@yamada-ui/radio 1.2.10-next-20241005220055 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,12 +3,12 @@
3
3
  // src/radio-context.ts
4
4
  import { createContext } from "@yamada-ui/utils";
5
5
  var [RadioGroupProvider, useRadioGroupContext] = createContext({
6
- strict: false,
7
- name: "RadioGroupContext"
6
+ name: "RadioGroupContext",
7
+ strict: false
8
8
  });
9
9
 
10
10
  export {
11
11
  RadioGroupProvider,
12
12
  useRadioGroupContext
13
13
  };
14
- //# sourceMappingURL=chunk-YWRIETVW.mjs.map
14
+ //# sourceMappingURL=chunk-6FMV6NX2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/radio-context.ts"],"sourcesContent":["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":";;;AAGA,SAAS,qBAAqB;AAUvB,IAAM,CAAC,oBAAoB,oBAAoB,IAAI,cAExD;AAAA,EACA,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;","names":[]}
@@ -1,23 +1,23 @@
1
1
  "use client"
2
2
  import {
3
3
  useRadioGroupContext
4
- } from "./chunk-YWRIETVW.mjs";
4
+ } from "./chunk-6FMV6NX2.mjs";
5
5
 
6
6
  // src/radio.tsx
7
- import { ui, useComponentMultiStyle, omitThemeProps } from "@yamada-ui/core";
7
+ import { omitThemeProps, ui, useComponentMultiStyle } from "@yamada-ui/core";
8
8
  import {
9
+ formControlProperties,
9
10
  useFormControl,
10
- useFormControlProps,
11
- formControlProperties
11
+ useFormControlProps
12
12
  } from "@yamada-ui/form-control";
13
13
  import { trackFocusVisible } from "@yamada-ui/use-focus-visible";
14
14
  import {
15
15
  cx,
16
- useCallbackRef,
16
+ dataAttr,
17
17
  funcAll,
18
18
  handlerAll,
19
- dataAttr,
20
- splitObject
19
+ splitObject,
20
+ useCallbackRef
21
21
  } from "@yamada-ui/utils";
22
22
  import { forwardRef, useCallback, useEffect, useId, useState } from "react";
