@spark-ui/components 10.0.1 → 10.0.3

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 (45) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/checkbox/index.js +115 -476
  3. package/dist/checkbox/index.js.map +1 -1
  4. package/dist/checkbox/index.mjs +3 -4
  5. package/dist/checkbox/index.mjs.map +1 -1
  6. package/dist/{chunk-JKNBJHD5.mjs → chunk-7BTJUYP3.mjs} +6 -5
  7. package/dist/chunk-7BTJUYP3.mjs.map +1 -0
  8. package/dist/combobox/index.js +298 -707
  9. package/dist/combobox/index.js.map +1 -1
  10. package/dist/combobox/index.mjs +3 -5
  11. package/dist/combobox/index.mjs.map +1 -1
  12. package/dist/dropdown/index.js +251 -661
  13. package/dist/dropdown/index.js.map +1 -1
  14. package/dist/dropdown/index.mjs +1 -4
  15. package/dist/dropdown/index.mjs.map +1 -1
  16. package/dist/form-field/index.mjs +373 -7
  17. package/dist/form-field/index.mjs.map +1 -1
  18. package/dist/input/index.js +46 -453
  19. package/dist/input/index.js.map +1 -1
  20. package/dist/input/index.mjs +1 -3
  21. package/dist/radio-group/index.js +46 -552
  22. package/dist/radio-group/index.js.map +1 -1
  23. package/dist/radio-group/index.mjs +3 -9
  24. package/dist/radio-group/index.mjs.map +1 -1
  25. package/dist/select/index.js +158 -568
  26. package/dist/select/index.js.map +1 -1
  27. package/dist/select/index.mjs +1 -4
  28. package/dist/select/index.mjs.map +1 -1
  29. package/dist/stepper/index.js +108 -514
  30. package/dist/stepper/index.js.map +1 -1
  31. package/dist/stepper/index.mjs +2 -5
  32. package/dist/stepper/index.mjs.map +1 -1
  33. package/dist/switch/index.js +94 -543
  34. package/dist/switch/index.js.map +1 -1
  35. package/dist/switch/index.mjs +3 -6
  36. package/dist/switch/index.mjs.map +1 -1
  37. package/dist/textarea/index.js +57 -464
  38. package/dist/textarea/index.js.map +1 -1
  39. package/dist/textarea/index.mjs +1 -3
  40. package/dist/textarea/index.mjs.map +1 -1
  41. package/package.json +16 -6
  42. package/tsup.config.ts +2 -1
  43. package/dist/chunk-7PMPYEHJ.mjs +0 -379
  44. package/dist/chunk-7PMPYEHJ.mjs.map +0 -1
  45. package/dist/chunk-JKNBJHD5.mjs.map +0 -1
