@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.
Files changed (141) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +45 -100
  3. package/assets/icons/checkmark.svg +4 -0
  4. package/cjs/{aria-loader-CfFuAbJn.js → aria-loader-Cec1zR2g.js} +1 -1
  5. package/cjs/ds.constants-DSnxZ3ia.js +16 -0
  6. package/cjs/icons-BQASWgk-.js +80 -0
  7. package/cjs/{index--7IqZZqn.js → index-3g9Z9sfF.js} +765 -2854
  8. package/cjs/index.cjs.js +12 -12
  9. package/cjs/lmvz-button.cjs.entry.js +4 -4
  10. package/cjs/lmvz-card.cjs.entry.js +1 -1
  11. package/cjs/lmvz-checkbox.cjs.entry.js +113 -0
  12. package/cjs/lmvz-chip.cjs.entry.js +68 -4
  13. package/cjs/lmvz-components.cjs.js +1 -1
  14. package/cjs/lmvz-header_2.cjs.entry.js +3 -3
  15. package/cjs/lmvz-icon.cjs.entry.js +10 -8
  16. package/cjs/lmvz-input.cjs.entry.js +4 -4
  17. package/cjs/lmvz-menuitem.cjs.entry.js +4 -4
  18. package/cjs/lmvz-select.cjs.entry.js +3 -3
  19. package/cjs/loader.cjs.js +1 -1
  20. package/cjs/{logger-Bn2yoZGP.js → logger-DsM6xg6V.js} +3063 -833
  21. package/cjs/{reactive-controller-host-CtaVAiYJ.js → reactive-controller-host-BA4ZhjKA.js} +10 -10
  22. package/cjs/svg-BMBduILB.js +125 -0
  23. package/collection/api/ds.constants.js +2 -0
  24. package/collection/assets/icons/checkmark.svg +4 -0
  25. package/collection/collection-manifest.json +1 -0
  26. package/collection/components/lmvz-button/lmvz-button.css +1 -2
  27. package/collection/components/lmvz-button/lmvz-button.js +6 -3
  28. package/collection/components/lmvz-card/lmvz-card.css +1 -2
  29. package/collection/components/lmvz-checkbox/lmvz-checkbox.css +207 -0
  30. package/collection/components/lmvz-checkbox/lmvz-checkbox.js +424 -0
  31. package/collection/components/lmvz-chip/lmvz-chip.css +84 -1
  32. package/collection/components/lmvz-chip/lmvz-chip.js +110 -13
  33. package/collection/components/lmvz-header/lmvz-header.js +2 -2
  34. package/collection/components/lmvz-icon/lmvz-icon.css +11 -10
  35. package/collection/components/lmvz-icon/lmvz-icon.js +8 -7
  36. package/collection/components/lmvz-input/lmvz-input.js +4 -4
  37. package/collection/components/lmvz-menuitem/lmvz-menuitem.css +1 -1
  38. package/collection/components/lmvz-menuitem/lmvz-menuitem.js +11 -5
  39. package/collection/components/lmvz-select/lmvz-select.js +1 -1
  40. package/collection/index.js +1 -1
  41. package/collection/integration/header-integration/header-integration.js +1 -1
  42. package/collection/utils/aria/aria-validation-controller.js +1 -0
  43. package/collection/utils/icons/icons.js +2 -13
  44. package/collection/utils/icons/icons.unit.js +3 -15
  45. package/collection/utils/reactive-controller-host.js +9 -9
  46. package/components/index.d.ts +2 -0
  47. package/components/index.d.ts.bak +2 -0
  48. package/components/index.js +1 -1
  49. package/components/lmvz-button.js +1 -1
  50. package/components/lmvz-card.js +1 -1
  51. package/components/lmvz-checkbox.d.ts +11 -0
  52. package/components/lmvz-checkbox.d.ts.bak +11 -0
  53. package/components/lmvz-checkbox.js +1 -0
  54. package/components/lmvz-chip.js +1 -1
  55. package/components/lmvz-header.js +1 -1
  56. package/components/lmvz-icon.js +1 -1
  57. package/components/lmvz-input.js +1 -1
  58. package/components/lmvz-menuitem.js +1 -1
  59. package/components/lmvz-select.js +1 -1
  60. package/components/p-0s99QfRy.js +12 -0
  61. package/components/{p-CBLAeife.js → p-BuFx0tTm.js} +1 -1
  62. package/components/p-CGmJG63p.js +1 -0
  63. package/components/p-CcxjkCOx.js +1 -0
  64. package/components/{p-DQEkWkMh.js → p-DIrAQ4IB.js} +1 -1
  65. package/esm/{aria-loader-BF_AYtbb.js → aria-loader-BVolm0lC.js} +1 -1
  66. package/esm/ds.constants-Bmi89ll1.js +9 -0
  67. package/esm/icons-CmuFKDRz.js +75 -0
  68. package/esm/{index-7Ru1khgk.js → index-Dh_9sN0q.js} +389 -2478
  69. package/esm/index.js +5 -11
  70. package/esm/lmvz-button.entry.js +4 -4
  71. package/esm/lmvz-card.entry.js +1 -1
  72. package/esm/lmvz-checkbox.entry.js +111 -0
  73. package/esm/lmvz-chip.entry.js +69 -5
  74. package/esm/lmvz-components.js +1 -1
  75. package/esm/lmvz-header_2.entry.js +3 -3
  76. package/esm/lmvz-icon.entry.js +10 -8
  77. package/esm/lmvz-input.entry.js +4 -4
  78. package/esm/lmvz-menuitem.entry.js +4 -4
  79. package/esm/lmvz-select.entry.js +3 -3
  80. package/esm/loader.js +1 -1
  81. package/esm/{logger-fiRXhuXK.js → logger-CGmJG63p.js} +2870 -765
  82. package/esm/{reactive-controller-host-sR2jJxNG.js → reactive-controller-host-DHcPpJW7.js} +10 -10
  83. package/esm/svg-B2YoIRuh.js +121 -0
  84. package/hydrate/index.js +2383 -42
  85. package/hydrate/index.mjs +2383 -42
  86. package/lmvz-components/index.esm.js +1 -1
  87. package/lmvz-components/lmvz-components.esm.js +1 -1
  88. package/lmvz-components/{p-5aa17cd2.entry.js → p-0f7a4236.entry.js} +1 -1
  89. package/lmvz-components/p-0s99QfRy.js +12 -0
  90. package/lmvz-components/{p-30b99f11.entry.js → p-2f83d7a2.entry.js} +1 -1
  91. package/lmvz-components/{p-6dbb3f13.entry.js → p-32171f4f.entry.js} +1 -1
  92. package/lmvz-components/{p-59383f3a.entry.js → p-400b2318.entry.js} +1 -1
  93. package/lmvz-components/p-851969bd.entry.js +1 -0
  94. package/lmvz-components/p-9f9d845d.entry.js +1 -0
  95. package/lmvz-components/p-Bmi89ll1.js +1 -0
  96. package/lmvz-components/p-CFsC37ww.js +1 -0
  97. package/lmvz-components/p-CGmJG63p.js +1 -0
  98. package/lmvz-components/p-CcxjkCOx.js +1 -0
  99. package/lmvz-components/{p-Bkfdgg0T.js → p-GdMr6Qlp.js} +1 -1
  100. package/lmvz-components/p-a12f95da.entry.js +1 -0
  101. package/lmvz-components/{p-84267405.entry.js → p-ab4437dc.entry.js} +1 -1
  102. package/lmvz-components/{p-7a6bec13.entry.js → p-d0a0e206.entry.js} +1 -1
  103. package/lmvz-components/{p-B3dnXEPG.js → p-dhVSUYqd.js} +1 -1
  104. package/manifest.json +544 -28
  105. package/package.json +5 -1
  106. package/types/api/ds.constants.d.ts +6 -1
  107. package/types/components/lmvz-action/lmvz-action.d.ts +0 -1
  108. package/types/components/lmvz-button/lmvz-button.d.ts +0 -1
  109. package/types/components/lmvz-card/lmvz-card.d.ts +0 -1
  110. package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +39 -0
  111. package/types/components/lmvz-chip/lmvz-chip.d.ts +18 -3
  112. package/types/components/lmvz-header/lmvz-header.d.ts +0 -1
  113. package/types/components/lmvz-icon/lmvz-icon.d.ts +0 -1
  114. package/types/components/lmvz-input/lmvz-input.d.ts +0 -1
  115. package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +0 -1
  116. package/types/components/lmvz-select/lmvz-select.d.ts +0 -1
  117. package/types/components.d.ts +221 -12
  118. package/types/index.d.ts +1 -2
  119. package/types/utils/aria/aria-validation-controller.d.ts +1 -2
  120. package/types/utils/aria/element-activation-controller.d.ts +0 -1
  121. package/types/utils/aria/list-keyboard-controller.d.ts +0 -1
  122. package/types/utils/assets.d.ts +0 -1
  123. package/types/utils/component.d.ts +0 -1
  124. package/types/utils/environment.d.ts +0 -1
  125. package/types/utils/http.d.ts +0 -1
  126. package/types/utils/http.unit.d.ts +0 -1
  127. package/types/utils/icons/icons-registry.d.ts +0 -1
  128. package/types/utils/icons/icons.d.ts +0 -2
  129. package/types/utils/icons/icons.unit.d.ts +0 -1
  130. package/types/utils/icons/public.d.ts +0 -1
  131. package/types/utils/public.d.ts +0 -1
  132. package/types/utils/reactive-controller-host.d.ts +0 -1
  133. package/cjs/icons-swqMn6s2.js +0 -163
  134. package/components/p-DXOTa5VF.js +0 -12
  135. package/components/p-fiRXhuXK.js +0 -1
  136. package/esm/icons-Ca8oMiRa.js +0 -157
  137. package/lmvz-components/p-0a41cc24.entry.js +0 -1
  138. package/lmvz-components/p-5f150890.entry.js +0 -1
  139. package/lmvz-components/p-Bh2Epkwf.js +0 -1
  140. package/lmvz-components/p-DXOTa5VF.js +0 -12
  141. package/lmvz-components/p-fiRXhuXK.js +0 -1