23
23
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -30,20 +30,20 @@ var useRadio = ({
30
30
  const {
31
31
  id: _id,
32
32
  name,
33
- value,
34
- isChecked: isCheckedProp,
35
33
  defaultIsChecked,
34
+ isChecked: isCheckedProp,
35
+ value,
36
36
  onChange: onChangeProp,
37
37
  ...computedProps
38
38
  } = useFormControlProps({ id, ...props });
39
39
  const [
40
40
  {
41
41
  "aria-readonly": _ariaReadonly,
42
- required,
43
42
  disabled,
44
43
  readOnly,
45
- onFocus: onFocusProp,
44
+ required,
46
45
  onBlur: onBlurProp,
46
+ onFocus: onFocusProp,
47
47
  ...formControlProps
48
48
  },
49
49
  rest
@@ -97,16 +97,16 @@ var useRadio = ({
97
97
  ...formControlProps,
98
98
  ...props2,
99
99
  ref,
100
+ "aria-hidden": true,
100
101
  "data-active": dataAttr(isActive),
101
- "data-hover": dataAttr(isHovered),
102
102
  "data-checked": dataAttr(checked),
103
103
  "data-focus": dataAttr(isFocused),
104
104
  "data-focus-visible": dataAttr(isFocused && isFocusVisible),
105
- "aria-hidden": true,
106
- onMouseDown: handlerAll(props2 == null ? void 0 : props2.onMouseDown, () => setActive(true)),
107
- onMouseUp: handlerAll(props2 == null ? void 0 : props2.onMouseUp, () => setActive(false)),
108
- onMouseEnter: handlerAll(props2 == null ? void 0 : props2.onMouseEnter, () => setHovered(true)),
109
- onMouseLeave: handlerAll(props2 == null ? void 0 : props2.onMouseLeave, () => setHovered(false))
105
+ "data-hover": dataAttr(isHovered),
106
+ onMouseDown: handlerAll(props2.onMouseDown, () => setActive(true)),
107
+ onMouseEnter: handlerAll(props2.onMouseEnter, () => setHovered(true)),
108
+ onMouseLeave: handlerAll(props2.onMouseLeave, () => setHovered(false)),
109
+ onMouseUp: handlerAll(props2.onMouseUp, () => setActive(false))
110
110
  }),
111
111
  [checked, isActive, isFocused, isFocusVisible, isHovered, formControlProps]
112
112
  );
@@ -114,32 +114,32 @@ var useRadio = ({
114
114
  (props2 = {}, ref = null) => ({
115
115
  ...formControlProps,
116
116
  ...props2,
117
- ref,
118
117
  id,
118
+ ref,
119
119
  type: "radio",
120
120
  name,
121
- value,
122
- required,
123
- disabled,
124
- readOnly,
125
- checked,
126
- "aria-checked": checked,
127
121
  style: {
128
122
  border: "0px",
129
123
  clip: "rect(0px, 0px, 0px, 0px)",
130
124
  height: "1px",
131
- width: "1px",
132
125
  margin: "-1px",
133
- padding: "0px",
134
126
  overflow: "hidden",
127
+ padding: "0px",
128
+ position: "absolute",
135
129
  whiteSpace: "nowrap",
136
- position: "absolute"
130
+ width: "1px"
137
131
  },
138
- onChange: handlerAll(props2 == null ? void 0 : props2.onChange, onChange),
139
- onBlur: handlerAll(props2 == null ? void 0 : props2.onBlur, onBlur, () => setFocused(false)),
140
- onFocus: handlerAll(props2 == null ? void 0 : props2.onFocus, onFocus, () => setFocused(true)),
141
- onKeyDown: handlerAll(props2 == null ? void 0 : props2.onKeyDown, onKeyDown),
142
- onKeyUp: handlerAll(props2 == null ? void 0 : props2.onKeyUp, onKeyUp)
132
+ "aria-checked": checked,
133
+ checked,
134
+ disabled,
135
+ readOnly,
136
+ required,
137
+ value,
138
+ onBlur: handlerAll(props2.onBlur, onBlur, () => setFocused(false)),
139
+ onChange: handlerAll(props2.onChange, onChange),
140
+ onFocus: handlerAll(props2.onFocus, onFocus, () => setFocused(true)),
141
+ onKeyDown: handlerAll(props2.onKeyDown, onKeyDown),
142
+ onKeyUp: handlerAll(props2.onKeyUp, onKeyUp)
143
143
  }),
144
144
  [
145
145
  formControlProps,
@@ -162,28 +162,28 @@ var useRadio = ({
162
162
  ...formControlProps,
163
163
  ...props2,
164
164
  ref,
165
- onMouseDown: handlerAll(props2 == null ? void 0 : props2.onMouseDown, (ev) => {
165
+ "data-checked": dataAttr(checked),
166
+ onMouseDown: handlerAll(props2.onMouseDown, (ev) => {
166
167
  ev.preventDefault();
167
168
  ev.stopPropagation();
168
169
  }),
169
- onTouchStart: handlerAll(props2 == null ? void 0 : props2.onTouchStart, (ev) => {
170
+ onTouchStart: handlerAll(props2.onTouchStart, (ev) => {
170
171
  ev.preventDefault();
171
172
  ev.stopPropagation();
172
- }),
173
- "data-checked": dataAttr(checked)
173
+ })
174
174
  }),
175
175
  [checked, formControlProps]
176
176
  );
177
177
  return {
178
- props: rest,
179
- isFocusVisible,
180
- isFocused,
181
- isHovered,
182
178
  isActive,
183
179
  isChecked: checked,
180
+ isFocused,
181
+ isFocusVisible,
182
+ isHovered,
183
+ props: rest,
184
184
  getContainerProps,
185
- getInputProps,
186
185
  getIconProps,
186
+ getInputProps,
187
187
  getLabelProps
188
188
  };
189
189
  };
@@ -199,33 +199,33 @@ var Radio = forwardRef(
199
199
  });
200
200
  const {
201
201
  className,
202
+ children,
202
203
  gap = "0.5rem",
203
- isRequired = (_a = groupProps.isRequired) != null ? _a : control.isRequired,
204
- isReadOnly = (_b = groupProps.isReadOnly) != null ? _b : control.isReadOnly,
205
- isDisabled = (_c = groupProps.isDisabled) != null ? _c : control.isDisabled,
206
- isInvalid = (_d = groupProps.isInvalid) != null ? _d : control.isInvalid,
204
+ isDisabled = (_a = groupProps.isDisabled) != null ? _a : control.isDisabled,
205
+ isInvalid = (_b = groupProps.isInvalid) != null ? _b : control.isInvalid,
206
+ isReadOnly = (_c = groupProps.isReadOnly) != null ? _c : control.isReadOnly,
207
+ isRequired = (_d = groupProps.isRequired) != null ? _d : control.isRequired,
207
208
  iconProps,
208
209
  inputProps,
209
210
  labelProps,
210
- children,
211
211
  ...computedProps
212
212
  } = omitThemeProps(mergedProps);
213
213
  const isCheckedProp = groupValue && computedProps.value ? groupValue === computedProps.value : computedProps.isChecked;
214
214
  const onChange = groupProps.onChange && computedProps.value ? funcAll(groupProps.onChange, computedProps.onChange) : computedProps.onChange;
215
215
  const {
216
216
  isChecked,
217
+ props: rest,
217
218
  getContainerProps,
218
- getInputProps,
219
219
  getIconProps,
220
- getLabelProps,
221
- props: rest
220
+ getInputProps,
221
+ getLabelProps
222
222
  } = useRadio({
223
223
  ...computedProps,
224
- isRequired,
225
- isReadOnly,
224
+ isChecked: isCheckedProp,
226
225
  isDisabled,
227
226
  isInvalid,
228
- isChecked: isCheckedProp,
227
+ isReadOnly,
228
+ isRequired,
229
229
  onChange
230
230
  });
231
231
  const tabIndex = !groupValue ? 0 : isChecked ? 0 : -1;
@@ -235,12 +235,12 @@ var Radio = forwardRef(
235
235
  className: cx("ui-radio", className),
236
236
  ...getContainerProps(rest),
237
237
  __css: {
238
+ alignItems: "center",
238
239
  cursor: "pointer",
239
- position: "relative",
240
240
  display: "inline-flex",
241
- alignItems: "center",
242
- verticalAlign: "top",
243
241
  gap,
242
+ position: "relative",
243
+ verticalAlign: "top",
244
244
  ...styles.container
245
245
  },
246
246
  children: [
@@ -263,8 +263,8 @@ var Radio = forwardRef(
263
263
  className: "ui-radio__icon",
264
264
  ...getIconProps(iconProps),
265
265
  __css: {
266
- position: "relative",
267
266
  display: "inline-block",
267
+ position: "relative",
268
268
  userSelect: "none",
269
269
  ...styles.icon
270
270
  }
@@ -291,4 +291,4 @@ export {
291
291
  useRadio,
292
292
  Radio
293
293
  };
294
- //# sourceMappingURL=chunk-7YYLBUPI.mjs.map
294
+ //# sourceMappingURL=chunk-NVHEZ3VI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/radio.tsx"],"sourcesContent":["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 initially checked.\n *\n * @default false\n */\n defaultIsChecked?: boolean\n /**\n * If `true`, the radio will be checked.\n *\n * @default false\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 const {\n id: _id,\n name,\n defaultIsChecked,\n isChecked: isCheckedProp,\n value,\n onChange: onChangeProp,\n ...computedProps\n } = useFormControlProps({ id, ...props })\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 [isFocusVisible, setIsFocusVisible] = useState<boolean>(false)\n const [isFocused, setFocused] = useState<boolean>(false)\n const [isHovered, setHovered] = useState<boolean>(false)\n const [isActive, setActive] = useState<boolean>(false)\n\n const [isChecked, setIsChecked] = useState<boolean>(!!defaultIsChecked)\n\n const isControlled = isCheckedProp !== undefined\n const checked = isControlled ? (isCheckedProp as boolean) : isChecked\n\n useEffect(() => {\n return trackFocusVisible(setIsFocusVisible)\n }, [])\n\n const onChange = useCallbackRef(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (readOnly || disabled) {\n ev.preventDefault()\n\n return\n }\n\n if (!isControlled) setIsChecked(ev.target.checked)\n\n onChangeProp?.(ev)\n },\n [readOnly, disabled, isControlled],\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(checked),\n }),\n [checked, 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(isActive),\n \"data-checked\": dataAttr(checked),\n \"data-focus\": dataAttr(isFocused),\n \"data-focus-visible\": dataAttr(isFocused && isFocusVisible),\n \"data-hover\": dataAttr(isHovered),\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 [checked, isActive, isFocused, isFocusVisible, isHovered, 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\": checked,\n checked,\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 checked,\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(checked),\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 [checked, formControlProps],\n )\n\n return {\n isActive,\n isChecked: checked,\n isFocused,\n isFocusVisible,\n isHovered,\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 const isCheckedProp =\n groupValue && computedProps.value\n ? groupValue === computedProps.value\n : computedProps.isChecked\n\n const onChange =\n groupProps.onChange && computedProps.value\n ? funcAll(groupProps.onChange, computedProps.onChange)\n : computedProps.onChange\n\n const {\n isChecked,\n props: rest,\n getContainerProps,\n getIconProps,\n getInputProps,\n getLabelProps,\n } = useRadio({\n ...computedProps,\n isChecked: isCheckedProp,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n onChange,\n })\n\n const tabIndex = !groupValue ? 0 : isChecked ? 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.span\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"],"mappings":";;;;;;AAkBA,SAAS,gBAAgB,IAAI,8BAA8B;AAC3D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,YAAY,aAAa,WAAW,OAAO,gBAAgB;AAyS9D,SAaE,KAbF;AAtQC,IAAM,WAAW,CAGtB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4B;AAC1B,QAAM,OAAO,MAAM;AAEnB,yBAAO;AAEP,QAAM;AAAA,IACJ,IAAI;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,UAAU;AAAA,IACV,GAAG;AAAA,EACL,IAAI,oBAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;AACxC,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,IAAI,YAAY,eAAe,qBAAqB;AAEpD,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAkB,KAAK;AACnE,QAAM,CAAC,WAAW,UAAU,IAAI,SAAkB,KAAK;AACvD,QAAM,CAAC,WAAW,UAAU,IAAI,SAAkB,KAAK;AACvD,QAAM,CAAC,UAAU,SAAS,IAAI,SAAkB,KAAK;AAErD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAkB,CAAC,CAAC,gBAAgB;AAEtE,QAAM,eAAe,kBAAkB;AACvC,QAAM,UAAU,eAAgB,gBAA4B;AAE5D,YAAU,MAAM;AACd,WAAO,kBAAkB,iBAAiB;AAAA,EAC5C,GAAG,CA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SAAS;AAAA,MACX,GAAG;AAAA,MACH,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,WAAW,CAAC,aAAa,IAAI,YAAY,IAAI;AAEnD,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC,WAAW,GAAG,YAAY,SAAS;AAAA,QAClC,GAAG,kBAAkB,IAAI;AAAA,QAC1B,OAAO;AAAA,UACL,YAAY;AAAA,UACZ,QAAQ;AAAA,UACR,SAAS;AAAA,UACT;AAAA,UACA,UAAU;AAAA,UACV,eAAe;AAAA,UACf,GAAG,OAAO;AAAA,QACZ;AAAA,QAEA;AAAA;AAAA,YAAC,GAAG;AAAA,YAAH;AAAA,cACC,WAAU;AAAA,cACT,GAAG;AAAA,gBACF;AAAA,kBACE,GAAG;AAAA,kBACH;AAAA,gBACF;AAAA,gBACA;AAAA,cACF;AAAA;AAAA,UACF;AAAA,UAEA;AAAA,YAAC,GAAG;AAAA,YAAH;AAAA,cACC,WAAU;AAAA,cACT,GAAG,aAAa,SAAS;AAAA,cAC1B,OAAO;AAAA,gBACL,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,YAAY;AAAA,gBACZ,GAAG,OAAO;AAAA,cACZ;AAAA;AAAA,UACF;AAAA,UAEA;AAAA,YAAC,GAAG;AAAA,YAAH;AAAA,cACC,WAAU;AAAA,cACT,GAAG,cAAc,UAAU;AAAA,cAC5B,OAAO,EAAE,GAAG,OAAO,MAAM;AAAA,cAExB;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAMA,MAAM,cAAc;AACpB,MAAM,SAAS;","names":["props"]}
@@ -1,10 +1,10 @@
1
1
  "use client"
2
2
  import {
3
3
  Radio
4
- } from "./chunk-7YYLBUPI.mjs";
4
+ } from "./chunk-NVHEZ3VI.mjs";
5
5
  import {
6
6
  RadioGroupProvider
7
- } from "./chunk-YWRIETVW.mjs";
7
+ } from "./chunk-6FMV6NX2.mjs";
8
8
 
9
9
  // src/radio-group.tsx
10
10
  import { useFormControl } from "@yamada-ui/form-control";
@@ -12,20 +12,20 @@ import { Flex } from "@yamada-ui/layouts";
12
12
  import { useControllableState } from "@yamada-ui/use-controllable-state";
13
13
  import {
14
14
  cx,
15
- isObject,
16
- useCallbackRef,
17
15
  getValidChildren,
18
- mergeRefs
16
+ isObject,
17
+ mergeRefs,
18
+ useCallbackRef
19
19
  } from "@yamada-ui/utils";
20
- import { useCallback, useId, useRef, forwardRef } from "react";
20
+ import { forwardRef, useCallback, useId, useRef } from "react";
21
21
  import { jsx } from "react/jsx-runtime";
22
22
  var isEvent = (value) => value && isObject(value) && isObject(value.target);
23
23
  var useRadioGroup = ({
24
24
  id,
25
25
  name,
26
+ defaultValue,
26
27
  isNative,
27
28
  value: valueProp,
28
- defaultValue,
29
29
  onChange: onChangeProp,
30
30
  ...props
31
31
  }) => {
@@ -34,8 +34,8 @@ var useRadioGroup = ({
34
34
  name != null ? name : name = `radio-${id}`;
35
35
  const onChangeRef = useCallbackRef(onChangeProp);
36
36
  const [value, setValue] = useControllableState({
37
- value: valueProp,
38
37
  defaultValue,
38
+ value: valueProp,
39
39
  onChange: onChangeRef
40
40
  });
41
41
  const containerRef = useRef(null);
@@ -74,44 +74,47 @@ var useRadioGroup = ({
74
74
  ...props2,
75
75
  ref,
76
76
  name,
77
- [isNative ? "checked" : "isChecked"]: value != null ? isChecked : void 0,
78
77
  "aria-checked": isChecked,
78
+ [isNative ? "checked" : "isChecked"]: (
79
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
80
+ value != null ? isChecked : void 0
81
+ ),
79
82
  onChange
80
83
  };
81
84
  },
82
85
  [name, value, onChange, isNative]
83
86
  );
84
87
  return {
85
- props,
86
88
  id,
87
89
  name,
88
- value,
90
+ props,
89
91
  setValue,
90
- onChange,
91
- onFocus,
92
+ value,
92
93
  getContainerProps,
93
- getRadioProps
94
+ getRadioProps,
95
+ onChange,
96
+ onFocus
94
97
  };
95
98
  };
96
99
  var RadioGroup = forwardRef(
97
100
  ({
98
101
  id: idProp,
99
102
  className,
103
+ colorScheme,
100
104
  size,
101
105
  variant,
102
- colorScheme,
103
106
  children,
104
- items = [],
105
107
  direction = "column",
106
108
  gap,
109
+ items = [],
107
110
  ...props
108
111
  }, ref) => {
109
112
  const {
110
- labelId,
111
- isRequired,
112
- isReadOnly,
113
113
  isDisabled,
114
114
  isInvalid,
115
+ isReadOnly,
116
+ isRequired,
117
+ labelId,
115
118
  ...computedProps
116
119
  } = useFormControl({
117
120
  id: idProp,
@@ -120,10 +123,10 @@ var RadioGroup = forwardRef(
120
123
  const {
121
124
  id,
122
125
  name,
126
+ props: rest,
123
127
  value,
124
- onChange,
125
128
  getContainerProps,
126
- props: rest
129
+ onChange
127
130
  } = useRadioGroup(computedProps);
128
131
  const validChildren = getValidChildren(children);
129
132
  let computedChildren = [];
@@ -134,14 +137,14 @@ var RadioGroup = forwardRef(
134
137
  RadioGroupProvider,
135
138
  {
136
139
  value: {
140
+ name,
141
+ colorScheme,
137
142
  size,
138
143
  variant,
139
- colorScheme,
140
- isRequired,
141
- isReadOnly,
142
144
  isDisabled,
143
145
  isInvalid,
144
- name,
146
+ isReadOnly,
147
+ isRequired,
145
148
  value,
146
149
  onChange
147
150
  },
@@ -171,4 +174,4 @@ export {
171
174
  useRadioGroup,
172
175
  RadioGroup
173
176
  };
174
- //# sourceMappingURL=chunk-VFISCGJO.mjs.map
177
+ //# sourceMappingURL=chunk-XCAPUS2B.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/radio-group.tsx"],"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 { checked?: boolean; isChecked?: boolean; value?: Y }\n > = useCallback(\n (props = {}, ref = null) => {\n const isChecked = props.value === value\n\n return {\n ...props,\n ref,\n name,\n \"aria-checked\": isChecked,\n [isNative ? \"checked\" : \"isChecked\"]:\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n value != null ? isChecked : 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"],"mappings":";;;;;;;;;AAYA,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AACrB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,YAAY,aAAa,OAAO,cAAc;AAwM/C;AAhMR,IAAM,UAAU,CAAC,UACf,SAAS,SAAS,KAAK,KAAK,SAAS,MAAM,MAAM;AAkC5C,IAAM,gBAAgB,CAG3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,GAAG;AACL,MAAiC;AAC/B,QAAM,OAAO,MAAM;AAEnB,yBAAO;AACP,+BAAS,SAAS,EAAE;AAEpB,QAAM,cAAc,eAAe,YAAY;AAE/C,QAAM,CAAC,OAAO,QAAQ,IAAI,qBAAqB;AAAA,IAC7C;AAAA,IACA,OAAO;AAAA,IACP,UAAU;AAAA,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