@tamagui/checkbox-headless 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 (61) hide show
  1. package/dist/cjs/BubbleInput.cjs +58 -71
  2. package/dist/cjs/BubbleInput.native.cjs +77 -0
  3. package/dist/cjs/BubbleInput.native.js +58 -70
  4. package/dist/cjs/BubbleInput.native.js.map +1 -1
  5. package/dist/cjs/index.cjs +10 -11
  6. package/dist/cjs/index.native.cjs +22 -0
  7. package/dist/cjs/index.native.js +10 -10
  8. package/dist/cjs/index.native.js.map +1 -1
  9. package/dist/cjs/useCheckbox.cjs +64 -80
  10. package/dist/cjs/useCheckbox.native.cjs +95 -0
  11. package/dist/cjs/useCheckbox.native.js +71 -86
  12. package/dist/cjs/useCheckbox.native.js.map +1 -1
  13. package/dist/cjs/utils.cjs +18 -19
  14. package/dist/cjs/utils.native.cjs +35 -0
  15. package/dist/cjs/utils.native.js +18 -18
  16. package/dist/cjs/utils.native.js.map +1 -1
  17. package/dist/esm/BubbleInput.mjs +42 -45
  18. package/dist/esm/BubbleInput.mjs.map +1 -1
  19. package/dist/esm/BubbleInput.native.js +43 -46
  20. package/dist/esm/BubbleInput.native.js.map +1 -1
  21. package/dist/esm/index.js +3 -3
  22. package/dist/esm/index.mjs +3 -3
  23. package/dist/esm/index.native.js +3 -3
  24. package/dist/esm/useCheckbox.mjs +48 -54
  25. package/dist/esm/useCheckbox.mjs.map +1 -1
  26. package/dist/esm/useCheckbox.native.js +56 -62
  27. package/dist/esm/useCheckbox.native.js.map +1 -1
  28. package/dist/esm/utils.mjs +3 -2
  29. package/dist/esm/utils.mjs.map +1 -1
  30. package/dist/esm/utils.native.js +3 -2
  31. package/dist/esm/utils.native.js.map +1 -1
  32. package/dist/jsx/BubbleInput.mjs +42 -45
  33. package/dist/jsx/BubbleInput.mjs.map +1 -1
  34. package/dist/jsx/BubbleInput.native.cjs +77 -0
  35. package/dist/jsx/BubbleInput.native.js +58 -70
  36. package/dist/jsx/BubbleInput.native.js.map +1 -1
  37. package/dist/jsx/index.js +3 -3
  38. package/dist/jsx/index.mjs +3 -3
  39. package/dist/jsx/index.native.cjs +22 -0
  40. package/dist/jsx/index.native.js +10 -10
  41. package/dist/jsx/index.native.js.map +1 -1
  42. package/dist/jsx/useCheckbox.mjs +48 -54
  43. package/dist/jsx/useCheckbox.mjs.map +1 -1
  44. package/dist/jsx/useCheckbox.native.cjs +95 -0
  45. package/dist/jsx/useCheckbox.native.js +71 -86
  46. package/dist/jsx/useCheckbox.native.js.map +1 -1
  47. package/dist/jsx/utils.mjs +3 -2
  48. package/dist/jsx/utils.mjs.map +1 -1
  49. package/dist/jsx/utils.native.cjs +35 -0
  50. package/dist/jsx/utils.native.js +18 -18
  51. package/dist/jsx/utils.native.js.map +1 -1
  52. package/package.json +12 -12
  53. package/types/BubbleInput.d.ts +1 -1
  54. package/types/BubbleInput.d.ts.map +1 -1
  55. package/types/useCheckbox.d.ts +4 -4
  56. package/types/utils.d.ts +1 -1
  57. package/dist/esm/index.js.map +0 -1
  58. package/dist/esm/index.mjs.map +0 -1
  59. package/dist/esm/index.native.js.map +0 -1
  60. package/dist/jsx/index.js.map +0 -1
  61. package/dist/jsx/index.mjs.map +0 -1