@@ -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-BF_AYtbb.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 {
@@ -156,34 +156,34 @@ class ReactiveControllerHost {
156
156
  this.controllers.delete(controller);
157
157
  }
158
158
  get activeControllers() {
159
- return Array.from(this.controllers).filter(controller => !controller.disabled);
159
+ return Array.from(this.controllers).filter((controller) => !controller.disabled);
160
160
  }
161
161
  connectedCallback() {
162
162
  if (!this.controllers.size) {
163
163
  console.warn('ReactiveControllerHost connected with no controllers registered.', this);
164
164
  }
165
- this.activeControllers.forEach(controller => controller.hostConnected?.());
165
+ this.activeControllers.forEach((controller) => controller.hostConnected?.());
166
166
  }
167
167
  disconnectedCallback() {
168
- this.activeControllers.forEach(controller => controller.hostDisconnected?.());
168
+ this.activeControllers.forEach((controller) => controller.hostDisconnected?.());
169
169
  }
170
170
  componentWillLoad() {
171
- this.activeControllers.forEach(controller => controller.hostWillLoad?.());
171
+ this.activeControllers.forEach((controller) => controller.hostWillLoad?.());
172
172
  }
173
173
  componentDidLoad() {
174
- this.activeControllers.forEach(controller => controller.hostDidLoad?.());
174
+ this.activeControllers.forEach((controller) => controller.hostDidLoad?.());
175
175
  }
176
176
  componentWillRender() {
177
- this.activeControllers.forEach(controller => controller.hostWillRender?.());
177
+ this.activeControllers.forEach((controller) => controller.hostWillRender?.());
178
178
  }
179
179
  componentDidRender() {
180
- this.activeControllers.forEach(controller => controller.hostDidRender?.());
180
+ this.activeControllers.forEach((controller) => controller.hostDidRender?.());
181
181
  }
182
182
  componentWillUpdate() {
183
- this.activeControllers.forEach(controller => controller.hostWillUpdate?.());
183
+ this.activeControllers.forEach((controller) => controller.hostWillUpdate?.());
184
184
  }
185
185
  componentDidUpdate() {
186
- this.activeControllers.forEach(controller => controller.hostDidUpdate?.());
186
+ this.activeControllers.forEach((controller) => controller.hostDidUpdate?.());
187
187
  }
188
188
  }
