@tamagui/switch 2.7.7 → 3.0.0-beta.643.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.
Files changed (97) hide show
  1. package/dist/cjs/StyledContext.cjs +19 -23
  2. package/dist/cjs/StyledContext.native.cjs +33 -0
  3. package/dist/cjs/StyledContext.native.js +19 -22
  4. package/dist/cjs/StyledContext.native.js.map +1 -1
  5. package/dist/cjs/Switch.cjs +140 -86
  6. package/dist/cjs/Switch.native.cjs +163 -0
  7. package/dist/cjs/Switch.native.js +147 -90
  8. package/dist/cjs/Switch.native.js.map +1 -1
  9. package/dist/cjs/index.cjs +14 -25
  10. package/dist/cjs/index.native.cjs +31 -0
  11. package/dist/cjs/index.native.js +15 -25
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/types.cjs +10 -11
  14. package/dist/cjs/types.native.cjs +19 -0
  15. package/dist/cjs/types.native.js +10 -10
  16. package/dist/cjs/types.native.js.map +1 -1
  17. package/dist/cjs/useSwitchNative.cjs +16 -19
  18. package/dist/cjs/useSwitchNative.native.cjs +65 -0
  19. package/dist/cjs/useSwitchNative.native.js +44 -54
  20. package/dist/cjs/useSwitchNative.native.js.map +1 -1
  21. package/dist/esm/StyledContext.mjs +6 -5
  22. package/dist/esm/StyledContext.mjs.map +1 -1
  23. package/dist/esm/StyledContext.native.js +6 -5
  24. package/dist/esm/StyledContext.native.js.map +1 -1
  25. package/dist/esm/Switch.mjs +119 -71
  26. package/dist/esm/Switch.mjs.map +1 -1
  27. package/dist/esm/Switch.native.js +126 -76
  28. package/dist/esm/Switch.native.js.map +1 -1
  29. package/dist/esm/index.js +8 -12
  30. package/dist/esm/index.mjs +8 -12
  31. package/dist/esm/index.native.js +8 -12
  32. package/dist/esm/types.mjs +0 -2
  33. package/dist/esm/types.native.js +0 -2
  34. package/dist/esm/useSwitchNative.mjs +2 -1
  35. package/dist/esm/useSwitchNative.mjs.map +1 -1
  36. package/dist/esm/useSwitchNative.native.js +30 -31
  37. package/dist/esm/useSwitchNative.native.js.map +1 -1
  38. package/dist/jsx/StyledContext.mjs +6 -5
  39. package/dist/jsx/StyledContext.mjs.map +1 -1
  40. package/dist/jsx/StyledContext.native.cjs +33 -0
  41. package/dist/jsx/StyledContext.native.js +19 -22
  42. package/dist/jsx/StyledContext.native.js.map +1 -1
  43. package/dist/jsx/Switch.mjs +119 -71
  44. package/dist/jsx/Switch.mjs.map +1 -1
  45. package/dist/jsx/Switch.native.cjs +163 -0
  46. package/dist/jsx/Switch.native.js +147 -90
  47. package/dist/jsx/Switch.native.js.map +1 -1
  48. package/dist/jsx/index.js +8 -12
  49. package/dist/jsx/index.mjs +8 -12
  50. package/dist/jsx/index.native.cjs +31 -0
  51. package/dist/jsx/index.native.js +15 -25
  52. package/dist/jsx/index.native.js.map +1 -1
  53. package/dist/jsx/types.mjs +0 -2
  54. package/dist/jsx/types.native.cjs +19 -0
  55. package/dist/jsx/types.native.js +10 -10
  56. package/dist/jsx/types.native.js.map +1 -1
  57. package/dist/jsx/useSwitchNative.mjs +2 -1
  58. package/dist/jsx/useSwitchNative.mjs.map +1 -1
  59. package/dist/jsx/useSwitchNative.native.cjs +65 -0
  60. package/dist/jsx/useSwitchNative.native.js +44 -54
  61. package/dist/jsx/useSwitchNative.native.js.map +1 -1
  62. package/package.json +7 -14
  63. package/src/StyledContext.tsx +1 -3
  64. package/src/Switch.tsx +190 -89
  65. package/src/index.ts +0 -20
  66. package/src/types.ts +3 -5
  67. package/types/StyledContext.d.ts +2 -3
  68. package/types/StyledContext.d.ts.map +1 -1
  69. package/types/Switch.d.ts +209 -37
  70. package/types/Switch.d.ts.map +1 -1
  71. package/types/index.d.ts +0 -146
  72. package/types/index.d.ts.map +1 -1
  73. package/types/types.d.ts +3 -4
  74. package/types/types.d.ts.map +1 -1
  75. package/dist/cjs/createSwitch.cjs +0 -186
  76. package/dist/cjs/createSwitch.native.js +0 -194
  77. package/dist/cjs/createSwitch.native.js.map +0 -1
  78. package/dist/esm/createSwitch.mjs +0 -150
  79. package/dist/esm/createSwitch.mjs.map +0 -1
  80. package/dist/esm/createSwitch.native.js +0 -155
  81. package/dist/esm/createSwitch.native.js.map +0 -1
  82. package/dist/esm/index.js.map +0 -1
  83. package/dist/esm/index.mjs.map +0 -1
  84. package/dist/esm/index.native.js.map +0 -1
  85. package/dist/esm/types.mjs.map +0 -1
  86. package/dist/esm/types.native.js.map +0 -1
  87. package/dist/jsx/createSwitch.mjs +0 -150
  88. package/dist/jsx/createSwitch.mjs.map +0 -1
  89. package/dist/jsx/createSwitch.native.js +0 -194
  90. package/dist/jsx/createSwitch.native.js.map +0 -1
  91. package/dist/jsx/index.js.map +0 -1
  92. package/dist/jsx/index.mjs.map +0 -1
  93. package/dist/jsx/types.mjs.map +0 -1
  94. package/src/Switch.draggable-tmp +0 -340
  95. package/src/createSwitch.tsx +0 -201
  96. package/types/createSwitch.d.ts +0 -141
  97. package/types/createSwitch.d.ts.map +0 -1
