pdyform 2.0.2 → 2.2.0

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 (215) hide show
  1. package/README.md +98 -74
  2. package/package.json +9 -3
  3. package/packages/core/dist/chunk-6F4PWJZI.js +0 -0
  4. package/packages/core/dist/chunk-KA6QUMVR.js +158 -0
  5. package/packages/core/dist/chunk-REHKL5VH.js +76 -0
  6. package/packages/core/dist/formState.cjs +132 -78
  7. package/packages/core/dist/formState.d.cts +14 -10
  8. package/packages/core/dist/formState.d.ts +14 -10
  9. package/packages/core/dist/formState.js +4 -12
  10. package/packages/core/dist/index.cjs +138 -78
  11. package/packages/core/dist/index.d.cts +4 -3
  12. package/packages/core/dist/index.d.ts +4 -3
  13. package/packages/core/dist/index.js +11 -12
  14. package/packages/core/dist/types.d.cts +17 -5
  15. package/packages/core/dist/types.d.ts +17 -5
  16. package/packages/core/dist/types.js +1 -0
  17. package/packages/core/dist/utils.cjs +78 -19
  18. package/packages/core/dist/utils.d.cts +17 -5
  19. package/packages/core/dist/utils.d.ts +17 -5
  20. package/packages/core/dist/utils.js +7 -1
  21. package/packages/react/dist/index.cjs +1 -461
  22. package/packages/react/dist/index.d.cts +33 -2
  23. package/packages/react/dist/index.d.ts +33 -2
  24. package/packages/react/dist/index.js +1 -411
  25. package/packages/vue/dist/index.d.ts +51 -39
  26. package/packages/vue/dist/index.js +1 -28
  27. package/packages/vue/dist/index.mjs +630 -6527
  28. package/eslint.config.mjs +0 -53
  29. package/example/README.md +0 -36
  30. package/example/react-demo/index.html +0 -12
  31. package/example/react-demo/node_modules/.bin/browserslist +0 -17
  32. package/example/react-demo/node_modules/.bin/tsc +0 -17
  33. package/example/react-demo/node_modules/.bin/tsserver +0 -17
  34. package/example/react-demo/node_modules/.bin/vite +0 -17
  35. package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-checkbox.js +0 -300
  36. package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-checkbox.js.map +0 -7
  37. package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-label.js +0 -194
  38. package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-label.js.map +0 -7
  39. package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-radio-group.js +0 -530
  40. package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-radio-group.js.map +0 -7
  41. package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-select.js +0 -4808
  42. package/example/react-demo/node_modules/.vite/deps/@radix-ui_react-select.js.map +0 -7
  43. package/example/react-demo/node_modules/.vite/deps/_metadata.json +0 -115
  44. package/example/react-demo/node_modules/.vite/deps/chunk-3D5PZ6F6.js +0 -49
  45. package/example/react-demo/node_modules/.vite/deps/chunk-3D5PZ6F6.js.map +0 -7
  46. package/example/react-demo/node_modules/.vite/deps/chunk-5Q2RBQLA.js +0 -127
  47. package/example/react-demo/node_modules/.vite/deps/chunk-5Q2RBQLA.js.map +0 -7
  48. package/example/react-demo/node_modules/.vite/deps/chunk-G3PMV62Z.js +0 -36
  49. package/example/react-demo/node_modules/.vite/deps/chunk-G3PMV62Z.js.map +0 -7
  50. package/example/react-demo/node_modules/.vite/deps/chunk-GX7YZ5KV.js +0 -370
  51. package/example/react-demo/node_modules/.vite/deps/chunk-GX7YZ5KV.js.map +0 -7
  52. package/example/react-demo/node_modules/.vite/deps/chunk-PUFJGYAC.js +0 -928
  53. package/example/react-demo/node_modules/.vite/deps/chunk-PUFJGYAC.js.map +0 -7
  54. package/example/react-demo/node_modules/.vite/deps/chunk-SIU35MPB.js +0 -21
  55. package/example/react-demo/node_modules/.vite/deps/chunk-SIU35MPB.js.map +0 -7
  56. package/example/react-demo/node_modules/.vite/deps/chunk-TOMGVNQP.js +0 -1906
  57. package/example/react-demo/node_modules/.vite/deps/chunk-TOMGVNQP.js.map +0 -7
  58. package/example/react-demo/node_modules/.vite/deps/chunk-YYN6DZAU.js +0 -21628
  59. package/example/react-demo/node_modules/.vite/deps/chunk-YYN6DZAU.js.map +0 -7
  60. package/example/react-demo/node_modules/.vite/deps/chunk-ZE5VSJFE.js +0 -144
  61. package/example/react-demo/node_modules/.vite/deps/chunk-ZE5VSJFE.js.map +0 -7
  62. package/example/react-demo/node_modules/.vite/deps/class-variance-authority.js +0 -51
  63. package/example/react-demo/node_modules/.vite/deps/class-variance-authority.js.map +0 -7
  64. package/example/react-demo/node_modules/.vite/deps/clsx.js +0 -10
  65. package/example/react-demo/node_modules/.vite/deps/clsx.js.map +0 -7
  66. package/example/react-demo/node_modules/.vite/deps/lucide-react.js +0 -29725
  67. package/example/react-demo/node_modules/.vite/deps/lucide-react.js.map +0 -7
  68. package/example/react-demo/node_modules/.vite/deps/package.json +0 -3
  69. package/example/react-demo/node_modules/.vite/deps/react-dom.js +0 -7
  70. package/example/react-demo/node_modules/.vite/deps/react-dom.js.map +0 -7
  71. package/example/react-demo/node_modules/.vite/deps/react-dom_client.js +0 -39
  72. package/example/react-demo/node_modules/.vite/deps/react-dom_client.js.map +0 -7
  73. package/example/react-demo/node_modules/.vite/deps/react.js +0 -6
  74. package/example/react-demo/node_modules/.vite/deps/react.js.map +0 -7
  75. package/example/react-demo/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -913
  76. package/example/react-demo/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
  77. package/example/react-demo/node_modules/.vite/deps/react_jsx-runtime.js +0 -7
  78. package/example/react-demo/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
  79. package/example/react-demo/node_modules/.vite/deps/tailwind-merge.js +0 -2534
  80. package/example/react-demo/node_modules/.vite/deps/tailwind-merge.js.map +0 -7
  81. package/example/react-demo/package.json +0 -23
  82. package/example/react-demo/postcss.config.mjs +0 -6
  83. package/example/react-demo/src/App.tsx +0 -64
  84. package/example/react-demo/src/main.tsx +0 -10
  85. package/example/react-demo/src/styles.css +0 -102
  86. package/example/react-demo/tailwind.config.mjs +0 -50
  87. package/example/react-demo/tsconfig.json +0 -16
  88. package/example/react-demo/vite.config.ts +0 -14
  89. package/example/shared/defaultSchema.ts +0 -68
  90. package/example/vue-demo/index.html +0 -12
  91. package/example/vue-demo/node_modules/.bin/tsc +0 -17
  92. package/example/vue-demo/node_modules/.bin/tsserver +0 -17
  93. package/example/vue-demo/node_modules/.bin/vite +0 -17
  94. package/example/vue-demo/node_modules/.vite/deps/_metadata.json +0 -46
  95. package/example/vue-demo/node_modules/.vite/deps/chunk-PZ5AY32C.js +0 -10
  96. package/example/vue-demo/node_modules/.vite/deps/chunk-PZ5AY32C.js.map +0 -7
  97. package/example/vue-demo/node_modules/.vite/deps/chunk-TCXBSQ4M.js +0 -12877
  98. package/example/vue-demo/node_modules/.vite/deps/chunk-TCXBSQ4M.js.map +0 -7
  99. package/example/vue-demo/node_modules/.vite/deps/clsx.js +0 -22
  100. package/example/vue-demo/node_modules/.vite/deps/clsx.js.map +0 -7
  101. package/example/vue-demo/node_modules/.vite/deps/lucide-vue-next.js +0 -29720
  102. package/example/vue-demo/node_modules/.vite/deps/lucide-vue-next.js.map +0 -7
  103. package/example/vue-demo/node_modules/.vite/deps/package.json +0 -3
  104. package/example/vue-demo/node_modules/.vite/deps/radix-vue.js +0 -24321
  105. package/example/vue-demo/node_modules/.vite/deps/radix-vue.js.map +0 -7
  106. package/example/vue-demo/node_modules/.vite/deps/tailwind-merge.js +0 -2534
  107. package/example/vue-demo/node_modules/.vite/deps/tailwind-merge.js.map +0 -7
  108. package/example/vue-demo/node_modules/.vite/deps/vue.js +0 -348
  109. package/example/vue-demo/node_modules/.vite/deps/vue.js.map +0 -7
  110. package/example/vue-demo/package.json +0 -20
  111. package/example/vue-demo/postcss.config.mjs +0 -6
  112. package/example/vue-demo/src/App.vue +0 -61
  113. package/example/vue-demo/src/env.d.ts +0 -1
  114. package/example/vue-demo/src/main.ts +0 -5
  115. package/example/vue-demo/src/style.css +0 -102
  116. package/example/vue-demo/tailwind.config.mjs +0 -50
  117. package/example/vue-demo/tsconfig.json +0 -15
  118. package/example/vue-demo/vite.config.ts +0 -14
  119. package/packages/core/dist/chunk-TP3IHKWV.js +0 -69
  120. package/packages/core/dist/chunk-WEDHXOHH.js +0 -102
  121. package/packages/core/node_modules/.bin/api-extractor +0 -17
  122. package/packages/core/node_modules/.bin/esbuild +0 -14
  123. package/packages/core/node_modules/.bin/jiti +0 -17
  124. package/packages/core/node_modules/.bin/tsc +0 -17
  125. package/packages/core/node_modules/.bin/tsserver +0 -17
  126. package/packages/core/node_modules/.bin/tsup +0 -17
  127. package/packages/core/node_modules/.bin/tsup-node +0 -17
  128. package/packages/core/node_modules/.bin/vitest +0 -17
  129. package/packages/core/node_modules/.vite/vitest/results.json +0 -1
  130. package/packages/core/package.json +0 -37
  131. package/packages/core/src/formState.ts +0 -79
  132. package/packages/core/src/index.ts +0 -3
  133. package/packages/core/src/types.ts +0 -42
  134. package/packages/core/src/utils.ts +0 -104
  135. package/packages/core/test/formState.test.ts +0 -71
  136. package/packages/core/test/utils.test.ts +0 -178
  137. package/packages/core/tsconfig.json +0 -15
  138. package/packages/core/tsup.config.ts +0 -9
  139. package/packages/react/node_modules/.bin/api-extractor +0 -17
  140. package/packages/react/node_modules/.bin/browserslist +0 -17
  141. package/packages/react/node_modules/.bin/esbuild +0 -14
  142. package/packages/react/node_modules/.bin/jiti +0 -17
  143. package/packages/react/node_modules/.bin/tsc +0 -17
  144. package/packages/react/node_modules/.bin/tsserver +0 -17
  145. package/packages/react/node_modules/.bin/tsup +0 -17
  146. package/packages/react/node_modules/.bin/tsup-node +0 -17
  147. package/packages/react/node_modules/.bin/vite +0 -17
  148. package/packages/react/node_modules/.bin/vitest +0 -17
  149. package/packages/react/node_modules/.vite/vitest/results.json +0 -1
  150. package/packages/react/package.json +0 -57
  151. package/packages/react/postcss.config.mjs +0 -6
  152. package/packages/react/src/DynamicForm.tsx +0 -69
  153. package/packages/react/src/FormFieldRenderer.tsx +0 -50
  154. package/packages/react/src/components/Checkbox.tsx +0 -28
  155. package/packages/react/src/components/CheckboxRenderer.tsx +0 -37
  156. package/packages/react/src/components/Input.tsx +0 -24
  157. package/packages/react/src/components/InputRenderer.tsx +0 -25
  158. package/packages/react/src/components/Label.tsx +0 -24
  159. package/packages/react/src/components/RadioGroup.tsx +0 -42
  160. package/packages/react/src/components/RadioRenderer.tsx +0 -29
  161. package/packages/react/src/components/Select.tsx +0 -93
  162. package/packages/react/src/components/SelectRenderer.tsx +0 -27
  163. package/packages/react/src/components/Textarea.tsx +0 -23
  164. package/packages/react/src/components/TextareaRenderer.tsx +0 -17
  165. package/packages/react/src/components/index.ts +0 -55
  166. package/packages/react/src/components/types.ts +0 -17
  167. package/packages/react/src/index.tsx +0 -3
  168. package/packages/react/src/utils.ts +0 -7
  169. package/packages/react/tailwind.config.mjs +0 -10
  170. package/packages/react/test/DynamicForm.test.tsx +0 -25
  171. package/packages/react/test/FormFieldRenderer.test.tsx +0 -127
  172. package/packages/react/tsconfig.json +0 -15
  173. package/packages/react/vitest.config.ts +0 -16
  174. package/packages/vue/node_modules/.bin/rollup +0 -17
  175. package/packages/vue/node_modules/.bin/tsc +0 -17
  176. package/packages/vue/node_modules/.bin/tsserver +0 -17
  177. package/packages/vue/node_modules/.bin/vite +0 -17
  178. package/packages/vue/node_modules/.bin/vitest +0 -17
  179. package/packages/vue/node_modules/.bin/vue-tsc +0 -17
  180. package/packages/vue/node_modules/.vite/vitest/results.json +0 -1
  181. package/packages/vue/node_modules/.vue-global-types/vue_3.5_0_0_0.d.ts +0 -118
  182. package/packages/vue/node_modules/.vue-global-types/vue_3.5_false.d.ts +0 -128
  183. package/packages/vue/package.json +0 -53
  184. package/packages/vue/postcss.config.mjs +0 -6
  185. package/packages/vue/src/DynamicForm.vue +0 -63
  186. package/packages/vue/src/FormFieldRenderer.vue +0 -70
  187. package/packages/vue/src/components/Checkbox.vue +0 -28
  188. package/packages/vue/src/components/CheckboxRenderer.vue +0 -35
  189. package/packages/vue/src/components/Input.vue +0 -21
  190. package/packages/vue/src/components/InputRenderer.vue +0 -24
  191. package/packages/vue/src/components/Label.vue +0 -21
  192. package/packages/vue/src/components/RadioGroup.vue +0 -30
  193. package/packages/vue/src/components/RadioGroupItem.vue +0 -26
  194. package/packages/vue/src/components/RadioRenderer.vue +0 -24
  195. package/packages/vue/src/components/Select.vue +0 -40
  196. package/packages/vue/src/components/SelectContent.vue +0 -38
  197. package/packages/vue/src/components/SelectItem.vue +0 -43
  198. package/packages/vue/src/components/SelectRenderer.vue +0 -30
  199. package/packages/vue/src/components/SelectTrigger.vue +0 -27
  200. package/packages/vue/src/components/Textarea.vue +0 -19
  201. package/packages/vue/src/components/TextareaRenderer.vue +0 -18
  202. package/packages/vue/src/components/index.ts +0 -24
  203. package/packages/vue/src/env.d.ts +0 -7
  204. package/packages/vue/src/fieldComponentMap.ts +0 -34
  205. package/packages/vue/src/index.ts +0 -4
  206. package/packages/vue/src/utils.ts +0 -6
  207. package/packages/vue/tailwind.config.mjs +0 -10
  208. package/packages/vue/test/DynamicForm.test.ts +0 -19
  209. package/packages/vue/test/FormFieldRenderer.test.ts +0 -133
  210. package/packages/vue/tsconfig.json +0 -16
  211. package/packages/vue/vite.config.ts +0 -29
  212. package/packages/vue/vitest.config.ts +0 -16
  213. package/pnpm-workspace.yaml +0 -4
  214. package/tsconfig.json +0 -21
  215. package/turbo.json +0 -25
