@tamagui/demos 1.88.4 → 1.88.6

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 (53) hide show
  1. package/package.json +18 -18
  2. package/dist/cjs/CheckboxHeadlessDemo.js +0 -49
  3. package/dist/cjs/CheckboxHeadlessDemo.js.map +0 -6
  4. package/dist/cjs/CheckboxHeadlessDemo.native.js +0 -54
  5. package/dist/cjs/CheckboxHeadlessDemo.native.js.map +0 -6
  6. package/dist/cjs/CheckboxUnstyledDemo.js +0 -52
  7. package/dist/cjs/CheckboxUnstyledDemo.js.map +0 -6
  8. package/dist/cjs/CheckboxUnstyledDemo.native.js +0 -58
  9. package/dist/cjs/CheckboxUnstyledDemo.native.js.map +0 -6
  10. package/dist/cjs/SwitchHeadlessDemo.js +0 -79
  11. package/dist/cjs/SwitchHeadlessDemo.js.map +0 -6
  12. package/dist/cjs/SwitchHeadlessDemo.native.js +0 -84
  13. package/dist/cjs/SwitchHeadlessDemo.native.js.map +0 -6
  14. package/dist/cjs/SwitchUnstyledDemo.js +0 -68
  15. package/dist/cjs/SwitchUnstyledDemo.js.map +0 -6
  16. package/dist/cjs/SwitchUnstyledDemo.native.js +0 -74
  17. package/dist/cjs/SwitchUnstyledDemo.native.js.map +0 -6
  18. package/dist/esm/CheckboxHeadlessDemo.js +0 -40
  19. package/dist/esm/CheckboxHeadlessDemo.js.map +0 -6
  20. package/dist/esm/CheckboxHeadlessDemo.native.js +0 -54
  21. package/dist/esm/CheckboxHeadlessDemo.native.js.map +0 -6
  22. package/dist/esm/CheckboxUnstyledDemo.js +0 -40
  23. package/dist/esm/CheckboxUnstyledDemo.js.map +0 -6
  24. package/dist/esm/CheckboxUnstyledDemo.native.js +0 -58
  25. package/dist/esm/CheckboxUnstyledDemo.native.js.map +0 -6
  26. package/dist/esm/SwitchHeadlessDemo.js +0 -67
  27. package/dist/esm/SwitchHeadlessDemo.js.map +0 -6
  28. package/dist/esm/SwitchHeadlessDemo.native.js +0 -84
  29. package/dist/esm/SwitchHeadlessDemo.native.js.map +0 -6
  30. package/dist/esm/SwitchUnstyledDemo.js +0 -55
  31. package/dist/esm/SwitchUnstyledDemo.js.map +0 -6
  32. package/dist/esm/SwitchUnstyledDemo.native.js +0 -74
  33. package/dist/esm/SwitchUnstyledDemo.native.js.map +0 -6
  34. package/dist/jsx/CheckboxHeadlessDemo.js +0 -40
  35. package/dist/jsx/CheckboxHeadlessDemo.js.map +0 -6
  36. package/dist/jsx/CheckboxHeadlessDemo.native.js +0 -54
  37. package/dist/jsx/CheckboxHeadlessDemo.native.js.map +0 -6
  38. package/dist/jsx/CheckboxUnstyledDemo.js +0 -40
  39. package/dist/jsx/CheckboxUnstyledDemo.js.map +0 -6
  40. package/dist/jsx/CheckboxUnstyledDemo.native.js +0 -58
  41. package/dist/jsx/CheckboxUnstyledDemo.native.js.map +0 -6
  42. package/dist/jsx/SwitchHeadlessDemo.js +0 -67
  43. package/dist/jsx/SwitchHeadlessDemo.js.map +0 -6
  44. package/dist/jsx/SwitchHeadlessDemo.native.js +0 -84
  45. package/dist/jsx/SwitchHeadlessDemo.native.js.map +0 -6
  46. package/dist/jsx/SwitchUnstyledDemo.js +0 -55
  47. package/dist/jsx/SwitchUnstyledDemo.js.map +0 -6
  48. package/dist/jsx/SwitchUnstyledDemo.native.js +0 -74
  49. package/dist/jsx/SwitchUnstyledDemo.native.js.map +0 -6
  50. package/types/CheckboxHeadlessDemo.d.ts.map +0 -1
  51. package/types/CheckboxUnstyledDemo.d.ts.map +0 -1
  52. package/types/SwitchHeadlessDemo.d.ts.map +0 -1
  53. package/types/SwitchUnstyledDemo.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/demos",