@@ -1,3 +1,4 @@
1
+
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -5,36 +6,27 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
6
  var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
30
26
  }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
28
  var useCheckbox_exports = {};
35
- __export(useCheckbox_exports, {
36
- useCheckbox: () => useCheckbox
37
- });
29
+ __export(useCheckbox_exports, { useCheckbox: () => useCheckbox });
38
30
  module.exports = __toCommonJS(useCheckbox_exports);
39
31
  var import_compose_refs = require("@tamagui/compose-refs");
40
32
  var import_constants = require("@tamagui/constants");
@@ -45,58 +37,50 @@ var import_BubbleInput = require("./BubbleInput.cjs");
45
37
  var import_utils = require("./utils.cjs");
46
38
  var import_jsx_runtime = require("react/jsx-runtime");
47
39
  function useCheckbox(props, [checked, setChecked], ref) {
48
- const {
49
- labelledBy: ariaLabelledby,
50
- name,
51
- required,
52
- disabled,
53
- value = "on",
54
- onCheckedChange,
55
- ...checkboxProps
56
- } = props;
57
- const [button, setButton] = import_react.default.useState(null);
58
- const composedRefs = (0, import_compose_refs.useComposedRefs)(ref, setButton);
59
- const hasConsumerStoppedPropagationRef = import_react.default.useRef(false);
60
- const isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
61
- const labelId = (0, import_label.useLabelContext)(button);
62
- const labelledBy = ariaLabelledby || labelId;
63
- const parentKeyDown = props.onKeyDown;
64
- const handleKeyDown = (0, import_react.useMemo)(() => (0, import_helpers.composeEventHandlers)(parentKeyDown, event => {
65
- if (event.key === "Enter") event.preventDefault();
66
- }), [parentKeyDown]);
67
- const handlePress = (0, import_react.useMemo)(() => (0, import_helpers.composeEventHandlers)(props.onPress, event => {
68
- setChecked(prevChecked => (0, import_utils.isIndeterminate)(prevChecked) ? true : !prevChecked);
69
- if (isFormControl && "isPropagationStopped" in event) {
70
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
71
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
72
- }
73
- }), [isFormControl]);
74
- return {
75
- bubbleInput: import_constants.isWeb && isFormControl ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
76
- isHidden: true,
77
- control: button,
78
- bubbles: !hasConsumerStoppedPropagationRef.current,
79
- name,
80
- value,
81
- checked,
82
- required,
83
- disabled
84
- }) : null,
85
- checkboxRef: composedRefs,
86
- checkboxProps: {
87
- role: "checkbox",
88
- "aria-labelledby": labelledBy,
89
- "aria-checked": (0, import_utils.isIndeterminate)(checked) ? "mixed" : checked,
90
- ...checkboxProps,
91
- ...(import_constants.isWeb && {
92
- type: "button",
93
- value,
94
- "data-state": (0, import_utils.getState)(checked),
95
- "data-disabled": disabled ? "" : void 0,
96
- disabled,
97
- onKeyDown: disabled ? void 0 : handleKeyDown
98
- }),
99
- onPress: disabled ? void 0 : handlePress
100
- }
101
- };
102
- }
40
+ const { labelledBy: ariaLabelledby, name, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props;
41
+ const [button, setButton] = import_react.default.useState(null);
42
+ const composedRefs = (0, import_compose_refs.useComposedRefs)(ref, setButton);
43
+ const hasConsumerStoppedPropagationRef = import_react.default.useRef(false);
44
+ const isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
45
+ const labelId = (0, import_label.useLabelContext)(button);
46
+ const labelledBy = ariaLabelledby || labelId;
47
+ const parentKeyDown = props.onKeyDown;
48
+ const handleKeyDown = (0, import_react.useMemo)(() => (0, import_helpers.composeEventHandlers)(parentKeyDown, (event) => {
49
+ if (event.key === "Enter") event.preventDefault();
50
+ }), [parentKeyDown]);
51
+ const handlePress = (0, import_react.useMemo)(() => (0, import_helpers.composeEventHandlers)(props.onPress, (event) => {
52
+ setChecked((prevChecked) => (0, import_utils.isIndeterminate)(prevChecked) ? true : !prevChecked);
53
+ if (isFormControl && "isPropagationStopped" in event) {
54
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
55
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
56
+ }
57
+ }), [isFormControl]);
58
+ return {
59
+ bubbleInput: import_constants.isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
60
+ isHidden: true,
61
+ control: button,
62
+ bubbles: !hasConsumerStoppedPropagationRef.current,
63
+ name,
64
+ value,
65
+ checked,
66
+ required,
67
+ disabled
68
+ }) : null,
69
+ checkboxRef: composedRefs,
70
+ checkboxProps: {
71
+ role: "checkbox",
72
+ "aria-labelledby": labelledBy,
73
+ "aria-checked": (0, import_utils.isIndeterminate)(checked) ? "mixed" : checked,
74
+ ...checkboxProps,
75
+ ...import_constants.isWeb && {
76
+ type: "button",
77
+ value,
78
+ "data-state": (0, import_utils.getState)(checked),
79
+ "data-disabled": disabled ? "" : void 0,
80
+ disabled,
81
+ onKeyDown: disabled ? void 0 : handleKeyDown
82
+ },
83
+ onPress: disabled ? void 0 : handlePress
84
+ }
85
+ };
86
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
+ get: () => from[key],
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: true
28
+ }) : target, mod));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var useCheckbox_exports = {};
31
+ __export(useCheckbox_exports, { useCheckbox: () => useCheckbox });
32
+ module.exports = __toCommonJS(useCheckbox_exports);
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var import_compose_refs = require("@tamagui/compose-refs");
35
+ var import_constants = require("@tamagui/constants");
36
+ var import_helpers = require("@tamagui/helpers");
37
+ var import_label = require("@tamagui/label");
38
+ var import_react = __toESM(require("react"), 1);
39
+ var import_BubbleInput = require("./BubbleInput.native.js");
40
+ var import_utils = require("./utils.native.js");
41
+ function useCheckbox(props, param, ref) {
42
+ var [checked, setChecked] = param;
43
+ var { labelledBy: ariaLabelledby, name, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props;
44
+ var [button, setButton] = import_react.default.useState(null);
45
+ var composedRefs = (0, import_compose_refs.useComposedRefs)(ref, setButton);
46
+ var hasConsumerStoppedPropagationRef = import_react.default.useRef(false);
47
+ var isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
48
+ var labelId = (0, import_label.useLabelContext)(button);
49
+ var labelledBy = ariaLabelledby || labelId;
50
+ var parentKeyDown = props.onKeyDown;
51
+ var handleKeyDown = (0, import_react.useMemo)(function() {
52
+ return (0, import_helpers.composeEventHandlers)(parentKeyDown, function(event) {
53
+ if (event.key === "Enter") event.preventDefault();
54
+ });
55
+ }, [parentKeyDown]);
56
+ var handlePress = (0, import_react.useMemo)(function() {
57
+ return (0, import_helpers.composeEventHandlers)(props.onPress, function(event) {
58
+ setChecked(function(prevChecked) {
59
+ return (0, import_utils.isIndeterminate)(prevChecked) ? true : !prevChecked;
60
+ });
61
+ if (isFormControl && "isPropagationStopped" in event) {
62
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
63
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
64
+ }
65
+ });
66
+ }, [isFormControl]);
67
+ return {
68
+ bubbleInput: import_constants.isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
69
+ isHidden: true,
70
+ control: button,
71
+ bubbles: !hasConsumerStoppedPropagationRef.current,
72
+ name,
73
+ value,
74
+ checked,
75
+ required,
76
+ disabled
77
+ }) : null,
78
+ checkboxRef: composedRefs,
79
+ checkboxProps: {
80
+ role: "checkbox",
81
+ "aria-labelledby": labelledBy,
82
+ "aria-checked": (0, import_utils.isIndeterminate)(checked) ? "mixed" : checked,
83
+ ...checkboxProps,
84
+ ...import_constants.isWeb && {
85
+ type: "button",
86
+ value,
87
+ "data-state": (0, import_utils.getState)(checked),
88
+ "data-disabled": disabled ? "" : void 0,
89
+ disabled,
90
+ onKeyDown: disabled ? void 0 : handleKeyDown
91
+ },
92
+ onPress: disabled ? void 0 : handlePress
93
+ }
94
+ };
95
+ }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __create = Object.create;
4
5
  var __defProp = Object.defineProperty;
