ingeniuscliq-core 0.4.24 → 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,321 @@
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, createContext as createContext2 } from '../../react-context/dist/index.js';
5
+ import { useId } from '../../react-id/dist/index.js';
6
+ import { useControllableState } from '../../react-use-controllable-state/dist/index.js';
7
+ import { DismissableLayer } from '../../react-dismissable-layer/dist/index.js';
8
+ import { FocusScope } from '../../react-focus-scope/dist/index.js';
9
+ import { Portal as Portal$1 } from '../../react-portal/dist/index.js';
10
+ import { Presence } from '../../react-presence/dist/index.js';
11
+ import { Primitive } from '../../react-primitive/dist/index.js';
12
+ import { useFocusGuards } from '../../react-focus-guards/dist/index.js';
13
+ import ReactRemoveScroll from '../../../react-remove-scroll/dist/es2015/Combination.js';
14
+ import { hideOthers } from '../../../aria-hidden/dist/es2015/index.js';
15
+ import { createSlot } from '../../react-slot/dist/index.js';
16
+ import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
17
+
18
+ var DIALOG_NAME = "Dialog";
19
+ var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
20
+ var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
21
+ var Dialog = (props) => {
22
+ const {
23
+ __scopeDialog,
24
+ children,
25
+ open: openProp,
26
+ defaultOpen,
27
+ onOpenChange,
28
+ modal = true
29
+ } = props;
30
+ const triggerRef = React.useRef(null);
31
+ const contentRef = React.useRef(null);
32
+ const [open, setOpen] = useControllableState({
33
+ prop: openProp,
34
+ defaultProp: defaultOpen ?? false,
35
+ onChange: onOpenChange,
36
+ caller: DIALOG_NAME
37
+ });
38
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
39
+ DialogProvider,
40
+ {
41
+ scope: __scopeDialog,
42
+ triggerRef,
43
+ contentRef,
44
+ contentId: useId(),
45
+ titleId: useId(),
46
+ descriptionId: useId(),
47
+ open,
48
+ onOpenChange: setOpen,
49
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
50
+ modal,
51
+ children
52
+ }
53
+ );
54
+ };
55
+ Dialog.displayName = DIALOG_NAME;
56
+ var TRIGGER_NAME = "DialogTrigger";
57
+ var DialogTrigger = React.forwardRef(
58
+ (props, forwardedRef) => {
59
+ const { __scopeDialog, ...triggerProps } = props;
60
+ const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
61
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
62
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
63
+ Primitive.button,
64
+ {
65
+ type: "button",
66
+ "aria-haspopup": "dialog",
67
+ "aria-expanded": context.open,
68
+ "aria-controls": context.contentId,
69
+ "data-state": getState(context.open),
70
+ ...triggerProps,
71
+ ref: composedTriggerRef,
72
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
73
+ }
74
+ );
75
+ }
76
+ );
77
+ DialogTrigger.displayName = TRIGGER_NAME;
78
+ var PORTAL_NAME = "DialogPortal";
79
+ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
80
+ forceMount: void 0
81
+ });
82
+ var DialogPortal = (props) => {
83
+ const { __scopeDialog, forceMount, children, container } = props;
84
+ const context = useDialogContext(PORTAL_NAME, __scopeDialog);
85
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Portal$1, { asChild: true, container, children: child }) })) });
86
+ };
87
+ DialogPortal.displayName = PORTAL_NAME;
88
+ var OVERLAY_NAME = "DialogOverlay";
89
+ var DialogOverlay = React.forwardRef(
90
+ (props, forwardedRef) => {
91
+ const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
92
+ const { forceMount = portalContext.forceMount, ...overlayProps } = props;
93
+ const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
94
+ return context.modal ? /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
95
+ }
96
+ );
97
+ DialogOverlay.displayName = OVERLAY_NAME;
98
+ var Slot = createSlot("DialogOverlay.RemoveScroll");
99
+ var DialogOverlayImpl = React.forwardRef(
100
+ (props, forwardedRef) => {
101
+ const { __scopeDialog, ...overlayProps } = props;
102
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
103
+ return (
104
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
105
+ // ie. when `Overlay` and `Content` are siblings
106
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
107
+ Primitive.div,
108
+ {
109
+ "data-state": getState(context.open),
110
+ ...overlayProps,
111
+ ref: forwardedRef,
112
+ style: { pointerEvents: "auto", ...overlayProps.style }
113
+ }
114
+ ) })
115
+ );
116
+ }
117
+ );
118
+ var CONTENT_NAME = "DialogContent";
119
+ var DialogContent = React.forwardRef(
120
+ (props, forwardedRef) => {
121
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
122
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
123
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
124
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
125
+ }
126
+ );
127
+ DialogContent.displayName = CONTENT_NAME;
128
+ var DialogContentModal = React.forwardRef(
129
+ (props, forwardedRef) => {
130
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
131
+ const contentRef = React.useRef(null);
132
+ const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
133
+ React.useEffect(() => {
134
+ const content = contentRef.current;
135
+ if (content) return hideOthers(content);
136
+ }, []);
137
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
138
+ DialogContentImpl,
139
+ {
140
+ ...props,
141
+ ref: composedRefs,
142
+ trapFocus: context.open,
143
+ disableOutsidePointerEvents: true,
144
+ onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
145
+ event.preventDefault();
146
+ context.triggerRef.current?.focus();
147
+ }),
148
+ onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
149
+ const originalEvent = event.detail.originalEvent;
150
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
151
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
152
+ if (isRightClick) event.preventDefault();
153
+ }),
154
+ onFocusOutside: composeEventHandlers(
155
+ props.onFocusOutside,
156
+ (event) => event.preventDefault()
157
+ )
158
+ }
159
+ );
160
+ }
161
+ );
162
+ var DialogContentNonModal = React.forwardRef(
163
+ (props, forwardedRef) => {
164
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
165
+ const hasInteractedOutsideRef = React.useRef(false);
166
+ const hasPointerDownOutsideRef = React.useRef(false);
167
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
168
+ DialogContentImpl,
169
+ {
170
+ ...props,
171
+ ref: forwardedRef,
172
+ trapFocus: false,
173
+ disableOutsidePointerEvents: false,
174
+ onCloseAutoFocus: (event) => {
175
+ props.onCloseAutoFocus?.(event);
176
+ if (!event.defaultPrevented) {
177
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
178
+ event.preventDefault();
179
+ }
180
+ hasInteractedOutsideRef.current = false;
181
+ hasPointerDownOutsideRef.current = false;
182
+ },
183
+ onInteractOutside: (event) => {
184
+ props.onInteractOutside?.(event);
185
+ if (!event.defaultPrevented) {
186
+ hasInteractedOutsideRef.current = true;
187
+ if (event.detail.originalEvent.type === "pointerdown") {
188
+ hasPointerDownOutsideRef.current = true;
189
+ }
190
+ }
191
+ const target = event.target;
192
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
193
+ if (targetIsTrigger) event.preventDefault();
194
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
195
+ event.preventDefault();
196
+ }
197
+ }
198
+ }
199
+ );
200
+ }
201
+ );
202
+ var DialogContentImpl = React.forwardRef(
203
+ (props, forwardedRef) => {
204
+ const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
205
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
206
+ const contentRef = React.useRef(null);
207
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
208
+ useFocusGuards();
209
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
210
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
211
+ FocusScope,
212
+ {
213
+ asChild: true,
214
+ loop: true,
215
+ trapped: trapFocus,
216
+ onMountAutoFocus: onOpenAutoFocus,
217
+ onUnmountAutoFocus: onCloseAutoFocus,
218
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
219
+ DismissableLayer,
220
+ {
221
+ role: "dialog",
222
+ id: context.contentId,
223
+ "aria-describedby": context.descriptionId,
224
+ "aria-labelledby": context.titleId,
225
+ "data-state": getState(context.open),
226
+ ...contentProps,
227
+ ref: composedRefs,
228
+ onDismiss: () => context.onOpenChange(false)
229
+ }
230
+ )
231
+ }
232
+ ),
233
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
234
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TitleWarning, { titleId: context.titleId }),
235
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
236
+ ] })
237
+ ] });
238
+ }
239
+ );
240
+ var TITLE_NAME = "DialogTitle";
241
+ var DialogTitle = React.forwardRef(
242
+ (props, forwardedRef) => {
243
+ const { __scopeDialog, ...titleProps } = props;
244
+ const context = useDialogContext(TITLE_NAME, __scopeDialog);
245
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
246
+ }
247
+ );
248
+ DialogTitle.displayName = TITLE_NAME;
249
+ var DESCRIPTION_NAME = "DialogDescription";
250
+ var DialogDescription = React.forwardRef(
251
+ (props, forwardedRef) => {
252
+ const { __scopeDialog, ...descriptionProps } = props;
253
+ const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
254
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
255
+ }
256
+ );
257
+ DialogDescription.displayName = DESCRIPTION_NAME;
258
+ var CLOSE_NAME = "DialogClose";
259
+ var DialogClose = React.forwardRef(
260
+ (props, forwardedRef) => {
261
+ const { __scopeDialog, ...closeProps } = props;
262
+ const context = useDialogContext(CLOSE_NAME, __scopeDialog);
263
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
264
+ Primitive.button,
265
+ {
266
+ type: "button",
267
+ ...closeProps,
268
+ ref: forwardedRef,
269
+ onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
270
+ }
271
+ );
272
+ }
273
+ );
274
+ DialogClose.displayName = CLOSE_NAME;
275
+ function getState(open) {
276
+ return open ? "open" : "closed";
277
+ }
278
+ var TITLE_WARNING_NAME = "DialogTitleWarning";
279
+ var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
280
+ contentName: CONTENT_NAME,
281
+ titleName: TITLE_NAME,
282
+ docsSlug: "dialog"
283
+ });
284
+ var TitleWarning = ({ titleId }) => {
285
+ const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
286
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
287
+
288
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
289
+
290
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
291
+ React.useEffect(() => {
292
+ if (titleId) {
293
+ const hasTitle = document.getElementById(titleId);
294
+ if (!hasTitle) console.error(MESSAGE);
295
+ }
296
+ }, [MESSAGE, titleId]);
297
+ return null;
298
+ };
299
+ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
300
+ var DescriptionWarning = ({ contentRef, descriptionId }) => {
301
+ const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
302
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
303
+ React.useEffect(() => {
304
+ const describedById = contentRef.current?.getAttribute("aria-describedby");
305
+ if (descriptionId && describedById) {
306
+ const hasDescription = document.getElementById(descriptionId);
307
+ if (!hasDescription) console.warn(MESSAGE);
308
+ }
309
+ }, [MESSAGE, contentRef, descriptionId]);
310
+ return null;
311
+ };
312
+ var Root = Dialog;
313
+ var Trigger = DialogTrigger;
314
+ var Portal = DialogPortal;
315
+ var Overlay = DialogOverlay;
316
+ var Content = DialogContent;
317
+ var Title = DialogTitle;
318
+ var Description = DialogDescription;
319
+ var Close = DialogClose;
320
+
321
+ export { Close, Content, Description, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Overlay, Portal, Root, Title, Trigger, WarningProvider, createDialogScope };
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import '../../../../_virtual/jsx-runtime.js';
3
+
4
+ // packages/react/direction/src/direction.tsx
5
+ var DirectionContext = React.createContext(void 0);
6
+ function useDirection(localDir) {
7
+ const globalDir = React.useContext(DirectionContext);
8
+ return localDir || globalDir || "ltr";
9
+ }
10
+
11
+ export { useDirection };
@@ -0,0 +1,211 @@
1
+ import * as React from 'react';
2
+ import { composeEventHandlers } from '../../primitive/dist/index.js';
3
+ import { Primitive, dispatchDiscreteCustomEvent } from '../../react-primitive/dist/index.js';
4
+ import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
5
+ import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
6
+ import { useEscapeKeydown } from '../../react-use-escape-keydown/dist/index.js';
7
+ import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
8
+
9
+ var DISMISSABLE_LAYER_NAME = "DismissableLayer";
10
+ var CONTEXT_UPDATE = "dismissableLayer.update";
11
+ var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
12
+ var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
13
+ var originalBodyPointerEvents;
14
+ var DismissableLayerContext = React.createContext({
15
+ layers: /* @__PURE__ */ new Set(),
16
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
17
+ branches: /* @__PURE__ */ new Set()
18
+ });
19
+ var DismissableLayer = React.forwardRef(
20
+ (props, forwardedRef) => {
21
+ const {
22
+ disableOutsidePointerEvents = false,
23
+ onEscapeKeyDown,
24
+ onPointerDownOutside,
25
+ onFocusOutside,
26
+ onInteractOutside,
27
+ onDismiss,
28
+ ...layerProps
29
+ } = props;
30
+ const context = React.useContext(DismissableLayerContext);
31
+ const [node, setNode] = React.useState(null);
32
+ const ownerDocument = node?.ownerDocument ?? globalThis?.document;
33
+ const [, force] = React.useState({});
34
+ const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
35
+ const layers = Array.from(context.layers);
36
+ const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
37
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
38
+ const index = node ? layers.indexOf(node) : -1;
39
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
40
+ const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
41
+ const pointerDownOutside = usePointerDownOutside((event) => {
42
+ const target = event.target;
43
+ const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
44
+ if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
45
+ onPointerDownOutside?.(event);
46
+ onInteractOutside?.(event);
47
+ if (!event.defaultPrevented) onDismiss?.();
48
+ }, ownerDocument);
49
+ const focusOutside = useFocusOutside((event) => {
50
+ const target = event.target;
51
+ const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
52
+ if (isFocusInBranch) return;
53
+ onFocusOutside?.(event);
54
+ onInteractOutside?.(event);
55
+ if (!event.defaultPrevented) onDismiss?.();
56
+ }, ownerDocument);
57
+ useEscapeKeydown((event) => {
58
+ const isHighestLayer = index === context.layers.size - 1;
59
+ if (!isHighestLayer) return;
60
+ onEscapeKeyDown?.(event);
61
+ if (!event.defaultPrevented && onDismiss) {
62
+ event.preventDefault();
63
+ onDismiss();
64
+ }
65
+ }, ownerDocument);
66
+ React.useEffect(() => {
67
+ if (!node) return;
68
+ if (disableOutsidePointerEvents) {
69
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
70
+ originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
71
+ ownerDocument.body.style.pointerEvents = "none";
72
+ }
73
+ context.layersWithOutsidePointerEventsDisabled.add(node);
74
+ }
75
+ context.layers.add(node);
76
+ dispatchUpdate();
77
+ return () => {
78
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
79
+ ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
80
+ }
81
+ };
82
+ }, [node, ownerDocument, disableOutsidePointerEvents, context]);
83
+ React.useEffect(() => {
84
+ return () => {
85
+ if (!node) return;
86
+ context.layers.delete(node);
87
+ context.layersWithOutsidePointerEventsDisabled.delete(node);
88
+ dispatchUpdate();
89
+ };
90
+ }, [node, context]);
91
+ React.useEffect(() => {
92
+ const handleUpdate = () => force({});
93
+ document.addEventListener(CONTEXT_UPDATE, handleUpdate);
94
+ return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
95
+ }, []);
96
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
97
+ Primitive.div,
98
+ {
99
+ ...layerProps,
100
+ ref: composedRefs,
101
+ style: {
102
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
103
+ ...props.style
104
+ },
105
+ onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
106
+ onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
107
+ onPointerDownCapture: composeEventHandlers(
108
+ props.onPointerDownCapture,
109
+ pointerDownOutside.onPointerDownCapture
110
+ )
111
+ }
112
+ );
113
+ }
114
+ );
115
+ DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
116
+ var BRANCH_NAME = "DismissableLayerBranch";
117
+ var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
118
+ const context = React.useContext(DismissableLayerContext);
119
+ const ref = React.useRef(null);
120
+ const composedRefs = useComposedRefs(forwardedRef, ref);
121
+ React.useEffect(() => {
122
+ const node = ref.current;
123
+ if (node) {
124
+ context.branches.add(node);
125
+ return () => {
126
+ context.branches.delete(node);
127
+ };
128
+ }
129
+ }, [context.branches]);
130
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...props, ref: composedRefs });
131
+ });
132
+ DismissableLayerBranch.displayName = BRANCH_NAME;
133
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
134
+ const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
135
+ const isPointerInsideReactTreeRef = React.useRef(false);
136
+ const handleClickRef = React.useRef(() => {
137
+ });
138
+ React.useEffect(() => {
139
+ const handlePointerDown = (event) => {
140
+ if (event.target && !isPointerInsideReactTreeRef.current) {
141
+ let handleAndDispatchPointerDownOutsideEvent2 = function() {
142
+ handleAndDispatchCustomEvent(
143
+ POINTER_DOWN_OUTSIDE,
144
+ handlePointerDownOutside,
145
+ eventDetail,
146
+ { discrete: true }
147
+ );
148
+ };
149
+ const eventDetail = { originalEvent: event };
150
+ if (event.pointerType === "touch") {
151
+ ownerDocument.removeEventListener("click", handleClickRef.current);
152
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
153
+ ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
154
+ } else {
155
+ handleAndDispatchPointerDownOutsideEvent2();
156
+ }
157
+ } else {
158
+ ownerDocument.removeEventListener("click", handleClickRef.current);
159
+ }
160
+ isPointerInsideReactTreeRef.current = false;
161
+ };
162
+ const timerId = window.setTimeout(() => {
163
+ ownerDocument.addEventListener("pointerdown", handlePointerDown);
164
+ }, 0);
165
+ return () => {
166
+ window.clearTimeout(timerId);
167
+ ownerDocument.removeEventListener("pointerdown", handlePointerDown);
168
+ ownerDocument.removeEventListener("click", handleClickRef.current);
169
+ };
170
+ }, [ownerDocument, handlePointerDownOutside]);
171
+ return {
172
+ // ensures we check React component tree (not just DOM tree)
173
+ onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
174
+ };
175
+ }
176
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
177
+ const handleFocusOutside = useCallbackRef(onFocusOutside);
178
+ const isFocusInsideReactTreeRef = React.useRef(false);
179
+ React.useEffect(() => {
180
+ const handleFocus = (event) => {
181
+ if (event.target && !isFocusInsideReactTreeRef.current) {
182
+ const eventDetail = { originalEvent: event };
183
+ handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
184
+ discrete: false
185
+ });
186
+ }
187
+ };
188
+ ownerDocument.addEventListener("focusin", handleFocus);
189
+ return () => ownerDocument.removeEventListener("focusin", handleFocus);
190
+ }, [ownerDocument, handleFocusOutside]);
191
+ return {
192
+ onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
193
+ onBlurCapture: () => isFocusInsideReactTreeRef.current = false
194
+ };
195
+ }
196
+ function dispatchUpdate() {
197
+ const event = new CustomEvent(CONTEXT_UPDATE);
198
+ document.dispatchEvent(event);
199
+ }
200
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
201
+ const target = detail.originalEvent.target;
202
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
203
+ if (handler) target.addEventListener(name, handler, { once: true });
204
+ if (discrete) {
205
+ dispatchDiscreteCustomEvent(target, event);
206
+ } else {
207
+ target.dispatchEvent(event);
208
+ }
209
+ }
210
+
211
+ export { DismissableLayer, DismissableLayerBranch };