@e1011/es-kit 1.1.24 → 1.1.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 (126) hide show
  1. package/dist/hooks/esm/index.css +250 -250
  2. package/dist/hooks/esm/node_modules/gsap/CSSPlugin.js +11 -0
  3. package/dist/hooks/esm/node_modules/gsap/CSSPlugin.js.map +1 -0
  4. package/dist/hooks/esm/node_modules/gsap/gsap-core.js +11 -0
  5. package/dist/hooks/esm/node_modules/gsap/gsap-core.js.map +1 -0
  6. package/dist/hooks/esm/node_modules/gsap/index.js +2 -0
  7. package/dist/hooks/esm/node_modules/gsap/index.js.map +1 -0
  8. package/dist/hooks/esm/src/core/hooks/index.js +1 -1
  9. package/dist/hooks/esm/src/core/hooks/useAnimation.js +2 -0
  10. package/dist/hooks/esm/src/core/hooks/useAnimation.js.map +1 -0
  11. package/dist/hooks/esm/src/core/hooks/useClassNames.js.map +1 -1
  12. package/dist/hooks/esm/src/core/hooks/useIntersectionObserver.js +2 -0
  13. package/dist/hooks/esm/src/core/hooks/useIntersectionObserver.js.map +1 -0
  14. package/dist/hooks/esm/src/core/hooks/useOutsideClick.js.map +1 -1
  15. package/dist/hooks/esm/src/core/hooks/useParseProps.js.map +1 -1
  16. package/dist/hooks/esm/src/core/hooks/useResize.js.map +1 -1
  17. package/dist/hooks/esm/src/core/hooks/useThemePreference.js +1 -1
  18. package/dist/hooks/esm/src/core/hooks/useThemePreference.js.map +1 -1
  19. package/dist/hooks/esm/src/core/hooks/useToggle.js.map +1 -1
  20. package/dist/hooks/index.css +250 -250
  21. package/dist/hooks/node_modules/gsap/CSSPlugin.js +11 -0
  22. package/dist/hooks/node_modules/gsap/CSSPlugin.js.map +1 -0
  23. package/dist/hooks/node_modules/gsap/gsap-core.js +11 -0
  24. package/dist/hooks/node_modules/gsap/gsap-core.js.map +1 -0
  25. package/dist/hooks/node_modules/gsap/index.js +2 -0
  26. package/dist/hooks/node_modules/gsap/index.js.map +1 -0
  27. package/dist/hooks/src/core/hooks/index.js +1 -1
  28. package/dist/hooks/src/core/hooks/useAnimation.js +2 -0
  29. package/dist/hooks/src/core/hooks/useAnimation.js.map +1 -0
  30. package/dist/hooks/src/core/hooks/useClassNames.js.map +1 -1
  31. package/dist/hooks/src/core/hooks/useIntersectionObserver.js +2 -0
  32. package/dist/hooks/src/core/hooks/useIntersectionObserver.js.map +1 -0
  33. package/dist/hooks/src/core/hooks/useOutsideClick.js.map +1 -1
  34. package/dist/hooks/src/core/hooks/useParseProps.js.map +1 -1
  35. package/dist/hooks/src/core/hooks/useResize.js.map +1 -1
  36. package/dist/hooks/src/core/hooks/useThemePreference.js +1 -1
  37. package/dist/hooks/src/core/hooks/useThemePreference.js.map +1 -1
  38. package/dist/hooks/src/core/hooks/useToggle.js.map +1 -1
  39. package/dist/lib/cjs/node_modules/gsap/CSSPlugin.js +11 -0
  40. package/dist/lib/cjs/node_modules/gsap/CSSPlugin.js.map +1 -0
  41. package/dist/lib/cjs/node_modules/gsap/gsap-core.js +11 -0
  42. package/dist/lib/cjs/node_modules/gsap/gsap-core.js.map +1 -0
  43. package/dist/lib/cjs/node_modules/gsap/index.js +2 -0
  44. package/dist/lib/cjs/node_modules/gsap/index.js.map +1 -0
  45. package/dist/lib/cjs/src/core/hooks/useAnimation.js +2 -0
  46. package/dist/lib/cjs/src/core/hooks/useAnimation.js.map +1 -0
  47. package/dist/lib/cjs/src/core/hooks/useClassNames.js.map +1 -1
  48. package/dist/lib/cjs/src/core/hooks/useIntersectionObserver.js +2 -0
  49. package/dist/lib/cjs/src/core/hooks/useIntersectionObserver.js.map +1 -0
  50. package/dist/lib/cjs/src/core/hooks/useOutsideClick.js.map +1 -1
  51. package/dist/lib/cjs/src/core/hooks/useParseProps.js.map +1 -1
  52. package/dist/lib/cjs/src/core/hooks/useResize.js.map +1 -1
  53. package/dist/lib/cjs/src/core/hooks/useThemePreference.js +1 -1
  54. package/dist/lib/cjs/src/core/hooks/useThemePreference.js.map +1 -1
  55. package/dist/lib/cjs/src/core/hooks/useToggle.js.map +1 -1
  56. package/dist/lib/cjs/src/core/ui/components/container/layoutBox/LayoutBox.js.map +1 -1
  57. package/dist/lib/cjs/src/core/ui/components/icon/IconBase.js.map +1 -1
  58. package/dist/lib/cjs/src/core/ui/components/icon/IconWC.js.map +1 -1
  59. package/dist/lib/cjs/src/core/ui/components/molecules/popup/Popup.js.map +1 -1
  60. package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
  61. package/dist/lib/cjs/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
  62. package/dist/lib/cjs/src/index.js +1 -1
  63. package/dist/lib/esm/node_modules/gsap/CSSPlugin.js +11 -0
  64. package/dist/lib/esm/node_modules/gsap/CSSPlugin.js.map +1 -0
  65. package/dist/lib/esm/node_modules/gsap/gsap-core.js +11 -0
  66. package/dist/lib/esm/node_modules/gsap/gsap-core.js.map +1 -0
  67. package/dist/lib/esm/node_modules/gsap/index.js +2 -0
  68. package/dist/lib/esm/node_modules/gsap/index.js.map +1 -0
  69. package/dist/lib/esm/src/core/hooks/useAnimation.js +2 -0
  70. package/dist/lib/esm/src/core/hooks/useAnimation.js.map +1 -0
  71. package/dist/lib/esm/src/core/hooks/useClassNames.js.map +1 -1
  72. package/dist/lib/esm/src/core/hooks/useIntersectionObserver.js +2 -0
  73. package/dist/lib/esm/src/core/hooks/useIntersectionObserver.js.map +1 -0
  74. package/dist/lib/esm/src/core/hooks/useOutsideClick.js.map +1 -1
  75. package/dist/lib/esm/src/core/hooks/useParseProps.js.map +1 -1
  76. package/dist/lib/esm/src/core/hooks/useResize.js.map +1 -1
  77. package/dist/lib/esm/src/core/hooks/useThemePreference.js +1 -1
  78. package/dist/lib/esm/src/core/hooks/useThemePreference.js.map +1 -1
  79. package/dist/lib/esm/src/core/hooks/useToggle.js.map +1 -1
  80. package/dist/lib/esm/src/core/ui/components/container/layoutBox/LayoutBox.js.map +1 -1
  81. package/dist/lib/esm/src/core/ui/components/icon/IconBase.js.map +1 -1
  82. package/dist/lib/esm/src/core/ui/components/icon/IconWC.js.map +1 -1
  83. package/dist/lib/esm/src/core/ui/components/molecules/popup/Popup.js.map +1 -1
  84. package/dist/lib/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
  85. package/dist/lib/esm/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
  86. package/dist/lib/esm/src/index.js +1 -1
  87. package/dist/lib/tsconfig.tsbuildinfo +1 -1
  88. package/dist/types/src/core/hooks/index.d.ts +2 -0
  89. package/dist/types/src/core/hooks/index.d.ts.map +1 -1
  90. package/dist/types/src/core/hooks/useAnimation.d.ts +23 -0
  91. package/dist/types/src/core/hooks/useAnimation.d.ts.map +1 -0
  92. package/dist/types/src/core/hooks/useClassNames.d.ts +6 -0
  93. package/dist/types/src/core/hooks/useClassNames.d.ts.map +1 -1
  94. package/dist/types/src/core/hooks/useIntersectionObserver.d.ts +28 -0
  95. package/dist/types/src/core/hooks/useIntersectionObserver.d.ts.map +1 -0
  96. package/dist/types/src/core/hooks/useOutsideClick.d.ts +14 -0
  97. package/dist/types/src/core/hooks/useOutsideClick.d.ts.map +1 -1
  98. package/dist/types/src/core/hooks/useParseProps.d.ts +5 -0
  99. package/dist/types/src/core/hooks/useParseProps.d.ts.map +1 -1
  100. package/dist/types/src/core/hooks/useResize.d.ts +23 -0
  101. package/dist/types/src/core/hooks/useResize.d.ts.map +1 -1
  102. package/dist/types/src/core/hooks/useThemePreference.d.ts +37 -1
  103. package/dist/types/src/core/hooks/useThemePreference.d.ts.map +1 -1
  104. package/dist/types/src/core/hooks/useToggle.d.ts +17 -2
  105. package/dist/types/src/core/hooks/useToggle.d.ts.map +1 -1
  106. package/dist/ui/esm/src/core/hooks/useOutsideClick.js.map +1 -1
  107. package/dist/ui/esm/src/core/hooks/useParseProps.js.map +1 -1
  108. package/dist/ui/esm/src/core/hooks/useResize.js.map +1 -1
  109. package/dist/ui/esm/src/core/ui/components/container/layoutBox/LayoutBox.js.map +1 -1
  110. package/dist/ui/esm/src/core/ui/components/icon/IconBase.js.map +1 -1
  111. package/dist/ui/esm/src/core/ui/components/icon/IconWC.js.map +1 -1
  112. package/dist/ui/esm/src/core/ui/components/molecules/popup/Popup.js.map +1 -1
  113. package/dist/ui/src/core/hooks/useOutsideClick.js.map +1 -1
  114. package/dist/ui/src/core/hooks/useParseProps.js.map +1 -1
  115. package/dist/ui/src/core/hooks/useResize.js.map +1 -1
  116. package/dist/ui/src/core/ui/components/container/layoutBox/LayoutBox.js.map +1 -1
  117. package/dist/ui/src/core/ui/components/icon/IconBase.js.map +1 -1
  118. package/dist/ui/src/core/ui/components/icon/IconWC.js.map +1 -1
  119. package/dist/ui/src/core/ui/components/molecules/popup/Popup.js.map +1 -1
  120. package/dist/utils/esm/index.css +250 -250
  121. package/dist/utils/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
  122. package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
  123. package/dist/utils/index.css +250 -250
  124. package/dist/utils/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
  125. package/dist/utils/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
  126. package/package.json +2 -1
@@ -5,4 +5,6 @@ export * from './useResize';
5
5
  export * from './useClassNames';
6
6
  export * from './useParseProps';
7
7
  export * from './useThemePreference';
8
+ export * from './useAnimation';
9
+ export * from './useIntersectionObserver';
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Type definition for the parameters used in the `useAnimation` hook.
3
+ * @typedef {Object} UseAnimationType
4
+ * @property {number} start - The starting value of the animation.
5
+ * @property {number} end - The ending value of the animation.
6
+ * @property {number} duration - The duration of the animation in seconds.
7
+ * @property {string} [ease='expo.inOut'] - The easing function for the animation.
8
+ * @property {boolean} [rounded] - Flag to determine if the value should be rounded during the animation.
9
+ */
10
+ export type UseAnimationType = {
11
+ start: number;
12
+ end: number;
13
+ duration: number;
14
+ ease?: string;
15
+ rounded?: boolean;
16
+ };
17
+ /**
18
+ * Custom hook to create an animation using GSAP.
19
+ * @param {UseAnimationType} params - The parameters for the animation.
20
+ * @returns {number} The current value of the animation.
21
+ */
22
+ export declare const useAnimation: ({ start, end, duration, ease, rounded }: UseAnimationType) => number;
23
+ //# sourceMappingURL=useAnimation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimation.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useAnimation.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,4CAA4D,gBAAgB,KAAG,MA4BvG,CAAA"}
@@ -1,3 +1,9 @@
1
1
  import { classNames, TClassName } from '../utils/helpers/ui';
2
+ /**
3
+ * Custom hook to memoize class names.
4
+ * @param {TClassName[]} classes - Array of class names or conditions to be applied.
5
+ * @param {unknown[]} deps - Dependencies array for the `useMemo` hook.
6
+ * @returns {ReturnType<typeof classNames>} The computed class names as a string.
7
+ */
2
8
  export declare const useClassNames: (classes: TClassName[], deps: unknown[]) => ReturnType<typeof classNames>;
3
9
  //# sourceMappingURL=useClassNames.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useClassNames.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useClassNames.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAE5D,eAAO,MAAM,aAAa,YACf,UAAU,EAAE,QACf,OAAO,EAAE,KAEd,UAAU,CAAC,OAAO,UAAU,CAA2D,CAAA"}
1
+ {"version":3,"file":"useClassNames.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useClassNames.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAG5D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YACf,UAAU,EAAE,QACf,OAAO,EAAE,KAEd,UAAU,CAAC,OAAO,UAAU,CAA2D,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { MutableRefObject } from 'react';
2
+ /**
3
+ * Type definition for the parameters used in the `useIntersectionObserver` hook.
4
+ * @typedef {Object} UseIntersectionObserverType
5
+ * @property {() => void} callback - Function to be called when the element intersects.
6
+ * @property {() => void} [notIntersectingCallback] - Optional function to be called
7
+ * when the element is not intersecting.
8
+ * @property {Partial<{ root: HTMLElement | null; rootMargin: string; threshold: number }>} [options] -
9
+ * Optional IntersectionObserver options.
10
+ * @property {boolean} [granular] - Flag to determine if each entry should be checked individually.
11
+ */
12
+ export type UseIntersectionObserverType = {
13
+ callback: () => void;
14
+ notIntersectingCallback?: () => void;
15
+ options?: Partial<{
16
+ root: HTMLElement | null;
17
+ rootMargin: string;
18
+ threshold: number;
19
+ }>;
20
+ granular?: boolean;
21
+ };
22
+ /**
23
+ * Custom hook to observe the intersection of an element.
24
+ * @param {UseIntersectionObserverType} params - The parameters for the intersection observer.
25
+ * @returns {MutableRefObject<T | null>} Ref object for the observed element.
26
+ */
27
+ export declare const useIntersectionObserver: <T extends Element = Element>({ callback, notIntersectingCallback, options, granular, }: UseIntersectionObserverType) => MutableRefObject<T | null>;
28
+ //# sourceMappingURL=useIntersectionObserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntersectionObserver.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useIntersectionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAkC,MAAM,OAAO,CAAA;AAQxE;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;QAChB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;QACxB,UAAU,EAAE,MAAM,CAAA;QAClB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAC,CAAA;IACF,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAiCD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,OAAO,uEAEtD,2BAA2B,KAAG,gBAAgB,CAAC,CAAC,GAAG,IAAI,CA2BzD,CAAA"}
@@ -1,6 +1,20 @@
1
1
  type Element = HTMLElement | null | (() => HTMLElement);
2
2
  type CallbackFunction = (target: HTMLElement | null) => void;
3
+ /**
4
+ * Custom hook to handle clicks outside a specified element.
5
+ * @param {Element} element - The element to detect outside clicks for.
6
+ * @param {CallbackFunction} [callback] - Optional callback function to execute when an outside click is detected.
7
+ * @param {Function} [handleClickOutside=defaultHandleClickOutside] - Optional custom function to handle outside clicks.
8
+ * @returns {() => void} Function to unsubscribe the event listener.
9
+ */
3
10
  export declare function useOutsideClick(element: Element, callback?: CallbackFunction, handleClickOutside?: (event: MouseEvent) => void): () => void;
11
+ /**
12
+ * Function to handle clicks outside a specified element.
13
+ * @param {Element} element - The element to detect outside clicks for.
14
+ * @param {CallbackFunction} [callback] - Optional callback function to execute when an outside click is detected.
15
+ * @param {Function} [handleClickOutside=defaultHandleClickOutside] - Optional custom function to handle outside clicks.
16
+ * @returns {() => void} Function to unsubscribe the event listener.
17
+ */
4
18
  export declare function outsideClickHandler(element: Element, callback?: CallbackFunction, handleClickOutside?: (event: MouseEvent) => void): () => void;
5
19
  export {};
6
20
  //# sourceMappingURL=useOutsideClick.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOutsideClick.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useOutsideClick.ts"],"names":[],"mappings":"AAKA,KAAK,OAAO,GAAG,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,WAAW,CAAC,CAAA;AACvD,KAAK,gBAAgB,GAAG,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;AAE5D,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,gBAAgB,EAC3B,kBAAkB,8BAA+C,GAChE,MAAM,IAAI,CAaZ;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,gBAAgB,EAC3B,kBAAkB,8BAA+C,GAChE,MAAM,IAAI,CAMZ"}
1
+ {"version":3,"file":"useOutsideClick.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useOutsideClick.ts"],"names":[],"mappings":"AAKA,KAAK,OAAO,GAAG,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,WAAW,CAAC,CAAA;AACvD,KAAK,gBAAgB,GAAG,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;AAE5D;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,gBAAgB,EAC3B,kBAAkB,8BAA+C,GAChE,MAAM,IAAI,CAaZ;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,gBAAgB,EAC3B,kBAAkB,8BAA+C,GAChE,MAAM,IAAI,CAMZ"}
@@ -1,3 +1,8 @@
1
1
  import { parseProps } from '../utils/helpers/ui';
2
+ /**
3
+ * Custom hook to parse properties using the `parseProps` utility function.
4
+ * @param {Record<string, unknown>} props - The properties to be parsed.
5
+ * @returns {ReturnType<typeof parseProps>} The parsed properties categorized by the `parseProps` function.
6
+ */
2
7
  export declare const useParseProps: (props: Record<string, unknown>) => ReturnType<typeof parseProps>;
3
8
  //# sourceMappingURL=useParseProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useParseProps.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useParseProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGhD,eAAO,MAAM,aAAa,UAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,UAAU,CAAC,OAAO,UAAU,CAI1F,CAAA"}
1
+ {"version":3,"file":"useParseProps.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useParseProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEhD;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,UAAU,CAAC,OAAO,UAAU,CAI1F,CAAA"}
@@ -1,10 +1,33 @@
1
1
  import { MutableRefObject } from 'react';