5
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -7,36 +8,27 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
8
  var __getProtoOf = Object.getPrototypeOf;
8
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
10
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
14
15
  };
15
16
  var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: () => from[key],
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
+ get: () => from[key],
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
22
+ }
23
+ return to;
23
24
  };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: true
32
28
  }) : target, mod));
33
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
- value: true
35
- }), mod);
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
30
  var useCheckbox_exports = {};
37
- __export(useCheckbox_exports, {
38
- useCheckbox: () => useCheckbox
39
- });
31
+ __export(useCheckbox_exports, { useCheckbox: () => useCheckbox });
40
32
  module.exports = __toCommonJS(useCheckbox_exports);
41
33
  var import_jsx_runtime = require("react/jsx-runtime");
42
34
  var import_compose_refs = require("@tamagui/compose-refs");
@@ -47,66 +39,59 @@ var import_react = __toESM(require("react"), 1);
47
39
  var import_BubbleInput = require("./BubbleInput.native.js");
48
40
  var import_utils = require("./utils.native.js");
49
41
  function useCheckbox(props, param, ref) {
50
- var [checked, setChecked] = param;
51
- var {
52
- labelledBy: ariaLabelledby,
53
- name,
54
- required,
55
- disabled,
56
- value = "on",
57
- onCheckedChange,
58
- ...checkboxProps
59
- } = props;
60
- var [button, setButton] = import_react.default.useState(null);
61
- var composedRefs = (0, import_compose_refs.useComposedRefs)(ref, setButton);
62
- var hasConsumerStoppedPropagationRef = import_react.default.useRef(false);
63
- var isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
64
- var labelId = (0, import_label.useLabelContext)(button);
65
- var labelledBy = ariaLabelledby || labelId;
66
- var parentKeyDown = props.onKeyDown;
67
- var handleKeyDown = (0, import_react.useMemo)(function () {
68
- return (0, import_helpers.composeEventHandlers)(parentKeyDown, function (event) {
69
- if (event.key === "Enter") event.preventDefault();
70
- });
71
- }, [parentKeyDown]);
72
- var handlePress = (0, import_react.useMemo)(function () {
73
- return (0, import_helpers.composeEventHandlers)(props.onPress, function (event) {
74
- setChecked(function (prevChecked) {
75
- return (0, import_utils.isIndeterminate)(prevChecked) ? true : !prevChecked;
76
- });
77
- if (isFormControl && "isPropagationStopped" in event) {
78
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
79
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
80
- }
81
- });
82
- }, [isFormControl]);
83
- return {
84
- bubbleInput: import_constants.isWeb && isFormControl ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
85
- isHidden: true,
86
- control: button,
87
- bubbles: !hasConsumerStoppedPropagationRef.current,
88
- name,
89
- value,
90
- checked,
91
- required,
92
- disabled
93
- }) : null,
94
- checkboxRef: composedRefs,
95
- checkboxProps: {
96
- role: "checkbox",
97
- "aria-labelledby": labelledBy,
98
- "aria-checked": (0, import_utils.isIndeterminate)(checked) ? "mixed" : checked,
99
- ...checkboxProps,
100
- ...(import_constants.isWeb && {
101
- type: "button",
102
- value,
103
- "data-state": (0, import_utils.getState)(checked),
104
- "data-disabled": disabled ? "" : void 0,
105
- disabled,
106
- onKeyDown: disabled ? void 0 : handleKeyDown
107
- }),
108
- onPress: disabled ? void 0 : handlePress
109
- }
110
- };
42
+ var [checked, setChecked] = param;
43
+ var { labelledBy: ariaLabelledby, name, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props;
44
+ var [button, setButton] = import_react.default.useState(null);
45
+ var composedRefs = (0, import_compose_refs.useComposedRefs)(ref, setButton);
46
+ var hasConsumerStoppedPropagationRef = import_react.default.useRef(false);
47
+ var isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
48
+ var labelId = (0, import_label.useLabelContext)(button);
49
+ var labelledBy = ariaLabelledby || labelId;
50
+ var parentKeyDown = props.onKeyDown;
51
+ var handleKeyDown = (0, import_react.useMemo)(function() {
52
+ return (0, import_helpers.composeEventHandlers)(parentKeyDown, function(event) {
53
+ if (event.key === "Enter") event.preventDefault();
54
+ });
55
+ }, [parentKeyDown]);
56
+ var handlePress = (0, import_react.useMemo)(function() {
57
+ return (0, import_helpers.composeEventHandlers)(props.onPress, function(event) {
58
+ setChecked(function(prevChecked) {
59
+ return (0, import_utils.isIndeterminate)(prevChecked) ? true : !prevChecked;
60
+ });
61
+ if (isFormControl && "isPropagationStopped" in event) {
62
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
63
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
64
+ }
65
+ });
66
+ }, [isFormControl]);
67
+ return {
68
+ bubbleInput: import_constants.isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
69
+ isHidden: true,
70
+ control: button,
71
+ bubbles: !hasConsumerStoppedPropagationRef.current,
72
+ name,
73
+ value,
74
+ checked,
75
+ required,
76
+ disabled
77
+ }) : null,
78
+ checkboxRef: composedRefs,
79
+ checkboxProps: {
80
+ role: "checkbox",
81
+ "aria-labelledby": labelledBy,
82
+ "aria-checked": (0, import_utils.isIndeterminate)(checked) ? "mixed" : checked,
83
+ ...checkboxProps,
84
+ ...import_constants.isWeb && {
85
+ type: "button",
86
+ value,
87
+ "data-state": (0, import_utils.getState)(checked),
88
+ "data-disabled": disabled ? "" : void 0,
89
+ disabled,
90
+ onKeyDown: disabled ? void 0 : handleKeyDown
91
+ },
92
+ onPress: disabled ? void 0 : handlePress
93
+ }
94
+ };
111
95
  }
