@yamada-ui/radio 1.2.16-next-20241126134247 → 1.3.0-next-20241126142838

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/dist/chunk-27VC2SJI.mjs +30 -0
  2. package/dist/chunk-27VC2SJI.mjs.map +1 -0
  3. package/dist/chunk-AOVCDCCW.mjs +88 -0
  4. package/dist/chunk-AOVCDCCW.mjs.map +1 -0
  5. package/dist/chunk-DO4JVJRM.mjs +103 -0
  6. package/dist/chunk-DO4JVJRM.mjs.map +1 -0
  7. package/dist/{chunk-PUPRIHYJ.mjs → chunk-HFS5TQ47.mjs} +8 -115
  8. package/dist/chunk-HFS5TQ47.mjs.map +1 -0
  9. package/dist/chunk-JLL7F3NY.mjs +120 -0
  10. package/dist/chunk-JLL7F3NY.mjs.map +1 -0
  11. package/dist/chunk-NP4GICPF.mjs +124 -0
  12. package/dist/chunk-NP4GICPF.mjs.map +1 -0
  13. package/dist/chunk-Q5GTUIUF.mjs +56 -0
  14. package/dist/chunk-Q5GTUIUF.mjs.map +1 -0
  15. package/dist/chunk-YDYOLCNG.mjs +94 -0
  16. package/dist/chunk-YDYOLCNG.mjs.map +1 -0
  17. package/dist/chunk-YRIADAI7.mjs +32 -0
  18. package/dist/chunk-YRIADAI7.mjs.map +1 -0
  19. package/dist/chunk-ZLJHOIFP.mjs +26 -0
  20. package/dist/chunk-ZLJHOIFP.mjs.map +1 -0
  21. package/dist/index.d.mts +11 -4
  22. package/dist/index.d.ts +11 -4
  23. package/dist/index.js +344 -37
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +29 -5
  26. package/dist/radio-card-addon.d.mts +8 -0
  27. package/dist/radio-card-addon.d.ts +8 -0
  28. package/dist/radio-card-addon.js +69 -0
  29. package/dist/radio-card-addon.js.map +1 -0
  30. package/dist/radio-card-addon.mjs +9 -0
  31. package/dist/radio-card-addon.mjs.map +1 -0
  32. package/dist/radio-card-description.d.mts +8 -0
  33. package/dist/radio-card-description.d.ts +8 -0
  34. package/dist/radio-card-description.js +67 -0
  35. package/dist/radio-card-description.js.map +1 -0
  36. package/dist/radio-card-description.mjs +9 -0
  37. package/dist/radio-card-description.mjs.map +1 -0
  38. package/dist/radio-card-group.d.mts +33 -0
  39. package/dist/radio-card-group.d.ts +33 -0
  40. package/dist/radio-card-group.js +584 -0
  41. package/dist/radio-card-group.js.map +1 -0
  42. package/dist/radio-card-group.mjs +15 -0
  43. package/dist/radio-card-group.mjs.map +1 -0
  44. package/dist/radio-card-label.d.mts +22 -0
  45. package/dist/radio-card-label.d.ts +22 -0
  46. package/dist/radio-card-label.js +93 -0
  47. package/dist/radio-card-label.js.map +1 -0
  48. package/dist/radio-card-label.mjs +9 -0
  49. package/dist/radio-card-label.mjs.map +1 -0
  50. package/dist/radio-card.d.mts +61 -0
  51. package/dist/radio-card.d.ts +61 -0
  52. package/dist/radio-card.js +412 -0
  53. package/dist/radio-card.js.map +1 -0
  54. package/dist/radio-card.mjs +13 -0
  55. package/dist/radio-card.mjs.map +1 -0
  56. package/dist/radio-context.d.mts +25 -3
  57. package/dist/radio-context.d.ts +25 -3
  58. package/dist/radio-context.js +16 -0
  59. package/dist/radio-context.js.map +1 -1
  60. package/dist/radio-context.mjs +9 -1
  61. package/dist/radio-group.d.mts +15 -58
  62. package/dist/radio-group.d.ts +15 -58
  63. package/dist/radio-group.js +56 -39
  64. package/dist/radio-group.js.map +1 -1
  65. package/dist/radio-group.mjs +7 -7
  66. package/dist/radio.d.mts +14 -80
  67. package/dist/radio.d.ts +14 -80
  68. package/dist/radio.js +31 -17
  69. package/dist/radio.js.map +1 -1
  70. package/dist/radio.mjs +5 -6
  71. package/dist/use-radio-group.d.mts +56 -0
  72. package/dist/use-radio-group.d.ts +56 -0
  73. package/dist/use-radio-group.js +111 -0
  74. package/dist/use-radio-group.js.map +1 -0
  75. package/dist/use-radio-group.mjs +8 -0
  76. package/dist/use-radio-group.mjs.map +1 -0
  77. package/dist/use-radio.d.mts +87 -0
  78. package/dist/use-radio.d.ts +87 -0
  79. package/dist/use-radio.js +207 -0
  80. package/dist/use-radio.js.map +1 -0
  81. package/dist/use-radio.mjs +8 -0
  82. package/dist/use-radio.mjs.map +1 -0
  83. package/package.json +7 -7
  84. package/dist/chunk-6FMV6NX2.mjs +0 -14
  85. package/dist/chunk-6FMV6NX2.mjs.map +0 -1
  86. package/dist/chunk-PUPRIHYJ.mjs.map +0 -1
  87. package/dist/chunk-QAADRIFZ.mjs +0 -177
  88. package/dist/chunk-QAADRIFZ.mjs.map +0 -1
