@lmvz-ds/components 0.22.0 → 0.23.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 +17 -0
- package/cjs/{aria-loader-Cec1zR2g.js → aria-loader-BRo2FTGh.js} +1 -0
- package/cjs/index.cjs.js +1 -1
- package/cjs/lmvz-button_3.cjs.entry.js +375 -0
- package/cjs/lmvz-card.cjs.entry.js +2 -2
- package/cjs/lmvz-checkbox.cjs.entry.js +3 -3
- 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 +4 -4
- package/cjs/lmvz-menuitem.cjs.entry.js +3 -3
- package/cjs/lmvz-modal.cjs.entry.js +6 -109
- package/cjs/lmvz-select.cjs.entry.js +3 -3
- package/cjs/lmvz-toggle.cjs.entry.js +3 -3
- package/cjs/loader.cjs.js +1 -1
- package/cjs/{reactive-controller-host-DnSTWHCF.js → reactive-controller-host-BOFg4vL-.js} +1 -1
- package/collection/collection-manifest.json +1 -0
- package/collection/components/lmvz-button/lmvz-button.css +28 -17
- package/collection/components/lmvz-button/lmvz-button.js +6 -7
- package/collection/components/lmvz-button-group/lmvz-button-group.css +14 -0
- package/collection/components/lmvz-button-group/lmvz-button-group.js +216 -0
- package/collection/components/lmvz-card/lmvz-card.css +27 -16
- package/collection/components/lmvz-card/lmvz-card.js +1 -1
- package/collection/components/lmvz-checkbox/lmvz-checkbox.js +1 -1
- package/collection/components/lmvz-chip/lmvz-chip.js +1 -1
- package/collection/components/lmvz-header/lmvz-header.js +1 -1
- package/collection/components/lmvz-icon/lmvz-icon.js +1 -1
- package/collection/components/lmvz-input/lmvz-input.js +2 -2
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
- package/collection/components/lmvz-modal/lmvz-modal.css +24 -30
- package/collection/components/lmvz-modal/lmvz-modal.js +4 -108
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/components/lmvz-toggle/lmvz-toggle.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.bak +2 -0
- package/components/index.js +1 -1
- package/components/lmvz-button-group.d.ts +11 -0
- package/components/lmvz-button-group.d.ts.bak +11 -0
- package/components/lmvz-button-group.js +1 -0
- 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-menuitem.js +1 -1
- package/components/lmvz-modal.js +1 -1
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-toggle.js +1 -1
- package/components/p-CdDO7mQa.js +1 -0
- package/components/p-Cg2XX_J-.js +1 -0
- package/components/p-DSvYtVoD.js +1 -0
- package/components/p-K_EPq-vy.js +1 -0
- package/components/p-slgmfnHm.js +1 -0
- package/esm/{aria-loader-BVolm0lC.js → aria-loader-GfsGHZHY.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/lmvz-button_3.entry.js +371 -0
- package/esm/lmvz-card.entry.js +2 -2
- package/esm/lmvz-checkbox.entry.js +3 -3
- 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 +4 -4
- package/esm/lmvz-menuitem.entry.js +3 -3
- package/esm/lmvz-modal.entry.js +6 -109
- package/esm/lmvz-select.entry.js +3 -3
- package/esm/lmvz-toggle.entry.js +3 -3
- package/esm/loader.js +1 -1
- package/esm/{reactive-controller-host-lF2kXM1x.js → reactive-controller-host-CroMsXdS.js} +1 -1
- package/hydrate/index.js +268 -184
- package/hydrate/index.mjs +268 -184
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/p-05896617.entry.js +1 -0
- package/lmvz-components/{p-1b181e90.entry.js → p-267344a7.entry.js} +1 -1
- package/lmvz-components/{p-ea335543.entry.js → p-2b09b8bc.entry.js} +1 -1
- package/lmvz-components/p-3df92762.entry.js +1 -0
- package/lmvz-components/{p-f8ea0eb2.entry.js → p-5f550b9f.entry.js} +1 -1
- package/lmvz-components/p-8e43fabb.entry.js +1 -0
- package/lmvz-components/{p-DCTzMRMQ.js → p-BRl6zKXT.js} +1 -1
- package/lmvz-components/p-CdDO7mQa.js +1 -0
- package/lmvz-components/p-d1dacf7e.entry.js +1 -0
- package/lmvz-components/{p-d984e118.entry.js → p-f6d1d9df.entry.js} +1 -1
- package/lmvz-components/p-f7f32879.entry.js +1 -0
- package/lmvz-components/{p-08a08b63.entry.js → p-fa4e00cf.entry.js} +1 -1
- package/manifest.json +105 -11
- package/package.json +5 -1
- package/types/components/lmvz-button/lmvz-button.d.ts +1 -1
- package/types/components/lmvz-button-group/lmvz-button-group.d.ts +20 -0
- package/types/components/lmvz-modal/lmvz-modal.d.ts +1 -16
- package/types/components.d.ts +27 -3
- package/cjs/lmvz-button_2.cjs.entry.js +0 -198
- package/components/p-Boj0PCdB.js +0 -1
- package/components/p-Cc6dOWwS.js +0 -1
- package/components/p-DBc1BzQb.js +0 -1
- package/esm/lmvz-button_2.entry.js +0 -195
- package/lmvz-components/p-23fb2476.entry.js +0 -1
- package/lmvz-components/p-6bb145e4.entry.js +0 -1
- package/lmvz-components/p-7a310b1e.entry.js +0 -1
- package/lmvz-components/p-b7940687.entry.js +0 -1
- package/lmvz-components/p-db8306a5.entry.js +0 -1
- package/lmvz-components/p-dhVSUYqd.js +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { negate } from "@lmvz-ds/lib-ts/stream/negate.js";
|
|
3
|
+
import { isAriaValidationEnabled } from "../..";
|
|
4
|
+
import { canReceiveFocus } from "../../utils/component";
|
|
5
|
+
export class LmvzButtonGroup {
|
|
6
|
+
actionsSlot;
|
|
7
|
+
validationMessageCache = [];
|
|
8
|
+
actionsStateObserver;
|
|
9
|
+
get primaryEnabledAction() {
|
|
10
|
+
return this.enabledButtons.find(isPrimaryAction) ?? this.enabledButtons[0];
|
|
11
|
+
}
|
|
12
|
+
get hasActions() {
|
|
13
|
+
return this.assignedButtons.some((element) => isVisible(element) && isActionButton(element) && !isDisabledButton(element));
|
|
14
|
+
}
|
|
15
|
+
componentDidLoad() {
|
|
16
|
+
this.handleActionsSlotChange();
|
|
17
|
+
}
|
|
18
|
+
disconnectedCallback() {
|
|
19
|
+
this.actionsStateObserver?.disconnect();
|
|
20
|
+
}
|
|
21
|
+
get assignedElements() {
|
|
22
|
+
return this.actionsSlot?.assignedElements({ flatten: true }) ?? [];
|
|
23
|
+
}
|
|
24
|
+
get assignedButtons() {
|
|
25
|
+
return this.assignedElements.filter(isActionButton);
|
|
26
|
+
}
|
|
27
|
+
get visibleButtons() {
|
|
28
|
+
return this.assignedButtons.filter(isVisible);
|
|
29
|
+
}
|
|
30
|
+
get enabledButtons() {
|
|
31
|
+
return this.visibleButtons.filter(negate(isDisabledButton));
|
|
32
|
+
}
|
|
33
|
+
getActionValidationResult() {
|
|
34
|
+
if (!this.visibleButtons.length) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
const primaryActions = this.visibleButtons.filter(isPrimaryAction);
|
|
38
|
+
const secondaryActions = this.visibleButtons.filter(isSecondaryAction);
|
|
39
|
+
const issues = [];
|
|
40
|
+
const order = this.visibleButtons.toReversed();
|
|
41
|
+
if (primaryActions.length !== 1)
|
|
42
|
+
issues.push('LmvzModal actions slot must contain exactly one primary action.');
|
|
43
|
+
if (secondaryActions.length > 1)
|
|
44
|
+
issues.push(`LmvzModal actions slot must contain at most one secondary action (received ${secondaryActions.length})`);
|
|
45
|
+
if (primaryActions.length) {
|
|
46
|
+
const primaryAction = primaryActions[0];
|
|
47
|
+
const secondaryAction = secondaryActions[0];
|
|
48
|
+
if (order.indexOf(primaryAction) !== 0)
|
|
49
|
+
issues.push('Primary action must be the last focusable element in the actions slot (i.e. rightmost button).');
|
|
50
|
+
if (secondaryAction && order.indexOf(secondaryAction) !== 1)
|
|
51
|
+
issues.push('Secondary action must be the second-to-last focusable element in the actions slot (i.e. left of primary button).');
|
|
52
|
+
}
|
|
53
|
+
else if (secondaryActions.length) {
|
|
54
|
+
const secondaryAction = secondaryActions[0];
|
|
55
|
+
if (order.indexOf(secondaryAction) !== 0)
|
|
56
|
+
issues.push('Secondary action must be the last focusable element in the actions slot when no primary action is present (i.e. rightmost button).');
|
|
57
|
+
}
|
|
58
|
+
return issues;
|
|
59
|
+
}
|
|
60
|
+
handleActionsSlotChange = () => {
|
|
61
|
+
this.observeActionState();
|
|
62
|
+
this.syncActionsState();
|
|
63
|
+
};
|
|
64
|
+
observeActionState() {
|
|
65
|
+
if (typeof MutationObserver === 'undefined')
|
|
66
|
+
return;
|
|
67
|
+
this.actionsStateObserver?.disconnect();
|
|
68
|
+
if (!this.assignedButtons.length)
|
|
69
|
+
return;
|
|
70
|
+
this.actionsStateObserver = new MutationObserver(() => {
|
|
71
|
+
this.syncActionsState();
|
|
72
|
+
});
|
|
73
|
+
this.assignedButtons.forEach((element) => {
|
|
74
|
+
this.actionsStateObserver?.observe(element, {
|
|
75
|
+
attributes: true,
|
|
76
|
+
attributeFilter: ['disabled', 'hidden', 'variant'],
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
syncActionsState() {
|
|
81
|
+
const assignedElements = this.assignedElements;
|
|
82
|
+
assignedElements.forEach((element) => {
|
|
83
|
+
const isAllowedAction = ['LMVZ-BUTTON', 'BUTTON'].includes(element.tagName.toUpperCase());
|
|
84
|
+
if (isAllowedAction)
|
|
85
|
+
return;
|
|
86
|
+
if (!element.hasAttribute('hidden')) {
|
|
87
|
+
element.setAttribute('hidden', '');
|
|
88
|
+
}
|
|
89
|
+
if (element.getAttribute('aria-hidden') !== 'true') {
|
|
90
|
+
element.setAttribute('aria-hidden', 'true');
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
this.checkActions();
|
|
94
|
+
const length = this.visibleButtons.length;
|
|
95
|
+
for (let i = 0; i < length; i++) {
|
|
96
|
+
const variant = i === length - 1 ? 'primary' : i === length - 2 ? 'secondary' : 'tertiary';
|
|
97
|
+
const element = this.visibleButtons.at(i);
|
|
98
|
+
if (!element)
|
|
99
|
+
continue;
|
|
100
|
+
if (isLmvzButton(element)) {
|
|
101
|
+
if (!element.getAttribute('variant'))
|
|
102
|
+
element.setAttribute('variant', variant);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
element.classList.add(variant);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
this.focusPrimaryAction();
|
|
109
|
+
}
|
|
110
|
+
focusPrimaryAction() {
|
|
111
|
+
const focusTarget = this.primaryEnabledAction;
|
|
112
|
+
if (!focusTarget || typeof window === 'undefined')
|
|
113
|
+
return;
|
|
114
|
+
window.requestAnimationFrame(() => {
|
|
115
|
+
if (canReceiveFocus(focusTarget)) {
|
|
116
|
+
focusTarget.focus();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
checkActions() {
|
|
121
|
+
if (!isAriaValidationEnabled())
|
|
122
|
+
return;
|
|
123
|
+
const issues = this.getActionValidationResult();
|
|
124
|
+
if (!issues.length) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
issues.forEach((issue) => {
|
|
128
|
+
if (this.validationMessageCache.includes(issue))
|
|
129
|
+
return;
|
|
130
|
+
console.warn(issue);
|
|
131
|
+
this.validationMessageCache.push(issue);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
render() {
|
|
135
|
+
return (h(Host, { key: '56b60821ecaa2301d13e78d621e873aa74cd170e' }, h("slot", { key: 'e6a1422950fa5b0026356b7788a607a690116186', ref: (element) => (this.actionsSlot = element), onSlotchange: this.handleActionsSlotChange })));
|
|
136
|
+
}
|
|
137
|
+
static get is() { return "lmvz-button-group"; }
|
|
138
|
+
static get encapsulation() { return "shadow"; }
|
|
139
|
+
static get originalStyleUrls() {
|
|
140
|
+
return {
|
|
141
|
+
"$": ["lmvz-button-group.css"]
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
static get styleUrls() {
|
|
145
|
+
return {
|
|
146
|
+
"$": ["lmvz-button-group.css"]
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
static get properties() {
|
|
150
|
+
return {
|
|
151
|
+
"primaryEnabledAction": {
|
|
152
|
+
"type": "unknown",
|
|
153
|
+
"mutable": false,
|
|
154
|
+
"complexType": {
|
|
155
|
+
"original": "HTMLButtonElement | undefined",
|
|
156
|
+
"resolved": "HTMLButtonElement | undefined",
|
|
157
|
+
"references": {
|
|
158
|
+
"HTMLButtonElement": {
|
|
159
|
+
"location": "global",
|
|
160
|
+
"id": "global::HTMLButtonElement"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": ""
|
|
169
|
+
},
|
|
170
|
+
"getter": true,
|
|
171
|
+
"setter": false
|
|
172
|
+
},
|
|
173
|
+
"hasActions": {
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "boolean",
|
|
178
|
+
"resolved": "boolean",
|
|
179
|
+
"references": {}
|
|
180
|
+
},
|
|
181
|
+
"required": false,
|
|
182
|
+
"optional": false,
|
|
183
|
+
"docs": {
|
|
184
|
+
"tags": [],
|
|
185
|
+
"text": ""
|
|
186
|
+
},
|
|
187
|
+
"getter": true,
|
|
188
|
+
"setter": false,
|
|
189
|
+
"reflect": false,
|
|
190
|
+
"attribute": "has-actions"
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function isActionButton(element) {
|
|
196
|
+
return ['LMVZ-BUTTON', 'BUTTON'].includes(element.tagName.toUpperCase());
|
|
197
|
+
}
|
|
198
|
+
function isLmvzButton(element) {
|
|
199
|
+
return element?.tagName.toUpperCase() === 'LMVZ-BUTTON';
|
|
200
|
+
}
|
|
201
|
+
function isDisabledButton(element) {
|
|
202
|
+
return element.hasAttribute('disabled') || element.disabled === true;
|
|
203
|
+
}
|
|
204
|
+
function isVisible(element) {
|
|
205
|
+
return !element.hasAttribute('hidden');
|
|
206
|
+
}
|
|
207
|
+
function getActionVariant(element) {
|
|
208
|
+
const variant = element.getAttribute('variant') ?? element.variant;
|
|
209
|
+
return variant === 'primary' || variant === 'secondary' || variant === 'tertiary' ? variant : 'secondary';
|
|
210
|
+
}
|
|
211
|
+
function isPrimaryAction(element) {
|
|
212
|
+
return getActionVariant(element) === 'primary';
|
|
213
|
+
}
|
|
214
|
+
function isSecondaryAction(element) {
|
|
215
|
+
return getActionVariant(element) === 'secondary';
|
|
216
|
+
}
|
|
@@ -47,13 +47,18 @@ h6 {
|
|
|
47
47
|
margin: 0;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
*[hidden] {
|
|
51
|
+
display: none !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
}
|
|
51
55
|
:host {
|
|
52
56
|
/** component dependencies */
|
|
53
57
|
/* * the (invalid nested) import will be handled by postcss */
|
|
54
58
|
/* stylelint-disable no-invalid-position-at-import-rule */
|
|
55
59
|
button {
|
|
56
|
-
|
|
60
|
+
/* secondary styling is default, primary is explicit */
|
|
61
|
+
--lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-secondary, #000000));
|
|
57
62
|
--lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)));
|
|
58
63
|
--lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)));
|
|
59
64
|
--lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
@@ -62,7 +67,7 @@ h6 {
|
|
|
62
67
|
--lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px);
|
|
63
68
|
--lmvz-button-border-width: 0;
|
|
64
69
|
--lmvz-button-border-color: transparent;
|
|
65
|
-
--lmvz-button-background: var(--lmvz-semantic-color-int-
|
|
70
|
+
--lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0);
|
|
66
71
|
|
|
67
72
|
display: inline-flex;
|
|
68
73
|
align-items: center;
|
|
@@ -109,18 +114,35 @@ button:is([disabled], .disabled) {
|
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
button:not([disabled]):hover {
|
|
112
|
-
--lmvz-button-background: var(--lmvz-semantic-color-int-
|
|
117
|
+
--lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0);
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
button:not([disabled]):active {
|
|
121
|
+
--lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
button.primary {
|
|
125
|
+
--lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000);
|
|
126
|
+
--lmvz-button-color: var(--lmvz-semantic-color-int-on-primary, #ffffff);
|
|
127
|
+
--lmvz-button-border-width: 0;
|
|
128
|
+
--lmvz-button-border-color: transparent;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
button.primary:not([disabled], .disabled):hover {
|
|
132
|
+
--lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e);
|
|
133
|
+
--lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
button.primary:not([disabled], .disabled):active {
|
|
116
137
|
--lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454);
|
|
138
|
+
--lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #0f8acc);
|
|
117
139
|
}
|
|
118
140
|
|
|
119
141
|
button.secondary {
|
|
120
142
|
--lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0);
|
|
121
143
|
--lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000);
|
|
122
|
-
--lmvz-button-border-width:
|
|
123
|
-
--lmvz-button-border-color:
|
|
144
|
+
--lmvz-button-border-width: 0;
|
|
145
|
+
--lmvz-button-border-color: transparent;
|
|
124
146
|
}
|
|
125
147
|
|
|
126
148
|
button.secondary:not([disabled], .disabled):hover {
|
|
@@ -133,12 +155,6 @@ button.secondary:not([disabled], .disabled):active {
|
|
|
133
155
|
--lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #0f8acc);
|
|
134
156
|
}
|
|
135
157
|
|
|
136
|
-
/* button.secondary:is([disabled], .disabled) {
|
|
137
|
-
--lmvz-button-background: var(--lmvz-global-color-neutral-200);
|
|
138
|
-
--lmvz-button-border-color: var(--lmvz-global-color-neutral-400);
|
|
139
|
-
--lmvz-button-color: var(--lmvz-global-color-neutral-700);
|
|
140
|
-
} */
|
|
141
|
-
|
|
142
158
|
button.tertiary {
|
|
143
159
|
--lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff);
|
|
144
160
|
--lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454);
|
|
@@ -152,11 +168,6 @@ button.tertiary:not([disabled], .disabled):active {
|
|
|
152
168
|
--lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0);
|
|
153
169
|
}
|
|
154
170
|
|
|
155
|
-
/* button.tertiary:is([disabled], .disabled) {
|
|
156
|
-
--lmvz-button-background: var(--lmvz-global-color-neutral-100);
|
|
157
|
-
--lmvz-button-color: var(--lmvz-global-color-neutral-600);
|
|
158
|
-
} */
|
|
159
|
-
|
|
160
171
|
button.small {
|
|
161
172
|
--lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
162
173
|
--lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
@@ -19,7 +19,7 @@ export class LmvzCard {
|
|
|
19
19
|
const imgStyle = {
|
|
20
20
|
backgroundImage: `url(${this.imageUrl ?? this.fallbackImage})`,
|
|
21
21
|
};
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: '2d9ecdeed986f142fb7ff477b56dece59549bbc7', role: "article" }, h("div", { key: '34fc9c3a1338b31ce73424e8c07c79a291ead85c', class: "top" }, h("div", { key: '1756e6b26d7f42499753c36ed0fc13755fe32bfe', class: "image-wrapper", style: imgStyle }, h("div", { key: 'cd8be8acc9e949092b6363024316d12d445a9fbc', class: "chip-slot" }, h("slot", { key: '26389ab3b7031b948ff1701857e6028446662cf5', name: "chip" })))), h("div", { key: '2fa61cd7bef437f15929ae39be7fa294e8778321', class: "bottom" }, h("header", { key: 'b237ca025e42a29f528f827dc3c83b3b0f9267c0' }, h("h2", { key: 'ffd0a509ba97acb75d4c15d0fd01eef08689a2a7', class: "title" }, this.cardTitle)), h("p", { key: 'c40bd5d5f7e41a0cebc2f7f9e572ba98cc892cc1', class: "description" }, this.description), h("div", { key: '7663f93b41ef1e798b464bd6ad75ca8a53c0667b', class: "actions" }, h("button", { key: '3348e6700aa1571183558ab8fe4f73393c1cc943', class: "primary", onClick: this._onPrimaryClick.bind(this), "data-testid": "primary" }, this.primaryActionLabel), h("button", { key: 'd3a12cdabbdd68c3b04e06984db44abd3bbd22ea', class: "tertiary", "aria-label": "More actions", onClick: this._onOverflowClick }, h("span", { key: '80e31e6b691e18d1b42a2b4831349c3abf8e02b0', class: "icon-placeholder" }, "..."))))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "lmvz-card"; }
|
|
25
25
|
static get encapsulation() { return "scoped"; }
|
|
@@ -83,7 +83,7 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
83
83
|
this.lmvzChange.emit(this.checked);
|
|
84
84
|
};
|
|
85
85
|
render() {
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: '70201fa49465f1e29b98bb251ea254be0293b1df' }, h("div", { key: 'dfeb788e3e2d9a8329e7798954c744eee616692e', class: "pill" }, h("input", { key: '79fefaa297a5fbbb1b7f180c7cf4cccf8650a1f0', type: "checkbox", id: this.checkboxId, checked: this.checkedState, disabled: this.disabled, required: this.required, "aria-required": this.required ? 'true' : 'false', "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": this.ariaDescribedBy, "aria-errormessage": this.error && this.errorId ? this.errorId : undefined, ref: (el) => (this.nativeInput = el), onChange: this.handleChange, autoFocus: this.autofocus }), h("span", { key: '8808a026274979678515b3e750065af38d62fff9', class: "box", "aria-hidden": "true" }, this.checkedState && h("span", { key: '861c08fb2a5cc6f24d3ae0a9f28cb6d2f51beda4', class: "indicator", innerHTML: CHECKMARK_SVG })), h("span", { key: '6dc36656d76bd3a6816553b4dcbdbea2c9bd2b0f', class: "content" }, h("label", { key: 'c343c4261e2eb231925d0f3ca0a83f9f3cdd0b9b', htmlFor: this.checkboxId }, this.label), this.helperText && (h("span", { key: '8473ed19adfe975b715a5e0b78c949c6b11de99e', class: "helper-text", id: this.helperId, role: "status" }, this.helperText)))), this.errorMessage && (h("span", { key: 'e934cec1cc622908188cf9090e24988e5df45799', class: "error-text", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
87
87
|
}
|
|
88
88
|
static get is() { return "lmvz-checkbox"; }
|
|
89
89
|
static get encapsulation() { return "scoped"; }
|
|
@@ -48,7 +48,7 @@ export class LmvzChip extends ReactiveControllerHost {
|
|
|
48
48
|
}
|
|
49
49
|
}, 500);
|
|
50
50
|
render() {
|
|
51
|
-
return (h(Host, { key: '
|
|
51
|
+
return (h(Host, { key: '70654d69189e77f9356853a921366083b2c4b969', type: this.type, size: this.size }, h("slot", { key: 'c7e667b93166286fe68a812dd8eec82885e3fc5e', name: "before-text", ref: (el) => (this.beforeSlot = el), onSlotchange: () => this.checkContent() }), h("span", { key: 'af38dd0429b42685a114e26175ce42d09f5fdcc1', class: "content-overflow-wrapper" }, h("slot", { key: '924158498d65b9ac7c912b6b1a479016176e0b78', ref: (el) => (this.defaultSlot = el), onSlotchange: () => this.checkContent() })), h("slot", { key: '9ff0394dbfb2131fafe513d0f2d8ce26c7781f20', name: "after-text", ref: (el) => (this.afterSlot = el), onSlotchange: () => this.checkContent() })));
|
|
52
52
|
}
|
|
53
53
|
static get is() { return "lmvz-chip"; }
|
|
54
54
|
static get encapsulation() { return "shadow"; }
|
|
@@ -84,7 +84,7 @@ export class LmvzHeader extends ReactiveControllerHost {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: '323b7b13ef147f48e5f06537c7f27ab6e8a649ca', onFocus: this.delegateFocus.bind(this) }, h("div", { key: '518434d55b7bfc5c1a8988f707984b8e2a41163c', class: "brand" }, h("slot", { key: '1829a1ba10ba3a4e1a0e32564c534e960dc652d1', name: "brand" }, h("img", { key: '485c217a7fc920646ec531cac9744a10f29dab4e', id: "fallback-logo-lmvz", src: logo, alt: "Lehrmittelverlag Z\u00FCrich" }))), h("nav", { key: 'df2cea9f42427c0bb51a498cc2627f0113a608a0', "aria-label": "Hauptnavigation" }, h("div", { key: '93d6e0edc45c0032c5d3c93ea5f22e204fb0617e', role: "menubar", class: "primary-menubar" }, h("slot", { key: '1b0238ca89023cc9a0ec4453e79a4597aaa92f2a', name: "nav-primary", ref: (el) => (this.primarySlot = el) }), h("div", { key: 'd7576b23a5f9268a106c98052a869825493e0485', role: "menu", id: "nav-secondary", class: "secondary-menubar", hidden: !this.lmvzActiveNav, ref: (el) => (this.secondaryNav = el) }, h("slot", { key: 'ada5f271c58350c44bb55c3bd976450214795f2b', name: this.secondarySlotName, ref: (el) => (this.secondarySlot = el) })))), h("div", { key: 'db47039ebf932942210fd3f0920f9f86f9d2b09b', class: "actions" }, h("slot", { key: '2d220a2946f26e69052d20dd4524e60fafbfe137', name: "actions" }))));
|
|
88
88
|
}
|
|
89
89
|
static get is() { return "lmvz-header"; }
|
|
90
90
|
static get encapsulation() { return "shadow"; }
|
|
@@ -57,7 +57,7 @@ export class LmvzIcon extends ReactiveControllerHost {
|
|
|
57
57
|
super.componentDidRender();
|
|
58
58
|
}
|
|
59
59
|
render() {
|
|
60
|
-
return h(Host, { key: '
|
|
60
|
+
return h(Host, { key: '03b4391d02a77409257bcda51c2b65ad9a9e0a0c', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
61
61
|
}
|
|
62
62
|
waitUntilVisible(callback, rootMargin = 50) {
|
|
63
63
|
if (!Build.isBrowser || typeof window === 'undefined' || !window.IntersectionObserver) {
|
|
@@ -150,9 +150,9 @@ export class LmvzInput extends ReactiveControllerHost {
|
|
|
150
150
|
render() {
|
|
151
151
|
const hasValue = Boolean(this.value);
|
|
152
152
|
const shouldFloatLabel = hasValue || Boolean(this.placeholder);
|
|
153
|
-
return (h("div", { key: '
|
|
153
|
+
return (h("div", { key: 'b8c3aaccafb89725aaa157a72633c67ae8b4d58c', class: classNames('input-container', {
|
|
154
154
|
'interaction-filled': hasValue,
|
|
155
|
-
}) }, h("div", { key: '
|
|
155
|
+
}) }, h("div", { key: '80261c486d3bfe61aa060d50e9a6774c961339a1', class: "input-wrapper" }, h("slot", { key: '6856dd64991251adc63d8064ed63e9cf7b1773a2', name: "before-input" }), h("div", { key: 'c975357079efef465c56fb50cbb404bd1cbe3fb1', class: "label-input-group" }, h("label", { key: '798417172f8411be97866edbffbd2bb98c308c69', htmlFor: this.inputId, class: classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (h("span", { key: '9fd59f3d93c984304e6c8ae6531df82bc0057243', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), h("input", { key: 'a4e1133b4891c01044365eb3c97ee234c84c9bac', id: this.inputId, ref: (el) => (this.nativeInputElement = el), type: this.type, min: this.min, max: this.max, step: this.step, value: this.value, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, required: this.required, form: this.form, autocomplete: this.autocomplete, inputmode: this.inputmode, autocorrect: this.autocorrect, autocapitalize: this.autocapitalize, spellcheck: this.spellcheck, autofocus: this.autofocus, minlength: this.minlength, maxlength: this.maxlength, pattern: this.pattern, "aria-invalid": this.error ? 'true' : 'false', "aria-required": this.required ? 'true' : 'false', "aria-describedby": this.describedBy, "aria-errormessage": this.errorId, onInput: this.handleInput, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur })), h("slot", { key: 'c774f03e704889b524f305c00d60c0902abdff5f', name: "after-input" })), h("div", { key: 'f513746541c71ce0d67c26eb220b54408fc3f136', id: this.helperId, role: "status" }, this.helperText || null), h("div", { key: '197683e55807bf100ca1543f5b84b14e910e721f', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
|
|
156
156
|
}
|
|
157
157
|
static get is() { return "lmvz-input"; }
|
|
158
158
|
static get encapsulation() { return "scoped"; }
|
|
@@ -21,7 +21,7 @@ export class LmvzMenuItem extends ReactiveControllerHost {
|
|
|
21
21
|
this.addController(new ElementActivationController(this));
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '3a722fe1fbacabd99ac5a5bd23537a1ff383fb95' }, h("slot", { key: 'e475dd50bbd2f9f349edb61766a0b21c1fb1ae16', ref: (e) => (this.validationSlot = e) })));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "lmvz-menuitem"; }
|
|
27
27
|
static get encapsulation() { return "scoped"; }
|
|
@@ -47,42 +47,52 @@ h6 {
|
|
|
47
47
|
margin: 0;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
*[hidden] {
|
|
51
|
+
display: none !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
}
|
|
51
55
|
:host {
|
|
52
56
|
display: contents;
|
|
53
|
-
color: var(--lmvz-semantic-color-on-surface-primary, #000000);
|
|
54
|
-
|
|
55
|
-
--lmvz-modal-shell-padding: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
|
|
56
|
-
--lmvz-modal-shell-gap: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
|
|
57
|
-
--lmvz-modal-actions-gap: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
58
|
-
--lmvz-modal-viewport-padding: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
|
|
59
57
|
|
|
60
|
-
/* TODO
|
|
61
|
-
--lmvz-modal-shell-
|
|
58
|
+
/* TODO: missing token for modal/box gap */
|
|
59
|
+
--lmvz-modal-shell-gap: var(--lmvz-dimension-16-20, clamp(1rem, 0.94rem + 0.26vw, 1.25rem));
|
|
62
60
|
}
|
|
63
61
|
dialog {
|
|
64
62
|
border: none;
|
|
65
63
|
padding: 0;
|
|
66
64
|
background: transparent;
|
|
67
|
-
color: var(--lmvz-semantic-color-on-surface-primary, #000000);
|
|
68
65
|
}
|
|
69
66
|
dialog::backdrop {
|
|
70
67
|
/* TODO(LDHCID-135): Missing token for the modal backdrop color */
|
|
71
68
|
/* Fallback for browsers without CSS Color Level 4 relative-color syntax (Chrome < 119, FF < 128, Safari < 16.4) */
|
|
72
69
|
background: rgba(0, 0, 0, 0.19);
|
|
73
|
-
background: rgb(from var(--lmvz-semantic-color-int-primary, #000000) r g b / 0.
|
|
70
|
+
background: rgb(from var(--lmvz-semantic-color-int-primary, #000000) r g b / 0.29);
|
|
74
71
|
}
|
|
75
72
|
.modal-shell {
|
|
73
|
+
position: relative;
|
|
76
74
|
display: flex;
|
|
77
75
|
flex-direction: column;
|
|
76
|
+
inline-size: fit-content;
|
|
77
|
+
max-inline-size: clamp(40rem, 100%, 80vw);
|
|
78
78
|
gap: var(--lmvz-modal-shell-gap);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
border-radius: var(--lmvz-semantic-border-radius-lg, 14px);
|
|
79
|
+
padding-block: var(--lmvz-component-modal-padding-y, clamp(2.25rem, 2.19rem + 0.26vw, 2.5rem));
|
|
80
|
+
padding-inline: var(--lmvz-component-modal-padding-x, clamp(1.5rem, 1.14rem + 1.55vw, 3rem));
|
|
81
|
+
border-radius: var(--lmvz-component-modal-border-radius, 18px);
|
|
83
82
|
background: var(--lmvz-semantic-color-surface-primary, #ffffff);
|
|
84
83
|
/* TODO(LDHCID-135): clarify overflow behaviour */
|
|
85
84
|
overflow: auto;
|
|
85
|
+
|
|
86
|
+
.close-button {
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: var(--lmvz-dimension-10-12, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem));
|
|
89
|
+
right: var(--lmvz-dimension-10-12, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
@media (min-width: 768px) {
|
|
93
|
+
.modal-shell {
|
|
94
|
+
max-inline-size: 100vw;
|
|
95
|
+
}
|
|
86
96
|
}
|
|
87
97
|
.header {
|
|
88
98
|
display: flex;
|
|
@@ -102,19 +112,3 @@ dialog::backdrop {
|
|
|
102
112
|
font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4
|
|
103
113
|
Router);
|
|
104
114
|
}
|
|
105
|
-
.actions {
|
|
106
|
-
display: flex;
|
|
107
|
-
flex-wrap: wrap;
|
|
108
|
-
justify-content: flex-end;
|
|
109
|
-
gap: var(--lmvz-modal-actions-gap);
|
|
110
|
-
font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4
|
|
111
|
-
Router);
|
|
112
|
-
/* TODO(LDHCID-135): Action wrapping threshold remains an assumption and currently follows intrinsic content width */
|
|
113
|
-
}
|
|
114
|
-
.close-button {
|
|
115
|
-
display: inline-flex;
|
|
116
|
-
flex: none;
|
|
117
|
-
}
|
|
118
|
-
::slotted([slot='actions'][hidden]) {
|
|
119
|
-
display: none;
|
|
120
|
-
}
|