@@ -1,79 +1,129 @@
1
- import { getVariableValue, styled } from "@tamagui/core";
2
- import { getSize } from "@tamagui/get-token";
3
- import { YStack } from "@tamagui/stacks";
4
- var SwitchThumb = styled(YStack, {
5
- name: "SwitchThumb",
6
- variants: {
7
- unstyled: {
8
- false: {
9
- size: "$true",
10
- backgroundColor: "$background",
11
- borderRadius: 1e3
12
- }
13
- },
14
- size: {
15
- "...size": function (val) {
16
- var size = getSwitchHeight(val);
17
- return {
18
- height: size,
19
- width: size
20
- };
21
- }
22
- }
23
- },
24
- defaultVariants: {
25
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
26
- }
27
- }, {
28
- accept: {
29
- activeStyle: "style"
30
- }
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Theme, View, composeEventHandlers, createStyledHOC, getVariableValue, isWeb, styled, withStaticProperties } from "@tamagui/core";
3
+ import { useSwitch } from "@tamagui/switch-headless";
4
+ import { useControllableState } from "@tamagui/use-controllable-state";
5
+ import * as React from "react";
6
+ import { SwitchStyledContext } from "./StyledContext.native.js";
7
+ import { useSwitchNative } from "./useSwitchNative.native.js";
8
+
9
+ var SwitchThumbFrame = styled(View, {
10
+ displayName: "SwitchThumb",
11
+ context: SwitchStyledContext
31
12
  });
32
- var getSwitchHeight = function (val) {
33
- return Math.round(getVariableValue(getSize(val)) * 0.65);
34
- };
35
- var getSwitchWidth = function (val) {
36
- return getSwitchHeight(val) * 2;
37
- };
38
- var SwitchFrame = styled(YStack, {
39
- name: "Switch",
40
- render: "button",
41
- tabIndex: 0,
42
- variants: {
43
- unstyled: {
44
- false: {
45
- borderRadius: 1e3,
46
- backgroundColor: "$background",
47
- focusVisibleStyle: {
48
- outlineColor: "$outlineColor",
49
- outlineStyle: "solid",
50
- outlineWidth: 2
51
- }
52
- }
53
- },
54
- size: {
55
- "...size": function (val, param) {
56
- var {
57
- props
58
- } = param;
59
- if (props["unstyled"]) return;
60
- var height = getSwitchHeight(val);
61
- var width = getSwitchWidth(val);
62
- return {
63
- height,
64
- minHeight: height,
65
- width
66
- };
67
- }
68
- }
69
- },
70
- defaultVariants: {
71
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
72
- }
73
- }, {
74
- accept: {
75
- activeStyle: "style"
76
- }
13
+ var SwitchFrame = styled(View, {
14
+ displayName: "Switch",
15
+ context: SwitchStyledContext,
16
+ render: "button",
17
+ tabIndex: 0
77
18
  });
78
- export { SwitchFrame, SwitchThumb };
19
+ function createSwitch(createProps) {
20
+ var _createProps_Frame;
21
+ var Frame = (_createProps_Frame = createProps.Frame) !== null && _createProps_Frame !== void 0 ? _createProps_Frame : SwitchFrame;
22
+ var _createProps_Thumb;
23
+ var Thumb = (_createProps_Thumb = createProps.Thumb) !== null && _createProps_Thumb !== void 0 ? _createProps_Thumb : SwitchThumbFrame;
24
+ Frame.staticConfig.context = SwitchStyledContext;
25
+ Thumb.staticConfig.context = SwitchStyledContext;
26
+ var SwitchThumbComponent = createStyledHOC(Thumb, function SwitchThumb2(props, forwardedRef) {
27
+ var _createProps_componentThemes;
28
+ var { size: sizeProp, activeStyle, theme, ...thumbProps } = props;
29
+ var styledContext = SwitchStyledContext.useStyledContext();
30
+ var { size: sizeContext, active, disabled, frameWidth = 0 } = styledContext;
31
+ var _ref;
32
+ var size = (_ref = sizeProp !== null && sizeProp !== void 0 ? sizeProp : sizeContext) !== null && _ref !== void 0 ? _ref : true;
33
+ var initialChecked = React.useRef(active).current;
34
+ var initialWidth = getVariableValue(props.width, "size");
35
+ var [thumbWidth, setThumbWidth] = React.useState(typeof initialWidth === "number" ? initialWidth : 0);
36
+ var distance = frameWidth - thumbWidth;
37
+ var x = initialChecked ? active ? 0 : -distance : active ? distance : 0;
38
+ var thumb = /* @__PURE__ */ jsx(Thumb, {
39
+ ref: forwardedRef,
40
+ size,
41
+ alignSelf: initialChecked ? "flex-end" : "flex-start",
42
+ x,
43
+ onLayout: composeEventHandlers(props.onLayout, function(event) {
44
+ setThumbWidth(event.nativeEvent.layout.width);
45
+ }),
46
+ disabled,
47
+ ...thumbProps,
48
+ ...active && activeStyle
49
+ });
50
+ var themeName = theme !== null && theme !== void 0 ? theme : (_createProps_componentThemes = createProps.componentThemes) === null || _createProps_componentThemes === void 0 ? void 0 : _createProps_componentThemes.thumb;
51
+ return themeName ? /* @__PURE__ */ jsx(Theme, {
52
+ name: themeName,
53
+ children: thumb
54
+ }) : thumb;
55
+ });
56
+ var SwitchComponent = createStyledHOC(Frame, function Switch2(_props, forwardedRef) {
57
+ var _createProps_componentThemes;
58
+ var { native, nativeProps, checked: checkedProp, defaultChecked, onCheckedChange, activeStyle, activeTheme, theme, ...props } = _props;
59
+ var [checked, setChecked] = useControllableState({
60
+ prop: checkedProp,
61
+ defaultProp: defaultChecked || false,
62
+ onChange: onCheckedChange,
63
+ transition: true
64
+ });
65
+ var styledContext = React.useContext(SwitchStyledContext.context);
66
+ var [frameWidth, setFrameInnerWidth] = React.useState(0);
67
+ var { switchProps, bubbleInput, switchRef } = useSwitch(props, [checked, setChecked], forwardedRef);
68
+ var nativeSwitch = useSwitchNative({
69
+ id: props.id,
70
+ disabled: props.disabled,
71
+ native,
72
+ nativeProps,
73
+ checked,
74
+ setChecked
75
+ });
76
+ if (nativeSwitch) {
77
+ return nativeSwitch;
78
+ }
79
+ var disabled = props.disabled;
80
+ var _styledContext_size, _ref;
81
+ var size = (_ref = (_styledContext_size = styledContext.size) !== null && _styledContext_size !== void 0 ? _styledContext_size : props.size) !== null && _ref !== void 0 ? _ref : true;
82
+ var handleLayout = function(event) {
83
+ var next = event.nativeEvent.layout.width;
84
+ if (next !== frameWidth) {
85
+ setFrameInnerWidth(next);
86
+ }
87
+ };
88
+ var frame = /* @__PURE__ */ jsx(Frame, {
89
+ ref: switchRef,
90
+ render: "button",
91
+ ...isWeb && { type: "button" },
92
+ size,
93
+ ...props,
94
+ ...switchProps,
95
+ disabled,
96
+ ...checked && activeStyle,
97
+ children: /* @__PURE__ */ jsx(View, {
98
+ alignSelf: "stretch",
99
+ flex: 1,
100
+ onLayout: handleLayout,
101
+ children: props.children
102
+ })
103
+ });
104
+ var _ref1, _ref2;
105
+ var frameTheme = (_ref2 = (_ref1 = checked ? activeTheme : void 0) !== null && _ref1 !== void 0 ? _ref1 : theme) !== null && _ref2 !== void 0 ? _ref2 : (_createProps_componentThemes = createProps.componentThemes) === null || _createProps_componentThemes === void 0 ? void 0 : _createProps_componentThemes.frame;
106
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SwitchStyledContext.Provider, {
107
+ size,
108
+ active: checked,
109
+ disabled,
110
+ frameWidth,
111
+ children: frameTheme ? /* @__PURE__ */ jsx(Theme, {
112
+ name: frameTheme,
113
+ children: frame
114
+ }) : frame
115
+ }), bubbleInput] });
116
+ }, { disableTheme: true });
117
+ return withStaticProperties(SwitchComponent, {
118
+ Frame,
119
+ Thumb: SwitchThumbComponent
120
+ });
121
+ }
122
+ var Switch = createSwitch({
123
+ Frame: SwitchFrame,
124
+ Thumb: SwitchThumbFrame
125
+ });
126
+ var SwitchThumb = Switch.Thumb;
127
+
128
+ export { Switch, SwitchFrame, SwitchThumb, SwitchThumbFrame, createSwitch };
79
129
  //# sourceMappingURL=Switch.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getVariableValue","styled","getSize","YStack","SwitchThumb","name","variants","unstyled","false","size","backgroundColor","borderRadius","...size","val","getSwitchHeight","height","width","defaultVariants","process","env","TAMAGUI_HEADLESS","accept","activeStyle","Math","round","getSwitchWidth","SwitchFrame","render","tabIndex","focusVisibleStyle","outlineColor","outlineStyle","outlineWidth","param","props","minHeight"],"sources":["../../src/Switch.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,gBAAA,EAAkBC,MAAA,QAAc;AACzC,SAASC,OAAA,QAAe;AACxB,SAASC,MAAA,QAAc;AAEhB,IAAAC,WAAM,GAAAH,MAAc,CAAAE,MAAA;EACzBE,IAAA;EACAC,QAAA;IACEC,QAAM;MAENC,KAAA;QACEC,IAAA,SAAU;QACRC,eAAO;QAAAC,YACC;MAAA;IACW;IACHF,IAChB;MACF,oBAAAG,CAAAC,GAAA;QAEA,IAAMJ,IAAA,GAAAK,eAAA,CAAAD,GAAA;QACJ;UACEE,MAAM,EAAAN,IAAA;UACNO,KAAA,EAAOP;QAAA;MACG;IACD;EACT;EACFQ,eACF;IACFV,QAAA,EAAAW,OAAA,CAAAC,GAAA,CAAAC,gBAAA;EAAA;AAEiB;EAC4BC,MAC7C;IACFC,WAAA;EACA;AAAA;AACU,IAAAR,eACO,YAAAA,CAAAD,GAAA;EAAA,OACfU,IAAA,CAAAC,KAAA,CAAAxB,gBAAA,CAAAE,OAAA,CAAAW,GAAA;AAAA;AAEJ,IAAAY,cAAA,YAAAA,CAAAZ,GAAA;EAEA,OAAMC,eAAkB,CAACD,GAAA,KACvB;AAEF;AAEO,IAAAa,WAAM,GAAAzB,MAAc,CAAAE,MAAA;EACzBE,IAAA;EACAsB,MAAA;EAAAC,QACQ;EAAAtB,QACN,EAAQ;IACRC,QAAA,EAAU;MAEVC,KAAA;QACEG,YAAU;QACRD,eAAO;QAAAmB,iBACS;UACdC,YAAA,iBAAiB;UAEjBC,YAAA,SAAmB;UAAAC,YACjB;QAAc;MACA;IACA;IAChBvB,IACF;MACF,oBAAAG,CAAAC,GAAA,EAAAoB,KAAA;QAEA,IAAM;UAAAC;QAAA,IAAAD,KAAA;QACJ,IAAAC,KAAA,WAAmB;QACjB,IAAAnB,MAAI,GAAMD,eAAa,CAAAD,GAAA;QACvB,IAAAG,KAAM,GAAAS,cAAS,CAAAZ,GAAA;QACf;UACAE,MAAA;UAAOoB,SACL,EAAApB,MAAA;UAAAC;QACW;MACX;IACF;EACF;EACFC,eACF;IAEAV,QAAA,EAAAW,OAAiB,CAAAC,GAAA,CAAAC,gBAAA;EAAA;AAC4B;EAE/CC,MAAA;IACAC,WAAA;EAAA;AACU;AACO,SAEjBI,WAAA,EACFtB,WAAA","ignoreList":[]}
