@tamagui/checkbox 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 (67) hide show
  1. package/dist/cjs/Checkbox.cjs +105 -101
  2. package/dist/cjs/Checkbox.native.cjs +137 -0
  3. package/dist/cjs/Checkbox.native.js +120 -100
  4. package/dist/cjs/Checkbox.native.js.map +1 -1
  5. package/dist/cjs/CheckboxStyledContext.cjs +18 -23
  6. package/dist/cjs/CheckboxStyledContext.native.cjs +32 -0
  7. package/dist/cjs/CheckboxStyledContext.native.js +18 -22
  8. package/dist/cjs/CheckboxStyledContext.native.js.map +1 -1
  9. package/dist/cjs/index.cjs +9 -26
  10. package/dist/cjs/index.native.cjs +22 -0
  11. package/dist/cjs/index.native.js +10 -26
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/esm/Checkbox.mjs +83 -87
  14. package/dist/esm/Checkbox.mjs.map +1 -1
  15. package/dist/esm/Checkbox.native.js +99 -87
  16. package/dist/esm/Checkbox.native.js.map +1 -1
  17. package/dist/esm/CheckboxStyledContext.mjs +5 -5
  18. package/dist/esm/CheckboxStyledContext.mjs.map +1 -1
  19. package/dist/esm/CheckboxStyledContext.native.js +5 -5
  20. package/dist/esm/CheckboxStyledContext.native.js.map +1 -1
  21. package/dist/esm/index.js +3 -11
  22. package/dist/esm/index.mjs +3 -11
  23. package/dist/esm/index.native.js +3 -11
  24. package/dist/jsx/Checkbox.mjs +83 -87
  25. package/dist/jsx/Checkbox.mjs.map +1 -1
  26. package/dist/jsx/Checkbox.native.cjs +137 -0
  27. package/dist/jsx/Checkbox.native.js +120 -100
  28. package/dist/jsx/Checkbox.native.js.map +1 -1
  29. package/dist/jsx/CheckboxStyledContext.mjs +5 -5
  30. package/dist/jsx/CheckboxStyledContext.mjs.map +1 -1
  31. package/dist/jsx/CheckboxStyledContext.native.cjs +32 -0
  32. package/dist/jsx/CheckboxStyledContext.native.js +18 -22
  33. package/dist/jsx/CheckboxStyledContext.native.js.map +1 -1
  34. package/dist/jsx/index.js +3 -11
  35. package/dist/jsx/index.mjs +3 -11
  36. package/dist/jsx/index.native.cjs +22 -0
  37. package/dist/jsx/index.native.js +10 -26
  38. package/dist/jsx/index.native.js.map +1 -1
  39. package/package.json +6 -16
  40. package/src/Checkbox.tsx +189 -81
  41. package/src/CheckboxStyledContext.tsx +2 -6
  42. package/src/index.ts +0 -9
  43. package/types/Checkbox.d.ts +446 -24
  44. package/types/Checkbox.d.ts.map +1 -1
  45. package/types/CheckboxStyledContext.d.ts +2 -4
  46. package/types/CheckboxStyledContext.d.ts.map +1 -1
  47. package/types/index.d.ts +0 -320
  48. package/types/index.d.ts.map +1 -1
  49. package/dist/cjs/createCheckbox.cjs +0 -194
  50. package/dist/cjs/createCheckbox.native.js +0 -213
  51. package/dist/cjs/createCheckbox.native.js.map +0 -1
  52. package/dist/esm/createCheckbox.mjs +0 -150
  53. package/dist/esm/createCheckbox.mjs.map +0 -1
  54. package/dist/esm/createCheckbox.native.js +0 -167
  55. package/dist/esm/createCheckbox.native.js.map +0 -1
  56. package/dist/esm/index.js.map +0 -1
  57. package/dist/esm/index.mjs.map +0 -1
  58. package/dist/esm/index.native.js.map +0 -1
  59. package/dist/jsx/createCheckbox.mjs +0 -150
  60. package/dist/jsx/createCheckbox.mjs.map +0 -1
  61. package/dist/jsx/createCheckbox.native.js +0 -213
  62. package/dist/jsx/createCheckbox.native.js.map +0 -1
  63. package/dist/jsx/index.js.map +0 -1
  64. package/dist/jsx/index.mjs.map +0 -1
  65. package/src/createCheckbox.tsx +0 -280
  66. package/types/createCheckbox.d.ts +0 -196
  67. package/types/createCheckbox.d.ts.map +0 -1
