@tamagui/toggle-group 3.0.0-beta.1216.1 → 3.0.0-beta.1309.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 +1 -1
- package/dist/cjs/Toggle.native.cjs +1 -1
- package/dist/cjs/Toggle.native.js +1 -1
- package/dist/cjs/Toggle.native.js.map +1 -1
- package/dist/esm/Toggle.mjs +1 -1
- package/dist/esm/Toggle.mjs.map +1 -1
- package/dist/esm/Toggle.native.js +1 -1
- package/dist/esm/Toggle.native.js.map +1 -1
- package/dist/jsx/Toggle.mjs +1 -1
- package/dist/jsx/Toggle.mjs.map +1 -1
- package/dist/jsx/Toggle.native.cjs +1 -1
- package/dist/jsx/Toggle.native.js +1 -1
- package/dist/jsx/Toggle.native.js.map +1 -1
- package/package.json +16 -16
- package/src/Toggle.tsx +1 -1
- package/src/ToggleGroup.tsx +13 -2
- package/types/ToggleGroup.d.ts +10 -3
- package/types/ToggleGroup.d.ts.map +1 -1
package/dist/cjs/Toggle.cjs
CHANGED
|
@@ -61,7 +61,7 @@ const Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(prop
|
|
|
61
61
|
defaultProp: defaultActive
|
|
62
62
|
});
|
|
63
63
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {
|
|
64
|
-
theme: activeTheme ?? null,
|
|
64
|
+
theme: active ? activeTheme ?? null : null,
|
|
65
65
|
"aria-pressed": active,
|
|
66
66
|
"data-state": active ? "on" : "off",
|
|
67
67
|
"data-disabled": props.disabled ? "" : void 0,
|
|
@@ -71,7 +71,7 @@ var Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(props,
|
|
|
71
71
|
});
|
|
72
72
|
var _props_onPress;
|
|
73
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {
|
|
74
|
-
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
74
|
+
theme: active ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,
|
|
75
75
|
"aria-pressed": active,
|
|
76
76
|
"data-state": active ? "on" : "off",
|
|
77
77
|
"data-disabled": props.disabled ? "" : void 0,
|
|
@@ -71,7 +71,7 @@ var Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(props,
|
|
|
71
71
|
});
|
|
72
72
|
var _props_onPress;
|
|
73
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {
|
|
74
|
-
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
74
|
+
theme: active ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,
|
|
75
75
|
"aria-pressed": active,
|
|
76
76
|
"data-state": active ? "on" : "off",
|
|
77
77
|
"data-disabled": props.disabled ? "" : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.native.js","names":[],"sources":["cjs/Toggle.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 Toggle_exports = {};\n__export(Toggle_exports, {\n Toggle: () => Toggle,\n ToggleFrame: () => ToggleFrame\n});\nmodule.exports = __toCommonJS(Toggle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_size = require(\"@tamagui/size\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_context = require(\"./context\");\nvar NAME = \"Toggle\";\nvar ToggleFrame = (0, import_web.styled)(import_web.View, {\n displayName: NAME,\n render: \"button\",\n context: import_context.context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: import_web.styled.dynamic(function(val, env) {\n if (!val) return;\n var { frame, controlHeight } = (0, import_size.resolveSize)(val, env);\n var side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\n }\n }\n});\nvar Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(props, forwardedRef) {\n var { active: activeProp, activeStyle, defaultActive = false, onActiveChange, activeTheme, ...buttonProps } = props;\n var [active = false, setActive] = (0, import_use_controllable_state.useControllableState)({\n prop: activeProp,\n onChange: onActiveChange,\n defaultProp: defaultActive\n });\n var _props_onPress;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {\n theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,\n \"aria-pressed\": active,\n \"data-state\": active ? \"on\" : \"off\",\n \"data-disabled\": props.disabled ? \"\" : void 0,\n ...active && !activeStyle && {\n defaultActiveStyle: true\n },\n ...buttonProps,\n style: [\n buttonProps.style,\n active && activeStyle\n ],\n ref: forwardedRef,\n onPress: (0, import_helpers.composeEventHandlers)((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {\n if (!props.disabled) {\n setActive(function(prev) {\n return !prev;\n });\n }\n })\n });\n});\n//# sourceMappingURL=Toggle.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;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,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB;CACvB,cAAc;CACd,mBAAmB;AACrB,CAAC;AACD,OAAO,UAAU,aAAa,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\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 Toggle_exports = {};\n__export(Toggle_exports, {\n Toggle: () => Toggle,\n ToggleFrame: () => ToggleFrame\n});\nmodule.exports = __toCommonJS(Toggle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_size = require(\"@tamagui/size\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_context = require(\"./context\");\nvar NAME = \"Toggle\";\nvar ToggleFrame = (0, import_web.styled)(import_web.View, {\n displayName: NAME,\n render: \"button\",\n context: import_context.context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: import_web.styled.dynamic(function(val, env) {\n if (!val) return;\n var { frame, controlHeight } = (0, import_size.resolveSize)(val, env);\n var side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\n }\n }\n});\nvar Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(props, forwardedRef) {\n var { active: activeProp, activeStyle, defaultActive = false, onActiveChange, activeTheme, ...buttonProps } = props;\n var [active = false, setActive] = (0, import_use_controllable_state.useControllableState)({\n prop: activeProp,\n onChange: onActiveChange,\n defaultProp: defaultActive\n });\n var _props_onPress;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {\n theme: active ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,\n \"aria-pressed\": active,\n \"data-state\": active ? \"on\" : \"off\",\n \"data-disabled\": props.disabled ? \"\" : void 0,\n ...active && !activeStyle && {\n defaultActiveStyle: true\n },\n ...buttonProps,\n style: [\n buttonProps.style,\n active && activeStyle\n ],\n ref: forwardedRef,\n onPress: (0, import_helpers.composeEventHandlers)((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {\n if (!props.disabled) {\n setActive(function(prev) {\n return !prev;\n });\n }\n })\n });\n});\n//# sourceMappingURL=Toggle.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;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,kBA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BAAgB;GAC3B,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc,MAAM;GACtB;EACF,CAAC;EACD,oBAAoB,EAClB,MAAM,CAAC,EACT;CACF;AACF,CAAC;AACD,IAAI,UAAU,GAAG,oBAAoB,mBAAkB,CAAE,SAAS,QAAQ,OAAO,cAAc;CAC7F,IAAI,EAAE,QAAQ,YAAY,aAAa,gBAAgB,OAAO,gBAAgB,aAAa,GAAG,gBAAgB;CAC9G,IAAI,CAAC,SAAS,OAAO,cAAc,GAAG,8BAA8B,qBAAoB,CAAE;EACxF,MAAM;EACN,UAAU;EACV,aAAa;CACf,CAAC;CACD,IAAI;CACJ,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,aAAa;EAC9D,OAAO,SAAS,gBAAgB,QAAQ,gBAAgB,KAAK,IAAI,cAAc,OAAO;EACtF,gBAAgB;EAChB,cAAc,SAAS,OAAO;EAC9B,iBAAiB,MAAM,WAAW,KAAK,KAAK;EAC5C,GAAG,UAAU,CAAC,eAAe,EAC3B,oBAAoB,KACtB;EACA,GAAG;EACH,OAAO,CACL,YAAY,OACZ,UAAU,WACZ;EACA,KAAK;EACL,UAAU,GAAG,eAAe,qBAAoB,EAAG,iBAAiB,MAAM,aAAa,QAAQ,mBAAmB,KAAK,IAAI,iBAAiB,KAAK,GAAG,WAAW;GAC7J,IAAI,CAAC,MAAM,UAAU;IACnB,UAAU,SAAS,MAAM;KACvB,OAAO,CAAC;IACV,CAAC;GACH;EACF,CAAC;CACH,CAAC;AACH,CAAC"}
|
package/dist/esm/Toggle.mjs
CHANGED
|
@@ -36,7 +36,7 @@ const Toggle = createRefComponent(function Toggle2(props, forwardedRef) {
|
|
|
36
36
|
defaultProp: defaultActive
|
|
37
37
|
});
|
|
38
38
|
return /* @__PURE__ */ jsx(ToggleFrame, {
|
|
39
|
-
theme: activeTheme ?? null,
|
|
39
|
+
theme: active ? activeTheme ?? null : null,
|
|
40
40
|
"aria-pressed": active,
|
|
41
41
|
"data-state": active ? "on" : "off",
|
|
42
42
|
"data-disabled": props.disabled ? "" : void 0,
|
package/dist/esm/Toggle.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.js","names":[],"sources":["esm/Toggle.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { resolveSize } 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(View, {\n displayName: NAME,\n render: \"button\",\n context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: styled.dynamic((val, env) => {\n if (!val) return;\n const { frame, controlHeight } = resolveSize(val, env);\n const side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\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 style: [buttonProps.style, active && activeStyle],\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,OAAO,MAAM;CAC/B,aAAa;CACb,QAAQ;CACR;CACA,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,UAAU;EACR,MAAM,OAAO,SAAS,KAAK,QAAQ;GACjC,IAAI,CAAC,KAAK;GACV,MAAM,EAAE,OAAO,kBAAkB,YAAY,KAAK,GAAG;GACrD,MAAM,OAAO,gBAAgB;GAC7B,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc,MAAM;GACtB;EACF,CAAC;EACD,oBAAoB,EAClB,MAAM,CAAC,EACT;CACF;AACF,CAAC;AACD,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;
|
|
1
|
+
{"version":3,"file":"Toggle.js","names":[],"sources":["esm/Toggle.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { resolveSize } 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(View, {\n displayName: NAME,\n render: \"button\",\n context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: styled.dynamic((val, env) => {\n if (!val) return;\n const { frame, controlHeight } = resolveSize(val, env);\n const side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\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: active ? activeTheme ?? null : 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 style: [buttonProps.style, active && activeStyle],\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,OAAO,MAAM;CAC/B,aAAa;CACb,QAAQ;CACR;CACA,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,UAAU;EACR,MAAM,OAAO,SAAS,KAAK,QAAQ;GACjC,IAAI,CAAC,KAAK;GACV,MAAM,EAAE,OAAO,kBAAkB,YAAY,KAAK,GAAG;GACrD,MAAM,OAAO,gBAAgB;GAC7B,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc,MAAM;GACtB;EACF,CAAC;EACD,oBAAoB,EAClB,MAAM,CAAC,EACT;CACF;AACF,CAAC;AACD,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,SAAS,eAAe,OAAO;EACtC,gBAAgB;EAChB,cAAc,SAAS,OAAO;EAC9B,iBAAiB,MAAM,WAAW,KAAK,KAAK;EAC5C,GAAG,UAAU,CAAC,eAAe,EAAE,oBAAoB,KAAK;EACxD,GAAG;EACH,OAAO,CAAC,YAAY,OAAO,UAAU,WAAW;EAChD,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"}
|
|
@@ -38,7 +38,7 @@ var Toggle = createRefComponent(function Toggle2(props, forwardedRef) {
|
|
|
38
38
|
});
|
|
39
39
|
var _props_onPress;
|
|
40
40
|
return /* @__PURE__ */ jsx(ToggleFrame, {
|
|
41
|
-
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
41
|
+
theme: active ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,
|
|
42
42
|
"aria-pressed": active,
|
|
43
43
|
"data-state": active ? "on" : "off",
|
|
44
44
|
"data-disabled": props.disabled ? "" : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.native.js","names":[],"sources":["esm/Toggle.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { resolveSize } from \"@tamagui/size\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { styled, View } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { context } from \"./context\";\nvar NAME = \"Toggle\";\nvar ToggleFrame = styled(View, {\n displayName: NAME,\n render: \"button\",\n context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: styled.dynamic(function(val, env) {\n if (!val) return;\n var { frame, controlHeight } = resolveSize(val, env);\n var side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\n }\n }\n});\nvar Toggle = createRefComponent(function Toggle2(props, forwardedRef) {\n var { active: activeProp, activeStyle, defaultActive = false, onActiveChange, activeTheme, ...buttonProps } = props;\n var [active = false, setActive] = useControllableState({\n prop: activeProp,\n onChange: onActiveChange,\n defaultProp: defaultActive\n });\n var _props_onPress;\n return /* @__PURE__ */ _jsx(ToggleFrame, {\n theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,\n \"aria-pressed\": active,\n \"data-state\": active ? \"on\" : \"off\",\n \"data-disabled\": props.disabled ? \"\" : void 0,\n ...active && !activeStyle && {\n defaultActiveStyle: true\n },\n ...buttonProps,\n style: [\n buttonProps.style,\n active && activeStyle\n ],\n ref: forwardedRef,\n onPress: composeEventHandlers((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {\n if (!props.disabled) {\n setActive(function(prev) {\n return !prev;\n });\n }\n })\n });\n});\nexport {\n Toggle,\n ToggleFrame\n};\n//# sourceMappingURL=Toggle.js.map\n"],"mappings":";;;;;;;;;;AAQA,IAAI,OAAO;AACX,IAAI,cAAc,OAAO,MAAM;CAC7B,aAAa;CACb,QAAQ;CACR;CACA,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,UAAU;EACR,MAAM,OAAO,QAAQ,SAAS,KAAK,KAAK;GACtC,IAAI,CAAC,KAAK;GACV,IAAI,EAAE,OAAO,kBAAkB,YAAY,KAAK,GAAG;GACnD,IAAI,OAAO,gBAAgB;GAC3B,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc,MAAM;GACtB;EACF,CAAC;EACD,oBAAoB,EAClB,MAAM,CAAC,EACT;CACF;AACF,CAAC;AACD,IAAI,SAAS,mBAAmB,SAAS,QAAQ,OAAO,cAAc;CACpE,IAAI,EAAE,QAAQ,YAAY,aAAa,gBAAgB,OAAO,gBAAgB,aAAa,GAAG,gBAAgB;CAC9G,IAAI,CAAC,SAAS,OAAO,aAAa,qBAAqB;EACrD,MAAM;EACN,UAAU;EACV,aAAa;CACf,CAAC;CACD,IAAI;CACJ,OAAuB,oBAAK,aAAa;EACvC,OAAO,gBAAgB,QAAQ,gBAAgB,KAAK,IAAI,cAAc;
|
|
1
|
+
{"version":3,"file":"Toggle.native.js","names":[],"sources":["esm/Toggle.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { resolveSize } from \"@tamagui/size\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { styled, View } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { context } from \"./context\";\nvar NAME = \"Toggle\";\nvar ToggleFrame = styled(View, {\n displayName: NAME,\n render: \"button\",\n context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: styled.dynamic(function(val, env) {\n if (!val) return;\n var { frame, controlHeight } = resolveSize(val, env);\n var side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\n }\n }\n});\nvar Toggle = createRefComponent(function Toggle2(props, forwardedRef) {\n var { active: activeProp, activeStyle, defaultActive = false, onActiveChange, activeTheme, ...buttonProps } = props;\n var [active = false, setActive] = useControllableState({\n prop: activeProp,\n onChange: onActiveChange,\n defaultProp: defaultActive\n });\n var _props_onPress;\n return /* @__PURE__ */ _jsx(ToggleFrame, {\n theme: active ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,\n \"aria-pressed\": active,\n \"data-state\": active ? \"on\" : \"off\",\n \"data-disabled\": props.disabled ? \"\" : void 0,\n ...active && !activeStyle && {\n defaultActiveStyle: true\n },\n ...buttonProps,\n style: [\n buttonProps.style,\n active && activeStyle\n ],\n ref: forwardedRef,\n onPress: composeEventHandlers((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {\n if (!props.disabled) {\n setActive(function(prev) {\n return !prev;\n });\n }\n })\n });\n});\nexport {\n Toggle,\n ToggleFrame\n};\n//# sourceMappingURL=Toggle.js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Ref) {
|
|
|
36
36
|
defaultProp: defaultActive
|
|
37
37
|
});
|
|
38
38
|
return /* @__PURE__ */ jsx(ToggleFrame, {
|
|
39
|
-
theme: activeTheme ?? null,
|
|
39
|
+
theme: active ? activeTheme ?? null : null,
|
|
40
40
|
"aria-pressed": active,
|
|
41
41
|
"data-state": active ? "on" : "off",
|
|
42
42
|
"data-disabled": props.disabled ? "" : void 0,
|
package/dist/jsx/Toggle.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.js","names":[],"sources":["jsx/Toggle.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { resolveSize } 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(View, {\n displayName: NAME,\n render: \"button\",\n context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: styled.dynamic((val, env) => {\n if (!val) return;\n const { frame, controlHeight } = resolveSize(val, env);\n const side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\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 style: [buttonProps.style, active && activeStyle],\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,OAAO,MAAM;CAC/B,aAAa;CACb,QAAQ;CACR;CACA,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,UAAU;EACR,MAAM,OAAO,SAAS,KAAK,QAAQ;GACjC,IAAI,CAAC,KAAK;GACV,MAAM,EAAE,OAAO,kBAAkB,YAAY,KAAK,GAAG;GACrD,MAAM,OAAO,gBAAgB;GAC7B,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc,MAAM;GACtB;EACF,CAAC;EACD,oBAAoB,EAClB,MAAM,CAAC,EACT;CACF;AACF,CAAC;AACD,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;
|
|
1
|
+
{"version":3,"file":"Toggle.js","names":[],"sources":["jsx/Toggle.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { resolveSize } 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(View, {\n displayName: NAME,\n render: \"button\",\n context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: styled.dynamic((val, env) => {\n if (!val) return;\n const { frame, controlHeight } = resolveSize(val, env);\n const side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\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: active ? activeTheme ?? null : 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 style: [buttonProps.style, active && activeStyle],\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,OAAO,MAAM;CAC/B,aAAa;CACb,QAAQ;CACR;CACA,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,UAAU;EACR,MAAM,OAAO,SAAS,KAAK,QAAQ;GACjC,IAAI,CAAC,KAAK;GACV,MAAM,EAAE,OAAO,kBAAkB,YAAY,KAAK,GAAG;GACrD,MAAM,OAAO,gBAAgB;GAC7B,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc,MAAM;GACtB;EACF,CAAC;EACD,oBAAoB,EAClB,MAAM,CAAC,EACT;CACF;AACF,CAAC;AACD,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,SAAS,eAAe,OAAO;EACtC,gBAAgB;EAChB,cAAc,SAAS,OAAO;EAC9B,iBAAiB,MAAM,WAAW,KAAK,KAAK;EAC5C,GAAG,UAAU,CAAC,eAAe,EAAE,oBAAoB,KAAK;EACxD,GAAG;EACH,OAAO,CAAC,YAAY,OAAO,UAAU,WAAW;EAChD,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"}
|
|
@@ -71,7 +71,7 @@ var Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(props,
|
|
|
71
71
|
});
|
|
72
72
|
var _props_onPress;
|
|
73
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {
|
|
74
|
-
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
74
|
+
theme: active ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,
|
|
75
75
|
"aria-pressed": active,
|
|
76
76
|
"data-state": active ? "on" : "off",
|
|
77
77
|
"data-disabled": props.disabled ? "" : void 0,
|
|
@@ -71,7 +71,7 @@ var Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(props,
|
|
|
71
71
|
});
|
|
72
72
|
var _props_onPress;
|
|
73
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {
|
|
74
|
-
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
74
|
+
theme: active ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,
|
|
75
75
|
"aria-pressed": active,
|
|
76
76
|
"data-state": active ? "on" : "off",
|
|
77
77
|
"data-disabled": props.disabled ? "" : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.native.js","names":[],"sources":["jsx/Toggle.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 Toggle_exports = {};\n__export(Toggle_exports, {\n Toggle: () => Toggle,\n ToggleFrame: () => ToggleFrame\n});\nmodule.exports = __toCommonJS(Toggle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_size = require(\"@tamagui/size\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_context = require(\"./context\");\nvar NAME = \"Toggle\";\nvar ToggleFrame = (0, import_web.styled)(import_web.View, {\n displayName: NAME,\n render: \"button\",\n context: import_context.context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: import_web.styled.dynamic(function(val, env) {\n if (!val) return;\n var { frame, controlHeight } = (0, import_size.resolveSize)(val, env);\n var side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\n }\n }\n});\nvar Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(props, forwardedRef) {\n var { active: activeProp, activeStyle, defaultActive = false, onActiveChange, activeTheme, ...buttonProps } = props;\n var [active = false, setActive] = (0, import_use_controllable_state.useControllableState)({\n prop: activeProp,\n onChange: onActiveChange,\n defaultProp: defaultActive\n });\n var _props_onPress;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {\n theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,\n \"aria-pressed\": active,\n \"data-state\": active ? \"on\" : \"off\",\n \"data-disabled\": props.disabled ? \"\" : void 0,\n ...active && !activeStyle && {\n defaultActiveStyle: true\n },\n ...buttonProps,\n style: [\n buttonProps.style,\n active && activeStyle\n ],\n ref: forwardedRef,\n onPress: (0, import_helpers.composeEventHandlers)((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {\n if (!props.disabled) {\n setActive(function(prev) {\n return !prev;\n });\n }\n })\n });\n});\n//# sourceMappingURL=Toggle.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;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,Q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OAAO,mBAAmB,GAAG,YAAY,YAAW,CAAE,KAAK,GAAG;GACpE,IAAI,OAAO,gBAAgB;GAC3B,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc,MAAM;GACtB;EACF,CAAC;EACD,oBAAoB,EAClB,MAAM,CAAC,EACT;CACF;AACF,CAAC;AACD,IAAI,UAAU,GAAG,oBAAoB,mBAAkB,CAAE,SAAS,QAAQ,OAAO,cAAc;CAC7F,IAAI,EAAE,QAAQ,YAAY,aAAa,gBAAgB,OAAO,gBAAgB,aAAa,GAAG,gBAAgB;CAC9G,IAAI,CAAC,SAAS,OAAO,cAAc,GAAG,8BAA8B,qBAAoB,CAAE;EACxF,MAAM;EACN,UAAU;EACV,aAAa;CACf,CAAC;CACD,IAAI;CACJ,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,aAAa;EAC9D,OAAO,gBAAgB,QAAQ,gBAAgB,KAAK,IAAI,cAAc;
|
|
1
|
+
{"version":3,"file":"Toggle.native.js","names":[],"sources":["jsx/Toggle.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 Toggle_exports = {};\n__export(Toggle_exports, {\n Toggle: () => Toggle,\n ToggleFrame: () => ToggleFrame\n});\nmodule.exports = __toCommonJS(Toggle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_size = require(\"@tamagui/size\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_context = require(\"./context\");\nvar NAME = \"Toggle\";\nvar ToggleFrame = (0, import_web.styled)(import_web.View, {\n displayName: NAME,\n render: \"button\",\n context: import_context.context,\n size: true,\n alignItems: \"center\",\n justifyContent: \"center\",\n variants: {\n size: import_web.styled.dynamic(function(val, env) {\n if (!val) return;\n var { frame, controlHeight } = (0, import_size.resolveSize)(val, env);\n var side = controlHeight + 2;\n return {\n width: side,\n height: side,\n borderRadius: frame.borderRadius\n };\n }),\n defaultActiveStyle: {\n true: {}\n }\n }\n});\nvar Toggle = (0, import_compose_refs.createRefComponent)(function Toggle2(props, forwardedRef) {\n var { active: activeProp, activeStyle, defaultActive = false, onActiveChange, activeTheme, ...buttonProps } = props;\n var [active = false, setActive] = (0, import_use_controllable_state.useControllableState)({\n prop: activeProp,\n onChange: onActiveChange,\n defaultProp: defaultActive\n });\n var _props_onPress;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleFrame, {\n theme: active ? activeTheme !== null && activeTheme !== void 0 ? activeTheme : null : null,\n \"aria-pressed\": active,\n \"data-state\": active ? \"on\" : \"off\",\n \"data-disabled\": props.disabled ? \"\" : void 0,\n ...active && !activeStyle && {\n defaultActiveStyle: true\n },\n ...buttonProps,\n style: [\n buttonProps.style,\n active && activeStyle\n ],\n ref: forwardedRef,\n onPress: (0, import_helpers.composeEventHandlers)((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {\n if (!props.disabled) {\n setActive(function(prev) {\n return !prev;\n });\n }\n })\n });\n});\n//# sourceMappingURL=Toggle.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;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,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB;CACvB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S,OAAO;EAC9B,iBAAiB,MAAM,WAAW,KAAK,KAAK;EAC5C,GAAG,UAAU,CAAC,eAAe,EAC3B,oBAAoB,KACtB;EACA,GAAG;EACH,OAAO,CACL,YAAY,OACZ,UAAU,WACZ;EACA,KAAK;EACL,UAAU,GAAG,eAAe,qBAAoB,EAAG,iBAAiB,MAAM,aAAa,QAAQ,mBAAmB,KAAK,IAAI,iBAAiB,KAAK,GAAG,WAAW;GAC7J,IAAI,CAAC,MAAM,UAAU;IACnB,UAAU,SAAS,MAAM;KACvB,OAAO,CAAC;IACV,CAAC;GACH;EACF,CAAC;CACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/toggle-group",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.1309.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
"clean:build": "tamagui-build clean:build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tamagui/compose-refs": "3.0.0-beta.
|
|
39
|
-
"@tamagui/constants": "3.0.0-beta.
|
|
40
|
-
"@tamagui/create-context": "3.0.0-beta.
|
|
41
|
-
"@tamagui/focusable": "3.0.0-beta.
|
|
42
|
-
"@tamagui/font-size": "3.0.0-beta.
|
|
43
|
-
"@tamagui/get-token": "3.0.0-beta.
|
|
44
|
-
"@tamagui/helpers": "3.0.0-beta.
|
|
45
|
-
"@tamagui/helpers-tamagui": "3.0.0-beta.
|
|
46
|
-
"@tamagui/roving-focus": "3.0.0-beta.
|
|
47
|
-
"@tamagui/size": "3.0.0-beta.
|
|
48
|
-
"@tamagui/stacks": "3.0.0-beta.
|
|
49
|
-
"@tamagui/use-controllable-state": "3.0.0-beta.
|
|
50
|
-
"@tamagui/use-direction": "3.0.0-beta.
|
|
51
|
-
"@tamagui/web": "3.0.0-beta.
|
|
38
|
+
"@tamagui/compose-refs": "3.0.0-beta.1309.1",
|
|
39
|
+
"@tamagui/constants": "3.0.0-beta.1309.1",
|
|
40
|
+
"@tamagui/create-context": "3.0.0-beta.1309.1",
|
|
41
|
+
"@tamagui/focusable": "3.0.0-beta.1309.1",
|
|
42
|
+
"@tamagui/font-size": "3.0.0-beta.1309.1",
|
|
43
|
+
"@tamagui/get-token": "3.0.0-beta.1309.1",
|
|
44
|
+
"@tamagui/helpers": "3.0.0-beta.1309.1",
|
|
45
|
+
"@tamagui/helpers-tamagui": "3.0.0-beta.1309.1",
|
|
46
|
+
"@tamagui/roving-focus": "3.0.0-beta.1309.1",
|
|
47
|
+
"@tamagui/size": "3.0.0-beta.1309.1",
|
|
48
|
+
"@tamagui/stacks": "3.0.0-beta.1309.1",
|
|
49
|
+
"@tamagui/use-controllable-state": "3.0.0-beta.1309.1",
|
|
50
|
+
"@tamagui/use-direction": "3.0.0-beta.1309.1",
|
|
51
|
+
"@tamagui/web": "3.0.0-beta.1309.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@tamagui/build": "3.0.0-beta.
|
|
54
|
+
"@tamagui/build": "3.0.0-beta.1309.1",
|
|
55
55
|
"react": "19.2.3"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
package/src/Toggle.tsx
CHANGED
|
@@ -81,7 +81,7 @@ export const Toggle = createRefComponent<TamaguiElement, ToggleProps>(
|
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
83
|
<ToggleFrame
|
|
84
|
-
theme={activeTheme ?? null}
|
|
84
|
+
theme={active ? (activeTheme ?? null) : null}
|
|
85
85
|
aria-pressed={active}
|
|
86
86
|
data-state={active ? 'on' : 'off'}
|
|
87
87
|
data-disabled={props.disabled ? '' : undefined}
|
package/src/ToggleGroup.tsx
CHANGED
|
@@ -128,7 +128,18 @@ interface ToggleGroupMultipleProps extends ToggleGroupImplMultipleProps {
|
|
|
128
128
|
type: 'multiple'
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
interface ToggleGroupGeneralProps extends ToggleGroupImplProps {
|
|
132
|
+
type: 'single' | 'multiple'
|
|
133
|
+
value?: string | string[]
|
|
134
|
+
defaultValue?: string | string[]
|
|
135
|
+
onValueChange?(value: any): void
|
|
136
|
+
disableDeactivation?: boolean
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
type ToggleGroupProps =
|
|
140
|
+
| ToggleGroupSingleProps
|
|
141
|
+
| ToggleGroupMultipleProps
|
|
142
|
+
| ToggleGroupGeneralProps
|
|
132
143
|
|
|
133
144
|
const ToggleGroup = withStaticProperties(
|
|
134
145
|
createRefComponent<TamaguiElement, ScopedProps<ToggleGroupProps>>(
|
|
@@ -235,7 +246,7 @@ interface ToggleGroupImplMultipleProps extends ToggleGroupImplProps {
|
|
|
235
246
|
defaultValue?: string[]
|
|
236
247
|
/** The callback that fires when the state of the toggle group changes. */
|
|
237
248
|
onValueChange?(value: string[]): void
|
|
238
|
-
disableDeactivation?:
|
|
249
|
+
disableDeactivation?: boolean
|
|
239
250
|
}
|
|
240
251
|
|
|
241
252
|
const ToggleGroupImplMultiple = createRefComponent<
|
package/types/ToggleGroup.d.ts
CHANGED
|
@@ -19,7 +19,14 @@ interface ToggleGroupSingleProps extends ToggleGroupImplSingleProps {
|
|
|
19
19
|
interface ToggleGroupMultipleProps extends ToggleGroupImplMultipleProps {
|
|
20
20
|
type: 'multiple';
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
interface ToggleGroupGeneralProps extends ToggleGroupImplProps {
|
|
23
|
+
type: 'single' | 'multiple';
|
|
24
|
+
value?: string | string[];
|
|
25
|
+
defaultValue?: string | string[];
|
|
26
|
+
onValueChange?(value: any): void;
|
|
27
|
+
disableDeactivation?: boolean;
|
|
28
|
+
}
|
|
29
|
+
type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps | ToggleGroupGeneralProps;
|
|
23
30
|
declare const ToggleGroup: ((props: ScopedProps<ToggleGroupProps> & import("@tamagui/compose-refs").RefProp<TamaguiElement>) => React.ReactNode) & {
|
|
24
31
|
displayName?: string;
|
|
25
32
|
propTypes?: any;
|
|
@@ -40,7 +47,7 @@ declare const ToggleGroup: ((props: ScopedProps<ToggleGroupProps> & import("@tam
|
|
|
40
47
|
disabled?: boolean;
|
|
41
48
|
} & {
|
|
42
49
|
__scopeToggleGroup?: string;
|
|
43
|
-
},
|
|
50
|
+
}, import("@tamagui/react-native-types/src").View | (HTMLElement & import("@tamagui/web").TamaguiElementMethods), import("@tamagui/web").StackNonStyleProps & Omit<import("@tamagui/web").StackNonStyleProps, "active" | "defaultActiveStyle" | "size" | keyof import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithFlatVariantValues<{
|
|
44
51
|
active?: boolean | undefined;
|
|
45
52
|
defaultActiveStyle?: boolean | undefined;
|
|
46
53
|
size?: any;
|
|
@@ -75,7 +82,7 @@ interface ToggleGroupImplMultipleProps extends ToggleGroupImplProps {
|
|
|
75
82
|
defaultValue?: string[];
|
|
76
83
|
/** The callback that fires when the state of the toggle group changes. */
|
|
77
84
|
onValueChange?(value: string[]): void;
|
|
78
|
-
disableDeactivation?:
|
|
85
|
+
disableDeactivation?: boolean;
|
|
79
86
|
}
|
|
80
87
|
type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup>;
|
|
81
88
|
declare const ToggleGroupFrame: React.FunctionComponent<Omit<import("@tamagui/web").StackNonStyleProps, keyof import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithFlatVariantValues<{}> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleGroup.d.ts","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