package/dist/index.js CHANGED
@@ -22,6 +22,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  var src_exports = {};
23
23
  __export(src_exports, {
24
24
  Radio: () => Radio,
25
+ RadioCard: () => RadioCard,
26
+ RadioCardAddon: () => RadioCardAddon,
27
+ RadioCardDescription: () => RadioCardDescription,
28
+ RadioCardGroup: () => RadioCardGroup,
29
+ RadioCardLabel: () => RadioCardLabel,
25
30
  RadioGroup: () => RadioGroup,
26
31
  useRadio: () => useRadio,
27
32
  useRadioGroup: () => useRadioGroup
@@ -30,10 +35,9 @@ module.exports = __toCommonJS(src_exports);
30
35
 
31
36
  // src/radio.tsx
32
37
  var import_core = require("@yamada-ui/core");
33
- var import_form_control = require("@yamada-ui/form-control");
34
- var import_use_focus_visible = require("@yamada-ui/use-focus-visible");
35
- var import_utils2 = require("@yamada-ui/utils");
36
- var import_react = require("react");
38
+ var import_form_control2 = require("@yamada-ui/form-control");
39
+ var import_utils3 = require("@yamada-ui/utils");
40
+ var import_react2 = require("react");
37
41
 
38
42
  // src/radio-context.ts
39
43
  var import_utils = require("@yamada-ui/utils");
@@ -41,9 +45,20 @@ var [RadioGroupProvider, useRadioGroupContext] = (0, import_utils.createContext)
41
45
  name: "RadioGroupContext",
42
46
  strict: false
43
47
  });
48
+ var [RadioCardGroupProvider, useRadioCardGroupContext] = (0, import_utils.createContext)({
49
+ name: "RadioCardGroupContext",
50
+ strict: false
51
+ });
52
+ var [RadioCardProvider, useRadioCardContext] = (0, import_utils.createContext)({
53
+ name: "RadioCardContext",
54
+ errorMessage: `useRadioCardContext returned is 'undefined'. Seems you forgot to wrap the components in "<RadioCard />"`
55
+ });
44
56
 
