@radix-ui/react-radio-group 1.2.0-rc.1 → 1.2.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,307 +1,318 @@
1
1
  "use strict";
2
- (() => {
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
- }) : x)(function(x) {
12
- if (typeof require !== "undefined") return require.apply(this, arguments);
13
- throw Error('Dynamic require of "' + x + '" is not supported');
14
- });
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // packages/react/radio-group/src/index.ts
32
+ var src_exports = {};
33
+ __export(src_exports, {
34
+ Indicator: () => Indicator,
35
+ Item: () => Item2,
36
+ RadioGroup: () => RadioGroup,
37
+ RadioGroupIndicator: () => RadioGroupIndicator,
38
+ RadioGroupItem: () => RadioGroupItem,
39
+ Root: () => Root2,
40
+ createRadioGroupScope: () => createRadioGroupScope
41
+ });
42
+ module.exports = __toCommonJS(src_exports);
43
+
44
+ // packages/react/radio-group/src/RadioGroup.tsx
45
+ var React2 = __toESM(require("react"));
46
+ var import_primitive2 = require("@radix-ui/primitive");
47
+ var import_react_compose_refs2 = require("@radix-ui/react-compose-refs");
48
+ var import_react_context2 = require("@radix-ui/react-context");
49
+ var import_react_primitive2 = require("@radix-ui/react-primitive");
50
+ var RovingFocusGroup = __toESM(require("@radix-ui/react-roving-focus"));
51
+ var import_react_roving_focus = require("@radix-ui/react-roving-focus");
52
+ var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
53
+ var import_react_direction = require("@radix-ui/react-direction");
31
54
 
32
- // packages/react/radio-group/src/RadioGroup.tsx
33
- var React2 = __toESM(__require("react"));
34
- var import_primitive2 = __require("@radix-ui/primitive");
35
- var import_react_compose_refs2 = __require("@radix-ui/react-compose-refs");
36
- var import_react_context2 = __require("@radix-ui/react-context");
37
- var import_react_primitive2 = __require("@radix-ui/react-primitive");
38
- var RovingFocusGroup = __toESM(__require("@radix-ui/react-roving-focus"));
39
- var import_react_roving_focus = __require("@radix-ui/react-roving-focus");
40
- var import_react_use_controllable_state = __require("@radix-ui/react-use-controllable-state");
41
- var import_react_direction = __require("@radix-ui/react-direction");
55
+ // packages/react/radio-group/src/Radio.tsx
56
+ var React = __toESM(require("react"));
57
+ var import_primitive = require("@radix-ui/primitive");
58
+ var import_react_compose_refs = require("@radix-ui/react-compose-refs");
59
+ var import_react_context = require("@radix-ui/react-context");
60
+ var import_react_use_size = require("@radix-ui/react-use-size");
61
+ var import_react_use_previous = require("@radix-ui/react-use-previous");
62
+ var import_react_presence = require("@radix-ui/react-presence");
63
+ var import_react_primitive = require("@radix-ui/react-primitive");
64
+ var import_jsx_runtime = require("react/jsx-runtime");
65
+ var RADIO_NAME = "Radio";
66
+ var [createRadioContext, createRadioScope] = (0, import_react_context.createContextScope)(RADIO_NAME);
67
+ var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
68
+ var Radio = React.forwardRef(
69
+ (props, forwardedRef) => {
70
+ const {
71
+ __scopeRadio,
72
+ name,
73
+ checked = false,
74
+ required,
75
+ disabled,
76
+ value = "on",
77
+ onCheck,
78
+ ...radioProps
79
+ } = props;
80
+ const [button, setButton] = React.useState(null);
81
+ const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setButton(node));
82
+ const hasConsumerStoppedPropagationRef = React.useRef(false);
83
+ const isFormControl = button ? Boolean(button.closest("form")) : true;
84
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
+ import_react_primitive.Primitive.button,
87
+ {
88
+ type: "button",
89
+ role: "radio",
90
+ "aria-checked": checked,
91
+ "data-state": getState(checked),
92
+ "data-disabled": disabled ? "" : void 0,
93
+ disabled,
94
+ value,
95
+ ...radioProps,
96
+ ref: composedRefs,
97
+ onClick: (0, import_primitive.composeEventHandlers)(props.onClick, (event) => {
98
+ if (!checked) onCheck?.();
99
+ if (isFormControl) {
100
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
101
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
102
+ }
103
+ })
104
+ }
105
+ ),
106
+ isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
107
+ BubbleInput,
108
+ {
109
+ control: button,
110
+ bubbles: !hasConsumerStoppedPropagationRef.current,
111
+ name,
112
+ value,
113
+ checked,
114
+ required,
115
+ disabled,
116
+ style: { transform: "translateX(-100%)" }
117
+ }
118
+ )
119
+ ] });
120
+ }
121
+ );
122
+ Radio.displayName = RADIO_NAME;
123
+ var INDICATOR_NAME = "RadioIndicator";
124
+ var RadioIndicator = React.forwardRef(
125
+ (props, forwardedRef) => {
126
+ const { __scopeRadio, forceMount, ...indicatorProps } = props;
127
+ const context = useRadioContext(INDICATOR_NAME, __scopeRadio);
128
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
129
+ import_react_primitive.Primitive.span,
130
+ {
131
+ "data-state": getState(context.checked),
132
+ "data-disabled": context.disabled ? "" : void 0,
133
+ ...indicatorProps,
134
+ ref: forwardedRef
135
+ }
136
+ ) });
137
+ }
138
+ );
139
+ RadioIndicator.displayName = INDICATOR_NAME;
140
+ var BubbleInput = (props) => {
141
+ const { control, checked, bubbles = true, ...inputProps } = props;
142
+ const ref = React.useRef(null);
143
+ const prevChecked = (0, import_react_use_previous.usePrevious)(checked);
144
+ const controlSize = (0, import_react_use_size.useSize)(control);
145
+ React.useEffect(() => {
146
+ const input = ref.current;
147
+ const inputProto = window.HTMLInputElement.prototype;
148
+ const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
149
+ const setChecked = descriptor.set;
150
+ if (prevChecked !== checked && setChecked) {
151
+ const event = new Event("click", { bubbles });
152
+ setChecked.call(input, checked);
153
+ input.dispatchEvent(event);
154
+ }
155
+ }, [prevChecked, checked, bubbles]);
156
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
157
+ "input",
158
+ {
159
+ type: "radio",
160
+ "aria-hidden": true,
161
+ defaultChecked: checked,
162
+ ...inputProps,
163
+ tabIndex: -1,
164
+ ref,
165
+ style: {
166
+ ...props.style,
167
+ ...controlSize,
168
+ position: "absolute",
169
+ pointerEvents: "none",
170
+ opacity: 0,
171
+ margin: 0
172
+ }
173
+ }
174
+ );
175
+ };
176
+ function getState(checked) {
177
+ return checked ? "checked" : "unchecked";
178
+ }
42
179
 
