@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,30 +1,29 @@
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 useRadioGroup_exports = {};
24
23
  __export(useRadioGroup_exports, {
25
- useRadioGroup: () => useRadioGroup,
26
- useRadioGroupItem: () => useRadioGroupItem,
27
- useRadioGroupItemIndicator: () => useRadioGroupItemIndicator
24
+ useRadioGroup: () => useRadioGroup,
25
+ useRadioGroupItem: () => useRadioGroupItem,
26
+ useRadioGroupItemIndicator: () => useRadioGroupItemIndicator
28
27
  });
29
28
  module.exports = __toCommonJS(useRadioGroup_exports);
30
29
  var import_compose_refs = require("@tamagui/compose-refs");
@@ -38,165 +37,133 @@ var import_BubbleInput = require("./BubbleInput.cjs");
38
37
  var import_utils = require("./utils.cjs");
39
38
  var import_jsx_runtime = require("react/jsx-runtime");
40
39
  function useRadioGroup(params) {
41
- const {
42
- value: valueProp,
43
- onValueChange,
44
- defaultValue,
45
- required,
46
- disabled,
47
- name,
48
- native,
49
- accentColor,
50
- orientation,
51
- ref
52
- } = params;
53
- const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
54
- prop: valueProp,
55
- defaultProp: defaultValue,
56
- onChange: onValueChange
57
- });
58
- return {
59
- providerValue: {
60
- value,
61
- onChange: setValue,
62
- required,
63
- disabled,
64
- name,
65
- native,
66
- accentColor
67
- },
68
- frameAttrs: {
69
- role: "radiogroup",
70
- "aria-orientation": orientation,
71
- "data-disabled": disabled ? "" : void 0
72
- },
73
- rovingFocusGroupAttrs: {
74
- orientation,
75
- loop: true
76
- }
77
- };
40
+ const { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params;
41
+ const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
42
+ prop: valueProp,
43
+ defaultProp: defaultValue,
44
+ onChange: onValueChange
45
+ });
46
+ return {
47
+ providerValue: {
48
+ value,
49
+ onChange: setValue,
50
+ required,
51
+ disabled,
52
+ name,
53
+ native,
54
+ accentColor
55
+ },
56
+ frameAttrs: {
57
+ role: "radiogroup",
58
+ "aria-orientation": orientation,
59
+ "data-disabled": disabled ? "" : void 0
60
+ },
61
+ rovingFocusGroupAttrs: {
62
+ orientation,
63
+ loop: true
64
+ }
65
+ };
78
66
  }
