@lmvz-ds/components 0.18.2 → 0.20.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 +16 -0
- package/README.md +45 -100
- package/assets/icons/checkmark.svg +4 -0
- package/cjs/{aria-loader-CfFuAbJn.js → aria-loader-Cec1zR2g.js} +1 -1
- package/cjs/ds.constants-DSnxZ3ia.js +16 -0
- package/cjs/icons-BQASWgk-.js +80 -0
- package/cjs/{index--7IqZZqn.js → index-3g9Z9sfF.js} +765 -2854
- package/cjs/index.cjs.js +12 -12
- package/cjs/lmvz-button.cjs.entry.js +4 -4
- package/cjs/lmvz-card.cjs.entry.js +1 -1
- package/cjs/lmvz-checkbox.cjs.entry.js +113 -0
- package/cjs/lmvz-chip.cjs.entry.js +68 -4
- package/cjs/lmvz-components.cjs.js +1 -1
- package/cjs/lmvz-header_2.cjs.entry.js +3 -3
- package/cjs/lmvz-icon.cjs.entry.js +10 -8
- package/cjs/lmvz-input.cjs.entry.js +4 -4
- package/cjs/lmvz-menuitem.cjs.entry.js +4 -4
- package/cjs/lmvz-select.cjs.entry.js +3 -3
- package/cjs/loader.cjs.js +1 -1
- package/cjs/{logger-Bn2yoZGP.js → logger-DsM6xg6V.js} +3063 -833
- package/cjs/{reactive-controller-host-CtaVAiYJ.js → reactive-controller-host-BA4ZhjKA.js} +10 -10
- package/cjs/svg-BMBduILB.js +125 -0
- package/collection/api/ds.constants.js +2 -0
- package/collection/assets/icons/checkmark.svg +4 -0
- package/collection/collection-manifest.json +1 -0
- package/collection/components/lmvz-button/lmvz-button.css +1 -2
- package/collection/components/lmvz-button/lmvz-button.js +6 -3
- package/collection/components/lmvz-card/lmvz-card.css +1 -2
- package/collection/components/lmvz-checkbox/lmvz-checkbox.css +207 -0
- package/collection/components/lmvz-checkbox/lmvz-checkbox.js +424 -0
- package/collection/components/lmvz-chip/lmvz-chip.css +84 -1
- package/collection/components/lmvz-chip/lmvz-chip.js +110 -13
- package/collection/components/lmvz-header/lmvz-header.js +2 -2
- package/collection/components/lmvz-icon/lmvz-icon.css +11 -10
- package/collection/components/lmvz-icon/lmvz-icon.js +8 -7
- package/collection/components/lmvz-input/lmvz-input.js +4 -4
- package/collection/components/lmvz-menuitem/lmvz-menuitem.css +1 -1
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +11 -5
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/index.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/utils/aria/aria-validation-controller.js +1 -0
- package/collection/utils/icons/icons.js +2 -13
- package/collection/utils/icons/icons.unit.js +3 -15
- package/collection/utils/reactive-controller-host.js +9 -9
- 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.js +1 -1
- package/components/lmvz-card.js +1 -1
- package/components/lmvz-checkbox.d.ts +11 -0
- package/components/lmvz-checkbox.d.ts.bak +11 -0
- package/components/lmvz-checkbox.js +1 -0
- 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-select.js +1 -1
- package/components/p-0s99QfRy.js +12 -0
- package/components/{p-CBLAeife.js → p-BuFx0tTm.js} +1 -1
- package/components/p-CGmJG63p.js +1 -0
- package/components/p-CcxjkCOx.js +1 -0
- package/components/{p-DQEkWkMh.js → p-DIrAQ4IB.js} +1 -1
- package/esm/{aria-loader-BF_AYtbb.js → aria-loader-BVolm0lC.js} +1 -1
- package/esm/ds.constants-Bmi89ll1.js +9 -0
- package/esm/icons-CmuFKDRz.js +75 -0
- package/esm/{index-7Ru1khgk.js → index-Dh_9sN0q.js} +389 -2478
- package/esm/index.js +5 -11
- package/esm/lmvz-button.entry.js +4 -4
- package/esm/lmvz-card.entry.js +1 -1
- package/esm/lmvz-checkbox.entry.js +111 -0
- package/esm/lmvz-chip.entry.js +69 -5
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-header_2.entry.js +3 -3
- package/esm/lmvz-icon.entry.js +10 -8
- package/esm/lmvz-input.entry.js +4 -4
- package/esm/lmvz-menuitem.entry.js +4 -4
- package/esm/lmvz-select.entry.js +3 -3
- package/esm/loader.js +1 -1
- package/esm/{logger-fiRXhuXK.js → logger-CGmJG63p.js} +2870 -765
- package/esm/{reactive-controller-host-sR2jJxNG.js → reactive-controller-host-DHcPpJW7.js} +10 -10
- package/esm/svg-B2YoIRuh.js +121 -0
- package/hydrate/index.js +2383 -42
- package/hydrate/index.mjs +2383 -42
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-5aa17cd2.entry.js → p-0f7a4236.entry.js} +1 -1
- package/lmvz-components/p-0s99QfRy.js +12 -0
- package/lmvz-components/{p-30b99f11.entry.js → p-2f83d7a2.entry.js} +1 -1
- package/lmvz-components/{p-6dbb3f13.entry.js → p-32171f4f.entry.js} +1 -1
- package/lmvz-components/{p-59383f3a.entry.js → p-400b2318.entry.js} +1 -1
- package/lmvz-components/p-851969bd.entry.js +1 -0
- package/lmvz-components/p-9f9d845d.entry.js +1 -0
- package/lmvz-components/p-Bmi89ll1.js +1 -0
- package/lmvz-components/p-CFsC37ww.js +1 -0
- package/lmvz-components/p-CGmJG63p.js +1 -0
- package/lmvz-components/p-CcxjkCOx.js +1 -0
- package/lmvz-components/{p-Bkfdgg0T.js → p-GdMr6Qlp.js} +1 -1
- package/lmvz-components/p-a12f95da.entry.js +1 -0
- package/lmvz-components/{p-84267405.entry.js → p-ab4437dc.entry.js} +1 -1
- package/lmvz-components/{p-7a6bec13.entry.js → p-d0a0e206.entry.js} +1 -1
- package/lmvz-components/{p-B3dnXEPG.js → p-dhVSUYqd.js} +1 -1
- package/manifest.json +544 -28
- package/package.json +5 -1
- package/types/api/ds.constants.d.ts +6 -1
- package/types/components/lmvz-action/lmvz-action.d.ts +0 -1
- package/types/components/lmvz-button/lmvz-button.d.ts +0 -1
- package/types/components/lmvz-card/lmvz-card.d.ts +0 -1
- package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +39 -0
- package/types/components/lmvz-chip/lmvz-chip.d.ts +18 -3
- package/types/components/lmvz-header/lmvz-header.d.ts +0 -1
- package/types/components/lmvz-icon/lmvz-icon.d.ts +0 -1
- package/types/components/lmvz-input/lmvz-input.d.ts +0 -1
- package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +0 -1
- package/types/components/lmvz-select/lmvz-select.d.ts +0 -1
- package/types/components.d.ts +221 -12
- package/types/index.d.ts +1 -2
- package/types/utils/aria/aria-validation-controller.d.ts +1 -2
- package/types/utils/aria/element-activation-controller.d.ts +0 -1
- package/types/utils/aria/list-keyboard-controller.d.ts +0 -1
- package/types/utils/assets.d.ts +0 -1
- package/types/utils/component.d.ts +0 -1
- package/types/utils/environment.d.ts +0 -1
- package/types/utils/http.d.ts +0 -1
- package/types/utils/http.unit.d.ts +0 -1
- package/types/utils/icons/icons-registry.d.ts +0 -1
- package/types/utils/icons/icons.d.ts +0 -2
- package/types/utils/icons/icons.unit.d.ts +0 -1
- package/types/utils/icons/public.d.ts +0 -1
- package/types/utils/public.d.ts +0 -1
- package/types/utils/reactive-controller-host.d.ts +0 -1
- package/cjs/icons-swqMn6s2.js +0 -163
- package/components/p-DXOTa5VF.js +0 -12
- package/components/p-fiRXhuXK.js +0 -1
- package/esm/icons-Ca8oMiRa.js +0 -157
- package/lmvz-components/p-0a41cc24.entry.js +0 -1
- package/lmvz-components/p-5f150890.entry.js +0 -1
- package/lmvz-components/p-Bh2Epkwf.js +0 -1
- package/lmvz-components/p-DXOTa5VF.js +0 -12
- package/lmvz-components/p-fiRXhuXK.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var ariaLoader = require('./aria-loader-
|
|
3
|
+
var ariaLoader = require('./aria-loader-Cec1zR2g.js');
|
|
4
4
|
var index = require('./index-C2yDXRqP.js');
|
|
5
5
|
|
|
6
6
|
class AriaValidationController {
|
|
@@ -158,34 +158,34 @@ class ReactiveControllerHost {
|
|
|
158
158
|
this.controllers.delete(controller);
|
|
159
159
|
}
|
|
160
160
|
get activeControllers() {
|
|
161
|
-
return Array.from(this.controllers).filter(controller => !controller.disabled);
|
|
161
|
+
return Array.from(this.controllers).filter((controller) => !controller.disabled);
|
|
162
162
|
}
|
|
163
163
|
connectedCallback() {
|
|
164
164
|
if (!this.controllers.size) {
|
|
165
165
|
console.warn('ReactiveControllerHost connected with no controllers registered.', this);
|
|
166
166
|
}
|
|
167
|
-
this.activeControllers.forEach(controller => controller.hostConnected?.());
|
|
167
|
+
this.activeControllers.forEach((controller) => controller.hostConnected?.());
|
|
168
168
|
}
|
|
169
169
|
disconnectedCallback() {
|
|
170
|
-
this.activeControllers.forEach(controller => controller.hostDisconnected?.());
|
|
170
|
+
this.activeControllers.forEach((controller) => controller.hostDisconnected?.());
|
|
171
171
|
}
|
|
172
172
|
componentWillLoad() {
|
|
173
|
-
this.activeControllers.forEach(controller => controller.hostWillLoad?.());
|
|
173
|
+
this.activeControllers.forEach((controller) => controller.hostWillLoad?.());
|
|
174
174
|
}
|
|
175
175
|
componentDidLoad() {
|
|
176
|
-
this.activeControllers.forEach(controller => controller.hostDidLoad?.());
|
|
176
|
+
this.activeControllers.forEach((controller) => controller.hostDidLoad?.());
|
|
177
177
|
}
|
|
178
178
|
componentWillRender() {
|
|
179
|
-
this.activeControllers.forEach(controller => controller.hostWillRender?.());
|
|
179
|
+
this.activeControllers.forEach((controller) => controller.hostWillRender?.());
|
|
180
180
|
}
|
|
181
181
|
componentDidRender() {
|
|
182
|
-
this.activeControllers.forEach(controller => controller.hostDidRender?.());
|
|
182
|
+
this.activeControllers.forEach((controller) => controller.hostDidRender?.());
|
|
183
183
|
}
|
|
184
184
|
componentWillUpdate() {
|
|
185
|
-
this.activeControllers.forEach(controller => controller.hostWillUpdate?.());
|
|
185
|
+
this.activeControllers.forEach((controller) => controller.hostWillUpdate?.());
|
|
186
186
|
}
|
|
187
187
|
componentDidUpdate() {
|
|
188
|
-
this.activeControllers.forEach(controller => controller.hostDidUpdate?.());
|
|
188
|
+
this.activeControllers.forEach((controller) => controller.hostDidUpdate?.());
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var logger = require('./logger-DsM6xg6V.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This module provides types and utility functions to create and work with branded types,
|
|
7
|
+
* which are TypeScript types with an added type tag to prevent accidental usage of a value in the wrong context.
|
|
8
|
+
*
|
|
9
|
+
* The `refined` and `nominal` functions are both used to create branded types in TypeScript.
|
|
10
|
+
* The main difference between them is that `refined` allows for validation of the data, while `nominal` does not.
|
|
11
|
+
*
|
|
12
|
+
* The `nominal` function is used to create a new branded type that has the same underlying type as the input, but with a different name.
|
|
13
|
+
* This is useful when you want to distinguish between two values of the same type that have different meanings.
|
|
14
|
+
* The `nominal` function does not perform any validation of the input data.
|
|
15
|
+
*
|
|
16
|
+
* On the other hand, the `refined` function is used to create a new branded type that has the same underlying type as the input,
|
|
17
|
+
* but with a different name, and it also allows for validation of the input data.
|
|
18
|
+
* The `refined` function takes a predicate that is used to validate the input data.
|
|
19
|
+
* If the input data fails the validation, a `BrandErrors` is returned, which provides information about the specific validation failure.
|
|
20
|
+
*
|
|
21
|
+
* @since 2.0.0
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* @since 2.0.0
|
|
25
|
+
* @category symbols
|
|
26
|
+
*/
|
|
27
|
+
const RefinedConstructorsTypeId = /*#__PURE__*/Symbol.for("effect/Brand/Refined");
|
|
28
|
+
/**
|
|
29
|
+
* Returns a `BrandErrors` that contains a single `RefinementError`.
|
|
30
|
+
*
|
|
31
|
+
* @since 2.0.0
|
|
32
|
+
* @category constructors
|
|
33
|
+
*/
|
|
34
|
+
const error = (message, meta) => [{
|
|
35
|
+
message,
|
|
36
|
+
meta
|
|
37
|
+
}];
|
|
38
|
+
function refined(...args) {
|
|
39
|
+
const either = args.length === 2 ? unbranded => args[0](unbranded) ? logger.right(unbranded) : logger.left(args[1](unbranded)) : unbranded => {
|
|
40
|
+
return logger.match(args[0](unbranded), {
|
|
41
|
+
onNone: () => logger.right(unbranded),
|
|
42
|
+
onSome: logger.left
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
return Object.assign(unbranded => logger.getOrThrowWith(either(unbranded), logger.identity), {
|
|
46
|
+
[RefinedConstructorsTypeId]: RefinedConstructorsTypeId,
|
|
47
|
+
option: args => logger.getRight(either(args)),
|
|
48
|
+
either,
|
|
49
|
+
is: args => logger.isRight(either(args))
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const SVGString = refined(isValidSVG, () => error('SVG data is malformed'));
|
|
54
|
+
class BrandValidationError extends logger.TaggedError('BrandValidationError') {
|
|
55
|
+
constructor(error, type) {
|
|
56
|
+
super(new Error(`Brand validation failed for type ${type}.`, { cause: error }));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates a synchronous Micro effect that validates a string against the branded `SVGString` type.
|
|
61
|
+
*
|
|
62
|
+
* @param svg Raw SVG markup to validate.
|
|
63
|
+
*/
|
|
64
|
+
const validateSvg = (svg) => logger.try_({
|
|
65
|
+
try: () => SVGString(sanitizeSvg(svg)),
|
|
66
|
+
catch: (error) => new BrandValidationError(error, 'SVGString'),
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* Checks whether a string can be parsed into an SVG document.
|
|
70
|
+
*
|
|
71
|
+
* @param svg Raw SVG markup to validate.
|
|
72
|
+
*/
|
|
73
|
+
function isValidSVG(svg) {
|
|
74
|
+
if (typeof svg !== 'string')
|
|
75
|
+
return false;
|
|
76
|
+
try {
|
|
77
|
+
const parser = new DOMParser();
|
|
78
|
+
const doc = parser.parseFromString(svg, 'image/svg+xml');
|
|
79
|
+
return doc.documentElement.nodeName === 'svg';
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function sanitizeSvg(svg) {
|
|
86
|
+
const dataUriPrefix = 'data:image/svg+xml,';
|
|
87
|
+
const dataUriPrefixWithEncoding = 'data:image/svg+xml;base64,';
|
|
88
|
+
const base = svg.trim();
|
|
89
|
+
if (base.startsWith(dataUriPrefixWithEncoding)) {
|
|
90
|
+
return atob(base.slice(dataUriPrefixWithEncoding.length));
|
|
91
|
+
}
|
|
92
|
+
return !base.startsWith(dataUriPrefix) ? base : decodeURIComponent(base.slice(dataUriPrefix.length));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Returns a valid, empty SVG.
|
|
96
|
+
*/
|
|
97
|
+
const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
|
|
98
|
+
/**
|
|
99
|
+
* Returns a valid SVG string, or a fallback empty SVG if the input is invalid.
|
|
100
|
+
*
|
|
101
|
+
* @param value The SVG string to validate.
|
|
102
|
+
*/
|
|
103
|
+
function toValidSvgStringWithFallback(value) {
|
|
104
|
+
try {
|
|
105
|
+
return logger.runSync(validateSvg(value));
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
console.warn('Invalid SVG string:', value);
|
|
109
|
+
return emptyDefaultSvg();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function parseSvgString(value) {
|
|
113
|
+
try {
|
|
114
|
+
return logger.runSync(validateSvg(value));
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// this will be called by lmvz-icon, which might pass an icon name instead of an SVG string, so we log this at debug level to avoid spamming the console with warnings
|
|
118
|
+
console.debug('Invalid SVG string:', value);
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
exports.emptyDefaultSvg = emptyDefaultSvg;
|
|
124
|
+
exports.parseSvgString = parseSvgString;
|
|
125
|
+
exports.toValidSvgStringWithFallback = toValidSvgStringWithFallback;
|
|
@@ -5,3 +5,5 @@ export const textSizes = [...sizes, 'xl'];
|
|
|
5
5
|
export const inputTypes = ['text', 'email', 'password', 'tel', 'url', 'search', 'number'];
|
|
6
6
|
export const iconSizes = [...sizes, 'inherit'];
|
|
7
7
|
export const iconWeights = ['thin', 'medium', 'bold', 'filled'];
|
|
8
|
+
export const chipTypes = ['active', 'warning', 'success', 'error', 'neutral'];
|
|
9
|
+
export const chipSizes = ['default', 'small'];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none"
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
3
|
+
<path d="M3.75 12.5625L8.83079 17.625L20.4375 6.375" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"components/lmvz-action/lmvz-action.js",
|
|
4
4
|
"components/lmvz-button/lmvz-button.js",
|
|
5
5
|
"components/lmvz-card/lmvz-card.js",
|
|
6
|
+
"components/lmvz-checkbox/lmvz-checkbox.js",
|
|
6
7
|
"components/lmvz-chip/lmvz-chip.js",
|
|
7
8
|
"components/lmvz-header/lmvz-header.js",
|
|
8
9
|
"components/lmvz-icon/lmvz-icon.js",
|
|
@@ -91,8 +91,7 @@ button > * {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
button:focus-visible {
|
|
94
|
-
|
|
95
|
-
outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-active, #f1f9fe);
|
|
94
|
+
outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-on-active, #0e7ab4);
|
|
96
95
|
outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
97
96
|
}
|
|
98
97
|
|
|
@@ -57,7 +57,7 @@ export class LmvzButton extends ReactiveControllerHost {
|
|
|
57
57
|
};
|
|
58
58
|
render() {
|
|
59
59
|
this.renderHiddenButton();
|
|
60
|
-
return (h(Host, { key: '
|
|
60
|
+
return (h(Host, { key: 'ce82e749ffb9172a9421d303e0d7cc02de58dff9', "aria-disabled": this.disabled ? 'true' : null }, h("button", { key: 'acd0773f72e76139ec5495eb15fc3a5949029e40', ref: (e) => (this.validationEl = e), disabled: this.disabled, class: classNames(this.variant, { [this.scale ?? '']: !!this.scale, disabled: this.disabled }), ...this.inheritedAttributes }, h("slot", { key: 'f519e0f82e68811a8831214e83e609bd9501fed0' }))));
|
|
61
61
|
}
|
|
62
62
|
static get is() { return "lmvz-button"; }
|
|
63
63
|
static get encapsulation() { return "shadow"; }
|
|
@@ -188,8 +188,11 @@ export class LmvzButton extends ReactiveControllerHost {
|
|
|
188
188
|
"required": false,
|
|
189
189
|
"optional": false,
|
|
190
190
|
"docs": {
|
|
191
|
-
"tags": [
|
|
192
|
-
|
|
191
|
+
"tags": [{
|
|
192
|
+
"name": "default",
|
|
193
|
+
"text": "'button'"
|
|
194
|
+
}],
|
|
195
|
+
"text": "Native button type forwarded to the internal `<button>` element.\nUse `submit` to trigger form submission."
|
|
193
196
|
},
|
|
194
197
|
"getter": false,
|
|
195
198
|
"setter": false,
|
|
@@ -92,8 +92,7 @@ button > * {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
button:focus-visible {
|
|
95
|
-
|
|
96
|
-
outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-active, #f1f9fe);
|
|
95
|
+
outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-on-active, #0e7ab4);
|
|
97
96
|
outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
98
97
|
}
|
|
99
98
|
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
|
|
2
|
+
@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides;
|
|
3
|
+
/**
|
|
4
|
+
* This defines the order of our lmvz-ds' CSS layers. See readme.md for details.
|
|
5
|
+
* Important: Always import this file _before_ layering your own styles!
|
|
6
|
+
*/
|
|
7
|
+
@layer lmvz-ds.theme {
|
|
8
|
+
@font-face {
|
|
9
|
+
font-family: Router;
|
|
10
|
+
src:
|
|
11
|
+
local('Router-Book'),
|
|
12
|
+
url('/assets/fonts/Router-Book.woff') format('woff'),
|
|
13
|
+
local('Router');
|
|
14
|
+
font-weight: 400 normal;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@font-face {
|
|
18
|
+
font-family: Router;
|
|
19
|
+
src:
|
|
20
|
+
local('Router-Medium'),
|
|
21
|
+
url('/assets/fonts/Router-Medium.woff') format('woff'),
|
|
22
|
+
local('Router');
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@font-face {
|
|
27
|
+
font-family: Router;
|
|
28
|
+
src:
|
|
29
|
+
local('Router-Bold'),
|
|
30
|
+
url('/assets/fonts/Router-Bold.woff') format('woff'),
|
|
31
|
+
local('Router');
|
|
32
|
+
font-weight: 700 bold;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
:host {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
|
|
39
|
+
--checkbox-box-size: var(--lmvz-global-s18, 18px); /* TODO: confirm this generic dimension token is intentional for checkbox box sizing */
|
|
40
|
+
--checkbox-border-radius: var(--lmvz-global-s4, 4px); /* TODO: consider component-specific token for border-radius */
|
|
41
|
+
|
|
42
|
+
--checkbox-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff);
|
|
43
|
+
--checkbox-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0);
|
|
44
|
+
--checkbox-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7);
|
|
45
|
+
--checkbox-border-color-checked: var(--lmvz-semantic-color-border-active, #0f8acc);
|
|
46
|
+
--checkbox-border-color-error: var(--lmvz-semantic-color-status-on-danger, #e52a31);
|
|
47
|
+
|
|
48
|
+
--checkbox-wrapper-bg-hover: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0);
|
|
49
|
+
--checkbox-wrapper-bg-checked: var(--lmvz-semantic-color-status-active, #f1f9fe);
|
|
50
|
+
|
|
51
|
+
--checkbox-ripple-bg: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0);
|
|
52
|
+
|
|
53
|
+
--checkbox-checkmark-color: var(--lmvz-semantic-color-border-active, #0f8acc);
|
|
54
|
+
|
|
55
|
+
--checkbox-label-color: var(--lmvz-semantic-color-on-surface-primary, #000000);
|
|
56
|
+
--checkbox-label-color-checked: var(--lmvz-semantic-color-status-on-active, #0e7ab4);
|
|
57
|
+
--checkbox-helper-color: var(--lmvz-semantic-color-on-surface-secondary, #7a7a7a);
|
|
58
|
+
--checkbox-error-color: var(--lmvz-semantic-color-status-on-danger, #e52a31);
|
|
59
|
+
--checkbox-focus-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4);
|
|
60
|
+
|
|
61
|
+
--checkbox-easing: var(--lmvz-global-easing-default, ease);
|
|
62
|
+
--checkbox-duration: 0.2s;
|
|
63
|
+
}
|
|
64
|
+
.pill {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
68
|
+
padding-block: var(--lmvz-dimension-2-8, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem));
|
|
69
|
+
padding-inline: var(--lmvz-dimension-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
70
|
+
border-radius: var(--lmvz-semantic-border-radius-round, 999px);
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
/* WCAG 2.5.5 AAA: 44px minimum touch target */
|
|
73
|
+
/* min-block-size: 44px; */
|
|
74
|
+
text-decoration: none;
|
|
75
|
+
background-color: transparent;
|
|
76
|
+
transition: background-color var(--checkbox-duration) var(--checkbox-easing);
|
|
77
|
+
}
|
|
78
|
+
input {
|
|
79
|
+
position: absolute;
|
|
80
|
+
opacity: 0;
|
|
81
|
+
width: var(--checkbox-box-size);
|
|
82
|
+
height: var(--checkbox-box-size);
|
|
83
|
+
margin: 0;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
z-index: 1;
|
|
86
|
+
}
|
|
87
|
+
.box {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
width: var(--checkbox-box-size);
|
|
92
|
+
height: var(--checkbox-box-size);
|
|
93
|
+
background-color: var(--checkbox-bg);
|
|
94
|
+
border: var(--lmvz-semantic-border-width-default, 1px) solid var(--checkbox-border-color);
|
|
95
|
+
border-radius: var(--checkbox-border-radius);
|
|
96
|
+
color: var(--checkbox-checkmark-color);
|
|
97
|
+
transition:
|
|
98
|
+
border-color var(--checkbox-duration) var(--checkbox-easing),
|
|
99
|
+
background-color var(--checkbox-duration) var(--checkbox-easing);
|
|
100
|
+
pointer-events: none;
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
}
|
|
103
|
+
.indicator {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
line-height: 0;
|
|
108
|
+
}
|
|
109
|
+
.content {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
overflow-wrap: break-word;
|
|
113
|
+
min-width: 0;
|
|
114
|
+
}
|
|
115
|
+
label {
|
|
116
|
+
font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4
|
|
117
|
+
Router);
|
|
118
|
+
color: var(--checkbox-label-color);
|
|
119
|
+
transition: color var(--checkbox-duration) var(--checkbox-easing);
|
|
120
|
+
}
|
|
121
|
+
.helper-text {
|
|
122
|
+
font: var(--lmvz-typography-body-sm, 400 clamp(0.75rem, 0.73rem + 0.06vw, 0.81rem) / 1.4
|
|
123
|
+
Router);
|
|
124
|
+
/* font-weight: 400 per DS token standard (body-sm). Note: lmvz-input.css [role='status'] incorrectly uses font-weight: 500 — DS inconsistency, see lmvz-input.css line ~153 */
|
|
125
|
+
color: var(--checkbox-helper-color);
|
|
126
|
+
margin-block-start: 2px;
|
|
127
|
+
}
|
|
128
|
+
.error-text {
|
|
129
|
+
font: var(--lmvz-typography-body-sm, 400 clamp(0.75rem, 0.73rem + 0.06vw, 0.81rem) / 1.4
|
|
130
|
+
Router);
|
|
131
|
+
color: var(--checkbox-error-color);
|
|
132
|
+
display: block;
|
|
133
|
+
margin-block-start: 4px;
|
|
134
|
+
padding-inline: 10px;
|
|
135
|
+
}
|
|
136
|
+
/* Hover state, guarded to prevent sticky hover on touch devices */
|
|
137
|
+
@media (hover: hover) {
|
|
138
|
+
.pill:hover {
|
|
139
|
+
background-color: var(--checkbox-wrapper-bg-hover);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.pill:hover .box {
|
|
143
|
+
border-color: var(--checkbox-border-color-hover);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/* Checked state */
|
|
147
|
+
:host([checked]) .pill {
|
|
148
|
+
background-color: var(--checkbox-wrapper-bg-checked);
|
|
149
|
+
}
|
|
150
|
+
:host([checked]) .box {
|
|
151
|
+
border-color: var(--checkbox-border-color-checked);
|
|
152
|
+
}
|
|
153
|
+
:host([checked]) label {
|
|
154
|
+
color: var(--checkbox-label-color-checked);
|
|
155
|
+
/* Contrast ~4.4:1 on checked wrapper background (#f1f9fe) — exception accepted per DS decision 5.3; approximately at WCAG AA threshold; pending design review for formal verification */
|
|
156
|
+
}
|
|
157
|
+
/* Error state. MUST appear AFTER checked state rules (error takes visual precedence) */
|
|
158
|
+
:host([error]) .box {
|
|
159
|
+
border-color: var(--checkbox-border-color-error);
|
|
160
|
+
}
|
|
161
|
+
:host([error]) .helper-text {
|
|
162
|
+
color: var(--checkbox-error-color);
|
|
163
|
+
}
|
|
164
|
+
/* Disabled state */
|
|
165
|
+
:host([disabled]) {
|
|
166
|
+
opacity: var(--lmvz-component-input-disabled-opacity, 40%);
|
|
167
|
+
pointer-events: none;
|
|
168
|
+
}
|
|
169
|
+
:host([disabled]) .pill {
|
|
170
|
+
cursor: not-allowed;
|
|
171
|
+
}
|
|
172
|
+
:host([disabled]) input {
|
|
173
|
+
cursor: not-allowed;
|
|
174
|
+
}
|
|
175
|
+
/* Focus ring, applied via sibling combinator on the native input */
|
|
176
|
+
input:focus-visible ~ .box {
|
|
177
|
+
outline: 2px solid var(--checkbox-focus-color);
|
|
178
|
+
outline-offset: 2px;
|
|
179
|
+
/* box-shadow: 0 0 0 3px rgba(15, 138, 204, 0.2); TODO: no design token available for focus shadow color/spread */
|
|
180
|
+
box-shadow: 0 var(--lmvz-semantic-shadow-l1-1-position-y, 2px) 0 var(--lmvz-semantic-shadow-l1-1-blur, 4px) var(--lmvz-semantic-color-shadow-l1-colored, rgba(175, 223, 249, 0.42));
|
|
181
|
+
}
|
|
182
|
+
/* Forced Colors / Windows High Contrast */
|
|
183
|
+
@media (forced-colors: active) {
|
|
184
|
+
.box {
|
|
185
|
+
forced-color-adjust: auto;
|
|
186
|
+
border-color: ButtonText;
|
|
187
|
+
background-color: Field;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:host([checked]) .box {
|
|
191
|
+
border-color: Highlight;
|
|
192
|
+
background-color: Field;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.indicator {
|
|
196
|
+
color: ButtonText;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:host([checked]) .indicator {
|
|
200
|
+
color: HighlightText;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
input:focus-visible ~ .box {
|
|
204
|
+
outline-color: Highlight;
|
|
205
|
+
box-shadow: none;
|
|
206
|
+
}
|
|
207
|
+
}
|