@e1011/es-kit 1.1.85 → 1.2.0

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 (71) hide show
  1. package/dist/hooks/esm/index.css +333 -333
  2. package/dist/hooks/esm/src/core/hooks/index.js +1 -1
  3. package/dist/hooks/esm/src/core/hooks/useThemePreference.js +1 -1
  4. package/dist/hooks/esm/src/core/hooks/useThemePreference.js.map +1 -1
  5. package/dist/hooks/esm/src/core/utils/helpers/ui.js +1 -1
  6. package/dist/hooks/esm/src/core/utils/helpers/ui.js.map +1 -1
  7. package/dist/hooks/index.css +333 -333
  8. package/dist/hooks/src/core/hooks/index.js +1 -1
  9. package/dist/hooks/src/core/hooks/useThemePreference.js +1 -1
  10. package/dist/hooks/src/core/hooks/useThemePreference.js.map +1 -1
  11. package/dist/hooks/src/core/utils/helpers/ui.js +1 -1
  12. package/dist/hooks/src/core/utils/helpers/ui.js.map +1 -1
  13. package/dist/lib/cjs/src/core/hooks/useThemePreference.js +1 -1
  14. package/dist/lib/cjs/src/core/hooks/useThemePreference.js.map +1 -1
  15. package/dist/lib/cjs/src/core/ui/components/atoms/icons.js +1 -1
  16. package/dist/lib/cjs/src/core/ui/components/atoms/icons.js.map +1 -1
  17. package/dist/lib/cjs/src/core/ui/components/atoms/text/Text.js +1 -1
  18. package/dist/lib/cjs/src/core/ui/components/atoms/text/Text.js.map +1 -1
  19. package/dist/lib/cjs/src/core/ui/components/error/ErrorBoundary.js.map +1 -1
  20. package/dist/lib/cjs/src/core/ui/components/molecules/popover/PopoverLite.js +1 -1
  21. package/dist/lib/cjs/src/core/ui/components/molecules/popover/PopoverLite.js.map +1 -1
  22. package/dist/lib/cjs/src/core/utils/helpers/ui.js +1 -1
  23. package/dist/lib/cjs/src/core/utils/helpers/ui.js.map +1 -1
  24. package/dist/lib/cjs/src/index.js +1 -1
  25. package/dist/lib/esm/src/core/hooks/useThemePreference.js +1 -1
  26. package/dist/lib/esm/src/core/hooks/useThemePreference.js.map +1 -1
  27. package/dist/lib/esm/src/core/ui/components/atoms/icons.js +1 -1
  28. package/dist/lib/esm/src/core/ui/components/atoms/icons.js.map +1 -1
  29. package/dist/lib/esm/src/core/ui/components/atoms/text/Text.js +1 -1
  30. package/dist/lib/esm/src/core/ui/components/atoms/text/Text.js.map +1 -1
  31. package/dist/lib/esm/src/core/ui/components/error/ErrorBoundary.js.map +1 -1
  32. package/dist/lib/esm/src/core/ui/components/molecules/popover/PopoverLite.js +1 -1
  33. package/dist/lib/esm/src/core/ui/components/molecules/popover/PopoverLite.js.map +1 -1
  34. package/dist/lib/esm/src/core/utils/helpers/ui.js +1 -1
  35. package/dist/lib/esm/src/core/utils/helpers/ui.js.map +1 -1
  36. package/dist/lib/esm/src/index.js +1 -1
  37. package/dist/lib/tsconfig.tsbuildinfo +1 -1
  38. package/dist/types/src/core/hooks/useThemePreference.d.ts +0 -41
  39. package/dist/types/src/core/hooks/useThemePreference.d.ts.map +1 -1
  40. package/dist/types/src/core/ui/components/atoms/icons.d.ts.map +1 -1
  41. package/dist/types/src/core/ui/components/atoms/text/Text.d.ts.map +1 -1
  42. package/dist/types/src/core/ui/components/error/ErrorBoundary.d.ts +2 -2
  43. package/dist/types/src/core/ui/components/error/ErrorBoundary.d.ts.map +1 -1
  44. package/dist/types/src/core/ui/components/molecules/popover/PopoverLite.d.ts.map +1 -1
  45. package/dist/types/src/core/utils/helpers/ui.d.ts +40 -0
  46. package/dist/types/src/core/utils/helpers/ui.d.ts.map +1 -1
  47. package/dist/ui/esm/src/core/ui/components/atoms/icons.js +1 -1
  48. package/dist/ui/esm/src/core/ui/components/atoms/icons.js.map +1 -1
  49. package/dist/ui/esm/src/core/ui/components/atoms/text/Text.js +1 -1
  50. package/dist/ui/esm/src/core/ui/components/atoms/text/Text.js.map +1 -1
  51. package/dist/ui/esm/src/core/ui/components/error/ErrorBoundary.js.map +1 -1
  52. package/dist/ui/esm/src/core/ui/components/molecules/popover/PopoverLite.js +1 -1
  53. package/dist/ui/esm/src/core/ui/components/molecules/popover/PopoverLite.js.map +1 -1
  54. package/dist/ui/esm/src/core/utils/helpers/ui.js.map +1 -1
  55. package/dist/ui/src/core/ui/components/atoms/icons.js +1 -1
  56. package/dist/ui/src/core/ui/components/atoms/icons.js.map +1 -1
  57. package/dist/ui/src/core/ui/components/atoms/text/Text.js +1 -1
  58. package/dist/ui/src/core/ui/components/atoms/text/Text.js.map +1 -1
  59. package/dist/ui/src/core/ui/components/error/ErrorBoundary.js.map +1 -1
  60. package/dist/ui/src/core/ui/components/molecules/popover/PopoverLite.js +1 -1
  61. package/dist/ui/src/core/ui/components/molecules/popover/PopoverLite.js.map +1 -1
  62. package/dist/ui/src/core/utils/helpers/ui.js.map +1 -1
  63. package/dist/utils/esm/index.css +333 -333
  64. package/dist/utils/esm/src/core/utils/helpers/ui.js +1 -1
  65. package/dist/utils/esm/src/core/utils/helpers/ui.js.map +1 -1
  66. package/dist/utils/esm/src/core/utils/index.js +1 -1
  67. package/dist/utils/index.css +333 -333
  68. package/dist/utils/src/core/utils/helpers/ui.js +1 -1
  69. package/dist/utils/src/core/utils/helpers/ui.js.map +1 -1
  70. package/dist/utils/src/core/utils/index.js +1 -1
  71. package/package.json +4 -3
@@ -1,48 +1,7 @@
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
- */
7
- export declare const observeThemePreference: (getHtmlElement?: () => HTMLElement, switchCallback?: (isDark: boolean) => void) => () => void;
8
1
  /**
9
2
  * Custom hook to use theme preference in a React component.
10
3
  * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.
11
4
  * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.
12
5
  */
13
6
  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
- */
20
- type ThemeMap = {
21
- dark: string;
22
- light: string;
23
- };
24
- /**
25
- * Gets the base themes.
26
- * @returns {ThemeMap} The current base themes.
27
- */
28
- export declare const getBaseThemes: () => ThemeMap;
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
- */
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
- */
46
- export declare const updateColorTheme: (isDark?: boolean, htmlElement?: HTMLElement) => void;
47
- export {};
48
7
  //# sourceMappingURL=useThemePreference.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"useThemePreference.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useThemePreference.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,oBACb,MAAM,WAAW,mBACjB,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KACxC,IAEF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/ui/components/atoms/icons.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,yCAExB,CAAA;AACD,eAAO,MAAM,WAAW,yCAGvB,CAAA;AAGD,eAAO,MAAM,YAAY,yCAExB,CAAA;AAGD,eAAO,MAAM,gBAAgB,yCAE5B,CAAA;AAGD,eAAO,MAAM,aAAa,yCAEzB,CAAA;AAED,eAAO,MAAM,eAAe,yCAE3B,CAAA;AAED,eAAO,MAAM,UAAU,yCAKtB,CAAA"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/ui/components/atoms/icons.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,yCAExB,CAAA;AACD,eAAO,MAAM,WAAW,yCAGvB,CAAA;AAGD,eAAO,MAAM,YAAY,yCAExB,CAAA;AAGD,eAAO,MAAM,gBAAgB,yCAE5B,CAAA;AAGD,eAAO,MAAM,aAAa,yCAEzB,CAAA;AAED,eAAO,MAAM,eAAe,yCAE3B,CAAA;AAED,eAAO,MAAM,UAAU,yCAKtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAQ,EAAE,EAAW,MAAM,OAAO,CAAA;AAKhD,OAAO,EAAc,SAAS,EAAE,MAAM,cAAc,CAAA;AAGpD,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA6B7B,CAAA"}
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,EAAE,EAAW,MAAM,OAAO,CAAA;AAKxD,OAAO,EAAc,SAAS,EAAE,MAAM,cAAc,CAAA;AAGpD,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA6B7B,CAAA"}
@@ -1,4 +1,4 @@
1
- import { FC, PureComponent, ReactNode } from 'react';
1
+ import { ErrorInfo, FC, PureComponent, ReactNode } from 'react';
2
2
  import { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types';
3
3
  interface State {
4
4
  error?: Error;
@@ -9,7 +9,7 @@ export declare const DefaultErrorComponent: FC<DefaultErrorComponentProps>;
9
9
  export declare class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {
10
10
  constructor(props: ErrorBoundaryProps);
11
11
  static getDerivedStateFromError(error: Error): State;
12
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
12
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
13
13
  render(): ReactNode;
14
14
  }
15
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAQ,aAAa,EAAE,SAAS,EAAE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,GAAG,IAAI;IAW3D,MAAM,IAAI,SAAS;CAmBpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverLite.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/ui/components/molecules/popover/PopoverLite.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EACwB,MAAM,OAAO,CAAA;AAOvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAkB9C,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAmRpC,CAAA"}
1
+ {"version":3,"file":"PopoverLite.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/ui/components/molecules/popover/PopoverLite.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAC0C,MAAM,OAAO,CAAA;AAOlE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAkB9C,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAmRpC,CAAA"}
@@ -24,5 +24,45 @@ export type NoopEvent = {
24
24
  stopImmediatePropagation?: () => void;
25
25
  } | Event;
26
26
  export declare const noop: (event?: NoopEvent) => void;
27
+ /**
28
+ * Type definition for theme map.
29
+ * @typedef {Object} ThemeMap
30
+ * @property {string} dark - CSS class for the dark theme.
31
+ * @property {string} light - CSS class for the light theme.
32
+ */
33
+ export type ThemeMap = {
34
+ dark: string;
35
+ light: string;
36
+ };
37
+ /**
38
+ * Gets the base themes.
39
+ * @returns {ThemeMap} The current base themes.
40
+ */
41
+ export declare const getBaseThemes: () => ThemeMap;
42
+ /**
43
+ * Sets the base theme class names.
44
+ * @param {ThemeMap} themes - Object containing the CSS classes for dark and light themes.
45
+ */
46
+ export declare const setThemeClassNames: (themes: ThemeMap) => void;
47
+ /**
48
+ * Switches the color theme of the document.
49
+ * @param {boolean} isDark - Flag to determine if the dark theme should be applied.
50
+ * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.
51
+ * @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.
52
+ */
53
+ export declare const switchColorTheme: (isDark: boolean, htmlElement?: HTMLElement, findShadows?: boolean) => void;
54
+ /**
55
+ * Updates the color theme of the document.
56
+ * @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.
57
+ * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.
58
+ */
59
+ export declare const updateColorTheme: (isDark?: boolean, htmlElement?: HTMLElement) => void;
60
+ /**
61
+ * Observes the user's theme preference and applies the appropriate theme.
62
+ * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.
63
+ * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.
64
+ * @returns {() => void} Function to stop observing the theme preference.
65
+ */
66
+ export declare const observeThemePreference: (getHtmlElement?: () => HTMLElement, switchCallback?: (isDark: boolean) => void) => () => void;
27
67
  export {};
28
68
  //# sourceMappingURL=ui.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../../../src/core/utils/helpers/ui.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QACnB,MAAM,SAAS,OAAO,KAAG,OAAO,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;CAQnF,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;AAC5D,eAAO,MAAM,UAAU,eAAgB,UAAU,EAAE,KAAG,MAE1B,CAAA;AAG5B,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAE,mBAY1D,CAAA;AAID,KAAK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kB,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;AAID;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,oBACjB,MAAM,WAAW,mBACjB,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KACxC,MAAM,IA6CR,CAAA"}
@@ -1,2 +1,2 @@
1
- import e from"react";const c=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},e.createElement("path",{d:"M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"})),t=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},e.createElement("path",{d:"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"}));export{c as closeIconJSX,t as infoIconJSX};
1
+ const e=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{d:"M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"})),c=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{d:"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"}));export{e as closeIconJSX,c as infoIconJSX};
2
2
  //# sourceMappingURL=icons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","sources":["../../../../../../../../src/core/ui/components/atoms/icons.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React from 'react'\n\nexport const closeIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z' /></svg>\n)\nexport const infoIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z' /></svg>\n\n)\n\n\nexport const appStoreIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M255.9 120.9l9.1-15.7c5.6-9.8 18.1-13.1 27.9-7.5 9.8 5.6 13.1 18.1 7.5 27.9l-87.5 151.5h63.3c20.5 0 32 24.1 23.1 40.8H113.8c-11.3 0-20.4-9.1-20.4-20.4 0-11.3 9.1-20.4 20.4-20.4h52l66.6-115.4-20.8-36.1c-5.6-9.8-2.3-22.2 7.5-27.9 9.8-5.6 22.2-2.3 27.9 7.5l8.9 15.7zm-78.7 218l-19.6 34c-5.6 9.8-18.1 13.1-27.9 7.5-9.8-5.6-13.1-18.1-7.5-27.9l14.6-25.2c16.4-5.1 29.8-1.2 40.4 11.6zm168.9-61.7h53.1c11.3 0 20.4 9.1 20.4 20.4 0 11.3-9.1 20.4-20.4 20.4h-29.5l19.9 34.5c5.6 9.8 2.3 22.2-7.5 27.9-9.8 5.6-22.2 2.3-27.9-7.5-33.5-58.1-58.7-101.6-75.4-130.6-17.1-29.5-4.9-59.1 7.2-69.1 13.4 23 33.4 57.7 60.1 104zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z' /></svg>\n)\n\n\nexport const batteryEmptyIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M544 192V160c0-35.35-28.65-64-64-64H64C28.65 96 0 124.7 0 160v192c0 35.35 28.65 64 64 64h416c35.35 0 64-28.65 64-64v-32c17.67 0 32-14.33 32-32V224C576 206.3 561.7 192 544 192zM480 352H64V160h416V352z' /></svg>\n)\n\n\nexport const elementorIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M425.6 32H22.4C10 32 0 42 0 54.4v403.2C0 470 10 480 22.4 480h403.2c12.4 0 22.4-10 22.4-22.4V54.4C448 42 438 32 425.6 32M164.3 355.5h-39.8v-199h39.8v199zm159.3 0H204.1v-39.8h119.5v39.8zm0-79.6H204.1v-39.8h119.5v39.8zm0-79.7H204.1v-39.8h119.5v39.8z' /></svg>\n)\n\nexport const squareCheckIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M384 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V96C448 60.65 419.3 32 384 32zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h320c8.836 0 16 7.162 16 16V416zM303 175L192 286.1L144.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C179.7 341.7 185.8 344 192 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S312.4 165.7 303 175z' /></svg>\n)\n\nexport const pencilIcon = (\n <svg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M8.91878 3.38356L6.59333 1.08219L7.35936 0.315069C7.56911 0.105023 7.82682 0 8.13251 0C8.43782 0 8.69536 0.105023 8.9051 0.315069L9.67113 1.08219C9.88088 1.29224 9.99031 1.54575 9.99943 1.84274C10.0086 2.13936 9.90824 2.39269 9.69849 2.60274L8.91878 3.38356ZM8.12539 4.19178L2.32545 10H0V7.67123L5.79994 1.86301L8.12539 4.19178Z' fill='#E2E369' />\n </svg>\n\n)\n"],"names":["closeIconJSX","React","createElement","xmlns","viewBox","d","infoIconJSX"],"mappings":"qBAIaA,MAAAA,EACXC,EAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,EAAAC,cAAA,OAAA,CAAMG,EAAE,ygBAE3DC,EACXL,EAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,EAAAC,cAAA,OAAA,CAAMG,EAAE"}