1
+ {"version":3,"file":"Switch.native.js","names":["_Fragment"],"sources":["esm/Switch.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { composeEventHandlers, createStyledHOC, getVariableValue, isWeb, styled, Theme, View, withStaticProperties } from \"@tamagui/core\";\nimport { useSwitch } from \"@tamagui/switch-headless\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { SwitchStyledContext } from \"./StyledContext\";\nimport { useSwitchNative } from \"./useSwitchNative\";\nvar SwitchThumbFrame = styled(View, {\n displayName: \"SwitchThumb\",\n context: SwitchStyledContext\n});\nvar SwitchFrame = styled(View, {\n displayName: \"Switch\",\n context: SwitchStyledContext,\n render: \"button\",\n tabIndex: 0\n});\nfunction createSwitch(createProps) {\n var _createProps_Frame;\n var Frame = (_createProps_Frame = createProps.Frame) !== null && _createProps_Frame !== void 0 ? _createProps_Frame : SwitchFrame;\n var _createProps_Thumb;\n var Thumb = (_createProps_Thumb = createProps.Thumb) !== null && _createProps_Thumb !== void 0 ? _createProps_Thumb : SwitchThumbFrame;\n Frame.staticConfig.context = SwitchStyledContext;\n Thumb.staticConfig.context = SwitchStyledContext;\n var SwitchThumbComponent = createStyledHOC(Thumb, function SwitchThumb2(props, forwardedRef) {\n var _createProps_componentThemes;\n var { size: sizeProp, activeStyle, theme, ...thumbProps } = props;\n var styledContext = SwitchStyledContext.useStyledContext();\n var { size: sizeContext, active, disabled, frameWidth = 0 } = styledContext;\n var _ref;\n var size = (_ref = sizeProp !== null && sizeProp !== void 0 ? sizeProp : sizeContext) !== null && _ref !== void 0 ? _ref : true;\n var initialChecked = React.useRef(active).current;\n var initialWidth = getVariableValue(props.width, \"size\");\n var [thumbWidth, setThumbWidth] = React.useState(typeof initialWidth === \"number\" ? initialWidth : 0);\n var distance = frameWidth - thumbWidth;\n var x = initialChecked ? active ? 0 : -distance : active ? distance : 0;\n var thumb = /* @__PURE__ */ _jsx(Thumb, {\n ref: forwardedRef,\n size,\n alignSelf: initialChecked ? \"flex-end\" : \"flex-start\",\n x,\n onLayout: composeEventHandlers(props.onLayout, function(event) {\n setThumbWidth(event.nativeEvent.layout.width);\n }),\n disabled,\n ...thumbProps,\n ...active && activeStyle\n });\n var themeName = theme !== null && theme !== void 0 ? theme : (_createProps_componentThemes = createProps.componentThemes) === null || _createProps_componentThemes === void 0 ? void 0 : _createProps_componentThemes.thumb;\n return themeName ? /* @__PURE__ */ _jsx(Theme, {\n name: themeName,\n children: thumb\n }) : thumb;\n });\n var SwitchComponent = createStyledHOC(Frame, function Switch2(_props, forwardedRef) {\n var _createProps_componentThemes;\n var { native, nativeProps, checked: checkedProp, defaultChecked, onCheckedChange, activeStyle, activeTheme, theme, ...props } = _props;\n var [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked || false,\n onChange: onCheckedChange,\n transition: true\n });\n var styledContext = React.useContext(SwitchStyledContext.context);\n var [frameWidth, setFrameInnerWidth] = React.useState(0);\n var { switchProps, bubbleInput, switchRef } = useSwitch(\n props,\n [\n checked,\n setChecked\n ],\n // @ts-ignore TODO tamagui react 19 type error\n forwardedRef\n );\n var nativeSwitch = useSwitchNative({\n id: props.id,\n disabled: props.disabled,\n native,\n nativeProps,\n checked,\n setChecked\n });\n if (nativeSwitch) {\n return nativeSwitch;\n }\n var disabled = props.disabled;\n var _styledContext_size, _ref;\n var size = (_ref = (_styledContext_size = styledContext.size) !== null && _styledContext_size !== void 0 ? _styledContext_size : props.size) !== null && _ref !== void 0 ? _ref : true;\n var handleLayout = function(event) {\n var next = event.nativeEvent.layout.width;\n if (next !== frameWidth) {\n setFrameInnerWidth(next);\n }\n };\n var frame = /* @__PURE__ */ _jsx(Frame, {\n ref: switchRef,\n render: \"button\",\n ...isWeb && {\n type: \"button\"\n },\n size,\n ...props,\n ...switchProps,\n disabled,\n ...checked && activeStyle,\n children: /* @__PURE__ */ _jsx(View, {\n alignSelf: \"stretch\",\n flex: 1,\n onLayout: handleLayout,\n children: props.children\n })\n });\n var _ref1, _ref2;\n var frameTheme = (_ref2 = (_ref1 = checked ? activeTheme : void 0) !== null && _ref1 !== void 0 ? _ref1 : theme) !== null && _ref2 !== void 0 ? _ref2 : (_createProps_componentThemes = createProps.componentThemes) === null || _createProps_componentThemes === void 0 ? void 0 : _createProps_componentThemes.frame;\n return /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(SwitchStyledContext.Provider, {\n size,\n active: checked,\n disabled,\n frameWidth,\n children: frameTheme ? /* @__PURE__ */ _jsx(Theme, {\n name: frameTheme,\n children: frame\n }) : frame\n }),\n bubbleInput\n ]\n });\n }, {\n disableTheme: true\n });\n return withStaticProperties(SwitchComponent, {\n Frame,\n Thumb: SwitchThumbComponent\n });\n}\nvar Switch = createSwitch({\n Frame: SwitchFrame,\n Thumb: SwitchThumbFrame\n});\nvar SwitchThumb = Switch.Thumb;\nexport {\n Switch,\n SwitchFrame,\n SwitchThumb,\n SwitchThumbFrame,\n createSwitch\n};\n//# sourceMappingURL=Switch.js.map\n"],"mappings":"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"}
package/dist/esm/index.js CHANGED
@@ -1,13 +1,9 @@
1
- import { createSwitch } from "./createSwitch.mjs";
2
- import { SwitchFrame, SwitchThumb } from "./Switch.mjs";
3
- export * from "./createSwitch.mjs";
4
- export * from "./StyledContext.mjs";
5
- export * from "./Switch.mjs";
6
- export * from "./types.mjs";
7
1
  import { useSwitchNative } from "./useSwitchNative.mjs";
