@radix-ui/react-radio-group 1.1.4-rc.9 → 1.2.0-rc.2
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.d.mts +39 -26
- package/dist/index.d.ts +39 -26
- package/dist/index.js +292 -274
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +269 -260
- package/dist/index.mjs.map +7 -1
- package/package.json +11 -12
- package/dist/index.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,290 +1,308 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
(() => {
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
|
+
}) : x)(function(x) {
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
+
});
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
13
32
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
33
|
+
// packages/react/radio-group/src/RadioGroup.tsx
|
|
34
|
+
var React2 = __toESM(__require("react"));
|
|
35
|
+
var import_primitive2 = __require("@radix-ui/primitive");
|
|
36
|
+
var import_react_compose_refs2 = __require("@radix-ui/react-compose-refs");
|
|
37
|
+
var import_react_context2 = __require("@radix-ui/react-context");
|
|
38
|
+
var import_react_primitive2 = __require("@radix-ui/react-primitive");
|
|
39
|
+
var RovingFocusGroup = __toESM(__require("@radix-ui/react-roving-focus"));
|
|
40
|
+
var import_react_roving_focus = __require("@radix-ui/react-roving-focus");
|
|
41
|
+
var import_react_use_controllable_state = __require("@radix-ui/react-use-controllable-state");
|
|
42
|
+
var import_react_direction = __require("@radix-ui/react-direction");
|
|
20
43
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"data-state": $ce74a64c62457efb$var$getState(checked),
|
|
68
|
-
"data-disabled": disabled ? '' : undefined,
|
|
69
|
-
disabled: disabled,
|
|
70
|
-
value: value
|
|
71
|
-
}, radioProps, {
|
|
72
|
-
ref: composedRefs,
|
|
73
|
-
onClick: $9yYIj$radixuiprimitive.composeEventHandlers(props.onClick, (event)=>{
|
|
74
|
-
// radios cannot be unchecked so we only communicate a checked state
|
|
75
|
-
if (!checked) onCheck === null || onCheck === void 0 || onCheck();
|
|
76
|
-
if (isFormControl) {
|
|
77
|
-
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(); // if radio is in a form, stop propagation from the button so that we only propagate
|
|
78
|
-
// one click event (from the input). We propagate changes from an input so that native
|
|
79
|
-
// form validation works and form events reflect radio updates.
|
|
44
|
+
// packages/react/radio-group/src/Radio.tsx
|
|
45
|
+
var React = __toESM(__require("react"));
|
|
46
|
+
var import_primitive = __require("@radix-ui/primitive");
|
|
47
|
+
var import_react_compose_refs = __require("@radix-ui/react-compose-refs");
|
|
48
|
+
var import_react_context = __require("@radix-ui/react-context");
|
|
49
|
+
var import_react_use_size = __require("@radix-ui/react-use-size");
|
|
50
|
+
var import_react_use_previous = __require("@radix-ui/react-use-previous");
|
|
51
|
+
var import_react_presence = __require("@radix-ui/react-presence");
|
|
52
|
+
var import_react_primitive = __require("@radix-ui/react-primitive");
|
|
53
|
+
var import_jsx_runtime = __require("react/jsx-runtime");
|
|
54
|
+
var RADIO_NAME = "Radio";
|
|
55
|
+
var [createRadioContext, createRadioScope] = (0, import_react_context.createContextScope)(RADIO_NAME);
|
|
56
|
+
var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
|
|
57
|
+
var Radio = React.forwardRef(
|
|
58
|
+
(props, forwardedRef) => {
|
|
59
|
+
const {
|
|
60
|
+
__scopeRadio,
|
|
61
|
+
name,
|
|
62
|
+
checked = false,
|
|
63
|
+
required,
|
|
64
|
+
disabled,
|
|
65
|
+
value = "on",
|
|
66
|
+
onCheck,
|
|
67
|
+
...radioProps
|
|
68
|
+
} = props;
|
|
69
|
+
const [button, setButton] = React.useState(null);
|
|
70
|
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setButton(node));
|
|
71
|
+
const hasConsumerStoppedPropagationRef = React.useRef(false);
|
|
72
|
+
const isFormControl = button ? Boolean(button.closest("form")) : true;
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
+
import_react_primitive.Primitive.button,
|
|
76
|
+
{
|
|
77
|
+
type: "button",
|
|
78
|
+
role: "radio",
|
|
79
|
+
"aria-checked": checked,
|
|
80
|
+
"data-state": getState(checked),
|
|
81
|
+
"data-disabled": disabled ? "" : void 0,
|
|
82
|
+
disabled,
|
|
83
|
+
value,
|
|
84
|
+
...radioProps,
|
|
85
|
+
ref: composedRefs,
|
|
86
|
+
onClick: (0, import_primitive.composeEventHandlers)(props.onClick, (event) => {
|
|
87
|
+
if (!checked) onCheck?.();
|
|
88
|
+
if (isFormControl) {
|
|
89
|
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
80
90
|
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
115
|
-
/*#__PURE__*/ Object.assign($ce74a64c62457efb$export$d35a9ffa9a04f9e7, {
|
|
116
|
-
displayName: $ce74a64c62457efb$var$INDICATOR_NAME
|
|
117
|
-
});
|
|
118
|
-
/* ---------------------------------------------------------------------------------------------- */ const $ce74a64c62457efb$var$BubbleInput = (props)=>{
|
|
119
|
-
const { control: control , checked: checked , bubbles: bubbles = true , ...inputProps } = props;
|
|
120
|
-
const ref = $9yYIj$react.useRef(null);
|
|
121
|
-
const prevChecked = $9yYIj$radixuireactuseprevious.usePrevious(checked);
|
|
122
|
-
const controlSize = $9yYIj$radixuireactusesize.useSize(control); // Bubble checked change to parents (e.g form change event)
|
|
123
|
-
$9yYIj$react.useEffect(()=>{
|
|
124
|
-
const input = ref.current;
|
|
125
|
-
const inputProto = window.HTMLInputElement.prototype;
|
|
126
|
-
const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'checked');
|
|
127
|
-
const setChecked = descriptor.set;
|
|
128
|
-
if (prevChecked !== checked && setChecked) {
|
|
129
|
-
const event = new Event('click', {
|
|
130
|
-
bubbles: bubbles
|
|
131
|
-
});
|
|
132
|
-
setChecked.call(input, checked);
|
|
133
|
-
input.dispatchEvent(event);
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
BubbleInput,
|
|
97
|
+
{
|
|
98
|
+
control: button,
|
|
99
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
100
|
+
name,
|
|
101
|
+
value,
|
|
102
|
+
checked,
|
|
103
|
+
required,
|
|
104
|
+
disabled,
|
|
105
|
+
style: { transform: "translateX(-100%)" }
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
Radio.displayName = RADIO_NAME;
|
|
112
|
+
var INDICATOR_NAME = "RadioIndicator";
|
|
113
|
+
var RadioIndicator = React.forwardRef(
|
|
114
|
+
(props, forwardedRef) => {
|
|
115
|
+
const { __scopeRadio, forceMount, ...indicatorProps } = props;
|
|
116
|
+
const context = useRadioContext(INDICATOR_NAME, __scopeRadio);
|
|
117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
118
|
+
import_react_primitive.Primitive.span,
|
|
119
|
+
{
|
|
120
|
+
"data-state": getState(context.checked),
|
|
121
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
122
|
+
...indicatorProps,
|
|
123
|
+
ref: forwardedRef
|
|
134
124
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
125
|
+
) });
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
RadioIndicator.displayName = INDICATOR_NAME;
|
|
129
|
+
var BubbleInput = (props) => {
|
|
130
|
+
const { control, checked, bubbles = true, ...inputProps } = props;
|
|
131
|
+
const ref = React.useRef(null);
|
|
132
|
+
const prevChecked = (0, import_react_use_previous.usePrevious)(checked);
|
|
133
|
+
const controlSize = (0, import_react_use_size.useSize)(control);
|
|
134
|
+
React.useEffect(() => {
|
|
135
|
+
const input = ref.current;
|
|
136
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
137
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
|
|
138
|
+
const setChecked = descriptor.set;
|
|
139
|
+
if (prevChecked !== checked && setChecked) {
|
|
140
|
+
const event = new Event("click", { bubbles });
|
|
141
|
+
setChecked.call(input, checked);
|
|
142
|
+
input.dispatchEvent(event);
|
|
143
|
+
}
|
|
144
|
+
}, [prevChecked, checked, bubbles]);
|
|
145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
146
|
+
"input",
|
|
147
|
+
{
|
|
141
148
|
type: "radio",
|
|
142
149
|
"aria-hidden": true,
|
|
143
|
-
defaultChecked: checked
|
|
144
|
-
|
|
150
|
+
defaultChecked: checked,
|
|
151
|
+
...inputProps,
|
|
145
152
|
tabIndex: -1,
|
|
146
|
-
ref
|
|
153
|
+
ref,
|
|
147
154
|
style: {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
...props.style,
|
|
156
|
+
...controlSize,
|
|
157
|
+
position: "absolute",
|
|
158
|
+
pointerEvents: "none",
|
|
159
|
+
opacity: 0,
|
|
160
|
+
margin: 0
|
|
154
161
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
};
|
|
165
|
+
function getState(checked) {
|
|
166
|
+
return checked ? "checked" : "unchecked";
|
|
167
|
+
}
|
|
161
168
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
169
|
+
// packages/react/radio-group/src/RadioGroup.tsx
|
|
170
|
+
var import_jsx_runtime2 = __require("react/jsx-runtime");
|
|
171
|
+
var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
172
|
+
var RADIO_GROUP_NAME = "RadioGroup";
|
|
173
|
+
var [createRadioGroupContext, createRadioGroupScope] = (0, import_react_context2.createContextScope)(RADIO_GROUP_NAME, [
|
|
174
|
+
import_react_roving_focus.createRovingFocusGroupScope,
|
|
175
|
+
createRadioScope
|
|
176
|
+
]);
|
|
177
|
+
var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)();
|
|
178
|
+
var useRadioScope = createRadioScope();
|
|
179
|
+
var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
|
|
180
|
+
var RadioGroup = React2.forwardRef(
|
|
181
|
+
(props, forwardedRef) => {
|
|
182
|
+
const {
|
|
183
|
+
__scopeRadioGroup,
|
|
184
|
+
name,
|
|
185
|
+
defaultValue,
|
|
186
|
+
value: valueProp,
|
|
187
|
+
required = false,
|
|
188
|
+
disabled = false,
|
|
189
|
+
orientation,
|
|
190
|
+
dir,
|
|
191
|
+
loop = true,
|
|
192
|
+
onValueChange,
|
|
193
|
+
...groupProps
|
|
194
|
+
} = props;
|
|
195
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
|
|
196
|
+
const direction = (0, import_react_direction.useDirection)(dir);
|
|
197
|
+
const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({
|
|
183
198
|
prop: valueProp,
|
|
184
199
|
defaultProp: defaultValue,
|
|
185
200
|
onChange: onValueChange
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
201
|
+
});
|
|
202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
203
|
+
RadioGroupProvider,
|
|
204
|
+
{
|
|
205
|
+
scope: __scopeRadioGroup,
|
|
206
|
+
name,
|
|
207
|
+
required,
|
|
208
|
+
disabled,
|
|
209
|
+
value,
|
|
210
|
+
onValueChange: setValue,
|
|
211
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
212
|
+
RovingFocusGroup.Root,
|
|
213
|
+
{
|
|
214
|
+
asChild: true,
|
|
215
|
+
...rovingFocusGroupScope,
|
|
216
|
+
orientation,
|
|
217
|
+
dir: direction,
|
|
218
|
+
loop,
|
|
219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
220
|
+
import_react_primitive2.Primitive.div,
|
|
221
|
+
{
|
|
222
|
+
role: "radiogroup",
|
|
223
|
+
"aria-required": required,
|
|
224
|
+
"aria-orientation": orientation,
|
|
225
|
+
"data-disabled": disabled ? "" : void 0,
|
|
226
|
+
dir: direction,
|
|
227
|
+
...groupProps,
|
|
228
|
+
ref: forwardedRef
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
RadioGroup.displayName = RADIO_GROUP_NAME;
|
|
238
|
+
var ITEM_NAME = "RadioGroupItem";
|
|
239
|
+
var RadioGroupItem = React2.forwardRef(
|
|
240
|
+
(props, forwardedRef) => {
|
|
241
|
+
const { __scopeRadioGroup, disabled, ...itemProps } = props;
|
|
242
|
+
const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);
|
|
243
|
+
const isDisabled = context.disabled || disabled;
|
|
244
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
|
|
245
|
+
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
246
|
+
const ref = React2.useRef(null);
|
|
247
|
+
const composedRefs = (0, import_react_compose_refs2.useComposedRefs)(forwardedRef, ref);
|
|
248
|
+
const checked = context.value === itemProps.value;
|
|
249
|
+
const isArrowKeyPressedRef = React2.useRef(false);
|
|
250
|
+
React2.useEffect(() => {
|
|
251
|
+
const handleKeyDown = (event) => {
|
|
252
|
+
if (ARROW_KEYS.includes(event.key)) {
|
|
253
|
+
isArrowKeyPressedRef.current = true;
|
|
254
|
+
}
|
|
229
255
|
};
|
|
230
|
-
const handleKeyUp = ()=>isArrowKeyPressedRef.current = false
|
|
231
|
-
;
|
|
232
|
-
document.addEventListener(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
document.removeEventListener('keyup', handleKeyUp);
|
|
256
|
+
const handleKeyUp = () => isArrowKeyPressedRef.current = false;
|
|
257
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
258
|
+
document.addEventListener("keyup", handleKeyUp);
|
|
259
|
+
return () => {
|
|
260
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
261
|
+
document.removeEventListener("keyup", handleKeyUp);
|
|
237
262
|
};
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
});
|
|
283
|
-
/* ---------------------------------------------------------------------------------------------- */ const $240483839a8a76fd$export$be92b6f5f03c0fe9 = $240483839a8a76fd$export$a98f0dcb43a68a25;
|
|
284
|
-
const $240483839a8a76fd$export$6d08773d2e66f8f2 = $240483839a8a76fd$export$9f866c100ef519e4;
|
|
285
|
-
const $240483839a8a76fd$export$adb584737d712b70 = $240483839a8a76fd$export$5fb54c671a65c88;
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
263
|
+
}, []);
|
|
264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
265
|
+
RovingFocusGroup.Item,
|
|
266
|
+
{
|
|
267
|
+
asChild: true,
|
|
268
|
+
...rovingFocusGroupScope,
|
|
269
|
+
focusable: !isDisabled,
|
|
270
|
+
active: checked,
|
|
271
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
272
|
+
Radio,
|
|
273
|
+
{
|
|
274
|
+
disabled: isDisabled,
|
|
275
|
+
required: context.required,
|
|
276
|
+
checked,
|
|
277
|
+
...radioScope,
|
|
278
|
+
...itemProps,
|
|
279
|
+
name: context.name,
|
|
280
|
+
ref: composedRefs,
|
|
281
|
+
onCheck: () => context.onValueChange(itemProps.value),
|
|
282
|
+
onKeyDown: (0, import_primitive2.composeEventHandlers)((event) => {
|
|
283
|
+
if (event.key === "Enter") event.preventDefault();
|
|
284
|
+
}),
|
|
285
|
+
onFocus: (0, import_primitive2.composeEventHandlers)(itemProps.onFocus, () => {
|
|
286
|
+
if (isArrowKeyPressedRef.current) ref.current?.click();
|
|
287
|
+
})
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
RadioGroupItem.displayName = ITEM_NAME;
|
|
295
|
+
var INDICATOR_NAME2 = "RadioGroupIndicator";
|
|
296
|
+
var RadioGroupIndicator = React2.forwardRef(
|
|
297
|
+
(props, forwardedRef) => {
|
|
298
|
+
const { __scopeRadioGroup, ...indicatorProps } = props;
|
|
299
|
+
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef });
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
RadioGroupIndicator.displayName = INDICATOR_NAME2;
|
|
304
|
+
var Root2 = RadioGroup;
|
|
305
|
+
var Item2 = RadioGroupItem;
|
|
306
|
+
var Indicator = RadioGroupIndicator;
|
|
307
|
+
})();
|
|
290
308
|
//# sourceMappingURL=index.js.map
|