@lmvz-ds/components 0.34.0 → 0.35.1
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/CHANGELOG.md +12 -0
- package/README.md +10 -0
- package/cjs/{async.util-BQ60l-WC.js → async.util-Dnl6c82X.js} +1 -0
- package/cjs/{list-keyboard-controller-Dm5S_l0D.js → directional-focus-controller-DBat-oF7.js} +13 -1
- package/cjs/element-activation-controller-BHqCUgQv.js +57 -0
- package/cjs/{element.util-Dbyc8yUG.js → element.util-CRS_YJ59.js} +10 -2
- package/cjs/lmvz-action-list.cjs.entry.js +9 -6
- package/cjs/lmvz-action.cjs.entry.js +1 -1
- package/cjs/lmvz-button-group.cjs.entry.js +1 -1
- package/cjs/lmvz-button_2.cjs.entry.js +6 -7
- package/cjs/lmvz-card.cjs.entry.js +1 -1
- package/cjs/lmvz-checkbox.cjs.entry.js +2 -2
- package/cjs/lmvz-chip.cjs.entry.js +2 -2
- package/cjs/lmvz-components.cjs.js +1 -1
- package/cjs/lmvz-header_2.cjs.entry.js +10 -7
- package/cjs/lmvz-input.cjs.entry.js +4 -4
- package/cjs/lmvz-link.cjs.entry.js +1 -1
- package/cjs/lmvz-menuitem.cjs.entry.js +3 -2
- package/cjs/lmvz-message.cjs.entry.js +43 -10
- package/cjs/lmvz-modal.cjs.entry.js +4 -4
- package/cjs/lmvz-popover.cjs.entry.js +48 -28
- package/cjs/lmvz-radio.cjs.entry.js +2 -2
- package/cjs/lmvz-select.cjs.entry.js +2 -2
- package/cjs/lmvz-snackbar.cjs.entry.js +1 -1
- package/cjs/lmvz-tab.cjs.entry.js +1 -1
- package/cjs/lmvz-tabs.cjs.entry.js +10 -7
- package/cjs/lmvz-toggle.cjs.entry.js +4 -4
- package/cjs/loader.cjs.js +1 -1
- package/{esm/reactive-controller-host-FBuCCcFC.js → cjs/reactive-controller-host-Bc6B_T45.js} +19 -1
- package/cjs/{stencil.util-DxdYjVoH.js → stencil.util-CBrPLd-F.js} +1 -1
- package/collection/components/lmvz-action/lmvz-action.js +1 -1
- package/collection/components/lmvz-action-list/lmvz-action-list.css +7 -7
- package/collection/components/lmvz-action-list/lmvz-action-list.js +26 -2
- package/collection/components/lmvz-button/lmvz-button.css +7 -7
- package/collection/components/lmvz-button/lmvz-button.js +1 -2
- package/collection/components/lmvz-card/lmvz-card.css +10 -10
- package/collection/components/lmvz-checkbox/lmvz-checkbox.css +8 -8
- package/collection/components/lmvz-chip/lmvz-chip.css +20 -20
- package/collection/components/lmvz-header/lmvz-header.css +3 -3
- package/collection/components/lmvz-header/lmvz-header.js +26 -2
- package/collection/components/lmvz-icon/lmvz-icon.css +1 -1
- package/collection/components/lmvz-input/lmvz-input.css +3 -3
- package/collection/components/lmvz-link/lmvz-link.css +6 -4
- package/collection/components/lmvz-message/lmvz-message.css +5 -5
- package/collection/components/lmvz-message/lmvz-message.js +42 -9
- package/collection/components/lmvz-modal/lmvz-modal.css +5 -5
- package/collection/components/lmvz-modal/lmvz-modal.js +1 -1
- package/collection/components/lmvz-modal/test/testing.js +36 -0
- package/collection/components/lmvz-popover/lmvz-popover.js +55 -28
- package/collection/components/lmvz-radio/lmvz-radio.css +9 -9
- package/collection/components/lmvz-select/lmvz-select.css +5 -5
- package/collection/components/lmvz-snackbar/lmvz-snackbar.css +13 -13
- package/collection/components/lmvz-tab/lmvz-tab.css +9 -9
- package/collection/components/lmvz-tabs/lmvz-tabs.css +2 -2
- package/collection/components/lmvz-tabs/lmvz-tabs.js +22 -2
- package/collection/components/lmvz-toggle/lmvz-toggle.css +3 -3
- package/collection/utils/aria/{list-keyboard-controller.js → directional-focus-controller.js} +11 -0
- package/collection/utils/aria/element-activation-controller.js +27 -11
- package/collection/utils/data/{event.utilt.js → event.util.js} +8 -0
- package/collection/utils/element/element.util.js +9 -2
- package/collection/utils/stencil/reactive-controller-host.js +14 -0
- package/components/index.js +1 -1
- package/components/lmvz-action-list.js +1 -1
- package/components/lmvz-action.js +1 -1
- package/components/lmvz-button-group.js +1 -1
- package/components/lmvz-button.js +1 -1
- package/components/lmvz-card.js +1 -1
- package/components/lmvz-checkbox.js +1 -1
- package/components/lmvz-chip.js +1 -1
- package/components/lmvz-header.js +1 -1
- package/components/lmvz-icon.js +1 -1
- package/components/lmvz-input.js +1 -1
- package/components/lmvz-link.js +1 -1
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-message.js +1 -1
- package/components/lmvz-modal.js +1 -1
- package/components/lmvz-popover.js +1 -1
- package/components/lmvz-radio.js +1 -1
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-snackbar.js +1 -1
- package/components/lmvz-tab.js +1 -1
- package/components/lmvz-tabs.js +1 -1
- package/components/lmvz-toggle.js +1 -1
- package/components/p-BVzxNP7h.js +1 -0
- package/components/p-CgK6-SEe.js +1 -0
- package/components/{p-De-xQqdU.js → p-Chj7BuUZ.js} +1 -1
- package/components/p-CxLd309t.js +1 -0
- package/components/{p-D7S1WiEC.js → p-D5FL8n1q.js} +1 -1
- package/components/p-DLUsBYJH.js +1 -0
- package/components/p-DZj20TV1.js +1 -0
- package/components/p-bh9cItsP.js +1 -0
- package/components/p-zMWemcoB.js +1 -0
- package/esm/{async.util-D9nUtvTm.js → async.util-DZj20TV1.js} +1 -1
- package/esm/{list-keyboard-controller-tle6IRkv.js → directional-focus-controller-DgAdCZrG.js} +13 -2
- package/esm/element-activation-controller-7PNSl6io.js +54 -0
- package/esm/{element.util-B0eCxdyI.js → element.util-BFcYfHYq.js} +10 -3
- package/esm/lmvz-action-list.entry.js +8 -5
- package/esm/lmvz-action.entry.js +1 -1
- package/esm/lmvz-button-group.entry.js +1 -1
- package/esm/lmvz-button_2.entry.js +6 -7
- package/esm/lmvz-card.entry.js +1 -1
- package/esm/lmvz-checkbox.entry.js +2 -2
- package/esm/lmvz-chip.entry.js +2 -2
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-header_2.entry.js +9 -6
- package/esm/lmvz-input.entry.js +4 -4
- package/esm/lmvz-link.entry.js +1 -1
- package/esm/lmvz-menuitem.entry.js +3 -2
- package/esm/lmvz-message.entry.js +43 -10
- package/esm/lmvz-modal.entry.js +4 -4
- package/esm/lmvz-popover.entry.js +48 -28
- package/esm/lmvz-radio.entry.js +2 -2
- package/esm/lmvz-select.entry.js +2 -2
- package/esm/lmvz-snackbar.entry.js +1 -1
- package/esm/lmvz-tab.entry.js +1 -1
- package/esm/lmvz-tabs.entry.js +8 -5
- package/esm/lmvz-toggle.entry.js +4 -4
- package/esm/loader.js +1 -1
- package/{cjs/reactive-controller-host-B_lZtcA6.js → esm/reactive-controller-host-CICeIanv.js} +15 -3
- package/esm/{stencil.util-wGFRYLwZ.js → stencil.util-D2-5rsN3.js} +1 -1
- package/hydrate/index.js +229 -114
- package/hydrate/index.mjs +229 -114
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-b0626234.entry.js → p-0c05f24b.entry.js} +1 -1
- package/lmvz-components/{p-b67ff2d1.entry.js → p-194a3af5.entry.js} +1 -1
- package/lmvz-components/{p-585470ef.entry.js → p-24d13be6.entry.js} +1 -1
- package/lmvz-components/p-4416d688.entry.js +1 -0
- package/lmvz-components/{p-08613ba2.entry.js → p-46edf36f.entry.js} +1 -1
- package/lmvz-components/{p-bfde444e.entry.js → p-489d9912.entry.js} +1 -1
- package/lmvz-components/p-5ff55ba9.entry.js +1 -0
- package/lmvz-components/{p-03c38ff2.entry.js → p-888e04d7.entry.js} +1 -1
- package/lmvz-components/p-9dc420e2.entry.js +1 -0
- package/lmvz-components/p-BFcYfHYq.js +1 -0
- package/lmvz-components/p-BuEA0MWd.js +1 -0
- package/lmvz-components/p-CICeIanv.js +1 -0
- package/lmvz-components/p-DZj20TV1.js +1 -0
- package/lmvz-components/p-a887018d.entry.js +1 -0
- package/lmvz-components/p-aaa7691c.entry.js +1 -0
- package/lmvz-components/p-af48eccb.entry.js +1 -0
- package/lmvz-components/{p-9b7ce515.entry.js → p-bc237ab7.entry.js} +1 -1
- package/lmvz-components/p-bh9cItsP.js +1 -0
- package/lmvz-components/{p-2036044c.entry.js → p-c2544495.entry.js} +1 -1
- package/lmvz-components/{p-ddc28256.entry.js → p-d4154a65.entry.js} +1 -1
- package/lmvz-components/p-e4ce63b3.entry.js +1 -0
- package/lmvz-components/{p-11de5905.entry.js → p-eb4c5a6f.entry.js} +1 -1
- package/lmvz-components/{p-6140866f.entry.js → p-eb62d4af.entry.js} +1 -1
- package/lmvz-components/{p-ce1a9f39.entry.js → p-ecbd9e93.entry.js} +1 -1
- package/lmvz-components/{p-4254aa38.entry.js → p-f42b16e6.entry.js} +1 -1
- package/lmvz-components/p-wlMjNjuv.js +1 -0
- package/manifest.json +79 -5
- package/package.json +1 -1
- package/types/api/ds.constants.d.ts +1 -0
- package/types/components/lmvz-action/lmvz-action.d.ts +1 -0
- package/types/components/lmvz-action-list/lmvz-action-list.d.ts +3 -1
- package/types/components/lmvz-button/lmvz-button.d.ts +2 -1
- package/types/components/lmvz-button-group/lmvz-button-group.d.ts +1 -0
- package/types/components/lmvz-card/lmvz-card.d.ts +1 -0
- package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +1 -0
- package/types/components/lmvz-chip/lmvz-chip.d.ts +1 -0
- package/types/components/lmvz-header/lmvz-header.d.ts +4 -2
- package/types/components/lmvz-icon/lmvz-icon.d.ts +1 -0
- package/types/components/lmvz-input/lmvz-input.d.ts +1 -0
- package/types/components/lmvz-link/lmvz-link.d.ts +1 -0
- package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +1 -0
- package/types/components/lmvz-message/lmvz-message.d.ts +1 -0
- package/types/components/lmvz-message/public.d.ts +1 -0
- package/types/components/lmvz-modal/lmvz-modal.d.ts +1 -0
- package/types/components/lmvz-modal/test/testing.d.ts +10 -0
- package/types/components/lmvz-popover/lmvz-popover.d.ts +6 -3
- package/types/components/lmvz-radio/lmvz-radio.d.ts +1 -0
- package/types/components/lmvz-select/lmvz-select.d.ts +1 -0
- package/types/components/lmvz-snackbar/lmvz-snackbar.d.ts +1 -0
- package/types/components/lmvz-snackbar/public.d.ts +1 -0
- package/types/components/lmvz-snackbar/snackbar-controller.d.ts +1 -0
- package/types/components/lmvz-spinner/lmvz-spinner.d.ts +1 -0
- package/types/components/lmvz-tab/lmvz-tab.d.ts +1 -0
- package/types/components/lmvz-tabs/lmvz-tabs.d.ts +3 -1
- package/types/components/lmvz-toggle/lmvz-toggle.d.ts +1 -0
- package/types/components.d.ts +18 -0
- package/types/index.d.ts +1 -0
- package/types/utils/aria/aria-validation-controller.d.ts +1 -0
- package/types/utils/aria/aria.constants.d.ts +1 -0
- package/types/utils/aria/{list-keyboard-controller.d.ts → directional-focus-controller.d.ts} +13 -2
- package/types/utils/aria/element-activation-controller.d.ts +11 -2
- package/types/utils/async/async.util.d.ts +1 -0
- package/types/utils/data/event.util.d.ts +6 -0
- package/types/utils/data/number.util.d.ts +1 -0
- package/types/utils/data/object.util.d.ts +1 -0
- package/types/utils/data/time.util.d.ts +1 -0
- package/types/utils/element/element.util.d.ts +2 -0
- package/types/utils/environment.d.ts +1 -0
- package/types/utils/icons/icons-registry.d.ts +1 -0
- package/types/utils/icons/icons.d.ts +1 -0
- package/types/utils/icons/icons.unit.d.ts +1 -0
- package/types/utils/icons/public.d.ts +1 -0
- package/types/utils/public.d.ts +1 -0
- package/types/utils/radio/radio-group-controller.d.ts +1 -0
- package/types/utils/stencil/assets.d.ts +1 -0
- package/types/utils/stencil/reactive-controller-host.d.ts +8 -1
- package/types/utils/stencil/stencil.util.d.ts +1 -0
- package/cjs/element-activation-controller-DC_6T0Rt.js +0 -31
- package/components/p-BhSTYZC6.js +0 -1
- package/components/p-CE-QR3Tp.js +0 -1
- package/components/p-CK3Ixl1K.js +0 -1
- package/components/p-CN0JX9-m.js +0 -1
- package/components/p-D-2gj6LP.js +0 -1
- package/components/p-D9nUtvTm.js +0 -1
- package/components/p-DAMVH-31.js +0 -1
- package/esm/element-activation-controller-CN0JX9-m.js +0 -29
- package/lmvz-components/p-45c3ccb6.entry.js +0 -1
- package/lmvz-components/p-49e98627.entry.js +0 -1
- package/lmvz-components/p-4f005b23.entry.js +0 -1
- package/lmvz-components/p-50063516.entry.js +0 -1
- package/lmvz-components/p-9f8fd077.entry.js +0 -1
- package/lmvz-components/p-B0eCxdyI.js +0 -1
- package/lmvz-components/p-BhSTYZC6.js +0 -1
- package/lmvz-components/p-CN0JX9-m.js +0 -1
- package/lmvz-components/p-D9nUtvTm.js +0 -1
- package/lmvz-components/p-DuLiExhX.js +0 -1
- package/lmvz-components/p-FBuCCcFC.js +0 -1
- package/lmvz-components/p-cc2734e9.entry.js +0 -1
- package/lmvz-components/p-fd455288.entry.js +0 -1
- package/types/utils/data/event.utilt.d.ts +0 -4
|
@@ -12,14 +12,47 @@ const TYPE_SVG = {
|
|
|
12
12
|
warning: WARNING_SVG,
|
|
13
13
|
};
|
|
14
14
|
const BLOCK_TAGS = new Set([
|
|
15
|
-
'ADDRESS',
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
15
|
+
'ADDRESS',
|
|
16
|
+
'ARTICLE',
|
|
17
|
+
'ASIDE',
|
|
18
|
+
'BLOCKQUOTE',
|
|
19
|
+
'CAPTION',
|
|
20
|
+
'COLGROUP',
|
|
21
|
+
'DD',
|
|
22
|
+
'DETAILS',
|
|
23
|
+
'DIALOG',
|
|
24
|
+
'DIV',
|
|
25
|
+
'DL',
|
|
26
|
+
'DT',
|
|
27
|
+
'FIELDSET',
|
|
28
|
+
'FIGCAPTION',
|
|
29
|
+
'FIGURE',
|
|
30
|
+
'FOOTER',
|
|
31
|
+
'FORM',
|
|
32
|
+
'H1',
|
|
33
|
+
'H2',
|
|
34
|
+
'H3',
|
|
35
|
+
'H4',
|
|
36
|
+
'H5',
|
|
37
|
+
'H6',
|
|
38
|
+
'HEADER',
|
|
39
|
+
'HGROUP',
|
|
40
|
+
'HR',
|
|
41
|
+
'LI',
|
|
42
|
+
'MAIN',
|
|
43
|
+
'MENU',
|
|
44
|
+
'NAV',
|
|
45
|
+
'OL',
|
|
46
|
+
'P',
|
|
47
|
+
'PRE',
|
|
48
|
+
'SECTION',
|
|
49
|
+
'TABLE',
|
|
50
|
+
'TBODY',
|
|
51
|
+
'TD',
|
|
52
|
+
'TH',
|
|
53
|
+
'THEAD',
|
|
54
|
+
'TFOOT',
|
|
55
|
+
'TR',
|
|
23
56
|
'UL',
|
|
24
57
|
]);
|
|
25
58
|
export class LmvzMessage {
|
|
@@ -60,7 +93,7 @@ export class LmvzMessage {
|
|
|
60
93
|
}
|
|
61
94
|
render() {
|
|
62
95
|
const role = this.live === 'assertive' ? 'alert' : this.live === 'polite' ? 'status' : 'note';
|
|
63
|
-
return (h(Host, { key: '
|
|
96
|
+
return (h(Host, { key: '99dad82a6300fb8d089f1ea688186d4b4316a058', role: role }, this.leadingIcon && h("span", { key: '2adf33102f7075a83ebf29d9b6e0d433a17beb68', class: "leading-icon", "aria-hidden": "true", innerHTML: TYPE_SVG[this.type] }), h("span", { key: '286d3d0ea065534b84be18c927b2fcd7f30f34bd', class: "message" }, h("slot", { key: '261e865980515a816382b2c7c6b3a52b500308bf', ref: (el) => (this.messageSlot = el), onSlotchange: this.handleSlotChange })), this.actionLabel && (h("lmvz-button", { key: '46d964c0490bbdd47426fc228db0e3ccb108b416', variant: "tertiary", scale: "small", onLmvzActivation: this.handleActionClick }, this.actionLabel)), this.dismissible && (h("lmvz-button", { key: 'ce1ec8beb756c2e11c948e227f94f81bd5568c88', variant: "tertiary", scale: "small", "aria-label": this.closeLabel, onClick: this.handleDismissClick }, h("lmvz-icon", { key: '5361c424e77ffea7984c2fd42357666cd86ba1d6', "aria-hidden": "true", icon: CLOSE_SM_SVG })))));
|
|
64
97
|
}
|
|
65
98
|
static get is() { return "lmvz-message"; }
|
|
66
99
|
static get encapsulation() { return "shadow"; }
|
|
@@ -58,7 +58,7 @@ h6 {
|
|
|
58
58
|
hr {
|
|
59
59
|
height: 0;
|
|
60
60
|
border: none;
|
|
61
|
-
margin: var(--lmvz-dimension-4
|
|
61
|
+
margin: var(--lmvz-dimension-8-4, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0;
|
|
62
62
|
border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0);
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -67,7 +67,7 @@ hr {
|
|
|
67
67
|
display: contents;
|
|
68
68
|
|
|
69
69
|
/* TODO: missing token for modal/box gap */
|
|
70
|
-
--lmvz-modal-shell-gap: var(--lmvz-dimension-16
|
|
70
|
+
--lmvz-modal-shell-gap: var(--lmvz-dimension-20-16, clamp(1rem, 0.94rem + 0.26vw, 1.25rem));
|
|
71
71
|
}
|
|
72
72
|
dialog {
|
|
73
73
|
border: none;
|
|
@@ -104,8 +104,8 @@ dialog::backdrop {
|
|
|
104
104
|
|
|
105
105
|
.close-button {
|
|
106
106
|
position: absolute;
|
|
107
|
-
top: var(--lmvz-dimension-10
|
|
108
|
-
right: var(--lmvz-dimension-10
|
|
107
|
+
top: var(--lmvz-dimension-12-10, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem));
|
|
108
|
+
right: var(--lmvz-dimension-12-10, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem));
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
.header {
|
|
@@ -116,7 +116,7 @@ dialog::backdrop {
|
|
|
116
116
|
}
|
|
117
117
|
.title {
|
|
118
118
|
min-inline-size: 0;
|
|
119
|
-
font: var(--lmvz-typography-heading-lg, 500 clamp(1.
|
|
119
|
+
font: var(--lmvz-typography-heading-lg, 500 clamp(1.13rem, 1.03rem + 0.39vw, 1.5rem) / 1.5
|
|
120
120
|
Router);
|
|
121
121
|
}
|
|
122
122
|
.has-title .title {
|
|
@@ -223,7 +223,7 @@ export class LmvzModal extends ReactiveControllerHost {
|
|
|
223
223
|
this.hasHeader = this.hasAssignedContent(this.headerSlot);
|
|
224
224
|
};
|
|
225
225
|
render() {
|
|
226
|
-
return (h(Host, { key: '8b5f506cdac223a440309d472639fe965b94f8c2' }, h("dialog", { key: '0b70ac4d9590266271052c4d7fdef03c684d9b72', ref: (element) => (this.dialogEl = element), onCancel: this.handleDialogCancel, onClose: this.handleDialogClose, ...this.dialogAccessibilityAttributes }, h("div", { key: '25b529bec1905408c2041b7370ab37586eade47d', class: "modal-shell" }, h("header", { key: 'd86ae4a6f4ac7f6efd38385f1407d1f6bfbb1abb', class: { header: true, 'has-title': this.hasHeader } }, h("div", { key: '7fd7059bfb0b90834895a87c2f2598e2e8c2ba80', class: "title", id: this.dialogTitleId, hidden: !this.hasHeader }, h("slot", { key: 'b6eb7885e220e5def4c3c8420d5b83f4a7e30907', name: "header", ref: (element) => (this.headerSlot = element), onSlotchange: this.handleHeaderSlotChange })), h("lmvz-button", { key: '
|
|
226
|
+
return (h(Host, { key: '8b5f506cdac223a440309d472639fe965b94f8c2' }, h("dialog", { key: '0b70ac4d9590266271052c4d7fdef03c684d9b72', ref: (element) => (this.dialogEl = element), onCancel: this.handleDialogCancel, onClose: this.handleDialogClose, ...this.dialogAccessibilityAttributes }, h("div", { key: '25b529bec1905408c2041b7370ab37586eade47d', class: "modal-shell" }, h("header", { key: 'd86ae4a6f4ac7f6efd38385f1407d1f6bfbb1abb', class: { header: true, 'has-title': this.hasHeader } }, h("div", { key: '7fd7059bfb0b90834895a87c2f2598e2e8c2ba80', class: "title", id: this.dialogTitleId, hidden: !this.hasHeader }, h("slot", { key: 'b6eb7885e220e5def4c3c8420d5b83f4a7e30907', name: "header", ref: (element) => (this.headerSlot = element), onSlotchange: this.handleHeaderSlotChange })), h("lmvz-button", { key: '72e17391097dfa756e572764f40080b6eec222b2', ref: (element) => (this.closeButtonEl = element), type: "button", class: "close-button", "aria-label": this.closeLabel, onLmvzActivation: this.handleCloseButtonClick, variant: "tertiary" }, h("lmvz-icon", { key: '7bbae1aefa9ccc6646d5861683e3476339a545e4', icon: closeIconSvg }))), h("div", { key: '9f22628448e9af527eb10ef2602c498afc55c029', class: "body" }, h("slot", { key: '413e72707749b3abc987ef47a81cccda4b874c84' })), h("footer", { key: 'a1a8f648e88d1f9045e9cf866d332aac69e033df', class: "actions", hidden: !this.buttonGroupEl?.hasActions }, h("lmvz-button-group", { key: '7d7eeee7a2551a09bfb4fc513bde48828be5ee8b', ref: (element) => (this.buttonGroupEl = element) }, h("slot", { key: '76b00523167c5fa08f11fc351a37638227401711', name: "actions" })))))));
|
|
227
227
|
}
|
|
228
228
|
static get is() { return "lmvz-modal"; }
|
|
229
229
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { vi } from "vitest";
|
|
2
|
+
export const mockDialogMethods = (dialog) => {
|
|
3
|
+
const showModal = vi.fn(() => {
|
|
4
|
+
dialog.open = true;
|
|
5
|
+
const closeButton = dialog.querySelector('.close-button');
|
|
6
|
+
closeButton?.focus();
|
|
7
|
+
});
|
|
8
|
+
const close = vi.fn((returnValue) => {
|
|
9
|
+
dialog.returnValue = returnValue ?? '';
|
|
10
|
+
dialog.open = false;
|
|
11
|
+
const closeEvent = dialog.ownerDocument.createEvent('Event');
|
|
12
|
+
closeEvent.initEvent('close', true, true);
|
|
13
|
+
dialog.dispatchEvent(closeEvent);
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(dialog, 'showModal', {
|
|
16
|
+
configurable: true,
|
|
17
|
+
value: showModal,
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(dialog, 'close', {
|
|
20
|
+
configurable: true,
|
|
21
|
+
value: close,
|
|
22
|
+
});
|
|
23
|
+
const requestClose = vi.fn((returnValue) => {
|
|
24
|
+
const cancelEvent = dialog.ownerDocument.createEvent('Event');
|
|
25
|
+
cancelEvent.initEvent('cancel', false, true);
|
|
26
|
+
dialog.dispatchEvent(cancelEvent);
|
|
27
|
+
if (!cancelEvent.defaultPrevented) {
|
|
28
|
+
close(returnValue);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(dialog, 'requestClose', {
|
|
32
|
+
configurable: true,
|
|
33
|
+
value: requestClose,
|
|
34
|
+
});
|
|
35
|
+
return { showModal, close, requestClose };
|
|
36
|
+
};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { computePosition, flip, offset, shift } from "@floating-ui/dom";
|
|
3
3
|
import { isAriaValidationEnabled } from "../../utils/aria/aria-validation-controller";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { isFocusControllerHost } from "../../utils/aria/directional-focus-controller";
|
|
5
|
+
import { addElementActivationListener } from "../../utils/aria/element-activation-controller";
|
|
6
|
+
import { wait, waitFrame } from "../../utils/async/async.util";
|
|
7
|
+
import { canReceiveFocus, getDeepActiveElement, isActionButton, isHtmlElement, isInteractiveElement, walkShadowDOMUntil } from "../../utils/element/element.util";
|
|
6
8
|
export class LmvzPopover {
|
|
7
9
|
el;
|
|
8
|
-
|
|
10
|
+
extEventController = new AbortController();
|
|
11
|
+
closureController;
|
|
9
12
|
containerEl;
|
|
10
13
|
slotEl;
|
|
11
14
|
previouslyFocusedElement = null;
|
|
15
|
+
anchorEl;
|
|
12
16
|
open = false;
|
|
13
17
|
anchor;
|
|
14
18
|
placement = 'bottom-start';
|
|
@@ -34,7 +38,6 @@ export class LmvzPopover {
|
|
|
34
38
|
}
|
|
35
39
|
componentDidLoad() {
|
|
36
40
|
autoAssignId(this.el);
|
|
37
|
-
validatePopoverAria(this.el, this.label, this.anchor, this.resolveAnchor());
|
|
38
41
|
}
|
|
39
42
|
handleOpenChange(isOpen) {
|
|
40
43
|
if (isOpen) {
|
|
@@ -44,24 +47,40 @@ export class LmvzPopover {
|
|
|
44
47
|
this.onClose();
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
|
-
handleAnchorChange() {
|
|
48
|
-
if (
|
|
49
|
-
this.
|
|
50
|
+
async handleAnchorChange(anchor) {
|
|
51
|
+
if (!anchor) {
|
|
52
|
+
console.warn('anchor property missing for popover', this.el?.id);
|
|
53
|
+
this.anchor = undefined;
|
|
54
|
+
return;
|
|
50
55
|
}
|
|
56
|
+
await wait();
|
|
57
|
+
this.anchorEl = typeof anchor === 'string' ? document.getElementById(anchor) : anchor;
|
|
58
|
+
this.setupAnchorEl();
|
|
59
|
+
if (!this.open)
|
|
60
|
+
return;
|
|
61
|
+
this.updatePosition();
|
|
51
62
|
}
|
|
52
63
|
disconnectedCallback() {
|
|
53
64
|
this.removeCloseHandlers();
|
|
65
|
+
this.extEventController.abort();
|
|
54
66
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return
|
|
67
|
+
setupAnchorEl() {
|
|
68
|
+
const { anchorEl } = this;
|
|
69
|
+
if (!anchorEl) {
|
|
70
|
+
console.warn('no anchor element set for', this);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!anchorEl.hasAttribute('aria-haspopup')) {
|
|
74
|
+
anchorEl.setAttribute('aria-haspopup', 'dialog');
|
|
60
75
|
}
|
|
61
|
-
|
|
76
|
+
anchorEl.setAttribute('aria-controls', this.el.getAttribute('id'));
|
|
77
|
+
if (isActionButton(anchorEl)) {
|
|
78
|
+
addElementActivationListener(anchorEl, this.toggle.bind(this), this.extEventController.signal);
|
|
79
|
+
}
|
|
80
|
+
validatePopoverAria(this.el, this.label, this.anchor, anchorEl);
|
|
62
81
|
}
|
|
63
82
|
async updatePosition() {
|
|
64
|
-
const anchorEl = this
|
|
83
|
+
const { anchorEl } = this;
|
|
65
84
|
const container = this.containerEl;
|
|
66
85
|
if (!anchorEl || !container)
|
|
67
86
|
return;
|
|
@@ -76,7 +95,6 @@ export class LmvzPopover {
|
|
|
76
95
|
async onOpen() {
|
|
77
96
|
this.previouslyFocusedElement = getDeepActiveElement(document);
|
|
78
97
|
this.setupCloseHandlers();
|
|
79
|
-
console.log('onOpen');
|
|
80
98
|
await waitFrame();
|
|
81
99
|
await this.updatePosition();
|
|
82
100
|
autoAssignId(this.el);
|
|
@@ -94,20 +112,14 @@ export class LmvzPopover {
|
|
|
94
112
|
this.lmvzClose.emit();
|
|
95
113
|
}
|
|
96
114
|
applyAnchorAriaOpen() {
|
|
97
|
-
|
|
98
|
-
if (!anchorEl)
|
|
115
|
+
if (!this.anchorEl)
|
|
99
116
|
return;
|
|
100
|
-
|
|
101
|
-
anchorEl.setAttribute('aria-haspopup', 'dialog');
|
|
102
|
-
}
|
|
103
|
-
anchorEl.setAttribute('aria-expanded', 'true');
|
|
104
|
-
anchorEl.setAttribute('aria-controls', this.el.getAttribute('id'));
|
|
117
|
+
this.anchorEl.setAttribute('aria-expanded', 'true');
|
|
105
118
|
}
|
|
106
119
|
applyAnchorAriaClose() {
|
|
107
|
-
|
|
108
|
-
if (!anchorEl)
|
|
120
|
+
if (!this.anchorEl)
|
|
109
121
|
return;
|
|
110
|
-
anchorEl.setAttribute('aria-expanded', 'false');
|
|
122
|
+
this.anchorEl.setAttribute('aria-expanded', 'false');
|
|
111
123
|
}
|
|
112
124
|
focusFirst() {
|
|
113
125
|
const { slotEl } = this;
|
|
@@ -115,6 +127,12 @@ export class LmvzPopover {
|
|
|
115
127
|
return;
|
|
116
128
|
const assigned = slotEl.assignedElements({ flatten: true });
|
|
117
129
|
for (const el of assigned) {
|
|
130
|
+
if (!isHtmlElement(el))
|
|
131
|
+
continue;
|
|
132
|
+
if (isFocusControllerHost(el)) {
|
|
133
|
+
el.initFocus();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
118
136
|
const focusable = walkShadowDOMUntil(el, canReceiveFocus);
|
|
119
137
|
if (focusable) {
|
|
120
138
|
focusable.focus();
|
|
@@ -136,6 +154,7 @@ export class LmvzPopover {
|
|
|
136
154
|
}
|
|
137
155
|
}
|
|
138
156
|
setupCloseHandlers() {
|
|
157
|
+
this.closureController = new AbortController();
|
|
139
158
|
const options = { signal: this.closureController.signal };
|
|
140
159
|
document.addEventListener('mousedown', (event) => {
|
|
141
160
|
if (!this.open)
|
|
@@ -153,10 +172,10 @@ export class LmvzPopover {
|
|
|
153
172
|
}, options);
|
|
154
173
|
}
|
|
155
174
|
removeCloseHandlers() {
|
|
156
|
-
this.closureController
|
|
175
|
+
this.closureController?.abort();
|
|
157
176
|
}
|
|
158
177
|
render() {
|
|
159
|
-
return (h(Host, { key: '
|
|
178
|
+
return (h(Host, { key: '744dae23d80c1e81a0b8bd2e9fcb02c6669d54cd' }, h("div", { key: '7f40e25f1e05738b2bbf900b90613004eb188395', role: "dialog", part: "container", class: `container lmvz-wrapper-card-${this.size}`, "aria-label": this.label || undefined, ref: (el) => (this.containerEl = el) }, h("slot", { key: '5a400fd9e697254007973f2dce172588fe3760ee', ref: (el) => (this.slotEl = el) }))));
|
|
160
179
|
}
|
|
161
180
|
static get is() { return "lmvz-popover"; }
|
|
162
181
|
static get encapsulation() { return "shadow"; }
|
|
@@ -323,6 +342,11 @@ export class LmvzPopover {
|
|
|
323
342
|
}
|
|
324
343
|
};
|
|
325
344
|
}
|
|
345
|
+
static get states() {
|
|
346
|
+
return {
|
|
347
|
+
"anchorEl": {}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
326
350
|
static get events() {
|
|
327
351
|
return [{
|
|
328
352
|
"method": "lmvzOpen",
|
|
@@ -433,7 +457,10 @@ export class LmvzPopover {
|
|
|
433
457
|
"methodName": "handleOpenChange"
|
|
434
458
|
}, {
|
|
435
459
|
"propName": "anchor",
|
|
436
|
-
"methodName": "handleAnchorChange"
|
|
460
|
+
"methodName": "handleAnchorChange",
|
|
461
|
+
"handlerOptions": {
|
|
462
|
+
"immediate": true
|
|
463
|
+
}
|
|
437
464
|
}];
|
|
438
465
|
}
|
|
439
466
|
}
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
|
|
46
46
|
--radio-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff);
|
|
47
47
|
--radio-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0);
|
|
48
|
-
--radio-border-color-hover: var(--lmvz-semantic-color-border-hover, #
|
|
48
|
+
--radio-border-color-hover: var(--lmvz-semantic-color-border-hover, #a1a1a1);
|
|
49
49
|
--radio-border-color-checked: var(--lmvz-semantic-color-border-active, #0f8acc);
|
|
50
|
-
--radio-border-color-error: var(--lmvz-semantic-color-status-on-danger, #
|
|
50
|
+
--radio-border-color-error: var(--lmvz-semantic-color-status-on-danger, #a31419);
|
|
51
51
|
--radio-dot-color: var(--lmvz-semantic-color-border-active, #0f8acc);
|
|
52
52
|
|
|
53
53
|
--radio-wrapper-bg-hover: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0);
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
--radio-label-color: var(--lmvz-semantic-color-on-surface-primary, #000000);
|
|
57
57
|
--radio-label-color-checked: var(--lmvz-semantic-color-status-on-active, #0e7ab4);
|
|
58
|
-
--radio-helper-color: var(--lmvz-semantic-color-on-surface-secondary, #
|
|
58
|
+
--radio-helper-color: var(--lmvz-semantic-color-on-surface-secondary, #545454);
|
|
59
59
|
|
|
60
60
|
--radio-easing: var(--lmvz-global-easing-default, ease);
|
|
61
61
|
--radio-duration: 0.2s;
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
display: flex;
|
|
64
64
|
align-items: center;
|
|
65
65
|
gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
66
|
-
padding-block: var(--lmvz-dimension-2
|
|
67
|
-
padding-inline: var(--lmvz-dimension-8
|
|
66
|
+
padding-block: var(--lmvz-dimension-8-2, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem));
|
|
67
|
+
padding-inline: var(--lmvz-dimension-12-8, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
68
68
|
border-radius: var(--lmvz-semantic-border-radius-round, 999px);
|
|
69
69
|
overflow: clip;
|
|
70
70
|
cursor: pointer;
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
}
|
|
75
75
|
input {
|
|
76
76
|
position: absolute;
|
|
77
|
-
inset-block-start: var(--lmvz-dimension-2
|
|
78
|
-
inset-inline-start: var(--lmvz-dimension-4
|
|
77
|
+
inset-block-start: var(--lmvz-dimension-8-2, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem));
|
|
78
|
+
inset-inline-start: var(--lmvz-dimension-10-4, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
79
79
|
opacity: 0;
|
|
80
80
|
width: var(--radio-circle-size);
|
|
81
81
|
height: var(--radio-circle-size);
|
|
@@ -117,7 +117,7 @@ label {
|
|
|
117
117
|
}
|
|
118
118
|
.helper-text {
|
|
119
119
|
display: block;
|
|
120
|
-
font: var(--lmvz-typography-body-sm, 400 clamp(0.
|
|
120
|
+
font: var(--lmvz-typography-body-sm, 400 clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem) / 1.5 Router);
|
|
121
121
|
color: var(--radio-helper-color);
|
|
122
122
|
margin-block-start: 2px;
|
|
123
123
|
}
|
|
@@ -150,7 +150,7 @@ label {
|
|
|
150
150
|
border-color: var(--radio-border-color-error);
|
|
151
151
|
}
|
|
152
152
|
:host([error]) .helper-text {
|
|
153
|
-
color: var(--lmvz-semantic-color-status-on-danger, #
|
|
153
|
+
color: var(--lmvz-semantic-color-status-on-danger, #a31419);
|
|
154
154
|
}
|
|
155
155
|
/* Disabled state */
|
|
156
156
|
:host([disabled]) {
|
|
@@ -49,20 +49,20 @@
|
|
|
49
49
|
--lmvz-select-radius: var(--lmvz-component-input-radius-default, 999px);
|
|
50
50
|
--lmvz-select-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff);
|
|
51
51
|
--lmvz-select-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0);
|
|
52
|
-
--lmvz-select-border-color-hover: var(--lmvz-semantic-color-border-hover, #
|
|
52
|
+
--lmvz-select-border-color-hover: var(--lmvz-semantic-color-border-hover, #a1a1a1);
|
|
53
53
|
--lmvz-select-border-width: var(--lmvz-semantic-border-width-default, 1px);
|
|
54
54
|
--lmvz-select-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000);
|
|
55
55
|
--lmvz-select-label-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000);
|
|
56
56
|
--lmvz-select-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem));
|
|
57
57
|
--lmvz-select-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
58
58
|
--lmvz-select-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem));
|
|
59
|
-
--lmvz-select-label-font-size: var(--lmvz-component-body-xs-font-size, clamp(0.63rem, 0.
|
|
59
|
+
--lmvz-select-label-font-size: var(--lmvz-component-body-xs-font-size, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem));
|
|
60
60
|
--lmvz-select-label-top-offset: calc(var(--lmvz-internal-select-floating-label-top-offset) * -1);
|
|
61
61
|
--lmvz-select-label-minimized-padding-x: 4px;
|
|
62
62
|
--lmvz-select-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%);
|
|
63
63
|
--lmvz-select-helper-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454);
|
|
64
64
|
--lmvz-select-focus-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4);
|
|
65
|
-
--lmvz-select-error-color: var(--lmvz-semantic-color-status-on-danger, #
|
|
65
|
+
--lmvz-select-error-color: var(--lmvz-semantic-color-status-on-danger, #a31419);
|
|
66
66
|
}
|
|
67
67
|
.select-wrapper {
|
|
68
68
|
position: relative;
|
|
@@ -201,7 +201,7 @@ select {
|
|
|
201
201
|
--lmvz-select-label-font-size: var(--lmvz-component-body-2xs-font-size, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem));
|
|
202
202
|
}
|
|
203
203
|
:host([size='small']) div[aria-hidden] > span:first-child {
|
|
204
|
-
font-size: var(--lmvz-component-body-sm-font-size, clamp(0.
|
|
204
|
+
font-size: var(--lmvz-component-body-sm-font-size, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem));
|
|
205
205
|
}
|
|
206
206
|
:host([size='small']) div[aria-hidden] svg {
|
|
207
207
|
width: var(--lmvz-component-icon-size-4xs, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem));
|
|
@@ -211,7 +211,7 @@ select {
|
|
|
211
211
|
--lmvz-select-height: var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem));
|
|
212
212
|
--lmvz-select-padding-x: var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem));
|
|
213
213
|
--lmvz-select-gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));
|
|
214
|
-
--lmvz-select-label-font-size: var(--lmvz-component-body-sm-font-size, clamp(0.
|
|
214
|
+
--lmvz-select-label-font-size: var(--lmvz-component-body-sm-font-size, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem));
|
|
215
215
|
}
|
|
216
216
|
:host([size='large']) div[aria-hidden] > span:first-child {
|
|
217
217
|
font-size: var(--lmvz-component-body-lg-font-size, clamp(1rem, 0.97rem + 0.13vw, 1.13rem));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
position: fixed;
|
|
3
|
-
bottom: var(--lmvz-dimension-16
|
|
3
|
+
bottom: var(--lmvz-dimension-20-16, clamp(1rem, 0.94rem + 0.26vw, 1.25rem));
|
|
4
4
|
left: 50%;
|
|
5
5
|
transform: translateX(-50%);
|
|
6
6
|
z-index: 2147483000; /* TODO(tokens): promote to design-token */
|
|
@@ -8,40 +8,40 @@
|
|
|
8
8
|
width: max-content;
|
|
9
9
|
border: 1px solid transparent;
|
|
10
10
|
border-radius: var(--lmvz-semantic-border-radius-lg, 14px);
|
|
11
|
-
padding: var(--lmvz-dimension-10
|
|
11
|
+
padding: var(--lmvz-dimension-12-10, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem)) var(--lmvz-dimension-14-12, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem));
|
|
12
12
|
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: row;
|
|
15
15
|
align-items: center;
|
|
16
16
|
justify-content: center;
|
|
17
|
-
gap: var(--lmvz-dimension-8
|
|
17
|
+
gap: var(--lmvz-dimension-12-8, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
18
18
|
|
|
19
19
|
pointer-events: auto;
|
|
20
20
|
font: var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5
|
|
21
21
|
Router);
|
|
22
22
|
|
|
23
23
|
/* this will be picked up by lmvz-icon as well */
|
|
24
|
-
--lmvz-component-color: var(--lmvz-semantic-color-status-on-success, #
|
|
24
|
+
--lmvz-component-color: var(--lmvz-semantic-color-status-on-success, #28625b);
|
|
25
25
|
|
|
26
26
|
color: var(--lmvz-component-color);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
:host([status='success']) {
|
|
30
|
-
background-color: var(--lmvz-semantic-color-status-success, #
|
|
31
|
-
border-color: var(--lmvz-semantic-color-status-on-success-subtle, #
|
|
32
|
-
--lmvz-component-color: var(--lmvz-semantic-color-status-on-success, #
|
|
30
|
+
background-color: var(--lmvz-semantic-color-status-success, #c2e6e1);
|
|
31
|
+
border-color: var(--lmvz-semantic-color-status-on-success-subtle, #4eb6a9);
|
|
32
|
+
--lmvz-component-color: var(--lmvz-semantic-color-status-on-success, #28625b);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:host([status='warning']) {
|
|
36
|
-
background-color: var(--lmvz-semantic-color-status-warning, #
|
|
37
|
-
border-color: var(--lmvz-semantic-color-status-on-warning-subtle, #
|
|
38
|
-
--lmvz-component-color: var(--lmvz-semantic-color-status-on-warning, #
|
|
36
|
+
background-color: var(--lmvz-semantic-color-status-warning, #ffeeb8);
|
|
37
|
+
border-color: var(--lmvz-semantic-color-status-on-warning-subtle, #e6b000);
|
|
38
|
+
--lmvz-component-color: var(--lmvz-semantic-color-status-on-warning, #614a00);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
:host([status='error']) {
|
|
42
|
-
background-color: var(--lmvz-semantic-color-status-danger, #
|
|
43
|
-
border-color: var(--lmvz-semantic-color-status-on-danger-subtle, #
|
|
44
|
-
--lmvz-component-color: var(--lmvz-semantic-color-status-on-danger, #
|
|
42
|
+
background-color: var(--lmvz-semantic-color-status-danger, #fbdfe0);
|
|
43
|
+
border-color: var(--lmvz-semantic-color-status-on-danger-subtle, #e8454b);
|
|
44
|
+
--lmvz-component-color: var(--lmvz-semantic-color-status-on-danger, #a31419);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
lmvz-icon {
|
|
@@ -25,7 +25,7 @@ h6 {
|
|
|
25
25
|
hr {
|
|
26
26
|
height: 0;
|
|
27
27
|
border: none;
|
|
28
|
-
margin: var(--lmvz-dimension-4
|
|
28
|
+
margin: var(--lmvz-dimension-8-4, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0;
|
|
29
29
|
border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -49,9 +49,9 @@ button {
|
|
|
49
49
|
justify-content: center;
|
|
50
50
|
gap: var(--lmvz-component-component-spacing-0-default, 4px);
|
|
51
51
|
|
|
52
|
-
padding-top: var(--lmvz-dimension-8
|
|
53
|
-
padding-bottom: var(--lmvz-dimension-8
|
|
54
|
-
padding-inline: var(--lmvz-dimension-16
|
|
52
|
+
padding-top: var(--lmvz-dimension-12-8, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
53
|
+
padding-bottom: var(--lmvz-dimension-14-8, clamp(0.5rem, 0.41rem + 0.39vw, 0.88rem));
|
|
54
|
+
padding-inline: var(--lmvz-dimension-24-16, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
|
|
55
55
|
|
|
56
56
|
border: none;
|
|
57
57
|
border-radius: var(--lmvz-semantic-border-radius-round, 999px);
|
|
@@ -89,9 +89,9 @@ button:active {
|
|
|
89
89
|
--lmvz-tab-background: var(--lmvz-semantic-color-int-tertiary, #ffffff);
|
|
90
90
|
}
|
|
91
91
|
:host([has-media]) button {
|
|
92
|
-
padding-top: var(--lmvz-dimension-16
|
|
93
|
-
padding-bottom: var(--lmvz-dimension-12
|
|
94
|
-
padding-inline: var(--lmvz-dimension-40
|
|
92
|
+
padding-top: var(--lmvz-dimension-18-16, clamp(1rem, 0.97rem + 0.13vw, 1.13rem));
|
|
93
|
+
padding-bottom: var(--lmvz-dimension-14-12, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem));
|
|
94
|
+
padding-inline: var(--lmvz-dimension-48-40, clamp(2.5rem, 2.38rem + 0.52vw, 3rem));
|
|
95
95
|
border-radius: var(--lmvz-semantic-border-radius-lg, 14px);
|
|
96
96
|
}
|
|
97
97
|
:host([has-media]) button:hover {
|
|
@@ -145,10 +145,10 @@ button:active {
|
|
|
145
145
|
--lmvz-component-color: var(--lmvz-tab-color);
|
|
146
146
|
}
|
|
147
147
|
::slotted(lmvz-icon) {
|
|
148
|
-
--lmvz-component-size: var(--lmvz-dimension-16
|
|
148
|
+
--lmvz-component-size: var(--lmvz-dimension-18-16, clamp(1rem, 0.97rem + 0.13vw, 1.13rem));
|
|
149
149
|
}
|
|
150
150
|
:host([has-media]) ::slotted(lmvz-icon) {
|
|
151
|
-
--lmvz-component-size: var(--lmvz-component-icon-size-lg, clamp(1.
|
|
151
|
+
--lmvz-component-size: var(--lmvz-component-icon-size-lg, clamp(1.25rem, 1.19rem + 0.26vw, 1.5rem));
|
|
152
152
|
}
|
|
153
153
|
.label {
|
|
154
154
|
display: contents;
|
|
@@ -25,7 +25,7 @@ h6 {
|
|
|
25
25
|
hr {
|
|
26
26
|
height: 0;
|
|
27
27
|
border: none;
|
|
28
|
-
margin: var(--lmvz-dimension-4
|
|
28
|
+
margin: var(--lmvz-dimension-8-4, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0;
|
|
29
29
|
border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -47,7 +47,7 @@ hr {
|
|
|
47
47
|
display: none; /* Chrome/Safari */
|
|
48
48
|
}
|
|
49
49
|
:host([has-icon-tabs]) .tablist {
|
|
50
|
-
gap: var(--lmvz-dimension-6
|
|
50
|
+
gap: var(--lmvz-dimension-8-6, clamp(0.38rem, 0.34rem + 0.13vw, 0.5rem));
|
|
51
51
|
background: none;
|
|
52
52
|
border-radius: 0;
|
|
53
53
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { DirectionalFocusController } from "../../utils/aria/
|
|
2
|
+
import { DirectionalFocusController } from "../../utils/aria/directional-focus-controller";
|
|
3
3
|
import { ReactiveControllerHost } from "../../utils/stencil/reactive-controller-host";
|
|
4
4
|
let tabsIdCounter = 0;
|
|
5
5
|
export class LmvzTabs extends ReactiveControllerHost {
|
|
@@ -43,6 +43,9 @@ export class LmvzTabs extends ReactiveControllerHost {
|
|
|
43
43
|
this.syncFocusTargets();
|
|
44
44
|
this.syncTabOrientation();
|
|
45
45
|
}
|
|
46
|
+
async initFocus() {
|
|
47
|
+
this.focusController.initFocus();
|
|
48
|
+
}
|
|
46
49
|
async activateTab(value) {
|
|
47
50
|
const tab = this.findTabByValue(value);
|
|
48
51
|
if (!tab || this.isTabDisabled(tab))
|
|
@@ -232,7 +235,7 @@ export class LmvzTabs extends ReactiveControllerHost {
|
|
|
232
235
|
this.selectTab(value);
|
|
233
236
|
};
|
|
234
237
|
render() {
|
|
235
|
-
return (h(Host, { key: '
|
|
238
|
+
return (h(Host, { key: '98df29f336a3ea47efa6c76a773de28c5174c718', onClick: this.handleTabClick, onKeydown: this.handleKeydown }, h("div", { key: '7e35ae180c4ebf2f5a82e0fad0977cd3c38ac659', role: "tablist", "aria-orientation": this.orientation, class: "tablist" }, h("slot", { key: '2520bc8b8988a60b37a067828ad237bf8dcfcc59', ref: (el) => (this.tabSlotEl = el) })), h("div", { key: 'bd4a954b6caca2d9f2eb588f58590821ec4af888', part: "panels-container", class: "panels-container" }, h("slot", { key: 'b4dffff530328e6e4c8d305895ef4dd2d5952757', name: "panels", ref: (el) => (this.panelSlotEl = el) }))));
|
|
236
239
|
}
|
|
237
240
|
static get is() { return "lmvz-tabs"; }
|
|
238
241
|
static get encapsulation() { return "shadow"; }
|
|
@@ -317,6 +320,23 @@ export class LmvzTabs extends ReactiveControllerHost {
|
|
|
317
320
|
}
|
|
318
321
|
static get methods() {
|
|
319
322
|
return {
|
|
323
|
+
"initFocus": {
|
|
324
|
+
"complexType": {
|
|
325
|
+
"signature": "() => Promise<void>",
|
|
326
|
+
"parameters": [],
|
|
327
|
+
"references": {
|
|
328
|
+
"Promise": {
|
|
329
|
+
"location": "global",
|
|
330
|
+
"id": "global::Promise"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"return": "Promise<void>"
|
|
334
|
+
},
|
|
335
|
+
"docs": {
|
|
336
|
+
"text": "Programmatically set focus to the first managed element.",
|
|
337
|
+
"tags": []
|
|
338
|
+
}
|
|
339
|
+
},
|
|
320
340
|
"activateTab": {
|
|
321
341
|
"complexType": {
|
|
322
342
|
"signature": "(value: string) => Promise<void>",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
display: inline-flex;
|
|
42
42
|
align-items: center;
|
|
43
43
|
gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
44
|
-
padding-block: var(--lmvz-dimension-2
|
|
45
|
-
padding-inline: var(--lmvz-dimension-4
|
|
44
|
+
padding-block: var(--lmvz-dimension-8-2, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem));
|
|
45
|
+
padding-inline: var(--lmvz-dimension-10-4, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
46
46
|
/* TODO[LDHCID-136]: min-height currently below accessibility requirements for tap targets (44px) */
|
|
47
47
|
/* min-height: 38px; */
|
|
48
48
|
border-radius: var(--lmvz-semantic-border-radius-round, 999px);
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0);
|
|
75
75
|
}
|
|
76
76
|
:host(:not([disabled]):hover) .track {
|
|
77
|
-
border-color: var(--lmvz-semantic-color-border-hover, #
|
|
77
|
+
border-color: var(--lmvz-semantic-color-border-hover, #a1a1a1);
|
|
78
78
|
}
|
|
79
79
|
:host([checked]) .track {
|
|
80
80
|
border-color: var(--lmvz-semantic-color-border-active, #0f8acc);
|