@tamagui/radio-headless 2.0.0-rc.3 → 2.0.0-rc.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","BubbleInput_exports","__export","BubbleInput","module","exports","import_jsx_runtime","require","import_react","__toESM","import_use_previous","props","checked","bubbles","control","isHidden","accentColor","inputProps","ref","default","useRef","prevChecked","usePrevious","useEffect","input","current","inputProto","window","HTMLInputElement","prototype","descriptor","Object","getOwnPropertyDescriptor","setChecked","set","event","Event","call","dispatchEvent","jsx","type","defaultChecked","tabIndex","style","position","pointerEvents","opacity","margin","appearance"],"sources":["../../src/BubbleInput.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAkB,CAAAK,mBAClB;AAUO,IAAAK,kBAAqB,GAAAC,OAA4B;EAAAC,YAAA,GAAAC,OAAA,CAAAF,OAAA;EAAAG,mBAAA,GAAAH,OAAA;EAAAJ,WAAA,YAAAA,CAAAQ,KAAA;IACtD;QAAMC,OAAE;QAAAC,OAAS,KAAU;QAAAC,OAAM;QAAAC,QAAS;QAAAC,WAAU;QAAA,GAAaC;MAAG,IAAWN,KAAI;MAAAO,GAC7E,GAAAV,YAAM,CAAAW,OAAA,CAAAC,MAAM,KAAyB;MAAIC,WACzC,OAAAX,mBAAc,CAAAY,WAAA,EAAAV,OAAY;IAGhC,OAAAJ,YAAA,CAAAW,OAAA,CAAMI,SAAA,CAAU,YAAM;MACpB,IAAAC,KAAM,GAAAN,GAAQ,CAAAO,OAAI;QAAAC,UACZ,GAAAC,MAAa,CAAAC,gBAAO,CAAAC,SAAiB;QAAAC,UAKrC,GAAAC,MAJa,CAAAC,wBAAO,CAAAN,UAAA;QAAAO,UAAA,GAAAH,UAAA,CAAAI,GAAA;MAAA,IACxBb,WAAA,KAAAT,OAAA,IAAAqB,UAAA;QACA,IAAAE,KAAA,OAAAC,KAAA;UAE4BvB;QAC9B,EAAI;QACFoB,UAAM,CAAAI,IAAQ,CAAAb,KAAI,EAAAZ,OAAM,GAASY,KAAE,CAAAc,aAAS,CAAAH,KAAA;MAC5C;IACyB,GAC3B,CACFd,WAAI,EAGDT,OAAA,EAAAC,OAAA,IACC,eAAK,IAAAP,kBAAA,CAAAiC,GAAA;MAAAC,IACL;MAAgBC,cACZ,EAAA7B,OAAA;MAAA,GACJK,UAAU;MAAAyB,QACV;MAAAxB,GACA;MAAa,aACN,EAAAH,QAAA;MAAA4B,KACL,EAAI;QACA,IAAA5B,QAAA;UAAA;UAEY6B,QACV,YAAe;UAAAC,aACN;UAAAC,OACT,GAAQ;UACVC,MACA;QAAA,IACE;UAAYC,UACZ;UACFhC;QAAA;QAGN,GAAAL,KAAA,CAAAgC;MAAA;IACF;EAEJ","ignoreList":[]}
1
+ {"version":3,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","BubbleInput_exports","BubbleInput","module","exports","import_jsx_runtime","require","import_react","import_use_previous","props","checked","bubbles","control","isHidden","accentColor","inputProps","ref","default","useRef","prevChecked","usePrevious","useEffect","input","current","inputProto","window","HTMLInputElement","descriptor","setChecked","set","event","Event","dispatchEvent","jsx","type","defaultChecked","tabIndex","style","position","pointerEvents","opacity","margin","appearance"],"sources":["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, __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\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: !0 }) : target,\n mod\n)), __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), 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\"), import_react = __toESM(require(\"react\"), 1), import_use_previous = require(\"@tamagui/use-previous\"), BubbleInput = function(props) {\n var { checked, bubbles = !0, control, isHidden, accentColor, ...inputProps } = props, ref = import_react.default.useRef(null), prevChecked = (0, import_use_previous.usePrevious)(checked);\n return import_react.default.useEffect(function() {\n var input = ref.current, inputProto = window.HTMLInputElement.prototype, descriptor = Object.getOwnPropertyDescriptor(inputProto, \"checked\"), setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n var event = new Event(\"click\", {\n bubbles\n });\n setChecked.call(input, checked), input.dispatchEvent(event);\n }\n }, [\n prevChecked,\n checked,\n bubbles\n ]), /* @__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":"AAAA,YAAY;;AACZ,IAAIA,QAAQ,GAAGC,MAAM,CAACC,MAAM;AAC5B,IAAIC,SAAS,GAAGF,MAAM,CAACG,cAAc;AACrC,IAAIC,gBAAgB,GAAGJ,MAAM,CAACK,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGN,MAAM,CAACO,mBAAmB;AAClD,IAAIC,YAAY,GAAGR,MAAM,CAACS,cAAc;EAAEC,YAAY,GAAGV,MAAM,CAACW,SAAS,CAACC,cAAc;AACxF,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;IAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBb,SAAS,CAACY,MAAM,EAAEE,IAAI,EAAE;MAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;MAAEE,UAAU,EAAE,CAAC;IAAE,CAAC,CAAC;EAC/D,CAAC;EAAEC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;IAC3C,IAAIF,IAAI,IAAI,OAAOA,IAAI,IAAI,QAAQ,IAAI,OAAOA,IAAI,IAAI,UAAU,EAC9D,KAAK,IAAIG,GAAG,IAAIlB,iBAAiB,CAACe,IAAI,CAAC,EACrC,CAACX,YAAY,CAACe,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,IAAIpB,SAAS,CAACkB,EAAE,EAAEI,GAAG,EAAE;MAAE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AM;UAClB5B;QACF,CAAC;QACD,GAAGL,KAAK,CAAC4B;MACX;IACF,CAAC,CAAC;EACJ,CAAC","ignoreList":[]}
@@ -17,6 +17,6 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
17
17
  }), mod);
18
18
  var index_exports = {};
19
19
  module.exports = __toCommonJS(index_exports);