@@ -1,35 +1,30 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
10
11
  };
11
12
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
19
20
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
22
  var CheckboxStyledContext_exports = {};
24
- __export(CheckboxStyledContext_exports, {
25
- CheckboxStyledContext: () => CheckboxStyledContext
26
- });
23
+ __export(CheckboxStyledContext_exports, { CheckboxStyledContext: () => CheckboxStyledContext });
27
24
  module.exports = __toCommonJS(CheckboxStyledContext_exports);
28
25
  var import_core = require("@tamagui/core");
29
26
  const CheckboxStyledContext = (0, import_core.createStyledContext)({
30
- size: "$true",
31
- scaleIcon: 1,
32
- unstyled: process.env.TAMAGUI_HEADLESS === "1",
33
- active: false,
34
- disabled: false
35
- });
27
+ size: true,
28
+ active: false,
29
+ disabled: false
30
+ });
@@ -0,0 +1,32 @@
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 CheckboxStyledContext_exports = {};
25
+ __export(CheckboxStyledContext_exports, { CheckboxStyledContext: () => CheckboxStyledContext });
26
+ module.exports = __toCommonJS(CheckboxStyledContext_exports);
27
+ var import_core = require("@tamagui/core");
28
+ var CheckboxStyledContext = (0, import_core.createStyledContext)({
29
+ size: true,
30
+ active: false,
31
+ disabled: false
32
+ });
@@ -1,38 +1,34 @@
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 CheckboxStyledContext_exports = {};
26
- __export(CheckboxStyledContext_exports, {
27
- CheckboxStyledContext: () => CheckboxStyledContext
28
- });
25
+ __export(CheckboxStyledContext_exports, { CheckboxStyledContext: () => CheckboxStyledContext });
29
26
  module.exports = __toCommonJS(CheckboxStyledContext_exports);
30
27
  var import_core = require("@tamagui/core");
31
28
  var CheckboxStyledContext = (0, import_core.createStyledContext)({
32
- size: "$true",
33
- scaleIcon: 1,
34
- unstyled: process.env.TAMAGUI_HEADLESS === "1",
35
- active: false,
36
- disabled: false
29
+ size: true,
30
+ active: false,
31
+ disabled: false
37
32
  });
33
+
38
34
  //# sourceMappingURL=CheckboxStyledContext.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","CheckboxStyledContext_exports","__export","CheckboxStyledContext","module","exports","import_core","require","createStyledContext","size","scaleIcon","unstyled","process","env","TAMAGUI_HEADLESS","active","disabled"],"sources":["../../src/CheckboxStyledContext.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,6BAAA;AAAAC,QAAA,CAAAD,6BAAA;EAAAE,qBAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAT,YAAoC,CAAAK,6BAAA;AAE7B,IAAAK,WAAM,GAAAC,OAAA,gBAAwB;AAMlC,IACDJ,qBAAM,OAAAG,WAAA,CAAAE,mBAAA;EACNC,IAAA,SAAW;EACXC,SAAA,EAAU;EACVC,QAAQ,EAAAC,OAAA,CAAAC,GAAA,CAAAC,gBAAA;EACRC,MAAA,OAAU;EACXC,QAAA","ignoreList":[]}
