@tamagui/toggle-group 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/Toggle.cjs +65 -130
- package/dist/cjs/Toggle.native.cjs +100 -0
- package/dist/cjs/Toggle.native.js +75 -136
- package/dist/cjs/Toggle.native.js.map +1 -1
- package/dist/cjs/ToggleGroup.cjs +158 -211
- package/dist/cjs/ToggleGroup.native.cjs +208 -0
- package/dist/cjs/ToggleGroup.native.js +173 -225
- package/dist/cjs/ToggleGroup.native.js.map +1 -1
- package/dist/cjs/context.cjs +19 -20
- package/dist/cjs/context.native.cjs +37 -0
- package/dist/cjs/context.native.js +20 -20
- package/dist/cjs/context.native.js.map +1 -1
- package/dist/cjs/index.cjs +15 -18
- package/dist/cjs/index.native.cjs +29 -0
- package/dist/cjs/index.native.js +15 -17
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +10 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/Toggle.mjs +53 -104
- package/dist/esm/Toggle.mjs.map +1 -1
- package/dist/esm/Toggle.native.js +61 -115
- package/dist/esm/Toggle.native.js.map +1 -1
- package/dist/esm/ToggleGroup.mjs +145 -188
- package/dist/esm/ToggleGroup.mjs.map +1 -1
- package/dist/esm/ToggleGroup.native.js +160 -203
- package/dist/esm/ToggleGroup.native.js.map +1 -1
- package/dist/esm/context.mjs +5 -3
- package/dist/esm/context.mjs.map +1 -1
- package/dist/esm/context.native.js +6 -4
- package/dist/esm/context.native.js.map +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.mjs +4 -3
- package/dist/esm/index.native.js +4 -3
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/dist/jsx/Toggle.mjs +53 -104
- package/dist/jsx/Toggle.mjs.map +1 -1
- package/dist/jsx/Toggle.native.cjs +100 -0
- package/dist/jsx/Toggle.native.js +75 -136
- package/dist/jsx/Toggle.native.js.map +1 -1
- package/dist/jsx/ToggleGroup.mjs +145 -188
- package/dist/jsx/ToggleGroup.mjs.map +1 -1
- package/dist/jsx/ToggleGroup.native.cjs +208 -0
- package/dist/jsx/ToggleGroup.native.js +173 -225
- package/dist/jsx/ToggleGroup.native.js.map +1 -1
- package/dist/jsx/context.mjs +5 -3
- package/dist/jsx/context.mjs.map +1 -1
- package/dist/jsx/context.native.cjs +37 -0
- package/dist/jsx/context.native.js +20 -20
- package/dist/jsx/context.native.js.map +1 -1
- package/dist/jsx/index.js +4 -3
- package/dist/jsx/index.mjs +4 -3
- package/dist/jsx/index.native.cjs +29 -0
- package/dist/jsx/index.native.js +15 -17
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.native.cjs +19 -0
- package/dist/jsx/types.native.js +10 -10
- package/dist/jsx/types.native.js.map +1 -1
- package/package.json +16 -15
- package/src/Toggle.tsx +27 -66
- package/src/ToggleGroup.tsx +13 -10
- package/types/Toggle.d.ts +45 -49
- package/types/Toggle.d.ts.map +1 -1
- package/types/ToggleGroup.d.ts +26 -87
- package/types/ToggleGroup.d.ts.map +1 -1
- package/types/context.d.ts +1 -1
- package/types/context.d.ts.map +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/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/types.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"context.native.js","names":[],"sources":["cjs/context.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 context_exports = {};\n__export(context_exports, {\n context: () => context,\n useToggleGroupItem: () => useToggleGroupItem\n});\nmodule.exports = __toCommonJS(context_exports);\nvar import_web = require(\"@tamagui/web\");\nvar context = (0, import_web.createStyledContext)({\n color: \"\",\n active: false\n});\nvar useToggleGroupItem = function() {\n return context.useStyledContext();\n};\n//# sourceMappingURL=context.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,kBAAkB,CAAC;AACvB,SAAS,iBAAiB;CACxB,eAAe;CACf,0BAA0B;AAC5B,CAAC;AACD,OAAO,UAAU,aAAa,eAAe;AAC7C,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,WAAW,GAAG,WAAW,qBAAqB;CAChD,OAAO;CACP,QAAQ;AACV,CAAC;AACD,IAAI,qBAAqB,WAAW;CAClC,OAAO,QAAQ,iBAAiB;AAClC"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
21
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
22
|
-
value: true
|
|
23
|
-
}), mod);
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
23
|
var index_exports = {};
|
|
25
|
-
__export(index_exports, {
|
|
26
|
-
useToggleGroupItem: () => import_context.useToggleGroupItem
|
|
27
|
-
});
|
|
24
|
+
__export(index_exports, { useToggleGroupItem: () => import_context.useToggleGroupItem });
|
|
28
25
|
module.exports = __toCommonJS(index_exports);
|
|
29
26
|
__reExport(index_exports, require("./ToggleGroup.cjs"), module.exports);
|
|
30
|
-
var import_context = require("./context.cjs");
|
|
27
|
+
var import_context = require("./context.cjs");
|
|
@@ -0,0 +1,29 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var index_exports = {};
|
|
26
|
+
__export(index_exports, { useToggleGroupItem: () => import_context.useToggleGroupItem });
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
__reExport(index_exports, require("./ToggleGroup.native.js"), module.exports);
|
|
29
|
+
var import_context = require("./context.native.js");
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,33 +1,31 @@
|
|
|
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
23
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
24
|
-
value: true
|
|
25
|
-
}), mod);
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
25
|
var index_exports = {};
|
|
27
|
-
__export(index_exports, {
|
|
28
|
-
useToggleGroupItem: () => import_context.useToggleGroupItem
|
|
29
|
-
});
|
|
26
|
+
__export(index_exports, { useToggleGroupItem: () => import_context.useToggleGroupItem });
|
|
30
27
|
module.exports = __toCommonJS(index_exports);
|
|
31
28
|
__reExport(index_exports, require("./ToggleGroup.native.js"), module.exports);
|
|
32
29
|
var import_context = require("./context.native.js");
|
|
30
|
+
|
|
33
31
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n useToggleGroupItem: () => import_context.useToggleGroupItem\n});\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./ToggleGroup\"), module.exports);\nvar import_context = require(\"./context\");\n//# sourceMappingURL=index.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,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe,EACtB,0BAA0B,eAAe,mBAC3C,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,yBAAe,GAAG,OAAO,OAAO;AAClE,IAAI,iBAAiB,QAAQ,qBAAW"}
|
package/dist/cjs/types.cjs
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
13
14
|
};
|
|
14
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
}), mod);
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
17
16
|
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var types_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/cjs/types.native.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
15
16
|
};
|
|
16
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
17
|
-
value: true
|
|
18
|
-
}), mod);
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
18
|
var types_exports = {};
|
|
20
19
|
module.exports = __toCommonJS(types_exports);
|
|
20
|
+
|
|
21
21
|
//# sourceMappingURL=types.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"types.native.js","names":[],"sources":["cjs/types.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\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 types_exports = {};\nmodule.exports = __toCommonJS(types_exports);\n//# sourceMappingURL=types.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,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,OAAO,UAAU,aAAa,aAAa"}
|
package/dist/esm/Toggle.mjs
CHANGED
|
@@ -1,113 +1,62 @@
|
|
|
1
|
+
import { createRefComponent } from "@tamagui/compose-refs";
|
|
1
2
|
import { composeEventHandlers } from "@tamagui/helpers";
|
|
3
|
+
import { resolveSizeToken } from "@tamagui/size";
|
|
2
4
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
3
|
-
import {
|
|
4
|
-
import * as React from "react";
|
|
5
|
+
import { View, styled } from "@tamagui/web";
|
|
5
6
|
import { context } from "./context.mjs";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
|
|
7
9
|
const NAME = "Toggle";
|
|
8
10
|
const ToggleFrame = styled(View, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
hoverStyle: {
|
|
58
|
-
backgroundColor: "$backgroundActive"
|
|
59
|
-
},
|
|
60
|
-
focusStyle: {
|
|
61
|
-
backgroundColor: "$backgroundActive"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
defaultVariants: {
|
|
67
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
68
|
-
}
|
|
69
|
-
}, {
|
|
70
|
-
accept: {
|
|
71
|
-
activeStyle: "style"
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
const Toggle = React.forwardRef(function Toggle2(props, forwardedRef) {
|
|
75
|
-
const {
|
|
76
|
-
active: activeProp,
|
|
77
|
-
activeStyle,
|
|
78
|
-
defaultActive = false,
|
|
79
|
-
onActiveChange,
|
|
80
|
-
activeTheme,
|
|
81
|
-
unstyled = false,
|
|
82
|
-
...buttonProps
|
|
83
|
-
} = props;
|
|
84
|
-
const [active = false, setActive] = useControllableState({
|
|
85
|
-
prop: activeProp,
|
|
86
|
-
onChange: onActiveChange,
|
|
87
|
-
defaultProp: defaultActive
|
|
88
|
-
});
|
|
89
|
-
return /* @__PURE__ */jsx(ToggleFrame, {
|
|
90
|
-
theme: activeTheme ?? null,
|
|
91
|
-
"aria-pressed": active,
|
|
92
|
-
"data-state": active ? "on" : "off",
|
|
93
|
-
"data-disabled": props.disabled ? "" : void 0,
|
|
94
|
-
unstyled,
|
|
95
|
-
...(active && !activeStyle && !unstyled && {
|
|
96
|
-
defaultActiveStyle: true
|
|
97
|
-
}),
|
|
98
|
-
...buttonProps,
|
|
99
|
-
...(active && activeStyle && {
|
|
100
|
-
...activeStyle,
|
|
101
|
-
hoverStyle: activeStyle,
|
|
102
|
-
focusStyle: activeStyle
|
|
103
|
-
}),
|
|
104
|
-
ref: forwardedRef,
|
|
105
|
-
onPress: composeEventHandlers(props.onPress ?? void 0, () => {
|
|
106
|
-
if (!props.disabled) {
|
|
107
|
-
setActive(prev => !prev);
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
});
|
|
11
|
+
displayName: NAME,
|
|
12
|
+
render: "button",
|
|
13
|
+
context,
|
|
14
|
+
size: true,
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
justifyContent: "center",
|
|
17
|
+
display: "flex",
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
number: (val) => ({
|
|
21
|
+
width: val,
|
|
22
|
+
height: val
|
|
23
|
+
}),
|
|
24
|
+
Size: (val, { tokens }) => {
|
|
25
|
+
if (!val) return;
|
|
26
|
+
const sizeToken = resolveSizeToken(val, "size");
|
|
27
|
+
const size = typeof sizeToken === "number" ? sizeToken : tokens.size[sizeToken];
|
|
28
|
+
return {
|
|
29
|
+
width: size,
|
|
30
|
+
height: size
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultActiveStyle: { true: {} }
|
|
35
|
+
}
|
|
36
|
+
}, { accept: { activeStyle: "style" } });
|
|
37
|
+
const Toggle = createRefComponent(function Toggle2(props, forwardedRef) {
|
|
38
|
+
const { active: activeProp, activeStyle, defaultActive = false, onActiveChange, activeTheme, ...buttonProps } = props;
|
|
39
|
+
const [active = false, setActive] = useControllableState({
|
|
40
|
+
prop: activeProp,
|
|
41
|
+
onChange: onActiveChange,
|
|
42
|
+
defaultProp: defaultActive
|
|
43
|
+
});
|
|
44
|
+
return /* @__PURE__ */ jsx(ToggleFrame, {
|
|
45
|
+
theme: activeTheme ?? null,
|
|
46
|
+
"aria-pressed": active,
|
|
47
|
+
"data-state": active ? "on" : "off",
|
|
48
|
+
"data-disabled": props.disabled ? "" : void 0,
|
|
49
|
+
...active && !activeStyle && { defaultActiveStyle: true },
|
|
50
|
+
...buttonProps,
|
|
51
|
+
...active && activeStyle ? activeStyle : void 0,
|
|
52
|
+
ref: forwardedRef,
|
|
53
|
+
onPress: composeEventHandlers(props.onPress ?? void 0, () => {
|
|
54
|
+
if (!props.disabled) {
|
|
55
|
+
setActive((prev) => !prev);
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
});
|
|
111
59
|
});
|
|
60
|
+
|
|
112
61
|
export { Toggle, ToggleFrame };
|
|
113
62
|
//# sourceMappingURL=Toggle.mjs.map
|
package/dist/esm/Toggle.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Toggle.js","names":[],"sources":["esm/Toggle.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { resolveSizeToken } from \"@tamagui/size\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { styled, View } from \"@tamagui/web\";\nimport { context } from \"./context\";\nimport { jsx } from \"react/jsx-runtime\";\nconst NAME = \"Toggle\";\nconst ToggleFrame = styled(\n View,\n {\n displayName: NAME,\n render: \"button\",\n context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n display: \"flex\",\n variants: {\n size: {\n number: (val) => ({\n width: val,\n height: val\n }),\n Size: (val, { tokens }) => {\n if (!val) return;\n const sizeToken = resolveSizeToken(val, \"size\");\n const size = typeof sizeToken === \"number\" ? sizeToken : tokens.size[sizeToken];\n return {\n width: size,\n height: size\n };\n }\n },\n defaultActiveStyle: {\n true: {}\n }\n }\n },\n {\n accept: {\n activeStyle: \"style\"\n }\n }\n);\nconst Toggle = createRefComponent(\n function Toggle2(props, forwardedRef) {\n const {\n active: activeProp,\n activeStyle,\n defaultActive = false,\n onActiveChange,\n activeTheme,\n ...buttonProps\n } = props;\n const [active = false, setActive] = useControllableState({\n prop: activeProp,\n onChange: onActiveChange,\n defaultProp: defaultActive\n });\n return /* @__PURE__ */ jsx(\n ToggleFrame,\n {\n theme: activeTheme ?? null,\n \"aria-pressed\": active,\n \"data-state\": active ? \"on\" : \"off\",\n \"data-disabled\": props.disabled ? \"\" : void 0,\n ...active && !activeStyle && { defaultActiveStyle: true },\n ...buttonProps,\n ...active && activeStyle ? activeStyle : void 0,\n ref: forwardedRef,\n onPress: composeEventHandlers(props.onPress ?? void 0, () => {\n if (!props.disabled) {\n setActive((prev) => !prev);\n }\n })\n }\n );\n }\n);\nexport {\n Toggle,\n ToggleFrame\n};\n//# sourceMappingURL=Toggle.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,OAAO;AACb,MAAM,cAAc,OAClB,MACA;CACE,aAAa;CACb,QAAQ;CACR;CACA,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,SAAS;CACT,UAAU;EACR,MAAM;GACJ,SAAS,SAAS;IAChB,OAAO;IACP,QAAQ;GACV;GACA,OAAO,KAAK,EAAE,aAAa;IACzB,IAAI,CAAC,KAAK;IACV,MAAM,YAAY,iBAAiB,KAAK,MAAM;IAC9C,MAAM,OAAO,OAAO,cAAc,WAAW,YAAY,OAAO,KAAK;IACrE,OAAO;KACL,OAAO;KACP,QAAQ;IACV;GACF;EACF;EACA,oBAAoB,EAClB,MAAM,CAAC,EACT;CACF;AACF,GACA,EACE,QAAQ,EACN,aAAa,QACf,EACF,CACF;AACA,MAAM,SAAS,mBACb,SAAS,QAAQ,OAAO,cAAc;CACpC,MAAM,EACJ,QAAQ,YACR,aACA,gBAAgB,OAChB,gBACA,aACA,GAAG,gBACD;CACJ,MAAM,CAAC,SAAS,OAAO,aAAa,qBAAqB;EACvD,MAAM;EACN,UAAU;EACV,aAAa;CACf,CAAC;CACD,OAAuB,oBACrB,aACA;EACE,OAAO,eAAe;EACtB,gBAAgB;EAChB,cAAc,SAAS,OAAO;EAC9B,iBAAiB,MAAM,WAAW,KAAK,KAAK;EAC5C,GAAG,UAAU,CAAC,eAAe,EAAE,oBAAoB,KAAK;EACxD,GAAG;EACH,GAAG,UAAU,cAAc,cAAc,KAAK;EAC9C,KAAK;EACL,SAAS,qBAAqB,MAAM,WAAW,KAAK,SAAS;GAC3D,IAAI,CAAC,MAAM,UAAU;IACnB,WAAW,SAAS,CAAC,IAAI;GAC3B;EACF,CAAC;CACH,CACF;AACF,CACF"}
|
|
@@ -1,123 +1,69 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createRefComponent } from "@tamagui/compose-refs";
|
|
2
3
|
import { composeEventHandlers } from "@tamagui/helpers";
|
|
4
|
+
import { resolveSizeToken } from "@tamagui/size";
|
|
3
5
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
+
import { View, styled } from "@tamagui/web";
|
|
7
|
+
import "react";
|
|
6
8
|
import { context } from "./context.native.js";
|
|
9
|
+
|
|
7
10
|
var NAME = "Toggle";
|
|
8
11
|
var ToggleFrame = styled(View, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
focusStyle: {
|
|
64
|
-
backgroundColor: "$backgroundActive"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
defaultVariants: {
|
|
70
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
accept: {
|
|
74
|
-
activeStyle: "style"
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
var Toggle = /* @__PURE__ */React.forwardRef(function Toggle2(props, forwardedRef) {
|
|
78
|
-
var {
|
|
79
|
-
active: activeProp,
|
|
80
|
-
activeStyle,
|
|
81
|
-
defaultActive = false,
|
|
82
|
-
onActiveChange,
|
|
83
|
-
activeTheme,
|
|
84
|
-
unstyled = false,
|
|
85
|
-
...buttonProps
|
|
86
|
-
} = props;
|
|
87
|
-
var [active = false, setActive] = useControllableState({
|
|
88
|
-
prop: activeProp,
|
|
89
|
-
onChange: onActiveChange,
|
|
90
|
-
defaultProp: defaultActive
|
|
91
|
-
});
|
|
92
|
-
var _props_onPress;
|
|
93
|
-
return /* @__PURE__ */_jsx(ToggleFrame, {
|
|
94
|
-
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
95
|
-
"aria-pressed": active,
|
|
96
|
-
"data-state": active ? "on" : "off",
|
|
97
|
-
"data-disabled": props.disabled ? "" : void 0,
|
|
98
|
-
unstyled,
|
|
99
|
-
...(active && !activeStyle && !unstyled && {
|
|
100
|
-
defaultActiveStyle: true
|
|
101
|
-
}),
|
|
102
|
-
...buttonProps,
|
|
103
|
-
// spread activeStyle after buttonProps so it wins when active: a styled()
|
|
104
|
-
// variant (e.g. a resting `backgroundColor`) forwards that value as a plain
|
|
105
|
-
// prop into buttonProps, which would otherwise clobber the activeStyle merge
|
|
106
|
-
// on overlapping keys and leave the active item stuck at its resting style.
|
|
107
|
-
...(active && activeStyle && {
|
|
108
|
-
...activeStyle,
|
|
109
|
-
hoverStyle: activeStyle,
|
|
110
|
-
focusStyle: activeStyle
|
|
111
|
-
}),
|
|
112
|
-
ref: forwardedRef,
|
|
113
|
-
onPress: composeEventHandlers((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function () {
|
|
114
|
-
if (!props.disabled) {
|
|
115
|
-
setActive(function (prev) {
|
|
116
|
-
return !prev;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
});
|
|
12
|
+
displayName: NAME,
|
|
13
|
+
render: "button",
|
|
14
|
+
context,
|
|
15
|
+
size: true,
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
display: "flex",
|
|
19
|
+
variants: {
|
|
20
|
+
size: {
|
|
21
|
+
number: function(val) {
|
|
22
|
+
return {
|
|
23
|
+
width: val,
|
|
24
|
+
height: val
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
Size: function(val, param) {
|
|
28
|
+
var { tokens } = param;
|
|
29
|
+
if (!val) return;
|
|
30
|
+
var sizeToken = resolveSizeToken(val, "size");
|
|
31
|
+
var size = typeof sizeToken === "number" ? sizeToken : tokens.size[sizeToken];
|
|
32
|
+
return {
|
|
33
|
+
width: size,
|
|
34
|
+
height: size
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
defaultActiveStyle: { true: {} }
|
|
39
|
+
}
|
|
40
|
+
}, { accept: { activeStyle: "style" } });
|
|
41
|
+
var Toggle = createRefComponent(function Toggle2(props, forwardedRef) {
|
|
42
|
+
var { active: activeProp, activeStyle, defaultActive = false, onActiveChange, activeTheme, ...buttonProps } = props;
|
|
43
|
+
var [active = false, setActive] = useControllableState({
|
|
44
|
+
prop: activeProp,
|
|
45
|
+
onChange: onActiveChange,
|
|
46
|
+
defaultProp: defaultActive
|
|
47
|
+
});
|
|
48
|
+
var _props_onPress;
|
|
49
|
+
return /* @__PURE__ */ jsx(ToggleFrame, {
|
|
50
|
+
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
51
|
+
"aria-pressed": active,
|
|
52
|
+
"data-state": active ? "on" : "off",
|
|
53
|
+
"data-disabled": props.disabled ? "" : void 0,
|
|
54
|
+
...active && !activeStyle && { defaultActiveStyle: true },
|
|
55
|
+
...buttonProps,
|
|
56
|
+
...active && activeStyle ? activeStyle : void 0,
|
|
57
|
+
ref: forwardedRef,
|
|
58
|
+
onPress: composeEventHandlers((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {
|
|
59
|
+
if (!props.disabled) {
|
|
60
|
+
setActive(function(prev) {
|
|
61
|
+
return !prev;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
});
|
|
121
66
|
});
|
|
67
|
+
|
|
122
68
|
export { Toggle, ToggleFrame };
|
|
123
69
|
//# sourceMappingURL=Toggle.native.js.map
|