96
+
112
97
  //# sourceMappingURL=useCheckbox.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useCheckbox_exports","__export","useCheckbox","module","exports","import_jsx_runtime","require","import_compose_refs","import_constants","import_helpers","import_label","import_react","__toESM","import_BubbleInput","import_utils","props","param","ref","checked","setChecked","labelledBy","ariaLabelledby","name","required","disabled","onCheckedChange","checkboxProps","button","setButton","default","useState","composedRefs","useComposedRefs","hasConsumerStoppedPropagationRef","useRef","isFormControl","isWeb","Boolean","closest","labelId","useLabelContext","parentKeyDown","onKeyDown","handleKeyDown","useMemo","composeEventHandlers","event","key","preventDefault","handlePress","onPress","prevChecked","isIndeterminate","current","isPropagationStopped","stopPropagation","bubbleInput","jsx","BubbleInput","isHidden","control","bubbles","checkboxRef","role","type","getState"],"sources":["../../src/useCheckbox.tsx"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"useCheckbox.native.js","names":[],"sources":["cjs/useCheckbox.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useCheckbox_exports = {};\n__export(useCheckbox_exports, {\n useCheckbox: () => useCheckbox\n});\nmodule.exports = __toCommonJS(useCheckbox_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_label = require(\"@tamagui/label\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_BubbleInput = require(\"./BubbleInput\");\nvar import_utils = require(\"./utils\");\nfunction useCheckbox(props, param, ref) {\n var [checked, setChecked] = param;\n var { labelledBy: ariaLabelledby, name, required, disabled, value = \"on\", onCheckedChange, ...checkboxProps } = props;\n var [button, setButton] = import_react.default.useState(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(ref, setButton);\n var hasConsumerStoppedPropagationRef = import_react.default.useRef(false);\n var isFormControl = import_constants.isWeb ? button ? Boolean(button.closest(\"form\")) : true : false;\n var labelId = (0, import_label.useLabelContext)(button);\n var labelledBy = ariaLabelledby || labelId;\n var parentKeyDown = props.onKeyDown;\n var handleKeyDown = (0, import_react.useMemo)(function() {\n return (0, import_helpers.composeEventHandlers)(parentKeyDown, function(event) {\n if (event.key === \"Enter\") event.preventDefault();\n });\n }, [\n parentKeyDown\n ]);\n var handlePress = (0, import_react.useMemo)(function() {\n return (0, import_helpers.composeEventHandlers)(props.onPress, function(event) {\n setChecked(function(prevChecked) {\n return (0, import_utils.isIndeterminate)(prevChecked) ? true : !prevChecked;\n });\n if (isFormControl && \"isPropagationStopped\" in event) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n });\n }, [\n isFormControl\n ]);\n return {\n bubbleInput: import_constants.isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {\n isHidden: true,\n control: button,\n bubbles: !hasConsumerStoppedPropagationRef.current,\n name,\n value,\n checked,\n required,\n disabled\n }) : null,\n checkboxRef: composedRefs,\n checkboxProps: {\n role: \"checkbox\",\n \"aria-labelledby\": labelledBy,\n \"aria-checked\": (0, import_utils.isIndeterminate)(checked) ? \"mixed\" : checked,\n ...checkboxProps,\n ...import_constants.isWeb && {\n type: \"button\",\n value,\n \"data-state\": (0, import_utils.getState)(checked),\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n onKeyDown: disabled ? void 0 : handleKeyDown\n },\n onPress: disabled ? void 0 : handlePress\n }\n };\n}\n//# sourceMappingURL=useCheckbox.js.map\n"],"mappings":"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"}
