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