@@ -25,8 +25,8 @@ __export(radio_group_exports, {
25
25
  module.exports = __toCommonJS(radio_group_exports);
26
26
 
27
27
  // src/radio-group/Radio.tsx
28
- var import_class_variance_authority14 = require("class-variance-authority");
29
- var import_react9 = require("react");
28
+ var import_class_variance_authority4 = require("class-variance-authority");
29
+ var import_react2 = require("react");
30
30
 
31
31
  // src/radio-group/RadioGroupContext.tsx
32
32
  var import_react = require("react");
@@ -40,523 +40,16 @@ var useRadioGroup = () => {
40
40
  };
41
41
 
42
42
  // src/radio-group/RadioInput.tsx
43
- var import_radix_ui4 = require("radix-ui");
44
-
45
- // src/form-field/FormField.tsx
46
- var import_class_variance_authority = require("class-variance-authority");
47
- var import_react5 = require("react");
48
-
49
- // src/slot/Slot.tsx
50
- var import_radix_ui = require("radix-ui");
51
- var import_react2 = require("react");
52
- var import_jsx_runtime = require("react/jsx-runtime");
53
- var Slottable = import_radix_ui.Slot.Slottable;
54
- var Slot = ({ ref, ...props }) => {
55
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
56
- };
57
-
58
- // src/form-field/FormFieldContext.tsx
59
- var import_react3 = require("react");
60
- var FormFieldContext = (0, import_react3.createContext)(null);
61
- var ID_PREFIX = ":form-field";
62
- var useFormField = () => {
63
- const context = (0, import_react3.useContext)(FormFieldContext);
64
- if (!context) {
65
- throw Error("useFormField must be used within a FormField provider");
66
- }
67
- return context;
68
- };
69
-
70
- // src/form-field/FormFieldProvider.tsx
71
- var import_react4 = require("react");
72
- var import_jsx_runtime2 = require("react/jsx-runtime");
73
- var FormFieldProvider = ({
74
- id,
75
- name,
76
- disabled = false,
77
- readOnly = false,
78
- state,
79
- isRequired,
80
- children
81
- }) => {
82
- const labelId = `${ID_PREFIX}-label-${(0, import_react4.useId)()}`;
83
- const [messageIds, setMessageIds] = (0, import_react4.useState)([]);
84
- const description = messageIds.length > 0 ? messageIds.join(" ") : void 0;
85
- const handleMessageIdAdd = (0, import_react4.useCallback)((msgId) => {
86
- setMessageIds((ids) => [...ids, msgId]);
87
- }, []);
88
- const handleMessageIdRemove = (0, import_react4.useCallback)((msgId) => {
89
- setMessageIds((ids) => ids.filter((current) => current !== msgId));
90
- }, []);
91
- const value = (0, import_react4.useMemo)(() => {
92
- const isInvalid = state === "error";
93
- return {
94
- id,
95
- labelId,
96
- name,
97
- disabled,
98
- readOnly,
99
- state,
100
- isRequired,
101
- isInvalid,
102
- description,
103
- onMessageIdAdd: handleMessageIdAdd,
104
- onMessageIdRemove: handleMessageIdRemove
105
- };
106
- }, [
107
- id,
108
- labelId,
109
- name,
110
- disabled,
111
- readOnly,
112
- description,
113
- state,
114
- isRequired,
115
- handleMessageIdAdd,
116
- handleMessageIdRemove
117
- ]);
118
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FormFieldContext.Provider, { value, children });
119
- };
120
- FormFieldProvider.displayName = "FormFieldProvider";
121
-
122
- // src/form-field/FormField.tsx
123
- var import_jsx_runtime3 = require("react/jsx-runtime");
124
- var FormField = ({
125
- className,
126
- disabled = false,
127
- readOnly = false,
128
- name,
129
- state,
130
- isRequired = false,
131
- asChild = false,
132
- ref,
133
- ...others
134
- }) => {
135
- const id = `${ID_PREFIX}-${(0, import_react5.useId)()}`;
136
- const Component = asChild ? Slot : "div";
137
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
138
- FormFieldProvider,
139
- {
140
- id,
141
- name,
142
- isRequired,
143
- disabled,
144
- readOnly,
145
- state,
146
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
147
- Component,
148
- {
149
- ref,
150
- "data-spark-component": "form-field",
151
- className: (0, import_class_variance_authority.cx)(className, "gap-sm flex flex-col"),
152
- ...others
153
- }
154
- )
155
- }
156
- );
157
- };
158
- FormField.displayName = "FormField";
159
-
160
- // src/form-field/FormFieldStateMessage.tsx
161
- var import_AlertOutline = require("@spark-ui/icons/AlertOutline");
162
- var import_Check = require("@spark-ui/icons/Check");
163
- var import_WarningOutline = require("@spark-ui/icons/WarningOutline");
164
- var import_class_variance_authority4 = require("class-variance-authority");
165
-
166
- // src/icon/Icon.tsx
167
- var import_react6 = require("react");
168
-
169
- // src/visually-hidden/VisuallyHidden.tsx
170
- var import_jsx_runtime4 = require("react/jsx-runtime");
171
- var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
172
- const Component = asChild ? Slot : "span";
173
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
174
- Component,
175
- {
176
- ...props,
177
- ref,
178
- style: {
179
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
180
- position: "absolute",
181
- border: 0,
182
- width: 1,
183
- height: 1,
184
- padding: 0,
185
- margin: -1,
186
- overflow: "hidden",
187
- clip: "rect(0, 0, 0, 0)",
188
- whiteSpace: "nowrap",
189
- wordWrap: "normal",
190
- ...props.style
191
- }
192
- }
193
- );
194
- };
195
- VisuallyHidden.displayName = "VisuallyHidden";
196
-
197
- // src/icon/Icon.styles.tsx
198
- var import_internal_utils = require("@spark-ui/internal-utils");
199
- var import_class_variance_authority2 = require("class-variance-authority");
200
- var iconStyles = (0, import_class_variance_authority2.cva)(["fill-current shrink-0"], {
201
- variants: {
202
- /**
203
- * Color scheme of the icon.
204
- */
205
- intent: (0, import_internal_utils.makeVariants)({
206
- current: ["text-current"],
207
- main: ["text-main"],
208
- support: ["text-support"],
209
- accent: ["text-accent"],
210
- basic: ["text-basic"],
211
- success: ["text-success"],
212
- alert: ["text-alert"],
213
- error: ["text-error"],
214
- info: ["text-info"],
215
- neutral: ["text-neutral"]
216
- }),
217
- /**
218
- * Sets the size of the icon.
219
- */
220
- size: (0, import_internal_utils.makeVariants)({
221
- current: ["u-current-font-size"],
222
- sm: ["w-sz-16", "h-sz-16"],
223
- md: ["w-sz-24", "h-sz-24"],
224
- lg: ["w-sz-32", "h-sz-32"],
225
- xl: ["w-sz-40", "h-sz-40"]
226
- })
227
- }
228
- });
229
-
230
- // src/icon/Icon.tsx
231
- var import_jsx_runtime5 = require("react/jsx-runtime");
232
- var Icon = ({
233
- label,
234
- className,
235
- size = "current",
236
- intent = "current",
237
- children,
238
- ...others
239
- }) => {
240
- const child = import_react6.Children.only(children);
241
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
242
- (0, import_react6.cloneElement)(child, {
243
- className: iconStyles({ className, size, intent }),
244
- "data-spark-component": "icon",
245
- "aria-hidden": "true",
246
- focusable: "false",
247
- ...others
248
- }),
249
- label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(VisuallyHidden, { children: label })
250
- ] });
251
- };
252
- Icon.displayName = "Icon";
253
-
254
- // src/form-field/FormFieldMessage.tsx
255
- var import_class_variance_authority3 = require("class-variance-authority");
256
- var import_react7 = require("react");
257
- var import_jsx_runtime6 = require("react/jsx-runtime");
258
- var FormFieldMessage = ({
259
- id: idProp,
260
- className,
261
- ref,
262
- ...others
263
- }) => {
264
- const { onMessageIdAdd, onMessageIdRemove } = useFormField();
265
- const currentId = `${ID_PREFIX}-message-${(0, import_react7.useId)()}`;
266
- const id = idProp || currentId;
267
- (0, import_react7.useEffect)(() => {
268
- onMessageIdAdd(id);
269
- return () => {
270
- onMessageIdRemove(id);
271
- };
272
- }, [id, onMessageIdAdd, onMessageIdRemove]);
273
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
274
- "span",
275
- {
276
- ref,
277
- id,
278
- "data-spark-component": "form-field-message",
279
- className: (0, import_class_variance_authority3.cx)(className, "text-caption"),
280
- ...others
281
- }
282
- );
283
- };
284
- FormFieldMessage.displayName = "FormField.Message";
285
-
286
- // src/form-field/FormFieldStateMessage.tsx
287
- var import_jsx_runtime7 = require("react/jsx-runtime");
288
- var FormFieldStateMessage = ({
289
- className,
290
- state,
291
- children,
292
- ref,
293
- ...others
294
- }) => {
295
- const field = useFormField();
296
- if (field.state !== state) {
297
- return null;
298
- }
299
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
300
- FormFieldMessage,
301
- {
302
- ref,
303
- "data-spark-component": "form-field-state-message",
304
- "aria-live": "polite",
305
- className: (0, import_class_variance_authority4.cx)(
306
- "gap-sm flex items-center",
307
- state === "error" ? "text-error" : "text-on-surface/dim-1",
308
- className
309
- ),
310
- ...others,
311
- children: [
312
- state === "alert" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_WarningOutline.WarningOutline, {}) }),
313
- state === "error" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", intent: "error", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_AlertOutline.AlertOutline, {}) }),
314
- state === "success" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Check.Check, {}) }),
315
- children
316
- ]
317
- }
318
- );
319
- };
320
- FormFieldStateMessage.displayName = "FormField.StateMessage";
321
-
322
- // src/form-field/FormFieldAlertMessage.tsx
323
- var import_jsx_runtime8 = require("react/jsx-runtime");
324
- var FormFieldAlertMessage = ({ ref, ...props }) => {
325
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
326
- FormFieldStateMessage,
327
- {
328
- ref,
329
- "data-spark-component": "form-field-alert-message",
330
- state: "alert",
331
- ...props
332
- }
333
- );
334
- };
335
- FormFieldAlertMessage.displayName = "FormField.AlertMessage";
336
-
337
- // src/form-field/FormFieldCharactersCount.tsx
338
- var import_class_variance_authority5 = require("class-variance-authority");
339
- var import_jsx_runtime9 = require("react/jsx-runtime");
340
- var FormFieldCharactersCount = ({
341
- className,
342
- value = "",
343
- maxLength,
344
- ref,
345
- ...others
346
- }) => {
347
- const displayValue = `${value.length}/${maxLength}`;
348
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
349
- "span",
350
- {
351
- ref,
352
- "data-spark-component": "form-field-characters-count",
353
- className: (0, import_class_variance_authority5.cx)(className, "text-caption", "text-neutral"),
354
- ...others,
355
- children: displayValue
356
- }
357
- );
358
- };
359
- FormFieldCharactersCount.displayName = "FormField.CharactersCount";
360
-
361
- // src/form-field/FormFieldControl.tsx
362
- var import_react8 = require("react");
363
- var import_jsx_runtime10 = require("react/jsx-runtime");
364
- var useFormFieldControl = () => {
365
- const { id, name, description, disabled, readOnly, state, labelId, isInvalid, isRequired } = (0, import_react8.useContext)(FormFieldContext) || {};
366
- return {
367
- id,
368
- name,
369
- description,
370
- disabled,
371
- readOnly,
372
- state,
373
- labelId,
374
- isInvalid,
375
- isRequired
376
- };
377
- };
378
- var FormFieldControl = ({ children }) => {
379
- const props = useFormFieldControl();
380
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: children(props) });
381
- };
382
- FormFieldControl.displayName = "FormField.Control";
383
-
384
- // src/form-field/FormFieldErrorMessage.tsx
385
- var import_jsx_runtime11 = require("react/jsx-runtime");
386
- var FormFieldErrorMessage = ({ ref, ...props }) => {
387
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
388
- FormFieldStateMessage,
389
- {
390
- ref,
391
- "data-spark-component": "form-field-error-message",
392
- state: "error",
393
- ...props
394
- }
395
- );
396
- };
397
- FormFieldErrorMessage.displayName = "FormField.ErrorMessage";
398
-
399
- // src/form-field/FormFieldHelperMessage.tsx
400
- var import_class_variance_authority6 = require("class-variance-authority");
401
- var import_jsx_runtime12 = require("react/jsx-runtime");
402
- var FormFieldHelperMessage = ({
403
- className,
404
- ref,
405
- ...others
406
- }) => {
407
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
408
- FormFieldMessage,
409
- {
410
- ref,
411
- "data-spark-component": "form-field-helper-message",
412
- className: (0, import_class_variance_authority6.cx)("text-on-surface/dim-1", className),
413
- ...others
414
- }
415
- );
416
- };
417
- FormFieldHelperMessage.displayName = "FormField.HelperMessage";
418
-
419
- // src/form-field/FormFieldLabel.tsx
420
- var import_class_variance_authority10 = require("class-variance-authority");
421
-
422
- // src/label/Label.tsx
423
- var import_class_variance_authority7 = require("class-variance-authority");
43
+ var import_form_field = require("@spark-ui/components/form-field");
424
44
  var import_radix_ui2 = require("radix-ui");
