From 4ac80d18c91e37bac1d51d5d42be236b6229e45f Mon Sep 17 00:00:00 2001 From: Arthur Khachatryan Date: Wed, 13 Nov 2024 13:16:59 -0800 Subject: [PATCH 1/2] feat(filter-menu): added search header --- dist/filter-menu/filter-menu.css | 34 +- src/modules/filter-menu.marko | 364 ++++++++++++++++++ src/sass/filter-menu/filter-menu.scss | 34 +- .../stories/filter-menu.stories.js | 89 +++++ 4 files changed, 519 insertions(+), 2 deletions(-) diff --git a/dist/filter-menu/filter-menu.css b/dist/filter-menu/filter-menu.css index 357c5b5f5..d9534c7b9 100644 --- a/dist/filter-menu/filter-menu.css +++ b/dist/filter-menu/filter-menu.css @@ -114,6 +114,38 @@ span.filter-menu__item[role^="menuitem"] { margin-bottom: 8px; } +.filter-menu__header { + align-items: center; + background-color: var(--color-background-secondary); + display: flex; + gap: var(--spacing-100); + padding: 14px var(--spacing-200); +} + +.filter-menu__header svg { + color: var(--color-foreground-secondary); +} + +.filter-menu__header input { + background-color: inherit; + border: none; + color: var(--color-foreground-primary); + flex-grow: 1; + font-size: var(--font-size-default); +} + +.filter-menu__header button { + border: none; + min-height: var(--spacing-250); + min-width: var(--spacing-250); + padding: 0; + width: var(--spacing-250); +} + +.filter-menu__header button:focus-visible { + outline-style: solid; +} + button.filter-menu-form__footer[type="submit"], button.filter-menu__footer { background-color: var( @@ -176,7 +208,7 @@ button.filter-menu__footer:hover { .filter-menu-form__text, .filter-menu__text { flex-grow: 1; - margin-left: 8px; + margin-inline-start: 8px; } .filter-menu__item[role="menuitemcheckbox"] svg.icon--checked, diff --git a/src/modules/filter-menu.marko b/src/modules/filter-menu.marko index ef400e0a6..451c17c38 100644 --- a/src/modules/filter-menu.marko +++ b/src/modules/filter-menu.marko @@ -703,6 +703,370 @@ + + + +

+ For multiple selection variation, you can also add an "Apply" button as a footer(to "apply" the selection(s)). +

+ +
+
+
+ + +
+
+
+ + + + + + + + +

+ Filter Menu with Header and Footer +

+ +

+ For multiple selection variation, you can also add a header to search the options. +

+ +
+
+
+
+ + + +
+ + +
+
+
+ + +
+
+ + + +
+ + +
+
+ export const metadata = { "ds-component": { diff --git a/src/sass/filter-menu/filter-menu.scss b/src/sass/filter-menu/filter-menu.scss index 0bc616251..167fadb9e 100644 --- a/src/sass/filter-menu/filter-menu.scss +++ b/src/sass/filter-menu/filter-menu.scss @@ -79,6 +79,38 @@ span.filter-menu-form__item { } } +.filter-menu__header { + align-items: center; + background-color: var(--color-background-secondary); + display: flex; + gap: var(--spacing-100); + padding: 14px var(--spacing-200); +} + +.filter-menu__header svg { + color: var(--color-foreground-secondary); +} + +.filter-menu__header input { + background-color: inherit; + border: none; + color: var(--color-foreground-primary); + flex-grow: 1; + font-size: var(--font-size-default); +} + +.filter-menu__header button { + border: none; + min-height: var(--spacing-250); + min-width: var(--spacing-250); + padding: 0; + width: var(--spacing-250); +} + +.filter-menu__header button:focus-visible { + outline-style: solid; +} + button.filter-menu__footer, button.filter-menu-form__footer[type="submit"] { @include filter-menu-item-base(); @@ -98,7 +130,7 @@ button.filter-menu-form__footer[type="submit"] { .filter-menu__text, .filter-menu-form__text { flex-grow: 1; - margin-left: 8px; + margin-inline-start: 8px; } .filter-menu__item[role="menuitemradio"] svg.icon--checked, diff --git a/src/sass/filter-menu/stories/filter-menu.stories.js b/src/sass/filter-menu/stories/filter-menu.stories.js index e8c1b4312..5b5acc79a 100644 --- a/src/sass/filter-menu/stories/filter-menu.stories.js +++ b/src/sass/filter-menu/stories/filter-menu.stories.js @@ -121,8 +121,81 @@ export const withFooterButton = () => ` `; +export const withHeaderSearch = () => ` + +
+ + + +
+ + +
+`; + export const textSpacing = () => ` +
+ + + +