189
189
 
@@ -0,0 +1,121 @@
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';
2
+
3
+ /**
4
+ * This module provides types and utility functions to create and work with branded types,
5
+ * which are TypeScript types with an added type tag to prevent accidental usage of a value in the wrong context.
6
+ *
7
+ * The `refined` and `nominal` functions are both used to create branded types in TypeScript.
8
+ * The main difference between them is that `refined` allows for validation of the data, while `nominal` does not.
9
+ *
10
+ * 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.
11
+ * This is useful when you want to distinguish between two values of the same type that have different meanings.
12
+ * The `nominal` function does not perform any validation of the input data.
13
+ *
14
+ * On the other hand, the `refined` function is used to create a new branded type that has the same underlying type as the input,
15
+ * but with a different name, and it also allows for validation of the input data.
16
+ * The `refined` function takes a predicate that is used to validate the input data.
17
+ * If the input data fails the validation, a `BrandErrors` is returned, which provides information about the specific validation failure.
18
+ *
19
+ * @since 2.0.0
20
+ */
21
+ /**
22
+ * @since 2.0.0
23
+ * @category symbols
24
+ */
25
+ const RefinedConstructorsTypeId = /*#__PURE__*/Symbol.for("effect/Brand/Refined");
26
+ /**
27
+ * Returns a `BrandErrors` that contains a single `RefinementError`.
28
+ *
29
+ * @since 2.0.0
30
+ * @category constructors
31
+ */
32
+ const error = (message, meta) => [{
33
+ message,
34
+ meta
35
+ }];
36
+ function refined(...args) {
37
+ const either = args.length === 2 ? unbranded => args[0](unbranded) ? right(unbranded) : left(args[1](unbranded)) : unbranded => {
38
+ return match(args[0](unbranded), {
39
+ onNone: () => right(unbranded),
40
+ onSome: left
41
+ });
42
+ };
43
+ return Object.assign(unbranded => getOrThrowWith(either(unbranded), identity), {
44
+ [RefinedConstructorsTypeId]: RefinedConstructorsTypeId,
45
+ option: args => getRight(either(args)),
46
+ either,
47
+ is: args => isRight(either(args))
48
+ });
49
+ }
50
+
51
+ const SVGString = refined(isValidSVG, () => error('SVG data is malformed'));
52
+ class BrandValidationError extends TaggedError('BrandValidationError') {
53
+ constructor(error, type) {
54
+ super(new Error(`Brand validation failed for type ${type}.`, { cause: error }));
55
+ }
56
+ }
57
+ /**
58
+ * Creates a synchronous Micro effect that validates a string against the branded `SVGString` type.
59
+ *
60
+ * @param svg Raw SVG markup to validate.
61
+ */
62
+ const validateSvg = (svg) => try_({
63
+ try: () => SVGString(sanitizeSvg(svg)),
64
+ catch: (error) => new BrandValidationError(error, 'SVGString'),
65
+ });
66
+ /**
67
+ * Checks whether a string can be parsed into an SVG document.
68
+ *
69
+ * @param svg Raw SVG markup to validate.
70
+ */
71
+ function isValidSVG(svg) {
72
+ if (typeof svg !== 'string')
73
+ return false;
74
+ try {
75
+ const parser = new DOMParser();
76
+ const doc = parser.parseFromString(svg, 'image/svg+xml');
77
+ return doc.documentElement.nodeName === 'svg';
78
+ }
79
+ catch {
80
+ return false;
81
+ }
82
+ }
83
+ function sanitizeSvg(svg) {
84
+ const dataUriPrefix = 'data:image/svg+xml,';
85
+ const dataUriPrefixWithEncoding = 'data:image/svg+xml;base64,';
86
+ const base = svg.trim();
87
+ if (base.startsWith(dataUriPrefixWithEncoding)) {
88
+ return atob(base.slice(dataUriPrefixWithEncoding.length));
89
+ }
90
+ return !base.startsWith(dataUriPrefix) ? base : decodeURIComponent(base.slice(dataUriPrefix.length));
91
+ }
92
+ /**
93
+ * Returns a valid, empty SVG.
94
+ */
95
+ const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
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) {
102
+ try {
103
+ return runSync(validateSvg(value));
104
+ }
105
+ catch {
106
+ console.warn('Invalid SVG string:', value);
107
+ return emptyDefaultSvg();
108
+ }
109
+ }
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
+ }
119
+ }
120
+
121
+ export { emptyDefaultSvg as e, parseSvgString as p, toValidSvgStringWithFallback as t };