@spark-ui/components 11.1.0 → 11.1.2

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 (146) hide show
  1. package/dist/DialogTrigger-woU7vsJi.d.ts +142 -0
  2. package/dist/Input-N8AWWSmt.d.ts +41 -0
  3. package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
  4. package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
  5. package/dist/accordion/index.d.ts +73 -0
  6. package/dist/accordion/index.js +325 -0
  7. package/dist/accordion/index.js.map +1 -0
  8. package/dist/alert-dialog/index.d.ts +119 -0
  9. package/dist/alert-dialog/index.js +1554 -0
  10. package/dist/alert-dialog/index.js.map +1 -0
  11. package/dist/avatar/index.d.ts +66 -0
  12. package/dist/avatar/index.js +1303 -0
  13. package/dist/avatar/index.js.map +1 -0
  14. package/dist/badge/index.d.ts +47 -0
  15. package/dist/badge/index.js +122 -0
  16. package/dist/badge/index.js.map +1 -0
  17. package/dist/breadcrumb/index.d.ts +64 -0
  18. package/dist/breadcrumb/index.js +327 -0
  19. package/dist/breadcrumb/index.js.map +1 -0
  20. package/dist/button/index.d.ts +41 -0
  21. package/dist/button/index.js +935 -0
  22. package/dist/button/index.js.map +1 -0
  23. package/dist/card/index.d.ts +61 -0
  24. package/dist/card/index.js +502 -0
  25. package/dist/card/index.js.map +1 -0
  26. package/dist/carousel/index.d.ts +261 -0
  27. package/dist/carousel/index.js +1801 -0
  28. package/dist/carousel/index.js.map +1 -0
  29. package/dist/checkbox/index.d.ts +120 -0
  30. package/dist/checkbox/index.js +511 -0
  31. package/dist/checkbox/index.js.map +1 -0
  32. package/dist/chip/index.d.ts +97 -0
  33. package/dist/chip/index.js +908 -0
  34. package/dist/chip/index.js.map +1 -0
  35. package/dist/collapsible/index.d.ts +43 -0
  36. package/dist/collapsible/index.js +109 -0
  37. package/dist/collapsible/index.js.map +1 -0
  38. package/dist/combobox/index.d.ts +287 -0
  39. package/dist/combobox/index.js +2588 -0
  40. package/dist/combobox/index.js.map +1 -0
  41. package/dist/dialog/index.d.ts +33 -0
  42. package/dist/dialog/index.js +1389 -0
  43. package/dist/dialog/index.js.map +1 -0
  44. package/dist/divider/index.d.ts +61 -0
  45. package/dist/divider/index.js +224 -0
  46. package/dist/divider/index.js.map +1 -0
  47. package/dist/drawer/index.d.ts +152 -0
  48. package/dist/drawer/index.js +1400 -0
  49. package/dist/drawer/index.js.map +1 -0
  50. package/dist/dropdown/index.d.ts +233 -0
  51. package/dist/dropdown/index.js +2051 -0
  52. package/dist/dropdown/index.js.map +1 -0
  53. package/dist/form-field/index.d.ts +186 -0
  54. package/dist/form-field/index.js +553 -0
  55. package/dist/form-field/index.js.map +1 -0
  56. package/dist/icon/index.d.ts +28 -0
  57. package/dist/icon/index.js +127 -0
  58. package/dist/icon/index.js.map +1 -0
  59. package/dist/icon-button/index.d.ts +16 -0
  60. package/dist/icon-button/index.js +980 -0
  61. package/dist/icon-button/index.js.map +1 -0
  62. package/dist/input/index.d.ts +78 -0
  63. package/dist/input/index.js +724 -0
  64. package/dist/input/index.js.map +1 -0
  65. package/dist/kbd/index.d.ts +9 -0
  66. package/dist/kbd/index.js +47 -0
  67. package/dist/kbd/index.js.map +1 -0
  68. package/dist/label/index.d.ts +11 -0
  69. package/dist/label/index.js +78 -0
  70. package/dist/label/index.js.map +1 -0
  71. package/dist/link-box/index.d.ts +34 -0
  72. package/dist/link-box/index.js +92 -0
  73. package/dist/link-box/index.js.map +1 -0
  74. package/dist/pagination/index.d.ts +143 -0
  75. package/dist/pagination/index.js +1353 -0
  76. package/dist/pagination/index.js.map +1 -0
  77. package/dist/popover/index.d.ts +93 -0
  78. package/dist/popover/index.js +1339 -0
  79. package/dist/popover/index.js.map +1 -0
  80. package/dist/portal/index.d.ts +13 -0
  81. package/dist/portal/index.js +37 -0
  82. package/dist/portal/index.js.map +1 -0
  83. package/dist/progress/index.d.ts +48 -0
  84. package/dist/progress/index.js +223 -0
  85. package/dist/progress/index.js.map +1 -0
  86. package/dist/progress-tracker/index.d.ts +80 -0
  87. package/dist/progress-tracker/index.js +571 -0
  88. package/dist/progress-tracker/index.js.map +1 -0
  89. package/dist/radio-group/index.d.ts +100 -0
  90. package/dist/radio-group/index.js +318 -0
  91. package/dist/radio-group/index.js.map +1 -0
  92. package/dist/rating/index.d.ts +78 -0
  93. package/dist/rating/index.js +363 -0
  94. package/dist/rating/index.js.map +1 -0
  95. package/dist/scrolling-list/index.d.ts +118 -0
  96. package/dist/scrolling-list/index.js +1426 -0
  97. package/dist/scrolling-list/index.js.map +1 -0
  98. package/dist/segmented-gauge/index.d.ts +100 -0
  99. package/dist/segmented-gauge/index.js +277 -0
  100. package/dist/segmented-gauge/index.js.map +1 -0
  101. package/dist/select/index.d.ts +167 -0
  102. package/dist/select/index.js +581 -0
  103. package/dist/select/index.js.map +1 -0
  104. package/dist/skeleton/index.d.ts +67 -0
  105. package/dist/skeleton/index.js +206 -0
  106. package/dist/skeleton/index.js.map +1 -0
  107. package/dist/slider/index.d.ts +97 -0
  108. package/dist/slider/index.js +220 -0
  109. package/dist/slider/index.js.map +1 -0
  110. package/dist/slot/index.d.ts +16 -0
  111. package/dist/slot/index.js +51 -0
  112. package/dist/slot/index.js.map +1 -0
  113. package/dist/snackbar/index.d.ts +158 -0
  114. package/dist/snackbar/index.js +1756 -0
  115. package/dist/snackbar/index.js.map +1 -0
  116. package/dist/spinner/index.d.mts +1 -1
  117. package/dist/spinner/index.d.ts +21 -0
  118. package/dist/spinner/index.js +139 -0
  119. package/dist/spinner/index.js.map +1 -0
  120. package/dist/stepper/index.d.ts +81 -0
  121. package/dist/stepper/index.js +1847 -0
  122. package/dist/stepper/index.js.map +1 -0
  123. package/dist/switch/index.d.ts +64 -0
  124. package/dist/switch/index.js +327 -0
  125. package/dist/switch/index.js.map +1 -0
  126. package/dist/tabs/index.d.ts +103 -0
  127. package/dist/tabs/index.js +1376 -0
  128. package/dist/tabs/index.js.map +1 -0
  129. package/dist/tag/index.d.ts +29 -0
  130. package/dist/tag/index.js +283 -0
  131. package/dist/tag/index.js.map +1 -0
  132. package/dist/text-link/index.d.ts +20 -0
  133. package/dist/text-link/index.js +100 -0
  134. package/dist/text-link/index.js.map +1 -0
  135. package/dist/textarea/index.d.ts +57 -0
  136. package/dist/textarea/index.js +797 -0
  137. package/dist/textarea/index.js.map +1 -0
  138. package/dist/toast/index.d.ts +56 -0
  139. package/dist/toast/index.js +1412 -0
  140. package/dist/toast/index.js.map +1 -0
  141. package/dist/toast/index.mjs +1 -1
  142. package/dist/toast/index.mjs.map +1 -1
  143. package/dist/visually-hidden/index.d.ts +16 -0
  144. package/dist/visually-hidden/index.js +67 -0
  145. package/dist/visually-hidden/index.js.map +1 -0
  146. package/package.json +5 -5
