@eunomia/elements 1.0.0-beta.7 → 1.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/components/chunks/{chunk-3PNGQEG4.js → chunk-32L2QYWQ.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-Z3OFIE7S.js → chunk-3UUZM7X2.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-BVASCT2V.js → chunk-55PUDL7D.js} +13 -13
- package/dist/cdn/components/chunks/chunk-5LA5DQMP.js +1 -0
- package/dist/cdn/components/chunks/chunk-5LXGJVJR.js +1 -0
- package/dist/cdn/components/chunks/chunk-6TIEBY34.js +1 -0
- package/dist/cdn/components/chunks/{chunk-LVKMAHMU.js → chunk-AH2SKZ7T.js} +4 -1
- package/dist/cdn/components/chunks/chunk-JAGZL7JH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-DGI7TKCU.js → chunk-LD35BFNK.js} +5 -9
- package/dist/cdn/components/chunks/chunk-P6LGU3FT.js +1 -0
- package/dist/cdn/components/chunks/{chunk-UYZR4JXZ.js → chunk-QSZO4GIH.js} +45 -9
- package/dist/cdn/components/chunks/{chunk-PXF554MD.js → chunk-QYB6Z6FG.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-RIFF2D2F.js → chunk-RGC3I6MK.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-N6ZW5CDN.js → chunk-TCSB2MLU.js} +1 -1
- package/dist/cdn/components/chunks/chunk-WIUERJII.js +1 -0
- package/dist/cdn/components/eun-animate.js +4 -4
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-carousel.js +10 -9
- package/dist/cdn/components/eun-chip.js +17 -11
- package/dist/cdn/components/eun-collapse.js +1 -1
- package/dist/cdn/components/eun-color-picker.js +18 -5
- package/dist/cdn/components/eun-counter.js +10 -8
- package/dist/cdn/components/eun-date-picker.js +46 -43
- package/dist/cdn/components/eun-drawer.js +19 -20
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +3 -3
- package/dist/cdn/components/eun-fab.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +4 -4
- package/dist/cdn/components/eun-input-phone.js +11 -8
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +59 -13
- package/dist/cdn/components/eun-modal.js +23 -13
- package/dist/cdn/components/eun-scheduler-event-editor.js +1 -1
- package/dist/cdn/components/eun-search.js +34 -28
- package/dist/cdn/components/eun-select.js +3 -3
- package/dist/cdn/components/eun-sidebar.js +66 -21
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-stepper.js +16 -16
- package/dist/cdn/components/eun-tab-panel.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +2 -2
- package/dist/cdn/components/eun-textarea.js +16 -13
- package/dist/cdn/components/eun-time-picker.js +25 -23
- package/dist/cdn/components/eun-toast.js +8 -8
- package/dist/cdn/components/eun-toggle-group.js +71 -35
- package/dist/cdn/components/eun-toggle-item.js +8 -8
- package/dist/cdn/components/eun-toolbar.js +20 -20
- package/dist/cdn/components/eun-tooltip.js +6 -6
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/components/action/button/button.d.ts +2 -2
- package/dist/components/action/button/button.js +3 -7
- package/dist/components/action/button/button.styles.js +3 -3
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -6
- package/dist/components/action/dropdown-button/dropdown-button.js +6 -8
- package/dist/components/action/dropdown-button/dropdown-item.d.ts +10 -2
- package/dist/components/action/dropdown-button/dropdown-item.js +24 -9
- package/dist/components/action/link/link.d.ts +10 -1
- package/dist/components/action/link/link.js +13 -1
- package/dist/components/action/link/link.styles.js +50 -3
- package/dist/components/action/toggle/toggle-group.d.ts +12 -2
- package/dist/components/action/toggle/toggle-group.js +17 -2
- package/dist/components/action/toggle/toggle-group.styles.js +54 -18
- package/dist/components/action/toggle/toggle-item.js +1 -3
- package/dist/components/action/toggle/toggle-item.styles.js +7 -7
- package/dist/components/alert/drawer/drawer.d.ts +25 -0
- package/dist/components/alert/drawer/drawer.js +42 -3
- package/dist/components/alert/drawer/drawer.styles.js +6 -6
- package/dist/components/alert/modal/modal.d.ts +25 -0
- package/dist/components/alert/modal/modal.js +42 -3
- package/dist/components/alert/modal/modal.styles.js +17 -6
- package/dist/components/alert/toast/toast.js +3 -2
- package/dist/components/alert/toast/toast.styles.js +3 -3
- package/dist/components/content/chip/chip.js +3 -2
- package/dist/components/content/chip/chip.styles.js +9 -3
- package/dist/components/content/image-carousel/image-carousel.js +5 -4
- package/dist/components/content/tooltip/tooltip.d.ts +16 -9
- package/dist/components/content/tooltip/tooltip.js +28 -12
- package/dist/components/content/tooltip/tooltip.styles.js +1 -1
- package/dist/components/form/color-picker/color-picker.d.ts +7 -1
- package/dist/components/form/color-picker/color-picker.js +8 -2
- package/dist/components/form/color-picker/color-picker.styles.js +13 -0
- package/dist/components/form/counter/counter.d.ts +3 -1
- package/dist/components/form/counter/counter.js +3 -1
- package/dist/components/form/counter/counter.styles.js +6 -4
- package/dist/components/form/date-picker/date-picker.d.ts +6 -1
- package/dist/components/form/date-picker/date-picker.js +7 -2
- package/dist/components/form/date-picker/date-picker.styles.js +9 -6
- package/dist/components/form/input/input.d.ts +6 -1
- package/dist/components/form/input/input.js +7 -2
- package/dist/components/form/input-phone/input-phone.d.ts +7 -1
- package/dist/components/form/input-phone/input-phone.js +7 -1
- package/dist/components/form/input-phone/input-phone.styles.js +6 -3
- package/dist/components/form/search/search.d.ts +64 -10
- package/dist/components/form/search/search.js +112 -31
- package/dist/components/form/search/search.styles.js +2 -0
- package/dist/components/form/select/select.d.ts +7 -1
- package/dist/components/form/select/select.js +7 -1
- package/dist/components/form/shared-styles/field.styles.js +45 -8
- package/dist/components/form/shared-styles/listbox.styles.js +5 -1
- package/dist/components/form/textarea/textarea.d.ts +1 -0
- package/dist/components/form/textarea/textarea.js +2 -1
- package/dist/components/form/textarea/textarea.styles.js +3 -0
- package/dist/components/form/time-picker/time-picker.d.ts +6 -1
- package/dist/components/form/time-picker/time-picker.js +7 -2
- package/dist/components/form/time-picker/time-picker.styles.js +7 -5
- package/dist/components/layout/animate/animate.js +2 -1
- package/dist/components/navigation/carousel/carousel.d.ts +1 -2
- package/dist/components/navigation/carousel/carousel.js +14 -6
- package/dist/components/navigation/carousel/carousel.styles.js +5 -4
- package/dist/components/navigation/sidebar/sidebar.d.ts +98 -52
- package/dist/components/navigation/sidebar/sidebar.js +140 -85
- package/dist/components/navigation/sidebar/sidebar.styles.d.ts +1 -1
- package/dist/components/navigation/sidebar/sidebar.styles.js +69 -21
- package/dist/components/navigation/stepper/stepper.d.ts +1 -3
- package/dist/components/navigation/stepper/stepper.js +3 -21
- package/dist/components/navigation/toolbar/toolbar.d.ts +10 -0
- package/dist/components/navigation/toolbar/toolbar.js +8 -1
- package/dist/components/navigation/toolbar/toolbar.styles.js +18 -17
- package/dist/events/select.event.d.ts +3 -2
- package/dist/events/select.event.js +2 -1
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +1 -1
- package/dist/features/table/table/table.js +1 -1
- package/dist/features/table/table-action-bar/table-action-bar.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/mixins/button.mixin.d.ts +1 -1
- package/dist/mixins/button.mixin.js +6 -4
- package/dist/mixins/dialog-surface.mixin.d.ts +8 -0
- package/dist/mixins/field-size.mixin.d.ts +19 -0
- package/dist/mixins/field-size.mixin.js +33 -0
- package/dist/mixins/rounded.mixin.d.ts +18 -0
- package/dist/mixins/rounded.mixin.js +32 -0
- package/dist/ssr/button-ssr.css +5 -5
- package/dist/ssr/carousel-ssr.css +9 -0
- package/dist/ssr/chip-ssr.css +8 -0
- package/dist/ssr/collapse-ssr.css +29 -0
- package/dist/ssr/field-ssr.css +43 -4
- package/dist/ssr/image-carousel-ssr.css +10 -0
- package/dist/ssr/links-ssr.css +38 -1
- package/dist/ssr/sidebar-ssr.css +95 -4
- package/dist/ssr/toggle-group-ssr.css +64 -13
- package/dist/ssr/toolbar-ssr.css +50 -0
- package/dist/types/variant.type.d.ts +4 -1
- package/dist/utils/boolean.utils.d.ts +14 -0
- package/dist/utils/boolean.utils.js +20 -0
- package/dist/utils/dropdown-menu.utils.d.ts +1 -1
- package/dist/utils/focusable-elements.utils.d.ts +12 -0
- package/dist/utils/focusable-elements.utils.js +26 -0
- package/dist/utils/input-modality.utils.d.ts +13 -0
- package/dist/utils/input-modality.utils.js +34 -0
- package/dist/utils/theme-generator.utils.d.ts +8 -2
- package/dist/utils/theme-generator.utils.js +30 -9
- package/package.json +1 -1
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/components/chunks/chunk-6VK6SHCG.js +0 -1
- package/dist/cdn/components/chunks/chunk-UDOZRIJZ.js +0 -1
|
@@ -52,7 +52,7 @@ export const EunomiaDropdownButtonTagName = "eun-dropdown-button";
|
|
|
52
52
|
* @prop {boolean} [fixedColor=false] - Keeps a light or dark trigger button white or black in every theme. Without it, they follow the grey scale, which flips with the active theme. Has no effect on the other colors
|
|
53
53
|
* @attr {boolean} [fixed-color=false] - Keeps a light or dark trigger button white or black in every theme. Without it, they follow the grey scale, which flips with the active theme. Has no effect on the other colors
|
|
54
54
|
* @prop {boolean} [rounded=false] - Whether the trigger button has fully rounded corners
|
|
55
|
-
* @prop {'
|
|
55
|
+
* @prop {'soft' | 'fill' | 'outline' | 'flat' | 'raised' | 'ghost'} [appearance='fill'] - The trigger button's surface style, using the same values as the button component
|
|
56
56
|
* @prop {EunomiaDropdownPlacement} [placement='bottom-start'] - Where the menu opens relative to the trigger
|
|
57
57
|
* @prop {boolean} [open=false] - Whether the menu is currently open. Read-only in practice (set from the menu's own native toggle handling), reflected as an attribute so a consumer's own CSS can select on it, e.g. to keep a hover-revealed trigger visible while its menu is open
|
|
58
58
|
* @attr {string} aria-label - The accessible label for the trigger button, required when it has no visible label or slotted content, such as an icon only trigger
|
|
@@ -112,10 +112,8 @@ let EunomiaDropdownButton = class EunomiaDropdownButton extends LitElement {
|
|
|
112
112
|
/**
|
|
113
113
|
* The trigger button's surface treatment, forwarded to the trigger
|
|
114
114
|
* `eun-button` — see its own `appearance` doc for the full list of
|
|
115
|
-
* values.
|
|
116
|
-
*
|
|
117
|
-
* lighter-weight control than a standalone primary action button.
|
|
118
|
-
* @default default
|
|
115
|
+
* values.
|
|
116
|
+
* @default fill
|
|
119
117
|
*/
|
|
120
118
|
this.appearance = "fill";
|
|
121
119
|
/**
|
|
@@ -371,7 +369,7 @@ let EunomiaDropdownButton = class EunomiaDropdownButton extends LitElement {
|
|
|
371
369
|
* The key of a direct menu entry, whichever mechanism produced it : an
|
|
372
370
|
* `options` entry's `<li>` carries it as `data-key` (see
|
|
373
371
|
* {@link renderOption}) ; a `eun-dropdown-item` carries it as its own
|
|
374
|
-
* `
|
|
372
|
+
* `value` property.
|
|
375
373
|
*
|
|
376
374
|
* @param entry the entry to read the key from.
|
|
377
375
|
* @private
|
|
@@ -380,7 +378,7 @@ let EunomiaDropdownButton = class EunomiaDropdownButton extends LitElement {
|
|
|
380
378
|
if (entry.tagName === "LI") {
|
|
381
379
|
return entry.dataset.key ?? null;
|
|
382
380
|
}
|
|
383
|
-
return entry.
|
|
381
|
+
return entry.value ?? null;
|
|
384
382
|
}
|
|
385
383
|
/**
|
|
386
384
|
* Closes whichever direct entry currently has its submenu open, unless
|
|
@@ -1055,7 +1053,7 @@ let EunomiaDropdownButton = class EunomiaDropdownButton extends LitElement {
|
|
|
1055
1053
|
}
|
|
1056
1054
|
const iconName = resolveIcon(this.icon, this.severity);
|
|
1057
1055
|
return iconName
|
|
1058
|
-
? html `<eun-icon slot="start" name=${iconName}
|
|
1056
|
+
? html `<eun-icon slot="start" name=${iconName}></eun-icon>`
|
|
1059
1057
|
: nothing;
|
|
1060
1058
|
}
|
|
1061
1059
|
/**
|
|
@@ -20,7 +20,8 @@ export declare const EunomiaDropdownItemTagName = "eun-dropdown-item";
|
|
|
20
20
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
21
21
|
* @slot submenu - Nested dropdown item elements, opened as this item's own submenu
|
|
22
22
|
* @csspart item - The item's own row (icon, label/description, submenu chevron), carrying its padding and hover/active background. Exposed for effects the item's CSS custom properties don't cover
|
|
23
|
-
* @prop {string}
|
|
23
|
+
* @prop {string} value - The key reported when this item is chosen
|
|
24
|
+
* @prop {string} key - Alias of value, kept for compatibility. Prefer value, since React and Vue reserve key and never pass it to the element
|
|
24
25
|
* @prop {string} label - The item's text content, if not using the default slot
|
|
25
26
|
* @prop {EunomiaIconName} icon - An optional leading icon
|
|
26
27
|
* @prop {string} description - Optional secondary text shown under the label or slotted content
|
|
@@ -49,7 +50,14 @@ export declare class EunomiaDropdownItem extends LitElement implements DropdownM
|
|
|
49
50
|
/**
|
|
50
51
|
* The key reported when this item is chosen.
|
|
51
52
|
*/
|
|
52
|
-
|
|
53
|
+
value: string;
|
|
54
|
+
/**
|
|
55
|
+
* Alias of {@link value}, kept for compatibility. React and Vue reserve
|
|
56
|
+
* `key` for list reconciliation and never pass it to the element, so
|
|
57
|
+
* `value` is the attribute to use from those frameworks.
|
|
58
|
+
*/
|
|
59
|
+
get key(): string;
|
|
60
|
+
set key(key: string);
|
|
53
61
|
/**
|
|
54
62
|
* The row's text content, if not using the default slot.
|
|
55
63
|
*/
|
|
@@ -28,7 +28,8 @@ export const EunomiaDropdownItemTagName = "eun-dropdown-item";
|
|
|
28
28
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
29
29
|
* @slot submenu - Nested dropdown item elements, opened as this item's own submenu
|
|
30
30
|
* @csspart item - The item's own row (icon, label/description, submenu chevron), carrying its padding and hover/active background. Exposed for effects the item's CSS custom properties don't cover
|
|
31
|
-
* @prop {string}
|
|
31
|
+
* @prop {string} value - The key reported when this item is chosen
|
|
32
|
+
* @prop {string} key - Alias of value, kept for compatibility. Prefer value, since React and Vue reserve key and never pass it to the element
|
|
32
33
|
* @prop {string} label - The item's text content, if not using the default slot
|
|
33
34
|
* @prop {EunomiaIconName} icon - An optional leading icon
|
|
34
35
|
* @prop {string} description - Optional secondary text shown under the label or slotted content
|
|
@@ -90,14 +91,14 @@ let EunomiaDropdownItem = class EunomiaDropdownItem extends LitElement {
|
|
|
90
91
|
if (toggleEvent.newState === "open") {
|
|
91
92
|
this.setAttribute("aria-expanded", "true");
|
|
92
93
|
this.toggleAttribute("data-submenu-open", true);
|
|
93
|
-
this.container?.notifySubmenuOpened(this.
|
|
94
|
+
this.container?.notifySubmenuOpened(this.value);
|
|
94
95
|
this.positionOwnSubmenu();
|
|
95
96
|
void this.updateComplete.then(() => focusEntryAt(this.submenuItems, 0));
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
99
|
this.setAttribute("aria-expanded", "false");
|
|
99
100
|
this.toggleAttribute("data-submenu-open", false);
|
|
100
|
-
this.container?.notifySubmenuClosed(this.
|
|
101
|
+
this.container?.notifySubmenuClosed(this.value);
|
|
101
102
|
this.closeOtherSubmenus(null);
|
|
102
103
|
};
|
|
103
104
|
/**
|
|
@@ -113,7 +114,7 @@ let EunomiaDropdownItem = class EunomiaDropdownItem extends LitElement {
|
|
|
113
114
|
this.toggleOwnSubmenu();
|
|
114
115
|
}
|
|
115
116
|
else {
|
|
116
|
-
this.container?.selectByKey(this.
|
|
117
|
+
this.container?.selectByKey(this.value);
|
|
117
118
|
}
|
|
118
119
|
};
|
|
119
120
|
/**
|
|
@@ -133,7 +134,7 @@ let EunomiaDropdownItem = class EunomiaDropdownItem extends LitElement {
|
|
|
133
134
|
? container
|
|
134
135
|
: undefined;
|
|
135
136
|
handleMenuKeydown(event, container.menuEntries, {
|
|
136
|
-
onSelect: () => container.selectByKey(this.
|
|
137
|
+
onSelect: () => container.selectByKey(this.value),
|
|
137
138
|
onOpenSubmenu: () => this.openSubmenu(),
|
|
138
139
|
onClose: parentItem
|
|
139
140
|
? () => {
|
|
@@ -184,6 +185,17 @@ let EunomiaDropdownItem = class EunomiaDropdownItem extends LitElement {
|
|
|
184
185
|
this.hasSubmenu = this.submenuItems.length > 0;
|
|
185
186
|
};
|
|
186
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Alias of {@link value}, kept for compatibility. React and Vue reserve
|
|
190
|
+
* `key` for list reconciliation and never pass it to the element, so
|
|
191
|
+
* `value` is the attribute to use from those frameworks.
|
|
192
|
+
*/
|
|
193
|
+
get key() {
|
|
194
|
+
return this.value;
|
|
195
|
+
}
|
|
196
|
+
set key(key) {
|
|
197
|
+
this.value = key;
|
|
198
|
+
}
|
|
187
199
|
/**
|
|
188
200
|
* The closest `eun-dropdown-button` or `eun-dropdown-item` ancestor this
|
|
189
201
|
* item delegates to. `null` when not (yet) placed inside one. Starts
|
|
@@ -267,7 +279,7 @@ let EunomiaDropdownItem = class EunomiaDropdownItem extends LitElement {
|
|
|
267
279
|
}
|
|
268
280
|
clearTimeout(this.openSubmenuTimer);
|
|
269
281
|
clearTimeout(this.closeSubmenuTimer);
|
|
270
|
-
this.container?.closeOtherSubmenus(this.
|
|
282
|
+
this.container?.closeOtherSubmenus(this.value);
|
|
271
283
|
if (opening) {
|
|
272
284
|
submenu.showPopover();
|
|
273
285
|
}
|
|
@@ -357,7 +369,7 @@ let EunomiaDropdownItem = class EunomiaDropdownItem extends LitElement {
|
|
|
357
369
|
}
|
|
358
370
|
if (this.openChildKey) {
|
|
359
371
|
this.submenuItems
|
|
360
|
-
.find((item) => item.
|
|
372
|
+
.find((item) => item.value === this.openChildKey)
|
|
361
373
|
?.repositionSubmenu();
|
|
362
374
|
}
|
|
363
375
|
}
|
|
@@ -384,7 +396,7 @@ let EunomiaDropdownItem = class EunomiaDropdownItem extends LitElement {
|
|
|
384
396
|
return;
|
|
385
397
|
}
|
|
386
398
|
this.submenuItems
|
|
387
|
-
.find((item) => item.
|
|
399
|
+
.find((item) => item.value === this.openChildKey)
|
|
388
400
|
?.closeSubmenu();
|
|
389
401
|
this.openChildKey = null;
|
|
390
402
|
}
|
|
@@ -515,7 +527,10 @@ let EunomiaDropdownItem = class EunomiaDropdownItem extends LitElement {
|
|
|
515
527
|
EunomiaDropdownItem.styles = dropdownItemStyles;
|
|
516
528
|
__decorate([
|
|
517
529
|
property({ reflect: true })
|
|
518
|
-
], EunomiaDropdownItem.prototype, "
|
|
530
|
+
], EunomiaDropdownItem.prototype, "value", void 0);
|
|
531
|
+
__decorate([
|
|
532
|
+
property({ attribute: "key" })
|
|
533
|
+
], EunomiaDropdownItem.prototype, "key", null);
|
|
519
534
|
__decorate([
|
|
520
535
|
property()
|
|
521
536
|
], EunomiaDropdownItem.prototype, "label", void 0);
|
|
@@ -20,13 +20,14 @@ declare const EunomiaLink_base: import("../../../utils/constructor.type.js").Con
|
|
|
20
20
|
* it the same way, through the anchor's aria-description.
|
|
21
21
|
*
|
|
22
22
|
* @slot [default] - The link content, or a native anchor carrying the href itself when href is unset
|
|
23
|
-
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element, such as an icon from another set. Falls back to icon when empty. The icon is decorative : the focus ring surrounds the text only
|
|
23
|
+
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element, such as an icon from another set. Falls back to icon when empty. The icon is decorative : the focus ring surrounds the text only, unless the link is block
|
|
24
24
|
* @prop {string} href - The destination URL
|
|
25
25
|
* @prop {'_blank' | '_self' | '_parent' | '_top'} [target='_self'] - Where to open the linked URL. Opening in a new tab automatically adds an external link icon at the end and announces it to assistive technology, in the current locale
|
|
26
26
|
* @prop {import('../../content/icon/icon.type.js').EunomiaIconName} icon - An optional decorative icon displayed to the left of the link
|
|
27
27
|
* @prop {'light' | 'dark'} [theme='light'] - The text color theme. Use dark on a dark background, such as --eun-surface-inverse, where it takes the --eun-text-on-inverse colors
|
|
28
28
|
* @prop {'auto' | 'off' | 'on'} [visitedStyle='auto'] - Controls the visited state color. Auto follows the browser's real navigation history, off always renders as unvisited, and on always renders as visited
|
|
29
29
|
* @prop {boolean} [current=false] - Marks the link as the current page: it renders with aria-current="page" and keeps the --link-color-current color in every state (hover, focus, visited), for example an active item in a navigation
|
|
30
|
+
* @prop {boolean} [block=false] - Makes the link fill the width of its container, the whole row taking the hover, the focus ring and the click, even with an icon, for example an item of a vertical navigation. The label stays on one line, cut with an ellipsis when it doesn't fit
|
|
30
31
|
* @prop {string} [locale] - The locale used to resolve the "opens in a new tab" announcement. Defaults to the one set with setDefaultLocale, English otherwise
|
|
31
32
|
* @attr {string} aria-label - An accessible label that overrides the link content. When the link also opens in a new tab, a note announcing it is appended automatically. Ignored with a slotted anchor, which takes it instead
|
|
32
33
|
* @fires {NavigationEvent} eunnavigate - Fired before following the link, so a client-side router can intercept the navigation. Cancelable
|
|
@@ -45,6 +46,7 @@ declare const EunomiaLink_base: import("../../../utils/constructor.type.js").Con
|
|
|
45
46
|
* @cssprop [--link-padding-block] - Sets the vertical padding, as one length applied to both sides. Ignored when --link-padding is set
|
|
46
47
|
* @cssprop [--link-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --link-padding is set
|
|
47
48
|
* @cssprop [--link-background] - Sets a persistent background color behind the link. Defaults to transparent
|
|
49
|
+
* @cssprop [--link-background-hover] - Sets a background color shown while the link is hovered, falling back to --link-background when unset
|
|
48
50
|
* @cssprop [--link-background-focus] - Sets a background color shown while the link is keyboard-focused, falling back to --link-background when unset
|
|
49
51
|
* @cssprop [--link-border-radius] - Sets the corner radius of the link's own background/focus outline box
|
|
50
52
|
* @cssstate focus-visible - Set while the link is keyboard-focused (never after a mouse click), so it can be styled from outside the shadow root with eun-link:state(focus-visible). Turbopack's CSS parser (lightningcss) doesn't recognize :state() yet and rejects the whole stylesheet it's in ; ship that rule as a runtime <style>/<link> instead until it's supported
|
|
@@ -108,6 +110,13 @@ export declare class EunomiaLink extends EunomiaLink_base {
|
|
|
108
110
|
* @default false
|
|
109
111
|
*/
|
|
110
112
|
current: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Fills the width of the container, the whole row taking the hover, the
|
|
115
|
+
* focus ring and the click, even with an icon : for a navigation item.
|
|
116
|
+
* The label stays on one line, cut with an ellipsis when it doesn't fit.
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
block: boolean;
|
|
111
120
|
/**
|
|
112
121
|
* React's server renderer writes a custom element's camelCase prop as an
|
|
113
122
|
* attribute of that exact name, lowercased (`visitedStyle="off"` becomes
|
|
@@ -43,13 +43,14 @@ export const EunomiaLinkTagName = "eun-link";
|
|
|
43
43
|
* it the same way, through the anchor's aria-description.
|
|
44
44
|
*
|
|
45
45
|
* @slot [default] - The link content, or a native anchor carrying the href itself when href is unset
|
|
46
|
-
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element, such as an icon from another set. Falls back to icon when empty. The icon is decorative : the focus ring surrounds the text only
|
|
46
|
+
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element, such as an icon from another set. Falls back to icon when empty. The icon is decorative : the focus ring surrounds the text only, unless the link is block
|
|
47
47
|
* @prop {string} href - The destination URL
|
|
48
48
|
* @prop {'_blank' | '_self' | '_parent' | '_top'} [target='_self'] - Where to open the linked URL. Opening in a new tab automatically adds an external link icon at the end and announces it to assistive technology, in the current locale
|
|
49
49
|
* @prop {import('../../content/icon/icon.type.js').EunomiaIconName} icon - An optional decorative icon displayed to the left of the link
|
|
50
50
|
* @prop {'light' | 'dark'} [theme='light'] - The text color theme. Use dark on a dark background, such as --eun-surface-inverse, where it takes the --eun-text-on-inverse colors
|
|
51
51
|
* @prop {'auto' | 'off' | 'on'} [visitedStyle='auto'] - Controls the visited state color. Auto follows the browser's real navigation history, off always renders as unvisited, and on always renders as visited
|
|
52
52
|
* @prop {boolean} [current=false] - Marks the link as the current page: it renders with aria-current="page" and keeps the --link-color-current color in every state (hover, focus, visited), for example an active item in a navigation
|
|
53
|
+
* @prop {boolean} [block=false] - Makes the link fill the width of its container, the whole row taking the hover, the focus ring and the click, even with an icon, for example an item of a vertical navigation. The label stays on one line, cut with an ellipsis when it doesn't fit
|
|
53
54
|
* @prop {string} [locale] - The locale used to resolve the "opens in a new tab" announcement. Defaults to the one set with setDefaultLocale, English otherwise
|
|
54
55
|
* @attr {string} aria-label - An accessible label that overrides the link content. When the link also opens in a new tab, a note announcing it is appended automatically. Ignored with a slotted anchor, which takes it instead
|
|
55
56
|
* @fires {NavigationEvent} eunnavigate - Fired before following the link, so a client-side router can intercept the navigation. Cancelable
|
|
@@ -68,6 +69,7 @@ export const EunomiaLinkTagName = "eun-link";
|
|
|
68
69
|
* @cssprop [--link-padding-block] - Sets the vertical padding, as one length applied to both sides. Ignored when --link-padding is set
|
|
69
70
|
* @cssprop [--link-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --link-padding is set
|
|
70
71
|
* @cssprop [--link-background] - Sets a persistent background color behind the link. Defaults to transparent
|
|
72
|
+
* @cssprop [--link-background-hover] - Sets a background color shown while the link is hovered, falling back to --link-background when unset
|
|
71
73
|
* @cssprop [--link-background-focus] - Sets a background color shown while the link is keyboard-focused, falling back to --link-background when unset
|
|
72
74
|
* @cssprop [--link-border-radius] - Sets the corner radius of the link's own background/focus outline box
|
|
73
75
|
* @cssstate focus-visible - Set while the link is keyboard-focused (never after a mouse click), so it can be styled from outside the shadow root with eun-link:state(focus-visible). Turbopack's CSS parser (lightningcss) doesn't recognize :state() yet and rejects the whole stylesheet it's in ; ship that rule as a runtime <style>/<link> instead until it's supported
|
|
@@ -111,6 +113,13 @@ let EunomiaLink = class EunomiaLink extends LocalizableMixin(LitElement) {
|
|
|
111
113
|
* @default false
|
|
112
114
|
*/
|
|
113
115
|
this.current = false;
|
|
116
|
+
/**
|
|
117
|
+
* Fills the width of the container, the whole row taking the hover, the
|
|
118
|
+
* focus ring and the click, even with an icon : for a navigation item.
|
|
119
|
+
* The label stays on one line, cut with an ellipsis when it doesn't fit.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
this.block = false;
|
|
114
123
|
/**
|
|
115
124
|
* The anchor {@link current} was last mirrored onto, so its
|
|
116
125
|
* `aria-current` can be cleared once it's swapped out or removed.
|
|
@@ -373,6 +382,9 @@ __decorate([
|
|
|
373
382
|
__decorate([
|
|
374
383
|
property({ type: Boolean, reflect: true })
|
|
375
384
|
], EunomiaLink.prototype, "current", void 0);
|
|
385
|
+
__decorate([
|
|
386
|
+
property({ type: Boolean, reflect: true })
|
|
387
|
+
], EunomiaLink.prototype, "block", void 0);
|
|
376
388
|
__decorate([
|
|
377
389
|
queryAssignedElements({ slot: "icon" })
|
|
378
390
|
], EunomiaLink.prototype, "iconSlotEls", void 0);
|
|
@@ -19,6 +19,7 @@ import { css } from "lit";
|
|
|
19
19
|
* [--link-padding-block] - Set a custom vertical padding, as one length applied to both sides. Ignored when --link-padding is set
|
|
20
20
|
* [--link-padding-inline] - Set a custom horizontal padding, as one length applied to both sides. Ignored when --link-padding is set
|
|
21
21
|
* [--link-background] - Set a persistent background color behind the link. Defaults to transparent
|
|
22
|
+
* [--link-background-hover] - Set a background color shown while the link is hovered, falling back to --link-background when unset
|
|
22
23
|
* [--link-background-focus] - Set a background color shown while the link is keyboard-focused, falling back to --link-background when unset
|
|
23
24
|
* [--link-border-radius] - Set a custom corner radius for the link's own background/focus outline box
|
|
24
25
|
*/
|
|
@@ -80,7 +81,7 @@ const base = css `
|
|
|
80
81
|
#label {
|
|
81
82
|
border-radius: var(--link-border-radius, var(--eun-border-radius-m, 8px));
|
|
82
83
|
outline: 2px solid transparent;
|
|
83
|
-
transition: outline var(--_duration) var(--eun-easing-out, ease-out);
|
|
84
|
+
transition: outline-color var(--_duration) var(--eun-easing-out, ease-out);
|
|
84
85
|
}
|
|
85
86
|
#external-link-icon {
|
|
86
87
|
display: inline-flex;
|
|
@@ -107,9 +108,15 @@ const base = css `
|
|
|
107
108
|
transition:
|
|
108
109
|
color var(--_duration) var(--eun-easing-out, ease-out),
|
|
109
110
|
background-color var(--_duration) var(--eun-easing-out, ease-out),
|
|
110
|
-
outline var(--_duration) var(--eun-easing-out, ease-out),
|
|
111
|
+
outline-color var(--_duration) var(--eun-easing-out, ease-out),
|
|
111
112
|
text-decoration-color var(--_duration) var(--eun-easing-out, ease-out);
|
|
112
113
|
}
|
|
114
|
+
#link:hover {
|
|
115
|
+
background: var(
|
|
116
|
+
--link-background-hover,
|
|
117
|
+
var(--link-background, transparent)
|
|
118
|
+
);
|
|
119
|
+
}
|
|
113
120
|
#link:visited {
|
|
114
121
|
color: var(--_colorVisited);
|
|
115
122
|
text-decoration-color: var(--_colorVisited);
|
|
@@ -189,6 +196,9 @@ const base = css `
|
|
|
189
196
|
text-decoration: var(--_textDecoration);
|
|
190
197
|
text-wrap-style: pretty;
|
|
191
198
|
border-radius: var(--link-border-radius, var(--eun-border-radius-m, 8px));
|
|
199
|
+
/* Transparent before the icon outline below is drawn, so it never fades
|
|
200
|
+
in from currentColor once has-icon lands after the first render. */
|
|
201
|
+
outline-color: transparent;
|
|
192
202
|
transition:
|
|
193
203
|
color var(--_duration) var(--eun-easing-out, ease-out),
|
|
194
204
|
background-color var(--_duration) var(--eun-easing-out, ease-out),
|
|
@@ -234,7 +244,7 @@ const base = css `
|
|
|
234
244
|
transition:
|
|
235
245
|
color var(--_duration) var(--eun-easing-out, ease-out),
|
|
236
246
|
background-color var(--_duration) var(--eun-easing-out, ease-out),
|
|
237
|
-
outline var(--_duration) var(--eun-easing-out, ease-out),
|
|
247
|
+
outline-color var(--_duration) var(--eun-easing-out, ease-out),
|
|
238
248
|
text-decoration-color var(--_duration) var(--eun-easing-out, ease-out);
|
|
239
249
|
}
|
|
240
250
|
#link.has-icon ::slotted(a:focus-visible) {
|
|
@@ -269,6 +279,43 @@ const base = css `
|
|
|
269
279
|
--icon-color: var(--link-icon-color, var(--_colorCurrent));
|
|
270
280
|
}
|
|
271
281
|
|
|
282
|
+
:host([block]) {
|
|
283
|
+
display: flex;
|
|
284
|
+
width: 100%;
|
|
285
|
+
min-width: 0;
|
|
286
|
+
white-space: nowrap;
|
|
287
|
+
}
|
|
288
|
+
:host([block]) #link {
|
|
289
|
+
box-sizing: border-box;
|
|
290
|
+
flex: 1;
|
|
291
|
+
min-width: 0;
|
|
292
|
+
}
|
|
293
|
+
:host([block]) #link.has-icon:focus-visible,
|
|
294
|
+
:host([block]:state(focus-visible)) #link.slotted-link {
|
|
295
|
+
background: var(
|
|
296
|
+
--link-background-focus,
|
|
297
|
+
var(--link-background, transparent)
|
|
298
|
+
);
|
|
299
|
+
outline-color: var(--_colorFocus);
|
|
300
|
+
outline-offset: 2px;
|
|
301
|
+
}
|
|
302
|
+
:host([block]) #link.has-icon:focus-visible #label {
|
|
303
|
+
background: none;
|
|
304
|
+
outline-color: transparent;
|
|
305
|
+
}
|
|
306
|
+
:host([block]) #link.has-icon ::slotted(a:focus-visible) {
|
|
307
|
+
background: none;
|
|
308
|
+
outline-color: transparent;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
:host([block]) #label,
|
|
312
|
+
:host([block]) ::slotted(a) {
|
|
313
|
+
min-width: 0;
|
|
314
|
+
overflow: hidden;
|
|
315
|
+
text-overflow: ellipsis;
|
|
316
|
+
white-space: nowrap;
|
|
317
|
+
}
|
|
318
|
+
|
|
272
319
|
@media (prefers-reduced-motion: reduce) {
|
|
273
320
|
#link,
|
|
274
321
|
::slotted(a) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, PropertyValues, TemplateResult } from "lit";
|
|
2
2
|
import { EunomiaIconName } from "../../content/icon/icon.type.js";
|
|
3
3
|
import { ButtonColor } from "../../../mixins/button.mixin.js";
|
|
4
|
-
import { EunomiaToggleAppearance } from "../../../types/variant.type.js";
|
|
4
|
+
import { EunomiaSize, EunomiaToggleAppearance } from "../../../types/variant.type.js";
|
|
5
5
|
import type { EunomiaToggleItem } from "./toggle-item.js";
|
|
6
6
|
/**
|
|
7
7
|
* Tag name of the toggle group component.
|
|
@@ -42,7 +42,7 @@ export type EunomiaToggleGroupOption = {
|
|
|
42
42
|
*/
|
|
43
43
|
color?: ButtonColor;
|
|
44
44
|
};
|
|
45
|
-
declare const EunomiaToggleGroup_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/overflow-navigation.mixin.js").NavigationOverflowMixinInterface> & import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/disabled.mixin.js").DisabledMixinInterface> & typeof LitElement;
|
|
45
|
+
declare const EunomiaToggleGroup_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/overflow-navigation.mixin.js").NavigationOverflowMixinInterface> & import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/rounded.mixin.js").RoundedMixinInterface> & import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/disabled.mixin.js").DisabledMixinInterface> & typeof LitElement;
|
|
46
46
|
/**
|
|
47
47
|
* Groups toggle choices, declared through options, slotted toggle item
|
|
48
48
|
* elements, or both at once, into a single segmented control. The
|
|
@@ -76,6 +76,8 @@ declare const EunomiaToggleGroup_base: import("../../../utils/constructor.type.j
|
|
|
76
76
|
* @prop {Array<string>} value - The currently selected choices' values. Always exactly one entry in exclusive mode
|
|
77
77
|
* @prop {boolean} [single=false] - Forces the exclusive, sliding indicator mode regardless of choice count. Already the case for exactly two choices without setting this
|
|
78
78
|
* @prop {'default' | 'outline' | 'flat'} [appearance='default'] - The display shape used to render the group's choices
|
|
79
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The group size. A group and a button of the same size share the same height
|
|
80
|
+
* @prop {boolean} [rounded=false] - Whether the track and its options are fully rounded, as pills. A custom border radius still wins over it
|
|
79
81
|
* @prop {boolean} [disabled=false] - Whether the whole group is disabled
|
|
80
82
|
* @attr {string} [aria-label] - The accessible label for the group, required since the group has no visible legend of its own
|
|
81
83
|
* @fires {ChangeEvent} eunchange - Fired whenever the selection changes
|
|
@@ -135,6 +137,14 @@ export declare class EunomiaToggleGroup extends EunomiaToggleGroup_base {
|
|
|
135
137
|
* @default default
|
|
136
138
|
*/
|
|
137
139
|
appearance: EunomiaToggleGroupAppearance;
|
|
140
|
+
/**
|
|
141
|
+
* The group size, matching the button size of the same name : a group
|
|
142
|
+
* and a button of the same size stand at the same height. The default
|
|
143
|
+
* isn't reflected, so an SSR framework doesn't see an attribute it never
|
|
144
|
+
* rendered.
|
|
145
|
+
* @default m
|
|
146
|
+
*/
|
|
147
|
+
size: EunomiaSize;
|
|
138
148
|
/**
|
|
139
149
|
* Stretches the group to 100% of its parent's width, dividing that width
|
|
140
150
|
* equally between every choice instead of sizing to content. A label
|
|
@@ -21,6 +21,7 @@ import { html, LitElement, nothing } from "lit";
|
|
|
21
21
|
import { classMap } from "lit/directives/class-map.js";
|
|
22
22
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
23
23
|
import { DisabledMixin } from "../../../mixins/disabled.mixin.js";
|
|
24
|
+
import { RoundedMixin } from "../../../mixins/rounded.mixin.js";
|
|
24
25
|
import { NavigationOverflowMixin } from "../../../mixins/overflow-navigation.mixin.js";
|
|
25
26
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
26
27
|
import { debounce } from "../../../utils/time.utils.js";
|
|
@@ -67,6 +68,8 @@ export const EunomiaToggleGroupTagName = "eun-toggle-group";
|
|
|
67
68
|
* @prop {Array<string>} value - The currently selected choices' values. Always exactly one entry in exclusive mode
|
|
68
69
|
* @prop {boolean} [single=false] - Forces the exclusive, sliding indicator mode regardless of choice count. Already the case for exactly two choices without setting this
|
|
69
70
|
* @prop {'default' | 'outline' | 'flat'} [appearance='default'] - The display shape used to render the group's choices
|
|
71
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The group size. A group and a button of the same size share the same height
|
|
72
|
+
* @prop {boolean} [rounded=false] - Whether the track and its options are fully rounded, as pills. A custom border radius still wins over it
|
|
70
73
|
* @prop {boolean} [disabled=false] - Whether the whole group is disabled
|
|
71
74
|
* @attr {string} [aria-label] - The accessible label for the group, required since the group has no visible legend of its own
|
|
72
75
|
* @fires {ChangeEvent} eunchange - Fired whenever the selection changes
|
|
@@ -88,7 +91,7 @@ export const EunomiaToggleGroupTagName = "eun-toggle-group";
|
|
|
88
91
|
* @cssprop [--toggle-group-arrows-color] - Sets the background color the overflow arrows fade out to, once the group overflows its container
|
|
89
92
|
* @element eun-toggle-group
|
|
90
93
|
*/
|
|
91
|
-
let EunomiaToggleGroup = class EunomiaToggleGroup extends NavigationOverflowMixin(DisabledMixin(LitElement)) {
|
|
94
|
+
let EunomiaToggleGroup = class EunomiaToggleGroup extends NavigationOverflowMixin(RoundedMixin(DisabledMixin(LitElement))) {
|
|
92
95
|
constructor() {
|
|
93
96
|
super(...arguments);
|
|
94
97
|
/**
|
|
@@ -119,6 +122,14 @@ let EunomiaToggleGroup = class EunomiaToggleGroup extends NavigationOverflowMixi
|
|
|
119
122
|
* @default default
|
|
120
123
|
*/
|
|
121
124
|
this.appearance = "default";
|
|
125
|
+
/**
|
|
126
|
+
* The group size, matching the button size of the same name : a group
|
|
127
|
+
* and a button of the same size stand at the same height. The default
|
|
128
|
+
* isn't reflected, so an SSR framework doesn't see an attribute it never
|
|
129
|
+
* rendered.
|
|
130
|
+
* @default m
|
|
131
|
+
*/
|
|
132
|
+
this.size = "m";
|
|
122
133
|
/**
|
|
123
134
|
* Stretches the group to 100% of its parent's width, dividing that width
|
|
124
135
|
* equally between every choice instead of sizing to content. A label
|
|
@@ -231,6 +242,7 @@ let EunomiaToggleGroup = class EunomiaToggleGroup extends NavigationOverflowMixi
|
|
|
231
242
|
_changedProperties.has("options") ||
|
|
232
243
|
_changedProperties.has("single") ||
|
|
233
244
|
_changedProperties.has("appearance") ||
|
|
245
|
+
_changedProperties.has("size") ||
|
|
234
246
|
_changedProperties.has("full")) {
|
|
235
247
|
this.settleAndSync(true);
|
|
236
248
|
}
|
|
@@ -692,7 +704,7 @@ let EunomiaToggleGroup = class EunomiaToggleGroup extends NavigationOverflowMixi
|
|
|
692
704
|
@click=${() => this.activateValue(option.value)}
|
|
693
705
|
>
|
|
694
706
|
${option.icon
|
|
695
|
-
? html `<eun-icon name=${option.icon}
|
|
707
|
+
? html `<eun-icon name=${option.icon}></eun-icon>`
|
|
696
708
|
: nothing}
|
|
697
709
|
${iconOnly ? nothing : option.label}
|
|
698
710
|
</button>
|
|
@@ -752,6 +764,9 @@ __decorate([
|
|
|
752
764
|
__decorate([
|
|
753
765
|
property({ reflect: true, useDefault: true })
|
|
754
766
|
], EunomiaToggleGroup.prototype, "appearance", void 0);
|
|
767
|
+
__decorate([
|
|
768
|
+
property({ reflect: true, useDefault: true })
|
|
769
|
+
], EunomiaToggleGroup.prototype, "size", void 0);
|
|
755
770
|
__decorate([
|
|
756
771
|
property({ type: Boolean, reflect: true })
|
|
757
772
|
], EunomiaToggleGroup.prototype, "full", void 0);
|
|
@@ -33,20 +33,64 @@ export const toggleGroupStyles = css `
|
|
|
33
33
|
--toggle-group-arrows-color,
|
|
34
34
|
var(--eun-surface-color, #ffffff)
|
|
35
35
|
);
|
|
36
|
+
--_toggleDefaultRadius: var(--eun-border-radius-m, 8px);
|
|
37
|
+
--_toggleRadius: var(
|
|
38
|
+
--toggle-group-border-radius,
|
|
39
|
+
var(--_toggleDefaultRadius)
|
|
40
|
+
);
|
|
41
|
+
--_toggleFontSize: var(--eun-font-size-s, 14px);
|
|
42
|
+
--_toggleButtonPaddingBlock: var(--eun-space-s, 8px);
|
|
43
|
+
--_toggleOptionPaddingInline: calc(var(--eun-space-l, 32px) / 2);
|
|
44
|
+
--_toggleLineHeight: 1rem;
|
|
36
45
|
--_trackPaddingBlock: var(
|
|
37
46
|
--toggle-group-padding,
|
|
38
|
-
var(
|
|
47
|
+
var(
|
|
48
|
+
--toggle-group-padding-block,
|
|
49
|
+
calc(var(--_toggleButtonPaddingBlock) / 2)
|
|
50
|
+
)
|
|
39
51
|
);
|
|
40
52
|
--_trackPaddingInline: var(
|
|
41
53
|
--toggle-group-padding,
|
|
42
54
|
var(--toggle-group-padding-inline, 4px)
|
|
43
55
|
);
|
|
56
|
+
--_toggleOptionPaddingBlock: max(
|
|
57
|
+
0px,
|
|
58
|
+
calc(var(--_toggleButtonPaddingBlock) - var(--_trackPaddingBlock))
|
|
59
|
+
);
|
|
44
60
|
--_focusRoom: 0px;
|
|
45
61
|
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
46
|
-
font-size: var(--
|
|
62
|
+
font-size: var(--_toggleFontSize);
|
|
63
|
+
}
|
|
64
|
+
:host([rounded]) {
|
|
65
|
+
--_toggleDefaultRadius: var(--eun-border-radius-xl, 999px);
|
|
66
|
+
}
|
|
67
|
+
:host([size="xs"]) {
|
|
68
|
+
--_toggleFontSize: var(--eun-font-size-xs, 10px);
|
|
69
|
+
--_toggleButtonPaddingBlock: var(--eun-space-xxs, 1.6px);
|
|
70
|
+
--_toggleOptionPaddingInline: var(--eun-space-xs, 4px);
|
|
71
|
+
--_toggleLineHeight: 10px;
|
|
72
|
+
}
|
|
73
|
+
:host([size="s"]) {
|
|
74
|
+
--_toggleFontSize: var(--eun-font-size-xs, 10px);
|
|
75
|
+
--_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) / 2);
|
|
76
|
+
--_toggleOptionPaddingInline: var(--eun-space-s, 8px);
|
|
77
|
+
--_toggleLineHeight: 10px;
|
|
78
|
+
}
|
|
79
|
+
:host([size="l"]) {
|
|
80
|
+
--_toggleFontSize: var(--eun-font-size-m, 16px);
|
|
81
|
+
--_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) * 1.25);
|
|
82
|
+
--_toggleOptionPaddingInline: calc(var(--eun-space-m, 16px) * 1.25);
|
|
83
|
+
--_toggleLineHeight: 1.1rem;
|
|
84
|
+
}
|
|
85
|
+
:host([size="xl"]) {
|
|
86
|
+
--_toggleFontSize: var(--eun-font-size-l, 1.3rem);
|
|
87
|
+
--_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) * 1.5);
|
|
88
|
+
--_toggleOptionPaddingInline: calc(var(--eun-space-m, 16px) * 1.5);
|
|
89
|
+
--_toggleLineHeight: 1.3rem;
|
|
47
90
|
}
|
|
48
91
|
:host([appearance="outline"]),
|
|
49
92
|
:host([appearance="flat"]) {
|
|
93
|
+
--_toggleOptionPaddingBlock: var(--_toggleButtonPaddingBlock);
|
|
50
94
|
--_focusRoom: 4px;
|
|
51
95
|
--_arrowsColor: var(
|
|
52
96
|
--toggle-group-arrows-color,
|
|
@@ -74,10 +118,7 @@ export const toggleGroupStyles = css `
|
|
|
74
118
|
max-width: 100%;
|
|
75
119
|
gap: var(--toggle-group-gap, var(--eun-space-xs, 4px));
|
|
76
120
|
padding: var(--_trackPaddingBlock) var(--_trackPaddingInline);
|
|
77
|
-
border-radius: var(
|
|
78
|
-
--toggle-group-border-radius,
|
|
79
|
-
var(--eun-border-radius-m, 8px)
|
|
80
|
-
);
|
|
121
|
+
border-radius: var(--_toggleRadius);
|
|
81
122
|
background: var(
|
|
82
123
|
--toggle-group-background,
|
|
83
124
|
var(--eun-surface-sunken, #f7f8fa)
|
|
@@ -178,9 +219,7 @@ export const toggleGroupStyles = css `
|
|
|
178
219
|
width: 0;
|
|
179
220
|
opacity: 0;
|
|
180
221
|
z-index: 0;
|
|
181
|
-
border-radius: calc(
|
|
182
|
-
var(--toggle-group-border-radius, var(--eun-border-radius-m, 8px)) - 3px
|
|
183
|
-
);
|
|
222
|
+
border-radius: calc(var(--_toggleRadius) - 3px);
|
|
184
223
|
background: var(
|
|
185
224
|
--toggle-group-active-background,
|
|
186
225
|
var(--eun-color-primary-500, #3d6fff)
|
|
@@ -232,12 +271,12 @@ export const toggleGroupStyles = css `
|
|
|
232
271
|
border: none;
|
|
233
272
|
background: transparent;
|
|
234
273
|
color: var(--toggle-group-color, var(--eun-color-grey-600, #666e8a));
|
|
235
|
-
|
|
274
|
+
--icon-size: var(--_toggleLineHeight);
|
|
275
|
+
padding: var(--_toggleOptionPaddingBlock) var(--_toggleOptionPaddingInline);
|
|
276
|
+
line-height: var(--_toggleLineHeight);
|
|
236
277
|
font-weight: var(--eun-font-weight-m, 500);
|
|
237
278
|
outline: 2px solid transparent;
|
|
238
|
-
border-radius: calc(
|
|
239
|
-
var(--toggle-group-border-radius, var(--eun-border-radius-m, 8px)) - 3px
|
|
240
|
-
);
|
|
279
|
+
border-radius: calc(var(--_toggleRadius) - 3px);
|
|
241
280
|
box-shadow: var(--_boxShadow);
|
|
242
281
|
transition: var(
|
|
243
282
|
--_toggleTransition,
|
|
@@ -294,7 +333,7 @@ export const toggleGroupStyles = css `
|
|
|
294
333
|
}
|
|
295
334
|
button.icon-only {
|
|
296
335
|
justify-content: center;
|
|
297
|
-
padding:
|
|
336
|
+
padding: var(--_toggleOptionPaddingBlock);
|
|
298
337
|
}
|
|
299
338
|
|
|
300
339
|
button[data-color="secondary"] {
|
|
@@ -315,10 +354,7 @@ export const toggleGroupStyles = css `
|
|
|
315
354
|
}
|
|
316
355
|
:host([appearance="outline"]) button,
|
|
317
356
|
:host([appearance="flat"]) button {
|
|
318
|
-
border-radius: var(
|
|
319
|
-
--toggle-group-border-radius,
|
|
320
|
-
var(--eun-border-radius-m, 8px)
|
|
321
|
-
);
|
|
357
|
+
border-radius: var(--_toggleRadius);
|
|
322
358
|
}
|
|
323
359
|
:host([appearance="outline"]) button {
|
|
324
360
|
border: var(--eun-border-width-s, 1px) solid
|
|
@@ -105,9 +105,7 @@ let EunomiaToggleItem = class EunomiaToggleItem extends DisabledMixin(LitElement
|
|
|
105
105
|
return html `
|
|
106
106
|
<div id="item" part="item">
|
|
107
107
|
<slot name="icon">
|
|
108
|
-
${this.icon
|
|
109
|
-
? html `<eun-icon name=${this.icon} size="16"></eun-icon>`
|
|
110
|
-
: nothing}
|
|
108
|
+
${this.icon ? html `<eun-icon name=${this.icon}></eun-icon>` : nothing}
|
|
111
109
|
</slot>
|
|
112
110
|
<slot></slot>
|
|
113
111
|
</div>
|
|
@@ -28,15 +28,18 @@ export const toggleItemStyles = css `
|
|
|
28
28
|
display: inline-flex;
|
|
29
29
|
align-items: center;
|
|
30
30
|
gap: var(--eun-space-xs, 4px);
|
|
31
|
+
--icon-size: var(--_toggleLineHeight, 1rem);
|
|
31
32
|
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
32
|
-
font-size: var(--eun-font-size-s, 14px);
|
|
33
|
+
font-size: var(--_toggleFontSize, var(--eun-font-size-s, 14px));
|
|
34
|
+
line-height: var(--_toggleLineHeight, 1rem);
|
|
33
35
|
font-weight: var(--eun-font-weight-m, 500);
|
|
34
36
|
white-space: nowrap;
|
|
35
37
|
cursor: pointer;
|
|
36
38
|
color: var(--toggle-group-color, var(--eun-color-grey-600, #666e8a));
|
|
37
|
-
padding:
|
|
39
|
+
padding: var(--_toggleOptionPaddingBlock, calc(var(--eun-space-s, 8px) / 2))
|
|
40
|
+
var(--_toggleOptionPaddingInline, calc(var(--eun-space-l, 32px) / 2));
|
|
38
41
|
border-radius: calc(
|
|
39
|
-
var(--
|
|
42
|
+
var(--_toggleRadius, var(--eun-border-radius-m, 8px)) - 3px
|
|
40
43
|
);
|
|
41
44
|
outline: 2px solid transparent;
|
|
42
45
|
box-shadow: var(--_boxShadow);
|
|
@@ -116,10 +119,7 @@ export const toggleItemStyles = css `
|
|
|
116
119
|
}
|
|
117
120
|
:host([appearance="outline"]) #item,
|
|
118
121
|
:host([appearance="flat"]) #item {
|
|
119
|
-
border-radius: var(
|
|
120
|
-
--toggle-group-border-radius,
|
|
121
|
-
var(--eun-border-radius-m, 8px)
|
|
122
|
-
);
|
|
122
|
+
border-radius: var(--_toggleRadius, var(--eun-border-radius-m, 8px));
|
|
123
123
|
}
|
|
124
124
|
:host([appearance="outline"]) #item {
|
|
125
125
|
border: var(--eun-border-width-s, 1px) solid
|