@xanui/core 1.2.42 → 1.2.44
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/AppRoot/{context.js → AppRootProvider.cjs} +1 -1
- package/AppRoot/AppRootProvider.cjs.map +1 -0
- package/AppRoot/{context.mjs → AppRootProvider.js} +1 -1
- package/AppRoot/AppRootProvider.js.map +1 -0
- package/AppRoot/Renderar.cjs +89 -0
- package/AppRoot/Renderar.cjs.map +1 -0
- package/AppRoot/Renderar.d.ts +1 -0
- package/AppRoot/Renderar.js +52 -20
- package/AppRoot/Renderar.js.map +1 -1
- package/AppRoot/index.cjs +43 -0
- package/AppRoot/index.cjs.map +1 -0
- package/AppRoot/index.d.ts +2 -2
- package/AppRoot/index.js +24 -106
- package/AppRoot/index.js.map +1 -1
- package/Document/index.cjs +21 -0
- package/Document/index.cjs.map +1 -0
- package/Document/index.d.ts +7 -1
- package/Document/index.js +8 -11
- package/Document/index.js.map +1 -1
- package/Iframe/index.cjs +45 -0
- package/Iframe/index.cjs.map +1 -0
- package/Iframe/index.d.ts +1 -0
- package/Iframe/index.js +23 -25
- package/Iframe/index.js.map +1 -1
- package/Tag/ServerStyleTag.cjs +13 -0
- package/Tag/{ServerStyleTag.mjs.map → ServerStyleTag.cjs.map} +1 -1
- package/Tag/ServerStyleTag.js +3 -5
- package/Tag/ServerStyleTag.js.map +1 -1
- package/Tag/{cssPropList.mjs → cssPropList.cjs} +4 -2
- package/Tag/cssPropList.cjs.map +1 -0
- package/Tag/cssPropList.js +1 -3
- package/Tag/cssPropList.js.map +1 -1
- package/Tag/index.cjs +40 -0
- package/Tag/{index.mjs.map → index.cjs.map} +1 -1
- package/Tag/index.js +10 -31
- package/Tag/index.js.map +1 -1
- package/Tag/{useTagProps.mjs → useTagProps.cjs} +18 -13
- package/Tag/useTagProps.cjs.map +1 -0
- package/Tag/useTagProps.js +15 -14
- package/Tag/useTagProps.js.map +1 -1
- package/Transition/index.cjs +29 -0
- package/Transition/{index.mjs.map → index.cjs.map} +1 -1
- package/Transition/index.js +13 -15
- package/Transition/index.js.map +1 -1
- package/breakpoint/BreakpointProvider.cjs +43 -0
- package/breakpoint/{BreakpointProvider.mjs.map → BreakpointProvider.cjs.map} +1 -1
- package/breakpoint/BreakpointProvider.js +13 -16
- package/breakpoint/BreakpointProvider.js.map +1 -1
- package/breakpoint/useBreakpoint.cjs +24 -0
- package/breakpoint/{useBreakpoint.mjs.map → useBreakpoint.cjs.map} +1 -1
- package/breakpoint/useBreakpoint.js +7 -9
- package/breakpoint/useBreakpoint.js.map +1 -1
- package/breakpoint/{useBreakpointProps.mjs → useBreakpointProps.cjs} +8 -6
- package/breakpoint/useBreakpointProps.cjs.map +1 -0
- package/breakpoint/useBreakpointProps.js +5 -7
- package/breakpoint/useBreakpointProps.js.map +1 -1
- package/css/CSSCacheProvider.cjs +34 -0
- package/css/CSSCacheProvider.cjs.map +1 -0
- package/css/CSSCacheProvider.d.ts +7 -0
- package/css/CSSCacheProvider.js +29 -0
- package/css/CSSCacheProvider.js.map +1 -0
- package/css/{aliases.mjs → aliases.cjs} +4 -2
- package/css/aliases.cjs.map +1 -0
- package/css/aliases.js +1 -3
- package/css/aliases.js.map +1 -1
- package/css/{getProps.mjs → getProps.cjs} +4 -2
- package/css/{getProps.mjs.map → getProps.cjs.map} +1 -1
- package/css/getProps.js +1 -3
- package/css/getProps.js.map +1 -1
- package/css/{getValue.mjs → getValue.cjs} +4 -2
- package/css/{getValue.mjs.map → getValue.cjs.map} +1 -1
- package/css/getValue.js +1 -3
- package/css/getValue.js.map +1 -1
- package/css/{index.mjs → index.cjs} +15 -7
- package/css/index.cjs.map +1 -0
- package/css/index.js +6 -14
- package/css/index.js.map +1 -1
- package/hooks/{useAnimation.mjs → useAnimation.cjs} +18 -6
- package/hooks/useAnimation.cjs.map +1 -0
- package/hooks/useAnimation.js +12 -10
- package/hooks/useAnimation.js.map +1 -1
- package/hooks/{useColorTemplate.mjs → useColorTemplate.cjs} +4 -2
- package/hooks/{useColorTemplate.mjs.map → useColorTemplate.cjs.map} +1 -1
- package/hooks/useColorTemplate.js +1 -3
- package/hooks/useColorTemplate.js.map +1 -1
- package/hooks/useInterface.cjs +19 -0
- package/hooks/useInterface.cjs.map +1 -0
- package/hooks/useInterface.js +7 -9
- package/hooks/useInterface.js.map +1 -1
- package/hooks/{useMergeRefs.mjs → useMergeRefs.cjs} +6 -4
- package/hooks/{useMergeRefs.mjs.map → useMergeRefs.cjs.map} +1 -1
- package/hooks/useMergeRefs.js +3 -5
- package/hooks/useMergeRefs.js.map +1 -1
- package/hooks/usePortal.cjs +66 -0
- package/hooks/usePortal.cjs.map +1 -0
- package/hooks/usePortal.js +24 -30
- package/hooks/usePortal.js.map +1 -1
- package/hooks/useTransition/{index.mjs → index.cjs} +29 -25
- package/hooks/useTransition/index.cjs.map +1 -0
- package/hooks/useTransition/index.js +26 -26
- package/hooks/useTransition/index.js.map +1 -1
- package/hooks/useTransition/{variants.mjs → variants.cjs} +17 -2
- package/hooks/useTransition/{variants.mjs.map → variants.cjs.map} +1 -1
- package/hooks/useTransition/variants.js +1 -16
- package/hooks/useTransition/variants.js.map +1 -1
- package/index.cjs +64 -0
- package/index.cjs.map +1 -0
- package/index.d.ts +3 -2
- package/index.js +25 -60
- package/index.js.map +1 -1
- package/package.json +5 -12
- package/theme/{ThemeCssVars.mjs → ThemeCssVars.cjs} +4 -2
- package/theme/{ThemeCssVars.mjs.map → ThemeCssVars.cjs.map} +1 -1
- package/theme/ThemeCssVars.js +1 -3
- package/theme/ThemeCssVars.js.map +1 -1
- package/theme/{ThemeDefaultOptions.mjs → ThemeDefaultOptions.cjs} +11 -5
- package/theme/{ThemeDefaultOptions.mjs.map → ThemeDefaultOptions.cjs.map} +1 -1
- package/theme/ThemeDefaultOptions.js +4 -10
- package/theme/ThemeDefaultOptions.js.map +1 -1
- package/theme/ThemeProvider.cjs +154 -0
- package/theme/ThemeProvider.cjs.map +1 -0
- package/theme/ThemeProvider.d.ts +3 -1
- package/theme/ThemeProvider.js +109 -41
- package/theme/ThemeProvider.js.map +1 -1
- package/theme/{core.mjs → core.cjs} +12 -6
- package/theme/core.cjs.map +1 -0
- package/theme/core.js +5 -11
- package/theme/core.js.map +1 -1
- package/theme/createTheme.cjs +27 -0
- package/theme/{createTheme.mjs.map → createTheme.cjs.map} +1 -1
- package/theme/createTheme.js +10 -12
- package/theme/createTheme.js.map +1 -1
- package/theme/{createThemeSwitcher.mjs → createThemeSwitcher.cjs} +8 -6
- package/theme/{createThemeSwitcher.mjs.map → createThemeSwitcher.cjs.map} +1 -1
- package/theme/createThemeSwitcher.js +5 -7
- package/theme/createThemeSwitcher.js.map +1 -1
- package/theme/index.cjs +15 -0
- package/theme/{index.mjs.map → index.cjs.map} +1 -1
- package/theme/index.js +6 -11
- package/theme/index.js.map +1 -1
- package/AppRoot/Renderar.mjs +0 -51
- package/AppRoot/Renderar.mjs.map +0 -1
- package/AppRoot/context.js.map +0 -1
- package/AppRoot/context.mjs.map +0 -1
- package/AppRoot/index.mjs +0 -118
- package/AppRoot/index.mjs.map +0 -1
- package/Document/index.mjs +0 -18
- package/Document/index.mjs.map +0 -1
- package/Iframe/index.mjs +0 -43
- package/Iframe/index.mjs.map +0 -1
- package/Tag/ServerStyleTag.mjs +0 -11
- package/Tag/cssPropList.mjs.map +0 -1
- package/Tag/index.mjs +0 -19
- package/Tag/useTagProps.mjs.map +0 -1
- package/Transition/index.mjs +0 -27
- package/breakpoint/BreakpointProvider.mjs +0 -40
- package/breakpoint/useBreakpoint.mjs +0 -22
- package/breakpoint/useBreakpointProps.mjs.map +0 -1
- package/css/aliases.mjs.map +0 -1
- package/css/index.mjs.map +0 -1
- package/hooks/useAnimation.mjs.map +0 -1
- package/hooks/useInterface.mjs +0 -17
- package/hooks/useInterface.mjs.map +0 -1
- package/hooks/usePortal.mjs +0 -68
- package/hooks/usePortal.mjs.map +0 -1
- package/hooks/useTransition/index.mjs.map +0 -1
- package/index.mjs +0 -25
- package/index.mjs.map +0 -1
- package/theme/ThemeProvider.mjs +0 -44
- package/theme/ThemeProvider.mjs.map +0 -1
- package/theme/core.mjs.map +0 -1
- package/theme/createTheme.mjs +0 -25
- package/theme/index.mjs +0 -10
- /package/AppRoot/{context.d.ts → AppRootProvider.d.ts} +0 -0
package/theme/ThemeProvider.js
CHANGED
|
@@ -1,65 +1,133 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import Tag from '../Tag/index.js';
|
|
6
|
+
import { ThemeFactory, ThemeContex } from './core.js';
|
|
7
|
+
import ThemeCssVars from './ThemeCssVars.js';
|
|
8
|
+
import { css } from '../css/index.js';
|
|
9
|
+
import { createDefaultThemes } from './ThemeDefaultOptions.js';
|
|
10
|
+
import ServerStyleTag from '../Tag/ServerStyleTag.js';
|
|
11
|
+
import { useDocument } from '../Document/index.js';
|
|
12
|
+
import { themeRootClass } from './index.js';
|
|
13
|
+
import { useCSSCacheId } from '../css/CSSCacheProvider.js';
|
|
3
14
|
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var index$2 = require('../Tag/index.js');
|
|
8
|
-
var core = require('./core.js');
|
|
9
|
-
var ThemeCssVars = require('./ThemeCssVars.js');
|
|
10
|
-
var index$1 = require('../css/index.js');
|
|
11
|
-
var ThemeDefaultOptions = require('./ThemeDefaultOptions.js');
|
|
12
|
-
var ServerStyleTag = require('../Tag/ServerStyleTag.js');
|
|
13
|
-
var index = require('../Document/index.js');
|
|
14
|
-
|
|
15
|
-
function _interopNamespaceDefault(e) {
|
|
16
|
-
var n = Object.create(null);
|
|
17
|
-
if (e) {
|
|
18
|
-
Object.keys(e).forEach(function (k) {
|
|
19
|
-
if (k !== 'default') {
|
|
20
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () { return e[k]; }
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
n.default = e;
|
|
29
|
-
return Object.freeze(n);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
33
|
-
|
|
34
|
-
ThemeDefaultOptions.createDefaultThemes();
|
|
15
|
+
createDefaultThemes();
|
|
35
16
|
const ThemeProvider = (_a) => {
|
|
36
|
-
var { children, theme } = _a, props =
|
|
37
|
-
let THEME =
|
|
17
|
+
var { children, theme, isRoot, noScrollbarCss } = _a, props = __rest(_a, ["children", "theme", "isRoot", "noScrollbarCss"]);
|
|
18
|
+
let THEME = ThemeFactory.get(theme);
|
|
38
19
|
if (!THEME) {
|
|
39
20
|
console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`);
|
|
40
|
-
THEME =
|
|
21
|
+
THEME = ThemeFactory.get("light");
|
|
41
22
|
}
|
|
42
|
-
const doc =
|
|
43
|
-
const
|
|
23
|
+
const doc = useDocument().document;
|
|
24
|
+
const cacheId = useCSSCacheId();
|
|
25
|
+
const themeGlobalStyle = React.useMemo(() => {
|
|
44
26
|
const root_cls = `.xui-${theme}-theme-root`;
|
|
45
27
|
let gkeys = Object.keys(THEME.globalStyle || {});
|
|
46
28
|
let gstyles = {};
|
|
47
29
|
gkeys.forEach((key) => {
|
|
48
30
|
gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key];
|
|
49
31
|
});
|
|
50
|
-
return
|
|
32
|
+
return css({
|
|
51
33
|
"@global": Object.assign(Object.assign({}, gstyles), { [root_cls]: ThemeCssVars(THEME) })
|
|
52
34
|
}, {
|
|
53
35
|
injectStyle: typeof window !== 'undefined',
|
|
54
36
|
container: doc,
|
|
37
|
+
cacheId
|
|
38
|
+
});
|
|
39
|
+
}, [theme, doc]);
|
|
40
|
+
const resetCss = React.useMemo(() => {
|
|
41
|
+
if (!isRoot)
|
|
42
|
+
return;
|
|
43
|
+
return css({
|
|
44
|
+
"@global": {
|
|
45
|
+
"*": {
|
|
46
|
+
m: 0,
|
|
47
|
+
p: 0,
|
|
48
|
+
outline: "none",
|
|
49
|
+
boxSizing: "border-box",
|
|
50
|
+
verticalAlign: "baseline",
|
|
51
|
+
},
|
|
52
|
+
"html, body": {
|
|
53
|
+
minHeight: "100%",
|
|
54
|
+
"-webkit-font-smoothing": "antialiased",
|
|
55
|
+
"-moz-osx-font-smoothing": "grayscale",
|
|
56
|
+
},
|
|
57
|
+
"img, picture, video, canvas, svg": {
|
|
58
|
+
maxWidth: "100%",
|
|
59
|
+
display: "block"
|
|
60
|
+
},
|
|
61
|
+
"input, button, textarea, select": {
|
|
62
|
+
font: "inherit"
|
|
63
|
+
},
|
|
64
|
+
"table": {
|
|
65
|
+
borderCollapse: "collapse",
|
|
66
|
+
borderSpacing: 0,
|
|
67
|
+
},
|
|
68
|
+
"ol, ul": {
|
|
69
|
+
listStyle: "none",
|
|
70
|
+
padding: 0,
|
|
71
|
+
margin: 0,
|
|
72
|
+
},
|
|
73
|
+
"a": {
|
|
74
|
+
display: "inline-block",
|
|
75
|
+
color: "inherit",
|
|
76
|
+
textDecoration: "none",
|
|
77
|
+
cursor: "pointer",
|
|
78
|
+
"&:hover": {
|
|
79
|
+
textDecoration: "underline"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"p, h1, h2, h3, h4, h5, h6": {
|
|
83
|
+
overflowWrap: "break-word",
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
injectStyle: typeof window !== 'undefined',
|
|
88
|
+
container: doc,
|
|
89
|
+
cacheId
|
|
90
|
+
});
|
|
91
|
+
}, []);
|
|
92
|
+
const scrollbarCss = React.useMemo(() => {
|
|
93
|
+
if (noScrollbarCss)
|
|
94
|
+
return;
|
|
95
|
+
const cls = (cls) => `${themeRootClass(theme)} ${cls}`;
|
|
96
|
+
let thumbSize = 6;
|
|
97
|
+
let thumbColor = "var(--color-text-secondary)";
|
|
98
|
+
let trackColor = "transparent";
|
|
99
|
+
return css({
|
|
100
|
+
"@global": {
|
|
101
|
+
[cls('*::-webkit-scrollbar')]: {
|
|
102
|
+
width: thumbSize,
|
|
103
|
+
height: thumbSize,
|
|
104
|
+
},
|
|
105
|
+
[cls("*::-webkit-scrollbar-thumb")]: {
|
|
106
|
+
backgroundColor: thumbColor,
|
|
107
|
+
borderRadius: "6px",
|
|
108
|
+
opacity: 0.6,
|
|
109
|
+
},
|
|
110
|
+
[cls("*::-webkit-scrollbar-thumb:hover")]: {
|
|
111
|
+
backgroundColor: thumbColor,
|
|
112
|
+
opacity: 0.0,
|
|
113
|
+
},
|
|
114
|
+
[cls("*::-webkit-scrollbar-track")]: {
|
|
115
|
+
backgroundColor: trackColor,
|
|
116
|
+
borderRadius: "6px",
|
|
117
|
+
},
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
injectStyle: typeof window !== 'undefined',
|
|
121
|
+
container: doc,
|
|
122
|
+
cacheId
|
|
55
123
|
});
|
|
56
|
-
}, [theme]);
|
|
57
|
-
return (
|
|
124
|
+
}, [noScrollbarCss, theme]);
|
|
125
|
+
return (jsxs(ThemeContex.Provider, { value: theme, children: [isRoot && jsxs(Fragment, { children: [jsx(ServerStyleTag, { factory: resetCss }), !noScrollbarCss && jsx(ServerStyleTag, { factory: scrollbarCss })] }), jsx(ServerStyleTag, { factory: themeGlobalStyle }), jsx(Tag, Object.assign({ minHeight: "100%", bgcolor: "background.primary", color: "text.primary", fontSize: "text", fontWeight: "text", lineHeight: "text", fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
|
|
58
126
|
"& a": {
|
|
59
127
|
color: "brand.primary",
|
|
60
128
|
},
|
|
61
129
|
}, baseClass: `${theme}-theme-root`, direction: THEME.rtl ? "rtl" : "ltr", children: children }))] }));
|
|
62
130
|
};
|
|
63
131
|
|
|
64
|
-
|
|
132
|
+
export { ThemeProvider as default };
|
|
65
133
|
//# sourceMappingURL=ThemeProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\r\nimport * as React from \"react\"\r\nimport { ThemeOptions } from \"./types\"\r\nimport Tag from \"../Tag\"\r\nimport { TagComponentType, TagProps } from \"../Tag/types\"\r\nimport { ThemeContex, ThemeFactory } from \"./core\"\r\nimport ThemeCssVars from \"./ThemeCssVars\"\r\nimport { css } from \"../css\"\r\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\r\nimport ServerStyleTag from \"../Tag/ServerStyleTag\"\r\nimport { useDocument } from \"../Document\";\r\n\r\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\r\n theme: string;\r\n}\r\n\r\ncreateDefaultThemes()\r\n\r\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\r\n let THEME = ThemeFactory.get(theme) as ThemeOptions\r\n if (!THEME) {\r\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\r\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\r\n }\r\n const doc = useDocument();\r\n\r\n const
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\r\nimport * as React from \"react\"\r\nimport { ThemeOptions } from \"./types\"\r\nimport Tag from \"../Tag\"\r\nimport { TagComponentType, TagProps } from \"../Tag/types\"\r\nimport { ThemeContex, ThemeFactory } from \"./core\"\r\nimport ThemeCssVars from \"./ThemeCssVars\"\r\nimport { css } from \"../css\"\r\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\r\nimport ServerStyleTag from \"../Tag/ServerStyleTag\"\r\nimport { useDocument } from \"../Document\";\r\nimport { themeRootClass } from \".\";\r\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\r\n\r\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\r\n theme: string;\r\n isRoot?: boolean;\r\n noScrollbarCss?: boolean;\r\n}\r\n\r\ncreateDefaultThemes()\r\n\r\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => {\r\n let THEME = ThemeFactory.get(theme) as ThemeOptions\r\n if (!THEME) {\r\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\r\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\r\n }\r\n const doc = useDocument().document;\r\n const cacheId = useCSSCacheId()\r\n\r\n const themeGlobalStyle: any = React.useMemo(() => {\r\n const root_cls = `.xui-${theme}-theme-root`\r\n let gkeys = Object.keys(THEME.globalStyle || {})\r\n let gstyles: any = {}\r\n gkeys.forEach((key) => {\r\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\r\n })\r\n\r\n return css({\r\n \"@global\": {\r\n ...gstyles,\r\n [root_cls]: ThemeCssVars(THEME)\r\n }\r\n }, {\r\n injectStyle: typeof window !== 'undefined',\r\n container: doc,\r\n cacheId\r\n })\r\n }, [theme, doc])\r\n\r\n const resetCss = React.useMemo(() => {\r\n if (!isRoot) return\r\n return css({\r\n \"@global\": {\r\n \"*\": {\r\n m: 0,\r\n p: 0,\r\n outline: \"none\",\r\n boxSizing: \"border-box\",\r\n verticalAlign: \"baseline\",\r\n },\r\n \"html, body\": {\r\n minHeight: \"100%\",\r\n \"-webkit-font-smoothing\": \"antialiased\",\r\n \"-moz-osx-font-smoothing\": \"grayscale\",\r\n } as any,\r\n \"img, picture, video, canvas, svg\": {\r\n maxWidth: \"100%\",\r\n display: \"block\"\r\n },\r\n \"input, button, textarea, select\": {\r\n font: \"inherit\"\r\n },\r\n \"table\": {\r\n borderCollapse: \"collapse\",\r\n borderSpacing: 0,\r\n },\r\n \"ol, ul\": {\r\n listStyle: \"none\",\r\n padding: 0,\r\n margin: 0,\r\n },\r\n \"a\": {\r\n display: \"inline-block\",\r\n color: \"inherit\",\r\n textDecoration: \"none\",\r\n cursor: \"pointer\",\r\n \"&:hover\": {\r\n textDecoration: \"underline\"\r\n }\r\n },\r\n \"p, h1, h2, h3, h4, h5, h6\": {\r\n overflowWrap: \"break-word\",\r\n },\r\n }\r\n }, {\r\n injectStyle: typeof window !== 'undefined',\r\n container: doc,\r\n cacheId\r\n })\r\n }, [])\r\n\r\n const scrollbarCss: any = React.useMemo(() => {\r\n if (noScrollbarCss) return;\r\n const cls = (cls: string) => `${themeRootClass(theme)} ${cls}`\r\n let thumbSize = 6\r\n let thumbColor = \"var(--color-text-secondary)\"\r\n let trackColor = \"transparent\"\r\n\r\n return css({\r\n \"@global\": {\r\n [cls('*::-webkit-scrollbar')]: {\r\n width: thumbSize,\r\n height: thumbSize,\r\n },\r\n [cls(\"*::-webkit-scrollbar-thumb\")]: {\r\n backgroundColor: thumbColor,\r\n borderRadius: \"6px\",\r\n opacity: 0.6,\r\n },\r\n [cls(\"*::-webkit-scrollbar-thumb:hover\")]: {\r\n backgroundColor: thumbColor,\r\n opacity: 0.0,\r\n },\r\n [cls(\"*::-webkit-scrollbar-track\")]: {\r\n backgroundColor: trackColor,\r\n borderRadius: \"6px\",\r\n },\r\n }\r\n }, {\r\n injectStyle: typeof window !== 'undefined',\r\n container: doc,\r\n cacheId\r\n }) as any\r\n }, [noScrollbarCss, theme])\r\n\r\n return (\r\n <ThemeContex.Provider value={theme}>\r\n {\r\n isRoot && <>\r\n <ServerStyleTag factory={resetCss as any} />\r\n {\r\n !noScrollbarCss && <ServerStyleTag factory={scrollbarCss} />\r\n }\r\n </>\r\n }\r\n <ServerStyleTag factory={themeGlobalStyle} />\r\n <Tag\r\n minHeight=\"100%\"\r\n bgcolor=\"background.primary\"\r\n color=\"text.primary\"\r\n fontSize=\"text\"\r\n fontWeight=\"text\"\r\n lineHeight=\"text\"\r\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\r\n {...props}\r\n sxr={{\r\n \"& a\": {\r\n color: \"brand.primary\",\r\n },\r\n }}\r\n baseClass={`${theme}-theme-root`}\r\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\r\n >\r\n {children}\r\n </Tag>\r\n </ThemeContex.Provider>\r\n )\r\n}\r\n\r\nexport default ThemeProvider"],"names":[],"mappings":";;;;;;;;;;;;;;AAoBA;AAEA;AAA2D;;;AAGrD;AACA;;AAEH;AACA;AAEA;AACG;AACA;;AAEA;AACG;AACH;AAEA;;;AAMG;AACA;;AAEF;AACJ;AAEA;AACG;;AACA;AACG;AACG;AACG;AACA;AACA;AACA;AACA;AACF;AACD;AACG;AACA;AACA;AACK;AACR;AACG;AACA;AACF;AACD;AACG;AACF;AACD;AACG;AACA;AACF;AACD;AACG;AACA;AACA;AACF;AACD;AACG;AACA;AACA;AACA;AACA;AACG;AACF;AACH;AACD;AACG;AACF;AACH;;AAED;AACA;;AAEF;;AAGJ;AACG;;AACA;;;;AAKA;AACG;AACG;AACG;AACA;AACF;AACD;AACG;AACA;AACA;AACF;AACD;AACG;AACA;AACF;AACD;AACG;AACA;AACF;AACH;;AAED;AACA;;AAEF;AACJ;AAEA;AAqBY;AACG;AACF;;AAShB;;"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
2
4
|
|
|
3
5
|
const ThemeFactory = new Map();
|
|
4
|
-
const ThemeContex =
|
|
6
|
+
const ThemeContex = React.createContext("light");
|
|
5
7
|
const getTheme = (theme) => ThemeFactory.get(theme);
|
|
6
8
|
const useTheme = () => {
|
|
7
|
-
const theme = ThemeFactory.get(
|
|
9
|
+
const theme = ThemeFactory.get(React.useContext(ThemeContex));
|
|
8
10
|
if (!theme) {
|
|
9
11
|
console.error("Theme not found, returning light theme as fallback");
|
|
10
12
|
return ThemeFactory.get("light");
|
|
@@ -16,7 +18,7 @@ const mergeObject = (a, b) => {
|
|
|
16
18
|
b = Object.assign({}, b);
|
|
17
19
|
for (const key in b) {
|
|
18
20
|
const v = b[key];
|
|
19
|
-
if (typeof v === 'object' && !Array.isArray(v) && !
|
|
21
|
+
if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {
|
|
20
22
|
a[key] = mergeObject(a[key], b[key]);
|
|
21
23
|
}
|
|
22
24
|
else {
|
|
@@ -26,5 +28,9 @@ const mergeObject = (a, b) => {
|
|
|
26
28
|
return a;
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
exports.ThemeContex = ThemeContex;
|
|
32
|
+
exports.ThemeFactory = ThemeFactory;
|
|
33
|
+
exports.getTheme = getTheme;
|
|
34
|
+
exports.mergeObject = mergeObject;
|
|
35
|
+
exports.useTheme = useTheme;
|
|
36
|
+
//# sourceMappingURL=core.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.cjs","sources":["../../src/theme/core.ts"],"sourcesContent":["import React from \"react\"\r\nimport { ObjectType, ThemeOptions } from \"./types\"\r\n\r\nexport const ThemeFactory = new Map<string, ThemeOptions>()\r\nexport const ThemeContex = React.createContext(\"light\")\r\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\r\nexport const useTheme = (): ThemeOptions => {\r\n const theme = ThemeFactory.get(React.useContext(ThemeContex)) as any\r\n if (!theme) {\r\n console.error(\"Theme not found, returning light theme as fallback\")\r\n return ThemeFactory.get(\"light\") as any\r\n }\r\n return theme\r\n}\r\n\r\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\r\n a = { ...a }\r\n b = { ...b }\r\n for (const key in b) {\r\n const v = (b as any)[key]\r\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\r\n a[key] = mergeObject(a[key], b[key])\r\n } else {\r\n a[key] = v\r\n }\r\n }\r\n return a\r\n}\r\n"],"names":[],"mappings":";;;;AAGO,MAAM,YAAY,GAAG,IAAI,GAAG;AAC5B,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO;AAC/C,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAK,YAAY,CAAC,GAAG,CAAC,KAAK;AAC1D,MAAM,QAAQ,GAAG,MAAmB;AACxC,IAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAQ;IACpE,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC;AACnE,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,CAAQ;IAC1C;AACA,IAAA,OAAO,KAAK;AACf;MAEa,WAAW,GAAG,CAAC,CAAa,EAAE,CAAa,KAAI;IACzD,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;IACZ,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;AACZ,IAAA,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE;AAClB,QAAA,MAAM,CAAC,GAAI,CAAS,CAAC,GAAG,CAAC;QACzB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;AACzE,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC;aAAO;AACJ,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACb;IACH;AACA,IAAA,OAAO,CAAC;AACX;;;;;;;;"}
|
package/theme/core.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
1
|
+
import React__default from 'react';
|
|
4
2
|
|
|
5
3
|
const ThemeFactory = new Map();
|
|
6
|
-
const ThemeContex =
|
|
4
|
+
const ThemeContex = React__default.createContext("light");
|
|
7
5
|
const getTheme = (theme) => ThemeFactory.get(theme);
|
|
8
6
|
const useTheme = () => {
|
|
9
|
-
const theme = ThemeFactory.get(
|
|
7
|
+
const theme = ThemeFactory.get(React__default.useContext(ThemeContex));
|
|
10
8
|
if (!theme) {
|
|
11
9
|
console.error("Theme not found, returning light theme as fallback");
|
|
12
10
|
return ThemeFactory.get("light");
|
|
@@ -18,7 +16,7 @@ const mergeObject = (a, b) => {
|
|
|
18
16
|
b = Object.assign({}, b);
|
|
19
17
|
for (const key in b) {
|
|
20
18
|
const v = b[key];
|
|
21
|
-
if (typeof v === 'object' && !Array.isArray(v) && !
|
|
19
|
+
if (typeof v === 'object' && !Array.isArray(v) && !React__default.isValidElement(v)) {
|
|
22
20
|
a[key] = mergeObject(a[key], b[key]);
|
|
23
21
|
}
|
|
24
22
|
else {
|
|
@@ -28,9 +26,5 @@ const mergeObject = (a, b) => {
|
|
|
28
26
|
return a;
|
|
29
27
|
};
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
exports.ThemeFactory = ThemeFactory;
|
|
33
|
-
exports.getTheme = getTheme;
|
|
34
|
-
exports.mergeObject = mergeObject;
|
|
35
|
-
exports.useTheme = useTheme;
|
|
29
|
+
export { ThemeContex, ThemeFactory, getTheme, mergeObject, useTheme };
|
|
36
30
|
//# sourceMappingURL=core.js.map
|
package/theme/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sources":["../../src/theme/core.ts"],"sourcesContent":["import React from \"react\"\r\nimport { ObjectType, ThemeOptions } from \"./types\"\r\n\r\nexport const ThemeFactory = new Map<string, ThemeOptions>()\r\nexport const ThemeContex = React.createContext(\"light\")\r\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\r\nexport const useTheme = (): ThemeOptions => {\r\n const theme = ThemeFactory.get(React.useContext(ThemeContex)) as any\r\n if (!theme) {\r\n console.error(\"Theme not found, returning light theme as fallback\")\r\n return ThemeFactory.get(\"light\") as any\r\n }\r\n return theme\r\n}\r\n\r\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\r\n a = { ...a }\r\n b = { ...b }\r\n for (const key in b) {\r\n const v = (b as any)[key]\r\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\r\n a[key] = mergeObject(a[key], b[key])\r\n } else {\r\n a[key] = v\r\n }\r\n }\r\n return a\r\n}\r\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.js","sources":["../../src/theme/core.ts"],"sourcesContent":["import React from \"react\"\r\nimport { ObjectType, ThemeOptions } from \"./types\"\r\n\r\nexport const ThemeFactory = new Map<string, ThemeOptions>()\r\nexport const ThemeContex = React.createContext(\"light\")\r\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\r\nexport const useTheme = (): ThemeOptions => {\r\n const theme = ThemeFactory.get(React.useContext(ThemeContex)) as any\r\n if (!theme) {\r\n console.error(\"Theme not found, returning light theme as fallback\")\r\n return ThemeFactory.get(\"light\") as any\r\n }\r\n return theme\r\n}\r\n\r\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\r\n a = { ...a }\r\n b = { ...b }\r\n for (const key in b) {\r\n const v = (b as any)[key]\r\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\r\n a[key] = mergeObject(a[key], b[key])\r\n } else {\r\n a[key] = v\r\n }\r\n }\r\n return a\r\n}\r\n"],"names":["React"],"mappings":";;AAGO,MAAM,YAAY,GAAG,IAAI,GAAG;AAC5B,MAAM,WAAW,GAAGA,cAAK,CAAC,aAAa,CAAC,OAAO;AAC/C,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAK,YAAY,CAAC,GAAG,CAAC,KAAK;AAC1D,MAAM,QAAQ,GAAG,MAAmB;AACxC,IAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAACA,cAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAQ;IACpE,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC;AACnE,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,CAAQ;IAC1C;AACA,IAAA,OAAO,KAAK;AACf;MAEa,WAAW,GAAG,CAAC,CAAa,EAAE,CAAa,KAAI;IACzD,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;IACZ,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;AACZ,IAAA,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE;AAClB,QAAA,MAAM,CAAC,GAAI,CAAS,CAAC,GAAG,CAAC;QACzB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAACA,cAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;AACzE,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC;aAAO;AACJ,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACb;IACH;AACA,IAAA,OAAO,CAAC;AACX;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('./core.cjs');
|
|
4
|
+
var index = require('../css/index.cjs');
|
|
5
|
+
var ThemeDefaultOptions = require('./ThemeDefaultOptions.cjs');
|
|
6
|
+
|
|
7
|
+
const createTheme = (name, options) => {
|
|
8
|
+
if (core.ThemeFactory.has(name)) {
|
|
9
|
+
console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`);
|
|
10
|
+
return core.ThemeFactory.get(name);
|
|
11
|
+
}
|
|
12
|
+
let theme = core.mergeObject(ThemeDefaultOptions.lightThemeOptions, Object.assign(Object.assign({}, options), { name, breakpoints: index.breakpoints }));
|
|
13
|
+
// add alpha colors
|
|
14
|
+
for (let color in theme.colors) {
|
|
15
|
+
const c = theme.colors[color];
|
|
16
|
+
const is_common = color === 'divider' || color === 'background' || color === 'text';
|
|
17
|
+
c.soft = {
|
|
18
|
+
primary: is_common ? index.alpha(c.primary, 0.60) : index.alpha(c.primary, 0.08),
|
|
19
|
+
secondary: is_common ? index.alpha(c.primary, 0.90) : index.alpha(c.primary, 0.12)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
core.ThemeFactory.set(name, theme);
|
|
23
|
+
return theme;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.createTheme = createTheme;
|
|
27
|
+
//# sourceMappingURL=createTheme.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.
|
|
1
|
+
{"version":3,"file":"createTheme.cjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\r\nimport { mergeObject, ThemeFactory } from \"./core\"\r\nimport { alpha, breakpoints } from \"../css\"\r\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\r\n\r\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\r\n if (ThemeFactory.has(name)) {\r\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\r\n return ThemeFactory.get(name) as ThemeOptions\r\n }\r\n\r\n let theme: any = mergeObject(lightThemeOptions, {\r\n ...options,\r\n name,\r\n breakpoints: breakpoints\r\n })\r\n\r\n // add alpha colors\r\n for (let color in theme.colors) {\r\n const c = theme.colors[color] as ThemeOptionsColor\r\n const is_common = color === 'divider' || color === 'background' || color === 'text'\r\n c.soft = {\r\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\r\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\r\n }\r\n }\r\n\r\n ThemeFactory.set(name, theme)\r\n\r\n return theme as ThemeOptions\r\n}\r\n"],"names":["ThemeFactory","mergeObject","lightThemeOptions","breakpoints","alpha"],"mappings":";;;;;;MAKa,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,KAAkB;AAClF,IAAA,IAAIA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAA,mEAAA,CAAqE,CAAC;AACnH,QAAA,OAAOA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;IAChD;AAEA,IAAA,IAAI,KAAK,GAAQC,gBAAW,CAACC,qCAAiB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACxC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAEC,iBAAW,IACzB;;AAGF,IAAA,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAsB;AAClD,QAAA,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM;QACnF,CAAC,CAAC,IAAI,GAAG;YACN,OAAO,EAAE,SAAS,GAAGC,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;YACpE,SAAS,EAAE,SAAS,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI;SACvE;IACJ;AAEA,IAAAJ,iBAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B;;;;"}
|
package/theme/createTheme.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var index = require('../css/index.js');
|
|
5
|
-
var ThemeDefaultOptions = require('./ThemeDefaultOptions.js');
|
|
1
|
+
import { ThemeFactory, mergeObject } from './core.js';
|
|
2
|
+
import { breakpoints, alpha } from '../css/index.js';
|
|
3
|
+
import { lightThemeOptions } from './ThemeDefaultOptions.js';
|
|
6
4
|
|
|
7
5
|
const createTheme = (name, options) => {
|
|
8
|
-
if (
|
|
6
|
+
if (ThemeFactory.has(name)) {
|
|
9
7
|
console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`);
|
|
10
|
-
return
|
|
8
|
+
return ThemeFactory.get(name);
|
|
11
9
|
}
|
|
12
|
-
let theme =
|
|
10
|
+
let theme = mergeObject(lightThemeOptions, Object.assign(Object.assign({}, options), { name, breakpoints: breakpoints }));
|
|
13
11
|
// add alpha colors
|
|
14
12
|
for (let color in theme.colors) {
|
|
15
13
|
const c = theme.colors[color];
|
|
16
14
|
const is_common = color === 'divider' || color === 'background' || color === 'text';
|
|
17
15
|
c.soft = {
|
|
18
|
-
primary: is_common ?
|
|
19
|
-
secondary: is_common ?
|
|
16
|
+
primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),
|
|
17
|
+
secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)
|
|
20
18
|
};
|
|
21
19
|
}
|
|
22
|
-
|
|
20
|
+
ThemeFactory.set(name, theme);
|
|
23
21
|
return theme;
|
|
24
22
|
};
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
export { createTheme };
|
|
27
25
|
//# sourceMappingURL=createTheme.js.map
|
package/theme/createTheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.js","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\r\nimport { mergeObject, ThemeFactory } from \"./core\"\r\nimport { alpha, breakpoints } from \"../css\"\r\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\r\n\r\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\r\n if (ThemeFactory.has(name)) {\r\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\r\n return ThemeFactory.get(name) as ThemeOptions\r\n }\r\n\r\n let theme: any = mergeObject(lightThemeOptions, {\r\n ...options,\r\n name,\r\n breakpoints: breakpoints\r\n })\r\n\r\n // add alpha colors\r\n for (let color in theme.colors) {\r\n const c = theme.colors[color] as ThemeOptionsColor\r\n const is_common = color === 'divider' || color === 'background' || color === 'text'\r\n c.soft = {\r\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\r\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\r\n }\r\n }\r\n\r\n ThemeFactory.set(name, theme)\r\n\r\n return theme as ThemeOptions\r\n}\r\n"],"names":[
|
|
1
|
+
{"version":3,"file":"createTheme.js","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\r\nimport { mergeObject, ThemeFactory } from \"./core\"\r\nimport { alpha, breakpoints } from \"../css\"\r\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\r\n\r\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\r\n if (ThemeFactory.has(name)) {\r\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\r\n return ThemeFactory.get(name) as ThemeOptions\r\n }\r\n\r\n let theme: any = mergeObject(lightThemeOptions, {\r\n ...options,\r\n name,\r\n breakpoints: breakpoints\r\n })\r\n\r\n // add alpha colors\r\n for (let color in theme.colors) {\r\n const c = theme.colors[color] as ThemeOptionsColor\r\n const is_common = color === 'divider' || color === 'background' || color === 'text'\r\n c.soft = {\r\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\r\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\r\n }\r\n }\r\n\r\n ThemeFactory.set(name, theme)\r\n\r\n return theme as ThemeOptions\r\n}\r\n"],"names":[],"mappings":";;;;MAKa,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,KAAkB;AAClF,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAA,mEAAA,CAAqE,CAAC;AACnH,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;IAChD;AAEA,IAAA,IAAI,KAAK,GAAQ,WAAW,CAAC,iBAAiB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACxC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAE,WAAW,IACzB;;AAGF,IAAA,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAsB;AAClD,QAAA,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM;QACnF,CAAC,CAAC,IAAI,GAAG;YACN,OAAO,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;YACpE,SAAS,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI;SACvE;IACJ;AAEA,IAAA,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B;;;;"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var reactStateBucket = require('react-state-bucket');
|
|
5
|
+
var core = require('./core.cjs');
|
|
4
6
|
|
|
5
7
|
const createThemeSwitcher = (defaultTheme, option) => {
|
|
6
|
-
const useThemeBucket = createBucket({ name: xv.string().default(defaultTheme) }, {
|
|
8
|
+
const useThemeBucket = reactStateBucket.createBucket({ name: reactStateBucket.xv.string().default(defaultTheme) }, {
|
|
7
9
|
store: (option === null || option === void 0 ? void 0 : option.store) || "memory",
|
|
8
10
|
onChange: (_key, value) => {
|
|
9
11
|
(option === null || option === void 0 ? void 0 : option.onChange) && (option === null || option === void 0 ? void 0 : option.onChange(value));
|
|
@@ -13,12 +15,12 @@ const createThemeSwitcher = (defaultTheme, option) => {
|
|
|
13
15
|
const bucket = useThemeBucket();
|
|
14
16
|
return {
|
|
15
17
|
name: bucket.state.name,
|
|
16
|
-
theme: getTheme(bucket.state.name),
|
|
18
|
+
theme: core.getTheme(bucket.state.name),
|
|
17
19
|
change: (theme) => bucket.set('name', theme)
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
return useThemeSwitcher;
|
|
21
23
|
};
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=createThemeSwitcher.
|
|
25
|
+
module.exports = createThemeSwitcher;
|
|
26
|
+
//# sourceMappingURL=createThemeSwitcher.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createThemeSwitcher.
|
|
1
|
+
{"version":3,"file":"createThemeSwitcher.cjs","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["\"use client\";\r\nimport { createBucket, xv } from \"react-state-bucket\"\r\nimport { getTheme } from \"./core\"\r\nimport { BucketOptions } from \"react-state-bucket\"\r\n\r\nexport type ThemeSwitcherOption = {\r\n store?: BucketOptions['store'],\r\n onChange?: (theme: string) => void\r\n}\r\n\r\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\r\n\r\n const useThemeBucket = createBucket({ name: xv.string().default(defaultTheme) }, {\r\n store: option?.store || \"memory\",\r\n onChange: (_key, value) => {\r\n option?.onChange && option?.onChange(value)\r\n }\r\n })\r\n\r\n const useThemeSwitcher = () => {\r\n const bucket = useThemeBucket()\r\n return {\r\n name: bucket.state.name,\r\n theme: getTheme(bucket.state.name),\r\n change: (theme: string) => bucket.set('name', theme)\r\n }\r\n }\r\n return useThemeSwitcher\r\n}\r\n\r\nexport default createThemeSwitcher"],"names":[],"mappings":";;;;;;AAUA;AAEG;;AAEG;AACG;;AAEL;;AAGE;;AAEG;;AAEA;;AAEN;AACA;AACH;;"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var reactStateBucket = require('react-state-bucket');
|
|
5
|
-
var core = require('./core.js');
|
|
2
|
+
import { createBucket, xv } from 'react-state-bucket';
|
|
3
|
+
import { getTheme } from './core.js';
|
|
6
4
|
|
|
7
5
|
const createThemeSwitcher = (defaultTheme, option) => {
|
|
8
|
-
const useThemeBucket =
|
|
6
|
+
const useThemeBucket = createBucket({ name: xv.string().default(defaultTheme) }, {
|
|
9
7
|
store: (option === null || option === void 0 ? void 0 : option.store) || "memory",
|
|
10
8
|
onChange: (_key, value) => {
|
|
11
9
|
(option === null || option === void 0 ? void 0 : option.onChange) && (option === null || option === void 0 ? void 0 : option.onChange(value));
|
|
@@ -15,12 +13,12 @@ const createThemeSwitcher = (defaultTheme, option) => {
|
|
|
15
13
|
const bucket = useThemeBucket();
|
|
16
14
|
return {
|
|
17
15
|
name: bucket.state.name,
|
|
18
|
-
theme:
|
|
16
|
+
theme: getTheme(bucket.state.name),
|
|
19
17
|
change: (theme) => bucket.set('name', theme)
|
|
20
18
|
};
|
|
21
19
|
};
|
|
22
20
|
return useThemeSwitcher;
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
export { createThemeSwitcher as default };
|
|
26
24
|
//# sourceMappingURL=createThemeSwitcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createThemeSwitcher.js","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["\"use client\";\r\nimport { createBucket, xv } from \"react-state-bucket\"\r\nimport { getTheme } from \"./core\"\r\nimport { BucketOptions } from \"react-state-bucket\"\r\n\r\nexport type ThemeSwitcherOption = {\r\n store?: BucketOptions['store'],\r\n onChange?: (theme: string) => void\r\n}\r\n\r\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\r\n\r\n const useThemeBucket = createBucket({ name: xv.string().default(defaultTheme) }, {\r\n store: option?.store || \"memory\",\r\n onChange: (_key, value) => {\r\n option?.onChange && option?.onChange(value)\r\n }\r\n })\r\n\r\n const useThemeSwitcher = () => {\r\n const bucket = useThemeBucket()\r\n return {\r\n name: bucket.state.name,\r\n theme: getTheme(bucket.state.name),\r\n change: (theme: string) => bucket.set('name', theme)\r\n }\r\n }\r\n return useThemeSwitcher\r\n}\r\n\r\nexport default createThemeSwitcher"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createThemeSwitcher.js","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["\"use client\";\r\nimport { createBucket, xv } from \"react-state-bucket\"\r\nimport { getTheme } from \"./core\"\r\nimport { BucketOptions } from \"react-state-bucket\"\r\n\r\nexport type ThemeSwitcherOption = {\r\n store?: BucketOptions['store'],\r\n onChange?: (theme: string) => void\r\n}\r\n\r\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\r\n\r\n const useThemeBucket = createBucket({ name: xv.string().default(defaultTheme) }, {\r\n store: option?.store || \"memory\",\r\n onChange: (_key, value) => {\r\n option?.onChange && option?.onChange(value)\r\n }\r\n })\r\n\r\n const useThemeSwitcher = () => {\r\n const bucket = useThemeBucket()\r\n return {\r\n name: bucket.state.name,\r\n theme: getTheme(bucket.state.name),\r\n change: (theme: string) => bucket.set('name', theme)\r\n }\r\n }\r\n return useThemeSwitcher\r\n}\r\n\r\nexport default createThemeSwitcher"],"names":[],"mappings":";;;;AAUA;AAEG;;AAEG;AACG;;AAEL;;AAGE;;AAEG;;AAEA;;AAEN;AACA;AACH;;"}
|
package/theme/index.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('./core.cjs');
|
|
4
|
+
require('../css/getValue.cjs');
|
|
5
|
+
require('oncss');
|
|
6
|
+
var ThemeProvider = require('./ThemeProvider.cjs');
|
|
7
|
+
require('react-state-bucket');
|
|
8
|
+
|
|
9
|
+
const themeRootClass = (theme) => `.xui-${theme}-theme-root`;
|
|
10
|
+
|
|
11
|
+
exports.getTheme = core.getTheme;
|
|
12
|
+
exports.useTheme = core.useTheme;
|
|
13
|
+
exports.ThemeProvider = ThemeProvider;
|
|
14
|
+
exports.themeRootClass = themeRootClass;
|
|
15
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport createThemeSwitcher from './createThemeSwitcher'\r\nimport { getTheme, useTheme } from './core'\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createThemeSwitcher,\r\n createTheme,\r\n getTheme,\r\n useTheme\r\n}\r\n\r\n"],"names":[],"mappings":";;;;;;;;AAOO,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,CAAA,KAAA,EAAQ,KAAK,CAAA,WAAA;;;;;;;"}
|
package/theme/index.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var ThemeProvider = require('./ThemeProvider.js');
|
|
7
|
-
require('react-state-bucket');
|
|
1
|
+
export { getTheme, useTheme } from './core.js';
|
|
2
|
+
import '../css/getValue.js';
|
|
3
|
+
import 'oncss';
|
|
4
|
+
export { default as ThemeProvider } from './ThemeProvider.js';
|
|
5
|
+
import 'react-state-bucket';
|
|
8
6
|
|
|
9
7
|
const themeRootClass = (theme) => `.xui-${theme}-theme-root`;
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
exports.useTheme = core.useTheme;
|
|
13
|
-
exports.ThemeProvider = ThemeProvider;
|
|
14
|
-
exports.themeRootClass = themeRootClass;
|
|
9
|
+
export { themeRootClass };
|
|
15
10
|
//# sourceMappingURL=index.js.map
|
package/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport createThemeSwitcher from './createThemeSwitcher'\r\nimport { getTheme, useTheme } from './core'\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createThemeSwitcher,\r\n createTheme,\r\n getTheme,\r\n useTheme\r\n}\r\n\r\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport createThemeSwitcher from './createThemeSwitcher'\r\nimport { getTheme, useTheme } from './core'\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createThemeSwitcher,\r\n createTheme,\r\n getTheme,\r\n useTheme\r\n}\r\n\r\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,CAAA,KAAA,EAAQ,KAAK,CAAA,WAAA;;;;"}
|
package/AppRoot/Renderar.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
|
|
4
|
-
const Components = [];
|
|
5
|
-
let dispatch = null;
|
|
6
|
-
class Renderar {
|
|
7
|
-
static render(component, props) {
|
|
8
|
-
Components.push({ component, props });
|
|
9
|
-
if (dispatch) {
|
|
10
|
-
dispatch();
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
unrender: () => {
|
|
14
|
-
this.unrender(component);
|
|
15
|
-
},
|
|
16
|
-
updateProps: (newProps) => {
|
|
17
|
-
this.updateProps(component, newProps);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
static unrender(component) {
|
|
22
|
-
const index = Components.findIndex((c) => c.component === component);
|
|
23
|
-
if (index > -1) {
|
|
24
|
-
Components.splice(index, 1);
|
|
25
|
-
if (dispatch)
|
|
26
|
-
dispatch();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
static updateProps(component, props) {
|
|
30
|
-
const storedComponent = Components.find((c) => c.component === component);
|
|
31
|
-
if (storedComponent) {
|
|
32
|
-
storedComponent.props = Object.assign(Object.assign({}, storedComponent.props), props);
|
|
33
|
-
}
|
|
34
|
-
if (dispatch)
|
|
35
|
-
dispatch();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const RenderRenderar = () => {
|
|
39
|
-
const [, setState] = React__default.useState(0);
|
|
40
|
-
if (!dispatch) {
|
|
41
|
-
dispatch = () => {
|
|
42
|
-
setState((prev) => prev + 1);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return Components.map(({ component: Component, props }, index) => {
|
|
46
|
-
return jsx(Component, Object.assign({}, props), index);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export { RenderRenderar, Renderar };
|
|
51
|
-
//# sourceMappingURL=Renderar.mjs.map
|
package/AppRoot/Renderar.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Renderar.mjs","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\r\n\r\ntype StoredComponent = {\r\n component: React.FunctionComponent<any>;\r\n props: any;\r\n};\r\n\r\nconst Components: StoredComponent[] = [];\r\nlet dispatch: (() => void) | null = null;\r\n\r\nexport class Renderar {\r\n static render(component: React.FunctionComponent, props?: any) {\r\n Components.push({ component, props });\r\n\r\n if (dispatch) {\r\n dispatch();\r\n }\r\n\r\n return {\r\n unrender: () => {\r\n this.unrender(component);\r\n },\r\n updateProps: (newProps: any) => {\r\n this.updateProps(component, newProps);\r\n }\r\n };\r\n }\r\n\r\n static unrender(component: React.FunctionComponent) {\r\n const index = Components.findIndex((c) => c.component === component);\r\n if (index > -1) {\r\n Components.splice(index, 1);\r\n if (dispatch) dispatch();\r\n }\r\n }\r\n\r\n static updateProps(component: React.FunctionComponent, props: any) {\r\n const storedComponent = Components.find((c) => c.component === component);\r\n if (storedComponent) {\r\n storedComponent.props = { ...storedComponent.props, ...props };\r\n }\r\n if (dispatch) dispatch();\r\n }\r\n}\r\n\r\nexport const RenderRenderar = () => {\r\n const [, setState] = React.useState(0);\r\n\r\n if (!dispatch) {\r\n dispatch = () => {\r\n setState((prev) => prev + 1);\r\n };\r\n }\r\n\r\n return Components.map(({ component: Component, props }, index): ReactElement => {\r\n return <Component key={index} {...props} />;\r\n });\r\n};\r\n"],"names":["React","_jsx"],"mappings":";;;AAOA,MAAM,UAAU,GAAsB,EAAE;AACxC,IAAI,QAAQ,GAAwB,IAAI;MAE3B,QAAQ,CAAA;AAClB,IAAA,OAAO,MAAM,CAAC,SAAkC,EAAE,KAAW,EAAA;QAC1D,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAErC,IAAI,QAAQ,EAAE;AACX,YAAA,QAAQ,EAAE;QACb;QAEA,OAAO;YACJ,QAAQ,EAAE,MAAK;AACZ,gBAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC3B,CAAC;AACD,YAAA,WAAW,EAAE,CAAC,QAAa,KAAI;AAC5B,gBAAA,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC;YACxC;SACF;IACJ;IAEA,OAAO,QAAQ,CAAC,SAAkC,EAAA;AAC/C,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;AACpE,QAAA,IAAI,KAAK,GAAG,EAAE,EAAE;AACb,YAAA,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC3B,YAAA,IAAI,QAAQ;AAAE,gBAAA,QAAQ,EAAE;QAC3B;IACH;AAEA,IAAA,OAAO,WAAW,CAAC,SAAkC,EAAE,KAAU,EAAA;AAC9D,QAAA,MAAM,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;QACzE,IAAI,eAAe,EAAE;YAClB,eAAe,CAAC,KAAK,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,eAAe,CAAC,KAAK,CAAA,EAAK,KAAK,CAAE;QACjE;AACA,QAAA,IAAI,QAAQ;AAAE,YAAA,QAAQ,EAAE;IAC3B;AACF;AAEM,MAAM,cAAc,GAAG,MAAK;IAChC,MAAM,GAAG,QAAQ,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEtC,IAAI,CAAC,QAAQ,EAAE;QACZ,QAAQ,GAAG,MAAK;YACb,QAAQ,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC;AAC/B,QAAA,CAAC;IACJ;AAEA,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,KAAkB;AAC5E,QAAA,OAAOC,IAAC,SAAS,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAiB,KAAK,CAAA,EAAhB,KAAK,CAAe;AAC9C,IAAA,CAAC,CAAC;AACL;;;;"}
|
package/AppRoot/context.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../src/AppRoot/context.tsx"],"sourcesContent":["import React from \"react\";\r\n\r\nconst AppRootContext = React.createContext<HTMLElement | null>(null);\r\n\r\nexport const AppRootProvider: React.FC<{ element: HTMLElement | null; children: React.ReactNode }> = ({ element, children }) => {\r\n return (\r\n <AppRootContext.Provider value={element}>\r\n {children}\r\n </AppRootContext.Provider>\r\n );\r\n}\r\n\r\nexport const useAppRootElement = (): HTMLElement => {\r\n const context = React.useContext(AppRootContext);\r\n if (typeof window === 'undefined') {\r\n return null as any;\r\n }\r\n return context as HTMLElement\r\n}\r\n"],"names":["_jsx"],"mappings":";;;;;AAEA,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAqB,IAAI,CAAC;AAE7D,MAAM,eAAe,GAAyE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAI;AAC5H,IAAA,QACGA,cAAA,CAAC,cAAc,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,QAAA,EACnC,QAAQ,EAAA,CACc;AAEhC;AAEO,MAAM,iBAAiB,GAAG,MAAkB;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;AAChD,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAChC,QAAA,OAAO,IAAW;IACrB;AACA,IAAA,OAAO,OAAsB;AAChC;;;;;"}
|
package/AppRoot/context.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","sources":["../../src/AppRoot/context.tsx"],"sourcesContent":["import React from \"react\";\r\n\r\nconst AppRootContext = React.createContext<HTMLElement | null>(null);\r\n\r\nexport const AppRootProvider: React.FC<{ element: HTMLElement | null; children: React.ReactNode }> = ({ element, children }) => {\r\n return (\r\n <AppRootContext.Provider value={element}>\r\n {children}\r\n </AppRootContext.Provider>\r\n );\r\n}\r\n\r\nexport const useAppRootElement = (): HTMLElement => {\r\n const context = React.useContext(AppRootContext);\r\n if (typeof window === 'undefined') {\r\n return null as any;\r\n }\r\n return context as HTMLElement\r\n}\r\n"],"names":["React","_jsx"],"mappings":";;;AAEA,MAAM,cAAc,GAAGA,cAAK,CAAC,aAAa,CAAqB,IAAI,CAAC;AAE7D,MAAM,eAAe,GAAyE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAI;AAC5H,IAAA,QACGC,GAAA,CAAC,cAAc,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,QAAA,EACnC,QAAQ,EAAA,CACc;AAEhC;AAEO,MAAM,iBAAiB,GAAG,MAAkB;IAChD,MAAM,OAAO,GAAGD,cAAK,CAAC,UAAU,CAAC,cAAc,CAAC;AAChD,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAChC,QAAA,OAAO,IAAW;IACrB;AACA,IAAA,OAAO,OAAsB;AAChC;;;;"}
|