@@ -0,0 +1,553 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/form-field/index.ts
21
+ var form_field_exports = {};
22
+ __export(form_field_exports, {
23
+ FormField: () => FormField2,
24
+ useFormFieldControl: () => useFormFieldControl
25
+ });
26
+ module.exports = __toCommonJS(form_field_exports);
27
+
28
+ // src/form-field/FormField.tsx
29
+ var import_class_variance_authority = require("class-variance-authority");
30
+ var import_react4 = require("react");
31
+
32
+ // src/slot/Slot.tsx
33
+ var import_radix_ui = require("radix-ui");
34
+ var import_react = require("react");
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var Slottable = import_radix_ui.Slot.Slottable;
37
+ var Slot = ({ ref, ...props }) => {
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
39
+ };
40
+
41
+ // src/form-field/FormFieldContext.tsx
42
+ var import_react2 = require("react");
43
+ var FormFieldContext = (0, import_react2.createContext)(null);
44
+ var ID_PREFIX = ":form-field";
45
+ var useFormField = () => {
46
+ const context = (0, import_react2.useContext)(FormFieldContext);
47
+ if (!context) {
48
+ throw Error("useFormField must be used within a FormField provider");
49
+ }
50
+ return context;
51
+ };
52
+
53
+ // src/form-field/FormFieldProvider.tsx
54
+ var import_react3 = require("react");
55
+ var import_jsx_runtime2 = require("react/jsx-runtime");
56
+ var FormFieldProvider = ({
57
+ id,
58
+ name,
59
+ disabled = false,
60
+ readOnly = false,
61
+ state,
62
+ isRequired,
63
+ children
64
+ }) => {
65
+ const labelId = `${ID_PREFIX}-label-${(0, import_react3.useId)()}`;
66
+ const [messageIds, setMessageIds] = (0, import_react3.useState)([]);
67
+ const description = messageIds.length > 0 ? messageIds.join(" ") : void 0;
68
+ const handleMessageIdAdd = (0, import_react3.useCallback)((msgId) => {
69
+ setMessageIds((ids) => [...ids, msgId]);
70
+ }, []);
71
+ const handleMessageIdRemove = (0, import_react3.useCallback)((msgId) => {
72
+ setMessageIds((ids) => ids.filter((current) => current !== msgId));
73
+ }, []);
74
+ const value = (0, import_react3.useMemo)(() => {
75
+ const isInvalid = state === "error";
76
+ return {
77
+ id,
78
+ labelId,
79
+ name,
80
+ disabled,
81
+ readOnly,
82
+ state,
83
+ isRequired,
84
+ isInvalid,
85
+ description,
86
+ onMessageIdAdd: handleMessageIdAdd,
87
+ onMessageIdRemove: handleMessageIdRemove
88
+ };
89
+ }, [
90
+ id,
91
+ labelId,
92
+ name,
93
+ disabled,
94
+ readOnly,
95
+ description,
96
+ state,
97
+ isRequired,
98
+ handleMessageIdAdd,
99
+ handleMessageIdRemove
100
+ ]);
101
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FormFieldContext.Provider, { value, children });
102
+ };
103
+ FormFieldProvider.displayName = "FormFieldProvider";
104
+
105
+ // src/form-field/FormField.tsx
106
+ var import_jsx_runtime3 = require("react/jsx-runtime");
107
+ var FormField = ({
108
+ className,
109
+ disabled = false,
110
+ readOnly = false,
111
+ name,
112
+ state,
113
+ isRequired = false,
114
+ asChild = false,
115
+ ref,
116
+ ...others
117
+ }) => {
118
+ const id = `${ID_PREFIX}-${(0, import_react4.useId)()}`;
119
+ const Component = asChild ? Slot : "div";
120
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
121
+ FormFieldProvider,
122
+ {
123
+ id,
124
+ name,
125
+ isRequired,
126
+ disabled,
127
+ readOnly,
128
+ state,
129
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
130
+ Component,
131
+ {
132
+ ref,
133
+ "data-spark-component": "form-field",
134
+ className: (0, import_class_variance_authority.cx)(className, "gap-sm flex flex-col"),
135
+ ...others
136
+ }
137
+ )
138
+ }
139
+ );
140
+ };
141
+ FormField.displayName = "FormField";
142
+
143
+ // src/form-field/FormFieldStateMessage.tsx
144
+ var import_AlertOutline = require("@spark-ui/icons/AlertOutline");
145
+ var import_Check = require("@spark-ui/icons/Check");
146
+ var import_WarningOutline = require("@spark-ui/icons/WarningOutline");
147
+ var import_class_variance_authority4 = require("class-variance-authority");
148
+
149
+ // src/icon/Icon.tsx
150
+ var import_react5 = require("react");
151
+
152
+ // src/visually-hidden/VisuallyHidden.tsx
153
+ var import_jsx_runtime4 = require("react/jsx-runtime");
154
+ var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
155
+ const Component = asChild ? Slot : "span";
156
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
157
+ Component,
158
+ {
159
+ ...props,
160
+ ref,
161
+ style: {
162
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
163
+ position: "absolute",
164
+ border: 0,
165
+ width: 1,
166
+ height: 1,
167
+ padding: 0,
168
+ margin: -1,
169
+ overflow: "hidden",
170
+ clip: "rect(0, 0, 0, 0)",
171
+ whiteSpace: "nowrap",
172
+ wordWrap: "normal",
173
+ ...props.style
174
+ }
175
+ }
176
+ );
177
+ };
178
+ VisuallyHidden.displayName = "VisuallyHidden";
179
+
180
+ // src/icon/Icon.styles.tsx
181
+ var import_internal_utils = require("@spark-ui/internal-utils");
182
+ var import_class_variance_authority2 = require("class-variance-authority");
183
+ var iconStyles = (0, import_class_variance_authority2.cva)(["fill-current shrink-0"], {
184
+ variants: {
185
+ /**
186
+ * Color scheme of the icon.
187
+ */
188
+ intent: (0, import_internal_utils.makeVariants)({
189
+ current: ["text-current"],
190
+ main: ["text-main"],
191
+ support: ["text-support"],
192
+ accent: ["text-accent"],
193
+ basic: ["text-basic"],
194
+ success: ["text-success"],
195
+ alert: ["text-alert"],
196
+ error: ["text-error"],
197
+ info: ["text-info"],
198
+ neutral: ["text-neutral"]
199
+ }),
200
+ /**
201
+ * Sets the size of the icon.
202
+ */
203
+ size: (0, import_internal_utils.makeVariants)({
204
+ current: ["u-current-font-size"],
205
+ sm: ["w-sz-16", "h-sz-16"],
206
+ md: ["w-sz-24", "h-sz-24"],
207
+ lg: ["w-sz-32", "h-sz-32"],
208
+ xl: ["w-sz-40", "h-sz-40"]
209
+ })
210
+ }
211
+ });
212
+
213
+ // src/icon/Icon.tsx
214
+ var import_jsx_runtime5 = require("react/jsx-runtime");
215
+ var Icon = ({
216
+ label,
217
+ className,
218
+ size = "current",
219
+ intent = "current",
220
+ children,
221
+ ...others
222
+ }) => {
223
+ const child = import_react5.Children.only(children);
224
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
225
+ (0, import_react5.cloneElement)(child, {
226
+ className: iconStyles({ className, size, intent }),
227
+ "data-spark-component": "icon",
228
+ "aria-hidden": "true",
229
+ focusable: "false",
230
+ ...others
231
+ }),
232
+ label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(VisuallyHidden, { children: label })
233
+ ] });
234
+ };
235
+ Icon.displayName = "Icon";
236
+
237
+ // src/form-field/FormFieldMessage.tsx
238
+ var import_class_variance_authority3 = require("class-variance-authority");
239
+ var import_react6 = require("react");
240
+ var import_jsx_runtime6 = require("react/jsx-runtime");
241
+ var FormFieldMessage = ({
242
+ id: idProp,
243
+ className,
244
+ ref,
245
+ ...others
246
+ }) => {
247
+ const { onMessageIdAdd, onMessageIdRemove } = useFormField();
248
+ const currentId = `${ID_PREFIX}-message-${(0, import_react6.useId)()}`;
249
+ const id = idProp || currentId;
250
+ (0, import_react6.useEffect)(() => {
251
+ onMessageIdAdd(id);
252
+ return () => {
253
+ onMessageIdRemove(id);
254
+ };
255
+ }, [id, onMessageIdAdd, onMessageIdRemove]);
256
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
257
+ "span",
258
+ {
259
+ ref,
260
+ id,
261
+ "data-spark-component": "form-field-message",
262
+ className: (0, import_class_variance_authority3.cx)(className, "text-caption"),
263
+ ...others
264
+ }
265
+ );
266
+ };
267
+ FormFieldMessage.displayName = "FormField.Message";
268
+
269
+ // src/form-field/FormFieldStateMessage.tsx
270
+ var import_jsx_runtime7 = require("react/jsx-runtime");
271
+ var FormFieldStateMessage = ({
272
+ className,
273
+ state,
274
+ children,
275
+ ref,
276
+ ...others
277
+ }) => {
278
+ const field = useFormField();
279
+ if (field.state !== state) {
280
+ return null;
281
+ }
282
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
283
+ FormFieldMessage,
284
+ {
285
+ ref,
286
+ "data-spark-component": "form-field-state-message",
287
+ className: (0, import_class_variance_authority4.cx)(
288
+ "gap-sm flex items-center",
289
+ state === "error" ? "text-error" : "text-on-surface/dim-1",
290
+ className
291
+ ),
292
+ ...others,
293
+ children: [
294
+ state === "alert" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_WarningOutline.WarningOutline, {}) }),
295
+ state === "error" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", intent: "error", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_AlertOutline.AlertOutline, {}) }),
296
+ state === "success" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Check.Check, {}) }),
297
+ children
298
+ ]
299
+ }
300
+ );
301
+ };
302
+ FormFieldStateMessage.displayName = "FormField.StateMessage";
303
+
304
+ // src/form-field/FormFieldAlertMessage.tsx
305
+ var import_jsx_runtime8 = require("react/jsx-runtime");
306
+ var FormFieldAlertMessage = ({ ref, ...props }) => {
307
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
308
+ FormFieldStateMessage,
309
+ {
310
+ ref,
311
+ "data-spark-component": "form-field-alert-message",
312
+ state: "alert",
313
+ ...props
314
+ }
315
+ );
316
+ };
317
+ FormFieldAlertMessage.displayName = "FormField.AlertMessage";
318
+
319
+ // src/form-field/FormFieldCharactersCount.tsx
320
+ var import_class_variance_authority5 = require("class-variance-authority");
321
+ var import_react7 = require("react");
322
+ var import_jsx_runtime9 = require("react/jsx-runtime");
323
+ var FormFieldCharactersCount = ({
324
+ className,
325
+ value = "",
326
+ maxLength,
327
+ description,
328
+ liveAnnouncement,
329
+ ref,
330
+ ...others
331
+ }) => {
332
+ const [throttledValue, setThrottledValue] = (0, import_react7.useState)(value);
333
+ (0, import_react7.useEffect)(() => {
334
+ const timeoutId = setTimeout(() => {
335
+ setThrottledValue(value);
336
+ }, 1e3);
337
+ return () => clearTimeout(timeoutId);
338
+ }, [value]);
339
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "ml-auto self-start", children: [
340
+ description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FormFieldMessage, { className: "default:sr-only", children: description }),
341
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
342
+ "span",
343
+ {
344
+ ref,
345
+ "aria-hidden": true,
346
+ "data-spark-component": "form-field-characters-count",
347
+ className: (0, import_class_variance_authority5.cx)(className, "text-caption", "text-neutral"),
348
+ ...others,
349
+ children: `${value.length}/${maxLength}`
350
+ }
351
+ ),
352
+ liveAnnouncement && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "sr-only", "aria-live": "polite", children: liveAnnouncement({ remainingChars: maxLength - throttledValue.length }) })
353
+ ] });
354
+ };
355
+ FormFieldCharactersCount.displayName = "FormField.CharactersCount";
356
+
357
+ // src/form-field/FormFieldControl.tsx
358
+ var import_react8 = require("react");
359
+ var import_jsx_runtime10 = require("react/jsx-runtime");
360
+ var useFormFieldControl = () => {
361
+ const { id, name, description, disabled, readOnly, state, labelId, isInvalid, isRequired } = (0, import_react8.useContext)(FormFieldContext) || {};
362
+ return {
363
+ id,
364
+ name,
365
+ description,
366
+ disabled,
367
+ readOnly,
368
+ state,
369
+ labelId,
370
+ isInvalid,
371
+ isRequired
372
+ };
373
+ };
374
+ var FormFieldControl = ({ children }) => {
375
+ const props = useFormFieldControl();
376
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: children(props) });
377
+ };
378
+ FormFieldControl.displayName = "FormField.Control";
379
+
380
+ // src/form-field/FormFieldErrorMessage.tsx
381
+ var import_jsx_runtime11 = require("react/jsx-runtime");
382
+ var FormFieldErrorMessage = ({ ref, ...props }) => {
383
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
384
+ FormFieldStateMessage,
385
+ {
386
+ ref,
387
+ "data-spark-component": "form-field-error-message",
388
+ state: "error",
389
+ ...props
390
+ }
391
+ );
392
+ };
393
+ FormFieldErrorMessage.displayName = "FormField.ErrorMessage";
394
+
395
+ // src/form-field/FormFieldHelperMessage.tsx
396
+ var import_class_variance_authority6 = require("class-variance-authority");
397
+ var import_jsx_runtime12 = require("react/jsx-runtime");
398
+ var FormFieldHelperMessage = ({
399
+ className,
400
+ ref,
401
+ ...others
402
+ }) => {
403
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
404
+ FormFieldMessage,
405
+ {
406
+ ref,
407
+ "data-spark-component": "form-field-helper-message",
408
+ className: (0, import_class_variance_authority6.cx)("text-on-surface/dim-1", className),
409
+ ...others
410
+ }
411
+ );
412
+ };
413
+ FormFieldHelperMessage.displayName = "FormField.HelperMessage";
414
+
415
+ // src/form-field/FormFieldLabel.tsx
416
+ var import_class_variance_authority10 = require("class-variance-authority");
417
+
418
+ // src/label/Label.tsx
419
+ var import_class_variance_authority7 = require("class-variance-authority");
420
+ var import_radix_ui2 = require("radix-ui");
421
+ var import_jsx_runtime13 = require("react/jsx-runtime");
422
+ var Label = ({ className, ref, ...others }) => {
423
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
424
+ import_radix_ui2.Label.Label,
425
+ {
426
+ ref,
427
+ "data-spark-component": "label",
428
+ className: (0, import_class_variance_authority7.cx)("text-body-1", className),
429
+ ...others
430
+ }
431
+ );
432
+ };
433
+ Label.displayName = "Label";
434
+
435
+ // src/label/LabelRequiredIndicator.tsx
436
+ var import_class_variance_authority8 = require("class-variance-authority");
437
+ var import_jsx_runtime14 = require("react/jsx-runtime");
438
+ var LabelRequiredIndicator = ({
439
+ className,
440
+ children = "*",
441
+ ref,
442
+ ...others
443
+ }) => {
444
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
445
+ "span",
446
+ {
447
+ ref,
448
+ "data-spark-component": "label-required-indicator",
449
+ role: "presentation",
450
+ "aria-hidden": "true",
451
+ className: (0, import_class_variance_authority8.cx)(className, "text-caption text-on-surface/dim-1"),
452
+ ...others,
453
+ children
454
+ }
455
+ );
456
+ };
457
+ LabelRequiredIndicator.displayName = "Label.RequiredIndicator";
458
+
459
+ // src/label/index.ts
460
+ var Label2 = Object.assign(Label, {
461
+ RequiredIndicator: LabelRequiredIndicator
462
+ });
463
+ Label2.displayName = "Label";
464
+ LabelRequiredIndicator.displayName = "Label.RequiredIndicator";
465
+
466
+ // src/form-field/FormFieldRequiredIndicator.tsx
467
+ var import_class_variance_authority9 = require("class-variance-authority");
468
+ var import_jsx_runtime15 = require("react/jsx-runtime");
469
+ var FormFieldRequiredIndicator = ({
470
+ className,
471
+ ref,
472
+ ...props
473
+ }) => {
474
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Label2.RequiredIndicator, { ref, className: (0, import_class_variance_authority9.cx)("ml-sm", className), ...props });
475
+ };
476
+ FormFieldRequiredIndicator.displayName = "FormField.RequiredIndicator";
477
+
478
+ // src/form-field/FormFieldLabel.tsx
479
+ var import_jsx_runtime16 = require("react/jsx-runtime");
480
+ var FormFieldLabel = ({
481
+ htmlFor: htmlForProp,
482
+ className,
483
+ children,
484
+ requiredIndicator = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormFieldRequiredIndicator, {}),
485
+ asChild,
486
+ ref,
487
+ ...others
488
+ }) => {
489
+ const control = useFormField();
490
+ const { disabled, labelId, isRequired } = control;
491
+ const htmlFor = asChild ? void 0 : htmlForProp || control.id;
492
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
493
+ Label2,
494
+ {
495
+ ref,
496
+ id: labelId,
497
+ "data-spark-component": "form-field-label",
498
+ htmlFor,
499
+ className: (0, import_class_variance_authority10.cx)(className, disabled ? "text-on-surface/dim-3 pointer-events-none" : void 0),
500
+ asChild,
501
+ ...others,
502
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
503
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Slottable, { children }),
504
+ isRequired && requiredIndicator
505
+ ] })
506
+ }
507
+ );
508
+ };
509
+ FormFieldLabel.displayName = "FormField.Label";
510
+
511
+ // src/form-field/FormFieldSuccessMessage.tsx
512
+ var import_jsx_runtime17 = require("react/jsx-runtime");
513
+ var FormFieldSuccessMessage = ({ ref, ...props }) => {
514
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
515
+ FormFieldStateMessage,
516
+ {
517
+ ref,
518
+ "data-spark-component": "form-field-success-message",
519
+ state: "success",
520
+ ...props
521
+ }
522
+ );
523
+ };
524
+ FormFieldSuccessMessage.displayName = "FormField.SuccessMessage";
525
+
526
+ // src/form-field/index.ts
527
+ var FormField2 = Object.assign(FormField, {
528
+ Label: FormFieldLabel,
529
+ Control: FormFieldControl,
530
+ StateMessage: FormFieldStateMessage,
531
+ SuccessMessage: FormFieldSuccessMessage,
532
+ AlertMessage: FormFieldAlertMessage,
533
+ ErrorMessage: FormFieldErrorMessage,
534
+ HelperMessage: FormFieldHelperMessage,
535
+ RequiredIndicator: FormFieldRequiredIndicator,
536
+ CharactersCount: FormFieldCharactersCount
537
+ });
538
+ FormField2.displayName = "FormField";
539
+ FormFieldLabel.displayName = "FormField.Label";
540
+ FormFieldControl.displayName = "FormField.Control";
541
+ FormFieldStateMessage.displayName = "FormField.StateMessage";
542
+ FormFieldSuccessMessage.displayName = "FormField.SuccessMessage";
543
+ FormFieldAlertMessage.displayName = "FormField.AlertMessage";
544
+ FormFieldErrorMessage.displayName = "FormField.ErrorMessage";
545
+ FormFieldHelperMessage.displayName = "FormField.HelperMessage";
546
+ FormFieldRequiredIndicator.displayName = "FormField.RequiredIndicator";
547
+ FormFieldCharactersCount.displayName = "FormField.CharactersCount";
548
+ // Annotate the CommonJS export names for ESM import in node:
549
+ 0 && (module.exports = {
550
+ FormField,
551
+ useFormFieldControl
552
+ });
553
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/form-field/index.ts","../../src/form-field/FormField.tsx","../../src/slot/Slot.tsx","../../src/form-field/FormFieldContext.tsx","../../src/form-field/FormFieldProvider.tsx","../../src/form-field/FormFieldStateMessage.tsx","../../src/icon/Icon.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx","../../src/form-field/FormFieldMessage.tsx","../../src/form-field/FormFieldAlertMessage.tsx","../../src/form-field/FormFieldCharactersCount.tsx","../../src/form-field/FormFieldControl.tsx","../../src/form-field/FormFieldErrorMessage.tsx","../../src/form-field/FormFieldHelperMessage.tsx","../../src/form-field/FormFieldLabel.tsx","../../src/label/Label.tsx","../../src/label/LabelRequiredIndicator.tsx","../../src/label/index.ts","../../src/form-field/FormFieldRequiredIndicator.tsx","../../src/form-field/FormFieldSuccessMessage.tsx"],"sourcesContent":["import { FormField as Root } from './FormField'\nimport { FormFieldAlertMessage } from './FormFieldAlertMessage'\nimport { FormFieldCharactersCount } from './FormFieldCharactersCount'\nimport { FormFieldControl } from './FormFieldControl'\nimport { FormFieldErrorMessage } from './FormFieldErrorMessage'\nimport { FormFieldHelperMessage } from './FormFieldHelperMessage'\nimport { FormFieldLabel } from './FormFieldLabel'\nimport { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'\nimport { FormFieldStateMessage } from './FormFieldStateMessage'\nimport { FormFieldSuccessMessage } from './FormFieldSuccessMessage'\n\nexport const FormField: typeof Root & {\n Label: typeof FormFieldLabel\n Control: typeof FormFieldControl\n StateMessage: typeof FormFieldStateMessage\n SuccessMessage: typeof FormFieldSuccessMessage\n AlertMessage: typeof FormFieldAlertMessage\n ErrorMessage: typeof FormFieldErrorMessage\n HelperMessage: typeof FormFieldHelperMessage\n RequiredIndicator: typeof FormFieldRequiredIndicator\n CharactersCount: typeof FormFieldCharactersCount\n} = Object.assign(Root, {\n Label: FormFieldLabel,\n Control: FormFieldControl,\n StateMessage: FormFieldStateMessage,\n SuccessMessage: FormFieldSuccessMessage,\n AlertMessage: FormFieldAlertMessage,\n ErrorMessage: FormFieldErrorMessage,\n HelperMessage: FormFieldHelperMessage,\n RequiredIndicator: FormFieldRequiredIndicator,\n CharactersCount: FormFieldCharactersCount,\n})\n\nFormField.displayName = 'FormField'\nFormFieldLabel.displayName = 'FormField.Label'\nFormFieldControl.displayName = 'FormField.Control'\nFormFieldStateMessage.displayName = 'FormField.StateMessage'\nFormFieldSuccessMessage.displayName = 'FormField.SuccessMessage'\nFormFieldAlertMessage.displayName = 'FormField.AlertMessage'\nFormFieldErrorMessage.displayName = 'FormField.ErrorMessage'\nFormFieldHelperMessage.displayName = 'FormField.HelperMessage'\nFormFieldRequiredIndicator.displayName = 'FormField.RequiredIndicator'\nFormFieldCharactersCount.displayName = 'FormField.CharactersCount'\n\nexport { type FormFieldProps } from './FormField'\nexport { type FormFieldStateMessageProps } from './FormFieldStateMessage'\nexport { type FormFieldControl, useFormFieldControl } from './FormFieldControl'\nexport { type FormFieldHelperMessageProps } from './FormFieldHelperMessage'\nexport { type FormFieldSuccessMessageProps } from './FormFieldSuccessMessage'\nexport { type FormFieldAlertMessageProps } from './FormFieldAlertMessage'\nexport { type FormFieldErrorMessageProps } from './FormFieldErrorMessage'\nexport { type FormFieldLabelProps } from './FormFieldLabel'\nexport { type FormFieldRequiredIndicatorProps } from './FormFieldRequiredIndicator'\nexport { type FormFieldCharactersCountProps } from './FormFieldCharactersCount'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useId } from 'react'\n\nimport { Slot } from '../slot'\nimport { FormFieldContextState, ID_PREFIX } from './FormFieldContext'\nimport { FormFieldProvider } from './FormFieldProvider'\n\nexport interface FormFieldProps\n extends ComponentPropsWithoutRef<'div'>,\n Pick<FormFieldContextState, 'name' | 'state' | 'isRequired'> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n */\n asChild?: boolean\n /**\n * When `true`, prevents the user from interacting.\n */\n disabled?: boolean\n /**\n * Sets the component as interactive or not.\n */\n readOnly?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const FormField = ({\n className,\n disabled = false,\n readOnly = false,\n name,\n state,\n isRequired = false,\n asChild = false,\n ref,\n ...others\n}: FormFieldProps) => {\n const id = `${ID_PREFIX}-${useId()}`\n const Component = asChild ? Slot : 'div'\n\n return (\n <FormFieldProvider\n id={id}\n name={name}\n isRequired={isRequired}\n disabled={disabled}\n readOnly={readOnly}\n state={state}\n >\n <Component\n ref={ref}\n data-spark-component=\"form-field\"\n className={cx(className, 'gap-sm flex flex-col')}\n {...others}\n />\n </FormFieldProvider>\n )\n}\n\nFormField.displayName = 'FormField'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { createContext, useContext } from 'react'\n\nexport interface FormFieldContextState {\n /**\n * Generated id for the input component.\n */\n id: string\n /**\n * Generated id for the label component.\n */\n labelId?: string\n /**\n * The name of the input. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * A set of ids separated by a space used to describe the input component given by a set of messages.\n */\n description?: string\n /**\n * Disables the field and its associated input\n */\n disabled?: boolean\n /**\n * Marks the field and its associated input as read only\n */\n readOnly?: boolean\n /**\n * The validation state of the input.\n */\n state?: 'error' | 'success' | 'alert'\n /**\n * If true, the form field will be invalid.\n */\n isInvalid?: boolean\n /**\n * If true, the form field will be required.\n */\n isRequired?: boolean\n /**\n * Callback used to store a descriptive message.\n */\n onMessageIdAdd: (id: string) => void\n /**\n * Callback used to remove a descriptive message.\n */\n onMessageIdRemove: (id: string) => void\n}\n\nexport const FormFieldContext = createContext<FormFieldContextState | null>(null)\n\nexport const ID_PREFIX = ':form-field'\n\nexport const useFormField = () => {\n const context = useContext(FormFieldContext)\n\n if (!context) {\n throw Error('useFormField must be used within a FormField provider')\n }\n\n return context\n}\n","import { ReactNode, useCallback, useId, useMemo, useState } from 'react'\n\nimport { FormFieldContext, FormFieldContextState, ID_PREFIX } from './FormFieldContext'\n\nexport interface FormFieldProviderProps\n extends Pick<\n FormFieldContextState,\n 'id' | 'name' | 'disabled' | 'readOnly' | 'state' | 'isRequired'\n > {\n children: ReactNode\n}\n\nexport const FormFieldProvider = ({\n id,\n name,\n disabled = false,\n readOnly = false,\n state,\n isRequired,\n children,\n}: FormFieldProviderProps) => {\n const labelId = `${ID_PREFIX}-label-${useId()}`\n const [messageIds, setMessageIds] = useState<string[]>([])\n const description = messageIds.length > 0 ? messageIds.join(' ') : undefined\n\n const handleMessageIdAdd = useCallback((msgId: string) => {\n setMessageIds(ids => [...ids, msgId])\n }, [])\n\n const handleMessageIdRemove = useCallback((msgId: string) => {\n setMessageIds(ids => ids.filter(current => current !== msgId))\n }, [])\n\n const value = useMemo(() => {\n const isInvalid = state === 'error'\n\n return {\n id,\n labelId,\n name,\n disabled,\n readOnly,\n state,\n isRequired,\n isInvalid,\n description,\n onMessageIdAdd: handleMessageIdAdd,\n onMessageIdRemove: handleMessageIdRemove,\n }\n }, [\n id,\n labelId,\n name,\n disabled,\n readOnly,\n description,\n state,\n isRequired,\n handleMessageIdAdd,\n handleMessageIdRemove,\n ])\n\n return <FormFieldContext.Provider value={value}>{children}</FormFieldContext.Provider>\n}\n\nFormFieldProvider.displayName = 'FormFieldProvider'\n","import { AlertOutline } from '@spark-ui/icons/AlertOutline'\nimport { Check } from '@spark-ui/icons/Check'\nimport { WarningOutline } from '@spark-ui/icons/WarningOutline'\nimport { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { useFormField } from './FormFieldContext'\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport interface FormFieldStateMessageProps extends FormFieldMessageProps {\n state: 'error' | 'alert' | 'success'\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldStateMessage = ({\n className,\n state,\n children,\n ref,\n ...others\n}: FormFieldStateMessageProps) => {\n const field = useFormField()\n\n if (field.state !== state) {\n return null\n }\n\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-state-message\"\n className={cx(\n 'gap-sm flex items-center',\n state === 'error' ? 'text-error' : 'text-on-surface/dim-1',\n className\n )}\n {...others}\n >\n {state === 'alert' && (\n <Icon size=\"sm\">\n <WarningOutline />\n </Icon>\n )}\n {state === 'error' && (\n <Icon size=\"sm\" intent=\"error\">\n <AlertOutline />\n </Icon>\n )}\n {state === 'success' && (\n <Icon size=\"sm\">\n <Check />\n </Icon>\n )}\n\n {children}\n </FormFieldMessage>\n )\n}\n\nFormFieldStateMessage.displayName = 'FormField.StateMessage'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useId } from 'react'\n\nimport { ID_PREFIX, useFormField } from './FormFieldContext'\n\nexport type FormFieldMessageProps = ComponentPropsWithoutRef<'span'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldMessage = ({\n id: idProp,\n className,\n ref,\n ...others\n}: FormFieldMessageProps) => {\n const { onMessageIdAdd, onMessageIdRemove } = useFormField()\n const currentId = `${ID_PREFIX}-message-${useId()}`\n const id = idProp || currentId\n\n useEffect(() => {\n onMessageIdAdd(id)\n\n return () => {\n onMessageIdRemove(id)\n }\n }, [id, onMessageIdAdd, onMessageIdRemove])\n\n return (\n <span\n ref={ref}\n id={id}\n data-spark-component=\"form-field-message\"\n className={cx(className, 'text-caption')}\n {...others}\n />\n )\n}\n\nFormFieldMessage.displayName = 'FormField.Message'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldAlertMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldAlertMessage = ({ ref, ...props }: FormFieldAlertMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-alert-message\"\n state=\"alert\"\n {...props}\n />\n )\n}\n\nFormFieldAlertMessage.displayName = 'FormField.AlertMessage'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useState } from 'react'\n\nimport { FormFieldMessage } from './FormFieldMessage'\n\nexport type FormFieldCharactersCountProps = ComponentPropsWithoutRef<'span'> & {\n /**\n * This description is for the screen reader, read when the input is focused.\n */\n description?: string\n /**\n * The live announcement is for the screen read after a delay once the input value changes.\n */\n liveAnnouncement?: ({ remainingChars }: { remainingChars: number }) => string\n /**\n * Current value for the input this component belongs to.\n */\n value?: string\n /**\n * Maximum numeric value to be displayed.\n */\n maxLength: number\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldCharactersCount = ({\n className,\n value = '',\n maxLength,\n description,\n liveAnnouncement,\n ref,\n ...others\n}: FormFieldCharactersCountProps) => {\n const [throttledValue, setThrottledValue] = useState(value)\n\n /**\n * The value is throttled to avoid spamming the aria-live region (and consequently the screen reader).\n */\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n setThrottledValue(value)\n }, 1000)\n\n return () => clearTimeout(timeoutId)\n }, [value])\n\n return (\n <span className=\"ml-auto self-start\">\n {description && (\n <FormFieldMessage className=\"default:sr-only\">{description}</FormFieldMessage>\n )}\n <span\n ref={ref}\n aria-hidden\n data-spark-component=\"form-field-characters-count\"\n className={cx(className, 'text-caption', 'text-neutral')}\n {...others}\n >\n {`${value.length}/${maxLength}`}\n </span>\n\n {liveAnnouncement && (\n <span className=\"sr-only\" aria-live=\"polite\">\n {liveAnnouncement({ remainingChars: maxLength - throttledValue.length })}\n </span>\n )}\n </span>\n )\n}\n\nFormFieldCharactersCount.displayName = 'FormField.CharactersCount'\n","import { ReactNode, useContext } from 'react'\n\nimport { FormFieldContext, FormFieldContextState } from './FormFieldContext'\n\ntype State = Partial<\n Pick<\n FormFieldContextState,\n | 'id'\n | 'name'\n | 'description'\n | 'labelId'\n | 'disabled'\n | 'readOnly'\n | 'state'\n | 'isInvalid'\n | 'isRequired'\n >\n>\n\nexport interface FormFieldControlProps {\n children: (state: State) => ReactNode\n}\n\nexport const useFormFieldControl = () => {\n const { id, name, description, disabled, readOnly, state, labelId, isInvalid, isRequired } =\n useContext(FormFieldContext) || {}\n\n return {\n id,\n name,\n description,\n disabled,\n readOnly,\n state,\n labelId,\n isInvalid,\n isRequired,\n } as State\n}\n\nexport const FormFieldControl = ({ children }: FormFieldControlProps) => {\n const props = useFormFieldControl()\n\n return <>{children(props)}</>\n}\n\nFormFieldControl.displayName = 'FormField.Control'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldErrorMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldErrorMessage = ({ ref, ...props }: FormFieldErrorMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-error-message\"\n state=\"error\"\n {...props}\n />\n )\n}\n\nFormFieldErrorMessage.displayName = 'FormField.ErrorMessage'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport type FormFieldHelperMessageProps = FormFieldMessageProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldHelperMessage = ({\n className,\n ref,\n ...others\n}: FormFieldHelperMessageProps) => {\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-helper-message\"\n className={cx('text-on-surface/dim-1', className)}\n {...others}\n />\n )\n}\n\nFormFieldHelperMessage.displayName = 'FormField.HelperMessage'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode, Ref } from 'react'\n\nimport { Label, LabelProps } from '../label'\nimport { Slottable } from '../slot'\nimport { useFormField } from './FormFieldContext'\nimport { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'\n\nexport interface FormFieldLabelProps extends LabelProps {\n /**\n * Element shown when the input is required inside the label.\n */\n requiredIndicator?: ReactNode\n ref?: Ref<HTMLLabelElement>\n}\n\nexport const FormFieldLabel = ({\n htmlFor: htmlForProp,\n className,\n children,\n requiredIndicator = <FormFieldRequiredIndicator />,\n asChild,\n ref,\n ...others\n}: FormFieldLabelProps) => {\n const control = useFormField()\n\n const { disabled, labelId, isRequired } = control\n const htmlFor = asChild ? undefined : htmlForProp || control.id\n\n return (\n <Label\n ref={ref}\n id={labelId}\n data-spark-component=\"form-field-label\"\n htmlFor={htmlFor}\n className={cx(className, disabled ? 'text-on-surface/dim-3 pointer-events-none' : undefined)}\n asChild={asChild}\n {...others}\n >\n <>\n <Slottable>{children}</Slottable>\n {isRequired && requiredIndicator}\n </>\n </Label>\n )\n}\n\nFormFieldLabel.displayName = 'FormField.Label'\n","import { cx } from 'class-variance-authority'\nimport { Label as RadixLabel } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type LabelProps = RadixLabel.LabelProps & {\n ref?: Ref<HTMLLabelElement>\n}\n\nexport const Label = ({ className, ref, ...others }: LabelProps) => {\n return (\n <RadixLabel.Label\n ref={ref}\n data-spark-component=\"label\"\n className={cx('text-body-1', className)}\n {...others}\n />\n )\n}\n\nLabel.displayName = 'Label'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithRef } from 'react'\n\nexport type LabelRequiredIndicatorProps = ComponentPropsWithRef<'span'>\n\nexport const LabelRequiredIndicator = ({\n className,\n children = '*',\n ref,\n ...others\n}: LabelRequiredIndicatorProps) => {\n return (\n <span\n ref={ref}\n data-spark-component=\"label-required-indicator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cx(className, 'text-caption text-on-surface/dim-1')}\n {...others}\n >\n {children}\n </span>\n )\n}\n\nLabelRequiredIndicator.displayName = 'Label.RequiredIndicator'\n","import { Label as Root } from './Label'\nimport { LabelRequiredIndicator } from './LabelRequiredIndicator'\n\nexport const Label: typeof Root & {\n RequiredIndicator: typeof LabelRequiredIndicator\n} = Object.assign(Root, {\n RequiredIndicator: LabelRequiredIndicator,\n})\n\nLabel.displayName = 'Label'\nLabelRequiredIndicator.displayName = 'Label.RequiredIndicator'\n\nexport type { LabelProps } from './Label'\nexport type { LabelRequiredIndicatorProps } from './LabelRequiredIndicator'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Label, LabelRequiredIndicatorProps } from '../label'\n\nexport type FormFieldRequiredIndicatorProps = LabelRequiredIndicatorProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldRequiredIndicator = ({\n className,\n ref,\n ...props\n}: FormFieldRequiredIndicatorProps) => {\n return <Label.RequiredIndicator ref={ref} className={cx('ml-sm', className)} {...props} />\n}\n\nFormFieldRequiredIndicator.displayName = 'FormField.RequiredIndicator'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldSuccessMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldSuccessMessage = ({ ref, ...props }: FormFieldSuccessMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-success-message\"\n state=\"success\"\n {...props}\n />\n )\n}\n\nFormFieldSuccessMessage.displayName = 'FormField.SuccessMessage'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACAA,sCAAmB;AACnB,IAAAC,gBAAqD;;;ACDrD,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAC,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,MAAiB;AACpD,SAAO,4CAAC,gBAAAA,KAAU,MAAV,EAAe,KAAW,GAAG,OAAO;AAC9C;;;AClBA,IAAAC,gBAA0C;AAiDnC,IAAM,uBAAmB,6BAA4C,IAAI;AAEzE,IAAM,YAAY;AAElB,IAAM,eAAe,MAAM;AAChC,QAAM,cAAU,0BAAW,gBAAgB;AAE3C,MAAI,CAAC,SAAS;AACZ,UAAM,MAAM,uDAAuD;AAAA,EACrE;AAEA,SAAO;AACT;;;AC7DA,IAAAC,gBAAiE;AA8DxD,IAAAC,sBAAA;AAlDF,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,UAAU,GAAG,SAAS,cAAU,qB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BAAyB,cAAc;","names":["FormField","import_react","RadixSlot","import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_class_variance_authority","import_radix_ui","import_jsx_runtime","RadixLabel","import_class_variance_authority","import_jsx_runtime","Label","import_class_variance_authority","import_jsx_runtime","Label","import_jsx_runtime","Label","import_jsx_runtime","FormField"]}
@@ -0,0 +1,28 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare const iconStyles: (props?: ({
7
+ intent?: "main" | "current" | "alert" | "error" | "support" | "accent" | "basic" | "success" | "info" | "neutral" | null | undefined;
8
+ size?: "current" | "sm" | "md" | "lg" | "xl" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ type IconVariantsProps = VariantProps<typeof iconStyles>;
11
+
12
+ interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {
13
+ /**
14
+ * The svg icon that will be wrapped
15
+ */
16
+ children: ReactNode;
17
+ /**
18
+ * The accessible label for the icon. This label will be visually hidden but announced to screen
19
+ * reader users, similar to `alt` text for `img` tags.
20
+ */
21
+ label?: string;
22
+ }
23
+ declare const Icon: {
24
+ ({ label, className, size, intent, children, ...others }: IconProps): react_jsx_runtime.JSX.Element;
25
+ displayName: string;
26
+ };
27
+
28
+ export { Icon, type IconProps };