43
- // packages/react/radio-group/src/Radio.tsx
44
- var React = __toESM(__require("react"));
45
- var import_primitive = __require("@radix-ui/primitive");
46
- var import_react_compose_refs = __require("@radix-ui/react-compose-refs");
47
- var import_react_context = __require("@radix-ui/react-context");
48
- var import_react_use_size = __require("@radix-ui/react-use-size");
49
- var import_react_use_previous = __require("@radix-ui/react-use-previous");
50
- var import_react_presence = __require("@radix-ui/react-presence");
51
- var import_react_primitive = __require("@radix-ui/react-primitive");
52
- var import_jsx_runtime = __require("react/jsx-runtime");
53
- var RADIO_NAME = "Radio";
54
- var [createRadioContext, createRadioScope] = (0, import_react_context.createContextScope)(RADIO_NAME);
55
- var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
56
- var Radio = React.forwardRef(
57
- (props, forwardedRef) => {
58
- const {
59
- __scopeRadio,
180
+ // packages/react/radio-group/src/RadioGroup.tsx
181
+ var import_jsx_runtime2 = require("react/jsx-runtime");
182
+ var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
183
+ var RADIO_GROUP_NAME = "RadioGroup";
184
+ var [createRadioGroupContext, createRadioGroupScope] = (0, import_react_context2.createContextScope)(RADIO_GROUP_NAME, [
185
+ import_react_roving_focus.createRovingFocusGroupScope,
186
+ createRadioScope
187
+ ]);
188
+ var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)();
189
+ var useRadioScope = createRadioScope();
190
+ var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
191
+ var RadioGroup = React2.forwardRef(
192
+ (props, forwardedRef) => {
193
+ const {
194
+ __scopeRadioGroup,
195
+ name,
196
+ defaultValue,
197
+ value: valueProp,
198
+ required = false,
199
+ disabled = false,
200
+ orientation,
201
+ dir,
202
+ loop = true,
203
+ onValueChange,
204
+ ...groupProps
205
+ } = props;
206
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
207
+ const direction = (0, import_react_direction.useDirection)(dir);
208
+ const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({
209
+ prop: valueProp,
210
+ defaultProp: defaultValue,
211
+ onChange: onValueChange
212
+ });
213
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
214
+ RadioGroupProvider,
215
+ {
216
+ scope: __scopeRadioGroup,
60
217
  name,
61
- checked = false,
62
218
  required,
63
219
  disabled,
64
- value = "on",
65
- onCheck,
66
- ...radioProps
67
- } = props;
68
- const [button, setButton] = React.useState(null);
69
- const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setButton(node));
70
- const hasConsumerStoppedPropagationRef = React.useRef(false);
71
- const isFormControl = button ? Boolean(button.closest("form")) : true;
72
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
73
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
74
- import_react_primitive.Primitive.button,
220
+ value,
221
+ onValueChange: setValue,
222
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
223
+ RovingFocusGroup.Root,
75
224
  {
76
- type: "button",
77
- role: "radio",
78
- "aria-checked": checked,
79
- "data-state": getState(checked),
80
- "data-disabled": disabled ? "" : void 0,
81
- disabled,
82
- value,
83
- ...radioProps,
84
- ref: composedRefs,
85
- onClick: (0, import_primitive.composeEventHandlers)(props.onClick, (event) => {
86
- if (!checked) onCheck?.();
87
- if (isFormControl) {
88
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
89
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
225
+ asChild: true,
226
+ ...rovingFocusGroupScope,
227
+ orientation,
228
+ dir: direction,
229
+ loop,
230
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
231
+ import_react_primitive2.Primitive.div,
232
+ {
233
+ role: "radiogroup",
234
+ "aria-required": required,
235
+ "aria-orientation": orientation,
236
+ "data-disabled": disabled ? "" : void 0,
237
+ dir: direction,
238
+ ...groupProps,
239
+ ref: forwardedRef
90
240
  }
91
- })
241
+ )
92
242
  }
93
- ),
94
- isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
- BubbleInput,
243
+ )
244
+ }
245
+ );
246
+ }
247
+ );
248
+ RadioGroup.displayName = RADIO_GROUP_NAME;
249
+ var ITEM_NAME = "RadioGroupItem";
250
+ var RadioGroupItem = React2.forwardRef(
251
+ (props, forwardedRef) => {
252
+ const { __scopeRadioGroup, disabled, ...itemProps } = props;
253
+ const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);
254
+ const isDisabled = context.disabled || disabled;
255
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
256
+ const radioScope = useRadioScope(__scopeRadioGroup);
257
+ const ref = React2.useRef(null);
258
+ const composedRefs = (0, import_react_compose_refs2.useComposedRefs)(forwardedRef, ref);
259
+ const checked = context.value === itemProps.value;
260
+ const isArrowKeyPressedRef = React2.useRef(false);
261
+ React2.useEffect(() => {
262
+ const handleKeyDown = (event) => {
263
+ if (ARROW_KEYS.includes(event.key)) {
264
+ isArrowKeyPressedRef.current = true;
265
+ }
266
+ };
267
+ const handleKeyUp = () => isArrowKeyPressedRef.current = false;
268
+ document.addEventListener("keydown", handleKeyDown);
269
+ document.addEventListener("keyup", handleKeyUp);
270
+ return () => {
271
+ document.removeEventListener("keydown", handleKeyDown);
272
+ document.removeEventListener("keyup", handleKeyUp);
273
+ };
274
+ }, []);
275
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
276
+ RovingFocusGroup.Item,
277
+ {
278
+ asChild: true,
279
+ ...rovingFocusGroupScope,
280
+ focusable: !isDisabled,
281
+ active: checked,
282
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
283
+ Radio,
96
284
  {
97
- control: button,
98
- bubbles: !hasConsumerStoppedPropagationRef.current,
99
- name,
100
- value,
285
+ disabled: isDisabled,
286
+ required: context.required,
101
287
  checked,
102
- required,
103
- disabled,
104
- style: { transform: "translateX(-100%)" }
288
+ ...radioScope,
289
+ ...itemProps,
290
+ name: context.name,
291
+ ref: composedRefs,
292
+ onCheck: () => context.onValueChange(itemProps.value),
293
+ onKeyDown: (0, import_primitive2.composeEventHandlers)((event) => {
294
+ if (event.key === "Enter") event.preventDefault();
295
+ }),
296
+ onFocus: (0, import_primitive2.composeEventHandlers)(itemProps.onFocus, () => {
297
+ if (isArrowKeyPressedRef.current) ref.current?.click();
298
+ })
105
299
  }
106
300
  )
107
- ] });
108
- }
109
- );
110
- Radio.displayName = RADIO_NAME;
111
- var INDICATOR_NAME = "RadioIndicator";
112
- var RadioIndicator = React.forwardRef(
113
- (props, forwardedRef) => {
114
- const { __scopeRadio, forceMount, ...indicatorProps } = props;
115
- const context = useRadioContext(INDICATOR_NAME, __scopeRadio);
116
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
117
- import_react_primitive.Primitive.span,
118
- {
119
- "data-state": getState(context.checked),
120
- "data-disabled": context.disabled ? "" : void 0,
121
- ...indicatorProps,
122
- ref: forwardedRef
123
- }
124
- ) });
125
- }
126
- );
127
- RadioIndicator.displayName = INDICATOR_NAME;
128
- var BubbleInput = (props) => {
129
- const { control, checked, bubbles = true, ...inputProps } = props;
130
- const ref = React.useRef(null);
131
- const prevChecked = (0, import_react_use_previous.usePrevious)(checked);
132
- const controlSize = (0, import_react_use_size.useSize)(control);
133
- React.useEffect(() => {
134
- const input = ref.current;
135
- const inputProto = window.HTMLInputElement.prototype;
136
- const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
137
- const setChecked = descriptor.set;
138
- if (prevChecked !== checked && setChecked) {
139
- const event = new Event("click", { bubbles });
140
- setChecked.call(input, checked);
141
- input.dispatchEvent(event);
142
- }
143
- }, [prevChecked, checked, bubbles]);
144
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
145
- "input",
146
- {
147
- type: "radio",
148
- "aria-hidden": true,
149
- defaultChecked: checked,
150
- ...inputProps,
151
- tabIndex: -1,
152
- ref,
153
- style: {
154
- ...props.style,
155
- ...controlSize,
156
- position: "absolute",
157
- pointerEvents: "none",
158
- opacity: 0,
159
- margin: 0
160
- }
161
301
  }
162
302
  );
