@lmvz-ds/components 0.29.0 → 0.31.0
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 +14 -0
- package/cjs/{ds.constants-JXqgKnXL.js → ds.constants-CKeXfK-s.js} +12 -0
- package/cjs/{component-C7cavwmZ.js → element.util-Cq4y-_iX.js} +42 -31
- package/cjs/index.cjs.js +8 -1
- package/cjs/{list-keyboard-controller-CzZdPBeH.js → list-keyboard-controller-StN6Yn8W.js} +13 -8
- package/cjs/lmvz-action-list.cjs.entry.js +79 -0
- package/cjs/lmvz-button-group.cjs.entry.js +43 -47
- package/cjs/lmvz-button_2.cjs.entry.js +10 -8
- package/cjs/lmvz-card.cjs.entry.js +2 -2
- package/cjs/lmvz-checkbox.cjs.entry.js +2 -2
- package/cjs/lmvz-chip.cjs.entry.js +3 -3
- package/cjs/lmvz-components.cjs.js +1 -1
- package/cjs/lmvz-header_2.cjs.entry.js +3 -3
- package/cjs/lmvz-input.cjs.entry.js +6 -6
- package/cjs/lmvz-link.cjs.entry.js +69 -0
- package/cjs/lmvz-menuitem.cjs.entry.js +2 -2
- package/cjs/lmvz-message.cjs.entry.js +2 -2
- package/cjs/lmvz-modal.cjs.entry.js +5 -5
- package/cjs/lmvz-radio.cjs.entry.js +3 -3
- package/cjs/lmvz-select.cjs.entry.js +2 -2
- package/cjs/lmvz-snackbar.cjs.entry.js +2 -2
- package/cjs/lmvz-spinner.cjs.entry.js +1 -1
- package/cjs/lmvz-tab.cjs.entry.js +2 -2
- package/cjs/lmvz-tabs.cjs.entry.js +4 -4
- package/cjs/lmvz-toggle.cjs.entry.js +5 -5
- package/cjs/loader.cjs.js +1 -1
- package/cjs/stencil.util-DzvzXSwk.js +25 -0
- package/collection/api/ds.constants.js +1 -0
- package/collection/collection-manifest.json +2 -0
- package/collection/components/lmvz-action-list/lmvz-action-list.css +93 -0
- package/collection/components/lmvz-action-list/lmvz-action-list.js +104 -0
- package/collection/components/lmvz-button/lmvz-button.css +67 -44
- package/collection/components/lmvz-button/lmvz-button.js +28 -7
- package/collection/components/lmvz-button-group/lmvz-button-group.css +35 -3
- package/collection/components/lmvz-button-group/lmvz-button-group.js +54 -38
- package/collection/components/lmvz-card/lmvz-card.css +66 -47
- package/collection/components/lmvz-card/lmvz-card.js +2 -2
- package/collection/components/lmvz-checkbox/lmvz-checkbox.css +8 -5
- package/collection/components/lmvz-checkbox/lmvz-checkbox.js +2 -2
- package/collection/components/lmvz-chip/lmvz-chip.css +4 -2
- package/collection/components/lmvz-chip/lmvz-chip.js +7 -7
- package/collection/components/lmvz-header/lmvz-header.js +2 -2
- package/collection/components/lmvz-icon/lmvz-icon.js +2 -2
- package/collection/components/lmvz-input/lmvz-input.css +2 -2
- package/collection/components/lmvz-input/lmvz-input.js +5 -5
- package/collection/components/lmvz-link/lmvz-link.css +44 -0
- package/collection/components/lmvz-link/lmvz-link.js +183 -0
- package/collection/components/lmvz-menuitem/lmvz-menuitem.css +2 -1
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +2 -2
- package/collection/components/lmvz-message/lmvz-message.css +2 -1
- package/collection/components/lmvz-message/lmvz-message.js +1 -1
- package/collection/components/lmvz-modal/lmvz-modal.css +11 -2
- package/collection/components/lmvz-modal/lmvz-modal.js +3 -3
- package/collection/components/lmvz-radio/lmvz-radio.css +4 -2
- package/collection/components/lmvz-radio/lmvz-radio.js +2 -2
- package/collection/components/lmvz-select/lmvz-select.css +4 -3
- package/collection/components/lmvz-select/lmvz-select.js +2 -2
- package/collection/components/lmvz-snackbar/lmvz-snackbar.css +2 -1
- package/collection/components/lmvz-snackbar/lmvz-snackbar.js +1 -1
- package/collection/components/lmvz-spinner/lmvz-spinner.js +1 -1
- package/collection/components/lmvz-tab/lmvz-tab.css +11 -3
- package/collection/components/lmvz-tab/lmvz-tab.js +1 -1
- package/collection/components/lmvz-tabs/lmvz-tabs.css +7 -0
- package/collection/components/lmvz-tabs/lmvz-tabs.js +2 -2
- package/collection/components/lmvz-toggle/lmvz-toggle.css +2 -1
- package/collection/components/lmvz-toggle/lmvz-toggle.js +3 -3
- package/collection/index.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/styles/fragments/_focus-within.css +2 -2
- package/collection/utils/aria/aria.constants.js +53 -0
- package/collection/utils/aria/list-keyboard-controller.js +12 -7
- package/collection/utils/async/async.util.js +62 -0
- package/collection/utils/data/event.utilt.js +19 -0
- package/collection/utils/data/number.util.js +6 -0
- package/collection/utils/data/object.util.js +20 -0
- package/collection/utils/data/time.util.js +3 -0
- package/collection/utils/element/element.util.js +117 -0
- package/collection/utils/{assets.js → stencil/assets.js} +1 -1
- package/collection/utils/stencil/stencil.util.js +12 -0
- package/components/index.d.ts +4 -0
- package/components/index.d.ts.bak +4 -0
- package/components/index.js +1 -1
- package/components/lmvz-action-list.d.ts +11 -0
- package/components/lmvz-action-list.d.ts.bak +11 -0
- package/components/lmvz-action-list.js +1 -0
- 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.d.ts +11 -0
- package/components/lmvz-link.d.ts.bak +11 -0
- package/components/lmvz-link.js +1 -0
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-message.js +1 -1
- package/components/lmvz-modal.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-spinner.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-B0H9qIwE.js +1 -0
- package/components/p-B4m1n4et.js +1 -0
- package/components/p-CJRqhXjK.js +1 -0
- package/components/p-CxfT9IA1.js +1 -0
- package/components/{p-CXakymyP.js → p-DJ90327O.js} +1 -1
- package/components/p-DeO5Vbxh.js +1 -0
- package/components/p-DuEtnKRj.js +1 -0
- package/esm/ds.constants-DuEtnKRj.js +18 -0
- package/esm/{component-DOTK1OW3.js → element.util-CxfT9IA1.js} +37 -31
- package/esm/index.js +1 -1
- package/esm/{list-keyboard-controller-Coi8XfUH.js → list-keyboard-controller-BKa9Kd2t.js} +12 -7
- package/esm/lmvz-action-list.entry.js +77 -0
- package/esm/lmvz-button-group.entry.js +35 -39
- package/esm/lmvz-button_2.entry.js +9 -7
- package/esm/lmvz-card.entry.js +2 -2
- package/esm/lmvz-checkbox.entry.js +2 -2
- package/esm/lmvz-chip.entry.js +3 -3
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-header_2.entry.js +3 -3
- package/esm/lmvz-input.entry.js +5 -5
- package/esm/lmvz-link.entry.js +67 -0
- package/esm/lmvz-menuitem.entry.js +2 -2
- package/esm/lmvz-message.entry.js +2 -2
- package/esm/lmvz-modal.entry.js +3 -3
- package/esm/lmvz-radio.entry.js +3 -3
- package/esm/lmvz-select.entry.js +2 -2
- package/esm/lmvz-snackbar.entry.js +2 -2
- package/esm/lmvz-spinner.entry.js +1 -1
- package/esm/lmvz-tab.entry.js +2 -2
- package/esm/lmvz-tabs.entry.js +4 -4
- package/esm/lmvz-toggle.entry.js +4 -4
- package/esm/loader.js +1 -1
- package/esm/stencil.util-CJRqhXjK.js +23 -0
- package/hydrate/index.js +586 -396
- package/hydrate/index.mjs +586 -396
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/p-1ce90ea7.entry.js +1 -0
- package/lmvz-components/{p-4484ab62.entry.js → p-24125bcf.entry.js} +1 -1
- package/lmvz-components/p-25a78ead.entry.js +1 -0
- package/lmvz-components/p-4072b2fb.entry.js +1 -0
- package/lmvz-components/p-48109e1d.entry.js +1 -0
- package/lmvz-components/{p-3b3e532f.entry.js → p-582f44ff.entry.js} +1 -1
- package/lmvz-components/p-592d509b.entry.js +1 -0
- package/lmvz-components/{p-7fd7e04c.entry.js → p-6f61c24d.entry.js} +1 -1
- package/lmvz-components/{p-5fcc6f84.entry.js → p-703b10b5.entry.js} +1 -1
- package/lmvz-components/p-74c7521c.entry.js +1 -0
- package/lmvz-components/{p-7e9938e7.entry.js → p-80a26307.entry.js} +1 -1
- package/lmvz-components/p-8e1f66dd.entry.js +1 -0
- package/lmvz-components/p-947e1fe6.entry.js +1 -0
- package/lmvz-components/p-B4m1n4et.js +1 -0
- package/lmvz-components/p-CJRqhXjK.js +1 -0
- package/lmvz-components/p-CxfT9IA1.js +1 -0
- package/lmvz-components/p-DuEtnKRj.js +1 -0
- package/lmvz-components/{p-2981a238.entry.js → p-b79af711.entry.js} +1 -1
- package/lmvz-components/p-c00f0d96.entry.js +1 -0
- package/lmvz-components/p-c0d05a97.entry.js +1 -0
- package/lmvz-components/p-c3e8092e.entry.js +1 -0
- package/lmvz-components/{p-fe7999d4.entry.js → p-ed3c2b13.entry.js} +1 -1
- package/lmvz-components/{p-af4e26da.entry.js → p-fa2cd315.entry.js} +1 -1
- package/manifest.json +336 -14
- package/package.json +9 -1
- package/types/api/ds.constants.d.ts +1 -37
- package/types/api/ds.types.d.ts +68 -1
- package/types/components/lmvz-action-list/lmvz-action-list.d.ts +15 -0
- package/types/components/lmvz-button/lmvz-button.d.ts +6 -3
- package/types/components/lmvz-button-group/lmvz-button-group.d.ts +2 -0
- package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +1 -1
- package/types/components/lmvz-chip/lmvz-chip.d.ts +2 -2
- package/types/components/lmvz-header/lmvz-header.d.ts +1 -1
- package/types/components/lmvz-icon/lmvz-icon.d.ts +1 -1
- package/types/components/lmvz-input/lmvz-input.d.ts +1 -1
- package/types/components/lmvz-link/lmvz-link.d.ts +13 -0
- package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +1 -1
- package/types/components/lmvz-modal/lmvz-modal.d.ts +1 -1
- package/types/components/lmvz-radio/lmvz-radio.d.ts +1 -1
- package/types/components/lmvz-select/lmvz-select.d.ts +1 -1
- package/types/components/lmvz-tabs/lmvz-tabs.d.ts +1 -1
- package/types/components/lmvz-toggle/lmvz-toggle.d.ts +1 -1
- package/types/components.d.ts +153 -2
- package/types/index.d.ts +1 -1
- package/types/utils/aria/aria-validation-controller.d.ts +3 -3
- package/types/utils/aria/aria.constants.d.ts +1 -0
- package/types/utils/aria/element-activation-controller.d.ts +1 -1
- package/types/utils/aria/list-keyboard-controller.d.ts +4 -1
- package/types/utils/async/async.util.d.ts +8 -0
- package/types/utils/data/event.utilt.d.ts +4 -0
- package/types/utils/data/number.util.d.ts +2 -0
- package/types/utils/data/object.util.d.ts +5 -0
- package/types/utils/data/time.util.d.ts +1 -0
- package/types/utils/element/element.util.d.ts +21 -0
- package/types/utils/radio/radio-group-controller.d.ts +1 -1
- package/types/utils/{reactive-controller-host.d.ts → stencil/reactive-controller-host.d.ts} +1 -1
- package/types/utils/stencil/stencil.util.d.ts +6 -0
- package/collection/utils/component.js +0 -270
- package/collection/utils/http.js +0 -21
- package/collection/utils/http.unit.js +0 -47
- package/components/p-BxPuC-EQ.js +0 -1
- package/components/p-CtaMrBNE.js +0 -1
- package/components/p-DBZE-Jyu.js +0 -1
- package/components/p-DOTK1OW3.js +0 -1
- package/esm/ds.constants-DWePb-zu.js +0 -13
- package/lmvz-components/p-087853c3.entry.js +0 -1
- package/lmvz-components/p-35b5efdc.entry.js +0 -1
- package/lmvz-components/p-4ba3f830.entry.js +0 -1
- package/lmvz-components/p-83ab106c.entry.js +0 -1
- package/lmvz-components/p-87d207e7.entry.js +0 -1
- package/lmvz-components/p-912776f8.entry.js +0 -1
- package/lmvz-components/p-CtaMrBNE.js +0 -1
- package/lmvz-components/p-DOTK1OW3.js +0 -1
- package/lmvz-components/p-DWePb-zu.js +0 -1
- package/lmvz-components/p-ca497e57.entry.js +0 -1
- package/lmvz-components/p-d8b55d55.entry.js +0 -1
- package/lmvz-components/p-f030f6f6.entry.js +0 -1
- package/types/utils/component.d.ts +0 -33
- package/types/utils/http.d.ts +0 -26
- package/types/utils/http.unit.d.ts +0 -1
- /package/collection/utils/{reactive-controller-host.js → stencil/reactive-controller-host.js} +0 -0
- /package/types/utils/{assets.d.ts → stencil/assets.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @lmvz-ds/components
|
|
2
2
|
|
|
3
|
+
## 0.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0fc8d0d: Action-List Komponente hinzugefügt
|
|
8
|
+
- a706f3c: Stacked-Variante für Button-Group hinzugefügt.
|
|
9
|
+
BREAKING: Die korrekte Reihenfolge der Buttons im Slot ist nun invertiert (1. primary, 2. secondary ...).
|
|
10
|
+
|
|
11
|
+
## 0.30.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 1e7600a: Link Komponente hinzugefügt
|
|
16
|
+
|
|
3
17
|
## 0.29.0
|
|
4
18
|
|
|
5
19
|
## 0.28.1
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const variants = ['primary', 'secondary', 'tertiary'];
|
|
3
4
|
const scaleValues = ['small', 'default', 'large'];
|
|
4
5
|
const sizes = ['xs', 'sm', 'md', 'lg'];
|
|
5
6
|
const textSizes = [...sizes, 'xl'];
|
|
@@ -10,7 +11,11 @@ const iconSizes = [...sizes, 'inherit'];
|
|
|
10
11
|
const iconWeights = ['thin', 'medium', 'bold'];
|
|
11
12
|
const chipTypes = ['active', 'warning', 'success', 'error', 'neutral'];
|
|
12
13
|
const chipSizes = ['default', 'small'];
|
|
14
|
+
const linkTypes = ['internal', 'external'];
|
|
13
15
|
const messageTypes = ['neutral', 'warning'];
|
|
16
|
+
const snackbarStatuses = ['success', 'warning', 'error'];
|
|
17
|
+
const snackbarPriorities = ['low', 'normal', 'high'];
|
|
18
|
+
const snackbarDismissReasons = ['timeout', 'manual', 'action', 'overridden', 'swallowed'];
|
|
14
19
|
|
|
15
20
|
exports.chipSizes = chipSizes;
|
|
16
21
|
exports.chipTypes = chipTypes;
|
|
@@ -18,6 +23,13 @@ exports.iconSizes = iconSizes;
|
|
|
18
23
|
exports.iconWeights = iconWeights;
|
|
19
24
|
exports.inputSizes = inputSizes;
|
|
20
25
|
exports.inputTypes = inputTypes;
|
|
26
|
+
exports.linkTypes = linkTypes;
|
|
21
27
|
exports.messageTypes = messageTypes;
|
|
28
|
+
exports.scaleValues = scaleValues;
|
|
22
29
|
exports.selectSizes = selectSizes;
|
|
30
|
+
exports.sizes = sizes;
|
|
31
|
+
exports.snackbarDismissReasons = snackbarDismissReasons;
|
|
32
|
+
exports.snackbarPriorities = snackbarPriorities;
|
|
33
|
+
exports.snackbarStatuses = snackbarStatuses;
|
|
23
34
|
exports.textSizes = textSizes;
|
|
35
|
+
exports.variants = variants;
|
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const componentOnReady = (el, callback) => {
|
|
4
|
-
if (el.componentOnReady) {
|
|
5
|
-
el.componentOnReady().then((resolvedEl) => callback(resolvedEl));
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
raf(() => callback(el));
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
const inheritAttributes = (el, attributes = []) => {
|
|
12
|
-
const attributeObject = {};
|
|
13
|
-
attributes.forEach((attr) => {
|
|
14
|
-
if (el.hasAttribute(attr)) {
|
|
15
|
-
const value = el.getAttribute(attr);
|
|
16
|
-
if (value !== null) {
|
|
17
|
-
attributeObject[attr] = el.getAttribute(attr);
|
|
18
|
-
}
|
|
19
|
-
el.removeAttribute(attr);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return attributeObject;
|
|
23
|
-
};
|
|
24
3
|
const ariaAttributes = [
|
|
25
4
|
'role',
|
|
26
5
|
'aria-activedescendant',
|
|
@@ -74,6 +53,42 @@ const ariaAttributes = [
|
|
|
74
53
|
'aria-valuenow',
|
|
75
54
|
'aria-valuetext',
|
|
76
55
|
];
|
|
56
|
+
|
|
57
|
+
function isActionButton(element) {
|
|
58
|
+
return ['LMVZ-BUTTON', 'BUTTON'].includes(element.tagName.toUpperCase());
|
|
59
|
+
}
|
|
60
|
+
function isLmvzButton(element) {
|
|
61
|
+
return element?.tagName.toUpperCase() === 'LMVZ-BUTTON';
|
|
62
|
+
}
|
|
63
|
+
function isDisabledButton(element) {
|
|
64
|
+
return element.hasAttribute('disabled') || element.disabled === true;
|
|
65
|
+
}
|
|
66
|
+
function isVisible(element) {
|
|
67
|
+
return !element.hasAttribute('hidden');
|
|
68
|
+
}
|
|
69
|
+
function getActionVariant(element) {
|
|
70
|
+
const variant = element.getAttribute('variant') ?? element.variant;
|
|
71
|
+
return variant === 'primary' || variant === 'secondary' || variant === 'tertiary' ? variant : 'secondary';
|
|
72
|
+
}
|
|
73
|
+
function isPrimaryAction(element) {
|
|
74
|
+
return getActionVariant(element) === 'primary';
|
|
75
|
+
}
|
|
76
|
+
function isSecondaryAction(element) {
|
|
77
|
+
return getActionVariant(element) === 'secondary';
|
|
78
|
+
}
|
|
79
|
+
const inheritAttributes = (el, attributes = []) => {
|
|
80
|
+
const attributeObject = {};
|
|
81
|
+
attributes.forEach((attr) => {
|
|
82
|
+
if (el.hasAttribute(attr)) {
|
|
83
|
+
const value = el.getAttribute(attr);
|
|
84
|
+
if (value !== null) {
|
|
85
|
+
attributeObject[attr] = el.getAttribute(attr);
|
|
86
|
+
}
|
|
87
|
+
el.removeAttribute(attr);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return attributeObject;
|
|
91
|
+
};
|
|
77
92
|
const inheritAriaAttributes = (el, ignoreList) => {
|
|
78
93
|
let attributesToInherit = ariaAttributes;
|
|
79
94
|
if (ignoreList && ignoreList.length > 0) {
|
|
@@ -81,15 +96,6 @@ const inheritAriaAttributes = (el, ignoreList) => {
|
|
|
81
96
|
}
|
|
82
97
|
return inheritAttributes(el, attributesToInherit);
|
|
83
98
|
};
|
|
84
|
-
const raf = (h) => {
|
|
85
|
-
if (typeof __zone_symbol__requestAnimationFrame === 'function') {
|
|
86
|
-
return __zone_symbol__requestAnimationFrame(h);
|
|
87
|
-
}
|
|
88
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
89
|
-
return requestAnimationFrame(h);
|
|
90
|
-
}
|
|
91
|
-
return setTimeout(h);
|
|
92
|
-
};
|
|
93
99
|
function getDeepActiveElement(root = document) {
|
|
94
100
|
let activeElement = root.activeElement;
|
|
95
101
|
if (!activeElement) {
|
|
@@ -137,7 +143,12 @@ function findFormByRef(form, el) {
|
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
exports.canReceiveFocus = canReceiveFocus;
|
|
140
|
-
exports.componentOnReady = componentOnReady;
|
|
141
146
|
exports.findFormByRef = findFormByRef;
|
|
142
147
|
exports.getDeepActiveElement = getDeepActiveElement;
|
|
143
148
|
exports.inheritAriaAttributes = inheritAriaAttributes;
|
|
149
|
+
exports.isActionButton = isActionButton;
|
|
150
|
+
exports.isDisabledButton = isDisabledButton;
|
|
151
|
+
exports.isLmvzButton = isLmvzButton;
|
|
152
|
+
exports.isPrimaryAction = isPrimaryAction;
|
|
153
|
+
exports.isSecondaryAction = isSecondaryAction;
|
|
154
|
+
exports.isVisible = isVisible;
|
package/cjs/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var ariaLoader = require('./aria-loader-BRo2FTGh.js');
|
|
4
|
-
var ds_constants = require('./ds.constants-
|
|
4
|
+
var ds_constants = require('./ds.constants-CKeXfK-s.js');
|
|
5
5
|
var icons = require('./icons-BQASWgk-.js');
|
|
6
6
|
require('./svg-BMBduILB.js');
|
|
7
7
|
require('./logger-DsM6xg6V.js');
|
|
@@ -213,9 +213,16 @@ exports.iconSizes = ds_constants.iconSizes;
|
|
|
213
213
|
exports.iconWeights = ds_constants.iconWeights;
|
|
214
214
|
exports.inputSizes = ds_constants.inputSizes;
|
|
215
215
|
exports.inputTypes = ds_constants.inputTypes;
|
|
216
|
+
exports.linkTypes = ds_constants.linkTypes;
|
|
216
217
|
exports.messageTypes = ds_constants.messageTypes;
|
|
218
|
+
exports.scaleValues = ds_constants.scaleValues;
|
|
217
219
|
exports.selectSizes = ds_constants.selectSizes;
|
|
220
|
+
exports.sizes = ds_constants.sizes;
|
|
221
|
+
exports.snackbarDismissReasons = ds_constants.snackbarDismissReasons;
|
|
222
|
+
exports.snackbarPriorities = ds_constants.snackbarPriorities;
|
|
223
|
+
exports.snackbarStatuses = ds_constants.snackbarStatuses;
|
|
218
224
|
exports.textSizes = ds_constants.textSizes;
|
|
225
|
+
exports.variants = ds_constants.variants;
|
|
219
226
|
exports.getRegisteredIconProvider = icons.getRegisteredIconProvider;
|
|
220
227
|
exports.registerIconProvider = icons.registerIconProvider;
|
|
221
228
|
exports.typedIconFromSet = icons.typedIconFromSet;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var element_util = require('./element.util-Cq4y-_iX.js');
|
|
4
4
|
|
|
5
5
|
const defaultConfig = {
|
|
6
6
|
orientation: 'both',
|
|
@@ -73,9 +73,11 @@ class DirectionalFocusController {
|
|
|
73
73
|
return undefined;
|
|
74
74
|
}
|
|
75
75
|
getManagedActiveElement() {
|
|
76
|
-
const activeElement =
|
|
77
|
-
if (activeElement instanceof HTMLElement
|
|
78
|
-
|
|
76
|
+
const activeElement = element_util.getDeepActiveElement(this.host.el.ownerDocument ?? document);
|
|
77
|
+
if (activeElement instanceof HTMLElement) {
|
|
78
|
+
const match = this.elements.find((el) => resolveElement(el) === activeElement);
|
|
79
|
+
if (match && this.canMoveFocusTo(match))
|
|
80
|
+
return match;
|
|
79
81
|
}
|
|
80
82
|
if (this.currentElement && this.elements.includes(this.currentElement) && this.canMoveFocusTo(this.currentElement)) {
|
|
81
83
|
return this.currentElement;
|
|
@@ -163,11 +165,14 @@ class DirectionalFocusController {
|
|
|
163
165
|
if (this.config.isFocusableElement)
|
|
164
166
|
return this.config.isFocusableElement(element);
|
|
165
167
|
const isTabOrderable = this.config.manageTabIndex || element.tabIndex >= 0;
|
|
166
|
-
return
|
|
167
|
-
element.getAttribute('aria-hidden') !== 'true' &&
|
|
168
|
-
(element.checkVisibility?.() ?? true) &&
|
|
169
|
-
element.offsetParent !== null);
|
|
168
|
+
return isTabOrderable && element.getAttribute('aria-hidden') !== 'true' && (element.checkVisibility?.() ?? true) && element.offsetParent !== null;
|
|
170
169
|
}
|
|
171
170
|
}
|
|
171
|
+
function isDirectionalFocusReceiver(el) {
|
|
172
|
+
return typeof el.resolveFocusableElement === 'function';
|
|
173
|
+
}
|
|
174
|
+
function resolveElement(el) {
|
|
175
|
+
return isDirectionalFocusReceiver(el) ? (el.resolveFocusableElement() ?? el) : el;
|
|
176
|
+
}
|
|
172
177
|
|
|
173
178
|
exports.DirectionalFocusController = DirectionalFocusController;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-TGsVZNDP.js');
|
|
4
|
+
var ariaValidationController = require('./aria-validation-controller-Z4TtOp2l.js');
|
|
5
|
+
var listKeyboardController = require('./list-keyboard-controller-StN6Yn8W.js');
|
|
6
|
+
var reactiveControllerHost = require('./reactive-controller-host-B_lZtcA6.js');
|
|
7
|
+
require('./aria-loader-BRo2FTGh.js');
|
|
8
|
+
require('./element.util-Cq4y-_iX.js');
|
|
9
|
+
|
|
10
|
+
const lmvzActionListCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } hr { height: 0; border: none; margin: var(--lmvz-dimension-4-8, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0; border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0); } } @layer lmvz-ds.components { .lmvz-wrapper-card-sm, .lmvz-wrapper-card-md, .lmvz-wrapper-card-lg { background: var(--lmvz-semantic-color-surface-primary, #ffffff); box-shadow: var(--lmvz-ds-shadow-l3-default-strong, 0 2px 32px 0 rgba(120, 120, 128, 0.11)); } .lmvz-wrapper-card-sm { padding: var(--lmvz-component-wrapper-sm-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)) var(--lmvz-component-wrapper-sm-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); border-radius: var(--lmvz-component-wrapper-sm-border-radius, 14px); } .lmvz-wrapper-card-md { padding: var(--lmvz-component-wrapper-md-padding-y, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)) var(--lmvz-component-wrapper-md-padding-x, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)); border-radius: var(--lmvz-component-wrapper-md-border-radius, 18px); } .lmvz-wrapper-card-lg { padding: var(--lmvz-component-wrapper-lg-padding-y, clamp(2.25rem, 2.19rem + 0.26vw, 2.5rem)) var(--lmvz-component-wrapper-lg-padding-x, clamp(1.5rem, 1.14rem + 1.55vw, 3rem)); border-radius: var(--lmvz-component-wrapper-lg-border-radius, 18px); } } .sc-lmvz-action-list-h { display: flex; flex-direction: column; gap: 0; lmvz-button, button { --lmvz-button-background-override: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color-override: var(--lmvz-semantic-color-int-on-tertiary, #000000); --lmvz-button-radius-override: var(--lmvz-semantic-border-radius-md, 6px); --lmvz-button-padding-inline-override: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --lmvz-button-padding-block-override: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); width: 100%; display: block; &:hover { --lmvz-button-background-override: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); --lmvz-button-color-override: var(--lmvz-semantic-color-int-on-tertiary-hover, #000000); } &:active { --lmvz-button-background-override: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); --lmvz-button-color-override: var(--lmvz-semantic-color-int-on-tertiary-active, #000000); } } .lmvz-action-list-item--danger { --lmvz-button-color-override: var(--lmvz-semantic-color-status-on-danger, #e52a31); &:hover { --lmvz-button-background-override: var(--lmvz-semantic-color-status-danger, #fdf1f2); --lmvz-button-color-override: var(--lmvz-semantic-color-status-on-danger, #e52a31); } &:active { --lmvz-button-background-override: var(--lmvz-semantic-color-status-on-danger-subtle, #f7bfc2); --lmvz-button-color-override: var(--lmvz-semantic-color-status-on-danger, #e52a31); } } }`;
|
|
11
|
+
|
|
12
|
+
const LmvzActionList = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
13
|
+
get el() { return index.getElement(this); }
|
|
14
|
+
slotEl;
|
|
15
|
+
get validationEl() {
|
|
16
|
+
return this.el;
|
|
17
|
+
}
|
|
18
|
+
get validationSlot() {
|
|
19
|
+
return this.slotEl;
|
|
20
|
+
}
|
|
21
|
+
focusController = new listKeyboardController.DirectionalFocusController(this, {
|
|
22
|
+
orientation: 'vertical',
|
|
23
|
+
manageTabIndex: true,
|
|
24
|
+
enableHomeAndEnd: true,
|
|
25
|
+
});
|
|
26
|
+
label;
|
|
27
|
+
constructor(hostRef) {
|
|
28
|
+
super();
|
|
29
|
+
index.registerInstance(this, hostRef);
|
|
30
|
+
this.addController(this.focusController);
|
|
31
|
+
this.addController(new ariaValidationController.AriaValidationController(this, {
|
|
32
|
+
validationTiming: 'slot',
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
componentDidLoad() {
|
|
36
|
+
this.handleSlotChange();
|
|
37
|
+
super.componentDidLoad();
|
|
38
|
+
}
|
|
39
|
+
handleSlotChange = () => {
|
|
40
|
+
const slot = this.slotEl;
|
|
41
|
+
if (!slot)
|
|
42
|
+
return;
|
|
43
|
+
const assigned = slot.assignedElements();
|
|
44
|
+
const interactive = [];
|
|
45
|
+
for (const el of assigned) {
|
|
46
|
+
collectInteractiveButtonsRecursively(el, interactive);
|
|
47
|
+
}
|
|
48
|
+
this.focusController.updateElements(interactive);
|
|
49
|
+
};
|
|
50
|
+
render() {
|
|
51
|
+
const ariaLabel = this.label || undefined;
|
|
52
|
+
return (index.h(index.Host, { key: '79e2d77c9aca02fb3ef2e58d241664598253334b', role: "menu", "aria-label": ariaLabel, class: "lmvz-wrapper-card-sm" }, index.h("slot", { key: '941b875a5be536c3d0e2ff9287da5af1a416d356', onSlotchange: this.handleSlotChange, ref: (el) => (this.slotEl = el) })));
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function collectInteractiveButtonsRecursively(el, collection) {
|
|
56
|
+
const tag = el.tagName.toLowerCase();
|
|
57
|
+
if (tag === 'lmvz-button') {
|
|
58
|
+
el.buttonRole = 'menuitem';
|
|
59
|
+
collection.push(el);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (tag === 'button') {
|
|
63
|
+
el.setAttribute('role', 'menuitem');
|
|
64
|
+
collection.push(el);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (tag === 'hr') {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (el.getAttribute('role') === 'group') {
|
|
71
|
+
const children = el.querySelectorAll('lmvz-button, button');
|
|
72
|
+
children.forEach((child) => collectInteractiveButtonsRecursively(child, collection));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
console.warn('Unexpected element encountered in ActionList:', tag);
|
|
76
|
+
}
|
|
77
|
+
LmvzActionList.style = lmvzActionListCss();
|
|
78
|
+
|
|
79
|
+
exports.lmvz_action_list = LmvzActionList;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-TGsVZNDP.js');
|
|
4
4
|
var ariaLoader = require('./aria-loader-BRo2FTGh.js');
|
|
5
|
-
var
|
|
5
|
+
var ds_constants = require('./ds.constants-CKeXfK-s.js');
|
|
6
|
+
var element_util = require('./element.util-Cq4y-_iX.js');
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Returns a function that delegates to the given predicate/filter and negates its result.
|
|
@@ -18,20 +19,22 @@ function negate(delegate) {
|
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
const lmvzButtonGroupCss = () => `:host{display:flex;
|
|
22
|
+
const lmvzButtonGroupCss = () => `:host{display:flex;flex-flow:row-reverse wrap;gap:var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));font:var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router);}:host([stacked]){flex-flow:column nowrap;align-items:stretch;padding:0}:host([stacked]) ::slotted(*){display:block;width:100%}::slotted([hidden]){display:none !important}:host(:not([data-only-tertiary],[stacked])) ::slotted([data-first-tertiary]){margin-inline-end:auto}:host([data-only-tertiary]:not([stacked])){justify-content:flex-end}`;
|
|
22
23
|
|
|
23
24
|
const LmvzButtonGroup = class {
|
|
24
25
|
constructor(hostRef) {
|
|
25
26
|
index.registerInstance(this, hostRef);
|
|
26
27
|
}
|
|
28
|
+
get el() { return index.getElement(this); }
|
|
27
29
|
actionsSlot;
|
|
28
30
|
validationMessageCache = [];
|
|
29
31
|
actionsStateObserver;
|
|
32
|
+
stacked = false;
|
|
30
33
|
get primaryEnabledAction() {
|
|
31
|
-
return this.enabledButtons.find(isPrimaryAction) ?? this.enabledButtons[0];
|
|
34
|
+
return this.enabledButtons.find(element_util.isPrimaryAction) ?? this.enabledButtons[0];
|
|
32
35
|
}
|
|
33
36
|
get hasActions() {
|
|
34
|
-
return this.assignedButtons.some((element) => isVisible(element) && isActionButton(element) && !isDisabledButton(element));
|
|
37
|
+
return this.assignedButtons.some((element) => element_util.isVisible(element) && element_util.isActionButton(element) && !element_util.isDisabledButton(element));
|
|
35
38
|
}
|
|
36
39
|
componentDidLoad() {
|
|
37
40
|
this.handleActionsSlotChange();
|
|
@@ -43,38 +46,38 @@ const LmvzButtonGroup = class {
|
|
|
43
46
|
return this.actionsSlot?.assignedElements({ flatten: true }) ?? [];
|
|
44
47
|
}
|
|
45
48
|
get assignedButtons() {
|
|
46
|
-
return this.assignedElements.filter(isActionButton);
|
|
49
|
+
return this.assignedElements.filter(element_util.isActionButton);
|
|
47
50
|
}
|
|
48
51
|
get visibleButtons() {
|
|
49
|
-
return this.assignedButtons.filter(isVisible);
|
|
52
|
+
return this.assignedButtons.filter(element_util.isVisible);
|
|
50
53
|
}
|
|
51
54
|
get enabledButtons() {
|
|
52
|
-
return this.visibleButtons.filter(negate(isDisabledButton));
|
|
55
|
+
return this.visibleButtons.filter(negate(element_util.isDisabledButton));
|
|
53
56
|
}
|
|
54
57
|
getActionValidationResult() {
|
|
55
58
|
if (!this.visibleButtons.length) {
|
|
56
59
|
return [];
|
|
57
60
|
}
|
|
58
|
-
const primaryActions = this.visibleButtons.filter(isPrimaryAction);
|
|
59
|
-
const secondaryActions = this.visibleButtons.filter(isSecondaryAction);
|
|
61
|
+
const primaryActions = this.visibleButtons.filter(element_util.isPrimaryAction);
|
|
62
|
+
const secondaryActions = this.visibleButtons.filter(element_util.isSecondaryAction);
|
|
60
63
|
const issues = [];
|
|
61
|
-
const order = this.visibleButtons
|
|
64
|
+
const order = this.visibleButtons;
|
|
62
65
|
if (primaryActions.length !== 1)
|
|
63
|
-
issues.push('
|
|
66
|
+
issues.push('LmvzButtonGroup actions slot should contain exactly one primary action.');
|
|
64
67
|
if (secondaryActions.length > 1)
|
|
65
|
-
issues.push(`
|
|
68
|
+
issues.push(`LmvzButtonGroup actions slot should contain at most one secondary action (received ${secondaryActions.length})`);
|
|
66
69
|
if (primaryActions.length) {
|
|
67
70
|
const primaryAction = primaryActions[0];
|
|
68
71
|
const secondaryAction = secondaryActions[0];
|
|
69
72
|
if (order.indexOf(primaryAction) !== 0)
|
|
70
|
-
issues.push('Primary action
|
|
73
|
+
issues.push('Primary action should be the first focusable element in the actions slot (i.e. first child of the actions slot).');
|
|
71
74
|
if (secondaryAction && order.indexOf(secondaryAction) !== 1)
|
|
72
|
-
issues.push('Secondary action
|
|
75
|
+
issues.push('Secondary action should be the second focusable element in the actions slot (i.e. immediately after the primary button).');
|
|
73
76
|
}
|
|
74
77
|
else if (secondaryActions.length) {
|
|
75
78
|
const secondaryAction = secondaryActions[0];
|
|
76
79
|
if (order.indexOf(secondaryAction) !== 0)
|
|
77
|
-
issues.push('Secondary action
|
|
80
|
+
issues.push('Secondary action should be the first focusable element in the actions slot when no primary action is present (i.e. first child of the actions slot).');
|
|
78
81
|
}
|
|
79
82
|
return issues;
|
|
80
83
|
}
|
|
@@ -112,20 +115,35 @@ const LmvzButtonGroup = class {
|
|
|
112
115
|
}
|
|
113
116
|
});
|
|
114
117
|
this.checkActions();
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
const visibleButtons = this.visibleButtons;
|
|
119
|
+
const hasNonTertiary = visibleButtons.length > 0 && visibleButtons.some((btn) => element_util.isPrimaryAction(btn) || element_util.isSecondaryAction(btn));
|
|
120
|
+
if (visibleButtons.length > 0 && !hasNonTertiary) {
|
|
121
|
+
this.el.setAttribute('data-only-tertiary', '');
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
this.el.removeAttribute('data-only-tertiary');
|
|
125
|
+
}
|
|
126
|
+
this.visibleButtons.forEach((element, i) => {
|
|
127
|
+
const variant = ds_constants.variants[i] ?? 'tertiary';
|
|
119
128
|
if (!element)
|
|
120
|
-
|
|
121
|
-
if (isLmvzButton(element)) {
|
|
122
|
-
if (!element.getAttribute('variant'))
|
|
129
|
+
return;
|
|
130
|
+
if (element_util.isLmvzButton(element)) {
|
|
131
|
+
if (!element.getAttribute('variant') && !element.variant)
|
|
123
132
|
element.setAttribute('variant', variant);
|
|
124
133
|
}
|
|
125
134
|
else {
|
|
126
135
|
element.classList.add(variant);
|
|
127
136
|
}
|
|
128
|
-
}
|
|
137
|
+
});
|
|
138
|
+
const firstTertiary = this.visibleButtons.find((btn) => btn.getAttribute('variant') === 'tertiary');
|
|
139
|
+
this.visibleButtons.forEach((btn) => {
|
|
140
|
+
if (btn === firstTertiary) {
|
|
141
|
+
btn.setAttribute('data-first-tertiary', '');
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
btn.removeAttribute('data-first-tertiary');
|
|
145
|
+
}
|
|
146
|
+
});
|
|
129
147
|
this.focusPrimaryAction();
|
|
130
148
|
}
|
|
131
149
|
focusPrimaryAction() {
|
|
@@ -133,7 +151,7 @@ const LmvzButtonGroup = class {
|
|
|
133
151
|
if (!focusTarget || typeof window === 'undefined')
|
|
134
152
|
return;
|
|
135
153
|
window.requestAnimationFrame(() => {
|
|
136
|
-
if (
|
|
154
|
+
if (element_util.canReceiveFocus(focusTarget)) {
|
|
137
155
|
focusTarget.focus();
|
|
138
156
|
}
|
|
139
157
|
});
|
|
@@ -153,31 +171,9 @@ const LmvzButtonGroup = class {
|
|
|
153
171
|
});
|
|
154
172
|
}
|
|
155
173
|
render() {
|
|
156
|
-
return (index.h(index.Host, { key: '
|
|
174
|
+
return (index.h(index.Host, { key: '3e8ce38f7e83e201e47d31579f22161ff36247b1' }, index.h("slot", { key: 'bc953d19b333f51c5f5c5ba86be3a85d155a29d1', ref: (element) => (this.actionsSlot = element), onSlotchange: this.handleActionsSlotChange })));
|
|
157
175
|
}
|
|
158
176
|
};
|
|
159
|
-
function isActionButton(element) {
|
|
160
|
-
return ['LMVZ-BUTTON', 'BUTTON'].includes(element.tagName.toUpperCase());
|
|
161
|
-
}
|
|
162
|
-
function isLmvzButton(element) {
|
|
163
|
-
return element?.tagName.toUpperCase() === 'LMVZ-BUTTON';
|
|
164
|
-
}
|
|
165
|
-
function isDisabledButton(element) {
|
|
166
|
-
return element.hasAttribute('disabled') || element.disabled === true;
|
|
167
|
-
}
|
|
168
|
-
function isVisible(element) {
|
|
169
|
-
return !element.hasAttribute('hidden');
|
|
170
|
-
}
|
|
171
|
-
function getActionVariant(element) {
|
|
172
|
-
const variant = element.getAttribute('variant') ?? element.variant;
|
|
173
|
-
return variant === 'primary' || variant === 'secondary' || variant === 'tertiary' ? variant : 'secondary';
|
|
174
|
-
}
|
|
175
|
-
function isPrimaryAction(element) {
|
|
176
|
-
return getActionVariant(element) === 'primary';
|
|
177
|
-
}
|
|
178
|
-
function isSecondaryAction(element) {
|
|
179
|
-
return getActionVariant(element) === 'secondary';
|
|
180
|
-
}
|
|
181
177
|
LmvzButtonGroup.style = lmvzButtonGroupCss();
|
|
182
178
|
|
|
183
179
|
exports.lmvz_button_group = LmvzButtonGroup;
|
|
@@ -4,14 +4,14 @@ var index = require('./index-TGsVZNDP.js');
|
|
|
4
4
|
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
5
5
|
var ariaValidationController = require('./aria-validation-controller-Z4TtOp2l.js');
|
|
6
6
|
var elementActivationController = require('./element-activation-controller-DC_6T0Rt.js');
|
|
7
|
-
var
|
|
7
|
+
var element_util = require('./element.util-Cq4y-_iX.js');
|
|
8
8
|
var reactiveControllerHost = require('./reactive-controller-host-B_lZtcA6.js');
|
|
9
9
|
var svg = require('./svg-BMBduILB.js');
|
|
10
10
|
var icons = require('./icons-BQASWgk-.js');
|
|
11
11
|
require('./aria-loader-BRo2FTGh.js');
|
|
12
12
|
require('./logger-DsM6xg6V.js');
|
|
13
13
|
|
|
14
|
-
const lmvzButtonCss = () => ` @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } } :host { button {
|
|
14
|
+
const lmvzButtonCss = () => ` @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } hr { height: 0; border: none; margin: var(--lmvz-dimension-4-8, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0; border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0); } } :host { button { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary, #000000)); --lmvz-button-radius: var(--lmvz-button-radius-override, var(--lmvz-component-input-radius-default, 999px)); --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); min-height: var(--lmvz-button-min-height); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); position: relative; z-index: 1; } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0)); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-active, #d4d4d4)); } button.primary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary, #000000)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); } button.primary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-hover, #2e2e2e)); } button.primary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-active, #545454)); } button.secondary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary, #000000)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary-hover, #000000)); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-active, #d4d4d4)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary-active, #000000)); } button.tertiary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary, #ffffff)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary, #000000)); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-hover, #000000)); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-active, #000000)); } button.small { --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-sm-strong, 500 clamp(0.69rem, 0.67rem + 0.06vw, 0.75rem) / 1.5 Router)); } button.large { --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-lg-strong, 500 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5 Router)); } display: inline-block; button { width: 100%; } } button { width: 100%; } ::slotted(*) { --lmvz-component-color: var(--lmvz-button-color); } `;
|
|
15
15
|
|
|
16
16
|
const LmvzButton = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
17
17
|
get el() { return index.getElement(this); }
|
|
@@ -20,8 +20,9 @@ const LmvzButton = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
20
20
|
formEl = null;
|
|
21
21
|
formButtonEl = null;
|
|
22
22
|
lmvzActivation;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
ti = 0;
|
|
24
|
+
resolveFocusableElement() {
|
|
25
|
+
return this.validationEl;
|
|
25
26
|
}
|
|
26
27
|
scale = 'default';
|
|
27
28
|
variant;
|
|
@@ -31,6 +32,7 @@ const LmvzButton = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
31
32
|
formMethod;
|
|
32
33
|
name;
|
|
33
34
|
value;
|
|
35
|
+
buttonRole;
|
|
34
36
|
constructor(hostRef) {
|
|
35
37
|
super();
|
|
36
38
|
index.registerInstance(this, hostRef);
|
|
@@ -42,7 +44,7 @@ const LmvzButton = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
42
44
|
}));
|
|
43
45
|
}
|
|
44
46
|
connectedCallback() {
|
|
45
|
-
this.inheritedAttributes =
|
|
47
|
+
this.inheritedAttributes = element_util.inheritAriaAttributes(this.el, ['role']);
|
|
46
48
|
super.connectedCallback();
|
|
47
49
|
}
|
|
48
50
|
disconnectedCallback() {
|
|
@@ -58,7 +60,7 @@ const LmvzButton = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
58
60
|
this.formEl = null;
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
|
-
const formEl =
|
|
63
|
+
const formEl = element_util.findFormByRef(this.form, this.el);
|
|
62
64
|
if (!formEl) {
|
|
63
65
|
this.formButtonEl?.remove();
|
|
64
66
|
this.formButtonEl = null;
|
|
@@ -99,7 +101,7 @@ const LmvzButton = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
99
101
|
};
|
|
100
102
|
render() {
|
|
101
103
|
this.renderHiddenButton();
|
|
102
|
-
return (index.h(index.Host, { key: '
|
|
104
|
+
return (index.h(index.Host, { key: 'f3e619dca398c3a8a78e9d2f8c3df4178b2531b2', role: "presentation" }, index.h("button", { key: 'eb1aac6756a70968d3a72cb40c1d52d96340423e', ref: (e) => (this.validationEl = e), part: "button", role: this.buttonRole, disabled: this.disabled, type: this.type, class: index$1.classNames(this.variant ?? 'secondary', { [this.scale ?? '']: !!this.scale, disabled: this.disabled }), ...this.inheritedAttributes }, index.h("slot", { key: '786ff1c10ae05eda646c77ac8779813be6e51949' }))));
|
|
103
105
|
}
|
|
104
106
|
static get delegatesFocus() { return true; }
|
|
105
107
|
};
|
|
@@ -162,7 +164,7 @@ const LmvzIcon = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
|
162
164
|
super.componentDidRender();
|
|
163
165
|
}
|
|
164
166
|
render() {
|
|
165
|
-
return index.h(index.Host, { key: '
|
|
167
|
+
return index.h(index.Host, { key: '4fba217d573d968951819f12af24d775c8ac62dc', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
166
168
|
}
|
|
167
169
|
waitUntilVisible(callback, rootMargin = 50) {
|
|
168
170
|
if (typeof window === 'undefined' || !window.IntersectionObserver) {
|