@tamagui/switch-headless 2.7.7 → 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.
@@ -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 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
- var [checked, setChecked] = param;
50
- return {
51
- switchProps: {
52
- onPress() {
53
- setChecked(function (prevChecked) {
54
- return !prevChecked;
55
- });
56
- }
57
- },
58
- switchRef: ref,
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,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","useSwitch_exports","useSwitch","module","exports","require","props","param","ref","checked","setChecked","switchProps","onPress","prevChecked","switchRef","bubbleInput"],"sources":["../../src/useSwitch.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AACT,IAAAA,QAAS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AAAT,UAAA;AAAA,KAEEJ,MAAA,EAAAa,GAAC;AAAA,IAAAI,YACM,GAAAJ,GAAA,IAAAR,WAAA,CAAAjB,SAAA;EAAA4B,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAK,iBACL,GAAW;AAAAnB,QACX,CAAAmB,iBAAgB;EAAAC,SAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OACZ,GAAAJ,YAAA,CAAAC,iBAAA;AAAAI,OAAA,CACJ,mBAAU;AAAAA,OAAA,CACV;AAAAA,OAAA,CACA,oBAAO;AAAAA,OAAA,mBACI;AAAAA,OAAA,iBACC;AAAAA,OAAA,wBACK;AAAAV,OAAA,CAAAU,OACf,QAAS;AAAA,SAAAH,SACDA,CAAAI,KAAA,EAAAC,KAAA,EAAAC,GAAA;EAAA,KAAAC,OACV,EAAAC,UAAA,IAAAH,KAAA;EAAA;IAAAI,WACF;MAAAC,QAAA;QAAAF,UAAA,WAAAG,WAAA;UAEJ,QAAAA,WAAA;QAEO;MAKL;IAAA;IACEC,SAAO,EAAAN,GAAA;IAAAO,WACL;EAAa;AAET","ignoreList":[]}
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,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKpG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CACpE,OAAO;CACP,YAAY;AACb,CAAC,IAAI,QACL,GACD;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,oBAAoB,CAAC;AACzB,SAAS,mBAAmB,EAAE,iBAAiB,UAAU,CAAC;AAC1D,OAAO,UAAU,aAAa,iBAAiB;AAC/C,QAAQ,mBAAmB;AAC3B,QAAQ,uBAAuB;AAC/B,QAAQ,oBAAoB;AAC5B,QAAQ,kBAAkB;AAC1B,QAAQ,gBAAgB;AACxB,QAAQ,uBAAuB;AAC/B,QAAQ,QAAQ,OAAO,GAAG,CAAC;AAC3B,SAAS,UAAU,OAAO,OAAO,KAAK;CACrC,IAAI,CAAC,SAAS,cAAc;CAC5B,OAAO;EACN,aAAa,EAAE,UAAU;GACxB,WAAW,SAAS,aAAa;IAChC,OAAO,CAAC;GACT,CAAC;EACF,EAAE;EACF,WAAW;EACX,aAAa;CACd;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/switch-headless",
3
- "version": "2.7.7",
3
+ "version": "3.0.0-beta.637.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": "2.7.7",
38
- "@tamagui/constants": "2.7.7",
39
- "@tamagui/helpers": "2.7.7",
40
- "@tamagui/label": "2.7.7",
41
- "@tamagui/use-previous": "2.7.7"
37
+ "@tamagui/compose-refs": "3.0.0-beta.637.1",
38
+ "@tamagui/constants": "3.0.0-beta.637.1",
39
+ "@tamagui/helpers": "3.0.0-beta.637.1",
40
+ "@tamagui/label": "3.0.0-beta.637.1",
41
+ "@tamagui/use-previous": "3.0.0-beta.637.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@tamagui/build": "2.7.7",
44
+ "@tamagui/build": "3.0.0-beta.637.1",
45
45
  "react": ">=19",
46
- "react-native": "0.83.2"
46
+ "react-native": "0.86.2"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": ">=19"
@@ -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
- 'aria-labelledby': string | undefined;
25
- onPress: import("@tamagui/helpers").EventHandler<GestureResponderEvent> | undefined;
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
- role: "switch";
31
- 'aria-checked': boolean;
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: import("react/jsx-runtime").JSX.Element | null;
37
+ bubbleInput: React.JSX.Element | null;
38
38
  };
39
39
  export {};
40
40
  //# sourceMappingURL=useSwitch.d.ts.map
@@ -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":[]}
@@ -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":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}