ingeniuscliq-core 0.4.23 → 0.4.25

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 (221) hide show
  1. package/dist/_virtual/index.js +5 -0
  2. package/dist/_virtual/index2.js +3 -0
  3. package/dist/_virtual/jsx-runtime.js +5 -0
  4. package/dist/_virtual/jsx-runtime2.js +3 -0
  5. package/dist/_virtual/react-jsx-runtime.development.js +3 -0
  6. package/dist/_virtual/react-jsx-runtime.production.js +3 -0
  7. package/dist/_virtual/use-sync-external-store-shim.development.js +3 -0
  8. package/dist/_virtual/use-sync-external-store-shim.production.js +3 -0
  9. package/dist/components/common/carousel/CustomCarousel.tsx +6 -6
  10. package/dist/components/common/carousel/CustomCarouselSection.tsx +12 -12
  11. package/dist/components/common/form/CustomFormField.tsx +6 -6
  12. package/dist/components/common/form/FormCheckbox.tsx +5 -5
  13. package/dist/components/common/form/FormInput.tsx +3 -3
  14. package/dist/components/common/form/FormSelect.tsx +5 -5
  15. package/dist/components/common/form/FormTextArea.tsx +3 -3
  16. package/dist/components/common/form/FormWrapper.tsx +2 -2
  17. package/dist/components/common/logo/Logo.tsx +3 -3
  18. package/dist/components/common/pagination/CustomPagination.tsx +5 -5
  19. package/dist/components/common/select/CustomSelect.tsx +4 -4
  20. package/dist/components/common/spinner/Spinner.tsx +14 -14
  21. package/dist/components/common/stepper/Stepper.tsx +9 -9
  22. package/dist/components/layouts/CoreBaseLayout.tsx +5 -5
  23. package/dist/components/templates/CoreHomeLayout.tsx +2 -2
  24. package/dist/components/templates/CorePreviewLayout.tsx +2 -2
  25. package/dist/components/ui/accordion.tsx +14 -14
  26. package/dist/components/ui/alert-dialog.tsx +27 -27
  27. package/dist/components/ui/alert.tsx +5 -5
  28. package/dist/components/ui/avatar.tsx +11 -11
  29. package/dist/components/ui/badge.tsx +3 -3
  30. package/dist/components/ui/breadcrumb.tsx +14 -13
  31. package/dist/components/ui/button.tsx +4 -4
  32. package/dist/components/ui/card.tsx +8 -8
  33. package/dist/components/ui/carousel.tsx +14 -13
  34. package/dist/components/ui/checkbox.tsx +9 -9
  35. package/dist/components/ui/dialog.tsx +26 -26
  36. package/dist/components/ui/dropdown-menu.tsx +39 -37
  37. package/dist/components/ui/form.tsx +9 -9
  38. package/dist/components/ui/input.tsx +2 -2
  39. package/dist/components/ui/label.tsx +6 -6
  40. package/dist/components/ui/pagination.tsx +17 -15
  41. package/dist/components/ui/popover.tsx +8 -8
  42. package/dist/components/ui/radio-group.tsx +10 -10
  43. package/dist/components/ui/select.tsx +40 -38
  44. package/dist/components/ui/separator.tsx +5 -5
  45. package/dist/components/ui/sheet.tsx +27 -27
  46. package/dist/components/ui/skeleton.tsx +2 -2
  47. package/dist/components/ui/slider.tsx +9 -9
  48. package/dist/components/ui/stepper.tsx +34 -34
  49. package/dist/components/ui/switch.tsx +7 -7
  50. package/dist/components/ui/table.tsx +9 -9
  51. package/dist/components/ui/tabs.tsx +13 -13
  52. package/dist/components/ui/textarea.tsx +2 -2
  53. package/dist/components/ui/tooltip.tsx +8 -8
  54. package/dist/helpers/axiosGlobal.js +2 -1
  55. package/dist/hooks/useNotification.js +1 -1
  56. package/dist/lib/utils.js +2 -2
  57. package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
  58. package/dist/modules/CoreAuth/context/AuthContext.tsx +1 -1
  59. package/dist/modules/CoreAuth/index.js +0 -1
  60. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +1 -1
  61. package/dist/modules/CoreCustomization/index.js +0 -1
  62. package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +1 -1
  63. package/dist/modules/CoreOrder/index.js +0 -1
  64. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +1 -1
  65. package/dist/modules/CorePayForm/index.js +0 -1
  66. package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +1 -1
  67. package/dist/modules/CoreProduct/index.js +0 -1
  68. package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +1 -1
  69. package/dist/modules/CoreShipment/index.js +0 -1
  70. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +1 -1
  71. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +814 -0
  72. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +751 -0
  73. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +350 -0
  74. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
  75. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +137 -0
  76. package/dist/node_modules/@radix-ui/number/dist/index.js +6 -0
  77. package/dist/node_modules/@radix-ui/primitive/dist/index.js +11 -0
  78. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +305 -0
  79. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +147 -0
  80. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +25 -0
  81. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +118 -0
  82. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +270 -0
  83. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +145 -0
  84. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +70 -0
  85. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +39 -0
  86. package/dist/node_modules/@radix-ui/react-context/dist/index.js +79 -0
  87. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +321 -0
  88. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +11 -0
  89. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +211 -0
  90. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +267 -0
  91. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +29 -0
  92. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +207 -0
  93. package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
  94. package/dist/node_modules/@radix-ui/react-label/dist/index.js +24 -0
  95. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +834 -0
  96. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +299 -0
  97. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +283 -0
  98. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
  99. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +130 -0
  100. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +43 -0
  101. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +282 -0
  102. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +223 -0
  103. package/dist/node_modules/@radix-ui/react-select/dist/index.js +1156 -0
  104. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +30 -0
  105. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +554 -0
  106. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +99 -0
  107. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +152 -0
  108. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +187 -0
  109. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +482 -0
  110. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +12 -0
  111. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +70 -0
  112. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
  113. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
  114. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
  115. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +15 -0
  116. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +40 -0
  117. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +35 -0
  118. package/dist/node_modules/@stepperize/core/dist/index.js +3 -0
  119. package/dist/node_modules/@stepperize/react/dist/index.js +6 -0
  120. package/dist/node_modules/aria-hidden/dist/es2015/index.js +137 -0
  121. package/dist/node_modules/axios/index.js +25 -0
  122. package/dist/node_modules/axios/lib/adapters/adapters.js +81 -0
  123. package/dist/node_modules/axios/lib/adapters/fetch.js +229 -0
  124. package/dist/node_modules/axios/lib/adapters/xhr.js +199 -0
  125. package/dist/node_modules/axios/lib/axios.js +86 -0
  126. package/dist/node_modules/axios/lib/cancel/CancelToken.js +133 -0
  127. package/dist/node_modules/axios/lib/cancel/CanceledError.js +23 -0
  128. package/dist/node_modules/axios/lib/cancel/isCancel.js +5 -0
  129. package/dist/node_modules/axios/lib/core/Axios.js +238 -0
  130. package/dist/node_modules/axios/lib/core/AxiosError.js +101 -0
  131. package/dist/node_modules/axios/lib/core/AxiosHeaders.js +312 -0
  132. package/dist/node_modules/axios/lib/core/InterceptorManager.js +69 -0
  133. package/dist/node_modules/axios/lib/core/buildFullPath.js +22 -0
  134. package/dist/node_modules/axios/lib/core/dispatchRequest.js +81 -0
  135. package/dist/node_modules/axios/lib/core/mergeConfig.js +106 -0
  136. package/dist/node_modules/axios/lib/core/settle.js +27 -0
  137. package/dist/node_modules/axios/lib/core/transformData.js +28 -0
  138. package/dist/node_modules/axios/lib/defaults/index.js +159 -0
  139. package/dist/node_modules/axios/lib/defaults/transitional.js +7 -0
  140. package/dist/node_modules/axios/lib/env/data.js +3 -0
  141. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +56 -0
  142. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
  143. package/dist/node_modules/axios/lib/helpers/bind.js +7 -0
  144. package/dist/node_modules/axios/lib/helpers/buildURL.js +69 -0
  145. package/dist/node_modules/axios/lib/helpers/combineURLs.js +15 -0
  146. package/dist/node_modules/axios/lib/helpers/composeSignals.js +48 -0
  147. package/dist/node_modules/axios/lib/helpers/cookies.js +43 -0
  148. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +93 -0
  149. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
  150. package/dist/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  151. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
  152. package/dist/node_modules/axios/lib/helpers/null.js +4 -0
  153. package/dist/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
  154. package/dist/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  155. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +46 -0
  156. package/dist/node_modules/axios/lib/helpers/resolveConfig.js +58 -0
  157. package/dist/node_modules/axios/lib/helpers/speedometer.js +53 -0
  158. package/dist/node_modules/axios/lib/helpers/spread.js +28 -0
  159. package/dist/node_modules/axios/lib/helpers/throttle.js +44 -0
  160. package/dist/node_modules/axios/lib/helpers/toFormData.js +219 -0
  161. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  162. package/dist/node_modules/axios/lib/helpers/trackStream.js +88 -0
  163. package/dist/node_modules/axios/lib/helpers/validator.js +99 -0
  164. package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  165. package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  166. package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
  167. package/dist/node_modules/axios/lib/platform/browser/index.js +15 -0
  168. package/dist/node_modules/axios/lib/platform/common/utils.js +45 -0
  169. package/dist/node_modules/axios/lib/platform/index.js +9 -0
  170. package/dist/node_modules/axios/lib/utils.js +780 -0
  171. package/dist/node_modules/class-variance-authority/dist/index.js +44 -0
  172. package/dist/node_modules/clsx/dist/clsx.js +3 -0
  173. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1669 -0
  174. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +37 -0
  175. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +38 -0
  176. package/dist/node_modules/get-nonce/dist/es2015/index.js +8 -0
  177. package/dist/node_modules/lucide-react/dist/esm/Icon.js +43 -0
  178. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +30 -0
  179. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
  180. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +17 -0
  181. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +17 -0
  182. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +14 -0
  183. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +14 -0
  184. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +14 -0
  185. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +14 -0
  186. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +14 -0
  187. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +14 -0
  188. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +18 -0
  189. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +17 -0
  190. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +28 -0
  191. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +363 -0
  192. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +44 -0
  193. package/dist/node_modules/react/jsx-runtime.js +19 -0
  194. package/dist/node_modules/react-hook-form/dist/index.esm.js +560 -0
  195. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +9 -0
  196. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +167 -0
  197. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +38 -0
  198. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +21 -0
  199. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +110 -0
  200. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
  201. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
  202. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +56 -0
  203. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +10 -0
  204. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +31 -0
  205. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +19 -0
  206. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +25 -0
  207. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +51 -0
  208. package/dist/node_modules/sonner/dist/index.js +299 -0
  209. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3035 -0
  210. package/dist/node_modules/tslib/tslib.es6.js +56 -0
  211. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +24 -0
  212. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +48 -0
  213. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +42 -0
  214. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
  215. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +77 -0
  216. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +106 -0
  217. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +77 -0
  218. package/dist/node_modules/use-sync-external-store/shim/index.js +19 -0
  219. package/dist/node_modules/zustand/esm/react.js +22 -0
  220. package/dist/node_modules/zustand/esm/vanilla.js +24 -0
  221. package/package.json +1 -1
