@tamagui/checkbox 1.79.9 → 1.79.11

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 (106) hide show
  1. package/dist/cjs/Checkbox.js +2 -2
  2. package/dist/cjs/Checkbox.js.map +1 -1
  3. package/dist/cjs/Checkbox.native.js +2 -2
  4. package/dist/cjs/Checkbox.native.js.map +1 -1
  5. package/dist/esm/Checkbox.js +3 -3
  6. package/dist/esm/Checkbox.js.map +1 -1
  7. package/dist/esm/Checkbox.native.js +3 -3
  8. package/dist/esm/Checkbox.native.js.map +1 -1
  9. package/dist/jsx/Checkbox.js +3 -3
  10. package/dist/jsx/Checkbox.js.map +1 -1
  11. package/dist/jsx/Checkbox.native.js +3 -3
  12. package/dist/jsx/Checkbox.native.js.map +1 -1
  13. package/package.json +12 -12
  14. package/src/Checkbox.tsx +5 -3
  15. package/types/Checkbox.d.ts.map +1 -1
  16. package/dist/cjs/BubbleInput.js +0 -69
  17. package/dist/cjs/BubbleInput.js.map +0 -6
  18. package/dist/cjs/BubbleInput.native.js +0 -70
  19. package/dist/cjs/BubbleInput.native.js.map +0 -6
  20. package/dist/cjs/CheckboxIndicator.js +0 -70
  21. package/dist/cjs/CheckboxIndicator.js.map +0 -6
  22. package/dist/cjs/CheckboxIndicator.native.js +0 -71
  23. package/dist/cjs/CheckboxIndicator.native.js.map +0 -6
  24. package/dist/cjs/CheckboxStyledContext.js +0 -29
  25. package/dist/cjs/CheckboxStyledContext.js.map +0 -6
  26. package/dist/cjs/CheckboxStyledContext.native.js +0 -30
  27. package/dist/cjs/CheckboxStyledContext.native.js.map +0 -6
  28. package/dist/cjs/ScopedProps.js +0 -189
  29. package/dist/cjs/ScopedProps.js.map +0 -6
  30. package/dist/cjs/ScopedProps.native.js +0 -199
  31. package/dist/cjs/ScopedProps.native.js.map +0 -6
  32. package/dist/cjs/createCheckbox.js +0 -167
  33. package/dist/cjs/createCheckbox.js.map +0 -6
  34. package/dist/cjs/createCheckbox.native.js +0 -177
  35. package/dist/cjs/createCheckbox.native.js.map +0 -6
  36. package/dist/cjs/isIndeterminate.js +0 -32
  37. package/dist/cjs/isIndeterminate.js.map +0 -6
  38. package/dist/cjs/isIndeterminate.native.js +0 -33
  39. package/dist/cjs/isIndeterminate.native.js.map +0 -6
  40. package/dist/cjs/utils.js +0 -32
  41. package/dist/cjs/utils.js.map +0 -6
  42. package/dist/cjs/utils.native.js +0 -33
  43. package/dist/cjs/utils.native.js.map +0 -6
  44. package/dist/esm/BubbleInput.js +0 -44
  45. package/dist/esm/BubbleInput.js.map +0 -6
  46. package/dist/esm/BubbleInput.native.js +0 -44
  47. package/dist/esm/BubbleInput.native.js.map +0 -6
  48. package/dist/esm/CheckboxIndicator.js +0 -57
  49. package/dist/esm/CheckboxIndicator.js.map +0 -6
  50. package/dist/esm/CheckboxIndicator.native.js +0 -57
  51. package/dist/esm/CheckboxIndicator.native.js.map +0 -6
  52. package/dist/esm/CheckboxStyledContext.js +0 -9
  53. package/dist/esm/CheckboxStyledContext.js.map +0 -6
  54. package/dist/esm/CheckboxStyledContext.native.js +0 -9
  55. package/dist/esm/CheckboxStyledContext.native.js.map +0 -6
  56. package/dist/esm/ScopedProps.js +0 -175
  57. package/dist/esm/ScopedProps.js.map +0 -6
  58. package/dist/esm/ScopedProps.native.js +0 -184
  59. package/dist/esm/ScopedProps.native.js.map +0 -6
  60. package/dist/esm/createCheckbox.js +0 -156
  61. package/dist/esm/createCheckbox.js.map +0 -6
  62. package/dist/esm/createCheckbox.native.js +0 -165
  63. package/dist/esm/createCheckbox.native.js.map +0 -6
  64. package/dist/esm/isIndeterminate.js +0 -11
  65. package/dist/esm/isIndeterminate.js.map +0 -6
  66. package/dist/esm/isIndeterminate.native.js +0 -11
  67. package/dist/esm/isIndeterminate.native.js.map +0 -6
  68. package/dist/esm/utils.js +0 -11
  69. package/dist/esm/utils.js.map +0 -6
  70. package/dist/esm/utils.native.js +0 -11
  71. package/dist/esm/utils.native.js.map +0 -6
  72. package/dist/jsx/BubbleInput.js +0 -40
  73. package/dist/jsx/BubbleInput.js.map +0 -6
  74. package/dist/jsx/BubbleInput.native.js +0 -40
  75. package/dist/jsx/BubbleInput.native.js.map +0 -6
  76. package/dist/jsx/CheckboxIndicator.js +0 -52
  77. package/dist/jsx/CheckboxIndicator.js.map +0 -6
  78. package/dist/jsx/CheckboxIndicator.native.js +0 -52
  79. package/dist/jsx/CheckboxIndicator.native.js.map +0 -6
  80. package/dist/jsx/CheckboxStyledContext.js +0 -9
  81. package/dist/jsx/CheckboxStyledContext.js.map +0 -6
  82. package/dist/jsx/CheckboxStyledContext.native.js +0 -9
  83. package/dist/jsx/CheckboxStyledContext.native.js.map +0 -6
  84. package/dist/jsx/ScopedProps.js +0 -160
  85. package/dist/jsx/ScopedProps.js.map +0 -6
  86. package/dist/jsx/ScopedProps.native.js +0 -169
  87. package/dist/jsx/ScopedProps.native.js.map +0 -6
  88. package/dist/jsx/createCheckbox.js +0 -137
  89. package/dist/jsx/createCheckbox.js.map +0 -6
  90. package/dist/jsx/createCheckbox.native.js +0 -146
  91. package/dist/jsx/createCheckbox.native.js.map +0 -6
  92. package/dist/jsx/isIndeterminate.js +0 -11
  93. package/dist/jsx/isIndeterminate.js.map +0 -6
  94. package/dist/jsx/isIndeterminate.native.js +0 -11
  95. package/dist/jsx/isIndeterminate.native.js.map +0 -6
  96. package/dist/jsx/utils.js +0 -11
  97. package/dist/jsx/utils.js.map +0 -6
  98. package/dist/jsx/utils.native.js +0 -11
  99. package/dist/jsx/utils.native.js.map +0 -6
  100. package/types/BubbleInput.d.ts.map +0 -1
  101. package/types/CheckboxIndicator.d.ts.map +0 -1
  102. package/types/CheckboxStyledContext.d.ts.map +0 -1
  103. package/types/ScopedProps.d.ts.map +0 -1
  104. package/types/createCheckbox.d.ts.map +0 -1
  105. package/types/isIndeterminate.d.ts.map +0 -1
  106. package/types/utils.d.ts.map +0 -1
