@xanui/core 1.2.63 → 1.2.65
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/Transition/index.cjs +75 -14
- package/Transition/index.cjs.map +1 -1
- package/Transition/index.d.ts +27 -4
- package/Transition/index.js +76 -15
- package/Transition/index.js.map +1 -1
- package/{hooks/useTransition → Transition}/variants.cjs +60 -20
- package/Transition/variants.cjs.map +1 -0
- package/{hooks/useTransition → Transition}/variants.d.ts +38 -10
- package/{hooks/useTransition → Transition}/variants.js +59 -21
- package/Transition/variants.js.map +1 -0
- 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 +9 -13
- package/index.cjs.map +1 -1
- package/index.d.ts +2 -4
- package/index.js +1 -3
- package/index.js.map +1 -1
- package/package.json +2 -2
- 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 +7 -3
- package/theme/index.cjs.map +1 -1
- package/theme/index.js +7 -2
- package/theme/index.js.map +1 -1
- package/theme/types.d.ts +1 -0
- package/hooks/useTransition/index.cjs +0 -108
- package/hooks/useTransition/index.cjs.map +0 -1
- package/hooks/useTransition/index.d.ts +0 -36
- package/hooks/useTransition/index.js +0 -106
- package/hooks/useTransition/index.js.map +0 -1
- package/hooks/useTransition/variants.cjs.map +0 -1
- package/hooks/useTransition/variants.js.map +0 -1
- package/theme/createTheme.cjs +0 -29
- package/theme/createTheme.cjs.map +0 -1
- package/theme/createTheme.d.ts +0 -5
- package/theme/createTheme.js +0 -27
- package/theme/createTheme.js.map +0 -1
package/index.cjs
CHANGED
|
@@ -7,7 +7,6 @@ var useColorTemplate = require('./hooks/useColorTemplate.cjs');
|
|
|
7
7
|
var useBreakpoint = require('./breakpoint/useBreakpoint.cjs');
|
|
8
8
|
var useBreakpointProps = require('./breakpoint/useBreakpointProps.cjs');
|
|
9
9
|
var useInterface = require('./hooks/useInterface.cjs');
|
|
10
|
-
var index$6 = require('./hooks/useTransition/index.cjs');
|
|
11
10
|
var useMergeRefs = require('./hooks/useMergeRefs.cjs');
|
|
12
11
|
var index$5 = require('./Transition/index.cjs');
|
|
13
12
|
var index = require('./AppRoot/index.cjs');
|
|
@@ -17,12 +16,11 @@ var index$4 = require('./Document/index.cjs');
|
|
|
17
16
|
var AppRootProvider = require('./AppRoot/AppRootProvider.cjs');
|
|
18
17
|
var CSSCacheProvider = require('./css/CSSCacheProvider.cjs');
|
|
19
18
|
var index$1 = require('./Iframe/index.cjs');
|
|
20
|
-
var index$
|
|
21
|
-
var index$
|
|
19
|
+
var index$6 = require('./css/index.cjs');
|
|
20
|
+
var index$7 = require('./theme/index.cjs');
|
|
22
21
|
var getValue = require('./css/getValue.cjs');
|
|
23
22
|
var getProps = require('./css/getProps.cjs');
|
|
24
23
|
var ThemeProvider = require('./theme/ThemeProvider.cjs');
|
|
25
|
-
var createTheme = require('./theme/createTheme.cjs');
|
|
26
24
|
var core = require('./theme/core.cjs');
|
|
27
25
|
var ThemeDefaultOptions = require('./theme/ThemeDefaultOptions.cjs');
|
|
28
26
|
|
|
@@ -36,7 +34,6 @@ exports.useColorTemplate = useColorTemplate;
|
|
|
36
34
|
exports.useBreakpoint = useBreakpoint;
|
|
37
35
|
exports.useBreakpointProps = useBreakpointProps;
|
|
38
36
|
exports.useInterface = useInterface;
|
|
39
|
-
exports.useTransition = index$6;
|
|
40
37
|
exports.useMergeRefs = useMergeRefs;
|
|
41
38
|
exports.Transition = index$5;
|
|
42
39
|
exports.AppRoot = index;
|
|
@@ -48,17 +45,16 @@ exports.getCSSCache = CSSCacheProvider.getCSSCache;
|
|
|
48
45
|
exports.useCSSCache = CSSCacheProvider.useCSSCache;
|
|
49
46
|
exports.useCSSCacheId = CSSCacheProvider.useCSSCacheId;
|
|
50
47
|
exports.Iframe = index$1;
|
|
51
|
-
exports.adjustColor = index$
|
|
52
|
-
exports.adjustTextContrast = index$
|
|
53
|
-
exports.alpha = index$
|
|
54
|
-
exports.breakpoints = index$
|
|
55
|
-
exports.css = index$
|
|
56
|
-
exports.themeRootClass = index$
|
|
48
|
+
exports.adjustColor = index$6.adjustColor;
|
|
49
|
+
exports.adjustTextContrast = index$6.adjustTextContrast;
|
|
50
|
+
exports.alpha = index$6.alpha;
|
|
51
|
+
exports.breakpoints = index$6.breakpoints;
|
|
52
|
+
exports.css = index$6.css;
|
|
53
|
+
exports.themeRootClass = index$7.themeRootClass;
|
|
57
54
|
exports.getValue = getValue;
|
|
58
55
|
exports.getProps = getProps;
|
|
59
56
|
exports.ThemeProvider = ThemeProvider;
|
|
60
|
-
exports.createTheme =
|
|
61
|
-
exports.getTheme = core.getTheme;
|
|
57
|
+
exports.createTheme = core.createTheme;
|
|
62
58
|
exports.useTheme = core.useTheme;
|
|
63
59
|
exports.darkThemeOptions = ThemeDefaultOptions.darkThemeOptions;
|
|
64
60
|
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
|
@@ -5,9 +5,8 @@ export { UseColorTemplateColor, UseColorTemplateType, default as useColorTemplat
|
|
|
5
5
|
export { default as useBreakpoint } from './breakpoint/useBreakpoint.js';
|
|
6
6
|
export { default as useBreakpointProps, useBreakpointPropsType } from './breakpoint/useBreakpointProps.js';
|
|
7
7
|
export { default as useInterface } from './hooks/useInterface.js';
|
|
8
|
-
export { UseTransitionProps, UseTransitionState, UseTransitionVariant, UseTransitionVariantTypes, default as useTransition } from './hooks/useTransition/index.js';
|
|
9
8
|
export { default as useMergeRefs } from './hooks/useMergeRefs.js';
|
|
10
|
-
export { default as Transition, TransitionProps } from './Transition/index.js';
|
|
9
|
+
export { default as Transition, TransitionProps, TransitionState, TransitionVariant, TransitionVariantTypes } from './Transition/index.js';
|
|
11
10
|
export { default as AppRoot, AppRootProps } from './AppRoot/index.js';
|
|
12
11
|
export { default as Portal, PortalProps } from './Portal/index.js';
|
|
13
12
|
export { Renderar } from './AppRoot/Renderar.js';
|
|
@@ -23,6 +22,5 @@ export { ColorsRefTypes, ObjectType, ThemeColorOption, ThemeOptionInput, ThemeOp
|
|
|
23
22
|
export { default as getValue } from './css/getValue.js';
|
|
24
23
|
export { default as getProps } from './css/getProps.js';
|
|
25
24
|
export { default as ThemeProvider, ThemeProviderProps } from './theme/ThemeProvider.js';
|
|
26
|
-
export { createTheme } from './theme/
|
|
27
|
-
export { getTheme, useTheme } from './theme/core.js';
|
|
25
|
+
export { createTheme, useTheme } from './theme/core.js';
|
|
28
26
|
export { darkThemeOptions, lightThemeOptions } from './theme/ThemeDefaultOptions.js';
|
package/index.js
CHANGED
|
@@ -5,7 +5,6 @@ export { default as useColorTemplate } from './hooks/useColorTemplate.js';
|
|
|
5
5
|
export { default as useBreakpoint } from './breakpoint/useBreakpoint.js';
|
|
6
6
|
export { default as useBreakpointProps } from './breakpoint/useBreakpointProps.js';
|
|
7
7
|
export { default as useInterface } from './hooks/useInterface.js';
|
|
8
|
-
export { default as useTransition } from './hooks/useTransition/index.js';
|
|
9
8
|
export { default as useMergeRefs } from './hooks/useMergeRefs.js';
|
|
10
9
|
export { default as Transition } from './Transition/index.js';
|
|
11
10
|
export { default as AppRoot } from './AppRoot/index.js';
|
|
@@ -20,7 +19,6 @@ export { themeRootClass } from './theme/index.js';
|
|
|
20
19
|
export { default as getValue } from './css/getValue.js';
|
|
21
20
|
export { default as getProps } from './css/getProps.js';
|
|
22
21
|
export { default as ThemeProvider } from './theme/ThemeProvider.js';
|
|
23
|
-
export { createTheme } from './theme/
|
|
24
|
-
export { getTheme, useTheme } from './theme/core.js';
|
|
22
|
+
export { createTheme, useTheme } from './theme/core.js';
|
|
25
23
|
export { darkThemeOptions, lightThemeOptions } from './theme/ThemeDefaultOptions.js';
|
|
26
24
|
//# 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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xanui/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.65",
|
|
4
4
|
"description": "Xanui Core Library",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./index.cjs",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"oncss": "^1.2.
|
|
11
|
+
"oncss": "^1.2.12",
|
|
12
12
|
"pretty-class": "^1.0.8"
|
|
13
13
|
},
|
|
14
14
|
"keywords": []
|
|
@@ -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,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;IAC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AAA,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;I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AO,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\", darkThemeOptions)\n}"],"names":[],"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,uG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ClB,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;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,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vB,SAAA;AAED,QAAA,IAAI,EAAE;YACF,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,SAAS;AACvB,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;;;;;"}
|
package/theme/ThemeProvider.cjs
CHANGED
|
@@ -8,7 +8,6 @@ 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 };
|