@tamagui/checkbox 2.7.7 → 3.0.0-beta.637.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.cjs +105 -101
- package/dist/cjs/Checkbox.native.cjs +137 -0
- package/dist/cjs/Checkbox.native.js +120 -100
- package/dist/cjs/Checkbox.native.js.map +1 -1
- package/dist/cjs/CheckboxStyledContext.cjs +18 -23
- package/dist/cjs/CheckboxStyledContext.native.cjs +32 -0
- package/dist/cjs/CheckboxStyledContext.native.js +18 -22
- package/dist/cjs/CheckboxStyledContext.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -26
- package/dist/cjs/index.native.cjs +22 -0
- package/dist/cjs/index.native.js +10 -26
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Checkbox.mjs +83 -87
- package/dist/esm/Checkbox.mjs.map +1 -1
- package/dist/esm/Checkbox.native.js +99 -87
- package/dist/esm/Checkbox.native.js.map +1 -1
- package/dist/esm/CheckboxStyledContext.mjs +5 -5
- package/dist/esm/CheckboxStyledContext.mjs.map +1 -1
- package/dist/esm/CheckboxStyledContext.native.js +5 -5
- package/dist/esm/CheckboxStyledContext.native.js.map +1 -1
- package/dist/esm/index.js +3 -11
- package/dist/esm/index.mjs +3 -11
- package/dist/esm/index.native.js +3 -11
- package/dist/jsx/Checkbox.mjs +83 -87
- package/dist/jsx/Checkbox.mjs.map +1 -1
- package/dist/jsx/Checkbox.native.cjs +137 -0
- package/dist/jsx/Checkbox.native.js +120 -100
- package/dist/jsx/Checkbox.native.js.map +1 -1
- package/dist/jsx/CheckboxStyledContext.mjs +5 -5
- package/dist/jsx/CheckboxStyledContext.mjs.map +1 -1
- package/dist/jsx/CheckboxStyledContext.native.cjs +32 -0
- package/dist/jsx/CheckboxStyledContext.native.js +18 -22
- package/dist/jsx/CheckboxStyledContext.native.js.map +1 -1
- package/dist/jsx/index.js +3 -11
- package/dist/jsx/index.mjs +3 -11
- package/dist/jsx/index.native.cjs +22 -0
- package/dist/jsx/index.native.js +10 -26
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +6 -16
- package/src/Checkbox.tsx +189 -81
- package/src/CheckboxStyledContext.tsx +2 -6
- package/src/index.ts +0 -9
- package/types/Checkbox.d.ts +446 -24
- package/types/Checkbox.d.ts.map +1 -1
- package/types/CheckboxStyledContext.d.ts +2 -4
- package/types/CheckboxStyledContext.d.ts.map +1 -1
- package/types/index.d.ts +0 -320
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/createCheckbox.cjs +0 -194
- package/dist/cjs/createCheckbox.native.js +0 -213
- package/dist/cjs/createCheckbox.native.js.map +0 -1
- package/dist/esm/createCheckbox.mjs +0 -150
- package/dist/esm/createCheckbox.mjs.map +0 -1
- package/dist/esm/createCheckbox.native.js +0 -167
- package/dist/esm/createCheckbox.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/createCheckbox.mjs +0 -150
- package/dist/jsx/createCheckbox.mjs.map +0 -1
- package/dist/jsx/createCheckbox.native.js +0 -213
- package/dist/jsx/createCheckbox.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/src/createCheckbox.tsx +0 -280
- package/types/createCheckbox.d.ts +0 -196
- package/types/createCheckbox.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["jsx/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Checkbox\"), module.exports);\n__reExport(index_exports, require(\"./CheckboxStyledContext\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,sBAAY,GAAG,OAAO,OAAO;AAC/D,WAAW,eAAe,QAAQ,mCAAyB,GAAG,OAAO,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/checkbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.637.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -35,23 +35,13 @@
|
|
|
35
35
|
"clean:build": "tamagui-build clean:build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tamagui/checkbox-headless": "
|
|
39
|
-
"@tamagui/
|
|
40
|
-
"@tamagui/
|
|
41
|
-
"@tamagui/
|
|
42
|
-
"@tamagui/create-context": "2.7.7",
|
|
43
|
-
"@tamagui/focusable": "2.7.7",
|
|
44
|
-
"@tamagui/get-token": "2.7.7",
|
|
45
|
-
"@tamagui/helpers": "2.7.7",
|
|
46
|
-
"@tamagui/helpers-tamagui": "2.7.7",
|
|
47
|
-
"@tamagui/label": "2.7.7",
|
|
48
|
-
"@tamagui/stacks": "2.7.7",
|
|
49
|
-
"@tamagui/use-controllable-state": "2.7.7",
|
|
50
|
-
"@tamagui/font-size": "2.7.7",
|
|
51
|
-
"@tamagui/use-previous": "2.7.7"
|
|
38
|
+
"@tamagui/checkbox-headless": "3.0.0-beta.637.1",
|
|
39
|
+
"@tamagui/core": "3.0.0-beta.637.1",
|
|
40
|
+
"@tamagui/focusable": "3.0.0-beta.637.1",
|
|
41
|
+
"@tamagui/use-controllable-state": "3.0.0-beta.637.1"
|
|
52
42
|
},
|
|
53
43
|
"devDependencies": {
|
|
54
|
-
"@tamagui/build": "
|
|
44
|
+
"@tamagui/build": "3.0.0-beta.637.1",
|
|
55
45
|
"react": ">=19"
|
|
56
46
|
},
|
|
57
47
|
"peerDependencies": {
|
package/src/Checkbox.tsx
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
// fork of radix
|
|
2
2
|
// https://github.com/radix-ui/primitives/tree/main/packages/react/checkbox/src/Checkbox.tsx
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import type {
|
|
5
|
+
CheckedState,
|
|
6
|
+
CheckboxExtraProps as HeadlessCheckboxExtraProps,
|
|
7
|
+
} from '@tamagui/checkbox-headless'
|
|
8
|
+
import { isIndeterminate, useCheckbox } from '@tamagui/checkbox-headless'
|
|
9
|
+
import type { GetProps, NativeValue, SizeTokens } from '@tamagui/core'
|
|
10
|
+
import {
|
|
11
|
+
createStyledHOC,
|
|
12
|
+
isWeb,
|
|
13
|
+
shouldRenderNativePlatform,
|
|
14
|
+
styled,
|
|
15
|
+
useProps,
|
|
16
|
+
View,
|
|
17
|
+
withStaticProperties,
|
|
18
|
+
} from '@tamagui/core'
|
|
19
|
+
import { registerFocusable } from '@tamagui/focusable'
|
|
20
|
+
import { useControllableState } from '@tamagui/use-controllable-state'
|
|
21
|
+
import React, { useMemo } from 'react'
|
|
7
22
|
|
|
8
23
|
import { CheckboxStyledContext } from './CheckboxStyledContext'
|
|
9
24
|
|
|
10
|
-
/* -------------------------------------------------------------------------------------------------
|
|
11
|
-
* CheckboxIndicator
|
|
12
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
13
25
|
const INDICATOR_NAME = 'CheckboxIndicator'
|
|
14
26
|
|
|
15
27
|
export const CheckboxIndicatorFrame = styled(
|
|
16
|
-
|
|
28
|
+
View,
|
|
17
29
|
{
|
|
18
30
|
// use Checkbox for easier themes
|
|
19
|
-
|
|
31
|
+
displayName: INDICATOR_NAME,
|
|
20
32
|
context: CheckboxStyledContext,
|
|
21
|
-
variants: {
|
|
22
|
-
unstyled: {
|
|
23
|
-
false: {},
|
|
24
|
-
},
|
|
25
|
-
} as const,
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
unstyled: process.env.TAMAGUI_HEADLESS === '1',
|
|
28
|
-
},
|
|
29
33
|
},
|
|
30
34
|
{
|
|
31
35
|
accept: {
|
|
@@ -34,85 +38,25 @@ export const CheckboxIndicatorFrame = styled(
|
|
|
34
38
|
}
|
|
35
39
|
)
|
|
36
40
|
|
|
37
|
-
/* -------------------------------------------------------------------------------------------------
|
|
38
|
-
* Checkbox
|
|
39
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
40
|
-
|
|
41
41
|
const CHECKBOX_NAME = 'Checkbox'
|
|
42
42
|
|
|
43
43
|
export const CheckboxFrame = styled(
|
|
44
|
-
|
|
44
|
+
View,
|
|
45
45
|
{
|
|
46
|
-
|
|
46
|
+
displayName: CHECKBOX_NAME,
|
|
47
47
|
render: 'button',
|
|
48
|
-
|
|
49
48
|
context: CheckboxStyledContext,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
false: {
|
|
53
|
-
size: '$true',
|
|
54
|
-
backgroundColor: '$background',
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
justifyContent: 'center',
|
|
57
|
-
borderWidth: 1,
|
|
58
|
-
borderColor: '$borderColor',
|
|
59
|
-
|
|
60
|
-
hoverStyle: {
|
|
61
|
-
borderColor: '$borderColorHover',
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
pressStyle: {
|
|
65
|
-
backgroundColor: '$backgroundPress',
|
|
66
|
-
borderColor: '$borderColorPress',
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
focusStyle: {
|
|
70
|
-
borderColor: '$borderColorFocus',
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
focusVisibleStyle: {
|
|
74
|
-
outlineStyle: 'solid',
|
|
75
|
-
outlineWidth: 2,
|
|
76
|
-
outlineColor: '$outlineColor',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
justifyContent: 'center',
|
|
80
51
|
|
|
52
|
+
variants: {
|
|
81
53
|
disabled: {
|
|
82
54
|
true: {
|
|
83
55
|
pointerEvents: 'none',
|
|
84
56
|
userSelect: 'none',
|
|
85
|
-
cursor: 'not-allowed',
|
|
86
|
-
|
|
87
|
-
hoverStyle: {
|
|
88
|
-
borderColor: '$borderColor',
|
|
89
|
-
backgroundColor: '$background',
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
pressStyle: {
|
|
93
|
-
borderColor: '$borderColor',
|
|
94
|
-
backgroundColor: '$background',
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
focusStyle: {
|
|
98
|
-
outlineWidth: 0,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
size: {
|
|
104
|
-
'...size': (val) => {
|
|
105
|
-
const radiusToken = getVariableValue(getSize(val)) / 8
|
|
106
|
-
return {
|
|
107
|
-
borderRadius: radiusToken,
|
|
108
|
-
}
|
|
109
57
|
},
|
|
110
58
|
},
|
|
111
59
|
} as const,
|
|
112
|
-
|
|
113
|
-
defaultVariants: {
|
|
114
|
-
unstyled: process.env.TAMAGUI_HEADLESS === '1',
|
|
115
|
-
},
|
|
116
60
|
},
|
|
117
61
|
{
|
|
118
62
|
accept: {
|
|
@@ -120,3 +64,167 @@ export const CheckboxFrame = styled(
|
|
|
120
64
|
} as const,
|
|
121
65
|
}
|
|
122
66
|
)
|
|
67
|
+
|
|
68
|
+
type CheckboxExpectingVariantProps = {
|
|
69
|
+
size?: SizeTokens | true
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type CheckboxExtraProps = HeadlessCheckboxExtraProps & {
|
|
73
|
+
native?: NativeValue<'web'>
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
type CheckboxFrameActiveStyleProps = {
|
|
77
|
+
activeStyle?: GetProps<typeof CheckboxFrame>
|
|
78
|
+
activeTheme?: string | null
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type CheckboxIndicatorActiveStyleProps = {
|
|
82
|
+
activeStyle?: GetProps<typeof CheckboxIndicatorFrame>
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type CheckboxProps = GetProps<typeof CheckboxFrame> &
|
|
86
|
+
CheckboxExtraProps &
|
|
87
|
+
CheckboxExpectingVariantProps &
|
|
88
|
+
CheckboxFrameActiveStyleProps
|
|
89
|
+
|
|
90
|
+
type CheckboxIndicatorExtraProps = {
|
|
91
|
+
/**
|
|
92
|
+
* Used to force mounting when more control is needed. Useful when
|
|
93
|
+
* controlling animation with React animation libraries.
|
|
94
|
+
*/
|
|
95
|
+
forceMount?: boolean
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type CheckboxIndicatorProps = GetProps<typeof CheckboxIndicatorFrame> &
|
|
99
|
+
CheckboxIndicatorExtraProps &
|
|
100
|
+
CheckboxIndicatorActiveStyleProps
|
|
101
|
+
|
|
102
|
+
export const CheckboxContext = React.createContext<{
|
|
103
|
+
checked: CheckedState
|
|
104
|
+
disabled?: boolean
|
|
105
|
+
}>({
|
|
106
|
+
checked: false,
|
|
107
|
+
disabled: false,
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const CheckboxComponent = createStyledHOC(
|
|
111
|
+
CheckboxFrame,
|
|
112
|
+
function Checkbox(_props: CheckboxProps, forwardedRef) {
|
|
113
|
+
const {
|
|
114
|
+
checked: checkedProp,
|
|
115
|
+
defaultChecked,
|
|
116
|
+
onCheckedChange,
|
|
117
|
+
native,
|
|
118
|
+
activeStyle,
|
|
119
|
+
activeTheme,
|
|
120
|
+
...props
|
|
121
|
+
} = _props
|
|
122
|
+
const propsActive = useProps(props)
|
|
123
|
+
|
|
124
|
+
const styledContext = React.useContext(CheckboxStyledContext.context)
|
|
125
|
+
const [checked = false, setChecked] = useControllableState({
|
|
126
|
+
prop: checkedProp,
|
|
127
|
+
defaultProp: defaultChecked!,
|
|
128
|
+
onChange: onCheckedChange,
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
const { checkboxProps, checkboxRef, bubbleInput } = useCheckbox(
|
|
132
|
+
// @ts-ignore
|
|
133
|
+
propsActive,
|
|
134
|
+
[checked, setChecked],
|
|
135
|
+
forwardedRef
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
if (process.env.TAMAGUI_TARGET === 'native') {
|
|
139
|
+
React.useEffect(() => {
|
|
140
|
+
if (!props.id) return
|
|
141
|
+
if (props.disabled) return
|
|
142
|
+
|
|
143
|
+
return registerFocusable(props.id, {
|
|
144
|
+
focusAndSelect: () => {
|
|
145
|
+
setChecked?.((value) => !value)
|
|
146
|
+
},
|
|
147
|
+
focus: () => {},
|
|
148
|
+
})
|
|
149
|
+
}, [props.id, props.disabled])
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const renderNative = shouldRenderNativePlatform(native)
|
|
153
|
+
if (renderNative === 'web') {
|
|
154
|
+
return (
|
|
155
|
+
<input
|
|
156
|
+
type="checkbox"
|
|
157
|
+
defaultChecked={isIndeterminate(checked) ? false : checked}
|
|
158
|
+
tabIndex={-1}
|
|
159
|
+
ref={checkboxRef as any}
|
|
160
|
+
disabled={checkboxProps.disabled}
|
|
161
|
+
style={checkboxProps.style as any}
|
|
162
|
+
/>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const memoizedContext = useMemo(
|
|
167
|
+
() => ({
|
|
168
|
+
checked,
|
|
169
|
+
disabled: checkboxProps.disabled,
|
|
170
|
+
}),
|
|
171
|
+
[checked, checkboxProps.disabled]
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
const isActive = !!checked
|
|
175
|
+
const disabled = checkboxProps.disabled
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<CheckboxContext.Provider value={memoizedContext}>
|
|
179
|
+
<CheckboxStyledContext.Provider
|
|
180
|
+
size={propsActive.size ?? styledContext?.size ?? true}
|
|
181
|
+
active={isActive}
|
|
182
|
+
disabled={disabled}
|
|
183
|
+
>
|
|
184
|
+
<CheckboxFrame
|
|
185
|
+
render="button"
|
|
186
|
+
ref={checkboxRef}
|
|
187
|
+
theme={activeTheme ?? null}
|
|
188
|
+
{...(isWeb && { type: 'button' })}
|
|
189
|
+
checked={checked}
|
|
190
|
+
disabled={disabled}
|
|
191
|
+
{...(checkboxProps as CheckboxProps)}
|
|
192
|
+
{...props}
|
|
193
|
+
{...(isActive && activeStyle ? (activeStyle as object) : undefined)}
|
|
194
|
+
>
|
|
195
|
+
{propsActive.children}
|
|
196
|
+
</CheckboxFrame>
|
|
197
|
+
{bubbleInput}
|
|
198
|
+
</CheckboxStyledContext.Provider>
|
|
199
|
+
</CheckboxContext.Provider>
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
const CheckboxIndicator = createStyledHOC(
|
|
205
|
+
CheckboxIndicatorFrame,
|
|
206
|
+
(props: CheckboxIndicatorProps, forwardedRef) => {
|
|
207
|
+
const { children, forceMount, activeStyle, ...indicatorProps } = props
|
|
208
|
+
const { active } = CheckboxStyledContext.useStyledContext()
|
|
209
|
+
const context = React.useContext(CheckboxContext)
|
|
210
|
+
|
|
211
|
+
if (forceMount || isIndeterminate(context.checked) || context.checked === true) {
|
|
212
|
+
return (
|
|
213
|
+
<CheckboxIndicatorFrame
|
|
214
|
+
pointerEvents="none"
|
|
215
|
+
{...indicatorProps}
|
|
216
|
+
{...(active && activeStyle ? (activeStyle as object) : undefined)}
|
|
217
|
+
ref={forwardedRef}
|
|
218
|
+
>
|
|
219
|
+
{children}
|
|
220
|
+
</CheckboxIndicatorFrame>
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return null
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
export const Checkbox = withStaticProperties(CheckboxComponent, {
|
|
229
|
+
Indicator: CheckboxIndicator,
|
|
230
|
+
})
|
|
@@ -2,15 +2,11 @@ import type { SizeTokens } from '@tamagui/core'
|
|
|
2
2
|
import { createStyledContext } from '@tamagui/core'
|
|
3
3
|
|
|
4
4
|
export const CheckboxStyledContext = createStyledContext<{
|
|
5
|
-
size: SizeTokens
|
|
6
|
-
scaleIcon: number
|
|
7
|
-
unstyled?: boolean
|
|
5
|
+
size: SizeTokens | true
|
|
8
6
|
active?: boolean
|
|
9
7
|
disabled?: boolean
|
|
10
8
|
}>({
|
|
11
|
-
size:
|
|
12
|
-
scaleIcon: 1,
|
|
13
|
-
unstyled: process.env.TAMAGUI_HEADLESS === '1',
|
|
9
|
+
size: true,
|
|
14
10
|
active: false,
|
|
15
11
|
disabled: false,
|
|
16
12
|
})
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import { CheckboxFrame, CheckboxIndicatorFrame } from './Checkbox'
|
|
2
|
-
import { createCheckbox } from './createCheckbox'
|
|
3
|
-
|
|
4
|
-
export * from './createCheckbox'
|
|
5
1
|
export * from './Checkbox'
|
|
6
2
|
export * from './CheckboxStyledContext'
|
|
7
3
|
export type { CheckedState } from '@tamagui/checkbox-headless'
|
|
8
|
-
|
|
9
|
-
export const Checkbox = createCheckbox({
|
|
10
|
-
Frame: CheckboxFrame,
|
|
11
|
-
Indicator: CheckboxIndicatorFrame,
|
|
12
|
-
})
|