@yamada-ui/radio 1.2.16-next-20241126134247 → 1.3.0-dev-20241127015414

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
@@ -1,64 +1,16 @@
1
- import { RadioProps } from './radio.mjs';
2
- import * as react from 'react';
3
- import { ChangeEvent, RefAttributes, ReactElement } from 'react';
4
- import { PropGetter, ThemeProps, ComponentArgs } from '@yamada-ui/core';
1
+ import { ThemeProps, ComponentArgs } from '@yamada-ui/core';
5
2
  import { FormControlOptions } from '@yamada-ui/form-control';
6
3
  import { FlexProps } from '@yamada-ui/layouts';
7
- import { Dict } from '@yamada-ui/utils';
4
+ import { RefAttributes, ReactElement } from 'react';
5
+ import { RadioProps } from './radio.mjs';
6
+ import { UseRadioGroupProps } from './use-radio-group.mjs';
7
+ import './use-radio.mjs';
8
+ import '@yamada-ui/utils';
8
9
 
9
- type RadioItem<Y extends number | string = string> = {
10
- label?: string;
11
- } & RadioProps<Y>;
12
- interface UseRadioGroupProps<Y extends number | string = string> {
13
- /**
14
- * The top-level id string that will be applied to the radios.
15
- * The index of the radio will be appended to this top-level id.
16
- */
17
- id?: string;
18
- /**
19
- * The HTML `name` attribute used for forms.
20
- */
21
- name?: string;
22
- /**
23
- * The initial value of the radio group.
24
- */
25
- defaultValue?: Y;
26
- /**
27
- * If `true`, input elements will receive `checked` attribute instead of `isChecked`.
28
- *
29
- * This assumes, you're using native radio inputs.
30
- *
31
- * @default false
32
- */
33
- isNative?: boolean;
34
- /**
35
- * The value of the radio group.
36
- */
37
- value?: Y;
38
- /**
39
- * The callback fired when any children radio is checked or unchecked.
40
- */
41
- onChange?: (value: Y) => void;
10
+ type RadioItem<Y extends number | string = string> = RadioProps<Y>;
11
+ interface RadioGroupSharedProps<Y extends number | string = string> extends Omit<FlexProps, "defaultValue" | "onChange">, UseRadioGroupProps<Y>, FormControlOptions {
42
12
  }
43
- declare const useRadioGroup: <Y extends number | string, M extends Dict = Dict<any>>({ id, name, defaultValue, isNative, value: valueProp, onChange: onChangeProp, ...props }: M & UseRadioGroupProps<Y>) => {
44
- id: string;
45
- name: string;
46
- props: Omit<M & UseRadioGroupProps<Y>, "value" | "defaultValue" | "name" | "id" | "onChange" | "isNative">;
47
- setValue: react.Dispatch<react.SetStateAction<Y>>;
48
- value: Y;
49
- getContainerProps: PropGetter<"div", undefined>;
50
- getRadioProps: PropGetter<{
51
- value?: Y;
52
- }, {
53
- checked?: boolean;
54
- isChecked?: boolean;
55
- value?: Y;
56
- }>;
57
- onChange: (evOrValue: ChangeEvent<HTMLInputElement> | Y) => void;
58
- onFocus: () => void;
59
- };
60
- type UseRadioGroupReturn<Y extends number | string = string> = ReturnType<typeof useRadioGroup<Y>>;
61
- interface RadioGroupProps<Y extends number | string = string> extends ThemeProps<"Radio">, Omit<FlexProps, "defaultValue" | "onChange">, UseRadioGroupProps<Y>, FormControlOptions {
13
+ interface RadioGroupProps<Y extends number | string = string> extends RadioGroupSharedProps<Y>, ThemeProps<"Radio"> {
62
14
  /**
63
15
  * If provided, generate radios based on items.
64
16
  *
@@ -66,8 +18,13 @@ interface RadioGroupProps<Y extends number | string = string> extends ThemeProps
66
18
  */
67
19
  items?: RadioItem<Y>[];
68
20
  }
21
+ /**
22
+ * `RadioGroup` is a component that groups `Radio` components.
23
+ *
24
+ * @see Docs https://yamada-ui.com/components/forms/radio
25
+ */
69
26
  declare const RadioGroup: {
70
27
  <Y extends number | string = string>(props: RadioGroupProps<Y> & RefAttributes<HTMLDivElement>): ReactElement;
71
28
  } & ComponentArgs;
72
29
 
73
- export { RadioGroup, type RadioGroupProps, type RadioItem, type UseRadioGroupProps, type UseRadioGroupReturn, useRadioGroup };
30
+ export { RadioGroup, type RadioGroupProps, type RadioGroupSharedProps, type RadioItem };
@@ -1,64 +1,16 @@
1
- import { RadioProps } from './radio.js';
2
- import * as react from 'react';
3
- import { ChangeEvent, RefAttributes, ReactElement } from 'react';
4
- import { PropGetter, ThemeProps, ComponentArgs } from '@yamada-ui/core';
1
+ import { ThemeProps, ComponentArgs } from '@yamada-ui/core';
5
2
  import { FormControlOptions } from '@yamada-ui/form-control';
6
3
  import { FlexProps } from '@yamada-ui/layouts';
7
- import { Dict } from '@yamada-ui/utils';
4
+ import { RefAttributes, ReactElement } from 'react';
5
+ import { RadioProps } from './radio.js';
6
+ import { UseRadioGroupProps } from './use-radio-group.js';
7
+ import './use-radio.js';
8
+ import '@yamada-ui/utils';
8
9
 
9
- type RadioItem<Y extends number | string = string> = {
10
- label?: string;
11
- } & RadioProps<Y>;
12
- interface UseRadioGroupProps<Y extends number | string = string> {
13
- /**
14
- * The top-level id string that will be applied to the radios.
15
- * The index of the radio will be appended to this top-level id.
16
- */
17
- id?: string;
18
- /**
19
- * The HTML `name` attribute used for forms.
20
- */
21
- name?: string;
22
- /**
23
- * The initial value of the radio group.
24
- */
25
- defaultValue?: Y;
26
- /**
27
- * If `true`, input elements will receive `checked` attribute instead of `isChecked`.
28
- *
29
- * This assumes, you're using native radio inputs.
30
- *
31
- * @default false
32
- */
33
- isNative?: boolean;
34
- /**
35
- * The value of the radio group.
36
- */
37
- value?: Y;
38
- /**
39
- * The callback fired when any children radio is checked or unchecked.
40
- */
41
- onChange?: (value: Y) => void;
10
+ type RadioItem<Y extends number | string = string> = RadioProps<Y>;
11
+ interface RadioGroupSharedProps<Y extends number | string = string> extends Omit<FlexProps, "defaultValue" | "onChange">, UseRadioGroupProps<Y>, FormControlOptions {
42
12
  }
43
- declare const useRadioGroup: <Y extends number | string, M extends Dict = Dict<any>>({ id, name, defaultValue, isNative, value: valueProp, onChange: onChangeProp, ...props }: M & UseRadioGroupProps<Y>) => {
44
- id: string;
45
- name: string;
46
- props: Omit<M & UseRadioGroupProps<Y>, "value" | "defaultValue" | "name" | "id" | "onChange" | "isNative">;
47
- setValue: react.Dispatch<react.SetStateAction<Y>>;
48
- value: Y;
49
- getContainerProps: PropGetter<"div", undefined>;
50
- getRadioProps: PropGetter<{
51
- value?: Y;
52
- }, {
53
- checked?: boolean;
54
- isChecked?: boolean;
55
- value?: Y;
56
- }>;
57
- onChange: (evOrValue: ChangeEvent<HTMLInputElement> | Y) => void;
58
- onFocus: () => void;
59
- };
60
- type UseRadioGroupReturn<Y extends number | string = string> = ReturnType<typeof useRadioGroup<Y>>;
61
- interface RadioGroupProps<Y extends number | string = string> extends ThemeProps<"Radio">, Omit<FlexProps, "defaultValue" | "onChange">, UseRadioGroupProps<Y>, FormControlOptions {
13
+ interface RadioGroupProps<Y extends number | string = string> extends RadioGroupSharedProps<Y>, ThemeProps<"Radio"> {
62
14
  /**
63
15
  * If provided, generate radios based on items.
64
16
  *
@@ -66,8 +18,13 @@ interface RadioGroupProps<Y extends number | string = string> extends ThemeProps
66
18
  */
67
19
  items?: RadioItem<Y>[];
68
20
  }
21
+ /**
22
+ * `RadioGroup` is a component that groups `Radio` components.
23
+ *
24
+ * @see Docs https://yamada-ui.com/components/forms/radio
25
+ */
69
26
  declare const RadioGroup: {
70
27
  <Y extends number | string = string>(props: RadioGroupProps<Y> & RefAttributes<HTMLDivElement>): ReactElement;
71
28
  } & ComponentArgs;
72
29
 
73
- export { RadioGroup, type RadioGroupProps, type RadioItem, type UseRadioGroupProps, type UseRadioGroupReturn, useRadioGroup };
30
+ export { RadioGroup, type RadioGroupProps, type RadioGroupSharedProps, type RadioItem };
@@ -21,22 +21,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  // src/radio-group.tsx
22
22
  var radio_group_exports = {};
23
23
  __export(radio_group_exports, {
24
- RadioGroup: () => RadioGroup,
25
- useRadioGroup: () => useRadioGroup
24
+ RadioGroup: () => RadioGroup
26
25
  });
27
26
  module.exports = __toCommonJS(radio_group_exports);
28
- var import_form_control2 = require("@yamada-ui/form-control");
27
+ var import_form_control3 = require("@yamada-ui/form-control");
29
28
  var import_layouts = require("@yamada-ui/layouts");
30
- var import_use_controllable_state = require("@yamada-ui/use-controllable-state");
31
- var import_utils3 = require("@yamada-ui/utils");
32
- var import_react2 = require("react");
29
+ var import_utils5 = require("@yamada-ui/utils");
30
+ var import_react4 = require("react");
33
31
 
34
32
  // src/radio.tsx
35
33
  var import_core = require("@yamada-ui/core");
36
- var import_form_control = require("@yamada-ui/form-control");
37
- var import_use_focus_visible = require("@yamada-ui/use-focus-visible");
38
- var import_utils2 = require("@yamada-ui/utils");
39
- var import_react = require("react");
34
+ var import_form_control2 = require("@yamada-ui/form-control");
35
+ var import_utils3 = require("@yamada-ui/utils");
36
+ var import_react2 = require("react");
40
37
 
41
38
  // src/radio-context.ts
42
39
  var import_utils = require("@yamada-ui/utils");
@@ -44,9 +41,20 @@ var [RadioGroupProvider, useRadioGroupContext] = (0, import_utils.createContext)
44
41
  name: "RadioGroupContext",
45
42
  strict: false
46
43
  });
44
+ var [RadioCardGroupProvider, useRadioCardGroupContext] = (0, import_utils.createContext)({
45
+ name: "RadioCardGroupContext",
46
+ strict: false
47
+ });
48
+ var [RadioCardProvider, useRadioCardContext] = (0, import_utils.createContext)({
49
+ name: "RadioCardContext",
50
+ errorMessage: `useRadioCardContext returned is 'undefined'. Seems you forgot to wrap the components in "<RadioCard />"`
51
+ });
47
52
 
48
- // src/radio.tsx
49
- var import_jsx_runtime = require("react/jsx-runtime");
53
+ // src/use-radio.ts
54
+ var import_form_control = require("@yamada-ui/form-control");
55
+ var import_use_focus_visible = require("@yamada-ui/use-focus-visible");
56
+ var import_utils2 = require("@yamada-ui/utils");
57
+ var import_react = require("react");
50
58
  var useRadio = ({
51
59
  id,
52
60
  ...props
@@ -118,9 +126,11 @@ var useRadio = ({
118
126
  ...formControlProps,
119
127
  ...props2,
120
128
  ref,
121
- "data-checked": (0, import_utils2.dataAttr)(resolvedChecked)
129
+ "data-checked": (0, import_utils2.dataAttr)(resolvedChecked),
130
+ "data-focus": (0, import_utils2.dataAttr)(focused),
131
+ "data-focus-visible": (0, import_utils2.dataAttr)(focused && focusVisible)
122
132
  }),
123
- [resolvedChecked, formControlProps]
133
+ [resolvedChecked, formControlProps, focused, focusVisible]
124
134
  );
125
135
  const getIconProps = (0, import_react.useCallback)(
126
136
  (props2 = {}, ref = null) => ({
@@ -217,12 +227,15 @@ var useRadio = ({
217
227
  getLabelProps
218
228
  };
219
229
  };
220
- var Radio = (0, import_react.forwardRef)(
230
+
231
+ // src/radio.tsx
232
+ var import_jsx_runtime = require("react/jsx-runtime");
233
+ var Radio = (0, import_react2.forwardRef)(
221
234
  (props, ref) => {
222
235
  var _a, _b, _c, _d, _e;
223
236
  const group = useRadioGroupContext();
224
237
  const { value: groupValue, ...groupProps } = { ...group };
225
- const control = (0, import_form_control.useFormControl)(props);
238
+ const control = (0, import_form_control2.useFormControl)(props);
226
239
  const [styles, mergedProps] = (0, import_core.useComponentMultiStyle)("Radio", {
227
240
  ...groupProps,
228
241
  ...props
@@ -235,6 +248,7 @@ var Radio = (0, import_react.forwardRef)(
235
248
  isInvalid = (_b = groupProps.isInvalid) != null ? _b : control.isInvalid,
236
249
  isReadOnly = (_c = groupProps.isReadOnly) != null ? _c : control.isReadOnly,
237
250
  isRequired = (_d = groupProps.isRequired) != null ? _d : control.isRequired,
251
+ label,
238
252
  iconProps,
239
253
  inputProps,
240
254
  labelProps,
@@ -242,7 +256,7 @@ var Radio = (0, import_react.forwardRef)(
242
256
  } = (0, import_core.omitThemeProps)(mergedProps);
243
257
  (_e = computedProps.checked) != null ? _e : computedProps.checked = computedProps.isChecked;
244
258
  const checkedProp = groupValue && computedProps.value ? groupValue === computedProps.value : computedProps.checked;
245
- const onChange = groupProps.onChange && computedProps.value ? (0, import_utils2.funcAll)(groupProps.onChange, computedProps.onChange) : computedProps.onChange;
259
+ const onChange = groupProps.onChange && computedProps.value ? (0, import_utils3.funcAll)(groupProps.onChange, computedProps.onChange) : computedProps.onChange;
246
260
  const {
247
261
  checked,
248
262
  props: rest,
@@ -263,7 +277,7 @@ var Radio = (0, import_react.forwardRef)(
263
277
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
264
278
  import_core.ui.label,
265
279
  {
266
- className: (0, import_utils2.cx)("ui-radio", className),
280
+ className: (0, import_utils3.cx)("ui-radio", className),
267
281
  ...getContainerProps(rest),
268
282
  __css: {
269
283
  alignItems: "center",
@@ -307,7 +321,7 @@ var Radio = (0, import_react.forwardRef)(
307
321
  className: "ui-radio__label",
308
322
  ...getLabelProps(labelProps),
309
323
  __css: { ...styles.label },
310
- children
324
+ children: children != null ? children : label
311
325
  }
312
326
  )
313
327
  ]
@@ -318,9 +332,11 @@ var Radio = (0, import_react.forwardRef)(
318
332
  Radio.displayName = "Radio";
319
333
  Radio.__ui__ = "Radio";
320
334
 
321
- // src/radio-group.tsx
322
- var import_jsx_runtime2 = require("react/jsx-runtime");
323
- var isEvent = (value) => value && (0, import_utils3.isObject)(value) && (0, import_utils3.isObject)(value.target);
335
+ // src/use-radio-group.ts
336
+ var import_use_controllable_state = require("@yamada-ui/use-controllable-state");
337
+ var import_utils4 = require("@yamada-ui/utils");
338
+ var import_react3 = require("react");
339
+ var isEvent = (value) => value && (0, import_utils4.isObject)(value) && (0, import_utils4.isObject)(value.target);
324
340
  var useRadioGroup = ({
325
341
  id,
326
342
  name,
@@ -330,17 +346,17 @@ var useRadioGroup = ({
330
346
  onChange: onChangeProp,
331
347
  ...props
332
348
  }) => {
333
- const uuid = (0, import_react2.useId)();
349
+ const uuid = (0, import_react3.useId)();
334
350
  id != null ? id : id = uuid;
335
351
  name != null ? name : name = `radio-${id}`;
336
- const onChangeRef = (0, import_utils3.useCallbackRef)(onChangeProp);
352
+ const onChangeRef = (0, import_utils4.useCallbackRef)(onChangeProp);
337
353
  const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
338
354
  defaultValue,
339
355
  value: valueProp,
340
356
  onChange: onChangeRef
341
357
  });
342
- const containerRef = (0, import_react2.useRef)(null);
343
- const onFocus = (0, import_react2.useCallback)(() => {
358
+ const containerRef = (0, import_react3.useRef)(null);
359
+ const onFocus = (0, import_react3.useCallback)(() => {
344
360
  const container = containerRef.current;
345
361
  if (!container) return;
346
362
  let query = `input:not(:disabled):checked`;
@@ -353,22 +369,22 @@ var useRadioGroup = ({
353
369
  firstInput == null ? void 0 : firstInput.focus();
354
370
  }
355
371
  }, []);
356
- const onChange = (0, import_react2.useCallback)(
372
+ const onChange = (0, import_react3.useCallback)(
357
373
  (evOrValue) => {
358
374
  const nextValue = isEvent(evOrValue) ? evOrValue.target.value : evOrValue;
359
375
  setValue(nextValue);
360
376
  },
361
377
  [setValue]
362
378
  );
363
- const getContainerProps = (0, import_react2.useCallback)(
379
+ const getContainerProps = (0, import_react3.useCallback)(
364
380
  (props2 = {}, ref = null) => ({
365
381
  role: "radiogroup",
366
382
  ...props2,
367
- ref: (0, import_utils3.mergeRefs)(ref, containerRef)
383
+ ref: (0, import_utils4.mergeRefs)(ref, containerRef)
368
384
  }),
369
385
  []
370
386
  );
371
- const getRadioProps = (0, import_react2.useCallback)(
387
+ const getRadioProps = (0, import_react3.useCallback)(
372
388
  (props2 = {}, ref = null) => {
373
389
  const checked = props2.value === value;
374
390
  return {
@@ -397,7 +413,10 @@ var useRadioGroup = ({
397
413
  onFocus
398
414
  };
399
415
  };
400
- var RadioGroup = (0, import_react2.forwardRef)(
416
+
417
+ // src/radio-group.tsx
418
+ var import_jsx_runtime2 = require("react/jsx-runtime");
419
+ var RadioGroup = (0, import_react4.forwardRef)(
401
420
  ({
402
421
  id: idProp,
403
422
  className,
@@ -417,7 +436,7 @@ var RadioGroup = (0, import_react2.forwardRef)(
417
436
  isRequired,
418
437
  labelId,
419
438
  ...computedProps
420
- } = (0, import_form_control2.useFormControl)({
439
+ } = (0, import_form_control3.useFormControl)({
421
440
  id: idProp,
422
441
  ...props
423
442
  });
@@ -429,11 +448,10 @@ var RadioGroup = (0, import_react2.forwardRef)(
429
448
  getContainerProps,
430
449
  onChange
431
450
  } = useRadioGroup(computedProps);
432
- const validChildren = (0, import_utils3.getValidChildren)(children);
451
+ const validChildren = (0, import_utils5.getValidChildren)(children);
433
452
  let computedChildren = [];
434
- if (!validChildren.length && items.length) {
435
- computedChildren = items.map(({ label, value: value2, ...props2 }, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Radio, { value: value2, ...props2, children: label }, i));
436
- }
453
+ if (!validChildren.length && items.length)
454
+ computedChildren = items.map((props2, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Radio, { ...props2 }, index));
437
455
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
438
456
  RadioGroupProvider,
439
457
  {
@@ -453,7 +471,7 @@ var RadioGroup = (0, import_react2.forwardRef)(
453
471
  import_layouts.Flex,
454
472
  {
455
473
  ref,
456
- className: (0, import_utils3.cx)("ui-radio-group", className),
474
+ className: (0, import_utils5.cx)("ui-radio-group", className),
457
475
  gap: gap != null ? gap : direction === "row" ? "1rem" : void 0,
458
476
  ...getContainerProps({
459
477
  id,
@@ -472,7 +490,6 @@ RadioGroup.displayName = "RadioGroup";
472
490
  RadioGroup.__ui__ = "RadioGroup";
473
491
  // Annotate the CommonJS export names for ESM import in node:
474
492
  0 && (module.exports = {
475
- RadioGroup,
476
- useRadioGroup
493
+ RadioGroup
477
494
  });
478
495
  //# sourceMappingURL=radio-group.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/radio-group.tsx","../src/radio.tsx","../src/radio-context.ts"],"sourcesContent":["import type { ComponentArgs, PropGetter, ThemeProps } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { FlexProps } from \"@yamada-ui/layouts\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type {\n ChangeEvent,\n ForwardedRef,\n ReactElement,\n RefAttributes,\n} from \"react\"\nimport type { RadioProps } from \"./radio\"\nimport type { RadioGroupContext } from \"./radio-context\"\nimport { useFormControl } from \"@yamada-ui/form-control\"\nimport { Flex } from \"@yamada-ui/layouts\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport {\n cx,\n getValidChildren,\n isObject,\n mergeRefs,\n useCallbackRef,\n} from \"@yamada-ui/utils\"\nimport { forwardRef, useCallback, useId, useRef } from \"react\"\nimport { Radio } from \"./radio\"\nimport { RadioGroupProvider } from \"./radio-context\"\n\nexport type RadioItem<Y extends number | string = string> = {\n label?: string\n} & RadioProps<Y>\n\nconst isEvent = (value: any): value is { target: HTMLInputElement } =>\n value && isObject(value) && isObject(value.target)\n\nexport interface UseRadioGroupProps<Y extends number | string = string> {\n /**\n * The top-level id string that will be applied to the radios.\n * The index of the radio will be appended to this top-level id.\n */\n id?: string\n /**\n * The HTML `name` attribute used for forms.\n */\n name?: string\n /**\n * The initial value of the radio group.\n */\n defaultValue?: Y\n /**\n * If `true`, input elements will receive `checked` attribute instead of `isChecked`.\n *\n * This assumes, you're using native radio inputs.\n *\n * @default false\n */\n isNative?: boolean\n /**\n * The value of the radio group.\n */\n value?: Y\n /**\n * The callback fired when any children radio is checked or unchecked.\n */\n onChange?: (value: Y) => void\n}\n\nexport const useRadioGroup = <\n Y extends number | string,\n M extends Dict = Dict,\n>({\n id,\n name,\n defaultValue,\n isNative,\n value: valueProp,\n onChange: onChangeProp,\n ...props\n}: M & UseRadioGroupProps<Y>) => {\n const uuid = useId()\n\n id ??= uuid\n name ??= `radio-${id}`\n\n const onChangeRef = useCallbackRef(onChangeProp)\n\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeRef,\n })\n\n const containerRef = useRef<any>(null)\n\n const onFocus = useCallback(() => {\n const container = containerRef.current\n\n if (!container) return\n\n let query = `input:not(:disabled):checked`\n\n let firstInput = container.querySelector(query) as HTMLElement | undefined\n\n if (firstInput) {\n firstInput.focus()\n } else {\n query = `input:not(:disabled)`\n firstInput = container.querySelector(query) as HTMLElement | undefined\n\n firstInput?.focus()\n }\n }, [])\n\n const onChange = useCallback(\n (evOrValue: ChangeEvent<HTMLInputElement> | Y) => {\n const nextValue = (\n isEvent(evOrValue) ? evOrValue.target.value : evOrValue\n ) as Y\n\n setValue(nextValue)\n },\n [setValue],\n )\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n role: \"radiogroup\",\n ...props,\n ref: mergeRefs(ref, containerRef),\n }),\n [],\n )\n\n const getRadioProps: PropGetter<\n { value?: Y },\n {\n checked?: boolean\n isChecked?: boolean\n value?: Y\n }\n > = useCallback(\n (props = {}, ref = null) => {\n const checked = props.value === value\n\n return {\n ...props,\n ref,\n name,\n \"aria-checked\": checked,\n [isNative ? \"checked\" : \"isChecked\"]:\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n value != null ? checked : undefined,\n onChange,\n }\n },\n [name, value, onChange, isNative],\n )\n\n return {\n id,\n name,\n props,\n setValue,\n value,\n getContainerProps,\n getRadioProps,\n onChange,\n onFocus,\n }\n}\n\nexport type UseRadioGroupReturn<Y extends number | string = string> =\n ReturnType<typeof useRadioGroup<Y>>\n\nexport interface RadioGroupProps<Y extends number | string = string>\n extends ThemeProps<\"Radio\">,\n Omit<FlexProps, \"defaultValue\" | \"onChange\">,\n UseRadioGroupProps<Y>,\n FormControlOptions {\n /**\n * If provided, generate radios based on items.\n *\n * @default '[]'\n */\n items?: RadioItem<Y>[]\n}\n\nexport const RadioGroup = forwardRef(\n <Y extends number | string = string>(\n {\n id: idProp,\n className,\n colorScheme,\n size,\n variant,\n children,\n direction = \"column\",\n gap,\n items = [],\n ...props\n }: RadioGroupProps<Y>,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const {\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n labelId,\n ...computedProps\n } = useFormControl({\n id: idProp,\n ...props,\n })\n const {\n id,\n name,\n props: rest,\n value,\n getContainerProps,\n onChange,\n } = useRadioGroup(computedProps)\n\n const validChildren = getValidChildren(children)\n let computedChildren: ReactElement[] = []\n\n if (!validChildren.length && items.length) {\n computedChildren = items.map(({ label, value, ...props }, i) => (\n <Radio key={i} value={value} {...props}>\n {label}\n </Radio>\n ))\n }\n\n return (\n <RadioGroupProvider\n value={\n {\n name,\n colorScheme,\n size,\n variant,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n value,\n onChange,\n } as RadioGroupContext\n }\n >\n <Flex\n ref={ref}\n className={cx(\"ui-radio-group\", className)}\n gap={gap ?? (direction === \"row\" ? \"1rem\" : undefined)}\n {...getContainerProps({\n id,\n \"aria-labelledby\": labelId,\n ...rest,\n })}\n direction={direction}\n >\n {children ?? computedChildren}\n </Flex>\n </RadioGroupProvider>\n )\n },\n) as {\n <Y extends number | string = string>(\n props: RadioGroupProps<Y> & RefAttributes<HTMLDivElement>,\n ): ReactElement\n} & ComponentArgs\n\nRadioGroup.displayName = \"RadioGroup\"\nRadioGroup.__ui__ = \"RadioGroup\"\n","import type {\n ComponentArgs,\n HTMLUIProps,\n PropGetter,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type {\n ChangeEvent,\n ChangeEventHandler,\n ForwardedRef,\n InputHTMLAttributes,\n KeyboardEvent,\n ReactElement,\n RefAttributes,\n SyntheticEvent,\n} from \"react\"\nimport { omitThemeProps, ui, useComponentMultiStyle } from \"@yamada-ui/core\"\nimport {\n formControlProperties,\n useFormControl,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { trackFocusVisible } from \"@yamada-ui/use-focus-visible\"\nimport {\n cx,\n dataAttr,\n funcAll,\n handlerAll,\n splitObject,\n useCallbackRef,\n} from \"@yamada-ui/utils\"\nimport { forwardRef, useCallback, useEffect, useId, useState } from \"react\"\nimport { useRadioGroupContext } from \"./radio-context\"\n\nexport interface UseRadioProps<Y extends number | string = string>\n extends FormControlOptions {\n /**\n * id assigned to input.\n */\n id?: string\n /**\n * The name of the input field in a radio.\n */\n name?: string\n /**\n * If `true`, the radio will be checked.\n *\n * @default false\n */\n checked?: boolean\n /**\n * If `true`, the radio will be initially checked.\n *\n * @default false\n */\n defaultChecked?: boolean\n /**\n * If `true`, the radio will be initially checked.\n *\n * @default false\n *\n * @deprecated Use `defaultChecked` instead.\n */\n defaultIsChecked?: boolean\n /**\n * If `true`, the radio will be checked.\n *\n * @default false\n *\n * @deprecated Use `checked` instead.\n */\n isChecked?: boolean\n /**\n * The value to be used in the radio button.\n */\n value?: Y\n /**\n * The callback invoked when the checked state changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>\n}\n\nexport const useRadio = <\n Y extends number | string = string,\n M extends Dict = Dict,\n>({\n id,\n ...props\n}: M & UseRadioProps<Y>) => {\n const uuid = useId()\n\n id ??= uuid\n\n let {\n id: _id,\n name,\n checked: checkedProp,\n defaultChecked,\n defaultIsChecked,\n isChecked: isCheckedProp,\n value,\n onChange: onChangeProp,\n ...computedProps\n } = useFormControlProps({ id, ...props })\n\n checkedProp ??= isCheckedProp\n defaultChecked ??= defaultIsChecked\n\n const [\n {\n \"aria-readonly\": _ariaReadonly,\n disabled,\n readOnly,\n required,\n onBlur: onBlurProp,\n onFocus: onFocusProp,\n ...formControlProps\n },\n rest,\n ] = splitObject(computedProps, formControlProperties)\n\n const [focusVisible, setFocusVisible] = useState<boolean>(false)\n const [focused, setFocused] = useState<boolean>(false)\n const [hovered, setHovered] = useState<boolean>(false)\n const [active, setActive] = useState<boolean>(false)\n\n const [checked, setChecked] = useState<boolean>(!!defaultChecked)\n\n const controlled = checkedProp !== undefined\n const resolvedChecked = controlled ? (checkedProp as boolean) : checked\n\n useEffect(() => {\n return trackFocusVisible(setFocusVisible)\n }, [])\n\n const onChange = useCallbackRef(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (readOnly || disabled) {\n ev.preventDefault()\n\n return\n }\n\n if (!controlled) setChecked(ev.target.checked)\n\n onChangeProp?.(ev)\n },\n [readOnly, disabled, controlled],\n )\n const onFocus = useCallbackRef(onFocusProp)\n const onBlur = useCallbackRef(onBlurProp)\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent) => {\n if (key === \" \") setActive(true)\n },\n [setActive],\n )\n\n const onKeyUp = useCallback(\n ({ key }: KeyboardEvent) => {\n if (key === \" \") setActive(false)\n },\n [setActive],\n )\n\n const getContainerProps: PropGetter<\"label\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-checked\": dataAttr(resolvedChecked),\n }),\n [resolvedChecked, formControlProps],\n )\n\n const getIconProps: PropGetter<\"span\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"aria-hidden\": true,\n \"data-active\": dataAttr(active),\n \"data-checked\": dataAttr(resolvedChecked),\n \"data-focus\": dataAttr(focused),\n \"data-focus-visible\": dataAttr(focused && focusVisible),\n \"data-hover\": dataAttr(hovered),\n onMouseDown: handlerAll(props.onMouseDown, () => setActive(true)),\n onMouseEnter: handlerAll(props.onMouseEnter, () => setHovered(true)),\n onMouseLeave: handlerAll(props.onMouseLeave, () => setHovered(false)),\n onMouseUp: handlerAll(props.onMouseUp, () => setActive(false)),\n }),\n [resolvedChecked, active, focused, focusVisible, hovered, formControlProps],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n id,\n ref,\n type: \"radio\",\n name,\n style: {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: \"0px\",\n position: \"absolute\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n },\n \"aria-checked\": resolvedChecked,\n checked: resolvedChecked,\n disabled,\n readOnly,\n required,\n value,\n onBlur: handlerAll(props.onBlur, onBlur, () => setFocused(false)),\n onChange: handlerAll(props.onChange, onChange),\n onFocus: handlerAll(props.onFocus, onFocus, () => setFocused(true)),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n onKeyUp: handlerAll(props.onKeyUp, onKeyUp),\n }),\n [\n formControlProps,\n id,\n name,\n value,\n required,\n disabled,\n readOnly,\n resolvedChecked,\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onKeyUp,\n ],\n )\n\n const getLabelProps: PropGetter<\"span\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-checked\": dataAttr(resolvedChecked),\n onMouseDown: handlerAll(props.onMouseDown, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n onTouchStart: handlerAll(props.onTouchStart, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n }),\n [resolvedChecked, formControlProps],\n )\n\n return {\n active,\n checked: resolvedChecked,\n focused,\n focusVisible,\n hovered,\n props: rest,\n getContainerProps,\n getIconProps,\n getInputProps,\n getLabelProps,\n }\n}\n\nexport type UseRadioReturn = ReturnType<typeof useRadio>\n\ninterface RadioOptions {\n iconProps?: HTMLUIProps<\"span\">\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n labelProps?: HTMLUIProps<\"span\">\n}\n\nexport interface RadioProps<Y extends number | string = string>\n extends Omit<HTMLUIProps<\"label\">, keyof UseRadioProps>,\n ThemeProps<\"Radio\">,\n UseRadioProps<Y>,\n RadioOptions {}\n\n/**\n * `Radio` is a component used for allowing users to select one option from multiple choices.\n *\n * @see Docs https://yamada-ui.com/components/forms/radio\n */\nexport const Radio = forwardRef(\n <Y extends number | string = string>(\n props: RadioProps<Y>,\n ref: ForwardedRef<HTMLInputElement>,\n ) => {\n const group = useRadioGroupContext()\n const { value: groupValue, ...groupProps } = { ...group }\n const control = useFormControl(props)\n const [styles, mergedProps] = useComponentMultiStyle(\"Radio\", {\n ...groupProps,\n ...props,\n })\n const {\n className,\n children,\n gap = \"0.5rem\",\n isDisabled = groupProps.isDisabled ?? control.isDisabled,\n isInvalid = groupProps.isInvalid ?? control.isInvalid,\n isReadOnly = groupProps.isReadOnly ?? control.isReadOnly,\n isRequired = groupProps.isRequired ?? control.isRequired,\n iconProps,\n inputProps,\n labelProps,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n computedProps.checked ??= computedProps.isChecked\n\n const checkedProp =\n groupValue && computedProps.value\n ? groupValue === computedProps.value\n : computedProps.checked\n\n const onChange =\n groupProps.onChange && computedProps.value\n ? funcAll(groupProps.onChange, computedProps.onChange)\n : computedProps.onChange\n\n const {\n checked,\n props: rest,\n getContainerProps,\n getIconProps,\n getInputProps,\n getLabelProps,\n } = useRadio({\n ...computedProps,\n checked: checkedProp,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n onChange,\n })\n\n const tabIndex = !groupValue ? 0 : checked ? 0 : -1\n\n return (\n <ui.label\n className={cx(\"ui-radio\", className)}\n {...getContainerProps(rest)}\n __css={{\n alignItems: \"center\",\n cursor: \"pointer\",\n display: \"inline-flex\",\n gap,\n position: \"relative\",\n verticalAlign: \"top\",\n ...styles.container,\n }}\n >\n <ui.input\n className=\"ui-radio__input\"\n {...getInputProps(\n {\n ...inputProps,\n tabIndex,\n },\n ref,\n )}\n />\n\n <ui.div\n className=\"ui-radio__icon\"\n {...getIconProps(iconProps)}\n __css={{\n display: \"inline-block\",\n position: \"relative\",\n userSelect: \"none\",\n ...styles.icon,\n }}\n />\n\n <ui.span\n className=\"ui-radio__label\"\n {...getLabelProps(labelProps)}\n __css={{ ...styles.label }}\n >\n {children}\n </ui.span>\n </ui.label>\n )\n },\n) as {\n <Y extends number | string = string>(\n props: RadioProps<Y> & RefAttributes<HTMLInputElement>,\n ): ReactElement\n} & ComponentArgs\n\nRadio.displayName = \"Radio\"\nRadio.__ui__ = \"Radio\"\n","import type { ThemeProps } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { ChangeEvent } from \"react\"\nimport { createContext } from \"@yamada-ui/utils\"\n\nexport interface RadioGroupContext\n extends ThemeProps<\"Radio\">,\n FormControlOptions {\n name: string\n value: number | string\n onChange: (evOrValue: ChangeEvent<HTMLInputElement> | number | string) => void\n}\n\nexport const [RadioGroupProvider, useRadioGroupContext] = createContext<\n RadioGroupContext | undefined\n>({\n name: \"RadioGroupContext\",\n strict: false,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,IAAAA,uBAA+B;AAC/B,qBAAqB;AACrB,oCAAqC;AACrC,IAAAC,gBAMO;AACP,IAAAC,gBAAuD;;;ACJvD,kBAA2D;AAC3D,0BAIO;AACP,+BAAkC;AAClC,IAAAC,gBAOO;AACP,mBAAoE;;;AC9BpE,mBAA8B;AAUvB,IAAM,CAAC,oBAAoB,oBAAoB,QAAI,4BAExD;AAAA,EACA,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;;;ADgVK;AA9QC,IAAM,WAAW,CAGtB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4B;AAC1B,QAAM,WAAO,oBAAM;AAEnB,yBAAO;AAEP,MAAI;AAAA,IACF,IAAI;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,UAAU;AAAA,IACV,GAAG;AAAA,EACL,QAAI,yCAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;AAExC,oDAAgB;AAChB,6DAAmB;AAEnB,QAAM;AAAA,IACJ;AAAA,MACE,iBAAiB;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,GAAG;AAAA,IACL;AAAA,IACA;AAAA,EACF,QAAI,2BAAY,eAAe,yCAAqB;AAEpD,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAkB,KAAK;AAC/D,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAkB,KAAK;AACrD,QAAM,CAAC,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,mBADS,CAEZ,CACD;AAAA,IACH;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OACE;AAAA,UACE;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QAGF;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,eAAW,kBAAG,kBAAkB,SAAS;AAAA,YACzC,KAAK,oBAAQ,cAAc,QAAQ,SAAS;AAAA,YAC3C,GAAG,kBAAkB;AAAA,cACpB;AAAA,cACA,mBAAmB;AAAA,cACnB,GAAG;AAAA,YACL,CAAC;AAAA,YACD;AAAA,YAEC,wCAAY;AAAA;AAAA,QACf;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAMA,WAAW,cAAc;AACzB,WAAW,SAAS;","names":["import_form_control","import_utils","import_react","import_utils","props","import_jsx_runtime","props","value"]}
1
+ {"version":3,"sources":["../src/radio-group.tsx","../src/radio.tsx","../src/radio-context.ts","../src/use-radio.ts","../src/use-radio-group.ts"],"sourcesContent":["import type { ComponentArgs, ThemeProps } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { FlexProps } from \"@yamada-ui/layouts\"\nimport type { ForwardedRef, ReactElement, RefAttributes } from \"react\"\nimport type { RadioProps } from \"./radio\"\nimport type { RadioGroupContext } from \"./radio-context\"\nimport type { UseRadioGroupProps } from \"./use-radio-group\"\nimport { useFormControl } from \"@yamada-ui/form-control\"\nimport { Flex } from \"@yamada-ui/layouts\"\nimport { cx, getValidChildren } from \"@yamada-ui/utils\"\nimport { forwardRef } from \"react\"\nimport { Radio } from \"./radio\"\nimport { RadioGroupProvider } from \"./radio-context\"\nimport { useRadioGroup } from \"./use-radio-group\"\n\nexport type RadioItem<Y extends number | string = string> = RadioProps<Y>\n\nexport interface RadioGroupSharedProps<Y extends number | string = string>\n extends Omit<FlexProps, \"defaultValue\" | \"onChange\">,\n UseRadioGroupProps<Y>,\n FormControlOptions {}\n\nexport interface RadioGroupProps<Y extends number | string = string>\n extends RadioGroupSharedProps<Y>,\n ThemeProps<\"Radio\"> {\n /**\n * If provided, generate radios based on items.\n *\n * @default '[]'\n */\n items?: RadioItem<Y>[]\n}\n\n/**\n * `RadioGroup` is a component that groups `Radio` components.\n *\n * @see Docs https://yamada-ui.com/components/forms/radio\n */\nexport const RadioGroup = forwardRef(\n <Y extends number | string = string>(\n {\n id: idProp,\n className,\n colorScheme,\n size,\n variant,\n children,\n direction = \"column\",\n gap,\n items = [],\n ...props\n }: RadioGroupProps<Y>,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const {\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n labelId,\n ...computedProps\n } = useFormControl({\n id: idProp,\n ...props,\n })\n const {\n id,\n name,\n props: rest,\n value,\n getContainerProps,\n onChange,\n } = useRadioGroup(computedProps)\n\n const validChildren = getValidChildren(children)\n let computedChildren: ReactElement[] = []\n\n if (!validChildren.length && items.length)\n computedChildren = items.map((props, index) => (\n <Radio key={index} {...props} />\n ))\n\n return (\n <RadioGroupProvider\n value={\n {\n name,\n colorScheme,\n size,\n variant,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n value,\n onChange,\n } as RadioGroupContext\n }\n >\n <Flex\n ref={ref}\n className={cx(\"ui-radio-group\", className)}\n gap={gap ?? (direction === \"row\" ? \"1rem\" : undefined)}\n {...getContainerProps({\n id,\n \"aria-labelledby\": labelId,\n ...rest,\n })}\n direction={direction}\n >\n {children ?? computedChildren}\n </Flex>\n </RadioGroupProvider>\n )\n },\n) as {\n <Y extends number | string = string>(\n props: RadioGroupProps<Y> & RefAttributes<HTMLDivElement>,\n ): ReactElement\n} & ComponentArgs\n\nRadioGroup.displayName = \"RadioGroup\"\nRadioGroup.__ui__ = \"RadioGroup\"\n","import type { ComponentArgs, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type {\n ForwardedRef,\n InputHTMLAttributes,\n ReactElement,\n ReactNode,\n RefAttributes,\n} from \"react\"\nimport type { UseRadioProps } from \"./use-radio\"\nimport { omitThemeProps, ui, useComponentMultiStyle } from \"@yamada-ui/core\"\nimport { useFormControl } from \"@yamada-ui/form-control\"\nimport { cx, funcAll } from \"@yamada-ui/utils\"\nimport { forwardRef } from \"react\"\nimport { useRadioGroupContext } from \"./radio-context\"\nimport { useRadio } from \"./use-radio\"\n\ninterface RadioOptions {\n /**\n * The label of the radio.\n */\n label?: ReactNode\n /**\n * Props for icon element.\n */\n iconProps?: HTMLUIProps<\"span\">\n /**\n * Props for input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n /**\n * Props for label element.\n */\n labelProps?: HTMLUIProps<\"span\">\n}\n\nexport interface RadioProps<Y extends number | string = string>\n extends Omit<HTMLUIProps<\"label\">, keyof UseRadioProps>,\n ThemeProps<\"Radio\">,\n UseRadioProps<Y>,\n RadioOptions {}\n\n/**\n * `Radio` is a component used for allowing users to select one option from multiple choices.\n *\n * @see Docs https://yamada-ui.com/components/forms/radio\n */\nexport const Radio = forwardRef(\n <Y extends number | string = string>(\n props: RadioProps<Y>,\n ref: ForwardedRef<HTMLInputElement>,\n ) => {\n const group = useRadioGroupContext()\n const { value: groupValue, ...groupProps } = { ...group }\n const control = useFormControl(props)\n const [styles, mergedProps] = useComponentMultiStyle(\"Radio\", {\n ...groupProps,\n ...props,\n })\n const {\n className,\n children,\n gap = \"0.5rem\",\n isDisabled = groupProps.isDisabled ?? control.isDisabled,\n isInvalid = groupProps.isInvalid ?? control.isInvalid,\n isReadOnly = groupProps.isReadOnly ?? control.isReadOnly,\n isRequired = groupProps.isRequired ?? control.isRequired,\n label,\n iconProps,\n inputProps,\n labelProps,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n computedProps.checked ??= computedProps.isChecked\n\n const checkedProp =\n groupValue && computedProps.value\n ? groupValue === computedProps.value\n : computedProps.checked\n\n const onChange =\n groupProps.onChange && computedProps.value\n ? funcAll(groupProps.onChange, computedProps.onChange)\n : computedProps.onChange\n\n const {\n checked,\n props: rest,\n getContainerProps,\n getIconProps,\n getInputProps,\n getLabelProps,\n } = useRadio({\n ...computedProps,\n checked: checkedProp,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n onChange,\n })\n\n const tabIndex = !groupValue ? 0 : checked ? 0 : -1\n\n return (\n <ui.label\n className={cx(\"ui-radio\", className)}\n {...getContainerProps(rest)}\n __css={{\n alignItems: \"center\",\n cursor: \"pointer\",\n display: \"inline-flex\",\n gap,\n position: \"relative\",\n verticalAlign: \"top\",\n ...styles.container,\n }}\n >\n <ui.input\n className=\"ui-radio__input\"\n {...getInputProps(\n {\n ...inputProps,\n tabIndex,\n },\n ref,\n )}\n />\n\n <ui.div\n className=\"ui-radio__icon\"\n {...getIconProps(iconProps)}\n __css={{\n display: \"inline-block\",\n position: \"relative\",\n userSelect: \"none\",\n ...styles.icon,\n }}\n />\n\n <ui.span\n className=\"ui-radio__label\"\n {...getLabelProps(labelProps)}\n __css={{ ...styles.label }}\n >\n {children ?? label}\n </ui.span>\n </ui.label>\n )\n },\n) as {\n <Y extends number | string = string>(\n props: RadioProps<Y> & RefAttributes<HTMLInputElement>,\n ): ReactElement\n} & ComponentArgs\n\nRadio.displayName = \"Radio\"\nRadio.__ui__ = \"Radio\"\n","import type {\n CSSUIObject,\n HTMLUIProps,\n PropGetter,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { ChangeEvent } from \"react\"\nimport type { RadioCardProps } from \"./radio-card\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface RadioGroupSharedContext extends FormControlOptions {\n name: string\n value: number | string\n onChange: (evOrValue: ChangeEvent<HTMLInputElement> | number | string) => void\n}\n\nexport interface RadioGroupContext\n extends RadioGroupSharedContext,\n ThemeProps<\"Radio\"> {}\n\nexport const [RadioGroupProvider, useRadioGroupContext] =\n createContext<RadioGroupContext>({\n name: \"RadioGroupContext\",\n strict: false,\n })\n\nexport interface RadioCardGroupContext\n extends RadioGroupSharedContext,\n Pick<\n RadioCardProps,\n \"addonProps\" | \"descriptionProps\" | \"labelProps\" | \"withIcon\"\n >,\n ThemeProps<\"RadioCard\"> {}\n\nexport const [RadioCardGroupProvider, useRadioCardGroupContext] =\n createContext<RadioCardGroupContext>({\n name: \"RadioCardGroupContext\",\n strict: false,\n })\n\nexport interface RadioCardContext {\n styles: { [key: string]: CSSUIObject | undefined }\n withIcon: boolean\n getIconProps: PropGetter\n iconProps?: HTMLUIProps\n}\n\nexport const [RadioCardProvider, useRadioCardContext] =\n createContext<RadioCardContext>({\n name: \"RadioCardContext\",\n errorMessage: `useRadioCardContext returned is 'undefined'. Seems you forgot to wrap the components in \"<RadioCard />\"`,\n })\n","import type { PropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type {\n ChangeEvent,\n ChangeEventHandler,\n KeyboardEvent,\n SyntheticEvent,\n} from \"react\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { trackFocusVisible } from \"@yamada-ui/use-focus-visible\"\nimport {\n dataAttr,\n handlerAll,\n splitObject,\n useCallbackRef,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useId, useState } from \"react\"\n\nexport interface UseRadioProps<Y extends number | string = string>\n extends FormControlOptions {\n /**\n * id assigned to input.\n */\n id?: string\n /**\n * The name of the input field in a radio.\n */\n name?: string\n /**\n * If `true`, the radio will be checked.\n *\n * @default false\n */\n checked?: boolean\n /**\n * If `true`, the radio will be initially checked.\n *\n * @default false\n */\n defaultChecked?: boolean\n /**\n * If `true`, the radio will be initially checked.\n *\n * @default false\n *\n * @deprecated Use `defaultChecked` instead.\n */\n defaultIsChecked?: boolean\n /**\n * If `true`, the radio will be checked.\n *\n * @default false\n *\n * @deprecated Use `checked` instead.\n */\n isChecked?: boolean\n /**\n * The value to be used in the radio button.\n */\n value?: Y\n /**\n * The callback invoked when the checked state changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>\n}\n\nexport const useRadio = <\n Y extends number | string = string,\n M extends Dict = Dict,\n>({\n id,\n ...props\n}: M & UseRadioProps<Y>) => {\n const uuid = useId()\n\n id ??= uuid\n\n let {\n id: _id,\n name,\n checked: checkedProp,\n defaultChecked,\n defaultIsChecked,\n isChecked: isCheckedProp,\n value,\n onChange: onChangeProp,\n ...computedProps\n } = useFormControlProps({ id, ...props })\n\n checkedProp ??= isCheckedProp\n defaultChecked ??= defaultIsChecked\n\n const [\n {\n \"aria-readonly\": _ariaReadonly,\n disabled,\n readOnly,\n required,\n onBlur: onBlurProp,\n onFocus: onFocusProp,\n ...formControlProps\n },\n rest,\n ] = splitObject(computedProps, formControlProperties)\n\n const [focusVisible, setFocusVisible] = useState<boolean>(false)\n const [focused, setFocused] = useState<boolean>(false)\n const [hovered, setHovered] = useState<boolean>(false)\n const [active, setActive] = useState<boolean>(false)\n\n const [checked, setChecked] = useState<boolean>(!!defaultChecked)\n\n const controlled = checkedProp !== undefined\n const resolvedChecked = controlled ? (checkedProp as boolean) : checked\n\n useEffect(() => {\n return trackFocusVisible(setFocusVisible)\n }, [])\n\n const onChange = useCallbackRef(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (readOnly || disabled) {\n ev.preventDefault()\n\n return\n }\n\n if (!controlled) setChecked(ev.target.checked)\n\n onChangeProp?.(ev)\n },\n [readOnly, disabled, controlled],\n )\n const onFocus = useCallbackRef(onFocusProp)\n const onBlur = useCallbackRef(onBlurProp)\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent) => {\n if (key === \" \") setActive(true)\n },\n [setActive],\n )\n\n const onKeyUp = useCallback(\n ({ key }: KeyboardEvent) => {\n if (key === \" \") setActive(false)\n },\n [setActive],\n )\n\n const getContainerProps: PropGetter<\"label\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-checked\": dataAttr(resolvedChecked),\n \"data-focus\": dataAttr(focused),\n \"data-focus-visible\": dataAttr(focused && focusVisible),\n }),\n [resolvedChecked, formControlProps, focused, focusVisible],\n )\n\n const getIconProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"aria-hidden\": true,\n \"data-active\": dataAttr(active),\n \"data-checked\": dataAttr(resolvedChecked),\n \"data-focus\": dataAttr(focused),\n \"data-focus-visible\": dataAttr(focused && focusVisible),\n \"data-hover\": dataAttr(hovered),\n onMouseDown: handlerAll(props.onMouseDown, () => setActive(true)),\n onMouseEnter: handlerAll(props.onMouseEnter, () => setHovered(true)),\n onMouseLeave: handlerAll(props.onMouseLeave, () => setHovered(false)),\n onMouseUp: handlerAll(props.onMouseUp, () => setActive(false)),\n }),\n [resolvedChecked, active, focused, focusVisible, hovered, formControlProps],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n id,\n ref,\n type: \"radio\",\n name,\n style: {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: \"0px\",\n position: \"absolute\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n },\n \"aria-checked\": resolvedChecked,\n checked: resolvedChecked,\n disabled,\n readOnly,\n required,\n value,\n onBlur: handlerAll(props.onBlur, onBlur, () => setFocused(false)),\n onChange: handlerAll(props.onChange, onChange),\n onFocus: handlerAll(props.onFocus, onFocus, () => setFocused(true)),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n onKeyUp: handlerAll(props.onKeyUp, onKeyUp),\n }),\n [\n formControlProps,\n id,\n name,\n value,\n required,\n disabled,\n readOnly,\n resolvedChecked,\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onKeyUp,\n ],\n )\n\n const getLabelProps: PropGetter<\"span\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref,\n \"data-checked\": dataAttr(resolvedChecked),\n onMouseDown: handlerAll(props.onMouseDown, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n onTouchStart: handlerAll(props.onTouchStart, (ev: SyntheticEvent) => {\n ev.preventDefault()\n ev.stopPropagation()\n }),\n }),\n [resolvedChecked, formControlProps],\n )\n\n return {\n active,\n checked: resolvedChecked,\n focused,\n focusVisible,\n hovered,\n props: rest,\n getContainerProps,\n getIconProps,\n getInputProps,\n getLabelProps,\n }\n}\n\nexport type UseRadioReturn = ReturnType<typeof useRadio>\n","import type { PropGetter } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type { ChangeEvent } from \"react\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { isObject, mergeRefs, useCallbackRef } from \"@yamada-ui/utils\"\nimport { useCallback, useId, useRef } from \"react\"\n\nconst isEvent = (value: any): value is { target: HTMLInputElement } =>\n value && isObject(value) && isObject(value.target)\n\nexport interface UseRadioGroupProps<Y extends number | string = string> {\n /**\n * The top-level id string that will be applied to the radios.\n * The index of the radio will be appended to this top-level id.\n */\n id?: string\n /**\n * The HTML `name` attribute used for forms.\n */\n name?: string\n /**\n * The initial value of the radio group.\n */\n defaultValue?: Y\n /**\n * If `true`, input elements will receive `checked` attribute instead of `isChecked`.\n *\n * This assumes, you're using native radio inputs.\n *\n * @default false\n */\n isNative?: boolean\n /**\n * The value of the radio group.\n */\n value?: Y\n /**\n * The callback fired when any children radio is checked or unchecked.\n */\n onChange?: (value: Y) => void\n}\n\nexport const useRadioGroup = <\n Y extends number | string,\n M extends Dict = Dict,\n>({\n id,\n name,\n defaultValue,\n isNative,\n value: valueProp,\n onChange: onChangeProp,\n ...props\n}: M & UseRadioGroupProps<Y>) => {\n const uuid = useId()\n\n id ??= uuid\n name ??= `radio-${id}`\n\n const onChangeRef = useCallbackRef(onChangeProp)\n\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeRef,\n })\n\n const containerRef = useRef<any>(null)\n\n const onFocus = useCallback(() => {\n const container = containerRef.current\n\n if (!container) return\n\n let query = `input:not(:disabled):checked`\n\n let firstInput = container.querySelector(query) as HTMLElement | undefined\n\n if (firstInput) {\n firstInput.focus()\n } else {\n query = `input:not(:disabled)`\n firstInput = container.querySelector(query) as HTMLElement | undefined\n\n firstInput?.focus()\n }\n }, [])\n\n const onChange = useCallback(\n (evOrValue: ChangeEvent<HTMLInputElement> | Y) => {\n const nextValue = (\n isEvent(evOrValue) ? evOrValue.target.value : evOrValue\n ) as Y\n\n setValue(nextValue)\n },\n [setValue],\n )\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n role: \"radiogroup\",\n ...props,\n ref: mergeRefs(ref, containerRef),\n }),\n [],\n )\n\n const getRadioProps: PropGetter<\n { value?: Y },\n {\n checked?: boolean\n isChecked?: boolean\n value?: Y\n }\n > = useCallback(\n (props = {}, ref = null) => {\n const checked = props.value === value\n\n return {\n ...props,\n ref,\n name,\n \"aria-checked\": checked,\n [isNative ? \"checked\" : \"isChecked\"]:\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n value != null ? checked : undefined,\n onChange,\n }\n },\n [name, value, onChange, isNative],\n )\n\n return {\n id,\n name,\n props,\n setValue,\n value,\n getContainerProps,\n getRadioProps,\n onChange,\n onFocus,\n }\n}\n\nexport type UseRadioGroupReturn<Y extends number | string = string> =\n ReturnType<typeof useRadioGroup<Y>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,IAAAA,uBAA+B;AAC/B,qBAAqB;AACrB,IAAAC,gBAAqC;AACrC,IAAAC,gBAA2B;;;ACD3B,kBAA2D;AAC3D,IAAAC,uBAA+B;AAC/B,IAAAC,gBAA4B;AAC5B,IAAAC,gBAA2B;;;ACH3B,mBAA8B;AAYvB,IAAM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;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QAGF;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,eAAW,kBAAG,kBAAkB,SAAS;AAAA,YACzC,KAAK,oBAAQ,cAAc,QAAQ,SAAS;AAAA,YAC3C,GAAG,kBAAkB;AAAA,cACpB;AAAA,cACA,mBAAmB;AAAA,cACnB,GAAG;AAAA,YACL,CAAC;AAAA,YACD;AAAA,YAEC,wCAAY;AAAA;AAAA,QACf;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAMA,WAAW,cAAc;AACzB,WAAW,SAAS;","names":["import_form_control","import_utils","import_react","import_form_control","import_utils","import_react","import_utils","props","import_utils","import_react","props","import_jsx_runtime","props"]}
@@ -1,12 +1,12 @@
1
1
  "use client"
2
2
  import {
3
- RadioGroup,
4
- useRadioGroup
5
- } from "./chunk-QAADRIFZ.mjs";
6
- import "./chunk-PUPRIHYJ.mjs";
7
- import "./chunk-6FMV6NX2.mjs";
3
+ RadioGroup
4
+ } from "./chunk-YDYOLCNG.mjs";
5
+ import "./chunk-JLL7F3NY.mjs";
6
+ import "./chunk-AOVCDCCW.mjs";
7
+ import "./chunk-HFS5TQ47.mjs";
8
+ import "./chunk-ZLJHOIFP.mjs";
8
9
  export {
9
- RadioGroup,
10
- useRadioGroup
10
+ RadioGroup
11
11
  };
12
12
  //# sourceMappingURL=radio-group.mjs.map