@tamagui/switch 1.88.0 → 1.88.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/cjs/Switch.js +0 -5
- package/dist/cjs/SwitchContext.js +0 -4
- package/dist/cjs/createSwitch.js +0 -4
- package/dist/cjs/index.js +0 -7
- package/dist/esm/Switch.native.js +29 -10
- package/dist/esm/Switch.native.js.map +1 -1
- package/dist/esm/SwitchContext.native.js +25 -4
- package/dist/esm/SwitchContext.native.js.map +1 -1
- package/dist/esm/createSwitch.native.js +83 -72
- package/dist/esm/createSwitch.native.js.map +2 -2
- package/dist/esm/index.native.js +34 -11
- package/dist/esm/index.native.js.map +1 -1
- package/dist/jsx/Switch.native.js +29 -10
- package/dist/jsx/Switch.native.js.map +1 -1
- package/dist/jsx/SwitchContext.native.js +25 -4
- package/dist/jsx/SwitchContext.native.js.map +1 -1
- package/dist/jsx/createSwitch.js +106 -90
- package/dist/jsx/createSwitch.js.map +1 -1
- package/dist/jsx/createSwitch.native.js +143 -116
- package/dist/jsx/createSwitch.native.js.map +2 -2
- package/dist/jsx/index.native.js +34 -11
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +12 -12
package/dist/jsx/createSwitch.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from "react-native-web";
|
|
17
17
|
import { SwitchFrame as DefaultSwitchFrame, SwitchThumb } from "./Switch";
|
|
18
18
|
import { SwitchContext } from "./SwitchContext";
|
|
19
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
20
|
function createSwitch({
|
|
20
21
|
disableActiveTheme,
|
|
21
22
|
Frame = DefaultSwitchFrame,
|
|
@@ -33,32 +34,35 @@ function createSwitch({
|
|
|
33
34
|
unstyled: unstyledContext,
|
|
34
35
|
frameWidth,
|
|
35
36
|
size: sizeContext
|
|
36
|
-
} = context, [thumbWidth, setThumbWidth] = React.useState(0), initialChecked = React.useRef(checked).current, distance = frameWidth - thumbWidth, x = initialChecked ? checked ? 0 : -distance : checked ? distance : 0
|
|
37
|
+
} = context, [thumbWidth, setThumbWidth] = React.useState(0), initialChecked = React.useRef(checked).current, distance = frameWidth - thumbWidth, x = initialChecked ? checked ? 0 : -distance : checked ? distance : 0;
|
|
37
38
|
return (
|
|
38
39
|
// @ts-ignore
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
Thumb,
|
|
42
|
+
{
|
|
43
|
+
...(unstyledProp ?? unstyledContext ?? !1) === !1 && {
|
|
44
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1",
|
|
45
|
+
size: sizeProp ?? sizeContext ?? "$true",
|
|
46
|
+
...!disableActiveTheme && {
|
|
47
|
+
theme: checked ? "active" : null
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"data-state": getState(checked),
|
|
51
|
+
"data-disabled": disabled ? "" : void 0,
|
|
52
|
+
alignSelf: initialChecked ? "flex-end" : "flex-start",
|
|
53
|
+
checked,
|
|
54
|
+
x,
|
|
55
|
+
...thumbProps,
|
|
56
|
+
onLayout: composeEventHandlers(
|
|
57
|
+
props.onLayout,
|
|
58
|
+
(e) => (
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
setThumbWidth(e.nativeEvent.layout.width)
|
|
61
|
+
)
|
|
62
|
+
),
|
|
63
|
+
ref: forwardedRef
|
|
64
|
+
}
|
|
65
|
+
)
|
|
62
66
|
);
|
|
63
67
|
}), SwitchComponent = Frame.styleable(
|
|
64
68
|
function(propsIn, forwardedRef) {
|
|
@@ -89,11 +93,14 @@ function createSwitch({
|
|
|
89
93
|
transition: !0
|
|
90
94
|
});
|
|
91
95
|
if (shouldRenderMobileNative)
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
NativeSwitch,
|
|
98
|
+
{
|
|
99
|
+
value: checkedProp,
|
|
100
|
+
onValueChange: onCheckedChange,
|
|
101
|
+
...nativeProps
|
|
102
|
+
}
|
|
103
|
+
);
|
|
97
104
|
isWeb || React.useEffect(() => {
|
|
98
105
|
if (props.id)
|
|
99
106
|
return registerFocusable(props.id, {
|
|
@@ -103,55 +110,61 @@ function createSwitch({
|
|
|
103
110
|
});
|
|
104
111
|
}, [props.id, setChecked]);
|
|
105
112
|
const isInsideButton = React.useContext(ButtonNestingContext);
|
|
106
|
-
return
|
|
107
|
-
|
|
113
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
114
|
+
/* @__PURE__ */ jsx(ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ jsx(
|
|
115
|
+
Frame,
|
|
108
116
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
frameWidth={frameWidth}
|
|
118
|
-
themeShallow
|
|
119
|
-
{...!disableActiveTheme && {
|
|
117
|
+
tag: isInsideButton ? "span" : "button",
|
|
118
|
+
unstyled,
|
|
119
|
+
size,
|
|
120
|
+
checked,
|
|
121
|
+
disabled,
|
|
122
|
+
frameWidth,
|
|
123
|
+
themeShallow: !0,
|
|
124
|
+
...!disableActiveTheme && {
|
|
120
125
|
theme: checked ? "active" : null,
|
|
121
126
|
themeShallow: !0
|
|
122
|
-
}
|
|
123
|
-
role
|
|
124
|
-
aria-checked
|
|
125
|
-
aria-labelledby
|
|
126
|
-
aria-required
|
|
127
|
-
data-state
|
|
128
|
-
data-disabled
|
|
129
|
-
tabIndex
|
|
130
|
-
value
|
|
131
|
-
|
|
132
|
-
ref
|
|
133
|
-
onPress
|
|
127
|
+
},
|
|
128
|
+
role: "switch",
|
|
129
|
+
"aria-checked": checked,
|
|
130
|
+
"aria-labelledby": labelledBy,
|
|
131
|
+
"aria-required": required,
|
|
132
|
+
"data-state": getState(checked),
|
|
133
|
+
"data-disabled": disabled ? "" : void 0,
|
|
134
|
+
tabIndex: disabled ? void 0 : 0,
|
|
135
|
+
value,
|
|
136
|
+
...switchProps,
|
|
137
|
+
ref: composedRefs,
|
|
138
|
+
onPress: composeEventHandlers(props.onPress, (event) => {
|
|
134
139
|
setChecked((prevChecked) => !prevChecked), isWeb && isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
140
|
+
}),
|
|
141
|
+
children: /* @__PURE__ */ jsx(
|
|
142
|
+
YStack,
|
|
143
|
+
{
|
|
144
|
+
alignSelf: "stretch",
|
|
145
|
+
flex: 1,
|
|
146
|
+
onLayout: (e) => {
|
|
147
|
+
setFrameWidth(e.nativeEvent.layout.width);
|
|
148
|
+
},
|
|
149
|
+
children: typeof children == "function" ? children(checked) : children
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
) }),
|
|
154
|
+
isWeb && isFormControl && /* @__PURE__ */ jsx(
|
|
155
|
+
BubbleInput,
|
|
156
|
+
{
|
|
157
|
+
control: button,
|
|
158
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
159
|
+
name,
|
|
160
|
+
value,
|
|
161
|
+
checked,
|
|
162
|
+
required,
|
|
163
|
+
disabled,
|
|
164
|
+
style: { transform: "translateX(-100%)" }
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] });
|
|
155
168
|
},
|
|
156
169
|
{
|
|
157
170
|
disableTheme: !0
|
|
@@ -168,22 +181,25 @@ function createSwitch({
|
|
|
168
181
|
setChecked.call(input, checked), input.dispatchEvent(event);
|
|
169
182
|
}
|
|
170
183
|
}, [prevChecked, checked, bubbles]), // @ts-ignore
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
/* @__PURE__ */ jsx(
|
|
185
|
+
"input",
|
|
186
|
+
{
|
|
187
|
+
type: "checkbox",
|
|
188
|
+
"aria-hidden": !0,
|
|
189
|
+
defaultChecked: checked,
|
|
190
|
+
...inputProps,
|
|
191
|
+
tabIndex: -1,
|
|
192
|
+
ref,
|
|
193
|
+
style: {
|
|
194
|
+
...props.style,
|
|
195
|
+
// ...controlSize,
|
|
196
|
+
position: "absolute",
|
|
197
|
+
pointerEvents: "none",
|
|
198
|
+
opacity: 0,
|
|
199
|
+
margin: 0
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
);
|
|
187
203
|
};
|
|
188
204
|
function getState(checked) {
|
|
189
205
|
return checked ? "checked" : "unchecked";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createSwitch.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB;AAAA,EAKE;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAS,sBAAsB,4BAA4B;AAC3D,SAAS,uBAAuB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AC3B;AAAA,IACF,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC;AAAA,IAIhC;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,eAAW;AAAA,QACX,gBAAgB;AAAA,QACf,GAAG;AAAA,QACJ,UAAU;AAAA,QACV;AAAA,QACA,OAAO;AAAA,UACL,GAAG,MAAM;AAAA;AAAA,UAET,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,WAAS,SAAS,SAAkB;AAClC,WAAO,UAAU,YAAY;AAAA,EAC/B;AAMA,SAJe,qBAAqB,iBAAiB;AAAA,IACnD,OAAO;AAAA,EACT,CAAC;AAGH;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,68 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var createSwitch_exports = {};
|
|
25
|
+
__export(createSwitch_exports, {
|
|
26
|
+
createSwitch: () => createSwitch
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(createSwitch_exports);
|
|
29
|
+
var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_focusable = require("@tamagui/focusable"), import_helpers = require("@tamagui/helpers"), import_label = require("@tamagui/label"), import_stacks = require("@tamagui/stacks"), import_use_controllable_state = require("@tamagui/use-controllable-state"), import_use_previous = require("@tamagui/use-previous"), React = __toESM(require("react")), import_react_native = require("react-native"), import_Switch = require("./Switch"), import_SwitchContext = require("./SwitchContext"), import_jsx_runtime = (
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
require("react/jsx-runtime")
|
|
32
|
+
);
|
|
19
33
|
function createSwitch({
|
|
20
34
|
disableActiveTheme,
|
|
21
|
-
Frame =
|
|
22
|
-
Thumb = SwitchThumb
|
|
35
|
+
Frame = import_Switch.SwitchFrame,
|
|
36
|
+
Thumb = import_Switch.SwitchThumb
|
|
23
37
|
}) {
|
|
24
|
-
process.env.NODE_ENV === "development" && (Frame !==
|
|
38
|
+
process.env.NODE_ENV === "development" && (Frame !== import_Switch.SwitchFrame && Frame.staticConfig.context && console.warn(
|
|
25
39
|
"Warning: createSwitch() needs to control context to pass checked state from Frame to Thumb, any custom context passed will be overridden."
|
|
26
|
-
), Thumb !== SwitchThumb && Thumb.staticConfig.context && console.warn(
|
|
40
|
+
), Thumb !== import_Switch.SwitchThumb && Thumb.staticConfig.context && console.warn(
|
|
27
41
|
"Warning: createSwitch() needs to control context to pass checked state from Frame to Thumb, any custom context passed will be overridden."
|
|
28
|
-
)), Frame.staticConfig.context = SwitchContext, Thumb.staticConfig.context = SwitchContext;
|
|
42
|
+
)), Frame.staticConfig.context = import_SwitchContext.SwitchContext, Thumb.staticConfig.context = import_SwitchContext.SwitchContext;
|
|
29
43
|
const SwitchThumbComponent = Thumb.styleable(function(props, forwardedRef) {
|
|
30
|
-
const { size: sizeProp, unstyled: unstyledProp, ...thumbProps } = props, context = React.useContext(SwitchContext), {
|
|
44
|
+
const { size: sizeProp, unstyled: unstyledProp, ...thumbProps } = props, context = React.useContext(import_SwitchContext.SwitchContext), {
|
|
31
45
|
disabled,
|
|
32
46
|
checked,
|
|
33
47
|
unstyled: unstyledContext,
|
|
34
48
|
frameWidth,
|
|
35
49
|
size: sizeContext
|
|
36
|
-
} = context, [thumbWidth, setThumbWidth] = React.useState(0), initialChecked = React.useRef(checked).current, distance = frameWidth - thumbWidth, x = initialChecked ? checked ? 0 : -distance : checked ? distance : 0
|
|
37
|
-
return (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
} = context, [thumbWidth, setThumbWidth] = React.useState(0), initialChecked = React.useRef(checked).current, distance = frameWidth - thumbWidth, x = initialChecked ? checked ? 0 : -distance : checked ? distance : 0;
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
Thumb,
|
|
53
|
+
{
|
|
54
|
+
...(unstyledProp ?? unstyledContext ?? !1) === !1 && {
|
|
41
55
|
unstyled: process.env.TAMAGUI_HEADLESS === "1",
|
|
42
56
|
size: sizeProp ?? sizeContext ?? "$true",
|
|
43
57
|
...!disableActiveTheme && {
|
|
44
58
|
theme: checked ? "active" : null
|
|
45
59
|
}
|
|
46
|
-
}
|
|
47
|
-
data-state
|
|
48
|
-
data-disabled
|
|
49
|
-
alignSelf
|
|
50
|
-
checked
|
|
51
|
-
x
|
|
52
|
-
|
|
53
|
-
onLayout
|
|
60
|
+
},
|
|
61
|
+
"data-state": getState(checked),
|
|
62
|
+
"data-disabled": disabled ? "" : void 0,
|
|
63
|
+
alignSelf: initialChecked ? "flex-end" : "flex-start",
|
|
64
|
+
checked,
|
|
65
|
+
x,
|
|
66
|
+
...thumbProps,
|
|
67
|
+
onLayout: (0, import_helpers.composeEventHandlers)(
|
|
54
68
|
props.onLayout,
|
|
55
69
|
(e) => (
|
|
56
70
|
// @ts-ignore
|
|
57
71
|
setThumbWidth(e.nativeEvent.layout.width)
|
|
58
72
|
)
|
|
59
|
-
)
|
|
60
|
-
ref
|
|
61
|
-
|
|
73
|
+
),
|
|
74
|
+
ref: forwardedRef
|
|
75
|
+
}
|
|
62
76
|
);
|
|
63
77
|
}), SwitchComponent = Frame.styleable(
|
|
64
78
|
function(propsIn, forwardedRef) {
|
|
65
|
-
const styledContext = React.useContext(SwitchContext), props = useProps(propsIn, {
|
|
79
|
+
const styledContext = React.useContext(import_SwitchContext.SwitchContext), props = (0, import_core.useProps)(propsIn, {
|
|
66
80
|
noNormalize: !0,
|
|
67
81
|
noExpand: !0,
|
|
68
82
|
resolveValues: "none",
|
|
@@ -82,82 +96,91 @@ function createSwitch({
|
|
|
82
96
|
nativeProps,
|
|
83
97
|
children,
|
|
84
98
|
...switchProps
|
|
85
|
-
} = props, native = Array.isArray(nativeProp) ? nativeProp : [nativeProp], shouldRenderMobileNative = !isWeb && nativeProp === !0 || !isWeb && native.includes("mobile") || native.includes("android") && Platform.OS === "android" || native.includes("ios") && Platform.OS === "ios", [button, setButton] = React.useState(null), composedRefs = useComposedRefs(forwardedRef, setButton), labelId = useLabelContext(button), labelledBy = ariaLabelledby || labelId, hasConsumerStoppedPropagationRef = React.useRef(!1), isFormControl = isWeb ? button ? !!button.closest("form") : !0 : !1, [frameWidth, setFrameWidth] = React.useState(0), [checked = !1, setChecked] = useControllableState({
|
|
99
|
+
} = props, native = Array.isArray(nativeProp) ? nativeProp : [nativeProp], shouldRenderMobileNative = !import_constants.isWeb && nativeProp === !0 || !import_constants.isWeb && native.includes("mobile") || native.includes("android") && import_react_native.Platform.OS === "android" || native.includes("ios") && import_react_native.Platform.OS === "ios", [button, setButton] = React.useState(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, setButton), labelId = (0, import_label.useLabelContext)(button), labelledBy = ariaLabelledby || labelId, hasConsumerStoppedPropagationRef = React.useRef(!1), isFormControl = import_constants.isWeb ? button ? !!button.closest("form") : !0 : !1, [frameWidth, setFrameWidth] = React.useState(0), [checked = !1, setChecked] = (0, import_use_controllable_state.useControllableState)({
|
|
86
100
|
prop: checkedProp,
|
|
87
101
|
defaultProp: defaultChecked || !1,
|
|
88
102
|
onChange: onCheckedChange,
|
|
89
103
|
transition: !0
|
|
90
104
|
});
|
|
91
105
|
if (shouldRenderMobileNative)
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
107
|
+
import_react_native.Switch,
|
|
108
|
+
{
|
|
109
|
+
value: checkedProp,
|
|
110
|
+
onValueChange: onCheckedChange,
|
|
111
|
+
...nativeProps
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
import_constants.isWeb || React.useEffect(() => {
|
|
98
115
|
if (props.id)
|
|
99
|
-
return registerFocusable(props.id, {
|
|
116
|
+
return (0, import_focusable.registerFocusable)(props.id, {
|
|
100
117
|
focus: () => {
|
|
101
118
|
setChecked((x) => !x);
|
|
102
119
|
}
|
|
103
120
|
});
|
|
104
121
|
}, [props.id, setChecked]);
|
|
105
|
-
const isInsideButton = React.useContext(ButtonNestingContext);
|
|
106
|
-
return
|
|
107
|
-
|
|
122
|
+
const isInsideButton = React.useContext(import_stacks.ButtonNestingContext);
|
|
123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
Frame,
|
|
108
126
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
frameWidth={frameWidth}
|
|
118
|
-
themeShallow
|
|
119
|
-
{...!disableActiveTheme && {
|
|
127
|
+
tag: isInsideButton ? "span" : "button",
|
|
128
|
+
unstyled,
|
|
129
|
+
size,
|
|
130
|
+
checked,
|
|
131
|
+
disabled,
|
|
132
|
+
frameWidth,
|
|
133
|
+
themeShallow: !0,
|
|
134
|
+
...!disableActiveTheme && {
|
|
120
135
|
theme: checked ? "active" : null,
|
|
121
136
|
themeShallow: !0
|
|
122
|
-
}
|
|
123
|
-
role
|
|
124
|
-
aria-checked
|
|
125
|
-
aria-labelledby
|
|
126
|
-
aria-required
|
|
127
|
-
data-state
|
|
128
|
-
data-disabled
|
|
129
|
-
tabIndex
|
|
130
|
-
value
|
|
131
|
-
|
|
132
|
-
ref
|
|
133
|
-
onPress
|
|
134
|
-
setChecked((prevChecked) => !prevChecked), isWeb && isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
137
|
+
},
|
|
138
|
+
role: "switch",
|
|
139
|
+
"aria-checked": checked,
|
|
140
|
+
"aria-labelledby": labelledBy,
|
|
141
|
+
"aria-required": required,
|
|
142
|
+
"data-state": getState(checked),
|
|
143
|
+
"data-disabled": disabled ? "" : void 0,
|
|
144
|
+
tabIndex: disabled ? void 0 : 0,
|
|
145
|
+
value,
|
|
146
|
+
...switchProps,
|
|
147
|
+
ref: composedRefs,
|
|
148
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, (event) => {
|
|
149
|
+
setChecked((prevChecked) => !prevChecked), import_constants.isWeb && isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
150
|
+
}),
|
|
151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
+
import_stacks.YStack,
|
|
153
|
+
{
|
|
154
|
+
alignSelf: "stretch",
|
|
155
|
+
flex: 1,
|
|
156
|
+
onLayout: (e) => {
|
|
157
|
+
setFrameWidth(e.nativeEvent.layout.width);
|
|
158
|
+
},
|
|
159
|
+
children: typeof children == "function" ? children(checked) : children
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
) }),
|
|
164
|
+
import_constants.isWeb && isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
165
|
+
BubbleInput,
|
|
166
|
+
{
|
|
167
|
+
control: button,
|
|
168
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
169
|
+
name,
|
|
170
|
+
value,
|
|
171
|
+
checked,
|
|
172
|
+
required,
|
|
173
|
+
disabled,
|
|
174
|
+
style: { transform: "translateX(-100%)" }
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] });
|
|
155
178
|
},
|
|
156
179
|
{
|
|
157
180
|
disableTheme: !0
|
|
158
181
|
}
|
|
159
182
|
), BubbleInput = (props) => {
|
|
160
|
-
const { control, checked, bubbles = !0, ...inputProps } = props, ref = React.useRef(null), prevChecked = usePrevious(checked);
|
|
183
|
+
const { control, checked, bubbles = !0, ...inputProps } = props, ref = React.useRef(null), prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
161
184
|
return React.useEffect(() => {
|
|
162
185
|
const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
|
|
163
186
|
inputProto,
|
|
@@ -168,31 +191,35 @@ function createSwitch({
|
|
|
168
191
|
setChecked.call(input, checked), input.dispatchEvent(event);
|
|
169
192
|
}
|
|
170
193
|
}, [prevChecked, checked, bubbles]), // @ts-ignore
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
195
|
+
"input",
|
|
196
|
+
{
|
|
197
|
+
type: "checkbox",
|
|
198
|
+
"aria-hidden": !0,
|
|
199
|
+
defaultChecked: checked,
|
|
200
|
+
...inputProps,
|
|
201
|
+
tabIndex: -1,
|
|
202
|
+
ref,
|
|
203
|
+
style: {
|
|
204
|
+
...props.style,
|
|
205
|
+
// ...controlSize,
|
|
206
|
+
position: "absolute",
|
|
207
|
+
pointerEvents: "none",
|
|
208
|
+
opacity: 0,
|
|
209
|
+
margin: 0
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
);
|
|
187
213
|
};
|
|
188
214
|
function getState(checked) {
|
|
189
215
|
return checked ? "checked" : "unchecked";
|
|
190
216
|
}
|
|
191
|
-
return withStaticProperties(SwitchComponent, {
|
|
217
|
+
return (0, import_helpers.withStaticProperties)(SwitchComponent, {
|
|
192
218
|
Thumb: SwitchThumbComponent
|
|
193
219
|
});
|
|
194
220
|
}
|
|
195
|
-
export
|
|
221
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
222
|
+
0 && (module.exports = {
|
|
196
223
|
createSwitch
|
|
197
|
-
};
|
|
224
|
+
});
|
|
198
225
|
//# sourceMappingURL=createSwitch.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createSwitch.tsx"],
|
|
4
|
-
"mappings": "AAAA
|
|
5
|
-
"names": []
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC,kCAChC,mBAAsB,+BACtB,cAMO,0BACP,mBAAkC,+BAClC,iBAA2D,6BAC3D,eAAgC,2BAChC,gBAA6C,4BAC7C,gCAAqC,4CACrC,sBAA4B,kCAC5B,QAAuB,2BACvB,sBAIO,yBAEP,gBAA+D,qBAC/D,uBAA8B,4BAgFxB;AAAA;AAAA;AAAA;AA7CC,SAAS,aAAwE;AAAA,EACtF;AAAA,EACA,QAAQ,cAAAA;AAAA,EACR,QAAQ;AACV,GAIG;AACD,EAAI,QAAQ,IAAI,aAAa,kBAEvB,UAAU,cAAAA,eAAsB,MAAM,aAAa,WACrD,QAAQ;AAAA,IACN;AAAA,EACF,GAGE,UAAU,6BAAe,MAAM,aAAa,WAC9C,QAAQ;AAAA,IACN;AAAA,EACF,IAIJ,MAAM,aAAa,UAAU,oCAC7B,MAAM,aAAa,UAAU;AAE7B,QAAM,uBAAuB,MAAM,UAAU,SAAqB,OAAO,cAAc;AACrF,UAAM,EAAE,MAAM,UAAU,UAAU,cAAc,GAAG,WAAW,IAAI,OAC5D,UAAU,MAAM,WAAW,kCAAa,GACxC;AAAA,MACJ;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,MAAM;AAAA,IACR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