@tamagui/radio-headless 2.7.7 → 3.0.0-beta.643.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cjs/BubbleInput.cjs +57 -71
  2. package/dist/cjs/BubbleInput.native.cjs +75 -0
  3. package/dist/cjs/BubbleInput.native.js +57 -70
  4. package/dist/cjs/BubbleInput.native.js.map +1 -1
  5. package/dist/cjs/index.cjs +10 -11
  6. package/dist/cjs/index.native.cjs +22 -0
  7. package/dist/cjs/index.native.js +10 -10
  8. package/dist/cjs/index.native.js.map +1 -1
  9. package/dist/cjs/useRadioGroup.cjs +143 -176
  10. package/dist/cjs/useRadioGroup.native.cjs +190 -0
  11. package/dist/cjs/useRadioGroup.native.js +162 -190
  12. package/dist/cjs/useRadioGroup.native.js.map +1 -1
  13. package/dist/cjs/utils.cjs +16 -19
  14. package/dist/cjs/utils.native.cjs +29 -0
  15. package/dist/cjs/utils.native.js +16 -18
  16. package/dist/cjs/utils.native.js.map +1 -1
  17. package/dist/esm/BubbleInput.mjs +41 -45
  18. package/dist/esm/BubbleInput.mjs.map +1 -1
  19. package/dist/esm/BubbleInput.native.js +42 -46
  20. package/dist/esm/BubbleInput.native.js.map +1 -1
  21. package/dist/esm/index.js +3 -3
  22. package/dist/esm/index.mjs +3 -3
  23. package/dist/esm/index.native.js +3 -3
  24. package/dist/esm/useRadioGroup.mjs +128 -158
  25. package/dist/esm/useRadioGroup.mjs.map +1 -1
  26. package/dist/esm/useRadioGroup.native.js +147 -173
  27. package/dist/esm/useRadioGroup.native.js.map +1 -1
  28. package/dist/esm/utils.mjs +2 -1
  29. package/dist/esm/utils.mjs.map +1 -1
  30. package/dist/esm/utils.native.js +2 -1
  31. package/dist/esm/utils.native.js.map +1 -1
  32. package/dist/jsx/BubbleInput.mjs +41 -45
  33. package/dist/jsx/BubbleInput.mjs.map +1 -1
  34. package/dist/jsx/BubbleInput.native.cjs +75 -0
  35. package/dist/jsx/BubbleInput.native.js +57 -70
  36. package/dist/jsx/BubbleInput.native.js.map +1 -1
  37. package/dist/jsx/index.js +3 -3
  38. package/dist/jsx/index.mjs +3 -3
  39. package/dist/jsx/index.native.cjs +22 -0
  40. package/dist/jsx/index.native.js +10 -10
  41. package/dist/jsx/index.native.js.map +1 -1
  42. package/dist/jsx/useRadioGroup.mjs +128 -158
  43. package/dist/jsx/useRadioGroup.mjs.map +1 -1
  44. package/dist/jsx/useRadioGroup.native.cjs +190 -0
  45. package/dist/jsx/useRadioGroup.native.js +162 -190
  46. package/dist/jsx/useRadioGroup.native.js.map +1 -1
  47. package/dist/jsx/utils.mjs +2 -1
  48. package/dist/jsx/utils.mjs.map +1 -1
  49. package/dist/jsx/utils.native.cjs +29 -0
  50. package/dist/jsx/utils.native.js +16 -18
  51. package/dist/jsx/utils.native.js.map +1 -1
  52. package/package.json +12 -12
  53. package/src/useRadioGroup.tsx +1 -1
  54. package/types/BubbleInput.d.ts +1 -1
  55. package/types/BubbleInput.d.ts.map +1 -1
  56. package/types/useRadioGroup.d.ts +10 -10
  57. package/types/useRadioGroup.d.ts.map +1 -1
  58. package/dist/esm/index.js.map +0 -1
  59. package/dist/esm/index.mjs.map +0 -1
  60. package/dist/esm/index.native.js.map +0 -1
  61. package/dist/jsx/index.js.map +0 -1
  62. package/dist/jsx/index.mjs.map +0 -1
