@tamagui/checkbox 1.3.0 → 1.3.1
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/Checkbox.js +123 -120
- package/dist/cjs/Checkbox.js.map +2 -2
- package/dist/esm/Checkbox.js +124 -123
- package/dist/esm/Checkbox.js.map +2 -2
- package/dist/esm/Checkbox.mjs +124 -123
- package/dist/esm/Checkbox.mjs.map +2 -2
- package/dist/jsx/Checkbox.js +110 -109
- package/dist/jsx/Checkbox.js.map +2 -2
- package/dist/jsx/Checkbox.mjs +110 -109
- package/dist/jsx/Checkbox.mjs.map +2 -2
- package/package.json +11 -11
- package/src/Checkbox.tsx +139 -137
- package/types/Checkbox.d.ts +8 -3
- package/types/Checkbox.d.ts.map +1 -1
package/dist/esm/Checkbox.js
CHANGED
|
@@ -2,10 +2,8 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { usePrevious } from "@radix-ui/react-use-previous";
|
|
3
3
|
import {
|
|
4
4
|
composeEventHandlers,
|
|
5
|
-
getConfig,
|
|
6
5
|
getVariableValue,
|
|
7
6
|
isWeb,
|
|
8
|
-
mergeProps,
|
|
9
7
|
styled,
|
|
10
8
|
useComposedRefs,
|
|
11
9
|
useMediaPropsActive,
|
|
@@ -18,7 +16,7 @@ import { getFontSize } from "@tamagui/font-size";
|
|
|
18
16
|
import { getSize, stepTokenUpOrDown } from "@tamagui/get-size";
|
|
19
17
|
import { useGetThemedIcon } from "@tamagui/helpers-tamagui";
|
|
20
18
|
import { useLabelContext } from "@tamagui/label";
|
|
21
|
-
import { ThemeableStack
|
|
19
|
+
import { ThemeableStack } from "@tamagui/stacks";
|
|
22
20
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
23
21
|
import * as React from "react";
|
|
24
22
|
function isIndeterminate(checked) {
|
|
@@ -75,58 +73,64 @@ const INDICATOR_NAME = "CheckboxIndicator";
|
|
|
75
73
|
const CheckboxIndicatorFrame = styled(ThemeableStack, {
|
|
76
74
|
name: INDICATOR_NAME
|
|
77
75
|
});
|
|
78
|
-
const CheckboxIndicator =
|
|
79
|
-
(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return getThemedIcon(child);
|
|
97
|
-
});
|
|
98
|
-
if (forceMount || isIndeterminate(context.state) || context.state === true)
|
|
99
|
-
return /* @__PURE__ */ jsx(
|
|
100
|
-
CheckboxIndicatorFrame,
|
|
101
|
-
{
|
|
102
|
-
theme: "active",
|
|
103
|
-
"data-state": getState(context.state),
|
|
104
|
-
"data-disabled": context.disabled ? "" : void 0,
|
|
105
|
-
pointerEvents: "none",
|
|
106
|
-
...indicatorProps,
|
|
107
|
-
ref: forwardedRef,
|
|
108
|
-
children
|
|
76
|
+
const CheckboxIndicator = CheckboxIndicatorFrame.extractable(
|
|
77
|
+
React.forwardRef(
|
|
78
|
+
(props, forwardedRef) => {
|
|
79
|
+
const {
|
|
80
|
+
__scopeCheckbox,
|
|
81
|
+
children: childrenProp,
|
|
82
|
+
forceMount,
|
|
83
|
+
disablePassStyles,
|
|
84
|
+
...indicatorProps
|
|
85
|
+
} = props;
|
|
86
|
+
const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
|
|
87
|
+
const iconSize = (typeof context.size === "number" ? context.size * 0.65 : getFontSize(context.size)) * context.scaleIcon;
|
|
88
|
+
const theme = useTheme();
|
|
89
|
+
const getThemedIcon = useGetThemedIcon({ size: iconSize, color: theme.color });
|
|
90
|
+
const childrens = React.Children.toArray(childrenProp);
|
|
91
|
+
const children = childrens.map((child) => {
|
|
92
|
+
if (disablePassStyles || !React.isValidElement(child)) {
|
|
93
|
+
return child;
|
|
109
94
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
95
|
+
return getThemedIcon(child);
|
|
96
|
+
});
|
|
97
|
+
if (forceMount || isIndeterminate(context.state) || context.state === true)
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
CheckboxIndicatorFrame,
|
|
100
|
+
{
|
|
101
|
+
theme: "active",
|
|
102
|
+
"data-state": getState(context.state),
|
|
103
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
104
|
+
pointerEvents: "none",
|
|
105
|
+
...indicatorProps,
|
|
106
|
+
ref: forwardedRef,
|
|
107
|
+
children
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
113
|
);
|
|
114
114
|
CheckboxIndicator.displayName = INDICATOR_NAME;
|
|
115
115
|
const CHECKBOX_NAME = "Checkbox";
|
|
116
116
|
const CheckboxFrame = styled(ThemeableStack, {
|
|
117
117
|
name: CHECKBOX_NAME,
|
|
118
118
|
tag: "button",
|
|
119
|
-
backgroundColor: "$background",
|
|
120
|
-
alignItems: "center",
|
|
121
|
-
justifyContent: "center",
|
|
122
|
-
pressTheme: true,
|
|
123
|
-
focusable: true,
|
|
124
|
-
borderWidth: 2,
|
|
125
|
-
borderColor: "transparent",
|
|
126
|
-
focusStyle: {
|
|
127
|
-
borderColor: "$borderColorFocus"
|
|
128
|
-
},
|
|
129
119
|
variants: {
|
|
120
|
+
unstyled: {
|
|
121
|
+
false: {
|
|
122
|
+
backgroundColor: "$background",
|
|
123
|
+
alignItems: "center",
|
|
124
|
+
justifyContent: "center",
|
|
125
|
+
pressTheme: true,
|
|
126
|
+
focusable: true,
|
|
127
|
+
borderWidth: 2,
|
|
128
|
+
borderColor: "transparent",
|
|
129
|
+
focusStyle: {
|
|
130
|
+
borderColor: "$borderColorFocus"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
130
134
|
size: {
|
|
131
135
|
"...size": (val, { tokens }) => {
|
|
132
136
|
const radiusToken = getVariableValue(getSize(val)) / 8;
|
|
@@ -137,7 +141,8 @@ const CheckboxFrame = styled(ThemeableStack, {
|
|
|
137
141
|
}
|
|
138
142
|
},
|
|
139
143
|
defaultVariants: {
|
|
140
|
-
size: "$true"
|
|
144
|
+
size: "$true",
|
|
145
|
+
unstyled: false
|
|
141
146
|
}
|
|
142
147
|
});
|
|
143
148
|
const [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
|
|
@@ -154,6 +159,7 @@ const Checkbox = withStaticProperties(
|
|
|
154
159
|
defaultChecked,
|
|
155
160
|
required,
|
|
156
161
|
scaleIcon = 1,
|
|
162
|
+
scaleSize = 0.45,
|
|
157
163
|
sizeAdjust = 0,
|
|
158
164
|
disabled,
|
|
159
165
|
value = "on",
|
|
@@ -171,8 +177,10 @@ const Checkbox = withStaticProperties(
|
|
|
171
177
|
defaultProp: defaultChecked,
|
|
172
178
|
onChange: onCheckedChange
|
|
173
179
|
});
|
|
174
|
-
const
|
|
175
|
-
|
|
180
|
+
const adjustedSize = getVariableValue(
|
|
181
|
+
stepTokenUpOrDown("size", propsActive.size, sizeAdjust)
|
|
182
|
+
);
|
|
183
|
+
const size = scaleSize ? Math.round(adjustedSize * scaleSize) : adjustedSize;
|
|
176
184
|
const labelId = useLabelContext(button);
|
|
177
185
|
const labelledBy = ariaLabelledby || labelId;
|
|
178
186
|
if (!isWeb) {
|
|
@@ -188,84 +196,81 @@ const Checkbox = withStaticProperties(
|
|
|
188
196
|
});
|
|
189
197
|
}, [props.id, setChecked]);
|
|
190
198
|
}
|
|
191
|
-
return (
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
return /* @__PURE__ */ jsx(
|
|
200
|
+
CheckboxProvider,
|
|
201
|
+
{
|
|
202
|
+
scope: __scopeCheckbox,
|
|
203
|
+
state: checked,
|
|
204
|
+
disabled,
|
|
205
|
+
size,
|
|
206
|
+
scaleIcon,
|
|
207
|
+
children: isWeb && native ? /* @__PURE__ */ jsx(
|
|
208
|
+
BubbleInput,
|
|
209
|
+
{
|
|
210
|
+
control: button,
|
|
211
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
212
|
+
name,
|
|
213
|
+
value,
|
|
214
|
+
checked,
|
|
215
|
+
required,
|
|
216
|
+
disabled,
|
|
217
|
+
id: props.id
|
|
218
|
+
}
|
|
219
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
CheckboxFrame,
|
|
222
|
+
{
|
|
223
|
+
width: size,
|
|
224
|
+
height: size,
|
|
225
|
+
theme: checked ? "active" : null,
|
|
226
|
+
tag: "button",
|
|
227
|
+
role: "checkbox",
|
|
228
|
+
"aria-labelledby": labelledBy,
|
|
229
|
+
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
230
|
+
"aria-required": required,
|
|
231
|
+
"data-state": getState(checked),
|
|
232
|
+
"data-disabled": disabled ? "" : void 0,
|
|
233
|
+
disabled,
|
|
234
|
+
...checkboxProps,
|
|
235
|
+
ref: composedRefs,
|
|
236
|
+
...isWeb && {
|
|
237
|
+
type: "button",
|
|
238
|
+
value,
|
|
239
|
+
onKeyDown: composeEventHandlers(
|
|
240
|
+
props.onKeyDown,
|
|
241
|
+
(event) => {
|
|
242
|
+
if (event.key === "Enter")
|
|
243
|
+
event.preventDefault();
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
},
|
|
247
|
+
onPress: composeEventHandlers(props.onPress, (event) => {
|
|
248
|
+
setChecked(
|
|
249
|
+
(prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked
|
|
250
|
+
);
|
|
251
|
+
if (isFormControl) {
|
|
252
|
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
253
|
+
if (!hasConsumerStoppedPropagationRef.current)
|
|
254
|
+
event.stopPropagation();
|
|
255
|
+
}
|
|
256
|
+
})
|
|
257
|
+
}
|
|
258
|
+
),
|
|
259
|
+
isWeb && isFormControl ? /* @__PURE__ */ jsx(
|
|
202
260
|
BubbleInput,
|
|
203
261
|
{
|
|
262
|
+
isHidden: true,
|
|
204
263
|
control: button,
|
|
205
264
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
206
265
|
name,
|
|
207
266
|
value,
|
|
208
267
|
checked,
|
|
209
268
|
required,
|
|
210
|
-
disabled
|
|
211
|
-
id: props.id
|
|
269
|
+
disabled
|
|
212
270
|
}
|
|
213
|
-
) :
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
width: size,
|
|
218
|
-
height: size,
|
|
219
|
-
theme: checked ? "active" : null,
|
|
220
|
-
tag: "button",
|
|
221
|
-
role: "checkbox",
|
|
222
|
-
"aria-labelledby": labelledBy,
|
|
223
|
-
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
224
|
-
"aria-required": required,
|
|
225
|
-
"data-state": getState(checked),
|
|
226
|
-
"data-disabled": disabled ? "" : void 0,
|
|
227
|
-
disabled,
|
|
228
|
-
...checkboxProps,
|
|
229
|
-
ref: composedRefs,
|
|
230
|
-
...isWeb && {
|
|
231
|
-
type: "button",
|
|
232
|
-
value,
|
|
233
|
-
onKeyDown: composeEventHandlers(
|
|
234
|
-
props.onKeyDown,
|
|
235
|
-
(event) => {
|
|
236
|
-
if (event.key === "Enter")
|
|
237
|
-
event.preventDefault();
|
|
238
|
-
}
|
|
239
|
-
)
|
|
240
|
-
},
|
|
241
|
-
onPress: composeEventHandlers(props.onPress, (event) => {
|
|
242
|
-
setChecked(
|
|
243
|
-
(prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked
|
|
244
|
-
);
|
|
245
|
-
if (isFormControl) {
|
|
246
|
-
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
247
|
-
if (!hasConsumerStoppedPropagationRef.current)
|
|
248
|
-
event.stopPropagation();
|
|
249
|
-
}
|
|
250
|
-
})
|
|
251
|
-
}
|
|
252
|
-
),
|
|
253
|
-
isWeb && isFormControl ? /* @__PURE__ */ jsx(
|
|
254
|
-
BubbleInput,
|
|
255
|
-
{
|
|
256
|
-
isHidden: true,
|
|
257
|
-
control: button,
|
|
258
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
259
|
-
name,
|
|
260
|
-
value,
|
|
261
|
-
checked,
|
|
262
|
-
required,
|
|
263
|
-
disabled
|
|
264
|
-
}
|
|
265
|
-
) : null
|
|
266
|
-
] })
|
|
267
|
-
}
|
|
268
|
-
) })
|
|
271
|
+
) : null
|
|
272
|
+
] })
|
|
273
|
+
}
|
|
269
274
|
);
|
|
270
275
|
}
|
|
271
276
|
)
|
|
@@ -275,10 +280,6 @@ const Checkbox = withStaticProperties(
|
|
|
275
280
|
}
|
|
276
281
|
);
|
|
277
282
|
Checkbox.displayName = CHECKBOX_NAME;
|
|
278
|
-
const cloneElementWithPropOrder = (child, props) => {
|
|
279
|
-
const next = mergeProps(child.props, props, false, getConfig().shorthands)[0];
|
|
280
|
-
return React.cloneElement({ ...child, props: null }, next);
|
|
281
|
-
};
|
|
282
283
|
export {
|
|
283
284
|
BubbleInput,
|
|
284
285
|
Checkbox,
|
package/dist/esm/Checkbox.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Checkbox.tsx"],
|
|
4
|
-
"sourcesContent": ["// fork of radix\n// https://github.com/radix-ui/primitives/tree/main/packages/react/checkbox/src/Checkbox.tsx\n\nimport { usePrevious } from '@radix-ui/react-use-previous'\nimport {\n GetProps,\n SizeTokens,\n TamaguiElement,\n composeEventHandlers,\n getConfig,\n getVariableValue,\n isWeb,\n mergeProps,\n styled,\n useComposedRefs,\n useMediaPropsActive,\n useTheme,\n withStaticProperties,\n} from '@tamagui/core'\nimport type { Scope } from '@tamagui/create-context'\nimport { createContextScope } from '@tamagui/create-context'\nimport { registerFocusable } from '@tamagui/focusable'\nimport { getFontSize } from '@tamagui/font-size'\nimport { getSize, stepTokenUpOrDown } from '@tamagui/get-size'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { useLabelContext } from '@tamagui/label'\nimport { ThemeableStack, YStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\n\nexport type CheckedState = boolean | 'indeterminate'\n\nexport function isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate'\n}\n\nexport function getState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked'\n}\n\ntype InputProps = any //Radix.ComponentPropsWithoutRef<'input'>\ninterface BubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: CheckedState\n control: HTMLElement | null\n bubbles: boolean\n\n isHidden?: boolean\n}\n\nexport const BubbleInput = (props: BubbleInputProps) => {\n const { checked, bubbles = true, control, isHidden, ...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(\n inputProto,\n 'checked'\n ) as PropertyDescriptor\n const setChecked = descriptor.set\n\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles })\n input.indeterminate = isIndeterminate(checked)\n setChecked.call(input, isIndeterminate(checked) ? false : checked)\n input.dispatchEvent(event)\n }\n }, [prevChecked, checked, bubbles])\n\n return (\n <input\n type=\"checkbox\"\n defaultChecked={isIndeterminate(checked) ? false : 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: 'var(--color6)',\n }),\n\n ...props.style,\n }}\n />\n )\n}\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxIndicator'\n\nconst CheckboxIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n})\n\ntype CheckboxIndicatorFrameProps = GetProps<typeof CheckboxIndicatorFrame>\n\nexport type CheckboxIndicatorProps = CheckboxIndicatorFrameProps & {\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 * Used to disable passing styles down to children.\n */\n disablePassStyles?: boolean\n}\n\nconst CheckboxIndicator = React.forwardRef<TamaguiElement, CheckboxIndicatorProps>(\n (props: ScopedProps<CheckboxIndicatorProps>, forwardedRef) => {\n const {\n __scopeCheckbox,\n children: childrenProp,\n forceMount,\n disablePassStyles,\n ...indicatorProps\n } = props\n const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox)\n const iconSize =\n (typeof context.size === 'number'\n ? context.size * 0.65\n : getFontSize(context.size)) * context.scaleIcon\n const theme = useTheme()\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color: theme.color })\n\n const childrens = React.Children.toArray(childrenProp)\n const children = childrens.map((child) => {\n if (disablePassStyles || !React.isValidElement(child)) {\n return child\n }\n return getThemedIcon(child)\n })\n\n if (forceMount || isIndeterminate(context.state) || context.state === true)\n return (\n <CheckboxIndicatorFrame\n theme=\"active\"\n data-state={getState(context.state)}\n data-disabled={context.disabled ? '' : undefined}\n pointerEvents=\"none\"\n {...indicatorProps}\n ref={forwardedRef}\n >\n {children}\n </CheckboxIndicatorFrame>\n )\n\n return null\n }\n)\n\nCheckboxIndicator.displayName = INDICATOR_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * Checkbox\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_NAME = 'Checkbox'\n\nexport const CheckboxFrame = styled(ThemeableStack, {\n name: CHECKBOX_NAME,\n tag: 'button',\n backgroundColor: '$background',\n alignItems: 'center',\n justifyContent: 'center',\n pressTheme: true,\n focusable: true,\n borderWidth: 2,\n borderColor: 'transparent',\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n\n variants: {\n size: {\n '...size': (val, { tokens }) => {\n const radiusToken = getVariableValue(getSize(val)) / 8\n return {\n borderRadius: radiusToken,\n }\n },\n },\n } as const,\n\n defaultVariants: {\n size: '$true',\n },\n})\n\ntype ScopedProps<P> = P & { __scopeCheckbox?: Scope }\nconst [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME)\n\ntype CheckboxContextValue = {\n state: CheckedState\n disabled?: boolean\n size: SizeTokens\n scaleIcon: number\n}\n\nconst [CheckboxProvider, useCheckboxContext] =\n createCheckboxContext<CheckboxContextValue>(CHECKBOX_NAME)\n\ntype CheckboxFrameProps = GetProps<typeof CheckboxFrame>\nexport interface CheckboxProps\n extends Omit<CheckboxFrameProps, 'checked' | 'defaultChecked'> {\n checked?: CheckedState\n defaultChecked?: CheckedState\n required?: boolean\n onCheckedChange?(checked: CheckedState): void\n labelledBy?: string\n name?: string\n value?: string\n native?: boolean\n scaleIcon?: number\n sizeAdjust?: number\n}\n\nexport const Checkbox = withStaticProperties(\n CheckboxFrame.extractable(\n React.forwardRef<HTMLButtonElement, CheckboxProps>(\n (props: ScopedProps<CheckboxProps>, forwardedRef) => {\n const {\n __scopeCheckbox,\n labelledBy: ariaLabelledby,\n name,\n checked: checkedProp,\n defaultChecked,\n required,\n scaleIcon = 1,\n sizeAdjust = 0,\n disabled,\n value = 'on',\n onCheckedChange,\n native,\n ...checkboxProps\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 const propsActive = useMediaPropsActive(props)\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = isWeb\n ? button\n ? Boolean(button.closest('form'))\n : true\n : false\n const [checked = false, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked!,\n onChange: onCheckedChange,\n })\n\n const adjustedSizeToken = stepTokenUpOrDown('size', propsActive.size, sizeAdjust)\n const size = Math.floor(getVariableValue(adjustedSizeToken) * 0.5)\n\n const labelId = useLabelContext(button)\n const labelledBy = ariaLabelledby || labelId\n\n if (!isWeb) {\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 setChecked((x) => !x)\n },\n focus: () => {},\n })\n }, [props.id, setChecked])\n }\n\n return (\n // YStack is here to provide theme for native input\n <YStack asChild theme={checkboxProps.theme}>\n <CheckboxProvider\n scope={__scopeCheckbox}\n state={checked}\n disabled={disabled}\n size={size}\n scaleIcon={scaleIcon}\n >\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={disabled}\n id={props.id}\n />\n ) : (\n <>\n <CheckboxFrame\n width={size}\n height={size}\n theme={checked ? 'active' : null}\n tag=\"button\"\n role=\"checkbox\"\n aria-labelledby={labelledBy}\n aria-checked={isIndeterminate(checked) ? 'mixed' : checked}\n aria-required={required}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n {...checkboxProps}\n ref={composedRefs}\n {...(isWeb && {\n type: 'button',\n value: value,\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 })}\n onPress={composeEventHandlers(props.onPress as any, (event) => {\n setChecked((prevChecked) =>\n isIndeterminate(prevChecked) ? true : !prevChecked\n )\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current =\n event.isPropagationStopped()\n // if checkbox 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 checkbox updates.\n if (!hasConsumerStoppedPropagationRef.current)\n event.stopPropagation()\n }\n })}\n />\n\n {isWeb && 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={disabled}\n />\n ) : null}\n </>\n )}\n </CheckboxProvider>\n </YStack>\n )\n }\n )\n ),\n {\n Indicator: CheckboxIndicator,\n }\n)\n\nCheckbox.displayName = CHECKBOX_NAME\n\nexport { createCheckboxScope }\n\nconst cloneElementWithPropOrder = (child: any, props: Object) => {\n const next = mergeProps(child.props, props, false, getConfig().shorthands)[0]\n return React.cloneElement({ ...child, props: null }, next)\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// fork of radix\n// https://github.com/radix-ui/primitives/tree/main/packages/react/checkbox/src/Checkbox.tsx\n\nimport { usePrevious } from '@radix-ui/react-use-previous'\nimport {\n GetProps,\n SizeTokens,\n TamaguiElement,\n composeEventHandlers,\n getVariableValue,\n isWeb,\n styled,\n useComposedRefs,\n useMediaPropsActive,\n useTheme,\n withStaticProperties,\n} from '@tamagui/core'\nimport type { Scope } from '@tamagui/create-context'\nimport { createContextScope } from '@tamagui/create-context'\nimport { registerFocusable } from '@tamagui/focusable'\nimport { getFontSize } from '@tamagui/font-size'\nimport { getSize, stepTokenUpOrDown } from '@tamagui/get-size'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { useLabelContext } from '@tamagui/label'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\n\nexport type CheckedState = boolean | 'indeterminate'\n\nexport function isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate'\n}\n\nexport function getState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked'\n}\n\ntype InputProps = any //Radix.ComponentPropsWithoutRef<'input'>\ninterface BubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: CheckedState\n control: HTMLElement | null\n bubbles: boolean\n\n isHidden?: boolean\n}\n\nexport const BubbleInput = (props: BubbleInputProps) => {\n const { checked, bubbles = true, control, isHidden, ...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(\n inputProto,\n 'checked'\n ) as PropertyDescriptor\n const setChecked = descriptor.set\n\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles })\n input.indeterminate = isIndeterminate(checked)\n setChecked.call(input, isIndeterminate(checked) ? false : checked)\n input.dispatchEvent(event)\n }\n }, [prevChecked, checked, bubbles])\n\n return (\n <input\n type=\"checkbox\"\n defaultChecked={isIndeterminate(checked) ? false : 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: 'var(--color6)',\n }),\n\n ...props.style,\n }}\n />\n )\n}\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxIndicator'\n\nconst CheckboxIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n})\n\ntype CheckboxIndicatorFrameProps = GetProps<typeof CheckboxIndicatorFrame>\n\nexport type CheckboxIndicatorProps = CheckboxIndicatorFrameProps & {\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 * Used to disable passing styles down to children.\n */\n disablePassStyles?: boolean\n}\n\nconst CheckboxIndicator = CheckboxIndicatorFrame.extractable(\n React.forwardRef<TamaguiElement, CheckboxIndicatorProps>(\n (props: ScopedProps<CheckboxIndicatorProps>, forwardedRef) => {\n const {\n __scopeCheckbox,\n children: childrenProp,\n forceMount,\n disablePassStyles,\n ...indicatorProps\n } = props\n const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox)\n const iconSize =\n (typeof context.size === 'number'\n ? context.size * 0.65\n : getFontSize(context.size)) * context.scaleIcon\n const theme = useTheme()\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color: theme.color })\n\n const childrens = React.Children.toArray(childrenProp)\n const children = childrens.map((child) => {\n if (disablePassStyles || !React.isValidElement(child)) {\n return child\n }\n return getThemedIcon(child)\n })\n\n if (forceMount || isIndeterminate(context.state) || context.state === true)\n return (\n <CheckboxIndicatorFrame\n theme=\"active\"\n data-state={getState(context.state)}\n data-disabled={context.disabled ? '' : undefined}\n pointerEvents=\"none\"\n {...indicatorProps}\n ref={forwardedRef}\n >\n {children}\n </CheckboxIndicatorFrame>\n )\n\n return null\n }\n )\n)\n\nCheckboxIndicator.displayName = INDICATOR_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * Checkbox\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_NAME = 'Checkbox'\n\nexport const CheckboxFrame = styled(ThemeableStack, {\n name: CHECKBOX_NAME,\n tag: 'button',\n\n variants: {\n unstyled: {\n false: {\n backgroundColor: '$background',\n alignItems: 'center',\n justifyContent: 'center',\n pressTheme: true,\n focusable: true,\n borderWidth: 2,\n borderColor: 'transparent',\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n },\n },\n\n size: {\n '...size': (val, { tokens }) => {\n const radiusToken = getVariableValue(getSize(val)) / 8\n return {\n borderRadius: radiusToken,\n }\n },\n },\n } as const,\n\n defaultVariants: {\n size: '$true',\n unstyled: false,\n },\n})\n\ntype ScopedProps<P> = P & { __scopeCheckbox?: Scope }\nconst [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME)\n\ntype CheckboxContextValue = {\n state: CheckedState\n disabled?: boolean\n size: SizeTokens\n scaleIcon: number\n}\n\nconst [CheckboxProvider, useCheckboxContext] =\n createCheckboxContext<CheckboxContextValue>(CHECKBOX_NAME)\n\ntype CheckboxFrameProps = GetProps<typeof CheckboxFrame>\nexport interface CheckboxProps\n extends Omit<CheckboxFrameProps, 'checked' | 'defaultChecked'> {\n checked?: CheckedState\n defaultChecked?: CheckedState\n required?: boolean\n onCheckedChange?(checked: CheckedState): void\n labelledBy?: string\n name?: string\n value?: string\n native?: boolean\n scaleIcon?: number\n scaleSize?: number\n sizeAdjust?: number\n}\n\nexport const Checkbox = withStaticProperties(\n CheckboxFrame.extractable(\n React.forwardRef<HTMLButtonElement, CheckboxProps>(\n (props: ScopedProps<CheckboxProps>, forwardedRef) => {\n const {\n __scopeCheckbox,\n labelledBy: ariaLabelledby,\n name,\n checked: checkedProp,\n defaultChecked,\n required,\n scaleIcon = 1,\n scaleSize = 0.45,\n sizeAdjust = 0,\n disabled,\n value = 'on',\n onCheckedChange,\n native,\n ...checkboxProps\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 const propsActive = useMediaPropsActive(props)\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = isWeb\n ? button\n ? Boolean(button.closest('form'))\n : true\n : false\n const [checked = false, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked!,\n onChange: onCheckedChange,\n })\n\n const adjustedSize = getVariableValue(\n stepTokenUpOrDown('size', propsActive.size, sizeAdjust)\n )\n const size = scaleSize ? Math.round(adjustedSize * scaleSize) : adjustedSize\n\n const labelId = useLabelContext(button)\n const labelledBy = ariaLabelledby || labelId\n\n if (!isWeb) {\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 setChecked((x) => !x)\n },\n focus: () => {},\n })\n }, [props.id, setChecked])\n }\n\n return (\n <CheckboxProvider\n scope={__scopeCheckbox}\n state={checked}\n disabled={disabled}\n size={size}\n scaleIcon={scaleIcon}\n >\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={disabled}\n id={props.id}\n />\n ) : (\n <>\n <CheckboxFrame\n width={size}\n height={size}\n theme={checked ? 'active' : null}\n tag=\"button\"\n role=\"checkbox\"\n aria-labelledby={labelledBy}\n aria-checked={isIndeterminate(checked) ? 'mixed' : checked}\n aria-required={required}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n {...checkboxProps}\n ref={composedRefs}\n {...(isWeb && {\n type: 'button',\n value,\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 })}\n onPress={composeEventHandlers(props.onPress as any, (event) => {\n setChecked((prevChecked) =>\n isIndeterminate(prevChecked) ? true : !prevChecked\n )\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current =\n event.isPropagationStopped()\n // if checkbox 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 checkbox updates.\n if (!hasConsumerStoppedPropagationRef.current)\n event.stopPropagation()\n }\n })}\n />\n\n {isWeb && 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={disabled}\n />\n ) : null}\n </>\n )}\n </CheckboxProvider>\n )\n }\n )\n ),\n {\n Indicator: CheckboxIndicator,\n }\n)\n\nCheckbox.displayName = CH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