@algorisys/zen-ui-solid 13.8.0 → 13.8.1

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 (198) hide show
  1. package/dist/components/form/checkbox/checkbox.d.ts.map +1 -1
  2. package/dist/components/form/radio/radio-group.d.ts.map +1 -1
  3. package/dist/components/form/slider/slider.d.ts.map +1 -1
  4. package/dist/components/form/switch/switch.d.ts.map +1 -1
  5. package/dist/index208.js +13 -13
  6. package/dist/index209.js +2 -2
  7. package/dist/index210.js +5 -5
  8. package/dist/index211.js +12 -12
  9. package/dist/index212.js +13 -13
  10. package/dist/index213.js +10 -10
  11. package/dist/index214.js +10 -10
  12. package/dist/index215.js +9 -9
  13. package/dist/index216.js +9 -9
  14. package/dist/index218.js +14 -14
  15. package/dist/index219.js +14 -14
  16. package/dist/index220.js +13 -13
  17. package/dist/index221.js +1 -1
  18. package/dist/index222.js +5 -5
  19. package/dist/index223.js +9 -9
  20. package/dist/index224.js +24 -24
  21. package/dist/index225.js +5 -5
  22. package/dist/index226.js +3 -3
  23. package/dist/index249.js +10 -10
  24. package/dist/index250.js +3 -3
  25. package/dist/index252.js +2 -2
  26. package/dist/index257.js +1 -1
  27. package/dist/index258.js +1 -1
  28. package/dist/index271.js +5 -5
  29. package/dist/index271.js.map +1 -1
  30. package/dist/index272.js +5 -3
  31. package/dist/index272.js.map +1 -1
  32. package/dist/index273.js +3 -17
  33. package/dist/index273.js.map +1 -1
  34. package/dist/index274.js +17 -16
  35. package/dist/index274.js.map +1 -1
  36. package/dist/index275.js +16 -3
  37. package/dist/index275.js.map +1 -1
  38. package/dist/index276.js +3 -3
  39. package/dist/index276.js.map +1 -1
  40. package/dist/index277.js +3 -26
  41. package/dist/index277.js.map +1 -1
  42. package/dist/index278.js +26 -11
  43. package/dist/index278.js.map +1 -1
  44. package/dist/index279.js +10 -7
  45. package/dist/index279.js.map +1 -1
  46. package/dist/index280.js +8 -49
  47. package/dist/index280.js.map +1 -1
  48. package/dist/index281.js +49 -13
  49. package/dist/index281.js.map +1 -1
  50. package/dist/index282.js +12 -6
  51. package/dist/index282.js.map +1 -1
  52. package/dist/index283.js +7 -4
  53. package/dist/index283.js.map +1 -1
  54. package/dist/index284.js +4 -5
  55. package/dist/index284.js.map +1 -1
  56. package/dist/index286.js +6 -260
  57. package/dist/index286.js.map +1 -1
  58. package/dist/index287.js +105 -64
  59. package/dist/index287.js.map +1 -1
  60. package/dist/index288.js +67 -19
  61. package/dist/index288.js.map +1 -1
  62. package/dist/index289.js +72 -3
  63. package/dist/index289.js.map +1 -1
  64. package/dist/index290.js +22 -15
  65. package/dist/index290.js.map +1 -1
  66. package/dist/index291.js +58 -7
  67. package/dist/index291.js.map +1 -1
  68. package/dist/index292.js +3 -384
  69. package/dist/index292.js.map +1 -1
  70. package/dist/index293.js +16 -35
  71. package/dist/index293.js.map +1 -1
  72. package/dist/index294.js +384 -6
  73. package/dist/index294.js.map +1 -1
  74. package/dist/index295.js +92 -19
  75. package/dist/index295.js.map +1 -1
  76. package/dist/index296.js +34 -391
  77. package/dist/index296.js.map +1 -1
  78. package/dist/index297.js +6 -118
  79. package/dist/index297.js.map +1 -1
  80. package/dist/index298.js +17 -48
  81. package/dist/index298.js.map +1 -1
  82. package/dist/index299.js +62 -16
  83. package/dist/index299.js.map +1 -1
  84. package/dist/index300.js +48 -58
  85. package/dist/index300.js.map +1 -1
  86. package/dist/index301.js +31 -62
  87. package/dist/index301.js.map +1 -1
  88. package/dist/index302.js +16 -20
  89. package/dist/index302.js.map +1 -1
  90. package/dist/index303.js +58 -56
  91. package/dist/index303.js.map +1 -1
  92. package/dist/index304.js +20 -10
  93. package/dist/index304.js.map +1 -1
  94. package/dist/index305.js +10 -117
  95. package/dist/index305.js.map +1 -1
  96. package/dist/index306.js +920 -20
  97. package/dist/index306.js.map +1 -1
  98. package/dist/index307.js +37 -19
  99. package/dist/index307.js.map +1 -1
  100. package/dist/index308.js +256 -18
  101. package/dist/index308.js.map +1 -1
  102. package/dist/index309.js +114 -71
  103. package/dist/index309.js.map +1 -1
  104. package/dist/index310.js +556 -891
  105. package/dist/index310.js.map +1 -1
  106. package/dist/index311.js +121 -36
  107. package/dist/index311.js.map +1 -1
  108. package/dist/index312.js +17 -114
  109. package/dist/index312.js.map +1 -1
  110. package/dist/index313.js +363 -560
  111. package/dist/index313.js.map +1 -1
  112. package/dist/index314.js +85 -118
  113. package/dist/index314.js.map +1 -1
  114. package/dist/index315.js +16 -112
  115. package/dist/index315.js.map +1 -1
  116. package/dist/index316.js +115 -67
  117. package/dist/index316.js.map +1 -1
  118. package/dist/index317.js +21 -16
  119. package/dist/index317.js.map +1 -1
  120. package/dist/index318.js +19 -91
  121. package/dist/index318.js.map +1 -1
  122. package/dist/index319.js +20 -87
  123. package/dist/index319.js.map +1 -1
  124. package/dist/index320.js +71 -16
  125. package/dist/index320.js.map +1 -1
  126. package/dist/index321.js +118 -32
  127. package/dist/index321.js.map +1 -1
  128. package/dist/index323.js +1 -1
  129. package/dist/index324.js +93 -63
  130. package/dist/index324.js.map +1 -1
  131. package/dist/index325.js +5 -116
  132. package/dist/index325.js.map +1 -1
  133. package/dist/index326.js +38 -7
  134. package/dist/index326.js.map +1 -1
  135. package/dist/index327.js +44 -7
  136. package/dist/index327.js.map +1 -1
  137. package/dist/index328.js +2 -13
  138. package/dist/index328.js.map +1 -1
  139. package/dist/index329.js +65 -7
  140. package/dist/index329.js.map +1 -1
  141. package/dist/index330.js +115 -3
  142. package/dist/index330.js.map +1 -1
  143. package/dist/index331.js +608 -3
  144. package/dist/index331.js.map +1 -1
  145. package/dist/index332.js +295 -4
  146. package/dist/index332.js.map +1 -1
  147. package/dist/index333.js +88 -5
  148. package/dist/index333.js.map +1 -1
  149. package/dist/index334.js +11 -95
  150. package/dist/index334.js.map +1 -1
  151. package/dist/index335.js +20 -5
  152. package/dist/index335.js.map +1 -1
  153. package/dist/index336.js +62 -38
  154. package/dist/index336.js.map +1 -1
  155. package/dist/index337.js +33 -43
  156. package/dist/index337.js.map +1 -1
  157. package/dist/index338.js +7 -2
  158. package/dist/index338.js.map +1 -1
  159. package/dist/index339.js +6 -608
  160. package/dist/index339.js.map +1 -1
  161. package/dist/index340.js +11 -294
  162. package/dist/index340.js.map +1 -1
  163. package/dist/index341.js +6 -88
  164. package/dist/index341.js.map +1 -1
  165. package/dist/index342.js +3 -10
  166. package/dist/index342.js.map +1 -1
  167. package/dist/index343.js +3 -19
  168. package/dist/index343.js.map +1 -1
  169. package/dist/index344.js +4 -61
  170. package/dist/index344.js.map +1 -1
  171. package/dist/index345.js +5 -33
  172. package/dist/index345.js.map +1 -1
  173. package/dist/index346.js +3 -466
  174. package/dist/index346.js.map +1 -1
  175. package/dist/index347.js +9 -125
  176. package/dist/index347.js.map +1 -1
  177. package/dist/index348.js +33 -134
  178. package/dist/index348.js.map +1 -1
  179. package/dist/index349.js +21 -3
  180. package/dist/index349.js.map +1 -1
  181. package/dist/index350.js +5 -5
  182. package/dist/index351.js +2 -2
  183. package/dist/index357.js +464 -8
  184. package/dist/index357.js.map +1 -1
  185. package/dist/index358.js +126 -33
  186. package/dist/index358.js.map +1 -1
  187. package/dist/index359.js +133 -20
  188. package/dist/index359.js.map +1 -1
  189. package/dist/index53.js +21 -15
  190. package/dist/index53.js.map +1 -1
  191. package/dist/index54.js +15 -9
  192. package/dist/index54.js.map +1 -1
  193. package/dist/index55.js +20 -14
  194. package/dist/index55.js.map +1 -1
  195. package/dist/index62.js +42 -22
  196. package/dist/index62.js.map +1 -1
  197. package/dist/server/index.js +50 -12
  198. package/package.json +1 -1