@@ -1,32 +1,31 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var useRadioGroup_exports = {};
26
25
  __export(useRadioGroup_exports, {
27
- useRadioGroup: () => useRadioGroup,
28
- useRadioGroupItem: () => useRadioGroupItem,
29
- useRadioGroupItemIndicator: () => useRadioGroupItemIndicator
26
+ useRadioGroup: () => useRadioGroup,
27
+ useRadioGroupItem: () => useRadioGroupItem,
28
+ useRadioGroupItemIndicator: () => useRadioGroupItemIndicator
30
29
  });
31
30
  module.exports = __toCommonJS(useRadioGroup_exports);
32
31
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -40,181 +39,154 @@ var import_react = require("react");
40
39
  var import_BubbleInput = require("./BubbleInput.native.js");
41
40
  var import_utils = require("./utils.native.js");
42
41
  function useRadioGroup(params) {
43
- var {
44
- value: valueProp,
45
- onValueChange,
46
- defaultValue,
47
- required,
48
- disabled,
49
- name,
50
- native,
51
- accentColor,
52
- orientation,
53
- ref
54
- } = params;
55
- var [value, setValue] = (0, import_use_controllable_state.useControllableState)({
56
- prop: valueProp,
57
- defaultProp: defaultValue,
58
- onChange: onValueChange
59
- });
60
- return {
61
- providerValue: {
62
- value,
63
- onChange: setValue,
64
- required,
65
- disabled,
66
- name,
67
- native,
68
- accentColor
69
- },
70
- frameAttrs: {
71
- role: "radiogroup",
72
- "aria-orientation": orientation,
73
- "data-disabled": disabled ? "" : void 0
74
- },
75
- rovingFocusGroupAttrs: {
76
- orientation,
77
- loop: true
78
- }
79
- };
42
+ var { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params;
43
+ var [value, setValue] = (0, import_use_controllable_state.useControllableState)({
44
+ prop: valueProp,
45
+ defaultProp: defaultValue,
46
+ onChange: onValueChange
47
+ });
48
+ return {
49
+ providerValue: {
50
+ value,
51
+ onChange: setValue,
52
+ required,
53
+ disabled,
54
+ name,
55
+ native,
56
+ accentColor
57
+ },
58
+ frameAttrs: {
59
+ role: "radiogroup",
60
+ "aria-orientation": orientation,
61
+ "data-disabled": disabled ? "" : void 0
62
+ },
63
+ rovingFocusGroupAttrs: {
64
+ orientation,
65
+ loop: true
66
+ }
67
+ };
80
68
  }
81
- var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
82
- var useRadioGroupItem = function (params) {
83
- var {
84
- radioGroupContext,
85
- value,
86
- labelledBy: ariaLabelledby,
87
- disabled: itemDisabled,
88
- ref: refProp,
89
- id,
90
- onPress,
91
- onKeyDown,
92
- onFocus
93
- } = params;
94
- var {
95
- value: groupValue,
96
- disabled,
97
- required,
98
- onChange,
99
- name,
100
- native,
101
- accentColor
102
- } = (0, import_react.useContext)(radioGroupContext);
103
- var [button, setButton] = (0, import_react.useState)(null);
104
- var hasConsumerStoppedPropagationRef = (0, import_react.useRef)(false);
105
- var ref = (0, import_react.useRef)(null);
106
- var composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, function (node) {
107
- return setButton(node);
108
- }, ref);
109
- var isArrowKeyPressedRef = (0, import_react.useRef)(false);
110
- var isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
111
- var checked = groupValue === value;
112
- var labelId = (0, import_label.useLabelContext)(button);
113
- var labelledBy = ariaLabelledby || labelId;
114
- (0, import_react.useEffect)(function () {
115
- if (import_constants.isWeb) {
116
- var handleKeyDown = function (event) {
117
- if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
118
- };
119
- var handleKeyUp = function () {
120
- isArrowKeyPressedRef.current = false;
121
- };
122
- document.addEventListener("keydown", handleKeyDown);
123
- document.addEventListener("keyup", handleKeyUp);
124
- return function () {
125
- document.removeEventListener("keydown", handleKeyDown);
126
- document.removeEventListener("keyup", handleKeyUp);
127
- };
128
- }
129
- }, []);
130
- (0, import_react.useEffect)(function () {
131
- if (!id) return;
132
- if (disabled) return;
133
- return (0, import_focusable.registerFocusable)(id, {
134
- focusAndSelect: function () {
135
- onChange === null || onChange === void 0 || onChange(value);
136
- },
137
- focus: function () {}
138
- });
139
- }, [id, value, disabled]);
140
- var isDisabled = disabled || itemDisabled;
141
- return {
142
- providerValue: {
143
- checked
144
- },
145
- checked,
146
- isFormControl,
147
- bubbleInput: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
148
- isHidden: !native,
149
- control: button,
150
- bubbles: !hasConsumerStoppedPropagationRef.current,
151
- name,
152
- value,
153
- checked,
154
- required,
155
- disabled: isDisabled,
156
- ...(import_constants.isWeb && native && {
157
- accentColor,
158
- id
159
- })
160
- }),
161
- native,
162
- frameAttrs: {
163
- "data-state": (0, import_utils.getState)(checked),
164
- "data-disabled": isDisabled ? "" : void 0,
165
- role: "radio",
166
- "aria-labelledby": labelledBy,
167
- "aria-checked": checked,
168
- "aria-required": required,
169
- disabled: isDisabled,
170
- ref: composedRefs,
171
- ...(import_constants.isWeb && {
172
- type: "button",
173
- value
174
- }),
175
- id,
176
- onPress: (0, import_helpers.composeEventHandlers)(onPress, function (event) {
177
- if (!checked) onChange === null || onChange === void 0 || onChange(value);
178
- if (isFormControl) {
179
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
180
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
181
- }
182
- }),
183
- ...(import_constants.isWeb && {
184
- onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, function (event) {
185
- if (event.key === "Enter" || event.key === " ") {
186
- if (!checked) onChange === null || onChange === void 0 || onChange(value);
187
- }
188
- }),
189
- onFocus: (0, import_helpers.composeEventHandlers)(onFocus, function () {
190
- if (isArrowKeyPressedRef.current) {
191
- var _ref_current;
192
- (_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();
193
- }
194
- })
195
- })
196
- },
197
- rovingFocusGroupAttrs: {
198
- asChild: "except-style",
199
- focusable: !isDisabled,
200
- active: checked
201
- }
202
- };
69
+ var ARROW_KEYS = [
70
+ "ArrowUp",
71
+ "ArrowDown",
72
+ "ArrowLeft",
73
+ "ArrowRight"
74
+ ];
75
+ var useRadioGroupItem = function(params) {
76
+ var { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;
77
+ var { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);
78
+ var [button, setButton] = (0, import_react.useState)(null);
79
+ var hasConsumerStoppedPropagationRef = (0, import_react.useRef)(false);
80
+ var ref = (0, import_react.useRef)(null);
81
+ var composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, function(node) {
82
+ return setButton(node);
83
+ }, ref);
84
+ var isArrowKeyPressedRef = (0, import_react.useRef)(false);
85
+ var isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
86
+ var checked = groupValue === value;
87
+ var labelId = (0, import_label.useLabelContext)(button);
88
+ var labelledBy = ariaLabelledby || labelId;
89
+ (0, import_react.useEffect)(function() {
90
+ if (import_constants.isWeb) {
91
+ var handleKeyDown = function(event) {
92
+ if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
93
+ };
94
+ var handleKeyUp = function() {
95
+ isArrowKeyPressedRef.current = false;
96
+ };
97
+ document.addEventListener("keydown", handleKeyDown);
98
+ document.addEventListener("keyup", handleKeyUp);
99
+ return function() {
100
+ document.removeEventListener("keydown", handleKeyDown);
101
+ document.removeEventListener("keyup", handleKeyUp);
102
+ };
103
+ }
104
+ }, []);
105
+ (0, import_react.useEffect)(function() {
106
+ if (!id) return;
107
+ if (disabled) return;
108
+ return (0, import_focusable.registerFocusable)(id, {
109
+ focusAndSelect: function() {
110
+ onChange === null || onChange === void 0 || onChange(value);
111
+ },
112
+ focus: function() {}
113
+ });
114
+ }, [
115
+ id,
116
+ value,
117
+ disabled
118
+ ]);
119
+ var isDisabled = disabled || itemDisabled;
120
+ return {
121
+ providerValue: { checked },
122
+ checked,
123
+ isFormControl,
124
+ bubbleInput: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
125
+ isHidden: !native,
126
+ control: button,
127
+ bubbles: !hasConsumerStoppedPropagationRef.current,
128
+ name,
129
+ value,
130
+ checked,
131
+ required,
132
+ disabled: isDisabled,
133
+ ...import_constants.isWeb && native && {
134
+ accentColor,
135
+ id
136
+ }
137
+ }),
138
+ native,
139
+ frameAttrs: {
140
+ "data-state": (0, import_utils.getState)(checked),
141
+ "data-disabled": isDisabled ? "" : void 0,
142
+ role: "radio",
143
+ "aria-labelledby": labelledBy,
144
+ "aria-checked": checked,
145
+ "aria-required": required,
146
+ disabled: isDisabled,
147
+ ref: composedRefs,
148
+ ...import_constants.isWeb && {
149
+ type: "button",
150
+ value
151
+ },
152
+ id,
153
+ onPress: (0, import_helpers.composeEventHandlers)(onPress, function(event) {
154
+ if (!checked) onChange === null || onChange === void 0 || onChange(value);
155
+ if (isFormControl) {
156
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
157
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
158
+ }
159
+ }),
160
+ ...import_constants.isWeb && {
161
+ onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, function(event) {
162
+ if (event.key === "Enter" || event.key === " ") {
163
+ if (!checked) onChange === null || onChange === void 0 || onChange(value);
164
+ }
165
+ }),
166
+ onFocus: (0, import_helpers.composeEventHandlers)(onFocus, function() {
167
+ if (isArrowKeyPressedRef.current) {
168
+ var _ref_current;
169
+ (_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.click();
170
+ }
171
+ })
172
+ }
173
+ },
174
+ rovingFocusGroupAttrs: {
175
+ asChild: "except-style",
176
+ tabIndex: isDisabled ? -1 : 0,
177
+ active: checked
178
+ }
179
+ };
203
180
  };
