@xanui/core 1.2.62 → 1.2.64
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.cjs +4 -4
- package/AppRoot/index.cjs.map +1 -1
- package/AppRoot/index.d.ts +1 -1
- package/AppRoot/index.js +4 -4
- package/AppRoot/index.js.map +1 -1
- package/Iframe/index.cjs +3 -2
- package/Iframe/index.cjs.map +1 -1
- package/Iframe/index.js +3 -2
- package/Iframe/index.js.map +1 -1
- package/hooks/useInterface.cjs +6 -1
- package/hooks/useInterface.cjs.map +1 -1
- package/hooks/useInterface.d.ts +2 -2
- package/hooks/useInterface.js +6 -1
- package/hooks/useInterface.js.map +1 -1
- package/index.cjs +1 -3
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -2
- package/index.js +1 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/theme/ThemeDefaultOptions.cjs +0 -7
- package/theme/ThemeDefaultOptions.cjs.map +1 -1
- package/theme/ThemeDefaultOptions.js +1 -7
- package/theme/ThemeDefaultOptions.js.map +1 -1
- package/theme/ThemeProvider.cjs +6 -13
- package/theme/ThemeProvider.cjs.map +1 -1
- package/theme/ThemeProvider.d.ts +3 -2
- package/theme/ThemeProvider.js +7 -14
- package/theme/ThemeProvider.js.map +1 -1
- package/theme/core.cjs +28 -20
- package/theme/core.cjs.map +1 -1
- package/theme/core.d.ts +4 -8
- package/theme/core.js +28 -19
- package/theme/core.js.map +1 -1
- package/theme/index.cjs +8 -3
- package/theme/index.cjs.map +1 -1
- package/theme/index.js +8 -2
- package/theme/index.js.map +1 -1
- package/theme/types.d.ts +1 -0
- package/theme/createTheme.cjs +0 -28
- package/theme/createTheme.cjs.map +0 -1
- package/theme/createTheme.d.ts +0 -5
- package/theme/createTheme.js +0 -26
- package/theme/createTheme.js.map +0 -1
package/AppRoot/index.cjs
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
var tslib = require('tslib');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var ThemeProvider = require('../theme/ThemeProvider.cjs');
|
|
7
8
|
require('../theme/core.cjs');
|
|
9
|
+
var BreakpointProvider = require('../breakpoint/BreakpointProvider.cjs');
|
|
8
10
|
require('../css/getValue.cjs');
|
|
9
11
|
require('oncss');
|
|
10
|
-
var ThemeProvider = require('../theme/ThemeProvider.cjs');
|
|
11
|
-
var BreakpointProvider = require('../breakpoint/BreakpointProvider.cjs');
|
|
12
12
|
var Renderar = require('./Renderar.cjs');
|
|
13
13
|
var index = require('../Document/index.cjs');
|
|
14
14
|
var AppRootProvider = require('./AppRootProvider.cjs');
|
|
@@ -35,7 +35,7 @@ const AppRoot = React.forwardRef((_a, ref) => {
|
|
|
35
35
|
React.useEffect(() => {
|
|
36
36
|
if (typeof _document === 'undefined')
|
|
37
37
|
return;
|
|
38
|
-
|
|
38
|
+
document.cookie = `xuitm=${theme.name};path=/`;
|
|
39
39
|
const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));
|
|
40
40
|
styles.forEach((style) => {
|
|
41
41
|
_document.head.appendChild(style);
|
|
@@ -52,7 +52,7 @@ const AppRoot = React.forwardRef((_a, ref) => {
|
|
|
52
52
|
}
|
|
53
53
|
return (jsxRuntime.jsx(index.DocumentProvider, { value: _document ? { document: _document, id: docid } : undefined, children: jsxRuntime.jsx(CSSCacheProvider.CSSCacheProvider, { cacheId: CSSCacheId, children: jsxRuntime.jsx(AppRootProvider.AppRootProvider, { element: () => rootRef.current, children: jsxRuntime.jsx(ThemeProvider, Object.assign({ theme: theme, onThemeChange: (t) => {
|
|
54
54
|
onThemeChange && onThemeChange(t);
|
|
55
|
-
document.cookie = `xuitm=${t};path=/`;
|
|
55
|
+
document.cookie = `xuitm=${t.name};path=/`;
|
|
56
56
|
} }, props, { ref: mergeRef, isRoot: true, sx: Object.assign(Object.assign(Object.assign({}, props.sx), (visibility === "hidden" ? { visibility: "hidden" } : {})), selection), children: jsxRuntime.jsxs(BreakpointProvider.BreakpointProvider, { defaultKey: defaultBreakpoint !== null && defaultBreakpoint !== void 0 ? defaultBreakpoint : "xl", children: [children, !disableRenderar && jsxRuntime.jsx(Renderar.RenderRenderar, {})] }) })) }) }) }));
|
|
57
57
|
});
|
|
58
58
|
|
package/AppRoot/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useLayoutEffect, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\nimport { BreakpointKeys } from '../css/types';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n defaultBreakpoint?: BreakpointKeys\n selectionColor?: \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\";\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n\n noScrollbarCss ??= false\n selectionColor ??= \"brand\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n const [visibility, setVisibility] = React.useState<string>(!defaultBreakpoint ? \"hidden\" : \"\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useLayoutEffect(() => {\n !defaultBreakpoint && setVisibility(\"\");\n }, [])\n\n useEffect(() => {\n if (typeof _document === 'undefined') return;\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useLayoutEffect, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\nimport { BreakpointKeys } from '../css/types';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n defaultBreakpoint?: BreakpointKeys\n selectionColor?: \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\";\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n\n noScrollbarCss ??= false\n selectionColor ??= \"brand\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n const [visibility, setVisibility] = React.useState<string>(!defaultBreakpoint ? \"hidden\" : \"\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useLayoutEffect(() => {\n !defaultBreakpoint && setVisibility(\"\");\n }, [])\n\n useEffect(() => {\n if (typeof _document === 'undefined') return;\n document.cookie = `xuitm=${theme.name};path=/`\n const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n _document.head.appendChild(style);\n });\n }, [])\n\n let selection: any = {}\n if (selectionColor && selectionColor !== 'default') {\n selection = {\n \"&::selection\": {\n bgcolor: `${selectionColor}.primary`,\n color: `${selectionColor}.text`\n }\n }\n }\n\n return (\n <DocumentProvider value={_document ? { document: _document, id: docid } : undefined}>\n <CSSCacheProvider cacheId={CSSCacheId}>\n <AppRootProvider element={() => rootRef.current}>\n <ThemeProvider\n theme={theme}\n onThemeChange={(t) => {\n onThemeChange && onThemeChange(t)\n document.cookie = `xuitm=${t.name};path=/`\n }}\n {...props}\n ref={mergeRef}\n isRoot\n sx={{\n ...props.sx,\n ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {}),\n ...selection\n }}\n >\n <BreakpointProvider defaultKey={defaultBreakpoint ?? \"xl\"}>\n {children}\n {!disableRenderar && <RenderRenderar />}\n </BreakpointProvider>\n </ThemeProvider>\n </AppRootProvider>\n </CSSCacheProvider>\n </DocumentProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqBA;;;;AAIG;;;;AAIA;AACA;;;AAIA;;;AAIG;;;;;;AAMA;AACA;AACG;AACH;;;AAIH;AACG;AACG;;;AAGC;;;;AAWW;;AAEH;AAmBlB;;"}
|
package/AppRoot/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { TagComponentType } from '../Tag/types.js';
|
|
3
|
-
import { BreakpointKeys } from '../css/types.js';
|
|
4
3
|
import { ThemeProviderProps } from '../theme/ThemeProvider.js';
|
|
4
|
+
import { BreakpointKeys } from '../css/types.js';
|
|
5
5
|
|
|
6
6
|
type AppRootProps<T extends TagComponentType = "div"> = ThemeProviderProps<T> & {
|
|
7
7
|
noScrollbarCss?: boolean;
|
package/AppRoot/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import React__default, { useId, useRef, useLayoutEffect, useEffect } from 'react';
|
|
5
|
+
import ThemeProvider from '../theme/ThemeProvider.js';
|
|
5
6
|
import '../theme/core.js';
|
|
7
|
+
import { BreakpointProvider } from '../breakpoint/BreakpointProvider.js';
|
|
6
8
|
import '../css/getValue.js';
|
|
7
9
|
import 'oncss';
|
|
8
|
-
import ThemeProvider from '../theme/ThemeProvider.js';
|
|
9
|
-
import { BreakpointProvider } from '../breakpoint/BreakpointProvider.js';
|
|
10
10
|
import { RenderRenderar } from './Renderar.js';
|
|
11
11
|
import { DocumentProvider } from '../Document/index.js';
|
|
12
12
|
import { AppRootProvider } from './AppRootProvider.js';
|
|
@@ -33,7 +33,7 @@ const AppRoot = React__default.forwardRef((_a, ref) => {
|
|
|
33
33
|
useEffect(() => {
|
|
34
34
|
if (typeof _document === 'undefined')
|
|
35
35
|
return;
|
|
36
|
-
|
|
36
|
+
document.cookie = `xuitm=${theme.name};path=/`;
|
|
37
37
|
const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));
|
|
38
38
|
styles.forEach((style) => {
|
|
39
39
|
_document.head.appendChild(style);
|
|
@@ -50,7 +50,7 @@ const AppRoot = React__default.forwardRef((_a, ref) => {
|
|
|
50
50
|
}
|
|
51
51
|
return (jsx(DocumentProvider, { value: _document ? { document: _document, id: docid } : undefined, children: jsx(CSSCacheProvider, { cacheId: CSSCacheId, children: jsx(AppRootProvider, { element: () => rootRef.current, children: jsx(ThemeProvider, Object.assign({ theme: theme, onThemeChange: (t) => {
|
|
52
52
|
onThemeChange && onThemeChange(t);
|
|
53
|
-
document.cookie = `xuitm=${t};path=/`;
|
|
53
|
+
document.cookie = `xuitm=${t.name};path=/`;
|
|
54
54
|
} }, props, { ref: mergeRef, isRoot: true, sx: Object.assign(Object.assign(Object.assign({}, props.sx), (visibility === "hidden" ? { visibility: "hidden" } : {})), selection), children: jsxs(BreakpointProvider, { defaultKey: defaultBreakpoint !== null && defaultBreakpoint !== void 0 ? defaultBreakpoint : "xl", children: [children, !disableRenderar && jsx(RenderRenderar, {})] }) })) }) }) }));
|
|
55
55
|
});
|
|
56
56
|
|
package/AppRoot/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useLayoutEffect, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\nimport { BreakpointKeys } from '../css/types';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n defaultBreakpoint?: BreakpointKeys\n selectionColor?: \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\";\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n\n noScrollbarCss ??= false\n selectionColor ??= \"brand\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n const [visibility, setVisibility] = React.useState<string>(!defaultBreakpoint ? \"hidden\" : \"\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useLayoutEffect(() => {\n !defaultBreakpoint && setVisibility(\"\");\n }, [])\n\n useEffect(() => {\n if (typeof _document === 'undefined') return;\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useLayoutEffect, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\nimport { BreakpointKeys } from '../css/types';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n defaultBreakpoint?: BreakpointKeys\n selectionColor?: \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\";\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, defaultBreakpoint, noScrollbarCss, CSSCacheId, theme, onThemeChange, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n\n noScrollbarCss ??= false\n selectionColor ??= \"brand\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n const [visibility, setVisibility] = React.useState<string>(!defaultBreakpoint ? \"hidden\" : \"\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useLayoutEffect(() => {\n !defaultBreakpoint && setVisibility(\"\");\n }, [])\n\n useEffect(() => {\n if (typeof _document === 'undefined') return;\n document.cookie = `xuitm=${theme.name};path=/`\n const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n _document.head.appendChild(style);\n });\n }, [])\n\n let selection: any = {}\n if (selectionColor && selectionColor !== 'default') {\n selection = {\n \"&::selection\": {\n bgcolor: `${selectionColor}.primary`,\n color: `${selectionColor}.text`\n }\n }\n }\n\n return (\n <DocumentProvider value={_document ? { document: _document, id: docid } : undefined}>\n <CSSCacheProvider cacheId={CSSCacheId}>\n <AppRootProvider element={() => rootRef.current}>\n <ThemeProvider\n theme={theme}\n onThemeChange={(t) => {\n onThemeChange && onThemeChange(t)\n document.cookie = `xuitm=${t.name};path=/`\n }}\n {...props}\n ref={mergeRef}\n isRoot\n sx={{\n ...props.sx,\n ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {}),\n ...selection\n }}\n >\n <BreakpointProvider defaultKey={defaultBreakpoint ?? \"xl\"}>\n {children}\n {!disableRenderar && <RenderRenderar />}\n </BreakpointProvider>\n </ThemeProvider>\n </AppRootProvider>\n </CSSCacheProvider>\n </DocumentProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqBA;;;;AAIG;;;;AAIA;AACA;;;AAIA;;;AAIG;;;;;;AAMA;AACA;AACG;AACH;;;AAIH;AACG;AACG;;;AAGC;;;;AAWW;;AAEH;AAmBlB;;"}
|
package/Iframe/index.cjs
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
var tslib = require('tslib');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var index$1 = require('../Tag/index.cjs');
|
|
7
8
|
var core = require('../theme/core.cjs');
|
|
8
9
|
require('../css/getValue.cjs');
|
|
9
10
|
require('oncss');
|
|
10
|
-
require('../
|
|
11
|
-
|
|
11
|
+
require('../Document/index.cjs');
|
|
12
|
+
require('../css/CSSCacheProvider.cjs');
|
|
12
13
|
var reactDom = require('react-dom');
|
|
13
14
|
var index$2 = require('../AppRoot/index.cjs');
|
|
14
15
|
var useMergeRefs = require('../hooks/useMergeRefs.cjs');
|
package/Iframe/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: string;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n theme ??= parentTheme.name\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={theme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: string;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n theme ??= parentTheme.name\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={theme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":";;;;;;;;;;;;;;;;AASA;AACG;AACA;AACF;AAQD;AAAgB;;AAEb;;AAEA;;;;;AAKG;;AAEA;;;;AAqBM;AAGS;;;AAYrB;AAEA;;"}
|
package/Iframe/index.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import React__default, { createContext, useState, useRef, useEffect } from 'react';
|
|
5
|
+
import Tag from '../Tag/index.js';
|
|
5
6
|
import { useTheme } from '../theme/core.js';
|
|
6
7
|
import '../css/getValue.js';
|
|
7
8
|
import 'oncss';
|
|
8
|
-
import '../
|
|
9
|
-
import
|
|
9
|
+
import '../Document/index.js';
|
|
10
|
+
import '../css/CSSCacheProvider.js';
|
|
10
11
|
import { createPortal } from 'react-dom';
|
|
11
12
|
import AppRoot from '../AppRoot/index.js';
|
|
12
13
|
import useMergeRefs from '../hooks/useMergeRefs.js';
|
package/Iframe/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: string;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n theme ??= parentTheme.name\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={theme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: string;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n theme ??= parentTheme.name\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={theme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":";;;;;;;;;;;;;;AASA;AACG;AACA;AACF;AAQD;AAAgB;;AAEb;;AAEA;;;;;AAKG;;AAEA;;;;AAqBM;AAGS;;;AAYrB;AAEA;;"}
|
package/hooks/useInterface.cjs
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('tslib');
|
|
4
|
+
require('react/jsx-runtime');
|
|
5
|
+
require('react');
|
|
6
|
+
require('../Tag/index.cjs');
|
|
3
7
|
var core = require('../theme/core.cjs');
|
|
4
8
|
require('../css/getValue.cjs');
|
|
5
9
|
require('oncss');
|
|
6
|
-
require('../
|
|
10
|
+
require('../Document/index.cjs');
|
|
11
|
+
require('../css/CSSCacheProvider.cjs');
|
|
7
12
|
|
|
8
13
|
const useInterface = (name, userPorps, defaultProps) => {
|
|
9
14
|
const theme = core.useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInterface.cjs","sources":["../../src/hooks/useInterface.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n let _props = { ...defaultProps, ...userPorps } as P\n if (name in theme.interfaces) {\n return theme.interfaces[name](_props, theme)\n }\n return [_props, theme]\n}\n\nexport default useInterface"],"names":["useTheme"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInterface.cjs","sources":["../../src/hooks/useInterface.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n let _props = { ...defaultProps, ...userPorps } as P\n if (name in theme.interfaces) {\n return theme.interfaces[name](_props, theme)\n }\n return [_props, theme]\n}\n\nexport default useInterface"],"names":["useTheme"],"mappings":";;;;;;;;;;;;AAEA,MAAM,YAAY,GAAG,CAAmB,IAAY,EAAE,SAAY,EAAE,YAAe,KAAI;AACnF,IAAA,MAAM,KAAK,GAAGA,aAAQ,EAAE;AACxB,IAAA,IAAI,MAAM,GAAG,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,YAAY,CAAA,EAAK,SAAS,CAAO;AACnD,IAAA,IAAI,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;QAC1B,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC;IAChD;AACA,IAAA,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;AAC1B;;;;"}
|
package/hooks/useInterface.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThemeOptions } from '../theme/types.js';
|
|
2
2
|
|
|
3
|
-
declare const useInterface: <P extends object>(name: string, userPorps: P, defaultProps: P) => P | (P |
|
|
3
|
+
declare const useInterface: <P extends object>(name: string, userPorps: P, defaultProps: P) => P | (P | ThemeOptions)[];
|
|
4
4
|
|
|
5
5
|
export { useInterface as default };
|
package/hooks/useInterface.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import 'tslib';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../Tag/index.js';
|
|
1
5
|
import { useTheme } from '../theme/core.js';
|
|
2
6
|
import '../css/getValue.js';
|
|
3
7
|
import 'oncss';
|
|
4
|
-
import '../
|
|
8
|
+
import '../Document/index.js';
|
|
9
|
+
import '../css/CSSCacheProvider.js';
|
|
5
10
|
|
|
6
11
|
const useInterface = (name, userPorps, defaultProps) => {
|
|
7
12
|
const theme = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInterface.js","sources":["../../src/hooks/useInterface.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n let _props = { ...defaultProps, ...userPorps } as P\n if (name in theme.interfaces) {\n return theme.interfaces[name](_props, theme)\n }\n return [_props, theme]\n}\n\nexport default useInterface"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInterface.js","sources":["../../src/hooks/useInterface.ts"],"sourcesContent":["import { useTheme } from \"../theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n let _props = { ...defaultProps, ...userPorps } as P\n if (name in theme.interfaces) {\n return theme.interfaces[name](_props, theme)\n }\n return [_props, theme]\n}\n\nexport default useInterface"],"names":[],"mappings":";;;;;;;;;;AAEA,MAAM,YAAY,GAAG,CAAmB,IAAY,EAAE,SAAY,EAAE,YAAe,KAAI;AACnF,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;AACxB,IAAA,IAAI,MAAM,GAAG,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,YAAY,CAAA,EAAK,SAAS,CAAO;AACnD,IAAA,IAAI,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;QAC1B,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC;IAChD;AACA,IAAA,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;AAC1B;;;;"}
|
package/index.cjs
CHANGED
|
@@ -22,7 +22,6 @@ var index$8 = require('./theme/index.cjs');
|
|
|
22
22
|
var getValue = require('./css/getValue.cjs');
|
|
23
23
|
var getProps = require('./css/getProps.cjs');
|
|
24
24
|
var ThemeProvider = require('./theme/ThemeProvider.cjs');
|
|
25
|
-
var createTheme = require('./theme/createTheme.cjs');
|
|
26
25
|
var core = require('./theme/core.cjs');
|
|
27
26
|
var ThemeDefaultOptions = require('./theme/ThemeDefaultOptions.cjs');
|
|
28
27
|
|
|
@@ -57,8 +56,7 @@ exports.themeRootClass = index$8.themeRootClass;
|
|
|
57
56
|
exports.getValue = getValue;
|
|
58
57
|
exports.getProps = getProps;
|
|
59
58
|
exports.ThemeProvider = ThemeProvider;
|
|
60
|
-
exports.createTheme =
|
|
61
|
-
exports.getTheme = core.getTheme;
|
|
59
|
+
exports.createTheme = core.createTheme;
|
|
62
60
|
exports.useTheme = core.useTheme;
|
|
63
61
|
exports.darkThemeOptions = ThemeDefaultOptions.darkThemeOptions;
|
|
64
62
|
exports.lightThemeOptions = ThemeDefaultOptions.lightThemeOptions;
|
package/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -23,6 +23,5 @@ export { ColorsRefTypes, ObjectType, ThemeColorOption, ThemeOptionInput, ThemeOp
|
|
|
23
23
|
export { default as getValue } from './css/getValue.js';
|
|
24
24
|
export { default as getProps } from './css/getProps.js';
|
|
25
25
|
export { default as ThemeProvider, ThemeProviderProps } from './theme/ThemeProvider.js';
|
|
26
|
-
export { createTheme } from './theme/
|
|
27
|
-
export { getTheme, useTheme } from './theme/core.js';
|
|
26
|
+
export { createTheme, useTheme } from './theme/core.js';
|
|
28
27
|
export { darkThemeOptions, lightThemeOptions } from './theme/ThemeDefaultOptions.js';
|
package/index.js
CHANGED
|
@@ -20,7 +20,6 @@ export { themeRootClass } from './theme/index.js';
|
|
|
20
20
|
export { default as getValue } from './css/getValue.js';
|
|
21
21
|
export { default as getProps } from './css/getProps.js';
|
|
22
22
|
export { default as ThemeProvider } from './theme/ThemeProvider.js';
|
|
23
|
-
export { createTheme } from './theme/
|
|
24
|
-
export { getTheme, useTheme } from './theme/core.js';
|
|
23
|
+
export { createTheme, useTheme } from './theme/core.js';
|
|
25
24
|
export { darkThemeOptions, lightThemeOptions } from './theme/ThemeDefaultOptions.js';
|
|
26
25
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var createTheme = require('./createTheme.cjs');
|
|
4
|
-
|
|
5
3
|
const lightShadows = [
|
|
6
4
|
"none",
|
|
7
5
|
"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)",
|
|
@@ -171,13 +169,8 @@ const darkThemeOptions = {
|
|
|
171
169
|
typography: ThemeTypography,
|
|
172
170
|
interfaces: {}
|
|
173
171
|
};
|
|
174
|
-
const createDefaultThemes = () => {
|
|
175
|
-
createTheme.createTheme("light", {});
|
|
176
|
-
createTheme.createTheme("dark", darkThemeOptions);
|
|
177
|
-
};
|
|
178
172
|
|
|
179
173
|
exports.ThemeTypography = ThemeTypography;
|
|
180
|
-
exports.createDefaultThemes = createDefaultThemes;
|
|
181
174
|
exports.darkShadows = darkShadows;
|
|
182
175
|
exports.darkThemeOptions = darkThemeOptions;
|
|
183
176
|
exports.lightShadows = lightShadows;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeDefaultOptions.cjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createTheme } from './createTheme'\nimport { ThemeOptionInput, ThemeTypographyType } from './types'\n\nexport const lightShadows = [\n \"none\",\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\n]\n\nexport const darkShadows = [\n \"none\",\n\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\n]\n\n\n\nexport const ThemeTypography: ThemeTypographyType = {\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\n}\n\nexport const lightThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: lightShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#FFFFFF\", // main app background\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\n },\n\n divider: {\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\n secondary: \"#D1D5DB\", // stronger divider for emphasis\n },\n\n text: {\n primary: \"#2E2E2E\",\n secondary: \"#6B7280\",\n },\n\n brand: {\n primary: \"#2563EB\",\n secondary: \"#1D4ED8\",\n text: \"#F9FAFB\",\n },\n\n accent: {\n primary: \"#7C3AED\",\n secondary: \"#6D28D9\",\n text: \"#F9FAFB\",\n },\n\n success: {\n primary: \"#16A34A\",\n secondary: \"#15803D\",\n text: \"#F9FAFB\",\n },\n\n info: {\n primary: \"#2563EB\",\n secondary: \"#1D4ED8\",\n text: \"#F9FAFB\",\n },\n\n warning: {\n primary: \"#D97706\",\n secondary: \"#B45309\",\n text: \"#FFFBEB\",\n },\n\n danger: {\n primary: \"#DC2626\",\n secondary: \"#B91C1C\",\n text: \"#FEF2F2\",\n },\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n\nexport const darkThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: darkShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#121212\",\n secondary: \"#1E1E1E\",\n },\n\n divider: {\n primary: \"#262626\",\n secondary: \"#2E2E2E\",\n },\n\n text: {\n primary: \"#E5E7EB\", // main readable text\n secondary: \"#9CA3AF\", // muted / secondary text\n },\n\n brand: {\n primary: \"#1D4ED8\",\n secondary: \"#2563EB\",\n text: \"#F9FAFB\",\n },\n\n accent: {\n primary: \"#6D28D9\",\n secondary: \"#7C3AED\",\n text: \"#F9FAFB\",\n },\n\n success: {\n primary: \"#15803D\",\n secondary: \"#16A34A\",\n text: \"#F9FAFB\",\n },\n\n info: {\n primary: \"#1D4ED8\",\n secondary: \"#2563EB\",\n text: \"#F9FAFB\",\n },\n\n warning: {\n primary: \"#B45309\",\n secondary: \"#D97706\",\n text: \"#FFFBEB\",\n },\n\n danger: {\n primary: \"#B91C1C\",\n secondary: \"#DC2626\",\n text: \"#FEF2F2\",\n },\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n\n\nexport const createDefaultThemes = () => {\n createTheme(\"light\", {})\n createTheme(\"dark\", darkThemeOptions)\n}"],"names":["createTheme"],"mappings":";;;;AAGO,MAAM,YAAY,GAAG;IACxB,MAAM;IACN,oGAAoG;IACpG,oGAAoG;IACpG,oGAAoG;IACpG,qGAAqG;IACrG,qGAAqG;IACrG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,yGAAyG;IACzG,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AAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,MAAM,EAAE;AACJ,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AACJ,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;AAIT,MAAM,mBAAmB,GAAG,MAAK;AACpC,IAAAA,uBAAW,CAAC,OAAO,EAAE,EAAE,CAAC;AACxB,IAAAA,uBAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC;AACzC;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ThemeDefaultOptions.cjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { ThemeOptionInput, ThemeTypographyType } from './types'\n\nexport const lightShadows = [\n \"none\",\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\n]\n\nexport const darkShadows = [\n \"none\",\n\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\n]\n\n\nexport const ThemeTypography: ThemeTypographyType = {\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\n}\n\nexport const lightThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: lightShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#FFFFFF\", // main app background\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\n },\n\n divider: {\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\n secondary: \"#D1D5DB\", // stronger divider for emphasis\n },\n\n text: {\n primary: \"#2E2E2E\",\n secondary: \"#6B7280\",\n },\n\n brand: {\n primary: \"#2563EB\",\n secondary: \"#1D4ED8\",\n text: \"#F9FAFB\",\n },\n\n accent: {\n primary: \"#7C3AED\",\n secondary: \"#6D28D9\",\n text: \"#F9FAFB\",\n },\n\n success: {\n primary: \"#16A34A\",\n secondary: \"#15803D\",\n text: \"#F9FAFB\",\n },\n\n info: {\n primary: \"#2563EB\",\n secondary: \"#1D4ED8\",\n text: \"#F9FAFB\",\n },\n\n warning: {\n primary: \"#D97706\",\n secondary: \"#B45309\",\n text: \"#FFFBEB\",\n },\n\n danger: {\n primary: \"#DC2626\",\n secondary: \"#B91C1C\",\n text: \"#FEF2F2\",\n },\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n\nexport const darkThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: darkShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#121212\",\n secondary: \"#1E1E1E\",\n },\n\n divider: {\n primary: \"#262626\",\n secondary: \"#2E2E2E\",\n },\n\n text: {\n primary: \"#E5E7EB\", // main readable text\n secondary: \"#9CA3AF\", // muted / secondary text\n },\n\n brand: {\n primary: \"#1D4ED8\",\n secondary: \"#2563EB\",\n text: \"#F9FAFB\",\n },\n\n accent: {\n primary: \"#6D28D9\",\n secondary: \"#7C3AED\",\n text: \"#F9FAFB\",\n },\n\n success: {\n primary: \"#15803D\",\n secondary: \"#16A34A\",\n text: \"#F9FAFB\",\n },\n\n info: {\n primary: \"#1D4ED8\",\n secondary: \"#2563EB\",\n text: \"#F9FAFB\",\n },\n\n warning: {\n primary: \"#B45309\",\n secondary: \"#D97706\",\n text: \"#FFFBEB\",\n },\n\n danger: {\n primary: \"#B91C1C\",\n secondary: \"#DC2626\",\n text: \"#FEF2F2\",\n },\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n"],"names":[],"mappings":";;AAEO,MAAM,YAAY,GAAG;IACxB,MAAM;IACN,oGAAoG;IACpG,oGAAoG;IACpG,oGAAoG;IACpG,qGAAqG;IACrG,qGAAqG;IACrG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;;AAGtG,MAAM,WAAW,GAAG;IACvB,MAAM;IAEN,wEAAwE;IACxE,wEAAwE;IACxE,uEAAuE;IACvE,wEAAwE;IAExE,wEAAwE;IACxE,wEAAwE;IACxE,wEAAwE;IACxE,yEAAyE;IACzE,yEAAyE;IAEzE,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;IACzE,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;;AAItE,MAAM,eAAe,GAAwB;AAChD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AACtD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE;AACvD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE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,SAAA;AAED,QAAA,KAAK,EAAE;AACH,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,MAAM,EAAE;AACJ,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,OAAO,EAAE;AACL,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,IAAI,EAAE;AACF,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,OAAO,EAAE;AACL,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,MAAM,EAAE;AACJ,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AACJ,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;;;;;;;;"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createTheme } from './createTheme.js';
|
|
2
|
-
|
|
3
1
|
const lightShadows = [
|
|
4
2
|
"none",
|
|
5
3
|
"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)",
|
|
@@ -169,10 +167,6 @@ const darkThemeOptions = {
|
|
|
169
167
|
typography: ThemeTypography,
|
|
170
168
|
interfaces: {}
|
|
171
169
|
};
|
|
172
|
-
const createDefaultThemes = () => {
|
|
173
|
-
createTheme("light", {});
|
|
174
|
-
createTheme("dark", darkThemeOptions);
|
|
175
|
-
};
|
|
176
170
|
|
|
177
|
-
export { ThemeTypography,
|
|
171
|
+
export { ThemeTypography, darkShadows, darkThemeOptions, lightShadows, lightThemeOptions };
|
|
178
172
|
//# sourceMappingURL=ThemeDefaultOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeDefaultOptions.js","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createTheme } from './createTheme'\nimport { ThemeOptionInput, ThemeTypographyType } from './types'\n\nexport const lightShadows = [\n \"none\",\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\n]\n\nexport const darkShadows = [\n \"none\",\n\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\n]\n\n\n\nexport const ThemeTypography: ThemeTypographyType = {\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\n}\n\nexport const lightThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: lightShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#FFFFFF\", // main app background\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\n },\n\n divider: {\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\n secondary: \"#D1D5DB\", // stronger divider for emphasis\n },\n\n text: {\n primary: \"#2E2E2E\",\n secondary: \"#6B7280\",\n },\n\n brand: {\n primary: \"#2563EB\",\n secondary: \"#1D4ED8\",\n text: \"#F9FAFB\",\n },\n\n accent: {\n primary: \"#7C3AED\",\n secondary: \"#6D28D9\",\n text: \"#F9FAFB\",\n },\n\n success: {\n primary: \"#16A34A\",\n secondary: \"#15803D\",\n text: \"#F9FAFB\",\n },\n\n info: {\n primary: \"#2563EB\",\n secondary: \"#1D4ED8\",\n text: \"#F9FAFB\",\n },\n\n warning: {\n primary: \"#D97706\",\n secondary: \"#B45309\",\n text: \"#FFFBEB\",\n },\n\n danger: {\n primary: \"#DC2626\",\n secondary: \"#B91C1C\",\n text: \"#FEF2F2\",\n },\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n\nexport const darkThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: darkShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#121212\",\n secondary: \"#1E1E1E\",\n },\n\n divider: {\n primary: \"#262626\",\n secondary: \"#2E2E2E\",\n },\n\n text: {\n primary: \"#E5E7EB\", // main readable text\n secondary: \"#9CA3AF\", // muted / secondary text\n },\n\n brand: {\n primary: \"#1D4ED8\",\n secondary: \"#2563EB\",\n text: \"#F9FAFB\",\n },\n\n accent: {\n primary: \"#6D28D9\",\n secondary: \"#7C3AED\",\n text: \"#F9FAFB\",\n },\n\n success: {\n primary: \"#15803D\",\n secondary: \"#16A34A\",\n text: \"#F9FAFB\",\n },\n\n info: {\n primary: \"#1D4ED8\",\n secondary: \"#2563EB\",\n text: \"#F9FAFB\",\n },\n\n warning: {\n primary: \"#B45309\",\n secondary: \"#D97706\",\n text: \"#FFFBEB\",\n },\n\n danger: {\n primary: \"#B91C1C\",\n secondary: \"#DC2626\",\n text: \"#FEF2F2\",\n },\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n\n\nexport const createDefaultThemes = () => {\n createTheme(\"light\", {})\n createTheme(\"dark\", darkThemeO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,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,OAAO,EAAE;AACL,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,IAAI,EAAE;AACF,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,OAAO,EAAE;AACL,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AAED,QAAA,MAAM,EAAE;AACJ,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AACJ,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;AAIT,MAAM,mBAAmB,GAAG,MAAK;AACpC,IAAA,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;AACxB,IAAA,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC;AACzC;;;;"}
|
|
1
|
+
{"version":3,"file":"ThemeDefaultOptions.js","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { ThemeOptionInput, ThemeTypographyType } from './types'\n\nexport const lightShadows = [\n \"none\",\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\n]\n\nexport const darkShadows = [\n \"none\",\n\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\n\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\n\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\n]\n\n\nexport const ThemeTypography: ThemeTypographyType = {\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\n}\n\nexport const lightThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: lightShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#FFFFFF\", // main app background\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\n },\n\n divider: {\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\n secondary: \"#D1D5DB\", // stronger divider for emphasis\n },\n\n text: {\n primary: \"#2E2E2E\",\n secondary: \"#6B7280\",\n },\n\n brand: {\n primary: \"#2563EB\",\n secondary: \"#1D4ED8\",\n text: \"#F9FAFB\",\n },\n\n accent: {\n primary: \"#7C3AED\",\n secondary: \"#6D28D9\",\n text: \"#F9FAFB\",\n },\n\n success: {\n primary: \"#16A34A\",\n secondary: \"#15803D\",\n text: \"#F9FAFB\",\n },\n\n info: {\n primary: \"#2563EB\",\n secondary: \"#1D4ED8\",\n text: \"#F9FAFB\",\n },\n\n warning: {\n primary: \"#D97706\",\n secondary: \"#B45309\",\n text: \"#FFFBEB\",\n },\n\n danger: {\n primary: \"#DC2626\",\n secondary: \"#B91C1C\",\n text: \"#FEF2F2\",\n },\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n\nexport const darkThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: darkShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#121212\",\n secondary: \"#1E1E1E\",\n },\n\n divider: {\n primary: \"#262626\",\n secondary: \"#2E2E2E\",\n },\n\n text: {\n primary: \"#E5E7EB\", // main readable text\n secondary: \"#9CA3AF\", // muted / secondary text\n },\n\n brand: {\n primary: \"#1D4ED8\",\n secondary: \"#2563EB\",\n text: \"#F9FAFB\",\n },\n\n accent: {\n primary: \"#6D28D9\",\n secondary: \"#7C3AED\",\n text: \"#F9FAFB\",\n },\n\n success: {\n primary: \"#15803D\",\n secondary: \"#16A34A\",\n text: \"#F9FAFB\",\n },\n\n info: {\n primary: \"#1D4ED8\",\n secondary: \"#2563EB\",\n text: \"#F9FAFB\",\n },\n\n warning: {\n primary: \"#B45309\",\n secondary: \"#D97706\",\n text: \"#FFFBEB\",\n },\n\n danger: {\n primary: \"#B91C1C\",\n secondary: \"#DC2626\",\n text: \"#FEF2F2\",\n },\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n"],"names":[],"mappings":"AAEO,MAAM,YAAY,GAAG;IACxB,MAAM;IACN,oGAAoG;IACpG,oGAAoG;IACpG,oGAAoG;IACpG,qGAAqG;IACrG,qGAAqG;IACrG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IACtG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;IACzG,yGAAyG;;AAGtG,MAAM,WAAW,GAAG;IACvB,MAAM;IAEN,wEAAwE;IACxE,wEAAwE;IACxE,uEAAuE;IACvE,wEAAwE;IAExE,wEAAwE;IACxE,wEAAwE;IACxE,wEAAwE;IACxE,yEAAyE;IACzE,yEAAyE;IAEzE,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;IACzE,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;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 var index$3 = require('../Tag/index.cjs');
|
|
|
8
8
|
var core = require('./core.cjs');
|
|
9
9
|
var ThemeCssVars = require('./ThemeCssVars.cjs');
|
|
10
10
|
var index$1 = require('../css/index.cjs');
|
|
11
|
-
var ThemeDefaultOptions = require('./ThemeDefaultOptions.cjs');
|
|
12
11
|
var ServerStyleTag = require('../Tag/ServerStyleTag.cjs');
|
|
13
12
|
var index = require('../Document/index.cjs');
|
|
14
13
|
var index$2 = require('./index.cjs');
|
|
@@ -33,25 +32,19 @@ function _interopNamespaceDefault(e) {
|
|
|
33
32
|
|
|
34
33
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
35
34
|
|
|
36
|
-
ThemeDefaultOptions.createDefaultThemes();
|
|
37
35
|
const ThemeProvider = (_a) => {
|
|
38
36
|
var { children, theme, onThemeChange, isRoot, noScrollbarCss } = _a, props = tslib.__rest(_a, ["children", "theme", "onThemeChange", "isRoot", "noScrollbarCss"]);
|
|
39
|
-
let THEME = core.ThemeFactory.get(theme);
|
|
40
|
-
if (!THEME) {
|
|
41
|
-
console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`);
|
|
42
|
-
THEME = core.ThemeFactory.get("light");
|
|
43
|
-
}
|
|
44
37
|
const doc = index.useDocument();
|
|
45
38
|
const cacheId = CSSCacheProvider.useCSSCacheId();
|
|
46
39
|
const themeGlobalStyle = React__namespace.useMemo(() => {
|
|
47
|
-
const root_cls = `.xui-${theme}-theme-root`;
|
|
48
|
-
let gkeys = Object.keys(
|
|
40
|
+
const root_cls = `.xui-${theme.name}-theme-root`;
|
|
41
|
+
let gkeys = Object.keys(theme.globalStyle || {});
|
|
49
42
|
let gstyles = {};
|
|
50
43
|
gkeys.forEach((key) => {
|
|
51
|
-
gstyles[`${root_cls} ${key}`] =
|
|
44
|
+
gstyles[`${root_cls} ${key}`] = theme.globalStyle[key];
|
|
52
45
|
});
|
|
53
46
|
return index$1.css({
|
|
54
|
-
"@global": Object.assign(Object.assign({}, gstyles), { [root_cls]: ThemeCssVars(
|
|
47
|
+
"@global": Object.assign(Object.assign({}, gstyles), { [root_cls]: ThemeCssVars(theme) })
|
|
55
48
|
}, {
|
|
56
49
|
injectStyle: typeof window !== 'undefined',
|
|
57
50
|
container: doc === null || doc === void 0 ? void 0 : doc.document,
|
|
@@ -113,7 +106,7 @@ const ThemeProvider = (_a) => {
|
|
|
113
106
|
const scrollbarCss = React__namespace.useMemo(() => {
|
|
114
107
|
if (noScrollbarCss)
|
|
115
108
|
return;
|
|
116
|
-
const cls = (cls) => `${index$2.themeRootClass(theme)} ${cls}`;
|
|
109
|
+
const cls = (cls) => `${index$2.themeRootClass(theme.name)} ${cls}`;
|
|
117
110
|
let thumbSize = 6;
|
|
118
111
|
let thumbColor = "var(--color-text-secondary)";
|
|
119
112
|
let trackColor = "transparent";
|
|
@@ -152,7 +145,7 @@ const ThemeProvider = (_a) => {
|
|
|
152
145
|
"& a": {
|
|
153
146
|
color: "brand.primary",
|
|
154
147
|
},
|
|
155
|
-
}, baseClass: `${theme}-theme-root`, direction:
|
|
148
|
+
}, baseClass: `${theme.name}-theme-root`, direction: theme.rtl ? "rtl" : "ltr", children: children }))] }));
|
|
156
149
|
};
|
|
157
150
|
|
|
158
151
|
module.exports = ThemeProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.cjs","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex
|
|
1
|
+
{"version":3,"file":"ThemeProvider.cjs","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\nimport ServerStyleTag from \"../Tag/ServerStyleTag\"\nimport { useDocument } from \"../Document\";\nimport { themeRootClass } from \".\";\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: ThemeOptions;\n onThemeChange?: (theme: ThemeOptions) => void\n isRoot?: boolean;\n noScrollbarCss?: boolean;\n}\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, onThemeChange, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => {\n const doc = useDocument()\n const cacheId = useCSSCacheId()\n\n const themeGlobalStyle: any = React.useMemo(() => {\n const root_cls = `.xui-${theme.name}-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 container: doc?.document,\n cacheId\n })\n }, [theme, doc])\n\n const resetCss = React.useMemo(() => {\n if (!isRoot) return\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 height: \"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 container: doc?.document,\n cacheId\n })\n }, [])\n\n const scrollbarCss: any = React.useMemo(() => {\n if (noScrollbarCss) return;\n const cls = (cls: string) => `${themeRootClass(theme.name)} ${cls}`\n let thumbSize = 6\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 container: doc?.document,\n cacheId\n }) as any\n }, [noScrollbarCss, theme])\n\n return (\n <ThemeContex.Provider\n value={{\n theme,\n onChange: (t) => {\n onThemeChange && onThemeChange(t)\n }\n }}\n >\n {\n isRoot && <>\n <ServerStyleTag factory={resetCss as any} />\n {\n !noScrollbarCss && <ServerStyleTag factory={scrollbarCss} />\n }\n </>\n }\n <ServerStyleTag factory={themeGlobalStyle} />\n <Tag\n minHeight=\"100%\"\n bgcolor=\"background.primary\"\n color=\"text.primary\"\n fontSize=\"text\"\n fontWeight=\"text\"\n lineHeight=\"text\"\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\n {...props}\n sxr={{\n \"& a\": {\n color: \"brand.primary\",\n },\n }}\n baseClass={`${theme.name}-theme-root`}\n direction={theme.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n </Tag>\n </ThemeContex.Provider>\n )\n}\n\nexport default ThemeProvider"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA;AAA2D;AACxD;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;;AAIS;AACG;;AAEL;AAqBK;AACG;AACF;;AAShB;;"}
|
package/theme/ThemeProvider.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ThemeOptions } from './types.js';
|
|
2
3
|
import { TagComponentType, TagProps } from '../Tag/types.js';
|
|
3
4
|
|
|
4
5
|
type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {
|
|
5
|
-
theme:
|
|
6
|
-
onThemeChange?: (theme:
|
|
6
|
+
theme: ThemeOptions;
|
|
7
|
+
onThemeChange?: (theme: ThemeOptions) => void;
|
|
7
8
|
isRoot?: boolean;
|
|
8
9
|
noScrollbarCss?: boolean;
|
|
9
10
|
};
|
package/theme/ThemeProvider.js
CHANGED
|
@@ -3,34 +3,27 @@ import { __rest } from 'tslib';
|
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import Tag from '../Tag/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ThemeContex } from './core.js';
|
|
7
7
|
import ThemeCssVars from './ThemeCssVars.js';
|
|
8
8
|
import { css } from '../css/index.js';
|
|
9
|
-
import { createDefaultThemes } from './ThemeDefaultOptions.js';
|
|
10
9
|
import ServerStyleTag from '../Tag/ServerStyleTag.js';
|
|
11
10
|
import { useDocument } from '../Document/index.js';
|
|
12
11
|
import { themeRootClass } from './index.js';
|
|
13
12
|
import { useCSSCacheId } from '../css/CSSCacheProvider.js';
|
|
14
13
|
|
|
15
|
-
createDefaultThemes();
|
|
16
14
|
const ThemeProvider = (_a) => {
|
|
17
15
|
var { children, theme, onThemeChange, isRoot, noScrollbarCss } = _a, props = __rest(_a, ["children", "theme", "onThemeChange", "isRoot", "noScrollbarCss"]);
|
|
18
|
-
let THEME = ThemeFactory.get(theme);
|
|
19
|
-
if (!THEME) {
|
|
20
|
-
console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`);
|
|
21
|
-
THEME = ThemeFactory.get("light");
|
|
22
|
-
}
|
|
23
16
|
const doc = useDocument();
|
|
24
17
|
const cacheId = useCSSCacheId();
|
|
25
18
|
const themeGlobalStyle = React.useMemo(() => {
|
|
26
|
-
const root_cls = `.xui-${theme}-theme-root`;
|
|
27
|
-
let gkeys = Object.keys(
|
|
19
|
+
const root_cls = `.xui-${theme.name}-theme-root`;
|
|
20
|
+
let gkeys = Object.keys(theme.globalStyle || {});
|
|
28
21
|
let gstyles = {};
|
|
29
22
|
gkeys.forEach((key) => {
|
|
30
|
-
gstyles[`${root_cls} ${key}`] =
|
|
23
|
+
gstyles[`${root_cls} ${key}`] = theme.globalStyle[key];
|
|
31
24
|
});
|
|
32
25
|
return css({
|
|
33
|
-
"@global": Object.assign(Object.assign({}, gstyles), { [root_cls]: ThemeCssVars(
|
|
26
|
+
"@global": Object.assign(Object.assign({}, gstyles), { [root_cls]: ThemeCssVars(theme) })
|
|
34
27
|
}, {
|
|
35
28
|
injectStyle: typeof window !== 'undefined',
|
|
36
29
|
container: doc === null || doc === void 0 ? void 0 : doc.document,
|
|
@@ -92,7 +85,7 @@ const ThemeProvider = (_a) => {
|
|
|
92
85
|
const scrollbarCss = React.useMemo(() => {
|
|
93
86
|
if (noScrollbarCss)
|
|
94
87
|
return;
|
|
95
|
-
const cls = (cls) => `${themeRootClass(theme)} ${cls}`;
|
|
88
|
+
const cls = (cls) => `${themeRootClass(theme.name)} ${cls}`;
|
|
96
89
|
let thumbSize = 6;
|
|
97
90
|
let thumbColor = "var(--color-text-secondary)";
|
|
98
91
|
let trackColor = "transparent";
|
|
@@ -131,7 +124,7 @@ const ThemeProvider = (_a) => {
|
|
|
131
124
|
"& a": {
|
|
132
125
|
color: "brand.primary",
|
|
133
126
|
},
|
|
134
|
-
}, baseClass: `${theme}-theme-root`, direction:
|
|
127
|
+
}, baseClass: `${theme.name}-theme-root`, direction: theme.rtl ? "rtl" : "ltr", children: children }))] }));
|
|
135
128
|
};
|
|
136
129
|
|
|
137
130
|
export { ThemeProvider as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\nimport ServerStyleTag from \"../Tag/ServerStyleTag\"\nimport { useDocument } from \"../Document\";\nimport { themeRootClass } from \".\";\nimport { useCSSCacheId } from \"../css/CSSCacheProvider\";\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: ThemeOptions;\n onThemeChange?: (theme: ThemeOptions) => void\n isRoot?: boolean;\n noScrollbarCss?: boolean;\n}\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, onThemeChange, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => {\n const doc = useDocument()\n const cacheId = useCSSCacheId()\n\n const themeGlobalStyle: any = React.useMemo(() => {\n const root_cls = `.xui-${theme.name}-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 container: doc?.document,\n cacheId\n })\n }, [theme, doc])\n\n const resetCss = React.useMemo(() => {\n if (!isRoot) return\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 height: \"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 container: doc?.document,\n cacheId\n })\n }, [])\n\n const scrollbarCss: any = React.useMemo(() => {\n if (noScrollbarCss) return;\n const cls = (cls: string) => `${themeRootClass(theme.name)} ${cls}`\n let thumbSize = 6\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 container: doc?.document,\n cacheId\n }) as any\n }, [noScrollbarCss, theme])\n\n return (\n <ThemeContex.Provider\n value={{\n theme,\n onChange: (t) => {\n onThemeChange && onThemeChange(t)\n }\n }}\n >\n {\n isRoot && <>\n <ServerStyleTag factory={resetCss as any} />\n {\n !noScrollbarCss && <ServerStyleTag factory={scrollbarCss} />\n }\n </>\n }\n <ServerStyleTag factory={themeGlobalStyle} />\n <Tag\n minHeight=\"100%\"\n bgcolor=\"background.primary\"\n color=\"text.primary\"\n fontSize=\"text\"\n fontWeight=\"text\"\n lineHeight=\"text\"\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\n {...props}\n sxr={{\n \"& a\": {\n color: \"brand.primary\",\n },\n }}\n baseClass={`${theme.name}-theme-root`}\n direction={theme.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n </Tag>\n </ThemeContex.Provider>\n )\n}\n\nexport default ThemeProvider"],"names":[],"mappings":";;;;;;;;;;;;;AAoBA;AAA2D;AACxD;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;;AAIS;AACG;;AAEL;AAqBK;AACG;AACF;;AAShB;;"}
|
package/theme/core.cjs
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var React = require('react');
|
|
5
|
+
var index = require('../css/index.cjs');
|
|
6
|
+
var ThemeDefaultOptions = require('./ThemeDefaultOptions.cjs');
|
|
4
7
|
|
|
5
|
-
const ThemeFactory = new Map();
|
|
6
|
-
const ThemeContex = React.createContext({
|
|
7
|
-
theme: "light",
|
|
8
|
-
onChange: () => { }
|
|
9
|
-
});
|
|
10
|
-
const getTheme = (theme) => ThemeFactory.get(theme);
|
|
11
|
-
const useTheme = () => {
|
|
12
|
-
const ctx = React.useContext(ThemeContex);
|
|
13
|
-
const theme = ThemeFactory.get(ctx === null || ctx === void 0 ? void 0 : ctx.theme);
|
|
14
|
-
if (!theme) {
|
|
15
|
-
console.error("Theme not found, returning light theme as fallback");
|
|
16
|
-
return ThemeFactory.get("light");
|
|
17
|
-
}
|
|
18
|
-
theme.change = (theme) => {
|
|
19
|
-
ctx.onChange(theme);
|
|
20
|
-
};
|
|
21
|
-
return theme;
|
|
22
|
-
};
|
|
23
8
|
const mergeObject = (a, b) => {
|
|
24
9
|
a = Object.assign({}, a);
|
|
25
10
|
b = Object.assign({}, b);
|
|
@@ -34,10 +19,33 @@ const mergeObject = (a, b) => {
|
|
|
34
19
|
}
|
|
35
20
|
return a;
|
|
36
21
|
};
|
|
22
|
+
const createTheme = (name, options, mode = "light") => {
|
|
23
|
+
const defaultOptions = mode === 'light' ? ThemeDefaultOptions.lightThemeOptions : ThemeDefaultOptions.darkThemeOptions;
|
|
24
|
+
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({}, options), { name, breakpoints: index.breakpoints }));
|
|
25
|
+
// add alpha colors
|
|
26
|
+
for (let color in theme.colors) {
|
|
27
|
+
const c = theme.colors[color];
|
|
28
|
+
const is_common = color === 'divider' || color === 'background' || color === 'text';
|
|
29
|
+
c.soft = {
|
|
30
|
+
primary: is_common ? index.alpha(c.primary, 0.60) : index.alpha(c.primary, 0.08),
|
|
31
|
+
secondary: is_common ? index.alpha(c.primary, 0.90) : index.alpha(c.primary, 0.12)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return theme;
|
|
35
|
+
};
|
|
36
|
+
const ThemeContex = React.createContext({
|
|
37
|
+
theme: createTheme("light", {}),
|
|
38
|
+
onChange(theme) { },
|
|
39
|
+
});
|
|
40
|
+
const useTheme = () => {
|
|
41
|
+
const ctx = React.useContext(ThemeContex);
|
|
42
|
+
const theme = ctx.theme;
|
|
43
|
+
theme.change = (theme) => ctx.onChange(theme);
|
|
44
|
+
return theme;
|
|
45
|
+
};
|
|
37
46
|
|
|
38
47
|
exports.ThemeContex = ThemeContex;
|
|
39
|
-
exports.
|
|
40
|
-
exports.getTheme = getTheme;
|
|
48
|
+
exports.createTheme = createTheme;
|
|
41
49
|
exports.mergeObject = mergeObject;
|
|
42
50
|
exports.useTheme = useTheme;
|
|
43
51
|
//# sourceMappingURL=core.cjs.map
|
package/theme/core.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.cjs","sources":["../../src/theme/core.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"core.cjs","sources":["../../src/theme/core.ts"],"sourcesContent":["\"use client\"\nimport React, { useContext } from \"react\"\nimport { ObjectType, ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { alpha, breakpoints } from \"../css\"\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\n\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\n a = { ...a }\n b = { ...b }\n for (const key in b) {\n const v = (b as any)[key]\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\n a[key] = mergeObject(a[key], b[key])\n } else {\n a[key] = v\n }\n }\n return a\n}\n\n\nexport const createTheme = (name: string, options: ThemeOptionInput, mode: \"light\" | \"dark\" = \"light\"): ThemeOptions => {\n const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions\n let theme: any = mergeObject(defaultOptions, {\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n // add alpha colors\n for (let color in theme.colors) {\n const c = theme.colors[color] as ThemeOptionsColor\n const is_common = color === 'divider' || color === 'background' || color === 'text'\n c.soft = {\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\n }\n }\n\n return theme as ThemeOptions\n}\n\nexport type ThemeCntextProps = {\n theme: ThemeOptions,\n onChange: (theme: ThemeOptions) => void\n}\n\nexport const ThemeContex = React.createContext<ThemeCntextProps>({\n theme: createTheme(\"light\", {}),\n onChange(theme) { },\n})\n\nexport const useTheme = () => {\n const ctx = useContext(ThemeContex)\n const theme = ctx.theme\n theme.change = (theme: ThemeOptions) => ctx.onChange(theme)\n return theme\n}\n\n"],"names":[],"mappings":";;;;;;;;;;AASG;AACG;;AAEG;;;AAEA;;;AAGN;AACH;AAGO;AACJ;AACA;;AAOA;;AAEG;;;;;;AAOH;AACH;AAOO;AACJ;;AAEF;AAEM;AACJ;AACA;AACA;AACA;AACH;;;;;"}
|
package/theme/core.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { ThemeOptions } from './types.js';
|
|
1
|
+
import { ThemeOptionInput, ThemeOptions } from './types.js';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
change: (theme: string) => void;
|
|
6
|
-
};
|
|
7
|
-
declare const useTheme: () => UseThemeOptions;
|
|
3
|
+
declare const createTheme: (name: string, options: ThemeOptionInput, mode?: "light" | "dark") => ThemeOptions;
|
|
4
|
+
declare const useTheme: () => ThemeOptions;
|
|
8
5
|
|
|
9
|
-
export {
|
|
10
|
-
export type { UseThemeOptions };
|
|
6
|
+
export { createTheme, useTheme };
|
package/theme/core.js
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import React__default, { useContext } from 'react';
|
|
3
|
+
import { breakpoints, alpha } from '../css/index.js';
|
|
4
|
+
import { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions.js';
|
|
2
5
|
|
|
3
|
-
const ThemeFactory = new Map();
|
|
4
|
-
const ThemeContex = React__default.createContext({
|
|
5
|
-
theme: "light",
|
|
6
|
-
onChange: () => { }
|
|
7
|
-
});
|
|
8
|
-
const getTheme = (theme) => ThemeFactory.get(theme);
|
|
9
|
-
const useTheme = () => {
|
|
10
|
-
const ctx = useContext(ThemeContex);
|
|
11
|
-
const theme = ThemeFactory.get(ctx === null || ctx === void 0 ? void 0 : ctx.theme);
|
|
12
|
-
if (!theme) {
|
|
13
|
-
console.error("Theme not found, returning light theme as fallback");
|
|
14
|
-
return ThemeFactory.get("light");
|
|
15
|
-
}
|
|
16
|
-
theme.change = (theme) => {
|
|
17
|
-
ctx.onChange(theme);
|
|
18
|
-
};
|
|
19
|
-
return theme;
|
|
20
|
-
};
|
|
21
6
|
const mergeObject = (a, b) => {
|
|
22
7
|
a = Object.assign({}, a);
|
|
23
8
|
b = Object.assign({}, b);
|
|
@@ -32,6 +17,30 @@ const mergeObject = (a, b) => {
|
|
|
32
17
|
}
|
|
33
18
|
return a;
|
|
34
19
|
};
|
|
20
|
+
const createTheme = (name, options, mode = "light") => {
|
|
21
|
+
const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions;
|
|
22
|
+
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({}, options), { name, breakpoints: breakpoints }));
|
|
23
|
+
// add alpha colors
|
|
24
|
+
for (let color in theme.colors) {
|
|
25
|
+
const c = theme.colors[color];
|
|
26
|
+
const is_common = color === 'divider' || color === 'background' || color === 'text';
|
|
27
|
+
c.soft = {
|
|
28
|
+
primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),
|
|
29
|
+
secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return theme;
|
|
33
|
+
};
|
|
34
|
+
const ThemeContex = React__default.createContext({
|
|
35
|
+
theme: createTheme("light", {}),
|
|
36
|
+
onChange(theme) { },
|
|
37
|
+
});
|
|
38
|
+
const useTheme = () => {
|
|
39
|
+
const ctx = useContext(ThemeContex);
|
|
40
|
+
const theme = ctx.theme;
|
|
41
|
+
theme.change = (theme) => ctx.onChange(theme);
|
|
42
|
+
return theme;
|
|
43
|
+
};
|
|
35
44
|
|
|
36
|
-
export { ThemeContex,
|
|
45
|
+
export { ThemeContex, createTheme, mergeObject, useTheme };
|
|
37
46
|
//# sourceMappingURL=core.js.map
|
package/theme/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sources":["../../src/theme/core.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"core.js","sources":["../../src/theme/core.ts"],"sourcesContent":["\"use client\"\nimport React, { useContext } from \"react\"\nimport { ObjectType, ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { alpha, breakpoints } from \"../css\"\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\n\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\n a = { ...a }\n b = { ...b }\n for (const key in b) {\n const v = (b as any)[key]\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\n a[key] = mergeObject(a[key], b[key])\n } else {\n a[key] = v\n }\n }\n return a\n}\n\n\nexport const createTheme = (name: string, options: ThemeOptionInput, mode: \"light\" | \"dark\" = \"light\"): ThemeOptions => {\n const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions\n let theme: any = mergeObject(defaultOptions, {\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n // add alpha colors\n for (let color in theme.colors) {\n const c = theme.colors[color] as ThemeOptionsColor\n const is_common = color === 'divider' || color === 'background' || color === 'text'\n c.soft = {\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\n }\n }\n\n return theme as ThemeOptions\n}\n\nexport type ThemeCntextProps = {\n theme: ThemeOptions,\n onChange: (theme: ThemeOptions) => void\n}\n\nexport const ThemeContex = React.createContext<ThemeCntextProps>({\n theme: createTheme(\"light\", {}),\n onChange(theme) { },\n})\n\nexport const useTheme = () => {\n const ctx = useContext(ThemeContex)\n const theme = ctx.theme\n theme.change = (theme: ThemeOptions) => ctx.onChange(theme)\n return theme\n}\n\n"],"names":[],"mappings":";;;;;;;;AASG;AACG;;AAEG;;;AAEA;;;AAGN;AACH;AAGO;AACJ;AACA;;AAOA;;AAEG;;;;;;AAOH;AACH;AAOO;AACJ;;AAEF;AAEM;AACJ;AACA;AACA;AACA;AACH;;"}
|
package/theme/index.cjs
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
4
|
+
require('tslib');
|
|
5
|
+
require('react/jsx-runtime');
|
|
6
|
+
require('react');
|
|
7
|
+
require('../Tag/index.cjs');
|
|
3
8
|
var core = require('./core.cjs');
|
|
4
9
|
require('../css/getValue.cjs');
|
|
5
10
|
require('oncss');
|
|
6
|
-
|
|
11
|
+
require('../Document/index.cjs');
|
|
12
|
+
require('../css/CSSCacheProvider.cjs');
|
|
7
13
|
|
|
8
14
|
const themeRootClass = (theme) => `.xui-${theme}-theme-root`;
|
|
9
15
|
|
|
10
|
-
exports.
|
|
16
|
+
exports.createTheme = core.createTheme;
|
|
11
17
|
exports.useTheme = core.useTheme;
|
|
12
|
-
exports.ThemeProvider = ThemeProvider;
|
|
13
18
|
exports.themeRootClass = themeRootClass;
|
|
14
19
|
//# sourceMappingURL=index.cjs.map
|
package/theme/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["\"use client\"\nimport ThemeProvider from './ThemeProvider'\nimport { useTheme, createTheme } from './core'\nimport { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions'\nexport type { ThemeProviderProps } from './ThemeProvider'\n\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\n\nexport {\n ThemeProvider,\n createTheme,\n useTheme,\n lightThemeOptions,\n darkThemeOptions\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;;;AAMO;;;;"}
|
package/theme/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import 'tslib';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../Tag/index.js';
|
|
6
|
+
export { createTheme, useTheme } from './core.js';
|
|
2
7
|
import '../css/getValue.js';
|
|
3
8
|
import 'oncss';
|
|
4
|
-
|
|
9
|
+
import '../Document/index.js';
|
|
10
|
+
import '../css/CSSCacheProvider.js';
|
|
5
11
|
|
|
6
12
|
const themeRootClass = (theme) => `.xui-${theme}-theme-root`;
|
|
7
13
|
|
package/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["\"use client\"\nimport ThemeProvider from './ThemeProvider'\nimport { useTheme, createTheme } from './core'\nimport { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions'\nexport type { ThemeProviderProps } from './ThemeProvider'\n\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\n\nexport {\n ThemeProvider,\n createTheme,\n useTheme,\n lightThemeOptions,\n darkThemeOptions\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;AAMO;;"}
|
package/theme/types.d.ts
CHANGED
package/theme/createTheme.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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, mode = "light") => {
|
|
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
|
-
const defaultOptions = mode === 'light' ? ThemeDefaultOptions.lightThemeOptions : ThemeDefaultOptions.darkThemeOptions;
|
|
13
|
-
let theme = core.mergeObject(defaultOptions, Object.assign(Object.assign({}, options), { name, breakpoints: index.breakpoints }));
|
|
14
|
-
// add alpha colors
|
|
15
|
-
for (let color in theme.colors) {
|
|
16
|
-
const c = theme.colors[color];
|
|
17
|
-
const is_common = color === 'divider' || color === 'background' || color === 'text';
|
|
18
|
-
c.soft = {
|
|
19
|
-
primary: is_common ? index.alpha(c.primary, 0.60) : index.alpha(c.primary, 0.08),
|
|
20
|
-
secondary: is_common ? index.alpha(c.primary, 0.90) : index.alpha(c.primary, 0.12)
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
core.ThemeFactory.set(name, theme);
|
|
24
|
-
return theme;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.createTheme = createTheme;
|
|
28
|
-
//# sourceMappingURL=createTheme.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.cjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput, mode: \"light\" | \"dark\" = \"light\"): ThemeOptions => {\n if (ThemeFactory.has(name)) {\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\n return ThemeFactory.get(name) as ThemeOptions\n }\n const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions\n let theme: any = mergeObject(defaultOptions, {\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n // add alpha colors\n for (let color in theme.colors) {\n const c = theme.colors[color] as ThemeOptionsColor\n const is_common = color === 'divider' || color === 'background' || color === 'text'\n c.soft = {\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\n }\n }\n\n ThemeFactory.set(name, theme)\n\n return theme as ThemeOptions\n}\n"],"names":["ThemeFactory","lightThemeOptions","darkThemeOptions","mergeObject","breakpoints","alpha"],"mappings":";;;;;;AAKO,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,EAAE,IAAA,GAAyB,OAAO,KAAkB;AACpH,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;AACA,IAAA,MAAM,cAAc,GAAG,IAAI,KAAK,OAAO,GAAGC,qCAAiB,GAAGC,oCAAgB;AAC9E,IAAA,IAAI,KAAK,GAAQC,gBAAW,CAAC,cAAc,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACrC,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,IAAAL,iBAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B;;;;"}
|
package/theme/createTheme.d.ts
DELETED
package/theme/createTheme.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ThemeFactory, mergeObject } from './core.js';
|
|
2
|
-
import { breakpoints, alpha } from '../css/index.js';
|
|
3
|
-
import { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions.js';
|
|
4
|
-
|
|
5
|
-
const createTheme = (name, options, mode = "light") => {
|
|
6
|
-
if (ThemeFactory.has(name)) {
|
|
7
|
-
console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`);
|
|
8
|
-
return ThemeFactory.get(name);
|
|
9
|
-
}
|
|
10
|
-
const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions;
|
|
11
|
-
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({}, options), { name, breakpoints: breakpoints }));
|
|
12
|
-
// add alpha colors
|
|
13
|
-
for (let color in theme.colors) {
|
|
14
|
-
const c = theme.colors[color];
|
|
15
|
-
const is_common = color === 'divider' || color === 'background' || color === 'text';
|
|
16
|
-
c.soft = {
|
|
17
|
-
primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),
|
|
18
|
-
secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
ThemeFactory.set(name, theme);
|
|
22
|
-
return theme;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { createTheme };
|
|
26
|
-
//# sourceMappingURL=createTheme.js.map
|
package/theme/createTheme.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.js","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput, mode: \"light\" | \"dark\" = \"light\"): ThemeOptions => {\n if (ThemeFactory.has(name)) {\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\n return ThemeFactory.get(name) as ThemeOptions\n }\n const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions\n let theme: any = mergeObject(defaultOptions, {\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n // add alpha colors\n for (let color in theme.colors) {\n const c = theme.colors[color] as ThemeOptionsColor\n const is_common = color === 'divider' || color === 'background' || color === 'text'\n c.soft = {\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\n }\n }\n\n ThemeFactory.set(name, the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