425
- var import_jsx_runtime13 = require("react/jsx-runtime");
426
- var Label = ({ className, ref, ...others }) => {
427
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
428
- import_radix_ui2.Label.Label,
429
- {
430
- ref,
431
- "data-spark-component": "label",
432
- className: (0, import_class_variance_authority7.cx)("text-body-1", className),
433
- ...others
434
- }
435
- );
436
- };
437
- Label.displayName = "Label";
438
-
439
- // src/label/LabelRequiredIndicator.tsx
440
- var import_class_variance_authority8 = require("class-variance-authority");
441
- var import_jsx_runtime14 = require("react/jsx-runtime");
442
- var LabelRequiredIndicator = ({
443
- className,
444
- children = "*",
445
- ref,
446
- ...others
447
- }) => {
448
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
449
- "span",
450
- {
451
- ref,
452
- "data-spark-component": "label-required-indicator",
453
- role: "presentation",
454
- "aria-hidden": "true",
455
- className: (0, import_class_variance_authority8.cx)(className, "text-caption text-on-surface/dim-1"),
456
- ...others,
457
- children
458
- }
459
- );
460
- };
461
- LabelRequiredIndicator.displayName = "Label.RequiredIndicator";
462
-
463
- // src/label/index.ts
464
- var Label2 = Object.assign(Label, {
465
- RequiredIndicator: LabelRequiredIndicator
466
- });
467
- Label2.displayName = "Label";
468
- LabelRequiredIndicator.displayName = "Label.RequiredIndicator";
469
-
470
- // src/form-field/FormFieldRequiredIndicator.tsx
471
- var import_class_variance_authority9 = require("class-variance-authority");
472
- var import_jsx_runtime15 = require("react/jsx-runtime");
473
- var FormFieldRequiredIndicator = ({
474
- className,
475
- ref,
476
- ...props
477
- }) => {
478
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Label2.RequiredIndicator, { ref, className: (0, import_class_variance_authority9.cx)("ml-sm", className), ...props });
479
- };
480
- FormFieldRequiredIndicator.displayName = "FormField.RequiredIndicator";
481
-
482
- // src/form-field/FormFieldLabel.tsx
483
- var import_jsx_runtime16 = require("react/jsx-runtime");
484
- var FormFieldLabel = ({
485
- htmlFor: htmlForProp,
486
- className,
487
- children,
488
- requiredIndicator = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormFieldRequiredIndicator, {}),
489
- asChild,
490
- ref,
491
- ...others
492
- }) => {
493
- const control = useFormField();
494
- const { disabled, labelId, isRequired } = control;
495
- const htmlFor = asChild ? void 0 : htmlForProp || control.id;
496
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
497
- Label2,
498
- {
499
- ref,
500
- id: labelId,
501
- "data-spark-component": "form-field-label",
502
- htmlFor,
503
- className: (0, import_class_variance_authority10.cx)(className, disabled ? "text-on-surface/dim-3 pointer-events-none" : void 0),
504
- asChild,
505
- ...others,
506
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
507
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Slottable, { children }),
508
- isRequired && requiredIndicator
509
- ] })
510
- }
511
- );
512
- };
513
- FormFieldLabel.displayName = "FormField.Label";
514
-
515
- // src/form-field/FormFieldSuccessMessage.tsx
516
- var import_jsx_runtime17 = require("react/jsx-runtime");
517
- var FormFieldSuccessMessage = ({ ref, ...props }) => {
518
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
519
- FormFieldStateMessage,
520
- {
521
- ref,
522
- "data-spark-component": "form-field-success-message",
523
- state: "success",
524
- ...props
525
- }
526
- );
527
- };
528
- FormFieldSuccessMessage.displayName = "FormField.SuccessMessage";
529
-
530
- // src/form-field/index.ts
531
- var FormField2 = Object.assign(FormField, {
532
- Label: FormFieldLabel,
533
- Control: FormFieldControl,
534
- StateMessage: FormFieldStateMessage,
535
- SuccessMessage: FormFieldSuccessMessage,
536
- AlertMessage: FormFieldAlertMessage,
537
- ErrorMessage: FormFieldErrorMessage,
538
- HelperMessage: FormFieldHelperMessage,
539
- RequiredIndicator: FormFieldRequiredIndicator,
540
- CharactersCount: FormFieldCharactersCount
541
- });
542
- FormField2.displayName = "FormField";
543
- FormFieldLabel.displayName = "FormField.Label";
544
- FormFieldControl.displayName = "FormField.Control";
545
- FormFieldStateMessage.displayName = "FormField.StateMessage";
546
- FormFieldSuccessMessage.displayName = "FormField.SuccessMessage";
547
- FormFieldAlertMessage.displayName = "FormField.AlertMessage";
548
- FormFieldErrorMessage.displayName = "FormField.ErrorMessage";
549
- FormFieldHelperMessage.displayName = "FormField.HelperMessage";
550
- FormFieldRequiredIndicator.displayName = "FormField.RequiredIndicator";
551
- FormFieldCharactersCount.displayName = "FormField.CharactersCount";
552
45
 