8
- const Switch = createSwitch({
9
- Frame: SwitchFrame,
10
- Thumb: SwitchThumb
11
- });
12
- export { Switch, useSwitchNative };
13
- //# sourceMappingURL=index.js.map
2
+
3
+ export * from "./StyledContext.mjs"
4
+
5
+ export * from "./Switch.mjs"
6
+
7
+ export * from "./types.mjs"
8
+
9
+ export { useSwitchNative };
@@ -1,13 +1,9 @@
1
- import { createSwitch } from "./createSwitch.mjs";
2
- import { SwitchFrame, SwitchThumb } from "./Switch.mjs";
3
- export * from "./createSwitch.mjs";
4
- export * from "./StyledContext.mjs";
5
- export * from "./Switch.mjs";
6
- export * from "./types.mjs";
7
1
  import { useSwitchNative } from "./useSwitchNative.mjs";
8
- const Switch = createSwitch({
9
- Frame: SwitchFrame,
10
- Thumb: SwitchThumb
11
- });
12
- export { Switch, useSwitchNative };
13
- //# sourceMappingURL=index.mjs.map
2
+
3
+ export * from "./StyledContext.mjs"
4
+
5
+ export * from "./Switch.mjs"
6
+
7
+ export * from "./types.mjs"
8
+
9
+ export { useSwitchNative };
@@ -1,13 +1,9 @@
1
- import { createSwitch } from "./createSwitch.native.js";
2
- import { SwitchFrame, SwitchThumb } from "./Switch.native.js";
3
- export * from "./createSwitch.native.js";
4
- export * from "./StyledContext.native.js";
5
- export * from "./Switch.native.js";
6
- export * from "./types.native.js";
7
1
  import { useSwitchNative } from "./useSwitchNative.native.js";