45
- // src/radio.tsx
46
- var import_jsx_runtime = require("react/jsx-runtime");
57
+ // src/use-radio.ts
58
+ var import_form_control = require("@yamada-ui/form-control");
59
+ var import_use_focus_visible = require("@yamada-ui/use-focus-visible");
60
+ var import_utils2 = require("@yamada-ui/utils");
61
+ var import_react = require("react");
47
62
  var useRadio = ({
48
63
  id,
49
64
  ...props
@@ -115,9 +130,11 @@ var useRadio = ({
115
130
  ...formControlProps,
116
131
  ...props2,
117
132
  ref,
118
- "data-checked": (0, import_utils2.dataAttr)(resolvedChecked)
133
+ "data-checked": (0, import_utils2.dataAttr)(resolvedChecked),
134
+ "data-focus": (0, import_utils2.dataAttr)(focused),
135
+ "data-focus-visible": (0, import_utils2.dataAttr)(focused && focusVisible)
119
136
  }),
120
- [resolvedChecked, formControlProps]
137
+ [resolvedChecked, formControlProps, focused, focusVisible]
121
138
  );
122
139
  const getIconProps = (0, import_react.useCallback)(
123
140
  (props2 = {}, ref = null) => ({
@@ -214,12 +231,15 @@ var useRadio = ({
214
231
  getLabelProps
215
232
  };
216
233
  };
217
- var Radio = (0, import_react.forwardRef)(
234
+
235
+ // src/radio.tsx
236
+ var import_jsx_runtime = require("react/jsx-runtime");
237
+ var Radio = (0, import_react2.forwardRef)(
218
238
  (props, ref) => {
219
239
  var _a, _b, _c, _d, _e;
220
240
  const group = useRadioGroupContext();
221
241
  const { value: groupValue, ...groupProps } = { ...group };
222
- const control = (0, import_form_control.useFormControl)(props);
242
+ const control = (0, import_form_control2.useFormControl)(props);
223
243
  const [styles, mergedProps] = (0, import_core.useComponentMultiStyle)("Radio", {
224
244
  ...groupProps,
225
245
  ...props
@@ -232,6 +252,7 @@ var Radio = (0, import_react.forwardRef)(
232
252
  isInvalid = (_b = groupProps.isInvalid) != null ? _b : control.isInvalid,
233
253
  isReadOnly = (_c = groupProps.isReadOnly) != null ? _c : control.isReadOnly,
234
254
  isRequired = (_d = groupProps.isRequired) != null ? _d : control.isRequired,
255
+ label,
235
256
  iconProps,
236
257
  inputProps,
237
258
  labelProps,
@@ -239,7 +260,7 @@ var Radio = (0, import_react.forwardRef)(
239
260
  } = (0, import_core.omitThemeProps)(mergedProps);
240
261
  (_e = computedProps.checked) != null ? _e : computedProps.checked = computedProps.isChecked;
241
262
  const checkedProp = groupValue && computedProps.value ? groupValue === computedProps.value : computedProps.checked;
242
- const onChange = groupProps.onChange && computedProps.value ? (0, import_utils2.funcAll)(groupProps.onChange, computedProps.onChange) : computedProps.onChange;
263
+ const onChange = groupProps.onChange && computedProps.value ? (0, import_utils3.funcAll)(groupProps.onChange, computedProps.onChange) : computedProps.onChange;
243
264
  const {
244
265
  checked,
245
266
  props: rest,
@@ -260,7 +281,7 @@ var Radio = (0, import_react.forwardRef)(
260
281
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
261
282
  import_core.ui.label,
262
283
  {
263
- className: (0, import_utils2.cx)("ui-radio", className),
284
+ className: (0, import_utils3.cx)("ui-radio", className),
264
285
  ...getContainerProps(rest),
265
286
  __css: {
266
287
  alignItems: "center",
@@ -304,7 +325,7 @@ var Radio = (0, import_react.forwardRef)(
304
325
  className: "ui-radio__label",
305
326
  ...getLabelProps(labelProps),
306
327
  __css: { ...styles.label },
307
- children
328
+ children: children != null ? children : label
308
329
  }
309
330
  )
310
331
  ]
@@ -315,14 +336,205 @@ var Radio = (0, import_react.forwardRef)(
315
336
  Radio.displayName = "Radio";
316
337
  Radio.__ui__ = "Radio";
317
338
 
318
- // src/radio-group.tsx
319
- var import_form_control2 = require("@yamada-ui/form-control");
339
+ // src/radio-card.tsx
340
+ var import_core8 = require("@yamada-ui/core");
341
+ var import_form_control3 = require("@yamada-ui/form-control");
342
+ var import_utils7 = require("@yamada-ui/utils");
343
+ var import_react3 = require("react");
344
+
345
+ // src/radio-card-addon.tsx
346
+ var import_core2 = require("@yamada-ui/core");
347
+ var import_core3 = require("@yamada-ui/core");
348
+ var import_utils4 = require("@yamada-ui/utils");
349
+ var import_jsx_runtime2 = require("react/jsx-runtime");
350
+ var RadioCardAddon = (0, import_core2.forwardRef)(
351
+ ({ className, ...rest }, ref) => {
352
+ const { styles } = useRadioCardContext();
353
+ const css = { ...styles.addon };
354
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
355
+ import_core3.ui.div,
356
+ {
357
+ ref,
358
+ className: (0, import_utils4.cx)("ui-radio-card__addon", className),
359
+ __css: css,
360
+ ...rest
361
+ }
362
+ );
363
+ }
364
+ );
365
+ RadioCardAddon.displayName = "RadioCardAddon";
366
+ RadioCardAddon.__ui__ = "RadioCardAddon";
367
+
368
+ // src/radio-card-description.tsx
369
+ var import_core4 = require("@yamada-ui/core");
370
+ var import_core5 = require("@yamada-ui/core");
371
+ var import_utils5 = require("@yamada-ui/utils");
372
+ var import_jsx_runtime3 = require("react/jsx-runtime");
373
+ var RadioCardDescription = (0, import_core4.forwardRef)(({ className, ...rest }, ref) => {
374
+ const { styles } = useRadioCardContext();
375
+ const css = { ...styles.description };
376
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
377
+ import_core5.ui.div,
378
+ {
379
+ ref,
380
+ className: (0, import_utils5.cx)("ui-radio-card__description", className),
381
+ __css: css,
382
+ ...rest
383
+ }
384
+ );
385
+ });
386
+ RadioCardDescription.displayName = "RadioCardDescription";
387
+ RadioCardDescription.__ui__ = "RadioCardDescription";
388
+
389
+ // src/radio-card-label.tsx
390
+ var import_core6 = require("@yamada-ui/core");
391
+ var import_core7 = require("@yamada-ui/core");
392
+ var import_utils6 = require("@yamada-ui/utils");
393
+ var import_jsx_runtime4 = require("react/jsx-runtime");
394
+ var RadioCardLabel = (0, import_core6.forwardRef)(
395
+ ({ className, children, withIcon, contentProps, iconProps, ...rest }, ref) => {
396
+ const {
397
+ styles,
398
+ withIcon: defaultWithIcon,
399
+ getIconProps,
400
+ iconProps: defaultIconProps
401
+ } = useRadioCardContext();
402
+ withIcon != null ? withIcon : withIcon = defaultWithIcon;
403
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
404
+ import_core7.ui.div,
405
+ {
406
+ ref,
407
+ className: (0, import_utils6.cx)("ui-radio-card__label", className),
408
+ __css: { ...styles.label },
409
+ ...rest,
410
+ children: [
411
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
412
+ import_core7.ui.span,
413
+ {
414
+ className: "ui-radio-card__label-content",
415
+ __css: { ...styles.labelContent },
416
+ ...contentProps,
417
+ children
418
+ }
419
+ ),
420
+ withIcon ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
421
+ import_core7.ui.div,
422
+ {
423
+ className: "ui-radio-card__icon",
424
+ __css: { ...styles.icon },
425
+ ...getIconProps({ ...defaultIconProps, ...iconProps })
426
+ }
427
+ ) : null
428
+ ]
429
+ }
430
+ );
431
+ }
432
+ );
433
+ RadioCardLabel.displayName = "RadioCardLabel";
434
+ RadioCardLabel.__ui__ = "RadioCardLabel";
435
+
436
+ // src/radio-card.tsx
437
+ var import_jsx_runtime5 = require("react/jsx-runtime");
438
+ var RadioCard = (0, import_react3.forwardRef)(
439
+ (props, ref) => {
440
+ var _a, _b, _c, _d, _e;
441
+ const group = useRadioCardGroupContext();
442
+ const { value: groupValue, ...groupProps } = { ...group };
443
+ const control = (0, import_form_control3.useFormControl)(props);
444
+ const [styles, mergedProps] = (0, import_core8.useComponentMultiStyle)("RadioCard", {
445
+ ...groupProps,
446
+ ...props
447
+ });
448
+ const {
449
+ className,
450
+ addon,
451
+ children,
452
+ description,
453
+ isDisabled = (_a = groupProps.isDisabled) != null ? _a : control.isDisabled,
454
+ isInvalid = (_b = groupProps.isInvalid) != null ? _b : control.isInvalid,
455
+ isReadOnly = (_c = groupProps.isReadOnly) != null ? _c : control.isReadOnly,
456
+ isRequired = (_d = groupProps.isRequired) != null ? _d : control.isRequired,
457
+ label,
458
+ withIcon = true,
459
+ addonProps,
460
+ descriptionProps,
461
+ iconProps,
462
+ inputProps,
463
+ labelProps,
464
+ ...computedProps
465
+ } = (0, import_core8.omitThemeProps)(mergedProps);
466
+ (_e = computedProps.checked) != null ? _e : computedProps.checked = computedProps.isChecked;
467
+ const checkedProp = groupValue && computedProps.value ? groupValue === computedProps.value : computedProps.checked;
468
+ const onChange = groupProps.onChange && computedProps.value ? (0, import_utils7.funcAll)(groupProps.onChange, computedProps.onChange) : computedProps.onChange;
469
+ const {
470
+ checked,
471
+ props: rest,
472
+ getContainerProps,
473
+ getIconProps,
474
+ getInputProps
475
+ } = useRadio({
476
+ ...computedProps,
477
+ checked: checkedProp,
478
+ isDisabled,
479
+ isInvalid,
480
+ isReadOnly,
481
+ isRequired,
482
+ onChange
483
+ });
484
+ const tabIndex = !groupValue ? 0 : checked ? 0 : -1;
485
+ const validChildren = (0, import_utils7.getValidChildren)(children);
486
+ const customLabel = (0, import_utils7.findChild)(validChildren, RadioCardLabel);
487
+ const customDescription = (0, import_utils7.findChild)(validChildren, RadioCardDescription);
488
+ const customAddon = (0, import_utils7.findChild)(validChildren, RadioCardAddon);
489
+ const computedChildren = !(0, import_utils7.isEmpty)(validChildren) ? (0, import_utils7.omitChildren)(
490
+ validChildren,
491
+ RadioCardLabel,
492
+ RadioCardDescription,
493
+ RadioCardAddon
494
+ ) : children;
495
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioCardProvider, { value: { styles, withIcon, getIconProps, iconProps }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
496
+ import_core8.ui.label,
497
+ {
498
+ className: (0, import_utils7.cx)("ui-radio-card", className),
499
+ ...getContainerProps(rest),
500
+ __css: { ...styles.container },
501
+ children: [
502
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
503
+ import_core8.ui.input,
504
+ {
505
+ className: "ui-radio-card__input",
506
+ ...getInputProps(
507
+ {
508
+ ...inputProps,
509
+ tabIndex
510
+ },
511
+ ref
512
+ )
513
+ }
514
+ ),
515
+ customLabel != null ? customLabel : label ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioCardLabel, { ...labelProps, children: label }) : null,
516
+ customDescription != null ? customDescription : description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioCardDescription, { ...descriptionProps, children: description }) : null,
517
+ customAddon != null ? customAddon : addon ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadioCardAddon, { ...addonProps, children: addon }) : null,
518
+ computedChildren
519
+ ]
520
+ }
521
+ ) });
522
+ }
523
+ );
524
+ RadioCard.displayName = "RadioCard";
525
+ RadioCard.__ui__ = "RadioCard";
526
+
527
+ // src/radio-card-group.tsx
528
+ var import_form_control4 = require("@yamada-ui/form-control");
320
529
  var import_layouts = require("@yamada-ui/layouts");
530
+ var import_utils9 = require("@yamada-ui/utils");
531
+ var import_react5 = require("react");
532
+
533
+ // src/use-radio-group.ts
321
534
  var import_use_controllable_state = require("@yamada-ui/use-controllable-state");
322
- var import_utils3 = require("@yamada-ui/utils");
323
- var import_react2 = require("react");
324
- var import_jsx_runtime2 = require("react/jsx-runtime");
325
- var isEvent = (value) => value && (0, import_utils3.isObject)(value) && (0, import_utils3.isObject)(value.target);
535
+ var import_utils8 = require("@yamada-ui/utils");
536
+ var import_react4 = require("react");
537
+ var isEvent = (value) => value && (0, import_utils8.isObject)(value) && (0, import_utils8.isObject)(value.target);
326
538
  var useRadioGroup = ({
327
539
  id,
328
540
  name,
@@ -332,17 +544,17 @@ var useRadioGroup = ({
332
544
  onChange: onChangeProp,
333
545
  ...props
334
546
  }) => {
335
- const uuid = (0, import_react2.useId)();
547
+ const uuid = (0, import_react4.useId)();
336
548
  id != null ? id : id = uuid;
337
549
  name != null ? name : name = `radio-${id}`;
338
- const onChangeRef = (0, import_utils3.useCallbackRef)(onChangeProp);
550
+ const onChangeRef = (0, import_utils8.useCallbackRef)(onChangeProp);
339
551
  const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
340
552
  defaultValue,
341
553
  value: valueProp,
342
554
  onChange: onChangeRef
343
555
  });
344
- const containerRef = (0, import_react2.useRef)(null);
345
- const onFocus = (0, import_react2.useCallback)(() => {
556
+ const containerRef = (0, import_react4.useRef)(null);
557
+ const onFocus = (0, import_react4.useCallback)(() => {
346
558
  const container = containerRef.current;
347
559
  if (!container) return;
348
560
  let query = `input:not(:disabled):checked`;
@@ -355,22 +567,22 @@ var useRadioGroup = ({
355
567
  firstInput == null ? void 0 : firstInput.focus();
356
568
  }
357
569
  }, []);
358
- const onChange = (0, import_react2.useCallback)(
570
+ const onChange = (0, import_react4.useCallback)(
359
571
  (evOrValue) => {
360
572
  const nextValue = isEvent(evOrValue) ? evOrValue.target.value : evOrValue;
361
573
  setValue(nextValue);
362
574
  },
363
575
  [setValue]
364
576
  );
365
- const getContainerProps = (0, import_react2.useCallback)(
577
+ const getContainerProps = (0, import_react4.useCallback)(
366
578
  (props2 = {}, ref = null) => ({
367
579
  role: "radiogroup",
368
580
  ...props2,
369
- ref: (0, import_utils3.mergeRefs)(ref, containerRef)
581
+ ref: (0, import_utils8.mergeRefs)(ref, containerRef)
370
582
  }),
371
583
  []
372
584
  );
373
- const getRadioProps = (0, import_react2.useCallback)(
585
+ const getRadioProps = (0, import_react4.useCallback)(
374
586
  (props2 = {}, ref = null) => {
375
587
  const checked = props2.value === value;
376
588
  return {
@@ -399,7 +611,98 @@ var useRadioGroup = ({
399
611
  onFocus
400
612
  };
401
613
  };
402
- var RadioGroup = (0, import_react2.forwardRef)(
614
+
615
+ // src/radio-card-group.tsx
616
+ var import_jsx_runtime6 = require("react/jsx-runtime");
617
+ var RadioCardGroup = (0, import_react5.forwardRef)(
618
+ ({
619
+ id: idProp,
620
+ className,
621
+ colorScheme,
622
+ size,
623
+ variant,
624
+ children,
625
+ direction = "row",
626
+ gap = "0.5rem",
627
+ items = [],
628
+ withIcon = true,
629
+ addonProps,
630
+ descriptionProps,
631
+ labelProps,
632
+ ...props
633
+ }, ref) => {
634
+ const {
635
+ isDisabled,
636
+ isInvalid,
637
+ isReadOnly,
638
+ isRequired,
639
+ labelId,
640
+ ...computedProps
641
+ } = (0, import_form_control4.useFormControl)({
642
+ id: idProp,
643
+ ...props
644
+ });
645
+ const {
646
+ id,
647
+ name,
648
+ props: rest,
649
+ value,
650
+ getContainerProps,
651
+ onChange
652
+ } = useRadioGroup(computedProps);
653
+ const validChildren = (0, import_utils9.getValidChildren)(children);
654
+ let computedChildren = [];
655
+ if (!validChildren.length && items.length)
656
+ computedChildren = items.map((props2, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadioCard, { ...props2 }, i));
657
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
658
+ RadioCardGroupProvider,
659
+ {
660
+ value: {
661
+ name,
662
+ colorScheme,
663
+ size,
664
+ variant,
665
+ isDisabled,
666
+ isInvalid,
667
+ isReadOnly,
668
+ isRequired,
669
+ value,
670
+ withIcon,
671
+ addonProps,
672
+ descriptionProps,
673
+ labelProps,
674
+ onChange
675
+ },
676
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
677
+ import_layouts.Flex,
678
+ {
679
+ ref,
680
+ className: (0, import_utils9.cx)("ui-radio-card-group", className),
681
+ gap,
682
+ w: "100%",
683
+ ...getContainerProps({
684
+ id,
685
+ "aria-labelledby": labelId,
686
+ ...rest
687
+ }),
688
+ direction,
689
+ children: children != null ? children : computedChildren
690
+ }
691
+ )
692
+ }
693
+ );
694
+ }
695
+ );
696
+ RadioCardGroup.displayName = "RadioCardGroup";
697
+ RadioCardGroup.__ui__ = "RadioCardGroup";
698
+
699
+ // src/radio-group.tsx
700
+ var import_form_control5 = require("@yamada-ui/form-control");
701
+ var import_layouts2 = require("@yamada-ui/layouts");
702
+ var import_utils10 = require("@yamada-ui/utils");
703
+ var import_react6 = require("react");
704
+ var import_jsx_runtime7 = require("react/jsx-runtime");
705
+ var RadioGroup = (0, import_react6.forwardRef)(
403
706
  ({
404
707
  id: idProp,
405
708
  className,
@@ -419,7 +722,7 @@ var RadioGroup = (0, import_react2.forwardRef)(
419
722
  isRequired,
420
723
  labelId,
421
724
  ...computedProps
422
- } = (0, import_form_control2.useFormControl)({
725
+ } = (0, import_form_control5.useFormControl)({
423
726
  id: idProp,
424
727
  ...props
425
728
  });
@@ -431,12 +734,11 @@ var RadioGroup = (0, import_react2.forwardRef)(
431
734
  getContainerProps,
432
735
  onChange
433
736
  } = useRadioGroup(computedProps);
434
- const validChildren = (0, import_utils3.getValidChildren)(children);
737
+ const validChildren = (0, import_utils10.getValidChildren)(children);
435
738
  let computedChildren = [];
436
- if (!validChildren.length && items.length) {
437
- computedChildren = items.map(({ label, value: value2, ...props2 }, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Radio, { value: value2, ...props2, children: label }, i));
438
- }
439
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
739
+ if (!validChildren.length && items.length)
740
+ computedChildren = items.map((props2, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Radio, { ...props2 }, index));
741
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
440
742
  RadioGroupProvider,
441
743
  {
442
744
  value: {
@@ -451,11 +753,11 @@ var RadioGroup = (0, import_react2.forwardRef)(
451
753
  value,
452
754
  onChange
453
755
  },
454
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
455
- import_layouts.Flex,
756
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
757
+ import_layouts2.Flex,
456
758
  {
457
759
  ref,
458
- className: (0, import_utils3.cx)("ui-radio-group", className),
760
+ className: (0, import_utils10.cx)("ui-radio-group", className),
459
761
  gap: gap != null ? gap : direction === "row" ? "1rem" : void 0,
460
762
  ...getContainerProps({
461
763
  id,
@@ -475,6 +777,11 @@ RadioGroup.__ui__ = "RadioGroup";
475
777
  // Annotate the CommonJS export names for ESM import in node:
476
778
  0 && (module.exports = {
477
779
  Radio,
780
+ RadioCard,
781
+ RadioCardAddon,
782
+ RadioCardDescription,
783
+ RadioCardGroup,
784
+ RadioCardLabel,
478
785
  RadioGroup,
479
786
  useRadio,
480
787
  useRadioGroup