@lmvz-ds/components 0.19.0 → 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 +10 -0
- package/assets/icons/checkmark.svg +4 -0
- package/cjs/{aria-loader-CfFuAbJn.js → aria-loader-Cec1zR2g.js} +1 -1
- package/cjs/icons-BQASWgk-.js +80 -0
- package/cjs/{index--7IqZZqn.js → index-3g9Z9sfF.js} +765 -2854
- package/cjs/index.cjs.js +4 -3
- package/cjs/lmvz-button.cjs.entry.js +3 -3
- 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 +3 -3
- 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 +9 -7
- 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-Bi9eu2bV.js → reactive-controller-host-BA4ZhjKA.js} +1 -1
- package/cjs/{icons-Tg7ySOh-.js → svg-BMBduILB.js} +31 -85
- 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-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.js +1 -1
- package/collection/components/lmvz-header/lmvz-header.js +1 -1
- package/collection/components/lmvz-icon/lmvz-icon.js +5 -5
- package/collection/components/lmvz-input/lmvz-input.js +2 -2
- package/collection/components/lmvz-menuitem/lmvz-menuitem.css +1 -1
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/utils/icons/icons.js +2 -13
- package/collection/utils/icons/icons.unit.js +3 -15
- 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-DbeHBSOe.js → p-BuFx0tTm.js} +1 -1
- package/components/p-CGmJG63p.js +1 -0
- package/components/p-CcxjkCOx.js +1 -0
- package/esm/{aria-loader-CES8Ae1e.js → aria-loader-BVolm0lC.js} +1 -1
- package/esm/icons-CmuFKDRz.js +75 -0
- package/esm/{index-BvxaUA12.js → index-Dh_9sN0q.js} +389 -2478
- package/esm/index.js +4 -3
- package/esm/lmvz-button.entry.js +3 -3
- package/esm/lmvz-card.entry.js +1 -1
- package/esm/lmvz-checkbox.entry.js +111 -0
- package/esm/lmvz-chip.entry.js +3 -3
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-header_2.entry.js +3 -3
- package/esm/lmvz-icon.entry.js +9 -7
- 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-0bL3pydp.js → logger-CGmJG63p.js} +2870 -765
- package/esm/{reactive-controller-host-J2thAxVH.js → reactive-controller-host-DHcPpJW7.js} +1 -1
- package/esm/{icons-Bj4dF1-I.js → svg-B2YoIRuh.js} +29 -80
- package/hydrate/index.js +2441 -165
- package/hydrate/index.mjs +2441 -165
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-ec96c6b6.entry.js → p-0f7a4236.entry.js} +1 -1
- package/lmvz-components/p-0s99QfRy.js +12 -0
- package/lmvz-components/p-2f83d7a2.entry.js +1 -0
- package/lmvz-components/{p-6e8acbd9.entry.js → p-32171f4f.entry.js} +1 -1
- package/lmvz-components/{p-9212bd23.entry.js → p-400b2318.entry.js} +1 -1
- package/lmvz-components/{p-9626e951.entry.js → p-851969bd.entry.js} +1 -1
- package/lmvz-components/p-9f9d845d.entry.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-BxHnZA0M.js → p-GdMr6Qlp.js} +1 -1
- package/lmvz-components/p-a12f95da.entry.js +1 -0
- package/lmvz-components/{p-e1b847d2.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-DYaffOLo.js → p-dhVSUYqd.js} +1 -1
- package/manifest.json +410 -1
- package/package.json +5 -1
- package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +39 -0
- package/types/components.d.ts +151 -0
- package/types/utils/icons/icons.d.ts +0 -1
- package/components/p-DXOTa5VF.js +0 -12
- package/components/p-fiRXhuXK.js +0 -1
- package/lmvz-components/p-0bL3pydp.js +0 -1
- package/lmvz-components/p-40569208.entry.js +0 -1
- package/lmvz-components/p-49ab22bd.entry.js +0 -1
- package/lmvz-components/p-Bu4Z_PMf.js +0 -1
- package/lmvz-components/p-DHZwxmLb.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isAriaValidationEnabled, u as useVerboseLogging, A as ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, q as queueValidation } from './aria-loader-
|
|
1
|
+
import { i as isAriaValidationEnabled, u as useVerboseLogging, A as ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, q as queueValidation } from './aria-loader-BVolm0lC.js';
|
|
2
2
|
import { B as Build } from './index-saW7O-EW.js';
|
|
3
3
|
|
|
4
4
|
class AriaValidationController {
|
|
@@ -1,39 +1,4 @@
|
|
|
1
|
-
import { g as getOrThrowWith,
|
|
2
|
-
|
|
3
|
-
const IconProviderRegistryKey = Symbol.for('LMVZ__iconProviderRegistry');
|
|
4
|
-
const inMemoryRegistry = {};
|
|
5
|
-
function getRegistry() {
|
|
6
|
-
if (typeof window === 'undefined') {
|
|
7
|
-
return inMemoryRegistry;
|
|
8
|
-
}
|
|
9
|
-
return window[IconProviderRegistryKey] ?? (window[IconProviderRegistryKey] = {});
|
|
10
|
-
}
|
|
11
|
-
function registerIconProvider(id, provider) {
|
|
12
|
-
const registry = getRegistry();
|
|
13
|
-
const providerName = id;
|
|
14
|
-
if (Object.prototype.hasOwnProperty.call(registry, providerName)) {
|
|
15
|
-
console.warn(`Icon provider with name "${providerName}" is already registered. Overwriting existing provider.`);
|
|
16
|
-
}
|
|
17
|
-
registry[providerName] = provider;
|
|
18
|
-
}
|
|
19
|
-
function getRegisteredIconProvider(id) {
|
|
20
|
-
const registry = getRegistry();
|
|
21
|
-
if (id) {
|
|
22
|
-
return registry[id];
|
|
23
|
-
}
|
|
24
|
-
const providerNames = Object.keys(registry);
|
|
25
|
-
if (providerNames.length === 0) {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
if (providerNames.length > 1) {
|
|
29
|
-
console.warn(`Multiple icon providers registered (${providerNames.join(', ')}). Using the first one: "${providerNames[0]}".`);
|
|
30
|
-
}
|
|
31
|
-
const firstProviderName = providerNames[0];
|
|
32
|
-
if (!firstProviderName) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
return registry[firstProviderName];
|
|
36
|
-
}
|
|
1
|
+
import { g as getOrThrowWith, r as right, l as left, i as identity, a as isRight, b as getRight, m as match, c as runSync, t as try_, T as TaggedError } from './logger-CGmJG63p.js';
|
|
37
2
|
|
|
38
3
|
/**
|
|
39
4
|
* This module provides types and utility functions to create and work with branded types,
|
|
@@ -90,11 +55,11 @@ class BrandValidationError extends TaggedError('BrandValidationError') {
|
|
|
90
55
|
}
|
|
91
56
|
}
|
|
92
57
|
/**
|
|
93
|
-
*
|
|
58
|
+
* Creates a synchronous Micro effect that validates a string against the branded `SVGString` type.
|
|
94
59
|
*
|
|
95
60
|
* @param svg Raw SVG markup to validate.
|
|
96
61
|
*/
|
|
97
|
-
const
|
|
62
|
+
const validateSvg = (svg) => try_({
|
|
98
63
|
try: () => SVGString(sanitizeSvg(svg)),
|
|
99
64
|
catch: (error) => new BrandValidationError(error, 'SVGString'),
|
|
100
65
|
});
|
|
@@ -106,10 +71,9 @@ const createValidSVGString = (svg) => try_({
|
|
|
106
71
|
function isValidSVG(svg) {
|
|
107
72
|
if (typeof svg !== 'string')
|
|
108
73
|
return false;
|
|
109
|
-
const sanitizedSvg = sanitizeSvg(svg);
|
|
110
74
|
try {
|
|
111
75
|
const parser = new DOMParser();
|
|
112
|
-
const doc = parser.parseFromString(
|
|
76
|
+
const doc = parser.parseFromString(svg, 'image/svg+xml');
|
|
113
77
|
return doc.documentElement.nodeName === 'svg';
|
|
114
78
|
}
|
|
115
79
|
catch {
|
|
@@ -118,55 +82,40 @@ function isValidSVG(svg) {
|
|
|
118
82
|
}
|
|
119
83
|
function sanitizeSvg(svg) {
|
|
120
84
|
const dataUriPrefix = 'data:image/svg+xml,';
|
|
85
|
+
const dataUriPrefixWithEncoding = 'data:image/svg+xml;base64,';
|
|
121
86
|
const base = svg.trim();
|
|
87
|
+
if (base.startsWith(dataUriPrefixWithEncoding)) {
|
|
88
|
+
return atob(base.slice(dataUriPrefixWithEncoding.length));
|
|
89
|
+
}
|
|
122
90
|
return !base.startsWith(dataUriPrefix) ? base : decodeURIComponent(base.slice(dataUriPrefix.length));
|
|
123
91
|
}
|
|
124
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Returns a valid, empty SVG.
|
|
94
|
+
*/
|
|
125
95
|
const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
|
|
126
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Returns a valid SVG string, or a fallback empty SVG if the input is invalid.
|
|
98
|
+
*
|
|
99
|
+
* @param value The SVG string to validate.
|
|
100
|
+
*/
|
|
101
|
+
function toValidSvgStringWithFallback(value) {
|
|
127
102
|
try {
|
|
128
|
-
return
|
|
103
|
+
return runSync(validateSvg(value));
|
|
129
104
|
}
|
|
130
105
|
catch {
|
|
131
|
-
console.
|
|
106
|
+
console.warn('Invalid SVG string:', value);
|
|
132
107
|
return emptyDefaultSvg();
|
|
133
108
|
}
|
|
134
109
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const resolved = await Promise.resolve(provider.resolve(icon));
|
|
145
|
-
if (!resolved?.svg) {
|
|
146
|
-
console.warn(`Icon "${icon}"${iconset ? ` from set "${iconset}"` : ''} not found in provider. Using default icon.`);
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const validated = await toValidSvgStringWithFallback(resolved.svg);
|
|
150
|
-
if (validated) {
|
|
151
|
-
return validated;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
console.error(`Error resolving icon "${icon}" with provider:`, error);
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
return;
|
|
159
|
-
})();
|
|
160
|
-
if (iconSvg)
|
|
161
|
-
return iconSvg;
|
|
162
|
-
console.error(`Icon "${icon}" not found${iconset ? ` in set "${iconset}"` : ''}. Using default icon.`);
|
|
163
|
-
return emptyDefaultSvg();
|
|
164
|
-
}
|
|
165
|
-
function typedIconFromSet(iconset, icon) {
|
|
166
|
-
return {
|
|
167
|
-
iconset,
|
|
168
|
-
icon,
|
|
169
|
-
};
|
|
110
|
+
function parseSvgString(value) {
|
|
111
|
+
try {
|
|
112
|
+
return runSync(validateSvg(value));
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
// 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
|
|
116
|
+
console.debug('Invalid SVG string:', value);
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
170
119
|
}
|
|
171
120
|
|
|
172
|
-
export {
|
|
121
|
+
export { emptyDefaultSvg as e, parseSvgString as p, toValidSvgStringWithFallback as t };
|