8
- var Switch = createSwitch({
9
- Frame: SwitchFrame,
10
- Thumb: SwitchThumb
11
- });
12
- export { Switch, useSwitchNative };
13
- //# sourceMappingURL=index.native.js.map
2
+
3
+ export * from "./StyledContext.native.js"
4
+
5
+ export * from "./Switch.native.js"
6
+
7
+ export * from "./types.native.js"
8
+
9
+ export { useSwitchNative };
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.mjs.map
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.native.js.map
@@ -1,5 +1,6 @@
1
1
  function useSwitchNative(_props) {
2
- return null;
2
+ return null;
3
3
  }
4
+
4
5
  export { useSwitchNative };
5
6
  //# sourceMappingURL=useSwitchNative.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSwitchNative","_props"],"sources":["../../src/useSwitchNative.tsx"],"sourcesContent":[null],"mappings":"AAKO,SAASA,gBAAgBC,MAAA,EAAsD;EACpF,OAAO;AACT","ignoreList":[]}
1
+ {"version":3,"file":"useSwitchNative.js","names":[],"sources":["esm/useSwitchNative.js"],"sourcesContent":["function useSwitchNative(_props) {\n return null;\n}\nexport {\n useSwitchNative\n};\n//# sourceMappingURL=useSwitchNative.js.map\n"],"mappings":";AAAA,SAAS,gBAAgB,QAAQ;CAC/B,OAAO;AACT"}
@@ -1,38 +1,37 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { shouldRenderNativePlatform } from "@tamagui/core";
3
3
  import { registerFocusable } from "@tamagui/focusable";
