@xanui/core 1.2.16 → 1.2.17
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/index.js +28 -4
- package/AppRoot/index.js.map +1 -1
- package/AppRoot/index.mjs +28 -4
- package/AppRoot/index.mjs.map +1 -1
- package/Tag/ServerStyleTag.js +6 -0
- package/Tag/ServerStyleTag.js.map +1 -0
- package/Tag/ServerStyleTag.mjs +6 -0
- package/Tag/ServerStyleTag.mjs.map +1 -0
- package/Tag/index.js +2 -2
- package/Tag/index.js.map +1 -1
- package/Tag/index.mjs +2 -2
- package/Tag/index.mjs.map +1 -1
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/theme/ThemeProvider.js +2 -2
- package/theme/ThemeProvider.js.map +1 -1
- package/theme/ThemeProvider.mjs +2 -2
- package/theme/ThemeProvider.mjs.map +1 -1
- package/hooks/useScrollbar.d.ts +0 -11
- package/hooks/useScrollbar.js +0 -32
- package/hooks/useScrollbar.js.map +0 -1
- package/hooks/useScrollbar.mjs +0 -32
- package/hooks/useScrollbar.mjs.map +0 -1
package/AppRoot/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),jsxRuntime=require('react/jsx-runtime'),React=require('react'),index$1=require('../theme/index.js'),BreakpointProvider=require('../breakpoint/BreakpointProvider.js'),index=require('../css/index.js'),
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),jsxRuntime=require('react/jsx-runtime'),React=require('react'),index$1=require('../theme/index.js'),BreakpointProvider=require('../breakpoint/BreakpointProvider.js'),index=require('../css/index.js'),Renderar=require('./Renderar.js'),ServerStyleTag=require('../Tag/ServerStyleTag.js'),ThemeProvider=require('../theme/ThemeProvider.js');const appRootClassName = "xui-app-root";
|
|
2
2
|
const appRootElement = () => document.querySelector(`.${appRootClassName}`);
|
|
3
3
|
const AppRoot = React.forwardRef((_a, ref) => {
|
|
4
4
|
var { children, noScrollbarCss, theme } = _a, props = tslib.__rest(_a, ["children", "noScrollbarCss", "theme"]);
|
|
@@ -7,8 +7,32 @@ const AppRoot = React.forwardRef((_a, ref) => {
|
|
|
7
7
|
const scrollbarCss = React.useMemo(() => {
|
|
8
8
|
if (noScrollbarCss)
|
|
9
9
|
return;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const cls = (cls) => `${index$1.themeRootClass(theme)} ${cls}`;
|
|
11
|
+
let thumbSize = 8;
|
|
12
|
+
let thumbColor = "var(--color-text-secondary)";
|
|
13
|
+
let trackColor = "transparent";
|
|
14
|
+
return index.css({
|
|
15
|
+
"@global": {
|
|
16
|
+
[cls('*::-webkit-scrollbar')]: {
|
|
17
|
+
width: thumbSize,
|
|
18
|
+
height: thumbSize,
|
|
19
|
+
},
|
|
20
|
+
[cls("*::-webkit-scrollbar-thumb")]: {
|
|
21
|
+
backgroundColor: thumbColor,
|
|
22
|
+
borderRadius: "6px",
|
|
23
|
+
opacity: 0.6,
|
|
24
|
+
},
|
|
25
|
+
[cls("*::-webkit-scrollbar-thumb:hover")]: {
|
|
26
|
+
backgroundColor: thumbColor,
|
|
27
|
+
opacity: 0.0,
|
|
28
|
+
},
|
|
29
|
+
[cls("*::-webkit-scrollbar-track")]: {
|
|
30
|
+
backgroundColor: trackColor,
|
|
31
|
+
borderRadius: "6px",
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
injectStyle: typeof window !== 'undefined'
|
|
12
36
|
});
|
|
13
37
|
}, [noScrollbarCss, theme]);
|
|
14
38
|
const globalStyle = React.useMemo(() => {
|
|
@@ -74,5 +98,5 @@ const AppRoot = React.forwardRef((_a, ref) => {
|
|
|
74
98
|
head.appendChild(style);
|
|
75
99
|
});
|
|
76
100
|
}, []);
|
|
77
|
-
return (jsxRuntime.jsxs(ThemeProvider.default, Object.assign({ ref: ref, theme: theme }, props, { sx: Object.assign(Object.assign({}, props.sx), (visibility === "hidden" ? { visibility: "hidden" } : {})), classNames: [appRootClassName], children: [
|
|
101
|
+
return (jsxRuntime.jsxs(ThemeProvider.default, Object.assign({ ref: ref, theme: theme }, props, { sx: Object.assign(Object.assign({}, props.sx), (visibility === "hidden" ? { visibility: "hidden" } : {})), classNames: [appRootClassName], children: [jsxRuntime.jsx(ServerStyleTag.default, { factory: globalStyle }), scrollbarCss && jsxRuntime.jsx(ServerStyleTag.default, { factory: scrollbarCss }), jsxRuntime.jsxs(BreakpointProvider.BreakpointProvider, { children: [children, jsxRuntime.jsx(Renderar.RenderRenderar, {})] })] })));
|
|
78
102
|
});exports.appRootElement=appRootElement;exports.default=AppRoot;//# sourceMappingURL=index.js.map
|
package/AppRoot/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps, themeRootClass } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { css } from '../css';\nimport { RenderRenderar } from './Renderar';\nimport ServerStyleTag from '../Tag/ServerStyleTag';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n}\n\nconst appRootClassName = \"xui-app-root\"\nexport const appRootElement = () => document.querySelector(`.${appRootClassName}`) as HTMLDivElement;\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, noScrollbarCss, theme, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n noScrollbarCss ??= false\n const [visibility, setVisibility] = React.useState<string>(\"hidden\");\n\n const scrollbarCss: any = useMemo(() => {\n if (noScrollbarCss) return;\n const cls = (cls: string) => `${themeRootClass(theme)} ${cls}`\n let thumbSize = 8\n let thumbColor = \"var(--color-text-secondary)\"\n let trackColor = \"transparent\"\n\n return css({\n \"@global\": {\n [cls('*::-webkit-scrollbar')]: {\n width: thumbSize,\n height: thumbSize,\n },\n [cls(\"*::-webkit-scrollbar-thumb\")]: {\n backgroundColor: thumbColor,\n borderRadius: \"6px\",\n opacity: 0.6,\n },\n [cls(\"*::-webkit-scrollbar-thumb:hover\")]: {\n backgroundColor: thumbColor,\n opacity: 0.0,\n },\n [cls(\"*::-webkit-scrollbar-track\")]: {\n backgroundColor: trackColor,\n borderRadius: \"6px\",\n },\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n }) as any\n }, [noScrollbarCss, theme])\n\n const globalStyle = useMemo(() => {\n return css({\n \"@global\": {\n \"*\": {\n m: 0,\n p: 0,\n outline: \"none\",\n boxSizing: \"border-box\",\n verticalAlign: \"baseline\",\n },\n \"html, body\": {\n minHeight: \"100%\",\n \"-webkit-font-smoothing\": \"antialiased\",\n \"-moz-osx-font-smoothing\": \"grayscale\",\n } as any,\n \"img, picture, video, canvas, svg\": {\n maxWidth: \"100%\",\n display: \"block\"\n },\n \"input, button, textarea, select\": {\n font: \"inherit\"\n },\n \"table\": {\n borderCollapse: \"collapse\",\n borderSpacing: 0,\n },\n \"ol, ul\": {\n listStyle: \"none\",\n padding: 0,\n margin: 0,\n },\n \"a\": {\n display: \"inline-block\",\n color: \"inherit\",\n textDecoration: \"none\",\n cursor: \"pointer\",\n \"&:hover\": {\n textDecoration: \"underline\"\n }\n },\n \"p, h1, h2, h3, h4, h5, h6\": {\n overflowWrap: \"break-word\",\n },\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n })\n }, [])\n\n useEffect(() => {\n\n const root = document.querySelectorAll(`.${appRootClassName}`)\n if (!root || root.length > 1) {\n throw new Error(\"Multiple AppRoot detected in the application tree. Please ensure that there is only one AppRoot component wrapping your application.\");\n }\n\n setVisibility(\"visible\");\n\n // move oncss style tags to head\n if (typeof window === 'undefined') return;\n const head = document.getElementsByTagName('head')[0];\n const styles = Array.from(document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n head.appendChild(style);\n });\n\n }, [])\n\n return (\n <ThemeProvider\n ref={ref}\n theme={theme}\n {...props}\n sx={{\n ...props.sx,\n ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {})\n }}\n classNames={[appRootClassName]}\n >\n <ServerStyleTag factory={globalStyle} />\n {\n scrollbarCss && <ServerStyleTag factory={scrollbarCss} />\n }\n <BreakpointProvider>\n {children}\n <RenderRenderar />\n </BreakpointProvider>\n </ThemeProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":["__rest","useMemo","themeRootClass","css","useEffect","_jsxs","ThemeProvider","_jsx","ServerStyleTag","BreakpointProvider","RenderRenderar"],"mappings":"gbAYA,MAAM,gBAAgB,GAAG,cAAc;AAChC,MAAM,cAAc,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,CAAA,CAAA,EAAI,gBAAgB,CAAA,CAAE;AAEjF,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,CAAqC,EAA8D,EAAE,GAAmB,KAAI;QAAvF,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,OAA6B,EAAxB,KAAK,GAAAA,YAAA,CAAA,EAAA,EAA3C,CAAA,UAAA,EAAA,gBAAA,EAAA,OAAA,CAA6C,CAAF;IAC9G,cAAc,KAAA,IAAA,IAAd,cAAc,KAAA,MAAA,GAAd,cAAc,IAAd,cAAc,GAAK,KAAK,CAAA;AACxB,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,QAAQ,CAAC;AAEpE,IAAA,MAAM,YAAY,GAAQC,aAAO,CAAC,MAAK;AACpC,QAAA,IAAI,cAAc;YAAE;AACpB,QAAA,MAAM,GAAG,GAAG,CAAC,GAAW,KAAK,CAAA,EAAGC,sBAAc,CAAC,KAAK,CAAC,CAAA,CAAA,EAAI,GAAG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AAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;AAC9E,QAAA,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACtB,YAAA,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC1B,QAAA,CAAC,CAAC;IAEL,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,QACGC,eAAA,CAACC,qBAAa,EAAA,MAAA,CAAA,MAAA,CAAA,EACX,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EAAA,EACR,KAAK,EAAA,EACT,EAAE,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACI,KAAK,CAAC,EAAE,CAAA,GACP,UAAU,KAAK,QAAQ,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAC,EAE/D,UAAU,EAAE,CAAC,gBAAgB,CAAC,EAAA,QAAA,EAAA,CAE9BC,cAAA,CAACC,sBAAc,EAAA,EAAC,OAAO,EAAE,WAAW,EAAA,CAAI,EAErC,YAAY,IAAID,cAAA,CAACC,sBAAc,EAAA,EAAC,OAAO,EAAE,YAAY,EAAA,CAAI,EAE5DH,gBAACI,qCAAkB,EAAA,EAAA,QAAA,EAAA,CACf,QAAQ,EACTF,eAACG,uBAAc,EAAA,EAAA,CAAG,CAAA,EAAA,CACA,CAAA,EAAA,CAAA,CACR;AAEtB,CAAC"}
|
package/AppRoot/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {__rest}from'tslib';import {jsxs,
|
|
1
|
+
import {__rest}from'tslib';import {jsxs,jsx}from'react/jsx-runtime';import React__default,{useMemo,useEffect}from'react';import {themeRootClass}from'../theme/index.mjs';import {BreakpointProvider}from'../breakpoint/BreakpointProvider.mjs';import {css}from'../css/index.mjs';import {RenderRenderar}from'./Renderar.mjs';import ServerStyleTag from'../Tag/ServerStyleTag.mjs';import ThemeProvider from'../theme/ThemeProvider.mjs';const appRootClassName = "xui-app-root";
|
|
2
2
|
const appRootElement = () => document.querySelector(`.${appRootClassName}`);
|
|
3
3
|
const AppRoot = React__default.forwardRef((_a, ref) => {
|
|
4
4
|
var { children, noScrollbarCss, theme } = _a, props = __rest(_a, ["children", "noScrollbarCss", "theme"]);
|
|
@@ -7,8 +7,32 @@ const AppRoot = React__default.forwardRef((_a, ref) => {
|
|
|
7
7
|
const scrollbarCss = useMemo(() => {
|
|
8
8
|
if (noScrollbarCss)
|
|
9
9
|
return;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const cls = (cls) => `${themeRootClass(theme)} ${cls}`;
|
|
11
|
+
let thumbSize = 8;
|
|
12
|
+
let thumbColor = "var(--color-text-secondary)";
|
|
13
|
+
let trackColor = "transparent";
|
|
14
|
+
return css({
|
|
15
|
+
"@global": {
|
|
16
|
+
[cls('*::-webkit-scrollbar')]: {
|
|
17
|
+
width: thumbSize,
|
|
18
|
+
height: thumbSize,
|
|
19
|
+
},
|
|
20
|
+
[cls("*::-webkit-scrollbar-thumb")]: {
|
|
21
|
+
backgroundColor: thumbColor,
|
|
22
|
+
borderRadius: "6px",
|
|
23
|
+
opacity: 0.6,
|
|
24
|
+
},
|
|
25
|
+
[cls("*::-webkit-scrollbar-thumb:hover")]: {
|
|
26
|
+
backgroundColor: thumbColor,
|
|
27
|
+
opacity: 0.0,
|
|
28
|
+
},
|
|
29
|
+
[cls("*::-webkit-scrollbar-track")]: {
|
|
30
|
+
backgroundColor: trackColor,
|
|
31
|
+
borderRadius: "6px",
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
injectStyle: typeof window !== 'undefined'
|
|
12
36
|
});
|
|
13
37
|
}, [noScrollbarCss, theme]);
|
|
14
38
|
const globalStyle = useMemo(() => {
|
|
@@ -74,5 +98,5 @@ const AppRoot = React__default.forwardRef((_a, ref) => {
|
|
|
74
98
|
head.appendChild(style);
|
|
75
99
|
});
|
|
76
100
|
}, []);
|
|
77
|
-
return (jsxs(ThemeProvider, Object.assign({ ref: ref, theme: theme }, props, { sx: Object.assign(Object.assign({}, props.sx), (visibility === "hidden" ? { visibility: "hidden" } : {})), classNames: [appRootClassName], children: [
|
|
101
|
+
return (jsxs(ThemeProvider, Object.assign({ ref: ref, theme: theme }, props, { sx: Object.assign(Object.assign({}, props.sx), (visibility === "hidden" ? { visibility: "hidden" } : {})), classNames: [appRootClassName], children: [jsx(ServerStyleTag, { factory: globalStyle }), scrollbarCss && jsx(ServerStyleTag, { factory: scrollbarCss }), jsxs(BreakpointProvider, { children: [children, jsx(RenderRenderar, {})] })] })));
|
|
78
102
|
});export{appRootElement,AppRoot as default};//# sourceMappingURL=index.mjs.map
|
package/AppRoot/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps, themeRootClass } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { css } from '../css';\nimport { RenderRenderar } from './Renderar';\nimport ServerStyleTag from '../Tag/ServerStyleTag';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n}\n\nconst appRootClassName = \"xui-app-root\"\nexport const appRootElement = () => document.querySelector(`.${appRootClassName}`) as HTMLDivElement;\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, noScrollbarCss, theme, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n noScrollbarCss ??= false\n const [visibility, setVisibility] = React.useState<string>(\"hidden\");\n\n const scrollbarCss: any = useMemo(() => {\n if (noScrollbarCss) return;\n const cls = (cls: string) => `${themeRootClass(theme)} ${cls}`\n let thumbSize = 8\n let thumbColor = \"var(--color-text-secondary)\"\n let trackColor = \"transparent\"\n\n return css({\n \"@global\": {\n [cls('*::-webkit-scrollbar')]: {\n width: thumbSize,\n height: thumbSize,\n },\n [cls(\"*::-webkit-scrollbar-thumb\")]: {\n backgroundColor: thumbColor,\n borderRadius: \"6px\",\n opacity: 0.6,\n },\n [cls(\"*::-webkit-scrollbar-thumb:hover\")]: {\n backgroundColor: thumbColor,\n opacity: 0.0,\n },\n [cls(\"*::-webkit-scrollbar-track\")]: {\n backgroundColor: trackColor,\n borderRadius: \"6px\",\n },\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n }) as any\n }, [noScrollbarCss, theme])\n\n const globalStyle = useMemo(() => {\n return css({\n \"@global\": {\n \"*\": {\n m: 0,\n p: 0,\n outline: \"none\",\n boxSizing: \"border-box\",\n verticalAlign: \"baseline\",\n },\n \"html, body\": {\n minHeight: \"100%\",\n \"-webkit-font-smoothing\": \"antialiased\",\n \"-moz-osx-font-smoothing\": \"grayscale\",\n } as any,\n \"img, picture, video, canvas, svg\": {\n maxWidth: \"100%\",\n display: \"block\"\n },\n \"input, button, textarea, select\": {\n font: \"inherit\"\n },\n \"table\": {\n borderCollapse: \"collapse\",\n borderSpacing: 0,\n },\n \"ol, ul\": {\n listStyle: \"none\",\n padding: 0,\n margin: 0,\n },\n \"a\": {\n display: \"inline-block\",\n color: \"inherit\",\n textDecoration: \"none\",\n cursor: \"pointer\",\n \"&:hover\": {\n textDecoration: \"underline\"\n }\n },\n \"p, h1, h2, h3, h4, h5, h6\": {\n overflowWrap: \"break-word\",\n },\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n })\n }, [])\n\n useEffect(() => {\n\n const root = document.querySelectorAll(`.${appRootClassName}`)\n if (!root || root.length > 1) {\n throw new Error(\"Multiple AppRoot detected in the application tree. Please ensure that there is only one AppRoot component wrapping your application.\");\n }\n\n setVisibility(\"visible\");\n\n // move oncss style tags to head\n if (typeof window === 'undefined') return;\n const head = document.getElementsByTagName('head')[0];\n const styles = Array.from(document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n head.appendChild(style);\n });\n\n }, [])\n\n return (\n <ThemeProvider\n ref={ref}\n theme={theme}\n {...props}\n sx={{\n ...props.sx,\n ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {})\n }}\n classNames={[appRootClassName]}\n >\n <ServerStyleTag factory={globalStyle} />\n {\n scrollbarCss && <ServerStyleTag factory={scrollbarCss} />\n }\n <BreakpointProvider>\n {children}\n <RenderRenderar />\n </BreakpointProvider>\n </ThemeProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":["React","_jsxs","_jsx"],"mappings":"0aAYA,MAAM,gBAAgB,GAAG,cAAc;AAChC,MAAM,cAAc,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,CAAA,CAAA,EAAI,gBAAgB,CAAA,CAAE;AAEjF,MAAM,OAAO,GAAGA,cAAK,CAAC,UAAU,CAAC,CAAqC,EAA8D,EAAE,GAAmB,KAAI;QAAvF,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,OAA6B,EAAxB,KAAK,GAAA,MAAA,CAAA,EAAA,EAA3C,CAAA,UAAA,EAAA,gBAAA,EAAA,OAAA,CAA6C,CAAF;IAC9G,cAAc,KAAA,IAAA,IAAd,cAAc,KAAA,MAAA,GAAd,cAAc,IAAd,cAAc,GAAK,KAAK,CAAA;AACxB,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAAS,QAAQ,CAAC;AAEpE,IAAA,MAAM,YAAY,GAAQ,OAAO,CAAC,MAAK;AACpC,QAAA,IAAI,cAAc;YAAE;AACpB,QAAA,MAAM,GAAG,GAAG,CAAC,GAAW,KAAK,CAAA,EAAG,cAAc,CAAC,KAAK,CAAC,CAAA,CAAA,EAAI,GAAG,EAAE;QAC9D,IAAI,SAAS,GAAG,CAAC;QACjB,IAAI,UAAU,GAAG,6BAA6B;QAC9C,I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CAAC;AAC9E,QAAA,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACtB,YAAA,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC1B,QAAA,CAAC,CAAC;IAEL,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,QACGC,IAAA,CAAC,aAAa,EAAA,MAAA,CAAA,MAAA,CAAA,EACX,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EAAA,EACR,KAAK,EAAA,EACT,EAAE,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACI,KAAK,CAAC,EAAE,CAAA,GACP,UAAU,KAAK,QAAQ,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAC,EAE/D,UAAU,EAAE,CAAC,gBAAgB,CAAC,EAAA,QAAA,EAAA,CAE9BC,GAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAE,WAAW,EAAA,CAAI,EAErC,YAAY,IAAIA,GAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAE,YAAY,EAAA,CAAI,EAE5DD,KAAC,kBAAkB,EAAA,EAAA,QAAA,EAAA,CACf,QAAQ,EACTC,IAAC,cAAc,EAAA,EAAA,CAAG,CAAA,EAAA,CACA,CAAA,EAAA,CAAA,CACR;AAEtB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var jsxRuntime=require('react/jsx-runtime');const ServerStyleTag = ({ factory }) => {
|
|
2
|
+
if (typeof window === 'undefined') {
|
|
3
|
+
return jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: factory.css }, precedence: factory.classname, href: factory.classname });
|
|
4
|
+
}
|
|
5
|
+
return null;
|
|
6
|
+
};exports.default=ServerStyleTag;//# sourceMappingURL=ServerStyleTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerStyleTag.js","sources":["../../src/Tag/ServerStyleTag.tsx"],"sourcesContent":["import { CSSFactoryType } from 'oncss'\nimport React from 'react'\n\nconst ServerStyleTag = ({ factory }: { factory: CSSFactoryType }) => {\n if (typeof window === 'undefined') {\n return <style\n dangerouslySetInnerHTML={{ __html: factory.css }}\n precedence={factory.classname}\n href={factory.classname}\n />\n }\n return null\n}\n\nexport default ServerStyleTag\n"],"names":["_jsx"],"mappings":"kHAGA,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAA+B,KAAI;AACjE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAChC,OAAOA,cAAA,CAAA,OAAA,EAAA,EACJ,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAChD,UAAU,EAAE,OAAO,CAAC,SAAS,EAC7B,IAAI,EAAE,OAAO,CAAC,SAAS,EAAA,CACxB;IACL;AACA,IAAA,OAAO,IAAI;AACd"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {jsx}from'react/jsx-runtime';const ServerStyleTag = ({ factory }) => {
|
|
2
|
+
if (typeof window === 'undefined') {
|
|
3
|
+
return jsx("style", { dangerouslySetInnerHTML: { __html: factory.css }, precedence: factory.classname, href: factory.classname });
|
|
4
|
+
}
|
|
5
|
+
return null;
|
|
6
|
+
};export{ServerStyleTag as default};//# sourceMappingURL=ServerStyleTag.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerStyleTag.mjs","sources":["../../src/Tag/ServerStyleTag.tsx"],"sourcesContent":["import { CSSFactoryType } from 'oncss'\nimport React from 'react'\n\nconst ServerStyleTag = ({ factory }: { factory: CSSFactoryType }) => {\n if (typeof window === 'undefined') {\n return <style\n dangerouslySetInnerHTML={{ __html: factory.css }}\n precedence={factory.classname}\n href={factory.classname}\n />\n }\n return null\n}\n\nexport default ServerStyleTag\n"],"names":["_jsx"],"mappings":"oCAGA,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAA+B,KAAI;AACjE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAChC,OAAOA,GAAA,CAAA,OAAA,EAAA,EACJ,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAChD,UAAU,EAAE,OAAO,CAAC,SAAS,EAC7B,IAAI,EAAE,OAAO,CAAC,SAAS,EAAA,CACxB;IACL;AACA,IAAA,OAAO,IAAI;AACd"}
|
package/Tag/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),jsxRuntime=require('react/jsx-runtime'),React=require('react'),useTagProps=require('./useTagProps.js');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var React__namespace=/*#__PURE__*/_interopNamespaceDefault(React);const Tag = React__namespace.forwardRef((_a, ref) => {
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),jsxRuntime=require('react/jsx-runtime'),React=require('react'),useTagProps=require('./useTagProps.js'),ServerStyleTag=require('./ServerStyleTag.js');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var React__namespace=/*#__PURE__*/_interopNamespaceDefault(React);const Tag = React__namespace.forwardRef((_a, ref) => {
|
|
2
2
|
var { component, children } = _a, rest = tslib.__rest(_a, ["component", "children"]);
|
|
3
3
|
const { props, style } = useTagProps.default(rest);
|
|
4
4
|
props.ref = ref;
|
|
5
5
|
const ele = React__namespace.createElement(component || "div", props, children);
|
|
6
6
|
if (typeof window === 'undefined') {
|
|
7
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
|
7
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ServerStyleTag.default, { factory: style }), ele] }));
|
|
8
8
|
}
|
|
9
9
|
return ele;
|
|
10
10
|
});exports.default=Tag;//# sourceMappingURL=index.js.map
|
package/Tag/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Tag/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { TagComponentType, TagPropsRoot } from './types';\nimport useTagProps from './useTagProps';\n\nconst Tag = React.forwardRef(<T extends TagComponentType = 'div'>({ component, children, ...rest }: TagPropsRoot<T>, ref: React.Ref<any>) => {\n const { props, style }: any = useTagProps(rest)\n props.ref = ref\n const ele = React.createElement(component || \"div\", props, children)\n if (typeof window === 'undefined') {\n return (\n <>\n <
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Tag/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { TagComponentType, TagPropsRoot } from './types';\nimport useTagProps from './useTagProps';\nimport ServerStyleTag from './ServerStyleTag';\n\nconst Tag = React.forwardRef(<T extends TagComponentType = 'div'>({ component, children, ...rest }: TagPropsRoot<T>, ref: React.Ref<any>) => {\n const { props, style }: any = useTagProps(rest)\n props.ref = ref\n const ele = React.createElement(component || \"div\", props, children)\n if (typeof window === 'undefined') {\n return (\n <>\n <ServerStyleTag factory={style} />\n {ele}\n </>\n )\n }\n return ele\n})\n\nexport default Tag"],"names":["React","__rest","useTagProps","_jsxs","_Fragment","_jsx","ServerStyleTag"],"mappings":"slBAKA,MAAM,GAAG,GAAGA,gBAAK,CAAC,UAAU,CAAC,CAAqC,EAAiD,EAAE,GAAmB,KAAI;QAA1E,EAAE,SAAS,EAAE,QAAQ,EAAA,GAAA,EAA4B,EAAvB,IAAI,GAAAC,YAAA,CAAA,EAAA,EAA9B,yBAAgC,CAAF;IAC5F,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAQC,mBAAW,CAAC,IAAI,CAAC;AAC/C,IAAA,KAAK,CAAC,GAAG,GAAG,GAAG;AACf,IAAA,MAAM,GAAG,GAAGF,gBAAK,CAAC,aAAa,CAAC,SAAS,IAAI,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAC/B,QAAA,QACIG,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACIC,cAAA,CAACC,sBAAc,EAAA,EAAC,OAAO,EAAE,KAAK,EAAA,CAAI,EACjC,GAAG,CAAA,EAAA,CACL;IAEX;AACA,IAAA,OAAO,GAAG;AACd,CAAC"}
|
package/Tag/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {__rest}from'tslib';import {jsxs,Fragment,jsx}from'react/jsx-runtime';import*as React from'react';import useTagProps from'./useTagProps.mjs';const Tag = React.forwardRef((_a, ref) => {
|
|
1
|
+
import {__rest}from'tslib';import {jsxs,Fragment,jsx}from'react/jsx-runtime';import*as React from'react';import useTagProps from'./useTagProps.mjs';import ServerStyleTag from'./ServerStyleTag.mjs';const Tag = React.forwardRef((_a, ref) => {
|
|
2
2
|
var { component, children } = _a, rest = __rest(_a, ["component", "children"]);
|
|
3
3
|
const { props, style } = useTagProps(rest);
|
|
4
4
|
props.ref = ref;
|
|
5
5
|
const ele = React.createElement(component || "div", props, children);
|
|
6
6
|
if (typeof window === 'undefined') {
|
|
7
|
-
return (jsxs(Fragment, { children: [jsx(
|
|
7
|
+
return (jsxs(Fragment, { children: [jsx(ServerStyleTag, { factory: style }), ele] }));
|
|
8
8
|
}
|
|
9
9
|
return ele;
|
|
10
10
|
});export{Tag as default};//# sourceMappingURL=index.mjs.map
|
package/Tag/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/Tag/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { TagComponentType, TagPropsRoot } from './types';\nimport useTagProps from './useTagProps';\n\nconst Tag = React.forwardRef(<T extends TagComponentType = 'div'>({ component, children, ...rest }: TagPropsRoot<T>, ref: React.Ref<any>) => {\n const { props, style }: any = useTagProps(rest)\n props.ref = ref\n const ele = React.createElement(component || \"div\", props, children)\n if (typeof window === 'undefined') {\n return (\n <>\n <
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/Tag/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { TagComponentType, TagPropsRoot } from './types';\nimport useTagProps from './useTagProps';\nimport ServerStyleTag from './ServerStyleTag';\n\nconst Tag = React.forwardRef(<T extends TagComponentType = 'div'>({ component, children, ...rest }: TagPropsRoot<T>, ref: React.Ref<any>) => {\n const { props, style }: any = useTagProps(rest)\n props.ref = ref\n const ele = React.createElement(component || \"div\", props, children)\n if (typeof window === 'undefined') {\n return (\n <>\n <ServerStyleTag factory={style} />\n {ele}\n </>\n )\n }\n return ele\n})\n\nexport default Tag"],"names":["_jsxs","_Fragment","_jsx"],"mappings":"qMAKA,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,CAAqC,EAAiD,EAAE,GAAmB,KAAI;QAA1E,EAAE,SAAS,EAAE,QAAQ,EAAA,GAAA,EAA4B,EAAvB,IAAI,GAAA,MAAA,CAAA,EAAA,EAA9B,yBAAgC,CAAF;IAC5F,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAQ,WAAW,CAAC,IAAI,CAAC;AAC/C,IAAA,KAAK,CAAC,GAAG,GAAG,GAAG;AACf,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,IAAI,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAC/B,QAAA,QACIA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACIC,GAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAE,KAAK,EAAA,CAAI,EACjC,GAAG,CAAA,EAAA,CACL;IAEX;AACA,IAAA,OAAO,GAAG;AACd,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export { default as useBreakpoint } from './breakpoint/useBreakpoint.js';
|
|
|
6
6
|
export { default as useBreakpointProps, useBreakpointPropsType } from './breakpoint/useBreakpointProps.js';
|
|
7
7
|
export { default as useInterface } from './hooks/useInterface.js';
|
|
8
8
|
export { default as Transition, TransitionElementProps, TransitionProps, TransitionState, TransitionVariantTypes } from './Transition/index.js';
|
|
9
|
-
export { default as useScrollbar } from './hooks/useScrollbar.js';
|
|
10
9
|
export { default as AppRoot, AppRootProps, appRootElement } from './AppRoot/index.js';
|
|
11
10
|
export { default as usePortal } from './hooks/usePortal.js';
|
|
12
11
|
export { Renderar } from './AppRoot/Renderar.js';
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var index$1=require('./Tag/index.js'),useTagProps=require('./Tag/useTagProps.js'),useAnimation=require('./hooks/useAnimation.js'),useColorTemplate=require('./hooks/useColorTemplate.js'),useBreakpoint=require('./breakpoint/useBreakpoint.js'),useBreakpointProps=require('./breakpoint/useBreakpointProps.js'),useInterface=require('./hooks/useInterface.js'),index$2=require('./Transition/index.js'),
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var index$1=require('./Tag/index.js'),useTagProps=require('./Tag/useTagProps.js'),useAnimation=require('./hooks/useAnimation.js'),useColorTemplate=require('./hooks/useColorTemplate.js'),useBreakpoint=require('./breakpoint/useBreakpoint.js'),useBreakpointProps=require('./breakpoint/useBreakpointProps.js'),useInterface=require('./hooks/useInterface.js'),index$2=require('./Transition/index.js'),index=require('./AppRoot/index.js'),usePortal=require('./hooks/usePortal.js'),Renderar=require('./AppRoot/Renderar.js'),index$3=require('./css/index.js'),index$4=require('./theme/index.js'),getValue=require('./css/getValue.js'),getProps=require('./css/getProps.js'),ThemeProvider=require('./theme/ThemeProvider.js'),createThemeSwitcher=require('./theme/createThemeSwitcher.js'),createTheme=require('./theme/createTheme.js'),core=require('./theme/core.js');exports.Tag=index$1.default;exports.useTagProps=useTagProps.default;exports.animationEases=useAnimation.animationEases;exports.useAnimation=useAnimation.default;exports.useColorTemplate=useColorTemplate.default;exports.useBreakpoint=useBreakpoint.default;exports.useBreakpointProps=useBreakpointProps.default;exports.useInterface=useInterface.default;exports.Transition=index$2.default;exports.AppRoot=index.default;exports.appRootElement=index.appRootElement;exports.usePortal=usePortal.usePortal;exports.Renderar=Renderar.Renderar;exports.adjustColor=index$3.adjustColor;exports.adjustTextContrast=index$3.adjustTextContrast;exports.alpha=index$3.alpha;exports.breakpoints=index$3.breakpoints;exports.css=index$3.css;exports.themeRootClass=index$4.themeRootClass;exports.getValue=getValue.default;exports.getProps=getProps.default;exports.ThemeProvider=ThemeProvider.default;exports.createThemeSwitcher=createThemeSwitcher.default;exports.createTheme=createTheme.createTheme;exports.getTheme=core.getTheme;exports.useTheme=core.useTheme;//# sourceMappingURL=index.js.map
|
package/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as Tag}from'./Tag/index.mjs';export{default as useTagProps}from'./Tag/useTagProps.mjs';export{animationEases,default as useAnimation}from'./hooks/useAnimation.mjs';export{default as useColorTemplate}from'./hooks/useColorTemplate.mjs';export{default as useBreakpoint}from'./breakpoint/useBreakpoint.mjs';export{default as useBreakpointProps}from'./breakpoint/useBreakpointProps.mjs';export{default as useInterface}from'./hooks/useInterface.mjs';export{default as Transition}from'./Transition/index.mjs';export{default as
|
|
1
|
+
export{default as Tag}from'./Tag/index.mjs';export{default as useTagProps}from'./Tag/useTagProps.mjs';export{animationEases,default as useAnimation}from'./hooks/useAnimation.mjs';export{default as useColorTemplate}from'./hooks/useColorTemplate.mjs';export{default as useBreakpoint}from'./breakpoint/useBreakpoint.mjs';export{default as useBreakpointProps}from'./breakpoint/useBreakpointProps.mjs';export{default as useInterface}from'./hooks/useInterface.mjs';export{default as Transition}from'./Transition/index.mjs';export{default as AppRoot,appRootElement}from'./AppRoot/index.mjs';export{usePortal}from'./hooks/usePortal.mjs';export{Renderar}from'./AppRoot/Renderar.mjs';export{adjustColor,adjustTextContrast,alpha,breakpoints,css}from'./css/index.mjs';export{themeRootClass}from'./theme/index.mjs';export{default as getValue}from'./css/getValue.mjs';export{default as getProps}from'./css/getProps.mjs';export{default as ThemeProvider}from'./theme/ThemeProvider.mjs';export{default as createThemeSwitcher}from'./theme/createThemeSwitcher.mjs';export{createTheme}from'./theme/createTheme.mjs';export{getTheme,useTheme}from'./theme/core.mjs';//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
package/theme/ThemeProvider.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),jsxRuntime=require('react/jsx-runtime'),React=require('react'),index$1=require('../Tag/index.js'),core=require('./core.js'),ThemeCssVars=require('./ThemeCssVars.js'),index=require('../css/index.js'),ThemeDefaultOptions=require('./ThemeDefaultOptions.js');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var React__namespace=/*#__PURE__*/_interopNamespaceDefault(React);ThemeDefaultOptions.createDefaultThemes();
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),jsxRuntime=require('react/jsx-runtime'),React=require('react'),index$1=require('../Tag/index.js'),core=require('./core.js'),ThemeCssVars=require('./ThemeCssVars.js'),index=require('../css/index.js'),ThemeDefaultOptions=require('./ThemeDefaultOptions.js'),ServerStyleTag=require('../Tag/ServerStyleTag.js');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var React__namespace=/*#__PURE__*/_interopNamespaceDefault(React);ThemeDefaultOptions.createDefaultThemes();
|
|
2
2
|
const ThemeProvider = (_a) => {
|
|
3
3
|
var { children, theme } = _a, props = tslib.__rest(_a, ["children", "theme"]);
|
|
4
4
|
let THEME = core.ThemeFactory.get(theme);
|
|
@@ -19,7 +19,7 @@ const ThemeProvider = (_a) => {
|
|
|
19
19
|
injectStyle: typeof window !== 'undefined'
|
|
20
20
|
});
|
|
21
21
|
}, [theme]);
|
|
22
|
-
return (jsxRuntime.jsxs(core.ThemeContex.Provider, { value: theme, children: [
|
|
22
|
+
return (jsxRuntime.jsxs(core.ThemeContex.Provider, { value: theme, children: [jsxRuntime.jsx(ServerStyleTag.default, { factory: globalStyle }), jsxRuntime.jsx(index$1.default, Object.assign({ minHeight: "100%", bgcolor: THEME.colors.background.primary, color: THEME.colors.text.primary, fontSize: THEME.typography.text.fontSize, fontWeight: THEME.typography.text.fontWeight, lineHeight: THEME.typography.text.lineHeight, fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
|
|
23
23
|
"& a": {
|
|
24
24
|
color: THEME.colors.brand.primary || 'inherit',
|
|
25
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex, ThemeFactory } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: string;\n}\n\ncreateDefaultThemes()\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\n let THEME = ThemeFactory.get(theme) as ThemeOptions\n if (!THEME) {\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\n }\n\n const globalStyle: any = React.useMemo(() => {\n const root_cls = `.xui-${theme}-theme-root`\n let gkeys = Object.keys(THEME.globalStyle || {})\n let gstyles: any = {}\n gkeys.forEach((key) => {\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\n })\n\n return css({\n \"@global\": {\n ...gstyles,\n [root_cls]: ThemeCssVars(THEME)\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n })\n }, [theme])\n\n return (\n <ThemeContex.Provider value={theme}>\n
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex, ThemeFactory } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\nimport ServerStyleTag from \"../Tag/ServerStyleTag\"\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: string;\n}\n\ncreateDefaultThemes()\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\n let THEME = ThemeFactory.get(theme) as ThemeOptions\n if (!THEME) {\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\n }\n\n const globalStyle: any = React.useMemo(() => {\n const root_cls = `.xui-${theme}-theme-root`\n let gkeys = Object.keys(THEME.globalStyle || {})\n let gstyles: any = {}\n gkeys.forEach((key) => {\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\n })\n\n return css({\n \"@global\": {\n ...gstyles,\n [root_cls]: ThemeCssVars(THEME)\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n })\n }, [theme])\n\n return (\n <ThemeContex.Provider value={theme}>\n <ServerStyleTag factory={globalStyle} />\n <Tag\n minHeight=\"100%\"\n bgcolor={THEME.colors.background.primary}\n color={THEME.colors.text.primary}\n fontSize={THEME.typography.text.fontSize}\n fontWeight={THEME.typography.text.fontWeight}\n lineHeight={THEME.typography.text.lineHeight}\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\n {...props}\n sxr={{\n \"& a\": {\n color: THEME.colors.brand.primary || 'inherit',\n },\n }}\n baseClass={`${theme}-theme-root`}\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n </Tag>\n </ThemeContex.Provider>\n )\n}\n\nexport default ThemeProvider"],"names":["createDefaultThemes","__rest","ThemeFactory","React","css","ThemeCssVars","_jsxs","ThemeContex","_jsx","ServerStyleTag","Tag"],"mappings":"mvBAcAA,uCAAmB,EAAE;AAErB,MAAM,aAAa,GAAG,CAAqC,EAAoD,KAAI;QAAxD,EAAE,QAAQ,EAAE,KAAK,EAAA,GAAA,EAAmC,EAA9B,KAAK,GAAAC,YAAA,CAAA,EAAA,EAA3B,qBAA6B,CAAF;IACnF,IAAI,KAAK,GAAGC,iBAAY,CAAC,GAAG,CAAC,KAAK,CAAiB;IACnD,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,KAAK,CAAA,6DAAA,CAA+D,CAAC;AAChH,QAAA,KAAK,GAAGA,iBAAY,CAAC,GAAG,CAAC,OAAO,CAAiB;IACpD;AAEA,IAAA,MAAM,WAAW,GAAQC,gBAAK,CAAC,OAAO,CAAC,MA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5C,UAAU,EAAE,CAAA,8FAAA,CAAgG,IACxG,KAAK,EAAA,EACT,GAAG,EAAE;AACF,oBAAA,KAAK,EAAE;wBACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,SAAS;AAChD,qBAAA;iBACH,EACD,SAAS,EAAE,CAAA,EAAG,KAAK,CAAA,WAAA,CAAa,EAChC,SAAS,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,GAAG,KAAK,YAEnC,QAAQ,EAAA,CAAA,CACN,CAAA,EAAA,CACc;AAE7B"}
|
package/theme/ThemeProvider.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {__rest}from'tslib';import {jsxs,jsx}from'react/jsx-runtime';import*as React from'react';import Tag from'../Tag/index.mjs';import {ThemeFactory,ThemeContex}from'./core.mjs';import ThemeCssVars from'./ThemeCssVars.mjs';import {css}from'../css/index.mjs';import {createDefaultThemes}from'./ThemeDefaultOptions.mjs';createDefaultThemes();
|
|
1
|
+
import {__rest}from'tslib';import {jsxs,jsx}from'react/jsx-runtime';import*as React from'react';import Tag from'../Tag/index.mjs';import {ThemeFactory,ThemeContex}from'./core.mjs';import ThemeCssVars from'./ThemeCssVars.mjs';import {css}from'../css/index.mjs';import {createDefaultThemes}from'./ThemeDefaultOptions.mjs';import ServerStyleTag from'../Tag/ServerStyleTag.mjs';createDefaultThemes();
|
|
2
2
|
const ThemeProvider = (_a) => {
|
|
3
3
|
var { children, theme } = _a, props = __rest(_a, ["children", "theme"]);
|
|
4
4
|
let THEME = ThemeFactory.get(theme);
|
|
@@ -19,7 +19,7 @@ const ThemeProvider = (_a) => {
|
|
|
19
19
|
injectStyle: typeof window !== 'undefined'
|
|
20
20
|
});
|
|
21
21
|
}, [theme]);
|
|
22
|
-
return (jsxs(ThemeContex.Provider, { value: theme, children: [
|
|
22
|
+
return (jsxs(ThemeContex.Provider, { value: theme, children: [jsx(ServerStyleTag, { factory: globalStyle }), jsx(Tag, Object.assign({ minHeight: "100%", bgcolor: THEME.colors.background.primary, color: THEME.colors.text.primary, fontSize: THEME.typography.text.fontSize, fontWeight: THEME.typography.text.fontWeight, lineHeight: THEME.typography.text.lineHeight, fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
|
|
23
23
|
"& a": {
|
|
24
24
|
color: THEME.colors.brand.primary || 'inherit',
|
|
25
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.mjs","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex, ThemeFactory } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: string;\n}\n\ncreateDefaultThemes()\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\n let THEME = ThemeFactory.get(theme) as ThemeOptions\n if (!THEME) {\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\n }\n\n const globalStyle: any = React.useMemo(() => {\n const root_cls = `.xui-${theme}-theme-root`\n let gkeys = Object.keys(THEME.globalStyle || {})\n let gstyles: any = {}\n gkeys.forEach((key) => {\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\n })\n\n return css({\n \"@global\": {\n ...gstyles,\n [root_cls]: ThemeCssVars(THEME)\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n })\n }, [theme])\n\n return (\n <ThemeContex.Provider value={theme}>\n
|
|
1
|
+
{"version":3,"file":"ThemeProvider.mjs","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex, ThemeFactory } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\nimport ServerStyleTag from \"../Tag/ServerStyleTag\"\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: string;\n}\n\ncreateDefaultThemes()\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\n let THEME = ThemeFactory.get(theme) as ThemeOptions\n if (!THEME) {\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\n }\n\n const globalStyle: any = React.useMemo(() => {\n const root_cls = `.xui-${theme}-theme-root`\n let gkeys = Object.keys(THEME.globalStyle || {})\n let gstyles: any = {}\n gkeys.forEach((key) => {\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\n })\n\n return css({\n \"@global\": {\n ...gstyles,\n [root_cls]: ThemeCssVars(THEME)\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n })\n }, [theme])\n\n return (\n <ThemeContex.Provider value={theme}>\n <ServerStyleTag factory={globalStyle} />\n <Tag\n minHeight=\"100%\"\n bgcolor={THEME.colors.background.primary}\n color={THEME.colors.text.primary}\n fontSize={THEME.typography.text.fontSize}\n fontWeight={THEME.typography.text.fontWeight}\n lineHeight={THEME.typography.text.lineHeight}\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\n {...props}\n sxr={{\n \"& a\": {\n color: THEME.colors.brand.primary || 'inherit',\n },\n }}\n baseClass={`${theme}-theme-root`}\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\n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K,CAAC,CAAC;AAEX,IAAA,QACGA,IAAA,CAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAA,QAAA,EAAA,CAC/BC,IAAC,cAAc,EAAA,EAAC,OAAO,EAAE,WAAW,GAAI,EACxCA,GAAA,CAAC,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EACD,SAAS,EAAC,MAAM,EAChB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,EACxC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAChC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EACxC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAC5C,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAC5C,UAAU,EAAE,CAAA,8FAAA,CAAgG,IACxG,KAAK,EAAA,EACT,GAAG,EAAE;AACF,oBAAA,KAAK,EAAE;wBACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,SAAS;AAChD,qBAAA;iBACH,EACD,SAAS,EAAE,CAAA,EAAG,KAAK,CAAA,WAAA,CAAa,EAChC,SAAS,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,GAAG,KAAK,YAEnC,QAAQ,EAAA,CAAA,CACN,CAAA,EAAA,CACc;AAE7B"}
|
package/hooks/useScrollbar.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type UseScrollbarOption = {
|
|
2
|
-
root_cls?: string;
|
|
3
|
-
thumbSize?: number;
|
|
4
|
-
thumbColor?: string;
|
|
5
|
-
trackColor?: string;
|
|
6
|
-
};
|
|
7
|
-
type ClassName = string;
|
|
8
|
-
declare const useScrollbar: ({ root_cls, thumbSize, thumbColor, trackColor }: UseScrollbarOption) => ClassName;
|
|
9
|
-
|
|
10
|
-
export { useScrollbar as default };
|
|
11
|
-
export type { UseScrollbarOption };
|
package/hooks/useScrollbar.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var index=require('../css/index.js');const useScrollbar = ({ root_cls, thumbSize, thumbColor, trackColor }) => {
|
|
2
|
-
thumbSize = thumbSize || 8;
|
|
3
|
-
thumbColor = thumbColor || "var(--color-common-subtext)";
|
|
4
|
-
trackColor = trackColor || "var(--color-common-lighter)";
|
|
5
|
-
const cls = (cls) => root_cls ? `${root_cls} ${cls}` : cls;
|
|
6
|
-
return index.css({
|
|
7
|
-
"@global": {
|
|
8
|
-
[cls('*::-webkit-scrollbar')]: {
|
|
9
|
-
width: thumbSize,
|
|
10
|
-
height: thumbSize,
|
|
11
|
-
cursor: "pointer",
|
|
12
|
-
},
|
|
13
|
-
[cls("*::-webkit-scrollbar-thumb")]: {
|
|
14
|
-
backgroundColor: thumbColor,
|
|
15
|
-
borderRadius: "6px",
|
|
16
|
-
},
|
|
17
|
-
[cls("*::-webkit-scrollbar-thumb:hover")]: {
|
|
18
|
-
backgroundColor: thumbColor,
|
|
19
|
-
},
|
|
20
|
-
[cls("*::-webkit-scrollbar-track")]: {
|
|
21
|
-
backgroundColor: trackColor,
|
|
22
|
-
borderRadius: "6px",
|
|
23
|
-
},
|
|
24
|
-
// [cls('*')]: {
|
|
25
|
-
// scrollbarWidth: "thin",
|
|
26
|
-
// scrollbarColor: `${thumbColor} ${trackColor}`,
|
|
27
|
-
// },
|
|
28
|
-
}
|
|
29
|
-
}, {
|
|
30
|
-
injectStyle: typeof window !== 'undefined'
|
|
31
|
-
});
|
|
32
|
-
};exports.default=useScrollbar;//# sourceMappingURL=useScrollbar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollbar.js","sources":["../../src/hooks/useScrollbar.ts"],"sourcesContent":["import { css } from '../css'\n\nexport type UseScrollbarOption = {\n root_cls?: string;\n thumbSize?: number\n thumbColor?: string\n trackColor?: string;\n}\n\ntype ClassName = string\n\nconst useScrollbar = ({ root_cls, thumbSize, thumbColor, trackColor }: UseScrollbarOption): ClassName => {\n\n thumbSize = thumbSize || 8\n thumbColor = thumbColor || \"var(--color-common-subtext)\"\n trackColor = trackColor || \"var(--color-common-lighter)\"\n\n const cls = (cls: string) => root_cls ? `${root_cls} ${cls}` : cls\n\n return css({\n \"@global\": {\n\n [cls('*::-webkit-scrollbar')]: {\n width: thumbSize,\n height: thumbSize,\n cursor: \"pointer\",\n },\n [cls(\"*::-webkit-scrollbar-thumb\")]: {\n backgroundColor: thumbColor,\n borderRadius: \"6px\",\n },\n [cls(\"*::-webkit-scrollbar-thumb:hover\")]: {\n backgroundColor: thumbColor,\n },\n [cls(\"*::-webkit-scrollbar-track\")]: {\n backgroundColor: trackColor,\n borderRadius: \"6px\",\n },\n // [cls('*')]: {\n // scrollbarWidth: \"thin\",\n // scrollbarColor: `${thumbColor} ${trackColor}`,\n // },\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n }) as any\n}\n\nexport default useScrollbar\n"],"names":["css"],"mappings":"2GAWA,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAsB,KAAe;AAErG,IAAA,SAAS,GAAG,SAAS,IAAI,CAAC;AAC1B,IAAA,UAAU,GAAG,UAAU,IAAI,6BAA6B;AACxD,IAAA,UAAU,GAAG,UAAU,IAAI,6BAA6B;IAExD,MAAM,GAAG,GAAG,CAAC,GAAW,KAAK,QAAQ,GAAG,CAAA,EAAG,QAAQ,IAAI,GAAG,CAAA,CAAE,GAAG,GAAG;AAElE,IAAA,OAAOA,SAAG,CAAC;AACR,QAAA,SAAS,EAAE;AAER,YAAA,CAAC,GAAG,CAAC,sBAAsB,CAAC,GAAG;AAC5B,gBAAA,KAAK,EAAE,SAAS;AAChB,gBAAA,MAAM,EAAE,SAAS;AACjB,gBAAA,MAAM,EAAE,SAAS;AACnB,aAAA;AACD,YAAA,CAAC,GAAG,CAAC,4BAA4B,CAAC,GAAG;AAClC,gBAAA,eAAe,EAAE,UAAU;AAC3B,gBAAA,YAAY,EAAE,KAAK;AACrB,aAAA;AACD,YAAA,CAAC,GAAG,CAAC,kCAAkC,CAAC,GAAG;AACxC,gBAAA,eAAe,EAAE,UAAU;AAC7B,aAAA;AACD,YAAA,CAAC,GAAG,CAAC,4BAA4B,CAAC,GAAG;AAClC,gBAAA,eAAe,EAAE,UAAU;AAC3B,gBAAA,YAAY,EAAE,KAAK;AACrB,aAAA;;;;;AAKH;KACH,EAAE;AACA,QAAA,WAAW,EAAE,OAAO,MAAM,KAAK;AACjC,KAAA,CAAQ;AACZ"}
|
package/hooks/useScrollbar.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {css}from'../css/index.mjs';const useScrollbar = ({ root_cls, thumbSize, thumbColor, trackColor }) => {
|
|
2
|
-
thumbSize = thumbSize || 8;
|
|
3
|
-
thumbColor = thumbColor || "var(--color-common-subtext)";
|
|
4
|
-
trackColor = trackColor || "var(--color-common-lighter)";
|
|
5
|
-
const cls = (cls) => root_cls ? `${root_cls} ${cls}` : cls;
|
|
6
|
-
return css({
|
|
7
|
-
"@global": {
|
|
8
|
-
[cls('*::-webkit-scrollbar')]: {
|
|
9
|
-
width: thumbSize,
|
|
10
|
-
height: thumbSize,
|
|
11
|
-
cursor: "pointer",
|
|
12
|
-
},
|
|
13
|
-
[cls("*::-webkit-scrollbar-thumb")]: {
|
|
14
|
-
backgroundColor: thumbColor,
|
|
15
|
-
borderRadius: "6px",
|
|
16
|
-
},
|
|
17
|
-
[cls("*::-webkit-scrollbar-thumb:hover")]: {
|
|
18
|
-
backgroundColor: thumbColor,
|
|
19
|
-
},
|
|
20
|
-
[cls("*::-webkit-scrollbar-track")]: {
|
|
21
|
-
backgroundColor: trackColor,
|
|
22
|
-
borderRadius: "6px",
|
|
23
|
-
},
|
|
24
|
-
// [cls('*')]: {
|
|
25
|
-
// scrollbarWidth: "thin",
|
|
26
|
-
// scrollbarColor: `${thumbColor} ${trackColor}`,
|
|
27
|
-
// },
|
|
28
|
-
}
|
|
29
|
-
}, {
|
|
30
|
-
injectStyle: typeof window !== 'undefined'
|
|
31
|
-
});
|
|
32
|
-
};export{useScrollbar as default};//# sourceMappingURL=useScrollbar.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollbar.mjs","sources":["../../src/hooks/useScrollbar.ts"],"sourcesContent":["import { css } from '../css'\n\nexport type UseScrollbarOption = {\n root_cls?: string;\n thumbSize?: number\n thumbColor?: string\n trackColor?: string;\n}\n\ntype ClassName = string\n\nconst useScrollbar = ({ root_cls, thumbSize, thumbColor, trackColor }: UseScrollbarOption): ClassName => {\n\n thumbSize = thumbSize || 8\n thumbColor = thumbColor || \"var(--color-common-subtext)\"\n trackColor = trackColor || \"var(--color-common-lighter)\"\n\n const cls = (cls: string) => root_cls ? `${root_cls} ${cls}` : cls\n\n return css({\n \"@global\": {\n\n [cls('*::-webkit-scrollbar')]: {\n width: thumbSize,\n height: thumbSize,\n cursor: \"pointer\",\n },\n [cls(\"*::-webkit-scrollbar-thumb\")]: {\n backgroundColor: thumbColor,\n borderRadius: \"6px\",\n },\n [cls(\"*::-webkit-scrollbar-thumb:hover\")]: {\n backgroundColor: thumbColor,\n },\n [cls(\"*::-webkit-scrollbar-track\")]: {\n backgroundColor: trackColor,\n borderRadius: \"6px\",\n },\n // [cls('*')]: {\n // scrollbarWidth: \"thin\",\n // scrollbarColor: `${thumbColor} ${trackColor}`,\n // },\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n }) as any\n}\n\nexport default useScrollbar\n"],"names":[],"mappings":"mCAWA,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAsB,KAAe;AAErG,IAAA,SAAS,GAAG,SAAS,IAAI,CAAC;AAC1B,IAAA,UAAU,GAAG,UAAU,IAAI,6BAA6B;AACxD,IAAA,UAAU,GAAG,UAAU,IAAI,6BAA6B;IAExD,MAAM,GAAG,GAAG,CAAC,GAAW,KAAK,QAAQ,GAAG,CAAA,EAAG,QAAQ,IAAI,GAAG,CAAA,CAAE,GAAG,GAAG;AAElE,IAAA,OAAO,GAAG,CAAC;AACR,QAAA,SAAS,EAAE;AAER,YAAA,CAAC,GAAG,CAAC,sBAAsB,CAAC,GAAG;AAC5B,gBAAA,KAAK,EAAE,SAAS;AAChB,gBAAA,MAAM,EAAE,SAAS;AACjB,gBAAA,MAAM,EAAE,SAAS;AACnB,aAAA;AACD,YAAA,CAAC,GAAG,CAAC,4BAA4B,CAAC,GAAG;AAClC,gBAAA,eAAe,EAAE,UAAU;AAC3B,gBAAA,YAAY,EAAE,KAAK;AACrB,aAAA;AACD,YAAA,CAAC,GAAG,CAAC,kCAAkC,CAAC,GAAG;AACxC,gBAAA,eAAe,EAAE,UAAU;AAC7B,aAAA;AACD,YAAA,CAAC,GAAG,CAAC,4BAA4B,CAAC,GAAG;AAClC,gBAAA,eAAe,EAAE,UAAU;AAC3B,gBAAA,YAAY,EAAE,KAAK;AACrB,aAAA;;;;;AAKH;KACH,EAAE;AACA,QAAA,WAAW,EAAE,OAAO,MAAM,KAAK;AACjC,KAAA,CAAQ;AACZ"}
|