@tamagui/switch 1.89.26 → 1.89.27-1708112217600

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.
@@ -18,8 +18,7 @@ __export(StyledContext_exports, {
18
18
  SwitchStyledContext: () => SwitchStyledContext
19
19
  });
20
20
  module.exports = __toCommonJS(StyledContext_exports);
21
- var import_core = require("@tamagui/core");
22
- const SwitchStyledContext = (0, import_core.createStyledContext)({
21
+ var import_core = require("@tamagui/core"), SwitchStyledContext = (0, import_core.createStyledContext)({
23
22
  size: void 0,
24
23
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
25
24
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/StyledContext.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAoC;AAE7B,MAAM,0BAAsB,iCAGhC;AAAA,EACD,MAAM;AAAA,EACN,UAAU,QAAQ,IAAI,qBAAqB;AAC7C,CAAC;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/switch/src/StyledContext.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AACA;;;;;kBAAoC,0BAEvBA,0BAAsBC,iCAGhC;EACDC,MAAMC;EACNC,UAAUC,QAAQC,IAAIC,qBAAqB;AAC7C,CAAA;",
5
+ "names": ["SwitchStyledContext", "createStyledContext", "size", "undefined", "unstyled", "process", "env", "TAMAGUI_HEADLESS"]
6
6
  }
@@ -19,8 +19,7 @@ __export(Switch_exports, {
19
19
  SwitchThumb: () => SwitchThumb
20
20
  });
21
21
  module.exports = __toCommonJS(Switch_exports);
22
- var import_core = require("@tamagui/core"), import_get_token = require("@tamagui/get-token"), import_stacks = require("@tamagui/stacks"), import_StyledContext = require("./StyledContext");
23
- const SwitchThumb = (0, import_core.styled)(import_stacks.ThemeableStack, {
22
+ var import_core = require("@tamagui/core"), import_get_token = require("@tamagui/get-token"), import_stacks = require("@tamagui/stacks"), import_StyledContext = require("./StyledContext"), SwitchThumb = (0, import_core.styled)(import_stacks.ThemeableStack, {
24
23
  name: "SwitchThumb",
25
24
  context: import_StyledContext.SwitchStyledContext,
26
25
  variants: {
@@ -35,8 +34,8 @@ const SwitchThumb = (0, import_core.styled)(import_stacks.ThemeableStack, {
35
34
  true: {}
36
35
  },
37
36
  size: {
38
- "...size": (val) => {
39
- const size = getSwitchHeight(val);
37
+ "...size": function(val) {
38
+ var size = getSwitchHeight(val);
40
39
  return {
41
40
  height: size,
42
41
  width: size
@@ -47,7 +46,11 @@ const SwitchThumb = (0, import_core.styled)(import_stacks.ThemeableStack, {
47
46
  defaultVariants: {
48
47
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
49
48
  }
50
- }), getSwitchHeight = (val) => Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * 0.65), getSwitchWidth = (val) => getSwitchHeight(val) * 2, SwitchFrame = (0, import_core.styled)(import_stacks.YStack, {
49
+ }), getSwitchHeight = function(val) {
50
+ return Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * 0.65);
51
+ }, getSwitchWidth = function(val) {
52
+ return getSwitchHeight(val) * 2;
53
+ }, SwitchFrame = (0, import_core.styled)(import_stacks.YStack, {
51
54
  name: "Switch",
52
55
  tag: "button",
53
56
  context: import_StyledContext.SwitchStyledContext,
@@ -69,8 +72,8 @@ const SwitchThumb = (0, import_core.styled)(import_stacks.ThemeableStack, {
69
72
  true: {}
70
73
  },
71
74
  size: {
72
- "...size": (val) => {
73
- const height = getSwitchHeight(val) + 4, width = getSwitchWidth(val) + 4;
75
+ "...size": function(val) {
76
+ var height = getSwitchHeight(val) + 4, width = getSwitchWidth(val) + 4;
74
77
  return {
75
78
  height,
76
79
  minHeight: height,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/Switch.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AA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,UACX;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU,QAAQ,IAAI,qBAAqB;AAAA,EAC7C;AACF,CAAC;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/switch/src/Switch.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AACA;;;;;;kBAAyC,0BACzC,mBAAwB,+BACxB,gBAAuC,4BAEvC,uBAAoC,4BAEvBA,kBAAcC,oBAAOC,8BAAgB;EAChDC,MAAM;EACNC,SAASC;EAETC,UAAU;IACRC,UAAU;MACRC,OAAO;QACLC,MAAM;QACNC,iBAAiB;QACjBC,cAAc;MAChB;IACF;IAEAC,SAAS;MACPC,MAAM,CAAC;IACT;IAEAJ,MAAM;MACJ,WAAW,SAACK,KAAAA;AACV,YAAML,OAAOM,gBAAgBD,GAAAA;AAC7B,eAAO;UACLE,QAAQP;UACRQ,OAAOR;QACT;MACF;IACF;EACF;EAEAS,iBAAiB;IACfX,UAAUY,QAAQC,IAAIC,qBAAqB;EAC7C;AACF,CAAA,GAEMN,kBAAkB,SAACD,KAAAA;SACvBQ,KAAKC,UAAMC,kCAAiBC,0BAAQX,GAAAA,CAAAA,IAAQ,IAAA;GAExCY,iBAAiB,SAACZ,KAAAA;SAAoBC,gBAAgBD,GAAAA,IAAO;GAEtDa,kBAAc1B,oBAAO2B,sBAAQ;EACxCzB,MAAM;EACN0B,KAAK;EACLzB,SAASC;EAETC,UAAU;IACRC,UAAU;MACRC,OAAO;QACLG,cAAc;QACdD,iBAAiB;QACjBoB,aAAa;QACbC,aAAa;QAEbC,YAAY;UACVC,cAAc;UACdC,cAAc;UACdC,cAAc;QAChB;MACF;IACF;IAEAvB,SAAS;MACPC,MAAM,CAAC;IACT;IAEAJ,MAAM;MACJ,WAAW,SAACK,KAAAA;AACV,YAAME,SAASD,gBAAgBD,GAAAA,IAAO,GAChCG,QAAQS,eAAeZ,GAAAA,IAAO;AACpC,eAAO;UACLE;UACAoB,WAAWpB;UACXC;QACF;MACF;IACF;EACF;EAEAC,iBAAiB;IACfX,UAAUY,QAAQC,IAAIC,qBAAqB;EAC7C;AACF,CAAA;",
5
+ "names": ["SwitchThumb", "styled", "ThemeableStack", "name", "context", "SwitchStyledContext", "variants", "unstyled", "false", "size", "backgroundColor", "borderRadius", "checked", "true", "val", "getSwitchHeight", "height", "width", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "Math", "round", "getVariableValue", "getSize", "getSwitchWidth", "SwitchFrame", "YStack", "tag", "borderWidth", "borderColor", "focusStyle", "outlineColor", "outlineStyle", "outlineWidth", "minHeight"]
6
6
  }
@@ -27,114 +27,200 @@ __export(createSwitch_exports, {
27
27
  createSwitch: () => createSwitch
28
28
  });
29
29
  module.exports = __toCommonJS(createSwitch_exports);
30
- var import_core = require("@tamagui/core"), import_switch_headless = require("@tamagui/switch-headless"), import_use_controllable_state = require("@tamagui/use-controllable-state"), React = __toESM(require("react")), import_react_native = require("react-native"), import_StyledContext = require("./StyledContext"), import_Switch = require("./Switch"), import_jsx_runtime = require("react/jsx-runtime");
31
- const SwitchContext = React.createContext({
30
+ var import_core = require("@tamagui/core"), import_switch_headless = require("@tamagui/switch-headless"), import_use_controllable_state = require("@tamagui/use-controllable-state"), React = __toESM(require("react")), import_react_native = require("react-native"), import_StyledContext = require("./StyledContext"), import_Switch = require("./Switch");
31
+ function _array_like_to_array(arr, len) {
32
+ (len == null || len > arr.length) && (len = arr.length);
33
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
34
+ arr2[i] = arr[i];
35
+ return arr2;
36
+ }
37
+ function _array_with_holes(arr) {
38
+ if (Array.isArray(arr))
39
+ return arr;
40
+ }
41
+ function _define_property(obj, key, value) {
42
+ return key in obj ? Object.defineProperty(obj, key, {
43
+ value,
44
+ enumerable: !0,
45
+ configurable: !0,
46
+ writable: !0
47
+ }) : obj[key] = value, obj;
48
+ }
49
+ function _iterable_to_array_limit(arr, i) {
50
+ var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
51
+ if (_i != null) {
52
+ var _arr = [], _n = !0, _d = !1, _s, _e;
53
+ try {
54
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
55
+ ;
56
+ } catch (err) {
57
+ _d = !0, _e = err;
58
+ } finally {
59
+ try {
60
+ !_n && _i.return != null && _i.return();
61
+ } finally {
62
+ if (_d)
63
+ throw _e;
64
+ }
65
+ }
66
+ return _arr;
67
+ }
68
+ }
69
+ function _non_iterable_rest() {
70
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
71
+ }
72
+ function _object_spread(target) {
73
+ for (var i = 1; i < arguments.length; i++) {
74
+ var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
75
+ typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
76
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
77
+ }))), ownKeys2.forEach(function(key) {
78
+ _define_property(target, key, source[key]);
79
+ });
80
+ }
81
+ return target;
82
+ }
83
+ function ownKeys(object, enumerableOnly) {
84
+ var keys = Object.keys(object);
85
+ if (Object.getOwnPropertySymbols) {
86
+ var symbols = Object.getOwnPropertySymbols(object);
87
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
88
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
89
+ })), keys.push.apply(keys, symbols);
90
+ }
91
+ return keys;
92
+ }
93
+ function _object_spread_props(target, source) {
94
+ return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
95
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
96
+ }), target;
97
+ }
98
+ function _object_without_properties(source, excluded) {
99
+ if (source == null)
100
+ return {};
101
+ var target = _object_without_properties_loose(source, excluded), key, i;
102
+ if (Object.getOwnPropertySymbols) {
103
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
104
+ for (i = 0; i < sourceSymbolKeys.length; i++)
105
+ key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
106
+ }
107
+ return target;
108
+ }
109
+ function _object_without_properties_loose(source, excluded) {
110
+ if (source == null)
111
+ return {};
112
+ var target = {}, sourceKeys = Object.keys(source), key, i;
113
+ for (i = 0; i < sourceKeys.length; i++)
114
+ key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
115
+ return target;
116
+ }
117
+ function _sliced_to_array(arr, i) {
118
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
119
+ }
120
+ function _unsupported_iterable_to_array(o, minLen) {
121
+ if (o) {
122
+ if (typeof o == "string")
123
+ return _array_like_to_array(o, minLen);
124
+ var n = Object.prototype.toString.call(o).slice(8, -1);
125
+ if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
126
+ return Array.from(n);
127
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
128
+ return _array_like_to_array(o, minLen);
129
+ }
130
+ }
131
+ var SwitchContext = /* @__PURE__ */ React.createContext({
32
132
  checked: !1,
33
133
  disabled: !1,
34
134
  frameWidth: 0
35
135
  });
36
136
  function createSwitch(createProps) {
37
- const {
38
- disableActiveTheme,
39
- Frame = import_Switch.SwitchFrame,
40
- Thumb = import_Switch.SwitchThumb
41
- } = createProps;
42
- process.env.NODE_ENV === "development" && (Frame !== import_Switch.SwitchFrame && Frame.staticConfig.context || Thumb !== import_Switch.SwitchThumb && Thumb.staticConfig.context) && console.warn(
43
- "Warning: createSwitch() needs to control context to pass checked state from Frame to Thumb, any custom context passed will be overridden."
44
- ), Frame.staticConfig.context = import_StyledContext.SwitchStyledContext, Thumb.staticConfig.context = import_StyledContext.SwitchStyledContext;
45
- const SwitchThumbComponent = Thumb.styleable(
46
- function(props, forwardedRef) {
47
- const { size: sizeProp, unstyled: unstyledProp, nativeID, ...thumbProps } = props, context = React.useContext(SwitchContext), { checked, disabled, frameWidth } = context, styledContext = import_StyledContext.SwitchStyledContext.useStyledContext(), { unstyled: unstyledContext, size: sizeContext } = styledContext, unstyled = process.env.TAMAGUI_HEADLESS === "1" ? !0 : unstyledProp ?? unstyledContext ?? !1, size = sizeProp ?? sizeContext ?? "$true", initialChecked = React.useRef(checked).current, [thumbWidth, setThumbWidth] = React.useState(0), distance = frameWidth - thumbWidth, x = initialChecked ? checked ? 0 : -distance : checked ? distance : 0;
48
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
- Thumb,
50
- {
51
- ref: forwardedRef,
52
- unstyled,
53
- ...unstyled === !1 && {
54
- size,
55
- ...!disableActiveTheme && {
56
- theme: checked ? "active" : null
57
- }
58
- },
59
- alignSelf: initialChecked ? "flex-end" : "flex-start",
60
- x,
61
- onLayout: (0, import_core.composeEventHandlers)(
62
- props.onLayout,
63
- (e) => setThumbWidth(e.nativeEvent.layout.width)
64
- ),
65
- checked,
66
- disabled,
67
- ...thumbProps
68
- }
69
- );
70
- }
71
- ), SwitchComponent = Frame.styleable(
72
- function(_props, forwardedRef) {
73
- const {
74
- native,
75
- nativeProps,
76
- checked: checkedProp,
77
- defaultChecked,
78
- onCheckedChange,
79
- ...props
80
- } = _props, [checked, setChecked] = (0, import_use_controllable_state.useControllableState)({
81
- prop: checkedProp,
82
- defaultProp: defaultChecked || !1,
83
- onChange: onCheckedChange,
84
- transition: !0
85
- }), styledContext = React.useContext(import_StyledContext.SwitchStyledContext.context), [frameWidth, setFrameWidth] = React.useState(0), propsActive = (0, import_core.useProps)(props, {
86
- noNormalize: !0,
87
- noExpand: !0,
88
- resolveValues: "none",
89
- forComponent: Frame
90
- });
91
- propsActive.size = styledContext.size ?? props.size ?? "$true", propsActive.unstyled = styledContext.unstyled ?? props.unstyled ?? !1;
92
- const { switchProps, bubbleInput, switchRef } = (0, import_switch_headless.useSwitch)(
93
- // @ts-ignore
94
- propsActive,
95
- [checked, setChecked],
96
- forwardedRef
97
- ), renderNative = (0, import_core.shouldRenderNativePlatform)(native);
98
- return renderNative === "android" || renderNative === "ios" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Switch, { value: checked, onValueChange: setChecked, ...nativeProps }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
99
- SwitchContext.Provider,
100
- {
101
- value: { checked, disabled: switchProps.disabled, frameWidth },
102
- children: [
103
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
104
- Frame,
105
- {
106
- ref: switchRef,
107
- tag: "button",
108
- ...import_core.isWeb && { type: "button" },
109
- ...switchProps,
110
- ...!disableActiveTheme && {
111
- theme: checked ? "active" : null,
112
- themeShallow: !0
113
- },
114
- checked,
115
- disabled: switchProps.disabled,
116
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
117
- import_core.Stack,
118
- {
119
- alignSelf: "stretch",
120
- flex: 1,
121
- onLayout: (e) => {
122
- setFrameWidth(e.nativeEvent.layout.width);
123
- },
124
- children: switchProps.children
125
- }
126
- )
127
- }
128
- ),
129
- bubbleInput
130
- ]
131
- }
132
- );
133
- },
134
- {
135
- disableTheme: !0
136
- }
137
- );
137
+ var disableActiveTheme = createProps.disableActiveTheme, _createProps_Frame = createProps.Frame, Frame = _createProps_Frame === void 0 ? import_Switch.SwitchFrame : _createProps_Frame, _createProps_Thumb = createProps.Thumb, Thumb = _createProps_Thumb === void 0 ? import_Switch.SwitchThumb : _createProps_Thumb;
138
+ process.env.NODE_ENV === "development" && (Frame !== import_Switch.SwitchFrame && Frame.staticConfig.context || Thumb !== import_Switch.SwitchThumb && Thumb.staticConfig.context) && console.warn("Warning: createSwitch() needs to control context to pass checked state from Frame to Thumb, any custom context passed will be overridden."), Frame.staticConfig.context = import_StyledContext.SwitchStyledContext, Thumb.staticConfig.context = import_StyledContext.SwitchStyledContext;
139
+ var SwitchThumbComponent = Thumb.styleable(function(props, forwardedRef) {
140
+ var sizeProp = props.size, unstyledProp = props.unstyled, nativeID = props.nativeID, thumbProps = _object_without_properties(props, [
141
+ "size",
142
+ "unstyled",
143
+ "nativeID"
144
+ ]), context = React.useContext(SwitchContext), checked = context.checked, disabled = context.disabled, frameWidth = context.frameWidth, styledContext = import_StyledContext.SwitchStyledContext.useStyledContext(), unstyledContext = styledContext.unstyled, sizeContext = styledContext.size, _ref, unstyled = process.env.TAMAGUI_HEADLESS === "1" ? !0 : (_ref = unstyledProp ?? unstyledContext) !== null && _ref !== void 0 ? _ref : !1, _ref1, size = (_ref1 = sizeProp ?? sizeContext) !== null && _ref1 !== void 0 ? _ref1 : "$true", initialChecked = React.useRef(checked).current, _React_useState = _sliced_to_array(React.useState(0), 2), thumbWidth = _React_useState[0], setThumbWidth = _React_useState[1], distance = frameWidth - thumbWidth, x = initialChecked ? checked ? 0 : -distance : checked ? distance : 0;
145
+ return /* @__PURE__ */ React.createElement(Thumb, _object_spread(_object_spread_props(_object_spread({
146
+ ref: forwardedRef,
147
+ unstyled
148
+ }, unstyled === !1 && _object_spread({
149
+ size
150
+ }, !disableActiveTheme && {
151
+ theme: checked ? "active" : null
152
+ })), {
153
+ alignSelf: initialChecked ? "flex-end" : "flex-start",
154
+ x,
155
+ // TODO: remove ViewProps cast
156
+ onLayout: (0, import_core.composeEventHandlers)(props.onLayout, function(e) {
157
+ return setThumbWidth(e.nativeEvent.layout.width);
158
+ }),
159
+ // expected variants
160
+ checked,
161
+ disabled
162
+ }), thumbProps));
163
+ }), SwitchComponent = Frame.styleable(function(_props, forwardedRef) {
164
+ var native = _props.native, nativeProps = _props.nativeProps, checkedProp = _props.checked, defaultChecked = _props.defaultChecked, onCheckedChange = _props.onCheckedChange, props = _object_without_properties(_props, [
165
+ "native",
166
+ "nativeProps",
167
+ "checked",
168
+ "defaultChecked",
169
+ "onCheckedChange"
170
+ ]), _useControllableState = _sliced_to_array((0, import_use_controllable_state.useControllableState)({
171
+ prop: checkedProp,
172
+ defaultProp: defaultChecked || !1,
173
+ onChange: onCheckedChange,
174
+ transition: !0
175
+ }), 2), checked = _useControllableState[0], setChecked = _useControllableState[1], styledContext = React.useContext(import_StyledContext.SwitchStyledContext.context), _React_useState = _sliced_to_array(React.useState(0), 2), frameWidth = _React_useState[0], setFrameWidth = _React_useState[1], propsActive = (0, import_core.useProps)(props, {
176
+ noNormalize: !0,
177
+ noExpand: !0,
178
+ resolveValues: "none",
179
+ forComponent: Frame
180
+ }), _styledContext_size, _ref;
181
+ propsActive.size = (_ref = (_styledContext_size = styledContext.size) !== null && _styledContext_size !== void 0 ? _styledContext_size : props.size) !== null && _ref !== void 0 ? _ref : "$true";
182
+ var _styledContext_unstyled, _ref1;
183
+ propsActive.unstyled = (_ref1 = (_styledContext_unstyled = styledContext.unstyled) !== null && _styledContext_unstyled !== void 0 ? _styledContext_unstyled : props.unstyled) !== null && _ref1 !== void 0 ? _ref1 : !1;
184
+ var _useSwitch = (0, import_switch_headless.useSwitch)(
185
+ // @ts-ignore
186
+ propsActive,
187
+ [
188
+ checked,
189
+ setChecked
190
+ ],
191
+ forwardedRef
192
+ ), switchProps = _useSwitch.switchProps, bubbleInput = _useSwitch.bubbleInput, switchRef = _useSwitch.switchRef, renderNative = (0, import_core.shouldRenderNativePlatform)(native);
193
+ return renderNative === "android" || renderNative === "ios" ? /* @__PURE__ */ React.createElement(import_react_native.Switch, _object_spread({
194
+ value: checked,
195
+ onValueChange: setChecked
196
+ }, nativeProps)) : /* @__PURE__ */ React.createElement(SwitchContext.Provider, {
197
+ value: {
198
+ checked,
199
+ disabled: switchProps.disabled,
200
+ frameWidth
201
+ }
202
+ }, /* @__PURE__ */ React.createElement(Frame, _object_spread_props(_object_spread({
203
+ ref: switchRef,
204
+ tag: "button"
205
+ }, import_core.isWeb && {
206
+ type: "button"
207
+ }, switchProps, !disableActiveTheme && {
208
+ theme: checked ? "active" : null,
209
+ themeShallow: !0
210
+ }), {
211
+ // expected variants
212
+ checked,
213
+ disabled: switchProps.disabled
214
+ }), /* @__PURE__ */ React.createElement(import_core.Stack, {
215
+ alignSelf: "stretch",
216
+ flex: 1,
217
+ onLayout: function(e) {
218
+ setFrameWidth(e.nativeEvent.layout.width);
219
+ }
220
+ }, switchProps.children)), bubbleInput);
221
+ }, {
222
+ disableTheme: !0
223
+ });
138
224
  return (0, import_core.withStaticProperties)(SwitchComponent, {
139
225
  Thumb: SwitchThumbComponent
140
226
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/createSwitch.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAOO,0BAKP,yBAA0B,qCAC1B,gCAAqC,4CACrC,QAAuB,2BAEvB,sBAAuC,yBAEvC,uBAAoC,4BACpC,gBAA+D,qBAiFvD;AA7DD,MAAM,gBAAgB,MAAM,cAIhC;AAAA,EACD,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AACd,CAAC;AAKM,SAAS,aAGd,aAAqE;AACrE,QAAM;AAAA,IACJ;AAAA,IACA,QAAQ,cAAAA;AAAA,IACR,QAAQ;AAAA,EACV,IAAI;AAMJ,EAAI,QAAQ,IAAI,aAAa,kBAExB,UAAU,cAAAA,eAAsB,MAAM,aAAa,WACnD,UAAU,6BAAe,MAAM,aAAa,YAE7C,QAAQ;AAAA,IACN;AAAA,EACF,GAIJ,MAAM,aAAa,UAAU,0CAC7B,MAAM,aAAa,UAAU;AAE7B,QAAM,uBAAuB,MAAM;AAAA,IACjC,SAAqB,OAAO,cAAc;AACxC,YAAM,EAAE,MAAM,UAAU,UAAU,cAAc,UAAU,GAAG,WAAW,IAAI,OACtE,UAAU,MAAM,WAAW,aAAa,GACxC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C,OAAOC,KAAK;MAC1C;OAECsB,YAAYe,QAAQ,CAAA,GAIxBd,WAAAA;EAGP,GACA;IACEe,cAAc;EAChB,CAAA;AAGF,aAAOC,kCAAqBtC,iBAAiB;IAC3C3C,OAAOU;EACT,CAAA;AACF;",
5
+ "names": ["SwitchContext", "React", "createContext", "checked", "disabled", "frameWidth", "createSwitch", "createProps", "disableActiveTheme", "Frame", "DefaultSwitchFrame", "Thumb", "SwitchThumb", "process", "env", "NODE_ENV", "staticConfig", "context", "console", "warn", "SwitchStyledContext", "SwitchThumbComponent", "styleable", "props", "forwardedRef", "sizeProp", "size", "unstyledProp", "unstyled", "nativeID", "thumbProps", "useContext", "styledContext", "useStyledContext", "unstyledContext", "sizeContext", "TAMAGUI_HEADLESS", "initialChecked", "useRef", "current", "useState", "thumbWidth", "setThumbWidth", "distance", "x", "ref", "theme", "alignSelf", "onLayout", "composeEventHandlers", "e", "nativeEvent", "layout", "width", "SwitchComponent", "_props", "native", "nativeProps", "checkedProp", "defaultChecked", "onCheckedChange", "useControllableState", "prop", "defaultProp", "onChange", "transition", "setChecked", "setFrameWidth", "propsActive", "useProps", "noNormalize", "noExpand", "resolveValues", "forComponent", "useSwitch", "switchProps", "bubbleInput", "switchRef", "renderNative", "shouldRenderNativePlatform", "NativeSwitch", "value", "onValueChange", "Provider", "tag", "isWeb", "type", "themeShallow", "Stack", "flex", "children", "disableTheme", "withStaticProperties"]
6
6
  }
@@ -22,7 +22,7 @@ var import_createSwitch = require("./createSwitch"), import_Switch = require("./
22
22
  __reExport(src_exports, require("./createSwitch"), module.exports);
23
23
  __reExport(src_exports, require("./StyledContext"), module.exports);
24
24
  __reExport(src_exports, require("./Switch"), module.exports);
25
- const Switch = (0, import_createSwitch.createSwitch)({
25
+ var Switch = (0, import_createSwitch.createSwitch)({
26
26
  Frame: import_Switch.SwitchFrame,
27
27
  Thumb: import_Switch.SwitchThumb
28
28
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B,2BAC7B,gBAAyC;AAEzC,wBAAc,2BAHd;AAIA,wBAAc,4BAJd;AAKA,wBAAc,qBALd;AAOO,MAAM,aAAS,kCAAa;AAAA,EACjC,OAAO;AAAA,EACP,OAAO;AACT,CAAC;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/switch/src/index.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;;;;;0BAA6B,2BAC7B,gBAAyC;AAEzC,wBAAc,2BAHd;AAIA,wBAAc,4BAJd;AAKA,wBAAc,qBALd;AAOO,IAAMA,aAASC,kCAAa;EACjCC,OAAOC;EACPC,OAAOC;AACT,CAAA;",
5
+ "names": ["Switch", "createSwitch", "Frame", "SwitchFrame", "Thumb", "SwitchThumb"]
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { createStyledContext } from "@tamagui/core";
2
- const SwitchStyledContext = createStyledContext({
2
+ var SwitchStyledContext = createStyledContext({
3
3
  size: void 0,
4
4
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
5
5
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/StyledContext.tsx"],
4
- "mappings": "AACA,SAAS,2BAA2B;AAE7B,MAAM,sBAAsB,oBAGhC;AAAA,EACD,MAAM;AAAA,EACN,UAAU,QAAQ,IAAI,qBAAqB;AAC7C,CAAC;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/switch/src/StyledContext.tsx"],
4
+ "mappings": "AACA,SAASA,2BAA2B;AAE7B,IAAMC,sBAAsBD,oBAGhC;EACDE,MAAMC;EACNC,UAAUC,QAAQC,IAAIC,qBAAqB;AAC7C,CAAA;",
5
+ "names": ["createStyledContext", "SwitchStyledContext", "size", "undefined", "unstyled", "process", "env", "TAMAGUI_HEADLESS"]
6
6
  }
@@ -2,7 +2,7 @@ import { getVariableValue, styled } from "@tamagui/core";
2
2
  import { getSize } from "@tamagui/get-token";
3
3
  import { ThemeableStack, YStack } from "@tamagui/stacks";
4
4
  import { SwitchStyledContext } from "./StyledContext";
5
- const SwitchThumb = styled(ThemeableStack, {
5
+ var SwitchThumb = styled(ThemeableStack, {
6
6
  name: "SwitchThumb",
7
7
  context: SwitchStyledContext,
8
8
  variants: {
@@ -17,8 +17,8 @@ const SwitchThumb = styled(ThemeableStack, {
17
17
  true: {}
18
18
  },
19
19
  size: {
20
- "...size": (val) => {
21
- const size = getSwitchHeight(val);
20
+ "...size": function(val) {
21
+ var size = getSwitchHeight(val);
22
22
  return {
23
23
  height: size,
24
24
  width: size
@@ -29,7 +29,11 @@ const SwitchThumb = styled(ThemeableStack, {
29
29
  defaultVariants: {
30
30
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
31
31
  }
32
- }), getSwitchHeight = (val) => Math.round(getVariableValue(getSize(val)) * 0.65), getSwitchWidth = (val) => getSwitchHeight(val) * 2, SwitchFrame = styled(YStack, {
32
+ }), getSwitchHeight = function(val) {
33
+ return Math.round(getVariableValue(getSize(val)) * 0.65);
34
+ }, getSwitchWidth = function(val) {
35
+ return getSwitchHeight(val) * 2;
36
+ }, SwitchFrame = styled(YStack, {
33
37
  name: "Switch",
34
38
  tag: "button",
35
39
  context: SwitchStyledContext,
@@ -51,8 +55,8 @@ const SwitchThumb = styled(ThemeableStack, {
51
55
  true: {}
52
56
  },
53
57
  size: {
54
- "...size": (val) => {
55
- const height = getSwitchHeight(val) + 4, width = getSwitchWidth(val) + 4;
58
+ "...size": function(val) {
59
+ var height = getSwitchHeight(val) + 4, width = getSwitchWidth(val) + 4;
56
60
  return {
57
61
  height,
58
62
  minHeight: height,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/Switch.tsx"],
4
- "mappings": "AACA,SAAS,kBAAkB,cAAc;AACzC,SAAS,eAAe;AACxB,SAAS,gBAAgB,cAAc;A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AAiB;AAAA,IACf,UAAU,QAAQ,IAAI,qBAAqB;AAAA,EAC7C;AACF,CAAC;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/switch/src/Switch.tsx"],
4
+ "mappings": "AACA,SAASA,kBAAkBC,cAAc;AACzC,SAASC,eAAe;AACxB,SAASC,gBAAgBC,cAAc;AAEvC,SAASC,2BAA2B;AAE7B,IAAMC,cAAcL,OAAOE,gBAAgB;EAChDI,MAAM;EACNC,SAASH;EAETI,UAAU;IACRC,UAAU;MACRC,OAAO;QACLC,MAAM;QACNC,iBAAiB;QACjBC,cAAc;MAChB;IACF;IAEAC,SAAS;MACPC,MAAM,CAAC;IACT;IAEAJ,MAAM;MACJ,WAAW,SAACK,KAAAA;AACV,YAAML,OAAOM,gBAAgBD,GAAAA;AAC7B,eAAO;UACLE,QAAQP;UACRQ,OAAOR;QACT;MACF;IACF;EACF;EAEAS,iBAAiB;IACfX,UAAUY,QAAQC,IAAIC,qBAAqB;EAC7C;AACF,CAAA,GAEMN,kBAAkB,SAACD,KAAAA;SACvBQ,KAAKC,MAAM1B,iBAAiBE,QAAQe,GAAAA,CAAAA,IAAQ,IAAA;GAExCU,iBAAiB,SAACV,KAAAA;SAAoBC,gBAAgBD,GAAAA,IAAO;GAEtDW,cAAc3B,OAAOG,QAAQ;EACxCG,MAAM;EACNsB,KAAK;EACLrB,SAASH;EAETI,UAAU;IACRC,UAAU;MACRC,OAAO;QACLG,cAAc;QACdD,iBAAiB;QACjBiB,aAAa;QACbC,aAAa;QAEbC,YAAY;UACVC,cAAc;UACdC,cAAc;UACdC,cAAc;QAChB;MACF;IACF;IAEApB,SAAS;MACPC,MAAM,CAAC;IACT;IAEAJ,MAAM;MACJ,WAAW,SAACK,KAAAA;AACV,YAAME,SAASD,gBAAgBD,GAAAA,IAAO,GAChCG,QAAQO,eAAeV,GAAAA,IAAO;AACpC,eAAO;UACLE;UACAiB,WAAWjB;UACXC;QACF;MACF;IACF;EACF;EAEAC,iBAAiB;IACfX,UAAUY,QAAQC,IAAIC,qBAAqB;EAC7C;AACF,CAAA;",
5
+ "names": ["getVariableValue", "styled", "getSize", "ThemeableStack", "YStack", "SwitchStyledContext", "SwitchThumb", "name", "context", "variants", "unstyled", "false", "size", "backgroundColor", "borderRadius", "checked", "true", "val", "getSwitchHeight", "height", "width", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "Math", "round", "getSwitchWidth", "SwitchFrame", "tag", "borderWidth", "borderColor", "focusStyle", "outlineColor", "outlineStyle", "outlineWidth", "minHeight"]
6
6
  }