4
4
  import * as React from "react";
5
- import { Switch as NativeSwitch } from "react-native";
5
+ import { Switch } from "react-native";
6
+
6
7
  function useSwitchNative(props) {
7
- var {
8
- id,
9
- disabled,
10
- native,
11
- nativeProps,
12
- checked,
13
- setChecked
14
- } = props;
15
- React.useEffect(function () {
16
- if (!id) return;
17
- if (disabled) return;
18
- return registerFocusable(id, {
19
- focusAndSelect: function () {
20
- setChecked(function (value) {
21
- return !value;
22
- });
23
- },
24
- focus: function () {}
25
- });
26
- }, [id, disabled, setChecked]);
27
- var renderNative = shouldRenderNativePlatform(native);
28
- if (renderNative === "android" || renderNative === "ios") {
29
- return /* @__PURE__ */_jsx(NativeSwitch, {
30
- value: checked,
31
- onValueChange: setChecked,
32
- ...nativeProps
33
- });
34
- }
35
- return null;
8
+ var { id, disabled, native, nativeProps, checked, setChecked } = props;
9
+ React.useEffect(function() {
10
+ if (!id) return;
11
+ if (disabled) return;
12
+ return registerFocusable(id, {
13
+ focusAndSelect: function() {
14
+ setChecked(function(value) {
15
+ return !value;
16
+ });
17
+ },
18
+ focus: function() {}
19
+ });
20
+ }, [
21
+ id,
22
+ disabled,
23
+ setChecked
24
+ ]);
25
+ var renderNative = shouldRenderNativePlatform(native);
26
+ if (renderNative === "android" || renderNative === "ios") {
27
+ return /* @__PURE__ */ jsx(Switch, {
28
+ value: checked,
29
+ onValueChange: setChecked,
30
+ ...nativeProps
31
+ });
32
+ }
33
+ return null;
36
34
  }
