ingeniuscliq-core 0.4.25 → 0.4.26

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 +3 -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,350 +0,0 @@
1
- import { computePosition, offset as offset$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, limitShift as limitShift$1, arrow as arrow$2 } from '../../dom/dist/floating-ui.dom.js';
2
- export { autoUpdate, platform } from '../../dom/dist/floating-ui.dom.js';
3
- import * as React from 'react';
4
- import { useLayoutEffect } from 'react';
5
- import * as ReactDOM from 'react-dom';
6
-
7
- var isClient = typeof document !== 'undefined';
8
-
9
- var noop = function noop() {};
10
- var index = isClient ? useLayoutEffect : noop;
11
-
12
- // Fork of `fast-deep-equal` that only does the comparisons we need and compares
13
- // functions
14
- function deepEqual(a, b) {
15
- if (a === b) {
16
- return true;
17
- }
18
- if (typeof a !== typeof b) {
19
- return false;
20
- }
21
- if (typeof a === 'function' && a.toString() === b.toString()) {
22
- return true;
23
- }
24
- let length;
25
- let i;
26
- let keys;
27
- if (a && b && typeof a === 'object') {
28
- if (Array.isArray(a)) {
29
- length = a.length;
30
- if (length !== b.length) return false;
31
- for (i = length; i-- !== 0;) {
32
- if (!deepEqual(a[i], b[i])) {
33
- return false;
34
- }
35
- }
36
- return true;
37
- }
38
- keys = Object.keys(a);
39
- length = keys.length;
40
- if (length !== Object.keys(b).length) {
41
- return false;
42
- }
43
- for (i = length; i-- !== 0;) {
44
- if (!{}.hasOwnProperty.call(b, keys[i])) {
45
- return false;
46
- }
47
- }
48
- for (i = length; i-- !== 0;) {
49
- const key = keys[i];
50
- if (key === '_owner' && a.$$typeof) {
51
- continue;
52
- }
53
- if (!deepEqual(a[key], b[key])) {
54
- return false;
55
- }
56
- }
57
- return true;
58
- }
59
- return a !== a && b !== b;
60
- }
61
-
62
- function getDPR(element) {
63
- if (typeof window === 'undefined') {
64
- return 1;
65
- }
66
- const win = element.ownerDocument.defaultView || window;
67
- return win.devicePixelRatio || 1;
68
- }
69
-
70
- function roundByDPR(element, value) {
71
- const dpr = getDPR(element);
72
- return Math.round(value * dpr) / dpr;
73
- }
74
-
75
- function useLatestRef(value) {
76
- const ref = React.useRef(value);
77
- index(() => {
78
- ref.current = value;
79
- });
80
- return ref;
81
- }
82
-
83
- /**
84
- * Provides data to position a floating element.
85
- * @see https://floating-ui.com/docs/useFloating
86
- */
87
- function useFloating(options) {
88
- if (options === void 0) {
89
- options = {};
90
- }
91
- const {
92
- placement = 'bottom',
93
- strategy = 'absolute',
94
- middleware = [],
95
- platform,
96
- elements: {
97
- reference: externalReference,
98
- floating: externalFloating
99
- } = {},
100
- transform = true,
101
- whileElementsMounted,
102
- open
103
- } = options;
104
- const [data, setData] = React.useState({
105
- x: 0,
106
- y: 0,
107
- strategy,
108
- placement,
109
- middlewareData: {},
110
- isPositioned: false
111
- });
112
- const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
113
- if (!deepEqual(latestMiddleware, middleware)) {
114
- setLatestMiddleware(middleware);
115
- }
116
- const [_reference, _setReference] = React.useState(null);
117
- const [_floating, _setFloating] = React.useState(null);
118
- const setReference = React.useCallback(node => {
119
- if (node !== referenceRef.current) {
120
- referenceRef.current = node;
121
- _setReference(node);
122
- }
123
- }, []);
124
- const setFloating = React.useCallback(node => {
125
- if (node !== floatingRef.current) {
126
- floatingRef.current = node;
127
- _setFloating(node);
128
- }
129
- }, []);
130
- const referenceEl = externalReference || _reference;
131
- const floatingEl = externalFloating || _floating;
132
- const referenceRef = React.useRef(null);
133
- const floatingRef = React.useRef(null);
134
- const dataRef = React.useRef(data);
135
- const hasWhileElementsMounted = whileElementsMounted != null;
136
- const whileElementsMountedRef = useLatestRef(whileElementsMounted);
137
- const platformRef = useLatestRef(platform);
138
- const openRef = useLatestRef(open);
139
- const update = React.useCallback(() => {
140
- if (!referenceRef.current || !floatingRef.current) {
141
- return;
142
- }
143
- const config = {
144
- placement,
145
- strategy,
146
- middleware: latestMiddleware
147
- };
148
- if (platformRef.current) {
149
- config.platform = platformRef.current;
150
- }
151
- computePosition(referenceRef.current, floatingRef.current, config).then(data => {
152
- const fullData = {
153
- ...data,
154
- // The floating element's position may be recomputed while it's closed
155
- // but still mounted (such as when transitioning out). To ensure
156
- // `isPositioned` will be `false` initially on the next open, avoid
157
- // setting it to `true` when `open === false` (must be specified).
158
- isPositioned: openRef.current !== false
159
- };
160
- if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
161
- dataRef.current = fullData;
162
- ReactDOM.flushSync(() => {
163
- setData(fullData);
164
- });
165
- }
166
- });
167
- }, [latestMiddleware, placement, strategy, platformRef, openRef]);
168
- index(() => {
169
- if (open === false && dataRef.current.isPositioned) {
170
- dataRef.current.isPositioned = false;
171
- setData(data => ({
172
- ...data,
173
- isPositioned: false
174
- }));
175
- }
176
- }, [open]);
177
- const isMountedRef = React.useRef(false);
178
- index(() => {
179
- isMountedRef.current = true;
180
- return () => {
181
- isMountedRef.current = false;
182
- };
183
- }, []);
184
- index(() => {
185
- if (referenceEl) referenceRef.current = referenceEl;
186
- if (floatingEl) floatingRef.current = floatingEl;
187
- if (referenceEl && floatingEl) {
188
- if (whileElementsMountedRef.current) {
189
- return whileElementsMountedRef.current(referenceEl, floatingEl, update);
190
- }
191
- update();
192
- }
193
- }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
194
- const refs = React.useMemo(() => ({
195
- reference: referenceRef,
196
- floating: floatingRef,
197
- setReference,
198
- setFloating
199
- }), [setReference, setFloating]);
200
- const elements = React.useMemo(() => ({
201
- reference: referenceEl,
202
- floating: floatingEl
203
- }), [referenceEl, floatingEl]);
204
- const floatingStyles = React.useMemo(() => {
205
- const initialStyles = {
206
- position: strategy,
207
- left: 0,
208
- top: 0
209
- };
210
- if (!elements.floating) {
211
- return initialStyles;
212
- }
213
- const x = roundByDPR(elements.floating, data.x);
214
- const y = roundByDPR(elements.floating, data.y);
215
- if (transform) {
216
- return {
217
- ...initialStyles,
218
- transform: "translate(" + x + "px, " + y + "px)",
219
- ...(getDPR(elements.floating) >= 1.5 && {
220
- willChange: 'transform'
221
- })
222
- };
223
- }
224
- return {
225
- position: strategy,
226
- left: x,
227
- top: y
228
- };
229
- }, [strategy, transform, elements.floating, data.x, data.y]);
230
- return React.useMemo(() => ({
231
- ...data,
232
- update,
233
- refs,
234
- elements,
235
- floatingStyles
236
- }), [data, update, refs, elements, floatingStyles]);
237
- }
238
-
239
- /**
240
- * Provides data to position an inner element of the floating element so that it
241
- * appears centered to the reference element.
242
- * This wraps the core `arrow` middleware to allow React refs as the element.
243
- * @see https://floating-ui.com/docs/arrow
244
- */
245
- const arrow$1 = options => {
246
- function isRef(value) {
247
- return {}.hasOwnProperty.call(value, 'current');
248
- }
249
- return {
250
- name: 'arrow',
251
- options,
252
- fn(state) {
253
- const {
254
- element,
255
- padding
256
- } = typeof options === 'function' ? options(state) : options;
257
- if (element && isRef(element)) {
258
- if (element.current != null) {
259
- return arrow$2({
260
- element: element.current,
261
- padding
262
- }).fn(state);
263
- }
264
- return {};
265
- }
266
- if (element) {
267
- return arrow$2({
268
- element,
269
- padding
270
- }).fn(state);
271
- }
272
- return {};
273
- }
274
- };
275
- };
276
-
277
- /**
278
- * Modifies the placement by translating the floating element along the
279
- * specified axes.
280
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
281
- * object may be passed.
282
- * @see https://floating-ui.com/docs/offset
283
- */
284
- const offset = (options, deps) => ({
285
- ...offset$1(options),
286
- options: [options, deps]
287
- });
288
-
289
- /**
290
- * Optimizes the visibility of the floating element by shifting it in order to
291
- * keep it in view when it will overflow the clipping boundary.
292
- * @see https://floating-ui.com/docs/shift
293
- */
294
- const shift = (options, deps) => ({
295
- ...shift$1(options),
296
- options: [options, deps]
297
- });
298
-
299
- /**
300
- * Built-in `limiter` that will stop `shift()` at a certain point.
301
- */
302
- const limitShift = (options, deps) => ({
303
- ...limitShift$1(options),
304
- options: [options, deps]
305
- });
306
-
307
- /**
308
- * Optimizes the visibility of the floating element by flipping the `placement`
309
- * in order to keep it in view when the preferred placement(s) will overflow the
310
- * clipping boundary. Alternative to `autoPlacement`.
311
- * @see https://floating-ui.com/docs/flip
312
- */
313
- const flip = (options, deps) => ({
314
- ...flip$1(options),
315
- options: [options, deps]
316
- });
317
-
318
- /**
319
- * Provides data that allows you to change the size of the floating element —
320
- * for instance, prevent it from overflowing the clipping boundary or match the
321
- * width of the reference element.
322
- * @see https://floating-ui.com/docs/size
323
- */
324
- const size = (options, deps) => ({
325
- ...size$1(options),
326
- options: [options, deps]
327
- });
328
-
329
- /**
330
- * Provides data to hide the floating element in applicable situations, such as
331
- * when it is not in the same clipping context as the reference element.
332
- * @see https://floating-ui.com/docs/hide
333
- */
334
- const hide = (options, deps) => ({
335
- ...hide$1(options),
336
- options: [options, deps]
337
- });
338
-
339
- /**
340
- * Provides data to position an inner element of the floating element so that it
341
- * appears centered to the reference element.
342
- * This wraps the core `arrow` middleware to allow React refs as the element.
343
- * @see https://floating-ui.com/docs/arrow
344
- */
345
- const arrow = (options, deps) => ({
346
- ...arrow$1(options),
347
- options: [options, deps]
348
- });
349
-
350
- export { arrow, computePosition, flip, hide, limitShift, offset, shift, size, useFloating };
@@ -1,161 +0,0 @@
1
- function hasWindow() {
2
- return typeof window !== 'undefined';
3
- }
4
- function getNodeName(node) {
5
- if (isNode(node)) {
6
- return (node.nodeName || '').toLowerCase();
7
- }
8
- // Mocked nodes in testing environments may not be instances of Node. By
9
- // returning `#document` an infinite loop won't occur.
10
- // https://github.com/floating-ui/floating-ui/issues/2317
11
- return '#document';
12
- }
13
- function getWindow(node) {
14
- var _node$ownerDocument;
15
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
16
- }
17
- function getDocumentElement(node) {
18
- var _ref;
19
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
20
- }
21
- function isNode(value) {
22
- if (!hasWindow()) {
23
- return false;
24
- }
25
- return value instanceof Node || value instanceof getWindow(value).Node;
26
- }
27
- function isElement(value) {
28
- if (!hasWindow()) {
29
- return false;
30
- }
31
- return value instanceof Element || value instanceof getWindow(value).Element;
32
- }
33
- function isHTMLElement(value) {
34
- if (!hasWindow()) {
35
- return false;
36
- }
37
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
38
- }
39
- function isShadowRoot(value) {
40
- if (!hasWindow() || typeof ShadowRoot === 'undefined') {
41
- return false;
42
- }
43
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
44
- }
45
- const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
46
- function isOverflowElement(element) {
47
- const {
48
- overflow,
49
- overflowX,
50
- overflowY,
51
- display
52
- } = getComputedStyle(element);
53
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
54
- }
55
- const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
56
- function isTableElement(element) {
57
- return tableElements.has(getNodeName(element));
58
- }
59
- const topLayerSelectors = [':popover-open', ':modal'];
60
- function isTopLayer(element) {
61
- return topLayerSelectors.some(selector => {
62
- try {
63
- return element.matches(selector);
64
- } catch (_e) {
65
- return false;
66
- }
67
- });
68
- }
69
- const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
70
- const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
71
- const containValues = ['paint', 'layout', 'strict', 'content'];
72
- function isContainingBlock(elementOrCss) {
73
- const webkit = isWebKit();
74
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
75
-
76
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
77
- // https://drafts.csswg.org/css-transforms-2/#individual-transforms
78
- return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
79
- }
80
- function getContainingBlock(element) {
81
- let currentNode = getParentNode(element);
82
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
83
- if (isContainingBlock(currentNode)) {
84
- return currentNode;
85
- } else if (isTopLayer(currentNode)) {
86
- return null;
87
- }
88
- currentNode = getParentNode(currentNode);
89
- }
90
- return null;
91
- }
92
- function isWebKit() {
93
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
94
- return CSS.supports('-webkit-backdrop-filter', 'none');
95
- }
96
- const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
97
- function isLastTraversableNode(node) {
98
- return lastTraversableNodeNames.has(getNodeName(node));
99
- }
100
- function getComputedStyle(element) {
101
- return getWindow(element).getComputedStyle(element);
102
- }
103
- function getNodeScroll(element) {
104
- if (isElement(element)) {
105
- return {
106
- scrollLeft: element.scrollLeft,
107
- scrollTop: element.scrollTop
108
- };
109
- }
110
- return {
111
- scrollLeft: element.scrollX,
112
- scrollTop: element.scrollY
113
- };
114
- }
115
- function getParentNode(node) {
116
- if (getNodeName(node) === 'html') {
117
- return node;
118
- }
119
- const result =
120
- // Step into the shadow DOM of the parent of a slotted node.
121
- node.assignedSlot ||
122
- // DOM Element detected.
123
- node.parentNode ||
124
- // ShadowRoot detected.
125
- isShadowRoot(node) && node.host ||
126
- // Fallback.
127
- getDocumentElement(node);
128
- return isShadowRoot(result) ? result.host : result;
129
- }
130
- function getNearestOverflowAncestor(node) {
131
- const parentNode = getParentNode(node);
132
- if (isLastTraversableNode(parentNode)) {
133
- return node.ownerDocument ? node.ownerDocument.body : node.body;
134
- }
135
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
136
- return parentNode;
137
- }
138
- return getNearestOverflowAncestor(parentNode);
139
- }
140
- function getOverflowAncestors(node, list, traverseIframes) {
141
- var _node$ownerDocument2;
142
- if (list === void 0) {
143
- list = [];
144
- }
145
- if (traverseIframes === void 0) {
146
- traverseIframes = true;
147
- }
148
- const scrollableAncestor = getNearestOverflowAncestor(node);
149
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
150
- const win = getWindow(scrollableAncestor);
151
- if (isBody) {
152
- const frameElement = getFrameElement(win);
153
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
154
- }
155
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
156
- }
157
- function getFrameElement(win) {
158
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
159
- }
160
-
161
- export { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };
@@ -1,137 +0,0 @@
1
- /**
2
- * Custom positioning reference element.
3
- * @see https://floating-ui.com/docs/virtual-elements
4
- */
5
-
6
- const sides = ['top', 'right', 'bottom', 'left'];
7
- const min = Math.min;
8
- const max = Math.max;
9
- const round = Math.round;
10
- const floor = Math.floor;
11
- const createCoords = v => ({
12
- x: v,
13
- y: v
14
- });
15
- const oppositeSideMap = {
16
- left: 'right',
17
- right: 'left',
18
- bottom: 'top',
19
- top: 'bottom'
20
- };
21
- const oppositeAlignmentMap = {
22
- start: 'end',
23
- end: 'start'
24
- };
25
- function clamp(start, value, end) {
26
- return max(start, min(value, end));
27
- }
28
- function evaluate(value, param) {
29
- return typeof value === 'function' ? value(param) : value;
30
- }
31
- function getSide(placement) {
32
- return placement.split('-')[0];
33
- }
34
- function getAlignment(placement) {
35
- return placement.split('-')[1];
36
- }
37
- function getOppositeAxis(axis) {
38
- return axis === 'x' ? 'y' : 'x';
39
- }
40
- function getAxisLength(axis) {
41
- return axis === 'y' ? 'height' : 'width';
42
- }
43
- const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
44
- function getSideAxis(placement) {
45
- return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
46
- }
47
- function getAlignmentAxis(placement) {
48
- return getOppositeAxis(getSideAxis(placement));
49
- }
50
- function getAlignmentSides(placement, rects, rtl) {
51
- if (rtl === void 0) {
52
- rtl = false;
53
- }
54
- const alignment = getAlignment(placement);
55
- const alignmentAxis = getAlignmentAxis(placement);
56
- const length = getAxisLength(alignmentAxis);
57
- let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
58
- if (rects.reference[length] > rects.floating[length]) {
59
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
60
- }
61
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
62
- }
63
- function getExpandedPlacements(placement) {
64
- const oppositePlacement = getOppositePlacement(placement);
65
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
66
- }
67
- function getOppositeAlignmentPlacement(placement) {
68
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
69
- }
70
- const lrPlacement = ['left', 'right'];
71
- const rlPlacement = ['right', 'left'];
72
- const tbPlacement = ['top', 'bottom'];
73
- const btPlacement = ['bottom', 'top'];
74
- function getSideList(side, isStart, rtl) {
75
- switch (side) {
76
- case 'top':
77
- case 'bottom':
78
- if (rtl) return isStart ? rlPlacement : lrPlacement;
79
- return isStart ? lrPlacement : rlPlacement;
80
- case 'left':
81
- case 'right':
82
- return isStart ? tbPlacement : btPlacement;
83
- default:
84
- return [];
85
- }
86
- }
87
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
88
- const alignment = getAlignment(placement);
89
- let list = getSideList(getSide(placement), direction === 'start', rtl);
90
- if (alignment) {
91
- list = list.map(side => side + "-" + alignment);
92
- if (flipAlignment) {
93
- list = list.concat(list.map(getOppositeAlignmentPlacement));
94
- }
95
- }
96
- return list;
97
- }
98
- function getOppositePlacement(placement) {
99
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
100
- }
101
- function expandPaddingObject(padding) {
102
- return {
103
- top: 0,
104
- right: 0,
105
- bottom: 0,
106
- left: 0,
107
- ...padding
108
- };
109
- }
110
- function getPaddingObject(padding) {
111
- return typeof padding !== 'number' ? expandPaddingObject(padding) : {
112
- top: padding,
113
- right: padding,
114
- bottom: padding,
115
- left: padding
116
- };
117
- }
118
- function rectToClientRect(rect) {
119
- const {
120
- x,
121
- y,
122
- width,
123
- height
124
- } = rect;
125
- return {
126
- width,
127
- height,
128
- top: y,
129
- left: x,
130
- right: x + width,
131
- bottom: y + height,
132
- x,
133
- y
134
- };
135
- }
136
-
137
- export { clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, rectToClientRect, round, sides };
@@ -1,6 +0,0 @@
1
- // packages/core/number/src/number.ts
2
- function clamp(value, [min, max]) {
3
- return Math.min(max, Math.max(min, value));
4
- }
5
-
6
- export { clamp };
@@ -1,11 +0,0 @@
1
- // src/primitive.tsx
2
- function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
3
- return function handleEvent(event) {
4
- originalEventHandler?.(event);
5
- if (checkForDefaultPrevented === false || !event.defaultPrevented) {
6
- return ourEventHandler?.(event);
7
- }
8
- };
9
- }
10
-
11
- export { composeEventHandlers };