@tamagui/radio-group 1.13.2 → 1.13.4
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/cjs/RadioGroup.js +1 -393
- package/dist/cjs/RadioGroup.js.map +2 -2
- package/dist/cjs/index.js +1 -18
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/RadioGroup.js +1 -365
- package/dist/esm/RadioGroup.js.map +2 -2
- package/dist/esm/RadioGroup.mjs +1 -365
- package/dist/esm/RadioGroup.mjs.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/jsx/RadioGroup.js +1 -341
- package/dist/jsx/RadioGroup.js.map +2 -2
- package/dist/jsx/RadioGroup.mjs +1 -341
- package/dist/jsx/RadioGroup.mjs.map +2 -2
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/esm/RadioGroup.mjs
CHANGED
|
@@ -1,366 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { usePrevious } from "@radix-ui/react-use-previous";
|
|
3
|
-
import {
|
|
4
|
-
composeEventHandlers,
|
|
5
|
-
getVariableValue,
|
|
6
|
-
isWeb,
|
|
7
|
-
styled,
|
|
8
|
-
useComposedRefs,
|
|
9
|
-
withStaticProperties
|
|
10
|
-
} from "@tamagui/core";
|
|
11
|
-
import { createContextScope } from "@tamagui/create-context";
|
|
12
|
-
import { registerFocusable } from "@tamagui/focusable";
|
|
13
|
-
import { getSize } from "@tamagui/get-size";
|
|
14
|
-
import { useLabelContext } from "@tamagui/label";
|
|
15
|
-
import { ThemeableStack } from "@tamagui/stacks";
|
|
16
|
-
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
17
|
-
import * as React from "react";
|
|
18
|
-
const RADIO_GROUP_NAME = "RadioGroup";
|
|
19
|
-
const ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
20
|
-
const [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME);
|
|
21
|
-
const [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
|
|
22
|
-
const getState = (checked) => {
|
|
23
|
-
return checked ? "checked" : "unchecked";
|
|
24
|
-
};
|
|
25
|
-
const RADIO_GROUP_INDICATOR_NAME = "RadioGroupIndicator";
|
|
26
|
-
const RadioIndicatorFrame = styled(ThemeableStack, {
|
|
27
|
-
name: RADIO_GROUP_INDICATOR_NAME,
|
|
28
|
-
variants: {
|
|
29
|
-
unstyled: {
|
|
30
|
-
false: {
|
|
31
|
-
w: "40%",
|
|
32
|
-
h: "40%",
|
|
33
|
-
br: 1e3,
|
|
34
|
-
backgroundColor: "$color",
|
|
35
|
-
pressTheme: true,
|
|
36
|
-
pressStyle: {
|
|
37
|
-
backgroundColor: "$colorTransparent"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
unstyled: false
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const RadioIndicator = RadioIndicatorFrame.extractable(
|
|
47
|
-
React.forwardRef(
|
|
48
|
-
(props, forwardedRef) => {
|
|
49
|
-
const { __scopeRadioGroupItem, forceMount, disabled, ...indicatorProps } = props;
|
|
50
|
-
const { checked } = useRadioGroupItemContext(
|
|
51
|
-
RADIO_GROUP_INDICATOR_NAME,
|
|
52
|
-
__scopeRadioGroupItem
|
|
53
|
-
);
|
|
54
|
-
if (forceMount || checked) {
|
|
55
|
-
return /* @__PURE__ */ jsx(
|
|
56
|
-
RadioIndicatorFrame,
|
|
57
|
-
{
|
|
58
|
-
theme: "active",
|
|
59
|
-
"data-state": getState(checked),
|
|
60
|
-
"data-disabled": disabled ? "" : void 0,
|
|
61
|
-
...indicatorProps,
|
|
62
|
-
ref: forwardedRef
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
);
|
|
70
|
-
RadioIndicator.displayName = RADIO_GROUP_INDICATOR_NAME;
|
|
71
|
-
const RADIO_GROUP_ITEM_NAME = "RadioGroupItem";
|
|
72
|
-
const [RadioGroupItemProvider, useRadioGroupItemContext] = createRadioGroupContext(RADIO_GROUP_NAME);
|
|
73
|
-
const RadioGroupItemFrame = styled(ThemeableStack, {
|
|
74
|
-
name: RADIO_GROUP_ITEM_NAME,
|
|
75
|
-
tag: "button",
|
|
76
|
-
variants: {
|
|
77
|
-
unstyled: {
|
|
78
|
-
false: {
|
|
79
|
-
size: "$true",
|
|
80
|
-
borderRadius: 1e3,
|
|
81
|
-
backgroundColor: "$background",
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
justifyContent: "center",
|
|
84
|
-
borderWidth: 1,
|
|
85
|
-
borderColor: "$borderColor",
|
|
86
|
-
padding: 0,
|
|
87
|
-
hoverStyle: {
|
|
88
|
-
borderColor: "$borderColorHover",
|
|
89
|
-
background: "$backgroundHover"
|
|
90
|
-
},
|
|
91
|
-
focusStyle: {
|
|
92
|
-
borderColor: "$borderColorHover",
|
|
93
|
-
background: "$backgroundHover"
|
|
94
|
-
},
|
|
95
|
-
pressStyle: {
|
|
96
|
-
borderColor: "$borderColorFocus",
|
|
97
|
-
background: "$backgroundFocus"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
size: {
|
|
102
|
-
"...size": (value, { props }) => {
|
|
103
|
-
const size = Math.floor(
|
|
104
|
-
getVariableValue(getSize(value)) * (props["scaleSize"] ?? 0.5)
|
|
105
|
-
);
|
|
106
|
-
return {
|
|
107
|
-
width: size,
|
|
108
|
-
height: size
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
defaultVariants: {
|
|
114
|
-
unstyled: false
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
const RadioGroupItem = RadioGroupItemFrame.extractable(
|
|
118
|
-
React.forwardRef(
|
|
119
|
-
(props, forwardedRef) => {
|
|
120
|
-
const {
|
|
121
|
-
__scopeRadioGroup,
|
|
122
|
-
value,
|
|
123
|
-
labelledBy: ariaLabelledby,
|
|
124
|
-
disabled: itemDisabled,
|
|
125
|
-
...itemProps
|
|
126
|
-
} = props;
|
|
127
|
-
const {
|
|
128
|
-
value: groupValue,
|
|
129
|
-
disabled,
|
|
130
|
-
required,
|
|
131
|
-
onChange,
|
|
132
|
-
name,
|
|
133
|
-
native,
|
|
134
|
-
accentColor
|
|
135
|
-
} = useRadioGroupContext(RADIO_GROUP_ITEM_NAME, __scopeRadioGroup);
|
|
136
|
-
const [button, setButton] = React.useState(null);
|
|
137
|
-
const hasConsumerStoppedPropagationRef = React.useRef(false);
|
|
138
|
-
const ref = React.useRef(null);
|
|
139
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node), ref);
|
|
140
|
-
const isArrowKeyPressedRef = React.useRef(false);
|
|
141
|
-
const isFormControl = isWeb ? button ? Boolean(button.closest("form")) : true : false;
|
|
142
|
-
const checked = groupValue === value;
|
|
143
|
-
const labelId = useLabelContext(button);
|
|
144
|
-
const labelledBy = ariaLabelledby || labelId;
|
|
145
|
-
React.useEffect(() => {
|
|
146
|
-
if (isWeb) {
|
|
147
|
-
const handleKeyDown = (event) => {
|
|
148
|
-
if (ARROW_KEYS.includes(event.key)) {
|
|
149
|
-
isArrowKeyPressedRef.current = true;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
const handleKeyUp = () => isArrowKeyPressedRef.current = false;
|
|
153
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
154
|
-
document.addEventListener("keyup", handleKeyUp);
|
|
155
|
-
return () => {
|
|
156
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
157
|
-
document.removeEventListener("keyup", handleKeyUp);
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
}, []);
|
|
161
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
162
|
-
React.useEffect(() => {
|
|
163
|
-
if (!props.id)
|
|
164
|
-
return;
|
|
165
|
-
return registerFocusable(props.id, {
|
|
166
|
-
focusAndSelect: () => {
|
|
167
|
-
onChange == null ? void 0 : onChange(value);
|
|
168
|
-
},
|
|
169
|
-
focus: () => {
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}, [props.id, value]);
|
|
173
|
-
}
|
|
174
|
-
const isDisabled = disabled || itemDisabled;
|
|
175
|
-
return /* @__PURE__ */ jsx(RadioGroupItemProvider, { checked, scope: __scopeRadioGroup, children: isWeb && native ? /* @__PURE__ */ jsx(
|
|
176
|
-
BubbleInput,
|
|
177
|
-
{
|
|
178
|
-
control: button,
|
|
179
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
180
|
-
name,
|
|
181
|
-
value,
|
|
182
|
-
checked,
|
|
183
|
-
required,
|
|
184
|
-
disabled: isDisabled,
|
|
185
|
-
id: props.id,
|
|
186
|
-
accentColor
|
|
187
|
-
}
|
|
188
|
-
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
189
|
-
/* @__PURE__ */ jsx(
|
|
190
|
-
RadioGroupItemFrame,
|
|
191
|
-
{
|
|
192
|
-
"data-state": getState(checked),
|
|
193
|
-
"data-disabled": isDisabled ? "" : void 0,
|
|
194
|
-
role: "radio",
|
|
195
|
-
"aria-labelledby": labelledBy,
|
|
196
|
-
"aria-checked": checked,
|
|
197
|
-
"aria-required": required,
|
|
198
|
-
disabled: isDisabled,
|
|
199
|
-
ref: composedRefs,
|
|
200
|
-
...isWeb && {
|
|
201
|
-
type: "button",
|
|
202
|
-
value
|
|
203
|
-
},
|
|
204
|
-
...itemProps,
|
|
205
|
-
onPress: composeEventHandlers(props.onPress, (event) => {
|
|
206
|
-
if (!checked) {
|
|
207
|
-
onChange == null ? void 0 : onChange(value);
|
|
208
|
-
}
|
|
209
|
-
if (isFormControl) {
|
|
210
|
-
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
211
|
-
if (!hasConsumerStoppedPropagationRef.current)
|
|
212
|
-
event.stopPropagation();
|
|
213
|
-
}
|
|
214
|
-
}),
|
|
215
|
-
...isWeb && {
|
|
216
|
-
onKeyDown: composeEventHandlers(
|
|
217
|
-
props.onKeyDown,
|
|
218
|
-
(event) => {
|
|
219
|
-
if (event.key === "Enter")
|
|
220
|
-
event.preventDefault();
|
|
221
|
-
}
|
|
222
|
-
),
|
|
223
|
-
onFocus: composeEventHandlers(itemProps.onFocus, () => {
|
|
224
|
-
var _a;
|
|
225
|
-
if (isArrowKeyPressedRef.current)
|
|
226
|
-
(_a = ref.current) == null ? void 0 : _a.click();
|
|
227
|
-
})
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
),
|
|
231
|
-
isFormControl && /* @__PURE__ */ jsx(
|
|
232
|
-
BubbleInput,
|
|
233
|
-
{
|
|
234
|
-
isHidden: true,
|
|
235
|
-
control: button,
|
|
236
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
237
|
-
name,
|
|
238
|
-
value,
|
|
239
|
-
checked,
|
|
240
|
-
required,
|
|
241
|
-
disabled: isDisabled
|
|
242
|
-
}
|
|
243
|
-
)
|
|
244
|
-
] }) });
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
);
|
|
248
|
-
const BubbleInput = (props) => {
|
|
249
|
-
const { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;
|
|
250
|
-
const ref = React.useRef(null);
|
|
251
|
-
const prevChecked = usePrevious(checked);
|
|
252
|
-
React.useEffect(() => {
|
|
253
|
-
const input = ref.current;
|
|
254
|
-
const inputProto = window.HTMLInputElement.prototype;
|
|
255
|
-
const descriptor = Object.getOwnPropertyDescriptor(
|
|
256
|
-
inputProto,
|
|
257
|
-
"checked"
|
|
258
|
-
);
|
|
259
|
-
const setChecked = descriptor.set;
|
|
260
|
-
if (prevChecked !== checked && setChecked) {
|
|
261
|
-
const event = new Event("click", { bubbles });
|
|
262
|
-
setChecked.call(input, checked);
|
|
263
|
-
input.dispatchEvent(event);
|
|
264
|
-
}
|
|
265
|
-
}, [prevChecked, checked, bubbles]);
|
|
266
|
-
return /* @__PURE__ */ jsx(
|
|
267
|
-
"input",
|
|
268
|
-
{
|
|
269
|
-
type: "radio",
|
|
270
|
-
defaultChecked: checked,
|
|
271
|
-
...inputProps,
|
|
272
|
-
tabIndex: -1,
|
|
273
|
-
ref,
|
|
274
|
-
"aria-hidden": isHidden,
|
|
275
|
-
style: {
|
|
276
|
-
...isHidden ? {
|
|
277
|
-
// ...controlSize,
|
|
278
|
-
position: "absolute",
|
|
279
|
-
pointerEvents: "none",
|
|
280
|
-
opacity: 0,
|
|
281
|
-
margin: 0
|
|
282
|
-
} : {
|
|
283
|
-
appearance: "auto",
|
|
284
|
-
accentColor
|
|
285
|
-
},
|
|
286
|
-
...props.style
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
);
|
|
290
|
-
};
|
|
291
|
-
const RadioGroupFrame = styled(ThemeableStack, {
|
|
292
|
-
name: RADIO_GROUP_NAME,
|
|
293
|
-
variants: {
|
|
294
|
-
orientation: {
|
|
295
|
-
horizontal: {
|
|
296
|
-
flexDirection: "row",
|
|
297
|
-
spaceDirection: "horizontal"
|
|
298
|
-
},
|
|
299
|
-
vertical: {
|
|
300
|
-
flexDirection: "column",
|
|
301
|
-
spaceDirection: "vertical"
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
const RadioGroup = withStaticProperties(
|
|
307
|
-
RadioGroupFrame.extractable(
|
|
308
|
-
React.forwardRef(
|
|
309
|
-
(props, forwardedRef) => {
|
|
310
|
-
const {
|
|
311
|
-
__scopeRadioGroup,
|
|
312
|
-
value: valueProp,
|
|
313
|
-
defaultValue,
|
|
314
|
-
onValueChange,
|
|
315
|
-
disabled = false,
|
|
316
|
-
required = false,
|
|
317
|
-
name,
|
|
318
|
-
orientation,
|
|
319
|
-
native,
|
|
320
|
-
accentColor,
|
|
321
|
-
...radioGroupProps
|
|
322
|
-
} = props;
|
|
323
|
-
const [value, setValue] = useControllableState({
|
|
324
|
-
prop: valueProp,
|
|
325
|
-
defaultProp: defaultValue,
|
|
326
|
-
onChange: onValueChange
|
|
327
|
-
});
|
|
328
|
-
return /* @__PURE__ */ jsx(
|
|
329
|
-
RadioGroupProvider,
|
|
330
|
-
{
|
|
331
|
-
scope: __scopeRadioGroup,
|
|
332
|
-
value,
|
|
333
|
-
required,
|
|
334
|
-
onChange: setValue,
|
|
335
|
-
disabled,
|
|
336
|
-
name,
|
|
337
|
-
native,
|
|
338
|
-
accentColor,
|
|
339
|
-
children: /* @__PURE__ */ jsx(
|
|
340
|
-
RadioGroupFrame,
|
|
341
|
-
{
|
|
342
|
-
"aria-valuetext": value,
|
|
343
|
-
role: "radiogroup",
|
|
344
|
-
"aria-orientation": orientation,
|
|
345
|
-
ref: forwardedRef,
|
|
346
|
-
orientation,
|
|
347
|
-
"data-disabled": disabled ? "" : void 0,
|
|
348
|
-
...radioGroupProps
|
|
349
|
-
}
|
|
350
|
-
)
|
|
351
|
-
}
|
|
352
|
-
);
|
|
353
|
-
}
|
|
354
|
-
)
|
|
355
|
-
),
|
|
356
|
-
{
|
|
357
|
-
Indicator: RadioIndicator,
|
|
358
|
-
Item: RadioGroupItem
|
|
359
|
-
}
|
|
360
|
-
);
|
|
361
|
-
RadioGroup.displayName = RADIO_GROUP_NAME;
|
|
362
|
-
export {
|
|
363
|
-
RadioGroup,
|
|
364
|
-
createRadioGroupScope
|
|
365
|
-
};
|
|
1
|
+
import{Fragment as de,jsx as c,jsxs as se}from"react/jsx-runtime";import{usePrevious as U}from"@radix-ui/react-use-previous";import{composeEventHandlers as C,getVariableValue as N,isWeb as P,styled as E,useComposedRefs as W,withStaticProperties as j}from"@tamagui/core";import{createContextScope as Y}from"@tamagui/create-context";import{registerFocusable as J}from"@tamagui/focusable";import{getSize as Q}from"@tamagui/get-size";import{useLabelContext as X}from"@tamagui/label";import{ThemeableStack as k}from"@tamagui/stacks";import{useControllableState as Z}from"@tamagui/use-controllable-state";import*as n from"react";const G="RadioGroup",ee=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],[M,oe]=Y(G),[te,re]=M(G),_=e=>e?"checked":"unchecked",w="RadioGroupIndicator",L=E(k,{name:w,variants:{unstyled:{false:{w:"40%",h:"40%",br:1e3,backgroundColor:"$color",pressTheme:!0,pressStyle:{backgroundColor:"$colorTransparent"}}}},defaultVariants:{unstyled:!1}}),x=L.extractable(n.forwardRef((e,o)=>{const{__scopeRadioGroupItem:r,forceMount:a,disabled:l,...u}=e,{checked:i}=ne(w,r);return a||i?c(L,{theme:"active","data-state":_(i),"data-disabled":l?"":void 0,...u,ref:o}):null}));x.displayName=w;const D="RadioGroupItem",[ae,ne]=M(G),A=E(k,{name:D,tag:"button",variants:{unstyled:{false:{size:"$true",borderRadius:1e3,backgroundColor:"$background",alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:"$borderColor",padding:0,hoverStyle:{borderColor:"$borderColorHover",background:"$backgroundHover"},focusStyle:{borderColor:"$borderColorHover",background:"$backgroundHover"},pressStyle:{borderColor:"$borderColorFocus",background:"$backgroundFocus"}}},size:{"...size":(e,{props:o})=>{const r=Math.floor(N(Q(e))*(o.scaleSize??.5));return{width:r,height:r}}}},defaultVariants:{unstyled:!1}}),ie=A.extractable(n.forwardRef((e,o)=>{const{__scopeRadioGroup:r,value:a,labelledBy:l,disabled:u,...i}=e,{value:m,disabled:b,required:s,onChange:d,name:v,native:f,accentColor:R}=re(D,r),[p,O]=n.useState(null),I=n.useRef(!1),S=n.useRef(null),$=W(o,t=>O(t),S),h=n.useRef(!1),T=P?p?Boolean(p.closest("form")):!0:!1,y=m===a,q=X(p),z=l||q;n.useEffect(()=>{if(P){const t=K=>{ee.includes(K.key)&&(h.current=!0)},H=()=>h.current=!1;return document.addEventListener("keydown",t),document.addEventListener("keyup",H),()=>{document.removeEventListener("keydown",t),document.removeEventListener("keyup",H)}}},[]),process.env.TAMAGUI_TARGET==="native"&&n.useEffect(()=>{if(e.id)return J(e.id,{focusAndSelect:()=>{d==null||d(a)},focus:()=>{}})},[e.id,a]);const g=b||u;return c(ae,{checked:y,scope:r,children:P&&f?c(V,{control:p,bubbles:!I.current,name:v,value:a,checked:y,required:s,disabled:g,id:e.id,accentColor:R}):se(de,{children:[c(A,{"data-state":_(y),"data-disabled":g?"":void 0,role:"radio","aria-labelledby":z,"aria-checked":y,"aria-required":s,disabled:g,ref:$,...P&&{type:"button",value:a},...i,onPress:C(e.onPress,t=>{y||d==null||d(a),T&&(I.current=t.isPropagationStopped(),I.current||t.stopPropagation())}),...P&&{onKeyDown:C(e.onKeyDown,t=>{t.key==="Enter"&&t.preventDefault()}),onFocus:C(i.onFocus,()=>{var t;h.current&&((t=S.current)==null||t.click())})}}),T&&c(V,{isHidden:!0,control:p,bubbles:!I.current,name:v,value:a,checked:y,required:s,disabled:g})]})})})),V=e=>{const{checked:o,bubbles:r=!0,control:a,isHidden:l,accentColor:u,...i}=e,m=n.useRef(null),b=U(o);return n.useEffect(()=>{const s=m.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(b!==o&&f){const R=new Event("click",{bubbles:r});f.call(s,o),s.dispatchEvent(R)}},[b,o,r]),c("input",{type:"radio",defaultChecked:o,...i,tabIndex:-1,ref:m,"aria-hidden":l,style:{...l?{position:"absolute",pointerEvents:"none",opacity:0,margin:0}:{appearance:"auto",accentColor:u},...e.style}})},B=E(k,{name:G,variants:{orientation:{horizontal:{flexDirection:"row",spaceDirection:"horizontal"},vertical:{flexDirection:"column",spaceDirection:"vertical"}}}}),F=j(B.extractable(n.forwardRef((e,o)=>{const{__scopeRadioGroup:r,value:a,defaultValue:l,onValueChange:u,disabled:i=!1,required:m=!1,name:b,orientation:s,native:d,accentColor:v,...f}=e,[R,p]=Z({prop:a,defaultProp:l,onChange:u});return c(te,{scope:r,value:R,required:m,onChange:p,disabled:i,name:b,native:d,accentColor:v,children:c(B,{"aria-valuetext":R,role:"radiogroup","aria-orientation":s,ref:o,orientation:s,"data-disabled":i?"":void 0,...f})})})),{Indicator:x,Item:ie});F.displayName=G;export{F as RadioGroup,oe as createRadioGroupScope};
|
|
366
2
|
//# sourceMappingURL=RadioGroup.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/RadioGroup.tsx"],
|
|
4
4
|
"sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/radio-group/src/RadioGroup.tsx\n\nimport { usePrevious } from '@radix-ui/react-use-previous'\nimport {\n GetProps,\n composeEventHandlers,\n getVariableValue,\n isWeb,\n styled,\n useComposedRefs,\n withStaticProperties,\n} from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { registerFocusable } from '@tamagui/focusable'\nimport { getSize, stepTokenUpOrDown } from '@tamagui/get-size'\nimport { useLabelContext } from '@tamagui/label'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nconst RADIO_GROUP_NAME = 'RadioGroup'\n\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']\n\nconst [createRadioGroupContext, createRadioGroupScope] =\n createContextScope(RADIO_GROUP_NAME)\ntype RadioGroupContextValue = {\n value?: string\n disabled?: boolean\n required?: boolean\n onChange?: (value: string) => void\n name?: string\n native?: boolean\n accentColor?: string\n}\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext<RadioGroupContextValue>(RADIO_GROUP_NAME)\n\nconst getState = (checked: boolean) => {\n return checked ? 'checked' : 'unchecked'\n}\n\n/* -------------------------------------------------------------------------\n * RadioIndicator\n * ------------------------------------------------------------------------ */\n\nconst RADIO_GROUP_INDICATOR_NAME = 'RadioGroupIndicator'\n\nconst RadioIndicatorFrame = styled(ThemeableStack, {\n name: RADIO_GROUP_INDICATOR_NAME,\n\n variants: {\n unstyled: {\n false: {\n w: '40%',\n h: '40%',\n br: 1000,\n backgroundColor: '$color',\n pressTheme: true,\n pressStyle: {\n backgroundColor: '$colorTransparent',\n },\n },\n },\n } as const,\n\n defaultVariants: {\n unstyled: false,\n },\n})\n\ntype RadioIndicatorProps = GetProps<typeof RadioIndicatorFrame> & {\n forceMount?: boolean\n unstyled?: boolean\n}\n\ntype RadioIndicatorElement = TamaguiElement\n\nconst RadioIndicator = RadioIndicatorFrame.extractable(\n React.forwardRef<RadioIndicatorElement, RadioIndicatorProps>(\n (props: ScopedRadioGroupItemProps<RadioIndicatorProps>, forwardedRef) => {\n const { __scopeRadioGroupItem, forceMount, disabled, ...indicatorProps } = props\n const { checked } = useRadioGroupItemContext(\n RADIO_GROUP_INDICATOR_NAME,\n __scopeRadioGroupItem\n )\n\n if (forceMount || checked) {\n return (\n <RadioIndicatorFrame\n theme=\"active\"\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n {...indicatorProps}\n ref={forwardedRef}\n />\n )\n }\n\n return null\n }\n )\n)\n\nRadioIndicator.displayName = RADIO_GROUP_INDICATOR_NAME\n\n/* -------------------------------------------------------------------------\n * RadioGroupItem\n * ------------------------------------------------------------------------ */\n\nconst RADIO_GROUP_ITEM_NAME = 'RadioGroupItem'\n\ntype RadioGroupItemContextValue = {\n checked: boolean\n disabled?: boolean\n}\n\nconst [RadioGroupItemProvider, useRadioGroupItemContext] =\n createRadioGroupContext<RadioGroupItemContextValue>(RADIO_GROUP_NAME)\n\nconst RadioGroupItemFrame = styled(ThemeableStack, {\n name: RADIO_GROUP_ITEM_NAME,\n tag: 'button',\n\n variants: {\n unstyled: {\n false: {\n size: '$true',\n borderRadius: 1000,\n backgroundColor: '$background',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 1,\n borderColor: '$borderColor',\n padding: 0,\n\n hoverStyle: {\n borderColor: '$borderColorHover',\n background: '$backgroundHover',\n },\n\n focusStyle: {\n borderColor: '$borderColorHover',\n background: '$backgroundHover',\n },\n\n pressStyle: {\n borderColor: '$borderColorFocus',\n background: '$backgroundFocus',\n },\n },\n },\n\n size: {\n '...size': (value, { props }) => {\n const size = Math.floor(\n getVariableValue(getSize(value)) * (props['scaleSize'] ?? 0.5)\n )\n return {\n width: size,\n height: size,\n }\n },\n },\n } as const,\n\n defaultVariants: {\n unstyled: false,\n },\n})\n\ntype RadioGroupItemProps = GetProps<typeof RadioGroupItemFrame> & {\n value: string\n id?: string\n labelledBy?: string\n disabled?: boolean\n}\n\ntype RadioGroupItemElement = HTMLButtonElement\n\ntype ScopedRadioGroupItemProps<P> = P & {\n __scopeRadioGroupItem?: Scope\n}\n\nconst RadioGroupItem = RadioGroupItemFrame.extractable(\n React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(\n (props: ScopedProps<RadioGroupItemProps>, forwardedRef) => {\n const {\n __scopeRadioGroup,\n value,\n labelledBy: ariaLabelledby,\n disabled: itemDisabled,\n ...itemProps\n } = props\n const {\n value: groupValue,\n disabled,\n required,\n onChange,\n name,\n native,\n accentColor,\n } = useRadioGroupContext(RADIO_GROUP_ITEM_NAME, __scopeRadioGroup)\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null)\n const hasConsumerStoppedPropagationRef = React.useRef(false)\n const ref = React.useRef<HTMLButtonElement>(null)\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node), ref)\n const isArrowKeyPressedRef = React.useRef(false)\n\n const isFormControl = isWeb\n ? button\n ? Boolean(button.closest('form'))\n : true\n : false\n\n const checked = groupValue === value\n\n const labelId = useLabelContext(button)\n const labelledBy = ariaLabelledby || labelId\n\n React.useEffect(() => {\n if (isWeb) {\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\n if (process.env.TAMAGUI_TARGET === 'native') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!props.id) return\n return registerFocusable(props.id, {\n focusAndSelect: () => {\n onChange?.(value)\n },\n focus: () => {},\n })\n }, [props.id, value])\n }\n\n const isDisabled = disabled || itemDisabled\n\n return (\n <RadioGroupItemProvider checked={checked} scope={__scopeRadioGroup}>\n {isWeb && native ? (\n <BubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={isDisabled}\n id={props.id}\n accentColor={accentColor}\n />\n ) : (\n <>\n <RadioGroupItemFrame\n // theme={checked ? 'active' : undefined}\n data-state={getState(checked)}\n data-disabled={isDisabled ? '' : undefined}\n role=\"radio\"\n aria-labelledby={labelledBy}\n aria-checked={checked}\n aria-required={required}\n disabled={isDisabled}\n ref={composedRefs}\n {...(isWeb && {\n type: 'button',\n value: value,\n })}\n // allow them to override all but the handlers that already compose:\n {...itemProps}\n onPress={composeEventHandlers(props.onPress as any, (event) => {\n if (!checked) {\n onChange?.(value)\n }\n\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current =\n 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 {...(isWeb && {\n onKeyDown: composeEventHandlers(\n (props as React.HTMLProps<HTMLButtonElement>).onKeyDown,\n (event) => {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n if (event.key === 'Enter') event.preventDefault()\n }\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)\n (ref.current as HTMLButtonElement)?.click()\n }),\n })}\n />\n {isFormControl && (\n <BubbleInput\n isHidden\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={isDisabled}\n />\n )}\n </>\n )}\n </RadioGroupItemProvider>\n )\n }\n )\n)\n\n/* -------------------------------------------------------------------------\n * BubbleInput\n * ------------------------------------------------------------------------ */\n\ninterface BubbleInputProps extends Omit<React.HTMLProps<HTMLInputElement>, 'checked'> {\n checked: boolean\n control: HTMLElement | null\n bubbles: boolean\n isHidden?: boolean\n accentColor?: string\n}\n\nconst BubbleInput = (props: BubbleInputProps) => {\n const { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props\n const ref = React.useRef<HTMLInputElement>(null)\n const prevChecked = usePrevious(checked)\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(\n inputProto,\n 'checked'\n ) 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 defaultChecked={checked}\n {...inputProps}\n tabIndex={-1}\n ref={ref}\n aria-hidden={isHidden}\n style={{\n ...(isHidden\n ? {\n // ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }\n : {\n appearance: 'auto',\n accentColor,\n }),\n\n ...props.style,\n }}\n />\n )\n}\n\n/* -------------------------------------------------------------------------\n * RadioGroup\n * ----------------------------------------------------------------------- */\n\ntype ScopedProps<P> = P & { __scopeRadioGroup?: Scope }\n\ntype TamaguiElement = HTMLElement | View\n\ntype RadioGroupElement = TamaguiElement\n\nconst RadioGroupFrame = styled(ThemeableStack, {\n name: RADIO_GROUP_NAME,\n\n variants: {\n orientation: {\n horizontal: {\n flexDirection: 'row',\n spaceDirection: 'horizontal',\n },\n vertical: {\n flexDirection: 'column',\n spaceDirection: 'vertical',\n },\n },\n } as const,\n})\n\ntype RadioGroupProps = GetProps<typeof RadioGroupFrame> & {\n value?: string\n defaultValue?: string\n onValueChange?: (value: string) => void\n required?: boolean\n disabled?: boolean\n name?: string\n native?: boolean\n accentColor?: string\n}\n\nconst RadioGroup = withStaticProperties(\n RadioGroupFrame.extractable(\n React.forwardRef<RadioGroupElement, RadioGroupProps>(\n (props: ScopedProps<RadioGroupProps>, forwardedRef) => {\n const {\n __scopeRadioGroup,\n value: valueProp,\n defaultValue,\n onValueChange,\n disabled = false,\n required = false,\n name,\n orientation,\n native,\n accentColor,\n ...radioGroupProps\n } = props\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue!,\n onChange: onValueChange,\n })\n\n return (\n <RadioGroupProvider\n scope={__scopeRadioGroup}\n value={value}\n required={required}\n onChange={setValue}\n disabled={disabled}\n name={name}\n native={native}\n accentColor={accentColor}\n >\n <RadioGroupFrame\n aria-valuetext={value}\n role=\"radiogroup\"\n aria-orientation={orientation}\n ref={forwardedRef}\n orientation={orientation}\n data-disabled={disabled ? '' : undefined}\n {...radioGroupProps}\n />\n </RadioGroupProvider>\n )\n }\n )\n ),\n {\n Indicator: RadioIndicator,\n Item: RadioGroupItem,\n }\n)\n\nRadioGroup.displayName = RADIO_GROUP_NAME\n\nexport { createRadioGroupScope, RadioGroup }\nexport type { RadioGroupProps }\n"],
|
|
5
|
-
"mappings": "AA2FU,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AA2FU,OAkLE,YAAAA,GAlLF,O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ACZ,YAAAnB,CACF,EAEJ,GAAGtB,EAAM,KACX,EACF,CAEJ,EAYM+C,EAAkBpE,EAAOO,EAAgB,CAC7C,KAAMG,EAEN,SAAU,CACR,YAAa,CACX,WAAY,CACV,cAAe,MACf,eAAgB,YAClB,EACA,SAAU,CACR,cAAe,SACf,eAAgB,UAClB,CACF,CACF,CACF,CAAC,EAaK2D,EAAanE,EACjBkE,EAAgB,YACd3D,EAAM,WACJ,CAACY,EAAqCC,IAAiB,CACrD,KAAM,CACJ,kBAAAY,EACA,MAAOoC,EACP,aAAAC,EACA,cAAAC,EACA,SAAA/C,EAAW,GACX,SAAAc,EAAW,GACX,KAAAE,EACA,YAAAgC,EACA,OAAA/B,EACA,YAAAC,EACA,GAAG+B,CACL,EAAIrD,EACE,CAACU,EAAO4C,CAAQ,EAAInE,EAAqB,CAC7C,KAAM8D,EACN,YAAaC,EACb,SAAUC,CACZ,CAAC,EAED,OACE9E,EAACoB,GAAA,CACC,MAAOoB,EACP,MAAOH,EACP,SAAUQ,EACV,SAAUoC,EACV,SAAUlD,EACV,KAAMgB,EACN,OAAQC,EACR,YAAaC,EAEb,SAAAjD,EAAC0E,EAAA,CACC,iBAAgBrC,EAChB,KAAK,aACL,mBAAkB0C,EAClB,IAAKnD,EACL,YAAamD,EACb,gBAAehD,EAAW,GAAK,OAC9B,GAAGiD,EACN,EACF,CAEJ,CACF,CACF,EACA,CACE,UAAWtD,EACX,KAAMa,EACR,CACF,EAEAoC,EAAW,YAAc3D",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "usePrevious", "composeEventHandlers", "getVariableValue", "isWeb", "styled", "useComposedRefs", "withStaticProperties", "createContextScope", "registerFocusable", "getSize", "useLabelContext", "ThemeableStack", "useControllableState", "React", "RADIO_GROUP_NAME", "ARROW_KEYS", "createRadioGroupContext", "createRadioGroupScope", "RadioGroupProvider", "useRadioGroupContext", "getState", "checked", "RADIO_GROUP_INDICATOR_NAME", "RadioIndicatorFrame", "RadioIndicator", "props", "forwardedRef", "__scopeRadioGroupItem", "forceMount", "disabled", "indicatorProps", "useRadioGroupItemContext", "RADIO_GROUP_ITEM_NAME", "RadioGroupItemProvider", "RadioGroupItemFrame", "value", "size", "RadioGroupItem", "__scopeRadioGroup", "ariaLabelledby", "itemDisabled", "itemProps", "groupValue", "required", "onChange", "name", "native", "accentColor", "button", "setButton", "hasConsumerStoppedPropagationRef", "ref", "composedRefs", "node", "isArrowKeyPressedRef", "isFormControl", "labelId", "labelledBy", "handleKeyDown", "event", "handleKeyUp", "isDisabled", "BubbleInput", "_a", "bubbles", "control", "isHidden", "inputProps", "prevChecked", "input", "inputProto", "setChecked", "RadioGroupFrame", "RadioGroup", "valueProp", "defaultValue", "onValueChange", "orientation", "radioGroupProps", "setValue"]
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export*from"./RadioGroup";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export*from"./RadioGroup";
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|