35
+
37
36
  export { useSwitchNative };
38
37
  //# sourceMappingURL=useSwitchNative.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["jsx","_jsx","shouldRenderNativePlatform","registerFocusable","React","Switch","NativeSwitch","useSwitchNative","props","id","disabled","native","nativeProps","checked","setChecked","useEffect","focusAndSelect","value","focus","renderNative","onValueChange"],"sources":["../../src/useSwitchNative.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAOC,IAAA,QAAY;AAC5B,SAASC,0BAAA,QAAkC;AAC3C,SAASC,iBAAA,QAAyB;AAClC,YAAYC,KAAA,MAAW;AACvB,SAASC,MAAA,IAAUC,YAAA,QAAoB;AAG5B,SAASC,gBAAgBC,KAAA,EAAO;EACvC,IAAI;IAAEC,EAAA;IAAIC,QAAA;IAAUC,MAAA;IAAQC,WAAA;IAAaC,OAAA;IAASC;EAAW,IAAIN,KAAA;EACjEJ,KAAA,CAAMW,SAAA,CAAU,YAAW;IACvB,IAAI,CAACN,EAAA,EAAI;IACT,IAAIC,QAAA,EAAU;IACd,OAAOP,iBAAA,CAAkBM,EAAA,EAAI;MACzBO,cAAA,EAAgB,SAAAA,CAAA,EAAW;QACvBF,UAAA,CAAW,UAASG,KAAA,EAAO;UACvB,OAAO,CAACA,KAAA;QACZ,CAAC;MACL;MACAC,KAAA,EAAO,SAAAA,CAAA,EAAW,CAAC;IACvB,CAAC;EACL,GAAG,CACCT,EAAA,EACAC,QAAA,EACAI,UAAA,CACH;EACD,IAAIK,YAAA,GAAejB,0BAAA,CAA2BS,MAAM;EACpD,IAAIQ,YAAA,KAAiB,aAAaA,YAAA,KAAiB,OAAO;IACtD,OAAqB,eAAAlB,IAAA,CAAKK,YAAA,EAAc;MACpCW,KAAA,EAAOJ,OAAA;MACPO,aAAA,EAAeN,UAAA;MACf,GAAGF;IACP,CAAC;EACL;EACA,OAAO;AACX","ignoreList":[]}
