@tamagui/radio-headless 3.0.7 → 3.0.9
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/BubbleInput.native.cjs +1 -1
- package/dist/cjs/BubbleInput.native.js +1 -1
- package/dist/cjs/BubbleInput.native.js.map +1 -1
- package/dist/cjs/useRadioGroup.native.cjs +5 -5
- package/dist/cjs/useRadioGroup.native.js +5 -5
- package/dist/cjs/useRadioGroup.native.js.map +1 -1
- package/dist/esm/BubbleInput.native.js +1 -1
- package/dist/esm/BubbleInput.native.js.map +1 -1
- package/dist/esm/useRadioGroup.native.js +5 -5
- package/dist/esm/useRadioGroup.native.js.map +1 -1
- package/dist/jsx/BubbleInput.native.cjs +1 -1
- package/dist/jsx/BubbleInput.native.js +1 -1
- package/dist/jsx/BubbleInput.native.js.map +1 -1
- package/dist/jsx/useRadioGroup.native.cjs +5 -5
- package/dist/jsx/useRadioGroup.native.js +5 -5
- package/dist/jsx/useRadioGroup.native.js.map +1 -1
- package/package.json +13 -13
|
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(BubbleInput_exports);
|
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
var import_react = __toESM(require("react"), 1);
|
|
34
34
|
var import_use_previous = require("@tamagui/use-previous");
|
|
35
|
-
var BubbleInput = function(props) {
|
|
35
|
+
var BubbleInput = function BubbleInput2(props) {
|
|
36
36
|
var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;
|
|
37
37
|
var ref = import_react.default.useRef(null);
|
|
38
38
|
var prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(BubbleInput_exports);
|
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
var import_react = __toESM(require("react"), 1);
|
|
34
34
|
var import_use_previous = require("@tamagui/use-previous");
|
|
35
|
-
var BubbleInput = function(props) {
|
|
35
|
+
var BubbleInput = function BubbleInput2(props) {
|
|
36
36
|
var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;
|
|
37
37
|
var ref = import_react.default.useRef(null);
|
|
38
38
|
var prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleInput.native.js","names":[],"sources":["cjs/BubbleInput.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 BubbleInput_exports = {};\n__export(BubbleInput_exports, {\n BubbleInput: () => BubbleInput\n});\nmodule.exports = __toCommonJS(BubbleInput_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_use_previous = require(\"@tamagui/use-previous\");\nvar BubbleInput = function(props) {\n var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;\n var ref = import_react.default.useRef(null);\n var prevChecked = (0, import_use_previous.usePrevious)(checked);\n import_react.default.useEffect(function() {\n var input = ref.current;\n var inputProto = window.HTMLInputElement.prototype;\n var descriptor = Object.getOwnPropertyDescriptor(inputProto, \"checked\");\n var setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n var event = new Event(\"click\", {\n bubbles\n });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [\n prevChecked,\n checked,\n bubbles\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"input\", {\n type: \"radio\",\n defaultChecked: checked,\n ...inputProps,\n tabIndex: -1,\n ref,\n \"aria-hidden\": isHidden,\n style: {\n ...isHidden ? {\n // ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0\n } : {\n appearance: \"auto\",\n accentColor\n },\n ...props.style\n }\n });\n};\n//# sourceMappingURL=BubbleInput.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,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB,EAC5B,mBAAmB,YACrB,CAAC;AACD,OAAO,UAAU,aAAa,mBAAmB;AACjD,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,eAAe,QAAQ,QAAQ,OAAO,GAAG,CAAC;AAC9C,IAAI,sBAAsB,QAAQ,uBAAuB;AACzD,IAAI,cAAc,SAAS,OAAO;
|
|
1
|
+
{"version":3,"file":"BubbleInput.native.js","names":[],"sources":["cjs/BubbleInput.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 BubbleInput_exports = {};\n__export(BubbleInput_exports, {\n BubbleInput: () => BubbleInput\n});\nmodule.exports = __toCommonJS(BubbleInput_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_use_previous = require(\"@tamagui/use-previous\");\nvar BubbleInput = function BubbleInput2(props) {\n var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;\n var ref = import_react.default.useRef(null);\n var prevChecked = (0, import_use_previous.usePrevious)(checked);\n import_react.default.useEffect(function() {\n var input = ref.current;\n var inputProto = window.HTMLInputElement.prototype;\n var descriptor = Object.getOwnPropertyDescriptor(inputProto, \"checked\");\n var setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n var event = new Event(\"click\", {\n bubbles\n });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [\n prevChecked,\n checked,\n bubbles\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"input\", {\n type: \"radio\",\n defaultChecked: checked,\n ...inputProps,\n tabIndex: -1,\n ref,\n \"aria-hidden\": isHidden,\n style: {\n ...isHidden ? {\n // ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0\n } : {\n appearance: \"auto\",\n accentColor\n },\n ...props.style\n }\n });\n};\n//# sourceMappingURL=BubbleInput.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,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,aAAa,OAAO,iBAAiB;EACzC,IAAI,aAAa,OAAO,yBAAyB,YAAY,SAAS;EACtE,IAAI,aAAa,WAAW;EAC5B,IAAI,gBAAgB,WAAW,YAAY;GACzC,IAAI,QAAQ,IAAI,MAAM,SAAS,EAC7B,QACF,CAAC;GACD,WAAW,KAAK,OAAO,OAAO;GAC9B,MAAM,cAAc,KAAK;EAC3B;CACF,GAAG;EACD;EACA;EACA;CACF,CAAC;CACD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,SAAS;EAC1D,MAAM;EACN,gBAAgB;EAChB,GAAG;EACH,UAAU,CAAC;EACX;EACA,eAAe;EACf,OAAO;GACL,GAAG,WAAW;IAEZ,UAAU;IACV,eAAe;IACf,SAAS;IACT,QAAQ;GACV,IAAI;IACF,YAAY;IACZ;GACF;GACA,GAAG,MAAM;EACX;CACF,CAAC;AACH"}
|
|
@@ -71,7 +71,7 @@ var ARROW_KEYS = [
|
|
|
71
71
|
"ArrowLeft",
|
|
72
72
|
"ArrowRight"
|
|
73
73
|
];
|
|
74
|
-
var useRadioGroupItem = function(params) {
|
|
74
|
+
var useRadioGroupItem = function useRadioGroupItem2(params) {
|
|
75
75
|
var { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;
|
|
76
76
|
var { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);
|
|
77
77
|
var [button, setButton] = (0, import_react.useState)(null);
|
|
@@ -87,10 +87,10 @@ var useRadioGroupItem = function(params) {
|
|
|
87
87
|
var labelledBy = ariaLabelledby || labelId;
|
|
88
88
|
(0, import_react.useEffect)(function() {
|
|
89
89
|
if (import_constants.isWeb) {
|
|
90
|
-
var handleKeyDown = function(event) {
|
|
90
|
+
var handleKeyDown = function handleKeyDown2(event) {
|
|
91
91
|
if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
|
|
92
92
|
};
|
|
93
|
-
var handleKeyUp = function() {
|
|
93
|
+
var handleKeyUp = function handleKeyUp2() {
|
|
94
94
|
isArrowKeyPressedRef.current = false;
|
|
95
95
|
};
|
|
96
96
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -105,10 +105,10 @@ var useRadioGroupItem = function(params) {
|
|
|
105
105
|
if (!id) return;
|
|
106
106
|
if (disabled) return;
|
|
107
107
|
return (0, import_focusable.registerFocusable)(id, {
|
|
108
|
-
focusAndSelect: function() {
|
|
108
|
+
focusAndSelect: function focusAndSelect() {
|
|
109
109
|
onChange === null || onChange === void 0 || onChange(value);
|
|
110
110
|
},
|
|
111
|
-
focus: function() {}
|
|
111
|
+
focus: function focus() {}
|
|
112
112
|
});
|
|
113
113
|
}, [
|
|
114
114
|
id,
|
|
@@ -71,7 +71,7 @@ var ARROW_KEYS = [
|
|
|
71
71
|
"ArrowLeft",
|
|
72
72
|
"ArrowRight"
|
|
73
73
|
];
|
|
74
|
-
var useRadioGroupItem = function(params) {
|
|
74
|
+
var useRadioGroupItem = function useRadioGroupItem2(params) {
|
|
75
75
|
var { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;
|
|
76
76
|
var { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);
|
|
77
77
|
var [button, setButton] = (0, import_react.useState)(null);
|
|
@@ -87,10 +87,10 @@ var useRadioGroupItem = function(params) {
|
|
|
87
87
|
var labelledBy = ariaLabelledby || labelId;
|
|
88
88
|
(0, import_react.useEffect)(function() {
|
|
89
89
|
if (import_constants.isWeb) {
|
|
90
|
-
var handleKeyDown = function(event) {
|
|
90
|
+
var handleKeyDown = function handleKeyDown2(event) {
|
|
91
91
|
if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
|
|
92
92
|
};
|
|
93
|
-
var handleKeyUp = function() {
|
|
93
|
+
var handleKeyUp = function handleKeyUp2() {
|
|
94
94
|
isArrowKeyPressedRef.current = false;
|
|
95
95
|
};
|
|
96
96
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -105,10 +105,10 @@ var useRadioGroupItem = function(params) {
|
|
|
105
105
|
if (!id) return;
|
|
106
106
|
if (disabled) return;
|
|
107
107
|
return (0, import_focusable.registerFocusable)(id, {
|
|
108
|
-
focusAndSelect: function() {
|
|
108
|
+
focusAndSelect: function focusAndSelect() {
|
|
109
109
|
onChange === null || onChange === void 0 || onChange(value);
|
|
110
110
|
},
|
|
111
|
-
focus: function() {}
|
|
111
|
+
focus: function focus() {}
|
|
112
112
|
});
|
|
113
113
|
}, [
|
|
114
114
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRadioGroup.native.js","names":[],"sources":["cjs/useRadioGroup.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\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useRadioGroup_exports = {};\n__export(useRadioGroup_exports, {\n\tuseRadioGroup: () => useRadioGroup,\n\tuseRadioGroupItem: () => useRadioGroupItem,\n\tuseRadioGroupItemIndicator: () => useRadioGroupItemIndicator\n});\nmodule.exports = __toCommonJS(useRadioGroup_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_label = require(\"@tamagui/label\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = require(\"react\");\nvar import_BubbleInput = require(\"./BubbleInput\");\nvar import_utils = require(\"./utils\");\nfunction useRadioGroup(params) {\n\tvar { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params;\n\tvar [value, setValue] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue,\n\t\tonChange: onValueChange\n\t});\n\treturn {\n\t\tproviderValue: {\n\t\t\tvalue,\n\t\t\tonChange: setValue,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\tnative,\n\t\t\taccentColor\n\t\t},\n\t\tframeAttrs: {\n\t\t\trole: \"radiogroup\",\n\t\t\t\"aria-orientation\": orientation,\n\t\t\t\"data-disabled\": disabled ? \"\" : void 0\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\torientation,\n\t\t\tloop: true\n\t\t}\n\t};\n}\nvar ARROW_KEYS = [\n\t\"ArrowUp\",\n\t\"ArrowDown\",\n\t\"ArrowLeft\",\n\t\"ArrowRight\"\n];\nvar useRadioGroupItem = function(params) {\n\tvar { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;\n\tvar { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);\n\tvar [button, setButton] = (0, import_react.useState)(null);\n\tvar hasConsumerStoppedPropagationRef = (0, import_react.useRef)(false);\n\tvar ref = (0, import_react.useRef)(null);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, function(node) {\n\t\treturn setButton(node);\n\t}, ref);\n\tvar isArrowKeyPressedRef = (0, import_react.useRef)(false);\n\tvar isFormControl = import_constants.isWeb ? button ? Boolean(button.closest(\"form\")) : true : false;\n\tvar checked = groupValue === value;\n\tvar labelId = (0, import_label.useLabelContext)(button);\n\tvar labelledBy = ariaLabelledby || labelId;\n\t(0, import_react.useEffect)(function() {\n\t\tif (import_constants.isWeb) {\n\t\t\tvar handleKeyDown = function(event) {\n\t\t\t\tif (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;\n\t\t\t};\n\t\t\tvar handleKeyUp = function() {\n\t\t\t\tisArrowKeyPressedRef.current = false;\n\t\t\t};\n\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t\tdocument.addEventListener(\"keyup\", handleKeyUp);\n\t\t\treturn function() {\n\t\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t\t\tdocument.removeEventListener(\"keyup\", handleKeyUp);\n\t\t\t};\n\t\t}\n\t}, []);\n\t(0, import_react.useEffect)(function() {\n\t\tif (!id) return;\n\t\tif (disabled) return;\n\t\treturn (0, import_focusable.registerFocusable)(id, {\n\t\t\tfocusAndSelect: function() {\n\t\t\t\tonChange === null || onChange === void 0 || onChange(value);\n\t\t\t},\n\t\t\tfocus: function() {}\n\t\t});\n\t}, [\n\t\tid,\n\t\tvalue,\n\t\tdisabled\n\t]);\n\tvar isDisabled = disabled || itemDisabled;\n\treturn {\n\t\tproviderValue: { checked },\n\t\tchecked,\n\t\tisFormControl,\n\t\tbubbleInput: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {\n\t\t\tisHidden: !native,\n\t\t\tcontrol: button,\n\t\t\tbubbles: !hasConsumerStoppedPropagationRef.current,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tchecked,\n\t\t\trequired,\n\t\t\tdisabled: isDisabled,\n\t\t\t...import_constants.isWeb && native && {\n\t\t\t\taccentColor,\n\t\t\t\tid\n\t\t\t}\n\t\t}),\n\t\tnative,\n\t\tframeAttrs: {\n\t\t\t\"data-state\": (0, import_utils.getState)(checked),\n\t\t\t\"data-disabled\": isDisabled ? \"\" : void 0,\n\t\t\trole: \"radio\",\n\t\t\t\"aria-labelledby\": labelledBy,\n\t\t\t\"aria-checked\": checked,\n\t\t\t\"aria-required\": required,\n\t\t\tdisabled: isDisabled,\n\t\t\tref: composedRefs,\n\t\t\t...import_constants.isWeb && {\n\t\t\t\ttype: \"button\",\n\t\t\t\tvalue\n\t\t\t},\n\t\t\tid,\n\t\t\tonPress: (0, import_helpers.composeEventHandlers)(onPress, function(event) {\n\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\tif (isFormControl) {\n\t\t\t\t\thasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n\t\t\t\t\tif (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t...import_constants.isWeb && {\n\t\t\t\tonKeyDown: (0, import_helpers.composeEventHandlers)(function(event) {\n\t\t\t\t\tif (\"key\" in event) onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);\n\t\t\t\t}, function(event) {\n\t\t\t\t\tvar { key } = event.nativeEvent;\n\t\t\t\t\tif (key === \"Enter\" || key === \" \") {\n\t\t\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tonFocus: (0, import_helpers.composeEventHandlers)(function(event) {\n\t\t\t\t\tif (\"relatedTarget\" in event) onFocus === null || onFocus === void 0 || onFocus(event);\n\t\t\t\t}, function() {\n\t\t\t\t\tif (isArrowKeyPressedRef.current) {\n\t\t\t\t\t\tvar _ref_current;\n\t\t\t\t\t\t(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\tasChild: \"except-style\",\n\t\t\ttabIndex: isDisabled ? -1 : 0,\n\t\t\tactive: checked\n\t\t}\n\t};\n};\nfunction useRadioGroupItemIndicator(params) {\n\tvar { radioGroupItemContext, disabled, ...rest } = params;\n\tvar { checked } = (0, import_react.useContext)(radioGroupItemContext);\n\treturn {\n\t\tchecked,\n\t\t\"data-state\": (0, import_utils.getState)(checked),\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...rest\n\t};\n}\n//# sourceMappingURL=useRadioGroup.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;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB;CAC/B,qBAAqB;CACrB,yBAAyB;CACzB,kCAAkC;AACnC,CAAC;AACD,OAAO,UAAU,aAAa,qBAAqB;AACnD,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,sBAAsB,QAAQ,uBAAuB;AACzD,IAAI,mBAAmB,QAAQ,oBAAoB;AACnD,IAAI,mBAAmB,QAAQ,oBAAoB;AACnD,IAAI,iBAAiB,QAAQ,kBAAk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
|
+
{"version":3,"file":"useRadioGroup.native.js","names":[],"sources":["cjs/useRadioGroup.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\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useRadioGroup_exports = {};\n__export(useRadioGroup_exports, {\n\tuseRadioGroup: () => useRadioGroup,\n\tuseRadioGroupItem: () => useRadioGroupItem,\n\tuseRadioGroupItemIndicator: () => useRadioGroupItemIndicator\n});\nmodule.exports = __toCommonJS(useRadioGroup_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_label = require(\"@tamagui/label\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = require(\"react\");\nvar import_BubbleInput = require(\"./BubbleInput\");\nvar import_utils = require(\"./utils\");\nfunction useRadioGroup(params) {\n\tvar { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params;\n\tvar [value, setValue] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue,\n\t\tonChange: onValueChange\n\t});\n\treturn {\n\t\tproviderValue: {\n\t\t\tvalue,\n\t\t\tonChange: setValue,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\tnative,\n\t\t\taccentColor\n\t\t},\n\t\tframeAttrs: {\n\t\t\trole: \"radiogroup\",\n\t\t\t\"aria-orientation\": orientation,\n\t\t\t\"data-disabled\": disabled ? \"\" : void 0\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\torientation,\n\t\t\tloop: true\n\t\t}\n\t};\n}\nvar ARROW_KEYS = [\n\t\"ArrowUp\",\n\t\"ArrowDown\",\n\t\"ArrowLeft\",\n\t\"ArrowRight\"\n];\nvar useRadioGroupItem = function useRadioGroupItem2(params) {\n\tvar { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;\n\tvar { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);\n\tvar [button, setButton] = (0, import_react.useState)(null);\n\tvar hasConsumerStoppedPropagationRef = (0, import_react.useRef)(false);\n\tvar ref = (0, import_react.useRef)(null);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, function(node) {\n\t\treturn setButton(node);\n\t}, ref);\n\tvar isArrowKeyPressedRef = (0, import_react.useRef)(false);\n\tvar isFormControl = import_constants.isWeb ? button ? Boolean(button.closest(\"form\")) : true : false;\n\tvar checked = groupValue === value;\n\tvar labelId = (0, import_label.useLabelContext)(button);\n\tvar labelledBy = ariaLabelledby || labelId;\n\t(0, import_react.useEffect)(function() {\n\t\tif (import_constants.isWeb) {\n\t\t\tvar handleKeyDown = function handleKeyDown2(event) {\n\t\t\t\tif (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;\n\t\t\t};\n\t\t\tvar handleKeyUp = function handleKeyUp2() {\n\t\t\t\tisArrowKeyPressedRef.current = false;\n\t\t\t};\n\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t\tdocument.addEventListener(\"keyup\", handleKeyUp);\n\t\t\treturn function() {\n\t\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t\t\tdocument.removeEventListener(\"keyup\", handleKeyUp);\n\t\t\t};\n\t\t}\n\t}, []);\n\t(0, import_react.useEffect)(function() {\n\t\tif (!id) return;\n\t\tif (disabled) return;\n\t\treturn (0, import_focusable.registerFocusable)(id, {\n\t\t\tfocusAndSelect: function focusAndSelect() {\n\t\t\t\tonChange === null || onChange === void 0 || onChange(value);\n\t\t\t},\n\t\t\tfocus: function focus() {}\n\t\t});\n\t}, [\n\t\tid,\n\t\tvalue,\n\t\tdisabled\n\t]);\n\tvar isDisabled = disabled || itemDisabled;\n\treturn {\n\t\tproviderValue: { checked },\n\t\tchecked,\n\t\tisFormControl,\n\t\tbubbleInput: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {\n\t\t\tisHidden: !native,\n\t\t\tcontrol: button,\n\t\t\tbubbles: !hasConsumerStoppedPropagationRef.current,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tchecked,\n\t\t\trequired,\n\t\t\tdisabled: isDisabled,\n\t\t\t...import_constants.isWeb && native && {\n\t\t\t\taccentColor,\n\t\t\t\tid\n\t\t\t}\n\t\t}),\n\t\tnative,\n\t\tframeAttrs: {\n\t\t\t\"data-state\": (0, import_utils.getState)(checked),\n\t\t\t\"data-disabled\": isDisabled ? \"\" : void 0,\n\t\t\trole: \"radio\",\n\t\t\t\"aria-labelledby\": labelledBy,\n\t\t\t\"aria-checked\": checked,\n\t\t\t\"aria-required\": required,\n\t\t\tdisabled: isDisabled,\n\t\t\tref: composedRefs,\n\t\t\t...import_constants.isWeb && {\n\t\t\t\ttype: \"button\",\n\t\t\t\tvalue\n\t\t\t},\n\t\t\tid,\n\t\t\tonPress: (0, import_helpers.composeEventHandlers)(onPress, function(event) {\n\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\tif (isFormControl) {\n\t\t\t\t\thasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n\t\t\t\t\tif (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t...import_constants.isWeb && {\n\t\t\t\tonKeyDown: (0, import_helpers.composeEventHandlers)(function(event) {\n\t\t\t\t\tif (\"key\" in event) onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);\n\t\t\t\t}, function(event) {\n\t\t\t\t\tvar { key } = event.nativeEvent;\n\t\t\t\t\tif (key === \"Enter\" || key === \" \") {\n\t\t\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tonFocus: (0, import_helpers.composeEventHandlers)(function(event) {\n\t\t\t\t\tif (\"relatedTarget\" in event) onFocus === null || onFocus === void 0 || onFocus(event);\n\t\t\t\t}, function() {\n\t\t\t\t\tif (isArrowKeyPressedRef.current) {\n\t\t\t\t\t\tvar _ref_current;\n\t\t\t\t\t\t(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\tasChild: \"except-style\",\n\t\t\ttabIndex: isDisabled ? -1 : 0,\n\t\t\tactive: checked\n\t\t}\n\t};\n};\nfunction useRadioGroupItemIndicator(params) {\n\tvar { radioGroupItemContext, disabled, ...rest } = params;\n\tvar { checked } = (0, import_react.useContext)(radioGroupItemContext);\n\treturn {\n\t\tchecked,\n\t\t\"data-state\": (0, import_utils.getState)(checked),\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...rest\n\t};\n}\n//# sourceMappingURL=useRadioGroup.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,Q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e,qBAAoB,CAAE,SAAS,OAAO;KACnE,IAAI,SAAS,OAAO,cAAc,QAAQ,cAAc,KAAK,KAAK,UAAU,KAAK;IAClF,GAAG,SAAS,OAAO;KAClB,IAAI,EAAE,QAAQ,MAAM;KACpB,IAAI,QAAQ,WAAW,QAAQ,KAAK;MACnC,IAAI,CAAC,SAAS,aAAa,QAAQ,aAAa,KAAK,KAAK,SAAS,KAAK;KACzE;IACD,CAAC;IACD,UAAU,GAAG,eAAe,qBAAoB,CAAE,SAAS,OAAO;KACjE,IAAI,mBAAmB,OAAO,YAAY,QAAQ,YAAY,KAAK,KAAK,QAAQ,KAAK;IACtF,GAAG,WAAW;KACb,IAAI,qBAAqB,SAAS;MACjC,IAAI;MACJ,CAAC,eAAe,IAAI,aAAa,QAAQ,iBAAiB,KAAK,KAAK,aAAa,MAAM;KACxF;IACD,CAAC;GACF;EACD;EACA,uBAAuB;GACtB,SAAS;GACT,UAAU,aAAa,CAAC,IAAI;GAC5B,QAAQ;EACT;CACD;AACD;AACA,SAAS,2BAA2B,QAAQ;CAC3C,IAAI,EAAE,uBAAuB,UAAU,GAAG,SAAS;CACnD,IAAI,EAAE,aAAa,GAAG,aAAa,WAAU,CAAE,qBAAqB;CACpE,OAAO;EACN;EACA,eAAe,GAAG,aAAa,SAAQ,CAAE,OAAO;EAChD,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;CACJ;AACD"}
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { usePrevious } from "@tamagui/use-previous";
|
|
4
4
|
|
|
5
|
-
var BubbleInput = function(props) {
|
|
5
|
+
var BubbleInput = function BubbleInput2(props) {
|
|
6
6
|
var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;
|
|
7
7
|
var ref = React.useRef(null);
|
|
8
8
|
var prevChecked = usePrevious(checked);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleInput.native.js","names":[],"sources":["esm/BubbleInput.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { usePrevious } from \"@tamagui/use-previous\";\nvar BubbleInput = function(props) {\n var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;\n var ref = React.useRef(null);\n var prevChecked = usePrevious(checked);\n React.useEffect(function() {\n var input = ref.current;\n var inputProto = window.HTMLInputElement.prototype;\n var descriptor = Object.getOwnPropertyDescriptor(inputProto, \"checked\");\n var setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n var event = new Event(\"click\", {\n bubbles\n });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [\n prevChecked,\n checked,\n bubbles\n ]);\n return /* @__PURE__ */ _jsx(\"input\", {\n type: \"radio\",\n defaultChecked: checked,\n ...inputProps,\n tabIndex: -1,\n ref,\n \"aria-hidden\": isHidden,\n style: {\n ...isHidden ? {\n // ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0\n } : {\n appearance: \"auto\",\n accentColor\n },\n ...props.style\n }\n });\n};\nexport {\n BubbleInput\n};\n//# sourceMappingURL=BubbleInput.js.map\n"],"mappings":";;;;;AAGA,IAAI,cAAc,SAAS,OAAO;
|
|
1
|
+
{"version":3,"file":"BubbleInput.native.js","names":[],"sources":["esm/BubbleInput.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { usePrevious } from \"@tamagui/use-previous\";\nvar BubbleInput = function BubbleInput2(props) {\n var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;\n var ref = React.useRef(null);\n var prevChecked = usePrevious(checked);\n React.useEffect(function() {\n var input = ref.current;\n var inputProto = window.HTMLInputElement.prototype;\n var descriptor = Object.getOwnPropertyDescriptor(inputProto, \"checked\");\n var setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n var event = new Event(\"click\", {\n bubbles\n });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [\n prevChecked,\n checked,\n bubbles\n ]);\n return /* @__PURE__ */ _jsx(\"input\", {\n type: \"radio\",\n defaultChecked: checked,\n ...inputProps,\n tabIndex: -1,\n ref,\n \"aria-hidden\": isHidden,\n style: {\n ...isHidden ? {\n // ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0\n } : {\n appearance: \"auto\",\n accentColor\n },\n ...props.style\n }\n });\n};\nexport {\n BubbleInput\n};\n//# sourceMappingURL=BubbleInput.js.map\n"],"mappings":";;;;;AAGA,IAAI,cAAc,SAAS,aAAa,OAAO;CAC7C,IAAI,EAAE,SAAS,UAAU,MAAM,SAAS,UAAU,aAAa,GAAG,eAAe;CACjF,IAAI,MAAM,MAAM,OAAO,IAAI;CAC3B,IAAI,cAAc,YAAY,OAAO;CACrC,MAAM,UAAU,WAAW;EACzB,IAAI,QAAQ,IAAI;EAChB,IAAI,aAAa,OAAO,iBAAiB;EACzC,IAAI,aAAa,OAAO,yBAAyB,YAAY,SAAS;EACtE,IAAI,aAAa,WAAW;EAC5B,IAAI,gBAAgB,WAAW,YAAY;GACzC,IAAI,QAAQ,IAAI,MAAM,SAAS,EAC7B,QACF,CAAC;GACD,WAAW,KAAK,OAAO,OAAO;GAC9B,MAAM,cAAc,KAAK;EAC3B;CACF,GAAG;EACD;EACA;EACA;CACF,CAAC;CACD,OAAuB,oBAAK,SAAS;EACnC,MAAM;EACN,gBAAgB;EAChB,GAAG;EACH,UAAU,CAAC;EACX;EACA,eAAe;EACf,OAAO;GACL,GAAG,WAAW;IAEZ,UAAU;IACV,eAAe;IACf,SAAS;IACT,QAAQ;GACV,IAAI;IACF,YAAY;IACZ;GACF;GACA,GAAG,MAAM;EACX;CACF,CAAC;AACH"}
|
|
@@ -43,7 +43,7 @@ var ARROW_KEYS = [
|
|
|
43
43
|
"ArrowLeft",
|
|
44
44
|
"ArrowRight"
|
|
45
45
|
];
|
|
46
|
-
var useRadioGroupItem = function(params) {
|
|
46
|
+
var useRadioGroupItem = function useRadioGroupItem2(params) {
|
|
47
47
|
var { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;
|
|
48
48
|
var { value: groupValue, disabled, required, onChange, name, native, accentColor } = useContext(radioGroupContext);
|
|
49
49
|
var [button, setButton] = useState(null);
|
|
@@ -59,10 +59,10 @@ var useRadioGroupItem = function(params) {
|
|
|
59
59
|
var labelledBy = ariaLabelledby || labelId;
|
|
60
60
|
useEffect(function() {
|
|
61
61
|
if (isWeb) {
|
|
62
|
-
var handleKeyDown = function(event) {
|
|
62
|
+
var handleKeyDown = function handleKeyDown2(event) {
|
|
63
63
|
if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
|
|
64
64
|
};
|
|
65
|
-
var handleKeyUp = function() {
|
|
65
|
+
var handleKeyUp = function handleKeyUp2() {
|
|
66
66
|
isArrowKeyPressedRef.current = false;
|
|
67
67
|
};
|
|
68
68
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -77,10 +77,10 @@ var useRadioGroupItem = function(params) {
|
|
|
77
77
|
if (!id) return;
|
|
78
78
|
if (disabled) return;
|
|
79
79
|
return registerFocusable(id, {
|
|
80
|
-
focusAndSelect: function() {
|
|
80
|
+
focusAndSelect: function focusAndSelect() {
|
|
81
81
|
onChange === null || onChange === void 0 || onChange(value);
|
|
82
82
|
},
|
|
83
|
-
focus: function() {}
|
|
83
|
+
focus: function focus() {}
|
|
84
84
|
});
|
|
85
85
|
}, [
|
|
86
86
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRadioGroup.native.js","names":[],"sources":["esm/useRadioGroup.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { registerFocusable } from \"@tamagui/focusable\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { useLabelContext } from \"@tamagui/label\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { useContext, useEffect, useRef, useState } from \"react\";\nimport { BubbleInput } from \"./BubbleInput\";\nimport { getState } from \"./utils\";\n\nfunction useRadioGroup(params) {\n\tvar { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params;\n\tvar [value, setValue] = useControllableState({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue,\n\t\tonChange: onValueChange\n\t});\n\treturn {\n\t\tproviderValue: {\n\t\t\tvalue,\n\t\t\tonChange: setValue,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\tnative,\n\t\t\taccentColor\n\t\t},\n\t\tframeAttrs: {\n\t\t\trole: \"radiogroup\",\n\t\t\t\"aria-orientation\": orientation,\n\t\t\t\"data-disabled\": disabled ? \"\" : void 0\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\torientation,\n\t\t\tloop: true\n\t\t}\n\t};\n}\nvar ARROW_KEYS = [\n\t\"ArrowUp\",\n\t\"ArrowDown\",\n\t\"ArrowLeft\",\n\t\"ArrowRight\"\n];\nvar useRadioGroupItem = function(params) {\n\tvar { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;\n\tvar { value: groupValue, disabled, required, onChange, name, native, accentColor } = useContext(radioGroupContext);\n\tvar [button, setButton] = useState(null);\n\tvar hasConsumerStoppedPropagationRef = useRef(false);\n\tvar ref = useRef(null);\n\tvar composedRefs = useComposedRefs(refProp, function(node) {\n\t\treturn setButton(node);\n\t}, ref);\n\tvar isArrowKeyPressedRef = useRef(false);\n\tvar isFormControl = isWeb ? button ? Boolean(button.closest(\"form\")) : true : false;\n\tvar checked = groupValue === value;\n\tvar labelId = useLabelContext(button);\n\tvar labelledBy = ariaLabelledby || labelId;\n\tuseEffect(function() {\n\t\tif (isWeb) {\n\t\t\tvar handleKeyDown = function(event) {\n\t\t\t\tif (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;\n\t\t\t};\n\t\t\tvar handleKeyUp = function() {\n\t\t\t\tisArrowKeyPressedRef.current = false;\n\t\t\t};\n\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t\tdocument.addEventListener(\"keyup\", handleKeyUp);\n\t\t\treturn function() {\n\t\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t\t\tdocument.removeEventListener(\"keyup\", handleKeyUp);\n\t\t\t};\n\t\t}\n\t}, []);\n\tuseEffect(function() {\n\t\tif (!id) return;\n\t\tif (disabled) return;\n\t\treturn registerFocusable(id, {\n\t\t\tfocusAndSelect: function() {\n\t\t\t\tonChange === null || onChange === void 0 || onChange(value);\n\t\t\t},\n\t\t\tfocus: function() {}\n\t\t});\n\t}, [\n\t\tid,\n\t\tvalue,\n\t\tdisabled\n\t]);\n\tvar isDisabled = disabled || itemDisabled;\n\treturn {\n\t\tproviderValue: { checked },\n\t\tchecked,\n\t\tisFormControl,\n\t\tbubbleInput: /* @__PURE__ */ jsx(BubbleInput, {\n\t\t\tisHidden: !native,\n\t\t\tcontrol: button,\n\t\t\tbubbles: !hasConsumerStoppedPropagationRef.current,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tchecked,\n\t\t\trequired,\n\t\t\tdisabled: isDisabled,\n\t\t\t...isWeb && native && {\n\t\t\t\taccentColor,\n\t\t\t\tid\n\t\t\t}\n\t\t}),\n\t\tnative,\n\t\tframeAttrs: {\n\t\t\t\"data-state\": getState(checked),\n\t\t\t\"data-disabled\": isDisabled ? \"\" : void 0,\n\t\t\trole: \"radio\",\n\t\t\t\"aria-labelledby\": labelledBy,\n\t\t\t\"aria-checked\": checked,\n\t\t\t\"aria-required\": required,\n\t\t\tdisabled: isDisabled,\n\t\t\tref: composedRefs,\n\t\t\t...isWeb && {\n\t\t\t\ttype: \"button\",\n\t\t\t\tvalue\n\t\t\t},\n\t\t\tid,\n\t\t\tonPress: composeEventHandlers(onPress, function(event) {\n\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\tif (isFormControl) {\n\t\t\t\t\thasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n\t\t\t\t\tif (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t...isWeb && {\n\t\t\t\tonKeyDown: composeEventHandlers(function(event) {\n\t\t\t\t\tif (\"key\" in event) onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);\n\t\t\t\t}, function(event) {\n\t\t\t\t\tvar { key } = event.nativeEvent;\n\t\t\t\t\tif (key === \"Enter\" || key === \" \") {\n\t\t\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tonFocus: composeEventHandlers(function(event) {\n\t\t\t\t\tif (\"relatedTarget\" in event) onFocus === null || onFocus === void 0 || onFocus(event);\n\t\t\t\t}, function() {\n\t\t\t\t\tif (isArrowKeyPressedRef.current) {\n\t\t\t\t\t\tvar _ref_current;\n\t\t\t\t\t\t(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\tasChild: \"except-style\",\n\t\t\ttabIndex: isDisabled ? -1 : 0,\n\t\t\tactive: checked\n\t\t}\n\t};\n};\nfunction useRadioGroupItemIndicator(params) {\n\tvar { radioGroupItemContext, disabled, ...rest } = params;\n\tvar { checked } = useContext(radioGroupItemContext);\n\treturn {\n\t\tchecked,\n\t\t\"data-state\": getState(checked),\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...rest\n\t};\n}\n\nexport { useRadioGroup, useRadioGroupItem, useRadioGroupItemIndicator };"],"mappings":";;;;;;;;;;;;AAWA,SAAS,cAAc,QAAQ;CAC9B,IAAI,EAAE,OAAO,WAAW,eAAe,cAAc,UAAU,UAAU,MAAM,QAAQ,aAAa,aAAa,QAAQ;CACzH,IAAI,CAAC,OAAO,YAAY,qBAAqB;EAC5C,MAAM;EACN,aAAa;EACb,UAAU;CACX,CAAC;CACD,OAAO;EACN,eAAe;GACd;GACA,UAAU;GACV;GACA;GACA;GACA;GACA;EACD;EACA,YAAY;GACX,MAAM;GACN,oBAAoB;GACpB,iBAAiB,WAAW,KAAK,KAAK;EACvC;EACA,uBAAuB;GACtB;GACA,MAAM;EACP;CACD;AACD;AACA,IAAI,aAAa;CAChB;CACA;CACA;CACA;AACD;AACA,IAAI,oBAAoB,SAAS,QAAQ;
|
|
1
|
+
{"version":3,"file":"useRadioGroup.native.js","names":[],"sources":["esm/useRadioGroup.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { registerFocusable } from \"@tamagui/focusable\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { useLabelContext } from \"@tamagui/label\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { useContext, useEffect, useRef, useState } from \"react\";\nimport { BubbleInput } from \"./BubbleInput\";\nimport { getState } from \"./utils\";\n\nfunction useRadioGroup(params) {\n\tvar { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params;\n\tvar [value, setValue] = useControllableState({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue,\n\t\tonChange: onValueChange\n\t});\n\treturn {\n\t\tproviderValue: {\n\t\t\tvalue,\n\t\t\tonChange: setValue,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\tnative,\n\t\t\taccentColor\n\t\t},\n\t\tframeAttrs: {\n\t\t\trole: \"radiogroup\",\n\t\t\t\"aria-orientation\": orientation,\n\t\t\t\"data-disabled\": disabled ? \"\" : void 0\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\torientation,\n\t\t\tloop: true\n\t\t}\n\t};\n}\nvar ARROW_KEYS = [\n\t\"ArrowUp\",\n\t\"ArrowDown\",\n\t\"ArrowLeft\",\n\t\"ArrowRight\"\n];\nvar useRadioGroupItem = function useRadioGroupItem2(params) {\n\tvar { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;\n\tvar { value: groupValue, disabled, required, onChange, name, native, accentColor } = useContext(radioGroupContext);\n\tvar [button, setButton] = useState(null);\n\tvar hasConsumerStoppedPropagationRef = useRef(false);\n\tvar ref = useRef(null);\n\tvar composedRefs = useComposedRefs(refProp, function(node) {\n\t\treturn setButton(node);\n\t}, ref);\n\tvar isArrowKeyPressedRef = useRef(false);\n\tvar isFormControl = isWeb ? button ? Boolean(button.closest(\"form\")) : true : false;\n\tvar checked = groupValue === value;\n\tvar labelId = useLabelContext(button);\n\tvar labelledBy = ariaLabelledby || labelId;\n\tuseEffect(function() {\n\t\tif (isWeb) {\n\t\t\tvar handleKeyDown = function handleKeyDown2(event) {\n\t\t\t\tif (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;\n\t\t\t};\n\t\t\tvar handleKeyUp = function handleKeyUp2() {\n\t\t\t\tisArrowKeyPressedRef.current = false;\n\t\t\t};\n\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t\tdocument.addEventListener(\"keyup\", handleKeyUp);\n\t\t\treturn function() {\n\t\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t\t\tdocument.removeEventListener(\"keyup\", handleKeyUp);\n\t\t\t};\n\t\t}\n\t}, []);\n\tuseEffect(function() {\n\t\tif (!id) return;\n\t\tif (disabled) return;\n\t\treturn registerFocusable(id, {\n\t\t\tfocusAndSelect: function focusAndSelect() {\n\t\t\t\tonChange === null || onChange === void 0 || onChange(value);\n\t\t\t},\n\t\t\tfocus: function focus() {}\n\t\t});\n\t}, [\n\t\tid,\n\t\tvalue,\n\t\tdisabled\n\t]);\n\tvar isDisabled = disabled || itemDisabled;\n\treturn {\n\t\tproviderValue: { checked },\n\t\tchecked,\n\t\tisFormControl,\n\t\tbubbleInput: /* @__PURE__ */ jsx(BubbleInput, {\n\t\t\tisHidden: !native,\n\t\t\tcontrol: button,\n\t\t\tbubbles: !hasConsumerStoppedPropagationRef.current,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tchecked,\n\t\t\trequired,\n\t\t\tdisabled: isDisabled,\n\t\t\t...isWeb && native && {\n\t\t\t\taccentColor,\n\t\t\t\tid\n\t\t\t}\n\t\t}),\n\t\tnative,\n\t\tframeAttrs: {\n\t\t\t\"data-state\": getState(checked),\n\t\t\t\"data-disabled\": isDisabled ? \"\" : void 0,\n\t\t\trole: \"radio\",\n\t\t\t\"aria-labelledby\": labelledBy,\n\t\t\t\"aria-checked\": checked,\n\t\t\t\"aria-required\": required,\n\t\t\tdisabled: isDisabled,\n\t\t\tref: composedRefs,\n\t\t\t...isWeb && {\n\t\t\t\ttype: \"button\",\n\t\t\t\tvalue\n\t\t\t},\n\t\t\tid,\n\t\t\tonPress: composeEventHandlers(onPress, function(event) {\n\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\tif (isFormControl) {\n\t\t\t\t\thasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n\t\t\t\t\tif (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t...isWeb && {\n\t\t\t\tonKeyDown: composeEventHandlers(function(event) {\n\t\t\t\t\tif (\"key\" in event) onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);\n\t\t\t\t}, function(event) {\n\t\t\t\t\tvar { key } = event.nativeEvent;\n\t\t\t\t\tif (key === \"Enter\" || key === \" \") {\n\t\t\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tonFocus: composeEventHandlers(function(event) {\n\t\t\t\t\tif (\"relatedTarget\" in event) onFocus === null || onFocus === void 0 || onFocus(event);\n\t\t\t\t}, function() {\n\t\t\t\t\tif (isArrowKeyPressedRef.current) {\n\t\t\t\t\t\tvar _ref_current;\n\t\t\t\t\t\t(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\tasChild: \"except-style\",\n\t\t\ttabIndex: isDisabled ? -1 : 0,\n\t\t\tactive: checked\n\t\t}\n\t};\n};\nfunction useRadioGroupItemIndicator(params) {\n\tvar { radioGroupItemContext, disabled, ...rest } = params;\n\tvar { checked } = useContext(radioGroupItemContext);\n\treturn {\n\t\tchecked,\n\t\t\"data-state\": getState(checked),\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...rest\n\t};\n}\n\nexport { useRadioGroup, useRadioGroupItem, useRadioGroupItemIndicator };"],"mappings":";;;;;;;;;;;;AAWA,SAAS,cAAc,QAAQ;CAC9B,IAAI,EAAE,OAAO,WAAW,eAAe,cAAc,UAAU,UAAU,MAAM,QAAQ,aAAa,aAAa,QAAQ;CACzH,IAAI,CAAC,OAAO,YAAY,qBAAqB;EAC5C,MAAM;EACN,aAAa;EACb,UAAU;CACX,CAAC;CACD,OAAO;EACN,eAAe;GACd;GACA,UAAU;GACV;GACA;GACA;GACA;GACA;EACD;EACA,YAAY;GACX,MAAM;GACN,oBAAoB;GACpB,iBAAiB,WAAW,KAAK,KAAK;EACvC;EACA,uBAAuB;GACtB;GACA,MAAM;EACP;CACD;AACD;AACA,IAAI,aAAa;CAChB;CACA;CACA;CACA;AACD;AACA,IAAI,oBAAoB,SAAS,mBAAmB,QAAQ;CAC3D,IAAI,EAAE,mBAAmB,OAAO,YAAY,gBAAgB,UAAU,cAAc,KAAK,SAAS,IAAI,SAAS,WAAW,YAAY;CACtI,IAAI,EAAE,OAAO,YAAY,UAAU,UAAU,UAAU,M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AAS,OAAO;EAC9B,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;CACJ;AACD"}
|
|
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(BubbleInput_exports);
|
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
var import_react = __toESM(require("react"), 1);
|
|
34
34
|
var import_use_previous = require("@tamagui/use-previous");
|
|
35
|
-
var BubbleInput = function(props) {
|
|
35
|
+
var BubbleInput = function BubbleInput2(props) {
|
|
36
36
|
var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;
|
|
37
37
|
var ref = import_react.default.useRef(null);
|
|
38
38
|
var prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(BubbleInput_exports);
|
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
var import_react = __toESM(require("react"), 1);
|
|
34
34
|
var import_use_previous = require("@tamagui/use-previous");
|
|
35
|
-
var BubbleInput = function(props) {
|
|
35
|
+
var BubbleInput = function BubbleInput2(props) {
|
|
36
36
|
var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;
|
|
37
37
|
var ref = import_react.default.useRef(null);
|
|
38
38
|
var prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleInput.native.js","names":[],"sources":["jsx/BubbleInput.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 BubbleInput_exports = {};\n__export(BubbleInput_exports, {\n BubbleInput: () => BubbleInput\n});\nmodule.exports = __toCommonJS(BubbleInput_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_use_previous = require(\"@tamagui/use-previous\");\nvar BubbleInput = function(props) {\n var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;\n var ref = import_react.default.useRef(null);\n var prevChecked = (0, import_use_previous.usePrevious)(checked);\n import_react.default.useEffect(function() {\n var input = ref.current;\n var inputProto = window.HTMLInputElement.prototype;\n var descriptor = Object.getOwnPropertyDescriptor(inputProto, \"checked\");\n var setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n var event = new Event(\"click\", {\n bubbles\n });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [\n prevChecked,\n checked,\n bubbles\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"input\", {\n type: \"radio\",\n defaultChecked: checked,\n ...inputProps,\n tabIndex: -1,\n ref,\n \"aria-hidden\": isHidden,\n style: {\n ...isHidden ? {\n // ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0\n } : {\n appearance: \"auto\",\n accentColor\n },\n ...props.style\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
|
1
|
+
{"version":3,"file":"BubbleInput.native.js","names":[],"sources":["jsx/BubbleInput.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 BubbleInput_exports = {};\n__export(BubbleInput_exports, {\n BubbleInput: () => BubbleInput\n});\nmodule.exports = __toCommonJS(BubbleInput_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_use_previous = require(\"@tamagui/use-previous\");\nvar BubbleInput = function BubbleInput2(props) {\n var { checked, bubbles = true, control, isHidden, accentColor, ...inputProps } = props;\n var ref = import_react.default.useRef(null);\n var prevChecked = (0, import_use_previous.usePrevious)(checked);\n import_react.default.useEffect(function() {\n var input = ref.current;\n var inputProto = window.HTMLInputElement.prototype;\n var descriptor = Object.getOwnPropertyDescriptor(inputProto, \"checked\");\n var setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n var event = new Event(\"click\", {\n bubbles\n });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [\n prevChecked,\n checked,\n bubbles\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"input\", {\n type: \"radio\",\n defaultChecked: checked,\n ...inputProps,\n tabIndex: -1,\n ref,\n \"aria-hidden\": isHidden,\n style: {\n ...isHidden ? {\n // ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0\n } : {\n appearance: \"auto\",\n accentColor\n },\n ...props.style\n }\n });\n};\n//# sourceMappingURL=BubbleInput.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,WAA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|
|
|
71
71
|
"ArrowLeft",
|
|
72
72
|
"ArrowRight"
|
|
73
73
|
];
|
|
74
|
-
var useRadioGroupItem = function(params) {
|
|
74
|
+
var useRadioGroupItem = function useRadioGroupItem2(params) {
|
|
75
75
|
var { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;
|
|
76
76
|
var { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);
|
|
77
77
|
var [button, setButton] = (0, import_react.useState)(null);
|
|
@@ -87,10 +87,10 @@ var useRadioGroupItem = function(params) {
|
|
|
87
87
|
var labelledBy = ariaLabelledby || labelId;
|
|
88
88
|
(0, import_react.useEffect)(function() {
|
|
89
89
|
if (import_constants.isWeb) {
|
|
90
|
-
var handleKeyDown = function(event) {
|
|
90
|
+
var handleKeyDown = function handleKeyDown2(event) {
|
|
91
91
|
if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
|
|
92
92
|
};
|
|
93
|
-
var handleKeyUp = function() {
|
|
93
|
+
var handleKeyUp = function handleKeyUp2() {
|
|
94
94
|
isArrowKeyPressedRef.current = false;
|
|
95
95
|
};
|
|
96
96
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -105,10 +105,10 @@ var useRadioGroupItem = function(params) {
|
|
|
105
105
|
if (!id) return;
|
|
106
106
|
if (disabled) return;
|
|
107
107
|
return (0, import_focusable.registerFocusable)(id, {
|
|
108
|
-
focusAndSelect: function() {
|
|
108
|
+
focusAndSelect: function focusAndSelect() {
|
|
109
109
|
onChange === null || onChange === void 0 || onChange(value);
|
|
110
110
|
},
|
|
111
|
-
focus: function() {}
|
|
111
|
+
focus: function focus() {}
|
|
112
112
|
});
|
|
113
113
|
}, [
|
|
114
114
|
id,
|
|
@@ -71,7 +71,7 @@ var ARROW_KEYS = [
|
|
|
71
71
|
"ArrowLeft",
|
|
72
72
|
"ArrowRight"
|
|
73
73
|
];
|
|
74
|
-
var useRadioGroupItem = function(params) {
|
|
74
|
+
var useRadioGroupItem = function useRadioGroupItem2(params) {
|
|
75
75
|
var { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;
|
|
76
76
|
var { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);
|
|
77
77
|
var [button, setButton] = (0, import_react.useState)(null);
|
|
@@ -87,10 +87,10 @@ var useRadioGroupItem = function(params) {
|
|
|
87
87
|
var labelledBy = ariaLabelledby || labelId;
|
|
88
88
|
(0, import_react.useEffect)(function() {
|
|
89
89
|
if (import_constants.isWeb) {
|
|
90
|
-
var handleKeyDown = function(event) {
|
|
90
|
+
var handleKeyDown = function handleKeyDown2(event) {
|
|
91
91
|
if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
|
|
92
92
|
};
|
|
93
|
-
var handleKeyUp = function() {
|
|
93
|
+
var handleKeyUp = function handleKeyUp2() {
|
|
94
94
|
isArrowKeyPressedRef.current = false;
|
|
95
95
|
};
|
|
96
96
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -105,10 +105,10 @@ var useRadioGroupItem = function(params) {
|
|
|
105
105
|
if (!id) return;
|
|
106
106
|
if (disabled) return;
|
|
107
107
|
return (0, import_focusable.registerFocusable)(id, {
|
|
108
|
-
focusAndSelect: function() {
|
|
108
|
+
focusAndSelect: function focusAndSelect() {
|
|
109
109
|
onChange === null || onChange === void 0 || onChange(value);
|
|
110
110
|
},
|
|
111
|
-
focus: function() {}
|
|
111
|
+
focus: function focus() {}
|
|
112
112
|
});
|
|
113
113
|
}, [
|
|
114
114
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRadioGroup.native.js","names":[],"sources":["jsx/useRadioGroup.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\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useRadioGroup_exports = {};\n__export(useRadioGroup_exports, {\n\tuseRadioGroup: () => useRadioGroup,\n\tuseRadioGroupItem: () => useRadioGroupItem,\n\tuseRadioGroupItemIndicator: () => useRadioGroupItemIndicator\n});\nmodule.exports = __toCommonJS(useRadioGroup_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_label = require(\"@tamagui/label\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = require(\"react\");\nvar import_BubbleInput = require(\"./BubbleInput\");\nvar import_utils = require(\"./utils\");\nfunction useRadioGroup(params) {\n\tvar { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params;\n\tvar [value, setValue] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue,\n\t\tonChange: onValueChange\n\t});\n\treturn {\n\t\tproviderValue: {\n\t\t\tvalue,\n\t\t\tonChange: setValue,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\tnative,\n\t\t\taccentColor\n\t\t},\n\t\tframeAttrs: {\n\t\t\trole: \"radiogroup\",\n\t\t\t\"aria-orientation\": orientation,\n\t\t\t\"data-disabled\": disabled ? \"\" : void 0\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\torientation,\n\t\t\tloop: true\n\t\t}\n\t};\n}\nvar ARROW_KEYS = [\n\t\"ArrowUp\",\n\t\"ArrowDown\",\n\t\"ArrowLeft\",\n\t\"ArrowRight\"\n];\nvar useRadioGroupItem = function(params) {\n\tvar { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;\n\tvar { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);\n\tvar [button, setButton] = (0, import_react.useState)(null);\n\tvar hasConsumerStoppedPropagationRef = (0, import_react.useRef)(false);\n\tvar ref = (0, import_react.useRef)(null);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, function(node) {\n\t\treturn setButton(node);\n\t}, ref);\n\tvar isArrowKeyPressedRef = (0, import_react.useRef)(false);\n\tvar isFormControl = import_constants.isWeb ? button ? Boolean(button.closest(\"form\")) : true : false;\n\tvar checked = groupValue === value;\n\tvar labelId = (0, import_label.useLabelContext)(button);\n\tvar labelledBy = ariaLabelledby || labelId;\n\t(0, import_react.useEffect)(function() {\n\t\tif (import_constants.isWeb) {\n\t\t\tvar handleKeyDown = function(event) {\n\t\t\t\tif (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;\n\t\t\t};\n\t\t\tvar handleKeyUp = function() {\n\t\t\t\tisArrowKeyPressedRef.current = false;\n\t\t\t};\n\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t\tdocument.addEventListener(\"keyup\", handleKeyUp);\n\t\t\treturn function() {\n\t\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t\t\tdocument.removeEventListener(\"keyup\", handleKeyUp);\n\t\t\t};\n\t\t}\n\t}, []);\n\t(0, import_react.useEffect)(function() {\n\t\tif (!id) return;\n\t\tif (disabled) return;\n\t\treturn (0, import_focusable.registerFocusable)(id, {\n\t\t\tfocusAndSelect: function() {\n\t\t\t\tonChange === null || onChange === void 0 || onChange(value);\n\t\t\t},\n\t\t\tfocus: function() {}\n\t\t});\n\t}, [\n\t\tid,\n\t\tvalue,\n\t\tdisabled\n\t]);\n\tvar isDisabled = disabled || itemDisabled;\n\treturn {\n\t\tproviderValue: { checked },\n\t\tchecked,\n\t\tisFormControl,\n\t\tbubbleInput: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {\n\t\t\tisHidden: !native,\n\t\t\tcontrol: button,\n\t\t\tbubbles: !hasConsumerStoppedPropagationRef.current,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tchecked,\n\t\t\trequired,\n\t\t\tdisabled: isDisabled,\n\t\t\t...import_constants.isWeb && native && {\n\t\t\t\taccentColor,\n\t\t\t\tid\n\t\t\t}\n\t\t}),\n\t\tnative,\n\t\tframeAttrs: {\n\t\t\t\"data-state\": (0, import_utils.getState)(checked),\n\t\t\t\"data-disabled\": isDisabled ? \"\" : void 0,\n\t\t\trole: \"radio\",\n\t\t\t\"aria-labelledby\": labelledBy,\n\t\t\t\"aria-checked\": checked,\n\t\t\t\"aria-required\": required,\n\t\t\tdisabled: isDisabled,\n\t\t\tref: composedRefs,\n\t\t\t...import_constants.isWeb && {\n\t\t\t\ttype: \"button\",\n\t\t\t\tvalue\n\t\t\t},\n\t\t\tid,\n\t\t\tonPress: (0, import_helpers.composeEventHandlers)(onPress, function(event) {\n\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\tif (isFormControl) {\n\t\t\t\t\thasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n\t\t\t\t\tif (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t...import_constants.isWeb && {\n\t\t\t\tonKeyDown: (0, import_helpers.composeEventHandlers)(function(event) {\n\t\t\t\t\tif (\"key\" in event) onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);\n\t\t\t\t}, function(event) {\n\t\t\t\t\tvar { key } = event.nativeEvent;\n\t\t\t\t\tif (key === \"Enter\" || key === \" \") {\n\t\t\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tonFocus: (0, import_helpers.composeEventHandlers)(function(event) {\n\t\t\t\t\tif (\"relatedTarget\" in event) onFocus === null || onFocus === void 0 || onFocus(event);\n\t\t\t\t}, function() {\n\t\t\t\t\tif (isArrowKeyPressedRef.current) {\n\t\t\t\t\t\tvar _ref_current;\n\t\t\t\t\t\t(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\tasChild: \"except-style\",\n\t\t\ttabIndex: isDisabled ? -1 : 0,\n\t\t\tactive: checked\n\t\t}\n\t};\n};\nfunction useRadioGroupItemIndicator(params) {\n\tvar { radioGroupItemContext, disabled, ...rest } = params;\n\tvar { checked } = (0, import_react.useContext)(radioGroupItemContext);\n\treturn {\n\t\tchecked,\n\t\t\"data-state\": (0, import_utils.getState)(checked),\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...rest\n\t};\n}\n//# sourceMappingURL=useRadioGroup.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;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,S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AAK,KAAK,SAAS,KAAK;KACzE;IACD,CAAC;IACD,UAAU,GAAG,eAAe,qBAAoB,CAAE,SAAS,OAAO;KACjE,IAAI,mBAAmB,OAAO,YAAY,QAAQ,YAAY,KAAK,KAAK,QAAQ,KAAK;IACtF,GAAG,WAAW;KACb,IAAI,qBAAqB,SAAS;MACjC,IAAI;MACJ,CAAC,eAAe,IAAI,aAAa,QAAQ,iBAAiB,KAAK,KAAK,aAAa,MAAM;KACxF;IACD,CAAC;GACF;EACD;EACA,uBAAuB;GACtB,SAAS;GACT,UAAU,aAAa,CAAC,IAAI;GAC5B,QAAQ;EACT;CACD;AACD;AACA,SAAS,2BAA2B,QAAQ;CAC3C,IAAI,EAAE,uBAAuB,UAAU,GAAG,SAAS;CACnD,IAAI,EAAE,aAAa,GAAG,aAAa,WAAU,CAAE,qBAAqB;CACpE,OAAO;EACN;EACA,eAAe,GAAG,aAAa,SAAQ,CAAE,OAAO;EAChD,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;CACJ;AACD"}
|
|
1
|
+
{"version":3,"file":"useRadioGroup.native.js","names":[],"sources":["jsx/useRadioGroup.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\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useRadioGroup_exports = {};\n__export(useRadioGroup_exports, {\n\tuseRadioGroup: () => useRadioGroup,\n\tuseRadioGroupItem: () => useRadioGroupItem,\n\tuseRadioGroupItemIndicator: () => useRadioGroupItemIndicator\n});\nmodule.exports = __toCommonJS(useRadioGroup_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_label = require(\"@tamagui/label\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = require(\"react\");\nvar import_BubbleInput = require(\"./BubbleInput\");\nvar import_utils = require(\"./utils\");\nfunction useRadioGroup(params) {\n\tvar { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params;\n\tvar [value, setValue] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue,\n\t\tonChange: onValueChange\n\t});\n\treturn {\n\t\tproviderValue: {\n\t\t\tvalue,\n\t\t\tonChange: setValue,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\tnative,\n\t\t\taccentColor\n\t\t},\n\t\tframeAttrs: {\n\t\t\trole: \"radiogroup\",\n\t\t\t\"aria-orientation\": orientation,\n\t\t\t\"data-disabled\": disabled ? \"\" : void 0\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\torientation,\n\t\t\tloop: true\n\t\t}\n\t};\n}\nvar ARROW_KEYS = [\n\t\"ArrowUp\",\n\t\"ArrowDown\",\n\t\"ArrowLeft\",\n\t\"ArrowRight\"\n];\nvar useRadioGroupItem = function useRadioGroupItem2(params) {\n\tvar { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;\n\tvar { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);\n\tvar [button, setButton] = (0, import_react.useState)(null);\n\tvar hasConsumerStoppedPropagationRef = (0, import_react.useRef)(false);\n\tvar ref = (0, import_react.useRef)(null);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, function(node) {\n\t\treturn setButton(node);\n\t}, ref);\n\tvar isArrowKeyPressedRef = (0, import_react.useRef)(false);\n\tvar isFormControl = import_constants.isWeb ? button ? Boolean(button.closest(\"form\")) : true : false;\n\tvar checked = groupValue === value;\n\tvar labelId = (0, import_label.useLabelContext)(button);\n\tvar labelledBy = ariaLabelledby || labelId;\n\t(0, import_react.useEffect)(function() {\n\t\tif (import_constants.isWeb) {\n\t\t\tvar handleKeyDown = function handleKeyDown2(event) {\n\t\t\t\tif (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;\n\t\t\t};\n\t\t\tvar handleKeyUp = function handleKeyUp2() {\n\t\t\t\tisArrowKeyPressedRef.current = false;\n\t\t\t};\n\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t\tdocument.addEventListener(\"keyup\", handleKeyUp);\n\t\t\treturn function() {\n\t\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t\t\tdocument.removeEventListener(\"keyup\", handleKeyUp);\n\t\t\t};\n\t\t}\n\t}, []);\n\t(0, import_react.useEffect)(function() {\n\t\tif (!id) return;\n\t\tif (disabled) return;\n\t\treturn (0, import_focusable.registerFocusable)(id, {\n\t\t\tfocusAndSelect: function focusAndSelect() {\n\t\t\t\tonChange === null || onChange === void 0 || onChange(value);\n\t\t\t},\n\t\t\tfocus: function focus() {}\n\t\t});\n\t}, [\n\t\tid,\n\t\tvalue,\n\t\tdisabled\n\t]);\n\tvar isDisabled = disabled || itemDisabled;\n\treturn {\n\t\tproviderValue: { checked },\n\t\tchecked,\n\t\tisFormControl,\n\t\tbubbleInput: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {\n\t\t\tisHidden: !native,\n\t\t\tcontrol: button,\n\t\t\tbubbles: !hasConsumerStoppedPropagationRef.current,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tchecked,\n\t\t\trequired,\n\t\t\tdisabled: isDisabled,\n\t\t\t...import_constants.isWeb && native && {\n\t\t\t\taccentColor,\n\t\t\t\tid\n\t\t\t}\n\t\t}),\n\t\tnative,\n\t\tframeAttrs: {\n\t\t\t\"data-state\": (0, import_utils.getState)(checked),\n\t\t\t\"data-disabled\": isDisabled ? \"\" : void 0,\n\t\t\trole: \"radio\",\n\t\t\t\"aria-labelledby\": labelledBy,\n\t\t\t\"aria-checked\": checked,\n\t\t\t\"aria-required\": required,\n\t\t\tdisabled: isDisabled,\n\t\t\tref: composedRefs,\n\t\t\t...import_constants.isWeb && {\n\t\t\t\ttype: \"button\",\n\t\t\t\tvalue\n\t\t\t},\n\t\t\tid,\n\t\t\tonPress: (0, import_helpers.composeEventHandlers)(onPress, function(event) {\n\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\tif (isFormControl) {\n\t\t\t\t\thasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n\t\t\t\t\tif (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t...import_constants.isWeb && {\n\t\t\t\tonKeyDown: (0, import_helpers.composeEventHandlers)(function(event) {\n\t\t\t\t\tif (\"key\" in event) onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);\n\t\t\t\t}, function(event) {\n\t\t\t\t\tvar { key } = event.nativeEvent;\n\t\t\t\t\tif (key === \"Enter\" || key === \" \") {\n\t\t\t\t\t\tif (!checked) onChange === null || onChange === void 0 || onChange(value);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tonFocus: (0, import_helpers.composeEventHandlers)(function(event) {\n\t\t\t\t\tif (\"relatedTarget\" in event) onFocus === null || onFocus === void 0 || onFocus(event);\n\t\t\t\t}, function() {\n\t\t\t\t\tif (isArrowKeyPressedRef.current) {\n\t\t\t\t\t\tvar _ref_current;\n\t\t\t\t\t\t(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\trovingFocusGroupAttrs: {\n\t\t\tasChild: \"except-style\",\n\t\t\ttabIndex: isDisabled ? -1 : 0,\n\t\t\tactive: checked\n\t\t}\n\t};\n};\nfunction useRadioGroupItemIndicator(params) {\n\tvar { radioGroupItemContext, disabled, ...rest } = params;\n\tvar { checked } = (0, import_react.useContext)(radioGroupItemContext);\n\treturn {\n\t\tchecked,\n\t\t\"data-state\": (0, import_utils.getState)(checked),\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...rest\n\t};\n}\n//# sourceMappingURL=useRadioGroup.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;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB;CAC/B,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a,CAAC,IAAI;GAC5B,QAAQ;EACT;CACD;AACD;AACA,SAAS,2BAA2B,QAAQ;CAC3C,IAAI,EAAE,uBAAuB,UAAU,GAAG,SAAS;CACnD,IAAI,EAAE,aAAa,GAAG,aAAa,WAAU,CAAE,qBAAqB;CACpE,OAAO;EACN;EACA,eAAe,GAAG,aAAa,SAAQ,CAAE,OAAO;EAChD,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;CACJ;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/radio-headless",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"clean:build": "tamagui-build clean:build"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@tamagui/compose-refs": "3.0.
|
|
40
|
-
"@tamagui/constants": "3.0.
|
|
41
|
-
"@tamagui/create-context": "3.0.
|
|
42
|
-
"@tamagui/focusable": "3.0.
|
|
43
|
-
"@tamagui/helpers": "3.0.
|
|
44
|
-
"@tamagui/label": "3.0.
|
|
45
|
-
"@tamagui/react-native-types": "3.0.
|
|
46
|
-
"@tamagui/use-controllable-state": "3.0.
|
|
47
|
-
"@tamagui/use-previous": "3.0.
|
|
48
|
-
"@tamagui/web": "3.0.
|
|
39
|
+
"@tamagui/compose-refs": "3.0.9",
|
|
40
|
+
"@tamagui/constants": "3.0.9",
|
|
41
|
+
"@tamagui/create-context": "3.0.9",
|
|
42
|
+
"@tamagui/focusable": "3.0.9",
|
|
43
|
+
"@tamagui/helpers": "3.0.9",
|
|
44
|
+
"@tamagui/label": "3.0.9",
|
|
45
|
+
"@tamagui/react-native-types": "3.0.9",
|
|
46
|
+
"@tamagui/use-controllable-state": "3.0.9",
|
|
47
|
+
"@tamagui/use-previous": "3.0.9",
|
|
48
|
+
"@tamagui/web": "3.0.9"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@tamagui/build": "3.0.
|
|
51
|
+
"@tamagui/build": "3.0.9",
|
|
52
52
|
"react": "19.2.3",
|
|
53
53
|
"react-native": "0.87.1"
|
|
54
54
|
},
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
63
63
|
"directory": "code/ui/radio-headless"
|
|
64
64
|
},
|
|
65
|
-
"releaseSourceCommit": "
|
|
65
|
+
"releaseSourceCommit": "1971272fa9915450004c84ea48188100fdf278ff"
|
|
66
66
|
}
|