553
46
  // src/radio-group/RadioIndicator.tsx
554
- var import_radix_ui3 = require("radix-ui");
47
+ var import_radix_ui = require("radix-ui");
555
48
 
556
49
  // src/radio-group/RadioIndicator.styles.ts
557
- var import_internal_utils2 = require("@spark-ui/internal-utils");
558
- var import_class_variance_authority11 = require("class-variance-authority");
559
- var radioIndicatorStyles = (0, import_class_variance_authority11.cva)(
50
+ var import_internal_utils = require("@spark-ui/internal-utils");
51
+ var import_class_variance_authority = require("class-variance-authority");
52
+ var radioIndicatorStyles = (0, import_class_variance_authority.cva)(
560
53
  [
561
54
  "relative block",
562
55
  "size-3/5",
@@ -572,7 +65,7 @@ var radioIndicatorStyles = (0, import_class_variance_authority11.cva)(
572
65
  ],
573
66
  {
574
67
  variants: {
575
- intent: (0, import_internal_utils2.makeVariants)({
68
+ intent: (0, import_internal_utils.makeVariants)({
576
69
  main: ["after:bg-main"],
577
70
  support: ["after:bg-support"],
578
71
  accent: ["after:bg-accent"],
@@ -591,10 +84,10 @@ var radioIndicatorStyles = (0, import_class_variance_authority11.cva)(
591
84
  );
592
85
 
593
86
  // src/radio-group/RadioIndicator.tsx
594
- var import_jsx_runtime18 = require("react/jsx-runtime");
87
+ var import_jsx_runtime = require("react/jsx-runtime");
595
88
  var RadioIndicator = ({ intent, className, ref, ...others }) => {
596
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
597
- import_radix_ui3.RadioGroup.Indicator,
89
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
+ import_radix_ui.RadioGroup.Indicator,
598
91
  {
599
92
  ref,
600
93
  className: radioIndicatorStyles({ intent, className }),
@@ -605,9 +98,9 @@ var RadioIndicator = ({ intent, className, ref, ...others }) => {
605
98
  RadioIndicator.displayName = "RadioGroup.RadioIndicator";
606
99
 
607
100
  // src/radio-group/RadioInput.styles.ts
608
- var import_internal_utils3 = require("@spark-ui/internal-utils");
609
- var import_class_variance_authority12 = require("class-variance-authority");
610
- var radioInputVariants = (0, import_class_variance_authority12.cva)(
101
+ var import_internal_utils2 = require("@spark-ui/internal-utils");
102
+ var import_class_variance_authority2 = require("class-variance-authority");
103
+ var radioInputVariants = (0, import_class_variance_authority2.cva)(
611
104
  [
612
105
  "flex shrink-0 items-center justify-center",
613
106
  "rounded-full",
@@ -624,7 +117,7 @@ var radioInputVariants = (0, import_class_variance_authority12.cva)(
624
117
  /**
625
118
  * Color scheme of the radio input.
626
119
  */
627
- intent: (0, import_internal_utils3.makeVariants)({
120
+ intent: (0, import_internal_utils2.makeVariants)({
628
121
  main: ["border-outline", "data-[state=checked]:border-main", "hover:ring-main-container"],
629
122
  support: [
630
123
  "border-outline",
@@ -671,28 +164,28 @@ var radioInputVariants = (0, import_class_variance_authority12.cva)(
671
164
  );
672
165
 
673
166
  // src/radio-group/RadioInput.tsx
674
- var import_jsx_runtime19 = require("react/jsx-runtime");
167
+ var import_jsx_runtime2 = require("react/jsx-runtime");
675
168
  var RadioInput = ({ intent: intentProp, className, ref, ...others }) => {
676
- const { state } = useFormFieldControl();
169
+ const { state } = (0, import_form_field.useFormFieldControl)();
677
170
  const intent = state ?? intentProp;
678
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
679
- import_radix_ui4.RadioGroup.RadioGroupItem,
171
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
172
+ import_radix_ui2.RadioGroup.RadioGroupItem,
680
173
  {
681
174
  ref,
682
175
  className: radioInputVariants({ intent, className }),
683
176
  ...others,
684
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RadioIndicator, { intent, forceMount: true })
177
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioIndicator, { intent, forceMount: true })
685
178
  }
686
179
  );
687
180
  };
688
181
  RadioInput.displayName = "RadioGroup.RadioInput";
689
182
 
690
183
  // src/radio-group/RadioLabel.tsx
691
- var import_radix_ui5 = require("radix-ui");
184
+ var import_radix_ui3 = require("radix-ui");
692
185
 
693
186
  // src/radio-group/RadioLabel.styles.tsx
694
- var import_class_variance_authority13 = require("class-variance-authority");
695
- var radioLabelStyles = (0, import_class_variance_authority13.cva)("grow", {
187
+ var import_class_variance_authority3 = require("class-variance-authority");
188
+ var radioLabelStyles = (0, import_class_variance_authority3.cva)("grow", {
696
189
  variants: {
697
190
  disabled: {
698
191
  true: ["text-neutral/dim-2", "cursor-not-allowed"],
@@ -705,15 +198,15 @@ var radioLabelStyles = (0, import_class_variance_authority13.cva)("grow", {
705
198
  });
706
199
 
707
200
  // src/radio-group/RadioLabel.tsx
708
- var import_jsx_runtime20 = require("react/jsx-runtime");
201
+ var import_jsx_runtime3 = require("react/jsx-runtime");
709
202
  var RadioLabel = ({ disabled, ...others }) => {
710
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui5.Label.Root, { className: radioLabelStyles({ disabled }), ...others });
203
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_radix_ui3.Label.Root, { className: radioLabelStyles({ disabled }), ...others });
711
204
  };
712
205
  RadioLabel.displayName = "RadioGroup.RadioLabel";
713
206
 
714
207
  // src/radio-group/Radio.tsx
715
- var import_jsx_runtime21 = require("react/jsx-runtime");
716
- var ID_PREFIX2 = ":radio";
208
+ var import_jsx_runtime4 = require("react/jsx-runtime");
209
+ var ID_PREFIX = ":radio";
717
210
  var Radio = ({
718
211
  className,
719
212
  children,
@@ -722,11 +215,11 @@ var Radio = ({
722
215
  ref,
723
216
  ...others
724
217
  }) => {
725
- const innerId = `${ID_PREFIX2}-input-${(0, import_react9.useId)()}`;
726
- const innerLabelId = `${ID_PREFIX2}-label-${(0, import_react9.useId)()}`;
218
+ const innerId = `${ID_PREFIX}-input-${(0, import_react2.useId)()}`;
219
+ const innerLabelId = `${ID_PREFIX}-label-${(0, import_react2.useId)()}`;
727
220
  const { intent, disabled, reverse } = useRadioGroup();
728
- const radioLabel = children && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(RadioLabel, { disabled: disabledProp || disabled, htmlFor: id || innerId, id: innerLabelId, children });
729
- const radioInput = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
221
+ const radioLabel = children && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RadioLabel, { disabled: disabledProp || disabled, htmlFor: id || innerId, id: innerLabelId, children });
222
+ const radioInput = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
730
223
  RadioInput,
731
224
  {
732
225
  ref,
@@ -737,23 +230,24 @@ var Radio = ({
737
230
  disabled: disabledProp
738
231
  }
739
232
  );
740
- const content = reverse ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
233
+ const content = reverse ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
741
234
  radioLabel,
742
235
  radioInput
743
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
236
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
744
237
  radioInput,
745
238
  radioLabel
746
239
  ] });
747
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: (0, import_class_variance_authority14.cx)("gap-md text-body-1 flex items-start", className), children: content });
240
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_class_variance_authority4.cx)("gap-md text-body-1 flex items-start", className), children: content });
748
241
  };
749
242
  Radio.displayName = "RadioGroup.Radio";
750
243
 
751
244
  // src/radio-group/RadioGroup.tsx
752
- var import_radix_ui6 = require("radix-ui");
245
+ var import_form_field2 = require("@spark-ui/components/form-field");
246
+ var import_radix_ui4 = require("radix-ui");
753
247
 
754
248
  // src/radio-group/RadioGroup.styles.ts
755
- var import_class_variance_authority15 = require("class-variance-authority");
756
- var radioGroupStyles = (0, import_class_variance_authority15.cva)(["flex"], {
249
+ var import_class_variance_authority5 = require("class-variance-authority");
250
+ var radioGroupStyles = (0, import_class_variance_authority5.cva)(["flex"], {
757
251
  variants: {
758
252
  orientation: {
759
253
  vertical: ["flex-col", "gap-lg"],
@@ -763,20 +257,20 @@ var radioGroupStyles = (0, import_class_variance_authority15.cva)(["flex"], {
763
257
  });
764
258
 
765
259
  // src/radio-group/RadioGroupProvider.tsx
766
- var import_react10 = require("react");
767
- var import_jsx_runtime22 = require("react/jsx-runtime");
260
+ var import_react3 = require("react");
261
+ var import_jsx_runtime5 = require("react/jsx-runtime");
768
262
  var RadioGroupProvider = ({
769
263
  intent,
770
264
  disabled,
771
265
  reverse,
772
266
  children
773
267
  }) => {
774
- const value = (0, import_react10.useMemo)(() => ({ intent, disabled, reverse }), [intent, disabled, reverse]);
775
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(RadioGroupContext.Provider, { value, children });
268
+ const value = (0, import_react3.useMemo)(() => ({ intent, disabled, reverse }), [intent, disabled, reverse]);
269
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioGroupContext.Provider, { value, children });
776
270
  };
777
271
 
778
272
  // src/radio-group/RadioGroup.tsx
779
- var import_jsx_runtime23 = require("react/jsx-runtime");
273
+ var import_jsx_runtime6 = require("react/jsx-runtime");
780
274
  var RadioGroup = ({
781
275
  orientation = "vertical",
782
276
  loop = true,
@@ -788,10 +282,10 @@ var RadioGroup = ({
788
282
  ref,
789
283
  ...others
790
284
  }) => {
791
- const { labelId, isInvalid, isRequired, description, name } = useFormFieldControl();
285
+ const { labelId, isInvalid, isRequired, description, name } = (0, import_form_field2.useFormFieldControl)();
792
286
  const required = requiredProp !== void 0 ? requiredProp : isRequired;
793
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(RadioGroupProvider, { reverse, intent, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
794
- import_radix_ui6.RadioGroup.RadioGroup,
287
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadioGroupProvider, { reverse, intent, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
288
+ import_radix_ui4.RadioGroup.RadioGroup,
795
289
  {
796
290
  "data-spark-component": "radio-group",
797
291
  className: radioGroupStyles({ orientation, className }),