@tamagui/checkbox 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/Checkbox.cjs +105 -101
- package/dist/cjs/Checkbox.native.cjs +137 -0
- package/dist/cjs/Checkbox.native.js +120 -100
- package/dist/cjs/Checkbox.native.js.map +1 -1
- package/dist/cjs/CheckboxStyledContext.cjs +18 -23
- package/dist/cjs/CheckboxStyledContext.native.cjs +32 -0
- package/dist/cjs/CheckboxStyledContext.native.js +18 -22
- package/dist/cjs/CheckboxStyledContext.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -26
- package/dist/cjs/index.native.cjs +22 -0
- package/dist/cjs/index.native.js +10 -26
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Checkbox.mjs +83 -87
- package/dist/esm/Checkbox.mjs.map +1 -1
- package/dist/esm/Checkbox.native.js +99 -87
- package/dist/esm/Checkbox.native.js.map +1 -1
- package/dist/esm/CheckboxStyledContext.mjs +5 -5
- package/dist/esm/CheckboxStyledContext.mjs.map +1 -1
- package/dist/esm/CheckboxStyledContext.native.js +5 -5
- package/dist/esm/CheckboxStyledContext.native.js.map +1 -1
- package/dist/esm/index.js +3 -11
- package/dist/esm/index.mjs +3 -11
- package/dist/esm/index.native.js +3 -11
- package/dist/jsx/Checkbox.mjs +83 -87
- package/dist/jsx/Checkbox.mjs.map +1 -1
- package/dist/jsx/Checkbox.native.cjs +137 -0
- package/dist/jsx/Checkbox.native.js +120 -100
- package/dist/jsx/Checkbox.native.js.map +1 -1
- package/dist/jsx/CheckboxStyledContext.mjs +5 -5
- package/dist/jsx/CheckboxStyledContext.mjs.map +1 -1
- package/dist/jsx/CheckboxStyledContext.native.cjs +32 -0
- package/dist/jsx/CheckboxStyledContext.native.js +18 -22
- package/dist/jsx/CheckboxStyledContext.native.js.map +1 -1
- package/dist/jsx/index.js +3 -11
- package/dist/jsx/index.mjs +3 -11
- package/dist/jsx/index.native.cjs +22 -0
- package/dist/jsx/index.native.js +10 -26
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +6 -16
- package/src/Checkbox.tsx +189 -81
- package/src/CheckboxStyledContext.tsx +2 -6
- package/src/index.ts +0 -9
- package/types/Checkbox.d.ts +446 -24
- package/types/Checkbox.d.ts.map +1 -1
- package/types/CheckboxStyledContext.d.ts +2 -4
- package/types/CheckboxStyledContext.d.ts.map +1 -1
- package/types/index.d.ts +0 -320
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/createCheckbox.cjs +0 -194
- package/dist/cjs/createCheckbox.native.js +0 -213
- package/dist/cjs/createCheckbox.native.js.map +0 -1
- package/dist/esm/createCheckbox.mjs +0 -150
- package/dist/esm/createCheckbox.mjs.map +0 -1
- package/dist/esm/createCheckbox.native.js +0 -167
- package/dist/esm/createCheckbox.native.js.map +0 -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/createCheckbox.mjs +0 -150
- package/dist/jsx/createCheckbox.mjs.map +0 -1
- package/dist/jsx/createCheckbox.native.js +0 -213
- package/dist/jsx/createCheckbox.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/src/createCheckbox.tsx +0 -280
- package/types/createCheckbox.d.ts +0 -196
- package/types/createCheckbox.d.ts.map +0 -1
|
@@ -1,35 +1,30 @@
|
|
|
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
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
22
|
var CheckboxStyledContext_exports = {};
|
|
24
|
-
__export(CheckboxStyledContext_exports, {
|
|
25
|
-
CheckboxStyledContext: () => CheckboxStyledContext
|
|
26
|
-
});
|
|
23
|
+
__export(CheckboxStyledContext_exports, { CheckboxStyledContext: () => CheckboxStyledContext });
|
|
27
24
|
module.exports = __toCommonJS(CheckboxStyledContext_exports);
|
|
28
25
|
var import_core = require("@tamagui/core");
|
|
29
26
|
const CheckboxStyledContext = (0, import_core.createStyledContext)({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
disabled: false
|
|
35
|
-
});
|
|
27
|
+
size: true,
|
|
28
|
+
active: false,
|
|
29
|
+
disabled: false
|
|
30
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
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 CheckboxStyledContext_exports = {};
|
|
25
|
+
__export(CheckboxStyledContext_exports, { CheckboxStyledContext: () => CheckboxStyledContext });
|
|
26
|
+
module.exports = __toCommonJS(CheckboxStyledContext_exports);
|
|
27
|
+
var import_core = require("@tamagui/core");
|
|
28
|
+
var CheckboxStyledContext = (0, import_core.createStyledContext)({
|
|
29
|
+
size: true,
|
|
30
|
+
active: false,
|
|
31
|
+
disabled: false
|
|
32
|
+
});
|
|
@@ -1,38 +1,34 @@
|
|
|
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 CheckboxStyledContext_exports = {};
|
|
26
|
-
__export(CheckboxStyledContext_exports, {
|
|
27
|
-
CheckboxStyledContext: () => CheckboxStyledContext
|
|
28
|
-
});
|
|
25
|
+
__export(CheckboxStyledContext_exports, { CheckboxStyledContext: () => CheckboxStyledContext });
|
|
29
26
|
module.exports = __toCommonJS(CheckboxStyledContext_exports);
|
|
30
27
|
var import_core = require("@tamagui/core");
|
|
31
28
|
var CheckboxStyledContext = (0, import_core.createStyledContext)({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
active: false,
|
|
36
|
-
disabled: false
|
|
29
|
+
size: true,
|
|
30
|
+
active: false,
|
|
31
|
+
disabled: false
|
|
37
32
|
});
|
|
33
|
+
|
|
38
34
|
//# sourceMappingURL=CheckboxStyledContext.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"CheckboxStyledContext.native.js","names":[],"sources":["cjs/CheckboxStyledContext.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 CheckboxStyledContext_exports = {};\n__export(CheckboxStyledContext_exports, {\n CheckboxStyledContext: () => CheckboxStyledContext\n});\nmodule.exports = __toCommonJS(CheckboxStyledContext_exports);\nvar import_core = require(\"@tamagui/core\");\nvar CheckboxStyledContext = (0, import_core.createStyledContext)({\n size: true,\n active: false,\n disabled: false\n});\n//# sourceMappingURL=CheckboxStyledContext.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,gCAAgC,CAAC;AACrC,SAAS,+BAA+B,EACtC,6BAA6B,sBAC/B,CAAC;AACD,OAAO,UAAU,aAAa,6BAA6B;AAC3D,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,yBAAyB,GAAG,YAAY,qBAAqB;CAC/D,MAAM;CACN,QAAQ;CACR,UAAU;AACZ,CAAC"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,37 +1,20 @@
|
|
|
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
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all) __defProp(target, name, {
|
|
7
|
-
get: all[name],
|
|
8
|
-
enumerable: true
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
6
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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;
|
|
19
14
|
};
|
|
20
15
|
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);
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
17
|
var index_exports = {};
|
|
25
|
-
__export(index_exports, {
|
|
26
|
-
Checkbox: () => Checkbox
|
|
27
|
-
});
|
|
28
18
|
module.exports = __toCommonJS(index_exports);
|
|
29
|
-
var import_Checkbox = require("./Checkbox.cjs");
|
|
30
|
-
var import_createCheckbox = require("./createCheckbox.cjs");
|
|
31
|
-
__reExport(index_exports, require("./createCheckbox.cjs"), module.exports);
|
|
32
19
|
__reExport(index_exports, require("./Checkbox.cjs"), module.exports);
|
|
33
20
|
__reExport(index_exports, require("./CheckboxStyledContext.cjs"), module.exports);
|
|
34
|
-
const Checkbox = (0, import_createCheckbox.createCheckbox)({
|
|
35
|
-
Frame: import_Checkbox.CheckboxFrame,
|
|
36
|
-
Indicator: import_Checkbox.CheckboxIndicatorFrame
|
|
37
|
-
});
|
|
@@ -0,0 +1,22 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(index_exports);
|
|
21
|
+
__reExport(index_exports, require("./Checkbox.native.js"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./CheckboxStyledContext.native.js"), module.exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,40 +1,24 @@
|
|
|
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
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
8
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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;
|
|
21
16
|
};
|
|
22
17
|
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);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
19
|
var index_exports = {};
|
|
27
|
-
__export(index_exports, {
|
|
28
|
-
Checkbox: () => Checkbox
|
|
29
|
-
});
|
|
30
20
|
module.exports = __toCommonJS(index_exports);
|
|
31
|
-
var import_Checkbox = require("./Checkbox.native.js");
|
|
32
|
-
var import_createCheckbox = require("./createCheckbox.native.js");
|
|
33
|
-
__reExport(index_exports, require("./createCheckbox.native.js"), module.exports);
|
|
34
21
|
__reExport(index_exports, require("./Checkbox.native.js"), module.exports);
|
|
35
22
|
__reExport(index_exports, require("./CheckboxStyledContext.native.js"), module.exports);
|
|
36
|
-
|
|
37
|
-
Frame: import_Checkbox.CheckboxFrame,
|
|
38
|
-
Indicator: import_Checkbox.CheckboxIndicatorFrame
|
|
39
|
-
});
|
|
23
|
+
|
|
40
24
|
//# 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 __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 = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Checkbox\"), module.exports);\n__reExport(index_exports, require(\"./CheckboxStyledContext\"), module.exports);\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,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,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,sBAAY,GAAG,OAAO,OAAO;AAC/D,WAAW,eAAe,QAAQ,mCAAyB,GAAG,OAAO,OAAO"}
|
package/dist/esm/Checkbox.mjs
CHANGED
|
@@ -1,90 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { isIndeterminate, useCheckbox } from "@tamagui/checkbox-headless";
|
|
2
|
+
import { View, createStyledHOC, isWeb, shouldRenderNativePlatform, styled, useProps, withStaticProperties } from "@tamagui/core";
|
|
3
|
+
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
4
|
+
import React, { useMemo } from "react";
|
|
4
5
|
import { CheckboxStyledContext } from "./CheckboxStyledContext.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
const CheckboxIndicatorFrame = styled(View, {
|
|
9
|
+
displayName: "CheckboxIndicator",
|
|
10
|
+
context: CheckboxStyledContext
|
|
11
|
+
}, { accept: { activeStyle: "style" } });
|
|
12
|
+
const CheckboxFrame = styled(View, {
|
|
13
|
+
displayName: "Checkbox",
|
|
14
|
+
render: "button",
|
|
15
|
+
context: CheckboxStyledContext,
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
variants: { disabled: { true: {
|
|
19
|
+
pointerEvents: "none",
|
|
20
|
+
userSelect: "none"
|
|
21
|
+
} } }
|
|
22
|
+
}, { accept: { activeStyle: "style" } });
|
|
23
|
+
const CheckboxContext = React.createContext({
|
|
24
|
+
checked: false,
|
|
25
|
+
disabled: false
|
|
22
26
|
});
|
|
23
|
-
const
|
|
24
|
-
const
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
accept: {
|
|
86
|
-
activeStyle: "style"
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
export { CheckboxFrame, CheckboxIndicatorFrame };
|
|
27
|
+
const Checkbox2 = withStaticProperties(createStyledHOC(CheckboxFrame, function Checkbox(_props, forwardedRef) {
|
|
28
|
+
const { checked: checkedProp, defaultChecked, onCheckedChange, native, activeStyle, activeTheme, ...props } = _props;
|
|
29
|
+
const propsActive = useProps(props);
|
|
30
|
+
const styledContext = React.useContext(CheckboxStyledContext.context);
|
|
31
|
+
const [checked = false, setChecked] = useControllableState({
|
|
32
|
+
prop: checkedProp,
|
|
33
|
+
defaultProp: defaultChecked,
|
|
34
|
+
onChange: onCheckedChange
|
|
35
|
+
});
|
|
36
|
+
const { checkboxProps, checkboxRef, bubbleInput } = useCheckbox(propsActive, [checked, setChecked], forwardedRef);
|
|
37
|
+
if (shouldRenderNativePlatform(native) === "web") return /* @__PURE__ */ jsx("input", {
|
|
38
|
+
type: "checkbox",
|
|
39
|
+
defaultChecked: isIndeterminate(checked) ? false : checked,
|
|
40
|
+
tabIndex: -1,
|
|
41
|
+
ref: checkboxRef,
|
|
42
|
+
disabled: checkboxProps.disabled,
|
|
43
|
+
style: checkboxProps.style
|
|
44
|
+
});
|
|
45
|
+
const memoizedContext = useMemo(() => ({
|
|
46
|
+
checked,
|
|
47
|
+
disabled: checkboxProps.disabled
|
|
48
|
+
}), [checked, checkboxProps.disabled]);
|
|
49
|
+
const isActive = !!checked;
|
|
50
|
+
const disabled = checkboxProps.disabled;
|
|
51
|
+
return /* @__PURE__ */ jsx(CheckboxContext.Provider, {
|
|
52
|
+
value: memoizedContext,
|
|
53
|
+
children: /* @__PURE__ */ jsxs(CheckboxStyledContext.Provider, {
|
|
54
|
+
size: propsActive.size ?? styledContext?.size ?? true,
|
|
55
|
+
active: isActive,
|
|
56
|
+
disabled,
|
|
57
|
+
children: [/* @__PURE__ */ jsx(CheckboxFrame, {
|
|
58
|
+
render: "button",
|
|
59
|
+
ref: checkboxRef,
|
|
60
|
+
theme: activeTheme ?? null,
|
|
61
|
+
...isWeb && { type: "button" },
|
|
62
|
+
checked,
|
|
63
|
+
disabled,
|
|
64
|
+
...checkboxProps,
|
|
65
|
+
...props,
|
|
66
|
+
...isActive && activeStyle ? activeStyle : void 0,
|
|
67
|
+
children: propsActive.children
|
|
68
|
+
}), bubbleInput]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}), { Indicator: createStyledHOC(CheckboxIndicatorFrame, (props, forwardedRef) => {
|
|
72
|
+
const { children, forceMount, activeStyle, ...indicatorProps } = props;
|
|
73
|
+
const { active } = CheckboxStyledContext.useStyledContext();
|
|
74
|
+
const context = React.useContext(CheckboxContext);
|
|
75
|
+
if (forceMount || isIndeterminate(context.checked) || context.checked === true) return /* @__PURE__ */ jsx(CheckboxIndicatorFrame, {
|
|
76
|
+
pointerEvents: "none",
|
|
77
|
+
...indicatorProps,
|
|
78
|
+
...active && activeStyle ? activeStyle : void 0,
|
|
79
|
+
ref: forwardedRef,
|
|
80
|
+
children
|
|
81
|
+
});
|
|
82
|
+
return null;
|
|
83
|
+
}) });
|
|
84
|
+
|
|
85
|
+
export { Checkbox2 as Checkbox, CheckboxContext, CheckboxFrame, CheckboxIndicatorFrame };
|
|
90
86
|
//# sourceMappingURL=Checkbox.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Checkbox.js","names":[],"sources":["esm/Checkbox.js"],"sourcesContent":["import { isIndeterminate, useCheckbox } from \"@tamagui/checkbox-headless\";\nimport { View, createStyledHOC, isWeb, shouldRenderNativePlatform, styled, useProps, withStaticProperties } from \"@tamagui/core\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport React, { useMemo } from \"react\";\nimport { CheckboxStyledContext } from \"./CheckboxStyledContext\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n\nconst CheckboxIndicatorFrame = styled(View, {\n\tdisplayName: \"CheckboxIndicator\",\n\tcontext: CheckboxStyledContext\n}, { accept: { activeStyle: \"style\" } });\nconst CheckboxFrame = styled(View, {\n\tdisplayName: \"Checkbox\",\n\trender: \"button\",\n\tcontext: CheckboxStyledContext,\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tvariants: { disabled: { true: {\n\t\tpointerEvents: \"none\",\n\t\tuserSelect: \"none\"\n\t} } }\n}, { accept: { activeStyle: \"style\" } });\nconst CheckboxContext = React.createContext({\n\tchecked: false,\n\tdisabled: false\n});\nconst Checkbox2 = withStaticProperties(createStyledHOC(CheckboxFrame, function Checkbox(_props, forwardedRef) {\n\tconst { checked: checkedProp, defaultChecked, onCheckedChange, native, activeStyle, activeTheme, ...props } = _props;\n\tconst propsActive = useProps(props);\n\tconst styledContext = React.useContext(CheckboxStyledContext.context);\n\tconst [checked = false, setChecked] = useControllableState({\n\t\tprop: checkedProp,\n\t\tdefaultProp: defaultChecked,\n\t\tonChange: onCheckedChange\n\t});\n\tconst { checkboxProps, checkboxRef, bubbleInput } = useCheckbox(propsActive, [checked, setChecked], forwardedRef);\n\tif (shouldRenderNativePlatform(native) === \"web\") return /* @__PURE__ */ jsx(\"input\", {\n\t\ttype: \"checkbox\",\n\t\tdefaultChecked: isIndeterminate(checked) ? false : checked,\n\t\ttabIndex: -1,\n\t\tref: checkboxRef,\n\t\tdisabled: checkboxProps.disabled,\n\t\tstyle: checkboxProps.style\n\t});\n\tconst memoizedContext = useMemo(() => ({\n\t\tchecked,\n\t\tdisabled: checkboxProps.disabled\n\t}), [checked, checkboxProps.disabled]);\n\tconst isActive = !!checked;\n\tconst disabled = checkboxProps.disabled;\n\treturn /* @__PURE__ */ jsx(CheckboxContext.Provider, {\n\t\tvalue: memoizedContext,\n\t\tchildren: /* @__PURE__ */ jsxs(CheckboxStyledContext.Provider, {\n\t\t\tsize: propsActive.size ?? styledContext?.size ?? true,\n\t\t\tactive: isActive,\n\t\t\tdisabled,\n\t\t\tchildren: [/* @__PURE__ */ jsx(CheckboxFrame, {\n\t\t\t\trender: \"button\",\n\t\t\t\tref: checkboxRef,\n\t\t\t\ttheme: activeTheme ?? null,\n\t\t\t\t...isWeb && { type: \"button\" },\n\t\t\t\tchecked,\n\t\t\t\tdisabled,\n\t\t\t\t...checkboxProps,\n\t\t\t\t...props,\n\t\t\t\t...isActive && activeStyle ? activeStyle : void 0,\n\t\t\t\tchildren: propsActive.children\n\t\t\t}), bubbleInput]\n\t\t})\n\t});\n}), { Indicator: createStyledHOC(CheckboxIndicatorFrame, (props, forwardedRef) => {\n\tconst { children, forceMount, activeStyle, ...indicatorProps } = props;\n\tconst { active } = CheckboxStyledContext.useStyledContext();\n\tconst context = React.useContext(CheckboxContext);\n\tif (forceMount || isIndeterminate(context.checked) || context.checked === true) return /* @__PURE__ */ jsx(CheckboxIndicatorFrame, {\n\t\tpointerEvents: \"none\",\n\t\t...indicatorProps,\n\t\t...active && activeStyle ? activeStyle : void 0,\n\t\tref: forwardedRef,\n\t\tchildren\n\t});\n\treturn null;\n}) });\n\nexport { Checkbox2 as Checkbox, CheckboxContext, CheckboxFrame, CheckboxIndicatorFrame };"],"mappings":";;;;;;;;AAOA,MAAM,yBAAyB,OAAO,MAAM;CAC3C,aAAa;CACb,SAAS;AACV,GAAG,EAAE,QAAQ,EAAE,aAAa,QAAQ,EAAE,CAAC;AACvC,MAAM,gBAAgB,OAAO,MAAM;CAClC,aAAa;CACb,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,gBAAgB;CAChB,UAAU,EAAE,UAAU,EAAE,MAAM;EAC7B,eAAe;EACf,YAAY;CACb,EAAE,EAAE;AACL,GAAG,EAAE,QAAQ,EAAE,aAAa,QAAQ,EAAE,CAAC;AACvC,MAAM,kBAAkB,MAAM,cAAc;CAC3C,SAAS;CACT,UAAU;AACX,CAAC;AACD,MAAM,YAAY,qBAAqB,gBAAgB,eAAe,SAAS,SAAS,QAAQ,cAAc;CAC7G,MAAM,EAAE,SAAS,aAAa,gBAAgB,iBAAiB,QAAQ,aAAa,aAAa,GAAG,UAAU;CAC9G,MAAM,cAAc,SAAS,KAAK;CAClC,MAAM,gBAAgB,MAAM,WAAW,sBAAsB,OAAO;CACpE,MAAM,CAAC,UAAU,OAAO,cAAc,qBAAqB;EAC1D,MAAM;EACN,aAAa;EACb,UAAU;CACX,CAAC;CACD,MAAM,EAAE,eAAe,aAAa,gBAAgB,YAAY,aAAa,CAAC,SAAS,UAAU,GAAG,YAAY;CAChH,IAAI,2BAA2B,MAAM,MAAM,OAAO,OAAuB,oBAAI,SAAS;EACrF,MAAM;EACN,gBAAgB,gBAAgB,OAAO,IAAI,QAAQ;EACnD,UAAU,CAAC;EACX,KAAK;EACL,UAAU,cAAc;EACxB,OAAO,cAAc;CACtB,CAAC;CACD,MAAM,kBAAkB,eAAe;EACtC;EACA,UAAU,cAAc;CACzB,IAAI,CAAC,SAAS,cAAc,QAAQ,CAAC;CACrC,MAAM,WAAW,CAAC,CAAC;CACnB,MAAM,WAAW,cAAc;CAC/B,OAAuB,oBAAI,gBAAgB,UAAU;EACpD,OAAO;EACP,UAA0B,qBAAK,sBAAsB,UAAU;GAC9D,MAAM,YAAY,QAAQ,eAAe,QAAQ;GACjD,QAAQ;GACR;GACA,UAAU,CAAiB,oBAAI,eAAe;IAC7C,QAAQ;IACR,KAAK;IACL,OAAO,eAAe;IACtB,GAAG,SAAS,EAAE,MAAM,SAAS;IAC7B;IACA;IACA,GAAG;IACH,GAAG;IACH,GAAG,YAAY,cAAc,cAAc,KAAK;IAChD,UAAU,YAAY;GACvB,CAAC,GAAG,WAAW;EAChB,CAAC;CACF,CAAC;AACF,CAAC,GAAG,EAAE,WAAW,gBAAgB,yBAAyB,OAAO,iBAAiB;CACjF,MAAM,EAAE,UAAU,YAAY,aAAa,GAAG,mBAAmB;CACjE,MAAM,EAAE,WAAW,sBAAsB,iBAAiB;CAC1D,MAAM,UAAU,MAAM,WAAW,eAAe;CAChD,IAAI,cAAc,gBAAgB,QAAQ,OAAO,KAAK,QAAQ,YAAY,MAAM,OAAuB,oBAAI,wBAAwB;EAClI,eAAe;EACf,GAAG;EACH,GAAG,UAAU,cAAc,cAAc,KAAK;EAC9C,KAAK;EACL;CACD,CAAC;CACD,OAAO;AACR,CAAC,EAAE,CAAC"}
|