1
+ {"version":3,"file":"CheckboxStyledContext.native.js","names":[],"sources":["cjs/CheckboxStyledContext.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 CheckboxStyledContext_exports = {};\n__export(CheckboxStyledContext_exports, {\n CheckboxStyledContext: () => CheckboxStyledContext\n});\nmodule.exports = __toCommonJS(CheckboxStyledContext_exports);\nvar import_core = require(\"@tamagui/core\");\nvar CheckboxStyledContext = (0, import_core.createStyledContext)({\n size: true,\n active: false,\n disabled: false\n});\n//# sourceMappingURL=CheckboxStyledContext.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,gCAAgC,CAAC;AACrC,SAAS,+BAA+B,EACtC,6BAA6B,sBAC/B,CAAC;AACD,OAAO,UAAU,aAAa,6BAA6B;AAC3D,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,yBAAyB,GAAG,YAAY,qBAAqB;CAC/D,MAAM;CACN,QAAQ;CACR,UAAU;AACZ,CAAC"}
@@ -1,37 +1,20 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
10
- };
11
6
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ }
13
+ return to;
19
14
  };
20
15
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
22
- value: true
23
- }), mod);
16
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
17
  var index_exports = {};
25
- __export(index_exports, {
26
- Checkbox: () => Checkbox
27
- });
28
18
  module.exports = __toCommonJS(index_exports);
29
- var import_Checkbox = require("./Checkbox.cjs");
30
- var import_createCheckbox = require("./createCheckbox.cjs");
31
- __reExport(index_exports, require("./createCheckbox.cjs"), module.exports);
32
19
  __reExport(index_exports, require("./Checkbox.cjs"), module.exports);
33
20
  __reExport(index_exports, require("./CheckboxStyledContext.cjs"), module.exports);
34
- const Checkbox = (0, import_createCheckbox.createCheckbox)({
35
- Frame: import_Checkbox.CheckboxFrame,
36
- Indicator: import_Checkbox.CheckboxIndicatorFrame
37
- });
@@ -0,0 +1,22 @@
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 __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var index_exports = {};
20
+ module.exports = __toCommonJS(index_exports);
21
+ __reExport(index_exports, require("./Checkbox.native.js"), module.exports);
22
+ __reExport(index_exports, require("./CheckboxStyledContext.native.js"), module.exports);
@@ -1,40 +1,24 @@
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
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
12
- };
13
8
  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;
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
21
16
  };
22
17
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
24
- value: true
25
- }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
19
  var index_exports = {};
27
- __export(index_exports, {
28
- Checkbox: () => Checkbox
29
- });
30
20
  module.exports = __toCommonJS(index_exports);
31
- var import_Checkbox = require("./Checkbox.native.js");
32
- var import_createCheckbox = require("./createCheckbox.native.js");
33
- __reExport(index_exports, require("./createCheckbox.native.js"), module.exports);
34
21
  __reExport(index_exports, require("./Checkbox.native.js"), module.exports);
35
22
  __reExport(index_exports, require("./CheckboxStyledContext.native.js"), module.exports);
36
- var Checkbox = (0, import_createCheckbox.createCheckbox)({
37
- Frame: import_Checkbox.CheckboxFrame,
38
- Indicator: import_Checkbox.CheckboxIndicatorFrame
39
- });
23
+
40
24
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","Checkbox","module","exports","import_Checkbox","require","import_createCheckbox","__reExport","createCheckbox","Frame","CheckboxFrame","Indicator","CheckboxIndicatorFrame"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAsD,CAAAK,aAAA;AACtD,IAAAK,eAAA,GAAAC,OAA+B;AAE/B,IAAAC,qBAAA,GAAcD,OAAA,8BAHd;AAIAE,UAAA,CAAAR,aAAA,EAAcM,OAAA,6BAJd,GAAAH,MAAA,CAAAC,OAAA;AAKAI,UAAA,CAAAR,aAAA,EAAcM,OAAA,0BAAAH,MAAA,CAAAC,OALd;AAQOI,UAAM,CAAAR,aAAW,EAAAM,OAAA,oCAAe,GAAAH,MAAA,CAAAC,OAAA;AAAA,IACrCF,QAAO,OAAAK,qBAAA,CAAAE,cAAA;EACPC,KAAA,EAAAL,eAAW,CAAAM,aAAA;EACZC,SAAA,EAAAP,eAAA,CAAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Checkbox\"), module.exports);\n__reExport(index_exports, require(\"./CheckboxStyledContext\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,sBAAY,GAAG,OAAO,OAAO;AAC/D,WAAW,eAAe,QAAQ,mCAAyB,GAAG,OAAO,OAAO"}
@@ -1,90 +1,86 @@
1
- import { getVariableValue, styled } from "@tamagui/core";
2
- import { getSize } from "@tamagui/get-token";
3
- import { YStack } from "@tamagui/stacks";
1
+ import { isIndeterminate, useCheckbox } from "@tamagui/checkbox-headless";
2
+ import { View, createStyledHOC, isWeb, shouldRenderNativePlatform, styled, useProps, withStaticProperties } from "@tamagui/core";
3
+ import { useControllableState } from "@tamagui/use-controllable-state";
4
+ import React, { useMemo } from "react";
4
5
  import { CheckboxStyledContext } from "./CheckboxStyledContext.mjs";
