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,167 +0,0 @@
1
- import { __spreadArray } from '../../../tslib/tslib.es6.js';
2
- import * as React from 'react';
3
- import { RemoveScrollBar } from '../../../react-remove-scroll-bar/dist/es2015/component.js';
4
- import { styleSingleton } from '../../../react-style-singleton/dist/es2015/component.js';
5
- import { nonPassive } from './aggresiveCapture.js';
6
- import { locationCouldBeScrolled, handleScroll } from './handleScroll.js';
7
-
8
- var getTouchXY = function (event) {
9
- return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
10
- };
11
- var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
12
- var extractRef = function (ref) {
13
- return ref && 'current' in ref ? ref.current : ref;
14
- };
15
- var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
16
- var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
17
- var idCounter = 0;
18
- var lockStack = [];
19
- function RemoveScrollSideCar(props) {
20
- var shouldPreventQueue = React.useRef([]);
21
- var touchStartRef = React.useRef([0, 0]);
22
- var activeAxis = React.useRef();
23
- var id = React.useState(idCounter++)[0];
24
- var Style = React.useState(styleSingleton)[0];
25
- var lastProps = React.useRef(props);
26
- React.useEffect(function () {
27
- lastProps.current = props;
28
- }, [props]);
29
- React.useEffect(function () {
30
- if (props.inert) {
31
- document.body.classList.add("block-interactivity-".concat(id));
32
- var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
33
- allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
34
- return function () {
35
- document.body.classList.remove("block-interactivity-".concat(id));
36
- allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
37
- };
38
- }
39
- return;
40
- }, [props.inert, props.lockRef.current, props.shards]);
41
- var shouldCancelEvent = React.useCallback(function (event, parent) {
42
- if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {
43
- return !lastProps.current.allowPinchZoom;
44
- }
45
- var touch = getTouchXY(event);
46
- var touchStart = touchStartRef.current;
47
- var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
48
- var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
49
- var currentAxis;
50
- var target = event.target;
51
- var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
52
- // allow horizontal touch move on Range inputs. They will not cause any scroll
53
- if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
54
- return false;
55
- }
56
- // allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target
57
- var selection = window.getSelection();
58
- var anchorNode = selection && selection.anchorNode;
59
- var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
60
- if (isTouchingSelection) {
61
- return false;
62
- }
63
- var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
64
- if (!canBeScrolledInMainDirection) {
65
- return true;
66
- }
67
- if (canBeScrolledInMainDirection) {
68
- currentAxis = moveDirection;
69
- }
70
- else {
71
- currentAxis = moveDirection === 'v' ? 'h' : 'v';
72
- canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
73
- // other axis might be not scrollable
74
- }
75
- if (!canBeScrolledInMainDirection) {
76
- return false;
77
- }
78
- if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
79
- activeAxis.current = currentAxis;
80
- }
81
- if (!currentAxis) {
82
- return true;
83
- }
84
- var cancelingAxis = activeAxis.current || currentAxis;
85
- return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY);
86
- }, []);
87
- var shouldPrevent = React.useCallback(function (_event) {
88
- var event = _event;
89
- if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
90
- // not the last active
91
- return;
92
- }
93
- var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
94
- var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0];
95
- // self event, and should be canceled
96
- if (sourceEvent && sourceEvent.should) {
97
- if (event.cancelable) {
98
- event.preventDefault();
99
- }
100
- return;
101
- }
102
- // outside or shard event
103
- if (!sourceEvent) {
104
- var shardNodes = (lastProps.current.shards || [])
105
- .map(extractRef)
106
- .filter(Boolean)
107
- .filter(function (node) { return node.contains(event.target); });
108
- var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
109
- if (shouldStop) {
110
- if (event.cancelable) {
111
- event.preventDefault();
112
- }
113
- }
114
- }
115
- }, []);
116
- var shouldCancel = React.useCallback(function (name, delta, target, should) {
117
- var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) };
118
- shouldPreventQueue.current.push(event);
119
- setTimeout(function () {
120
- shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
121
- }, 1);
122
- }, []);
123
- var scrollTouchStart = React.useCallback(function (event) {
124
- touchStartRef.current = getTouchXY(event);
125
- activeAxis.current = undefined;
126
- }, []);
127
- var scrollWheel = React.useCallback(function (event) {
128
- shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
129
- }, []);
130
- var scrollTouchMove = React.useCallback(function (event) {
131
- shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
132
- }, []);
133
- React.useEffect(function () {
134
- lockStack.push(Style);
135
- props.setCallbacks({
136
- onScrollCapture: scrollWheel,
137
- onWheelCapture: scrollWheel,
138
- onTouchMoveCapture: scrollTouchMove,
139
- });
140
- document.addEventListener('wheel', shouldPrevent, nonPassive);
141
- document.addEventListener('touchmove', shouldPrevent, nonPassive);
142
- document.addEventListener('touchstart', scrollTouchStart, nonPassive);
143
- return function () {
144
- lockStack = lockStack.filter(function (inst) { return inst !== Style; });
145
- document.removeEventListener('wheel', shouldPrevent, nonPassive);
146
- document.removeEventListener('touchmove', shouldPrevent, nonPassive);
147
- document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
148
- };
149
- }, []);
150
- var removeScrollBar = props.removeScrollBar, inert = props.inert;
151
- return (React.createElement(React.Fragment, null,
152
- inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,
153
- removeScrollBar ? React.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null));
154
- }
155
- function getOutermostShadowParent(node) {
156
- var shadowParent = null;
157
- while (node !== null) {
158
- if (node instanceof ShadowRoot) {
159
- shadowParent = node.host;
160
- node = node.host;
161
- }
162
- node = node.parentNode;
163
- }
164
- return shadowParent;
165
- }
166
-
167
- export { RemoveScrollSideCar, getDeltaXY, getTouchXY };
@@ -1,38 +0,0 @@
1
- import { __rest, __assign } from '../../../tslib/tslib.es6.js';
2
- import * as React from 'react';
3
- import { zeroRightClassName, fullWidthClassName } from '../../../react-remove-scroll-bar/dist/es2015/constants.js';
4
- import { effectCar } from './medium.js';
5
- import { useMergeRefs } from '../../../use-callback-ref/dist/es2015/useMergeRef.js';
6
-
7
- var nothing = function () {
8
- return;
9
- };
10
- /**
11
- * Removes scrollbar from the page and contain the scroll within the Lock
12
- */
13
- var RemoveScroll = React.forwardRef(function (props, parentRef) {
14
- var ref = React.useRef(null);
15
- var _a = React.useState({
16
- onScrollCapture: nothing,
17
- onWheelCapture: nothing,
18
- onTouchMoveCapture: nothing,
19
- }), callbacks = _a[0], setCallbacks = _a[1];
20
- var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
21
- var SideCar = sideCar;
22
- var containerRef = useMergeRefs([ref, parentRef]);
23
- var containerProps = __assign(__assign({}, rest), callbacks);
24
- return (React.createElement(React.Fragment, null,
25
- enabled && (React.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noRelative: noRelative, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })),
26
- forwardProps ? (React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (React.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children))));
27
- });
28
- RemoveScroll.defaultProps = {
29
- enabled: true,
30
- removeScrollBar: true,
31
- inert: false,
32
- };
33
- RemoveScroll.classNames = {
34
- fullWidth: fullWidthClassName,
35
- zeroRight: zeroRightClassName,
36
- };
37
-
38
- export { RemoveScroll };
@@ -1,21 +0,0 @@
1
- var passiveSupported = false;
2
- if (typeof window !== 'undefined') {
3
- try {
4
- var options = Object.defineProperty({}, 'passive', {
5
- get: function () {
6
- passiveSupported = true;
7
- return true;
8
- },
9
- });
10
- // @ts-ignore
11
- window.addEventListener('test', options, options);
12
- // @ts-ignore
13
- window.removeEventListener('test', options, options);
14
- }
15
- catch (err) {
16
- passiveSupported = false;
17
- }
18
- }
19
- var nonPassive = passiveSupported ? { passive: false } : false;
20
-
21
- export { nonPassive };
@@ -1,110 +0,0 @@
1
- var alwaysContainsScroll = function (node) {
2
- // textarea will always _contain_ scroll inside self. It only can be hidden
3
- return node.tagName === 'TEXTAREA';
4
- };
5
- var elementCanBeScrolled = function (node, overflow) {
6
- if (!(node instanceof Element)) {
7
- return false;
8
- }
9
- var styles = window.getComputedStyle(node);
10
- return (
11
- // not-not-scrollable
12
- styles[overflow] !== 'hidden' &&
13
- // contains scroll inside self
14
- !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
15
- };
16
- var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
17
- var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
18
- var locationCouldBeScrolled = function (axis, node) {
19
- var ownerDocument = node.ownerDocument;
20
- var current = node;
21
- do {
22
- // Skip over shadow root
23
- if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
24
- current = current.host;
25
- }
26
- var isScrollable = elementCouldBeScrolled(axis, current);
27
- if (isScrollable) {
28
- var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
29
- if (scrollHeight > clientHeight) {
30
- return true;
31
- }
32
- }
33
- current = current.parentNode;
34
- } while (current && current !== ownerDocument.body);
35
- return false;
36
- };
37
- var getVScrollVariables = function (_a) {
38
- var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
39
- return [
40
- scrollTop,
41
- scrollHeight,
42
- clientHeight,
43
- ];
44
- };
45
- var getHScrollVariables = function (_a) {
46
- var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
47
- return [
48
- scrollLeft,
49
- scrollWidth,
50
- clientWidth,
51
- ];
52
- };
53
- var elementCouldBeScrolled = function (axis, node) {
54
- return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
55
- };
56
- var getScrollVariables = function (axis, node) {
57
- return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
58
- };
59
- var getDirectionFactor = function (axis, direction) {
60
- /**
61
- * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
62
- * and then increasingly negative as you scroll towards the end of the content.
63
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
64
- */
65
- return axis === 'h' && direction === 'rtl' ? -1 : 1;
66
- };
67
- var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
68
- var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
69
- var delta = directionFactor * sourceDelta;
70
- // find scrollable target
71
- var target = event.target;
72
- var targetInLock = endTarget.contains(target);
73
- var shouldCancelScroll = false;
74
- var isDeltaPositive = delta > 0;
75
- var availableScroll = 0;
76
- var availableScrollTop = 0;
77
- do {
78
- if (!target) {
79
- break;
80
- }
81
- var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
82
- var elementScroll = scroll_1 - capacity - directionFactor * position;
83
- if (position || elementScroll) {
84
- if (elementCouldBeScrolled(axis, target)) {
85
- availableScroll += elementScroll;
86
- availableScrollTop += position;
87
- }
88
- }
89
- var parent_1 = target.parentNode;
90
- // we will "bubble" from ShadowDom in case we are, or just to the parent in normal case
91
- // this is the same logic used in focus-lock
92
- target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);
93
- } while (
94
- // portaled content
95
- (!targetInLock && target !== document.body) ||
96
- // self content
97
- (targetInLock && (endTarget.contains(target) || endTarget === target)));
98
- // handle epsilon around 0 (non standard zoom levels)
99
- if (isDeltaPositive &&
100
- ((Math.abs(availableScroll) < 1) || (false))) {
101
- shouldCancelScroll = true;
102
- }
103
- else if (!isDeltaPositive &&
104
- ((Math.abs(availableScrollTop) < 1) || (false))) {
105
- shouldCancelScroll = true;
106
- }
107
- return shouldCancelScroll;
108
- };
109
-
110
- export { handleScroll, locationCouldBeScrolled };
@@ -1,5 +0,0 @@
1
- import { createSidecarMedium } from '../../../use-sidecar/dist/es2015/medium.js';
2
-
3
- var effectCar = createSidecarMedium();
4
-
5
- export { effectCar };
@@ -1,7 +0,0 @@
1
- import { RemoveScrollSideCar } from './SideEffect.js';
2
- import { effectCar } from './medium.js';
3
- import { exportSidecar } from '../../../use-sidecar/dist/es2015/exports.js';
4
-
5
- const SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
6
-
7
- export { SideCar as default };
@@ -1,56 +0,0 @@
1
- import * as React from 'react';
2
- import { styleSingleton } from '../../../react-style-singleton/dist/es2015/component.js';
3
- import { noScrollbarsClassName, zeroRightClassName, fullWidthClassName, removedBarSizeVariable } from './constants.js';
4
- import { getGapWidth } from './utils.js';
5
-
6
- var Style = styleSingleton();
7
- var lockAttribute = 'data-scroll-locked';
8
- // important tip - once we measure scrollBar width and remove them
9
- // we could not repeat this operation
10
- // thus we are using style-singleton - only the first "yet correct" style will be applied.
11
- var getStyles = function (_a, allowRelative, gapMode, important) {
12
- var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
13
- if (gapMode === void 0) { gapMode = 'margin'; }
14
- return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
15
- allowRelative && "position: relative ".concat(important, ";"),
16
- gapMode === 'margin' &&
17
- "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
18
- gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"),
19
- ]
20
- .filter(Boolean)
21
- .join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
22
- };
23
- var getCurrentUseCounter = function () {
24
- var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10);
25
- return isFinite(counter) ? counter : 0;
26
- };
27
- var useLockAttribute = function () {
28
- React.useEffect(function () {
29
- document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
30
- return function () {
31
- var newCounter = getCurrentUseCounter() - 1;
32
- if (newCounter <= 0) {
33
- document.body.removeAttribute(lockAttribute);
34
- }
35
- else {
36
- document.body.setAttribute(lockAttribute, newCounter.toString());
37
- }
38
- };
39
- }, []);
40
- };
41
- /**
42
- * Removes page scrollbar and blocks page scroll when mounted
43
- */
44
- var RemoveScrollBar = function (_a) {
45
- var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b;
46
- useLockAttribute();
47
- /*
48
- gap will be measured on every component mount
49
- however it will be used only by the "first" invocation
50
- due to singleton nature of <Style
51
- */
52
- var gap = React.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
53
- return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
54
- };
55
-
56
- export { RemoveScrollBar, lockAttribute, useLockAttribute };
@@ -1,10 +0,0 @@
1
- var zeroRightClassName = 'right-scroll-bar-position';
2
- var fullWidthClassName = 'width-before-scroll-bar';
3
- var noScrollbarsClassName = 'with-scroll-bars-hidden';
4
- /**
5
- * Name of a CSS variable containing the amount of "hidden" scrollbar
6
- * ! might be undefined ! use will fallback!
7
- */
8
- var removedBarSizeVariable = '--removed-body-scroll-bar-size';
9
-
10
- export { fullWidthClassName, noScrollbarsClassName, removedBarSizeVariable, zeroRightClassName };
@@ -1,31 +0,0 @@
1
- var zeroGap = {
2
- left: 0,
3
- top: 0,
4
- right: 0,
5
- gap: 0,
6
- };
7
- var parse = function (x) { return parseInt(x || '', 10) || 0; };
8
- var getOffset = function (gapMode) {
9
- var cs = window.getComputedStyle(document.body);
10
- var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
11
- var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
12
- var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
13
- return [parse(left), parse(top), parse(right)];
14
- };
15
- var getGapWidth = function (gapMode) {
16
- if (gapMode === void 0) { gapMode = 'margin'; }
17
- if (typeof window === 'undefined') {
18
- return zeroGap;
19
- }
20
- var offsets = getOffset(gapMode);
21
- var documentWidth = document.documentElement.clientWidth;
22
- var windowWidth = window.innerWidth;
23
- return {
24
- left: offsets[0],
25
- top: offsets[1],
26
- right: offsets[2],
27
- gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),
28
- };
29
- };
30
-
31
- export { getGapWidth, zeroGap };
@@ -1,19 +0,0 @@
1
- import { styleHookSingleton } from './hook.js';
2
-
3
- /**
4
- * create a Component to add styles on demand
5
- * - styles are added when first instance is mounted
6
- * - styles are removed when the last instance is unmounted
7
- * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
8
- */
9
- var styleSingleton = function () {
10
- var useStyle = styleHookSingleton();
11
- var Sheet = function (_a) {
12
- var styles = _a.styles, dynamic = _a.dynamic;
13
- useStyle(styles, dynamic);
14
- return null;
15
- };
16
- return Sheet;
17
- };
18
-
19
- export { styleSingleton };
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
- import { stylesheetSingleton } from './singleton.js';
3
-
4
- /**
5
- * creates a hook to control style singleton
6
- * @see {@link styleSingleton} for a safer component version
7
- * @example
8
- * ```tsx
9
- * const useStyle = styleHookSingleton();
10
- * ///
11
- * useStyle('body { overflow: hidden}');
12
- */
13
- var styleHookSingleton = function () {
14
- var sheet = stylesheetSingleton();
15
- return function (styles, isDynamic) {
16
- React.useEffect(function () {
17
- sheet.add(styles);
18
- return function () {
19
- sheet.remove();
20
- };
21
- }, [styles && isDynamic]);
22
- };
23
- };
24
-
25
- export { styleHookSingleton };
@@ -1,51 +0,0 @@
1
- import { getNonce } from '../../../get-nonce/dist/es2015/index.js';
2
-
3
- function makeStyleTag() {
4
- if (!document)
5
- return null;
6
- var tag = document.createElement('style');
7
- tag.type = 'text/css';
8
- var nonce = getNonce();
9
- if (nonce) {
10
- tag.setAttribute('nonce', nonce);
11
- }
12
- return tag;
13
- }
14
- function injectStyles(tag, css) {
15
- // @ts-ignore
16
- if (tag.styleSheet) {
17
- // @ts-ignore
18
- tag.styleSheet.cssText = css;
19
- }
20
- else {
21
- tag.appendChild(document.createTextNode(css));
22
- }
23
- }
24
- function insertStyleTag(tag) {
25
- var head = document.head || document.getElementsByTagName('head')[0];
26
- head.appendChild(tag);
27
- }
28
- var stylesheetSingleton = function () {
29
- var counter = 0;
30
- var stylesheet = null;
31
- return {
32
- add: function (style) {
33
- if (counter == 0) {
34
- if ((stylesheet = makeStyleTag())) {
35
- injectStyles(stylesheet, style);
36
- insertStyleTag(stylesheet);
37
- }
38
- }
39
- counter++;
40
- },
41
- remove: function () {
42
- counter--;
43
- if (!counter && stylesheet) {
44
- stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
45
- stylesheet = null;
46
- }
47
- },
48
- };
49
- };
50
-
51
- export { stylesheetSingleton };