3
- "version": "1.88.4",
3
+ "version": "1.88.6",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -40,29 +40,29 @@
40
40
  }
41
41
  },
42
42
  "dependencies": {
43
- "@tamagui/avatar": "1.88.4",
44
- "@tamagui/button": "1.88.4",
45
- "@tamagui/core": "1.88.4",
46
- "@tamagui/list-item": "1.88.4",
47
- "@tamagui/logo": "1.88.4",
48
- "@tamagui/menu": "1.88.4",
49
- "@tamagui/popover": "1.88.4",
50
- "@tamagui/progress": "1.88.4",
51
- "@tamagui/radio-group": "1.88.4",
52
- "@tamagui/select": "1.88.4",
53
- "@tamagui/sheet": "1.88.4",
54
- "@tamagui/site-config": "1.88.4",
55
- "@tamagui/slider": "1.88.4",
56
- "@tamagui/stacks": "1.88.4",
57
- "@tamagui/toast": "1.88.4",
58
- "tamagui": "1.88.4"
43
+ "@tamagui/avatar": "1.88.6",
44
+ "@tamagui/button": "1.88.6",
45
+ "@tamagui/core": "1.88.6",
46
+ "@tamagui/list-item": "1.88.6",
47
+ "@tamagui/logo": "1.88.6",
48
+ "@tamagui/menu": "1.88.6",
49
+ "@tamagui/popover": "1.88.6",
50
+ "@tamagui/progress": "1.88.6",
51
+ "@tamagui/radio-group": "1.88.6",
52
+ "@tamagui/select": "1.88.6",
53
+ "@tamagui/sheet": "1.88.6",
54
+ "@tamagui/site-config": "1.88.6",
55
+ "@tamagui/slider": "1.88.6",
56
+ "@tamagui/stacks": "1.88.6",
57
+ "@tamagui/toast": "1.88.6",
58
+ "tamagui": "1.88.6"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "react": "*",
62
62
  "react-dom": "*"
63
63
  },
64
64
  "devDependencies": {
65
- "@tamagui/build": "1.88.4",
65
+ "@tamagui/build": "1.88.6",
66
66
  "react": "^18.2.0",
67
67
  "react-dom": "^18.2.0"
68
68
  },