@@ -0,0 +1,130 @@
1
+ import * as React from 'react';
2
+ import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
3
+ import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
4
+
5
+ function useStateMachine(initialState, machine) {
6
+ return React.useReducer((state, event) => {
7
+ const nextState = machine[state][event];
8
+ return nextState ?? state;
9
+ }, initialState);
10
+ }
11
+
12
+ // src/presence.tsx
13
+ var Presence = (props) => {
14
+ const { present, children } = props;
15
+ const presence = usePresence(present);
16
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
17
+ const ref = useComposedRefs(presence.ref, getElementRef(child));
18
+ const forceMount = typeof children === "function";
19
+ return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
20
+ };
21
+ Presence.displayName = "Presence";
22
+ function usePresence(present) {
23
+ const [node, setNode] = React.useState();
24
+ const stylesRef = React.useRef(null);
25
+ const prevPresentRef = React.useRef(present);
26
+ const prevAnimationNameRef = React.useRef("none");
27
+ const initialState = present ? "mounted" : "unmounted";
28
+ const [state, send] = useStateMachine(initialState, {
29
+ mounted: {
30
+ UNMOUNT: "unmounted",
31
+ ANIMATION_OUT: "unmountSuspended"
32
+ },
33
+ unmountSuspended: {
34
+ MOUNT: "mounted",
35
+ ANIMATION_END: "unmounted"
36
+ },
37
+ unmounted: {
38
+ MOUNT: "mounted"
39
+ }
40
+ });
41
+ React.useEffect(() => {
42
+ const currentAnimationName = getAnimationName(stylesRef.current);
43
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
44
+ }, [state]);
45
+ useLayoutEffect2(() => {
46
+ const styles = stylesRef.current;
47
+ const wasPresent = prevPresentRef.current;
48
+ const hasPresentChanged = wasPresent !== present;
49
+ if (hasPresentChanged) {
50
+ const prevAnimationName = prevAnimationNameRef.current;
51
+ const currentAnimationName = getAnimationName(styles);
52
+ if (present) {
53
+ send("MOUNT");
54
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
55
+ send("UNMOUNT");
56
+ } else {
57
+ const isAnimating = prevAnimationName !== currentAnimationName;
58
+ if (wasPresent && isAnimating) {
59
+ send("ANIMATION_OUT");
60
+ } else {
61
+ send("UNMOUNT");
62
+ }
63
+ }
64
+ prevPresentRef.current = present;
65
+ }
66
+ }, [present, send]);
67
+ useLayoutEffect2(() => {
68
+ if (node) {
69
+ let timeoutId;
70
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
71
+ const handleAnimationEnd = (event) => {
72
+ const currentAnimationName = getAnimationName(stylesRef.current);
73
+ const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
74
+ if (event.target === node && isCurrentAnimation) {
75
+ send("ANIMATION_END");
76
+ if (!prevPresentRef.current) {
77
+ const currentFillMode = node.style.animationFillMode;
78
+ node.style.animationFillMode = "forwards";
79
+ timeoutId = ownerWindow.setTimeout(() => {
80
+ if (node.style.animationFillMode === "forwards") {
81
+ node.style.animationFillMode = currentFillMode;
82
+ }
83
+ });
84
+ }
85
+ }
86
+ };
87
+ const handleAnimationStart = (event) => {
88
+ if (event.target === node) {
89
+ prevAnimationNameRef.current = getAnimationName(stylesRef.current);
90
+ }
91
+ };
92
+ node.addEventListener("animationstart", handleAnimationStart);
93
+ node.addEventListener("animationcancel", handleAnimationEnd);
94
+ node.addEventListener("animationend", handleAnimationEnd);
95
+ return () => {
96
+ ownerWindow.clearTimeout(timeoutId);
97
+ node.removeEventListener("animationstart", handleAnimationStart);
98
+ node.removeEventListener("animationcancel", handleAnimationEnd);
99
+ node.removeEventListener("animationend", handleAnimationEnd);
100
+ };
101
+ } else {
102
+ send("ANIMATION_END");
103
+ }
104
+ }, [node, send]);
105
+ return {
106
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
107
+ ref: React.useCallback((node2) => {
108
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
109
+ setNode(node2);
110
+ }, [])
111
+ };
112
+ }
113
+ function getAnimationName(styles) {
114
+ return styles?.animationName || "none";
115
+ }
116
+ function getElementRef(element) {
117
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
118
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
119
+ if (mayWarn) {
120
+ return element.ref;
121
+ }
122
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
123
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
124
+ if (mayWarn) {
125
+ return element.props.ref;
126
+ }
127
+ return element.props.ref || element.ref;
128
+ }
129
+
130
+ export { Presence };
@@ -0,0 +1,43 @@
1
+ import * as React from 'react';
2
+ import * as ReactDOM from 'react-dom';
3
+ import { createSlot } from '../../react-slot/dist/index.js';
4
+ import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
5
+
6
+ // src/primitive.tsx
7
+ var NODES = [
8
+ "a",
9
+ "button",
10
+ "div",
11
+ "form",
12
+ "h2",
13
+ "h3",
14
+ "img",
15
+ "input",
16
+ "label",
17
+ "li",
18
+ "nav",
19
+ "ol",
20
+ "p",
21
+ "select",
22
+ "span",
23
+ "svg",
24
+ "ul"
25
+ ];
26
+ var Primitive = NODES.reduce((primitive, node) => {
27
+ const Slot = createSlot(`Primitive.${node}`);
28
+ const Node = React.forwardRef((props, forwardedRef) => {
29
+ const { asChild, ...primitiveProps } = props;
30
+ const Comp = asChild ? Slot : node;
31
+ if (typeof window !== "undefined") {
32
+ window[Symbol.for("radix-ui")] = true;
33
+ }
34
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
35
+ });
36
+ Node.displayName = `Primitive.${node}`;
37
+ return { ...primitive, [node]: Node };
38
+ }, {});
39
+ function dispatchDiscreteCustomEvent(target, event) {
40
+ if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
41
+ }
42
+
43
+ export { Primitive, dispatchDiscreteCustomEvent };
@@ -0,0 +1,282 @@
1
+ import * as React from 'react';
2
+ import { composeEventHandlers } from '../../primitive/dist/index.js';
3
+ import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
4
+ import { createContextScope } from '../../react-context/dist/index.js';
5
+ import { Primitive } from '../../react-primitive/dist/index.js';
6
+ import { createRovingFocusGroupScope, Root, Item } from '../../react-roving-focus/dist/index.js';
7
+ import { useControllableState } from '../../react-use-controllable-state/dist/index.js';
8
+ import { useDirection } from '../../react-direction/dist/index.js';
9
+ import { useSize } from '../../react-use-size/dist/index.js';
10
+ import { usePrevious } from '../../react-use-previous/dist/index.js';
11
+ import { Presence } from '../../react-presence/dist/index.js';
12
+ import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
13
+
14
+ var RADIO_NAME = "Radio";
15
+ var [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);
16
+ var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
17
+ var Radio = React.forwardRef(
18
+ (props, forwardedRef) => {
19
+ const {
20
+ __scopeRadio,
21
+ name,
22
+ checked = false,
23
+ required,
24
+ disabled,
25
+ value = "on",
26
+ onCheck,
27
+ form,
28
+ ...radioProps
29
+ } = props;
30
+ const [button, setButton] = React.useState(null);
31
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
32
+ const hasConsumerStoppedPropagationRef = React.useRef(false);
33
+ const isFormControl = button ? form || !!button.closest("form") : true;
34
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
35
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36
+ Primitive.button,
37
+ {
38
+ type: "button",
39
+ role: "radio",
40
+ "aria-checked": checked,
41
+ "data-state": getState(checked),
42
+ "data-disabled": disabled ? "" : void 0,
43
+ disabled,
44
+ value,
45
+ ...radioProps,
46
+ ref: composedRefs,
47
+ onClick: composeEventHandlers(props.onClick, (event) => {
48
+ if (!checked) onCheck?.();
49
+ if (isFormControl) {
50
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
51
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
52
+ }
53
+ })
54
+ }
55
+ ),
56
+ isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
57
+ RadioBubbleInput,
58
+ {
59
+ control: button,
60
+ bubbles: !hasConsumerStoppedPropagationRef.current,
61
+ name,
62
+ value,
63
+ checked,
64
+ required,
65
+ disabled,
66
+ form,
67
+ style: { transform: "translateX(-100%)" }
68
+ }
69
+ )
70
+ ] });
71
+ }
72
+ );
73
+ Radio.displayName = RADIO_NAME;
74
+ var INDICATOR_NAME = "RadioIndicator";
75
+ var RadioIndicator = React.forwardRef(
76
+ (props, forwardedRef) => {
77
+ const { __scopeRadio, forceMount, ...indicatorProps } = props;
78
+ const context = useRadioContext(INDICATOR_NAME, __scopeRadio);
79
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
80
+ Primitive.span,
81
+ {
82
+ "data-state": getState(context.checked),
83
+ "data-disabled": context.disabled ? "" : void 0,
84
+ ...indicatorProps,
85
+ ref: forwardedRef
86
+ }
87
+ ) });
88
+ }
89
+ );
90
+ RadioIndicator.displayName = INDICATOR_NAME;
91
+ var BUBBLE_INPUT_NAME = "RadioBubbleInput";
92
+ var RadioBubbleInput = React.forwardRef(
93
+ ({
94
+ __scopeRadio,
95
+ control,
96
+ checked,
97
+ bubbles = true,
98
+ ...props
99
+ }, forwardedRef) => {
100
+ const ref = React.useRef(null);
101
+ const composedRefs = useComposedRefs(ref, forwardedRef);
102
+ const prevChecked = usePrevious(checked);
103
+ const controlSize = useSize(control);
104
+ React.useEffect(() => {
105
+ const input = ref.current;
106
+ if (!input) return;
107
+ const inputProto = window.HTMLInputElement.prototype;
108
+ const descriptor = Object.getOwnPropertyDescriptor(
109
+ inputProto,
110
+ "checked"
111
+ );
112
+ const setChecked = descriptor.set;
113
+ if (prevChecked !== checked && setChecked) {
114
+ const event = new Event("click", { bubbles });
115
+ setChecked.call(input, checked);
116
+ input.dispatchEvent(event);
117
+ }
118
+ }, [prevChecked, checked, bubbles]);
119
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
120
+ Primitive.input,
121
+ {
122
+ type: "radio",
123
+ "aria-hidden": true,
124
+ defaultChecked: checked,
125
+ ...props,
126
+ tabIndex: -1,
127
+ ref: composedRefs,
128
+ style: {
129
+ ...props.style,
130
+ ...controlSize,
131
+ position: "absolute",
132
+ pointerEvents: "none",
133
+ opacity: 0,
134
+ margin: 0
135
+ }
136
+ }
137
+ );
138
+ }
139
+ );
140
+ RadioBubbleInput.displayName = BUBBLE_INPUT_NAME;
141
+ function getState(checked) {
142
+ return checked ? "checked" : "unchecked";
143
+ }
144
+ var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
145
+ var RADIO_GROUP_NAME = "RadioGroup";
146
+ var [createRadioGroupContext] = createContextScope(RADIO_GROUP_NAME, [
147
+ createRovingFocusGroupScope,
148
+ createRadioScope
149
+ ]);
150
+ var useRovingFocusGroupScope = createRovingFocusGroupScope();
151
+ var useRadioScope = createRadioScope();
152
+ var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
153
+ var RadioGroup = React.forwardRef(
154
+ (props, forwardedRef) => {
155
+ const {
156
+ __scopeRadioGroup,
157
+ name,
158
+ defaultValue,
159
+ value: valueProp,
160
+ required = false,
161
+ disabled = false,
162
+ orientation,
163
+ dir,
164
+ loop = true,
165
+ onValueChange,
166
+ ...groupProps
167
+ } = props;
168
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
169
+ const direction = useDirection(dir);
170
+ const [value, setValue] = useControllableState({
171
+ prop: valueProp,
172
+ defaultProp: defaultValue ?? null,
173
+ onChange: onValueChange,
174
+ caller: RADIO_GROUP_NAME
175
+ });
176
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
177
+ RadioGroupProvider,
178
+ {
179
+ scope: __scopeRadioGroup,
180
+ name,
181
+ required,
182
+ disabled,
183
+ value,
184
+ onValueChange: setValue,
185
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
186
+ Root,
187
+ {
188
+ asChild: true,
189
+ ...rovingFocusGroupScope,
190
+ orientation,
191
+ dir: direction,
192
+ loop,
193
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
194
+ Primitive.div,
195
+ {
196
+ role: "radiogroup",
197
+ "aria-required": required,
198
+ "aria-orientation": orientation,
199
+ "data-disabled": disabled ? "" : void 0,
200
+ dir: direction,
201
+ ...groupProps,
202
+ ref: forwardedRef
203
+ }
204
+ )
205
+ }
206
+ )
207
+ }
208
+ );
209
+ }
210
+ );
211
+ RadioGroup.displayName = RADIO_GROUP_NAME;
212
+ var ITEM_NAME = "RadioGroupItem";
213
+ var RadioGroupItem = React.forwardRef(
214
+ (props, forwardedRef) => {
215
+ const { __scopeRadioGroup, disabled, ...itemProps } = props;
216
+ const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);
217
+ const isDisabled = context.disabled || disabled;
218
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
219
+ const radioScope = useRadioScope(__scopeRadioGroup);
220
+ const ref = React.useRef(null);
221
+ const composedRefs = useComposedRefs(forwardedRef, ref);
222
+ const checked = context.value === itemProps.value;
223
+ const isArrowKeyPressedRef = React.useRef(false);
224
+ React.useEffect(() => {
225
+ const handleKeyDown = (event) => {
226
+ if (ARROW_KEYS.includes(event.key)) {
227
+ isArrowKeyPressedRef.current = true;
228
+ }
229
+ };
230
+ const handleKeyUp = () => isArrowKeyPressedRef.current = false;
231
+ document.addEventListener("keydown", handleKeyDown);
232
+ document.addEventListener("keyup", handleKeyUp);
233
+ return () => {
234
+ document.removeEventListener("keydown", handleKeyDown);
235
+ document.removeEventListener("keyup", handleKeyUp);
236
+ };
237
+ }, []);
238
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
239
+ Item,
240
+ {
241
+ asChild: true,
242
+ ...rovingFocusGroupScope,
243
+ focusable: !isDisabled,
244
+ active: checked,
245
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
246
+ Radio,
247
+ {
248
+ disabled: isDisabled,
249
+ required: context.required,
250
+ checked,
251
+ ...radioScope,
252
+ ...itemProps,
253
+ name: context.name,
254
+ ref: composedRefs,
255
+ onCheck: () => context.onValueChange(itemProps.value),
256
+ onKeyDown: composeEventHandlers((event) => {
257
+ if (event.key === "Enter") event.preventDefault();
258
+ }),
259
+ onFocus: composeEventHandlers(itemProps.onFocus, () => {
260
+ if (isArrowKeyPressedRef.current) ref.current?.click();
261
+ })
262
+ }
263
+ )
264
+ }
265
+ );
266
+ }
267
+ );
268
+ RadioGroupItem.displayName = ITEM_NAME;
269
+ var INDICATOR_NAME2 = "RadioGroupIndicator";
270
+ var RadioGroupIndicator = React.forwardRef(
271
+ (props, forwardedRef) => {
272
+ const { __scopeRadioGroup, ...indicatorProps } = props;
273
+ const radioScope = useRadioScope(__scopeRadioGroup);
274
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef });
275
+ }
276
+ );
277
+ RadioGroupIndicator.displayName = INDICATOR_NAME2;
278
+ var Root2 = RadioGroup;
279
+ var Item2 = RadioGroupItem;
280
+ var Indicator = RadioGroupIndicator;
281
+
282
+ export { Indicator, Item2 as Item, RadioGroup, RadioGroupIndicator, RadioGroupItem, Root2 as Root };
@@ -0,0 +1,223 @@
1
+ import * as React from 'react';
2
+ import { composeEventHandlers } from '../../primitive/dist/index.js';
3
+ import { createCollection } from '../../react-collection/dist/index.js';
4
+ import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
5
+ import { createContextScope } from '../../react-context/dist/index.js';
6
+ import { useId } from '../../react-id/dist/index.js';
7
+ import { Primitive } from '../../react-primitive/dist/index.js';
8
+ import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
9
+ import { useControllableState } from '../../react-use-controllable-state/dist/index.js';
10
+ import { useDirection } from '../../react-direction/dist/index.js';
11
+ import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
12
+
13
+ var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
14
+ var EVENT_OPTIONS = { bubbles: false, cancelable: true };
15
+ var GROUP_NAME = "RovingFocusGroup";
16
+ var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
17
+ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
18
+ GROUP_NAME,
19
+ [createCollectionScope]
20
+ );
21
+ var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
22
+ var RovingFocusGroup = React.forwardRef(
23
+ (props, forwardedRef) => {
24
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
25
+ }
26
+ );
27
+ RovingFocusGroup.displayName = GROUP_NAME;
28
+ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
29
+ const {
30
+ __scopeRovingFocusGroup,
31
+ orientation,
32
+ loop = false,
33
+ dir,
34
+ currentTabStopId: currentTabStopIdProp,
35
+ defaultCurrentTabStopId,
36
+ onCurrentTabStopIdChange,
37
+ onEntryFocus,
38
+ preventScrollOnEntryFocus = false,
39
+ ...groupProps
40
+ } = props;
41
+ const ref = React.useRef(null);
42
+ const composedRefs = useComposedRefs(forwardedRef, ref);
43
+ const direction = useDirection(dir);
44
+ const [currentTabStopId, setCurrentTabStopId] = useControllableState({
45
+ prop: currentTabStopIdProp,
46
+ defaultProp: defaultCurrentTabStopId ?? null,
47
+ onChange: onCurrentTabStopIdChange,
48
+ caller: GROUP_NAME
49
+ });
50
+ const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
51
+ const handleEntryFocus = useCallbackRef(onEntryFocus);
52
+ const getItems = useCollection(__scopeRovingFocusGroup);
53
+ const isClickFocusRef = React.useRef(false);
54
+ const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
55
+ React.useEffect(() => {
56
+ const node = ref.current;
57
+ if (node) {
58
+ node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
59
+ return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
60
+ }
61
+ }, [handleEntryFocus]);
62
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
63
+ RovingFocusProvider,
64
+ {
65
+ scope: __scopeRovingFocusGroup,
66
+ orientation,
67
+ dir: direction,
68
+ loop,
69
+ currentTabStopId,
70
+ onItemFocus: React.useCallback(
71
+ (tabStopId) => setCurrentTabStopId(tabStopId),
72
+ [setCurrentTabStopId]
73
+ ),
74
+ onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
75
+ onFocusableItemAdd: React.useCallback(
76
+ () => setFocusableItemsCount((prevCount) => prevCount + 1),
77
+ []
78
+ ),
79
+ onFocusableItemRemove: React.useCallback(
80
+ () => setFocusableItemsCount((prevCount) => prevCount - 1),
81
+ []
82
+ ),
83
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
84
+ Primitive.div,
85
+ {
86
+ tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
87
+ "data-orientation": orientation,
88
+ ...groupProps,
89
+ ref: composedRefs,
90
+ style: { outline: "none", ...props.style },
91
+ onMouseDown: composeEventHandlers(props.onMouseDown, () => {
92
+ isClickFocusRef.current = true;
93
+ }),
94
+ onFocus: composeEventHandlers(props.onFocus, (event) => {
95
+ const isKeyboardFocus = !isClickFocusRef.current;
96
+ if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
97
+ const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
98
+ event.currentTarget.dispatchEvent(entryFocusEvent);
99
+ if (!entryFocusEvent.defaultPrevented) {
100
+ const items = getItems().filter((item) => item.focusable);
101
+ const activeItem = items.find((item) => item.active);
102
+ const currentItem = items.find((item) => item.id === currentTabStopId);
103
+ const candidateItems = [activeItem, currentItem, ...items].filter(
104
+ Boolean
105
+ );
106
+ const candidateNodes = candidateItems.map((item) => item.ref.current);
107
+ focusFirst(candidateNodes, preventScrollOnEntryFocus);
108
+ }
109
+ }
110
+ isClickFocusRef.current = false;
111
+ }),
112
+ onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
113
+ }
114
+ )
115
+ }
116
+ );
117
+ });
118
+ var ITEM_NAME = "RovingFocusGroupItem";
119
+ var RovingFocusGroupItem = React.forwardRef(
120
+ (props, forwardedRef) => {
121
+ const {
122
+ __scopeRovingFocusGroup,
123
+ focusable = true,
124
+ active = false,
125
+ tabStopId,
126
+ children,
127
+ ...itemProps
128
+ } = props;
129
+ const autoId = useId();
130
+ const id = tabStopId || autoId;
131
+ const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
132
+ const isCurrentTabStop = context.currentTabStopId === id;
133
+ const getItems = useCollection(__scopeRovingFocusGroup);
134
+ const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
135
+ React.useEffect(() => {
136
+ if (focusable) {
137
+ onFocusableItemAdd();
138
+ return () => onFocusableItemRemove();
139
+ }
140
+ }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
141
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
142
+ Collection.ItemSlot,
143
+ {
144
+ scope: __scopeRovingFocusGroup,
145
+ id,
146
+ focusable,
147
+ active,
148
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
149
+ Primitive.span,
150
+ {
151
+ tabIndex: isCurrentTabStop ? 0 : -1,
152
+ "data-orientation": context.orientation,
153
+ ...itemProps,
154
+ ref: forwardedRef,
155
+ onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
156
+ if (!focusable) event.preventDefault();
157
+ else context.onItemFocus(id);
158
+ }),
159
+ onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
160
+ onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
161
+ if (event.key === "Tab" && event.shiftKey) {
162
+ context.onItemShiftTab();
163
+ return;
164
+ }
165
+ if (event.target !== event.currentTarget) return;
166
+ const focusIntent = getFocusIntent(event, context.orientation, context.dir);
167
+ if (focusIntent !== void 0) {
168
+ if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
169
+ event.preventDefault();
170
+ const items = getItems().filter((item) => item.focusable);
171
+ let candidateNodes = items.map((item) => item.ref.current);
172
+ if (focusIntent === "last") candidateNodes.reverse();
173
+ else if (focusIntent === "prev" || focusIntent === "next") {
174
+ if (focusIntent === "prev") candidateNodes.reverse();
175
+ const currentIndex = candidateNodes.indexOf(event.currentTarget);
176
+ candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
177
+ }
178
+ setTimeout(() => focusFirst(candidateNodes));
179
+ }
180
+ }),
181
+ children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
182
+ }
183
+ )
184
+ }
185
+ );
186
+ }
187
+ );
188
+ RovingFocusGroupItem.displayName = ITEM_NAME;
189
+ var MAP_KEY_TO_FOCUS_INTENT = {
190
+ ArrowLeft: "prev",
191
+ ArrowUp: "prev",
192
+ ArrowRight: "next",
193
+ ArrowDown: "next",
194
+ PageUp: "first",
195
+ Home: "first",
196
+ PageDown: "last",
197
+ End: "last"
198
+ };
199
+ function getDirectionAwareKey(key, dir) {
200
+ if (dir !== "rtl") return key;
201
+ return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
202
+ }
203
+ function getFocusIntent(event, orientation, dir) {
204
+ const key = getDirectionAwareKey(event.key, dir);
205
+ if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
206
+ if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
207
+ return MAP_KEY_TO_FOCUS_INTENT[key];
208
+ }
209
+ function focusFirst(candidates, preventScroll = false) {
210
+ const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
211
+ for (const candidate of candidates) {
212
+ if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
213
+ candidate.focus({ preventScroll });
214
+ if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
215
+ }
216
+ }
217
+ function wrapArray(array, startIndex) {
218
+ return array.map((_, index) => array[(startIndex + index) % array.length]);
219
+ }
220
+ var Root = RovingFocusGroup;
221
+ var Item = RovingFocusGroupItem;
222
+
223
+ export { Item, Root, RovingFocusGroup, RovingFocusGroupItem, createRovingFocusGroupScope };