163
- };
164
- function getState(checked) {
165
- return checked ? "checked" : "unchecked";
166
303
  }
167
-
168
- // packages/react/radio-group/src/RadioGroup.tsx
169
- var import_jsx_runtime2 = __require("react/jsx-runtime");
170
- var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
171
- var RADIO_GROUP_NAME = "RadioGroup";
172
- var [createRadioGroupContext, createRadioGroupScope] = (0, import_react_context2.createContextScope)(RADIO_GROUP_NAME, [
173
- import_react_roving_focus.createRovingFocusGroupScope,
174
- createRadioScope
175
- ]);
176
- var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)();
177
- var useRadioScope = createRadioScope();
178
- var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
179
- var RadioGroup = React2.forwardRef(
180
- (props, forwardedRef) => {
181
- const {
182
- __scopeRadioGroup,
183
- name,
184
- defaultValue,
185
- value: valueProp,
186
- required = false,
187
- disabled = false,
188
- orientation,
189
- dir,
190
- loop = true,
191
- onValueChange,
192
- ...groupProps
193
- } = props;
194
- const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
195
- const direction = (0, import_react_direction.useDirection)(dir);
196
- const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({
197
- prop: valueProp,
198
- defaultProp: defaultValue,
199
- onChange: onValueChange
200
- });
201
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
202
- RadioGroupProvider,
203
- {
204
- scope: __scopeRadioGroup,
205
- name,
206
- required,
207
- disabled,
208
- value,
209
- onValueChange: setValue,
210
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
211
- RovingFocusGroup.Root,
212
- {
213
- asChild: true,
214
- ...rovingFocusGroupScope,
215
- orientation,
216
- dir: direction,
217
- loop,
218
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
219
- import_react_primitive2.Primitive.div,
220
- {
221
- role: "radiogroup",
222
- "aria-required": required,
223
- "aria-orientation": orientation,
224
- "data-disabled": disabled ? "" : void 0,
225
- dir: direction,
226
- ...groupProps,
227
- ref: forwardedRef
228
- }
229
- )
230
- }
231
- )
232
- }
233
- );
234
- }
235
- );
236
- RadioGroup.displayName = RADIO_GROUP_NAME;
237
- var ITEM_NAME = "RadioGroupItem";
238
- var RadioGroupItem = React2.forwardRef(
239
- (props, forwardedRef) => {
240
- const { __scopeRadioGroup, disabled, ...itemProps } = props;
241
- const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);
242
- const isDisabled = context.disabled || disabled;
243
- const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
244
- const radioScope = useRadioScope(__scopeRadioGroup);
245
- const ref = React2.useRef(null);
246
- const composedRefs = (0, import_react_compose_refs2.useComposedRefs)(forwardedRef, ref);
247
- const checked = context.value === itemProps.value;
248
- const isArrowKeyPressedRef = React2.useRef(false);
249
- React2.useEffect(() => {
250
- const handleKeyDown = (event) => {
251
- if (ARROW_KEYS.includes(event.key)) {
252
- isArrowKeyPressedRef.current = true;
253
- }
254
- };
255
- const handleKeyUp = () => isArrowKeyPressedRef.current = false;
256
- document.addEventListener("keydown", handleKeyDown);
257
- document.addEventListener("keyup", handleKeyUp);
258
- return () => {
259
- document.removeEventListener("keydown", handleKeyDown);
260
- document.removeEventListener("keyup", handleKeyUp);
261
- };
262
- }, []);
263
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
264
- RovingFocusGroup.Item,
265
- {
266
- asChild: true,
267
- ...rovingFocusGroupScope,
268
- focusable: !isDisabled,
269
- active: checked,
270
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
271
- Radio,
272
- {
273
- disabled: isDisabled,
274
- required: context.required,
275
- checked,
276
- ...radioScope,
277
- ...itemProps,
278
- name: context.name,
279
- ref: composedRefs,
280
- onCheck: () => context.onValueChange(itemProps.value),
281
- onKeyDown: (0, import_primitive2.composeEventHandlers)((event) => {
282
- if (event.key === "Enter") event.preventDefault();
283
- }),
284
- onFocus: (0, import_primitive2.composeEventHandlers)(itemProps.onFocus, () => {
285
- if (isArrowKeyPressedRef.current) ref.current?.click();
286
- })
287
- }
288
- )
289
- }
290
- );
291
- }
292
- );
293
- RadioGroupItem.displayName = ITEM_NAME;
294
- var INDICATOR_NAME2 = "RadioGroupIndicator";
295
- var RadioGroupIndicator = React2.forwardRef(
296
- (props, forwardedRef) => {
297
- const { __scopeRadioGroup, ...indicatorProps } = props;
298
- const radioScope = useRadioScope(__scopeRadioGroup);
299
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef });
300
- }
301
- );
302
- RadioGroupIndicator.displayName = INDICATOR_NAME2;
303
- var Root2 = RadioGroup;
304
- var Item2 = RadioGroupItem;
305
- var Indicator = RadioGroupIndicator;
306
- })();
304
+ );
305
+ RadioGroupItem.displayName = ITEM_NAME;
306
+ var INDICATOR_NAME2 = "RadioGroupIndicator";
307
+ var RadioGroupIndicator = React2.forwardRef(
308
+ (props, forwardedRef) => {
309
+ const { __scopeRadioGroup, ...indicatorProps } = props;
310
+ const radioScope = useRadioScope(__scopeRadioGroup);
311
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef });
312
+ }
313
+ );
314
+ RadioGroupIndicator.displayName = INDICATOR_NAME2;
315
+ var Root2 = RadioGroup;
316
+ var Item2 = RadioGroupItem;
317
+ var Indicator = RadioGroupIndicator;
307
318
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/RadioGroup.tsx", "../src/Radio.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Radio, RadioIndicator, createRadioScope } from './Radio';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroup\n * -----------------------------------------------------------------------------------------------*/\nconst RADIO_GROUP_NAME = 'RadioGroup';\n\ntype ScopedProps<P> = P & { __scopeRadioGroup?: Scope };\nconst [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [\n createRovingFocusGroupScope,\n createRadioScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useRadioScope = createRadioScope();\n\ntype RadioGroupContextValue = {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string;\n onValueChange(value: string): void;\n};\n\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext<RadioGroupContextValue>(RADIO_GROUP_NAME);\n\ntype RadioGroupElement = React.ElementRef<typeof Primitive.div>;\ntype RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface RadioGroupProps extends PrimitiveDivProps {\n name?: RadioGroupContextValue['name'];\n required?: Radix.ComponentPropsWithoutRef<typeof Radio>['required'];\n disabled?: Radix.ComponentPropsWithoutRef<typeof Radio>['disabled'];\n dir?: RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroupProps['loop'];\n defaultValue?: string;\n value?: RadioGroupContextValue['value'];\n onValueChange?: RadioGroupContextValue['onValueChange'];\n}\n\nconst RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(\n (props: ScopedProps<RadioGroupProps>, forwardedRef) => {\n const {\n __scopeRadioGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...groupProps\n } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <RadioGroupProvider\n scope={__scopeRadioGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onValueChange={setValue}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n <Primitive.div\n role=\"radiogroup\"\n aria-required={required}\n aria-orientation={orientation}\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...groupProps}\n ref={forwardedRef}\n />\n </RovingFocusGroup.Root>\n </RadioGroupProvider>\n );\n }\n);\n\nRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RadioGroupItem';\n\ntype RadioGroupItemElement = React.ElementRef<typeof Radio>;\ntype RadioProps = Radix.ComponentPropsWithoutRef<typeof Radio>;\ninterface RadioGroupItemProps extends Omit<RadioProps, 'onCheck' | 'name'> {\n value: string;\n}\n\nconst RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(\n (props: ScopedProps<RadioGroupItemProps>, forwardedRef) => {\n const { __scopeRadioGroup, disabled, ...itemProps } = props;\n const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const ref = React.useRef<React.ElementRef<typeof Radio>>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const checked = context.value === itemProps.value;\n const isArrowKeyPressedRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) {\n isArrowKeyPressedRef.current = true;\n }\n };\n const handleKeyUp = () => (isArrowKeyPressedRef.current = false);\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n };\n }, []);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <Radio\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...radioScope}\n {...itemProps}\n name={context.name}\n ref={composedRefs}\n onCheck={() => context.onValueChange(itemProps.value)}\n onKeyDown={composeEventHandlers((event) => {\n // According to WAI ARIA, radio groups don't activate items on enter keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onFocus={composeEventHandlers(itemProps.onFocus, () => {\n /**\n * Our `RovingFocusGroup` will focus the radio when navigating with arrow keys\n * and we need to \"check\" it in that case. We click it to \"check\" it (instead\n * of updating `context.value`) so that the radio change event fires.\n */\n if (isArrowKeyPressedRef.current) ref.current?.click();\n })}\n />\n </RovingFocusGroup.Item>\n );\n }\n);\n\nRadioGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioGroupIndicator';\n\ntype RadioGroupIndicatorElement = React.ElementRef<typeof RadioIndicator>;\ntype RadioIndicatorProps = Radix.ComponentPropsWithoutRef<typeof RadioIndicator>;\ninterface RadioGroupIndicatorProps extends RadioIndicatorProps {}\n\nconst RadioGroupIndicator = React.forwardRef<RadioGroupIndicatorElement, RadioGroupIndicatorProps>(\n (props: ScopedProps<RadioGroupIndicatorProps>, forwardedRef) => {\n const { __scopeRadioGroup, ...indicatorProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return <RadioIndicator {...radioScope} {...indicatorProps} ref={forwardedRef} />;\n }\n);\n\nRadioGroupIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = RadioGroup;\nconst Item = RadioGroupItem;\nconst Indicator = RadioGroupIndicator;\n\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupIndicator,\n //\n Root,\n Item,\n Indicator,\n};\nexport type { RadioGroupProps, RadioGroupItemProps, RadioGroupIndicatorProps };\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Radio\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_NAME = 'Radio';\n\ntype ScopedProps<P> = P & { __scopeRadio?: Scope };\nconst [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);\n\ntype RadioContextValue = { checked: boolean; disabled?: boolean };\nconst [RadioProvider, useRadioContext] = createRadioContext<RadioContextValue>(RADIO_NAME);\n\ntype RadioElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface RadioProps extends PrimitiveButtonProps {\n checked?: boolean;\n required?: boolean;\n onCheck?(): void;\n}\n\nconst Radio = React.forwardRef<RadioElement, RadioProps>(\n (props: ScopedProps<RadioProps>, forwardedRef) => {\n const {\n __scopeRadio,\n name,\n checked = false,\n required,\n disabled,\n value = 'on',\n onCheck,\n ...radioProps\n } = props;\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = button ? Boolean(button.closest('form')) : true;\n\n return (\n <RadioProvider scope={__scopeRadio} checked={checked} disabled={disabled}>\n <Primitive.button\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...radioProps}\n ref={composedRefs}\n onClick={composeEventHandlers(props.onClick, (event) => {\n // radios cannot be unchecked so we only communicate a checked state\n if (!checked) onCheck?.();\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if radio is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect radio updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n {isFormControl && (\n <BubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n style={{ transform: 'translateX(-100%)' }}\n />\n )}\n </RadioProvider>\n );\n }\n);\n\nRadio.displayName = RADIO_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioIndicator';\n\ntype RadioIndicatorElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\nexport interface RadioIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst RadioIndicator = React.forwardRef<RadioIndicatorElement, RadioIndicatorProps>(\n (props: ScopedProps<RadioIndicatorProps>, forwardedRef) => {\n const { __scopeRadio, forceMount, ...indicatorProps } = props;\n const context = useRadioContext(INDICATOR_NAME, __scopeRadio);\n return (\n <Presence present={forceMount || context.checked}>\n <Primitive.span\n data-state={getState(context.checked)}\n data-disabled={context.disabled ? '' : undefined}\n {...indicatorProps}\n ref={forwardedRef}\n />\n </Presence>\n );\n }\n);\n\nRadioIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype InputProps = Radix.ComponentPropsWithoutRef<'input'>;\ninterface BubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: boolean;\n control: HTMLElement | null;\n bubbles: boolean;\n}\n\nconst BubbleInput = (props: BubbleInputProps) => {\n const { control, checked, bubbles = true, ...inputProps } = props;\n const ref = React.useRef<HTMLInputElement>(null);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current!;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'checked') as PropertyDescriptor;\n const setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [prevChecked, checked, bubbles]);\n\n return (\n <input\n type=\"radio\"\n aria-hidden\n defaultChecked={checked}\n {...inputProps}\n tabIndex={-1}\n ref={ref}\n style={{\n ...props.style,\n ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }}\n />\n );\n};\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createRadioScope,\n //\n Radio,\n RadioIndicator,\n};\nexport type { RadioProps };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAAA,SAAuB;AACvB,MAAAC,oBAAqC;AACrC,MAAAC,6BAAgC;AAChC,MAAAC,wBAAmC;AACnC,MAAAC,0BAA0B;AAC1B,yBAAkC;AAClC,kCAA4C;AAC5C,4CAAqC;AACrC,+BAA6B;;;ACR7B,cAAuB;AACvB,yBAAqC;AACrC,kCAAgC;AAChC,6BAAmC;AACnC,8BAAwB;AACxB,kCAA4B;AAC5B,8BAAyB;AACzB,+BAA0B;AA4CpB;AAnCN,MAAM,aAAa;AAGnB,MAAM,CAAC,oBAAoB,gBAAgB,QAAI,yCAAmB,UAAU;AAG5E,MAAM,CAAC,eAAe,eAAe,IAAI,mBAAsC,UAAU;AAUzF,MAAM,QAAc;AAAA,IAClB,CAAC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U,SAAS,MAAM;AAMrD,oBAAI,qBAAqB,QAAS,KAAI,SAAS,MAAM;AAAA,cACvD,CAAC;AAAA;AAAA,UACH;AAAA;AAAA,MACF;AAAA,IAEJ;AAAA,EACF;AAEA,iBAAe,cAAc;AAM7B,MAAMC,kBAAiB;AAMvB,MAAM,sBAA4B;AAAA,IAChC,CAAC,OAA8C,iBAAiB;AAC9D,YAAM,EAAE,mBAAmB,GAAG,eAAe,IAAI;AACjD,YAAM,aAAa,cAAc,iBAAiB;AAClD,aAAO,6CAAC,kBAAgB,GAAG,YAAa,GAAG,gBAAgB,KAAK,cAAc;AAAA,IAChF;AAAA,EACF;AAEA,sBAAoB,cAAcA;AAIlC,MAAMC,QAAO;AACb,MAAMC,QAAO;AACb,MAAM,YAAY;",
6
- "names": ["React", "import_primitive", "import_react_compose_refs", "import_react_context", "import_react_primitive", "import_jsx_runtime", "INDICATOR_NAME", "Root", "Item"]
3
+ "sources": ["../src/index.ts", "../src/RadioGroup.tsx", "../src/Radio.tsx"],
4
+ "sourcesContent": ["'use client';\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupIndicator,\n //\n Root,\n Item,\n Indicator,\n} from './RadioGroup';\nexport type { RadioGroupProps, RadioGroupItemProps, RadioGroupIndicatorProps } from './RadioGroup';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Radio, RadioIndicator, createRadioScope } from './Radio';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroup\n * -----------------------------------------------------------------------------------------------*/\nconst RADIO_GROUP_NAME = 'RadioGroup';\n\ntype ScopedProps<P> = P & { __scopeRadioGroup?: Scope };\nconst [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [\n createRovingFocusGroupScope,\n createRadioScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useRadioScope = createRadioScope();\n\ntype RadioGroupContextValue = {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string;\n onValueChange(value: string): void;\n};\n\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext<RadioGroupContextValue>(RADIO_GROUP_NAME);\n\ntype RadioGroupElement = React.ElementRef<typeof Primitive.div>;\ntype RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface RadioGroupProps extends PrimitiveDivProps {\n name?: RadioGroupContextValue['name'];\n required?: Radix.ComponentPropsWithoutRef<typeof Radio>['required'];\n disabled?: Radix.ComponentPropsWithoutRef<typeof Radio>['disabled'];\n dir?: RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroupProps['loop'];\n defaultValue?: string;\n value?: RadioGroupContextValue['value'];\n onValueChange?: RadioGroupContextValue['onValueChange'];\n}\n\nconst RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(\n (props: ScopedProps<RadioGroupProps>, forwardedRef) => {\n const {\n __scopeRadioGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...groupProps\n } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <RadioGroupProvider\n scope={__scopeRadioGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onValueChange={setValue}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n <Primitive.div\n role=\"radiogroup\"\n aria-required={required}\n aria-orientation={orientation}\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...groupProps}\n ref={forwardedRef}\n />\n </RovingFocusGroup.Root>\n </RadioGroupProvider>\n );\n }\n);\n\nRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RadioGroupItem';\n\ntype RadioGroupItemElement = React.ElementRef<typeof Radio>;\ntype RadioProps = Radix.ComponentPropsWithoutRef<typeof Radio>;\ninterface RadioGroupItemProps extends Omit<RadioProps, 'onCheck' | 'name'> {\n value: string;\n}\n\nconst RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(\n (props: ScopedProps<RadioGroupItemProps>, forwardedRef) => {\n const { __scopeRadioGroup, disabled, ...itemProps } = props;\n const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const ref = React.useRef<React.ElementRef<typeof Radio>>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const checked = context.value === itemProps.value;\n const isArrowKeyPressedRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) {\n isArrowKeyPressedRef.current = true;\n }\n };\n const handleKeyUp = () => (isArrowKeyPressedRef.current = false);\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n };\n }, []);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <Radio\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...radioScope}\n {...itemProps}\n name={context.name}\n ref={composedRefs}\n onCheck={() => context.onValueChange(itemProps.value)}\n onKeyDown={composeEventHandlers((event) => {\n // According to WAI ARIA, radio groups don't activate items on enter keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onFocus={composeEventHandlers(itemProps.onFocus, () => {\n /**\n * Our `RovingFocusGroup` will focus the radio when navigating with arrow keys\n * and we need to \"check\" it in that case. We click it to \"check\" it (instead\n * of updating `context.value`) so that the radio change event fires.\n */\n if (isArrowKeyPressedRef.current) ref.current?.click();\n })}\n />\n </RovingFocusGroup.Item>\n );\n }\n);\n\nRadioGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioGroupIndicator';\n\ntype RadioGroupIndicatorElement = React.ElementRef<typeof RadioIndicator>;\ntype RadioIndicatorProps = Radix.ComponentPropsWithoutRef<typeof RadioIndicator>;\ninterface RadioGroupIndicatorProps extends RadioIndicatorProps {}\n\nconst RadioGroupIndicator = React.forwardRef<RadioGroupIndicatorElement, RadioGroupIndicatorProps>(\n (props: ScopedProps<RadioGroupIndicatorProps>, forwardedRef) => {\n const { __scopeRadioGroup, ...indicatorProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return <RadioIndicator {...radioScope} {...indicatorProps} ref={forwardedRef} />;\n }\n);\n\nRadioGroupIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = RadioGroup;\nconst Item = RadioGroupItem;\nconst Indicator = RadioGroupIndicator;\n\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupIndicator,\n //\n Root,\n Item,\n Indicator,\n};\nexport type { RadioGroupProps, RadioGroupItemProps, RadioGroupIndicatorProps };\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Radio\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_NAME = 'Radio';\n\ntype ScopedProps<P> = P & { __scopeRadio?: Scope };\nconst [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);\n\ntype RadioContextValue = { checked: boolean; disabled?: boolean };\nconst [RadioProvider, useRadioContext] = createRadioContext<RadioContextValue>(RADIO_NAME);\n\ntype RadioElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface RadioProps extends PrimitiveButtonProps {\n checked?: boolean;\n required?: boolean;\n onCheck?(): void;\n}\n\nconst Radio = React.forwardRef<RadioElement, RadioProps>(\n (props: ScopedProps<RadioProps>, forwardedRef) => {\n const {\n __scopeRadio,\n name,\n checked = false,\n required,\n disabled,\n value = 'on',\n onCheck,\n ...radioProps\n } = props;\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = button ? Boolean(button.closest('form')) : true;\n\n return (\n <RadioProvider scope={__scopeRadio} checked={checked} disabled={disabled}>\n <Primitive.button\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...radioProps}\n ref={composedRefs}\n onClick={composeEventHandlers(props.onClick, (event) => {\n // radios cannot be unchecked so we only communicate a checked state\n if (!checked) onCheck?.();\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if radio is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect radio updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n {isFormControl && (\n <BubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n style={{ transform: 'translateX(-100%)' }}\n />\n )}\n </RadioProvider>\n );\n }\n);\n\nRadio.displayName = RADIO_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioIndicator';\n\ntype RadioIndicatorElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\nexport interface RadioIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst RadioIndicator = React.forwardRef<RadioIndicatorElement, RadioIndicatorProps>(\n (props: ScopedProps<RadioIndicatorProps>, forwardedRef) => {\n const { __scopeRadio, forceMount, ...indicatorProps } = props;\n const context = useRadioContext(INDICATOR_NAME, __scopeRadio);\n return (\n <Presence present={forceMount || context.checked}>\n <Primitive.span\n data-state={getState(context.checked)}\n data-disabled={context.disabled ? '' : undefined}\n {...indicatorProps}\n ref={forwardedRef}\n />\n </Presence>\n );\n }\n);\n\nRadioIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype InputProps = Radix.ComponentPropsWithoutRef<'input'>;\ninterface BubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: boolean;\n control: HTMLElement | null;\n bubbles: boolean;\n}\n\nconst BubbleInput = (props: BubbleInputProps) => {\n const { control, checked, bubbles = true, ...inputProps } = props;\n const ref = React.useRef<HTMLInputElement>(null);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current!;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'checked') as PropertyDescriptor;\n const setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [prevChecked, checked, bubbles]);\n\n return (\n <input\n type=\"radio\"\n aria-hidden\n defaultChecked={checked}\n {...inputProps}\n tabIndex={-1}\n ref={ref}\n style={{\n ...props.style,\n ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }}\n />\n );\n};\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createRadioScope,\n //\n Radio,\n RadioIndicator,\n};\nexport type { RadioProps };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,cAAAA;AAAA,EAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,IAAAC,SAAuB;AACvB,IAAAC,oBAAqC;AACrC,IAAAC,6BAAgC;AAChC,IAAAC,wBAAmC;AACnC,IAAAC,0BAA0B;AAC1B,uBAAkC;AAClC,gCAA4C;AAC5C,0CAAqC;AACrC,6BAA6B;;;ACR7B,YAAuB;AACvB,uBAAqC;AACrC,gCAAgC;AAChC,2BAAmC;AACnC,4BAAwB;AACxB,gCAA4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MAAM,QAAQ,cAAc,UAAU,KAAK;AAAA,YACpD,eAAW,wCAAqB,CAAC,UAAU;AAEzC,kBAAI,MAAM,QAAQ,QAAS,OAAM,eAAe;AAAA,YAClD,CAAC;AAAA,YACD,aAAS,wCAAqB,UAAU,SAAS,MAAM;AAMrD,kBAAI,qBAAqB,QAAS,KAAI,SAAS,MAAM;AAAA,YACvD,CAAC;AAAA;AAAA,QACH;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAM7B,IAAMC,kBAAiB;AAMvB,IAAM,sBAA4B;AAAA,EAChC,CAAC,OAA8C,iBAAiB;AAC9D,UAAM,EAAE,mBAAmB,GAAG,eAAe,IAAI;AACjD,UAAM,aAAa,cAAc,iBAAiB;AAClD,WAAO,6CAAC,kBAAgB,GAAG,YAAa,GAAG,gBAAgB,KAAK,cAAc;AAAA,EAChF;AACF;AAEA,oBAAoB,cAAcA;AAIlC,IAAMC,QAAO;AACb,IAAMC,QAAO;AACb,IAAM,YAAY;",
6
+ "names": ["Item", "Root", "React", "import_primitive", "import_react_compose_refs", "import_react_context", "import_react_primitive", "import_jsx_runtime", "INDICATOR_NAME", "Root", "Item"]
7
7
  }
package/dist/index.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  // packages/react/radio-group/src/RadioGroup.tsx
2
4
  import * as React2 from "react";
3
5
  import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/RadioGroup.tsx", "../src/Radio.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Radio, RadioIndicator, createRadioScope } from './Radio';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroup\n * -----------------------------------------------------------------------------------------------*/\nconst RADIO_GROUP_NAME = 'RadioGroup';\n\ntype ScopedProps<P> = P & { __scopeRadioGroup?: Scope };\nconst [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [\n createRovingFocusGroupScope,\n createRadioScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useRadioScope = createRadioScope();\n\ntype RadioGroupContextValue = {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string;\n onValueChange(value: string): void;\n};\n\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext<RadioGroupContextValue>(RADIO_GROUP_NAME);\n\ntype RadioGroupElement = React.ElementRef<typeof Primitive.div>;\ntype RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface RadioGroupProps extends PrimitiveDivProps {\n name?: RadioGroupContextValue['name'];\n required?: Radix.ComponentPropsWithoutRef<typeof Radio>['required'];\n disabled?: Radix.ComponentPropsWithoutRef<typeof Radio>['disabled'];\n dir?: RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroupProps['loop'];\n defaultValue?: string;\n value?: RadioGroupContextValue['value'];\n onValueChange?: RadioGroupContextValue['onValueChange'];\n}\n\nconst RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(\n (props: ScopedProps<RadioGroupProps>, forwardedRef) => {\n const {\n __scopeRadioGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...groupProps\n } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <RadioGroupProvider\n scope={__scopeRadioGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onValueChange={setValue}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n <Primitive.div\n role=\"radiogroup\"\n aria-required={required}\n aria-orientation={orientation}\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...groupProps}\n ref={forwardedRef}\n />\n </RovingFocusGroup.Root>\n </RadioGroupProvider>\n );\n }\n);\n\nRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RadioGroupItem';\n\ntype RadioGroupItemElement = React.ElementRef<typeof Radio>;\ntype RadioProps = Radix.ComponentPropsWithoutRef<typeof Radio>;\ninterface RadioGroupItemProps extends Omit<RadioProps, 'onCheck' | 'name'> {\n value: string;\n}\n\nconst RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(\n (props: ScopedProps<RadioGroupItemProps>, forwardedRef) => {\n const { __scopeRadioGroup, disabled, ...itemProps } = props;\n const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const ref = React.useRef<React.ElementRef<typeof Radio>>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const checked = context.value === itemProps.value;\n const isArrowKeyPressedRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) {\n isArrowKeyPressedRef.current = true;\n }\n };\n const handleKeyUp = () => (isArrowKeyPressedRef.current = false);\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n };\n }, []);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <Radio\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...radioScope}\n {...itemProps}\n name={context.name}\n ref={composedRefs}\n onCheck={() => context.onValueChange(itemProps.value)}\n onKeyDown={composeEventHandlers((event) => {\n // According to WAI ARIA, radio groups don't activate items on enter keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onFocus={composeEventHandlers(itemProps.onFocus, () => {\n /**\n * Our `RovingFocusGroup` will focus the radio when navigating with arrow keys\n * and we need to \"check\" it in that case. We click it to \"check\" it (instead\n * of updating `context.value`) so that the radio change event fires.\n */\n if (isArrowKeyPressedRef.current) ref.current?.click();\n })}\n />\n </RovingFocusGroup.Item>\n );\n }\n);\n\nRadioGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioGroupIndicator';\n\ntype RadioGroupIndicatorElement = React.ElementRef<typeof RadioIndicator>;\ntype RadioIndicatorProps = Radix.ComponentPropsWithoutRef<typeof RadioIndicator>;\ninterface RadioGroupIndicatorProps extends RadioIndicatorProps {}\n\nconst RadioGroupIndicator = React.forwardRef<RadioGroupIndicatorElement, RadioGroupIndicatorProps>(\n (props: ScopedProps<RadioGroupIndicatorProps>, forwardedRef) => {\n const { __scopeRadioGroup, ...indicatorProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return <RadioIndicator {...radioScope} {...indicatorProps} ref={forwardedRef} />;\n }\n);\n\nRadioGroupIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = RadioGroup;\nconst Item = RadioGroupItem;\nconst Indicator = RadioGroupIndicator;\n\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupIndicator,\n //\n Root,\n Item,\n Indicator,\n};\nexport type { RadioGroupProps, RadioGroupItemProps, RadioGroupIndicatorProps };\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Radio\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_NAME = 'Radio';\n\ntype ScopedProps<P> = P & { __scopeRadio?: Scope };\nconst [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);\n\ntype RadioContextValue = { checked: boolean; disabled?: boolean };\nconst [RadioProvider, useRadioContext] = createRadioContext<RadioContextValue>(RADIO_NAME);\n\ntype RadioElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface RadioProps extends PrimitiveButtonProps {\n checked?: boolean;\n required?: boolean;\n onCheck?(): void;\n}\n\nconst Radio = React.forwardRef<RadioElement, RadioProps>(\n (props: ScopedProps<RadioProps>, forwardedRef) => {\n const {\n __scopeRadio,\n name,\n checked = false,\n required,\n disabled,\n value = 'on',\n onCheck,\n ...radioProps\n } = props;\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = button ? Boolean(button.closest('form')) : true;\n\n return (\n <RadioProvider scope={__scopeRadio} checked={checked} disabled={disabled}>\n <Primitive.button\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...radioProps}\n ref={composedRefs}\n onClick={composeEventHandlers(props.onClick, (event) => {\n // radios cannot be unchecked so we only communicate a checked state\n if (!checked) onCheck?.();\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if radio is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect radio updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n {isFormControl && (\n <BubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n style={{ transform: 'translateX(-100%)' }}\n />\n )}\n </RadioProvider>\n );\n }\n);\n\nRadio.displayName = RADIO_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioIndicator';\n\ntype RadioIndicatorElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\nexport interface RadioIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst RadioIndicator = React.forwardRef<RadioIndicatorElement, RadioIndicatorProps>(\n (props: ScopedProps<RadioIndicatorProps>, forwardedRef) => {\n const { __scopeRadio, forceMount, ...indicatorProps } = props;\n const context = useRadioContext(INDICATOR_NAME, __scopeRadio);\n return (\n <Presence present={forceMount || context.checked}>\n <Primitive.span\n data-state={getState(context.checked)}\n data-disabled={context.disabled ? '' : undefined}\n {...indicatorProps}\n ref={forwardedRef}\n />\n </Presence>\n );\n }\n);\n\nRadioIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype InputProps = Radix.ComponentPropsWithoutRef<'input'>;\ninterface BubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: boolean;\n control: HTMLElement | null;\n bubbles: boolean;\n}\n\nconst BubbleInput = (props: BubbleInputProps) => {\n const { control, checked, bubbles = true, ...inputProps } = props;\n const ref = React.useRef<HTMLInputElement>(null);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current!;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'checked') as PropertyDescriptor;\n const setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [prevChecked, checked, bubbles]);\n\n return (\n <input\n type=\"radio\"\n aria-hidden\n defaultChecked={checked}\n {...inputProps}\n tabIndex={-1}\n ref={ref}\n style={{\n ...props.style,\n ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }}\n />\n );\n};\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createRadioScope,\n //\n Radio,\n RadioIndicator,\n};\nexport type { RadioProps };\n"],
5
- "mappings": ";AAAA,YAAYA,YAAW;AACvB,SAAS,wBAAAC,6BAA4B;AACrC,SAAS,mBAAAC,wBAAuB;AAChC,SAAS,sBAAAC,2BAA0B;AACnC,SAAS,aAAAC,kBAAiB;AAC1B,YAAY,sBAAsB;AAClC,SAAS,mCAAmC;AAC5C,SAAS,4BAA4B;AACrC,SA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QAAQ,cAAc,UAAU,KAAK;AAAA,YACpD,WAAWI,sBAAqB,CAAC,UAAU;AAEzC,kBAAI,MAAM,QAAQ,QAAS,OAAM,eAAe;AAAA,YAClD,CAAC;AAAA,YACD,SAASA,sBAAqB,UAAU,SAAS,MAAM;AAMrD,kBAAI,qBAAqB,QAAS,KAAI,SAAS,MAAM;AAAA,YACvD,CAAC;AAAA;AAAA,QACH;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAM7B,IAAMC,kBAAiB;AAMvB,IAAM,sBAA4B;AAAA,EAChC,CAAC,OAA8C,iBAAiB;AAC9D,UAAM,EAAE,mBAAmB,GAAG,eAAe,IAAI;AACjD,UAAM,aAAa,cAAc,iBAAiB;AAClD,WAAO,gBAAAL,KAAC,kBAAgB,GAAG,YAAa,GAAG,gBAAgB,KAAK,cAAc;AAAA,EAChF;AACF;AAEA,oBAAoB,cAAcK;AAIlC,IAAMC,QAAO;AACb,IAAMC,QAAO;AACb,IAAM,YAAY;",
6
6
  "names": ["React", "composeEventHandlers", "useComposedRefs", "createContextScope", "Primitive", "jsx", "createContextScope", "Primitive", "useComposedRefs", "composeEventHandlers", "INDICATOR_NAME", "Root", "Item"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-radio-group",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0-rc.3",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -28,16 +28,16 @@
28
28
  "version": "yarn version"
29
29
  },
30
30
  "dependencies": {
31
- "@radix-ui/primitive": "1.1.0-rc.1",
32
- "@radix-ui/react-compose-refs": "1.1.0-rc.1",
33
- "@radix-ui/react-context": "1.1.0-rc.1",
34
- "@radix-ui/react-direction": "1.1.0-rc.1",
35
- "@radix-ui/react-presence": "1.1.0-rc.1",
36
- "@radix-ui/react-primitive": "1.1.0-rc.1",
37
- "@radix-ui/react-roving-focus": "1.1.0-rc.1",
38
- "@radix-ui/react-use-controllable-state": "1.1.0-rc.1",
39
- "@radix-ui/react-use-previous": "1.1.0-rc.1",
40
- "@radix-ui/react-use-size": "1.1.0-rc.1"
31
+ "@radix-ui/primitive": "1.1.0-rc.3",
32
+ "@radix-ui/react-compose-refs": "1.1.0-rc.3",
33
+ "@radix-ui/react-context": "1.1.0-rc.3",
34
+ "@radix-ui/react-direction": "1.1.0-rc.3",
35
+ "@radix-ui/react-presence": "1.1.0-rc.3",
36
+ "@radix-ui/react-primitive": "1.1.0-rc.3",
37
+ "@radix-ui/react-roving-focus": "1.1.0-rc.3",
38
+ "@radix-ui/react-use-controllable-state": "1.1.0-rc.3",
39
+ "@radix-ui/react-use-previous": "1.1.0-rc.3",
40
+ "@radix-ui/react-use-size": "1.1.0-rc.3"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@types/react": "*",