79
- const ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
80
- const useRadioGroupItem = params => {
81
- const {
82
- radioGroupContext,
83
- value,
84
- labelledBy: ariaLabelledby,
85
- disabled: itemDisabled,
86
- ref: refProp,
87
- id,
88
- onPress,
89
- onKeyDown,
90
- onFocus
91
- } = params;
92
- const {
93
- value: groupValue,
94
- disabled,
95
- required,
96
- onChange,
97
- name,
98
- native,
99
- accentColor
100
- } = (0, import_react.useContext)(radioGroupContext);
101
- const [button, setButton] = (0, import_react.useState)(null);
102
- const hasConsumerStoppedPropagationRef = (0, import_react.useRef)(false);
103
- const ref = (0, import_react.useRef)(null);
104
- const composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, node => setButton(node), ref);
105
- const isArrowKeyPressedRef = (0, import_react.useRef)(false);
106
- const isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
107
- const checked = groupValue === value;
108
- const labelId = (0, import_label.useLabelContext)(button);
109
- const labelledBy = ariaLabelledby || labelId;
110
- (0, import_react.useEffect)(() => {
111
- if (import_constants.isWeb) {
112
- const handleKeyDown = event => {
113
- if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
114
- };
115
- const handleKeyUp = () => {
116
- isArrowKeyPressedRef.current = false;
117
- };
118
- document.addEventListener("keydown", handleKeyDown);
119
- document.addEventListener("keyup", handleKeyUp);
120
- return () => {
121
- document.removeEventListener("keydown", handleKeyDown);
122
- document.removeEventListener("keyup", handleKeyUp);
123
- };
124
- }
125
- }, []);
126
- const isDisabled = disabled || itemDisabled;
127
- return {
128
- providerValue: {
129
- checked
130
- },
131
- checked,
132
- isFormControl,
133
- bubbleInput: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
134
- isHidden: !native,
135
- control: button,
136
- bubbles: !hasConsumerStoppedPropagationRef.current,
137
- name,
138
- value,
139
- checked,
140
- required,
141
- disabled: isDisabled,
142
- ...(import_constants.isWeb && native && {
143
- accentColor,
144
- id
145
- })
146
- }),
147
- native,
148
- frameAttrs: {
149
- "data-state": (0, import_utils.getState)(checked),
150
- "data-disabled": isDisabled ? "" : void 0,
151
- role: "radio",
152
- "aria-labelledby": labelledBy,
153
- "aria-checked": checked,
154
- "aria-required": required,
155
- disabled: isDisabled,
156
- ref: composedRefs,
157
- ...(import_constants.isWeb && {
158
- type: "button",
159
- value
160
- }),
161
- id,
162
- onPress: (0, import_helpers.composeEventHandlers)(onPress, event => {
163
- if (!checked) onChange?.(value);
164
- if (isFormControl) {
165
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
166
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
167
- }
168
- }),
169
- ...(import_constants.isWeb && {
170
- onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, event => {
171
- if (event.key === "Enter" || event.key === " ") {
172
- if (!checked) onChange?.(value);
173
- }
174
- }),
175
- onFocus: (0, import_helpers.composeEventHandlers)(onFocus, () => {
176
- if (isArrowKeyPressedRef.current) ref.current?.click();
177
- })
178
- })
179
- },
180
- rovingFocusGroupAttrs: {
181
- asChild: "except-style",
182
- focusable: !isDisabled,
183
- active: checked
184
- }
185
- };
67
+ const ARROW_KEYS = [
68
+ "ArrowUp",
69
+ "ArrowDown",
70
+ "ArrowLeft",
71
+ "ArrowRight"
72
+ ];
73
+ const useRadioGroupItem = (params) => {
74
+ const { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params;
75
+ const { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react.useContext)(radioGroupContext);
76
+ const [button, setButton] = (0, import_react.useState)(null);
77
+ const hasConsumerStoppedPropagationRef = (0, import_react.useRef)(false);
78
+ const ref = (0, import_react.useRef)(null);
79
+ const composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, (node) => setButton(node), ref);
80
+ const isArrowKeyPressedRef = (0, import_react.useRef)(false);
81
+ const isFormControl = import_constants.isWeb ? button ? Boolean(button.closest("form")) : true : false;
82
+ const checked = groupValue === value;
83
+ const labelId = (0, import_label.useLabelContext)(button);
84
+ const labelledBy = ariaLabelledby || labelId;
85
+ (0, import_react.useEffect)(() => {
86
+ if (import_constants.isWeb) {
87
+ const handleKeyDown = (event) => {
88
+ if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
89
+ };
90
+ const handleKeyUp = () => {
91
+ isArrowKeyPressedRef.current = false;
92
+ };
93
+ document.addEventListener("keydown", handleKeyDown);
94
+ document.addEventListener("keyup", handleKeyUp);
95
+ return () => {
96
+ document.removeEventListener("keydown", handleKeyDown);
97
+ document.removeEventListener("keyup", handleKeyUp);
98
+ };
99
+ }
100
+ }, []);
101
+ const isDisabled = disabled || itemDisabled;
102
+ return {
103
+ providerValue: { checked },
104
+ checked,
105
+ isFormControl,
106
+ bubbleInput: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BubbleInput.BubbleInput, {
107
+ isHidden: !native,
108
+ control: button,
109
+ bubbles: !hasConsumerStoppedPropagationRef.current,
110
+ name,
111
+ value,
112
+ checked,
113
+ required,
114
+ disabled: isDisabled,
115
+ ...import_constants.isWeb && native && {
116
+ accentColor,
117
+ id
118
+ }
119
+ }),
120
+ native,
121
+ frameAttrs: {
122
+ "data-state": (0, import_utils.getState)(checked),
123
+ "data-disabled": isDisabled ? "" : void 0,
124
+ role: "radio",
125
+ "aria-labelledby": labelledBy,
126
+ "aria-checked": checked,
127
+ "aria-required": required,
128
+ disabled: isDisabled,
129
+ ref: composedRefs,
130
+ ...import_constants.isWeb && {
131
+ type: "button",
132
+ value
133
+ },
134
+ id,
135
+ onPress: (0, import_helpers.composeEventHandlers)(onPress, (event) => {
136
+ if (!checked) onChange?.(value);
137
+ if (isFormControl) {
138
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
139
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
140
+ }
141
+ }),
142
+ ...import_constants.isWeb && {
143
+ onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, (event) => {
144
+ if (event.key === "Enter" || event.key === " ") {
145
+ if (!checked) onChange?.(value);
146
+ }
147
+ }),
148
+ onFocus: (0, import_helpers.composeEventHandlers)(onFocus, () => {
149
+ if (isArrowKeyPressedRef.current) ref.current?.click();
150
+ })
151
+ }
152
+ },
153
+ rovingFocusGroupAttrs: {
154
+ asChild: "except-style",
155
+ tabIndex: isDisabled ? -1 : 0,
156
+ active: checked
157
+ }
158
+ };
186
159
  };
187
160
  function useRadioGroupItemIndicator(params) {
188
- const {
189
- radioGroupItemContext,
190
- disabled,
191
- ...rest
192
- } = params;
193
- const {
194
- checked
195
- } = (0, import_react.useContext)(radioGroupItemContext);
196
- return {
197
- checked,
198
- "data-state": (0, import_utils.getState)(checked),
199
- "data-disabled": disabled ? "" : void 0,
200
- ...rest
201
- };
202
- }
161
+ const { radioGroupItemContext, disabled, ...rest } = params;
162
+ const { checked } = (0, import_react.useContext)(radioGroupItemContext);
163
+ return {
164
+ checked,
165
+ "data-state": (0, import_utils.getState)(checked),
166
+ "data-disabled": disabled ? "" : void 0,
167
+ ...rest
168
+ };
169
+ }
@@ -0,0 +1,190 @@
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 useRadioGroup_exports = {};
25
+ __export(useRadioGroup_exports, {
26
+ useRadioGroup: () => useRadioGroup,
27
+ useRadioGroupItem: () => useRadioGroupItem,
28
+ useRadioGroupItemIndicator: () => useRadioGroupItemIndicator
29
+ });
30
+ module.exports = __toCommonJS(useRadioGroup_exports);
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ var import_compose_refs = require("@tamagui/compose-refs");
33
+ var import_constants = require("@tamagui/constants");
34
+ var import_focusable = require("@tamagui/focusable");
35
+ var import_helpers = require("@tamagui/helpers");
36
+ var import_label = require("@tamagui/label");
37
+ var import_use_controllable_state = require("@tamagui/use-controllable-state");
38
+ var import_react = require("react");
39
+ var import_BubbleInput = require("./BubbleInput.native.js");
40
+ var import_utils = require("./utils.native.js");
41
+ function useRadioGroup(params) {
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
+ };
68
+ }
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
+ };
180
+ };
181
+ function useRadioGroupItemIndicator(params) {
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
+ };
190
+ }