2
+ /**
3
+ * Type definition for the size of the wrapper element.
4
+ * @typedef {Object} WrapperSize
5
+ * @property {undefined | number} width - The width of the wrapper element.
6
+ * @property {undefined | number} height - The height of the wrapper element.
7
+ */
2
8
  export type WrapperSize = {
3
9
  width: undefined | number;
4
10
  height: undefined | number;
5
11
  };
12
+ /**
13
+ * Type definition for the unobserver function.
14
+ * @typedef {() => (null | void)} Unobserver
15
+ */
6
16
  type Unobserver = () => (null | void);
17
+ /**
18
+ * Type definition for the resize callback function.
19
+ * @typedef {(wrapperSize: WrapperSize) => void} UseResizeCallBack
20
+ */
7
21
  export type UseResizeCallBack = (wrapperSize: WrapperSize) => void;
22
+ /**
23
+ * Custom hook to observe the resize event of an HTML element
24
+ * and execute a callback or update the state with the new size.
25
+ * @param {number} [debounceDelay=250] - The delay in milliseconds for debouncing the resize event.
26
+ * @param {UseResizeCallBack} [callBack] - Optional callback function to execute when the element is resized.
27
+ * @returns {[MutableRefObject<HTMLElement | null | undefined>, WrapperSize, Unobserver | undefined]}
28
+ * An array containing the ref object for the container element,
29
+ * the current size of the container, and an unobserver function.
30
+ */
8
31
  export declare const useResize: (debounceDelay?: number, callBack?: UseResizeCallBack) => [MutableRefObject<HTMLElement | null | undefined>, WrapperSize, Unobserver | undefined];
9
32
  export {};
10
33
  //# sourceMappingURL=useResize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useResize.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useResize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA8C,MAAM,OAAO,CAAA;AAGpF,MAAM,MAAM,WAAW,GAAG;IAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;CAAC,CAAA;AAGjF,KAAK,UAAU,GAAG,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;AAErC,MAAM,MAAM,iBAAiB,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAA;AAGlE,eAAO,MAAM,SAAS,sCAAoC,iBAAiB,KAAG,CAC5E,gBAAgB,CAAC,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,WAAW,EAAE,UAAU,GAAG,SAAS,CAoDtF,CAAA"}
1
+ {"version":3,"file":"useResize.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useResize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA8C,MAAM,OAAO,CAAA;AAGpF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,CAAA;AAEnF;;;GAGG;AACH,KAAK,UAAU,GAAG,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;AAErC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAA;AAElE;;;;;;;;GAQG;AAEH,eAAO,MAAM,SAAS,sCAAoC,iBAAiB,KAAG,CAC5E,gBAAgB,CAAC,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,WAAW,EAAE,UAAU,GAAG,SAAS,CAmDtF,CAAA"}
@@ -1,12 +1,48 @@
1
+ /**
2
+ * Observes the user's theme preference and applies the appropriate theme.
3
+ * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.
4
+ * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.
5
+ * @returns {() => void} Function to stop observing the theme preference.
6
+ */
1
7
  export declare const observeThemePreference: (getHtmlElement?: () => HTMLElement, switchCallback?: (isDark: boolean) => void) => () => void;
8
+ /**
9
+ * Custom hook to use theme preference in a React component.
10
+ * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.
11
+ * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.
12
+ */
2
13
  export declare const useThemePreference: (getHtmlElement?: () => HTMLElement, switchCallback?: (isDark: boolean) => void) => void;
14
+ /**
15
+ * Type definition for theme map.
16
+ * @typedef {Object} ThemeMap
17
+ * @property {string} dark - CSS class for the dark theme.
18
+ * @property {string} light - CSS class for the light theme.
19
+ */
3
20
  type ThemeMap = {
4
21
  dark: string;
5
22
  light: string;
6
23
  };
24
+ /**
25
+ * Gets the base themes.
26
+ * @returns {ThemeMap} The current base themes.
27
+ */
7
28
  export declare const getBaseThemes: () => ThemeMap;
8
- export declare const setTHemeClassNames: (themes: ThemeMap) => void;
29
+ /**
30
+ * Sets the base theme class names.
31
+ * @param {ThemeMap} themes - Object containing the CSS classes for dark and light themes.
32
+ */
33
+ export declare const setThemeClassNames: (themes: ThemeMap) => void;
34
+ /**
35
+ * Switches the color theme of the document.
36
+ * @param {boolean} isDark - Flag to determine if the dark theme should be applied.
37
+ * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.
38
+ * @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.
39
+ */
9
40
  export declare const switchColorTheme: (isDark: boolean, htmlElement?: HTMLElement, findShadows?: boolean) => void;
41
+ /**
42
+ * Updates the color theme of the document.
43
+ * @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.
44
+ * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.
45
+ */
10
46
  export declare const updateColorTheme: (isDark?: boolean, htmlElement?: HTMLElement) => void;
11
47
  export {};
12
48
  //# sourceMappingURL=useThemePreference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useThemePreference.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useThemePreference.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB,oBACjB,MAAM,WAAW,mBACjB,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KACxC,MAAM,IA6CR,CAAA;AAED,eAAO,MAAM,kBAAkB,oBACb,MAAM,WAAW,mBACjB,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KACxC,IAEF,CAAA;AAED,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAQD,eAAO,MAAM,aAAa,QAAO,QAAsB,CAAA;AAEvD,eAAO,MAAM,kBAAkB,WAAY,QAAQ,KAAG,IAErD,CAAA;AAED,eAAO,MAAM,gBAAgB,WAAY,OAAO,gBAAgB,WAAW,4BAAuB,IAmCjG,CAAA;AAED,eAAO,MAAM,gBAAgB,YAAa,OAAO,gBAAgB,WAAW,KAAG,IAO9E,CAAA"}