1
+ {"version":3,"file":"icons.js","sources":["../../../../../../../../src/core/ui/components/atoms/icons.tsx"],"sourcesContent":["\nexport const closeIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z' /></svg>\n)\nexport const infoIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z' /></svg>\n\n)\n\n\nexport const appStoreIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M255.9 120.9l9.1-15.7c5.6-9.8 18.1-13.1 27.9-7.5 9.8 5.6 13.1 18.1 7.5 27.9l-87.5 151.5h63.3c20.5 0 32 24.1 23.1 40.8H113.8c-11.3 0-20.4-9.1-20.4-20.4 0-11.3 9.1-20.4 20.4-20.4h52l66.6-115.4-20.8-36.1c-5.6-9.8-2.3-22.2 7.5-27.9 9.8-5.6 22.2-2.3 27.9 7.5l8.9 15.7zm-78.7 218l-19.6 34c-5.6 9.8-18.1 13.1-27.9 7.5-9.8-5.6-13.1-18.1-7.5-27.9l14.6-25.2c16.4-5.1 29.8-1.2 40.4 11.6zm168.9-61.7h53.1c11.3 0 20.4 9.1 20.4 20.4 0 11.3-9.1 20.4-20.4 20.4h-29.5l19.9 34.5c5.6 9.8 2.3 22.2-7.5 27.9-9.8 5.6-22.2 2.3-27.9-7.5-33.5-58.1-58.7-101.6-75.4-130.6-17.1-29.5-4.9-59.1 7.2-69.1 13.4 23 33.4 57.7 60.1 104zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z' /></svg>\n)\n\n\nexport const batteryEmptyIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M544 192V160c0-35.35-28.65-64-64-64H64C28.65 96 0 124.7 0 160v192c0 35.35 28.65 64 64 64h416c35.35 0 64-28.65 64-64v-32c17.67 0 32-14.33 32-32V224C576 206.3 561.7 192 544 192zM480 352H64V160h416V352z' /></svg>\n)\n\n\nexport const elementorIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M425.6 32H22.4C10 32 0 42 0 54.4v403.2C0 470 10 480 22.4 480h403.2c12.4 0 22.4-10 22.4-22.4V54.4C448 42 438 32 425.6 32M164.3 355.5h-39.8v-199h39.8v199zm159.3 0H204.1v-39.8h119.5v39.8zm0-79.6H204.1v-39.8h119.5v39.8zm0-79.7H204.1v-39.8h119.5v39.8z' /></svg>\n)\n\nexport const squareCheckIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M384 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V96C448 60.65 419.3 32 384 32zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h320c8.836 0 16 7.162 16 16V416zM303 175L192 286.1L144.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C179.7 341.7 185.8 344 192 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S312.4 165.7 303 175z' /></svg>\n)\n\nexport const pencilIcon = (\n <svg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M8.91878 3.38356L6.59333 1.08219L7.35936 0.315069C7.56911 0.105023 7.82682 0 8.13251 0C8.43782 0 8.69536 0.105023 8.9051 0.315069L9.67113 1.08219C9.88088 1.29224 9.99031 1.54575 9.99943 1.84274C10.0086 2.13936 9.90824 2.39269 9.69849 2.60274L8.91878 3.38356ZM8.12539 4.19178L2.32545 10H0V7.67123L5.79994 1.86301L8.12539 4.19178Z' fill='#E2E369' />\n </svg>\n\n)\n"],"names":["closeIconJSX","React","createElement","xmlns","viewBox","d","infoIconJSX"],"mappings":"AACaA,MAAAA,EACXC,MAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,MAAAC,cAAA,OAAA,CAAMG,EAAE,ygBAE3DC,EACXL,MAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,MAAAC,cAAA,OAAA,CAAMG,EAAE"}
@@ -1,2 +1,2 @@
1
- import{objectWithoutProperties as t,objectSpread2 as e}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import r,{memo as o,useMemo as a}from"react";import{useParseProps as s}from"../../../../hooks/useParseProps.js";import{composeId as l}from"../../../../utils/helpers/text.js";const i=["element","children","href","target","className","id","onClick","text"],n=o((o=>{let{element:n="span",children:c,href:d,target:m,className:p="",id:u,onClick:h,text:f}=o,x=t(o,i);const{dataProps:P,restProps:b}=s(x),g=f||(null==c?void 0:c.toString()),j=a((()=>h?{onClick:h,onKeyDown:h,role:"button",tabIndex:-1}:{}),[h]);return r.createElement(n,e(e(e({id:"".concat(u||g&&l(g)),href:d,text:f,target:m,className:p},j),{},{style:b},P),{},{"data-testid":"".concat(P.dataTestId||P["data-testid"]||u||g&&l(g))}),c)}));n.displayName="Text";export{n as Text};
1
+ import{objectWithoutProperties as t,objectSpread2 as e}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import{memo as r,useMemo as o,createElement as a}from"react";import{useParseProps as s}from"../../../../hooks/useParseProps.js";import{composeId as l}from"../../../../utils/helpers/text.js";const i=["element","children","href","target","className","id","onClick","text"],n=r((r=>{let{element:n="span",children:c,href:d,target:p,className:m="",id:u,onClick:h,text:f}=r,x=t(r,i);const{dataProps:P,restProps:b}=s(x),g=f||(null==c?void 0:c.toString()),j=o((()=>h?{onClick:h,onKeyDown:h,role:"button",tabIndex:-1}:{}),[h]);return a(n,e(e(e({id:"".concat(u||g&&l(g)),href:d,text:f,target:p,className:m},j),{},{style:b},P),{},{"data-testid":"".concat(P.dataTestId||P["data-testid"]||u||g&&l(g))}),c)}));n.displayName="Text";export{n as Text};
2
2
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"sourcesContent":["import React, { memo, FC, useMemo } from 'react'\n\nimport { composeId } from '../../../../utils'\nimport { useParseProps } from '../../../../hooks'\n\nimport { ITextProps, TextProps } from './text.types'\n\n\nexport const Text: FC<TextProps> = memo<ITextProps>((\n { element = 'span', children, href, target, className = '', id, onClick, text, ...rest }: ITextProps,\n) => {\n const { dataProps, restProps } = useParseProps(rest)\n const textFromChildren: string | undefined = text || children?.toString()\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return React.createElement<TextProps>(\n element,\n {\n id: `${id || (textFromChildren && composeId(textFromChildren))}`,\n href,\n text,\n target,\n className,\n ...onClickProps,\n style: restProps,\n ...dataProps,\n 'data-testid':\n `${dataProps.dataTestId || dataProps['data-testid'] || id || (textFromChildren && composeId(textFromChildren))}`,\n },\n children,\n )\n})\n\nText.displayName = 'Text'\n"],"names":["Text","memo","_ref","element","children","href","target","className","id","onClick","text","rest","_objectWithoutProperties","_excluded","dataProps","restProps","useParseProps","textFromChildren","toString","onClickProps","useMemo","onKeyDown","role","tabIndex","React","createElement","_objectSpread","concat","composeId","style","dataTestId","displayName"],"mappings":"oXAQaA,EAAsBC,GAAiBC,IAE/C,IADHC,QAAEA,EAAU,OAAMC,SAAEA,EAAQC,KAAEA,EAAIC,OAAEA,EAAMC,UAAEA,EAAY,GAAEC,GAAEA,EAAEC,QAAEA,EAAOC,KAAEA,GAA2BR,EAAlBS,EAAIC,EAAAV,EAAAW,GAEtF,MAAMC,UAAEA,EAASC,UAAEA,GAAcC,EAAcL,GACzCM,EAAuCP,IAAQN,aAAQ,EAARA,EAAUc,YAEzDC,EAAeC,GAAQ,IAAOX,EAAW,CAC7CA,UACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACd,IAEX,OAAOe,EAAMC,cACXtB,EAAOuB,EAAAA,EAAAA,EAAA,CAELlB,GAAE,GAAAmB,OAAKnB,GAAOS,GAAoBW,EAAUX,IAC5CZ,OACAK,OACAJ,SACAC,aACGY,GAAY,GAAA,CACfU,MAAOd,GACJD,GAAS,GAAA,CACZ,iBAAaa,OACVb,EAAUgB,YAAchB,EAAU,gBAAkBN,GAAOS,GAAoBW,EAAUX,MAE9Fb,EACD,IAGHJ,EAAK+B,YAAc"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"sourcesContent":["import { createElement, memo, FC, useMemo } from 'react'\n\nimport { composeId } from '../../../../utils'\nimport { useParseProps } from '../../../../hooks'\n\nimport { ITextProps, TextProps } from './text.types'\n\n\nexport const Text: FC<TextProps> = memo<ITextProps>((\n { element = 'span', children, href, target, className = '', id, onClick, text, ...rest }: ITextProps,\n) => {\n const { dataProps, restProps } = useParseProps(rest)\n const textFromChildren: string | undefined = text || children?.toString()\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return createElement<TextProps>(\n element,\n {\n id: `${id || (textFromChildren && composeId(textFromChildren))}`,\n href,\n text,\n target,\n className,\n ...onClickProps,\n style: restProps,\n ...dataProps,\n 'data-testid':\n `${dataProps.dataTestId || dataProps['data-testid'] || id || (textFromChildren && composeId(textFromChildren))}`,\n },\n children,\n )\n})\n\nText.displayName = 'Text'\n"],"names":["Text","memo","_ref","element","children","href","target","className","id","onClick","text","rest","_objectWithoutProperties","_excluded","dataProps","restProps","useParseProps","textFromChildren","toString","onClickProps","useMemo","onKeyDown","role","tabIndex","createElement","_objectSpread","concat","composeId","style","dataTestId","displayName"],"mappings":"oYAQaA,EAAsBC,GAAiBC,IAE/C,IADHC,QAAEA,EAAU,OAAMC,SAAEA,EAAQC,KAAEA,EAAIC,OAAEA,EAAMC,UAAEA,EAAY,GAAEC,GAAEA,EAAEC,QAAEA,EAAOC,KAAEA,GAA2BR,EAAlBS,EAAIC,EAAAV,EAAAW,GAEtF,MAAMC,UAAEA,EAASC,UAAEA,GAAcC,EAAcL,GACzCM,EAAuCP,IAAQN,aAAQ,EAARA,EAAUc,YAEzDC,EAAeC,GAAQ,IAAOX,EAAW,CAC7CA,UACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACd,IAEX,OAAOe,EACLrB,EAAOsB,EAAAA,EAAAA,EAAA,CAELjB,GAAE,GAAAkB,OAAKlB,GAAOS,GAAoBU,EAAUV,IAC5CZ,OACAK,OACAJ,SACAC,aACGY,GAAY,GAAA,CACfS,MAAOb,GACJD,GAAS,GAAA,CACZ,iBAAaY,OACVZ,EAAUe,YAAcf,EAAU,gBAAkBN,GAAOS,GAAoBU,EAAUV,MAE9Fb,EACD,IAGHJ,EAAK8B,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sources":["../../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"sourcesContent":["import { FC, memo, PureComponent, ReactNode } from 'react'\n\nimport { IconBase } from '../icon'\nimport { LayoutBox } from '../container/layoutBox/LayoutBox'\n\nimport classes from './errorBoundary.module.scss'\nimport { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types'\n\n\ninterface State {\n error?: Error\n errorInfo?: unknown\n hasError: boolean\n}\n\n\nexport const DefaultErrorComponent: FC<DefaultErrorComponentProps>\n= memo(({ title, text }: DefaultErrorComponentProps) => (\n <LayoutBox className={classes.errorBoundary} direction='column' flexWrap='wrap' gap='2rem' padding='1rem'>\n {title && <h1>{title}</h1>}\n <LayoutBox align='center' justify='space-between' gap='1rem'>\n <IconBase\n className={classes.StyledIcon}\n color='#FF0000'\n width='3rem'\n height='3rem'\n >\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>\n <path d='M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z' />\n </svg>\n </IconBase>\n {text && (\n <LayoutBox flexShrink='0' width='90%'>\n {text}\n </LayoutBox>\n )}\n </LayoutBox>\n </LayoutBox>\n))\nDefaultErrorComponent.displayName = 'DefaultErrorComponent'\n\nexport class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n // eslint-disable-next-line no-console\n !this.props.muted && error && console.error(error)\n // eslint-disable-next-line no-console\n !this.props.muted && errorInfo && console.error(errorInfo)\n\n this.props?.onError?.({ error, errorInfo })\n\n !this.props.muted && this.setState({ hasError: true, error, errorInfo })\n }\n\n render(): ReactNode {\n const { ErrorComponent = DefaultErrorComponent, title, text, muted } = this.props\n const { hasError, error, errorInfo } = this.state\n\n if (hasError && !muted) {\n return (\n <ErrorComponent\n title={title || error?.toString() || 'Error'}\n text={text || `${JSON.stringify(errorInfo, null, 2)}`}\n />\n )\n }\n\n if (hasError && muted) {\n return null\n }\n\n return this.props.children\n }\n}\n"],"names":["DefaultErrorComponent","memo","_ref","title","text","React","createElement","LayoutBox","className","classes","errorBoundary","direction","flexWrap","gap","padding","align","justify","IconBase","StyledIcon","color","width","height","xmlns","viewBox","d","flexShrink","displayName","ErrorBoundary","PureComponent","constructor","props","super","this","state","hasError","getDerivedStateFromError","error","componentDidCatch","errorInfo","_this$props","_this$props$onError","muted","onError","call","setState","render","ErrorComponent","toString","concat","JSON","stringify","children"],"mappings":"6MAgBaA,MAAAA,EACXC,GAAKC,IAAA,IAACC,MAAEA,EAAKC,KAAEA,GAAkCF,EAAA,OACjDG,MAAAC,cAACC,EAAS,CAACC,UAAWC,EAAQC,cAAeC,UAAU,SAASC,SAAS,OAAOC,IAAI,OAAOC,QAAQ,QAChGX,GAASE,MAAAC,cAAA,KAAA,KAAKH,GACfE,MAAAC,cAACC,EAAS,CAACQ,MAAM,SAASC,QAAQ,gBAAgBH,IAAI,QACpDR,MAAAC,cAACW,EAAQ,CACPT,UAAWC,EAAQS,WACnBC,MAAM,UACNC,MAAM,OACNC,OAAO,QAEPhB,MAAAC,cAAA,MAAA,CAAKgB,MAAM,6BAA6BC,QAAQ,eAC9ClB,MAAAC,cAAA,OAAA,CAAMkB,EAAE,6WAGXpB,GACCC,MAAAC,cAACC,EAAS,CAACkB,WAAW,IAAIL,MAAM,OAC7BhB,IAIG,IAEdJ,EAAsB0B,YAAc,wBAE7B,MAAMC,UAAsBC,EACjCC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CAAEC,UAAU,EAC3B,CAEA,+BAAOC,CAAyBC,GAC9B,MAAO,CAAEF,UAAU,EAAME,QAC3B,CAEAC,iBAAAA,CAAkBD,EAAcE,GAAkC,IAAAC,EAAAC,EAE/DR,KAAKF,MAAMW,MAEXT,KAAKF,MAAMW,cAEZF,OAAKT,aAAK,IAAAS,GAAS,QAATC,EAAVD,EAAYG,eAAZF,IAAmBA,GAAnBA,EAAAG,KAAAJ,EAAsB,CAAEH,QAAOE,eAE9BN,KAAKF,MAAMW,OAAST,KAAKY,SAAS,CAAEV,UAAU,EAAME,QAAOE,aAC9D,CAEAO,MAAAA,GACE,MAAMC,eAAEA,EAAiB9C,EAAqBG,MAAEA,EAAKC,KAAEA,EAAIqC,MAAEA,GAAUT,KAAKF,OACtEI,SAAEA,EAAQE,MAAEA,EAAKE,UAAEA,GAAcN,KAAKC,MAE5C,OAAIC,IAAaO,EAEbpC,MAAAC,cAACwC,EAAc,CACb3C,MAAOA,IAASiC,aAAAA,EAAAA,EAAOW,aAAc,QACrC3C,KAAMA,GAAI4C,GAAAA,OAAOC,KAAKC,UAAUZ,EAAW,KAAM,MAKnDJ,GAAYO,EACP,KAGFT,KAAKF,MAAMqB,QACpB"}
1
+ {"version":3,"file":"ErrorBoundary.js","sources":["../../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"sourcesContent":["import { ErrorInfo, FC, memo, PureComponent, ReactNode } from 'react'\n\nimport { IconBase } from '../icon'\nimport { LayoutBox } from '../container/layoutBox/LayoutBox'\n\nimport classes from './errorBoundary.module.scss'\nimport { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types'\n\n\ninterface State {\n error?: Error\n errorInfo?: unknown\n hasError: boolean\n}\n\n\nexport const DefaultErrorComponent: FC<DefaultErrorComponentProps>\n= memo(({ title, text }: DefaultErrorComponentProps) => (\n <LayoutBox className={classes.errorBoundary} direction='column' flexWrap='wrap' gap='2rem' padding='1rem'>\n {title && <h1>{title}</h1>}\n <LayoutBox align='center' justify='space-between' gap='1rem'>\n <IconBase\n className={classes.StyledIcon}\n color='#FF0000'\n width='3rem'\n height='3rem'\n >\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>\n <path d='M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z' />\n </svg>\n </IconBase>\n {text && (\n <LayoutBox flexShrink='0' width='90%'>\n {text}\n </LayoutBox>\n )}\n </LayoutBox>\n </LayoutBox>\n))\nDefaultErrorComponent.displayName = 'DefaultErrorComponent'\n\nexport class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n // eslint-disable-next-line no-console\n !this.props.muted && error && console.error(error)\n // eslint-disable-next-line no-console\n !this.props.muted && errorInfo && console.error(errorInfo)\n\n this.props?.onError?.({ error, errorInfo })\n\n !this.props.muted && this.setState({ hasError: true, error, errorInfo })\n }\n\n render(): ReactNode {\n const { ErrorComponent = DefaultErrorComponent, title, text, muted } = this.props\n const { hasError, error, errorInfo } = this.state\n\n if (hasError && !muted) {\n return (\n <ErrorComponent\n title={title || error?.toString() || 'Error'}\n text={text || `${JSON.stringify(errorInfo, null, 2)}`}\n />\n )\n }\n\n if (hasError && muted) {\n return null\n }\n\n return this.props.children\n }\n}\n"],"names":["DefaultErrorComponent","memo","_ref","title","text","React","createElement","LayoutBox","className","classes","errorBoundary","direction","flexWrap","gap","padding","align","justify","IconBase","StyledIcon","color","width","height","xmlns","viewBox","d","flexShrink","displayName","ErrorBoundary","PureComponent","constructor","props","super","this","state","hasError","getDerivedStateFromError","error","componentDidCatch","errorInfo","_this$props","_this$props$onError","muted","onError","call","setState","render","ErrorComponent","toString","concat","JSON","stringify","children"],"mappings":"6MAgBaA,MAAAA,EACXC,GAAKC,IAAA,IAACC,MAAEA,EAAKC,KAAEA,GAAkCF,EAAA,OACjDG,MAAAC,cAACC,EAAS,CAACC,UAAWC,EAAQC,cAAeC,UAAU,SAASC,SAAS,OAAOC,IAAI,OAAOC,QAAQ,QAChGX,GAASE,MAAAC,cAAA,KAAA,KAAKH,GACfE,MAAAC,cAACC,EAAS,CAACQ,MAAM,SAASC,QAAQ,gBAAgBH,IAAI,QACpDR,MAAAC,cAACW,EAAQ,CACPT,UAAWC,EAAQS,WACnBC,MAAM,UACNC,MAAM,OACNC,OAAO,QAEPhB,MAAAC,cAAA,MAAA,CAAKgB,MAAM,6BAA6BC,QAAQ,eAC9ClB,MAAAC,cAAA,OAAA,CAAMkB,EAAE,6WAGXpB,GACCC,MAAAC,cAACC,EAAS,CAACkB,WAAW,IAAIL,MAAM,OAC7BhB,IAIG,IAEdJ,EAAsB0B,YAAc,wBAE7B,MAAMC,UAAsBC,EACjCC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CAAEC,UAAU,EAC3B,CAEA,+BAAOC,CAAyBC,GAC9B,MAAO,CAAEF,UAAU,EAAME,QAC3B,CAEAC,iBAAAA,CAAkBD,EAAcE,GAA4B,IAAAC,EAAAC,EAEzDR,KAAKF,MAAMW,MAEXT,KAAKF,MAAMW,cAEZF,OAAKT,aAAK,IAAAS,GAAS,QAATC,EAAVD,EAAYG,eAAZF,IAAmBA,GAAnBA,EAAAG,KAAAJ,EAAsB,CAAEH,QAAOE,eAE9BN,KAAKF,MAAMW,OAAST,KAAKY,SAAS,CAAEV,UAAU,EAAME,QAAOE,aAC9D,CAEAO,MAAAA,GACE,MAAMC,eAAEA,EAAiB9C,EAAqBG,MAAEA,EAAKC,KAAEA,EAAIqC,MAAEA,GAAUT,KAAKF,OACtEI,SAAEA,EAAQE,MAAEA,EAAKE,UAAEA,GAAcN,KAAKC,MAE5C,OAAIC,IAAaO,EAEbpC,MAAAC,cAACwC,EAAc,CACb3C,MAAOA,IAASiC,aAAAA,EAAAA,EAAOW,aAAc,QACrC3C,KAAMA,GAAI4C,GAAAA,OAAOC,KAAKC,UAAUZ,EAAW,KAAM,MAKnDJ,GAAYO,EACP,KAGFT,KAAKF,MAAMqB,QACpB"}
@@ -1,2 +1,2 @@
1
- import{objectWithoutProperties as e,objectSpread2 as n,extends as t}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import l,{memo as o,useState as r,useEffect as i,useRef as s,useMemo as u,useCallback as d}from"react";import{createPopper as a}from"../../../../../../node_modules/@popperjs/core/lib/popper.js";import{cancelableSetTimeout as c}from"../../../../utils/helpers/cancelableDelayedFunction.js";import{outsideClickHandler as p}from"../../../../hooks/useOutsideClick.js";import{KeyCode as m,EventName as v}from"../../../../constants/ui.constants.js";const f=["children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape"],h=["ContentComponent"],y={modal:{zIndex:1,position:"fixed",width:"100%",height:"100%",top:"0",left:"0",background:"rgba(0 0 0 / 70%)",pointerEvents:"all",userSelect:"none",visibility:"hidden"}},b=o((o=>{var b,E;let{children:w,components:C,placement:g="bottom",modifiers:O,data:k,hoverable:j,clickable:L,onOpen:M,onHide:x,isOpen:R,hideOnContentClick:H=!1,hideOnClickOutside:P=!0,hideTimeout:T=150,isPopup:A=!1,isModal:N=!1,modalOverlayClassName:W,modalContainer:_,targetRef:D,hideOnEscape:z}=o,B=e(o,f);const[F,I]=r(null),[K,S]=r(null!==(b=null==D?void 0:D.current)&&void 0!==b?b:null);i((()=>{null!=D&&D.current&&S(null==D?void 0:D.current)}),[D]);const q=C||{},{ContentComponent:G}=q,J=e(q,h),Q=s(null),U=u((()=>{const e=O?{modifiers:O,placement:g}:{placement:g};return e.modifiers=e.modifiers||[],A&&(e.modifiers=[...e.modifiers,{name:"centering",phase:"beforeWrite",enabled:!0,fn:e=>{let{state:t}=e;const l=null==_?void 0:_.getBoundingClientRect(),{width:o,height:r,left:i,top:s}=l||{width:window.innerWidth,height:window.innerHeight,left:0,top:0},u=i+(o-t.elements.popper.clientWidth)/2,d=s+(r-t.elements.popper.clientHeight)/2;return n(n({},t),{},{styles:n(n({},t.styles),{},{popper:n(n({},t.styles.popper),{},{left:"".concat(u,"px"),top:"".concat(d,"px"),transform:"none"})})})}}]),e}),[O,g,A,_]),V=s();i((()=>{var e;let t;return null==Q||null===(e=Q.current)||void 0===e||e.destroy(),K&&F&&(t=a(K,F,n({},U)),Q.current=t),()=>{var e;null===(e=t)||void 0===e||e.destroy(),Q.current=null}}),[F,K,U]);const X=s(),Y=s(-1),Z=d((()=>{var e,n;F&&delete F.dataset.show,N&&null!=ue&&ue.current&&(ue.current.style.visibility="hidden",delete ue.current.dataset.show),null==Q||null===(e=Q.current)||void 0===e||e.update(),null==x||x(),null==X||null===(n=X.current)||void 0===n||n.call(X),clearTimeout(Y.current)}),[F,N,x]),$=d((()=>{V.current&&V.current(),V.current=c(Z,T)}),[Z,T]),ee=d((()=>{V.current&&V.current()}),[]),ne=d((e=>{var n;("true"===(null==F||null===(n=F.dataset)||void 0===n?void 0:n.show)&&P&&(null==F||!F.contains(e))||null!=F&&F.contains(e)&&H)&&Z()}),[Z,F,H,P]),te=d((()=>{var e,n;F&&(F.dataset.show="true"),null==Q||null===(e=Q.current)||void 0===e||e.update(),N&&null!=ue&&ue.current&&(ue.current.style.visibility="visible",ue.current.dataset.show="true"),null==M||M(),null==X||null===(n=X.current)||void 0===n||n.call(X),clearTimeout(Y.current),Y.current=setTimeout((()=>{X.current=p(K,ne)}),250)}),[F,ne,N,M,K]),le=d((()=>{var e;"true"===(null==F||null===(e=F.dataset)||void 0===e?void 0:e.show)?Z():te()}),[F,Z,te]),oe=d((e=>{z&&e.keyCode===m.Escape&&Z()}),[z,Z]);i((()=>{var e,n;const t=null==K||null===(e=K.addEventListener)||void 0===e?void 0:e.bind(K),l=null==F||null===(n=F.addEventListener)||void 0===n?void 0:n.bind(F);return l&&t&&(j&&(t(v.MouseEnter,te),l(v.MouseEnter,ee),t(v.MouseLeave,$),l(v.MouseLeave,Z)),L&&t(v.Click,le)),z&&document.addEventListener(v.KeyDown,oe),()=>{var e,n;const t=null==K||null===(e=K.removeEventListener)||void 0===e?void 0:e.bind(K),l=null==F||null===(n=F.removeEventListener)||void 0===n?void 0:n.bind(F);document.removeEventListener(v.KeyDown,oe),V.current&&V.current(),t&&(t(v.Click,le),t(v.MouseEnter,te),t(v.MouseLeave,$)),l&&(l(v.MouseLeave,Z),l(v.MouseEnter,ee))}}),[K,F,L,j,te,Z,le,$,ee,z,oe]),i((()=>(!0===R&&te(),!1===R&&Z(),null==X?void 0:X.current)),[Z,R,te]);const re="function"==typeof w,ie="function"!=typeof w&&!Array.isArray(w),se="function"!=typeof w&&Array.isArray(w)&&2===w.filter((e=>!!e)).length,ue=s(null);return i((()=>{N&&F&&(F.style.zIndex="2")}),[F,N]),l.createElement(l.Fragment,null,N&&l.createElement("span",{ref:ue,style:y.modal,className:W}),!D&&re&&(null==w?void 0:w({forwardedRef:S,data:k})),!D&&ie&&l.createElement("span",{ref:S},w),!se&&G&&l.createElement(G,t({placement:g,forwardedRef:I,ref:"function"!=typeof G?I:null,data:k,hide:Z,components:J},B)),!D&&se&&l.createElement("span",{ref:S},w[0]),se&&(null==w?void 0:w[1])&&"object"==typeof(null==w?void 0:w[1])&&l.cloneElement(w[1],n(n({},null==w||null===(E=w[1])||void 0===E?void 0:E.props),{},{placement:g,forwardedRef:I,ref:I,data:k,hide:Z,components:J},B)))}));b.displayName="Popover";export{b as Popover};
1
+ import{objectWithoutProperties as e,objectSpread2 as t,extends as n}from"../../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import{memo as l,useState as o,useEffect as r,useRef as i,useMemo as a,useCallback as s,cloneElement as u}from"react";import{createPopper as d}from"../../../../../../node_modules/@popperjs/core/lib/popper.js";import{cancelableSetTimeout as c}from"../../../../utils/helpers/cancelableDelayedFunction.js";import{outsideClickHandler as p}from"../../../../hooks/useOutsideClick.js";import{KeyCode as m,EventName as v}from"../../../../constants/ui.constants.js";const f=["children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape"],h=["ContentComponent"],y={modal:{zIndex:1,position:"fixed",width:"100%",height:"100%",top:"0",left:"0",background:"rgba(0 0 0 / 70%)",pointerEvents:"all",userSelect:"none",visibility:"hidden"}},b=l((l=>{var b,w;let{children:C,components:E,placement:g="bottom",modifiers:O,data:k,hoverable:R,clickable:j,onOpen:L,onHide:M,isOpen:x,hideOnContentClick:H=!1,hideOnClickOutside:P=!0,hideTimeout:T=150,isPopup:A=!1,isModal:N=!1,modalOverlayClassName:W,modalContainer:_,targetRef:D,hideOnEscape:z}=l,B=e(l,f);const[F,I]=o(null),[K,S]=o(null!==(b=null==D?void 0:D.current)&&void 0!==b?b:null);r((()=>{null!=D&&D.current&&S(null==D?void 0:D.current)}),[D]);const q=E||{},{ContentComponent:G}=q,J=e(q,h),Q=i(null),U=a((()=>{const e=O?{modifiers:O,placement:g}:{placement:g};return e.modifiers=e.modifiers||[],A&&(e.modifiers=[...e.modifiers,{name:"centering",phase:"beforeWrite",enabled:!0,fn:e=>{let{state:n}=e;const l=null==_?void 0:_.getBoundingClientRect(),{width:o,height:r,left:i,top:a}=l||{width:window.innerWidth,height:window.innerHeight,left:0,top:0},s=i+(o-n.elements.popper.clientWidth)/2,u=a+(r-n.elements.popper.clientHeight)/2;return t(t({},n),{},{styles:t(t({},n.styles),{},{popper:t(t({},n.styles.popper),{},{left:"".concat(s,"px"),top:"".concat(u,"px"),transform:"none"})})})}}]),e}),[O,g,A,_]),V=i();r((()=>{var e;let n;return null==Q||null===(e=Q.current)||void 0===e||e.destroy(),K&&F&&(n=d(K,F,t({},U)),Q.current=n),()=>{var e;null===(e=n)||void 0===e||e.destroy(),Q.current=null}}),[F,K,U]);const X=i(),Y=i(-1),Z=s((()=>{var e,t;F&&delete F.dataset.show,N&&null!=se&&se.current&&(se.current.style.visibility="hidden",delete se.current.dataset.show),null==Q||null===(e=Q.current)||void 0===e||e.update(),null==M||M(),null==X||null===(t=X.current)||void 0===t||t.call(X),clearTimeout(Y.current)}),[F,N,M]),$=s((()=>{V.current&&V.current(),V.current=c(Z,T)}),[Z,T]),ee=s((()=>{V.current&&V.current()}),[]),te=s((e=>{var t;("true"===(null==F||null===(t=F.dataset)||void 0===t?void 0:t.show)&&P&&(null==F||!F.contains(e))||null!=F&&F.contains(e)&&H)&&Z()}),[Z,F,H,P]),ne=s((()=>{var e,t;F&&(F.dataset.show="true"),null==Q||null===(e=Q.current)||void 0===e||e.update(),N&&null!=se&&se.current&&(se.current.style.visibility="visible",se.current.dataset.show="true"),null==L||L(),null==X||null===(t=X.current)||void 0===t||t.call(X),clearTimeout(Y.current),Y.current=setTimeout((()=>{X.current=p(K,te)}),250)}),[F,te,N,L,K]),le=s((()=>{var e;"true"===(null==F||null===(e=F.dataset)||void 0===e?void 0:e.show)?Z():ne()}),[F,Z,ne]),oe=s((e=>{z&&e.keyCode===m.Escape&&Z()}),[z,Z]);r((()=>{var e,t;const n=null==K||null===(e=K.addEventListener)||void 0===e?void 0:e.bind(K),l=null==F||null===(t=F.addEventListener)||void 0===t?void 0:t.bind(F);return l&&n&&(R&&(n(v.MouseEnter,ne),l(v.MouseEnter,ee),n(v.MouseLeave,$),l(v.MouseLeave,Z)),j&&n(v.Click,le)),z&&document.addEventListener(v.KeyDown,oe),()=>{var e,t;const n=null==K||null===(e=K.removeEventListener)||void 0===e?void 0:e.bind(K),l=null==F||null===(t=F.removeEventListener)||void 0===t?void 0:t.bind(F);document.removeEventListener(v.KeyDown,oe),V.current&&V.current(),n&&(n(v.Click,le),n(v.MouseEnter,ne),n(v.MouseLeave,$)),l&&(l(v.MouseLeave,Z),l(v.MouseEnter,ee))}}),[K,F,j,R,ne,Z,le,$,ee,z,oe]),r((()=>(!0===x&&ne(),!1===x&&Z(),null==X?void 0:X.current)),[Z,x,ne]);const re="function"==typeof C,ie="function"!=typeof C&&!Array.isArray(C),ae="function"!=typeof C&&Array.isArray(C)&&2===C.filter((e=>!!e)).length,se=i(null);return r((()=>{N&&F&&(F.style.zIndex="2")}),[F,N]),React.createElement(React.Fragment,null,N&&React.createElement("span",{ref:se,style:y.modal,className:W}),!D&&re&&(null==C?void 0:C({forwardedRef:S,data:k})),!D&&ie&&React.createElement("span",{ref:S},C),!ae&&G&&React.createElement(G,n({placement:g,forwardedRef:I,ref:"function"!=typeof G?I:null,data:k,hide:Z,components:J},B)),!D&&ae&&React.createElement("span",{ref:S},C[0]),ae&&(null==C?void 0:C[1])&&"object"==typeof(null==C?void 0:C[1])&&u(C[1],t(t({},null==C||null===(w=C[1])||void 0===w?void 0:w.props),{},{placement:g,forwardedRef:I,ref:I,data:k,hide:Z,components:J},B)))}));b.displayName="Popover";export{b as Popover};
2
2
  //# sourceMappingURL=PopoverLite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverLite.js","sources":["../../../../../../../../../src/core/ui/components/molecules/popover/PopoverLite.tsx"],"sourcesContent":["\nimport React, { FC, memo, useRef, useEffect, useState, useCallback, useMemo,\n CSSProperties, ReactNode, ReactElement } from 'react'\nimport { createPopper, Instance, ModifierArguments } from '@popperjs/core'\n\nimport { EventName, KeyCode } from '../../../../constants'\nimport { cancelableSetTimeout } from '../../../../utils'\nimport { outsideClickHandler } from '../../../../hooks'\n\nimport { PopoverProps } from './popover.types'\n\n\nconst styles: Record<string, Partial<CSSProperties>> = {\n modal: {\n zIndex: 1,\n position: 'fixed',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n background: 'rgba(0 0 0 / 70%)',\n pointerEvents: 'all',\n userSelect: 'none',\n visibility: 'hidden',\n },\n}\n\nexport const Popover: FC<PopoverProps> = memo<PopoverProps>(\n ({\n children,\n components,\n placement = 'bottom',\n modifiers,\n data,\n hoverable,\n clickable,\n onOpen,\n onHide,\n isOpen,\n hideOnContentClick = false,\n hideOnClickOutside = true,\n hideTimeout = 150,\n isPopup = false,\n isModal = false,\n modalOverlayClassName,\n modalContainer,\n targetRef,\n hideOnEscape,\n ...props\n }: PopoverProps) => {\n const [content, setContent] = useState<HTMLElement | null>(null)\n const [target, setTarget] = useState<HTMLElement | null>(targetRef?.current ?? null)\n\n useEffect(() => {\n if (targetRef?.current) {\n setTarget(targetRef?.current)\n }\n }, [targetRef])\n\n const { ContentComponent, ...contentComponents } = components || {}\n\n const popperInstanceRef = useRef<Instance | null>(null)\n\n const options = useMemo(() => {\n const options = (modifiers ? { modifiers, placement } : { placement })\n\n options.modifiers = options.modifiers || []\n\n if (isPopup) {\n options.modifiers = [\n ...options.modifiers,\n {\n name: 'centering',\n phase: 'beforeWrite',\n enabled: true,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n fn: ({ state }): Partial<ModifierArguments> => {\n const mcBoundRect = modalContainer?.getBoundingClientRect()\n\n const { width, height, left, top } = mcBoundRect || {\n width: window.innerWidth,\n height: window.innerHeight,\n left: 0,\n top: 0,\n }\n\n const xpos = left + (width - state.elements.popper.clientWidth) / 2\n const ypos = top + (height - state.elements.popper.clientHeight) / 2\n\n return {\n ...state,\n styles: {\n ...state.styles,\n popper: {\n ...state.styles.popper,\n left: `${xpos}px`,\n top: `${ypos}px`,\n transform: 'none',\n },\n },\n }\n },\n },\n ] as PopoverProps['modifiers']\n }\n\n return options\n }, [modifiers, placement, isPopup, modalContainer])\n\n // to save cancelable setTimout\n const pendingHideRef = useRef<(() => void)>()\n\n useEffect(() => {\n popperInstanceRef?.current?.destroy()\n let popperInstance: ReturnType<typeof createPopper>\n\n if (target && content) {\n popperInstance = createPopper(target, content, { ...options })\n\n popperInstanceRef.current = popperInstance\n }\n\n return (): void => {\n popperInstance?.destroy()\n popperInstanceRef.current = null\n }\n }, [content, target, options])\n\n\n const outsideClickUnsubscriber = useRef<() => void | null>()\n const outsideClickUnsubscriberTimeout = useRef<any>(-1)\n\n const hide = useCallback(() => {\n if (content) {\n delete content.dataset.show\n }\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'hidden'\n delete modalRef.current.dataset.show\n }\n\n popperInstanceRef?.current?.update()\n onHide?.()\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n }, [content, isModal, onHide])\n\n\n const delayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n pendingHideRef.current = cancelableSetTimeout(hide, hideTimeout)\n }, [hide, hideTimeout])\n\n const cancelDelayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n }, [])\n\n const handleOutsideClick = useCallback((eventTarget: HTMLElement | null) => {\n if ((content?.dataset?.show === 'true' && hideOnClickOutside && !content?.contains(eventTarget))\n || (content?.contains(eventTarget) && hideOnContentClick)) {\n hide()\n }\n }, [hide, content, hideOnContentClick, hideOnClickOutside])\n\n const open = useCallback(() => {\n if (content) {\n content.dataset.show = 'true'\n }\n\n popperInstanceRef?.current?.update()\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'visible'\n modalRef.current.dataset.show = 'true'\n }\n\n onOpen?.()\n\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n outsideClickUnsubscriberTimeout.current = setTimeout(() => {\n outsideClickUnsubscriber.current = outsideClickHandler(target, handleOutsideClick)\n }, 250)\n }, [content, handleOutsideClick, isModal, onOpen, target])\n\n const toggleOpen = useCallback(() => {\n content?.dataset?.show === 'true' ? hide() : open()\n }, [content, hide, open])\n\n const keydownHandler = useCallback((event: Event) => {\n if (hideOnEscape && (event as unknown as KeyboardEvent).keyCode === KeyCode.Escape) {\n hide()\n }\n }, [hideOnEscape, hide])\n\n useEffect(() => {\n if (!hoverable && !clickable) {\n console.error('Popover component should have at least one of props [\"hoverable\", \"clickable\"]')\n }\n\n const targetAddListener = target?.addEventListener?.bind(target)\n const contentAddListener = content?.addEventListener?.bind(content)\n\n if (contentAddListener && targetAddListener) {\n if (hoverable) {\n targetAddListener(EventName.MouseEnter, open)\n contentAddListener(EventName.MouseEnter, cancelDelayedHide)\n targetAddListener(EventName.MouseLeave, delayedHide)\n contentAddListener(EventName.MouseLeave, hide)\n }\n\n if (clickable) {\n targetAddListener(EventName.Click, toggleOpen)\n }\n }\n\n if (hideOnEscape) {\n document.addEventListener(EventName.KeyDown, keydownHandler)\n }\n\n return (): void => {\n const targetRemoveListener = target?.removeEventListener?.bind(target)\n const contentRemoveListener = content?.removeEventListener?.bind(content)\n\n document.removeEventListener(EventName.KeyDown, keydownHandler)\n\n pendingHideRef.current && pendingHideRef.current()\n\n if (targetRemoveListener) {\n targetRemoveListener(EventName.Click, toggleOpen)\n targetRemoveListener(EventName.MouseEnter, open)\n targetRemoveListener(EventName.MouseLeave, delayedHide)\n }\n if (contentRemoveListener) {\n contentRemoveListener(EventName.MouseLeave, hide)\n contentRemoveListener(EventName.MouseEnter, cancelDelayedHide)\n }\n }\n }, [target, content, clickable, hoverable,\n open, hide, toggleOpen, delayedHide, cancelDelayedHide, hideOnEscape, keydownHandler])\n\n // open, hide based on external isOpen\n useEffect(() => {\n if (isOpen === true) {\n open()\n }\n if (isOpen === false) {\n hide()\n }\n return outsideClickUnsubscriber?.current as () => void\n }, [hide, isOpen, open])\n\n const childrenIsFunction = typeof children === 'function'\n const childrenIsElement = typeof children !== 'function' && !Array.isArray(children)\n const childrenAreElements = typeof children !== 'function' && Array.isArray(children)\n && children.filter((child: ReactNode) => !!child).length === 2\n\n // modal\n const modalRef = useRef<HTMLDivElement | null>(null)\n\n useEffect(() => {\n if (isModal && content) {\n content.style.zIndex = '2'\n }\n }, [content, isModal])\n\n return (\n <>\n {isModal && <span ref={modalRef} style={styles.modal} className={modalOverlayClassName} />}\n {(!targetRef && childrenIsFunction) && children?.({ forwardedRef: setTarget, data })}\n {(!targetRef && childrenIsElement) && <span ref={setTarget}>{children}</span>}\n {!childrenAreElements && ContentComponent && (\n <ContentComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n placement={placement}\n forwardedRef={setContent}\n ref={typeof ContentComponent !== 'function' ? setContent : null}\n data={data}\n hide={hide}\n components={contentComponents as { [key: string]: FC | React.Component<any> }}\n {...props}\n />\n )}\n {(!targetRef && childrenAreElements) && <span ref={setTarget}>{children[0]}</span>}\n {(childrenAreElements && children?.[1] && typeof children?.[1] === 'object')\n && React.cloneElement(children[1] as ReactElement, {\n ...((children?.[1] as ReactElement)?.props),\n placement,\n forwardedRef: setContent,\n // ...(typeof children[1] !== 'function' ? { ref: setContent } : {}),\n ref: setContent,\n data,\n hide,\n components: contentComponents as { [key: string]: FC | React.Component<any> },\n ...props,\n })}\n </>\n )\n },\n)\n\nPopover.displayName = 'Popover'\n"],"names":["styles","modal","zIndex","position","width","height","top","left","background","pointerEvents","userSelect","visibility","Popover","memo","_ref","_targetRef$current","_children$","children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape","props","_objectWithoutProperties","_excluded","content","setContent","useState","target","setTarget","current","useEffect","_ref2","ContentComponent","contentComponents","_excluded2","popperInstanceRef","useRef","options","useMemo","name","phase","enabled","fn","_ref3","state","mcBoundRect","getBoundingClientRect","window","innerWidth","innerHeight","xpos","elements","popper","clientWidth","ypos","clientHeight","_objectSpread","concat","transform","pendingHideRef","_popperInstanceRef$cu","popperInstance","destroy","createPopper","_popperInstance","outsideClickUnsubscriber","outsideClickUnsubscriberTimeout","hide","useCallback","_popperInstanceRef$cu2","_outsideClickUnsubscr","dataset","show","modalRef","style","update","call","clearTimeout","delayedHide","cancelableSetTimeout","cancelDelayedHide","handleOutsideClick","eventTarget","_content$dataset","contains","open","_popperInstanceRef$cu3","_outsideClickUnsubscr2","setTimeout","outsideClickHandler","toggleOpen","_content$dataset2","keydownHandler","event","keyCode","KeyCode","Escape","_target$addEventListe","_content$addEventList","targetAddListener","addEventListener","bind","contentAddListener","EventName","MouseEnter","MouseLeave","Click","document","KeyDown","_target$removeEventLi","_content$removeEventL","targetRemoveListener","removeEventListener","contentRemoveListener","childrenIsFunction","childrenIsElement","Array","isArray","childrenAreElements","filter","child","length","React","createElement","Fragment","ref","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,IAKTxB,EAAQqI,YAAc"}
1
+ {"version":3,"file":"PopoverLite.js","sources":["../../../../../../../../../src/core/ui/components/molecules/popover/PopoverLite.tsx"],"sourcesContent":["\nimport { FC, memo, useRef, useEffect, useState, useCallback, useMemo, cloneElement,\n CSSProperties, ReactNode, ReactElement, Component } from 'react'\nimport { createPopper, Instance, ModifierArguments } from '@popperjs/core'\n\nimport { EventName, KeyCode } from '../../../../constants'\nimport { cancelableSetTimeout } from '../../../../utils'\nimport { outsideClickHandler } from '../../../../hooks'\n\nimport { PopoverProps } from './popover.types'\n\n\nconst styles: Record<string, Partial<CSSProperties>> = {\n modal: {\n zIndex: 1,\n position: 'fixed',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n background: 'rgba(0 0 0 / 70%)',\n pointerEvents: 'all',\n userSelect: 'none',\n visibility: 'hidden',\n },\n}\n\nexport const Popover: FC<PopoverProps> = memo<PopoverProps>(\n ({\n children,\n components,\n placement = 'bottom',\n modifiers,\n data,\n hoverable,\n clickable,\n onOpen,\n onHide,\n isOpen,\n hideOnContentClick = false,\n hideOnClickOutside = true,\n hideTimeout = 150,\n isPopup = false,\n isModal = false,\n modalOverlayClassName,\n modalContainer,\n targetRef,\n hideOnEscape,\n ...props\n }: PopoverProps) => {\n const [content, setContent] = useState<HTMLElement | null>(null)\n const [target, setTarget] = useState<HTMLElement | null>(targetRef?.current ?? null)\n\n useEffect(() => {\n if (targetRef?.current) {\n setTarget(targetRef?.current)\n }\n }, [targetRef])\n\n const { ContentComponent, ...contentComponents } = components || {}\n\n const popperInstanceRef = useRef<Instance | null>(null)\n\n const options = useMemo(() => {\n const options = (modifiers ? { modifiers, placement } : { placement })\n\n options.modifiers = options.modifiers || []\n\n if (isPopup) {\n options.modifiers = [\n ...options.modifiers,\n {\n name: 'centering',\n phase: 'beforeWrite',\n enabled: true,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n fn: ({ state }): Partial<ModifierArguments> => {\n const mcBoundRect = modalContainer?.getBoundingClientRect()\n\n const { width, height, left, top } = mcBoundRect || {\n width: window.innerWidth,\n height: window.innerHeight,\n left: 0,\n top: 0,\n }\n\n const xpos = left + (width - state.elements.popper.clientWidth) / 2\n const ypos = top + (height - state.elements.popper.clientHeight) / 2\n\n return {\n ...state,\n styles: {\n ...state.styles,\n popper: {\n ...state.styles.popper,\n left: `${xpos}px`,\n top: `${ypos}px`,\n transform: 'none',\n },\n },\n }\n },\n },\n ] as PopoverProps['modifiers']\n }\n\n return options\n }, [modifiers, placement, isPopup, modalContainer])\n\n // to save cancelable setTimout\n const pendingHideRef = useRef<(() => void)>()\n\n useEffect(() => {\n popperInstanceRef?.current?.destroy()\n let popperInstance: ReturnType<typeof createPopper>\n\n if (target && content) {\n popperInstance = createPopper(target, content, { ...options })\n\n popperInstanceRef.current = popperInstance\n }\n\n return (): void => {\n popperInstance?.destroy()\n popperInstanceRef.current = null\n }\n }, [content, target, options])\n\n\n const outsideClickUnsubscriber = useRef<() => void | null>()\n const outsideClickUnsubscriberTimeout = useRef<any>(-1)\n\n const hide = useCallback(() => {\n if (content) {\n delete content.dataset.show\n }\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'hidden'\n delete modalRef.current.dataset.show\n }\n\n popperInstanceRef?.current?.update()\n onHide?.()\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n }, [content, isModal, onHide])\n\n\n const delayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n pendingHideRef.current = cancelableSetTimeout(hide, hideTimeout)\n }, [hide, hideTimeout])\n\n const cancelDelayedHide = useCallback(() => {\n pendingHideRef.current && pendingHideRef.current()\n }, [])\n\n const handleOutsideClick = useCallback((eventTarget: HTMLElement | null) => {\n if ((content?.dataset?.show === 'true' && hideOnClickOutside && !content?.contains(eventTarget))\n || (content?.contains(eventTarget) && hideOnContentClick)) {\n hide()\n }\n }, [hide, content, hideOnContentClick, hideOnClickOutside])\n\n const open = useCallback(() => {\n if (content) {\n content.dataset.show = 'true'\n }\n\n popperInstanceRef?.current?.update()\n\n if (isModal && modalRef?.current) {\n modalRef.current.style.visibility = 'visible'\n modalRef.current.dataset.show = 'true'\n }\n\n onOpen?.()\n\n outsideClickUnsubscriber?.current?.()\n clearTimeout(outsideClickUnsubscriberTimeout.current)\n outsideClickUnsubscriberTimeout.current = setTimeout(() => {\n outsideClickUnsubscriber.current = outsideClickHandler(target, handleOutsideClick)\n }, 250)\n }, [content, handleOutsideClick, isModal, onOpen, target])\n\n const toggleOpen = useCallback(() => {\n content?.dataset?.show === 'true' ? hide() : open()\n }, [content, hide, open])\n\n const keydownHandler = useCallback((event: Event) => {\n if (hideOnEscape && (event as unknown as KeyboardEvent).keyCode === KeyCode.Escape) {\n hide()\n }\n }, [hideOnEscape, hide])\n\n useEffect(() => {\n if (!hoverable && !clickable) {\n console.error('Popover component should have at least one of props [\"hoverable\", \"clickable\"]')\n }\n\n const targetAddListener = target?.addEventListener?.bind(target)\n const contentAddListener = content?.addEventListener?.bind(content)\n\n if (contentAddListener && targetAddListener) {\n if (hoverable) {\n targetAddListener(EventName.MouseEnter, open)\n contentAddListener(EventName.MouseEnter, cancelDelayedHide)\n targetAddListener(EventName.MouseLeave, delayedHide)\n contentAddListener(EventName.MouseLeave, hide)\n }\n\n if (clickable) {\n targetAddListener(EventName.Click, toggleOpen)\n }\n }\n\n if (hideOnEscape) {\n document.addEventListener(EventName.KeyDown, keydownHandler)\n }\n\n return (): void => {\n const targetRemoveListener = target?.removeEventListener?.bind(target)\n const contentRemoveListener = content?.removeEventListener?.bind(content)\n\n document.removeEventListener(EventName.KeyDown, keydownHandler)\n\n pendingHideRef.current && pendingHideRef.current()\n\n if (targetRemoveListener) {\n targetRemoveListener(EventName.Click, toggleOpen)\n targetRemoveListener(EventName.MouseEnter, open)\n targetRemoveListener(EventName.MouseLeave, delayedHide)\n }\n if (contentRemoveListener) {\n contentRemoveListener(EventName.MouseLeave, hide)\n contentRemoveListener(EventName.MouseEnter, cancelDelayedHide)\n }\n }\n }, [target, content, clickable, hoverable,\n open, hide, toggleOpen, delayedHide, cancelDelayedHide, hideOnEscape, keydownHandler])\n\n // open, hide based on external isOpen\n useEffect(() => {\n if (isOpen === true) {\n open()\n }\n if (isOpen === false) {\n hide()\n }\n return outsideClickUnsubscriber?.current as () => void\n }, [hide, isOpen, open])\n\n const childrenIsFunction = typeof children === 'function'\n const childrenIsElement = typeof children !== 'function' && !Array.isArray(children)\n const childrenAreElements = typeof children !== 'function' && Array.isArray(children)\n && children.filter((child: ReactNode) => !!child).length === 2\n\n // modal\n const modalRef = useRef<HTMLDivElement | null>(null)\n\n useEffect(() => {\n if (isModal && content) {\n content.style.zIndex = '2'\n }\n }, [content, isModal])\n\n return (\n <>\n {isModal && <span ref={modalRef} style={styles.modal} className={modalOverlayClassName} />}\n {(!targetRef && childrenIsFunction) && children?.({ forwardedRef: setTarget, data })}\n {(!targetRef && childrenIsElement) && <span ref={setTarget}>{children}</span>}\n {!childrenAreElements && ContentComponent && (\n <ContentComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n placement={placement}\n forwardedRef={setContent}\n ref={typeof ContentComponent !== 'function' ? setContent : null}\n data={data}\n hide={hide}\n components={contentComponents as { [key: string]: FC | Component<any> }}\n {...props}\n />\n )}\n {(!targetRef && childrenAreElements) && <span ref={setTarget}>{children[0]}</span>}\n {(childrenAreElements && children?.[1] && typeof children?.[1] === 'object')\n && cloneElement(children[1] as ReactElement, {\n ...((children?.[1] as ReactElement)?.props),\n placement,\n forwardedRef: setContent,\n // ...(typeof children[1] !== 'function' ? { ref: setContent } : {}),\n ref: setContent,\n data,\n hide,\n components: contentComponents as { [key: string]: FC | Component<any> },\n ...props,\n })}\n </>\n )\n },\n)\n\nPopover.displayName = 'Popover'\n"],"names":["styles","modal","zIndex","position","width","height","top","left","background","pointerEvents","userSelect","visibility","Popover","memo","_ref","_targetRef$current","_children$","children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape","props","_objectWithoutProperties","_excluded","content","setContent","useState","target","setTarget","current","useEffect","_ref2","ContentComponent","contentComponents","_excluded2","popperInstanceRef","useRef","options","useMemo","name","phase","enabled","fn","_ref3","state","mcBoundRect","getBoundingClientRect","window","innerWidth","innerHeight","xpos","elements","popper","clientWidth","ypos","clientHeight","_objectSpread","concat","transform","pendingHideRef","_popperInstanceRef$cu","popperInstance","destroy","createPopper","_popperInstance","outsideClickUnsubscriber","outsideClickUnsubscriberTimeout","hide","useCallback","_popperInstanceRef$cu2","_outsideClickUnsubscr","dataset","show","modalRef","style","update","call","clearTimeout","delayedHide","cancelableSetTimeout","cancelDelayedHide","handleOutsideClick","eventTarget","_content$dataset","contains","open","_popperInstanceRef$cu3","_outsideClickUnsubscr2","setTimeout","outsideClickHandler","toggleOpen","_content$dataset2","keydownHandler","event","keyCode","KeyCode","Escape","_target$addEventListe","_content$addEventList","targetAddListener","addEventListener","bind","contentAddListener","EventName","MouseEnter","MouseLeave","Click","document","KeyDown","_target$removeEventLi","_content$removeEventL","targetRemoveListener","removeEventListener","contentRemoveListener","childrenIsFunction","childrenIsElement","Array","isArray","childrenAreElements","filter","child","length","React","createElement","Fragment","ref","className","forwardedRef","_extends","cloneElement","displayName"],"mappings":"67BAYMA,EAAiD,CACrDC,MAAO,CACLC,OAAQ,EACRC,SAAU,QACVC,MAAO,OACPC,OAAQ,OACRC,IAAK,IACLC,KAAM,IACNC,WAAY,oBACZC,cAAe,MACfC,WAAY,OACZC,WAAY,WAIHC,EAA4BC,GACvCC,IAqBoB,IAAAC,EAAAC,EAAA,IArBnBC,SACCA,EAAQC,WACRA,EAAUC,UACVA,EAAY,SAAQC,UACpBA,EAASC,KACTA,EAAIC,UACJA,EAASC,UACTA,EAASC,OACTA,EAAMC,OACNA,EAAMC,OACNA,EAAMC,mBACNA,G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zB,GACC,CAACqC,EAASR,IAGX0G,MAAAC,cAAAD,MAAAE,SAAA,KACG5G,GAAW0G,MAAAC,cAAA,OAAA,CAAME,IAAKpD,GAAUC,MAAOzF,EAAOC,MAAO4I,UAAW7G,KAC9DE,GAAa+F,KAAuBhH,aAAAA,EAAAA,EAAW,CAAE6H,aAAcnG,EAAWtB,WAC1Ea,GAAagG,IAAsBO,MAAAC,cAAA,OAAA,CAAME,IAAKjG,GAAY1B,IAC3DoH,IAAuBtF,GACzB0F,MAAAC,cAAC3F,EAECgG,EAAA,CACA5H,UAAWA,EACX2H,aAActG,EACdoG,IAAiC,mBAArB7F,EAAkCP,EAAa,KAC3DnB,KAAMA,EACN6D,KAAMA,EACNhE,WAAY8B,GACRZ,KAGHF,GAAamG,IAAwBI,MAAAC,cAAA,OAAA,CAAME,IAAKjG,GAAY1B,EAAS,IACtEoH,KAAuBpH,aAAQ,EAARA,EAAW,KAA+B,iBAAlBA,aAAAA,EAAAA,EAAW,KACzD+H,EAAa/H,EAAS,GAAEsD,EAAAA,EAAA,GACpBtD,SAAa,QAALD,EAARC,EAAW,UAAE,IAAAD,OAAA,EAAdA,EAAiCoB,OAAK,CAAA,EAAA,CAC1CjB,YACA2H,aAActG,EAEdoG,IAAKpG,EACLnB,OACA6D,OACAhE,WAAY8B,GACTZ,IAEJ,IAKTxB,EAAQqI,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ui.js","sources":["../../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n"],"names":["classNames","_len","arguments","length","classes","Array","_key","filter","className","Boolean","join","parseProps","props","dataProps","restProps","Object","entries","forEach","_ref","key","value","substr","noop","event","_event$preventDefault","_event$stopPropagatio","_event$stopImmediateP","preventDefault","call","stopPropagation","stopImmediatePropagation"],"mappings":"iFAYaA,MAAAA,EAAa,WAAA,IAAA,IAAAC,EAAAC,UAAAC,OAAIC,EAAOC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAPF,EAAOE,GAAAJ,UAAAI,GAAA,OAA2BF,EAC7DG,QAAQC,GAAgD,iBAAdA,GAAP,MAAiCA,IACpED,OAAOE,SAASC,KAAK,IAAI,EAQfC,EAAcC,IACzB,MAAMC,EAAqC,CAAE,EACvCC,EAAqC,CAAE,EAS7C,OAPAC,OAAOC,QAAQJ,GAAOK,SAAQC,IAAkB,IAAhBC,EAAKC,GAAMF,EAChB,UAArBC,EAAIE,OAAO,EAAG,IAAuC,SAArBF,EAAIE,OAAO,EAAG,GAChDR,EAAUM,GAAOC,EAEjBN,EAAUK,GAAOC,CACnB,IAEK,CAAEP,YAAWC,YAAW,EAoEpBQ,EAAQC,IAA4B,IAAAC,EAAAC,EAAAC,EAC/CH,SAAqBC,QAAhBA,EAALD,EAAOI,0BAAcH,GAArBA,EAAAI,KAAAL,GACAA,SAAsBE,QAAjBA,EAALF,EAAOM,2BAAeJ,GAAtBA,EAAAG,KAAAL,GACAA,SAA+BG,QAA1BA,EAALH,EAAOO,oCAAwBJ,GAA/BA,EAAAE,KAAAL,EAAmC"}
1
+ {"version":3,"file":"ui.js","sources":["../../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n\n/**\n * Type definition for theme map.\n * @typedef {Object} ThemeMap\n * @property {string} dark - CSS class for the dark theme.\n * @property {string} light - CSS class for the light theme.\n */\nexport type ThemeMap = {\n dark: string\n light: string\n}\n\nlet baseThemes: ThemeMap = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\n/**\n * Gets the base themes.\n * @returns {ThemeMap} The current base themes.\n */\nexport const getBaseThemes = (): ThemeMap => baseThemes\n\n/**\n * Sets the base theme class names.\n * @param {ThemeMap} themes - Object containing the CSS classes for dark and light themes.\n */\nexport const setThemeClassNames = (themes: ThemeMap): void => {\n baseThemes = themes\n}\n\n/**\n * Switches the color theme of the document.\n * @param {boolean} isDark - Flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n * @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.\n */\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true): void => {\n const oldClass = isDark ? baseThemes.light : baseThemes.dark\n const newClass = isDark ? baseThemes.dark : baseThemes.light\n\n if (htmlElement) {\n htmlElement.classList.remove(oldClass)\n htmlElement.classList.remove(newClass)\n htmlElement.classList.add(newClass)\n }\n\n if (typeof document !== 'undefined') {\n document.querySelectorAll(`.${oldClass}`).forEach((element) => {\n element.classList.add(`.${newClass}`)\n element.classList.remove(`.${oldClass}`)\n })\n\n if (findShadows) {\n document.querySelectorAll('.shadow-div').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n })\n\n document.querySelectorAll('esmf-wrapper').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n\n const firstChild: HTMLElement = element.shadowRoot?.childNodes[0] as HTMLElement\n\n if (firstChild) {\n firstChild.classList.add(newClass)\n firstChild.classList.remove(oldClass)\n }\n })\n }\n }\n}\n\n/**\n * Updates the color theme of the document.\n * @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n */\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement): void => {\n let resolvedIsDark: boolean = isDark || false\n\n if (typeof document !== 'undefined' && isDark === undefined) {\n resolvedIsDark = document.body.classList.contains(baseThemes.dark)\n }\n switchColorTheme(resolvedIsDark, htmlElement || document.body)\n}\n\nconst windowMatchMediaChangeEventType = 'change'\n\n/**\n * Observes the user's theme preference and applies the appropriate theme.\n * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.\n * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.\n * @returns {() => void} Function to stop observing the theme preference.\n */\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = (): HTMLElement => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean): boolean => isDark,\n): () => void => {\n const switchColorThemeHandler = (isDark: boolean): void => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent): void => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent): void => {\n switchColorThemeHandler(!event.matches)\n }\n\n const isDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n try {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n } catch (error) {\n console.error(`Error::observeThemePreference::removeEventListener: ${error}`)\n }\n\n switchColorThemeHandler(isDark?.matches)\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').addEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n\n return () => {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n }\n}\n"],"names":["classNames","_len","arguments","length","classes","Array","_key","filter","className","Boolean","join","parseProps","props","dataProps","restProps","Object","entries","forEach","_ref","key","value","substr","noop","event","_event$preventDefault","_event$stopPropagatio","_event$stopImmediateP","preventDefault","call","stopPropagation","stopImmediatePropagation"],"mappings":"iFAYaA,MAAAA,EAAa,WAAA,IAAA,IAAAC,EAAAC,UAAAC,OAAIC,EAAOC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAPF,EAAOE,GAAAJ,UAAAI,GAAA,OAA2BF,EAC7DG,QAAQC,GAAgD,iBAAdA,GAAP,MAAiCA,IACpED,OAAOE,SAASC,KAAK,IAAI,EAQfC,EAAcC,IACzB,MAAMC,EAAqC,CAAE,EACvCC,EAAqC,CAAE,EAS7C,OAPAC,OAAOC,QAAQJ,GAAOK,SAAQC,IAAkB,IAAhBC,EAAKC,GAAMF,EAChB,UAArBC,EAAIE,OAAO,EAAG,IAAuC,SAArBF,EAAIE,OAAO,EAAG,GAChDR,EAAUM,GAAOC,EAEjBN,EAAUK,GAAOC,CACnB,IAEK,CAAEP,YAAWC,YAAW,EAoEpBQ,EAAQC,IAA4B,IAAAC,EAAAC,EAAAC,EAC/CH,SAAqBC,QAAhBA,EAALD,EAAOI,0BAAcH,GAArBA,EAAAI,KAAAL,GACAA,SAAsBE,QAAjBA,EAALF,EAAOM,2BAAeJ,GAAtBA,EAAAG,KAAAL,GACAA,SAA+BG,QAA1BA,EAALH,EAAOO,oCAAwBJ,GAA/BA,EAAAE,KAAAL,EAAmC"}
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&e.__esModule?e:{default:e}}var t=e(require("react"));const c=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t.default.createElement("path",{d:"M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"})),s=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t.default.createElement("path",{d:"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"}));exports.closeIconJSX=c,exports.infoIconJSX=s;
1
+ "use strict";const e=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{d:"M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"})),c=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},React.createElement("path",{d:"M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"}));exports.closeIconJSX=e,exports.infoIconJSX=c;
2
2
  //# sourceMappingURL=icons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","sources":["../../../../../../../src/core/ui/components/atoms/icons.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React from 'react'\n\nexport const closeIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z' /></svg>\n)\nexport const infoIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z' /></svg>\n\n)\n\n\nexport const appStoreIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M255.9 120.9l9.1-15.7c5.6-9.8 18.1-13.1 27.9-7.5 9.8 5.6 13.1 18.1 7.5 27.9l-87.5 151.5h63.3c20.5 0 32 24.1 23.1 40.8H113.8c-11.3 0-20.4-9.1-20.4-20.4 0-11.3 9.1-20.4 20.4-20.4h52l66.6-115.4-20.8-36.1c-5.6-9.8-2.3-22.2 7.5-27.9 9.8-5.6 22.2-2.3 27.9 7.5l8.9 15.7zm-78.7 218l-19.6 34c-5.6 9.8-18.1 13.1-27.9 7.5-9.8-5.6-13.1-18.1-7.5-27.9l14.6-25.2c16.4-5.1 29.8-1.2 40.4 11.6zm168.9-61.7h53.1c11.3 0 20.4 9.1 20.4 20.4 0 11.3-9.1 20.4-20.4 20.4h-29.5l19.9 34.5c5.6 9.8 2.3 22.2-7.5 27.9-9.8 5.6-22.2 2.3-27.9-7.5-33.5-58.1-58.7-101.6-75.4-130.6-17.1-29.5-4.9-59.1 7.2-69.1 13.4 23 33.4 57.7 60.1 104zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z' /></svg>\n)\n\n\nexport const batteryEmptyIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M544 192V160c0-35.35-28.65-64-64-64H64C28.65 96 0 124.7 0 160v192c0 35.35 28.65 64 64 64h416c35.35 0 64-28.65 64-64v-32c17.67 0 32-14.33 32-32V224C576 206.3 561.7 192 544 192zM480 352H64V160h416V352z' /></svg>\n)\n\n\nexport const elementorIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M425.6 32H22.4C10 32 0 42 0 54.4v403.2C0 470 10 480 22.4 480h403.2c12.4 0 22.4-10 22.4-22.4V54.4C448 42 438 32 425.6 32M164.3 355.5h-39.8v-199h39.8v199zm159.3 0H204.1v-39.8h119.5v39.8zm0-79.6H204.1v-39.8h119.5v39.8zm0-79.7H204.1v-39.8h119.5v39.8z' /></svg>\n)\n\nexport const squareCheckIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M384 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V96C448 60.65 419.3 32 384 32zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h320c8.836 0 16 7.162 16 16V416zM303 175L192 286.1L144.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C179.7 341.7 185.8 344 192 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S312.4 165.7 303 175z' /></svg>\n)\n\nexport const pencilIcon = (\n <svg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M8.91878 3.38356L6.59333 1.08219L7.35936 0.315069C7.56911 0.105023 7.82682 0 8.13251 0C8.43782 0 8.69536 0.105023 8.9051 0.315069L9.67113 1.08219C9.88088 1.29224 9.99031 1.54575 9.99943 1.84274C10.0086 2.13936 9.90824 2.39269 9.69849 2.60274L8.91878 3.38356ZM8.12539 4.19178L2.32545 10H0V7.67123L5.79994 1.86301L8.12539 4.19178Z' fill='#E2E369' />\n </svg>\n\n)\n"],"names":["closeIconJSX","React","createElement","xmlns","viewBox","default","d","infoIconJSX"],"mappings":"0FAIaA,MAAAA,EACXC,EAAAA,QAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,EAAAI,QAAAH,cAAA,OAAA,CAAMI,EAAE,ygBAE3DC,EACXN,EAAAA,QAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,EAAAI,QAAAH,cAAA,OAAA,CAAMI,EAAE"}
