@e1011/es-kit 1.0.172 → 1.0.175
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.
- package/dist/hooks/esm/index.css +41 -41
- package/dist/hooks/esm/src/core/hooks/useThemePreference.js +1 -1
- package/dist/hooks/esm/src/core/hooks/useThemePreference.js.map +1 -1
- package/dist/hooks/index.css +41 -41
- package/dist/hooks/src/core/hooks/useThemePreference.js +1 -1
- package/dist/hooks/src/core/hooks/useThemePreference.js.map +1 -1
- package/dist/lib/cjs/index.css +1 -1
- package/dist/lib/cjs/src/core/hooks/useThemePreference.js +1 -1
- package/dist/lib/cjs/src/core/hooks/useThemePreference.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/LayoutBox.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/LayoutBox.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/container/layoutBox.module.scss.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/lib/cjs/src/index.js +1 -1
- package/dist/lib/esm/index.css +1 -1
- package/dist/lib/esm/src/core/hooks/useThemePreference.js +1 -1
- package/dist/lib/esm/src/core/hooks/useThemePreference.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/container/LayoutBox.js +1 -1
- package/dist/lib/esm/src/core/ui/components/container/LayoutBox.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/container/layoutBox.module.scss.js +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/lib/esm/src/index.js +1 -1
- package/dist/lib/src/core/hooks/useThemePreference.js +1 -1
- package/dist/lib/src/core/ui/components/container/LayoutBox.js +1 -1
- package/dist/lib/src/core/ui/components/container/LayoutBox.js.map +1 -1
- package/dist/lib/src/core/ui/components/icon/IconWC.js +8 -8
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/core/ui/components/icon/IconWC.d.ts +3 -3
- package/dist/ui/esm/index.css +1 -1
- package/dist/ui/esm/src/core/ui/components/container/LayoutBox.js +1 -1
- package/dist/ui/esm/src/core/ui/components/container/LayoutBox.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/container/layoutBox.module.scss.js +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/ui/esm/src/core/ui/index.js +1 -1
- package/dist/ui/index.css +1 -1
- package/dist/ui/src/core/ui/components/container/LayoutBox.js +1 -1
- package/dist/ui/src/core/ui/components/container/LayoutBox.js.map +1 -1
- package/dist/ui/src/core/ui/components/container/layoutBox.module.scss.js +1 -1
- package/dist/ui/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/ui/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/ui/src/core/ui/index.js +1 -1
- package/dist/utils/esm/index.css +41 -41
- package/dist/utils/index.css +41 -41
- package/package.json +1 -1
package/dist/hooks/esm/index.css
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
.layoutBox-module_flexible-box__Q8zyl {
|
|
2
|
-
display: flex;
|
|
3
|
-
position: relative;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
flex: 0;
|
|
6
|
-
flex-grow: 0;
|
|
7
|
-
flex-shrink: 0;
|
|
8
|
-
flex-basis: auto;
|
|
9
|
-
flex-wrap: nowrap;
|
|
10
|
-
gap: 0;
|
|
11
|
-
text-align: left;
|
|
12
|
-
justify-content: flex-start;
|
|
13
|
-
align-items: flex-start;
|
|
14
|
-
align-self: auto;
|
|
15
|
-
margin: 0;
|
|
16
|
-
padding: 0;
|
|
17
|
-
width: auto;
|
|
18
|
-
height: auto;
|
|
19
|
-
max-width: none;
|
|
20
|
-
max-height: none;
|
|
21
|
-
min-width: 0;
|
|
22
|
-
min-height: 0;
|
|
23
|
-
border-radius: initial;
|
|
24
|
-
}
|
|
25
1
|
.icon-module_icon-base-parent__nOMvW {
|
|
26
2
|
line-height: 1px !important;
|
|
27
3
|
}
|
|
@@ -52,24 +28,29 @@
|
|
|
52
28
|
width: var(--height);
|
|
53
29
|
height: var(--width);
|
|
54
30
|
}
|
|
55
|
-
.
|
|
31
|
+
.layoutBox-module_layout-box__faPND {
|
|
32
|
+
display: flex;
|
|
56
33
|
position: relative;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
height:
|
|
72
|
-
|
|
34
|
+
flex-direction: row;
|
|
35
|
+
flex: 0;
|
|
36
|
+
flex-grow: 0;
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
flex-basis: auto;
|
|
39
|
+
flex-wrap: nowrap;
|
|
40
|
+
gap: 0;
|
|
41
|
+
text-align: left;
|
|
42
|
+
justify-content: flex-start;
|
|
43
|
+
align-items: flex-start;
|
|
44
|
+
align-self: auto;
|
|
45
|
+
margin: 0;
|
|
46
|
+
padding: 0;
|
|
47
|
+
width: auto;
|
|
48
|
+
height: auto;
|
|
49
|
+
max-width: none;
|
|
50
|
+
max-height: none;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
min-height: 0;
|
|
53
|
+
border-radius: initial;
|
|
73
54
|
}
|
|
74
55
|
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
75
56
|
transform-origin: 0% 0%;
|
|
@@ -103,4 +84,23 @@
|
|
|
103
84
|
width: var(--prop-value);
|
|
104
85
|
max-width: var(--prop-value);
|
|
105
86
|
opacity: 1;
|
|
87
|
+
}
|
|
88
|
+
.divider-module_divider-line__6CesR {
|
|
89
|
+
position: relative;
|
|
90
|
+
display: block;
|
|
91
|
+
transition: opacity, width, height 250ms ease-in-out;
|
|
92
|
+
background-color: var(--color);
|
|
93
|
+
opacity: var(--opacity);
|
|
94
|
+
}
|
|
95
|
+
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
96
|
+
height: var(--length);
|
|
97
|
+
left: var(--left);
|
|
98
|
+
width: var(--width);
|
|
99
|
+
margin: var(--margin);
|
|
100
|
+
}
|
|
101
|
+
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
102
|
+
width: var(--length);
|
|
103
|
+
left: var(--left);
|
|
104
|
+
height: var(--height);
|
|
105
|
+
margin: var(--margin);
|
|
106
106
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEffect as e}from"react";const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const c=o=>{const c=e();null==r||r(o,c),null==t||t(o)},d=e=>{c(e.matches)},l=e=>{c(!e.matches)},s=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}catch(e){}return c(null==s?void 0:s.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").addEventListener(o,l),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}},c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;e((()=>t(o,c)),[o,c])},d={dark:"theme-dark",light:"theme-light"},r=function(e,o){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const c=e?d.light:d.dark,r=e?d.dark:d.light;o&&(o.classList.remove(c),o.classList.remove(r),o.classList.add(r)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(c)).forEach((e=>{e.classList.add(".".concat(r)),e.classList.remove(".".concat(c))})),t&&(document.querySelectorAll(".shadow-div").forEach((e=>{var o,t;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c)})),document.querySelectorAll("
|
|
1
|
+
import{useEffect as e}from"react";const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const c=o=>{const c=e();null==r||r(o,c),null==t||t(o)},d=e=>{c(e.matches)},l=e=>{c(!e.matches)},s=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}catch(e){}return c(null==s?void 0:s.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").addEventListener(o,l),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}},c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;e((()=>t(o,c)),[o,c])},d={dark:"theme-dark",light:"theme-light"},r=function(e,o){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const c=e?d.light:d.dark,r=e?d.dark:d.light;o&&(o.classList.remove(c),o.classList.remove(r),o.classList.add(r)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(c)).forEach((e=>{e.classList.add(".".concat(r)),e.classList.remove(".".concat(c))})),t&&(document.querySelectorAll(".shadow-div").forEach((e=>{var o,t;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c)})),document.querySelectorAll("esmf-wrapper").forEach((e=>{var o,t,d;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c);const l=null===(d=e.shadowRoot)||void 0===d?void 0:d.childNodes[0];l&&(l.classList.add(r),l.classList.remove(c))}))))},l=(e,o)=>{let t=e||!1;"undefined"!=typeof document&&void 0===e&&(t=document.body.classList.contains(d.dark)),r(t,o||document.body)};export{d as baseThemes,t as observeThemePreference,r as switchColorTheme,l as updateColorTheme,c as useThemePreference};
|
|
2
2
|
//# sourceMappingURL=useThemePreference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\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\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\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('
|
|
1
|
+
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\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\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\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\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement) => {\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"],"names":["windowMatchMediaChangeEventType","observeThemePreference","getHtmlElement","arguments","length","undefined","document","body","switchCallback","isDark","switchColorThemeHandler","htmlElement","switchColorTheme","changeDarkColorThemeHandler","event","matches","changeLightColorThemeHandler","window","matchMedia","removeEventListener","error","addEventListener","useThemePreference","useEffect","baseThemes","dark","light","findShadows","oldClass","newClass","classList","remove","add","querySelectorAll","concat","forEach","element","_element$shadowRoot","_element$shadowRoot2","shadowRoot","querySelector","_element$shadowRoot3","_element$shadowRoot4","_element$shadowRoot5","firstChild","childNodes","updateColorTheme","resolvedIsDark","contains"],"mappings":"kCAGA,MAAMA,EAAkC,SAE3BC,EAAyB,WAGjC,IAFHC,EAAiCC,UAAAC,OAAAD,QAAAE,IAAAF,UA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B,SAASxB,EAAWC,OAE/Db,EAAiBmC,EAAgBpC,GAAeL,SAASC,KAAK"}
|
package/dist/hooks/index.css
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
.layoutBox-module_flexible-box__Q8zyl {
|
|
2
|
-
display: flex;
|
|
3
|
-
position: relative;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
flex: 0;
|
|
6
|
-
flex-grow: 0;
|
|
7
|
-
flex-shrink: 0;
|
|
8
|
-
flex-basis: auto;
|
|
9
|
-
flex-wrap: nowrap;
|
|
10
|
-
gap: 0;
|
|
11
|
-
text-align: left;
|
|
12
|
-
justify-content: flex-start;
|
|
13
|
-
align-items: flex-start;
|
|
14
|
-
align-self: auto;
|
|
15
|
-
margin: 0;
|
|
16
|
-
padding: 0;
|
|
17
|
-
width: auto;
|
|
18
|
-
height: auto;
|
|
19
|
-
max-width: none;
|
|
20
|
-
max-height: none;
|
|
21
|
-
min-width: 0;
|
|
22
|
-
min-height: 0;
|
|
23
|
-
border-radius: initial;
|
|
24
|
-
}
|
|
25
1
|
.icon-module_icon-base-parent__nOMvW {
|
|
26
2
|
line-height: 1px !important;
|
|
27
3
|
}
|
|
@@ -52,24 +28,29 @@
|
|
|
52
28
|
width: var(--height);
|
|
53
29
|
height: var(--width);
|
|
54
30
|
}
|
|
55
|
-
.
|
|
31
|
+
.layoutBox-module_layout-box__faPND {
|
|
32
|
+
display: flex;
|
|
56
33
|
position: relative;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
height:
|
|
72
|
-
|
|
34
|
+
flex-direction: row;
|
|
35
|
+
flex: 0;
|
|
36
|
+
flex-grow: 0;
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
flex-basis: auto;
|
|
39
|
+
flex-wrap: nowrap;
|
|
40
|
+
gap: 0;
|
|
41
|
+
text-align: left;
|
|
42
|
+
justify-content: flex-start;
|
|
43
|
+
align-items: flex-start;
|
|
44
|
+
align-self: auto;
|
|
45
|
+
margin: 0;
|
|
46
|
+
padding: 0;
|
|
47
|
+
width: auto;
|
|
48
|
+
height: auto;
|
|
49
|
+
max-width: none;
|
|
50
|
+
max-height: none;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
min-height: 0;
|
|
53
|
+
border-radius: initial;
|
|
73
54
|
}
|
|
74
55
|
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
75
56
|
transform-origin: 0% 0%;
|
|
@@ -103,4 +84,23 @@
|
|
|
103
84
|
width: var(--prop-value);
|
|
104
85
|
max-width: var(--prop-value);
|
|
105
86
|
opacity: 1;
|
|
87
|
+
}
|
|
88
|
+
.divider-module_divider-line__6CesR {
|
|
89
|
+
position: relative;
|
|
90
|
+
display: block;
|
|
91
|
+
transition: opacity, width, height 250ms ease-in-out;
|
|
92
|
+
background-color: var(--color);
|
|
93
|
+
opacity: var(--opacity);
|
|
94
|
+
}
|
|
95
|
+
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
96
|
+
height: var(--length);
|
|
97
|
+
left: var(--left);
|
|
98
|
+
width: var(--width);
|
|
99
|
+
margin: var(--margin);
|
|
100
|
+
}
|
|
101
|
+
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
102
|
+
width: var(--length);
|
|
103
|
+
left: var(--left);
|
|
104
|
+
height: var(--height);
|
|
105
|
+
margin: var(--margin);
|
|
106
106
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const r=o=>{const r=e();null==c||c(o,r),null==t||t(o)},s=e=>{r(e.matches)},d=e=>{r(!e.matches)},l=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,s),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,d)}catch(e){}return r(null==l?void 0:l.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(o,s),window.matchMedia("(prefers-color-scheme: light)").addEventListener(o,d),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,s),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,d)}},r={dark:"theme-dark",light:"theme-light"},c=function(e,o){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const c=e?r.light:r.dark,s=e?r.dark:r.light;o&&(o.classList.remove(c),o.classList.remove(s),o.classList.add(s)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(c)).forEach((e=>{e.classList.add(".".concat(s)),e.classList.remove(".".concat(c))})),t&&(document.querySelectorAll(".shadow-div").forEach((e=>{var o,t;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(s),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c)})),document.querySelectorAll("esmf-wrapper").forEach((e=>{var o,t,r;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(s),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c);const d=null===(r=e.shadowRoot)||void 0===r?void 0:r.childNodes[0];d&&(d.classList.add(s),d.classList.remove(c))}))))};exports.baseThemes=r,exports.observeThemePreference=t,exports.switchColorTheme=c,exports.updateColorTheme=(e,o)=>{let t=e||!1;"undefined"!=typeof document&&void 0===e&&(t=document.body.classList.contains(r.dark)),c(t,o||document.body)},exports.useThemePreference=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;e.useEffect((()=>t(o,r)),[o,r])};
|
|
2
2
|
//# sourceMappingURL=useThemePreference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemePreference.js","sources":["../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\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\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\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('
|
|
1
|
+
{"version":3,"file":"useThemePreference.js","sources":["../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\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\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\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\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement) => {\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"],"names":["windowMatchMediaChangeEventType","observeThemePreference","getHtmlElement","arguments","length","undefined","document","body","switchCallback","isDark","switchColorThemeHandler","htmlElement","switchColorTheme","changeDarkColorThemeHandler","event","matches","changeLightColorThemeHandler","window","matchMedia","removeEventListener","error","addEventListener","baseThemes","dark","light","findShadows","oldClass","newClass","classList","remove","add","querySelectorAll","concat","forEach","element","_element$shadowRoot","_element$shadowRoot2","shadowRoot","querySelector","_element$shadowRoot3","_element$shadowRoot4","_element$shadowRoot5","firstChild","childNodes","updateColorTheme","resolvedIsDark","contains","useEffect"],"mappings":"2FAGA,MAAMA,EAAkC,SAE3BC,EAAyB,WAGjC,IAFHC,EAAiCC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,IAAMG,SAASC,KACnDC,EAAyCL,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIM,GAAAA,GAAoBA,EAEjE,MAAMC,EAA2BD,IAC/B,MAAME,EAAcT,IAEpBU,SAAAA,EAAmBH,EAAQE,GAC3BH,SAAAA,EAAiBC,EAAO,EAGpBI,EAA+BC,IACnCJ,EAAwBI,E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E,cAAa,IAAAN,OAAKN,WAAW,IAAAU,GAAjDA,EAAmDR,UAAUC,OAAOH,EAAS,IAG/EpB,SAASyB,iBAAiB,gBAAgBE,SAASC,IAAY,IAAAK,EAAAC,EAAAC,EAC3C,QAAlBF,EAAAL,EAAQG,kBAAU,IAAAE,GAA+B,QAA/BA,EAAlBA,EAAoBD,cAAa,IAAAN,OAAKN,WAAW,IAAAa,GAAjDA,EAAmDX,UAAUE,IAAIH,GAC/C,QAAlBa,EAAAN,EAAQG,kBAAU,IAAAG,GAA+B,QAA/BA,EAAlBA,EAAoBF,cAAa,IAAAN,OAAKN,WAAW,IAAAc,GAAjDA,EAAmDZ,UAAUC,OAAOH,GAEpE,MAAMgB,EAA4CD,QAArBA,EAAGP,EAAQG,sBAAUI,SAAlBA,EAAoBE,WAAW,GAE3DD,IACFA,EAAWd,UAAUE,IAAIH,GACzBe,EAAWd,UAAUC,OAAOH,GAC9B,KAIR,4GAEgCkB,CAACnC,EAAkBE,KACjD,IAAIkC,EAA0BpC,IAAU,EAEhB,oBAAbH,eAAuCD,IAAXI,IACrCoC,EAAiBvC,SAASC,KAAKqB,UAAUkB,SAASxB,EAAWC,OAE/DX,EAAiBiC,EAAgBlC,GAAeL,SAASC,KAAK,6BA3D9B,WAG7B,IAFHL,EAAiCC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,IAAMG,SAASC,KACnDC,EAAyCL,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIM,GAAAA,GAAoBA,EAEjEsC,aAAU,IAAM9C,EAAuBC,EAAgBM,IAAiB,CAACN,EAAgBM,GAC3F"}
|
package/dist/lib/cjs/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const r=o=>{const r=e();null==c||c(o,r),null==t||t(o)},s=e=>{r(e.matches)},d=e=>{r(!e.matches)},l=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,s),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,d)}catch(e){}return r(null==l?void 0:l.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(o,s),window.matchMedia("(prefers-color-scheme: light)").addEventListener(o,d),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,s),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,d)}},r={dark:"theme-dark",light:"theme-light"},c=function(e,o){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const c=e?r.light:r.dark,s=e?r.dark:r.light;o&&(o.classList.remove(c),o.classList.remove(s),o.classList.add(s)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(c)).forEach((e=>{e.classList.add(".".concat(s)),e.classList.remove(".".concat(c))})),t&&(document.querySelectorAll(".shadow-div").forEach((e=>{var o,t;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(s),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c)})),document.querySelectorAll("esmf-wrapper").forEach((e=>{var o,t,r;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(s),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c);const d=null===(r=e.shadowRoot)||void 0===r?void 0:r.childNodes[0];d&&(d.classList.add(s),d.classList.remove(c))}))))};exports.baseThemes=r,exports.observeThemePreference=t,exports.switchColorTheme=c,exports.updateColorTheme=(e,o)=>{let t=e||!1;"undefined"!=typeof document&&void 0===e&&(t=document.body.classList.contains(r.dark)),c(t,o||document.body)},exports.useThemePreference=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;e.useEffect((()=>t(o,r)),[o,r])};
|
|
2
2
|
//# sourceMappingURL=useThemePreference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\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\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\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('
|
|
1
|
+
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\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\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\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\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement) => {\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"],"names":["windowMatchMediaChangeEventType","observeThemePreference","getHtmlElement","arguments","length","undefined","document","body","switchCallback","isDark","switchColorThemeHandler","htmlElement","switchColorTheme","changeDarkColorThemeHandler","event","matches","changeLightColorThemeHandler","window","matchMedia","removeEventListener","error","addEventListener","baseThemes","dark","light","findShadows","oldClass","newClass","classList","remove","add","querySelectorAll","concat","forEach","element","_element$shadowRoot","_element$shadowRoot2","shadowRoot","querySelector","_element$shadowRoot3","_element$shadowRoot4","_element$shadowRoot5","firstChild","childNodes","updateColorTheme","resolvedIsDark","contains","useEffect"],"mappings":"2FAGA,MAAMA,EAAkC,SAE3BC,EAAyB,WAGjC,IAFHC,EAAiCC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,IAAMG,SAASC,KACnDC,EAAyCL,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIM,GAAAA,GAAoBA,EAEjE,MAAMC,EAA2BD,IAC/B,MAAME,EAAcT,IAEpBU,SAAAA,EAAmBH,EAAQE,GAC3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,EAAAF,EAAQG,kBAAU,IAAAD,GAA+B,QAA/BA,EAAlBA,EAAoBE,cAAa,IAAAN,OAAKN,WAAW,IAAAU,GAAjDA,EAAmDR,UAAUC,OAAOH,EAAS,IAG/EpB,SAASyB,iBAAiB,gBAAgBE,SAASC,IAAY,IAAAK,EAAAC,EAAAC,EAC3C,QAAlBF,EAAAL,EAAQG,kBAAU,IAAAE,GAA+B,QAA/BA,EAAlBA,EAAoBD,cAAa,IAAAN,OAAKN,WAAW,IAAAa,GAAjDA,EAAmDX,UAAUE,IAAIH,GAC/C,QAAlBa,EAAAN,EAAQG,kBAAU,IAAAG,GAA+B,QAA/BA,EAAlBA,EAAoBF,cAAa,IAAAN,OAAKN,WAAW,IAAAc,GAAjDA,EAAmDZ,UAAUC,OAAOH,GAEpE,MAAMgB,EAA4CD,QAArBA,EAAGP,EAAQG,sBAAUI,SAAlBA,EAAoBE,WAAW,GAE3DD,IACFA,EAAWd,UAAUE,IAAIH,GACzBe,EAAWd,UAAUC,OAAOH,GAC9B,KAIR,4GAEgCkB,CAACnC,EAAkBE,KACjD,IAAIkC,EAA0BpC,IAAU,EAEhB,oBAAbH,eAAuCD,IAAXI,IACrCoC,EAAiBvC,SAASC,KAAKqB,UAAUkB,SAASxB,EAAWC,OAE/DX,EAAiBiC,EAAgBlC,GAAeL,SAASC,KAAK,6BA3D9B,WAG7B,IAFHL,EAAiCC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,IAAMG,SAASC,KACnDC,EAAyCL,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIM,GAAAA,GAAoBA,EAEjEsC,aAAU,IAAM9C,EAAuBC,EAAgBM,IAAiB,CAACN,EAAgBM,GAC3F"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),o=require("../../../hooks/useParseProps.js"),s=require("./layoutBox.types.js"),a=require("./layoutBox.module.scss.js");const r={start:"flex-start","flex-start":"flex-start",end:"flex-end","flex-end":"flex-end"},l=e=>e&&r[e]||e,n=t.forwardRef(((r,n)=>{let{id:i,style:u,children:d,tabIndex:c,className:x="",onClick:y,column:f,...m}=r;const{dataProps:p,restProps:j}=o.useParseProps(m),P=t.useMemo((()=>y?{onClick:y,onKeyDown:y,role:"button",tabIndex:-1}:{}),[y]),b=t.useMemo((()=>void 0!==f&&!0===f?s.LayoutDirection.COLUMN:null),[f]),B=t.useMemo((()=>({...j,...j.align?{alignItems:l(j.align)}:{},...j.justify?{justifyContent:l(j.justify)}:{},...j.direction||b?{flexDirection:j.direction||b}:{},...u})),[b,j,u]);return React.createElement("div",e.extends({},i?{id:"".concat(i)}:{},{ref:n,tabIndex:c,className:"".concat(a.default["layout-box"]," ").concat(x),style:B},p,{"data-testid":p.dataTestId||p["data-testid"]||i},P),d)}));n.displayName="LayoutBoxRefForwarded";const i=t.memo(n);i.displayName="LayoutBox",exports.LayoutBox=i;
|
|
2
2
|
//# sourceMappingURL=LayoutBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutBox.js","sources":["../../../../../../../../src/core/ui/components/container/LayoutBox.tsx"],"sourcesContent":["import { memo, FC, useMemo, CSSProperties, forwardRef, LegacyRef } from 'react'\n\nimport { useParseProps } from '../../../hooks/useParseProps'\n\nimport { LayoutDirection, LayoutBoxProps } from './layoutBox.types'\nimport classes from './layoutBox.module.scss'\n\n\n/**\n * Map of flex values for resolving flex alignment and justification.\n * @type {Record<string, string>}\n */\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\n/**\n * Resolves flex alignment and justification properties based on the provided value.\n * @param {string | undefined} value - The value to resolve.\n * @returns {string | undefined} - Resolved flex property value.\n */\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\n/**\n * Forwarded ref version of the LayoutBox component.\n * @param {LayoutBoxProps} props - Props for the LayoutBox component.\n * @param {LegacyRef<HTMLDivElement> | undefined} ref - Ref for accessing the underlying DOM element.\n * @returns {JSX.Element} - Rendered LayoutBox component.\n */\nconst LayoutBoxRefForwarded = forwardRef(({\n id, style, children, tabIndex, className = '', onClick, column, ...props\n}: LayoutBoxProps, ref: LegacyRef<HTMLDivElement> | undefined) => {\n const { dataProps, restProps } = useParseProps(props)\n\n /**\n * Memoized onClick event properties.\n * @type {{ onClick?: () => void; onKeyDown?: () => void; role?: string; tabIndex?: number }}\n */\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n /**\n * Memoized resolved direction based on the column prop.\n * @type {LayoutDirection}\n */\n const resolvedColumn = useMemo(() => ((\n column !== undefined && column === true)\n ? LayoutDirection.COLUMN\n : null), [column])\n\n /**\n * Memoized styles combining parsed props and additional styles.\n * @type {CSSProperties}\n */\n const styles = useMemo(() => (\n {\n ...restProps,\n ...(restProps.align ? { alignItems: resolveFlexProps(restProps.align as string) } : {}),\n ...(restProps.justify ? { justifyContent: resolveFlexProps(restProps.justify as string) } : {}),\n ...(restProps.direction || resolvedColumn ? { flexDirection: restProps.direction || resolvedColumn } : {}),\n ...style,\n }\n ), [resolvedColumn, restProps, style])\n\n return (\n <div\n {...(id ? { id: `${id}` } : {})}\n ref={ref}\n tabIndex={tabIndex}\n className={`${(classes as any)['
|
|
1
|
+
{"version":3,"file":"LayoutBox.js","sources":["../../../../../../../../src/core/ui/components/container/LayoutBox.tsx"],"sourcesContent":["import { memo, FC, useMemo, CSSProperties, forwardRef, LegacyRef } from 'react'\n\nimport { useParseProps } from '../../../hooks/useParseProps'\n\nimport { LayoutDirection, LayoutBoxProps } from './layoutBox.types'\nimport classes from './layoutBox.module.scss'\n\n\n/**\n * Map of flex values for resolving flex alignment and justification.\n * @type {Record<string, string>}\n */\nconst flexValueMap: Record<string, string> = {\n start: 'flex-start',\n 'flex-start': 'flex-start',\n end: 'flex-end',\n 'flex-end': 'flex-end',\n}\n\n/**\n * Resolves flex alignment and justification properties based on the provided value.\n * @param {string | undefined} value - The value to resolve.\n * @returns {string | undefined} - Resolved flex property value.\n */\nconst resolveFlexProps = (value?: string): string | undefined => (value ? (flexValueMap[value] || value) : value)\n\n/**\n * Forwarded ref version of the LayoutBox component.\n * @param {LayoutBoxProps} props - Props for the LayoutBox component.\n * @param {LegacyRef<HTMLDivElement> | undefined} ref - Ref for accessing the underlying DOM element.\n * @returns {JSX.Element} - Rendered LayoutBox component.\n */\nconst LayoutBoxRefForwarded = forwardRef(({\n id, style, children, tabIndex, className = '', onClick, column, ...props\n}: LayoutBoxProps, ref: LegacyRef<HTMLDivElement> | undefined) => {\n const { dataProps, restProps } = useParseProps(props)\n\n /**\n * Memoized onClick event properties.\n * @type {{ onClick?: () => void; onKeyDown?: () => void; role?: string; tabIndex?: number }}\n */\n const onClickProps = useMemo(() => (onClick ? ({\n onClick,\n onKeyDown: onClick,\n role: 'button',\n tabIndex: -1,\n }) : {}), [onClick])\n\n /**\n * Memoized resolved direction based on the column prop.\n * @type {LayoutDirection}\n */\n const resolvedColumn = useMemo(() => ((\n column !== undefined && column === true)\n ? LayoutDirection.COLUMN\n : null), [column])\n\n /**\n * Memoized styles combining parsed props and additional styles.\n * @type {CSSProperties}\n */\n const styles = useMemo(() => (\n {\n ...restProps,\n ...(restProps.align ? { alignItems: resolveFlexProps(restProps.align as string) } : {}),\n ...(restProps.justify ? { justifyContent: resolveFlexProps(restProps.justify as string) } : {}),\n ...(restProps.direction || resolvedColumn ? { flexDirection: restProps.direction || resolvedColumn } : {}),\n ...style,\n }\n ), [resolvedColumn, restProps, style])\n\n return (\n <div\n {...(id ? { id: `${id}` } : {})}\n ref={ref}\n tabIndex={tabIndex}\n className={`${(classes as any)['layout-box']} ${className}`}\n style={styles as CSSProperties}\n {...dataProps}\n data-testid={dataProps.dataTestId || dataProps['data-testid'] || id}\n {...onClickProps}\n >\n {children}\n </div>\n )\n})\n\nLayoutBoxRefForwarded.displayName = 'LayoutBoxRefForwarded'\n\n/**\n * Memoized and memoized LayoutBox component.\n * @type {FC<LayoutBoxProps>}\n */\nexport const LayoutBox: FC<LayoutBoxProps> = memo<LayoutBoxProps>(LayoutBoxRefForwarded)\n\nLayoutBox.displayName = 'LayoutBox'\n"],"names":["flexValueMap","start","end","resolveFlexProps","value","LayoutBoxRefForwarded","forwardRef","_ref","ref","id","style","children","tabIndex","className","onClick","column","props","dataProps","restProps","useParseProps","onClickProps","useMemo","onKeyDown","role","resolvedColumn","undefined","LayoutDirection","COLUMN","styles","align","alignItems","justify","justifyContent","direction","flexDirection","React","createElement","_extends","concat","classes","dataTestId","displayName","LayoutBox","memo"],"mappings":"oRAYA,MAAMA,EAAuC,CAC3CC,MAAO,aACP,aAAc,aACdC,IAAK,WACL,WAAY,YAQRC,EAAoBC,GAAwCA,GAASJ,EAAaI,IAAmBA,EAQrGC,EAAwBC,EAAUA,YAAC,CAAAC,EAEtBC,KAA+C,IAFxBC,GACxCA,EAAEC,MAAEA,EAAKC,SAAEA,EAAQC,SAAEA,EAAQC,UAAEA,EAAY,GAAEC,QAAEA,EAAOC,OAAEA,KAAWC,GACpDT,EACf,MAAMU,UAAEA,EAASC,UAAEA,GAAcC,EAAAA,cAAcH,GAMzCI,EAAeC,WAAQ,IAAOP,EAAW,CAC7CA,UACAQ,UAAWR,EACXS,KAAM,SACNX,UAAW,GACR,CAAG,GAAE,CAACE,IAMLU,EAAiBH,EAAOA,SAAC,SAClBI,IAAXV,IAAmC,IAAXA,EACtBW,EAAAA,gBAAgBC,OAChB,MAAO,CAACZ,IAMNa,EAASP,EAAAA,SAAQ,KACrB,IACKH,KACCA,EAAUW,MAAQ,CAAEC,WAAY3B,EAAiBe,EAAUW,QAAqB,MAChFX,EAAUa,QAAU,CAAEC,eAAgB7B,EAAiBe,EAAUa,UAAuB,MACxFb,EAAUe,WAAaT,EAAiB,CAAEU,cAAehB,EAAUe,WAAaT,GAAmB,MACpGd,KAEJ,CAACc,EAAgBN,EAAWR,IAE/B,OACEyB,MAAAC,oBAAAC,EAAAA,QAAA,CAAA,EACO5B,EAAK,CAAEA,GAAE,GAAA6B,OAAK7B,IAAS,GAAE,CAC9BD,IAAKA,EACLI,SAAUA,EACVC,UAAS,GAAAyB,OAAMC,EAAO,QAAS,cAAaD,KAAAA,OAAIzB,GAChDH,MAAOkB,GACHX,EAAS,CACb,cAAaA,EAAUuB,YAAcvB,EAAU,gBAAkBR,GAC7DW,GAEHT,EACG,IAIVN,EAAsBoC,YAAc,8BAMvBC,EAAgCC,EAAIA,KAAiBtC,GAElEqC,EAAUD,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={"layout-box":"layoutBox-module_layout-box__faPND"};
|
|
2
2
|
//# sourceMappingURL=layoutBox.module.scss.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var t,i=require("../../../utils/webComponents/webComponent.utils.js"),e=require("./icon.module.scss.js");const s=document.createElement("template");s.innerHTML='<span class="icon-base"></span>';let n=i.ced("icon-base")(t=class t extends HTMLElement{constructor(){super(...arguments),this.content=void 0,this.mainElement=void 0,this.iconUrl=void 0,this.minWidth=void 0,this.minHeight=void 0,this.width=void 0,this.height=void 0,this.size=void 0,this.fontSize=void 0,this.color=void 0,this.render=()=>{if(this.mainElement=this.mainElement||this.querySelector(".icon-base"),!this.mainElement)return;this.classList.add(e.default["icon-base-parent"]),this.mainElement.classList.add(e.default["icon-base"]);const t={"--min-width":this.minWidth||this.size||this.width||"auto","--min-height":this.minHeight||this.size||this.height||"auto","--width":this.size||this.width||"1rem","--height":this.size||this.height||"1rem",...this.fontSize?{"font-size":this.fontSize||"unset"}:{},...this.iconUrl?{"--icon-url":"url(".concat(this.iconUrl,")")}:{},...this.iconUrl?{"--icon-color":this.color}:{"--icon-content-color":this.color}};this.mainElement.innerHTML=this.iconUrl?"":this.content||"",this.mainElement.setAttribute("style",Object.entries(t).map((t=>{let[i,e]=t;return"".concat(i,": ").concat(e,";")})).join(" "))}}static get observedAttributes(){return["iconUrl","minWidth","minHeight","width","height","size","fontSize","color","className"]}connectedCallback(){(this.content||this.innerHTML)&&(this.content=this.content||this.innerHTML||this.getAttribute("content")),this.innerHTML=s.innerHTML,i.resolveAttributes(this,t.observedAttributes),this.render()}attributeChangedCallback(t,i,e){"className"!==t&&"classname"!==t&&"class"!==t||"string"==typeof e&&(this.classList.remove(e),this.classList.add(e)),this.color||(this.color="currentColor"),this[t]=e||"",this.render()}})||t;const o={
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var t,i=require("../../../utils/webComponents/webComponent.utils.js"),e=require("./icon.module.scss.js");const s=document.createElement("template");s.innerHTML='<span class="icon-base"></span>';let n=i.ced("icon-base")(t=class t extends HTMLElement{constructor(){super(...arguments),this.content=void 0,this.mainElement=void 0,this.iconUrl=void 0,this.minWidth=void 0,this.minHeight=void 0,this.width=void 0,this.height=void 0,this.size=void 0,this.fontSize=void 0,this.color=void 0,this.render=()=>{if(this.mainElement=this.mainElement||this.querySelector(".icon-base"),!this.mainElement)return;this.classList.add(e.default["icon-base-parent"]),this.mainElement.classList.add(e.default["icon-base"]);const t={"--min-width":this.minWidth||this.size||this.width||"auto","--min-height":this.minHeight||this.size||this.height||"auto","--width":this.size||this.width||"1rem","--height":this.size||this.height||"1rem",...this.fontSize?{"font-size":this.fontSize||"unset"}:{},...this.iconUrl?{"--icon-url":"url(".concat(this.iconUrl,")")}:{},...this.iconUrl?{"--icon-color":this.color}:{"--icon-content-color":this.color}};this.mainElement.innerHTML=this.iconUrl?"":this.content||"",this.mainElement.setAttribute("style",Object.entries(t).map((t=>{let[i,e]=t;return"".concat(i,": ").concat(e,";")})).join(" "))}}static get observedAttributes(){return["iconUrl","minWidth","minHeight","width","height","size","fontSize","color","className"]}connectedCallback(){(this.content||this.innerHTML)&&(this.content=this.content||this.innerHTML||this.getAttribute("content")),this.innerHTML=s.innerHTML,i.resolveAttributes(this,t.observedAttributes),this.render()}attributeChangedCallback(t,i,e){"className"!==t&&"classname"!==t&&"class"!==t||"string"==typeof e&&(this.classList.remove(e),this.classList.add(e)),this.color||(this.color="currentColor"),this[t]=e||"",this.render()}})||t;const o={ESIconBase:n};exports.ESIcon=n,exports.ESIconBase=o;
|
|
2
2
|
//# sourceMappingURL=IconWC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWC.js","sources":["../../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class
|
|
1
|
+
{"version":3,"file":"IconWC.js","sources":["../../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class ESIcon extends HTMLElement {\n content: string | null\n\n mainElement: HTMLElement\n\n iconUrl?: string | null\n\n minWidth?: string | null\n\n minHeight?: string | null\n\n width?: string | null\n\n height?: string | null\n\n size?: string | null\n\n fontSize?: string | null\n\n color?: string | null\n\n static get observedAttributes() {\n return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'fontSize', 'color', 'className']\n }\n\n connectedCallback() {\n if (this.content || this.innerHTML) {\n this.content = this.content || this.innerHTML || this.getAttribute('content')\n }\n\n this.innerHTML = template.innerHTML\n\n resolveAttributes(this, ESIcon.observedAttributes)\n\n this.render()\n }\n\n attributeChangedCallback(attrName: string, oldVal: string | number | null, newVal: string | number | null) {\n if (attrName === 'className' || attrName === 'classname' || attrName === 'class') {\n if (typeof newVal === 'string') {\n this.classList.remove(newVal as string)\n this.classList.add(newVal as string)\n }\n }\n if (!this.color) {\n this.color = 'currentColor'\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[attrName] = (newVal as string) || ''\n this.render()\n }\n\n render = () => {\n this.mainElement = this.mainElement || this.querySelector('.icon-base') as HTMLElement\n if (!this.mainElement) {\n return\n }\n this.classList.add(classes['icon-base-parent'])\n this.mainElement.classList.add(classes['icon-base'])\n\n const styles = {\n '--min-width': this.minWidth || this.size || this.width || 'auto',\n '--min-height': this.minHeight || this.size || this.height || 'auto',\n '--width': this.size || this.width || '1rem',\n '--height': this.size || this.height || '1rem',\n ...(this.fontSize ? { 'font-size': this.fontSize || 'unset' } : {}),\n ...(this.iconUrl ? { '--icon-url': `url(${this.iconUrl})` } : {}),\n ...(this.iconUrl ? { '--icon-color': this.color } : { '--icon-content-color': this.color }),\n }\n\n this.mainElement.innerHTML = this.iconUrl ? '' : (this.content || '')\n\n this.mainElement.setAttribute('style', Object.entries(styles).map(([key, value]) => `${key}: ${value};`).join(' '))\n }\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'icon-base': any\n }\n }\n}\n\nexport const ESIconBase = {\n ESIconBase: ESIcon,\n}\n"],"names":["template","document","createElement","innerHTML","ESIcon","ced","_dec","_class","HTMLElement","constructor","super","arguments","this","content","mainElement","iconUrl","minWidth","minHeight","width","height","size","fontSize","color","render","querySelector","classList","add","classes","styles","concat","setAttribute","Object","entries","map","_ref","key","value","join","observedAttributes","connectedCallback","getAttribute","resolveAttributes","attributeChangedCallback","attrName","oldVal","newVal","remove","ESIconBase"],"mappings":"oQAKA,MAAMA,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,kCAcrB,IACaC,EADZC,EAAAA,IAAI,YAAYC,CAAAC,EAAjB,MACaH,UAAeI,YAAYC,WAAAA,GAAAC,SAAAC,WAAAC,KACtCC,aAAO,EAAAD,KAEPE,iBAAW,EAAAF,KAEXG,aAAO,EAAAH,KAEPI,cAAQ,EAAAJ,KAERK,eAAS,EAAAL,KAETM,WAAK,EAAAN,KAELO,YAAM,EAAAP,KAENQ,UAAI,EAAAR,KAEJS,cAAQ,EAAAT,KAERU,WAAK,EAAAV,KAkCLW,OAAS,KAEP,GADAX,KAAKE,YAAcF,KAAKE,aAAeF,KAAKY,cAAc,eACrDZ,KAAKE,YACR,OAEFF,KAAKa,UAAUC,IAAIC,EAAAA,QAAQ,qBAC3Bf,KAAKE,YAAYW,UAAUC,IAAIC,EAAO,QAAC,cAEvC,MAAMC,EAAS,CACb,cAAehB,KAAKI,UAAYJ,KAAKQ,MAAQR,KAAKM,OAAS,OAC3D,eAAgBN,KAAKK,WAAaL,KAAKQ,MAAQR,KAAKO,QAAU,OAC9D,UAAWP,KAAKQ,MAAQR,KAAKM,OAAS,OACtC,WAAYN,KAAKQ,MAAQR,KAAKO,QAAU,UACpCP,KAAKS,SAAW,CAAE,YAAaT,KAAKS,UAAY,SAAY,MAC5DT,KAAKG,QAAU,CAAE,aAAYc,OAAAA,OAASjB,KAAKG,QAAO,MAAQ,MAC1DH,KAAKG,QAAU,CAAE,eAAgBH,KAAKU,OAAU,CAAE,uBAAwBV,KAAKU,QAGrFV,KAAKE,YAAYX,UAAYS,KAAKG,QAAU,GAAMH,KAAKC,SAAW,GAElED,KAAKE,YAAYgB,aAAa,QAASC,OAAOC,QAAQJ,GAAQK,KAAIC,IAAA,IAAEC,EAAKC,GAAMF,EAAA,MAAA,GAAAL,OAAQM,EAAGN,MAAAA,OAAKO,EAAK,IAAA,IAAKC,KAAK,KAAK,CACpH,CArDD,6BAAWC,GACT,MAAO,CAAC,UAAW,WAAY,YAAa,QAAS,SAAU,OAAQ,WAAY,QAAS,YAC9F,CAEAC,iBAAAA,IACM3B,KAAKC,SAAWD,KAAKT,aACvBS,KAAKC,QAAUD,KAAKC,SAAWD,KAAKT,WAAaS,KAAK4B,aAAa,YAGrE5B,KAAKT,UAAYH,EAASG,UAE1BsC,EAAAA,kBAAkB7B,KAAMR,EAAOkC,oBAE/B1B,KAAKW,QACP,CAEAmB,wBAAAA,CAAyBC,EAAkBC,EAAgCC,GACxD,cAAbF,GAAyC,cAAbA,GAAyC,UAAbA,GACpC,iBAAXE,IACTjC,KAAKa,UAAUqB,OAAOD,GACtBjC,KAAKa,UAAUC,IAAImB,IAGlBjC,KAAKU,QACRV,KAAKU,MAAQ,gBAIfV,KAAK+B,GAAaE,GAAqB,GACvCjC,KAAKW,QACP,KAwBDhB,EAWM,MAAMwC,EAAa,CACxBA,WAAY3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./core/hooks/useApi.js"),r=require("./core/hooks/useToggle.js"),t=require("./core/hooks/useTranslations.js"),o=require("./core/hooks/useOutsideClick.js"),s=require("./core/hooks/useResize.js"),i=require("./core/hooks/useClassNames.js"),a=require("./core/hooks/useParseProps.js"),l=require("./core/hooks/useThemePreference.js"),p=require("./core/utils/helpers/birthnumber.validator.js"),n=require("./core/utils/helpers/birthnumberCZSKvalidator.js"),c=require("./core/utils/helpers/fileValidator.js"),u=require("./core/utils/helpers/date.js"),x=require("./core/utils/helpers/deviceInfo.js"),m=require("./core/utils/helpers/emailMatcher.js"),d=require("./core/utils/helpers/file.js"),h=require("./core/utils/helpers/objectOperations.js"),T=require("./core/utils/helpers/other.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./core/hooks/useApi.js"),r=require("./core/hooks/useToggle.js"),t=require("./core/hooks/useTranslations.js"),o=require("./core/hooks/useOutsideClick.js"),s=require("./core/hooks/useResize.js"),i=require("./core/hooks/useClassNames.js"),a=require("./core/hooks/useParseProps.js"),l=require("./core/hooks/useThemePreference.js"),p=require("./core/utils/helpers/birthnumber.validator.js"),n=require("./core/utils/helpers/birthnumberCZSKvalidator.js"),c=require("./core/utils/helpers/fileValidator.js"),u=require("./core/utils/helpers/date.js"),x=require("./core/utils/helpers/deviceInfo.js"),m=require("./core/utils/helpers/emailMatcher.js"),d=require("./core/utils/helpers/file.js"),h=require("./core/utils/helpers/objectOperations.js"),T=require("./core/utils/helpers/other.js"),j=require("./core/utils/helpers/textValueOperations.js"),C=require("./core/utils/helpers/valueOperations.js"),S=require("./core/utils/helpers/cancelableDelayedFunction.js"),v=require("./core/utils/helpers/ui.js"),b=require("./core/utils/keyExtractor.js"),g=require("./core/utils/date.js"),F=require("./core/utils/webComponents/webComponent.utils.js"),q=require("./core/utils/appState/store/store.vanillajs.js"),f=require("./core/utils/appState/store/store.vanillajs.templates.js"),y=require("./core/utils/appState/store/useStore.react.js"),D=require("./core/constants/ui.constants.js"),I=require("./core/ui/utils/style.js"),z=require("./core/ui/components/container/LayoutBox.js"),O=require("./core/ui/components/container/layoutBox.types.js"),P=require("./core/ui/components/container/Flex.js"),V=require("./core/ui/components/container/Placeholder.js"),N=require("./core/ui/components/container/CollapsibleContainer.js"),k=require("./core/ui/components/container/ResizableContainer.js"),R=require("./core/ui/components/field/Field.js"),E=require("./core/ui/components/dividers/DividerLine.js"),L=require("./core/ui/components/icon/IconBase.js"),A=require("./core/ui/components/icon/Icon.js"),B=require("./core/ui/components/icon/IconWC.js");exports.useApi=e.useApi,exports.useToggle=r.useToggle,exports.createSafeT=t.createSafeT,exports.setUseTranslation=t.setUseTranslation,exports.useTranslations=t.useTranslations,exports.outsideClickHandler=o.outsideClickHandler,exports.useOutsideClick=o.useOutsideClick,exports.useResize=s.useResize,exports.useClassNames=i.useClassNames,exports.useParseProps=a.useParseProps,exports.baseThemes=l.baseThemes,exports.observeThemePreference=l.observeThemePreference,exports.switchColorTheme=l.switchColorTheme,exports.updateColorTheme=l.updateColorTheme,exports.useThemePreference=l.useThemePreference,exports.isBirthNumberValid=p.isBirthNumberValid,exports.getMatch=n.getMatch,exports.isValidFormat=n.isValidFormat,exports.isValidModulo11=n.isValidModulo11,exports.parse=n.parse,exports.regex=n.regex,exports.parseCSVdata=c.parseCSVdata,exports.validateCSVFile=c.validateCSVFile,exports.validateCSVlines=c.validateCSVlines,exports.validateJSONFile=c.validateJSONFile,exports.validateLineCellTrimmed=c.validateLineCellTrimmed,exports.validateLineNumColumns=c.validateLineNumColumns,exports.validateSDFFile=c.validateSDFFile,exports.DATE_FORMAT=u.DATE_FORMAT,exports.formatDateToTimestamp=u.formatDateToTimestamp,exports.getDate=u.getDate,exports.getDeviceId=x.getDeviceId,exports.emailMatch=m.emailMatch,exports.emailMatcher=m.emailMatcher,exports.regexBuilder=m.regexBuilder,exports.cleanCsvLines=d.cleanCsvLines,exports.formatFilePath=d.formatFilePath,exports.arrayToObjectTree=h.arrayToObjectTree,exports.chunkArray=h.chunkArray,exports.duplicatesInArray=h.duplicatesInArray,exports.formatJsonString=h.formatJsonString,exports.formatObj=h.formatObj,exports.formatObj2=h.formatObj2,exports.debounce=T.debounce,exports.delay=T.delay,exports.memoize=T.memoize,exports.memoizeComplex=T.memoizeComplex,exports.memoizer=T.memoizer,exports.nestedTernary=T.nestedTernary,exports.escapeRegExp=j.escapeRegExp,exports.fileNameExt=j.fileNameExt,exports.findStringInText=j.findStringInText,exports.normalizeString=j.normalizeString,exports.removeWhitespaces=j.removeWhitespaces,exports.sanitizeId=j.sanitizeId,exports.sanitizePathId=j.sanitizePathId,exports.toLowerCase=j.toLowerCase,exports.toUpperCase=j.toUpperCase,exports.truncateText=j.truncateText,exports.Operation=C.Operation,exports.decrementValue=C.decrementValue,exports.incerementValue=C.incerementValue,exports.numberDefined=C.numberDefined,exports.numberOperation=C.numberOperation,exports.restrictNumberInLimits=C.restrictNumberInLimits,exports.setValue=C.setValue,exports.cancelableSetInterval=S.cancelableSetInterval,exports.cancelableSetTimeout=S.cancelableSetTimeout,exports.classNames=v.classNames,exports.mapSerReplacer=v.mapSerReplacer,exports.noop=v.noop,exports.parseProps=v.parseProps,exports.keyExtractor=b.keyExtractor,exports.keyExtractorFunction=b.keyExtractorFunction,exports.dateRangeFormat=g.dateRangeFormat,exports.getDateTime=g.getDateTime,exports.getTimeFromNow=g.getTimeFromNow,exports.getTimeFromNowOriginal=g.getTimeFromNowOriginal,exports.getTimeTo=g.getTimeTo,exports.ced=F.ced,exports.createResolveAttribute=F.createResolveAttribute,exports.customElementDefine=F.customElementDefine,exports.resolveAttributes=F.resolveAttributes,exports.createStore=q.createStore,exports.createDataStore=f.createDataStore,exports.useStore=y.useStore,exports.useStoreApi=y.useStoreApi,exports.EventName=D.EventName,exports.calculateColors=I.calculateColors,exports.calculatePercColor=I.calculatePercColor,exports.convertHex=I.convertHex,exports.convertRGB=I.convertRGB,Object.defineProperty(exports,"defaultFontSize",{enumerable:!0,get:function(){return I.defaultFontSize}}),exports.pxToRem=I.pxToRem,exports.resolveStyleValue=I.resolveStyleValue,exports.setDefaultFontSize=I.setDefaultFontSize,exports.toHex=I.toHex,exports.LayoutBox=z.LayoutBox,exports.LayoutDirection=O.LayoutDirection,exports.Flex=P.Flex,exports.FlexTight=P.FlexTight,exports.FlexTightStyled=P.FlexTightStyled,exports.FlexWrapper=P.FlexWrapper,exports.Placeholder=V.Placeholder,exports.CollapsibleContainer=N.CollapsibleContainer,exports.ResizableContainer=k.ResizableContainer,exports.Field=R.Field,exports.FieldWrapper=R.FieldWrapper,exports.Select=R.Select,exports.setIconColor=R.setIconColor,exports.setIconComponent=R.setIconComponent,exports.DividerHorizontal=E.DividerHorizontal,exports.DividerLine=E.DividerLine,exports.DividerVertical=E.DividerVertical,exports.IconBase=L.IconBase,exports.Icon=A.Icon,exports.ESIcon=B.ESIcon,exports.ESIconBase=B.ESIconBase;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/esm/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEffect as e}from"react";const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const c=o=>{const c=e();null==r||r(o,c),null==t||t(o)},d=e=>{c(e.matches)},l=e=>{c(!e.matches)},s=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}catch(e){}return c(null==s?void 0:s.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").addEventListener(o,l),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}},c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;e((()=>t(o,c)),[o,c])},d={dark:"theme-dark",light:"theme-light"},r=function(e,o){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const c=e?d.light:d.dark,r=e?d.dark:d.light;o&&(o.classList.remove(c),o.classList.remove(r),o.classList.add(r)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(c)).forEach((e=>{e.classList.add(".".concat(r)),e.classList.remove(".".concat(c))})),t&&(document.querySelectorAll(".shadow-div").forEach((e=>{var o,t;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c)})),document.querySelectorAll("
|
|
1
|
+
import{useEffect as e}from"react";const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const c=o=>{const c=e();null==r||r(o,c),null==t||t(o)},d=e=>{c(e.matches)},l=e=>{c(!e.matches)},s=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}catch(e){}return c(null==s?void 0:s.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").addEventListener(o,l),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}},c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;e((()=>t(o,c)),[o,c])},d={dark:"theme-dark",light:"theme-light"},r=function(e,o){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const c=e?d.light:d.dark,r=e?d.dark:d.light;o&&(o.classList.remove(c),o.classList.remove(r),o.classList.add(r)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(c)).forEach((e=>{e.classList.add(".".concat(r)),e.classList.remove(".".concat(c))})),t&&(document.querySelectorAll(".shadow-div").forEach((e=>{var o,t;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c)})),document.querySelectorAll("esmf-wrapper").forEach((e=>{var o,t,d;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c);const l=null===(d=e.shadowRoot)||void 0===d?void 0:d.childNodes[0];l&&(l.classList.add(r),l.classList.remove(c))}))))},l=(e,o)=>{let t=e||!1;"undefined"!=typeof document&&void 0===e&&(t=document.body.classList.contains(d.dark)),r(t,o||document.body)};export{d as baseThemes,t as observeThemePreference,r as switchColorTheme,l as updateColorTheme,c as useThemePreference};
|
|
2
2
|
//# sourceMappingURL=useThemePreference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\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\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\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('
|
|
1
|
+
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\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\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\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\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement) => {\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"],"names":["windowMatchMediaChangeEventType","observeThemePreference","getHtmlElement","arguments","length","undefined","document","body","switchCallback","isDark","switchColorThemeHandler","htmlElement","switchColorTheme","changeDarkColorThemeHandler","event","matches","changeLightColorThemeHandler","window","matchMedia","removeEventListener","error","addEventListener","useThemePreference","useEffect","baseThemes","dark","light","findShadows","oldClass","newClass","classList","remove","add","querySelectorAll","concat","forEach","element","_element$shadowRoot","_element$shadowRoot2","shadowRoot","querySelector","_element$shadowRoot3","_element$shadowRoot4","_element$shadowRoot5","firstChild","childNodes","updateColorTheme","resolvedIsDark","contains"],"mappings":"kCAGA,MAAMA,EAAkC,SAE3BC,EAAyB,WAGjC,IAFHC,EAAiCC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAA,GAAG,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,EAAiBmC,EAAgBpC,GAAeL,SAASC,KAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{extends as t}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{memo as e,forwardRef as o,useMemo as a}from"react";import{useParseProps as s}from"../../../hooks/useParseProps.js";import{LayoutDirection as l}from"./layoutBox.types.js";import r from"./layoutBox.module.scss.js";const n={start:"flex-start","flex-start":"flex-start",end:"flex-end","flex-end":"flex-end"},i=t=>t&&n[t]||t,d=o(((e,o)=>{let{id:n,style:d,children:c,tabIndex:
|
|
1
|
+
import{extends as t}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{memo as e,forwardRef as o,useMemo as a}from"react";import{useParseProps as s}from"../../../hooks/useParseProps.js";import{LayoutDirection as l}from"./layoutBox.types.js";import r from"./layoutBox.module.scss.js";const n={start:"flex-start","flex-start":"flex-start",end:"flex-end","flex-end":"flex-end"},i=t=>t&&n[t]||t,d=o(((e,o)=>{let{id:n,style:d,children:c,tabIndex:m,className:f="",onClick:u,column:x,...p}=e;const{dataProps:y,restProps:j}=s(p),b=a((()=>u?{onClick:u,onKeyDown:u,role:"button",tabIndex:-1}:{}),[u]),B=a((()=>void 0!==x&&!0===x?l.COLUMN:null),[x]),I=a((()=>({...j,...j.align?{alignItems:i(j.align)}:{},...j.justify?{justifyContent:i(j.justify)}:{},...j.direction||B?{flexDirection:j.direction||B}:{},...d})),[B,j,d]);return React.createElement("div",t({},n?{id:"".concat(n)}:{},{ref:o,tabIndex:m,className:"".concat(r["layout-box"]," ").concat(f),style:I},y,{"data-testid":y.dataTestId||y["data-testid"]||n},b),c)}));d.displayName="LayoutBoxRefForwarded";const c=e(d);c.displayName="LayoutBox";export{c as LayoutBox};
|
|
2
2
|
//# sourceMappingURL=LayoutBox.js.map
|