@@ -1,530 +0,0 @@
1
- "use client";
2
- import {
3
- Presence
4
- } from "./chunk-ZE5VSJFE.js";
5
- import {
6
- createCollection,
7
- useCallbackRef,
8
- useDirection,
9
- useId
10
- } from "./chunk-5Q2RBQLA.js";
11
- import {
12
- Primitive,
13
- composeEventHandlers,
14
- createContextScope,
15
- useControllableState,
16
- usePrevious,
17
- useSize
18
- } from "./chunk-GX7YZ5KV.js";
19
- import {
20
- useComposedRefs
21
- } from "./chunk-3D5PZ6F6.js";
22
- import "./chunk-YYN6DZAU.js";
23
- import {
24
- require_jsx_runtime
25
- } from "./chunk-PUFJGYAC.js";
26
- import {
27
- require_react
28
- } from "./chunk-TOMGVNQP.js";
29
- import {
30
- __toESM
31
- } from "./chunk-G3PMV62Z.js";
32
-
33
- // ../../node_modules/.pnpm/@radix-ui+react-radio-group@1.3.8_@types+react-dom@18.3.7_@types+react@18.3.28__@types+react@_ikqgihfiueu52yvwwtlqfp4l7u/node_modules/@radix-ui/react-radio-group/dist/index.mjs
34
- var React2 = __toESM(require_react(), 1);
35
-
36
- // ../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.11_@types+react-dom@18.3.7_@types+react@18.3.28__@types+reac_hp3yyvshcme64xtgeexy2xq53y/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
37
- var React = __toESM(require_react(), 1);
38
- var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
39
- var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
40
- var EVENT_OPTIONS = { bubbles: false, cancelable: true };
41
- var GROUP_NAME = "RovingFocusGroup";
42
- var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
43
- var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
44
- GROUP_NAME,
45
- [createCollectionScope]
46
- );
47
- var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
48
- var RovingFocusGroup = React.forwardRef(
49
- (props, forwardedRef) => {
50
- return (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: (0, import_jsx_runtime.jsx)(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
51
- }
52
- );
53
- RovingFocusGroup.displayName = GROUP_NAME;
54
- var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
55
- const {
56
- __scopeRovingFocusGroup,
57
- orientation,
58
- loop = false,
59
- dir,
60
- currentTabStopId: currentTabStopIdProp,
61
- defaultCurrentTabStopId,
62
- onCurrentTabStopIdChange,
63
- onEntryFocus,
64
- preventScrollOnEntryFocus = false,
65
- ...groupProps
66
- } = props;
67
- const ref = React.useRef(null);
68
- const composedRefs = useComposedRefs(forwardedRef, ref);
69
- const direction = useDirection(dir);
70
- const [currentTabStopId, setCurrentTabStopId] = useControllableState({
71
- prop: currentTabStopIdProp,
72
- defaultProp: defaultCurrentTabStopId ?? null,
73
- onChange: onCurrentTabStopIdChange,
74
- caller: GROUP_NAME
75
- });
76
- const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
77
- const handleEntryFocus = useCallbackRef(onEntryFocus);
78
- const getItems = useCollection(__scopeRovingFocusGroup);
79
- const isClickFocusRef = React.useRef(false);
80
- const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
81
- React.useEffect(() => {
82
- const node = ref.current;
83
- if (node) {
84
- node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
85
- return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
86
- }
87
- }, [handleEntryFocus]);
88
- return (0, import_jsx_runtime.jsx)(
89
- RovingFocusProvider,
90
- {
91
- scope: __scopeRovingFocusGroup,
92
- orientation,
93
- dir: direction,
94
- loop,
95
- currentTabStopId,
96
- onItemFocus: React.useCallback(
97
- (tabStopId) => setCurrentTabStopId(tabStopId),
98
- [setCurrentTabStopId]
99
- ),
100
- onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
101
- onFocusableItemAdd: React.useCallback(
102
- () => setFocusableItemsCount((prevCount) => prevCount + 1),
103
- []
104
- ),
105
- onFocusableItemRemove: React.useCallback(
106
- () => setFocusableItemsCount((prevCount) => prevCount - 1),
107
- []
108
- ),
109
- children: (0, import_jsx_runtime.jsx)(
110
- Primitive.div,
111
- {
112
- tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
113
- "data-orientation": orientation,
114
- ...groupProps,
115
- ref: composedRefs,
116
- style: { outline: "none", ...props.style },
117
- onMouseDown: composeEventHandlers(props.onMouseDown, () => {
118
- isClickFocusRef.current = true;
119
- }),
120
- onFocus: composeEventHandlers(props.onFocus, (event) => {
121
- const isKeyboardFocus = !isClickFocusRef.current;
122
- if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
123
- const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
124
- event.currentTarget.dispatchEvent(entryFocusEvent);
125
- if (!entryFocusEvent.defaultPrevented) {
126
- const items = getItems().filter((item) => item.focusable);
127
- const activeItem = items.find((item) => item.active);
128
- const currentItem = items.find((item) => item.id === currentTabStopId);
129
- const candidateItems = [activeItem, currentItem, ...items].filter(
130
- Boolean
131
- );
132
- const candidateNodes = candidateItems.map((item) => item.ref.current);
133
- focusFirst(candidateNodes, preventScrollOnEntryFocus);
134
- }
135
- }
136
- isClickFocusRef.current = false;
137
- }),
138
- onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
139
- }
140
- )
141
- }
142
- );
143
- });
144
- var ITEM_NAME = "RovingFocusGroupItem";
145
- var RovingFocusGroupItem = React.forwardRef(
146
- (props, forwardedRef) => {
147
- const {
148
- __scopeRovingFocusGroup,
149
- focusable = true,
150
- active = false,
151
- tabStopId,
152
- children,
153
- ...itemProps
154
- } = props;
155
- const autoId = useId();
156
- const id = tabStopId || autoId;
157
- const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
158
- const isCurrentTabStop = context.currentTabStopId === id;
159
- const getItems = useCollection(__scopeRovingFocusGroup);
160
- const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
161
- React.useEffect(() => {
162
- if (focusable) {
163
- onFocusableItemAdd();
164
- return () => onFocusableItemRemove();
165
- }
166
- }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
167
- return (0, import_jsx_runtime.jsx)(
168
- Collection.ItemSlot,
169
- {
170
- scope: __scopeRovingFocusGroup,
171
- id,
172
- focusable,
173
- active,
174
- children: (0, import_jsx_runtime.jsx)(
175
- Primitive.span,
176
- {
177
- tabIndex: isCurrentTabStop ? 0 : -1,
178
- "data-orientation": context.orientation,
179
- ...itemProps,
180
- ref: forwardedRef,
181
- onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
182
- if (!focusable) event.preventDefault();
183
- else context.onItemFocus(id);
184
- }),
185
- onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
186
- onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
187
- if (event.key === "Tab" && event.shiftKey) {
188
- context.onItemShiftTab();
189
- return;
190
- }
191
- if (event.target !== event.currentTarget) return;
192
- const focusIntent = getFocusIntent(event, context.orientation, context.dir);
193
- if (focusIntent !== void 0) {
194
- if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
195
- event.preventDefault();
196
- const items = getItems().filter((item) => item.focusable);
197
- let candidateNodes = items.map((item) => item.ref.current);
198
- if (focusIntent === "last") candidateNodes.reverse();
199
- else if (focusIntent === "prev" || focusIntent === "next") {
200
- if (focusIntent === "prev") candidateNodes.reverse();
201
- const currentIndex = candidateNodes.indexOf(event.currentTarget);
202
- candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
203
- }
204
- setTimeout(() => focusFirst(candidateNodes));
205
- }
206
- }),
207
- children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
208
- }
209
- )
210
- }
211
- );
212
- }
213
- );
214
- RovingFocusGroupItem.displayName = ITEM_NAME;
215
- var MAP_KEY_TO_FOCUS_INTENT = {
216
- ArrowLeft: "prev",
217
- ArrowUp: "prev",
218
- ArrowRight: "next",
219
- ArrowDown: "next",
220
- PageUp: "first",
221
- Home: "first",
222
- PageDown: "last",
223
- End: "last"
224
- };
225
- function getDirectionAwareKey(key, dir) {
226
- if (dir !== "rtl") return key;
227
- return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
228
- }
229
- function getFocusIntent(event, orientation, dir) {
230
- const key = getDirectionAwareKey(event.key, dir);
231
- if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
232
- if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
233
- return MAP_KEY_TO_FOCUS_INTENT[key];
234
- }
235
- function focusFirst(candidates, preventScroll = false) {
236
- const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
237
- for (const candidate of candidates) {
238
- if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
239
- candidate.focus({ preventScroll });
240
- if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
241
- }
242
- }
243
- function wrapArray(array, startIndex) {
244
- return array.map((_, index) => array[(startIndex + index) % array.length]);
245
- }
246
- var Root = RovingFocusGroup;
247
- var Item = RovingFocusGroupItem;
248
-
249
- // ../../node_modules/.pnpm/@radix-ui+react-radio-group@1.3.8_@types+react-dom@18.3.7_@types+react@18.3.28__@types+react@_ikqgihfiueu52yvwwtlqfp4l7u/node_modules/@radix-ui/react-radio-group/dist/index.mjs
250
- var React3 = __toESM(require_react(), 1);
251
- var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
252
- var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
253
- var RADIO_NAME = "Radio";
254
- var [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);
255
- var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
256
- var Radio = React3.forwardRef(
257
- (props, forwardedRef) => {
258
- const {
259
- __scopeRadio,
260
- name,
261
- checked = false,
262
- required,
263
- disabled,
264
- value = "on",
265
- onCheck,
266
- form,
267
- ...radioProps
268
- } = props;
269
- const [button, setButton] = React3.useState(null);
270
- const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
271
- const hasConsumerStoppedPropagationRef = React3.useRef(false);
272
- const isFormControl = button ? form || !!button.closest("form") : true;
273
- return (0, import_jsx_runtime2.jsxs)(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
274
- (0, import_jsx_runtime2.jsx)(
275
- Primitive.button,
276
- {
277
- type: "button",
278
- role: "radio",
279
- "aria-checked": checked,
280
- "data-state": getState(checked),
281
- "data-disabled": disabled ? "" : void 0,
282
- disabled,
283
- value,
284
- ...radioProps,
285
- ref: composedRefs,
286
- onClick: composeEventHandlers(props.onClick, (event) => {
287
- if (!checked) onCheck == null ? void 0 : onCheck();
288
- if (isFormControl) {
289
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
290
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
291
- }
292
- })
293
- }
294
- ),
295
- isFormControl && (0, import_jsx_runtime2.jsx)(
296
- RadioBubbleInput,
297
- {
298
- control: button,
299
- bubbles: !hasConsumerStoppedPropagationRef.current,
300
- name,
301
- value,
302
- checked,
303
- required,
304
- disabled,
305
- form,
306
- style: { transform: "translateX(-100%)" }
307
- }
308
- )
309
- ] });
310
- }
311
- );
312
- Radio.displayName = RADIO_NAME;
313
- var INDICATOR_NAME = "RadioIndicator";
314
- var RadioIndicator = React3.forwardRef(
315
- (props, forwardedRef) => {
316
- const { __scopeRadio, forceMount, ...indicatorProps } = props;
317
- const context = useRadioContext(INDICATOR_NAME, __scopeRadio);
318
- return (0, import_jsx_runtime2.jsx)(Presence, { present: forceMount || context.checked, children: (0, import_jsx_runtime2.jsx)(
319
- Primitive.span,
320
- {
321
- "data-state": getState(context.checked),
322
- "data-disabled": context.disabled ? "" : void 0,
323
- ...indicatorProps,
324
- ref: forwardedRef
325
- }
326
- ) });
327
- }
328
- );
329
- RadioIndicator.displayName = INDICATOR_NAME;
330
- var BUBBLE_INPUT_NAME = "RadioBubbleInput";
331
- var RadioBubbleInput = React3.forwardRef(
332
- ({
333
- __scopeRadio,
334
- control,
335
- checked,
336
- bubbles = true,
337
- ...props
338
- }, forwardedRef) => {
339
- const ref = React3.useRef(null);
340
- const composedRefs = useComposedRefs(ref, forwardedRef);
341
- const prevChecked = usePrevious(checked);
342
- const controlSize = useSize(control);
343
- React3.useEffect(() => {
344
- const input = ref.current;
345
- if (!input) return;
346
- const inputProto = window.HTMLInputElement.prototype;
347
- const descriptor = Object.getOwnPropertyDescriptor(
348
- inputProto,
349
- "checked"
350
- );
351
- const setChecked = descriptor.set;
352
- if (prevChecked !== checked && setChecked) {
353
- const event = new Event("click", { bubbles });
354
- setChecked.call(input, checked);
355
- input.dispatchEvent(event);
356
- }
357
- }, [prevChecked, checked, bubbles]);
358
- return (0, import_jsx_runtime2.jsx)(
359
- Primitive.input,
360
- {
361
- type: "radio",
362
- "aria-hidden": true,
363
- defaultChecked: checked,
364
- ...props,
365
- tabIndex: -1,
366
- ref: composedRefs,
367
- style: {
368
- ...props.style,
369
- ...controlSize,
370
- position: "absolute",
371
- pointerEvents: "none",
372
- opacity: 0,
373
- margin: 0
374
- }
375
- }
376
- );
377
- }
378
- );
379
- RadioBubbleInput.displayName = BUBBLE_INPUT_NAME;
380
- function getState(checked) {
381
- return checked ? "checked" : "unchecked";
382
- }
383
- var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
384
- var RADIO_GROUP_NAME = "RadioGroup";
385
- var [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [
386
- createRovingFocusGroupScope,
387
- createRadioScope
388
- ]);
389
- var useRovingFocusGroupScope = createRovingFocusGroupScope();
390
- var useRadioScope = createRadioScope();
391
- var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
392
- var RadioGroup = React2.forwardRef(
393
- (props, forwardedRef) => {
394
- const {
395
- __scopeRadioGroup,
396
- name,
397
- defaultValue,
398
- value: valueProp,
399
- required = false,
400
- disabled = false,
401
- orientation,
402
- dir,
403
- loop = true,
404
- onValueChange,
405
- ...groupProps
406
- } = props;
407
- const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
408
- const direction = useDirection(dir);
409
- const [value, setValue] = useControllableState({
410
- prop: valueProp,
411
- defaultProp: defaultValue ?? null,
412
- onChange: onValueChange,
413
- caller: RADIO_GROUP_NAME
414
- });
415
- return (0, import_jsx_runtime3.jsx)(
416
- RadioGroupProvider,
417
- {
418
- scope: __scopeRadioGroup,
419
- name,
420
- required,
421
- disabled,
422
- value,
423
- onValueChange: setValue,
424
- children: (0, import_jsx_runtime3.jsx)(
425
- Root,
426
- {
427
- asChild: true,
428
- ...rovingFocusGroupScope,
429
- orientation,
430
- dir: direction,
431
- loop,
432
- children: (0, import_jsx_runtime3.jsx)(
433
- Primitive.div,
434
- {
435
- role: "radiogroup",
436
- "aria-required": required,
437
- "aria-orientation": orientation,
438
- "data-disabled": disabled ? "" : void 0,
439
- dir: direction,
440
- ...groupProps,
441
- ref: forwardedRef
442
- }
443
- )
444
- }
445
- )
446
- }
447
- );
448
- }
449
- );
450
- RadioGroup.displayName = RADIO_GROUP_NAME;
451
- var ITEM_NAME2 = "RadioGroupItem";
452
- var RadioGroupItem = React2.forwardRef(
453
- (props, forwardedRef) => {
454
- const { __scopeRadioGroup, disabled, ...itemProps } = props;
455
- const context = useRadioGroupContext(ITEM_NAME2, __scopeRadioGroup);
456
- const isDisabled = context.disabled || disabled;
457
- const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
458
- const radioScope = useRadioScope(__scopeRadioGroup);
459
- const ref = React2.useRef(null);
460
- const composedRefs = useComposedRefs(forwardedRef, ref);
461
- const checked = context.value === itemProps.value;
462
- const isArrowKeyPressedRef = React2.useRef(false);
463
- React2.useEffect(() => {
464
- const handleKeyDown = (event) => {
465
- if (ARROW_KEYS.includes(event.key)) {
466
- isArrowKeyPressedRef.current = true;
467
- }
468
- };
469
- const handleKeyUp = () => isArrowKeyPressedRef.current = false;
470
- document.addEventListener("keydown", handleKeyDown);
471
- document.addEventListener("keyup", handleKeyUp);
472
- return () => {
473
- document.removeEventListener("keydown", handleKeyDown);
474
- document.removeEventListener("keyup", handleKeyUp);
475
- };
476
- }, []);
477
- return (0, import_jsx_runtime3.jsx)(
478
- Item,
479
- {
480
- asChild: true,
481
- ...rovingFocusGroupScope,
482
- focusable: !isDisabled,
483
- active: checked,
484
- children: (0, import_jsx_runtime3.jsx)(
485
- Radio,
486
- {
487
- disabled: isDisabled,
488
- required: context.required,
489
- checked,
490
- ...radioScope,
491
- ...itemProps,
492
- name: context.name,
493
- ref: composedRefs,
494
- onCheck: () => context.onValueChange(itemProps.value),
495
- onKeyDown: composeEventHandlers((event) => {
496
- if (event.key === "Enter") event.preventDefault();
497
- }),
498
- onFocus: composeEventHandlers(itemProps.onFocus, () => {
499
- var _a;
500
- if (isArrowKeyPressedRef.current) (_a = ref.current) == null ? void 0 : _a.click();
501
- })
502
- }
503
- )
504
- }
505
- );
506
- }
507
- );
508
- RadioGroupItem.displayName = ITEM_NAME2;
509
- var INDICATOR_NAME2 = "RadioGroupIndicator";
510
- var RadioGroupIndicator = React2.forwardRef(
511
- (props, forwardedRef) => {
512
- const { __scopeRadioGroup, ...indicatorProps } = props;
513
- const radioScope = useRadioScope(__scopeRadioGroup);
514
- return (0, import_jsx_runtime3.jsx)(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef });
515
- }
516
- );
517
- RadioGroupIndicator.displayName = INDICATOR_NAME2;
518
- var Root2 = RadioGroup;
519
- var Item2 = RadioGroupItem;
520
- var Indicator = RadioGroupIndicator;
521
- export {
522
- Indicator,
523
- Item2 as Item,
524
- RadioGroup,
525
- RadioGroupIndicator,
526
- RadioGroupItem,
527
- Root2 as Root,
528
- createRadioGroupScope
529
- };
530
- //# sourceMappingURL=@radix-ui_react-radio-group.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../node_modules/.pnpm/@radix-ui+react-radio-group@1.3.8_@types+react-dom@18.3.7_@types+react@18.3.28__@types+react@_ikqgihfiueu52yvwwtlqfp4l7u/node_modules/@radix-ui/react-radio-group/src/radio-group.tsx", "../../../../../node_modules/.pnpm/@radix-ui+react-radio-group@1.3.8_@types+react-dom@18.3.7_@types+react@18.3.28__@types+react@_ikqgihfiueu52yvwwtlqfp4l7u/node_modules/@radix-ui/react-radio-group/src/radio.tsx", "../../../../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.11_@types+react-dom@18.3.7_@types+react@18.3.28__@types+reac_hp3yyvshcme64xtgeexy2xq53y/node_modules/@radix-ui/react-roving-focus/src/roving-focus-group.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Radio, RadioIndicator, createRadioScope } from './radio';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroup\n * -----------------------------------------------------------------------------------------------*/\nconst RADIO_GROUP_NAME = 'RadioGroup';\n\ntype ScopedProps<P> = P & { __scopeRadioGroup?: Scope };\nconst [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [\n createRovingFocusGroupScope,\n createRadioScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useRadioScope = createRadioScope();\n\ntype RadioGroupContextValue = {\n name?: string;\n required: boolean;\n disabled: boolean;\n value: string | null;\n onValueChange(value: string): void;\n};\n\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext<RadioGroupContextValue>(RADIO_GROUP_NAME);\n\ntype RadioGroupElement = React.ComponentRef<typeof Primitive.div>;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface RadioGroupProps extends PrimitiveDivProps {\n name?: RadioGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<typeof Radio>['required'];\n disabled?: React.ComponentPropsWithoutRef<typeof Radio>['disabled'];\n dir?: RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroupProps['loop'];\n defaultValue?: string;\n value?: string | null;\n onValueChange?: RadioGroupContextValue['onValueChange'];\n}\n\nconst RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(\n (props: ScopedProps<RadioGroupProps>, forwardedRef) => {\n const {\n __scopeRadioGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...groupProps\n } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? null,\n onChange: onValueChange as (value: string | null) => void,\n caller: RADIO_GROUP_NAME,\n });\n\n return (\n <RadioGroupProvider\n scope={__scopeRadioGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onValueChange={setValue}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n <Primitive.div\n role=\"radiogroup\"\n aria-required={required}\n aria-orientation={orientation}\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...groupProps}\n ref={forwardedRef}\n />\n </RovingFocusGroup.Root>\n </RadioGroupProvider>\n );\n }\n);\n\nRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RadioGroupItem';\n\ntype RadioGroupItemElement = React.ComponentRef<typeof Radio>;\ntype RadioProps = React.ComponentPropsWithoutRef<typeof Radio>;\ninterface RadioGroupItemProps extends Omit<RadioProps, 'onCheck' | 'name'> {\n value: string;\n}\n\nconst RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(\n (props: ScopedProps<RadioGroupItemProps>, forwardedRef) => {\n const { __scopeRadioGroup, disabled, ...itemProps } = props;\n const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const ref = React.useRef<React.ComponentRef<typeof Radio>>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const checked = context.value === itemProps.value;\n const isArrowKeyPressedRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) {\n isArrowKeyPressedRef.current = true;\n }\n };\n const handleKeyUp = () => (isArrowKeyPressedRef.current = false);\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n };\n }, []);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <Radio\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...radioScope}\n {...itemProps}\n name={context.name}\n ref={composedRefs}\n onCheck={() => context.onValueChange(itemProps.value)}\n onKeyDown={composeEventHandlers((event) => {\n // According to WAI ARIA, radio groups don't activate items on enter keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onFocus={composeEventHandlers(itemProps.onFocus, () => {\n /**\n * Our `RovingFocusGroup` will focus the radio when navigating with arrow keys\n * and we need to \"check\" it in that case. We click it to \"check\" it (instead\n * of updating `context.value`) so that the radio change event fires.\n */\n if (isArrowKeyPressedRef.current) ref.current?.click();\n })}\n />\n </RovingFocusGroup.Item>\n );\n }\n);\n\nRadioGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioGroupIndicator';\n\ntype RadioGroupIndicatorElement = React.ComponentRef<typeof RadioIndicator>;\ntype RadioIndicatorProps = React.ComponentPropsWithoutRef<typeof RadioIndicator>;\ninterface RadioGroupIndicatorProps extends RadioIndicatorProps {}\n\nconst RadioGroupIndicator = React.forwardRef<RadioGroupIndicatorElement, RadioGroupIndicatorProps>(\n (props: ScopedProps<RadioGroupIndicatorProps>, forwardedRef) => {\n const { __scopeRadioGroup, ...indicatorProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return <RadioIndicator {...radioScope} {...indicatorProps} ref={forwardedRef} />;\n }\n);\n\nRadioGroupIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = RadioGroup;\nconst Item = RadioGroupItem;\nconst Indicator = RadioGroupIndicator;\n\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupIndicator,\n //\n Root,\n Item,\n Indicator,\n};\nexport type { RadioGroupProps, RadioGroupItemProps, RadioGroupIndicatorProps };\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Radio\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_NAME = 'Radio';\n\ntype ScopedProps<P> = P & { __scopeRadio?: Scope };\nconst [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);\n\ntype RadioContextValue = { checked: boolean; disabled?: boolean };\nconst [RadioProvider, useRadioContext] = createRadioContext<RadioContextValue>(RADIO_NAME);\n\ntype RadioElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface RadioProps extends PrimitiveButtonProps {\n checked?: boolean;\n required?: boolean;\n onCheck?(): void;\n}\n\nconst Radio = React.forwardRef<RadioElement, RadioProps>(\n (props: ScopedProps<RadioProps>, forwardedRef) => {\n const {\n __scopeRadio,\n name,\n checked = false,\n required,\n disabled,\n value = 'on',\n onCheck,\n form,\n ...radioProps\n } = props;\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = button ? form || !!button.closest('form') : true;\n\n return (\n <RadioProvider scope={__scopeRadio} checked={checked} disabled={disabled}>\n <Primitive.button\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...radioProps}\n ref={composedRefs}\n onClick={composeEventHandlers(props.onClick, (event) => {\n // radios cannot be unchecked so we only communicate a checked state\n if (!checked) onCheck?.();\n if (isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if radio is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect radio updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n {isFormControl && (\n <RadioBubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n form={form}\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n style={{ transform: 'translateX(-100%)' }}\n />\n )}\n </RadioProvider>\n );\n }\n);\n\nRadio.displayName = RADIO_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioIndicator';\n\ntype RadioIndicatorElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\nexport interface RadioIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst RadioIndicator = React.forwardRef<RadioIndicatorElement, RadioIndicatorProps>(\n (props: ScopedProps<RadioIndicatorProps>, forwardedRef) => {\n const { __scopeRadio, forceMount, ...indicatorProps } = props;\n const context = useRadioContext(INDICATOR_NAME, __scopeRadio);\n return (\n <Presence present={forceMount || context.checked}>\n <Primitive.span\n data-state={getState(context.checked)}\n data-disabled={context.disabled ? '' : undefined}\n {...indicatorProps}\n ref={forwardedRef}\n />\n </Presence>\n );\n }\n);\n\nRadioIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'RadioBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\ninterface RadioBubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: boolean;\n control: HTMLElement | null;\n bubbles: boolean;\n}\n\nconst RadioBubbleInput = React.forwardRef<HTMLInputElement, RadioBubbleInputProps>(\n (\n {\n __scopeRadio,\n control,\n checked,\n bubbles = true,\n ...props\n }: ScopedProps<RadioBubbleInputProps>,\n forwardedRef\n ) => {\n const ref = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked'\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [prevChecked, checked, bubbles]);\n\n return (\n <Primitive.input\n type=\"radio\"\n aria-hidden\n defaultChecked={checked}\n {...props}\n tabIndex={-1}\n ref={composedRefs}\n style={{\n ...props.style,\n ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }}\n />\n );\n }\n);\n\nRadioBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createRadioScope,\n //\n Radio,\n RadioIndicator,\n};\nexport type { RadioProps };\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'RovingFocusGroup';\n\ntype ItemData = { id: string; focusable: boolean; active: boolean };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n HTMLSpanElement,\n ItemData\n>(GROUP_NAME);\n\ntype ScopedProps<P> = P & { __scopeRovingFocusGroup?: Scope };\nconst [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\n\ntype Orientation = React.AriaAttributes['aria-orientation'];\ntype Direction = 'ltr' | 'rtl';\n\ninterface RovingFocusGroupOptions {\n /**\n * The orientation of the group.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n */\n orientation?: Orientation;\n /**\n * The direction of navigation between items.\n */\n dir?: Direction;\n /**\n * Whether keyboard navigation should loop around\n * @defaultValue false\n */\n loop?: boolean;\n}\n\ntype RovingContextValue = RovingFocusGroupOptions & {\n currentTabStopId: string | null;\n onItemFocus(tabStopId: string): void;\n onItemShiftTab(): void;\n onFocusableItemAdd(): void;\n onFocusableItemRemove(): void;\n};\n\nconst [RovingFocusProvider, useRovingFocusContext] =\n createRovingFocusGroupContext<RovingContextValue>(GROUP_NAME);\n\ntype RovingFocusGroupElement = RovingFocusGroupImplElement;\ninterface RovingFocusGroupProps extends RovingFocusGroupImplProps {}\n\nconst RovingFocusGroup = React.forwardRef<RovingFocusGroupElement, RovingFocusGroupProps>(\n (props: ScopedProps<RovingFocusGroupProps>, forwardedRef) => {\n return (\n <Collection.Provider scope={props.__scopeRovingFocusGroup}>\n <Collection.Slot scope={props.__scopeRovingFocusGroup}>\n <RovingFocusGroupImpl {...props} ref={forwardedRef} />\n </Collection.Slot>\n </Collection.Provider>\n );\n }\n);\n\nRovingFocusGroup.displayName = GROUP_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype RovingFocusGroupImplElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface RovingFocusGroupImplProps\n extends Omit<PrimitiveDivProps, 'dir'>,\n RovingFocusGroupOptions {\n currentTabStopId?: string | null;\n defaultCurrentTabStopId?: string;\n onCurrentTabStopIdChange?: (tabStopId: string | null) => void;\n onEntryFocus?: (event: Event) => void;\n preventScrollOnEntryFocus?: boolean;\n}\n\nconst RovingFocusGroupImpl = React.forwardRef<\n RovingFocusGroupImplElement,\n RovingFocusGroupImplProps\n>((props: ScopedProps<RovingFocusGroupImplProps>, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef<RovingFocusGroupImplElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME,\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n\n return (\n <RovingFocusProvider\n scope={__scopeRovingFocusGroup}\n orientation={orientation}\n dir={direction}\n loop={loop}\n currentTabStopId={currentTabStopId}\n onItemFocus={React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n )}\n onItemShiftTab={React.useCallback(() => setIsTabbingBackOut(true), [])}\n onFocusableItemAdd={React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n )}\n onFocusableItemRemove={React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n )}\n >\n <Primitive.div\n tabIndex={isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0}\n data-orientation={orientation}\n {...groupProps}\n ref={composedRefs}\n style={{ outline: 'none', ...props.style }}\n onMouseDown={composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n })}\n onFocus={composeEventHandlers(props.onFocus, (event) => {\n // We normally wouldn't need this check, because we already check\n // that the focus is on the current target and not bubbling to it.\n // We do this because Safari doesn't focus buttons when clicked, and\n // instead, the wrapper will get focused and not through a bubbling event.\n const isKeyboardFocus = !isClickFocusRef.current;\n\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n ) as typeof items;\n const candidateNodes = candidateItems.map((item) => item.ref.current!);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n\n isClickFocusRef.current = false;\n })}\n onBlur={composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))}\n />\n </RovingFocusProvider>\n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RovingFocusGroupItem';\n\ntype RovingFocusItemElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface RovingFocusItemProps extends Omit<PrimitiveSpanProps, 'children'> {\n tabStopId?: string;\n focusable?: boolean;\n active?: boolean;\n children?:\n | React.ReactNode\n | ((props: { hasTabStop: boolean; isCurrentTabStop: boolean }) => React.ReactNode);\n}\n\nconst RovingFocusGroupItem = React.forwardRef<RovingFocusItemElement, RovingFocusItemProps>(\n (props: ScopedProps<RovingFocusItemProps>, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n\n return (\n <Collection.ItemSlot\n scope={__scopeRovingFocusGroup}\n id={id}\n focusable={focusable}\n active={active}\n >\n <Primitive.span\n tabIndex={isCurrentTabStop ? 0 : -1}\n data-orientation={context.orientation}\n {...itemProps}\n ref={forwardedRef}\n onMouseDown={composeEventHandlers(props.onMouseDown, (event) => {\n // We prevent focusing non-focusable items on `mousedown`.\n // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n if (!focusable) event.preventDefault();\n // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n else context.onItemFocus(id);\n })}\n onFocus={composeEventHandlers(props.onFocus, () => context.onItemFocus(id))}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === 'Tab' && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n\n if (event.target !== event.currentTarget) return;\n\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n\n if (focusIntent !== undefined) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current!);\n\n if (focusIntent === 'last') candidateNodes.reverse();\n else if (focusIntent === 'prev' || focusIntent === 'next') {\n if (focusIntent === 'prev') candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop\n ? wrapArray(candidateNodes, currentIndex + 1)\n : candidateNodes.slice(currentIndex + 1);\n }\n\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n }\n })}\n >\n {typeof children === 'function'\n ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null })\n : children}\n </Primitive.span>\n </Collection.ItemSlot>\n );\n }\n);\n\nRovingFocusGroupItem.displayName = ITEM_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// prettier-ignore\nconst MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent> = {\n ArrowLeft: 'prev', ArrowUp: 'prev',\n ArrowRight: 'next', ArrowDown: 'next',\n PageUp: 'first', Home: 'first',\n PageDown: 'last', End: 'last',\n};\n\nfunction getDirectionAwareKey(key: string, dir?: Direction) {\n if (dir !== 'rtl') return key;\n return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\n\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next';\n\nfunction getFocusIntent(event: React.KeyboardEvent, orientation?: Orientation, dir?: Direction) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined;\n if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\n\nfunction focusFirst(candidates: HTMLElement[], preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray<T>(array: T[], startIndex: number) {\n return array.map<T>((_, index) => array[(startIndex + index) % array.length]!);\n}\n\nconst Root = RovingFocusGroup;\nconst Item = RovingFocusGroupItem;\n\nexport {\n createRovingFocusGroupScope,\n //\n RovingFocusGro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;AAEzC,kBAAI,MAAM,QAAQ,QAAS,OAAM,eAAe;YAClD,CAAC;YACD,SAASA,qBAAqB,UAAU,SAAS,MAAM;;AAMrD,kBAAI,qBAAqB,QAAS,WAAI,YAAJ,mBAAa;YACjD,CAAC;UAAA;QACH;MAAA;IACF;EAEJ;AACF;AAEA,eAAe,cAAcF;AAM7B,IAAMG,kBAAiB;AAMvB,IAAM,sBAA4B;EAChC,CAAC,OAA8C,iBAAiB;AAC9D,UAAM,EAAE,mBAAmB,GAAG,eAAe,IAAI;AACjD,UAAM,aAAa,cAAc,iBAAiB;AAClD,eAAOL,oBAAAA,KAAC,gBAAA,EAAgB,GAAG,YAAa,GAAG,gBAAgB,KAAK,aAAA,CAAc;EAChF;AACF;AAEA,oBAAoB,cAAcK;AAIlC,IAAMC,QAAO;AACb,IAAMC,QAAO;AACb,IAAM,YAAY;",
6
- "names": ["React", "import_jsx_runtime", "createContextScope", "jsx", "Primitive", "ITEM_NAME", "useComposedRefs", "composeEventHandlers", "INDICATOR_NAME", "Root", "Item"]
7
- }