ingeniuscliq-core 0.4.25 → 0.4.27

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 (231) hide show
  1. package/dist/components/common/carousel/CustomCarousel.js +26 -0
  2. package/dist/components/common/carousel/CustomCarouselSection.js +41 -0
  3. package/dist/components/common/form/CustomFormField.js +29 -0
  4. package/dist/components/common/form/{FormCheckbox.tsx → FormCheckbox.js} +7 -7
  5. package/dist/components/common/form/{FormInput.tsx → FormInput.js} +5 -5
  6. package/dist/components/common/form/{FormSelect.tsx → FormSelect.js} +7 -7
  7. package/dist/components/common/form/{FormTextArea.tsx → FormTextArea.js} +5 -5
  8. package/dist/components/common/form/{FormWrapper.tsx → FormWrapper.js} +2 -2
  9. package/dist/components/common/logo/{Logo.tsx → Logo.js} +3 -3
  10. package/dist/components/common/pagination/{CustomPagination.tsx → CustomPagination.js} +6 -6
  11. package/dist/components/common/select/CustomSelect.js +27 -0
  12. package/dist/components/common/spinner/Spinner.js +32 -0
  13. package/dist/components/common/stepper/{Stepper.tsx → Stepper.js} +9 -9
  14. package/dist/components/layouts/CoreBaseLayout.js +19 -0
  15. package/dist/components/templates/CoreHomeLayout.js +8 -0
  16. package/dist/components/templates/{CorePreviewLayout.tsx → CorePreviewLayout.js} +3 -3
  17. package/dist/components/ui/accordion.js +44 -0
  18. package/dist/components/ui/{alert-dialog.tsx → alert-dialog.js} +28 -28
  19. package/dist/components/ui/{alert.tsx → alert.js} +5 -5
  20. package/dist/components/ui/{avatar.tsx → avatar.js} +11 -11
  21. package/dist/components/ui/{badge.tsx → badge.js} +3 -3
  22. package/dist/components/ui/{breadcrumb.tsx → breadcrumb.js} +13 -14
  23. package/dist/components/ui/{button.tsx → button.js} +4 -4
  24. package/dist/components/ui/{card.tsx → card.js} +8 -8
  25. package/dist/components/ui/{carousel.tsx → carousel.js} +14 -15
  26. package/dist/components/ui/{checkbox.tsx → checkbox.js} +9 -9
  27. package/dist/components/ui/{dialog.tsx → dialog.js} +26 -26
  28. package/dist/components/ui/{dropdown-menu.tsx → dropdown-menu.js} +37 -39
  29. package/dist/components/ui/{form.tsx → form.js} +10 -10
  30. package/dist/components/ui/{input.tsx → input.js} +2 -2
  31. package/dist/components/ui/{label.tsx → label.js} +6 -6
  32. package/dist/components/ui/{pagination.tsx → pagination.js} +16 -18
  33. package/dist/components/ui/{popover.tsx → popover.js} +8 -8
  34. package/dist/components/ui/radio-group.js +34 -0
  35. package/dist/components/ui/{select.tsx → select.js} +38 -40
  36. package/dist/components/ui/{separator.tsx → separator.js} +5 -5
  37. package/dist/components/ui/{sheet.tsx → sheet.js} +27 -27
  38. package/dist/components/ui/{skeleton.tsx → skeleton.js} +2 -2
  39. package/dist/components/ui/{slider.tsx → slider.js} +9 -9
  40. package/dist/components/ui/{stepper.tsx → stepper.js} +35 -35
  41. package/dist/components/ui/{switch.tsx → switch.js} +7 -7
  42. package/dist/components/ui/{table.tsx → table.js} +9 -9
  43. package/dist/components/ui/{tabs.tsx → tabs.js} +13 -13
  44. package/dist/components/ui/{textarea.tsx → textarea.js} +2 -2
  45. package/dist/components/ui/{tooltip.tsx → tooltip.js} +8 -8
  46. package/dist/helpers/axiosGlobal.js +1 -2
  47. package/dist/hooks/useNotification.js +1 -1
  48. package/dist/index.js +45 -45
  49. package/dist/lib/utils.js +2 -2
  50. package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
  51. package/dist/modules/CoreAuth/context/{AuthContext.tsx → AuthContext.js} +1 -1
  52. package/dist/modules/CoreAuth/index.js +2 -1
  53. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +1 -1
  54. package/dist/modules/CoreCustomization/index.js +1 -0
  55. package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +1 -1
  56. package/dist/modules/CoreOrder/index.js +1 -0
  57. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +1 -1
  58. package/dist/modules/CorePayForm/index.js +1 -0
  59. package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +1 -1
  60. package/dist/modules/CoreProduct/index.js +1 -0
  61. package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +1 -1
  62. package/dist/modules/CoreShipment/index.js +1 -0
  63. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +1 -1
  64. package/package.json +2 -7
  65. package/dist/_virtual/index.js +0 -5
  66. package/dist/_virtual/index2.js +0 -3
  67. package/dist/_virtual/jsx-runtime.js +0 -5
  68. package/dist/_virtual/jsx-runtime2.js +0 -3
  69. package/dist/_virtual/react-jsx-runtime.development.js +0 -3
  70. package/dist/_virtual/react-jsx-runtime.production.js +0 -3
  71. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -3
  72. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -3
  73. package/dist/components/common/carousel/CustomCarousel.tsx +0 -26
  74. package/dist/components/common/carousel/CustomCarouselSection.tsx +0 -41
  75. package/dist/components/common/form/CustomFormField.tsx +0 -29
  76. package/dist/components/common/select/CustomSelect.tsx +0 -27
  77. package/dist/components/common/spinner/Spinner.tsx +0 -32
  78. package/dist/components/layouts/CoreBaseLayout.tsx +0 -19
  79. package/dist/components/templates/CoreHomeLayout.tsx +0 -8
  80. package/dist/components/ui/accordion.tsx +0 -44
  81. package/dist/components/ui/radio-group.tsx +0 -34
  82. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
  83. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
  84. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
  85. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
  86. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
  87. package/dist/node_modules/@radix-ui/number/dist/index.js +0 -6
  88. package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
  89. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +0 -305
  90. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -147
  91. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
  92. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -118
  93. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -270
  94. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +0 -145
  95. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
  96. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
  97. package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -79
  98. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -321
  99. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -11
  100. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
  101. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -267
  102. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -29
  103. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
  104. package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
  105. package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -24
  106. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -834
  107. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -299
  108. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
  109. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
  110. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
  111. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
  112. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +0 -282
  113. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
  114. package/dist/node_modules/@radix-ui/react-select/dist/index.js +0 -1156
  115. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -30
  116. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +0 -554
  117. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -99
  118. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -152
  119. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -187
  120. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -482
  121. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
  122. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
  123. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
  124. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
  125. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
  126. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -15
  127. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
  128. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -35
  129. package/dist/node_modules/@stepperize/core/dist/index.js +0 -3
  130. package/dist/node_modules/@stepperize/react/dist/index.js +0 -6
  131. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
  132. package/dist/node_modules/axios/index.js +0 -25
  133. package/dist/node_modules/axios/lib/adapters/adapters.js +0 -81
  134. package/dist/node_modules/axios/lib/adapters/fetch.js +0 -229
  135. package/dist/node_modules/axios/lib/adapters/xhr.js +0 -199
  136. package/dist/node_modules/axios/lib/axios.js +0 -86
  137. package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -133
  138. package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -23
  139. package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -5
  140. package/dist/node_modules/axios/lib/core/Axios.js +0 -238
  141. package/dist/node_modules/axios/lib/core/AxiosError.js +0 -101
  142. package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -312
  143. package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -69
  144. package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -22
  145. package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -81
  146. package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -106
  147. package/dist/node_modules/axios/lib/core/settle.js +0 -27
  148. package/dist/node_modules/axios/lib/core/transformData.js +0 -28
  149. package/dist/node_modules/axios/lib/defaults/index.js +0 -159
  150. package/dist/node_modules/axios/lib/defaults/transitional.js +0 -7
  151. package/dist/node_modules/axios/lib/env/data.js +0 -3
  152. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -56
  153. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
  154. package/dist/node_modules/axios/lib/helpers/bind.js +0 -7
  155. package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -69
  156. package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -15
  157. package/dist/node_modules/axios/lib/helpers/composeSignals.js +0 -48
  158. package/dist/node_modules/axios/lib/helpers/cookies.js +0 -43
  159. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -93
  160. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
  161. package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  162. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
  163. package/dist/node_modules/axios/lib/helpers/null.js +0 -4
  164. package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
  165. package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  166. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +0 -46
  167. package/dist/node_modules/axios/lib/helpers/resolveConfig.js +0 -58
  168. package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -53
  169. package/dist/node_modules/axios/lib/helpers/spread.js +0 -28
  170. package/dist/node_modules/axios/lib/helpers/throttle.js +0 -44
  171. package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -219
  172. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
  173. package/dist/node_modules/axios/lib/helpers/trackStream.js +0 -88
  174. package/dist/node_modules/axios/lib/helpers/validator.js +0 -99
  175. package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  176. package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  177. package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -5
  178. package/dist/node_modules/axios/lib/platform/browser/index.js +0 -15
  179. package/dist/node_modules/axios/lib/platform/common/utils.js +0 -45
  180. package/dist/node_modules/axios/lib/platform/index.js +0 -9
  181. package/dist/node_modules/axios/lib/utils.js +0 -780
  182. package/dist/node_modules/class-variance-authority/dist/index.js +0 -44
  183. package/dist/node_modules/clsx/dist/clsx.js +0 -3
  184. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +0 -1669
  185. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +0 -37
  186. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +0 -38
  187. package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
  188. package/dist/node_modules/lucide-react/dist/esm/Icon.js +0 -43
  189. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -30
  190. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -20
  191. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +0 -17
  192. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +0 -17
  193. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +0 -14
  194. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -14
  195. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -14
  196. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -14
  197. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -14
  198. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +0 -14
  199. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -18
  200. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +0 -17
  201. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -28
  202. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -363
  203. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -44
  204. package/dist/node_modules/react/jsx-runtime.js +0 -19
  205. package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -560
  206. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
  207. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
  208. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
  209. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
  210. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
  211. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  212. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  213. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
  214. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
  215. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
  216. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
  217. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
  218. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
  219. package/dist/node_modules/sonner/dist/index.js +0 -299
  220. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -3035
  221. package/dist/node_modules/tslib/tslib.es6.js +0 -56
  222. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
  223. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
  224. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
  225. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
  226. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
  227. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -106
  228. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -77
  229. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -19
  230. package/dist/node_modules/zustand/esm/react.js +0 -22
  231. package/dist/node_modules/zustand/esm/vanilla.js +0 -24
@@ -1,321 +0,0 @@
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 };
@@ -1,11 +0,0 @@
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 };
@@ -1,211 +0,0 @@
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 };