1
+ {"version":3,"file":"useSwitchNative.native.js","names":["NativeSwitch"],"sources":["esm/useSwitchNative.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { shouldRenderNativePlatform } from \"@tamagui/core\";\nimport { registerFocusable } from \"@tamagui/focusable\";\nimport * as React from \"react\";\nimport { Switch as NativeSwitch } from \"react-native\";\nfunction useSwitchNative(props) {\n var { id, disabled, native, nativeProps, checked, setChecked } = props;\n React.useEffect(function() {\n if (!id) return;\n if (disabled) return;\n return registerFocusable(id, {\n focusAndSelect: function() {\n setChecked(function(value) {\n return !value;\n });\n },\n focus: function() {\n }\n });\n }, [\n id,\n disabled,\n setChecked\n ]);\n var renderNative = shouldRenderNativePlatform(native);\n if (renderNative === \"android\" || renderNative === \"ios\") {\n return /* @__PURE__ */ _jsx(NativeSwitch, {\n value: checked,\n onValueChange: setChecked,\n ...nativeProps\n });\n }\n return null;\n}\nexport {\n useSwitchNative\n};\n//# sourceMappingURL=useSwitchNative.native.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,gBAAgB,OAAO;CAC9B,IAAI,EAAE,IAAI,UAAU,QAAQ,aAAa,SAAS,eAAe;CACjE,MAAM,UAAU,WAAW;EACzB,IAAI,CAAC,IAAI;EACT,IAAI,UAAU;EACd,OAAO,kBAAkB,IAAI;GAC3B,gBAAgB,WAAW;IACzB,WAAW,SAAS,OAAO;KACzB,OAAO,CAAC;IACV,CAAC;GACH;GACA,OAAO,WAAW,CAClB;EACF,CAAC;CACH,GAAG;EACD;EACA;EACA;CACF,CAAC;CACD,IAAI,eAAe,2BAA2B,MAAM;CACpD,IAAI,iBAAiB,aAAa,iBAAiB,OAAO;EACxD,OAAuB,oBAAKA,QAAc;GACxC,OAAO;GACP,eAAe;GACf,GAAG;EACL,CAAC;CACH;CACA,OAAO;AACT"}
@@ -1,10 +1,11 @@
1
1
  import { createStyledContext } from "@tamagui/core";
2
+
2
3
  const SwitchStyledContext = createStyledContext({
3
- active: false,
4
- disabled: false,
5
- frameWidth: void 0,
6
- size: void 0,
7
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
4
+ active: false,
5
+ disabled: false,
6
+ frameWidth: void 0,
7
+ size: void 0
8
8
  });
9
+
9
10
  export { SwitchStyledContext };
10
11
  //# sourceMappingURL=StyledContext.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["createStyledContext","SwitchStyledContext","active","disabled","frameWidth","size","unstyled","process","env","TAMAGUI_HEADLESS"],"sources":["../../src/StyledContext.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,mBAAA,QAA2B;AAE7B,MAAMC,mBAAA,GAAsBD,mBAAA,CAMhC;EACDE,MAAA,EAAQ;EACRC,QAAA,EAAU;EACVC,UAAA,EAAY;EACZC,IAAA,EAAM;EACNC,QAAA,EAAUC,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;AAC7C,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"StyledContext.js","names":[],"sources":["jsx/StyledContext.js"],"sourcesContent":["import { createStyledContext } from \"@tamagui/core\";\nconst SwitchStyledContext = createStyledContext({\n active: false,\n disabled: false,\n frameWidth: void 0,\n size: void 0\n});\nexport {\n SwitchStyledContext\n};\n//# sourceMappingURL=StyledContext.js.map\n"],"mappings":";;;AACA,MAAM,sBAAsB,oBAAoB;CAC9C,QAAQ;CACR,UAAU;CACV,YAAY,KAAK;CACjB,MAAM,KAAK;AACb,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var StyledContext_exports = {};
25
+ __export(StyledContext_exports, { SwitchStyledContext: () => SwitchStyledContext });
26
+ module.exports = __toCommonJS(StyledContext_exports);
27
+ var import_core = require("@tamagui/core");
28
+ var SwitchStyledContext = (0, import_core.createStyledContext)({
29
+ active: false,
30
+ disabled: false,
31
+ frameWidth: void 0,
32
+ size: void 0
33
+ });
@@ -1,38 +1,35 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var StyledContext_exports = {};
26
- __export(StyledContext_exports, {
27
- SwitchStyledContext: () => SwitchStyledContext
28
- });
25
+ __export(StyledContext_exports, { SwitchStyledContext: () => SwitchStyledContext });
29
26
  module.exports = __toCommonJS(StyledContext_exports);
30
27
  var import_core = require("@tamagui/core");
31
28
  var SwitchStyledContext = (0, import_core.createStyledContext)({
32
- active: false,
33
- disabled: false,
34
- frameWidth: void 0,
35
- size: void 0,
36
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
29
+ active: false,
30
+ disabled: false,
31
+ frameWidth: void 0,
32
+ size: void 0
37
33
  });
34
+
38
35
  //# sourceMappingURL=StyledContext.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable"],"sources":["../../src/StyledContext.tsx"],"sourcesContent":[null],"mappings":"AACA,YAAS;;AAEF,IAAAA,SAAM,GAAAC,MAAA,CAAAC,cAAsB;AAMhC,IACDC,gBAAQ,GAAAF,MAAA,CAAAG,wBAAA;AAAA,IACRC,iBAAU,GAAAJ,MAAA,CAAAK,mBAAA;AAAA,IACVC,YAAY,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IACZC,QAAM,GAAAA,CAAAC,MAAA,EAAAC,GAAA;EACN,SAAAC,IAAU,IAAAD,GAAQ,EACnBZ,SAAA,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA","ignoreList":[]}
1
+ {"version":3,"file":"StyledContext.native.js","names":[],"sources":["jsx/StyledContext.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar StyledContext_exports = {};\n__export(StyledContext_exports, {\n SwitchStyledContext: () => SwitchStyledContext\n});\nmodule.exports = __toCommonJS(StyledContext_exports);\nvar import_core = require(\"@tamagui/core\");\nvar SwitchStyledContext = (0, import_core.createStyledContext)({\n active: false,\n disabled: false,\n frameWidth: void 0,\n size: void 0\n});\n//# sourceMappingURL=StyledContext.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB,EAC9B,2BAA2B,oBAC7B,CAAC;AACD,OAAO,UAAU,aAAa,qBAAqB;AACnD,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,uBAAuB,GAAG,YAAY,qBAAqB;CAC7D,QAAQ;CACR,UAAU;CACV,YAAY,KAAK;CACjB,MAAM,KAAK;AACb,CAAC"}