5
- const INDICATOR_NAME = "CheckboxIndicator";
6
- const CheckboxIndicatorFrame = styled(YStack, {
7
- // use Checkbox for easier themes
8
- name: INDICATOR_NAME,
9
- context: CheckboxStyledContext,
10
- variants: {
11
- unstyled: {
12
- false: {}
13
- }
14
- },
15
- defaultVariants: {
16
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
17
- }
18
- }, {
19
- accept: {
20
- activeStyle: "style"
21
- }
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+
8
+ const CheckboxIndicatorFrame = styled(View, {
9
+ displayName: "CheckboxIndicator",
10
+ context: CheckboxStyledContext
11
+ }, { accept: { activeStyle: "style" } });
12
+ const CheckboxFrame = styled(View, {
13
+ displayName: "Checkbox",
14
+ render: "button",
15
+ context: CheckboxStyledContext,
16
+ alignItems: "center",
17
+ justifyContent: "center",
18
+ variants: { disabled: { true: {
19
+ pointerEvents: "none",
20
+ userSelect: "none"
21
+ } } }
22
+ }, { accept: { activeStyle: "style" } });
23
+ const CheckboxContext = React.createContext({
24
+ checked: false,
25
+ disabled: false
22
26
  });
23
- const CHECKBOX_NAME = "Checkbox";
24
- const CheckboxFrame = styled(YStack, {
25
- name: CHECKBOX_NAME,
26
- render: "button",
27
- context: CheckboxStyledContext,
28
- variants: {
29
- unstyled: {
30
- false: {
31
- size: "$true",
32
- backgroundColor: "$background",
33
- alignItems: "center",
34
- justifyContent: "center",
35
- borderWidth: 1,
36
- borderColor: "$borderColor",
37
- hoverStyle: {
38
- borderColor: "$borderColorHover"
39
- },
40
- pressStyle: {
41
- backgroundColor: "$backgroundPress",
42
- borderColor: "$borderColorPress"
43
- },
44
- focusStyle: {
45
- borderColor: "$borderColorFocus"
46
- },
47
- focusVisibleStyle: {
48
- outlineStyle: "solid",
49
- outlineWidth: 2,
50
- outlineColor: "$outlineColor"
51
- }
52
- }
53
- },
54
- disabled: {
55
- true: {
56
- pointerEvents: "none",
57
- userSelect: "none",
58
- cursor: "not-allowed",
59
- hoverStyle: {
60
- borderColor: "$borderColor",
61
- backgroundColor: "$background"
62
- },
63
- pressStyle: {
64
- borderColor: "$borderColor",
65
- backgroundColor: "$background"
66
- },
67
- focusStyle: {
68
- outlineWidth: 0
69
- }
70
- }
71
- },
72
- size: {
73
- "...size": val => {
74
- const radiusToken = getVariableValue(getSize(val)) / 8;
75
- return {
76
- borderRadius: radiusToken
77
- };
78
- }
79
- }
80
- },
81
- defaultVariants: {
82
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
83
- }
84
- }, {
85
- accept: {
86
- activeStyle: "style"
87
- }
88
- });
89
- export { CheckboxFrame, CheckboxIndicatorFrame };
27
+ const Checkbox2 = withStaticProperties(createStyledHOC(CheckboxFrame, function Checkbox(_props, forwardedRef) {
28
+ const { checked: checkedProp, defaultChecked, onCheckedChange, native, activeStyle, activeTheme, ...props } = _props;
29
+ const propsActive = useProps(props);
30
+ const styledContext = React.useContext(CheckboxStyledContext.context);
31
+ const [checked = false, setChecked] = useControllableState({
32
+ prop: checkedProp,
33
+ defaultProp: defaultChecked,
34
+ onChange: onCheckedChange
35
+ });
36
+ const { checkboxProps, checkboxRef, bubbleInput } = useCheckbox(propsActive, [checked, setChecked], forwardedRef);
37
+ if (shouldRenderNativePlatform(native) === "web") return /* @__PURE__ */ jsx("input", {
38
+ type: "checkbox",
39
+ defaultChecked: isIndeterminate(checked) ? false : checked,
40
+ tabIndex: -1,
41
+ ref: checkboxRef,
42
+ disabled: checkboxProps.disabled,
43
+ style: checkboxProps.style
44
+ });
45
+ const memoizedContext = useMemo(() => ({
46
+ checked,
47
+ disabled: checkboxProps.disabled
48
+ }), [checked, checkboxProps.disabled]);
49
+ const isActive = !!checked;
50
+ const disabled = checkboxProps.disabled;
51
+ return /* @__PURE__ */ jsx(CheckboxContext.Provider, {
52
+ value: memoizedContext,
53
+ children: /* @__PURE__ */ jsxs(CheckboxStyledContext.Provider, {
54
+ size: propsActive.size ?? styledContext?.size ?? true,
55
+ active: isActive,
56
+ disabled,
57
+ children: [/* @__PURE__ */ jsx(CheckboxFrame, {
58
+ render: "button",
59
+ ref: checkboxRef,
60
+ theme: activeTheme ?? null,
61
+ ...isWeb && { type: "button" },
62
+ checked,
63
+ disabled,
64
+ ...checkboxProps,
65
+ ...props,
66
+ ...isActive && activeStyle ? activeStyle : void 0,
67
+ children: propsActive.children
68
+ }), bubbleInput]
69
+ })
70
+ });
71
+ }), { Indicator: createStyledHOC(CheckboxIndicatorFrame, (props, forwardedRef) => {
72
+ const { children, forceMount, activeStyle, ...indicatorProps } = props;
73
+ const { active } = CheckboxStyledContext.useStyledContext();
74
+ const context = React.useContext(CheckboxContext);
75
+ if (forceMount || isIndeterminate(context.checked) || context.checked === true) return /* @__PURE__ */ jsx(CheckboxIndicatorFrame, {
76
+ pointerEvents: "none",
77
+ ...indicatorProps,
78
+ ...active && activeStyle ? activeStyle : void 0,
79
+ ref: forwardedRef,
80
+ children
81
+ });
82
+ return null;
83
+ }) });
84
+
85
+ export { Checkbox2 as Checkbox, CheckboxContext, CheckboxFrame, CheckboxIndicatorFrame };
90
86
  //# sourceMappingURL=Checkbox.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["getVariableValue","styled","getSize","YStack","CheckboxStyledContext","INDICATOR_NAME","CheckboxIndicatorFrame","name","context","variants","unstyled","false","defaultVariants","process","env","TAMAGUI_HEADLESS","accept","activeStyle","CHECKBOX_NAME","CheckboxFrame","render","size","backgroundColor","alignItems","justifyContent","borderWidth","borderColor","hoverStyle","pressStyle","focusStyle","focusVisibleStyle","outlineStyle","outlineWidth","outlineColor","disabled","true","pointerEvents","userSelect","cursor","val","radiusToken","borderRadius"],"sources":["../../src/Checkbox.tsx"],"sourcesContent":[null],"mappings":"AAGA,SAASA,gBAAA,EAAkBC,MAAA,QAAc;AACzC,SAASC,OAAA,QAAe;AACxB,SAASC,MAAA,QAAc;AAEvB,SAASC,qBAAA,QAA6B;AAKtC,MAAMC,cAAA,GAAiB;AAEhB,MAAMC,sBAAA,GAAyBL,MAAA,CACpCE,MAAA,EACA;EAAA;EAEEI,IAAA,EAAMF,cAAA;EACNG,OAAA,EAASJ,qBAAA;EACTK,QAAA,EAAU;IACRC,QAAA,EAAU;MACRC,KAAA,EAAO,CAAC;IACV;EACF;EACAC,eAAA,EAAiB;IACfF,QAAA,EAAUG,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;EAC7C;AACF,GACA;EACEC,MAAA,EAAQ;IACNC,WAAA,EAAa;EACf;AACF,CACF;AAMA,MAAMC,aAAA,GAAgB;AAEf,MAAMC,aAAA,GAAgBlB,MAAA,CAC3BE,MAAA,EACA;EACEI,IAAA,EAAMW,aAAA;EACNE,MAAA,EAAQ;EAERZ,OAAA,EAASJ,qBAAA;EACTK,QAAA,EAAU;IACRC,QAAA,EAAU;MACRC,KAAA,EAAO;QACLU,IAAA,EAAM;QACNC,eAAA,EAAiB;QACjBC,UAAA,EAAY;QACZC,cAAA,EAAgB;QAChBC,WAAA,EAAa;QACbC,WAAA,EAAa;QAEbC,UAAA,EAAY;UACVD,WAAA,EAAa;QACf;QAEAE,UAAA,EAAY;UACVN,eAAA,EAAiB;UACjBI,WAAA,EAAa;QACf;QAEAG,UAAA,EAAY;UACVH,WAAA,EAAa;QACf;QAEAI,iBAAA,EAAmB;UACjBC,YAAA,EAAc;UACdC,YAAA,EAAc;UACdC,YAAA,EAAc;QAChB;MACF;IACF;IAEAC,QAAA,EAAU;MACRC,IAAA,EAAM;QACJC,aAAA,EAAe;QACfC,UAAA,EAAY;QACZC,MAAA,EAAQ;QAERX,UAAA,EAAY;UACVD,WAAA,EAAa;UACbJ,eAAA,EAAiB;QACnB;QAEAM,UAAA,EAAY;UACVF,WAAA,EAAa;UACbJ,eAAA,EAAiB;QACnB;QAEAO,UAAA,EAAY;UACVG,YAAA,EAAc;QAChB;MACF;IACF;IAEAX,IAAA,EAAM;MACJ,WAAYkB,GAAA,IAAQ;QAClB,MAAMC,WAAA,GAAcxC,gBAAA,CAAiBE,OAAA,CAAQqC,GAAG,CAAC,IAAI;QACrD,OAAO;UACLE,YAAA,EAAcD;QAChB;MACF;IACF;EACF;EAEA5B,eAAA,EAAiB;IACfF,QAAA,EAAUG,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;EAC7C;AACF,GACA;EACEC,MAAA,EAAQ;IACNC,WAAA,EAAa;EACf;AACF,CACF","ignoreList":[]}
1
+ {"version":3,"file":"Checkbox.js","names":[],"sources":["esm/Checkbox.js"],"sourcesContent":["import { isIndeterminate, useCheckbox } from \"@tamagui/checkbox-headless\";\nimport { View, createStyledHOC, isWeb, shouldRenderNativePlatform, styled, useProps, withStaticProperties } from \"@tamagui/core\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport React, { useMemo } from \"react\";\nimport { CheckboxStyledContext } from \"./CheckboxStyledContext\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n\nconst CheckboxIndicatorFrame = styled(View, {\n\tdisplayName: \"CheckboxIndicator\",\n\tcontext: CheckboxStyledContext\n}, { accept: { activeStyle: \"style\" } });\nconst CheckboxFrame = styled(View, {\n\tdisplayName: \"Checkbox\",\n\trender: \"button\",\n\tcontext: CheckboxStyledContext,\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tvariants: { disabled: { true: {\n\t\tpointerEvents: \"none\",\n\t\tuserSelect: \"none\"\n\t} } }\n}, { accept: { activeStyle: \"style\" } });\nconst CheckboxContext = React.createContext({\n\tchecked: false,\n\tdisabled: false\n});\nconst Checkbox2 = withStaticProperties(createStyledHOC(CheckboxFrame, function Checkbox(_props, forwardedRef) {\n\tconst { checked: checkedProp, defaultChecked, onCheckedChange, native, activeStyle, activeTheme, ...props } = _props;\n\tconst propsActive = useProps(props);\n\tconst styledContext = React.useContext(CheckboxStyledContext.context);\n\tconst [checked = false, setChecked] = useControllableState({\n\t\tprop: checkedProp,\n\t\tdefaultProp: defaultChecked,\n\t\tonChange: onCheckedChange\n\t});\n\tconst { checkboxProps, checkboxRef, bubbleInput } = useCheckbox(propsActive, [checked, setChecked], forwardedRef);\n\tif (shouldRenderNativePlatform(native) === \"web\") return /* @__PURE__ */ jsx(\"input\", {\n\t\ttype: \"checkbox\",\n\t\tdefaultChecked: isIndeterminate(checked) ? false : checked,\n\t\ttabIndex: -1,\n\t\tref: checkboxRef,\n\t\tdisabled: checkboxProps.disabled,\n\t\tstyle: checkboxProps.style\n\t});\n\tconst memoizedContext = useMemo(() => ({\n\t\tchecked,\n\t\tdisabled: checkboxProps.disabled\n\t}), [checked, checkboxProps.disabled]);\n\tconst isActive = !!checked;\n\tconst disabled = checkboxProps.disabled;\n\treturn /* @__PURE__ */ jsx(CheckboxContext.Provider, {\n\t\tvalue: memoizedContext,\n\t\tchildren: /* @__PURE__ */ jsxs(CheckboxStyledContext.Provider, {\n\t\t\tsize: propsActive.size ?? styledContext?.size ?? true,\n\t\t\tactive: isActive,\n\t\t\tdisabled,\n\t\t\tchildren: [/* @__PURE__ */ jsx(CheckboxFrame, {\n\t\t\t\trender: \"button\",\n\t\t\t\tref: checkboxRef,\n\t\t\t\ttheme: activeTheme ?? null,\n\t\t\t\t...isWeb && { type: \"button\" },\n\t\t\t\tchecked,\n\t\t\t\tdisabled,\n\t\t\t\t...checkboxProps,\n\t\t\t\t...props,\n\t\t\t\t...isActive && activeStyle ? activeStyle : void 0,\n\t\t\t\tchildren: propsActive.children\n\t\t\t}), bubbleInput]\n\t\t})\n\t});\n}), { Indicator: createStyledHOC(CheckboxIndicatorFrame, (props, forwardedRef) => {\n\tconst { children, forceMount, activeStyle, ...indicatorProps } = props;\n\tconst { active } = CheckboxStyledContext.useStyledContext();\n\tconst context = React.useContext(CheckboxContext);\n\tif (forceMount || isIndeterminate(context.checked) || context.checked === true) return /* @__PURE__ */ jsx(CheckboxIndicatorFrame, {\n\t\tpointerEvents: \"none\",\n\t\t...indicatorProps,\n\t\t...active && activeStyle ? activeStyle : void 0,\n\t\tref: forwardedRef,\n\t\tchildren\n\t});\n\treturn null;\n}) });\n\nexport { Checkbox2 as Checkbox, CheckboxContext, CheckboxFrame, CheckboxIndicatorFrame };"],"mappings":";;;;;;;;AAOA,MAAM,yBAAyB,OAAO,MAAM;CAC3C,aAAa;CACb,SAAS;AACV,GAAG,EAAE,QAAQ,EAAE,aAAa,QAAQ,EAAE,CAAC;AACvC,MAAM,gBAAgB,OAAO,MAAM;CAClC,aAAa;CACb,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,gBAAgB;CAChB,UAAU,EAAE,UAAU,EAAE,MAAM;EAC7B,eAAe;EACf,YAAY;CACb,EAAE,EAAE;AACL,GAAG,EAAE,QAAQ,EAAE,aAAa,QAAQ,EAAE,CAAC;AACvC,MAAM,kBAAkB,MAAM,cAAc;CAC3C,SAAS;CACT,UAAU;AACX,CAAC;AACD,MAAM,YAAY,qBAAqB,gBAAgB,eAAe,SAAS,SAAS,QAAQ,cAAc;CAC7G,MAAM,EAAE,SAAS,aAAa,gBAAgB,iBAAiB,QAAQ,aAAa,aAAa,GAAG,UAAU;CAC9G,MAAM,cAAc,SAAS,KAAK;CAClC,MAAM,gBAAgB,MAAM,WAAW,sBAAsB,OAAO;CACpE,MAAM,CAAC,UAAU,OAAO,cAAc,qBAAqB;EAC1D,MAAM;EACN,aAAa;EACb,UAAU;CACX,CAAC;CACD,MAAM,EAAE,eAAe,aAAa,gBAAgB,YAAY,aAAa,CAAC,SAAS,UAAU,GAAG,YAAY;CAChH,IAAI,2BAA2B,MAAM,MAAM,OAAO,OAAuB,oBAAI,SAAS;EACrF,MAAM;EACN,gBAAgB,gBAAgB,OAAO,IAAI,QAAQ;EACnD,UAAU,CAAC;EACX,KAAK;EACL,UAAU,cAAc;EACxB,OAAO,cAAc;CACtB,CAAC;CACD,MAAM,kBAAkB,eAAe;EACtC;EACA,UAAU,cAAc;CACzB,IAAI,CAAC,SAAS,cAAc,QAAQ,CAAC;CACrC,MAAM,WAAW,CAAC,CAAC;CACnB,MAAM,WAAW,cAAc;CAC/B,OAAuB,oBAAI,gBAAgB,UAAU;EACpD,OAAO;EACP,UAA0B,qBAAK,sBAAsB,UAAU;GAC9D,MAAM,YAAY,QAAQ,eAAe,QAAQ;GACjD,QAAQ;GACR;GACA,UAAU,CAAiB,oBAAI,eAAe;IAC7C,QAAQ;IACR,KAAK;IACL,OAAO,eAAe;IACtB,GAAG,SAAS,EAAE,MAAM,SAAS;IAC7B;IACA;IACA,GAAG;IACH,GAAG;IACH,GAAG,YAAY,cAAc,cAAc,KAAK;IAChD,UAAU,YAAY;GACvB,CAAC,GAAG,WAAW;EAChB,CAAC;CACF,CAAC;AACF,CAAC,GAAG,EAAE,WAAW,gBAAgB,yBAAyB,OAAO,iBAAiB;CACjF,MAAM,EAAE,UAAU,YAAY,aAAa,GAAG,mBAAmB;CACjE,MAAM,EAAE,WAAW,sBAAsB,iBAAiB;CAC1D,MAAM,UAAU,MAAM,WAAW,eAAe;CAChD,IAAI,cAAc,gBAAgB,QAAQ,OAAO,KAAK,QAAQ,YAAY,MAAM,OAAuB,oBAAI,wBAAwB;EAClI,eAAe;EACf,GAAG;EACH,GAAG,UAAU,cAAc,cAAc,KAAK;EAC9C,KAAK;EACL;CACD,CAAC;CACD,OAAO;AACR,CAAC,EAAE,CAAC"}