20
- __reExport(index_exports, require("./useRadioGroup.native.js"), module.exports);
21
- __reExport(index_exports, require("./utils.native.js"), module.exports);
20
+ __reExport(index_exports, require("./useRadioGroup"), module.exports);
21
+ __reExport(index_exports, require("./utils"), module.exports);
22
22
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,4BADd,GAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__reExport","target","mod","secondTarget","__toCommonJS","value","index_exports","module","exports","require"],"sources":["index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./useRadioGroup\"), module.exports);\n__reExport(index_exports, require(\"./utils\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;IAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,IAAI,QAAQ,IAAI,OAAOA,IAAI,IAAI,UAAU,EAC9D,KAAK,IAAIG,GAAG,IAAIV,iBAAiB,CAACO,IAAI,CAAC,EACrC,CAACL,YAAY,CAACS,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,IAAIb,SAAS,CAACW,EAAE,EAAEI,GAAG,EAAE;MAAEE,GAAG,EAAEA,CAAA,KAAML,IAAI,CAACG,GAAG,CAAC;MAAEG,UAAU,EAAE,EAAEJ,IAAI,GAAGX,gBAAgB,CAACS,IAAI,EAAEG,GAAG,CAAC,CAAC,IAAID,IAAI,CAACI;IAAW,CAAC,CAAC;IACvK,OAAOP,EAAE;EACX,CAAC;EAAEQ,UAAU,GAAGA,CAACC,MAAM,EAAEC,GAAG,EAAEC,YAAY,MAAMZ,WAAW,CAACU,MAAM,EAAEC,GAAG,EAAE,SAAS,CAAC,EAAEC,YAAY,IAAIZ,WAAW,CAACY,YAAY,EAAED,GAAG,EAAE,SAAS,CAAC,CAAC;AAC/I,IAAIE,YAAY,GAAIF,GAAG,IAAKX,WAAW,CAACV,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE;EAAEwB,KAAK,EAAE,CAAC;AAAE,CAAC,CAAC,EAAEH,GAAG,CAAC;AACxF,IAAII,aAAa,GAAG,CAAC,CAAC;AACtBC,MAAM,CAACC,OAAO,GAAGJ,YAAY,CAACE,aAAa,CAAC;AAC5CN,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,iBAAiB,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC;AACrER,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,SAAS,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC","ignoreList":[]}
@@ -35,8 +35,8 @@ var import_jsx_runtime = require("react/jsx-runtime"),
35
35
  import_label = require("@tamagui/label"),
36
36
  import_use_controllable_state = require("@tamagui/use-controllable-state"),
37
37
  import_react = require("react"),