package/dist/index319.js CHANGED
@@ -1,93 +1,26 @@
1
- import { isString as r, isNumber as S } from "./index292.js";
2
- import { createMemo as x } from "solid-js";
3
- import { access as c } from "./index298.js";
4
- function s(t) {
5
- let l = t.startIndex ?? 0;
6
- const o = t.startLevel ?? 0, i = [], f = (e) => {
7
- if (e == null)
8
- return "";
9
- const n = t.getKey ?? "key", u = r(n) ? e[n] : n(e);
10
- return u != null ? String(u) : "";
11
- }, h = (e) => {
12
- if (e == null)
13
- return "";
14
- const n = t.getTextValue ?? "textValue", u = r(n) ? e[n] : n(e);
15
- return u != null ? String(u) : "";
16
- }, g = (e) => {
17
- if (e == null)
18
- return !1;
19
- const n = t.getDisabled ?? "disabled";
20
- return (r(n) ? e[n] : n(e)) ?? !1;
21
- }, d = (e) => {
22
- if (e != null)
23
- return r(t.getSectionChildren) ? e[t.getSectionChildren] : t.getSectionChildren?.(e);
24
- };
25
- for (const e of t.dataSource) {
26
- if (r(e) || S(e)) {
27
- i.push({
28
- type: "item",
29
- rawValue: e,
30
- key: String(e),
31
- textValue: String(e),
32
- disabled: g(e),
33
- level: o,
34
- index: l
35
- }), l++;
36
- continue;
1
+ import { createComponent as t, mergeProps as m } from "solid-js/web";
2
+ import { useFormControlContext as a } from "./index320.js";
3
+ import { Polymorphic as c } from "./index293.js";
4
+ import { mergeDefaultProps as p } from "./index294.js";
5
+ import { splitProps as f, createEffect as l, onCleanup as d, Show as g } from "solid-js";
6
+ function M(n) {
7
+ const r = a(), s = p({
8
+ id: r.generateId("error-message")
9
+ }, n), [i, o] = f(s, ["forceMount"]), e = () => r.validationState() === "invalid";
10
+ return l(() => {
11
+ e() && d(r.registerErrorMessage(o.id));
12
+ }), t(g, {
13
+ get when() {
14
+ return i.forceMount || e();
15
+ },
16
+ get children() {
17
+ return t(c, m({
18
+ as: "div"
19
+ }, () => r.dataset(), o));
37
20
  }
38
- if (d(e) != null) {
39
- i.push({
40
- type: "section",
41
- rawValue: e,
42
- key: "",
43
- // not applicable here
44
- textValue: "",
45
- // not applicable here
46
- disabled: !1,
47
- // not applicable here
48
- level: o,
49
- index: l
50
- }), l++;
51
- const n = d(e) ?? [];
52
- if (n.length > 0) {
53
- const u = s({
54
- dataSource: n,
55
- getKey: t.getKey,
56
- getTextValue: t.getTextValue,
57
- getDisabled: t.getDisabled,
58
- getSectionChildren: t.getSectionChildren,
59
- startIndex: l,
60
- startLevel: o + 1
61
- });
62
- i.push(...u), l += u.length;
63
- }
64
- } else
65
- i.push({
66
- type: "item",
67
- rawValue: e,
68
- key: f(e),
69
- textValue: h(e),
70
- disabled: g(e),
71
- level: o,
72
- index: l
73
- }), l++;
74
- }
75
- return i;
76
- }
77
- function b(t, l = []) {
78
- return x(() => {
79
- const o = s({
80
- dataSource: c(t.dataSource),
81
- getKey: c(t.getKey),
82
- getTextValue: c(t.getTextValue),
83
- getDisabled: c(t.getDisabled),
84
- getSectionChildren: c(t.getSectionChildren)
85
- });
86
- for (let i = 0; i < l.length; i++) l[i]();
87
- return t.factory(o);
88
21
  });
89
22
  }
90
23
  export {
91
- b as createCollection
24
+ M as FormControlErrorMessage
92
25
  };
93
26
  //# sourceMappingURL=index319.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index319.js","sources":["../../../node_modules/.bun/@kobalte+core@0.13.12+ee58d66d663bac7b/node_modules/@kobalte/core/dist/chunk/FKUFPCQ6.jsx"],"sourcesContent":["// src/primitives/create-collection/create-collection.ts\nimport { access } from \"@kobalte/utils\";\nimport { createMemo } from \"solid-js\";\n\n// src/primitives/create-collection/utils.ts\nimport { isNumber, isString } from \"@kobalte/utils\";\nfunction buildNodes(params) {\n let index = params.startIndex ?? 0;\n const level = params.startLevel ?? 0;\n const nodes = [];\n const getKey = (data) => {\n if (data == null) {\n return \"\";\n }\n const _getKey = params.getKey ?? \"key\";\n const dataKey = isString(_getKey) ? data[_getKey] : _getKey(data);\n return dataKey != null ? String(dataKey) : \"\";\n };\n const getTextValue = (data) => {\n if (data == null) {\n return \"\";\n }\n const _getTextValue = params.getTextValue ?? \"textValue\";\n const dataTextValue = isString(_getTextValue) ? data[_getTextValue] : _getTextValue(data);\n return dataTextValue != null ? String(dataTextValue) : \"\";\n };\n const getDisabled = (data) => {\n if (data == null) {\n return false;\n }\n const _getDisabled = params.getDisabled ?? \"disabled\";\n return (isString(_getDisabled) ? data[_getDisabled] : _getDisabled(data)) ?? false;\n };\n const getSectionChildren = (data) => {\n if (data == null) {\n return void 0;\n }\n if (isString(params.getSectionChildren)) {\n return data[params.getSectionChildren];\n }\n return params.getSectionChildren?.(data);\n };\n for (const data of params.dataSource) {\n if (isString(data) || isNumber(data)) {\n nodes.push({\n type: \"item\",\n rawValue: data,\n key: String(data),\n textValue: String(data),\n disabled: getDisabled(data),\n level,\n index\n });\n index++;\n continue;\n }\n if (getSectionChildren(data) != null) {\n nodes.push({\n type: \"section\",\n rawValue: data,\n key: \"\",\n // not applicable here\n textValue: \"\",\n // not applicable here\n disabled: false,\n // not applicable here\n level,\n index\n });\n index++;\n const sectionChildren = getSectionChildren(data) ?? [];\n if (sectionChildren.length > 0) {\n const childNodes = buildNodes({\n dataSource: sectionChildren,\n getKey: params.getKey,\n getTextValue: params.getTextValue,\n getDisabled: params.getDisabled,\n getSectionChildren: params.getSectionChildren,\n startIndex: index,\n startLevel: level + 1\n });\n nodes.push(...childNodes);\n index += childNodes.length;\n }\n } else {\n nodes.push({\n type: \"item\",\n rawValue: data,\n key: getKey(data),\n textValue: getTextValue(data),\n disabled: getDisabled(data),\n level,\n index\n });\n index++;\n }\n }\n return nodes;\n}\n\n// src/primitives/create-collection/create-collection.ts\nfunction createCollection(props, deps = []) {\n return createMemo(() => {\n const nodes = buildNodes({\n dataSource: access(props.dataSource),\n getKey: access(props.getKey),\n getTextValue: access(props.getTextValue),\n getDisabled: access(props.getDisabled),\n getSectionChildren: access(props.getSectionChildren)\n });\n for (let i = 0; i < deps.length; i++)\n deps[i]();\n return props.factory(nodes);\n });\n}\n\nexport {\n createCollection\n};\n"],"names":["buildNodes","params","index","startIndex","level","startLevel","nodes","getKey","data","_getKey","dataKey","isString","String","getTextValue","_getTextValue","dataTextValue","getDisabled","_getDisabled","getSectionChildren","dataSource","isNumber","push","type","rawValue","key","textValue","disabled","sectionChildren","length","childNodes","createCollection","props","deps","createMemo","access","i","factory"],"mappings":";;;AAMA,SAASA,EAAWC,GAAQ;AAC1B,MAAIC,IAAQD,EAAOE,c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iB,IAAI,GAAGA,IAAIH,EAAKJ,QAAQO,IAC/BH,CAAAA,EAAKG,CAAC,EAAA;AACR,WAAOJ,EAAMK,QAAQ9B,CAAK;AAAA,EAC5B,CAAC;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index319.js","sources":["../../../node_modules/.bun/@kobalte+core@0.13.12+ee58d66d663bac7b/node_modules/@kobalte/core/dist/chunk/ZZYKR3VO.jsx"],"sourcesContent":["import {\n useFormControlContext\n} from \"./XUUROM4M.jsx\";\nimport {\n Polymorphic\n} from \"./FLVHQV4A.jsx\";\n\n// src/form-control/form-control-error-message.tsx\nimport { mergeDefaultProps } from \"@kobalte/utils\";\nimport {\n Show,\n createEffect,\n onCleanup,\n splitProps\n} from \"solid-js\";\nfunction FormControlErrorMessage(props) {\n const context = useFormControlContext();\n const mergedProps = mergeDefaultProps(\n {\n id: context.generateId(\"error-message\")\n },\n props\n );\n const [local, others] = splitProps(mergedProps, [\"forceMount\"]);\n const isInvalid = () => context.validationState() === \"invalid\";\n createEffect(() => {\n if (!isInvalid()) {\n return;\n }\n onCleanup(context.registerErrorMessage(others.id));\n });\n return <Show when={local.forceMount || isInvalid()}><Polymorphic\n as=\"div\"\n {...context.dataset()}\n {...others}\n /></Show>;\n}\n\nexport {\n FormControlErrorMessage\n};\n"],"names":["FormControlErrorMessage","props","context","useFormControlContext","mergedProps","mergeDefaultProps","id","generateId","local","others","splitProps","isInvalid","validationState","createEffect","onCleanup","registerErrorMessage","_$createComponent","Show","when","forceMount","children","Polymorphic","_$mergeProps","as","dataset"],"mappings":";;;;;AAeA,SAASA,EAAwBC,GAAO;AACtC,QAAMC,IAAUC,EAAAA,GACVC,IAAcC,EAClB;AAAA,IACEC,IAAIJ,EAAQK,WAAW,eAAe;AAAA,EAAA,GAExCN,CACF,GACM,CAACO,GAAOC,CAAM,IAAIC,EAAWN,GAAa,CAAC,YAAY,CAAC,GACxDO,IAAYA,MAAMT,EAAQU,gBAAAA,MAAsB;AACtDC,SAAAA,EAAa,MAAM;AACjB,IAAKF,OAGLG,EAAUZ,EAAQa,qBAAqBN,EAAOH,EAAE,CAAC;AAAA,EACnD,CAAC,GACDU,EAAQC,GAAI;AAAA,IAAA,IAACC,OAAI;AAAA,aAAEV,EAAMW,cAAcR,EAAAA;AAAAA,IAAW;AAAA,IAAA,IAAAS,WAAA;AAAA,aAAAJ,EAAGK,GAAWC,EAAA;AAAA,QAC9DC,IAAE;AAAA,MAAA,GAAA,MACErB,EAAQsB,QAAAA,GACRf,CAAM,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAEd;","x_google_ignoreList":[0]}
package/dist/index320.js CHANGED
@@ -1,21 +1,76 @@
1
- import { asArray as c, access as o, tryOnCleanup as a } from "./index298.js";
2
- import { createEffect as m, createRenderEffect as E } from "solid-js";
3
- import { isServer as u } from "solid-js/web";
4
- function v(e, r, n, t) {
5
- return e.addEventListener(r, n, t), a(e.removeEventListener.bind(e, r, n, t));
6
- }
7
- function h(e, r, n, t) {
8
- if (u)
9
- return;
10
- const f = () => {
11
- c(o(e)).forEach((i) => {
12
- i && c(o(r)).forEach((s) => v(i, s, n, t));
13
- });
1
+ import { createComponent as y, mergeProps as O } from "solid-js/web";
2
+ import { createRegisterId as i } from "./index292.js";
3
+ import { Polymorphic as P } from "./index293.js";
4
+ import { mergeDefaultProps as m, createGenerateId as D } from "./index294.js";
5
+ import { createEffect as S, onCleanup as q, createUniqueId as M, createSignal as n, createMemo as R, createContext as E, useContext as h } from "solid-js";
6
+ import { access as t } from "./index300.js";
7
+ var T = ["id", "name", "validationState", "required", "disabled", "readOnly"];
8
+ function U(r) {
9
+ const o = `form-control-${M()}`, e = m({
10
+ id: o
11
+ }, r), [a, u] = n(), [v, p] = n(), [s, f] = n(), [l, C] = n(), g = (d, x, c) => {
12
+ const F = c != null || a() != null;
13
+ return [
14
+ c,
15
+ a(),
16
+ // If there is both an aria-label and aria-labelledby, add the field itself has an aria-labelledby
17
+ F && x != null ? d : void 0
18
+ ].filter(Boolean).join(" ") || void 0;
19
+ }, I = (d) => [
20
+ s(),
21
+ // Use aria-describedby for error message because aria-errormessage is unsupported using VoiceOver or NVDA.
22
+ // See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268
23
+ l(),
24
+ d
25
+ ].filter(Boolean).join(" ") || void 0, b = R(() => ({
26
+ "data-valid": t(e.validationState) === "valid" ? "" : void 0,
27
+ "data-invalid": t(e.validationState) === "invalid" ? "" : void 0,
28
+ "data-required": t(e.required) ? "" : void 0,
29
+ "data-disabled": t(e.disabled) ? "" : void 0,
30
+ "data-readonly": t(e.readOnly) ? "" : void 0
31
+ }));
32
+ return {
33
+ formControlContext: {
34
+ name: () => t(e.name) ?? t(e.id),
35
+ dataset: b,
36
+ validationState: () => t(e.validationState),
37
+ isRequired: () => t(e.required),
38
+ isDisabled: () => t(e.disabled),
39
+ isReadOnly: () => t(e.readOnly),
40
+ labelId: a,
41
+ fieldId: v,
42
+ descriptionId: s,
43
+ errorMessageId: l,
44
+ getAriaLabelledBy: g,
45
+ getAriaDescribedBy: I,
46
+ generateId: D(() => t(e.id)),
47
+ registerLabel: i(u),
48
+ registerField: i(p),
49
+ registerDescription: i(f),
50
+ registerErrorMessage: i(C)
51
+ }
14
52
  };
15
- typeof e == "function" ? m(f) : E(f);
53
+ }
54
+ var B = E();
55
+ function L() {
56
+ const r = h(B);
57
+ if (r === void 0)
58
+ throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");
59
+ return r;
60
+ }
61
+ function $(r) {
62
+ const o = L(), e = m({
63
+ id: o.generateId("description")
64
+ }, r);
65
+ return S(() => q(o.registerDescription(e.id))), y(P, O({
66
+ as: "div"
67
+ }, () => o.dataset(), e));
16
68
  }
17
69
  export {
18
- h as createEventListener,
19
- v as makeEventListener
70
+ T as FORM_CONTROL_PROP_NAMES,
71
+ B as FormControlContext,
72
+ $ as FormControlDescription,
73
+ U as createFormControl,
74
+ L as useFormControlContext
20
75
  };
21
76
  //# sourceMappingURL=index320.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index320.js","sources":["../../../node_modules/.bun/@solid-primitives+event-listener@2.4.6+ee58d66d663bac7b/node_modules/@solid-primitives/event-listener/dist/eventListener.js"],"sourcesContent":["import { access, asArray, tryOnCleanup, } from \"@solid-primitives/utils\";\nimport { createEffect, createRenderEffect, createSignal } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nexport function makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nexport function createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach(el => {\n if (el)\n asArray(access(type)).forEach(type => makeEventListener(el, type, handler, options));\n });\n };\n // if the target is an accessor the listeners will be added on the first effect (onMount)\n // so that when passed a jsx ref it will be availabe\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n // if the target prop is NOT an accessor, the event listeners can be added right away\n else\n createRenderEffect(attachListeners);\n}\nexport function createEventSignal(target, type, options) {\n if (isServer) {\n return () => undefined;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\n/**\n * Directive Usage. Creates an event listener, that will be automatically disposed on cleanup.\n *\n * @param props [eventType, handler, options]\n *\n * @example\n * <button use:eventListener={[\"click\", () => {...}]}>Click me!</button>\n */\nexport const eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\n// // /* TypeCheck */\n// const mouseHandler = (e: MouseEvent) => {};\n// const touchHandler = (e: TouchEvent) => {};\n// const el = document.createElement(\"div\");\n// // dom events\n// createEventListener(window as Window | undefined, \"mousemove\", mouseHandler);\n// createEventListener(document, \"touchstart\", touchHandler);\n// createEventListener(el, \"mousemove\", mouseHandler);\n// createEventListener(() => el, \"touchstart\", touchHandler);\n// const mouseSignal = createEventSignal(window, \"mousemove\");\n// const touchSignal = createEventSignal(() => document, \"touchstart\");\n// // custom events\n// createEventListener<{ test: MouseEvent }>(window, \"test\", mouseHandler);\n// createEventListener<{ test: Event; custom: MouseEvent }, \"custom\">(\n// () => el,\n// \"custom\",\n// mouseHandler\n// );\n// createEventListener<{ test: Event }>(new EventTarget(), \"test\", () => console.log(\"test\"));\n// const testSignal = createEventSignal<{ test: MouseEvent }>(window, \"test\");\n// const customSignal = createEventSignal<{ test: Event; custom: MouseEvent }, \"custom\">(\n// () => document,\n// \"custom\"\n// );\n// // directive\n// eventListener(el, () => [\"mousemove\", mouseHandler, { passive: true }]);\n// eventListener(el, () => [\"custom\", e => {}]);\n"],"names":["makeEventListener","target","type","handler","options","tryOnCleanup","createEventListener","targets","isServer","attachListeners","asArray","access","el","createEffect","createRenderEffect"],"mappings":";;;AAGO,SAASA,EAAkBC,GAAQC,GAAMC,GAASC,GAAS;AAC9D,SAAAH,EAAO,iBAAiBC,GAAMC,GAASC,CAAO,GACvCC,EAAaJ,EAAO,oBAAoB,KAAKA,GAAQC,GAAMC,GAASC,CAAO,CAAC;AACvF;AACO,SAASE,EAAoBC,GAASL,GAAMC,GAASC,GAAS;AACjE,MAAII;AACA;AACJ,QAAMC,IAAkB,MAAM;AAC1B,IAAAC,EAAQC,EAAOJ,CAAO,CAAC,EAAE,QAAQ,CAAAK,MAAM;AACnC,MAAIA,KACAF,EAAQC,EAAOT,CAAI,CAAC,EAAE,QAAQ,CAAAA,MAAQF,EAAkBY,GAAIV,GAAMC,GAASC,CAAO,CAAC;AAAA,IAC3F,CAAC;AAAA,EACL;AAGA,EAAI,OAAOG,KAAY,aACnBM,EAAaJ,CAAe,IAG5BK,EAAmBL,CAAe;AAC1C;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index320.js","sources":["../../../node_modules/.bun/@kobalte+core@0.13.12+ee58d66d663bac7b/node_modules/@kobalte/core/dist/chunk/XUUROM4M.jsx"],"sourcesContent":["import {\n createRegisterId\n} from \"./JNCCF6MP.jsx\";\nimport {\n Polymorphic\n} from \"./FLVHQV4A.jsx\";\n\n// src/form-control/create-form-control.tsx\nimport {\n access,\n createGenerateId,\n mergeDefaultProps\n} from \"@kobalte/utils\";\nimport {\n createMemo,\n createSignal,\n createUniqueId\n} from \"solid-js\";\nvar FORM_CONTROL_PROP_NAMES = [\n \"id\",\n \"name\",\n \"validationState\",\n \"required\",\n \"disabled\",\n \"readOnly\"\n];\nfunction createFormControl(props) {\n const defaultId = `form-control-${createUniqueId()}`;\n const mergedProps = mergeDefaultProps({ id: defaultId }, props);\n const [labelId, setLabelId] = createSignal();\n const [fieldId, setFieldId] = createSignal();\n const [descriptionId, setDescriptionId] = createSignal();\n const [errorMessageId, setErrorMessageId] = createSignal();\n const getAriaLabelledBy = (fieldId2, fieldAriaLabel, fieldAriaLabelledBy) => {\n const hasAriaLabelledBy = fieldAriaLabelledBy != null || labelId() != null;\n return [\n fieldAriaLabelledBy,\n labelId(),\n // If there is both an aria-label and aria-labelledby, add the field itself has an aria-labelledby\n hasAriaLabelledBy && fieldAriaLabel != null ? fieldId2 : void 0\n ].filter(Boolean).join(\" \") || void 0;\n };\n const getAriaDescribedBy = (fieldAriaDescribedBy) => {\n return [\n descriptionId(),\n // Use aria-describedby for error message because aria-errormessage is unsupported using VoiceOver or NVDA.\n // See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268\n errorMessageId(),\n fieldAriaDescribedBy\n ].filter(Boolean).join(\" \") || void 0;\n };\n const dataset = createMemo(() => ({\n \"data-valid\": access(mergedProps.validationState) === \"valid\" ? \"\" : void 0,\n \"data-invalid\": access(mergedProps.validationState) === \"invalid\" ? \"\" : void 0,\n \"data-required\": access(mergedProps.required) ? \"\" : void 0,\n \"data-disabled\": access(mergedProps.disabled) ? \"\" : void 0,\n \"data-readonly\": access(mergedProps.readOnly) ? \"\" : void 0\n }));\n const formControlContext = {\n name: () => access(mergedProps.name) ?? access(mergedProps.id),\n dataset,\n validationState: () => access(mergedProps.validationState),\n isRequired: () => access(mergedProps.required),\n isDisabled: () => access(mergedProps.disabled),\n isReadOnly: () => access(mergedProps.readOnly),\n labelId,\n fieldId,\n descriptionId,\n errorMessageId,\n getAriaLabelledBy,\n getAriaDescribedBy,\n generateId: createGenerateId(() => access(mergedProps.id)),\n registerLabel: createRegisterId(setLabelId),\n registerField: createRegisterId(setFieldId),\n registerDescription: createRegisterId(setDescriptionId),\n registerErrorMessage: createRegisterId(setErrorMessageId)\n };\n return { formControlContext };\n}\n\n// src/form-control/form-control-context.tsx\nimport { createContext, useContext } from \"solid-js\";\nvar FormControlContext = createContext();\nfunction useFormControlContext() {\n const context = useContext(FormControlContext);\n if (context === void 0) {\n throw new Error(\n \"[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component\"\n );\n }\n return context;\n}\n\n// src/form-control/form-control-description.tsx\nimport { mergeDefaultProps as mergeDefaultProps2 } from \"@kobalte/utils\";\nimport { createEffect, onCleanup } from \"solid-js\";\nfunction FormControlDescription(props) {\n const context = useFormControlContext();\n const mergedProps = mergeDefaultProps2(\n {\n id: context.generateId(\"description\")\n },\n props\n );\n createEffect(() => onCleanup(context.registerDescription(mergedProps.id)));\n return <Polymorphic\n as=\"div\"\n {...context.dataset()}\n {...mergedProps}\n />;\n}\n\nexport {\n FORM_CONTROL_PROP_NAMES,\n createFormControl,\n FormControlContext,\n useFormControlContext,\n FormControlDescription\n};\n"],"names":["FORM_CONTROL_PROP_NAMES","createFormControl","props","defaultId","createUniqueId","mergedProps","mergeDefaultProps","id","labelId","setLabelId","createSignal","fieldId","setFieldId","descriptionId","setDescriptionId","errorMessageId","setErrorMessageId","getAriaLabelledBy","fieldId2","fieldAriaLabel","fieldAriaLabelledBy","hasAriaLabelledBy","filter","Boolean","join","getAriaDescribedBy","fieldAriaDescribedBy","dataset","createMemo","access","validationState","required","disabled","readOnly","formControlContext","name","isRequired","isDisabled","isReadOnly","generateId","createGenerateId","registerLabel","createRegisterId","registerField","registerDescription","registerErrorMessage","FormControlContext","createContext","useFormControlContext","context","useContext","Error","FormControlDescription","mergeDefaultProps2","createEffect","onCleanup","_$createComponent","Polymorphic","_$mergeProps","as"],"mappings":";;;;;;AAkBA,IAAIA,IAA0B,CAC5B,MACA,QACA,mBACA,YACA,YACA,UAAU;AAEZ,SAASC,EAAkBC,GAAO;AAChC,QAAMC,IAAY,gBAAgBC,EAAAA,CAAgB,IAC5CC,IAAcC,EAAkB;AAAA,IAAEC,IAAIJ;AAAAA,EAAAA,GAAaD,CAAK,GACxD,CAACM,GAASC,CAAU,IAAIC,EAAAA,GACxB,CAACC,GAASC,CAAU,IAAIF,EAAAA,GACxB,CAACG,GAAeC,CAAgB,IAAIJ,EAAAA,GACpC,CAACK,GAAgBC,CAAiB,IAAIN,EAAAA,GACtCO,IAAoBA,CAACC,GAAUC,GAAgBC,MAAwB;AAC3E,UAAMC,IAAoBD,KAAuB,QAAQZ,EAAAA,KAAa;AACtE,WAAO;AAAA,MACLY;AAAAA,MACAZ,EAAAA;AAAAA;AAAAA,MAEAa,KAAqBF,KAAkB,OAAOD,IAAW;AAAA,IAAA,EACzDI,OAAOC,OAAO,EAAEC,KAAK,GAAG,KAAK;AAAA,EACjC,GACMC,IAAsBC,CAAAA,MACnB;AAAA,IACLb,EAAAA;AAAAA;AAAAA;AAAAA,IAGAE,EAAAA;AAAAA,IACAW;AAAAA,EAAAA,EACAJ,OAAOC,OAAO,EAAEC,KAAK,GAAG,KAAK,QAE3BG,IAAUC,EAAW,OAAO;AAAA,IAChC,cAAcC,EAAOxB,EAAYyB,eAAe,MAAM,UAAU,KAAK;AAAA,IACrE,gBAAgBD,EAAOxB,EAAYyB,eAAe,MAAM,YAAY,KAAK;AAAA,IACzE,iBAAiBD,EAAOxB,EAAY0B,QAAQ,IAAI,KAAK;AAAA,IACrD,iBAAiBF,EAAOxB,EAAY2B,QAAQ,IAAI,KAAK;AAAA,IACrD,iBAAiBH,EAAOxB,EAAY4B,QAAQ,IAAI,KAAK;AAAA,EAAA,EACrD;AAoBF,SAAO;AAAA,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.js CHANGED
@@ -1,36 +1,122 @@
1
- import { visuallyHiddenStyles as s } from "./index292.js";
2
- var r = 7e3, o = null, l = "data-live-announcer";
3
- function c(e, t = "assertive", n = r) {
4
- o || (o = new d()), o.announce(e, t, n);
1
+ import { createComponent as a, mergeProps as l, memo as h } from "solid-js/web";
2
+ import { createNumberFormatter as M } from "./index252.js";
3
+ import { createRegisterId as I } from "./index292.js";
4
+ import { Polymorphic as o } from "./index293.js";
5
+ import { createUniqueId as y, splitProps as s, createSignal as P, createMemo as C, createEffect as w, onCleanup as F, createContext as k, useContext as R } from "solid-js";
6
+ import { mergeDefaultProps as f, createGenerateId as E, clamp as S } from "./index294.js";
7
+ import { combineStyle as T } from "./index298.js";
8
+ var g = k();
9
+ function m() {
10
+ const r = R(g);
11
+ if (r === void 0)
12
+ throw new Error("[kobalte]: `useMeterContext` must be used within a `Meter.Root` component");
13
+ return r;
5
14
  }
6
- var d = class {
7
- node;
8
- assertiveLog;
9
- politeLog;
10
- constructor() {
11
- this.node = document.createElement("div"), this.node.dataset.liveAnnouncer = "true", Object.assign(this.node.style, s), this.assertiveLog = this.createLog("assertive"), this.node.appendChild(this.assertiveLog), this.politeLog = this.createLog("polite"), this.node.appendChild(this.politeLog), document.body.prepend(this.node);
12
- }
13
- createLog(e) {
14
- const t = document.createElement("div");
15
- return t.setAttribute("role", "log"), t.setAttribute("aria-live", e), t.setAttribute("aria-relevant", "additions"), t;
16
- }
17
- destroy() {
18
- this.node && (document.body.removeChild(this.node), this.node = null);
19
- }
20
- announce(e, t = "assertive", n = r) {
21
- if (!this.node)
22
- return;
23
- const i = document.createElement("div");
24
- i.textContent = e, t === "assertive" ? this.assertiveLog.appendChild(i) : this.politeLog.appendChild(i), e !== "" && setTimeout(() => {
25
- i.remove();
26
- }, n);
27
- }
28
- clear(e) {
29
- this.node && ((!e || e === "assertive") && (this.assertiveLog.innerHTML = ""), (!e || e === "polite") && (this.politeLog.innerHTML = ""));
30
- }
31
- };
15
+ function W(r) {
16
+ const t = m(), [n, e] = s(r, ["style"]);
17
+ return a(o, l({
18
+ as: "div",
19
+ get style() {
20
+ return T({
21
+ "--kb-meter-fill-width": t.meterFillWidth()
22
+ }, n.style);
23
+ }
24
+ }, () => t.dataset(), e));
25
+ }
26
+ function $(r) {
27
+ const t = m(), n = f({
28
+ id: t.generateId("label")
29
+ }, r), [e, i] = s(n, ["id"]);
30
+ return w(() => F(t.registerLabelId(e.id))), a(o, l({
31
+ as: "span",
32
+ get id() {
33
+ return e.id;
34
+ }
35
+ }, () => t.dataset(), i));
36
+ }
37
+ function j(r) {
38
+ const t = `meter-${y()}`, n = f({
39
+ id: t,
40
+ value: 0,
41
+ minValue: 0,
42
+ maxValue: 100,
43
+ role: "meter",
44
+ indeterminate: !1
45
+ }, r), [e, i] = s(n, ["value", "minValue", "maxValue", "getValueLabel", "role", "aria-valuetext", "aria-labelledby", "aria-valuemax", "aria-valuemin", "aria-valuenow", "indeterminate"]), [d, x] = P(), p = M(() => ({
46
+ style: "percent"
47
+ })), u = () => S(e.value, e.minValue, e.maxValue), c = () => (u() - e.minValue) / (e.maxValue - e.minValue), v = () => {
48
+ if (!e.indeterminate)
49
+ return e.getValueLabel ? e.getValueLabel({
50
+ value: u(),
51
+ min: e.minValue,
52
+ max: e.maxValue
53
+ }) : p().format(c());
54
+ }, V = () => `${c() * 100}%`, b = C(() => ({})), L = {
55
+ dataset: b,
56
+ value: u,
57
+ valuePercent: c,
58
+ valueLabel: v,
59
+ labelId: d,
60
+ meterFillWidth: V,
61
+ generateId: E(() => i.id),
62
+ registerLabelId: I(x)
63
+ };
64
+ return a(g.Provider, {
65
+ value: L,
66
+ get children() {
67
+ return a(o, l({
68
+ as: "div",
69
+ get role() {
70
+ return e.role || "meter";
71
+ },
72
+ get "aria-valuenow"() {
73
+ return h(() => !!e.indeterminate)() ? void 0 : u();
74
+ },
75
+ get "aria-valuemin"() {
76
+ return e.minValue;
77
+ },
78
+ get "aria-valuemax"() {
79
+ return e.maxValue;
80
+ },
81
+ get "aria-valuetext"() {
82
+ return v();
83
+ },
84
+ get "aria-labelledby"() {
85
+ return d();
86
+ }
87
+ }, b, i));
88
+ }
89
+ });
90
+ }
91
+ function q(r) {
92
+ const t = m();
93
+ return a(o, l({
94
+ as: "div"
95
+ }, () => t.dataset(), r));
96
+ }
97
+ function D(r) {
98
+ const t = m();
99
+ return a(o, l({
100
+ as: "div"
101
+ }, () => t.dataset(), r, {
102
+ get children() {
103
+ return t.valueLabel();
104
+ }
105
+ }));
106
+ }
107
+ var H = Object.assign(j, {
108
+ Fill: W,
109
+ Label: $,
110
+ Track: q,
111
+ ValueLabel: D
112
+ });
32
113
  export {
33
- l as DATA_LIVE_ANNOUNCER_ATTR,
34
- c as announce
114
+ H as Meter,
115
+ W as MeterFill,
116
+ $ as MeterLabel,
117
+ j as MeterRoot,
118
+ q as MeterTrack,
119
+ D as MeterValueLabel,
120
+ m as useMeterContext
35
121
  };
36
122
  //# sourceMappingURL=index321.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index321.js","sources":["../../../node_modules/.bun/@kobalte+core@0.13.12+ee58d66d663bac7b/node_modules/@kobalte/core/dist/chunk/JHMNWOLY.jsx"],"sourcesContent":["// src/live-announcer/live-announcer.tsx\nimport { visuallyHiddenStyles } from \"@kobalte/utils\";\nvar LIVEREGION_TIMEOUT_DELAY = 7e3;\nvar liveAnnouncer = null;\nvar DATA_LIVE_ANNOUNCER_ATTR = \"data-live-announcer\";\nfunction announce(message, assertiveness = \"assertive\", timeout = LIVEREGION_TIMEOUT_DELAY) {\n if (!liveAnnouncer) {\n liveAnnouncer = new LiveAnnouncer();\n }\n liveAnnouncer.announce(message, assertiveness, timeout);\n}\nfunction clearAnnouncer(assertiveness) {\n if (liveAnnouncer) {\n liveAnnouncer.clear(assertiveness);\n }\n}\nfunction destroyAnnouncer() {\n if (liveAnnouncer) {\n liveAnnouncer.destroy();\n liveAnnouncer = null;\n }\n}\nvar LiveAnnouncer = class {\n node;\n assertiveLog;\n politeLog;\n constructor() {\n this.node = document.createElement(\"div\");\n this.node.dataset.liveAnnouncer = \"true\";\n Object.assign(this.node.style, visuallyHiddenStyles);\n this.assertiveLog = this.createLog(\"assertive\");\n this.node.appendChild(this.assertiveLog);\n this.politeLog = this.createLog(\"polite\");\n this.node.appendChild(this.politeLog);\n document.body.prepend(this.node);\n }\n createLog(ariaLive) {\n const node = document.createElement(\"div\");\n node.setAttribute(\"role\", \"log\");\n node.setAttribute(\"aria-live\", ariaLive);\n node.setAttribute(\"aria-relevant\", \"additions\");\n return node;\n }\n destroy() {\n if (!this.node) {\n return;\n }\n document.body.removeChild(this.node);\n this.node = null;\n }\n announce(message, assertiveness = \"assertive\", timeout = LIVEREGION_TIMEOUT_DELAY) {\n if (!this.node) {\n return;\n }\n const node = document.createElement(\"div\");\n node.textContent = message;\n if (assertiveness === \"assertive\") {\n this.assertiveLog.appendChild(node);\n } else {\n this.politeLog.appendChild(node);\n }\n if (message !== \"\") {\n setTimeout(() => {\n node.remove();\n }, timeout);\n }\n }\n clear(assertiveness) {\n if (!this.node) {\n return;\n }\n if (!assertiveness || assertiveness === \"assertive\") {\n this.assertiveLog.innerHTML = \"\";\n }\n if (!assertiveness || assertiveness === \"polite\") {\n this.politeLog.innerHTML = \"\";\n }\n }\n};\n\nexport {\n DATA_LIVE_ANNOUNCER_ATTR,\n announce,\n clearAnnouncer,\n destroyAnnouncer\n};\n"],"names":["LIVEREGION_TIMEOUT_DELAY","liveAnnouncer","DATA_LIVE_ANNOUNCER_ATTR","announce","message","assertiveness","timeout","LiveAnnouncer","node","assertiveLog","politeLog","constructor","document","createElement","dataset","Object","assign","style","visuallyHiddenStyles","createLog","appendChild","body","prepend","ariaLive","setAttribute","destroy","removeChild","textContent","setTimeout","remove","clear","innerHTML"],"mappings":";AAEA,IAAIA,IAA2B,KAC3BC,IAAgB,MAChBC,IAA2B;AAC/B,SAASC,EAASC,GAASC,IAAgB,aAAaC,IAAUN,GAA0B;AAC1F,EAAKC,MACHA,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asB,YAAY,MAE5B,CAAC1B,KAAiBA,MAAkB,cACtC,KAAKK,UAAUqB,YAAY;AAAA,EAE/B;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index321.js","sources":["../../../node_modules/.bun/@kobalte+core@0.13.12+ee58d66d663bac7b/node_modules/@kobalte/core/dist/chunk/OU7DYFTQ.jsx"],"sourcesContent":["import {\n createNumberFormatter\n} from \"./LP6E37CW.jsx\";\nimport {\n createRegisterId\n} from \"./JNCCF6MP.jsx\";\nimport {\n Polymorphic\n} from \"./FLVHQV4A.jsx\";\n\n// src/meter/meter-fill.tsx\nimport { splitProps } from \"solid-js\";\nimport { combineStyle } from \"@solid-primitives/props\";\n\n// src/meter/meter-context.tsx\nimport { createContext, useContext } from \"solid-js\";\nvar MeterContext = createContext();\nfunction useMeterContext() {\n const context = useContext(MeterContext);\n if (context === void 0) {\n throw new Error(\n \"[kobalte]: `useMeterContext` must be used within a `Meter.Root` component\"\n );\n }\n return context;\n}\n\n// src/meter/meter-fill.tsx\nfunction MeterFill(props) {\n const context = useMeterContext();\n const [local, others] = splitProps(props, [\"style\"]);\n return <Polymorphic\n as=\"div\"\n style={combineStyle(\n {\n \"--kb-meter-fill-width\": context.meterFillWidth()\n },\n local.style\n )}\n {...context.dataset()}\n {...others}\n />;\n}\n\n// src/meter/meter-label.tsx\nimport { mergeDefaultProps } from \"@kobalte/utils\";\nimport {\n createEffect,\n onCleanup,\n splitProps as splitProps2\n} from \"solid-js\";\nfunction MeterLabel(props) {\n const context = useMeterContext();\n const mergedProps = mergeDefaultProps(\n {\n id: context.generateId(\"label\")\n },\n props\n );\n const [local, others] = splitProps2(mergedProps, [\"id\"]);\n createEffect(() => onCleanup(context.registerLabelId(local.id)));\n return <Polymorphic\n as=\"span\"\n id={local.id}\n {...context.dataset()}\n {...others}\n />;\n}\n\n// src/meter/meter-root.tsx\nimport { clamp, createGenerateId, mergeDefaultProps as mergeDefaultProps2 } from \"@kobalte/utils\";\nimport {\n createMemo,\n createSignal,\n createUniqueId,\n splitProps as splitProps3\n} from \"solid-js\";\nfunction MeterRoot(props) {\n const defaultId = `meter-${createUniqueId()}`;\n const mergedProps = mergeDefaultProps2(\n {\n id: defaultId,\n value: 0,\n minValue: 0,\n maxValue: 100,\n role: \"meter\",\n indeterminate: false\n },\n props\n );\n const [local, others] = splitProps3(mergedProps, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"getValueLabel\",\n \"role\",\n \"aria-valuetext\",\n \"aria-labelledby\",\n \"aria-valuemax\",\n \"aria-valuemin\",\n \"aria-valuenow\",\n \"indeterminate\"\n ]);\n const [labelId, setLabelId] = createSignal();\n const defaultFormatter = createNumberFormatter(() => ({ style: \"percent\" }));\n const value = () => {\n return clamp(local.value, local.minValue, local.maxValue);\n };\n const valuePercent = () => {\n return (value() - local.minValue) / (local.maxValue - local.minValue);\n };\n const valueLabel = () => {\n if (local.indeterminate) {\n return void 0;\n }\n if (local.getValueLabel) {\n return local.getValueLabel({\n value: value(),\n min: local.minValue,\n max: local.maxValue\n });\n }\n return defaultFormatter().format(valuePercent());\n };\n const meterFillWidth = () => {\n return `${valuePercent() * 100}%`;\n };\n const dataset = createMemo(() => {\n return {};\n });\n const context = {\n dataset,\n value,\n valuePercent,\n valueLabel,\n labelId,\n meterFillWidth,\n generateId: createGenerateId(() => others.id),\n registerLabelId: createRegisterId(setLabelId)\n };\n return <MeterContext.Provider value={context}><Polymorphic\n as=\"div\"\n role={local.role || \"meter\"}\n aria-valuenow={local.indeterminate ? void 0 : value()}\n aria-valuemin={local.minValue}\n aria-valuemax={local.maxValue}\n aria-valuetext={valueLabel()}\n aria-labelledby={labelId()}\n {...dataset()}\n {...others}\n /></MeterContext.Provider>;\n}\n\n// src/meter/meter-track.tsx\nfunction MeterTrack(props) {\n const context = useMeterContext();\n return <Polymorphic\n as=\"div\"\n {...context.dataset()}\n {...props}\n />;\n}\n\n// src/meter/meter-value-label.tsx\nfunction MeterValueLabel(props) {\n const context = useMeterContext();\n return <Polymorphic\n as=\"div\"\n {...context.dataset()}\n {...props}\n >{context.valueLabel()}</Polymorphic>;\n}\n\n// src/meter/index.tsx\nvar Meter = Object.assign(MeterRoot, {\n Fill: MeterFill,\n Label: MeterLabel,\n Track: MeterTrack,\n ValueLabel: MeterValueLabel\n});\n\nexport {\n useMeterContext,\n MeterFill,\n MeterLabel,\n MeterRoot,\n MeterTrack,\n MeterValueLabel,\n Meter\n};\n"],"names":["MeterContext","createContext","useMeterContext","context","useContext","Error","MeterFill","props","local","others","splitProps","_$createComponent","Polymorphic","_$mergeProps","as","style","combineStyle","meterFillWidth","dataset","MeterLabel","mergedProps","mergeDefaultProps","id","generateId","splitProps2","createEffect","onCleanup","registerLabelId","MeterRoot","defaultId","createUniqueId","mergeDefaultProps2","value","minValue","maxValue","role","indeterminate","splitProps3","labelId","setLabelId","createSignal","defaultFormatter","createNumberFormatter","clamp","valuePercent","valueLabel","getValueLabel","min","max","format","createMemo","createGenerateId","createRegisterId","Provider","children","_$memo","MeterTrack","MeterValueLabel","Meter","Object","assign","Fill","Label","Track","ValueLabel"],"mappings":";;;;;;;AAgBA,IAAIA,IAAeC,EAAAA;AACnB,SAASC,IAAkB;AACzB,QAAMC,IAAUC,EAAWJ,CAAY;AACvC,MAAIG,MAAY;AACd,UAAM,IAAIE,MACR,2EACF;AAEF,SAAOF;AACT;AAGA,SAASG,EAAUC,GAAO;AACxB,QAAMJ,IAAUD,EAAAA,GACV,CAACM,GAAOC,CAAM,IAAIC,EAAWH,GAAO,CAAC,OAAO,CAAC;AACnD,SAAAI,EAAQC,GAAWC,EAAA;AAAA,IACjBC,IAAE;AAAA,IAAA,IACFC,QAAK;AAAA,aAAEC,EACL;AAAA,QACE,yBAAyBb,EAAQc,eAAAA;AAAAA,MAAe,GAElDT,EAAMO,KACR;AAAA,IAAC;AAAA,EAAA,GAAA,MACGZ,EAAQe,QAAAA,GACRT,CAAM,CAAA;AAEd;AASA,SAASU,EAAWZ,GAAO;AACzB,QAAMJ,IA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EAAAA;AAChB,SAAAS,EAAQC,GAAWC,EAAA;AAAA,IACjBC,IAAE;AAAA,EAAA,GAAA,MACEX,EAAQe,QAAAA,GACRX,GAAK;AAAA,IAAA,IAAA+C,WAAA;AAAA,aACTnD,EAAQ0C,WAAAA;AAAAA,IAAY;AAAA,EAAA,CAAA,CAAA;AACxB;AAGA,IAAIa,IAAQC,OAAOC,OAAOhC,GAAW;AAAA,EACnCiC,MAAMvD;AAAAA,EACNwD,OAAO3C;AAAAA,EACP4C,OAAOP;AAAAA,EACPQ,YAAYP;AACd,CAAC;","x_google_ignoreList":[0]}
package/dist/index323.js CHANGED
@@ -1,4 +1,4 @@
1
- import { filterNonNullable as d, asArray as m, access as l, handleDiffArray as g, noop as b } from "./index298.js";
1
+ import { filterNonNullable as d, asArray as m, access as l, handleDiffArray as g, noop as b } from "./index300.js";
2
2
  import { createEffect as w, onCleanup as M } from "solid-js";
3
3
  import { isServer as v } from "solid-js/web";
4
4
  function R(o, n) {