@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.
Files changed (103) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/assets/icons/checkmark.svg +4 -0
  3. package/cjs/{aria-loader-CfFuAbJn.js → aria-loader-Cec1zR2g.js} +1 -1
  4. package/cjs/icons-BQASWgk-.js +80 -0
  5. package/cjs/{index--7IqZZqn.js → index-3g9Z9sfF.js} +765 -2854
  6. package/cjs/index.cjs.js +4 -3
  7. package/cjs/lmvz-button.cjs.entry.js +3 -3
  8. package/cjs/lmvz-card.cjs.entry.js +1 -1
  9. package/cjs/lmvz-checkbox.cjs.entry.js +113 -0
  10. package/cjs/lmvz-chip.cjs.entry.js +3 -3
  11. package/cjs/lmvz-components.cjs.js +1 -1
  12. package/cjs/lmvz-header_2.cjs.entry.js +3 -3
  13. package/cjs/lmvz-icon.cjs.entry.js +9 -7
  14. package/cjs/lmvz-input.cjs.entry.js +4 -4
  15. package/cjs/lmvz-menuitem.cjs.entry.js +4 -4
  16. package/cjs/lmvz-select.cjs.entry.js +3 -3
  17. package/cjs/loader.cjs.js +1 -1
  18. package/cjs/{logger-Bn2yoZGP.js → logger-DsM6xg6V.js} +3063 -833
  19. package/cjs/{reactive-controller-host-Bi9eu2bV.js → reactive-controller-host-BA4ZhjKA.js} +1 -1
  20. package/cjs/{icons-Tg7ySOh-.js → svg-BMBduILB.js} +31 -85
  21. package/collection/assets/icons/checkmark.svg +4 -0
  22. package/collection/collection-manifest.json +1 -0
  23. package/collection/components/lmvz-button/lmvz-button.css +1 -2
  24. package/collection/components/lmvz-card/lmvz-card.css +1 -2
  25. package/collection/components/lmvz-checkbox/lmvz-checkbox.css +207 -0
  26. package/collection/components/lmvz-checkbox/lmvz-checkbox.js +424 -0
  27. package/collection/components/lmvz-chip/lmvz-chip.js +1 -1
  28. package/collection/components/lmvz-header/lmvz-header.js +1 -1
  29. package/collection/components/lmvz-icon/lmvz-icon.js +5 -5
  30. package/collection/components/lmvz-input/lmvz-input.js +2 -2
  31. package/collection/components/lmvz-menuitem/lmvz-menuitem.css +1 -1
  32. package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
  33. package/collection/components/lmvz-select/lmvz-select.js +1 -1
  34. package/collection/integration/header-integration/header-integration.js +1 -1
  35. package/collection/utils/icons/icons.js +2 -13
  36. package/collection/utils/icons/icons.unit.js +3 -15
  37. package/components/index.d.ts +2 -0
  38. package/components/index.d.ts.bak +2 -0
  39. package/components/index.js +1 -1
  40. package/components/lmvz-button.js +1 -1
  41. package/components/lmvz-card.js +1 -1
  42. package/components/lmvz-checkbox.d.ts +11 -0
  43. package/components/lmvz-checkbox.d.ts.bak +11 -0
  44. package/components/lmvz-checkbox.js +1 -0
  45. package/components/lmvz-chip.js +1 -1
  46. package/components/lmvz-header.js +1 -1
  47. package/components/lmvz-icon.js +1 -1
  48. package/components/lmvz-input.js +1 -1
  49. package/components/lmvz-menuitem.js +1 -1
  50. package/components/lmvz-select.js +1 -1
  51. package/components/p-0s99QfRy.js +12 -0
  52. package/components/{p-DbeHBSOe.js → p-BuFx0tTm.js} +1 -1
  53. package/components/p-CGmJG63p.js +1 -0
  54. package/components/p-CcxjkCOx.js +1 -0
  55. package/esm/{aria-loader-CES8Ae1e.js → aria-loader-BVolm0lC.js} +1 -1
  56. package/esm/icons-CmuFKDRz.js +75 -0
  57. package/esm/{index-BvxaUA12.js → index-Dh_9sN0q.js} +389 -2478
  58. package/esm/index.js +4 -3
  59. package/esm/lmvz-button.entry.js +3 -3
  60. package/esm/lmvz-card.entry.js +1 -1
  61. package/esm/lmvz-checkbox.entry.js +111 -0
  62. package/esm/lmvz-chip.entry.js +3 -3
  63. package/esm/lmvz-components.js +1 -1
  64. package/esm/lmvz-header_2.entry.js +3 -3
  65. package/esm/lmvz-icon.entry.js +9 -7
  66. package/esm/lmvz-input.entry.js +4 -4
  67. package/esm/lmvz-menuitem.entry.js +4 -4
  68. package/esm/lmvz-select.entry.js +3 -3
  69. package/esm/loader.js +1 -1
  70. package/esm/{logger-0bL3pydp.js → logger-CGmJG63p.js} +2870 -765
  71. package/esm/{reactive-controller-host-J2thAxVH.js → reactive-controller-host-DHcPpJW7.js} +1 -1
  72. package/esm/{icons-Bj4dF1-I.js → svg-B2YoIRuh.js} +29 -80
  73. package/hydrate/index.js +2441 -165
  74. package/hydrate/index.mjs +2441 -165
  75. package/lmvz-components/index.esm.js +1 -1
  76. package/lmvz-components/lmvz-components.esm.js +1 -1
  77. package/lmvz-components/{p-ec96c6b6.entry.js → p-0f7a4236.entry.js} +1 -1
  78. package/lmvz-components/p-0s99QfRy.js +12 -0
  79. package/lmvz-components/p-2f83d7a2.entry.js +1 -0
  80. package/lmvz-components/{p-6e8acbd9.entry.js → p-32171f4f.entry.js} +1 -1
  81. package/lmvz-components/{p-9212bd23.entry.js → p-400b2318.entry.js} +1 -1
  82. package/lmvz-components/{p-9626e951.entry.js → p-851969bd.entry.js} +1 -1
  83. package/lmvz-components/p-9f9d845d.entry.js +1 -0
  84. package/lmvz-components/p-CFsC37ww.js +1 -0
  85. package/lmvz-components/p-CGmJG63p.js +1 -0
  86. package/lmvz-components/p-CcxjkCOx.js +1 -0
  87. package/lmvz-components/{p-BxHnZA0M.js → p-GdMr6Qlp.js} +1 -1
  88. package/lmvz-components/p-a12f95da.entry.js +1 -0
  89. package/lmvz-components/{p-e1b847d2.entry.js → p-ab4437dc.entry.js} +1 -1
  90. package/lmvz-components/{p-7a6bec13.entry.js → p-d0a0e206.entry.js} +1 -1
  91. package/lmvz-components/{p-DYaffOLo.js → p-dhVSUYqd.js} +1 -1
  92. package/manifest.json +410 -1
  93. package/package.json +5 -1
  94. package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +39 -0
  95. package/types/components.d.ts +151 -0
  96. package/types/utils/icons/icons.d.ts +0 -1
  97. package/components/p-DXOTa5VF.js +0 -12
  98. package/components/p-fiRXhuXK.js +0 -1
  99. package/lmvz-components/p-0bL3pydp.js +0 -1
  100. package/lmvz-components/p-40569208.entry.js +0 -1
  101. package/lmvz-components/p-49ab22bd.entry.js +0 -1
  102. package/lmvz-components/p-Bu4Z_PMf.js +0 -1
  103. 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-CES8Ae1e.js';
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, a as right, l as left, i as identity, b as isRight, c as getRight, m as match, t as try_, T as TaggedError, r as runPromise } from './logger-0bL3pydp.js';
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
- * Validates an SVG string against the branded `SVGString` type and returns the result effect.
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 createValidSVGString = (svg) => try_({
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(sanitizedSvg, 'image/svg+xml');
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
- async function toValidSvgStringWithFallback(value) {
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 await runPromise(createValidSVGString(value));
103
+ return runSync(validateSvg(value));
129
104
  }
130
105
  catch {
131
- console.error('Invalid SVG string:', value);
106
+ console.warn('Invalid SVG string:', value);
132
107
  return emptyDefaultSvg();
133
108
  }
134
109
  }
135
- async function resolveIconSvg(options) {
136
- const { icon, iconset } = options;
137
- const iconSvg = await (async () => {
138
- const provider = getRegisteredIconProvider(iconset);
139
- if (!provider) {
140
- console.warn(`No icon provider registered. Unable to resolve icon "${icon}"${iconset ? ` from set "${iconset}"` : ''}. Using default icon.`);
141
- return;
142
- }
143
- try {
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 { resolveIconSvg as a, createValidSVGString as c, getRegisteredIconProvider as g, isValidSVG as i, registerIconProvider as r, typedIconFromSet as t };
121
+ export { emptyDefaultSvg as e, parseSvgString as p, toValidSvgStringWithFallback as t };