1
+ {"version":3,"file":"icons.js","sources":["../../../../../../../src/core/ui/components/atoms/icons.tsx"],"sourcesContent":["\nexport const closeIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M336.1 175c-9.375-9.375-24.56-9.375-33.94 0L256 222.1L208.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03L175 303c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L256 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94l-47.03-47.03l47.03-47.03C346.3 199.6 346.3 184.4 336.1 175zM256 0C114.6 0 0 114.6 0 256s114.6 256 256 256S512 397.4 512 256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z' /></svg>\n)\nexport const infoIconJSX = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z' /></svg>\n\n)\n\n\nexport const appStoreIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M255.9 120.9l9.1-15.7c5.6-9.8 18.1-13.1 27.9-7.5 9.8 5.6 13.1 18.1 7.5 27.9l-87.5 151.5h63.3c20.5 0 32 24.1 23.1 40.8H113.8c-11.3 0-20.4-9.1-20.4-20.4 0-11.3 9.1-20.4 20.4-20.4h52l66.6-115.4-20.8-36.1c-5.6-9.8-2.3-22.2 7.5-27.9 9.8-5.6 22.2-2.3 27.9 7.5l8.9 15.7zm-78.7 218l-19.6 34c-5.6 9.8-18.1 13.1-27.9 7.5-9.8-5.6-13.1-18.1-7.5-27.9l14.6-25.2c16.4-5.1 29.8-1.2 40.4 11.6zm168.9-61.7h53.1c11.3 0 20.4 9.1 20.4 20.4 0 11.3-9.1 20.4-20.4 20.4h-29.5l19.9 34.5c5.6 9.8 2.3 22.2-7.5 27.9-9.8 5.6-22.2 2.3-27.9-7.5-33.5-58.1-58.7-101.6-75.4-130.6-17.1-29.5-4.9-59.1 7.2-69.1 13.4 23 33.4 57.7 60.1 104zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216z' /></svg>\n)\n\n\nexport const batteryEmptyIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M544 192V160c0-35.35-28.65-64-64-64H64C28.65 96 0 124.7 0 160v192c0 35.35 28.65 64 64 64h416c35.35 0 64-28.65 64-64v-32c17.67 0 32-14.33 32-32V224C576 206.3 561.7 192 544 192zM480 352H64V160h416V352z' /></svg>\n)\n\n\nexport const elementorIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M425.6 32H22.4C10 32 0 42 0 54.4v403.2C0 470 10 480 22.4 480h403.2c12.4 0 22.4-10 22.4-22.4V54.4C448 42 438 32 425.6 32M164.3 355.5h-39.8v-199h39.8v199zm159.3 0H204.1v-39.8h119.5v39.8zm0-79.6H204.1v-39.8h119.5v39.8zm0-79.7H204.1v-39.8h119.5v39.8z' /></svg>\n)\n\nexport const squareCheckIcon = (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M384 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V96C448 60.65 419.3 32 384 32zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h320c8.836 0 16 7.162 16 16V416zM303 175L192 286.1L144.1 239c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l64 64C179.7 341.7 185.8 344 192 344s12.28-2.344 16.97-7.031l128-128c9.375-9.375 9.375-24.56 0-33.94S312.4 165.7 303 175z' /></svg>\n)\n\nexport const pencilIcon = (\n <svg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path d='M8.91878 3.38356L6.59333 1.08219L7.35936 0.315069C7.56911 0.105023 7.82682 0 8.13251 0C8.43782 0 8.69536 0.105023 8.9051 0.315069L9.67113 1.08219C9.88088 1.29224 9.99031 1.54575 9.99943 1.84274C10.0086 2.13936 9.90824 2.39269 9.69849 2.60274L8.91878 3.38356ZM8.12539 4.19178L2.32545 10H0V7.67123L5.79994 1.86301L8.12539 4.19178Z' fill='#E2E369' />\n </svg>\n\n)\n"],"names":["closeIconJSX","React","createElement","xmlns","viewBox","d","infoIconJSX"],"mappings":"aACaA,MAAAA,EACXC,MAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,MAAAC,cAAA,OAAA,CAAMG,EAAE,ygBAE3DC,EACXL,MAAAC,cAAA,MAAA,CAAKC,MAAM,6BAA6BC,QAAQ,eAAcH,MAAAC,cAAA,OAAA,CAAMG,EAAE"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),r=require("../../../../hooks/useParseProps.js"),s=require("../../../../utils/helpers/text.js");function a(e){return e&&e.__esModule?e:{default:e}}var o=a(t);const l=["element","children","href","target","className","id","onClick","text"],c=t.memo((a=>{let{element:c="span",children:i,href:n,target:d,className:u="",id:p,onClick:m,text:h}=a,x=e.objectWithoutProperties(a,l);const{dataProps:P,restProps:b}=r.useParseProps(x),j=h||(null==i?void 0:i.toString()),f=t.useMemo((()=>m?{onClick:m,onKeyDown:m,role:"button",tabIndex:-1}:{}),[m]);return o.default.createElement(c,e.objectSpread2(e.objectSpread2(e.objectSpread2({id:"".concat(p||j&&s.composeId(j)),href:n,text:h,target:d,className:u},f),{},{style:b},P),{},{"data-testid":"".concat(P.dataTestId||P["data-testid"]||p||j&&s.composeId(j))}),i)}));c.displayName="Text",exports.Text=c;
1
+ "use strict";var e=require("../../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),r=require("../../../../hooks/useParseProps.js"),s=require("../../../../utils/helpers/text.js");const a=["element","children","href","target","className","id","onClick","text"],o=t.memo((o=>{let{element:l="span",children:c,href:i,target:n,className:d="",id:p,onClick:u,text:m}=o,h=e.objectWithoutProperties(o,a);const{dataProps:x,restProps:P}=r.useParseProps(h),b=m||(null==c?void 0:c.toString()),j=t.useMemo((()=>u?{onClick:u,onKeyDown:u,role:"button",tabIndex:-1}:{}),[u]);return t.createElement(l,e.objectSpread2(e.objectSpread2(e.objectSpread2({id:"".concat(p||b&&s.composeId(b)),href:i,text:m,target:n,className:d},j),{},{style:P},x),{},{"data-testid":"".concat(x.dataTestId||x["data-testid"]||p||b&&s.composeId(b))}),c)}));o.displayName="Text",exports.Text=o;
2
2
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"sourcesContent":["import React, { memo, FC, useMemo } from 'react'\n\nimport { composeId } from '../../../../utils'\nimport { useParseProps } from '../../../../hooks'\n\nimport { ITextProps, TextProps } from './text.types'\n\n\nexport const Text: FC<TextProps> = memo<ITextProps>((\n { element = 'span', children, href, target, className = '', id, onClick, text, ...rest }: ITextProps,\n) => {\n const { dataProps, restProps } = useParseProps(rest)\n const textFromChildren: string | undefined = text || children?.toString()\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return React.createElement<TextProps>(\n element,\n {\n id: `${id || (textFromChildren && composeId(textFromChildren))}`,\n href,\n text,\n target,\n className,\n ...onClickProps,\n style: restProps,\n ...dataProps,\n 'data-testid':\n `${dataProps.dataTestId || dataProps['data-testid'] || id || (textFromChildren && composeId(textFromChildren))}`,\n },\n children,\n )\n})\n\nText.displayName = 'Text'\n"],"names":["Text","memo","_ref","element","children","href","target","className","id","onClick","text","rest","_objectWithoutProperties","_excluded","dataProps","restProps","useParseProps","textFromChildren","toString","onClickProps","useMemo","onKeyDown","role","tabIndex","React","createElement","_objectSpread","concat","composeId","style","dataTestId","displayName"],"mappings":"uVAQaA,EAAsBC,EAAIA,MAAaC,IAE/C,IADHC,QAAEA,EAAU,OAAMC,SAAEA,EAAQC,KAAEA,EAAIC,OAAEA,EAAMC,UAAEA,EAAY,GAAEC,GAAEA,EAAEC,QAAEA,EAASC,KAAAA,GAA2BR,EAAlBS,EAAIC,EAAAA,wBAAAV,EAAAW,GAEtF,MAAMC,UAAEA,EAASC,UAAEA,GAAcC,EAAAA,cAAcL,GACzCM,EAAuCP,IAAQN,aAAQ,EAARA,EAAUc,YAEzDC,EAAeC,WAAQ,IAAOX,EAAW,CAC7CA,UACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACd,IAEX,OAAOe,EAAAA,QAAMC,cACXtB,EAAOuB,EAAAA,cAAAA,EAAAA,cAAAA,EAAAA,cAAA,CAELlB,GAAE,GAAAmB,OAAKnB,GAAOS,GAAoBW,EAAAA,UAAUX,IAC5CZ,YACAK,EACAJ,SACAC,aACGY,GAAY,GAAA,CACfU,MAAOd,GACJD,GAAS,GAAA,CACZ,iBAAaa,OACVb,EAAUgB,YAAchB,EAAU,gBAAkBN,GAAOS,GAAoBW,EAAAA,UAAUX,MAE9Fb,EACD,IAGHJ,EAAK+B,YAAc"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../../../../src/core/ui/components/atoms/text/Text.tsx"],"sourcesContent":["import { createElement, memo, FC, useMemo } from 'react'\n\nimport { composeId } from '../../../../utils'\nimport { useParseProps } from '../../../../hooks'\n\nimport { ITextProps, TextProps } from './text.types'\n\n\nexport const Text: FC<TextProps> = memo<ITextProps>((\n { element = 'span', children, href, target, className = '', id, onClick, text, ...rest }: ITextProps,\n) => {\n const { dataProps, restProps } = useParseProps(rest)\n const textFromChildren: string | undefined = text || children?.toString()\n\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n return createElement<TextProps>(\n element,\n {\n id: `${id || (textFromChildren && composeId(textFromChildren))}`,\n href,\n text,\n target,\n className,\n ...onClickProps,\n style: restProps,\n ...dataProps,\n 'data-testid':\n `${dataProps.dataTestId || dataProps['data-testid'] || id || (textFromChildren && composeId(textFromChildren))}`,\n },\n children,\n )\n})\n\nText.displayName = 'Text'\n"],"names":["Text","memo","_ref","element","children","href","target","className","id","onClick","text","rest","_objectWithoutProperties","_excluded","dataProps","restProps","useParseProps","textFromChildren","toString","onClickProps","useMemo","onKeyDown","role","tabIndex","createElement","_objectSpread","concat","composeId","style","dataTestId","displayName"],"mappings":"yRAQaA,EAAsBC,EAAIA,MAAaC,IAE/C,IADHC,QAAEA,EAAU,OAAMC,SAAEA,EAAQC,KAAEA,EAAIC,OAAEA,EAAMC,UAAEA,EAAY,GAAEC,GAAEA,EAAEC,QAAEA,EAASC,KAAAA,GAA2BR,EAAlBS,EAAIC,EAAAA,wBAAAV,EAAAW,GAEtF,MAAMC,UAAEA,EAASC,UAAEA,GAAcC,EAAAA,cAAcL,GACzCM,EAAuCP,IAAQN,aAAQ,EAARA,EAAUc,YAEzDC,EAAeC,WAAQ,IAAOX,EAAW,CAC7CA,UACAY,UAAWZ,EACXa,KAAM,SACNC,UAAW,GACR,CAAG,GAAE,CAACd,IAEX,OAAOe,EAAaA,cAClBrB,EAAOsB,gBAAAA,EAAAA,cAAAA,EAAAA,cAAA,CAELjB,GAAE,GAAAkB,OAAKlB,GAAOS,GAAoBU,EAAAA,UAAUV,IAC5CZ,YACAK,EACAJ,SACAC,aACGY,GAAY,GAAA,CACfS,MAAOb,GACJD,GAAS,GAAA,CACZ,iBAAaY,OACVZ,EAAUe,YAAcf,EAAU,gBAAkBN,GAAOS,GAAoBU,EAAAA,UAAUV,MAE9Fb,EACD,IAGHJ,EAAK8B,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sources":["../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"sourcesContent":["import { FC, memo, PureComponent, ReactNode } from 'react'\n\nimport { IconBase } from '../icon'\nimport { LayoutBox } from '../container/layoutBox/LayoutBox'\n\nimport classes from './errorBoundary.module.scss'\nimport { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types'\n\n\ninterface State {\n error?: Error\n errorInfo?: unknown\n hasError: boolean\n}\n\n\nexport const DefaultErrorComponent: FC<DefaultErrorComponentProps>\n= memo(({ title, text }: DefaultErrorComponentProps) => (\n <LayoutBox className={classes.errorBoundary} direction='column' flexWrap='wrap' gap='2rem' padding='1rem'>\n {title && <h1>{title}</h1>}\n <LayoutBox align='center' justify='space-between' gap='1rem'>\n <IconBase\n className={classes.StyledIcon}\n color='#FF0000'\n width='3rem'\n height='3rem'\n >\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>\n <path d='M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z' />\n </svg>\n </IconBase>\n {text && (\n <LayoutBox flexShrink='0' width='90%'>\n {text}\n </LayoutBox>\n )}\n </LayoutBox>\n </LayoutBox>\n))\nDefaultErrorComponent.displayName = 'DefaultErrorComponent'\n\nexport class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n // eslint-disable-next-line no-console\n !this.props.muted && error && console.error(error)\n // eslint-disable-next-line no-console\n !this.props.muted && errorInfo && console.error(errorInfo)\n\n this.props?.onError?.({ error, errorInfo })\n\n !this.props.muted && this.setState({ hasError: true, error, errorInfo })\n }\n\n render(): ReactNode {\n const { ErrorComponent = DefaultErrorComponent, title, text, muted } = this.props\n const { hasError, error, errorInfo } = this.state\n\n if (hasError && !muted) {\n return (\n <ErrorComponent\n title={title || error?.toString() || 'Error'}\n text={text || `${JSON.stringify(errorInfo, null, 2)}`}\n />\n )\n }\n\n if (hasError && muted) {\n return null\n }\n\n return this.props.children\n }\n}\n"],"names":["DefaultErrorComponent","memo","_ref","title","text","React","createElement","LayoutBox","className","classes","default","errorBoundary","direction","flexWrap","gap","padding","align","justify","IconBase","StyledIcon","color","width","height","xmlns","viewBox","d","flexShrink","displayName","ErrorBoundary","PureComponent","constructor","props","super","this","state","hasError","getDerivedStateFromError","error","componentDidCatch","errorInfo","_this$props","_this$props$onError","muted","onError","call","setState","render","ErrorComponent","toString","concat","JSON","stringify","children"],"mappings":"kKAgBaA,MAAAA,EACXC,EAAIA,MAACC,IAAA,IAACC,MAAEA,EAAKC,KAAEA,GAAkCF,EAAA,OACjDG,MAAAC,cAACC,YAAS,CAACC,UAAWC,EAAOC,QAACC,cAAeC,UAAU,SAASC,SAAS,OAAOC,IAAI,OAAOC,QAAQ,QAChGZ,GAASE,MAAAC,cAAA,KAAA,KAAKH,GACfE,MAAAC,cAACC,YAAS,CAACS,MAAM,SAASC,QAAQ,gBAAgBH,IAAI,QACpDT,MAAAC,cAACY,WAAQ,CACPV,UAAWC,EAAOC,QAACS,WACnBC,MAAM,UACNC,MAAM,OACNC,OAAO,QAEPjB,MAAAC,cAAA,MAAA,CAAKiB,MAAM,6BAA6BC,QAAQ,eAC9CnB,MAAAC,cAAA,OAAA,CAAMmB,EAAE,6WAGXrB,GACCC,MAAAC,cAACC,EAAAA,UAAS,CAACmB,WAAW,IAAIL,MAAM,OAC7BjB,IAIG,IAEdJ,EAAsB2B,YAAc,wBAE7B,MAAMC,UAAsBC,EAAAA,cACjCC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CAAEC,UAAU,EAC3B,CAEA,+BAAOC,CAAyBC,GAC9B,MAAO,CAAEF,UAAU,EAAME,QAC3B,CAEAC,iBAAAA,CAAkBD,EAAcE,GAAkC,IAAAC,EAAAC,EAE/DR,KAAKF,MAAMW,MAEXT,KAAKF,MAAMW,cAEZF,OAAKT,aAAK,IAAAS,GAAS,QAATC,EAAVD,EAAYG,eAAZF,IAAmBA,GAAnBA,EAAAG,KAAAJ,EAAsB,CAAEH,QAAOE,eAE9BN,KAAKF,MAAMW,OAAST,KAAKY,SAAS,CAAEV,UAAU,EAAME,QAAOE,aAC9D,CAEAO,MAAAA,GACE,MAAMC,eAAEA,EAAiB/C,EAAqBG,MAAEA,EAAKC,KAAEA,EAAIsC,MAAEA,GAAUT,KAAKF,OACtEI,SAAEA,EAAQE,MAAEA,EAAKE,UAAEA,GAAcN,KAAKC,MAE5C,OAAIC,IAAaO,EAEbrC,MAAAC,cAACyC,EAAc,CACb5C,MAAOA,IAASkC,aAAAA,EAAAA,EAAOW,aAAc,QACrC5C,KAAMA,GAAI6C,GAAAA,OAAOC,KAAKC,UAAUZ,EAAW,KAAM,MAKnDJ,GAAYO,EACP,KAGFT,KAAKF,MAAMqB,QACpB"}
1
+ {"version":3,"file":"ErrorBoundary.js","sources":["../../../../../../../src/core/ui/components/error/ErrorBoundary.tsx"],"sourcesContent":["import { ErrorInfo, FC, memo, PureComponent, ReactNode } from 'react'\n\nimport { IconBase } from '../icon'\nimport { LayoutBox } from '../container/layoutBox/LayoutBox'\n\nimport classes from './errorBoundary.module.scss'\nimport { DefaultErrorComponentProps, ErrorBoundaryProps } from './errorBoundary.types'\n\n\ninterface State {\n error?: Error\n errorInfo?: unknown\n hasError: boolean\n}\n\n\nexport const DefaultErrorComponent: FC<DefaultErrorComponentProps>\n= memo(({ title, text }: DefaultErrorComponentProps) => (\n <LayoutBox className={classes.errorBoundary} direction='column' flexWrap='wrap' gap='2rem' padding='1rem'>\n {title && <h1>{title}</h1>}\n <LayoutBox align='center' justify='space-between' gap='1rem'>\n <IconBase\n className={classes.StyledIcon}\n color='#FF0000'\n width='3rem'\n height='3rem'\n >\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>\n <path d='M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z' />\n </svg>\n </IconBase>\n {text && (\n <LayoutBox flexShrink='0' width='90%'>\n {text}\n </LayoutBox>\n )}\n </LayoutBox>\n </LayoutBox>\n))\nDefaultErrorComponent.displayName = 'DefaultErrorComponent'\n\nexport class ErrorBoundary extends PureComponent<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error): State {\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n // eslint-disable-next-line no-console\n !this.props.muted && error && console.error(error)\n // eslint-disable-next-line no-console\n !this.props.muted && errorInfo && console.error(errorInfo)\n\n this.props?.onError?.({ error, errorInfo })\n\n !this.props.muted && this.setState({ hasError: true, error, errorInfo })\n }\n\n render(): ReactNode {\n const { ErrorComponent = DefaultErrorComponent, title, text, muted } = this.props\n const { hasError, error, errorInfo } = this.state\n\n if (hasError && !muted) {\n return (\n <ErrorComponent\n title={title || error?.toString() || 'Error'}\n text={text || `${JSON.stringify(errorInfo, null, 2)}`}\n />\n )\n }\n\n if (hasError && muted) {\n return null\n }\n\n return this.props.children\n }\n}\n"],"names":["DefaultErrorComponent","memo","_ref","title","text","React","createElement","LayoutBox","className","classes","default","errorBoundary","direction","flexWrap","gap","padding","align","justify","IconBase","StyledIcon","color","width","height","xmlns","viewBox","d","flexShrink","displayName","ErrorBoundary","PureComponent","constructor","props","super","this","state","hasError","getDerivedStateFromError","error","componentDidCatch","errorInfo","_this$props","_this$props$onError","muted","onError","call","setState","render","ErrorComponent","toString","concat","JSON","stringify","children"],"mappings":"kKAgBaA,MAAAA,EACXC,EAAIA,MAACC,IAAA,IAACC,MAAEA,EAAKC,KAAEA,GAAkCF,EAAA,OACjDG,MAAAC,cAACC,YAAS,CAACC,UAAWC,EAAOC,QAACC,cAAeC,UAAU,SAASC,SAAS,OAAOC,IAAI,OAAOC,QAAQ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MAAMqB,QACpB"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var t=require("react"),n=require("../../../../../../node_modules/@popperjs/core/lib/popper.js"),l=require("../../../../utils/helpers/cancelableDelayedFunction.js"),r=require("../../../../hooks/useOutsideClick.js"),o=require("../../../../constants/ui.constants.js");function a(e){return e&&e.__esModule?e:{default:e}}var u=a(t);const i=["children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape"],s=["ContentComponent"],d={modal:{zIndex:1,position:"fixed",width:"100%",height:"100%",top:"0",left:"0",background:"rgba(0 0 0 / 70%)",pointerEvents:"all",userSelect:"none",visibility:"hidden"}},c=t.memo((a=>{var c,p;let{children:v,components:m,placement:f="bottom",modifiers:b,data:h,hoverable:E,clickable:y,onOpen:C,onHide:j,isOpen:k,hideOnContentClick:w=!1,hideOnClickOutside:N=!0,hideTimeout:g=150,isPopup:O=!1,isModal:S=!1,modalOverlayClassName:M,modalContainer:R,targetRef:L,hideOnEscape:P}=a,q=e.objectWithoutProperties(a,i);const[x,H]=t.useState(null),[T,_]=t.useState(null!==(c=null==L?void 0:L.current)&&void 0!==c?c:null);t.useEffect((()=>{null!=L&&L.current&&_(null==L?void 0:L.current)}),[L]);const W=m||{},{ContentComponent:A}=W,D=e.objectWithoutProperties(W,s),K=t.useRef(null),z=t.useMemo((()=>{const t=b?{modifiers:b,placement:f}:{placement:f};return t.modifiers=t.modifiers||[],O&&(t.modifiers=[...t.modifiers,{name:"centering",phase:"beforeWrite",enabled:!0,fn:t=>{let{state:n}=t;const l=null==R?void 0:R.getBoundingClientRect(),{width:r,height:o,left:a,top:u}=l||{width:window.innerWidth,height:window.innerHeight,left:0,top:0},i=a+(r-n.elements.popper.clientWidth)/2,s=u+(o-n.elements.popper.clientHeight)/2;return e.objectSpread2(e.objectSpread2({},n),{},{styles:e.objectSpread2(e.objectSpread2({},n.styles),{},{popper:e.objectSpread2(e.objectSpread2({},n.styles.popper),{},{left:"".concat(i,"px"),top:"".concat(s,"px"),transform:"none"})})})}}]),t}),[b,f,O,R]),B=t.useRef();t.useEffect((()=>{var t;let l;return null==K||null===(t=K.current)||void 0===t||t.destroy(),T&&x&&(l=n.createPopper(T,x,e.objectSpread2({},z)),K.current=l),()=>{var e;null===(e=l)||void 0===e||e.destroy(),K.current=null}}),[x,T,z]);const F=t.useRef(),I=t.useRef(-1),G=t.useCallback((()=>{var e,t;x&&delete x.dataset.show,S&&null!=te&&te.current&&(te.current.style.visibility="hidden",delete te.current.dataset.show),null==K||null===(e=K.current)||void 0===e||e.update(),null==j||j(),null==F||null===(t=F.current)||void 0===t||t.call(F),clearTimeout(I.current)}),[x,S,j]),J=t.useCallback((()=>{B.current&&B.current(),B.current=l.cancelableSetTimeout(G,g)}),[G,g]),Q=t.useCallback((()=>{B.current&&B.current()}),[]),U=t.useCallback((e=>{var t;("true"===(null==x||null===(t=x.dataset)||void 0===t?void 0:t.show)&&N&&(null==x||!x.contains(e))||null!=x&&x.contains(e)&&w)&&G()}),[G,x,w,N]),V=t.useCallback((()=>{var e,t;x&&(x.dataset.show="true"),null==K||null===(e=K.current)||void 0===e||e.update(),S&&null!=te&&te.current&&(te.current.style.visibility="visible",te.current.dataset.show="true"),null==C||C(),null==F||null===(t=F.current)||void 0===t||t.call(F),clearTimeout(I.current),I.current=setTimeout((()=>{F.current=r.outsideClickHandler(T,U)}),250)}),[x,U,S,C,T]),X=t.useCallback((()=>{var e;"true"===(null==x||null===(e=x.dataset)||void 0===e?void 0:e.show)?G():V()}),[x,G,V]),Y=t.useCallback((e=>{P&&e.keyCode===o.KeyCode.Escape&&G()}),[P,G]);t.useEffect((()=>{var e,t;const n=null==T||null===(e=T.addEventListener)||void 0===e?void 0:e.bind(T),l=null==x||null===(t=x.addEventListener)||void 0===t?void 0:t.bind(x);return l&&n&&(E&&(n(o.EventName.MouseEnter,V),l(o.EventName.MouseEnter,Q),n(o.EventName.MouseLeave,J),l(o.EventName.MouseLeave,G)),y&&n(o.EventName.Click,X)),P&&document.addEventListener(o.EventName.KeyDown,Y),()=>{var e,t;const n=null==T||null===(e=T.removeEventListener)||void 0===e?void 0:e.bind(T),l=null==x||null===(t=x.removeEventListener)||void 0===t?void 0:t.bind(x);document.removeEventListener(o.EventName.KeyDown,Y),B.current&&B.current(),n&&(n(o.EventName.Click,X),n(o.EventName.MouseEnter,V),n(o.EventName.MouseLeave,J)),l&&(l(o.EventName.MouseLeave,G),l(o.EventName.MouseEnter,Q))}}),[T,x,y,E,V,G,X,J,Q,P,Y]),t.useEffect((()=>(!0===k&&V(),!1===k&&G(),null==F?void 0:F.current)),[G,k,V]);const Z="function"==typeof v,$="function"!=typeof v&&!Array.isArray(v),ee="function"!=typeof v&&Array.isArray(v)&&2===v.filter((e=>!!e)).length,te=t.useRef(null);return t.useEffect((()=>{S&&x&&(x.style.zIndex="2")}),[x,S]),u.default.createElement(u.default.Fragment,null,S&&u.default.createElement("span",{ref:te,style:d.modal,className:M}),!L&&Z&&(null==v?void 0:v({forwardedRef:_,data:h})),!L&&$&&u.default.createElement("span",{ref:_},v),!ee&&A&&u.default.createElement(A,e.extends({placement:f,forwardedRef:H,ref:"function"!=typeof A?H:null,data:h,hide:G,components:D},q)),!L&&ee&&u.default.createElement("span",{ref:_},v[0]),ee&&(null==v?void 0:v[1])&&"object"==typeof(null==v?void 0:v[1])&&u.default.cloneElement(v[1],e.objectSpread2(e.objectSpread2({},null==v||null===(p=v[1])||void 0===p?void 0:p.props),{},{placement:f,forwardedRef:H,ref:H,data:h,hide:G,components:D},q)))}));c.displayName="Popover",exports.Popover=c;
1
+ "use strict";var e=require("../../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var t=require("react"),n=require("../../../../../../node_modules/@popperjs/core/lib/popper.js"),l=require("../../../../utils/helpers/cancelableDelayedFunction.js"),r=require("../../../../hooks/useOutsideClick.js"),o=require("../../../../constants/ui.constants.js");const a=["children","components","placement","modifiers","data","hoverable","clickable","onOpen","onHide","isOpen","hideOnContentClick","hideOnClickOutside","hideTimeout","isPopup","isModal","modalOverlayClassName","modalContainer","targetRef","hideOnEscape"],i=["ContentComponent"],u={modal:{zIndex:1,position:"fixed",width:"100%",height:"100%",top:"0",left:"0",background:"rgba(0 0 0 / 70%)",pointerEvents:"all",userSelect:"none",visibility:"hidden"}},s=t.memo((s=>{var c,d;let{children:p,components:v,placement:m="bottom",modifiers:f,data:b,hoverable:h,clickable:E,onOpen:y,onHide:C,isOpen:j,hideOnContentClick:k=!1,hideOnClickOutside:w=!0,hideTimeout:R=150,isPopup:N=!1,isModal:g=!1,modalOverlayClassName:O,modalContainer:S,targetRef:M,hideOnEscape:L}=s,P=e.objectWithoutProperties(s,a);const[q,x]=t.useState(null),[H,T]=t.useState(null!==(c=null==M?void 0:M.current)&&void 0!==c?c:null);t.useEffect((()=>{null!=M&&M.current&&T(null==M?void 0:M.current)}),[M]);const W=v||{},{ContentComponent:A}=W,_=e.objectWithoutProperties(W,i),D=t.useRef(null),K=t.useMemo((()=>{const t=f?{modifiers:f,placement:m}:{placement:m};return t.modifiers=t.modifiers||[],N&&(t.modifiers=[...t.modifiers,{name:"centering",phase:"beforeWrite",enabled:!0,fn:t=>{let{state:n}=t;const l=null==S?void 0:S.getBoundingClientRect(),{width:r,height:o,left:a,top:i}=l||{width:window.innerWidth,height:window.innerHeight,left:0,top:0},u=a+(r-n.elements.popper.clientWidth)/2,s=i+(o-n.elements.popper.clientHeight)/2;return e.objectSpread2(e.objectSpread2({},n),{},{styles:e.objectSpread2(e.objectSpread2({},n.styles),{},{popper:e.objectSpread2(e.objectSpread2({},n.styles.popper),{},{left:"".concat(u,"px"),top:"".concat(s,"px"),transform:"none"})})})}}]),t}),[f,m,N,S]),z=t.useRef();t.useEffect((()=>{var t;let l;return null==D||null===(t=D.current)||void 0===t||t.destroy(),H&&q&&(l=n.createPopper(H,q,e.objectSpread2({},K)),D.current=l),()=>{var e;null===(e=l)||void 0===e||e.destroy(),D.current=null}}),[q,H,K]);const B=t.useRef(),F=t.useRef(-1),I=t.useCallback((()=>{var e,t;q&&delete q.dataset.show,g&&null!=ee&&ee.current&&(ee.current.style.visibility="hidden",delete ee.current.dataset.show),null==D||null===(e=D.current)||void 0===e||e.update(),null==C||C(),null==B||null===(t=B.current)||void 0===t||t.call(B),clearTimeout(F.current)}),[q,g,C]),G=t.useCallback((()=>{z.current&&z.current(),z.current=l.cancelableSetTimeout(I,R)}),[I,R]),J=t.useCallback((()=>{z.current&&z.current()}),[]),Q=t.useCallback((e=>{var t;("true"===(null==q||null===(t=q.dataset)||void 0===t?void 0:t.show)&&w&&(null==q||!q.contains(e))||null!=q&&q.contains(e)&&k)&&I()}),[I,q,k,w]),U=t.useCallback((()=>{var e,t;q&&(q.dataset.show="true"),null==D||null===(e=D.current)||void 0===e||e.update(),g&&null!=ee&&ee.current&&(ee.current.style.visibility="visible",ee.current.dataset.show="true"),null==y||y(),null==B||null===(t=B.current)||void 0===t||t.call(B),clearTimeout(F.current),F.current=setTimeout((()=>{B.current=r.outsideClickHandler(H,Q)}),250)}),[q,Q,g,y,H]),V=t.useCallback((()=>{var e;"true"===(null==q||null===(e=q.dataset)||void 0===e?void 0:e.show)?I():U()}),[q,I,U]),X=t.useCallback((e=>{L&&e.keyCode===o.KeyCode.Escape&&I()}),[L,I]);t.useEffect((()=>{var e,t;const n=null==H||null===(e=H.addEventListener)||void 0===e?void 0:e.bind(H),l=null==q||null===(t=q.addEventListener)||void 0===t?void 0:t.bind(q);return l&&n&&(h&&(n(o.EventName.MouseEnter,U),l(o.EventName.MouseEnter,J),n(o.EventName.MouseLeave,G),l(o.EventName.MouseLeave,I)),E&&n(o.EventName.Click,V)),L&&document.addEventListener(o.EventName.KeyDown,X),()=>{var e,t;const n=null==H||null===(e=H.removeEventListener)||void 0===e?void 0:e.bind(H),l=null==q||null===(t=q.removeEventListener)||void 0===t?void 0:t.bind(q);document.removeEventListener(o.EventName.KeyDown,X),z.current&&z.current(),n&&(n(o.EventName.Click,V),n(o.EventName.MouseEnter,U),n(o.EventName.MouseLeave,G)),l&&(l(o.EventName.MouseLeave,I),l(o.EventName.MouseEnter,J))}}),[H,q,E,h,U,I,V,G,J,L,X]),t.useEffect((()=>(!0===j&&U(),!1===j&&I(),null==B?void 0:B.current)),[I,j,U]);const Y="function"==typeof p,Z="function"!=typeof p&&!Array.isArray(p),$="function"!=typeof p&&Array.isArray(p)&&2===p.filter((e=>!!e)).length,ee=t.useRef(null);return t.useEffect((()=>{g&&q&&(q.style.zIndex="2")}),[q,g]),React.createElement(React.Fragment,null,g&&React.createElement("span",{ref:ee,style:u.modal,className:O}),!M&&Y&&(null==p?void 0:p({forwardedRef:T,data:b})),!M&&Z&&React.createElement("span",{ref:T},p),!$&&A&&React.createElement(A,e.extends({placement:m,forwardedRef:x,ref:"function"!=typeof A?x:null,data:b,hide:I,components:_},P)),!M&&$&&React.createElement("span",{ref:T},p[0]),$&&(null==p?void 0:p[1])&&"object"==typeof(null==p?void 0:p[1])&&t.cloneElement(p[1],e.objectSpread2(e.objectSpread2({},null==p||null===(d=p[1])||void 0===d?void 0:d.props),{},{placement:m,forwardedRef:x,ref:x,data:b,hide:I,components:_},P)))}));s.displayName="Popover",exports.Popover=s;
2
2
  //# sourceMappingURL=PopoverLite.js.map