204
181
  function useRadioGroupItemIndicator(params) {
205
- var {
206
- radioGroupItemContext,
207
- disabled,
208
- ...rest
209
- } = params;
210
- var {
211
- checked
212
- } = (0, import_react.useContext)(radioGroupItemContext);
213
- return {
214
- checked,
215
- "data-state": (0, import_utils.getState)(checked),
216
- "data-disabled": disabled ? "" : void 0,
217
- ...rest
218
- };
182
+ var { radioGroupItemContext, disabled, ...rest } = params;
183
+ var { checked } = (0, import_react.useContext)(radioGroupItemContext);
184
+ return {
185
+ checked,
186
+ "data-state": (0, import_utils.getState)(checked),
187
+ "data-disabled": disabled ? "" : void 0,
188
+ ...rest
189
+ };
219
190
  }
191
+
220
192
  //# sourceMappingURL=useRadioGroup.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["to","__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","Boolean","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":";;;;;;;;;;;;;;;;;;EAAA;EAAA,OAAAA,EAAA;AAAA;AAAA,IAAAC,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,KAAgCA,iBAAA;EAChCC,0BAAsB,EAAAA,CAAA,KAAAA;AACtB;AACAC,MAAA,CAAAC,OAAA,GAAAX,YAAqC,CAAAK,qBAAA;AACrC,IAAAO,kBAAgC,GAAAC,OAAA;AAChC,IAAAC,mBAAA,GAAAD,OAAA,wBAAqC;AAGrC,IAAAE,gBAAwD,GAAAF,OAAA;AAExD,IAAAG,gBAAA,GAAAH,OAA4B;AAC5B,IAAAI,cAAA,GAAyBJ,OAAA;AA4JnB,IAAAK,YAAA,GAAAL,OAAA;AA9IC,IAAAM,6BAAoD,GAAAN,OAAA;AACzD,IAAAO,YAAM,GAAAP,OAAA;AAAA,IACJQ,kBAAO,GAAAR,OAAA;AAAA,IACPS,YAAA,GAAAT,OAAA;AAAA,SACAN,cAAAgB,MAAA;EAAA,IACA;IAAAnB,KAAA,EAAAoB,SAAA;IAAAC,aAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,QAAA;IAAAC,IAAA;IAAAC,MAAA;IAAAC,WAAA;IAAAC,WAAA;IAAAC;EAAA,IAAAV,MAAA;EAAA,IACA,CAAAnB,KAAA,EAAA8B,QAAA,QAAAf,6BAAA,CAAAgB,oBAAA;IAAAC,IACA,EAAAZ,SAAA;IAAA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AAA,YAAA,CAAAC,KAAA;UAAA;QACP;MACL;IACQ;IACLxD,qBACN;MAAAyD,OACF;MAAAC,SACA,GAAAf,UAAA;MAAAgB,MACA,EAAAhC;IACE;EACE;AAAgB;AAGlB,SAAA5D,0BAAmBA,CAAAc,MAAA;EACjB;IAAA+E,qBAAA;IAAA1E,QAAA;IAAA,GAAiC2E;EAAA,IAAAhF,MAAU;EAI3C;IAAA8C;EAAK,QAAAjD,YAAA,CAAAmC,UAAA,EAAiC+C,qBAAe;EAAgB,OACvE;IAAAjC,OACD;IAAA,YACG,MAAA/C,YAAA,CAAAsE,QAAS,EAAAvB,OAAA;IAAA,eACX,EAAAzC,QAAW;IAET,GAAA2E;EACE;AACE","ignoreList":[]}
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)(onKeyDown, function(event) {\n\t\t\t\t\tif (event.key === \"Enter\" || event.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)(onFocus, 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.get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AAqB;KACtE,IAAI,CAAC,iCAAiC,SAAS,MAAM,gBAAgB;IACtE;GACD,CAAC;GACD,GAAG,iBAAiB,SAAS;IAC5B,YAAY,GAAG,eAAe,sBAAsB,WAAW,SAAS,OAAO;KAC9E,IAAI,MAAM,QAAQ,WAAW,MAAM,QAAQ,KAAK;MAC/C,IAAI,CAAC,SAAS,aAAa,QAAQ,aAAa,KAAK,KAAK,SAAS,KAAK;KACzE;IACD,CAAC;IACD,UAAU,GAAG,eAAe,sBAAsB,SAAS,WAAW;KACrE,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,YAAY,qBAAqB;CACpE,OAAO;EACN;EACA,eAAe,GAAG,aAAa,UAAU,OAAO;EAChD,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;CACJ;AACD"}
@@ -1,30 +1,27 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
10
11
  };
11
12
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
19
20
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
22
  var utils_exports = {};
24
- __export(utils_exports, {
25
- getState: () => getState
26
- });
23
+ __export(utils_exports, { getState: () => getState });
27
24
  module.exports = __toCommonJS(utils_exports);
28
25
  function getState(checked) {
29
- return checked ? "checked" : "unchecked";
30
- }
26
+ return checked ? "checked" : "unchecked";
27
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var utils_exports = {};
25
+ __export(utils_exports, { getState: () => getState });
26
+ module.exports = __toCommonJS(utils_exports);
27
+ function getState(checked) {
28
+ return checked ? "checked" : "unchecked";
29
+ }
@@ -1,33 +1,31 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var utils_exports = {};
26
- __export(utils_exports, {
27
- getState: () => getState
28
- });
25
+ __export(utils_exports, { getState: () => getState });
29
26
  module.exports = __toCommonJS(utils_exports);
30
27
  function getState(checked) {
31
- return checked ? "checked" : "unchecked";
28
+ return checked ? "checked" : "unchecked";
32
29
  }
30
+
33
31
  //# sourceMappingURL=utils.native.js.map
@@ -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,"file":"utils.native.js","names":[],"sources":["cjs/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: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar 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":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe,EACtB,gBAAgB,SAClB,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,SAAS,SAAS,SAAS;CACzB,OAAO,UAAU,YAAY;AAC/B"}