@tamagui/checkbox-headless 2.7.6 → 3.0.0-beta.637.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.
- package/dist/cjs/BubbleInput.cjs +58 -71
- package/dist/cjs/BubbleInput.native.cjs +77 -0
- package/dist/cjs/BubbleInput.native.js +58 -70
- package/dist/cjs/BubbleInput.native.js.map +1 -1
- package/dist/cjs/index.cjs +10 -11
- package/dist/cjs/index.native.cjs +22 -0
- package/dist/cjs/index.native.js +10 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/useCheckbox.cjs +64 -80
- package/dist/cjs/useCheckbox.native.cjs +95 -0
- package/dist/cjs/useCheckbox.native.js +71 -86
- package/dist/cjs/useCheckbox.native.js.map +1 -1
- package/dist/cjs/utils.cjs +18 -19
- package/dist/cjs/utils.native.cjs +35 -0
- package/dist/cjs/utils.native.js +18 -18
- package/dist/cjs/utils.native.js.map +1 -1
- package/dist/esm/BubbleInput.mjs +42 -45
- package/dist/esm/BubbleInput.mjs.map +1 -1
- package/dist/esm/BubbleInput.native.js +43 -46
- package/dist/esm/BubbleInput.native.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/index.native.js +3 -3
- package/dist/esm/useCheckbox.mjs +48 -54
- package/dist/esm/useCheckbox.mjs.map +1 -1
- package/dist/esm/useCheckbox.native.js +56 -62
- package/dist/esm/useCheckbox.native.js.map +1 -1
- package/dist/esm/utils.mjs +3 -2
- package/dist/esm/utils.mjs.map +1 -1
- package/dist/esm/utils.native.js +3 -2
- package/dist/esm/utils.native.js.map +1 -1
- package/dist/jsx/BubbleInput.mjs +42 -45
- package/dist/jsx/BubbleInput.mjs.map +1 -1
- package/dist/jsx/BubbleInput.native.cjs +77 -0
- package/dist/jsx/BubbleInput.native.js +58 -70
- package/dist/jsx/BubbleInput.native.js.map +1 -1
- package/dist/jsx/index.js +3 -3
- package/dist/jsx/index.mjs +3 -3
- package/dist/jsx/index.native.cjs +22 -0
- package/dist/jsx/index.native.js +10 -10
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/useCheckbox.mjs +48 -54
- package/dist/jsx/useCheckbox.mjs.map +1 -1
- package/dist/jsx/useCheckbox.native.cjs +95 -0
- package/dist/jsx/useCheckbox.native.js +71 -86
- package/dist/jsx/useCheckbox.native.js.map +1 -1
- package/dist/jsx/utils.mjs +3 -2
- package/dist/jsx/utils.mjs.map +1 -1
- package/dist/jsx/utils.native.cjs +35 -0
- package/dist/jsx/utils.native.js +18 -18
- package/dist/jsx/utils.native.js.map +1 -1
- package/package.json +12 -12
- package/types/BubbleInput.d.ts +1 -1
- package/types/BubbleInput.d.ts.map +1 -1
- package/types/useCheckbox.d.ts +4 -4
- package/types/utils.d.ts +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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,"
|
|
1
|
+
{"version":3,"file":"useCheckbox.native.js","names":[],"sources":["jsx/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":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAA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ChD,iBAAiB,WAAW,KAAK,KAAK;IACtC;IACA,WAAW,WAAW,KAAK,IAAI;GACjC;GACA,SAAS,WAAW,KAAK,IAAI;EAC/B;CACF;AACF"}
|
package/dist/jsx/utils.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
function isIndeterminate(checked) {
|
|
2
|
-
|
|
2
|
+
return checked === "indeterminate";
|
|
3
3
|
}
|
|
4
4
|
function getState(checked) {
|
|
5
|
-
|
|
5
|
+
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
export { getState, isIndeterminate };
|
|
8
9
|
//# sourceMappingURL=utils.mjs.map
|
package/dist/jsx/utils.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["jsx/utils.js"],"sourcesContent":["function isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nexport {\n getState,\n isIndeterminate\n};\n//# sourceMappingURL=utils.js.map\n"],"mappings":";AAAA,SAAS,gBAAgB,SAAS;CAChC,OAAO,YAAY;AACrB;AACA,SAAS,SAAS,SAAS;CACzB,OAAO,gBAAgB,OAAO,IAAI,kBAAkB,UAAU,YAAY;AAC5E"}
|
|
@@ -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
|
+
}
|
package/dist/jsx/utils.native.js
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
28
|
-
|
|
26
|
+
getState: () => getState,
|
|
27
|
+
isIndeterminate: () => isIndeterminate
|
|
29
28
|
});
|
|
30
29
|
module.exports = __toCommonJS(utils_exports);
|
|
31
30
|
function isIndeterminate(checked) {
|
|
32
|
-
|
|
31
|
+
return checked === "indeterminate";
|
|
33
32
|
}
|
|
34
33
|
function getState(checked) {
|
|
35
|
-
|
|
34
|
+
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
36
35
|
}
|
|
36
|
+
|
|
37
37
|
//# sourceMappingURL=utils.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils.native.js","names":[],"sources":["jsx/utils.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 utils_exports = {};\n__export(utils_exports, {\n getState: () => getState,\n isIndeterminate: () => isIndeterminate\n});\nmodule.exports = __toCommonJS(utils_exports);\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\n//# sourceMappingURL=utils.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,gBAAgB,CAAC;AACrB,SAAS,eAAe;CACtB,gBAAgB;CAChB,uBAAuB;AACzB,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,SAAS,gBAAgB,SAAS;CAChC,OAAO,YAAY;AACrB;AACA,SAAS,SAAS,SAAS;CACzB,OAAO,gBAAgB,OAAO,IAAI,kBAAkB,UAAU,YAAY;AAC5E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/checkbox-headless",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.637.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
"clean:build": "tamagui-build clean:build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tamagui/compose-refs": "
|
|
39
|
-
"@tamagui/constants": "
|
|
40
|
-
"@tamagui/create-context": "
|
|
41
|
-
"@tamagui/focusable": "
|
|
42
|
-
"@tamagui/helpers": "
|
|
43
|
-
"@tamagui/label": "
|
|
44
|
-
"@tamagui/use-controllable-state": "
|
|
45
|
-
"@tamagui/use-previous": "
|
|
46
|
-
"@tamagui/web": "
|
|
38
|
+
"@tamagui/compose-refs": "3.0.0-beta.637.1",
|
|
39
|
+
"@tamagui/constants": "3.0.0-beta.637.1",
|
|
40
|
+
"@tamagui/create-context": "3.0.0-beta.637.1",
|
|
41
|
+
"@tamagui/focusable": "3.0.0-beta.637.1",
|
|
42
|
+
"@tamagui/helpers": "3.0.0-beta.637.1",
|
|
43
|
+
"@tamagui/label": "3.0.0-beta.637.1",
|
|
44
|
+
"@tamagui/use-controllable-state": "3.0.0-beta.637.1",
|
|
45
|
+
"@tamagui/use-previous": "3.0.0-beta.637.1",
|
|
46
|
+
"@tamagui/web": "3.0.0-beta.637.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@tamagui/build": "
|
|
49
|
+
"@tamagui/build": "3.0.0-beta.637.1",
|
|
50
50
|
"react": ">=19",
|
|
51
|
-
"react-native": "0.
|
|
51
|
+
"react-native": "0.86.2"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": ">=19"
|
package/types/BubbleInput.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export interface BubbleInputProps extends Omit<React.ComponentProps<'input'>, 'c
|
|
|
6
6
|
bubbles: boolean;
|
|
7
7
|
isHidden?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare const BubbleInput: (props: BubbleInputProps) =>
|
|
9
|
+
export declare const BubbleInput: (props: BubbleInputProps) => React.JSX.Element;
|
|
10
10
|
//# sourceMappingURL=BubbleInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleInput.d.ts","sourceRoot":"","sources":["../src/BubbleInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IACtF,OAAO,EAAE,YAAY,CAAA;IACrB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAEhB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"BubbleInput.d.ts","sourceRoot":"","sources":["../src/BubbleInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IACtF,OAAO,EAAE,YAAY,CAAA;IACrB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAEhB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,UAAW,gBAAgB,sBAiDlD,CAAA"}
|
package/types/useCheckbox.d.ts
CHANGED
|
@@ -23,20 +23,20 @@ export declare function useCheckbox<R extends View, P extends CheckboxProps>(pro
|
|
|
23
23
|
CheckedState,
|
|
24
24
|
React.Dispatch<React.SetStateAction<CheckedState>>
|
|
25
25
|
], ref: React.Ref<R>): {
|
|
26
|
-
bubbleInput:
|
|
26
|
+
bubbleInput: React.JSX.Element | null;
|
|
27
27
|
checkboxRef: (node: R | null) => void;
|
|
28
28
|
checkboxProps: {
|
|
29
29
|
role: string;
|
|
30
30
|
'aria-labelledby': string | undefined;
|
|
31
31
|
'aria-checked': string | boolean;
|
|
32
|
-
} & Omit<P, "disabled" | "labelledBy" | "name" | "
|
|
33
|
-
onPress: import("@tamagui/web").EventHandler<import("react-native").GestureResponderEvent> | undefined;
|
|
32
|
+
} & Omit<P, "disabled" | "labelledBy" | "name" | "onCheckedChange" | "required" | "value"> & {
|
|
34
33
|
type?: string | undefined;
|
|
35
34
|
value?: string | undefined;
|
|
36
35
|
'data-state'?: string | undefined;
|
|
37
36
|
'data-disabled'?: string | undefined;
|
|
38
37
|
disabled?: boolean | undefined;
|
|
39
|
-
onKeyDown?: import("@tamagui/
|
|
38
|
+
onKeyDown?: import("@tamagui/helpers").EventHandler<React.KeyboardEvent<HTMLButtonElement>> | undefined;
|
|
39
|
+
onPress: import("@tamagui/helpers").EventHandler<import("react-native").GestureResponderEvent> | undefined;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
export {};
|
package/types/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CheckedState } from './useCheckbox';
|
|
2
2
|
export declare function isIndeterminate(checked?: CheckedState): checked is 'indeterminate';
|
|
3
|
-
export declare function getState(checked: CheckedState): "
|
|
3
|
+
export declare function getState(checked: CheckedState): "checked" | "indeterminate" | "unchecked";
|
|
4
4
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|
package/dist/esm/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|
package/dist/jsx/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|
package/dist/jsx/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|