@@ -1,34 +1,33 @@
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 utils_exports = {};
24
23
  __export(utils_exports, {
25
- getState: () => getState,
26
- isIndeterminate: () => isIndeterminate
24
+ getState: () => getState,
25
+ isIndeterminate: () => isIndeterminate
27
26
  });
28
27
  module.exports = __toCommonJS(utils_exports);
29
28
  function isIndeterminate(checked) {
30
- return checked === "indeterminate";
29
+ return checked === "indeterminate";
31
30
  }
32
31
  function getState(checked) {
33
- return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
34
- }
32
+ return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
33
+ }
@@ -0,0 +1,35 @@
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 utils_exports = {};
25
+ __export(utils_exports, {
26
+ getState: () => getState,
27
+ isIndeterminate: () => isIndeterminate
28
+ });
29
+ module.exports = __toCommonJS(utils_exports);
30
+ function isIndeterminate(checked) {
31
+ return checked === "indeterminate";
32
+ }
33
+ function getState(checked) {
34
+ return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
35
+ }
@@ -1,37 +1,37 @@
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 utils_exports = {};
26
25
  __export(utils_exports, {
27
- getState: () => getState,
28
- isIndeterminate: () => isIndeterminate
26
+ getState: () => getState,
27
+ isIndeterminate: () => isIndeterminate
29
28
  });
30
29
  module.exports = __toCommonJS(utils_exports);
31
30
  function isIndeterminate(checked) {
32
- return checked === "indeterminate";
31
+ return checked === "indeterminate";
33
32
  }
34
33
  function getState(checked) {
35
- return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
34
+ return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
36
35
  }
36
+
37
37
  //# sourceMappingURL=utils.native.js.map