@tamagui/switch-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.
- package/dist/cjs/index.cjs +10 -11
- package/dist/cjs/index.native.cjs +21 -0
- package/dist/cjs/index.native.js +10 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/useSwitch.cjs +92 -110
- package/dist/cjs/useSwitch.native.cjs +51 -0
- package/dist/cjs/useSwitch.native.js +28 -37
- package/dist/cjs/useSwitch.native.js.map +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.native.js +1 -2
- package/dist/esm/useSwitch.mjs +76 -84
- package/dist/esm/useSwitch.mjs.map +1 -1
- package/dist/esm/useSwitch.native.js +11 -12
- package/dist/esm/useSwitch.native.js.map +1 -1
- package/dist/jsx/index.js +1 -2
- package/dist/jsx/index.mjs +1 -2
- package/dist/jsx/index.native.cjs +21 -0
- package/dist/jsx/index.native.js +10 -10
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/useSwitch.mjs +76 -84
- package/dist/jsx/useSwitch.mjs.map +1 -1
- package/dist/jsx/useSwitch.native.cjs +51 -0
- package/dist/jsx/useSwitch.native.js +28 -37
- package/dist/jsx/useSwitch.native.js.map +1 -1
- package/package.json +8 -8
- package/types/useSwitch.d.ts +5 -5
- 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
|
@@ -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 useSwitch_exports = {};
|
|
37
|
-
__export(useSwitch_exports, {
|
|
38
|
-
useSwitch: () => useSwitch
|
|
39
|
-
});
|
|
31
|
+
__export(useSwitch_exports, { useSwitch: () => useSwitch });
|
|
40
32
|
module.exports = __toCommonJS(useSwitch_exports);
|
|
41
33
|
require("react/jsx-runtime");
|
|
42
34
|
require("@tamagui/compose-refs");
|
|
@@ -46,17 +38,16 @@ require("@tamagui/label");
|
|
|
46
38
|
require("@tamagui/use-previous");
|
|
47
39
|
__toESM(require("react"), 1);
|
|
48
40
|
function useSwitch(props, param, ref) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
bubbleInput: null
|
|
60
|
-
};
|
|
41
|
+
var [checked, setChecked] = param;
|
|
42
|
+
return {
|
|
43
|
+
switchProps: { onPress() {
|
|
44
|
+
setChecked(function(prevChecked) {
|
|
45
|
+
return !prevChecked;
|
|
46
|
+
});
|
|
47
|
+
} },
|
|
48
|
+
switchRef: ref,
|
|
49
|
+
bubbleInput: null
|
|
50
|
+
};
|
|
61
51
|
}
|
|
52
|
+
|
|
62
53
|
//# sourceMappingURL=useSwitch.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useSwitch.native.js","names":[],"sources":["jsx/useSwitch.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\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useSwitch_exports = {};\n__export(useSwitch_exports, { useSwitch: () => useSwitch });\nmodule.exports = __toCommonJS(useSwitch_exports);\nrequire(\"react/jsx-runtime\");\nrequire(\"@tamagui/compose-refs\");\nrequire(\"@tamagui/constants\");\nrequire(\"@tamagui/helpers\");\nrequire(\"@tamagui/label\");\nrequire(\"@tamagui/use-previous\");\n__toESM(require(\"react\"), 1);\nfunction useSwitch(props, param, ref) {\n\tvar [checked, setChecked] = param;\n\treturn {\n\t\tswitchProps: { onPress() {\n\t\t\tsetChecked(function(prevChecked) {\n\t\t\t\treturn !prevChecked;\n\t\t\t});\n\t\t} },\n\t\tswitchRef: ref,\n\t\tbubbleInput: null\n\t};\n}\n//# sourceMappingURL=useSwitch.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;CAC/B,KAA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@@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/switch-headless",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.643.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"clean:build": "tamagui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tamagui/compose-refs": "
|
|
38
|
-
"@tamagui/constants": "
|
|
39
|
-
"@tamagui/helpers": "
|
|
40
|
-
"@tamagui/label": "
|
|
41
|
-
"@tamagui/use-previous": "
|
|
37
|
+
"@tamagui/compose-refs": "3.0.0-beta.643.1",
|
|
38
|
+
"@tamagui/constants": "3.0.0-beta.643.1",
|
|
39
|
+
"@tamagui/helpers": "3.0.0-beta.643.1",
|
|
40
|
+
"@tamagui/label": "3.0.0-beta.643.1",
|
|
41
|
+
"@tamagui/use-previous": "3.0.0-beta.643.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@tamagui/build": "
|
|
44
|
+
"@tamagui/build": "3.0.0-beta.643.1",
|
|
45
45
|
"react": ">=19",
|
|
46
|
-
"react-native": "0.
|
|
46
|
+
"react-native": "0.86.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": ">=19"
|
package/types/useSwitch.d.ts
CHANGED
|
@@ -21,20 +21,20 @@ export declare function useSwitch<R extends View, P extends SwitchProps>(props:
|
|
|
21
21
|
bubbleInput: null;
|
|
22
22
|
} | {
|
|
23
23
|
switchProps: {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
role: "switch";
|
|
25
|
+
'aria-checked': boolean;
|
|
26
26
|
tabIndex?: 0 | undefined;
|
|
27
27
|
'data-state'?: string | undefined;
|
|
28
28
|
'data-disabled'?: string | undefined;
|
|
29
29
|
disabled?: boolean | undefined;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
'aria-labelledby': string | undefined;
|
|
31
|
+
onPress: import("@tamagui/helpers").EventHandler<GestureResponderEvent> | undefined;
|
|
32
32
|
};
|
|
33
33
|
switchRef: (node: View) => void;
|
|
34
34
|
/**
|
|
35
35
|
* insert as a sibling of your switch (should not be inside the switch)
|
|
36
36
|
*/
|
|
37
|
-
bubbleInput:
|
|
37
|
+
bubbleInput: React.JSX.Element | null;
|
|
38
38
|
};
|
|
39
39
|
export {};
|
|
40
40
|
//# sourceMappingURL=useSwitch.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","ignoreList":[]}
|
package/dist/esm/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,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","ignoreList":[]}
|
package/dist/jsx/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|