@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
package/cjs/icons-swqMn6s2.js
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var logger = require('./logger-Bn2yoZGP.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
|
-
const createValidSVGString = (svg) => logger.try_({
|
|
60
|
-
try: () => SVGString(svg),
|
|
61
|
-
catch: (error) => new BrandValidationError(error, 'SVGString'),
|
|
62
|
-
});
|
|
63
|
-
function isValidSVG(svg) {
|
|
64
|
-
if (typeof svg !== 'string') {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
try {
|
|
68
|
-
const parser = new DOMParser();
|
|
69
|
-
const doc = parser.parseFromString(svg, 'image/svg+xml');
|
|
70
|
-
return doc.documentElement.nodeName === 'svg';
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const IconProviderRegistryKey = Symbol.for('LMVZ__iconProviderRegistry');
|
|
78
|
-
const inMemoryRegistry = {};
|
|
79
|
-
function getRegistry() {
|
|
80
|
-
if (typeof window === 'undefined') {
|
|
81
|
-
return inMemoryRegistry;
|
|
82
|
-
}
|
|
83
|
-
return window[IconProviderRegistryKey] ?? (window[IconProviderRegistryKey] = {});
|
|
84
|
-
}
|
|
85
|
-
function registerIconProvider(id, provider) {
|
|
86
|
-
const registry = getRegistry();
|
|
87
|
-
const providerName = id;
|
|
88
|
-
if (Object.prototype.hasOwnProperty.call(registry, providerName)) {
|
|
89
|
-
console.warn(`Icon provider with name "${providerName}" is already registered. Overwriting existing provider.`);
|
|
90
|
-
}
|
|
91
|
-
registry[providerName] = provider;
|
|
92
|
-
}
|
|
93
|
-
function getRegisteredIconProvider(id) {
|
|
94
|
-
const registry = getRegistry();
|
|
95
|
-
if (id) {
|
|
96
|
-
return registry[id];
|
|
97
|
-
}
|
|
98
|
-
const providerNames = Object.keys(registry);
|
|
99
|
-
if (providerNames.length === 0) {
|
|
100
|
-
return undefined;
|
|
101
|
-
}
|
|
102
|
-
if (providerNames.length > 1) {
|
|
103
|
-
console.warn(`Multiple icon providers registered (${providerNames.join(', ')}). Using the first one: "${providerNames[0]}".`);
|
|
104
|
-
}
|
|
105
|
-
const firstProviderName = providerNames[0];
|
|
106
|
-
if (!firstProviderName) {
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
return registry[firstProviderName];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
|
|
113
|
-
async function toValidSvgStringWithFallback(value) {
|
|
114
|
-
try {
|
|
115
|
-
return await logger.runPromise(createValidSVGString(value));
|
|
116
|
-
}
|
|
117
|
-
catch {
|
|
118
|
-
console.error('Invalid SVG string:', value);
|
|
119
|
-
return emptyDefaultSvg();
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
async function resolveIconSvg(options) {
|
|
123
|
-
const { icon, iconset } = options;
|
|
124
|
-
const iconSvg = await (async () => {
|
|
125
|
-
const provider = getRegisteredIconProvider(iconset);
|
|
126
|
-
if (!provider) {
|
|
127
|
-
console.warn(`No icon provider registered. Unable to resolve icon "${icon}"${iconset ? ` from set "${iconset}"` : ''}. Using default icon.`);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
try {
|
|
131
|
-
const resolved = await Promise.resolve(provider.resolve(icon));
|
|
132
|
-
if (!resolved?.svg) {
|
|
133
|
-
console.warn(`Icon "${icon}"${iconset ? ` from set "${iconset}"` : ''} not found in provider. Using default icon.`);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const validated = await toValidSvgStringWithFallback(resolved.svg);
|
|
137
|
-
if (validated) {
|
|
138
|
-
return validated;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
142
|
-
console.error(`Error resolving icon "${icon}" with provider:`, error);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
return;
|
|
146
|
-
})();
|
|
147
|
-
if (iconSvg)
|
|
148
|
-
return iconSvg;
|
|
149
|
-
console.error(`Icon "${icon}" not found${iconset ? ` in set "${iconset}"` : ''}. Using default icon.`);
|
|
150
|
-
return emptyDefaultSvg();
|
|
151
|
-
}
|
|
152
|
-
function typedIconFromSet(iconset, icon) {
|
|
153
|
-
return {
|
|
154
|
-
iconset,
|
|
155
|
-
icon,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
exports.getRegisteredIconProvider = getRegisteredIconProvider;
|
|
160
|
-
exports.isValidSVG = isValidSVG;
|
|
161
|
-
exports.registerIconProvider = registerIconProvider;
|
|
162
|
-
exports.resolveIconSvg = resolveIconSvg;
|
|
163
|
-
exports.typedIconFromSet = typedIconFromSet;
|