Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DP-36147: Login links integration branch #1943

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 92 additions & 86 deletions package-lock.json

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions packages/assets/scss/02-molecules/_button-dropdown.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@use "00-base/configure" as *;

.ma__button-dropdown-wrapper {
position: relative;

&.is-open, &.is-open-react {

.ma__button-dropdown:after {
transform: translateY(-30%) rotate(-135deg);
}
}

.ma__button-dropdown {
@include ma-chevron;

&:after {
cursor: pointer;
transform: translateY(-30%) rotate(45deg);
transform-origin: 65% 65%;
transition: transform .5s;
}
}

.ma__button-dropdown__subitems {
position: absolute;
top: 100%;
left: 0;
box-shadow: 0 0.25em 0.5rem $c-box-shadow-black;
transition: visibility .5s ease, right .5s ease;
z-index: $z-overlay;
min-width: 340px;
max-width: 340px;
width: 100%;

&.is-open {
display: inline-block;
}
&.is-closed {
display: none !important;
}

&-container {
@include ma-reset-list;

background-color: $c-bg;
}
}

.ma__button-dropdown__subitem {
border-bottom: 1px solid;
border-bottom-color: $c-bd-divider;

.ma__button-dropdown__link {
@include ma-button-reset;
width: 100%;
text-align: left;
display: inline-block;
font-size: $fonts-small;
line-height: 1.33;
padding: 10px 20px;
font-weight: $fonts-normal;
word-break: break-word;

&:hover,
&:focus {
background-color: $c-bg-subtle;
}
}
}
}
19 changes: 9 additions & 10 deletions packages/assets/scss/03-organisms/_page-banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $textcolors: (
}
}


.ma__page-header {
margin-left: 0;
margin-right: 0;
Expand All @@ -51,19 +51,18 @@ $textcolors: (
&__container {
margin-left: auto;
margin-right: auto;
overflow: hidden;
display: flex;
flex-direction: column;
}

/* Style for the text content on the left side */

&__content {
display: flex;
align-items: center;
flex: 1.5; // width ratio to image 3:2
}

/* Style for the image on the right side */

&__image {
Expand All @@ -73,15 +72,15 @@ $textcolors: (
background-size: contain;
background-repeat: no-repeat;
}

@media ($bp-large-extended-min) {

&__container {
flex-direction: row;
align-items: stretch;
max-width: 1320px;
}

&__image {
flex: 1;
display: block;
Expand All @@ -90,7 +89,7 @@ $textcolors: (
min-height: 200px;
}
}

@media ($bp-x-large-min) {

&__image {
Expand All @@ -101,8 +100,8 @@ $textcolors: (
min-height: 200px;
}
}


@media ($bp-x-small-max) {

&__image {
Expand All @@ -111,4 +110,4 @@ $textcolors: (
width: 100%;
}
}
}
}
2 changes: 2 additions & 0 deletions packages/assets/scss/03-organisms/_page-header-addons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ $page-header-widget-width: 350px;

@include clearfix;

margin-top: 20px;


&__content {
padding: 0 0 30px;
Expand Down
1 change: 0 additions & 1 deletion packages/assets/scss/03-organisms/_page-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ $page-header-widget-width: 350px;
&-wrapper {
display: flex;
width: 100%;
margin-top: 1.5rem;

@media ($bp-medium-max) {
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

{% set buttonTheme = button.theme ? "ma__button--" ~ button.theme : "" %}

{% set buttonUppercaseOverride = button.uppercaseOverride ? "" : "ma__button--uppercase" %}
{% set buttonClass = button.class %}

{% set buttonUppercaseOverride = button ? "" : "ma__button--uppercase" %}

{% if button.href %}
<a
href="{{ button.href }}"
class="ma__button {{ buttonSize }} {{buttonTheme}} {{buttonUsage}} {{ buttonUppercaseOverride }}"
class="ma__button {{ buttonSize }} {{buttonTheme}} {{buttonUsage}} {{buttonClass}} {{ buttonUppercaseOverride }}"
{% if button.info %} title="{{ button.info }}"{% endif %}>
{{ button.text }}
{% if button.icon %}
Expand All @@ -19,7 +21,7 @@
{% else %}
<button
type="{{ button.type }}"
class="ma__button {{ buttonSize }} {{buttonTheme}} {{buttonUsage}} {{button.class}} {{ buttonUppercaseOverride }}"
class="ma__button {{ buttonSize }} {{buttonTheme}} {{buttonUsage}} {{buttonClass}} {{ buttonUppercaseOverride }}"
aria-label="{{ button.info }}">
{{ button.text }}
{% if button.icon %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"button": {
"id": "random-id",
"info": "",
"text": "Log in to...",
"size": "",
"theme": "c-primary",
"usage": "secondary",
"class": "ma__button-dropdown",
"menuId": "random-menu-id",
"items": [{
"href": "https://mass.gov",
"text": "Random text"
},{
"href": "https://mass.gov",
"text": "Random text 2"
},{
"href": "https://mass.gov",
"text": "Random text ver long super long text with second line"
}]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="ma__button-dropdown-wrapper js-button-dropdown">
{% set buttonClass = 'ma__button-dropdown js-button-dropdown-toggle' %}
{% include "@atoms/01-buttons/button.twig" with {
button: button|merge({
'class': 'ma__button-dropdown js-button-dropdown-toggle'
})
}
%}
<div class="ma__button-dropdown__subitems js-button-dropdown-content is-closed">
<ul id="{{ button.menuId }}" role="menu" aria-labelledby="{{ button.id }}" class="ma__button-dropdown__subitems-container">
{% for item in button.items %}
<li role="none" class="ma__button-dropdown__subitem">
<a role="menuitem" href="{{ item.href }}" class="ma__button-dropdown__link" tabindex="0">{{ item.text }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
"description": "This is an optional description. This is an optional description. This is an optional description. <a href=''>You can add a hyperlink in the description.</a>",
"buttonsLabel": "Button:",
"buttons": [{
"id": "random-id",
"info": "",
"text": "Button",
"size": "small",
"theme": "c-primary",
"usage": "secondary",
"class": "ma__button-dropdown",
"menuId": "random-menu-id",
"items": [{
"href": "https://mass.gov",
"text": "Random text"
},{
"href": "https://mass.gov",
"text": "Random text 2"
}]
}, {
"href": "#",
"text": "Button 1",
"size": "small",
Expand Down Expand Up @@ -50,15 +66,15 @@
"placeholder": {
"text": "Optional Content"
}
}
}
}],
"widgets": [{
"path": "@base/placeholder.twig",
"data": {
"placeholder": {
"text": "Optional widgets"
}
}
}
}]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
<ul class="ma__page-header__buttons">
{% for button in pageHeader.buttons %}
<li class="ma__page-header__button">
{% if button.items %}
{% include "@molecules/button-dropdown.twig" %}
{% else %}
{% include "@atoms/01-buttons/button.twig" %}
{% endif %}
</li>
{% endfor %}
</ul>
Expand Down
1 change: 1 addition & 0 deletions packages/patternlab/styleguide/source/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import inlineLinksLanguageToggle from "./modules/inlineLinksLanguageToggle.js";
import listAfterFloat from "./modules/listAfterFloat.js";
import locationListingLeaflet from "./modules/locationListingLeaflet.js";
import locationFiltersLeaflet from "./modules/locationFiltersLeaflet.js";
import buttonDropdown from "./modules/buttonDropdown.js";
import mainNav from "./modules/mainNav.js";
import mainNavHamburger from "./modules/mainNavHamburger.js";
import mainNavMIxed from "./modules/mainNavMixed.js";
Expand Down
Loading