@@ -1,70 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var CheckboxIndicator_exports = {};
24
- __export(CheckboxIndicator_exports, {
25
- Checkbox: () => Checkbox
26
- });
27
- module.exports = __toCommonJS(CheckboxIndicator_exports);
28
- var import_core = require("@tamagui/core"), import_font_size = require("@tamagui/font-size"), import_helpers_tamagui = require("@tamagui/helpers-tamagui"), import_stacks = require("@tamagui/stacks"), React = __toESM(require("react")), import_Checkbox = require("./Checkbox"), import_CheckboxStyledContext = require("./CheckboxStyledContext"), import_utils = require("./utils"), import_jsx_runtime = require("react/jsx-runtime");
29
- const INDICATOR_NAME = "CheckboxIndicator", CheckboxIndicatorFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
30
- // use Checkbox for easier themes
31
- name: INDICATOR_NAME,
32
- context: import_CheckboxStyledContext.CheckboxStyledContext
33
- }), CheckboxIndicator = CheckboxIndicatorFrame.extractable(
34
- React.forwardRef(
35
- (props, forwardedRef) => {
36
- const {
37
- __scopeCheckbox,
38
- children: childrenProp,
39
- forceMount,
40
- disablePassStyles,
41
- ...indicatorProps
42
- } = props;
43
- process.env.NODE_ENV === "development" && !childrenProp && console.warn(
44
- "Warning: You created a Checkbox.Indicator without passing an child prop for it to use as an icon."
45
- );
46
- const context = (0, import_Checkbox.useCheckboxContext)(INDICATOR_NAME, __scopeCheckbox), styledContext = React.useContext(import_CheckboxStyledContext.CheckboxStyledContext), iconSize = (typeof styledContext.size == "number" ? styledContext.size * 0.65 : (0, import_font_size.getFontSize)(styledContext.size)) * styledContext.scaleIcon, theme = (0, import_core.useTheme)(), getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color: theme.color }), children = React.Children.toArray(childrenProp).map((child) => disablePassStyles || !React.isValidElement(child) ? child : getThemedIcon(child));
47
- return forceMount || (0, import_utils.isIndeterminate)(context.state) || context.state === !0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
48
- CheckboxIndicatorFrame,
49
- {
50
- "data-state": (0, import_utils.getState)(context.state),
51
- "data-disabled": context.disabled ? "" : void 0,
52
- pointerEvents: "none",
53
- ...indicatorProps,
54
- ref: forwardedRef,
55
- children
56
- }
57
- ) : null;
58
- }
59
- )
60
- );
61
- CheckboxIndicator.displayName = INDICATOR_NAME;
62
- const Checkbox = (0, import_core.withStaticProperties)(import_Checkbox.CheckboxComponent, {
63
- Indicator: CheckboxIndicator,
64
- Props: import_CheckboxStyledContext.CheckboxStyledContext.Provider
65
- });
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- Checkbox
69
- });
70
- //# sourceMappingURL=CheckboxIndicator.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/CheckboxIndicator.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;A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;AAAA,EACX,OAAO,mDAAsB;AAC/B,CAAC;",
5
- "names": []
6
- }
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var CheckboxIndicator_exports = {};
25
- __export(CheckboxIndicator_exports, {
26
- Checkbox: () => Checkbox
27
- });
28
- module.exports = __toCommonJS(CheckboxIndicator_exports);
29
- var import_core = require("@tamagui/core"), import_font_size = require("@tamagui/font-size"), import_helpers_tamagui = require("@tamagui/helpers-tamagui"), import_stacks = require("@tamagui/stacks"), React = __toESM(require("react")), import_Checkbox = require("./Checkbox"), import_CheckboxStyledContext = require("./CheckboxStyledContext"), import_utils = require("./utils"), import_jsx_runtime = require("react/jsx-runtime");
30
- const INDICATOR_NAME = "CheckboxIndicator", CheckboxIndicatorFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
31
- // use Checkbox for easier themes
32
- name: INDICATOR_NAME,
33
- context: import_CheckboxStyledContext.CheckboxStyledContext
34
- }), CheckboxIndicator = CheckboxIndicatorFrame.extractable(
35
- React.forwardRef(
36
- (props, forwardedRef) => {
37
- const {
38
- __scopeCheckbox,
39
- children: childrenProp,
40
- forceMount,
41
- disablePassStyles,
42
- ...indicatorProps
43
- } = props;
44
- process.env.NODE_ENV === "development" && !childrenProp && console.warn(
45
- "Warning: You created a Checkbox.Indicator without passing an child prop for it to use as an icon."
46
- );
47
- const context = (0, import_Checkbox.useCheckboxContext)(INDICATOR_NAME, __scopeCheckbox), styledContext = React.useContext(import_CheckboxStyledContext.CheckboxStyledContext), iconSize = (typeof styledContext.size == "number" ? styledContext.size * 0.65 : (0, import_font_size.getFontSize)(styledContext.size)) * styledContext.scaleIcon, theme = (0, import_core.useTheme)(), getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color: theme.color }), children = React.Children.toArray(childrenProp).map((child) => disablePassStyles || !React.isValidElement(child) ? child : getThemedIcon(child));
48
- return forceMount || (0, import_utils.isIndeterminate)(context.state) || context.state === !0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
- CheckboxIndicatorFrame,
50
- {
51
- "data-state": (0, import_utils.getState)(context.state),
52
- "data-disabled": context.disabled ? "" : void 0,
53
- pointerEvents: "none",
54
- ...indicatorProps,
55
- ref: forwardedRef,
56
- children
57
- }
58
- ) : null;
59
- }
60
- )
61
- );
62
- CheckboxIndicator.displayName = INDICATOR_NAME;
63
- const Checkbox = (0, import_core.withStaticProperties)(import_Checkbox.CheckboxComponent, {
64
- Indicator: CheckboxIndicator,
65
- Props: import_CheckboxStyledContext.CheckboxStyledContext.Provider
66
- });
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
69
- Checkbox
70
- });
71
- //# sourceMappingURL=CheckboxIndicator.js.map
@@ -1,6 +0,0 @@
1
- {
2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G;AAAA,IACT;AAAA,EACF;AACF;AAEA,kBAAkB,cAAc;AAEzB,MAAM,eAAW,kCAAqB,mCAAmB;AAAA,EAC9D,WAAW;AAAA,EACX,OAAO,mDAAsB;AAC/B,CAAC;",
5
- "names": []
6
- }
@@ -1,29 +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 CheckboxStyledContext_exports = {};
16
- __export(CheckboxStyledContext_exports, {
17
- CheckboxStyledContext: () => CheckboxStyledContext
18
- });
19
- module.exports = __toCommonJS(CheckboxStyledContext_exports);
20
- var import_core = require("@tamagui/core");
21
- const CheckboxStyledContext = (0, import_core.createStyledContext)({
22
- size: "$true",
23
- scaleIcon: 1
24
- });
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- CheckboxStyledContext
28
- });
29
- //# sourceMappingURL=CheckboxStyledContext.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/CheckboxStyledContext.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAgD;AAEzC,MAAM,4BAAwB,iCAAoB;AAAA,EACvD,MAAM;AAAA,EACN,WAAW;AACb,CAAC;",
5
- "names": []
6
- }
@@ -1,30 +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 CheckboxStyledContext_exports = {};
17
- __export(CheckboxStyledContext_exports, {
18
- CheckboxStyledContext: () => CheckboxStyledContext
19
- });
20
- module.exports = __toCommonJS(CheckboxStyledContext_exports);
21
- var import_core = require("@tamagui/core");
22
- const CheckboxStyledContext = (0, import_core.createStyledContext)({
23
- size: "$true",
24
- scaleIcon: 1
25
- });
26
- // Annotate the CommonJS export names for ESM import in node:
27
- 0 && (module.exports = {
28
- CheckboxStyledContext
29
- });
30
- //# sourceMappingURL=CheckboxStyledContext.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/CheckboxStyledContext.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAgD;AAEzC,MAAM,4BAAwB,iCAAoB;AAAA,EACvD,MAAM;AAAA,EACN,WAAW;AACb,CAAC;",
5
- "names": []
6
- }
@@ -1,189 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var ScopedProps_exports = {};
24
- __export(ScopedProps_exports, {
25
- CheckboxComponent: () => CheckboxComponent,
26
- CheckboxFrame: () => CheckboxFrame,
27
- CheckboxProvider: () => CheckboxProvider,
28
- createCheckboxScope: () => createCheckboxScope,
29
- useCheckboxContext: () => useCheckboxContext
30
- });
31
- module.exports = __toCommonJS(ScopedProps_exports);
32
- var import_core = require("@tamagui/core"), import_create_context = require("@tamagui/create-context"), import_focusable = require("@tamagui/focusable"), import_get_token = require("@tamagui/get-token"), import_label = require("@tamagui/label"), import_stacks = require("@tamagui/stacks"), import_use_controllable_state = require("@tamagui/use-controllable-state"), React = __toESM(require("react")), import_BubbleInput = require("./BubbleInput"), import_CheckboxStyledContext = require("./CheckboxStyledContext"), import_isIndeterminate = require("./isIndeterminate"), import_jsx_runtime = require("react/jsx-runtime");
33
- const CHECKBOX_NAME = "Checkbox", CheckboxFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
34
- name: CHECKBOX_NAME,
35
- tag: "button",
36
- context: import_CheckboxStyledContext.CheckboxStyledContext,
37
- variants: {
38
- unstyled: {
39
- false: {
40
- size: "$true",
41
- backgroundColor: "$background",
42
- alignItems: "center",
43
- justifyContent: "center",
44
- pressTheme: !0,
45
- focusable: !0,
46
- borderWidth: 1,
47
- borderColor: "$borderColor",
48
- hoverStyle: {
49
- borderColor: "$borderColorHover"
50
- },
51
- focusStyle: {
52
- borderColor: "$borderColorFocus",
53
- outlineStyle: "solid",
54
- outlineWidth: 2,
55
- outlineColor: "$borderColorFocus"
56
- }
57
- }
58
- },
59
- disabled: {
60
- true: {
61
- pointerEvents: "none",
62
- userSelect: "none",
63
- cursor: "not-allowed",
64
- hoverStyle: {
65
- borderColor: "$borderColor",
66
- backgroundColor: "$background"
67
- },
68
- pressStyle: {
69
- borderColor: "$borderColor",
70
- backgroundColor: "$backgroundColor"
71
- },
72
- focusStyle: {
73
- outlineWidth: 0
74
- }
75
- }
76
- },
77
- size: {
78
- "...size": (val, { tokens }) => ({
79
- borderRadius: (0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) / 8
80
- })
81
- }
82
- },
83
- defaultVariants: {
84
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
85
- }
86
- }), [createCheckboxContext, createCheckboxScope] = (0, import_create_context.createContextScope)(CHECKBOX_NAME), [CheckboxProvider, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME), CheckboxComponent = CheckboxFrame.styleable(
87
- function(props, forwardedRef) {
88
- const {
89
- __scopeCheckbox,
90
- labelledBy: ariaLabelledby,
91
- name,
92
- checked: checkedProp,
93
- defaultChecked,
94
- required,
95
- scaleSize = 0.45,
96
- sizeAdjust = 0,
97
- disabled,
98
- value = "on",
99
- onCheckedChange,
100
- native,
101
- scaleIcon,
102
- ...checkboxProps
103
- } = props, [button, setButton] = React.useState(null), composedRefs = (0, import_core.useComposedRefs)(forwardedRef, (node) => setButton(node)), hasConsumerStoppedPropagationRef = React.useRef(!1), propsActive = (0, import_core.useProps)(props), isFormControl = import_core.isWeb ? button ? !!button.closest("form") : !0 : !1, [checked = !1, setChecked] = (0, import_use_controllable_state.useControllableState)({
104
- prop: checkedProp,
105
- defaultProp: defaultChecked,
106
- onChange: onCheckedChange
107
- }), styledContext = React.useContext(import_CheckboxStyledContext.CheckboxStyledContext), adjustedSize = (0, import_core.getVariableValue)(
108
- (0, import_get_token.getSize)(propsActive.size ?? (styledContext == null ? void 0 : styledContext.size) ?? "$true", {
109
- shift: sizeAdjust
110
- })
111
- ), size = scaleSize ? Math.round(adjustedSize * scaleSize) : adjustedSize, labelId = (0, import_label.useLabelContext)(button);
112
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxProvider, { scope: __scopeCheckbox, state: checked, disabled, children: import_core.isWeb && native ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
113
- import_BubbleInput.BubbleInput,
114
- {
115
- control: button,
116
- bubbles: !hasConsumerStoppedPropagationRef.current,
117
- name,
118
- value,
119
- checked,
120
- required,
121
- disabled,
122
- id: props.id
123
- }
124
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
125
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
- CheckboxFrame,
127
- {
128
- width: size,
129
- height: size,
130
- tag: "button",
131
- role: "checkbox",
132
- "aria-labelledby": ariaLabelledby || labelId,
133
- "aria-checked": (0, import_isIndeterminate.isIndeterminate)(checked) ? "mixed" : checked,
134
- "aria-required": required,
135
- "data-state": (0, import_isIndeterminate.getState)(checked),
136
- "data-disabled": disabled ? "" : void 0,
137
- disabled,
138
- ...checkboxProps,
139
- ref: composedRefs,
140
- ...import_core.isWeb && {
141
- type: "button",
142
- value,
143
- onKeyDown: (0, import_core.composeEventHandlers)(
144
- props.onKeyDown,
145
- (event) => {
146
- event.key === "Enter" && event.preventDefault();
147
- }
148
- )
149
- },
150
- onPress: (0, import_core.composeEventHandlers)(props.onPress, (event) => {
151
- setChecked(
152
- (prevChecked) => (0, import_isIndeterminate.isIndeterminate)(prevChecked) ? !0 : !prevChecked
153
- ), isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
154
- }),
155
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
156
- import_CheckboxStyledContext.CheckboxStyledContext.Provider,
157
- {
158
- size: propsActive.size ?? (styledContext == null ? void 0 : styledContext.size) ?? "$true",
159
- scaleIcon: scaleIcon ?? (styledContext == null ? void 0 : styledContext.scaleIcon) ?? 1,
160
- children: propsActive.children
161
- }
162
- )
163
- }
164
- ),
165
- import_core.isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
166
- import_BubbleInput.BubbleInput,
167
- {
168
- isHidden: !0,
169
- control: button,
170
- bubbles: !hasConsumerStoppedPropagationRef.current,
171
- name,
172
- value,
173
- checked,
174
- required,
175
- disabled
176
- }
177
- ) : null
178
- ] }) });
179
- }
180
- );
181
- // Annotate the CommonJS export names for ESM import in node:
182
- 0 && (module.exports = {
183
- CheckboxComponent,
184
- CheckboxFrame,
185
- CheckboxProvider,
186
- createCheckboxScope,
187
- useCheckboxContext
188
- });
189
- //# sourceMappingURL=ScopedProps.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ScopedProps.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAQO,0BAEP,wBAAmC,oCACnC,mBAAkC,+BAClC,mBAAwB,+BACxB,eAAgC,2BAChC,gBAA+B,4BAC/B,gCAAqC,4CACrC,QAAuB,2BAEvB,qBAA4B,0BAC5B,+BAAsC,oCACtC,yBAA0C,8BA4KhC;AArKV,MAAM,gBAAgB,YAET,oBAAgB,oBAAO,8BAAgB;AAAA,EAClD,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,SAAS;AAAA,EACT,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,MAAM;AAAA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M,eAAe;AAAA,cAClD;AAAA,YACF;AAAA,UACF;AAAA,UACA,aAAS,kCAAqB,MAAM,SAAgB,CAAC,UAAU;AAC7D;AAAA,cAAW,CAAC,oBACV,wCAAgB,WAAW,IAAI,KAAO,CAAC;AAAA,YACzC,GACI,kBACF,iCAAiC,UAAU,MAAM,qBAAqB,GAIjE,iCAAiC,WAAS,MAAM,gBAAgB;AAAA,UAEzE,CAAC;AAAA,UAED;AAAA,YAAC,mDAAsB;AAAA,YAAtB;AAAA,cACC,MAAM,YAAY,SAAQ,+CAAe,SAAQ;AAAA,cACjD,WAAW,cAAa,+CAAe,cAAa;AAAA,cAEnD,sBAAY;AAAA;AAAA,UACf;AAAA;AAAA,MACF;AAAA,MAEC,qBAAS,gBACR;AAAA,QAAC;AAAA;AAAA,UACC,UAAQ;AAAA,UACR,SAAS;AAAA,UACT,SAAS,CAAC,iCAAiC;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF,IACE;AAAA,OACN,GAEJ;AAAA,EAEJ;AACF;",
5
- "names": []
6
- }
@@ -1,199 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var ScopedProps_exports = {};
25
- __export(ScopedProps_exports, {
26
- CheckboxComponent: () => CheckboxComponent,
27
- CheckboxFrame: () => CheckboxFrame,
28
- CheckboxProvider: () => CheckboxProvider,
29
- createCheckboxScope: () => createCheckboxScope,
30
- useCheckboxContext: () => useCheckboxContext
31
- });
32
- module.exports = __toCommonJS(ScopedProps_exports);
33
- var import_core = require("@tamagui/core"), import_create_context = require("@tamagui/create-context"), import_focusable = require("@tamagui/focusable"), import_get_token = require("@tamagui/get-token"), import_label = require("@tamagui/label"), import_stacks = require("@tamagui/stacks"), import_use_controllable_state = require("@tamagui/use-controllable-state"), React = __toESM(require("react")), import_BubbleInput = require("./BubbleInput"), import_CheckboxStyledContext = require("./CheckboxStyledContext"), import_isIndeterminate = require("./isIndeterminate"), import_jsx_runtime = require("react/jsx-runtime");
34
- const CHECKBOX_NAME = "Checkbox", CheckboxFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
35
- name: CHECKBOX_NAME,
36
- tag: "button",
37
- context: import_CheckboxStyledContext.CheckboxStyledContext,
38
- variants: {
39
- unstyled: {
40
- false: {
41
- size: "$true",
42
- backgroundColor: "$background",
43
- alignItems: "center",
44
- justifyContent: "center",
45
- pressTheme: !0,
46
- focusable: !0,
47
- borderWidth: 1,
48
- borderColor: "$borderColor",
49
- hoverStyle: {
50
- borderColor: "$borderColorHover"
51
- },
52
- focusStyle: {
53
- borderColor: "$borderColorFocus",
54
- outlineStyle: "solid",
55
- outlineWidth: 2,
56
- outlineColor: "$borderColorFocus"
57
- }
58
- }
59
- },
60
- disabled: {
61
- true: {
62
- pointerEvents: "none",
63
- userSelect: "none",
64
- cursor: "not-allowed",
65
- hoverStyle: {
66
- borderColor: "$borderColor",
67
- backgroundColor: "$background"
68
- },
69
- pressStyle: {
70
- borderColor: "$borderColor",
71
- backgroundColor: "$backgroundColor"
72
- },
73
- focusStyle: {
74
- outlineWidth: 0
75
- }
76
- }
77
- },
78
- size: {
79
- "...size": (val, { tokens }) => ({
80
- borderRadius: (0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) / 8
81
- })
82
- }
83
- },
84
- defaultVariants: {
85
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
86
- }
87
- }), [createCheckboxContext, createCheckboxScope] = (0, import_create_context.createContextScope)(CHECKBOX_NAME), [CheckboxProvider, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME), CheckboxComponent = CheckboxFrame.styleable(
88
- function(props, forwardedRef) {
89
- const {
90
- __scopeCheckbox,
91
- labelledBy: ariaLabelledby,
92
- name,
93
- checked: checkedProp,
94
- defaultChecked,
95
- required,
96
- scaleSize = 0.45,
97
- sizeAdjust = 0,
98
- disabled,
99
- value = "on",
100
- onCheckedChange,
101
- native,
102
- scaleIcon,
103
- ...checkboxProps
104
- } = props, [button, setButton] = React.useState(null), composedRefs = (0, import_core.useComposedRefs)(forwardedRef, (node) => setButton(node)), hasConsumerStoppedPropagationRef = React.useRef(!1), propsActive = (0, import_core.useProps)(props), isFormControl = import_core.isWeb ? button ? !!button.closest("form") : !0 : !1, [checked = !1, setChecked] = (0, import_use_controllable_state.useControllableState)({
105
- prop: checkedProp,
106
- defaultProp: defaultChecked,
107
- onChange: onCheckedChange
108
- }), styledContext = React.useContext(import_CheckboxStyledContext.CheckboxStyledContext), adjustedSize = (0, import_core.getVariableValue)(
109
- (0, import_get_token.getSize)(propsActive.size ?? (styledContext == null ? void 0 : styledContext.size) ?? "$true", {
110
- shift: sizeAdjust
111
- })
112
- ), size = scaleSize ? Math.round(adjustedSize * scaleSize) : adjustedSize, labelId = (0, import_label.useLabelContext)(button), labelledBy = ariaLabelledby || labelId;
113
- return React.useEffect(() => {
114
- if (props.id && !disabled)
115
- return (0, import_focusable.registerFocusable)(props.id, {
116
- focusAndSelect: () => {
117
- setChecked((x) => !x);
118
- },
119
- focus: () => {
120
- }
121
- });
122
- }, [props.id, setChecked, disabled]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxProvider, { scope: __scopeCheckbox, state: checked, disabled, children: import_core.isWeb && native ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
- import_BubbleInput.BubbleInput,
124
- {
125
- control: button,
126
- bubbles: !hasConsumerStoppedPropagationRef.current,
127
- name,
128
- value,
129
- checked,
130
- required,
131
- disabled,
132
- id: props.id
133
- }
134
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
135
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
136
- CheckboxFrame,
137
- {
138
- width: size,
139
- height: size,
140
- tag: "button",
141
- role: "checkbox",
142
- "aria-labelledby": labelledBy,
143
- "aria-checked": (0, import_isIndeterminate.isIndeterminate)(checked) ? "mixed" : checked,
144
- "aria-required": required,
145
- "data-state": (0, import_isIndeterminate.getState)(checked),
146
- "data-disabled": disabled ? "" : void 0,
147
- disabled,
148
- ...checkboxProps,
149
- ref: composedRefs,
150
- ...import_core.isWeb && {
151
- type: "button",
152
- value,
153
- onKeyDown: (0, import_core.composeEventHandlers)(
154
- props.onKeyDown,
155
- (event) => {
156
- event.key === "Enter" && event.preventDefault();
157
- }
158
- )
159
- },
160
- onPress: (0, import_core.composeEventHandlers)(props.onPress, (event) => {
161
- setChecked(
162
- (prevChecked) => (0, import_isIndeterminate.isIndeterminate)(prevChecked) ? !0 : !prevChecked
163
- ), isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
164
- }),
165
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
166
- import_CheckboxStyledContext.CheckboxStyledContext.Provider,
167
- {
168
- size: propsActive.size ?? (styledContext == null ? void 0 : styledContext.size) ?? "$true",
169
- scaleIcon: scaleIcon ?? (styledContext == null ? void 0 : styledContext.scaleIcon) ?? 1,
170
- children: propsActive.children
171
- }
172
- )
173
- }
174
- ),
175
- import_core.isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
176
- import_BubbleInput.BubbleInput,
177
- {
178
- isHidden: !0,
179
- control: button,
180
- bubbles: !hasConsumerStoppedPropagationRef.current,
181
- name,
182
- value,
183
- checked,
184
- required,
185
- disabled
186
- }
187
- ) : null
188
- ] }) });
189
- }
190
- );
191
- // Annotate the CommonJS export names for ESM import in node:
192
- 0 && (module.exports = {
193
- CheckboxComponent,
194
- CheckboxFrame,
195
- CheckboxProvider,
196
- createCheckboxScope,
197
- useCheckboxContext
198
- });
199
- //# sourceMappingURL=ScopedProps.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ScopedProps.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAQO,0BAEP,wBAAmC,oCACnC,mBAAkC,+BAClC,mBAAwB,+BACxB,eAAgC,2BAChC,gBAA+B,4BAC/B,gCAAqC,4CACrC,QAAuB,2BAEvB,qBAA4B,0BAC5B,+BAAsC,oCACtC,yBAA0C,8BA4KhC;AArKV,MAAM,gBAAgB,YAET,oBAAgB,oBAAO,8BAAgB;AAAA,EAClD,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,SAAS;AAAA,EACT,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,MAAM;AAAA,QACN,iBAAiB;AAAA,QACjB,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,aAAa;AAAA,QACb,aAAa;AAAA,QAEb,YAAY;AAAA,UAC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