@@ -1,49 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var CheckboxHeadlessDemo_exports = {};
16
- __export(CheckboxHeadlessDemo_exports, {
17
- CheckboxHeadlessDemo: () => CheckboxHeadlessDemo
18
- });
19
- module.exports = __toCommonJS(CheckboxHeadlessDemo_exports);
20
- var import_checkbox_headless = require("@tamagui/checkbox-headless"), import_lucide_icons = require("@tamagui/lucide-icons"), import_react = require("react"), import_react_native = require("react-native-web"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
21
- function CheckboxHeadlessDemo() {
22
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { space: "$3", alignItems: "center", children: [
23
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadlessCheckbox, { defaultChecked: "indeterminate", id: "headless" }),
24
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "headless", children: "Headless" })
25
- ] }) });
26
- }
27
- const HeadlessCheckbox = (0, import_react.forwardRef)((props, ref) => {
28
- const [checked, setChecked] = (0, import_react.useState)(props.defaultChecked || !1), { checkboxProps, bubbleInput } = (0, import_checkbox_headless.useCheckbox)(props, [checked, setChecked], ref);
29
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
30
- import_react_native.Pressable,
31
- {
32
- style: {
33
- width: 20,
34
- height: 20,
35
- borderRadius: 4,
36
- justifyContent: "center",
37
- alignItems: "center",
38
- backgroundColor: checked === !0 ? "lightblue" : "silver"
39
- },
40
- ...checkboxProps,
41
- children: [
42
- checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.Minus, { width: 18, height: 18 }),
43
- checked === !0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.Check, { width: 18, height: 18 }),
44
- bubbleInput
45
- ]
46
- }
47
- );
48
- });
49
- //# sourceMappingURL=CheckboxHeadlessDemo.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/CheckboxHeadlessDemo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAGO,uCACP,sBAA6B,kCAC7B,eAAqC,kBACrC,sBAAgC,yBAChC,iBAAsC,oBAKhC;AAHC,SAAS,uBAAuB;AACrC,SACE,4CAAC,yBAAO,OAAO,KAAK,YAAW,UAAS,OAAM,MAC5C,uDAAC,yBAAO,OAAM,MAAK,YAAW,UAC5B;AAAA,gDAAC,oBAAiB,gBAAe,iBAAgB,IAAG,YAAW;AAAA,IAE/D,4CAAC,wBAAM,SAAQ,YAAW,sBAAQ;AAAA,KACpC,GACF;AAEJ;AAEA,MAAM,uBAAmB,yBAAwC,CAAC,OAAO,QAAQ;AAC/E,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,MAAM,kBAAkB,EAAK,GAC9D,EAAE,eAAe,YAAY,QAAI,sCAAY,OAAO,CAAC,SAAS,UAAU,GAAG,GAAG;AAEpF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,iBAAiB,YAAY,KAAO,cAAc;AAAA,MACpD;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,oBAAY,mBAAmB,4CAAC,6BAAM,OAAO,IAAI,QAAQ,IAAI;AAAA,QAC7D,YAAY,MAAQ,4CAAC,6BAAM,OAAO,IAAI,QAAQ,IAAI;AAAA,QAClD;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;",
5
- "names": []
6
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var CheckboxHeadlessDemo_exports = {};
17
- __export(CheckboxHeadlessDemo_exports, {
18
- CheckboxHeadlessDemo: () => CheckboxHeadlessDemo
19
- });
20
- module.exports = __toCommonJS(CheckboxHeadlessDemo_exports);
21
- var import_checkbox_headless = require("@tamagui/checkbox-headless"), import_lucide_icons = require("@tamagui/lucide-icons"), import_react = require("react"), import_react_native = require("react-native"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
22
- function CheckboxHeadlessDemo() {
23
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { space: "$3", alignItems: "center", children: [
24
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadlessCheckbox, { defaultChecked: "indeterminate", id: "headless" }),
25
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "headless", children: "Headless" })
26
- ] }) });
27
- }
28
- const HeadlessCheckbox = (0, import_react.forwardRef)((props, ref) => {
29
- const [checked, setChecked] = (0, import_react.useState)(props.defaultChecked || !1), { checkboxProps, bubbleInput } = (0, import_checkbox_headless.useCheckbox)(props, [checked, setChecked], ref);
30
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
31
- import_react_native.Pressable,
32
- {
33
- style: {
34
- width: 20,
35
- height: 20,
36
- borderRadius: 4,
37
- justifyContent: "center",
38
- alignItems: "center",
39
- backgroundColor: checked === !0 ? "lightblue" : "silver"
40
- },
41
- ...checkboxProps,
42
- children: [
43
- checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.Minus, { width: 18, height: 18 }),
44
- checked === !0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.Check, { width: 18, height: 18 }),
45
- bubbleInput
46
- ]
47
- }
48
- );
49
- });
50
- // Annotate the CommonJS export names for ESM import in node:
51
- 0 && (module.exports = {
52
- CheckboxHeadlessDemo
53
- });
54
- //# sourceMappingURL=CheckboxHeadlessDemo.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/CheckboxHeadlessDemo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAGO,uCACP,sBAA6B,kCAC7B,eAAqC,kBACrC,sBAAgC,yBAChC,iBAAsC,oBAKhC;AAHC,SAAS,uBAAuB;AACrC,SACE,4CAAC,yBAAO,OAAO,KAAK,YAAW,UAAS,OAAM,MAC5C,uDAAC,yBAAO,OAAM,MAAK,YAAW,UAC5B;AAAA,gDAAC,oBAAiB,gBAAe,iBAAgB,IAAG,YAAW;AAAA,IAE/D,4CAAC,wBAAM,SAAQ,YAAW,sBAAQ;AAAA,KACpC,GACF;AAEJ;AAEA,MAAM,uBAAmB,yBAAwC,CAAC,OAAO,QAAQ;AAC/E,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,MAAM,kBAAkB,EAAK,GAC9D,EAAE,eAAe,YAAY,QAAI,sCAAY,OAAO,CAAC,SAAS,UAAU,GAAG,GAAG;AAEpF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,iBAAiB,YAAY,KAAO,cAAc;AAAA,MACpD;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,oBAAY,mBAAmB,4CAAC,6BAAM,OAAO,IAAI,QAAQ,IAAI;AAAA,QAC7D,YAAY,MAAQ,4CAAC,6BAAM,OAAO,IAAI,QAAQ,IAAI;AAAA,QAClD;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;",
5
- "names": []
6
- }
@@ -1,52 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var CheckboxUnstyledDemo_exports = {};
16
- __export(CheckboxUnstyledDemo_exports, {
17
- Checkbox: () => Checkbox,
18
- CheckboxUnstyledDemo: () => CheckboxUnstyledDemo
19
- });
20
- module.exports = __toCommonJS(CheckboxUnstyledDemo_exports);
21
- var import_checkbox = require("@tamagui/checkbox"), import_core = require("@tamagui/core"), import_lucide_icons = require("@tamagui/lucide-icons"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
22
- const Frame = (0, import_core.styled)(import_core.Stack, {
23
- borderWidth: 1,
24
- borderColor: "$borderColor",
25
- borderRadius: 5,
26
- alignItems: "center",
27
- justifyContent: "center",
28
- variants: {
29
- checked: {
30
- indeterminate: {},
31
- true: {
32
- backgroundColor: "$color5"
33
- },
34
- false: {
35
- backgroundColor: "$color3"
36
- }
37
- }
38
- },
39
- defaultVariants: {
40
- checked: !1
41
- }
42
- }), Indicator = (0, import_core.styled)(import_core.Stack, {}), Checkbox = (0, import_checkbox.createCheckbox)({
43
- Frame,
44
- Indicator
45
- });
46
- function CheckboxUnstyledDemo() {
47
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", gap: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$3", alignItems: "center", children: [
48
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox, { defaultChecked: !0, id: "unstyled", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.Check, {}) }) }),
49
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "unstyled", children: "Unstyled" })
50
- ] }) });
51
- }
52
- //# sourceMappingURL=CheckboxUnstyledDemo.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/CheckboxUnstyledDemo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsD,8BACtD,cAA8B,0BAC9B,sBAAsB,kCACtB,iBAAsC,oBAmChC;AAjCN,MAAM,YAAQ,oBAAO,mBAAO;AAAA,EAC1B,aAAa;AAAA,EACb,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,UAAU;AAAA,IACR,SAAS;AAAA,MACP,eAAe,CAAC;AAAA,MAChB,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,MACA,OAAO;AAAA,QACL,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,SAAS;AAAA,EACX;AACF,CAAC,GAEK,gBAAY,oBAAO,mBAAO,CAAC,CAAC,GAErB,eAAW,gCAAe;AAAA,EACrC;AAAA,EACA;AACF,CAAC;AAEM,SAAS,uBAAuB;AACrC,SACE,4CAAC,yBAAO,OAAO,KAAK,YAAW,UAAS,KAAI,MAC1C,uDAAC,yBAAO,KAAI,MAAK,YAAW,UAC1B;AAAA,gDAAC,YAAS,gBAAc,IAAC,IAAG,YAC1B,sDAAC,SAAS,WAAT,EACC,sDAAC,6BAAM,GACT,GACF;AAAA,IACA,4CAAC,wBAAM,SAAQ,YAAW,sBAAQ;AAAA,KACpC,GACF;AAEJ;",
5
- "names": []
6
- }
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var CheckboxUnstyledDemo_exports = {};
17
- __export(CheckboxUnstyledDemo_exports, {
18
- Checkbox: () => Checkbox,
19
- CheckboxUnstyledDemo: () => CheckboxUnstyledDemo
20
- });
21
- module.exports = __toCommonJS(CheckboxUnstyledDemo_exports);
22
- var import_checkbox = require("@tamagui/checkbox"), import_core = require("@tamagui/core"), import_lucide_icons = require("@tamagui/lucide-icons"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
23
- const Frame = (0, import_core.styled)(import_core.Stack, {
24
- borderWidth: 1,
25
- borderColor: "$borderColor",
26
- borderRadius: 5,
27
- alignItems: "center",
28
- justifyContent: "center",
29
- variants: {
30
- checked: {
31
- indeterminate: {},
32
- true: {
33
- backgroundColor: "$color5"
34
- },
35
- false: {
36
- backgroundColor: "$color3"
37
- }
38
- }
39
- },
40
- defaultVariants: {
41
- checked: !1
42
- }
43
- }), Indicator = (0, import_core.styled)(import_core.Stack, {}), Checkbox = (0, import_checkbox.createCheckbox)({
44
- Frame,
45
- Indicator
46
- });
47
- function CheckboxUnstyledDemo() {
48
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", gap: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$3", alignItems: "center", children: [
49
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox, { defaultChecked: !0, id: "unstyled", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.Check, {}) }) }),
50
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "unstyled", children: "Unstyled" })
51
- ] }) });
52
- }
53
- // Annotate the CommonJS export names for ESM import in node:
54
- 0 && (module.exports = {
55
- Checkbox,
56
- CheckboxUnstyledDemo
57
- });
58
- //# sourceMappingURL=CheckboxUnstyledDemo.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/CheckboxUnstyledDemo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsD,8BACtD,cAA8B,0BAC9B,sBAAsB,kCACtB,iBAAsC,oBAmChC;AAjCN,MAAM,YAAQ,oBAAO,mBAAO;AAAA,EAC1B,aAAa;AAAA,EACb,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,UAAU;AAAA,IACR,SAAS;AAAA,MACP,eAAe,CAAC;AAAA,MAChB,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,MACA,OAAO;AAAA,QACL,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,SAAS;AAAA,EACX;AACF,CAAC,GAEK,gBAAY,oBAAO,mBAAO,CAAC,CAAC,GAErB,eAAW,gCAAe;AAAA,EACrC;AAAA,EACA;AACF,CAAC;AAEM,SAAS,uBAAuB;AACrC,SACE,4CAAC,yBAAO,OAAO,KAAK,YAAW,UAAS,KAAI,MAC1C,uDAAC,yBAAO,KAAI,MAAK,YAAW,UAC1B;AAAA,gDAAC,YAAS,gBAAc,IAAC,IAAG,YAC1B,sDAAC,SAAS,WAAT,EACC,sDAAC,6BAAM,GACT,GACF;AAAA,IACA,4CAAC,wBAAM,SAAQ,YAAW,sBAAQ;AAAA,KACpC,GACF;AAEJ;",
5
- "names": []
6
- }
@@ -1,79 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var SwitchHeadlessDemo_exports = {};
16
- __export(SwitchHeadlessDemo_exports, {
17
- SwitchHeadlessDemo: () => SwitchHeadlessDemo
18
- });
19
- module.exports = __toCommonJS(SwitchHeadlessDemo_exports);
20
- var import_switch_headless = require("@tamagui/switch-headless"), import_react = require("react"), import_react_native = require("react-native-web"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
21
- function SwitchHeadlessDemo() {
22
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { space: "$3", alignItems: "center", children: [
23
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "headless", children: "Headless" }),
24
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadlessSwitch, { defaultChecked: !0, id: "headless" })
25
- ] }) });
26
- }
27
- const HeadlessSwitch = (0, import_react.forwardRef)((props, ref) => {
28
- const [checked, setChecked] = (0, import_react.useState)(props.defaultChecked || !1), { switchProps, switchRef, bubbleInput } = (0, import_switch_headless.useSwitch)(
29
- props,
30
- [checked, setChecked],
31
- ref
32
- ), animation = (0, import_react.useRef)(new import_react_native.Animated.Value(checked ? 1 : 0)).current;
33
- return (0, import_react.useEffect)(() => {
34
- import_react_native.Animated.timing(animation, {
35
- toValue: checked ? 1 : 0,
36
- duration: 100,
37
- useNativeDriver: !0
38
- }).start();
39
- }, [checked]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
40
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
41
- import_react_native.Pressable,
42
- {
43
- style: {
44
- width: 40,
45
- height: 20,
46
- borderRadius: 100,
47
- backgroundColor: checked ? "lightblue" : "silver"
48
- },
49
- ref: switchRef,
50
- ...switchProps,
51
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
- import_react_native.Animated.View,
53
- {
54
- style: [
55
- {
56
- backgroundColor: "black",
57
- borderRadius: 100,
58
- width: 20,
59
- height: 20
60
- },
61
- {
62
- transform: [
63
- {
64
- translateX: animation.interpolate({
65
- inputRange: [0, 1],
66
- outputRange: [0, 20]
67
- })
68
- }
69
- ]
70
- }
71
- ]
72
- }
73
- )
74
- }
75
- ),
76
- bubbleInput
77
- ] });
78
- });
79
- //# sourceMappingURL=SwitchHeadlessDemo.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/SwitchHeadlessDemo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA8D,qCAC9D,eAAwD,kBACxD,sBAA0C,yBAC1C,iBAAsC,oBAKhC;AAHC,SAAS,qBAAqB;AACnC,SACE,4CAAC,yBAAO,OAAO,KAAK,YAAW,UAAS,OAAM,MAC5C,uDAAC,yBAAO,OAAM,MAAK,YAAW,UAC5B;AAAA,gDAAC,wBAAM,SAAQ,YAAW,sBAAQ;AAAA,IAClC,4CAAC,kBAAe,gBAAc,IAAC,IAAG,YAAW;AAAA,KAC/C,GACF;AAEJ;AAEA,MAAM,qBAAiB,yBAAsC,CAAC,OAAO,QAAQ;AAC3E,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,MAAM,kBAAkB,EAAK,GAC9D,EAAE,aAAa,WAAW,YAAY,QAAI;AAAA,IAC9C;AAAA,IACA,CAAC,SAAS,UAAU;AAAA,IACpB;AAAA,EACF,GAEM,gBAAY,qBAAO,IAAI,6BAAS,MAAM,UAAU,IAAI,CAAC,CAAC,EAAE;AAE9D,qCAAU,MAAM;AACd,iCAAS,OAAO,WAAW;AAAA,MACzB,SAAS,UAAU,IAAI;AAAA,MACvB,UAAU;AAAA,MACV,iBAAiB;AAAA,IACnB,CAAC,EAAE,MAAM;AAAA,EACX,GAAG,CAAC,OAAO,CAAC,GAGV,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,iBAAiB,UAAU,cAAc;AAAA,QAC3C;AAAA,QACA,KAAK;AAAA,QACJ,GAAG;AAAA,QAEJ;AAAA,UAAC,6BAAS;AAAA,UAAT;AAAA,YACC,OAAO;AAAA,cACL;AAAA,gBACE,iBAAiB;AAAA,gBACjB,cAAc;AAAA,gBACd,OAAO;AAAA,gBACP,QAAQ;AAAA,cACV;AAAA,cACA;AAAA,gBACE,WAAW;AAAA,kBACT;AAAA,oBACE,YAAY,UAAU,YAAY;AAAA,sBAChC,YAAY,CAAC,GAAG,CAAC;AAAA,sBACjB,aAAa,CAAC,GAAG,EAAE;AAAA,oBACrB,CAAC;AAAA,kBACH;AAAA,gBACF;AAAA,cACF;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACC;AAAA,KACH;AAEJ,CAAC;",
5
- "names": []
6
- }
@@ -1,84 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var SwitchHeadlessDemo_exports = {};
17
- __export(SwitchHeadlessDemo_exports, {
18
- SwitchHeadlessDemo: () => SwitchHeadlessDemo
19
- });
20
- module.exports = __toCommonJS(SwitchHeadlessDemo_exports);
21
- var import_switch_headless = require("@tamagui/switch-headless"), import_react = require("react"), import_react_native = require("react-native"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
22
- function SwitchHeadlessDemo() {
23
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { space: "$3", alignItems: "center", children: [
24
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "headless", children: "Headless" }),
25
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadlessSwitch, { defaultChecked: !0, id: "headless" })
26
- ] }) });
27
- }
28
- const HeadlessSwitch = (0, import_react.forwardRef)((props, ref) => {
29
- const [checked, setChecked] = (0, import_react.useState)(props.defaultChecked || !1), { switchProps, switchRef, bubbleInput } = (0, import_switch_headless.useSwitch)(
30
- props,
31
- [checked, setChecked],
32
- ref
33
- ), animation = (0, import_react.useRef)(new import_react_native.Animated.Value(checked ? 1 : 0)).current;
34
- return (0, import_react.useEffect)(() => {
35
- import_react_native.Animated.timing(animation, {
36
- toValue: checked ? 1 : 0,
37
- duration: 100,
38
- useNativeDriver: !0
39
- }).start();
40
- }, [checked]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
41
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
42
- import_react_native.Pressable,
43
- {
44
- style: {
45
- width: 40,
46
- height: 20,
47
- borderRadius: 100,
48
- backgroundColor: checked ? "lightblue" : "silver"
49
- },
50
- ref: switchRef,
51
- ...switchProps,
52
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
- import_react_native.Animated.View,
54
- {
55
- style: [
56
- {
57
- backgroundColor: "black",
58
- borderRadius: 100,
59
- width: 20,
60
- height: 20
61
- },
62
- {
63
- transform: [
64
- {
65
- translateX: animation.interpolate({
66
- inputRange: [0, 1],
67
- outputRange: [0, 20]
68
- })
69
- }
70
- ]
71
- }
72
- ]
73
- }
74
- )
75
- }
76
- ),
77
- bubbleInput
78
- ] });
79
- });
80
- // Annotate the CommonJS export names for ESM import in node:
81
- 0 && (module.exports = {
82
- SwitchHeadlessDemo
83
- });
84
- //# sourceMappingURL=SwitchHeadlessDemo.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/SwitchHeadlessDemo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA8D,qCAC9D,eAAwD,kBACxD,sBAA0C,yBAC1C,iBAAsC,oBAKhC;AAHC,SAAS,qBAAqB;AACnC,SACE,4CAAC,yBAAO,OAAO,KAAK,YAAW,UAAS,OAAM,MAC5C,uDAAC,yBAAO,OAAM,MAAK,YAAW,UAC5B;AAAA,gDAAC,wBAAM,SAAQ,YAAW,sBAAQ;AAAA,IAClC,4CAAC,kBAAe,gBAAc,IAAC,IAAG,YAAW;AAAA,KAC/C,GACF;AAEJ;AAEA,MAAM,qBAAiB,yBAAsC,CAAC,OAAO,QAAQ;AAC3E,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,MAAM,kBAAkB,EAAK,GAC9D,EAAE,aAAa,WAAW,YAAY,QAAI;AAAA,IAC9C;AAAA,IACA,CAAC,SAAS,UAAU;AAAA,IACpB;AAAA,EACF,GAEM,gBAAY,qBAAO,IAAI,6BAAS,MAAM,UAAU,IAAI,CAAC,CAAC,EAAE;AAE9D,qCAAU,MAAM;AACd,iCAAS,OAAO,WAAW;AAAA,MACzB,SAAS,UAAU,IAAI;AAAA,MACvB,UAAU;AAAA,MACV,iBAAiB;AAAA,IACnB,CAAC,EAAE,MAAM;AAAA,EACX,GAAG,CAAC,OAAO,CAAC,GAGV,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,iBAAiB,UAAU,cAAc;AAAA,QAC3C;AAAA,QACA,KAAK;AAAA,QACJ,GAAG;AAAA,QAEJ;AAAA,UAAC,6BAAS;AAAA,UAAT;AAAA,YACC,OAAO;AAAA,cACL;AAAA,gBACE,iBAAiB;AAAA,gBACjB,cAAc;AAAA,gBACd,OAAO;AAAA,gBACP,QAAQ;AAAA,cACV;AAAA,cACA;AAAA,gBACE,WAAW;AAAA,kBACT;AAAA,oBACE,YAAY,UAAU,YAAY;AAAA,sBAChC,YAAY,CAAC,GAAG,CAAC;AAAA,sBACjB,aAAa,CAAC,GAAG,EAAE;AAAA,oBACrB,CAAC;AAAA,kBACH;AAAA,gBACF;AAAA,cACF;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACC;AAAA,KACH;AAEJ,CAAC;",
5
- "names": []
6
- }
@@ -1,68 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var SwitchUnstyledDemo_exports = {};
16
- __export(SwitchUnstyledDemo_exports, {
17
- Switch: () => Switch,
18
- SwitchUnstyledDemo: () => SwitchUnstyledDemo
19
- });
20
- module.exports = __toCommonJS(SwitchUnstyledDemo_exports);
21
- var import_core = require("@tamagui/core"), import_switch = require("@tamagui/switch"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
22
- const Frame = (0, import_core.styled)(import_core.Stack, {
23
- context: import_switch.SwitchStyledContext,
24
- width: 40,
25
- height: 20,
26
- borderRadius: 20,
27
- variants: {
28
- checked: {
29
- true: {
30
- backgroundColor: "lightblue"
31
- },
32
- false: {
33
- backgroundColor: "silver"
34
- }
35
- }
36
- },
37
- defaultVariants: {
38
- checked: !1
39
- }
40
- }), Thumb = (0, import_core.styled)(import_core.Stack, {
41
- context: import_switch.SwitchStyledContext,
42
- width: 20,
43
- height: 20,
44
- backgroundColor: "black",
45
- borderRadius: 20,
46
- variants: {
47
- checked: {
48
- true: {
49
- opacity: 0.8
50
- },
51
- false: {
52
- opacity: 0.5
53
- }
54
- }
55
- }
56
- }), Switch = (0, import_switch.createSwitch)({
57
- // @ts-ignore
58
- Frame,
59
- // @ts-ignore
60
- Thumb
61
- });
62
- function SwitchUnstyledDemo() {
63
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { space: "$3", alignItems: "center", children: [
64
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "unstyled-switch", children: "Unstyled" }),
65
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Switch, { defaultChecked: !0, id: "unstyled-switch", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Switch.Thumb, { animation: "quick" }) })
66
- ] }) });
67
- }
68
- //# sourceMappingURL=SwitchUnstyledDemo.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/SwitchUnstyledDemo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA8B,0BAC9B,gBAAkD,4BAClD,iBAAsC,oBAoDhC;AAlDN,MAAM,YAAQ,oBAAO,mBAAO;AAAA,EAC1B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,MACA,OAAO;AAAA,QACL,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,EACX;AACF,CAAC,GAEK,YAAQ,oBAAO,mBAAO;AAAA,EAC1B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,cAAc;AAAA,EAEd,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM;AAAA,QACJ,SAAS;AAAA,MACX;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF,CAAC,GAGY,aAAS,4BAAa;AAAA;AAAA,EAEjC;AAAA;AAAA,EAEA;AACF,CAAC;AAEM,SAAS,qBAAqB;AACnC,SACE,4CAAC,yBAAO,OAAO,KAAK,YAAW,UAAS,OAAM,MAC5C,uDAAC,yBAAO,OAAM,MAAK,YAAW,UAC5B;AAAA,gDAAC,wBAAM,SAAQ,mBAAkB,sBAAQ;AAAA,IACzC,4CAAC,UAAO,gBAAc,IAAC,IAAG,mBACxB,sDAAC,OAAO,OAAP,EAAa,WAAU,SAAQ,GAClC;AAAA,KACF,GACF;AAEJ;",
5
- "names": []
6
- }
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var SwitchUnstyledDemo_exports = {};
17
- __export(SwitchUnstyledDemo_exports, {
18
- Switch: () => Switch,
19
- SwitchUnstyledDemo: () => SwitchUnstyledDemo
20
- });
21
- module.exports = __toCommonJS(SwitchUnstyledDemo_exports);
22
- var import_core = require("@tamagui/core"), import_switch = require("@tamagui/switch"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
23
- const Frame = (0, import_core.styled)(import_core.Stack, {
24
- context: import_switch.SwitchStyledContext,
25
- width: 40,
26
- height: 20,
27
- borderRadius: 20,
28
- variants: {
29
- checked: {
30
- true: {
31
- backgroundColor: "lightblue"
32
- },
33
- false: {
34
- backgroundColor: "silver"
35
- }
36
- }
37
- },
38
- defaultVariants: {
39
- checked: !1
40
- }
41
- }), Thumb = (0, import_core.styled)(import_core.Stack, {
42
- context: import_switch.SwitchStyledContext,
43
- width: 20,
44
- height: 20,
45
- backgroundColor: "black",
46
- borderRadius: 20,
47
- variants: {
48
- checked: {
49
- true: {
50
- opacity: 0.8
51
- },
52
- false: {
53
- opacity: 0.5
54
- }
55
- }
56
- }
57
- }), Switch = (0, import_switch.createSwitch)({
58
- // @ts-ignore
59
- Frame,
60
- // @ts-ignore
61
- Thumb
62
- });
63
- function SwitchUnstyledDemo() {
64
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { space: "$3", alignItems: "center", children: [
65
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "unstyled-switch", children: "Unstyled" }),
66
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Switch, { defaultChecked: !0, id: "unstyled-switch", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Switch.Thumb, { animation: "quick" }) })
67
- ] }) });
68
- }
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
71
- Switch,
72
- SwitchUnstyledDemo
73
- });
74
- //# sourceMappingURL=SwitchUnstyledDemo.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/SwitchUnstyledDemo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA8B,0BAC9B,gBAAkD,4BAClD,iBAAsC,oBAoDhC;AAlDN,MAAM,YAAQ,oBAAO,mBAAO;AAAA,EAC1B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,MACA,OAAO;AAAA,QACL,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,EACX;AACF,CAAC,GAEK,YAAQ,oBAAO,mBAAO;AAAA,EAC1B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,cAAc;AAAA,EAEd,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM;AAAA,QACJ,SAAS;AAAA,MACX;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF,CAAC,GAGY,aAAS,4BAAa;AAAA;AAAA,EAEjC;AAAA;AAAA,EAEA;AACF,CAAC;AAEM,SAAS,qBAAqB;AACnC,SACE,4CAAC,yBAAO,OAAO,KAAK,YAAW,UAAS,OAAM,MAC5C,uDAAC,yBAAO,OAAM,MAAK,YAAW,UAC5B;AAAA,gDAAC,wBAAM,SAAQ,mBAAkB,sBAAQ;AAAA,IACzC,4CAAC,UAAO,gBAAc,IAAC,IAAG,mBACxB,sDAAC,OAAO,OAAP,EAAa,WAAU,SAAQ,GAClC;AAAA,KACF,GACF;AAEJ;",
5
- "names": []
6
- }