1
+ {"version":3,"file":"useThemePreference.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useThemePreference.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,oBACjB,MAAM,WAAW,mBACjB,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KACxC,MAAM,IA6CR,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,oBACb,MAAM,WAAW,mBACjB,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KACxC,IAEF,CAAA;AAED;;;;;GAKG;AACH,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAOD;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,QAAsB,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,WAAY,QAAQ,KAAG,IAErD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,WAAY,OAAO,gBAAgB,WAAW,4BAAuB,IAmCjG,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,YAAa,OAAO,gBAAgB,WAAW,KAAG,IAO9E,CAAA"}
@@ -1,8 +1,23 @@
1
- export type useTogggleReturnType = [
1
+ /**
2
+ * Type definition for the return value of the `useToggle` hook.
3
+ * @typedef {Array} useToggleReturnType
4
+ * @property {boolean} 0 - The current toggled state.
5
+ * @property {(value?: any | boolean) => void} 1 - Function to toggle the state.
6
+ * @property {(value?: any | boolean) => void} 2 - Function to forcefully set the state to true.
7
+ * @property {(value?: any | boolean) => void} 3 - Function to forcefully set the state to false.
8
+ */
9
+ export type useToggleReturnType = [
2
10
  boolean,
3
11
  (value?: any | boolean) => void,
4
12
  (value?: any | boolean) => void,
5
13
  (value?: any | boolean) => void
6
14
  ];
7
- export declare const useToggle: (defaultValue: boolean, async?: boolean) => useTogggleReturnType;
15
+ /**
16
+ * Custom hook to manage a boolean state with toggle functionality.
17
+ * @param {boolean} defaultValue - The initial value of the toggled state.
18
+ * @param {boolean} [async=true] - Flag to determine if the toggle should be asynchronous.
19
+ * @returns {useToggleReturnType} An array containing the current state, a toggle function,
20
+ * and functions to set the state to true or false.
21
+ */
22
+ export declare const useToggle: (defaultValue: boolean, async?: boolean) => useToggleReturnType;
8
23
  //# sourceMappingURL=useToggle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useToggle.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useToggle.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO;IACP,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,OAAO,KAAK,IAAI;IAC/B,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,OAAO,KAAK,IAAI;IAC/B,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,OAAO,KAAK,IAAI;CAChC,CAAA;AAED,eAAO,MAAM,SAAS,iBAAkB,OAAO,sBAAiB,oBAoB/D,CAAA"}
1
+ {"version":3,"file":"useToggle.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useToggle.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO;IACP,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,OAAO,KAAK,IAAI;IAC/B,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,OAAO,KAAK,IAAI;IAC/B,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,OAAO,KAAK,IAAI;CAChC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,iBAAkB,OAAO,sBAAiB,mBAkC/D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useOutsideClick.js","sources":["../../../../../../src/core/hooks/useOutsideClick.ts"],"sourcesContent":["import { useEffect, useCallback } from 'react'\n\nimport { EventName } from '../constants/ui.constants'\nimport { handleClickOutside as defaultHandleClickOutside } from '../ui/utils/clickOutside'\n\ntype Element = HTMLElement | null | (() => HTMLElement)\ntype CallbackFunction = (target: HTMLElement | null) => void\n\nexport function useOutsideClick(\n element: Element,\n callback?: CallbackFunction,\n handleClickOutside = defaultHandleClickOutside(element, callback),\n): () => void {\n const unsubscriber = useCallback(\n () => document.removeEventListener(EventName.Click, handleClickOutside), [handleClickOutside],\n )\n\n useEffect(() => {\n unsubscriber()\n document.addEventListener(EventName.Click, handleClickOutside)\n\n return unsubscriber\n }, [element, handleClickOutside, unsubscriber])\n\n return unsubscriber\n}\n\nexport function outsideClickHandler(\n element: Element,\n callback?: CallbackFunction,\n handleClickOutside = defaultHandleClickOutside(element, callback),\n): () => void {\n const unsubscriber = (): void => document.removeEventListener(EventName.Click, handleClickOutside)\n\n document.addEventListener(EventName.Click, handleClickOutside)\n\n return unsubscriber\n}\n"],"names":["outsideClickHandler","element","callback","handleClickOutside","arguments","length","undefined","defaultHandleClickOutside","document","addEventListener","EventName","Click","unsubscriber","removeEventListener"],"mappings":"wIA2BO,SAASA,EACdC,EACAC,GAEY,IADZC,EAAkBC,UAAAC,eAAAC,IAAAF,UAAA,GAAAA,UAAGG,GAAAA,EAA0BN,EAASC,GAMxD,OAFAM,SAASC,iBAAiBC,EAAUC,MAAOR,GAFtBS,IAAYJ,SAASK,oBAAoBH,EAAUC,MAAOR,EAKjF"}
1
+ {"version":3,"file":"useOutsideClick.js","sources":["../../../../../../src/core/hooks/useOutsideClick.ts"],"sourcesContent":["import { useEffect, useCallback } from 'react'\n\nimport { EventName } from '../constants/ui.constants'\nimport { handleClickOutside as defaultHandleClickOutside } from '../ui/utils/clickOutside'\n\ntype Element = HTMLElement | null | (() => HTMLElement)\ntype CallbackFunction = (target: HTMLElement | null) => void\n\n/**\n * Custom hook to handle clicks outside a specified element.\n * @param {Element} element - The element to detect outside clicks for.\n * @param {CallbackFunction} [callback] - Optional callback function to execute when an outside click is detected.\n * @param {Function} [handleClickOutside=defaultHandleClickOutside] - Optional custom function to handle outside clicks.\n * @returns {() => void} Function to unsubscribe the event listener.\n */\nexport function useOutsideClick(\n element: Element,\n callback?: CallbackFunction,\n handleClickOutside = defaultHandleClickOutside(element, callback),\n): () => void {\n const unsubscriber = useCallback(\n () => document.removeEventListener(EventName.Click, handleClickOutside), [handleClickOutside],\n )\n\n useEffect(() => {\n unsubscriber()\n document.addEventListener(EventName.Click, handleClickOutside)\n\n return unsubscriber\n }, [element, handleClickOutside, unsubscriber])\n\n return unsubscriber\n}\n\n/**\n * Function to handle clicks outside a specified element.\n * @param {Element} element - The element to detect outside clicks for.\n * @param {CallbackFunction} [callback] - Optional callback function to execute when an outside click is detected.\n * @param {Function} [handleClickOutside=defaultHandleClickOutside] - Optional custom function to handle outside clicks.\n * @returns {() => void} Function to unsubscribe the event listener.\n */\nexport function outsideClickHandler(\n element: Element,\n callback?: CallbackFunction,\n handleClickOutside = defaultHandleClickOutside(element, callback),\n): () => void {\n const unsubscriber = (): void => document.removeEventListener(EventName.Click, handleClickOutside)\n\n document.addEventListener(EventName.Click, handleClickOutside)\n\n return unsubscriber\n}\n"],"names":["outsideClickHandler","element","callback","handleClickOutside","arguments","length","undefined","defaultHandleClickOutside","document","addEventListener","EventName","Click","unsubscriber","removeEventListener"],"mappings":"wIAyCO,SAASA,EACdC,EACAC,GAEY,IADZC,EAAkBC,UAAAC,eAAAC,IAAAF,UAAA,GAAAA,UAAGG,GAAAA,EAA0BN,EAASC,GAMxD,OAFAM,SAASC,iBAAiBC,EAAUC,MAAOR,GAFtBS,IAAYJ,SAASK,oBAAoBH,EAAUC,MAAOR,EAKjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"useParseProps.js","sources":["../../../../../../src/core/hooks/useParseProps.ts"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { parseProps } from '../utils/helpers/ui'\n\n\nexport const useParseProps = (props: Record<string, unknown>): ReturnType<typeof parseProps> => {\n const propsCategories = useMemo(() => parseProps(props), [props])\n\n return propsCategories\n}\n"],"names":["useParseProps","props","useMemo","parseProps"],"mappings":"oFAKaA,MAAAA,EAAiBC,GACJC,GAAQ,IAAMC,EAAWF,IAAQ,CAACA"}
1
+ {"version":3,"file":"useParseProps.js","sources":["../../../../../../src/core/hooks/useParseProps.ts"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { parseProps } from '../utils/helpers/ui'\n\n/**\n * Custom hook to parse properties using the `parseProps` utility function.\n * @param {Record<string, unknown>} props - The properties to be parsed.\n * @returns {ReturnType<typeof parseProps>} The parsed properties categorized by the `parseProps` function.\n */\nexport const useParseProps = (props: Record<string, unknown>): ReturnType<typeof parseProps> => {\n const propsCategories = useMemo(() => parseProps(props), [props])\n\n return propsCategories\n}\n"],"names":["useParseProps","props","useMemo","parseProps"],"mappings":"oFASaA,MAAAA,EAAiBC,GACJC,GAAQ,IAAMC,EAAWF,IAAQ,CAACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useResize.js","sources":["../../../../../../src/core/hooks/useResize.ts"],"sourcesContent":["import { MutableRefObject, useLayoutEffect, useMemo, useState, useRef } from 'react'\nimport debounce from 'lodash-es/debounce'\n\nexport type WrapperSize = {width: undefined | number; height: undefined | number}\n\n\ntype Unobserver = () => (null | void)\n\nexport type UseResizeCallBack = (wrapperSize: WrapperSize) => void\n\n// eslint-disable-next-line default-param-last\nexport const useResize = (debounceDelay = 250, callBack?: UseResizeCallBack): [\n MutableRefObject<HTMLElement | null | undefined>, WrapperSize, Unobserver | undefined] => {\n const [containerSize, setContainerSize]\n = useState<WrapperSize>({ width: undefined, height: undefined })\n\n const lastResizeWidthRef = useRef<WrapperSize>({ width: 0, height: 0 })\n const containerRef: MutableRefObject<HTMLElement | undefined | null> = useRef<HTMLElement | undefined | null>()\n const unobserverRef = useRef<Unobserver>()\n\n const debouncedResizeWrapper = useMemo(() => debounce((entries) => {\n const newResizeWidth = entries[0].contentRect.width\n const newResizeHeight = entries[0].contentRect.height\n\n if (lastResizeWidthRef.current?.width === newResizeWidth\n && lastResizeWidthRef.current?.height === newResizeHeight) {\n return\n }\n lastResizeWidthRef.current = { width: newResizeWidth, height: newResizeHeight }\n\n // eslint-disable-next-line semi-style\n ;(callBack || setContainerSize)({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }, debounceDelay), [callBack, debounceDelay])\n\n useLayoutEffect(() => {\n let resizeObserver: ResizeObserver\n let containerElement: HTMLElement\n\n if (containerRef?.current) {\n containerElement = containerRef?.current\n resizeObserver = new ResizeObserver(debouncedResizeWrapper)\n resizeObserver.observe(containerElement as Element)\n\n // eslint-disable-next-line semi-style\n ;(callBack || setContainerSize)({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }\n\n const unobserver = (): void => {\n resizeObserver?.unobserve?.(containerElement as Element)\n }\n\n // setUnobserver(unobserver)\n unobserverRef.current = unobserver\n\n return unobserver\n }, [debouncedResizeWrapper, containerRef, callBack])\n\n return [containerRef, containerSize, unobserverRef.current]\n}\n"],"names":["useResize","debounceDelay","arguments","length","undefined","callBack","containerSize","setContainerSize","useState","width","height","lastResizeWidthRef","useRef","containerRef","unobserverRef","debouncedResizeWrapper","useMemo","debounce","entries","newResizeWidth","contentRect","newResizeHeight","current","clientWidth","clientHeight","useLayoutEffect","resizeObserver","containerElement","ResizeObserver","observe","unobserver","unobserve"],"mappings":"0IAWaA,MAAAA,EAAY,WACmE,IADlEC,EAAaC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAAKG,EAA4BH,UAAAC,OAAAD,EAAAA,kBAAAE,EAEzE,MAAOE,EAAeC,GAClBC,EAAsB,CAAEC,WAAOL,EAAWM,YAAQN,IAEhDO,EAAqBC,EAAoB,CAAEH,MAAO,EAAGC,OAAQ,IAC7DG,EAAiED,IACjEE,EAAgBF,IAEhBG,EAAyBC,GAAQ,IAAMC,GAAUC,IACrD,MAAMC,EAAiBD,EAAQ,GAAGE,YAAYX,MACxCY,EAAkBH,EAAQ,GAAGE,YAAYV,OAE3CC,EAAmBW,SAASb,QAAUU,GACrCR,EAAmBW,SAASZ,SAAWW,IAG5CV,EAAmBW,QAAU,CAAEb,MAAOU,EAAgBT,OAAQW,IAG5DhB,GAAYE,GAAkB,CAC9BE,MAAOI,GAAcS,SAASC,YAC9Bb,OAAQG,GAAcS,SAASE,eAC/B,GACDvB,IAAgB,CAACI,EAAUJ,IA4B9B,OA1BAwB,GAAgB,KACd,IAAIC,EACAC,EAEAd,GAAcS,UAChBK,EAAmBd,GAAcS,QACjCI,EAAiB,IAAIE,eAAeb,GACpCW,EAAeG,QAAQF,IAGrBtB,GAAYE,GAAkB,CAC9BE,MAAOI,GAAcS,SAASC,YAC9Bb,OAAQG,GAAcS,SAASE,gBAInC,MAAMM,EAAaA,KACjBJ,GAAgBK,YAAYJ,EAA4B,EAM1D,OAFAb,EAAcQ,QAAUQ,EAEjBA,CAAU,GAChB,CAACf,EAAwBF,EAAcR,IAEnC,CAACQ,EAAcP,EAAeQ,EAAcQ,QACrD"}
1
+ {"version":3,"file":"useResize.js","sources":["../../../../../../src/core/hooks/useResize.ts"],"sourcesContent":["import { MutableRefObject, useLayoutEffect, useMemo, useState, useRef } from 'react'\nimport debounce from 'lodash-es/debounce'\n\n/**\n * Type definition for the size of the wrapper element.\n * @typedef {Object} WrapperSize\n * @property {undefined | number} width - The width of the wrapper element.\n * @property {undefined | number} height - The height of the wrapper element.\n */\nexport type WrapperSize = { width: undefined | number; height: undefined | number }\n\n/**\n * Type definition for the unobserver function.\n * @typedef {() => (null | void)} Unobserver\n */\ntype Unobserver = () => (null | void)\n\n/**\n * Type definition for the resize callback function.\n * @typedef {(wrapperSize: WrapperSize) => void} UseResizeCallBack\n */\nexport type UseResizeCallBack = (wrapperSize: WrapperSize) => void\n\n/**\n * Custom hook to observe the resize event of an HTML element\n * and execute a callback or update the state with the new size.\n * @param {number} [debounceDelay=250] - The delay in milliseconds for debouncing the resize event.\n * @param {UseResizeCallBack} [callBack] - Optional callback function to execute when the element is resized.\n * @returns {[MutableRefObject<HTMLElement | null | undefined>, WrapperSize, Unobserver | undefined]}\n * An array containing the ref object for the container element,\n * the current size of the container, and an unobserver function.\n */\n// eslint-disable-next-line default-param-last\nexport const useResize = (debounceDelay = 250, callBack?: UseResizeCallBack): [\n MutableRefObject<HTMLElement | null | undefined>, WrapperSize, Unobserver | undefined] => {\n const [containerSize, setContainerSize] = useState<WrapperSize>({ width: undefined, height: undefined })\n\n const lastResizeWidthRef = useRef<WrapperSize>({ width: 0, height: 0 })\n const containerRef: MutableRefObject<HTMLElement | undefined | null> = useRef<HTMLElement | undefined | null>()\n const unobserverRef = useRef<Unobserver>()\n\n const debouncedResizeWrapper = useMemo(() => debounce((entries) => {\n const newResizeWidth = entries[0].contentRect.width\n const newResizeHeight = entries[0].contentRect.height\n\n if (lastResizeWidthRef.current?.width === newResizeWidth\n && lastResizeWidthRef.current?.height === newResizeHeight) {\n return\n }\n lastResizeWidthRef.current = { width: newResizeWidth, height: newResizeHeight }\n\n // eslint-disable-next-line semi-style\n ;(callBack || setContainerSize)({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }, debounceDelay), [callBack, debounceDelay])\n\n useLayoutEffect(() => {\n let resizeObserver: ResizeObserver\n let containerElement: HTMLElement\n\n if (containerRef?.current) {\n containerElement = containerRef?.current\n resizeObserver = new ResizeObserver(debouncedResizeWrapper)\n resizeObserver.observe(containerElement as Element)\n\n // eslint-disable-next-line semi-style\n ;(callBack || setContainerSize)({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }\n\n const unobserver = (): void => {\n resizeObserver?.unobserve?.(containerElement as Element)\n }\n\n // setUnobserver(unobserver)\n unobserverRef.current = unobserver\n\n return unobserver\n }, [debouncedResizeWrapper, containerRef, callBack])\n\n return [containerRef, containerSize, unobserverRef.current]\n}\n"],"names":["useResize","debounceDelay","arguments","length","undefined","callBack","containerSize","setContainerSize","useState","width","height","lastResizeWidthRef","useRef","containerRef","unobserverRef","debouncedResizeWrapper","useMemo","debounce","entries","newResizeWidth","contentRect","newResizeHeight","current","clientWidth","clientHeight","useLayoutEffect","resizeObserver","containerElement","ResizeObserver","observe","unobserver","unobserve"],"mappings":"0IAiCaA,MAAAA,EAAY,WACmE,IADlEC,EAAaC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAAKG,EAA4BH,UAAAC,OAAAD,EAAAA,kBAAAE,EAEzE,MAAOE,EAAeC,GAAoBC,EAAsB,CAAEC,WAAOL,EAAWM,YAAQN,IAEtFO,EAAqBC,EAAoB,CAAEH,MAAO,EAAGC,OAAQ,IAC7DG,EAAiED,IACjEE,EAAgBF,IAEhBG,EAAyBC,GAAQ,IAAMC,GAAUC,IACrD,MAAMC,EAAiBD,EAAQ,GAAGE,YAAYX,MACxCY,EAAkBH,EAAQ,GAAGE,YAAYV,OAE3CC,EAAmBW,SAASb,QAAUU,GACrCR,EAAmBW,SAASZ,SAAWW,IAG5CV,EAAmBW,QAAU,CAAEb,MAAOU,EAAgBT,OAAQW,IAG5DhB,GAAYE,GAAkB,CAC9BE,MAAOI,GAAcS,SAASC,YAC9Bb,OAAQG,GAAcS,SAASE,eAC/B,GACDvB,IAAgB,CAACI,EAAUJ,IA4B9B,OA1BAwB,GAAgB,KACd,IAAIC,EACAC,EAEAd,GAAcS,UAChBK,EAAmBd,GAAcS,QACjCI,EAAiB,IAAIE,eAAeb,GACpCW,EAAeG,QAAQF,IAGrBtB,GAAYE,GAAkB,CAC9BE,MAAOI,GAAcS,SAASC,YAC9Bb,OAAQG,GAAcS,SAASE,gBAInC,MAAMM,EAAaA,KACjBJ,GAAgBK,YAAYJ,EAA4B,EAM1D,OAFAb,EAAcQ,QAAUQ,EAEjBA,CAAU,GAChB,CAACf,EAAwBF,EAAcR,IAEnC,CAACQ,EAAcP,EAAeQ,EAAcQ,QACrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutBox.js","sources":["../../../../../../../../../src/core/ui/components/container/layoutBox/LayoutBox.tsx"],"sourcesContent":["import { memo, FC, useMemo, CSSProperties, forwardRef, LegacyRef } from 'react'\n\nimport { useParseProps } from '../../../../hooks/useParseProps'\nimport { classNames } from '../../../../utils/helpers/ui'\n\nimport classes from './layoutBox.module.scss'\nimport { LayoutDirection, LayoutBoxProps } from './layoutBox.types'\n\n/**\n * Map of flex values for resolving flex alignment and justification.\n * @type {Record<string, string>}\n */\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\n/**\n * Resolves flex alignment and justification properties based on the provided value.\n * @param {string | undefined} value - The value to resolve.\n * @returns {string | undefined} - Resolved flex property value.\n */\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\n/**\n * Forwarded ref version of the LayoutBox component.\n * @param {LayoutBoxProps} props - Props for the LayoutBox component.\n * @param {LegacyRef<HTMLDivElement> | undefined} ref - Ref for accessing the underlying DOM element.\n * @returns {JSX.Element} - Rendered LayoutBox component.\n */\nconst LayoutBoxRefForwarded = forwardRef(({\n id, style, children, tabIndex, className = '', onClick, column, ...props\n}: LayoutBoxProps, ref: LegacyRef<HTMLDivElement> | undefined | null) => {\n const { dataProps, restProps } = useParseProps(props)\n\n /**\n * Memoized onClick event properties.\n * @type {{ onClick?: () => void; onKeyDown?: () => void; role?: string; tabIndex?: number }}\n */\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n /**\n * Memoized resolved direction based on the column prop.\n * @type {LayoutDirection}\n */\n const resolvedColumn = useMemo(() => ((\n column !== undefined && column === true)\n ? LayoutDirection.COLUMN\n : null), [column])\n\n /**\n * Memoized styles combining parsed props and additional styles.\n * @type {CSSProperties}\n */\n const styles = useMemo(() => (\n {\n ...restProps,\n ...(restProps.align ? { alignItems: resolveFlexProps(restProps.align as string) } : {}),\n ...(restProps.justify ? { justifyContent: resolveFlexProps(restProps.justify as string) } : {}),\n ...(restProps.direction || resolvedColumn ? { flexDirection: restProps.direction || resolvedColumn } : {}),\n ...style,\n }\n ), [resolvedColumn, restProps, style])\n\n return (\n <div\n {...(id ? { id: `${id}` } : {})}\n ref={ref}\n tabIndex={tabIndex}\n className={classNames(\n classes['layout-box'],\n className,\n )}\n style={styles as CSSProperties}\n {...dataProps}\n data-testid={dataProps.dataTestId || dataProps['data-testid'] || id}\n {...onClickProps}\n >\n {children}\n </div>\n )\n})\n\nLayoutBoxRefForwarded.displayName = 'LayoutBoxRefForwarded'\n\n/**\n * Memoized and memoized LayoutBox component.\n * @type {FC<LayoutBoxProps>}\n */\nexport const LayoutBox: FC<LayoutBoxProps> = memo<LayoutBoxProps>(LayoutBoxRefForwarded)\n\nLayoutBox.displayName = 'LayoutBox'\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","LayoutBoxRefForwarded","forwardRef","_ref","ref","id","style","children","tabIndex","className","onClick","column","props","dataProps","restProps","useParseProps","onClickProps","useMemo","onKeyDown","role","resolvedColumn","undefined","LayoutDirection","COLUMN","styles","align","alignItems","justify","justifyContent","direction","flexDirection","React","createElement","_extends","classNames","classes","dataTestId","displayName","LayoutBox","memo"],"mappings":"6WAYA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAQRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAQrGC,EAAwBC,GAAW,CAAAC,EAEtBC,KAAsD,IAF/BC,GACxCA,EAAEC,MAAEA,EAAKC,SAAEA,EAAQC,SAAEA,EAAQC,UAAEA,EAAY,GAAEC,QAAEA,EAAOC,OAAEA,KAAWC,GACpDT,EACf,MAAMU,UAAEA,EAASC,UAAEA,GAAcC,EAAcH,GAMzCI,EAAeC,GAAQ,IAAOP,EAAW,CAC7CA,UACAQ,UAAWR,EACXS,KAAM,SACNX,UAAW,GACR,CAAG,GAAE,CAACE,IAMLU,EAAiBH,GAAQ,SAClBI,IAAXV,IAAmC,IAAXA,EACtBW,EAAgBC,OAChB,MAAO,CAACZ,IAMNa,EAASP,GAAQ,KACrB,IACKH,KACCA,EAAUW,MAAQ,CAAEC,WAAY3B,EAAiBe,EAAUW,QAAqB,CAAE,KAClFX,EAAUa,QAAU,CAAEC,eAAgB7B,EAAiBe,EAAUa,UAAuB,CAAE,KAC1Fb,EAAUe,WAAaT,EAAiB,CAAEU,cAAehB,EAAUe,WAAaT,GAAmB,CAAE,KACtGd,KAEJ,CAACc,EAAgBN,EAAWR,IAE/B,OACEyB,MAAAC,oBAAAC,EAAA,CAAA,EACO5B,EAAK,CAAEA,GAAI,GAAGA,KAAS,GAAE,CAC9BD,IAAKA,EACLI,SAAUA,EACVC,UAAWyB,EACTC,EAAQ,cACR1B,GAEFH,MAAOkB,GACHX,EAAS,CACb,cAAaA,EAAUuB,YAAcvB,EAAU,gBAAkBR,GAC7DW,GAEHT,EACG,IAIVN,EAAsBoC,YAAc,8BAMvBC,EAAgCC,EAAqBtC,GAElEqC,EAAUD,YAAc"}
1
+ {"version":3,"file":"LayoutBox.js","sources":["../../../../../../../../../src/core/ui/components/container/layoutBox/LayoutBox.tsx"],"sourcesContent":["import { memo, FC, useMemo, CSSProperties, forwardRef, LegacyRef } from 'react'\n\nimport { useParseProps } from '../../../../hooks/useParseProps'\nimport { classNames } from '../../../../utils/helpers/ui'\n\nimport classes from './layoutBox.module.scss'\nimport { LayoutDirection, LayoutBoxProps } from './layoutBox.types'\n\n/**\n * Map of flex values for resolving flex alignment and justification.\n * @type {Record<string, string>}\n */\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\n/**\n * Resolves flex alignment and justification properties based on the provided value.\n * @param {string | undefined} value - The value to resolve.\n * @returns {string | undefined} - Resolved flex property value.\n */\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\n/**\n * Forwarded ref version of the LayoutBox component.\n * @param {LayoutBoxProps} props - Props for the LayoutBox component.\n * @param {LegacyRef<HTMLDivElement> | undefined} ref - Ref for accessing the underlying DOM element.\n * @returns {JSX.Element} - Rendered LayoutBox component.\n */\nconst LayoutBoxRefForwarded = forwardRef(({\n id, style, children, tabIndex, className = '', onClick, column, ...props\n}: LayoutBoxProps, ref: LegacyRef<HTMLDivElement> | undefined | null) => {\n const { dataProps, restProps } = useParseProps(props)\n\n /**\n * Memoized onClick event properties.\n * @type {{ onClick?: () => void; onKeyDown?: () => void; role?: string; tabIndex?: number }}\n */\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n /**\n * Memoized resolved direction based on the column prop.\n * @type {LayoutDirection}\n */\n const resolvedColumn = useMemo(() => ((\n column !== undefined && column === true)\n ? LayoutDirection.COLUMN\n : null), [column])\n\n /**\n * Memoized styles combining parsed props and additional styles.\n * @type {CSSProperties}\n */\n const styles = useMemo(() => (\n {\n ...restProps,\n ...(restProps.align ? { alignItems: resolveFlexProps(restProps.align as string) } : {}),\n ...(restProps.justify ? { justifyContent: resolveFlexProps(restProps.justify as string) } : {}),\n ...(restProps.direction || resolvedColumn ? { flexDirection: restProps.direction || resolvedColumn } : {}),\n ...style,\n }\n ), [resolvedColumn, restProps, style])\n\n return (\n <div\n {...(id ? { id: `${id}` } : {})}\n ref={ref}\n tabIndex={tabIndex}\n className={classNames(\n classes['layout-box'],\n className,\n )}\n style={styles as CSSProperties}\n {...dataProps}\n data-testid={dataProps.dataTestId || dataProps['data-testid'] || id}\n {...onClickProps}\n >\n {children}\n </div>\n )\n})\n\nLayoutBoxRefForwarded.displayName = 'LayoutBoxRefForwarded'\n\n/**\n * Memoized and memoized LayoutBox component.\n * @type {FC<LayoutBoxProps>}\n */\nexport const LayoutBox: FC<LayoutBoxProps> = memo<LayoutBoxProps>(LayoutBoxRefForwarded)\n\nLayoutBox.displayName = 'LayoutBox'\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","LayoutBoxRefForwarded","forwardRef","_ref","ref","id","style","children","tabIndex","className","onClick","column","props","dataProps","restProps","useParseProps","onClickProps","useMemo","onKeyDown","role","resolvedColumn","undefined","LayoutDirection","COLUMN","styles","align","alignItems","justify","justifyContent","direction","flexDirection","React","createElement","_extends","classNames","classes","dataTestId","displayName","LayoutBox","memo"],"mappings":"6WAYA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAQRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAQrGC,EAAwBC,GAAW,CAAAC,EAEtBC,KAAsD,IAF/BC,GACxCA,EAAEC,MAAEA,EAAKC,SAAEA,EAAQC,SAAEA,EAAQC,UAAEA,EAAY,GAAEC,QAAEA,EAAOC,OAAEA,KAAWC,GACpDT,EACf,MAAMU,UAAEA,EAASC,UAAEA,GAAcC,EAAcH,GAMzCI,EAAeC,GAAQ,IAAOP,EAAW,CAC7CA,UACAQ,UAAWR,EACXS,KAAM,SACNX,UAAW,GACR,CAAG,GAAE,CAACE,IAMLU,EAAiBH,GAAQ,SAClBI,IAAXV,IAAmC,IAAXA,EACtBW,EAAgBC,OAChB,MAAO,CAACZ,IAMNa,EAASP,GAAQ,KACrB,IACKH,KACCA,EAAUW,MAAQ,CAAEC,WAAY3B,EAAiBe,EAAUW,QAAqB,MAChFX,EAAUa,QAAU,CAAEC,eAAgB7B,EAAiBe,EAAUa,UAAuB,MACxFb,EAAUe,WAAaT,EAAiB,CAAEU,cAAehB,EAAUe,WAAaT,GAAmB,MACpGd,KAEJ,CAACc,EAAgBN,EAAWR,IAE/B,OACEyB,MAAAC,oBAAAC,EAAA,CAAA,EACO5B,EAAK,CAAEA,GAAI,GAAGA,KAAS,GAAE,CAC9BD,IAAKA,EACLI,SAAUA,EACVC,UAAWyB,EACTC,EAAQ,cACR1B,GAEFH,MAAOkB,GACHX,EAAS,CACb,cAAaA,EAAUuB,YAAcvB,EAAU,gBAAkBR,GAC7DW,GAEHT,EACG,IAIVN,EAAsBoC,YAAc,8BAMvBC,EAAgCC,EAAqBtC,GAElEqC,EAAUD,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"IconBase.js","sources":["../../../../../../../../src/core/ui/components/icon/IconBase.tsx"],"sourcesContent":["import { CSSProperties, memo, useMemo, FC, PropsWithChildren, MouseEvent } from 'react'\n\nimport classes from './icon.module.scss'\nimport { unifyIconUrl } from './unifyIconUrl'\n\n\nexport type IconBaseType = PropsWithChildren<unknown> & {\n id?: string\n iconUrl?: string | null\n minWidth?: string | null\n minHeight?: string | null\n width?: string | null\n height?: string | null\n size?: string | null\n fontSize?: string | null\n color?: string | null\n className?: string | null\n style?: CSSProperties | null\n onClick?: (event?: MouseEvent<HTMLSpanElement> | undefined) => void\n}\n\nexport const IconBase: FC<IconBaseType> = memo<IconBaseType>(({\n iconUrl, minWidth, minHeight, size,\n fontSize, width, height, color = 'currentColor', className = '', children, style, onClick, ...props\n}: IconBaseType) => {\n const unifiedIconUrl = iconUrl && unifyIconUrl(iconUrl)\n\n const styles = useMemo(() => (\n {\n '--min-width': minWidth || size || width || 'auto',\n '--min-height': minHeight || size || height || 'auto',\n '--width': size || width || '1rem',\n '--height': size || height || '1rem',\n ...(fontSize ? { fontSize } : {}),\n ...(unifiedIconUrl ? { '--icon-url': `url(${unifiedIconUrl})` } : {}),\n ...(unifiedIconUrl ? { '--icon-color': color } : { '--icon-content-color': color }),\n ...(onClick ? { cursor: 'pointer' } : {}),\n ...style,\n }\n ), [minWidth, size, width, minHeight, height, fontSize, unifiedIconUrl, color, onClick, style])\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return (\n <span\n {...props}\n {...onClickProps}\n className={`${classes['icon-base']} icon-base ${className}`}\n style={styles as CSSProperties}\n >\n {(!unifiedIconUrl && children) && children}\n </span>\n )\n})\n\nIconBase.displayName = 'IconBase'\n"],"names":["IconBase","memo","_ref","iconUrl","minWidth","minHeight","size","fontSize","width","height","color","className","children","style","onClick","props","unifiedIconUrl","unifyIconUrl","styles","useMemo","cursor","onClickProps","role","tabIndex","React","createElement","_extends","classes","displayName"],"mappings":"qNAqBaA,EAA6BC,GAAmBC,IAGzC,IAH0CC,QAC5DA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,KAAEA,EAAIC,SAClCA,EAAQC,MAAEA,EAAKC,OAAEA,EAAMC,MAAEA,EAAQ,eAAcC,UAAEA,EAAY,GAAEC,SAAEA,EAAQC,MAAEA,EAAKC,QAAEA,KAAYC,GACjFb,EACb,MAAMc,EAAiBb,GAAWc,EAAad,GAEzCe,EAASC,GAAQ,KACrB,CACE,cAAef,GAAYE,GAAQE,GAAS,OAC5C,eAAgBH,GAAaC,GAAQG,GAAU,OAC/C,UAAWH,GAAQE,GAAS,OAC5B,WAAYF,GAAQG,GAAU,UAC1BF,EAAW,CAAEA,YAAa,CAAE,KAC5BS,EAAiB,CAAE,aAAc,OAAOA,MAAsB,CAAE,KAChEA,EAAiB,CAAE,eAAgBN,GAAU,CAAE,uBAAwBA,MACvEI,EAAU,CAAEM,OAAQ,WAAc,CAAE,KACrCP,KAEJ,CAACT,EAAUE,EAAME,EAAOH,EAAWI,EAAQF,EAAUS,EAAgBN,EAAOI,EAASD,IAElFQ,EAAeF,GAAQ,IAAOL,EAAW,CAC7CA,UACAQ,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACT,IAEX,OACEU,MAAAC,cAAA,OAAAC,EACMX,CAAAA,EAAAA,EACAM,EAAY,CAChBV,UAAW,GAAGgB,EAAQ,0BAA0BhB,IAChDE,MAAOK,KAEJF,GAAkBJ,GAAaA,EAC7B,IAIXZ,EAAS4B,YAAc"}
1
+ {"version":3,"file":"IconBase.js","sources":["../../../../../../../../src/core/ui/components/icon/IconBase.tsx"],"sourcesContent":["import { CSSProperties, memo, useMemo, FC, PropsWithChildren, MouseEvent } from 'react'\n\nimport classes from './icon.module.scss'\nimport { unifyIconUrl } from './unifyIconUrl'\n\n\nexport type IconBaseType = PropsWithChildren<unknown> & {\n id?: string\n iconUrl?: string | null\n minWidth?: string | null\n minHeight?: string | null\n width?: string | null\n height?: string | null\n size?: string | null\n fontSize?: string | null\n color?: string | null\n className?: string | null\n style?: CSSProperties | null\n onClick?: (event?: MouseEvent<HTMLSpanElement> | undefined) => void\n}\n\nexport const IconBase: FC<IconBaseType> = memo<IconBaseType>(({\n iconUrl, minWidth, minHeight, size,\n fontSize, width, height, color = 'currentColor', className = '', children, style, onClick, ...props\n}: IconBaseType) => {\n const unifiedIconUrl = iconUrl && unifyIconUrl(iconUrl)\n\n const styles = useMemo(() => (\n {\n '--min-width': minWidth || size || width || 'auto',\n '--min-height': minHeight || size || height || 'auto',\n '--width': size || width || '1rem',\n '--height': size || height || '1rem',\n ...(fontSize ? { fontSize } : {}),\n ...(unifiedIconUrl ? { '--icon-url': `url(${unifiedIconUrl})` } : {}),\n ...(unifiedIconUrl ? { '--icon-color': color } : { '--icon-content-color': color }),\n ...(onClick ? { cursor: 'pointer' } : {}),\n ...style,\n }\n ), [minWidth, size, width, minHeight, height, fontSize, unifiedIconUrl, color, onClick, style])\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return (\n <span\n {...props}\n {...onClickProps}\n className={`${classes['icon-base']} icon-base ${className}`}\n style={styles as CSSProperties}\n >\n {(!unifiedIconUrl && children) && children}\n </span>\n )\n})\n\nIconBase.displayName = 'IconBase'\n"],"names":["IconBase","memo","_ref","iconUrl","minWidth","minHeight","size","fontSize","width","height","color","className","children","style","onClick","props","unifiedIconUrl","unifyIconUrl","styles","useMemo","cursor","onClickProps","role","tabIndex","React","createElement","_extends","classes","displayName"],"mappings":"qNAqBaA,EAA6BC,GAAmBC,IAGzC,IAH0CC,QAC5DA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,KAAEA,EAAIC,SAClCA,EAAQC,MAAEA,EAAKC,OAAEA,EAAMC,MAAEA,EAAQ,eAAcC,UAAEA,EAAY,GAAEC,SAAEA,EAAQC,MAAEA,EAAKC,QAAEA,KAAYC,GACjFb,EACb,MAAMc,EAAiBb,GAAWc,EAAad,GAEzCe,EAASC,GAAQ,KACrB,CACE,cAAef,GAAYE,GAAQE,GAAS,OAC5C,eAAgBH,GAAaC,GAAQG,GAAU,OAC/C,UAAWH,GAAQE,GAAS,OAC5B,WAAYF,GAAQG,GAAU,UAC1BF,EAAW,CAAEA,YAAa,MAC1BS,EAAiB,CAAE,aAAc,OAAOA,MAAsB,MAC9DA,EAAiB,CAAE,eAAgBN,GAAU,CAAE,uBAAwBA,MACvEI,EAAU,CAAEM,OAAQ,WAAc,MACnCP,KAEJ,CAACT,EAAUE,EAAME,EAAOH,EAAWI,EAAQF,EAAUS,EAAgBN,EAAOI,EAASD,IAElFQ,EAAeF,GAAQ,IAAOL,EAAW,CAC7CA,UACAQ,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACT,IAEX,OACEU,MAAAC,cAAA,OAAAC,EACMX,CAAAA,EAAAA,EACAM,EAAY,CAChBV,UAAW,GAAGgB,EAAQ,0BAA0BhB,IAChDE,MAAOK,KAEJF,GAAkBJ,GAAaA,EAC7B,IAIXZ,EAAS4B,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"IconWC.js","sources":["../../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class ESIcon extends HTMLElement {\n content: string | null\n\n mainElement: HTMLElement\n\n iconUrl?: string | null\n\n minWidth?: string | null\n\n minHeight?: string | null\n\n width?: string | null\n\n height?: string | null\n\n size?: string | null\n\n fontSize?: string | null\n\n color?: string | null\n\n static get observedAttributes(): string[] {\n return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'fontSize', 'color', 'className']\n }\n\n connectedCallback(): void {\n if (this.content || this.innerHTML) {\n this.content = this.content || this.innerHTML || this.getAttribute('content')\n }\n\n this.innerHTML = template.innerHTML\n\n resolveAttributes(this, ESIcon.observedAttributes)\n\n this.render()\n }\n\n attributeChangedCallback(attrName: string, oldVal: string | number | null, newVal: string | number | null): void {\n if (attrName === 'className' || attrName === 'classname' || attrName === 'class') {\n if (typeof newVal === 'string') {\n this.classList.remove(newVal as string)\n this.classList.add(newVal as string)\n }\n }\n if (!this.color) {\n this.color = 'currentColor'\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[attrName] = (newVal as string) || ''\n this.render()\n }\n\n render = (): void => {\n this.mainElement = this.mainElement || this.querySelector('.icon-base') as HTMLElement\n if (!this.mainElement) {\n return\n }\n this.classList.add(classes['icon-base-parent'])\n this.mainElement.classList.add(classes['icon-base'])\n\n const styles = {\n '--min-width': this.minWidth || this.size || this.width || 'auto',\n '--min-height': this.minHeight || this.size || this.height || 'auto',\n '--width': this.size || this.width || '1rem',\n '--height': this.size || this.height || '1rem',\n ...(this.fontSize ? { 'font-size': this.fontSize || 'unset' } : {}),\n ...(this.iconUrl ? { '--icon-url': `url(${this.iconUrl})` } : {}),\n ...(this.iconUrl ? { '--icon-color': this.color } : { '--icon-content-color': this.color }),\n }\n\n this.mainElement.innerHTML = this.iconUrl ? '' : (this.content || '')\n\n this.mainElement.setAttribute('style', Object.entries(styles).map(([key, value]) => `${key}: ${value};`).join(' '))\n }\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'icon-base': any\n }\n }\n}\n\nexport const ESIconBase = {\n ESIconBase: ESIcon,\n}\n"],"names":["template","document","createElement","innerHTML","ESIcon","ced","_dec","_class","HTMLElement","constructor","super","arguments","this","content","mainElement","iconUrl","minWidth","minHeight","width","height","size","fontSize","color","render","querySelector","classList","add","classes","styles","setAttribute","Object","entries","map","_ref","key","value","join","observedAttributes","connectedCallback","getAttribute","resolveAttributes","attributeChangedCallback","attrName","oldVal","newVal","remove","ESIconBase"],"mappings":"2IAKA,MAAMA,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,kCAcrB,IACaC,EADZC,EAAI,YAAYC,CAAAC,EAAjB,MACaH,UAAeI,YAAYC,WAAAA,GAAAC,SAAAC,WAAAC,KACtCC,aAAO,EAAAD,KAEPE,iBAAW,EAAAF,KAEXG,aAAO,EAAAH,KAEPI,cAAQ,EAAAJ,KAERK,eAAS,EAAAL,KAETM,WAAK,EAAAN,KAELO,YAAM,EAAAP,KAENQ,UAAI,EAAAR,KAEJS,cAAQ,EAAAT,KAERU,WAAK,EAAAV,KAkCLW,OAAS,KAEP,GADAX,KAAKE,YAAcF,KAAKE,aAAeF,KAAKY,cAAc,eACrDZ,KAAKE,YACR,OAEFF,KAAKa,UAAUC,IAAIC,EAAQ,qBAC3Bf,KAAKE,YAAYW,UAAUC,IAAIC,EAAQ,cAEvC,MAAMC,EAAS,CACb,cAAehB,KAAKI,UAAYJ,KAAKQ,MAAQR,KAAKM,OAAS,OAC3D,eAAgBN,KAAKK,WAAaL,KAAKQ,MAAQR,KAAKO,QAAU,OAC9D,UAAWP,KAAKQ,MAAQR,KAAKM,OAAS,OACtC,WAAYN,KAAKQ,MAAQR,KAAKO,QAAU,UACpCP,KAAKS,SAAW,CAAE,YAAaT,KAAKS,UAAY,SAAY,CAAE,KAC9DT,KAAKG,QAAU,CAAE,aAAc,OAAOH,KAAKG,YAAe,CAAE,KAC5DH,KAAKG,QAAU,CAAE,eAAgBH,KAAKU,OAAU,CAAE,uBAAwBV,KAAKU,QAGrFV,KAAKE,YAAYX,UAAYS,KAAKG,QAAU,GAAMH,KAAKC,SAAW,GAElED,KAAKE,YAAYe,aAAa,QAASC,OAAOC,QAAQH,GAAQI,KAAIC,IAAA,IAAEC,EAAKC,GAAMF,EAAA,MAAK,GAAGC,MAAQC,IAAQ,IAAEC,KAAK,KAAK,CACpH,CArDD,6BAAWC,GACT,MAAO,CAAC,UAAW,WAAY,YAAa,QAAS,SAAU,OAAQ,WAAY,QAAS,YAC9F,CAEAC,iBAAAA,IACM1B,KAAKC,SAAWD,KAAKT,aACvBS,KAAKC,QAAUD,KAAKC,SAAWD,KAAKT,WAAaS,KAAK2B,aAAa,YAGrE3B,KAAKT,UAAYH,EAASG,UAE1BqC,EAAkB5B,KAAMR,EAAOiC,oBAE/BzB,KAAKW,QACP,CAEAkB,wBAAAA,CAAyBC,EAAkBC,EAAgCC,GACxD,cAAbF,GAAyC,cAAbA,GAAyC,UAAbA,GACpC,iBAAXE,IACThC,KAAKa,UAAUoB,OAAOD,GACtBhC,KAAKa,UAAUC,IAAIkB,IAGlBhC,KAAKU,QACRV,KAAKU,MAAQ,gBAIfV,KAAK8B,GAAaE,GAAqB,GACvChC,KAAKW,QACP,KAwBDhB,EAWM,MAAMuC,EAAa,CACxBA,WAAY1C"}
1
+ {"version":3,"file":"IconWC.js","sources":["../../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class ESIcon extends HTMLElement {\n content: string | null\n\n mainElement: HTMLElement\n\n iconUrl?: string | null\n\n minWidth?: string | null\n\n minHeight?: string | null\n\n width?: string | null\n\n height?: string | null\n\n size?: string | null\n\n fontSize?: string | null\n\n color?: string | null\n\n static get observedAttributes(): string[] {\n return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'fontSize', 'color', 'className']\n }\n\n connectedCallback(): void {\n if (this.content || this.innerHTML) {\n this.content = this.content || this.innerHTML || this.getAttribute('content')\n }\n\n this.innerHTML = template.innerHTML\n\n resolveAttributes(this, ESIcon.observedAttributes)\n\n this.render()\n }\n\n attributeChangedCallback(attrName: string, oldVal: string | number | null, newVal: string | number | null): void {\n if (attrName === 'className' || attrName === 'classname' || attrName === 'class') {\n if (typeof newVal === 'string') {\n this.classList.remove(newVal as string)\n this.classList.add(newVal as string)\n }\n }\n if (!this.color) {\n this.color = 'currentColor'\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[attrName] = (newVal as string) || ''\n this.render()\n }\n\n render = (): void => {\n this.mainElement = this.mainElement || this.querySelector('.icon-base') as HTMLElement\n if (!this.mainElement) {\n return\n }\n this.classList.add(classes['icon-base-parent'])\n this.mainElement.classList.add(classes['icon-base'])\n\n const styles = {\n '--min-width': this.minWidth || this.size || this.width || 'auto',\n '--min-height': this.minHeight || this.size || this.height || 'auto',\n '--width': this.size || this.width || '1rem',\n '--height': this.size || this.height || '1rem',\n ...(this.fontSize ? { 'font-size': this.fontSize || 'unset' } : {}),\n ...(this.iconUrl ? { '--icon-url': `url(${this.iconUrl})` } : {}),\n ...(this.iconUrl ? { '--icon-color': this.color } : { '--icon-content-color': this.color }),\n }\n\n this.mainElement.innerHTML = this.iconUrl ? '' : (this.content || '')\n\n this.mainElement.setAttribute('style', Object.entries(styles).map(([key, value]) => `${key}: ${value};`).join(' '))\n }\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'icon-base': any\n }\n }\n}\n\nexport const ESIconBase = {\n ESIconBase: ESIcon,\n}\n"],"names":["template","document","createElement","innerHTML","ESIcon","ced","_dec","_class","HTMLElement","constructor","super","arguments","this","content","mainElement","iconUrl","minWidth","minHeight","width","height","size","fontSize","color","render","querySelector","classList","add","classes","styles","setAttribute","Object","entries","map","_ref","key","value","join","observedAttributes","connectedCallback","getAttribute","resolveAttributes","attributeChangedCallback","attrName","oldVal","newVal","remove","ESIconBase"],"mappings":"2IAKA,MAAMA,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,kCAcrB,IACaC,EADZC,EAAI,YAAYC,CAAAC,EAAjB,MACaH,UAAeI,YAAYC,WAAAA,GAAAC,SAAAC,WAAAC,KACtCC,aAAO,EAAAD,KAEPE,iBAAW,EAAAF,KAEXG,aAAO,EAAAH,KAEPI,cAAQ,EAAAJ,KAERK,eAAS,EAAAL,KAETM,WAAK,EAAAN,KAELO,YAAM,EAAAP,KAENQ,UAAI,EAAAR,KAEJS,cAAQ,EAAAT,KAERU,WAAK,EAAAV,KAkCLW,OAAS,KAEP,GADAX,KAAKE,YAAcF,KAAKE,aAAeF,KAAKY,cAAc,eACrDZ,KAAKE,YACR,OAEFF,KAAKa,UAAUC,IAAIC,EAAQ,qBAC3Bf,KAAKE,YAAYW,UAAUC,IAAIC,EAAQ,cAEvC,MAAMC,EAAS,CACb,cAAehB,KAAKI,UAAYJ,KAAKQ,MAAQR,KAAKM,OAAS,OAC3D,eAAgBN,KAAKK,WAAaL,KAAKQ,MAAQR,KAAKO,QAAU,OAC9D,UAAWP,KAAKQ,MAAQR,KAAKM,OAAS,OACtC,WAAYN,KAAKQ,MAAQR,KAAKO,QAAU,UACpCP,KAAKS,SAAW,CAAE,YAAaT,KAAKS,UAAY,SAAY,MAC5DT,KAAKG,QAAU,CAAE,aAAc,OAAOH,KAAKG,YAAe,MAC1DH,KAAKG,QAAU,CAAE,eAAgBH,KAAKU,OAAU,CAAE,uBAAwBV,KAAKU,QAGrFV,KAAKE,YAAYX,UAAYS,KAAKG,QAAU,GAAMH,KAAKC,SAAW,GAElED,KAAKE,YAAYe,aAAa,QAASC,OAAOC,QAAQH,GAAQI,KAAIC,IAAA,IAAEC,EAAKC,GAAMF,EAAA,MAAK,GAAGC,MAAQC,IAAQ,IAAEC,KAAK,KAAK,CACpH,CArDD,6BAAWC,GACT,MAAO,CAAC,UAAW,WAAY,YAAa,QAAS,SAAU,OAAQ,WAAY,QAAS,YAC9F,CAEAC,iBAAAA,IACM1B,KAAKC,SAAWD,KAAKT,aACvBS,KAAKC,QAAUD,KAAKC,SAAWD,KAAKT,WAAaS,KAAK2B,aAAa,YAGrE3B,KAAKT,UAAYH,EAASG,UAE1BqC,EAAkB5B,KAAMR,EAAOiC,oBAE/BzB,KAAKW,QACP,CAEAkB,wBAAAA,CAAyBC,EAAkBC,EAAgCC,GACxD,cAAbF,GAAyC,cAAbA,GAAyC,UAAbA,GACpC,iBAAXE,IACThC,KAAKa,UAAUoB,OAAOD,GACtBhC,KAAKa,UAAUC,IAAIkB,IAGlBhC,KAAKU,QACRV,KAAKU,MAAQ,gBAIfV,KAAK8B,GAAaE,GAAqB,GACvChC,KAAKW,QACP,KAwBDhB,EAWM,MAAMuC,EAAa,CACxBA,WAAY1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popup.js","sources":["../../../../../../../../../src/core/ui/components/molecules/popup/Popup.tsx"],"sourcesContent":["import {\n cloneElement, memo, PropsWithChildren, FC, ReactNode, CSSProperties, useMemo, ReactElement,\n} from 'react'\n\nimport { Popover as PopoverLite } from '../popover/PopoverLite'\nimport { HeadlineTertiary as H3 } from '../../atoms/text'\nimport { IconBase } from '../../icon'\nimport { DividerLine } from '../../dividers'\nimport { LayoutBox } from '../../container'\nimport { closeIconJSX } from '../../atoms/icons'\n\nimport classes from './popup.module.scss'\nimport classesOverlay from './popup.overlay.module.scss'\nimport { PopupAnimateVariant, PopupProps } from './popup.types'\n\n\n/**\n * Styles for the Popup component.\n *\n * @typedef {Object} PopupStyles\n * @property {Object} inner - The inner styles for the popup.\n * @property {CSSProperties} content - The styles for the popup content.\n */\n\nconst styles: {\n popup: {\n inner: Record<string, Record<string, string>>\n }\n\n} = {\n popup: {\n inner: {\n [PopupAnimateVariant.SLIDE_DOWN]: { '--slideYFrom': '-48px' },\n [PopupAnimateVariant.SLIDE_UP]: { '--slideYFrom': '48px' },\n [PopupAnimateVariant.SLIDE_RIGHT]: { '--slideXFrom': '-64px' },\n [PopupAnimateVariant.SLIDE_LEFT]: { '--slideXFrom': '64px' },\n },\n },\n}\n\n/**\n * Popup component.\n *\n * @type {React.FC<PopupProps>}\n * @returns {React.ReactElement} The Popup.\n */\nexport const Popup: FC<PopupProps> = memo<PopupProps>(({\n title = 'Popup\\'s title',\n children,\n components = {},\n isModal = true,\n hideOnClickOutside = false,\n hideOnContentClick = false,\n animateVariant = PopupAnimateVariant.SLIDE_UP,\n hasHeader = true,\n hasCloseIcon = true,\n width,\n height,\n style,\n ...props\n}: PopupProps) => {\n /**\n * The ContentComponent to render.\n *\n * @type {ComponentType}\n */\n const ContentComponent = components?.ContentComponent\n\n /**\n * The popup styles.\n *\n * @type {CSSProperties}\n */\n const styles = useMemo(() => ({\n ...(width ? { '--popup-width': width } : {}),\n ...(height ? { '--popup-height': height } : {}),\n ...style,\n }), [height, style, width])\n\n return (\n <PopoverLite\n clickable\n isPopup\n isModal={isModal}\n hideOnContentClick={hideOnContentClick}\n hideOnClickOutside={hideOnClickOutside}\n modalOverlayClassName={classesOverlay['popup-modal-overlay']}\n {...props}\n >\n <p>{/* Placeholder element to avoid error with no children */}</p>\n <PopupContent\n title={title}\n hasHeader={hasHeader}\n hasCloseIcon={hasCloseIcon}\n animateVariant={animateVariant}\n popupStyle={styles}\n >\n {/* Render children if ContentComponent is not provided */}\n {(!ContentComponent && children) && children}\n {/* Render ContentComponent if children are not provided */}\n {(!children && ContentComponent) && <ContentComponent />}\n </PopupContent>\n </PopoverLite>\n )\n})\n\n/**\n * The display name of the Popup component.\n *\n * @type {string}\n */\nPopup.displayName = 'Popup'\n\ntype PopupContentProps = PropsWithChildren<unknown> & {\n title?: string\n forwardedRef?: ForwardedRef['forwardedRef']\n animateVariant?: PopupProps['animateVariant']\n popupStyle?: CSSProperties\n hasHeader?: boolean\n hasCloseIcon?: boolean\n closeIconURL?: string\n hide?: () => void\n}\n\n/**\n * The PopupContent component.\n *\n * @param {PopupContentProps} props The props for the PopupContent component.\n * @returns {React.ReactElement} The PopupContent.\n */\nconst PopupContent = memo(({\n title,\n forwardedRef,\n hide,\n children,\n animateVariant,\n popupStyle,\n hasHeader = true,\n hasCloseIcon = true,\n closeIconURL,\n ...props\n}: PopupContentProps) => {\n /**\n * The ContentRemapped element.\n *\n * @type {React.ReactElement[] | React.ReactElement}\n */\n const ContentRemapped = children && Array.isArray(children)\n ? children.filter((child: ReactNode | ReactElement) => !!child)\n .map((child: ReactElement, index: number) => cloneElement(\n // eslint-disable-next-line react/no-array-index-key\n child, { key: index, ...child.props, hide, ...props },\n ))\n : <div>Pseudo Content</div>\n\n return (\n <div className={`${classes['popup-container']}`} ref={forwardedRef} style={popupStyle}>\n <LayoutBox\n className={`${classes['popup-container-inner']}`}\n style={animateVariant ? styles.popup.inner[animateVariant] : null}\n >\n {hasHeader && (\n <>\n <LayoutBox justify='space-between' align='start' width='100%' padding='20px 20px 16px 20px'>\n <H3>{title}</H3>\n {hasCloseIcon && (\n <div\n onClick={hide}\n onKeyDown={hide}\n role='button'\n tabIndex={-1}\n className={classes['close-button']}\n >\n {closeIconURL && <IconBase iconUrl={closeIconURL} />}\n {!closeIconURL && (\n <IconBase>\n {closeIconJSX}\n </IconBase>\n )}\n </div>\n )}\n </LayoutBox>\n <DividerLine length='100%' />\n </>\n )}\n <div className={classes['popup-container-inner-div']}>\n {ContentRemapped && ContentRemapped}\n </div>\n </LayoutBox>\n </div>\n )\n})\n\n/**\n * The display name of the PopupContent component.\n *\n * @type {string}\n */\nPopupContent.displayName = 'PopupContent'\n"],"names":["styles","popup","inner","PopupAnimateVariant","SLIDE_DOWN","SLIDE_UP","SLIDE_RIGHT","SLIDE_LEFT","Popup","memo","_ref","title","children","components","isModal","hideOnClickOutside","hideOnContentClick","animateVariant","hasHeader","hasCloseIcon","width","height","style","props","ContentComponent","useMemo","React","createElement","PopoverLite","_extends","clickable","isPopup","modalOverlayClassName","classesOverlay","PopupContent","popupStyle","displayName","_ref2","forwardedRef","hide","closeIconURL","ContentRemapped","Array","isArray","filter","child","map","index","cloneElement","key","className","classes","ref","LayoutBox","Fragment","justify","align","padding","H3","onClick","onKeyDown","role","tabIndex","IconBase","iconUrl","closeIconJSX","DividerLine","length"],"mappings":"knBAwBA,MAAMA,EAKF,CACFC,MAAO,CACLC,MAAO,CACL,CAACC,EAAoBC,YAAa,CAAE,eAAgB,SACpD,CAACD,EAAoBE,UAAW,CAAE,eAAgB,QAClD,CAACF,EAAoBG,aAAc,CAAE,eAAgB,SACrD,CAACH,EAAoBI,YAAa,CAAE,eAAgB,WAW7CC,EAAwBC,GAAiBC,IAcpC,IAdqCC,MACrDA,EAAQ,gBAAgBC,SACxBA,EAAQC,WACRA,EAAa,CAAE,EAAAC,QACfA,GAAU,EAAIC,mBACdA,GAAqB,EAAKC,mBAC1BA,GAAqB,EAAKC,eAC1BA,EAAiBd,EAAoBE,SAAQa,UAC7CA,GAAY,EAAIC,aAChBA,GAAe,EAAIC,MACnBA,EAAKC,OACLA,EAAMC,MACNA,KACGC,GACQb,EAMX,MAAMc,EAAmBX,GAAYW,iBAO/BxB,EAASyB,GAAQ,KAAO,IACxBL,EAAQ,CAAE,gBAAiBA,GAAU,CAAE,KACvCC,EAAS,CAAE,iBAAkBA,GAAW,CAAE,KAC3CC,KACD,CAACD,EAAQC,EAAOF,IAEpB,OACEM,MAAAC,cAACC,EAAWC,EAAA,CACVC,WAAS,EACTC,SAAO,EACPjB,QAASA,EACTE,mBAAoBA,EACpBD,mBAAoBA,EACpBiB,sBAAuBC,EAAe,wBAClCV,GAEJG,MAAAC,cAAA,IAAA,MACAD,MAAAC,cAACO,EAAY,CACXvB,MAAOA,EACPO,UAAWA,EACXC,aAAcA,EACdF,eAAgBA,EAChBkB,WAAYnC,IAGTwB,GAAoBZ,GAAaA,GAEjCA,GAAYY,GAAqBE,MAAAC,cAACH,EAAkB,OAE7C,IASlBhB,EAAM4B,YAAc,QAmBpB,MAAMF,EAAezB,GAAK4B,IAWD,IAXE1B,MACzBA,EAAK2B,aACLA,EAAYC,KACZA,EAAI3B,SACJA,EAAQK,eACRA,EAAckB,WACdA,EAAUjB,UACVA,GAAY,EAAIC,aAChBA,GAAe,EAAIqB,aACnBA,KACGjB,GACec,EAMlB,MAAMI,EAAkB7B,GAAY8B,MAAMC,QAAQ/B,GAC9CA,EAASgC,QAAQC,KAAsCA,IACtDC,KAAI,CAACD,EAAqBE,IAAkBC,EAE3CH,EAAO,CAAEI,IAAKF,KAAUF,EAAMtB,MAAOgB,UAAShB,MAEhDG,MAAAC,cAAA,MAAA,KAAK,kBAET,OACED,MAAAC,cAAA,MAAA,CAAKuB,UAAW,GAAGC,EAAQ,qBAAsBC,IAAKd,EAAchB,MAAOa,GACzET,MAAAC,cAAC0B,EAAS,CACRH,UAAW,GAAGC,EAAQ,2BACtB7B,MAAOL,EAAiBjB,EAAOC,MAAMC,MAAMe,GAAkB,MAE5DC,GACCQ,MAAAC,cAAAD,MAAA4B,SACE5B,KAAAA,MAAAC,cAAC0B,EAAS,CAACE,QAAQ,gBAAgBC,MAAM,QAAQpC,MAAM,OAAOqC,QAAQ,uBACpE/B,MAAAC,cAAC+B,EAAE,KAAE/C,GACJQ,GACCO,MAAAC,cAAA,MAAA,CACEgC,QAASpB,EACTqB,UAAWrB,EACXsB,KAAK,SACLC,UAAW,EACXZ,UAAWC,EAAQ,iBAElBX,GAAgBd,MAAAC,cAACoC,EAAQ,CAACC,QAASxB,KAClCA,GACAd,MAAAC,cAACoC,OACEE,KAMXvC,MAAAC,cAACuC,EAAW,CAACC,OAAO,UAGxBzC,MAAAC,cAAA,MAAA,CAAKuB,UAAWC,EAAQ,8BACrBV,GAAmBA,IAGpB,IASVP,EAAaE,YAAc"}
1
+ {"version":3,"file":"Popup.js","sources":["../../../../../../../../../src/core/ui/components/molecules/popup/Popup.tsx"],"sourcesContent":["import {\n cloneElement, memo, PropsWithChildren, FC, ReactNode, CSSProperties, useMemo, ReactElement,\n} from 'react'\n\nimport { Popover as PopoverLite } from '../popover/PopoverLite'\nimport { HeadlineTertiary as H3 } from '../../atoms/text'\nimport { IconBase } from '../../icon'\nimport { DividerLine } from '../../dividers'\nimport { LayoutBox } from '../../container'\nimport { closeIconJSX } from '../../atoms/icons'\n\nimport classes from './popup.module.scss'\nimport classesOverlay from './popup.overlay.module.scss'\nimport { PopupAnimateVariant, PopupProps } from './popup.types'\n\n\n/**\n * Styles for the Popup component.\n *\n * @typedef {Object} PopupStyles\n * @property {Object} inner - The inner styles for the popup.\n * @property {CSSProperties} content - The styles for the popup content.\n */\n\nconst styles: {\n popup: {\n inner: Record<string, Record<string, string>>\n }\n\n} = {\n popup: {\n inner: {\n [PopupAnimateVariant.SLIDE_DOWN]: { '--slideYFrom': '-48px' },\n [PopupAnimateVariant.SLIDE_UP]: { '--slideYFrom': '48px' },\n [PopupAnimateVariant.SLIDE_RIGHT]: { '--slideXFrom': '-64px' },\n [PopupAnimateVariant.SLIDE_LEFT]: { '--slideXFrom': '64px' },\n },\n },\n}\n\n/**\n * Popup component.\n *\n * @type {React.FC<PopupProps>}\n * @returns {React.ReactElement} The Popup.\n */\nexport const Popup: FC<PopupProps> = memo<PopupProps>(({\n title = 'Popup\\'s title',\n children,\n components = {},\n isModal = true,\n hideOnClickOutside = false,\n hideOnContentClick = false,\n animateVariant = PopupAnimateVariant.SLIDE_UP,\n hasHeader = true,\n hasCloseIcon = true,\n width,\n height,\n style,\n ...props\n}: PopupProps) => {\n /**\n * The ContentComponent to render.\n *\n * @type {ComponentType}\n */\n const ContentComponent = components?.ContentComponent\n\n /**\n * The popup styles.\n *\n * @type {CSSProperties}\n */\n const styles = useMemo(() => ({\n ...(width ? { '--popup-width': width } : {}),\n ...(height ? { '--popup-height': height } : {}),\n ...style,\n }), [height, style, width])\n\n return (\n <PopoverLite\n clickable\n isPopup\n isModal={isModal}\n hideOnContentClick={hideOnContentClick}\n hideOnClickOutside={hideOnClickOutside}\n modalOverlayClassName={classesOverlay['popup-modal-overlay']}\n {...props}\n >\n <p>{/* Placeholder element to avoid error with no children */}</p>\n <PopupContent\n title={title}\n hasHeader={hasHeader}\n hasCloseIcon={hasCloseIcon}\n animateVariant={animateVariant}\n popupStyle={styles}\n >\n {/* Render children if ContentComponent is not provided */}\n {(!ContentComponent && children) && children}\n {/* Render ContentComponent if children are not provided */}\n {(!children && ContentComponent) && <ContentComponent />}\n </PopupContent>\n </PopoverLite>\n )\n})\n\n/**\n * The display name of the Popup component.\n *\n * @type {string}\n */\nPopup.displayName = 'Popup'\n\ntype PopupContentProps = PropsWithChildren<unknown> & {\n title?: string\n forwardedRef?: ForwardedRef['forwardedRef']\n animateVariant?: PopupProps['animateVariant']\n popupStyle?: CSSProperties\n hasHeader?: boolean\n hasCloseIcon?: boolean\n closeIconURL?: string\n hide?: () => void\n}\n\n/**\n * The PopupContent component.\n *\n * @param {PopupContentProps} props The props for the PopupContent component.\n * @returns {React.ReactElement} The PopupContent.\n */\nconst PopupContent = memo(({\n title,\n forwardedRef,\n hide,\n children,\n animateVariant,\n popupStyle,\n hasHeader = true,\n hasCloseIcon = true,\n closeIconURL,\n ...props\n}: PopupContentProps) => {\n /**\n * The ContentRemapped element.\n *\n * @type {React.ReactElement[] | React.ReactElement}\n */\n const ContentRemapped = children && Array.isArray(children)\n ? children.filter((child: ReactNode | ReactElement) => !!child)\n .map((child: ReactElement, index: number) => cloneElement(\n // eslint-disable-next-line react/no-array-index-key\n child, { key: index, ...child.props, hide, ...props },\n ))\n : <div>Pseudo Content</div>\n\n return (\n <div className={`${classes['popup-container']}`} ref={forwardedRef} style={popupStyle}>\n <LayoutBox\n className={`${classes['popup-container-inner']}`}\n style={animateVariant ? styles.popup.inner[animateVariant] : null}\n >\n {hasHeader && (\n <>\n <LayoutBox justify='space-between' align='start' width='100%' padding='20px 20px 16px 20px'>\n <H3>{title}</H3>\n {hasCloseIcon && (\n <div\n onClick={hide}\n onKeyDown={hide}\n role='button'\n tabIndex={-1}\n className={classes['close-button']}\n >\n {closeIconURL && <IconBase iconUrl={closeIconURL} />}\n {!closeIconURL && (\n <IconBase>\n {closeIconJSX}\n </IconBase>\n )}\n </div>\n )}\n </LayoutBox>\n <DividerLine length='100%' />\n </>\n )}\n <div className={classes['popup-container-inner-div']}>\n {ContentRemapped && ContentRemapped}\n </div>\n </LayoutBox>\n </div>\n )\n})\n\n/**\n * The display name of the PopupContent component.\n *\n * @type {string}\n */\nPopupContent.displayName = 'PopupContent'\n"],"names":["styles","popup","inner","PopupAnimateVariant","SLIDE_DOWN","SLIDE_UP","SLIDE_RIGHT","SLIDE_LEFT","Popup","memo","_ref","title","children","components","isModal","hideOnClickOutside","hideOnContentClick","animateVariant","hasHeader","hasCloseIcon","width","height","style","props","ContentComponent","useMemo","React","createElement","PopoverLite","_extends","clickable","isPopup","modalOverlayClassName","classesOverlay","PopupContent","popupStyle","displayName","_ref2","forwardedRef","hide","closeIconURL","ContentRemapped","Array","isArray","filter","child","map","index","cloneElement","key","className","classes","ref","LayoutBox","Fragment","justify","align","padding","H3","onClick","onKeyDown","role","tabIndex","IconBase","iconUrl","closeIconJSX","DividerLine","length"],"mappings":"knBAwBA,MAAMA,EAKF,CACFC,MAAO,CACLC,MAAO,CACL,CAACC,EAAoBC,YAAa,CAAE,eAAgB,SACpD,CAACD,EAAoBE,UAAW,CAAE,eAAgB,QAClD,CAACF,EAAoBG,aAAc,CAAE,eAAgB,SACrD,CAACH,EAAoBI,YAAa,CAAE,eAAgB,WAW7CC,EAAwBC,GAAiBC,IAcpC,IAdqCC,MACrDA,EAAQ,gBAAgBC,SACxBA,EAAQC,WACRA,EAAa,CAAE,EAAAC,QACfA,GAAU,EAAIC,mBACdA,GAAqB,EAAKC,mBAC1BA,GAAqB,EAAKC,eAC1BA,EAAiBd,EAAoBE,SAAQa,UAC7CA,GAAY,EAAIC,aAChBA,GAAe,EAAIC,MACnBA,EAAKC,OACLA,EAAMC,MACNA,KACGC,GACQb,EAMX,MAAMc,EAAmBX,GAAYW,iBAO/BxB,EAASyB,GAAQ,KAAO,IACxBL,EAAQ,CAAE,gBAAiBA,GAAU,MACrCC,EAAS,CAAE,iBAAkBA,GAAW,MACzCC,KACD,CAACD,EAAQC,EAAOF,IAEpB,OACEM,MAAAC,cAACC,EAAWC,EAAA,CACVC,WAAS,EACTC,SAAO,EACPjB,QAASA,EACTE,mBAAoBA,EACpBD,mBAAoBA,EACpBiB,sBAAuBC,EAAe,wBAClCV,GAEJG,MAAAC,cAAA,IAAA,MACAD,MAAAC,cAACO,EAAY,CACXvB,MAAOA,EACPO,UAAWA,EACXC,aAAcA,EACdF,eAAgBA,EAChBkB,WAAYnC,IAGTwB,GAAoBZ,GAAaA,GAEjCA,GAAYY,GAAqBE,MAAAC,cAACH,EAAkB,OAE7C,IASlBhB,EAAM4B,YAAc,QAmBpB,MAAMF,EAAezB,GAAK4B,IAWD,IAXE1B,MACzBA,EAAK2B,aACLA,EAAYC,KACZA,EAAI3B,SACJA,EAAQK,eACRA,EAAckB,WACdA,EAAUjB,UACVA,GAAY,EAAIC,aAChBA,GAAe,EAAIqB,aACnBA,KACGjB,GACec,EAMlB,MAAMI,EAAkB7B,GAAY8B,MAAMC,QAAQ/B,GAC9CA,EAASgC,QAAQC,KAAsCA,IACtDC,KAAI,CAACD,EAAqBE,IAAkBC,EAE3CH,EAAO,CAAEI,IAAKF,KAAUF,EAAMtB,MAAOgB,UAAShB,MAEhDG,MAAAC,cAAA,MAAA,KAAK,kBAET,OACED,MAAAC,cAAA,MAAA,CAAKuB,UAAW,GAAGC,EAAQ,qBAAsBC,IAAKd,EAAchB,MAAOa,GACzET,MAAAC,cAAC0B,EAAS,CACRH,UAAW,GAAGC,EAAQ,2BACtB7B,MAAOL,EAAiBjB,EAAOC,MAAMC,MAAMe,GAAkB,MAE5DC,GACCQ,MAAAC,cAAAD,MAAA4B,SACE5B,KAAAA,MAAAC,cAAC0B,EAAS,CAACE,QAAQ,gBAAgBC,MAAM,QAAQpC,MAAM,OAAOqC,QAAQ,uBACpE/B,MAAAC,cAAC+B,EAAE,KAAE/C,GACJQ,GACCO,MAAAC,cAAA,MAAA,CACEgC,QAASpB,EACTqB,UAAWrB,EACXsB,KAAK,SACLC,UAAW,EACXZ,UAAWC,EAAQ,iBAElBX,GAAgBd,MAAAC,cAACoC,EAAQ,CAACC,QAASxB,KAClCA,GACAd,MAAAC,cAACoC,OACEE,KAMXvC,MAAAC,cAACuC,EAAW,CAACC,OAAO,UAGxBzC,MAAAC,cAAA,MAAA,CAAKuB,UAAWC,EAAQ,8BACrBV,GAAmBA,IAGpB,IASVP,EAAaE,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"useOutsideClick.js","sources":["../../../../../src/core/hooks/useOutsideClick.ts"],"sourcesContent":["import { useEffect, useCallback } from 'react'\n\nimport { EventName } from '../constants/ui.constants'\nimport { handleClickOutside as defaultHandleClickOutside } from '../ui/utils/clickOutside'\n\ntype Element = HTMLElement | null | (() => HTMLElement)\ntype CallbackFunction = (target: HTMLElement | null) => void\n\nexport function useOutsideClick(\n element: Element,\n callback?: CallbackFunction,\n handleClickOutside = defaultHandleClickOutside(element, callback),\n): () => void {\n const unsubscriber = useCallback(\n () => document.removeEventListener(EventName.Click, handleClickOutside), [handleClickOutside],\n )\n\n useEffect(() => {\n unsubscriber()\n document.addEventListener(EventName.Click, handleClickOutside)\n\n return unsubscriber\n }, [element, handleClickOutside, unsubscriber])\n\n return unsubscriber\n}\n\nexport function outsideClickHandler(\n element: Element,\n callback?: CallbackFunction,\n handleClickOutside = defaultHandleClickOutside(element, callback),\n): () => void {\n const unsubscriber = (): void => document.removeEventListener(EventName.Click, handleClickOutside)\n\n document.addEventListener(EventName.Click, handleClickOutside)\n\n return unsubscriber\n}\n"],"names":["element","callback","handleClickOutside","arguments","length","undefined","defaultHandleClickOutside","document","addEventListener","EventName","Click","unsubscriber","removeEventListener"],"mappings":"iJA2BO,SACLA,EACAC,GAEY,IADZC,EAAkBC,UAAAC,eAAAC,IAAAF,UAAA,GAAAA,UAAGG,GAAAA,EAAyBJ,mBAACF,EAASC,GAMxD,OAFAM,SAASC,iBAAiBC,EAAAA,UAAUC,MAAOR,GAFtBS,IAAYJ,SAASK,oBAAoBH,EAAAA,UAAUC,MAAOR,EAKjF"}
1
+ {"version":3,"file":"useOutsideClick.js","sources":["../../../../../src/core/hooks/useOutsideClick.ts"],"sourcesContent":["import { useEffect, useCallback } from 'react'\n\nimport { EventName } from '../constants/ui.constants'\nimport { handleClickOutside as defaultHandleClickOutside } from '../ui/utils/clickOutside'\n\ntype Element = HTMLElement | null | (() => HTMLElement)\ntype CallbackFunction = (target: HTMLElement | null) => void\n\n/**\n * Custom hook to handle clicks outside a specified element.\n * @param {Element} element - The element to detect outside clicks for.\n * @param {CallbackFunction} [callback] - Optional callback function to execute when an outside click is detected.\n * @param {Function} [handleClickOutside=defaultHandleClickOutside] - Optional custom function to handle outside clicks.\n * @returns {() => void} Function to unsubscribe the event listener.\n */\nexport function useOutsideClick(\n element: Element,\n callback?: CallbackFunction,\n handleClickOutside = defaultHandleClickOutside(element, callback),\n): () => void {\n const unsubscriber = useCallback(\n () => document.removeEventListener(EventName.Click, handleClickOutside), [handleClickOutside],\n )\n\n useEffect(() => {\n unsubscriber()\n document.addEventListener(EventName.Click, handleClickOutside)\n\n return unsubscriber\n }, [element, handleClickOutside, unsubscriber])\n\n return unsubscriber\n}\n\n/**\n * Function to handle clicks outside a specified element.\n * @param {Element} element - The element to detect outside clicks for.\n * @param {CallbackFunction} [callback] - Optional callback function to execute when an outside click is detected.\n * @param {Function} [handleClickOutside=defaultHandleClickOutside] - Optional custom function to handle outside clicks.\n * @returns {() => void} Function to unsubscribe the event listener.\n */\nexport function outsideClickHandler(\n element: Element,\n callback?: CallbackFunction,\n handleClickOutside = defaultHandleClickOutside(element, callback),\n): () => void {\n const unsubscriber = (): void => document.removeEventListener(EventName.Click, handleClickOutside)\n\n document.addEventListener(EventName.Click, handleClickOutside)\n\n return unsubscriber\n}\n"],"names":["element","callback","handleClickOutside","arguments","length","undefined","defaultHandleClickOutside","document","addEventListener","EventName","Click","unsubscriber","removeEventListener"],"mappings":"iJAyCO,SACLA,EACAC,GAEY,IADZC,EAAkBC,UAAAC,eAAAC,IAAAF,UAAA,GAAAA,UAAGG,GAAAA,EAAyBJ,mBAACF,EAASC,GAMxD,OAFAM,SAASC,iBAAiBC,EAAAA,UAAUC,MAAOR,GAFtBS,IAAYJ,SAASK,oBAAoBH,EAAAA,UAAUC,MAAOR,EAKjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"useParseProps.js","sources":["../../../../../src/core/hooks/useParseProps.ts"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { parseProps } from '../utils/helpers/ui'\n\n\nexport const useParseProps = (props: Record<string, unknown>): ReturnType<typeof parseProps> => {\n const propsCategories = useMemo(() => parseProps(props), [props])\n\n return propsCategories\n}\n"],"names":["props","useMemo","parseProps"],"mappings":"8FAK8BA,GACJC,EAAAA,SAAQ,IAAMC,EAAAA,WAAWF,IAAQ,CAACA"}
1
+ {"version":3,"file":"useParseProps.js","sources":["../../../../../src/core/hooks/useParseProps.ts"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { parseProps } from '../utils/helpers/ui'\n\n/**\n * Custom hook to parse properties using the `parseProps` utility function.\n * @param {Record<string, unknown>} props - The properties to be parsed.\n * @returns {ReturnType<typeof parseProps>} The parsed properties categorized by the `parseProps` function.\n */\nexport const useParseProps = (props: Record<string, unknown>): ReturnType<typeof parseProps> => {\n const propsCategories = useMemo(() => parseProps(props), [props])\n\n return propsCategories\n}\n"],"names":["props","useMemo","parseProps"],"mappings":"8FAS8BA,GACJC,EAAAA,SAAQ,IAAMC,EAAAA,WAAWF,IAAQ,CAACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useResize.js","sources":["../../../../../src/core/hooks/useResize.ts"],"sourcesContent":["import { MutableRefObject, useLayoutEffect, useMemo, useState, useRef } from 'react'\nimport debounce from 'lodash-es/debounce'\n\nexport type WrapperSize = {width: undefined | number; height: undefined | number}\n\n\ntype Unobserver = () => (null | void)\n\nexport type UseResizeCallBack = (wrapperSize: WrapperSize) => void\n\n// eslint-disable-next-line default-param-last\nexport const useResize = (debounceDelay = 250, callBack?: UseResizeCallBack): [\n MutableRefObject<HTMLElement | null | undefined>, WrapperSize, Unobserver | undefined] => {\n const [containerSize, setContainerSize]\n = useState<WrapperSize>({ width: undefined, height: undefined })\n\n const lastResizeWidthRef = useRef<WrapperSize>({ width: 0, height: 0 })\n const containerRef: MutableRefObject<HTMLElement | undefined | null> = useRef<HTMLElement | undefined | null>()\n const unobserverRef = useRef<Unobserver>()\n\n const debouncedResizeWrapper = useMemo(() => debounce((entries) => {\n const newResizeWidth = entries[0].contentRect.width\n const newResizeHeight = entries[0].contentRect.height\n\n if (lastResizeWidthRef.current?.width === newResizeWidth\n && lastResizeWidthRef.current?.height === newResizeHeight) {\n return\n }\n lastResizeWidthRef.current = { width: newResizeWidth, height: newResizeHeight }\n\n // eslint-disable-next-line semi-style\n ;(callBack || setContainerSize)({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }, debounceDelay), [callBack, debounceDelay])\n\n useLayoutEffect(() => {\n let resizeObserver: ResizeObserver\n let containerElement: HTMLElement\n\n if (containerRef?.current) {\n containerElement = containerRef?.current\n resizeObserver = new ResizeObserver(debouncedResizeWrapper)\n resizeObserver.observe(containerElement as Element)\n\n // eslint-disable-next-line semi-style\n ;(callBack || setContainerSize)({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }\n\n const unobserver = (): void => {\n resizeObserver?.unobserve?.(containerElement as Element)\n }\n\n // setUnobserver(unobserver)\n unobserverRef.current = unobserver\n\n return unobserver\n }, [debouncedResizeWrapper, containerRef, callBack])\n\n return [containerRef, containerSize, unobserverRef.current]\n}\n"],"names":["debounceDelay","arguments","length","undefined","callBack","containerSize","setContainerSize","useState","width","height","lastResizeWidthRef","useRef","containerRef","unobserverRef","debouncedResizeWrapper","useMemo","debounce","entries","newResizeWidth","contentRect","newResizeHeight","current","clientWidth","clientHeight","useLayoutEffect","resizeObserver","containerElement","ResizeObserver","observe","unobserver","unobserve"],"mappings":"+GAWyB,WACmE,IADlEA,EAAaC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAAKG,EAA4BH,UAAAC,OAAAD,EAAAA,kBAAAE,EAEzE,MAAOE,EAAeC,GAClBC,WAAsB,CAAEC,WAAOL,EAAWM,YAAQN,IAEhDO,EAAqBC,EAAAA,OAAoB,CAAEH,MAAO,EAAGC,OAAQ,IAC7DG,EAAiED,EAAAA,SACjEE,EAAgBF,EAAAA,SAEhBG,EAAyBC,EAAAA,SAAQ,IAAMC,EAAAA,SAAUC,IACrD,MAAMC,EAAiBD,EAAQ,GAAGE,YAAYX,MACxCY,EAAkBH,EAAQ,GAAGE,YAAYV,OAE3CC,EAAmBW,SAASb,QAAUU,GACrCR,EAAmBW,SAASZ,SAAWW,IAG5CV,EAAmBW,QAAU,CAAEb,MAAOU,EAAgBT,OAAQW,IAG5DhB,GAAYE,GAAkB,CAC9BE,MAAOI,GAAcS,SAASC,YAC9Bb,OAAQG,GAAcS,SAASE,eAC/B,GACDvB,IAAgB,CAACI,EAAUJ,IA4B9B,OA1BAwB,EAAAA,iBAAgB,KACd,IAAIC,EACAC,EAEAd,GAAcS,UAChBK,EAAmBd,GAAcS,QACjCI,EAAiB,IAAIE,eAAeb,GACpCW,EAAeG,QAAQF,IAGrBtB,GAAYE,GAAkB,CAC9BE,MAAOI,GAAcS,SAASC,YAC9Bb,OAAQG,GAAcS,SAASE,gBAInC,MAAMM,EAAaA,KACjBJ,GAAgBK,YAAYJ,EAA4B,EAM1D,OAFAb,EAAcQ,QAAUQ,EAEjBA,CAAU,GAChB,CAACf,EAAwBF,EAAcR,IAEnC,CAACQ,EAAcP,EAAeQ,EAAcQ,QACrD"}
1
+ {"version":3,"file":"useResize.js","sources":["../../../../../src/core/hooks/useResize.ts"],"sourcesContent":["import { MutableRefObject, useLayoutEffect, useMemo, useState, useRef } from 'react'\nimport debounce from 'lodash-es/debounce'\n\n/**\n * Type definition for the size of the wrapper element.\n * @typedef {Object} WrapperSize\n * @property {undefined | number} width - The width of the wrapper element.\n * @property {undefined | number} height - The height of the wrapper element.\n */\nexport type WrapperSize = { width: undefined | number; height: undefined | number }\n\n/**\n * Type definition for the unobserver function.\n * @typedef {() => (null | void)} Unobserver\n */\ntype Unobserver = () => (null | void)\n\n/**\n * Type definition for the resize callback function.\n * @typedef {(wrapperSize: WrapperSize) => void} UseResizeCallBack\n */\nexport type UseResizeCallBack = (wrapperSize: WrapperSize) => void\n\n/**\n * Custom hook to observe the resize event of an HTML element\n * and execute a callback or update the state with the new size.\n * @param {number} [debounceDelay=250] - The delay in milliseconds for debouncing the resize event.\n * @param {UseResizeCallBack} [callBack] - Optional callback function to execute when the element is resized.\n * @returns {[MutableRefObject<HTMLElement | null | undefined>, WrapperSize, Unobserver | undefined]}\n * An array containing the ref object for the container element,\n * the current size of the container, and an unobserver function.\n */\n// eslint-disable-next-line default-param-last\nexport const useResize = (debounceDelay = 250, callBack?: UseResizeCallBack): [\n MutableRefObject<HTMLElement | null | undefined>, WrapperSize, Unobserver | undefined] => {\n const [containerSize, setContainerSize] = useState<WrapperSize>({ width: undefined, height: undefined })\n\n const lastResizeWidthRef = useRef<WrapperSize>({ width: 0, height: 0 })\n const containerRef: MutableRefObject<HTMLElement | undefined | null> = useRef<HTMLElement | undefined | null>()\n const unobserverRef = useRef<Unobserver>()\n\n const debouncedResizeWrapper = useMemo(() => debounce((entries) => {\n const newResizeWidth = entries[0].contentRect.width\n const newResizeHeight = entries[0].contentRect.height\n\n if (lastResizeWidthRef.current?.width === newResizeWidth\n && lastResizeWidthRef.current?.height === newResizeHeight) {\n return\n }\n lastResizeWidthRef.current = { width: newResizeWidth, height: newResizeHeight }\n\n // eslint-disable-next-line semi-style\n ;(callBack || setContainerSize)({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }, debounceDelay), [callBack, debounceDelay])\n\n useLayoutEffect(() => {\n let resizeObserver: ResizeObserver\n let containerElement: HTMLElement\n\n if (containerRef?.current) {\n containerElement = containerRef?.current\n resizeObserver = new ResizeObserver(debouncedResizeWrapper)\n resizeObserver.observe(containerElement as Element)\n\n // eslint-disable-next-line semi-style\n ;(callBack || setContainerSize)({\n width: containerRef?.current?.clientWidth,\n height: containerRef?.current?.clientHeight,\n })\n }\n\n const unobserver = (): void => {\n resizeObserver?.unobserve?.(containerElement as Element)\n }\n\n // setUnobserver(unobserver)\n unobserverRef.current = unobserver\n\n return unobserver\n }, [debouncedResizeWrapper, containerRef, callBack])\n\n return [containerRef, containerSize, unobserverRef.current]\n}\n"],"names":["debounceDelay","arguments","length","undefined","callBack","containerSize","setContainerSize","useState","width","height","lastResizeWidthRef","useRef","containerRef","unobserverRef","debouncedResizeWrapper","useMemo","debounce","entries","newResizeWidth","contentRect","newResizeHeight","current","clientWidth","clientHeight","useLayoutEffect","resizeObserver","containerElement","ResizeObserver","observe","unobserver","unobserve"],"mappings":"+GAiCyB,WACmE,IADlEA,EAAaC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAAKG,EAA4BH,UAAAC,OAAAD,EAAAA,kBAAAE,EAEzE,MAAOE,EAAeC,GAAoBC,WAAsB,CAAEC,WAAOL,EAAWM,YAAQN,IAEtFO,EAAqBC,EAAAA,OAAoB,CAAEH,MAAO,EAAGC,OAAQ,IAC7DG,EAAiED,EAAAA,SACjEE,EAAgBF,EAAAA,SAEhBG,EAAyBC,EAAAA,SAAQ,IAAMC,EAAAA,SAAUC,IACrD,MAAMC,EAAiBD,EAAQ,GAAGE,YAAYX,MACxCY,EAAkBH,EAAQ,GAAGE,YAAYV,OAE3CC,EAAmBW,SAASb,QAAUU,GACrCR,EAAmBW,SAASZ,SAAWW,IAG5CV,EAAmBW,QAAU,CAAEb,MAAOU,EAAgBT,OAAQW,IAG5DhB,GAAYE,GAAkB,CAC9BE,MAAOI,GAAcS,SAASC,YAC9Bb,OAAQG,GAAcS,SAASE,eAC/B,GACDvB,IAAgB,CAACI,EAAUJ,IA4B9B,OA1BAwB,EAAAA,iBAAgB,KACd,IAAIC,EACAC,EAEAd,GAAcS,UAChBK,EAAmBd,GAAcS,QACjCI,EAAiB,IAAIE,eAAeb,GACpCW,EAAeG,QAAQF,IAGrBtB,GAAYE,GAAkB,CAC9BE,MAAOI,GAAcS,SAASC,YAC9Bb,OAAQG,GAAcS,SAASE,gBAInC,MAAMM,EAAaA,KACjBJ,GAAgBK,YAAYJ,EAA4B,EAM1D,OAFAb,EAAcQ,QAAUQ,EAEjBA,CAAU,GAChB,CAACf,EAAwBF,EAAcR,IAEnC,CAACQ,EAAcP,EAAeQ,EAAcQ,QACrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutBox.js","sources":["../../../../../../../../src/core/ui/components/container/layoutBox/LayoutBox.tsx"],"sourcesContent":["import { memo, FC, useMemo, CSSProperties, forwardRef, LegacyRef } from 'react'\n\nimport { useParseProps } from '../../../../hooks/useParseProps'\nimport { classNames } from '../../../../utils/helpers/ui'\n\nimport classes from './layoutBox.module.scss'\nimport { LayoutDirection, LayoutBoxProps } from './layoutBox.types'\n\n/**\n * Map of flex values for resolving flex alignment and justification.\n * @type {Record<string, string>}\n */\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\n/**\n * Resolves flex alignment and justification properties based on the provided value.\n * @param {string | undefined} value - The value to resolve.\n * @returns {string | undefined} - Resolved flex property value.\n */\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\n/**\n * Forwarded ref version of the LayoutBox component.\n * @param {LayoutBoxProps} props - Props for the LayoutBox component.\n * @param {LegacyRef<HTMLDivElement> | undefined} ref - Ref for accessing the underlying DOM element.\n * @returns {JSX.Element} - Rendered LayoutBox component.\n */\nconst LayoutBoxRefForwarded = forwardRef(({\n id, style, children, tabIndex, className = '', onClick, column, ...props\n}: LayoutBoxProps, ref: LegacyRef<HTMLDivElement> | undefined | null) => {\n const { dataProps, restProps } = useParseProps(props)\n\n /**\n * Memoized onClick event properties.\n * @type {{ onClick?: () => void; onKeyDown?: () => void; role?: string; tabIndex?: number }}\n */\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n /**\n * Memoized resolved direction based on the column prop.\n * @type {LayoutDirection}\n */\n const resolvedColumn = useMemo(() => ((\n column !== undefined && column === true)\n ? LayoutDirection.COLUMN\n : null), [column])\n\n /**\n * Memoized styles combining parsed props and additional styles.\n * @type {CSSProperties}\n */\n const styles = useMemo(() => (\n {\n ...restProps,\n ...(restProps.align ? { alignItems: resolveFlexProps(restProps.align as string) } : {}),\n ...(restProps.justify ? { justifyContent: resolveFlexProps(restProps.justify as string) } : {}),\n ...(restProps.direction || resolvedColumn ? { flexDirection: restProps.direction || resolvedColumn } : {}),\n ...style,\n }\n ), [resolvedColumn, restProps, style])\n\n return (\n <div\n {...(id ? { id: `${id}` } : {})}\n ref={ref}\n tabIndex={tabIndex}\n className={classNames(\n classes['layout-box'],\n className,\n )}\n style={styles as CSSProperties}\n {...dataProps}\n data-testid={dataProps.dataTestId || dataProps['data-testid'] || id}\n {...onClickProps}\n >\n {children}\n </div>\n )\n})\n\nLayoutBoxRefForwarded.displayName = 'LayoutBoxRefForwarded'\n\n/**\n * Memoized and memoized LayoutBox component.\n * @type {FC<LayoutBoxProps>}\n */\nexport const LayoutBox: FC<LayoutBoxProps> = memo<LayoutBoxProps>(LayoutBoxRefForwarded)\n\nLayoutBox.displayName = 'LayoutBox'\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","LayoutBoxRefForwarded","forwardRef","_ref","ref","id","style","children","tabIndex","className","onClick","column","props","dataProps","restProps","useParseProps","onClickProps","useMemo","onKeyDown","role","resolvedColumn","undefined","LayoutDirection","COLUMN","styles","align","alignItems","justify","justifyContent","direction","flexDirection","React","createElement","_extends","classNames","classes","dataTestId","displayName","LayoutBox","memo"],"mappings":"gRAYA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAQRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAQrGC,EAAwBC,EAAUA,YAAC,CAAAC,EAEtBC,KAAsD,IAF/BC,GACxCA,EAAEC,MAAEA,EAAKC,SAAEA,EAAQC,SAAEA,EAAQC,UAAEA,EAAY,GAAEC,QAAEA,EAAOC,OAAEA,KAAWC,GACpDT,EACf,MAAMU,UAAEA,EAASC,UAAEA,GAAcC,EAAAA,cAAcH,GAMzCI,EAAeC,WAAQ,IAAOP,EAAW,CAC7CA,UACAQ,UAAWR,EACXS,KAAM,SACNX,UAAW,GACR,CAAG,GAAE,CAACE,IAMLU,EAAiBH,EAAOA,SAAC,SAClBI,IAAXV,IAAmC,IAAXA,EACtBW,EAAAA,gBAAgBC,OAChB,MAAO,CAACZ,IAMNa,EAASP,EAAAA,SAAQ,KACrB,IACKH,KACCA,EAAUW,MAAQ,CAAEC,WAAY3B,EAAiBe,EAAUW,QAAqB,CAAE,KAClFX,EAAUa,QAAU,CAAEC,eAAgB7B,EAAiBe,EAAUa,UAAuB,CAAE,KAC1Fb,EAAUe,WAAaT,EAAiB,CAAEU,cAAehB,EAAUe,WAAaT,GAAmB,CAAE,KACtGd,KAEJ,CAACc,EAAgBN,EAAWR,IAE/B,OACEyB,MAAAC,oBAAAC,EAAAA,QAAA,CAAA,EACO5B,EAAK,CAAEA,GAAI,GAAGA,KAAS,GAAE,CAC9BD,IAAKA,EACLI,SAAUA,EACVC,UAAWyB,EAAAA,WACTC,EAAAA,QAAQ,cACR1B,GAEFH,MAAOkB,GACHX,EAAS,CACb,cAAaA,EAAUuB,YAAcvB,EAAU,gBAAkBR,GAC7DW,GAEHT,EACG,IAIVN,EAAsBoC,YAAc,8BAMvBC,EAAgCC,EAAIA,KAAiBtC,GAElEqC,EAAUD,YAAc"}
1
+ {"version":3,"file":"LayoutBox.js","sources":["../../../../../../../../src/core/ui/components/container/layoutBox/LayoutBox.tsx"],"sourcesContent":["import { memo, FC, useMemo, CSSProperties, forwardRef, LegacyRef } from 'react'\n\nimport { useParseProps } from '../../../../hooks/useParseProps'\nimport { classNames } from '../../../../utils/helpers/ui'\n\nimport classes from './layoutBox.module.scss'\nimport { LayoutDirection, LayoutBoxProps } from './layoutBox.types'\n\n/**\n * Map of flex values for resolving flex alignment and justification.\n * @type {Record<string, string>}\n */\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\n/**\n * Resolves flex alignment and justification properties based on the provided value.\n * @param {string | undefined} value - The value to resolve.\n * @returns {string | undefined} - Resolved flex property value.\n */\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\n/**\n * Forwarded ref version of the LayoutBox component.\n * @param {LayoutBoxProps} props - Props for the LayoutBox component.\n * @param {LegacyRef<HTMLDivElement> | undefined} ref - Ref for accessing the underlying DOM element.\n * @returns {JSX.Element} - Rendered LayoutBox component.\n */\nconst LayoutBoxRefForwarded = forwardRef(({\n id, style, children, tabIndex, className = '', onClick, column, ...props\n}: LayoutBoxProps, ref: LegacyRef<HTMLDivElement> | undefined | null) => {\n const { dataProps, restProps } = useParseProps(props)\n\n /**\n * Memoized onClick event properties.\n * @type {{ onClick?: () => void; onKeyDown?: () => void; role?: string; tabIndex?: number }}\n */\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n /**\n * Memoized resolved direction based on the column prop.\n * @type {LayoutDirection}\n */\n const resolvedColumn = useMemo(() => ((\n column !== undefined && column === true)\n ? LayoutDirection.COLUMN\n : null), [column])\n\n /**\n * Memoized styles combining parsed props and additional styles.\n * @type {CSSProperties}\n */\n const styles = useMemo(() => (\n {\n ...restProps,\n ...(restProps.align ? { alignItems: resolveFlexProps(restProps.align as string) } : {}),\n ...(restProps.justify ? { justifyContent: resolveFlexProps(restProps.justify as string) } : {}),\n ...(restProps.direction || resolvedColumn ? { flexDirection: restProps.direction || resolvedColumn } : {}),\n ...style,\n }\n ), [resolvedColumn, restProps, style])\n\n return (\n <div\n {...(id ? { id: `${id}` } : {})}\n ref={ref}\n tabIndex={tabIndex}\n className={classNames(\n classes['layout-box'],\n className,\n )}\n style={styles as CSSProperties}\n {...dataProps}\n data-testid={dataProps.dataTestId || dataProps['data-testid'] || id}\n {...onClickProps}\n >\n {children}\n </div>\n )\n})\n\nLayoutBoxRefForwarded.displayName = 'LayoutBoxRefForwarded'\n\n/**\n * Memoized and memoized LayoutBox component.\n * @type {FC<LayoutBoxProps>}\n */\nexport const LayoutBox: FC<LayoutBoxProps> = memo<LayoutBoxProps>(LayoutBoxRefForwarded)\n\nLayoutBox.displayName = 'LayoutBox'\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","LayoutBoxRefForwarded","forwardRef","_ref","ref","id","style","children","tabIndex","className","onClick","column","props","dataProps","restProps","useParseProps","onClickProps","useMemo","onKeyDown","role","resolvedColumn","undefined","LayoutDirection","COLUMN","styles","align","alignItems","justify","justifyContent","direction","flexDirection","React","createElement","_extends","classNames","classes","dataTestId","displayName","LayoutBox","memo"],"mappings":"gRAYA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAQRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAQrGC,EAAwBC,EAAUA,YAAC,CAAAC,EAEtBC,KAAsD,IAF/BC,GACxCA,EAAEC,MAAEA,EAAKC,SAAEA,EAAQC,SAAEA,EAAQC,UAAEA,EAAY,GAAEC,QAAEA,EAAOC,OAAEA,KAAWC,GACpDT,EACf,MAAMU,UAAEA,EAASC,UAAEA,GAAcC,EAAAA,cAAcH,GAMzCI,EAAeC,WAAQ,IAAOP,EAAW,CAC7CA,UACAQ,UAAWR,EACXS,KAAM,SACNX,UAAW,GACR,CAAG,GAAE,CAACE,IAMLU,EAAiBH,EAAOA,SAAC,SAClBI,IAAXV,IAAmC,IAAXA,EACtBW,EAAAA,gBAAgBC,OAChB,MAAO,CAACZ,IAMNa,EAASP,EAAAA,SAAQ,KACrB,IACKH,KACCA,EAAUW,MAAQ,CAAEC,WAAY3B,EAAiBe,EAAUW,QAAqB,MAChFX,EAAUa,QAAU,CAAEC,eAAgB7B,EAAiBe,EAAUa,UAAuB,MACxFb,EAAUe,WAAaT,EAAiB,CAAEU,cAAehB,EAAUe,WAAaT,GAAmB,MACpGd,KAEJ,CAACc,EAAgBN,EAAWR,IAE/B,OACEyB,MAAAC,oBAAAC,EAAAA,QAAA,CAAA,EACO5B,EAAK,CAAEA,GAAI,GAAGA,KAAS,GAAE,CAC9BD,IAAKA,EACLI,SAAUA,EACVC,UAAWyB,EAAAA,WACTC,EAAAA,QAAQ,cACR1B,GAEFH,MAAOkB,GACHX,EAAS,CACb,cAAaA,EAAUuB,YAAcvB,EAAU,gBAAkBR,GAC7DW,GAEHT,EACG,IAIVN,EAAsBoC,YAAc,8BAMvBC,EAAgCC,EAAIA,KAAiBtC,GAElEqC,EAAUD,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"IconBase.js","sources":["../../../../../../../src/core/ui/components/icon/IconBase.tsx"],"sourcesContent":["import { CSSProperties, memo, useMemo, FC, PropsWithChildren, MouseEvent } from 'react'\n\nimport classes from './icon.module.scss'\nimport { unifyIconUrl } from './unifyIconUrl'\n\n\nexport type IconBaseType = PropsWithChildren<unknown> & {\n id?: string\n iconUrl?: string | null\n minWidth?: string | null\n minHeight?: string | null\n width?: string | null\n height?: string | null\n size?: string | null\n fontSize?: string | null\n color?: string | null\n className?: string | null\n style?: CSSProperties | null\n onClick?: (event?: MouseEvent<HTMLSpanElement> | undefined) => void\n}\n\nexport const IconBase: FC<IconBaseType> = memo<IconBaseType>(({\n iconUrl, minWidth, minHeight, size,\n fontSize, width, height, color = 'currentColor', className = '', children, style, onClick, ...props\n}: IconBaseType) => {\n const unifiedIconUrl = iconUrl && unifyIconUrl(iconUrl)\n\n const styles = useMemo(() => (\n {\n '--min-width': minWidth || size || width || 'auto',\n '--min-height': minHeight || size || height || 'auto',\n '--width': size || width || '1rem',\n '--height': size || height || '1rem',\n ...(fontSize ? { fontSize } : {}),\n ...(unifiedIconUrl ? { '--icon-url': `url(${unifiedIconUrl})` } : {}),\n ...(unifiedIconUrl ? { '--icon-color': color } : { '--icon-content-color': color }),\n ...(onClick ? { cursor: 'pointer' } : {}),\n ...style,\n }\n ), [minWidth, size, width, minHeight, height, fontSize, unifiedIconUrl, color, onClick, style])\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return (\n <span\n {...props}\n {...onClickProps}\n className={`${classes['icon-base']} icon-base ${className}`}\n style={styles as CSSProperties}\n >\n {(!unifiedIconUrl && children) && children}\n </span>\n )\n})\n\nIconBase.displayName = 'IconBase'\n"],"names":["IconBase","memo","_ref","iconUrl","minWidth","minHeight","size","fontSize","width","height","color","className","children","style","onClick","props","unifiedIconUrl","unifyIconUrl","styles","useMemo","cursor","onClickProps","role","tabIndex","React","createElement","_extends","extends","classes","default","displayName"],"mappings":"8KAqBaA,EAA6BC,EAAIA,MAAeC,IAGzC,IAH0CC,QAC5DA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,KAAEA,EAAIC,SAClCA,EAAQC,MAAEA,EAAKC,OAAEA,EAAMC,MAAEA,EAAQ,eAAcC,UAAEA,EAAY,GAAEC,SAAEA,EAAQC,MAAEA,EAAKC,QAAEA,KAAYC,GACjFb,EACb,MAAMc,EAAiBb,GAAWc,EAAYA,aAACd,GAEzCe,EAASC,EAAAA,SAAQ,KACrB,CACE,cAAef,GAAYE,GAAQE,GAAS,OAC5C,eAAgBH,GAAaC,GAAQG,GAAU,OAC/C,UAAWH,GAAQE,GAAS,OAC5B,WAAYF,GAAQG,GAAU,UAC1BF,EAAW,CAAEA,YAAa,CAAE,KAC5BS,EAAiB,CAAE,aAAc,OAAOA,MAAsB,CAAE,KAChEA,EAAiB,CAAE,eAAgBN,GAAU,CAAE,uBAAwBA,MACvEI,EAAU,CAAEM,OAAQ,WAAc,CAAE,KACrCP,KAEJ,CAACT,EAAUE,EAAME,EAAOH,EAAWI,EAAQF,EAAUS,EAAgBN,EAAOI,EAASD,IAElFQ,EAAeF,WAAQ,IAAOL,EAAW,CAC7CA,UACAQ,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACT,IAEX,OACEU,MAAAC,cAAA,OAAAC,EAAAC,QACMZ,CAAAA,EAAAA,EACAM,EAAY,CAChBV,UAAW,GAAGiB,EAAOC,QAAC,0BAA0BlB,IAChDE,MAAOK,KAEJF,GAAkBJ,GAAaA,EAC7B,IAIXZ,EAAS8B,YAAc"}
1
+ {"version":3,"file":"IconBase.js","sources":["../../../../../../../src/core/ui/components/icon/IconBase.tsx"],"sourcesContent":["import { CSSProperties, memo, useMemo, FC, PropsWithChildren, MouseEvent } from 'react'\n\nimport classes from './icon.module.scss'\nimport { unifyIconUrl } from './unifyIconUrl'\n\n\nexport type IconBaseType = PropsWithChildren<unknown> & {\n id?: string\n iconUrl?: string | null\n minWidth?: string | null\n minHeight?: string | null\n width?: string | null\n height?: string | null\n size?: string | null\n fontSize?: string | null\n color?: string | null\n className?: string | null\n style?: CSSProperties | null\n onClick?: (event?: MouseEvent<HTMLSpanElement> | undefined) => void\n}\n\nexport const IconBase: FC<IconBaseType> = memo<IconBaseType>(({\n iconUrl, minWidth, minHeight, size,\n fontSize, width, height, color = 'currentColor', className = '', children, style, onClick, ...props\n}: IconBaseType) => {\n const unifiedIconUrl = iconUrl && unifyIconUrl(iconUrl)\n\n const styles = useMemo(() => (\n {\n '--min-width': minWidth || size || width || 'auto',\n '--min-height': minHeight || size || height || 'auto',\n '--width': size || width || '1rem',\n '--height': size || height || '1rem',\n ...(fontSize ? { fontSize } : {}),\n ...(unifiedIconUrl ? { '--icon-url': `url(${unifiedIconUrl})` } : {}),\n ...(unifiedIconUrl ? { '--icon-color': color } : { '--icon-content-color': color }),\n ...(onClick ? { cursor: 'pointer' } : {}),\n ...style,\n }\n ), [minWidth, size, width, minHeight, height, fontSize, unifiedIconUrl, color, onClick, style])\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return (\n <span\n {...props}\n {...onClickProps}\n className={`${classes['icon-base']} icon-base ${className}`}\n style={styles as CSSProperties}\n >\n {(!unifiedIconUrl && children) && children}\n </span>\n )\n})\n\nIconBase.displayName = 'IconBase'\n"],"names":["IconBase","memo","_ref","iconUrl","minWidth","minHeight","size","fontSize","width","height","color","className","children","style","onClick","props","unifiedIconUrl","unifyIconUrl","styles","useMemo","cursor","onClickProps","role","tabIndex","React","createElement","_extends","extends","classes","default","displayName"],"mappings":"8KAqBaA,EAA6BC,EAAIA,MAAeC,IAGzC,IAH0CC,QAC5DA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,KAAEA,EAAIC,SAClCA,EAAQC,MAAEA,EAAKC,OAAEA,EAAMC,MAAEA,EAAQ,eAAcC,UAAEA,EAAY,GAAEC,SAAEA,EAAQC,MAAEA,EAAKC,QAAEA,KAAYC,GACjFb,EACb,MAAMc,EAAiBb,GAAWc,EAAYA,aAACd,GAEzCe,EAASC,EAAAA,SAAQ,KACrB,CACE,cAAef,GAAYE,GAAQE,GAAS,OAC5C,eAAgBH,GAAaC,GAAQG,GAAU,OAC/C,UAAWH,GAAQE,GAAS,OAC5B,WAAYF,GAAQG,GAAU,UAC1BF,EAAW,CAAEA,YAAa,MAC1BS,EAAiB,CAAE,aAAc,OAAOA,MAAsB,MAC9DA,EAAiB,CAAE,eAAgBN,GAAU,CAAE,uBAAwBA,MACvEI,EAAU,CAAEM,OAAQ,WAAc,MACnCP,KAEJ,CAACT,EAAUE,EAAME,EAAOH,EAAWI,EAAQF,EAAUS,EAAgBN,EAAOI,EAASD,IAElFQ,EAAeF,WAAQ,IAAOL,EAAW,CAC7CA,UACAQ,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACT,IAEX,OACEU,MAAAC,cAAA,OAAAC,EAAAC,QACMZ,CAAAA,EAAAA,EACAM,EAAY,CAChBV,UAAW,GAAGiB,EAAOC,QAAC,0BAA0BlB,IAChDE,MAAOK,KAEJF,GAAkBJ,GAAaA,EAC7B,IAIXZ,EAAS8B,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"IconWC.js","sources":["../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class ESIcon extends HTMLElement {\n content: string | null\n\n mainElement: HTMLElement\n\n iconUrl?: string | null\n\n minWidth?: string | null\n\n minHeight?: string | null\n\n width?: string | null\n\n height?: string | null\n\n size?: string | null\n\n fontSize?: string | null\n\n color?: string | null\n\n static get observedAttributes(): string[] {\n return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'fontSize', 'color', 'className']\n }\n\n connectedCallback(): void {\n if (this.content || this.innerHTML) {\n this.content = this.content || this.innerHTML || this.getAttribute('content')\n }\n\n this.innerHTML = template.innerHTML\n\n resolveAttributes(this, ESIcon.observedAttributes)\n\n this.render()\n }\n\n attributeChangedCallback(attrName: string, oldVal: string | number | null, newVal: string | number | null): void {\n if (attrName === 'className' || attrName === 'classname' || attrName === 'class') {\n if (typeof newVal === 'string') {\n this.classList.remove(newVal as string)\n this.classList.add(newVal as string)\n }\n }\n if (!this.color) {\n this.color = 'currentColor'\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[attrName] = (newVal as string) || ''\n this.render()\n }\n\n render = (): void => {\n this.mainElement = this.mainElement || this.querySelector('.icon-base') as HTMLElement\n if (!this.mainElement) {\n return\n }\n this.classList.add(classes['icon-base-parent'])\n this.mainElement.classList.add(classes['icon-base'])\n\n const styles = {\n '--min-width': this.minWidth || this.size || this.width || 'auto',\n '--min-height': this.minHeight || this.size || this.height || 'auto',\n '--width': this.size || this.width || '1rem',\n '--height': this.size || this.height || '1rem',\n ...(this.fontSize ? { 'font-size': this.fontSize || 'unset' } : {}),\n ...(this.iconUrl ? { '--icon-url': `url(${this.iconUrl})` } : {}),\n ...(this.iconUrl ? { '--icon-color': this.color } : { '--icon-content-color': this.color }),\n }\n\n this.mainElement.innerHTML = this.iconUrl ? '' : (this.content || '')\n\n this.mainElement.setAttribute('style', Object.entries(styles).map(([key, value]) => `${key}: ${value};`).join(' '))\n }\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'icon-base': any\n }\n }\n}\n\nexport const ESIconBase = {\n ESIconBase: ESIcon,\n}\n"],"names":["template","document","createElement","innerHTML","ESIcon","ced","_dec","_class","HTMLElement","constructor","super","arguments","this","content","mainElement","iconUrl","minWidth","minHeight","width","height","size","fontSize","color","render","querySelector","classList","add","classes","default","styles","setAttribute","Object","entries","map","_ref","key","value","join","observedAttributes","connectedCallback","getAttribute","resolveAttributes","attributeChangedCallback","attrName","oldVal","newVal","remove","ESIconBase"],"mappings":"sHAKA,MAAMA,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,kCAcrB,IACaC,EADZC,EAAAA,IAAI,YAAYC,CAAAC,EAAjB,MACaH,UAAeI,YAAYC,WAAAA,GAAAC,SAAAC,WAAAC,KACtCC,aAAO,EAAAD,KAEPE,iBAAW,EAAAF,KAEXG,aAAO,EAAAH,KAEPI,cAAQ,EAAAJ,KAERK,eAAS,EAAAL,KAETM,WAAK,EAAAN,KAELO,YAAM,EAAAP,KAENQ,UAAI,EAAAR,KAEJS,cAAQ,EAAAT,KAERU,WAAK,EAAAV,KAkCLW,OAAS,KAEP,GADAX,KAAKE,YAAcF,KAAKE,aAAeF,KAAKY,cAAc,eACrDZ,KAAKE,YACR,OAEFF,KAAKa,UAAUC,IAAIC,EAAAA,QAAQ,qBAC3Bf,KAAKE,YAAYW,UAAUC,IAAIC,EAAOC,QAAC,cAEvC,MAAMC,EAAS,CACb,cAAejB,KAAKI,UAAYJ,KAAKQ,MAAQR,KAAKM,OAAS,OAC3D,eAAgBN,KAAKK,WAAaL,KAAKQ,MAAQR,KAAKO,QAAU,OAC9D,UAAWP,KAAKQ,MAAQR,KAAKM,OAAS,OACtC,WAAYN,KAAKQ,MAAQR,KAAKO,QAAU,UACpCP,KAAKS,SAAW,CAAE,YAAaT,KAAKS,UAAY,SAAY,CAAE,KAC9DT,KAAKG,QAAU,CAAE,aAAc,OAAOH,KAAKG,YAAe,CAAE,KAC5DH,KAAKG,QAAU,CAAE,eAAgBH,KAAKU,OAAU,CAAE,uBAAwBV,KAAKU,QAGrFV,KAAKE,YAAYX,UAAYS,KAAKG,QAAU,GAAMH,KAAKC,SAAW,GAElED,KAAKE,YAAYgB,aAAa,QAASC,OAAOC,QAAQH,GAAQI,KAAIC,IAAA,IAAEC,EAAKC,GAAMF,EAAA,MAAK,GAAGC,MAAQC,IAAQ,IAAEC,KAAK,KAAK,CACpH,CArDD,6BAAWC,GACT,MAAO,CAAC,UAAW,WAAY,YAAa,QAAS,SAAU,OAAQ,WAAY,QAAS,YAC9F,CAEAC,iBAAAA,IACM3B,KAAKC,SAAWD,KAAKT,aACvBS,KAAKC,QAAUD,KAAKC,SAAWD,KAAKT,WAAaS,KAAK4B,aAAa,YAGrE5B,KAAKT,UAAYH,EAASG,UAE1BsC,EAAAA,kBAAkB7B,KAAMR,EAAOkC,oBAE/B1B,KAAKW,QACP,CAEAmB,wBAAAA,CAAyBC,EAAkBC,EAAgCC,GACxD,cAAbF,GAAyC,cAAbA,GAAyC,UAAbA,GACpC,iBAAXE,IACTjC,KAAKa,UAAUqB,OAAOD,GACtBjC,KAAKa,UAAUC,IAAImB,IAGlBjC,KAAKU,QACRV,KAAKU,MAAQ,gBAIfV,KAAK+B,GAAaE,GAAqB,GACvCjC,KAAKW,QACP,KAwBDhB,EAWM,MAAMwC,EAAa,CACxBA,WAAY3C"}
1
+ {"version":3,"file":"IconWC.js","sources":["../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class ESIcon extends HTMLElement {\n content: string | null\n\n mainElement: HTMLElement\n\n iconUrl?: string | null\n\n minWidth?: string | null\n\n minHeight?: string | null\n\n width?: string | null\n\n height?: string | null\n\n size?: string | null\n\n fontSize?: string | null\n\n color?: string | null\n\n static get observedAttributes(): string[] {\n return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'fontSize', 'color', 'className']\n }\n\n connectedCallback(): void {\n if (this.content || this.innerHTML) {\n this.content = this.content || this.innerHTML || this.getAttribute('content')\n }\n\n this.innerHTML = template.innerHTML\n\n resolveAttributes(this, ESIcon.observedAttributes)\n\n this.render()\n }\n\n attributeChangedCallback(attrName: string, oldVal: string | number | null, newVal: string | number | null): void {\n if (attrName === 'className' || attrName === 'classname' || attrName === 'class') {\n if (typeof newVal === 'string') {\n this.classList.remove(newVal as string)\n this.classList.add(newVal as string)\n }\n }\n if (!this.color) {\n this.color = 'currentColor'\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[attrName] = (newVal as string) || ''\n this.render()\n }\n\n render = (): void => {\n this.mainElement = this.mainElement || this.querySelector('.icon-base') as HTMLElement\n if (!this.mainElement) {\n return\n }\n this.classList.add(classes['icon-base-parent'])\n this.mainElement.classList.add(classes['icon-base'])\n\n const styles = {\n '--min-width': this.minWidth || this.size || this.width || 'auto',\n '--min-height': this.minHeight || this.size || this.height || 'auto',\n '--width': this.size || this.width || '1rem',\n '--height': this.size || this.height || '1rem',\n ...(this.fontSize ? { 'font-size': this.fontSize || 'unset' } : {}),\n ...(this.iconUrl ? { '--icon-url': `url(${this.iconUrl})` } : {}),\n ...(this.iconUrl ? { '--icon-color': this.color } : { '--icon-content-color': this.color }),\n }\n\n this.mainElement.innerHTML = this.iconUrl ? '' : (this.content || '')\n\n this.mainElement.setAttribute('style', Object.entries(styles).map(([key, value]) => `${key}: ${value};`).join(' '))\n }\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'icon-base': any\n }\n }\n}\n\nexport const ESIconBase = {\n ESIconBase: ESIcon,\n}\n"],"names":["template","document","createElement","innerHTML","ESIcon","ced","_dec","_class","HTMLElement","constructor","super","arguments","this","content","mainElement","iconUrl","minWidth","minHeight","width","height","size","fontSize","color","render","querySelector","classList","add","classes","default","styles","setAttribute","Object","entries","map","_ref","key","value","join","observedAttributes","connectedCallback","getAttribute","resolveAttributes","attributeChangedCallback","attrName","oldVal","newVal","remove","ESIconBase"],"mappings":"sHAKA,MAAMA,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,kCAcrB,IACaC,EADZC,EAAAA,IAAI,YAAYC,CAAAC,EAAjB,MACaH,UAAeI,YAAYC,WAAAA,GAAAC,SAAAC,WAAAC,KACtCC,aAAO,EAAAD,KAEPE,iBAAW,EAAAF,KAEXG,aAAO,EAAAH,KAEPI,cAAQ,EAAAJ,KAERK,eAAS,EAAAL,KAETM,WAAK,EAAAN,KAELO,YAAM,EAAAP,KAENQ,UAAI,EAAAR,KAEJS,cAAQ,EAAAT,KAERU,WAAK,EAAAV,KAkCLW,OAAS,KAEP,GADAX,KAAKE,YAAcF,KAAKE,aAAeF,KAAKY,cAAc,eACrDZ,KAAKE,YACR,OAEFF,KAAKa,UAAUC,IAAIC,EAAAA,QAAQ,qBAC3Bf,KAAKE,YAAYW,UAAUC,IAAIC,EAAOC,QAAC,cAEvC,MAAMC,EAAS,CACb,cAAejB,KAAKI,UAAYJ,KAAKQ,MAAQR,KAAKM,OAAS,OAC3D,eAAgBN,KAAKK,WAAaL,KAAKQ,MAAQR,KAAKO,QAAU,OAC9D,UAAWP,KAAKQ,MAAQR,KAAKM,OAAS,OACtC,WAAYN,KAAKQ,MAAQR,KAAKO,QAAU,UACpCP,KAAKS,SAAW,CAAE,YAAaT,KAAKS,UAAY,SAAY,MAC5DT,KAAKG,QAAU,CAAE,aAAc,OAAOH,KAAKG,YAAe,MAC1DH,KAAKG,QAAU,CAAE,eAAgBH,KAAKU,OAAU,CAAE,uBAAwBV,KAAKU,QAGrFV,KAAKE,YAAYX,UAAYS,KAAKG,QAAU,GAAMH,KAAKC,SAAW,GAElED,KAAKE,YAAYgB,aAAa,QAASC,OAAOC,QAAQH,GAAQI,KAAIC,IAAA,IAAEC,EAAKC,GAAMF,EAAA,MAAK,GAAGC,MAAQC,IAAQ,IAAEC,KAAK,KAAK,CACpH,CArDD,6BAAWC,GACT,MAAO,CAAC,UAAW,WAAY,YAAa,QAAS,SAAU,OAAQ,WAAY,QAAS,YAC9F,CAEAC,iBAAAA,IACM3B,KAAKC,SAAWD,KAAKT,aACvBS,KAAKC,QAAUD,KAAKC,SAAWD,KAAKT,WAAaS,KAAK4B,aAAa,YAGrE5B,KAAKT,UAAYH,EAASG,UAE1BsC,EAAAA,kBAAkB7B,KAAMR,EAAOkC,oBAE/B1B,KAAKW,QACP,CAEAmB,wBAAAA,CAAyBC,EAAkBC,EAAgCC,GACxD,cAAbF,GAAyC,cAAbA,GAAyC,UAAbA,GACpC,iBAAXE,IACTjC,KAAKa,UAAUqB,OAAOD,GACtBjC,KAAKa,UAAUC,IAAImB,IAGlBjC,KAAKU,QACRV,KAAKU,MAAQ,gBAIfV,KAAK+B,GAAaE,GAAqB,GACvCjC,KAAKW,QACP,KAwBDhB,EAWM,MAAMwC,EAAa,CACxBA,WAAY3C"}