38
- import_BubbleInput = require("./BubbleInput.native.js"),
39
- import_utils = require("./utils.native.js");
38
+ import_BubbleInput = require("./BubbleInput"),
39
+ import_utils = require("./utils");
40
40
  function useRadioGroup(params) {
41
41
  var {
42
42
  value: valueProp,
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useRadioGroup_exports","__export","useRadioGroup","useRadioGroupItem","useRadioGroupItemIndicator","module","exports","import_jsx_runtime","require","import_compose_refs","import_constants","import_focusable","import_helpers","import_label","import_use_controllable_state","import_react","import_BubbleInput","import_utils","params","valueProp","onValueChange","defaultValue","required","disabled","name","native","accentColor","orientation","ref","setValue","useControllableState","prop","defaultProp","onChange","providerValue","frameAttrs","role","rovingFocusGroupAttrs","loop","ARROW_KEYS","radioGroupContext","labelledBy","ariaLabelledby","itemDisabled","refProp","id","onPress","onKeyDown","onFocus","groupValue","useContext","button","setButton","useState","hasConsumerStoppedPropagationRef","useRef","composedRefs","useComposedRefs","node","isArrowKeyPressedRef","isFormControl","isWeb","closest","checked","labelId","useLabelContext","useEffect","handleKeyDown","event","includes","key","current","handleKeyUp","document","addEventListener","removeEventListener","registerFocusable","focusAndSelect","focus","isDisabled","bubbleInput","jsx","BubbleInput","isHidden","control","bubbles","getState","type","composeEventHandlers","isPropagationStopped","stopPropagation","_ref_current","click","asChild","focusable","active","radioGroupItemContext","rest"],"sources":["../../src/useRadioGroup.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,qBAAA;AAAAC,QAAA,CAAAD,qBAAA;EAAAE,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,0BAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAX,YAAgC,CAAAK,qBAAA;AAyBzB,IAAAO,kBAAS,GAAcC,OAA6B;EAAAC,mBAAA,GAAAD,OAAA;EAAAE,gBAAA,GAAAF,OAAA;EAAAG,gBAAA,GAAAH,OAAA;EAAAI,cAAA,GAAAJ,OAAA;EAAAK,YAAA,GAAAL,OAAA;EAAAM,6BAAA,GAAAN,OAAA;EAAAO,YAAA,GAAAP,OAAA;EAAAQ,kBAAA,GAAAR,OAAA;EAAAS,YAAA,GAAAT,OAAA;AACzD,SAAMN,cAAAgB,MAAA;EAAA,IACJ;MAAAnB,KAAO,EAAAoB,SAAA;MAAAC,aAAA;MAAAC,YAAA;MAAAC,QAAA;MAAAC,QAAA;MAAAC,IAAA;MAAAC,MAAA;MAAAC,WAAA;MAAAC,WAAA;MAAAC;IAAA,IAAAV,MAAA;IAAA,CAAAnB,KAAA,EAAA8B,QAAA,QAAAf,6BAAA,CAAAgB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A0E;IAAA,IAAA/E,MAAA;IAAA;MAAA6C;IAAA,QAAAhD,YAAA,CAAAmC,UAAA,EAAA8C,qBAAA;EAAA,OACrB;IAASjC,OACT;IAAY,YACJ,MAAA9C,YAAA,CAAAqE,QAAA,EAAAvB,OAAA;IACV,iBAAAxC,QAAA;IACF,GAAA0E;EACF;AAWO","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","useRadioGroup_exports","useRadioGroup","useRadioGroupItem","useRadioGroupItemIndicator","module","exports","import_jsx_runtime","require","import_compose_refs","import_constants","import_focusable","import_helpers","import_label","import_use_controllable_state","import_react","import_BubbleInput","import_utils","params","valueProp","onValueChange","defaultValue","required","disabled","native","accentColor","orientation","ref","setValue","useControllableState","prop","defaultProp","onChange","providerValue","frameAttrs","role","rovingFocusGroupAttrs","loop","ARROW_KEYS","radioGroupContext","labelledBy","ariaLabelledby","itemDisabled","refProp","id","onPress","onKeyDown","onFocus","groupValue","useContext","button","setButton","useState","hasConsumerStoppedPropagationRef","useRef","composedRefs","useComposedRefs","node","isArrowKeyPressedRef","isFormControl","isWeb","closest","checked","labelId","useLabelContext","useEffect","handleKeyDown","event","includes","current","handleKeyUp","document","addEventListener","removeEventListener","registerFocusable","focusAndSelect","focus","isDisabled","bubbleInput","jsx","BubbleInput","isHidden","control","bubbles","getState","type","composeEventHandlers","isPropagationStopped","stopPropagation","_ref_current","click","asChild","focusable","active","radioGroupItemContext","rest"],"sources":["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 for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar useRadioGroup_exports = {};\n__export(useRadioGroup_exports, {\n useRadioGroup: () => useRadioGroup,\n useRadioGroupItem: () => useRadioGroupItem,\n useRadioGroupItemIndicator: () => useRadioGroupItemIndicator\n});\nmodule.exports = __toCommonJS(useRadioGroup_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\"), import_compose_refs = require(\"@tamagui/compose-refs\"), import_constants = require(\"@tamagui/constants\"), import_focusable = require(\"@tamagui/focusable\"), import_helpers = require(\"@tamagui/helpers\"), import_label = require(\"@tamagui/label\"), import_use_controllable_state = require(\"@tamagui/use-controllable-state\"), import_react = require(\"react\"), import_BubbleInput = require(\"./BubbleInput\"), import_utils = require(\"./utils\");\nfunction useRadioGroup(params) {\n var { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params, [value, setValue] = (0, import_use_controllable_state.useControllableState)({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange\n });\n return {\n providerValue: {\n value,\n onChange: setValue,\n required,\n disabled,\n name,\n native,\n accentColor\n },\n frameAttrs: {\n role: \"radiogroup\",\n \"aria-orientation\": orientation,\n \"data-disabled\": disabled ? \"\" : void 0\n },\n rovingFocusGroupAttrs: {\n orientation,\n loop: !0\n }\n };\n}\nvar ARROW_KEYS = [\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\"\n], useRadioGroupItem = function(params) {\n var { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params, { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext), [button, setButton] = (0, import_react.useState)(null), hasConsumerStoppedPropagationRef = (0, import_react.useRef)(!1), ref = (0, import_react.useRef)(null), composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, function(node) {\n return setButton(node);\n }, ref), isArrowKeyPressedRef = (0, import_react.useRef)(!1), isFormControl = import_constants.isWeb ? button ? !!button.closest(\"form\") : !0 : !1, checked = groupValue === value, labelId = (0, import_label.useLabelContext)(button), labelledBy = ariaLabelledby || labelId;\n (0, import_react.useEffect)(function() {\n if (import_constants.isWeb) {\n var handleKeyDown = function(event) {\n ARROW_KEYS.includes(event.key) && (isArrowKeyPressedRef.current = !0);\n }, handleKeyUp = function() {\n isArrowKeyPressedRef.current = !1;\n };\n return document.addEventListener(\"keydown\", handleKeyDown), document.addEventListener(\"keyup\", handleKeyUp), function() {\n document.removeEventListener(\"keydown\", handleKeyDown), document.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []), (0, import_react.useEffect)(function() {\n if (id && !disabled)\n return (0, import_focusable.registerFocusable)(id, {\n focusAndSelect: function() {\n onChange?.(value);\n },\n focus: function() {\n }\n });\n }, [\n id,\n value,\n disabled\n ]);\n var isDisabled = disabled || itemDisabled;\n return {\n providerValue: {\n checked\n },\n checked,\n isFormControl,\n bubbleInput: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {\n isHidden: !native,\n control: button,\n bubbles: !hasConsumerStoppedPropagationRef.current,\n name,\n value,\n checked,\n required,\n disabled: isDisabled,\n ...import_constants.isWeb && native && {\n accentColor,\n id\n }\n }),\n native,\n frameAttrs: {\n \"data-state\": (0, import_utils.getState)(checked),\n \"data-disabled\": isDisabled ? \"\" : void 0,\n role: \"radio\",\n \"aria-labelledby\": labelledBy,\n \"aria-checked\": checked,\n \"aria-required\": required,\n disabled: isDisabled,\n ref: composedRefs,\n ...import_constants.isWeb && {\n type: \"button\",\n value\n },\n id,\n onPress: (0, import_helpers.composeEventHandlers)(onPress, function(event) {\n checked || onChange?.(value), isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());\n }),\n ...import_constants.isWeb && {\n onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, function(event) {\n (event.key === \"Enter\" || event.key === \" \") && (checked || onChange?.(value));\n }),\n onFocus: (0, import_helpers.composeEventHandlers)(onFocus, function() {\n if (isArrowKeyPressedRef.current) {\n var _ref_current;\n (_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();\n }\n })\n }\n },\n rovingFocusGroupAttrs: {\n asChild: \"except-style\",\n focusable: !isDisabled,\n active: checked\n }\n };\n};\nfunction useRadioGroupItemIndicator(params) {\n var { radioGroupItemContext, disabled, ...rest } = params, { checked } = (0, import_react.useContext)(radioGroupItemContext);\n return {\n checked,\n \"data-state\": (0, import_utils.getState)(checked),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...rest\n };\n}\n//# sourceMappingURL=useRadioGroup.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;IAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;MAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;MAAEE,UAAU,EAAE,CAAC;IAAE,CAAC,CAAC;EAC/D,CAAC;EAAEC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;IAC3C,IAAIF,I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C;UACF+C,OAAO,EAAE,CAAC,CAAC,EAAEnC,cAAc,CAAC0E,oBAAoB,EAAEvC,OAAO,EAAE,YAAW;YACpE,IAAIW,oBAAoB,CAACW,OAAO,EAAE;cAChC,IAAIoB,YAAY;cAChB,CAACA,YAAY,GAAG9D,GAAG,CAAC0C,OAAO,MAAM,IAAI,IAAIoB,YAAY,KAAK,KAAK,CAAC,IAAIA,YAAY,CAACC,KAAK,CAAC,CAAC;YAC1F;UACF,CAAC;QACH,CAAC;MACH,CAAC;MACDtD,qBAAqB,EAAE;QACrBuD,OAAO,EAAE,cAAc;QACvBC,SAAS,EAAE,CAACf,UAAU;QACtBgB,MAAM,EAAE/B;MACV;IACF,CAAC;EACH,CAAC;AACD,SAAS1D,0BAA0BA,CAACc,MAAM,EAAE;EAC1C,IAAI;MAAE4E,qBAAqB;MAAEvE,QAAQ;MAAE,GAAGwE;IAAK,CAAC,GAAG7E,MAAM;IAAE;MAAE4C;IAAQ,CAAC,GAAG,CAAC,CAAC,EAAE/C,YAAY,CAACkC,UAAU,EAAE6C,qBAAqB,CAAC;EAC5H,OAAO;IACLhC,OAAO;IACP,YAAY,EAAE,CAAC,CAAC,EAAE7C,YAAY,CAACmE,QAAQ,EAAEtB,OAAO,CAAC;IACjD,eAAe,EAAEvC,QAAQ,GAAG,EAAE,GAAG,KAAK,CAAC;IACvC,GAAGwE;EACL,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","utils_exports","__export","getState","module","exports","checked"],"sources":["../../src/utils.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAAOC,MAAA,CAAAC,OAAS,GAAAT,YAA2B,CAAAK,aAAA;AACzC,SAAOE,SAAAG,OAAU;EACnB,OAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","utils_exports","getState","module","exports","checked"],"sources":["utils.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar utils_exports = {};\n__export(utils_exports, {\n getState: () => getState\n});\nmodule.exports = __toCommonJS(utils_exports);\nfunction getState(checked) {\n return checked ? \"checked\" : \"unchecked\";\n}\n//# sourceMappingURL=utils.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;IAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;MAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;MAAEE,UAAU,EAAE,CAAC;IAAE,CAAC,CAAC;EAC/D,CAAC;EAAEC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;IAC3C,IAAIF,IAAI,IAAI,OAAOA,IAAI,IAAI,QAAQ,IAAI,OAAOA,IAAI,IAAI,UAAU,EAC9D,KAAK,IAAIG,GAAG,IAAIhB,iBAAiB,CAACa,IAAI,CAAC,EACrC,CAACX,YAAY,CAACe,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,IAAInB,SAAS,CAACiB,EAAE,EAAEI,GAAG,EAAE;MAAEP,GAAG,EAAEA,CAAA,KAAMI,IAAI,CAACG,GAAG,CAAC;MAAEN,UAAU,EAAE,EAAEK,IAAI,GAAGjB,gBAAgB,CAACe,IAAI,EAAEG,GAAG,CAAC,CAAC,IAAID,IAAI,CAACL;IAAW,CAAC,CAAC;IACvK,OAAOE,EAAE;EACX,CAAC;AACD,IAAIM,YAAY,GAAIC,GAAG,IAAKR,WAAW,CAAChB,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE;EAAEyB,KAAK,EAAE,CAAC;AAAE,CAAC,CAAC,EAAED,GAAG,CAAC;AACxF,IAAIE,aAAa,GAAG,CAAC,CAAC;AACtBhB,QAAQ,CAACgB,aAAa,EAAE;EACtBC,QAAQ,EAAEA,CAAA,KAAMA;AAClB,CAAC,CAAC;AACFC,MAAM,CAACC,OAAO,GAAGN,YAAY,CAACG,aAAa,CAAC;AAC5C,SAASC,QAAQA,CAACG,OAAO,EAAE;EACzB,OAAOA,OAAO,GAAG,SAAS,GAAG,WAAW;AAC1C","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./useRadioGroup";
2
- export * from "./utils";
1
+ export * from "./useRadioGroup.mjs";
2
+ export * from "./utils.mjs";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
package/dist/jsx/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./useRadioGroup";
2
- export * from "./utils";
1
+ export * from "./useRadioGroup.mjs";
2
+ export * from "./utils.mjs";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/radio-headless",
3
- "version": "2.0.0-rc.3",
3
+ "version": "2.0.0-rc.31",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -19,15 +19,12 @@
19
19
  "./package.json": "./package.json",
20
20
  ".": {
21
21
  "types": "./types/index.d.ts",
22
- "react-native": {
23
- "module": "./dist/esm/index.native.js",
24
- "import": "./dist/esm/index.native.js",
25
- "require": "./dist/cjs/index.native.js"
26
- },
22
+ "react-native": "./dist/esm/index.native.js",
23
+ "browser": "./dist/esm/index.mjs",
27
24
  "module": "./dist/esm/index.mjs",
28
25
  "import": "./dist/esm/index.mjs",
29
26
  "require": "./dist/cjs/index.cjs",
30
- "default": "./dist/cjs/index.native.js"
27
+ "default": "./dist/esm/index.mjs"
31
28
  }
32
29
  },
33
30
  "publishConfig": {
@@ -40,20 +37,20 @@
40
37
  "clean:build": "tamagui-build clean:build"
41
38
  },
42
39
  "dependencies": {
43
- "@tamagui/compose-refs": "2.0.0-rc.3",
44
- "@tamagui/constants": "2.0.0-rc.3",
45
- "@tamagui/create-context": "2.0.0-rc.3",
46
- "@tamagui/focusable": "2.0.0-rc.3",
47
- "@tamagui/helpers": "2.0.0-rc.3",
48
- "@tamagui/label": "2.0.0-rc.3",
49
- "@tamagui/use-controllable-state": "2.0.0-rc.3",
50
- "@tamagui/use-previous": "2.0.0-rc.3",
51
- "@tamagui/web": "2.0.0-rc.3"
40
+ "@tamagui/compose-refs": "2.0.0-rc.31",
41
+ "@tamagui/constants": "2.0.0-rc.31",
42
+ "@tamagui/create-context": "2.0.0-rc.31",
43
+ "@tamagui/focusable": "2.0.0-rc.31",
44
+ "@tamagui/helpers": "2.0.0-rc.31",
45
+ "@tamagui/label": "2.0.0-rc.31",
46
+ "@tamagui/use-controllable-state": "2.0.0-rc.31",
47
+ "@tamagui/use-previous": "2.0.0-rc.31",
48
+ "@tamagui/web": "2.0.0-rc.31"
52
49
  },
53
50
  "devDependencies": {
54
- "@tamagui/build": "2.0.0-rc.3",
51
+ "@tamagui/build": "2.0.0-rc.31",
55
52
  "react": ">=19",
56
- "react-native": "0.81.5"
53
+ "react-native": "0.83.2"
57
54
  },
58
55
  "peerDependencies": {
59
56
  "react": ">=19",
@@ -1,65 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var BubbleInput_exports = {};
24
- __export(BubbleInput_exports, {
25
- BubbleInput: () => BubbleInput
26
- });
27
- module.exports = __toCommonJS(BubbleInput_exports);
28
- var import_react = __toESM(require("react"), 1), import_use_previous = require("@tamagui/use-previous"), import_jsx_runtime = require("react/jsx-runtime");
29
- const BubbleInput = (props) => {
30
- const { checked, bubbles = !0, control, isHidden, accentColor, ...inputProps } = props, ref = import_react.default.useRef(null), prevChecked = (0, import_use_previous.usePrevious)(checked);
31
- return import_react.default.useEffect(() => {
32
- const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
33
- inputProto,
34
- "checked"
35
- ).set;
36
- if (prevChecked !== checked && setChecked) {
37
- const event = new Event("click", { bubbles });
38
- setChecked.call(input, checked), input.dispatchEvent(event);
39
- }
40
- }, [prevChecked, checked, bubbles]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
41
- "input",
42
- {
43
- type: "radio",
44
- defaultChecked: checked,
45
- ...inputProps,
46
- tabIndex: -1,
47
- ref,
48
- "aria-hidden": isHidden,
49
- style: {
50
- ...isHidden ? {
51
- // ...controlSize,
52
- position: "absolute",
53
- pointerEvents: "none",
54
- opacity: 0,
55
- margin: 0
56
- } : {
57
- appearance: "auto",
58
- accentColor
59
- },
60
- ...props.style
61
- }
62
- }
63
- );
64
- };
65
- //# sourceMappingURL=BubbleInput.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/BubbleInput.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,8BAClB,sBAA4B,kCAgCxB;AAtBG,MAAM,cAAc,CAAC,UAA4B;AACtD,QAAM,EAAE,SAAS,UAAU,IAAM,SAAS,UAAU,aAAa,GAAG,WAAW,IAAI,OAC7E,MAAM,aAAAA,QAAM,OAAyB,IAAI,GACzC,kBAAc,iCAAY,OAAO;AAGvC,sBAAAA,QAAM,UAAU,MAAM;AACpB,UAAM,QAAQ,IAAI,SACZ,aAAa,OAAO,iBAAiB,WAKrC,aAJa,OAAO;AAAA,MACxB;AAAA,MACA;AAAA,IACF,EAC8B;AAC9B,QAAI,gBAAgB,WAAW,YAAY;AACzC,YAAM,QAAQ,IAAI,MAAM,SAAS,EAAE,QAAQ,CAAC;AAC5C,iBAAW,KAAK,OAAO,OAAO,GAC9B,MAAM,cAAc,KAAK;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC,GAGhC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,gBAAgB;AAAA,MACf,GAAG;AAAA,MACJ,UAAU;AAAA,MACV;AAAA,MACA,eAAa;AAAA,MACb,OAAO;AAAA,QACL,GAAI,WACA;AAAA;AAAA,UAEE,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV,IACA;AAAA,UACE,YAAY;AAAA,UACZ;AAAA,QACF;AAAA,QAEJ,GAAG,MAAM;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;",
5
- "names": ["React"]
6
- }
package/dist/cjs/index.js DELETED
@@ -1,16 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var index_exports = {};
13
- module.exports = __toCommonJS(index_exports);
14
- __reExport(index_exports, require("./useRadioGroup"), module.exports);
15
- __reExport(index_exports, require("./utils"), module.exports);
16
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,4BAAd;AACA,0BAAc,oBADd;",
5
- "names": []
6
- }
@@ -1,160 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var useRadioGroup_exports = {};
16
- __export(useRadioGroup_exports, {
17
- useRadioGroup: () => useRadioGroup,
18
- useRadioGroupItem: () => useRadioGroupItem,
19
- useRadioGroupItemIndicator: () => useRadioGroupItemIndicator
20
- });
21
- module.exports = __toCommonJS(useRadioGroup_exports);
22
- var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_focusable = require("@tamagui/focusable"), import_helpers = require("@tamagui/helpers"), import_label = require("@tamagui/label"), import_use_controllable_state = require("@tamagui/use-controllable-state"), import_react = require("react"), import_BubbleInput = require("./BubbleInput"), import_utils = require("./utils"), import_jsx_runtime = require("react/jsx-runtime");
23
- function useRadioGroup(params) {
24
- const {
25
- value: valueProp,
26
- onValueChange,
27
- defaultValue,
28
- required,
29
- disabled,
30
- name,
31
- native,
32
- accentColor,
33
- orientation,
34
- ref
35
- } = params, [value, setValue] = (0, import_use_controllable_state.useControllableState)({
36
- prop: valueProp,
37
- defaultProp: defaultValue,
38
- onChange: onValueChange
39
- });
40
- return {
41
- providerValue: {
42
- value,
43
- onChange: setValue,
44
- required,
45
- disabled,
46
- name,
47
- native,
48
- accentColor
49
- },
50
- frameAttrs: {
51
- role: "radiogroup",
52
- "aria-orientation": orientation,
53
- "data-disabled": disabled ? "" : void 0
54
- },
55
- rovingFocusGroupAttrs: {
56
- orientation,
57
- loop: !0
58
- }
59
- };
60
- }
61
- const ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], useRadioGroupItem = (params) => {
62
- const {
63
- radioGroupContext,
64
- value,
65
- labelledBy: ariaLabelledby,
66
- disabled: itemDisabled,
67
- ref: refProp,
68
- id,
69
- onPress,
70
- onKeyDown,
71
- onFocus
72
- } = params, {
73
- value: groupValue,
74
- disabled,
75
- required,
76
- onChange,
77
- name,
78
- native,
79
- accentColor
80
- } = (0, import_react.useContext)(radioGroupContext), [button, setButton] = (0, import_react.useState)(null), hasConsumerStoppedPropagationRef = (0, import_react.useRef)(!1), ref = (0, import_react.useRef)(null), composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, (node) => setButton(node), ref), isArrowKeyPressedRef = (0, import_react.useRef)(!1), isFormControl = import_constants.isWeb ? button ? !!button.closest("form") : !0 : !1, checked = groupValue === value, labelId = (0, import_label.useLabelContext)(button), labelledBy = ariaLabelledby || labelId;
81
- (0, import_react.useEffect)(() => {
82
- if (import_constants.isWeb) {
83
- const handleKeyDown = (event) => {
84
- ARROW_KEYS.includes(event.key) && (isArrowKeyPressedRef.current = !0);
85
- }, handleKeyUp = () => {
86
- isArrowKeyPressedRef.current = !1;
87
- };
88
- return document.addEventListener("keydown", handleKeyDown), document.addEventListener("keyup", handleKeyUp), () => {
89
- document.removeEventListener("keydown", handleKeyDown), document.removeEventListener("keyup", handleKeyUp);
90
- };
91
- }
92
- }, []);
93
- const isDisabled = disabled || itemDisabled;
94
- return {
95
- providerValue: {
96
- checked
97
- },
98
- checked,
99
- isFormControl,
100
- bubbleInput: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
- import_BubbleInput.BubbleInput,
102
- {
103
- isHidden: !native,
104
- control: button,
105
- bubbles: !hasConsumerStoppedPropagationRef.current,
106
- name,
107
- value,
108
- checked,
109
- required,
110
- disabled: isDisabled,
111
- ...import_constants.isWeb && native && {
112
- accentColor,
113
- id
114
- }
115
- }
116
- ),
117
- native,
118
- frameAttrs: {
119
- "data-state": (0, import_utils.getState)(checked),
120
- "data-disabled": isDisabled ? "" : void 0,
121
- role: "radio",
122
- "aria-labelledby": labelledBy,
123
- "aria-checked": checked,
124
- "aria-required": required,
125
- disabled: isDisabled,
126
- ref: composedRefs,
127
- ...import_constants.isWeb && {
128
- type: "button",
129
- value
130
- },
131
- id,
132
- onPress: (0, import_helpers.composeEventHandlers)(onPress, (event) => {
133
- checked || onChange?.(value), isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
134
- }),
135
- ...import_constants.isWeb && {
136
- onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, (event) => {
137
- (event.key === "Enter" || event.key === " ") && (checked || onChange?.(value));
138
- }),
139
- onFocus: (0, import_helpers.composeEventHandlers)(onFocus, () => {
140
- isArrowKeyPressedRef.current && ref.current?.click();
141
- })
142
- }
143
- },
144
- rovingFocusGroupAttrs: {
145
- asChild: "except-style",
146
- focusable: !isDisabled,
147
- active: checked
148
- }
149
- };
150
- };
151
- function useRadioGroupItemIndicator(params) {
152
- const { radioGroupItemContext, disabled, ...rest } = params, { checked } = (0, import_react.useContext)(radioGroupItemContext);
153
- return {
154
- checked,
155
- "data-state": (0, import_utils.getState)(checked),
156
- "data-disabled": disabled ? "" : void 0,
157
- ...rest
158
- };
159
- }
160
- //# sourceMappingURL=useRadioGroup.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/useRadioGroup.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC,kCAChC,mBAAsB,+BACtB,mBAAkC,+BAClC,iBAAqC,6BACrC,eAAgC,2BAChC,gCAAqC,4CAGrC,eAAwD,kBAExD,qBAA4B,0BAC5B,eAAyB,oBA4JnB;AA9IC,SAAS,cAAc,QAA6B;AACzD,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,QACE,CAAC,OAAO,QAAQ,QAAI,oDAAqB;AAAA,IAC7C,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ,CAAC;AAED,SAAO;AAAA,IACL,eAAe;AAAA,MACb;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,oBAAoB;AAAA,MACpB,iBAAiB,WAAW,KAAK;AAAA,IACnC;AAAA,IACA,uBAAuB;AAAA,MACrB;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAwBA,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AA,EACL;AACF;",
5
- "names": []
6
- }
package/dist/cjs/utils.js DELETED
@@ -1,23 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var utils_exports = {};
16
- __export(utils_exports, {
17
- getState: () => getState
18
- });
19
- module.exports = __toCommonJS(utils_exports);
20
- function getState(checked) {
21
- return checked ? "checked" : "unchecked";
22
- }
23
- //# sourceMappingURL=utils.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/utils.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,SAAS,SAAkB;AACzC,SAAO,UAAU,YAAY;AAC/B;",
5
- "names": []
6
- }
@@ -1,43 +0,0 @@
1
- import React from "react";
2
- import { usePrevious } from "@tamagui/use-previous";
3
- import { jsx } from "react/jsx-runtime";
4
- const BubbleInput = (props) => {
5
- const { checked, bubbles = !0, control, isHidden, accentColor, ...inputProps } = props, ref = React.useRef(null), prevChecked = usePrevious(checked);
6
- return React.useEffect(() => {
7
- const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
8
- inputProto,
9
- "checked"
10
- ).set;
11
- if (prevChecked !== checked && setChecked) {
12
- const event = new Event("click", { bubbles });
13
- setChecked.call(input, checked), input.dispatchEvent(event);
14
- }
15
- }, [prevChecked, checked, bubbles]), /* @__PURE__ */ jsx(
16
- "input",
17
- {
18
- type: "radio",
19
- defaultChecked: checked,
20
- ...inputProps,
21
- tabIndex: -1,
22
- ref,
23
- "aria-hidden": isHidden,
24
- style: {
25
- ...isHidden ? {
26
- // ...controlSize,
27
- position: "absolute",
28
- pointerEvents: "none",
29
- opacity: 0,
30
- margin: 0
31
- } : {
32
- appearance: "auto",
33
- accentColor
34
- },
35
- ...props.style
36
- }
37
- }
38
- );
39
- };
40
- export {
41
- BubbleInput
42
- };
43
- //# sourceMappingURL=BubbleInput.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/BubbleInput.tsx"],
4
- "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,mBAAmB;AAgCxB;AAtBG,MAAM,cAAc,CAAC,UAA4B;AACtD,QAAM,EAAE,SAAS,UAAU,IAAM,SAAS,UAAU,aAAa,GAAG,WAAW,IAAI,OAC7E,MAAM,MAAM,OAAyB,IAAI,GACzC,cAAc,YAAY,OAAO;AAGvC,eAAM,UAAU,MAAM;AACpB,UAAM,QAAQ,IAAI,SACZ,aAAa,OAAO,iBAAiB,WAKrC,aAJa,OAAO;AAAA,MACxB;AAAA,MACA;AAAA,IACF,EAC8B;AAC9B,QAAI,gBAAgB,WAAW,YAAY;AACzC,YAAM,QAAQ,IAAI,MAAM,SAAS,EAAE,QAAQ,CAAC;AAC5C,iBAAW,KAAK,OAAO,OAAO,GAC9B,MAAM,cAAc,KAAK;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC,GAGhC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,gBAAgB;AAAA,MACf,GAAG;AAAA,MACJ,UAAU;AAAA,MACV;AAAA,MACA,eAAa;AAAA,MACb,OAAO;AAAA,QACL,GAAI,WACA;AAAA;AAAA,UAEE,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV,IACA;AAAA,UACE,YAAY;AAAA,UACZ;AAAA,QACF;AAAA,QAEJ,GAAG,MAAM;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;",
5
- "names": []
6
- }
@@ -1,153 +0,0 @@
1
- import { useComposedRefs } from "@tamagui/compose-refs";
2
- import { isWeb } from "@tamagui/constants";
3
-
4
- import { composeEventHandlers } from "@tamagui/helpers";
5
- import { useLabelContext } from "@tamagui/label";
6
- import { useControllableState } from "@tamagui/use-controllable-state";
7
- import { useContext, useEffect, useRef, useState } from "react";
8
- import { BubbleInput } from "./BubbleInput";
9
- import { getState } from "./utils";
10
- import { jsx } from "react/jsx-runtime";
11
- function useRadioGroup(params) {
12
- const {
13
- value: valueProp,
14
- onValueChange,
15
- defaultValue,
16
- required,
17
- disabled,
18
- name,
19
- native,
20
- accentColor,
21
- orientation,
22
- ref
23
- } = params, [value, setValue] = useControllableState({
24
- prop: valueProp,
25
- defaultProp: defaultValue,
26
- onChange: onValueChange
27
- });
28
- return {
29
- providerValue: {
30
- value,
31
- onChange: setValue,
32
- required,
33
- disabled,
34
- name,
35
- native,
36
- accentColor
37
- },
38
- frameAttrs: {
39
- role: "radiogroup",
40
- "aria-orientation": orientation,
41
- "data-disabled": disabled ? "" : void 0
42
- },
43
- rovingFocusGroupAttrs: {
44
- orientation,
45
- loop: !0
46
- }
47
- };
48
- }
49
- const ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], useRadioGroupItem = (params) => {
50
- const {
51
- radioGroupContext,
52
- value,
53
- labelledBy: ariaLabelledby,
54
- disabled: itemDisabled,
55
- ref: refProp,
56
- id,
57
- onPress,
58
- onKeyDown,
59
- onFocus
60
- } = params, {
61
- value: groupValue,
62
- disabled,
63
- required,
64
- onChange,
65
- name,
66
- native,
67
- accentColor
68
- } = useContext(radioGroupContext), [button, setButton] = useState(null), hasConsumerStoppedPropagationRef = useRef(!1), ref = useRef(null), composedRefs = useComposedRefs(refProp, (node) => setButton(node), ref), isArrowKeyPressedRef = useRef(!1), isFormControl = isWeb ? button ? !!button.closest("form") : !0 : !1, checked = groupValue === value, labelId = useLabelContext(button), labelledBy = ariaLabelledby || labelId;
69
- useEffect(() => {
70
- if (isWeb) {
71
- const handleKeyDown = (event) => {
72
- ARROW_KEYS.includes(event.key) && (isArrowKeyPressedRef.current = !0);
73
- }, handleKeyUp = () => {
74
- isArrowKeyPressedRef.current = !1;
75
- };
76
- return document.addEventListener("keydown", handleKeyDown), document.addEventListener("keyup", handleKeyUp), () => {
77
- document.removeEventListener("keydown", handleKeyDown), document.removeEventListener("keyup", handleKeyUp);
78
- };
79
- }
80
- }, []);
81
- const isDisabled = disabled || itemDisabled;
82
- return {
83
- providerValue: {
84
- checked
85
- },
86
- checked,
87
- isFormControl,
88
- bubbleInput: /* @__PURE__ */ jsx(
89
- BubbleInput,
90
- {
91
- isHidden: !native,
92
- control: button,
93
- bubbles: !hasConsumerStoppedPropagationRef.current,
94
- name,
95
- value,
96
- checked,
97
- required,
98
- disabled: isDisabled,
99
- ...isWeb && native && {
100
- accentColor,
101
- id
102
- }
103
- }
104
- ),
105
- native,
106
- frameAttrs: {
107
- "data-state": getState(checked),
108
- "data-disabled": isDisabled ? "" : void 0,
109
- role: "radio",
110
- "aria-labelledby": labelledBy,
111
- "aria-checked": checked,
112
- "aria-required": required,
113
- disabled: isDisabled,
114
- ref: composedRefs,
115
- ...isWeb && {
116
- type: "button",
117
- value
118
- },
119
- id,
120
- onPress: composeEventHandlers(onPress, (event) => {
121
- checked || onChange?.(value), isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
122
- }),
123
- ...isWeb && {
124
- onKeyDown: composeEventHandlers(onKeyDown, (event) => {
125
- (event.key === "Enter" || event.key === " ") && (checked || onChange?.(value));
126
- }),
127
- onFocus: composeEventHandlers(onFocus, () => {
128
- isArrowKeyPressedRef.current && ref.current?.click();
129
- })
130
- }
131
- },
132
- rovingFocusGroupAttrs: {
133
- asChild: "except-style",
134
- focusable: !isDisabled,
135
- active: checked
136
- }
137
- };
138
- };
139
- function useRadioGroupItemIndicator(params) {
140
- const { radioGroupItemContext, disabled, ...rest } = params, { checked } = useContext(radioGroupItemContext);
141
- return {
142
- checked,
143
- "data-state": getState(checked),
144
- "data-disabled": disabled ? "" : void 0,
145
- ...rest
146
- };
147
- }
148
- export {
149
- useRadioGroup,
150
- useRadioGroupItem,
151
- useRadioGroupItemIndicator
152
- };
153
- //# sourceMappingURL=useRadioGroup.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/useRadioGroup.tsx"],
4
- "mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,OAAkC;AAClC,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AAGrC,SAAS,YAAY,WAAW,QAAQ,gBAAgB;AAExD,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AA4JnB;AA9IC,SAAS,cAAc,QAA6B;AACzD,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,QACE,CAAC,OAAO,QAAQ,IAAI,qBAAqB;AAAA,IAC7C,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ,CAAC;AAED,SAAO;AAAA,IACL,eAAe;AAAA,MACb;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,oBAAoB;AAAA,MACpB,iBAAiB,WAAW,KAAK;AAAA,IACnC;AAAA,IACA,uBAAuB;AAAA,MACrB;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAC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F;",
5
- "names": []
6
- }
package/dist/esm/utils.js DELETED
@@ -1,7 +0,0 @@
1
- function getState(checked) {
2
- return checked ? "checked" : "unchecked";
3
- }
4
- export {
5
- getState
6
- };
7
- //# sourceMappingURL=utils.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/utils.tsx"],
4
- "mappings": "AAAO,SAAS,SAAS,SAAkB;AACzC,SAAO,UAAU,YAAY;AAC/B;",
5
- "names": []
6
- }
@@ -1,43 +0,0 @@
1
- import React from "react";
2
- import { usePrevious } from "@tamagui/use-previous";
3
- import { jsx } from "react/jsx-runtime";
4
- const BubbleInput = (props) => {
5
- const { checked, bubbles = !0, control, isHidden, accentColor, ...inputProps } = props, ref = React.useRef(null), prevChecked = usePrevious(checked);
6
- return React.useEffect(() => {
7
- const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
8
- inputProto,
9
- "checked"
10
- ).set;
11
- if (prevChecked !== checked && setChecked) {
12
- const event = new Event("click", { bubbles });
13
- setChecked.call(input, checked), input.dispatchEvent(event);
14
- }
15
- }, [prevChecked, checked, bubbles]), /* @__PURE__ */ jsx(
16
- "input",
17
- {
18
- type: "radio",
19
- defaultChecked: checked,
20
- ...inputProps,
21
- tabIndex: -1,
22
- ref,
23
- "aria-hidden": isHidden,
24
- style: {
25
- ...isHidden ? {
26
- // ...controlSize,
27
- position: "absolute",
28
- pointerEvents: "none",
29
- opacity: 0,
30
- margin: 0
31
- } : {
32
- appearance: "auto",
33
- accentColor
34
- },
35
- ...props.style
36
- }
37
- }
38
- );
39
- };
40
- export {
41
- BubbleInput
42
- };
43
- //# sourceMappingURL=BubbleInput.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/BubbleInput.tsx"],
4
- "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,mBAAmB;AAgCxB;AAtBG,MAAM,cAAc,CAAC,UAA4B;AACtD,QAAM,EAAE,SAAS,UAAU,IAAM,SAAS,UAAU,aAAa,GAAG,WAAW,IAAI,OAC7E,MAAM,MAAM,OAAyB,IAAI,GACzC,cAAc,YAAY,OAAO;AAGvC,eAAM,UAAU,MAAM;AACpB,UAAM,QAAQ,IAAI,SACZ,aAAa,OAAO,iBAAiB,WAKrC,aAJa,OAAO;AAAA,MACxB;AAAA,MACA;AAAA,IACF,EAC8B;AAC9B,QAAI,gBAAgB,WAAW,YAAY;AACzC,YAAM,QAAQ,IAAI,MAAM,SAAS,EAAE,QAAQ,CAAC;AAC5C,iBAAW,KAAK,OAAO,OAAO,GAC9B,MAAM,cAAc,KAAK;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC,GAGhC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,gBAAgB;AAAA,MACf,GAAG;AAAA,MACJ,UAAU;AAAA,MACV;AAAA,MACA,eAAa;AAAA,MACb,OAAO;AAAA,QACL,GAAI,WACA;AAAA;AAAA,UAEE,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV,IACA;AAAA,UACE,YAAY;AAAA,UACZ;AAAA,QACF;AAAA,QAEJ,GAAG,MAAM;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;",
5
- "names": []
6
- }
@@ -1,153 +0,0 @@
1
- import { useComposedRefs } from "@tamagui/compose-refs";
2
- import { isWeb } from "@tamagui/constants";
3
-
4
- import { composeEventHandlers } from "@tamagui/helpers";
5
- import { useLabelContext } from "@tamagui/label";
6
- import { useControllableState } from "@tamagui/use-controllable-state";
7
- import { useContext, useEffect, useRef, useState } from "react";
8
- import { BubbleInput } from "./BubbleInput";
9
- import { getState } from "./utils";
10
- import { jsx } from "react/jsx-runtime";
11
- function useRadioGroup(params) {
12
- const {
13
- value: valueProp,
14
- onValueChange,
15
- defaultValue,
16
- required,
17
- disabled,
18
- name,
19
- native,
20
- accentColor,
21
- orientation,
22
- ref
23
- } = params, [value, setValue] = useControllableState({
24
- prop: valueProp,
25
- defaultProp: defaultValue,
26
- onChange: onValueChange
27
- });
28
- return {
29
- providerValue: {
30
- value,
31
- onChange: setValue,
32
- required,
33
- disabled,
34
- name,
35
- native,
36
- accentColor
37
- },
38
- frameAttrs: {
39
- role: "radiogroup",
40
- "aria-orientation": orientation,
41
- "data-disabled": disabled ? "" : void 0
42
- },
43
- rovingFocusGroupAttrs: {
44
- orientation,
45
- loop: !0
46
- }
47
- };
48
- }
49
- const ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], useRadioGroupItem = (params) => {
50
- const {
51
- radioGroupContext,
52
- value,
53
- labelledBy: ariaLabelledby,
54
- disabled: itemDisabled,
55
- ref: refProp,
56
- id,
57
- onPress,
58
- onKeyDown,
59
- onFocus
60
- } = params, {
61
- value: groupValue,
62
- disabled,
63
- required,
64
- onChange,
65
- name,
66
- native,
67
- accentColor
68
- } = useContext(radioGroupContext), [button, setButton] = useState(null), hasConsumerStoppedPropagationRef = useRef(!1), ref = useRef(null), composedRefs = useComposedRefs(refProp, (node) => setButton(node), ref), isArrowKeyPressedRef = useRef(!1), isFormControl = isWeb ? button ? !!button.closest("form") : !0 : !1, checked = groupValue === value, labelId = useLabelContext(button), labelledBy = ariaLabelledby || labelId;
69
- useEffect(() => {
70
- if (isWeb) {
71
- const handleKeyDown = (event) => {
72
- ARROW_KEYS.includes(event.key) && (isArrowKeyPressedRef.current = !0);
73
- }, handleKeyUp = () => {
74
- isArrowKeyPressedRef.current = !1;
75
- };
76
- return document.addEventListener("keydown", handleKeyDown), document.addEventListener("keyup", handleKeyUp), () => {
77
- document.removeEventListener("keydown", handleKeyDown), document.removeEventListener("keyup", handleKeyUp);
78
- };
79
- }
80
- }, []);
81
- const isDisabled = disabled || itemDisabled;
82
- return {
83
- providerValue: {
84
- checked
85
- },
86
- checked,
87
- isFormControl,
88
- bubbleInput: /* @__PURE__ */ jsx(
89
- BubbleInput,
90
- {
91
- isHidden: !native,
92
- control: button,
93
- bubbles: !hasConsumerStoppedPropagationRef.current,
94
- name,
95
- value,
96
- checked,
97
- required,
98
- disabled: isDisabled,
99
- ...isWeb && native && {
100
- accentColor,
101
- id
102
- }
103
- }
104
- ),
105
- native,
106
- frameAttrs: {
107
- "data-state": getState(checked),
108
- "data-disabled": isDisabled ? "" : void 0,
109
- role: "radio",
110
- "aria-labelledby": labelledBy,
111
- "aria-checked": checked,
112
- "aria-required": required,
113
- disabled: isDisabled,
114
- ref: composedRefs,
115
- ...isWeb && {
116
- type: "button",
117
- value
118
- },
119
- id,
120
- onPress: composeEventHandlers(onPress, (event) => {
121
- checked || onChange?.(value), isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
122
- }),
123
- ...isWeb && {
124
- onKeyDown: composeEventHandlers(onKeyDown, (event) => {
125
- (event.key === "Enter" || event.key === " ") && (checked || onChange?.(value));
126
- }),
127
- onFocus: composeEventHandlers(onFocus, () => {
128
- isArrowKeyPressedRef.current && ref.current?.click();
129
- })
130
- }
131
- },
132
- rovingFocusGroupAttrs: {
133
- asChild: "except-style",
134
- focusable: !isDisabled,
135
- active: checked
136
- }
137
- };
138
- };
139
- function useRadioGroupItemIndicator(params) {
140
- const { radioGroupItemContext, disabled, ...rest } = params, { checked } = useContext(radioGroupItemContext);
141
- return {
142
- checked,
143
- "data-state": getState(checked),
144
- "data-disabled": disabled ? "" : void 0,
145
- ...rest
146
- };
147
- }
148
- export {
149
- useRadioGroup,
150
- useRadioGroupItem,
151
- useRadioGroupItemIndicator
152
- };
153
- //# sourceMappingURL=useRadioGroup.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/useRadioGroup.tsx"],
4
- "mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,OAAkC;AAClC,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,4BAA4B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,WAAS,MAAM,gBAAgB;AAAA,MAEzE,CAAC;AAAA,MACD,GAAI,SAAS;AAAA,QACX,WAAW,qBAAqB,WAAW,CAAC,UAAU;AAEpD,WAAI,MAAM,QAAQ,WAAW,MAAM,QAAQ,SACpC,WACH,WAAW,KAAK;AAAA,QAGtB,CAAC;AAAA,QACD,SAAS,qBAAqB,SAAS,MAAM;AAM3C,UAAI,qBAAqB,WACrB,IAAI,SAA+B,MAAM;AAAA,QAE/C,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,uBAAuB;AAAA,MACrB,SAAS;AAAA,MACT,WAAW,CAAC;AAAA,MACZ,QAAQ;AAAA,IACV;AAAA,EACF;AACF;AAWO,SAAS,2BAA2B,QAA0C;AACnF,QAAM,EAAE,uBAAuB,UAAU,GAAG,KAAK,IAAI,QAC/C,EAAE,QAAQ,IAAI,WAAW,qBAAqB;AAEpD,SAAO;AAAA,IACL;AAAA,IACA,cAAc,SAAS,OAAO;AAAA,IAC9B,iBAAiB,WAAW,KAAK;AAAA,IACjC,GAAG;AAAA,EACL;AACF;",
5
- "names": []
6
- }
package/dist/jsx/utils.js DELETED
@@ -1,7 +0,0 @@
1
- function getState(checked) {
2
- return checked ? "checked" : "unchecked";
3
- }
4
- export {
5
- getState
6
- };
7
- //# sourceMappingURL=utils.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/utils.tsx"],
4
- "mappings": "AAAO,SAAS,SAAS,SAAkB;AACzC,SAAO,UAAU,YAAY;AAC/B;",
5
- "names": []
6
- }