@lmvz-ds/components 0.12.5 → 0.13.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/dist/{esm/Effect-BhQLGXPs.js → cjs/assets-CB5ikzmP.js} +857 -4832
- package/dist/cjs/{icons-7wUEcWEo.js → icons-DM_TTn48.js} +363 -113
- package/dist/cjs/{index-CVw4GUo6.js → index-Bp6Dd2i1.js} +4 -2
- package/dist/cjs/{index-9ZJx0550.js → index-D3BMpL5w.js} +0 -3
- package/dist/cjs/index.cjs.js +4 -6
- package/dist/cjs/lmvz-action.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-button.cjs.entry.js +7 -10
- package/dist/cjs/lmvz-card.cjs.entry.js +3 -4
- package/dist/cjs/lmvz-chip.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-components.cjs.js +1 -1
- package/dist/cjs/lmvz-header.cjs.entry.js +13 -12
- package/dist/cjs/lmvz-icon.cjs.entry.js +8 -10
- package/dist/cjs/lmvz-input.cjs.entry.js +8 -11
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +5 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/reactive-controller-host-BMDEj1kX.js +168 -0
- package/dist/collection/components/lmvz-button/lmvz-button.js +3 -3
- package/dist/collection/components/lmvz-header/lmvz-header.js +11 -8
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +2 -2
- package/dist/collection/components/lmvz-icon/test/icons.unit.js +21 -12
- package/dist/collection/components/lmvz-input/lmvz-input.css +5 -2
- package/dist/collection/components/lmvz-input/lmvz-input.js +3 -3
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +3 -3
- package/dist/collection/integration/header-integration.js +3 -1
- package/dist/collection/utils/{validation → aria}/aria-validation-controller.js +15 -34
- package/dist/collection/utils/{list-keyboard-controller.js → aria/list-keyboard-controller.js} +1 -1
- package/dist/collection/utils/{http.test.js → http.unit.js} +7 -6
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-action.js +1 -1
- package/dist/components/lmvz-button.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-chip.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/lmvz-input.js +1 -1
- package/dist/components/lmvz-menuitem.js +1 -1
- package/dist/components/p-BBDH9X49.js +1 -0
- package/dist/components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/components/p-Bs6_m7Uw.js +1 -0
- package/dist/components/p-CMteT-Yo.js +1 -0
- package/dist/components/p-vi4YzJmv.js +1 -0
- package/dist/{cjs/Effect-CNhHt4Xb.js → esm/assets-ozES4zSA.js} +785 -5032
- package/dist/esm/{icons-Bx1wWPM2.js → icons-kpJZ1u9g.js} +268 -18
- package/dist/esm/{index-Bt32KzDW.js → index-BfTCfPZ1.js} +3 -1
- package/dist/esm/{index-smGPjoDX.js → index-T5ljELGS.js} +1 -3
- package/dist/esm/index.js +3 -5
- package/dist/esm/lmvz-action.entry.js +1 -1
- package/dist/esm/lmvz-button.entry.js +5 -8
- package/dist/esm/lmvz-card.entry.js +2 -3
- package/dist/esm/lmvz-chip.entry.js +1 -1
- package/dist/esm/lmvz-components.js +2 -2
- package/dist/esm/lmvz-header.entry.js +11 -10
- package/dist/esm/lmvz-icon.entry.js +5 -7
- package/dist/esm/lmvz-input.entry.js +6 -9
- package/dist/esm/lmvz-menuitem.entry.js +3 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/reactive-controller-host-CZ3dGAjR.js +165 -0
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-16878d4c.entry.js +1 -0
- package/dist/lmvz-components/p-4ad8c332.entry.js +1 -0
- package/dist/lmvz-components/p-5eee0752.entry.js +1 -0
- package/dist/lmvz-components/p-8ea1a349.entry.js +1 -0
- package/dist/lmvz-components/{p-d4b68381.entry.js → p-980688a0.entry.js} +1 -1
- package/dist/lmvz-components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/lmvz-components/p-CZ3dGAjR.js +1 -0
- package/dist/lmvz-components/p-D9lc4ayG.js +1 -0
- package/dist/lmvz-components/p-T5ljELGS.js +2 -0
- package/dist/lmvz-components/p-a34542fa.entry.js +1 -0
- package/dist/lmvz-components/p-d2bf6a3f.entry.js +1 -0
- package/dist/lmvz-components/{p-9faac8f3.entry.js → p-feda2ec5.entry.js} +1 -1
- package/dist/lmvz-components/p-iviTjlUy.js +1 -0
- package/dist/manifest.json +1 -1
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +2 -2
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +5 -4
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +1 -1
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +1 -1
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +2 -2
- package/dist/types/utils/{validation → aria}/aria-validation-controller.d.ts +1 -5
- package/dist/types/utils/{element-activation-controller.d.ts → aria/element-activation-controller.d.ts} +2 -2
- package/dist/types/utils/{list-keyboard-controller.d.ts → aria/list-keyboard-controller.d.ts} +1 -1
- package/hydrate/index.js +9610 -50169
- package/hydrate/index.mjs +9610 -50169
- package/package.json +17 -18
- package/readme.md +18 -0
- package/dist/cjs/MutableQueue-Bk9tBfaK.js +0 -462
- package/dist/cjs/_commonjsHelpers-CFO10eej.js +0 -7
- package/dist/cjs/aria-validation-controller-B3hMkau3.js +0 -2930
- package/dist/cjs/assets-BguFB3wV.js +0 -71
- package/dist/cjs/axe-BNqwbBGU.js +0 -32834
- package/dist/components/p-3I3wZmp8.js +0 -1
- package/dist/components/p-B85MJLTf.js +0 -1
- package/dist/components/p-BaPwpeMs.js +0 -1
- package/dist/components/p-CAi33KTt.js +0 -1
- package/dist/components/p-CdofjRtQ.js +0 -1
- package/dist/components/p-D1HbKFuh.js +0 -12
- package/dist/components/p-UwhTS2ue.js +0 -1
- package/dist/esm/MutableQueue-CNlEFklh.js +0 -431
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/esm/aria-validation-controller-iA4YWFG-.js +0 -2927
- package/dist/esm/assets-Iu8neKuE.js +0 -67
- package/dist/esm/axe-cRQ9Ux1I.js +0 -32832
- package/dist/lmvz-components/p-1a10fcbd.entry.js +0 -1
- package/dist/lmvz-components/p-274c36df.entry.js +0 -1
- package/dist/lmvz-components/p-2ba68483.entry.js +0 -1
- package/dist/lmvz-components/p-4XIjw3k8.js +0 -1
- package/dist/lmvz-components/p-51Fb_qqD.js +0 -1
- package/dist/lmvz-components/p-77e26e71.entry.js +0 -1
- package/dist/lmvz-components/p-B85MJLTf.js +0 -1
- package/dist/lmvz-components/p-BhQLGXPs.js +0 -1
- package/dist/lmvz-components/p-CXWyvf0D.js +0 -1
- package/dist/lmvz-components/p-D1HbKFuh.js +0 -12
- package/dist/lmvz-components/p-D7I-Bc5i.js +0 -1
- package/dist/lmvz-components/p-a5fe62b6.entry.js +0 -1
- package/dist/lmvz-components/p-c8b78793.entry.js +0 -1
- package/dist/lmvz-components/p-smGPjoDX.js +0 -2
- /package/dist/collection/utils/{element-activation-controller.js → aria/element-activation-controller.js} +0 -0
- /package/dist/types/utils/{http.test.d.ts → http.unit.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { AriaValidationController } from "../../utils/aria/aria-validation-controller";
|
|
3
|
+
import { ListKeyboardNavigationController } from "../../utils/aria/list-keyboard-controller";
|
|
3
4
|
import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
|
|
4
|
-
import { AriaValidationController } from "../../utils/validation/aria-validation-controller";
|
|
5
5
|
export class LmvzHeader extends ReactiveControllerHost {
|
|
6
6
|
el;
|
|
7
7
|
primarySlot;
|
|
@@ -30,11 +30,11 @@ export class LmvzHeader extends ReactiveControllerHost {
|
|
|
30
30
|
this.updateElementsActive();
|
|
31
31
|
}
|
|
32
32
|
componentDidLoad() {
|
|
33
|
-
this.primarySlot.addEventListener('slotchange', this.
|
|
34
|
-
this.
|
|
35
|
-
this.secondarySlot.addEventListener('slotchange', this.
|
|
33
|
+
this.primarySlot.addEventListener('slotchange', this.handlePrimaryNavItemsChange.bind(this));
|
|
34
|
+
this.handlePrimaryNavItemsChange();
|
|
35
|
+
this.secondarySlot.addEventListener('slotchange', this.handleSecondaryNavItemsChange.bind(this));
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
handlePrimaryNavItemsChange() {
|
|
38
38
|
const items = this.primaryMenuitems;
|
|
39
39
|
if (!items.length) {
|
|
40
40
|
console.warn('Primary slot has no assigned elements. Please add navigation items to the primary slot.');
|
|
@@ -46,11 +46,14 @@ export class LmvzHeader extends ReactiveControllerHost {
|
|
|
46
46
|
});
|
|
47
47
|
this.updateElementsActive();
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
handleSecondaryNavItemsChange() {
|
|
50
50
|
const items = this.secondaryMenuitems;
|
|
51
51
|
if (!items.length) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
+
this.updateKeyboardNavSubjects();
|
|
55
|
+
}
|
|
56
|
+
updateKeyboardNavSubjects() {
|
|
54
57
|
this.keyboardNavigationController.updateElements([...this.primaryMenuitems, ...this.secondaryMenuitems]);
|
|
55
58
|
}
|
|
56
59
|
updateElementsActive() {
|
|
@@ -71,7 +74,7 @@ export class LmvzHeader extends ReactiveControllerHost {
|
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
render() {
|
|
74
|
-
return (h(Host, { key: '
|
|
77
|
+
return (h(Host, { key: '783c855e49e1a2447107d6205a1b2c50285ccfff', onFocus: this.delegateFocus.bind(this) }, h("div", { key: '84a78b0ed3e170c49a711fa4091f80dbc7003b2f', class: "brand" }, h("slot", { key: '76cc54f17a7bc5f825433fc56351666a93891fd2', name: "brand" }, h("lmvz-icon", { key: 'e196e43720cb4b4c3f79b3071d534b50480f6206', id: "fallback-logo-lmvz", icon: "Logo", size: "inherit", "aria-label": "Lehrmittelverlag Z\u00FCrich" }))), h("nav", { key: 'd25a719752bd4085da5ad18af94afc66e9cabd5e', "aria-label": "Hauptnavigation" }, h("div", { key: '8a12c2c53bd061b3559ce9693780e592b3d7aa32', role: "menubar", class: "primary-menubar" }, h("slot", { key: '4461632675dc657f675883e8ef618e371ace0ad7', name: "nav-primary", ref: el => (this.primarySlot = el) }), h("div", { key: 'c1dabc588ac376db667df32d3edbdd6dce60aaad', role: "menu", id: "nav-secondary", class: "secondary-menubar", hidden: !this.lmvzActiveNav, ref: el => (this.secondaryNav = el) }, h("slot", { key: '74ca44ee2f755ffe9ea3ebc19cc2b227ae22df8b', name: this.secondarySlotName, ref: el => (this.secondarySlot = el) })))), h("div", { key: 'a4d250a5fcd10390aed1f5369c28ddec9aa9ee8d', class: "actions" }, h("slot", { key: '77a499ce12d269e79221ca971cc1b203d179f459', name: "actions" }))));
|
|
75
78
|
}
|
|
76
79
|
static get is() { return "lmvz-header"; }
|
|
77
80
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Build, h, Host } from "@stencil/core";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
+
import { AriaValidationController } from "../../utils/aria/aria-validation-controller";
|
|
3
4
|
import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
|
|
4
|
-
import { AriaValidationController } from "../../utils/validation/aria-validation-controller";
|
|
5
5
|
import { emptyDefaultSvg, fetchIconSvg } from "./icons";
|
|
6
6
|
export class LmvzIcon extends ReactiveControllerHost {
|
|
7
7
|
intersectionObserver;
|
|
@@ -39,7 +39,7 @@ export class LmvzIcon extends ReactiveControllerHost {
|
|
|
39
39
|
this.iconData = await Effect.runPromise(fetchIconSvg(this.icon).pipe(Effect.tapError(error => Effect.logError(`Error loading icon "${icon}":`, error.message, error.cause, error.stack)), Effect.catchAll(() => Effect.succeed(emptyDefaultSvg()))));
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return h(Host, { key: '
|
|
42
|
+
return h(Host, { key: 'd4c1cbfbaf39ebf6aa26415d46100763b9f89b5b', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
43
43
|
}
|
|
44
44
|
waitUntilVisible(callback, rootMargin = 50) {
|
|
45
45
|
if (!Build.isBrowser || typeof window === 'undefined' || !window.IntersectionObserver) {
|
|
@@ -1,34 +1,40 @@
|
|
|
1
|
+
import { beforeAll, beforeEach, describe, expect, test, vi } from "@stencil/vitest";
|
|
1
2
|
import { Effect } from "effect";
|
|
2
3
|
import { FetchError, ResponseTextError } from "../../../utils/http";
|
|
3
4
|
import { BrandValidationError, SVGString } from "../../../utils/validation/svg";
|
|
4
5
|
import { clearIconCache, emptyDefaultSvg, fetchIconSvg } from "../icons";
|
|
6
|
+
const fetchMock = vi.fn();
|
|
7
|
+
const mockResponse = (textResult) => ({
|
|
8
|
+
status: 200,
|
|
9
|
+
url: 'https://example.com/icons/actions.svg',
|
|
10
|
+
text: vi.fn().mockResolvedValue(textResult),
|
|
11
|
+
});
|
|
5
12
|
describe('icon utils:', () => {
|
|
6
13
|
beforeAll(() => {
|
|
7
|
-
|
|
8
|
-
parseFromString(str,
|
|
14
|
+
vi.stubGlobal('DOMParser', class {
|
|
15
|
+
parseFromString(str, _type) {
|
|
9
16
|
return {
|
|
10
17
|
documentElement: {
|
|
11
|
-
nodeName: str.
|
|
18
|
+
nodeName: typeof str === 'string' && str.trimStart().startsWith('<svg') ? 'svg' : 'not-svg',
|
|
12
19
|
},
|
|
13
20
|
};
|
|
14
21
|
}
|
|
15
|
-
};
|
|
22
|
+
});
|
|
16
23
|
});
|
|
17
24
|
beforeEach(() => {
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
vi.clearAllMocks();
|
|
26
|
+
fetchMock.mockReset();
|
|
27
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
20
28
|
return Effect.runPromise(clearIconCache());
|
|
21
29
|
});
|
|
22
30
|
const validSvg = '<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg>';
|
|
23
31
|
const invalidSvg = '<div>not an svg</div>';
|
|
24
32
|
const iconName = 'actions';
|
|
25
33
|
function mockFetchSuccess(svg = validSvg) {
|
|
26
|
-
|
|
27
|
-
text: () => Promise.resolve(svg),
|
|
28
|
-
});
|
|
34
|
+
fetchMock.mockResolvedValueOnce(mockResponse(svg));
|
|
29
35
|
}
|
|
30
36
|
function mockFetchFailure() {
|
|
31
|
-
|
|
37
|
+
fetchMock.mockRejectedValueOnce(new Error('fail'));
|
|
32
38
|
}
|
|
33
39
|
test('fetchIcon returns valid SVGString when fetch succeeds with valid SVG', async () => {
|
|
34
40
|
mockFetchSuccess(validSvg);
|
|
@@ -48,7 +54,9 @@ describe('icon utils:', () => {
|
|
|
48
54
|
expect(result.message).toContain('SVGString');
|
|
49
55
|
});
|
|
50
56
|
test('fetchIcon throws specific NotFoundError when icon is missing', async () => {
|
|
51
|
-
|
|
57
|
+
fetchMock.mockResolvedValueOnce({
|
|
58
|
+
status: 200,
|
|
59
|
+
url: 'https://example.com/icons/missing.svg',
|
|
52
60
|
text: () => Promise.reject(new Error('not found')),
|
|
53
61
|
});
|
|
54
62
|
const result = await Effect.runPromise(fetchIconSvg('missing').pipe(Effect.flip));
|
|
@@ -60,7 +68,7 @@ describe('icon utils:', () => {
|
|
|
60
68
|
expect(result).toBeInstanceOf(BrandValidationError);
|
|
61
69
|
});
|
|
62
70
|
test('fetchIcon throws specific BrandValidationError for non-string SVG', async () => {
|
|
63
|
-
|
|
71
|
+
fetchMock.mockResolvedValueOnce(mockResponse(123));
|
|
64
72
|
const result = await Effect.runPromise(fetchIconSvg(iconName).pipe(Effect.flip));
|
|
65
73
|
expect(result).toBeInstanceOf(BrandValidationError);
|
|
66
74
|
});
|
|
@@ -85,5 +93,6 @@ describe('icon utils:', () => {
|
|
|
85
93
|
const result2 = await Effect.runPromise(fetchIconSvg(iconName));
|
|
86
94
|
expect(result1).toContain('<svg');
|
|
87
95
|
expect(result2).toBe(result1);
|
|
96
|
+
expect(fetchMock).toHaveBeenCalledTimes(1);
|
|
88
97
|
});
|
|
89
98
|
});
|
|
@@ -179,7 +179,10 @@ input {
|
|
|
179
179
|
input::placeholder {
|
|
180
180
|
color: var(--label-color);
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
div:empty {
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
[role='status'] {
|
|
183
186
|
padding-top: 8px; /* space-gap-component-input-helper-text */
|
|
184
187
|
padding-left: 12px; /* input-md-padding-x for helper text indent */
|
|
185
188
|
font-size: 12px;
|
|
@@ -187,7 +190,7 @@ input::placeholder {
|
|
|
187
190
|
font-family: Router, sans-serif;
|
|
188
191
|
font-weight: 500; /* Medium weight */
|
|
189
192
|
}
|
|
190
|
-
|
|
193
|
+
[role='alert'] {
|
|
191
194
|
padding-top: 8px;
|
|
192
195
|
padding-left: 12px;
|
|
193
196
|
font-size: 12px;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
+
import { AriaValidationController } from "../../utils/aria/aria-validation-controller";
|
|
3
4
|
import { componentOnReady } from "../../utils/component";
|
|
4
5
|
import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
|
|
5
|
-
import { AriaValidationController } from "../../utils/validation/aria-validation-controller";
|
|
6
6
|
let inputIdCounter = 0;
|
|
7
7
|
export class LmvzInput extends ReactiveControllerHost {
|
|
8
8
|
el;
|
|
@@ -142,9 +142,9 @@ export class LmvzInput extends ReactiveControllerHost {
|
|
|
142
142
|
render() {
|
|
143
143
|
const hasValue = Boolean(this.value);
|
|
144
144
|
const shouldFloatLabel = hasValue || Boolean(this.placeholder);
|
|
145
|
-
return (h("div", { key: '
|
|
145
|
+
return (h("div", { key: '4dffa432df9b8ca5d89c02b59cfe25b9321ca162', class: classNames('input-container', {
|
|
146
146
|
'interaction-filled': hasValue,
|
|
147
|
-
}) }, h("div", { key: '
|
|
147
|
+
}) }, h("div", { key: 'ade1cd1137acce218d458c1b66b2eb29cf887b70', class: "input-wrapper" }, h("slot", { key: '013dff3540481724658ff754bf3db0585ec3b6f4', name: "before-input" }), h("div", { key: '6587bb63c79f97c31abff5be0a91eb16374971d5', class: "label-input-group" }, h("label", { key: '2ef0a35fbd38b255423d2793415568a661476db3', htmlFor: this.inputId, class: classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (h("span", { key: '0785826710ee4ecea96037cc689c34a43113552e', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), h("input", { key: '5ad0d4b2d1c11dd89824db87e331232ba703a05e', 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: 'a23676cc830cac7fbf87fef81a8d05b50b831725', name: "after-input" })), h("div", { key: 'e0a05138954d70508f840b6d5c4f53e74c2f2979', id: this.helperId, role: "status" }, this.helperText || null), h("div", { key: 'fcba57be2d596b3b8aa0ac97b2fd31dc3e77e14b', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
|
|
148
148
|
}
|
|
149
149
|
static get is() { return "lmvz-input"; }
|
|
150
150
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { AriaValidationController } from "../../utils/aria/aria-validation-controller";
|
|
3
|
+
import { ElementActivationController } from "../../utils/aria/element-activation-controller";
|
|
3
4
|
import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
|
|
4
|
-
import { AriaValidationController } from "../../utils/validation/aria-validation-controller";
|
|
5
5
|
export class LmvzMenuItem extends ReactiveControllerHost {
|
|
6
6
|
el;
|
|
7
7
|
get role() {
|
|
@@ -17,7 +17,7 @@ export class LmvzMenuItem extends ReactiveControllerHost {
|
|
|
17
17
|
this.addController(new ElementActivationController(this));
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: 'c4a21e628aaf4e983d51ce7b1f38ff66c47ec3ac' }, h("slot", { key: '0040d27a11c4bdd5a49dd54f352ba7d17b53ff7b' })));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "lmvz-menuitem"; }
|
|
23
23
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { enableAriaValidation } from "@lmvz-ds/aria-validation";
|
|
1
2
|
import { h, Host } from "@stencil/core";
|
|
3
|
+
enableAriaValidation();
|
|
2
4
|
export class HeaderIntegration {
|
|
3
5
|
activeNav;
|
|
4
6
|
activate(event) {
|
|
@@ -15,7 +17,7 @@ export class HeaderIntegration {
|
|
|
15
17
|
this.activeNav = navId;
|
|
16
18
|
}
|
|
17
19
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '2c1e17a546e2f02d3a0571c8ad25f04dc4ddc21c' }, h("lmvz-header", { key: '2072642f27497dba23b82766efb47bae66cf2ca4', lmvzActiveNav: this.activeNav }, h("lmvz-menuitem", { key: '2f3f76364aeccf1d0012403599df6089324a6407', slot: "nav-primary", id: "lehrmittel", onLmvzActivation: this.activate.bind(this) }, h("a", { key: '925a3cddc298fd33c08b2a911a7b668503dd6457', href: "#" }, "Lehrmittel")), h("lmvz-menuitem", { key: '3579a89fb31a3c4f34550553830b4f17c466a26c', slot: "nav-primary", id: "verwaltung", onLmvzActivation: this.activate.bind(this) }, h("a", { key: 'f33245d9ae6eada3eab9fd65f6994e3950785a49', href: "#" }, "Verwaltung")), h("lmvz-menuitem", { key: '53fb94f79851dd87bf235fe7008004cc6ac81ba5', slot: "connect-nav-lehrmittel" }, h("lmvz-icon", { key: '74a1a501f0b0207c041470e6133cf9811922ad90', icon: "book" }), "Deutsch 7"), h("lmvz-menuitem", { key: 'b5885aeabe690ea9b16e5e1779de50e231ee9e68', slot: "connect-nav-lehrmittel" }, h("lmvz-icon", { key: 'a5691f42169f9812cd46206baf3e71b91dbda01d', icon: "book" }), "Mathe 2"), h("lmvz-menuitem", { key: 'b171e9be2812c4743482a40cb10cad501d1e5826', slot: "connect-nav-verwaltung" }, h("lmvz-icon", { key: 'f89e3b94ea03de64a516df80bcc152dfa814b0fc', icon: "cog" }), "iwas mit Verwaltung"), h("lmvz-menuitem", { key: 'f32ca2a5aab550d65a7a9da9210944cb5c66f83c', slot: "connect-nav-verwaltung", "aria-label": "Einstellungen" }, h("lmvz-icon", { key: '6a8b0d2afd0c94e44567a74d46a55e526f53dbd5', icon: "cog" })), h("lmvz-button", { key: '9c31e29f041ed4ae515eef1b966e8fcb68c7acd8', slot: "actions", "aria-label": "Benutzerkonto" }, h("lmvz-icon", { key: '340aa71a47c0714850bbdcbfbf971931fb83060e', icon: "user" }))), h("main", { key: '16c5b3916cb4dd172423f41f33015d2348407659' }, h("h1", { key: 'f71be25ec19f727050709f092c8c28f7f8a1cfde' }, "Content"))));
|
|
19
21
|
}
|
|
20
22
|
static get is() { return "header-integration"; }
|
|
21
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,49 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Effect, Queue, Stream } from "effect";
|
|
1
|
+
import { ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, isAriaValidationEnabled, queueValidation } from "@lmvz-ds/aria-validation";
|
|
3
2
|
export class AriaValidationController {
|
|
4
3
|
host;
|
|
5
4
|
config;
|
|
6
|
-
static get globalValidationEnabled() {
|
|
7
|
-
return Build.isDev;
|
|
8
|
-
}
|
|
9
|
-
static axe = this.globalValidationEnabled ? import('axe-core') : null;
|
|
10
|
-
static axeQueue = null;
|
|
11
|
-
static axeStreamFiber = null;
|
|
12
5
|
visibilityObserver;
|
|
13
6
|
elementQueued = false;
|
|
14
7
|
elementValidated = false;
|
|
15
8
|
knownValidationErrors = [];
|
|
16
9
|
get disabled() {
|
|
17
|
-
return !
|
|
10
|
+
return !isAriaValidationEnabled();
|
|
18
11
|
}
|
|
19
12
|
constructor(host, config) {
|
|
20
13
|
this.host = host;
|
|
21
14
|
this.config = config;
|
|
22
|
-
AriaValidationController.initializeAxeStream();
|
|
23
15
|
}
|
|
24
|
-
|
|
25
|
-
if (!
|
|
26
|
-
return;
|
|
27
|
-
if (this.axeStreamFiber)
|
|
16
|
+
onRuntimeConfigChange = () => {
|
|
17
|
+
if (!isAriaValidationEnabled())
|
|
28
18
|
return;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const axeLib = yield* Effect.promise(() => AriaValidationController.axe);
|
|
32
|
-
if (!axeLib) {
|
|
33
|
-
console.error('Axe library not available, ARIA validation will not run.');
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const stream = Stream.fromQueue(queue).pipe(Stream.mapEffect(({ context, onComplete }) => Effect.async(resume => {
|
|
37
|
-
axeLib.run(context, {}, (error, results) => {
|
|
38
|
-
onComplete(error, results);
|
|
39
|
-
resume(Effect.void);
|
|
40
|
-
});
|
|
41
|
-
})));
|
|
42
|
-
yield* Stream.runDrain(stream);
|
|
43
|
-
});
|
|
44
|
-
this.axeStreamFiber = Effect.runFork(program);
|
|
45
|
-
}
|
|
19
|
+
this.checkLazyValidation();
|
|
20
|
+
};
|
|
46
21
|
hostDidLoad() {
|
|
22
|
+
if (typeof window !== 'undefined') {
|
|
23
|
+
window.addEventListener(ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, this.onRuntimeConfigChange);
|
|
24
|
+
}
|
|
47
25
|
if (this.elementQueued || this.elementValidated)
|
|
48
26
|
return;
|
|
49
27
|
if (!this.host.el.checkVisibility()) {
|
|
@@ -57,6 +35,9 @@ export class AriaValidationController {
|
|
|
57
35
|
}
|
|
58
36
|
hostDisconnected() {
|
|
59
37
|
this.discardVisibilityObserver();
|
|
38
|
+
if (typeof window !== 'undefined') {
|
|
39
|
+
window.removeEventListener(ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, this.onRuntimeConfigChange);
|
|
40
|
+
}
|
|
60
41
|
}
|
|
61
42
|
observeVisibilityOnce() {
|
|
62
43
|
this.visibilityObserver = new IntersectionObserver(entries => {
|
|
@@ -81,10 +62,10 @@ export class AriaValidationController {
|
|
|
81
62
|
this.enqueueValidation();
|
|
82
63
|
}
|
|
83
64
|
enqueueValidation() {
|
|
84
|
-
if (!
|
|
65
|
+
if (!isAriaValidationEnabled())
|
|
85
66
|
return;
|
|
86
67
|
this.elementQueued = true;
|
|
87
|
-
|
|
68
|
+
queueValidation({
|
|
88
69
|
context: { include: this.host.el, exclude: this.knownValidationErrors },
|
|
89
70
|
onComplete: (error, results) => {
|
|
90
71
|
this.elementValidated = true;
|
|
@@ -113,7 +94,7 @@ export class AriaValidationController {
|
|
|
113
94
|
console.groupEnd();
|
|
114
95
|
this.knownValidationErrors.push(...targets);
|
|
115
96
|
},
|
|
116
|
-
})
|
|
97
|
+
});
|
|
117
98
|
}
|
|
118
99
|
discardVisibilityObserver() {
|
|
119
100
|
if (!this.visibilityObserver)
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "@stencil/vitest";
|
|
1
2
|
import { Effect } from "effect";
|
|
2
3
|
import { FetchError, NotFoundError, ResponseTextError, httpClient, responseAsText } from "./http";
|
|
3
4
|
describe('Http Utils', () => {
|
|
4
5
|
describe('httpClient', () => {
|
|
5
6
|
it('should return response on successful fetch', async () => {
|
|
6
7
|
const mockResponse = { status: 200, url: 'https://example.com' };
|
|
7
|
-
global.fetch =
|
|
8
|
+
global.fetch = vi.fn().mockResolvedValueOnce(mockResponse);
|
|
8
9
|
const result = await Effect.runPromise(httpClient('https://example.com'));
|
|
9
10
|
expect(result).toEqual(mockResponse);
|
|
10
11
|
});
|
|
11
12
|
it('should handle fetch errors', async () => {
|
|
12
13
|
const error = new Error('Network error');
|
|
13
|
-
global.fetch =
|
|
14
|
+
global.fetch = vi.fn().mockRejectedValueOnce(error);
|
|
14
15
|
const result = await Effect.runPromise(Effect.flip(httpClient('https://example.com')));
|
|
15
16
|
expect(result).toBeInstanceOf(FetchError);
|
|
16
17
|
expect(result.cause).toBe(error);
|
|
17
18
|
});
|
|
18
19
|
it('should return NotFoundError on 404 status', async () => {
|
|
19
20
|
const mockResponse = { status: 404, url: 'https://example.com/notfound' };
|
|
20
|
-
global.fetch =
|
|
21
|
+
global.fetch = vi.fn().mockResolvedValueOnce(mockResponse);
|
|
21
22
|
const result = await Effect.runPromise(Effect.flip(httpClient('https://example.com/notfound')));
|
|
22
23
|
expect(result).toBeInstanceOf(NotFoundError);
|
|
23
24
|
});
|
|
24
25
|
it('should pass RequestInit options to fetch', async () => {
|
|
25
26
|
const mockResponse = { status: 200, url: 'https://example.com' };
|
|
26
|
-
global.fetch =
|
|
27
|
+
global.fetch = vi.fn().mockResolvedValueOnce(mockResponse);
|
|
27
28
|
const init = { method: 'POST', headers: { 'Content-Type': 'application/json' } };
|
|
28
29
|
await Effect.runPromise(httpClient('https://example.com', init));
|
|
29
30
|
expect(global.fetch).toHaveBeenCalledWith('https://example.com', init);
|
|
@@ -31,13 +32,13 @@ describe('Http Utils', () => {
|
|
|
31
32
|
});
|
|
32
33
|
describe('responseAsText', () => {
|
|
33
34
|
it('should return text from response', async () => {
|
|
34
|
-
const mockResponse = { text:
|
|
35
|
+
const mockResponse = { text: vi.fn().mockResolvedValueOnce('Hello World') };
|
|
35
36
|
const result = await Effect.runPromise(responseAsText(mockResponse));
|
|
36
37
|
expect(result).toBe('Hello World');
|
|
37
38
|
});
|
|
38
39
|
it('should handle text reading errors', async () => {
|
|
39
40
|
const error = new Error('Read error');
|
|
40
|
-
const mockResponse = { text:
|
|
41
|
+
const mockResponse = { text: vi.fn().mockRejectedValueOnce(error) };
|
|
41
42
|
const result = await Effect.runPromise(Effect.flip(responseAsText(mockResponse)));
|
|
42
43
|
expect(result).toBeInstanceOf(ResponseTextError);
|
|
43
44
|
expect(result.message).toContain('Failed to read response text');
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-vi4YzJmv.js";export{c as clearIconCache}from"./p-BBDH9X49.js";import{r as e}from"./p-Bs6_m7Uw.js";export{LmvzAction,defineCustomElement as defineCustomElementLmvzAction}from"./lmvz-action.js";export{LmvzButton,defineCustomElement as defineCustomElementLmvzButton}from"./lmvz-button.js";export{LmvzCard,defineCustomElement as defineCustomElementLmvzCard}from"./lmvz-card.js";export{LmvzChip,defineCustomElement as defineCustomElementLmvzChip}from"./lmvz-chip.js";export{LmvzHeader,defineCustomElement as defineCustomElementLmvzHeader}from"./lmvz-header.js";export{LmvzIcon,defineCustomElement as defineCustomElementLmvzIcon}from"./lmvz-icon.js";export{LmvzInput,defineCustomElement as defineCustomElementLmvzInput}from"./lmvz-input.js";export{LmvzMenuitem,defineCustomElement as defineCustomElementLmvzMenuitem}from"./lmvz-menuitem.js";const t=["primary","secondary","tertiary"],o=["small","default","large"],m=["xs","sm","md","lg"],n=[...m,"xl"],l=["text","email","password","tel","url","search","number"],i=[...m,"inherit"],d=["thin","medium","bold","filled"],u=["Logo","actions","adduser","alert","apple","arrow-down","arrow-left","arrow-right","arrow-up","book","bookmark","checkmark","chevron-down","chevron-left","chevron-right","chevron-up","close-l","close-sm","cog","computer","dashboard","delete","download","edit","external","facebook","favorite","filter","group","hide","home","info","instagram","letter","linkedin","logout","map","minus","navigation","plus","qr-scan","question","reader","reset","school","search","send","settings","share","shopping-cart","show","snapchat","sort","speech-bubble","star","student","upload","user","warn-circle","warn-triangle","whatsapp","world","x","youtube"];function f(t){return e(t).catch((e=>{console.error("Unhandled error in Effect:",e)}))}export{u as iconNames,i as iconSizes,d as iconWeights,l as inputTypes,f as run,o as scaleValues,m as sizes,n as textSizes,t as variants}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as c,d as i,t as o}from"./p-
|
|
1
|
+
import{p as t,H as e,c as s,h as c,d as i,t as o}from"./p-vi4YzJmv.js";const n=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.actionClick=s(this,"actionClick")}actionClick;_onClick(t){this.actionClick.emit(t)}render(){return c(i,{key:"71303bfe6ac64a96edd21800ae5e8c43a3a38c23",onClick:this._onClick.bind(this)},c("slot",{key:"94922fdfd355e7e4d1b78bedb80ae814c186b199"}))}static get style(){return":host{display:block}"}},[257,"lmvz-action"]),a=n,l=function(){"undefined"!=typeof customElements&&["lmvz-action"].forEach((t=>{"lmvz-action"===t&&(customElements.get(o(t))||customElements.define(o(t),n))}))};export{a as LmvzAction,l as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,c as o,h as e,d as r,t as n}from"./p-
|
|
1
|
+
import{p as t,c as o,h as e,d as r,t as n}from"./p-vi4YzJmv.js";import{c as a}from"./p-BfTCfPZ1.js";import{R as l,A as m}from"./p-CMteT-Yo.js";import{E as i}from"./p-CN0JX9-m.js";import{i as s,f as d}from"./p-B3JVFwO1.js";const c=t(class extends l{get el(){return this}inheritedAttributes={};formEl=null;formButtonEl=null;lmvzActivation;get ti(){return 0}scale="default";variant="secondary";disabled=!1;type="button";form;constructor(t){super(!1),!1!==t&&this.__registerHost(),this.__attachShadow(),this.lmvzActivation=o(this,"lmvzActivation"),this.addController(new m(this)),this.addController(new i(this,{localHandler:this.handleClick.bind(this),keys:["Enter"]}))}connectedCallback(){this.inheritedAttributes=s(this.el)}renderHiddenButton(){const t=this.formEl=d(this.form,this.el);if(!t)return;const{formButtonEl:o}=this;if(null!==o&&t.contains(o))return;const e=this.formButtonEl=document.createElement("button");e.type="submit",e.style.display="none",e.disabled=this.disabled,t.appendChild(e)}submitForm(t){this.formEl&&this.formButtonEl&&(t.preventDefault(),this.formButtonEl.click())}handleClick=t=>{"submit"===this.type&&this.submitForm(t)};render(){return this.renderHiddenButton(),e(r,{key:"cd4a63b866c801ad7f96f59d15e561a54bfe9ec2","aria-disabled":this.disabled?"true":null},e("button",{key:"a1e3ecb88fb84d724df4939519bb22d4b6725c1d",disabled:this.disabled,class:a(this.variant,{[this.scale??""]:!!this.scale,disabled:this.disabled}),...this.inheritedAttributes},e("slot",{key:"f1fd32c993b1ef9f6d62d6f3affa169c9368df78"})))}static get delegatesFocus(){return!0}static get style(){return" @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { h1, h2, h3, h4, h5, h6 { margin: 0; } } :host { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); 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); 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-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } 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-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: contents; } ::slotted(*) { --lmvz-component-color: var(--lmvz-button-color); } "}},[785,"lmvz-button",{ti:[2562,"tabindex"],scale:[513],variant:[513],disabled:[516],type:[1],form:[1]}]),v=c,u=function(){"undefined"!=typeof customElements&&["lmvz-button"].forEach((t=>{"lmvz-button"===t&&(customElements.get(n(t))||customElements.define(n(t),c))}))};export{v as LmvzButton,u as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as r,c as t,h as a,d as o,t as m}from"./p-
|
|
1
|
+
import{p as e,H as r,c as t,h as a,d as o,t as m}from"./p-vi4YzJmv.js";import{a as n,s as l}from"./p-Bs6_m7Uw.js";const i=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.primaryAction=t(this,"primaryAction")}cardTitle;imageUrl;description;primaryActionLabel="";primaryAction;get fallbackImage(){return n(l("card-placeholder.svg"))}_onPrimaryClick(){this.primaryAction.emit()}_onOverflowClick(e){console.log(e)}render(){return a(o,{key:"1438354a53604954320d01652aa1d84f8712e875",role:"article"},a("div",{key:"dcffae2c48ebf8f8769cf07c2e78806f12df6888",class:"top"},a("div",{key:"e41e1d0aafbfc5879b86022e91958ef3373b48b2",class:"image-wrapper",style:{backgroundImage:`url(${this.imageUrl??this.fallbackImage})`}},a("div",{key:"f6a1fc9706012f39aca9dd0b995290e6042e3407",class:"chip-slot"},a("slot",{key:"4e014519c147705cc30b3268d652ea6c76c749ec",name:"chip"})))),a("div",{key:"e7baf78b660e9a97edd0b6a0aa1bdb1afa593fed",class:"bottom"},a("header",{key:"a8dad9f91df60f535725328a4901833d47652678"},a("h2",{key:"1cdbca46469750187856a46fa155128f1f8a677f",class:"title"},this.cardTitle)),a("p",{key:"f33c2c0af86d7be31fcbd676833b27c7d06e2dd9",class:"description"},this.description),a("div",{key:"a12595d514167fb957aac71fe3d144810b442f9d",class:"actions"},a("button",{key:"9730cedbf83599c09eedaaae43331147691486d6",class:"primary",onClick:this._onPrimaryClick.bind(this),"data-testid":"primary"},this.primaryActionLabel),a("button",{key:"48e9c511c406beb75334452769beade3dec9a3f5",class:"tertiary","aria-label":"More actions",onClick:this._onOverflowClick},a("span",{key:"81cc1af42a15dddb9dbd4f373a6a047c2e2cd563",class:"icon-placeholder"},"...")))))}static get assetsDirs(){return["../../assets"]}static get style(){return"@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { h1, h2, h3, h4, h5, h6 { margin: 0; } } .sc-lmvz-card-h { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); 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); 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-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } 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-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: flex; min-width: var(--lmvz-other-component-card-minwidth, 20.4375rem); max-width: var(--lmvz-other-component-card-maxwidth, 21.6875rem); flex-direction: column; align-items: flex-start; border-radius: var(--lmvz-semantic-border-radius-lg, 14px); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); background: var(--lmvz-semantic-color-surface-primary, #ffffff); } *.sc-lmvz-card { color: var(--lmvz-semantic-color-on-surface-primary, #000000); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .top.sc-lmvz-card { display: flex; padding: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); flex-direction: column; justify-content: center; align-items: center; align-self: stretch; } .bottom.sc-lmvz-card { display: flex; min-width: 150px; padding: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)); flex-direction: column; align-items: flex-start; align-self: stretch; } .title.sc-lmvz-card { margin: 0; display: flex; justify-content: center; align-items: center; align-self: stretch; padding-bottom: var(--lmvz-global-s4, 4px); overflow-wrap: break-word; font: var(--lmvz-typography-heading-2xl, 500 clamp(2rem, 1.94rem + 0.26vw, 2.25rem) / 1.2 Router); } .description.sc-lmvz-card { display: flex; margin: 0; padding-bottom: var(--lmvz-component-body-sm-padding-bottom, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-items: flex-start; align-self: stretch; white-space: pre-line; font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .image-wrapper.sc-lmvz-card { aspect-ratio: 4 / 3; width: 100%; background-size: cover; background-position: center; flex: 1 0 0; align-self: stretch; border-radius: var(--lmvz-semantic-border-radius-md, 6px); } .actions.sc-lmvz-card { margin-top: var(--lmvz-component-form-wrapper-gap-y, clamp(1.13rem, 0.97rem + 0.65vw, 1.75rem)); display: flex; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-self: stretch; } button.primary.sc-lmvz-card, lmvz-button.primary.sc-lmvz-card { display: flex; justify-content: center; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); flex: 1 0 0; }"}},[774,"lmvz-card",{cardTitle:[1,"card-title"],imageUrl:[1,"image-url"],description:[1],primaryActionLabel:[1,"primary-action-label"]}]),c=i,d=function(){"undefined"!=typeof customElements&&["lmvz-card"].forEach((e=>{"lmvz-card"===e&&(customElements.get(m(e))||customElements.define(m(e),i))}))};export{c as LmvzCard,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as s,h as e,d as c,t as n}from"./p-
|
|
1
|
+
import{p as t,H as s,h as e,d as c,t as n}from"./p-vi4YzJmv.js";const o=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}text;render(){return e(c,{key:"b247f41d22bcf77998bf5a49669f1aa8d7fd3a63"},this.text)}static get style(){return":host{display:block}"}},[513,"lmvz-chip",{text:[1]}]),i=o,m=function(){"undefined"!=typeof customElements&&["lmvz-chip"].forEach((t=>{"lmvz-chip"===t&&(customElements.get(n(t))||customElements.define(n(t),o))}))};export{i as LmvzChip,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,h as a,d as t,t as r}from"./p-
|
|
1
|
+
import{p as e,h as a,d as t,t as r}from"./p-vi4YzJmv.js";import{R as n,A as s}from"./p-CMteT-Yo.js";import{g as i,c as l}from"./p-B3JVFwO1.js";import{d as o}from"./p-BBDH9X49.js";class c{host;elements=[];constructor(e){this.host=e}hostDidRender(){this.host.el.addEventListener("keydown",this.handleKeydown)}updateElements(e){this.elements=e}handleKeydown=e=>{const{key:a}=e;if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(a))return;const t=i(document),r=this.getNextFocusableElement(t,["ArrowDown","ArrowRight"].includes(a)?"down":"up");r&&(e.preventDefault(),r.focus?.())};getNextFocusableElement(e,a){const{elements:t}=this,r=t.indexOf(e);if(-1===r)return null;let n=null;if("down"===a?n=(r+1)%t.length:"up"===a&&(n=(r-1+t.length)%t.length),null==n)return null;const s=t[n];return l(s)?s:this.getNextFocusableElement(s,a)}}const d=e(class extends n{get el(){return this}primarySlot;secondarySlot;secondaryNav;keyboardNavigationController=new c(this);get primaryMenuitems(){return this.primarySlot.assignedElements({flatten:!1})}get secondaryMenuitems(){return this.secondarySlot.assignedElements({flatten:!0})}get role(){return"banner"}lmvzActiveNav;get secondarySlotName(){return"connect-nav-"+this.lmvzActiveNav}constructor(e){super(!1),!1!==e&&this.__registerHost(),this.__attachShadow(),this.addController(new s(this,{reValidateOnPropChanges:!0})),this.addController(this.keyboardNavigationController)}handleActiveNavChange(){this.updateElementsActive()}componentDidLoad(){this.primarySlot.addEventListener("slotchange",this.handlePrimaryNavItemsChange.bind(this)),this.handlePrimaryNavItemsChange(),this.secondarySlot.addEventListener("slotchange",this.handleSecondaryNavItemsChange.bind(this))}handlePrimaryNavItemsChange(){const e=this.primaryMenuitems;e.length?(e.forEach((e=>{e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-controls","nav-secondary")})),this.updateElementsActive()):console.warn("Primary slot has no assigned elements. Please add navigation items to the primary slot.")}handleSecondaryNavItemsChange(){this.secondaryMenuitems.length&&this.updateKeyboardNavSubjects()}updateKeyboardNavSubjects(){this.keyboardNavigationController.updateElements([...this.primaryMenuitems,...this.secondaryMenuitems])}updateElementsActive(){let e;this.primaryMenuitems.forEach((a=>{const t=a.id===this.lmvzActiveNav;t&&(e=a.textContent||a.id),a.setAttribute("aria-expanded",t?"true":"false")})),this.secondaryNav.setAttribute("aria-label","Untermenü für "+e)}delegateFocus(){const e=this.primaryMenuitems[0];e&&e.focus()}render(){return a(t,{key:"783c855e49e1a2447107d6205a1b2c50285ccfff",onFocus:this.delegateFocus.bind(this)},a("div",{key:"84a78b0ed3e170c49a711fa4091f80dbc7003b2f",class:"brand"},a("slot",{key:"76cc54f17a7bc5f825433fc56351666a93891fd2",name:"brand"},a("lmvz-icon",{key:"e196e43720cb4b4c3f79b3071d534b50480f6206",id:"fallback-logo-lmvz",icon:"Logo",size:"inherit","aria-label":"Lehrmittelverlag Zürich"}))),a("nav",{key:"d25a719752bd4085da5ad18af94afc66e9cabd5e","aria-label":"Hauptnavigation"},a("div",{key:"8a12c2c53bd061b3559ce9693780e592b3d7aa32",role:"menubar",class:"primary-menubar"},a("slot",{key:"4461632675dc657f675883e8ef618e371ace0ad7",name:"nav-primary",ref:e=>this.primarySlot=e}),a("div",{key:"c1dabc588ac376db667df32d3edbdd6dce60aaad",role:"menu",id:"nav-secondary",class:"secondary-menubar",hidden:!this.lmvzActiveNav,ref:e=>this.secondaryNav=e},a("slot",{key:"74ca44ee2f755ffe9ea3ebc19cc2b227ae22df8b",name:this.secondarySlotName,ref:e=>this.secondarySlot=e})))),a("div",{key:"a4d250a5fcd10390aed1f5369c28ddec9aa9ee8d",class:"actions"},a("slot",{key:"77a499ce12d269e79221ca971cc1b203d179f459",name:"actions"})))}static get watchers(){return{lmvzActiveNav:[{handleActiveNavChange:0}]}}static get style(){return":host{display:flex;width:100vw;flex-direction:row;align-items:center;box-sizing:border-box;background-color:var(--lmvz-semantic-color-surface-primary, #ffffff);--lmvz-header-x-spacing-level-1:var(--lmvz-dimension-8-28, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));--lmvz-header-x-spacing-level-2:var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));padding:var(--lmvz-dimension-8-16, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);gap:var(--lmvz-header-x-spacing-level-1);.brand{display:inline-flex;justify-content:center;align-items:center}#fallback-logo-lmvz{height:34px;width:auto}nav{flex-grow:1}.primary-menubar{display:flex;flex-direction:row;align-items:center}.secondary-menubar{display:flex;flex-direction:row;align-items:center;margin-left:var(--lmvz-header-x-spacing-level-2);padding-left:var(--lmvz-header-x-spacing-level-2);border-left:1px solid var(--lmvz-semantic-color-border-default, #e0e0e0)}}"}},[769,"lmvz-header",{role:[2561],lmvzActiveNav:[1,"lmvz-active-nav"]},void 0,{lmvzActiveNav:[{handleActiveNavChange:0}]}]),m=d,h=function(){"undefined"!=typeof customElements&&["lmvz-header","lmvz-icon"].forEach((e=>{switch(e){case"lmvz-header":customElements.get(r(e))||customElements.define(r(e),d);break;case"lmvz-icon":customElements.get(r(e))||o()}}))};export{m as LmvzHeader,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as o,d as s}from"./p-
|
|
1
|
+
import{L as o,d as s}from"./p-BBDH9X49.js";const p=o,r=s;export{p as LmvzIcon,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,c as e,h as r,t as i}from"./p-
|
|
1
|
+
import{p as t,c as e,h as r,t as i}from"./p-vi4YzJmv.js";import{c as o}from"./p-BfTCfPZ1.js";import{R as a,A as n}from"./p-CMteT-Yo.js";import{a as l}from"./p-B3JVFwO1.js";let s=0;const c=t(class extends a{get el(){return this}lmvzInput;internals;nativeInputElement;inputId="lmvz-input-"+s++;initialValue="";nativeError=!1;errorFromProp=!1;get helperId(){return this.helperText?this.inputId+"-helper":void 0}get showErrorMessage(){return this.error&&!!this.errorMessage}get errorId(){return this.inputId+"-error"}get describedBy(){const t=[];return this.helperId&&t.push(this.helperId),this.showErrorMessage&&t.push(this.errorId),t.length>0?t.join(" "):void 0}value;label;helperText;placeholder;disabled=!1;readonly=!1;required=!1;name;type="text";errorMessage;autocomplete;inputmode;autocorrect;autocapitalize;spellcheck;autofocus=!1;minlength;maxlength;pattern;min;max;step;form;get error(){return this.errorFromProp||this.nativeError}set error(t){this.errorFromProp=t}async setValue(t){this.value=this.nativeInputElement.value=t??"",this.internals.setFormValue?.(t),this.lmvzInput.emit(t)}async focusInput(){this.nativeInputElement?.focus()}async blurInput(){this.nativeInputElement?.blur()}async select(){this.nativeInputElement?.select()}async checkValidity(){return this.nativeInputElement?.checkValidity?.()??!1}async reportValidity(){return this.nativeInputElement?.reportValidity?.()??!1}async getInputElement(){return this.nativeInputElement||await new Promise((t=>l(this.el,t))),Promise.resolve(this.nativeInputElement)}constructor(t){super(!1),!1!==t&&this.__registerHost(),this.lmvzInput=e(this,"lmvzInput"),this.internals=this.attachInternals(),this.addController(new n(this,{reValidateOnPropChanges:!0}))}componentWillLoad(){this.initialValue=this.value}formAssociatedCallback(t){t&&this.internals.setFormValue?.(this.value)}formResetCallback(){this.internals.setValidity({}),this.setValue(this.initialValue)}formStateRestoreCallback(t){this.setValue(t)}handleValueChange(t){this.nativeInputElement&&(this.nativeInputElement.value===t||this.setValue(t))}handleDisabledChange(t){t&&this.nativeInputElement&&this.nativeInputElement.blur()}handleInput=t=>{this.setValue(t.target.value)};handleChange=t=>{this.updateNativeError(t.target??this.nativeInputElement)};handleFocus=()=>{};handleBlur=t=>{const e=t.target;e.reportValidity?.()};updateNativeError(t){const e=t??this.nativeInputElement;e&&(this.nativeError=!(e.checkValidity?.()??1))}render(){const t=!!this.value,e=t||!!this.placeholder;return r("div",{key:"4dffa432df9b8ca5d89c02b59cfe25b9321ca162",class:o("input-container",{"interaction-filled":t})},r("div",{key:"ade1cd1137acce218d458c1b66b2eb29cf887b70",class:"input-wrapper"},r("slot",{key:"013dff3540481724658ff754bf3db0585ec3b6f4",name:"before-input"}),r("div",{key:"6587bb63c79f97c31abff5be0a91eb16374971d5",class:"label-input-group"},r("label",{key:"2ef0a35fbd38b255423d2793415568a661476db3",htmlFor:this.inputId,class:o({floating:e})},this.label,this.required&&r("span",{key:"0785826710ee4ecea96037cc689c34a43113552e",class:"required-indicator","aria-hidden":"true"}," ","*")),r("input",{key:"5ad0d4b2d1c11dd89824db87e331232ba703a05e",id:this.inputId,ref:t=>this.nativeInputElement=t,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})),r("slot",{key:"a23676cc830cac7fbf87fef81a8d05b50b831725",name:"after-input"})),r("div",{key:"e0a05138954d70508f840b6d5c4f53e74c2f2979",id:this.helperId,role:"status"},this.helperText||null),r("div",{key:"fcba57be2d596b3b8aa0ac97b2fd31dc3e77e14b",id:this.errorId,role:"alert"},this.showErrorMessage&&this.errorMessage||null))}static get formAssociated(){return!0}static get watchers(){return{value:[{handleValueChange:0}],disabled:[{handleDisabledChange:0}]}}static get style(){return"@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --input-border-color-focus: var(--lmvz-semantic-color-status-on-selected, #0e7ab4); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: 48px; --input-padding-x: 16px; --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --input-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --helper-text-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --error-text-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); --label-floating-scale: 0.85; --label-minimized-top: -6px; --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } .input-container.sc-lmvz-input { display: flex; flex-direction: column; position: relative; width: 100%; } .input-wrapper.sc-lmvz-input { background-color: var(--input-bg); border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); display: flex; align-items: center; height: var(--input-height); padding: 0 var(--input-padding-x); position: relative; transition: border-color 0.2s ease; gap: 8px; } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .input-container.sc-lmvz-input:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); outline: 2px solid var(--input-border-color-focus); outline-offset: 2px; } .input-container.sc-lmvz-input:has(input:focus-visible) .input-wrapper.sc-lmvz-input { box-shadow: 0 0 0 3px rgb(0 86 214 / 20%); } [error].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); } [error].sc-lmvz-input-h:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); outline-color: var(--error-text-color); } .sc-lmvz-input-h:not([disabled]) .input-wrapper.sc-lmvz-input:hover { border-color: var(--input-border-color-hover); } .label-input-group.sc-lmvz-input { position: relative; flex-grow: 1; display: flex; align-items: center; height: 100%; } label.sc-lmvz-input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--label-color); font-size: 14px; font-family: Router, sans-serif; font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: normal; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0; transform: translateY(-50%) scale(0.85); transform-origin: left top; background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 500; } .required-indicator.sc-lmvz-input { color: var(--error-text-color); margin-left: 2px; } input.sc-lmvz-input { border: none; background: transparent; width: 100%; height: 100%; color: var(--input-text-color); font-family: inherit; font-size: 14px; outline: none; padding: 0; margin: 0; font-weight: 400; } input.sc-lmvz-input::placeholder { color: var(--label-color); } div.sc-lmvz-input:empty { display: none; } [role='status'].sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--helper-text-color); font-family: Router, sans-serif; font-weight: 500; } [role='alert'].sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--error-text-color); font-family: Router, sans-serif; font-weight: 500; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: 4px; }"}},[838,"lmvz-input",{value:[1025],label:[1],helperText:[1,"helper-text"],placeholder:[1],disabled:[516],readonly:[516],required:[516],name:[1],type:[1],errorMessage:[1,"error-message"],autocomplete:[1],inputmode:[1],autocorrect:[1],autocapitalize:[1],spellcheck:[4],autofocus:[4],minlength:[2],maxlength:[2],pattern:[1],min:[8],max:[8],step:[8],form:[1],error:[6660],nativeError:[32],setValue:[64],focusInput:[64],blurInput:[64],select:[64],checkValidity:[64],reportValidity:[64],getInputElement:[64]},void 0,{value:[{handleValueChange:0}],disabled:[{handleDisabledChange:0}]}]),p=c,u=function(){"undefined"!=typeof customElements&&["lmvz-input"].forEach((t=>{"lmvz-input"===t&&(customElements.get(i(t))||customElements.define(i(t),c))}))};export{p as LmvzInput,u as defineCustomElement}
|