@xanui/core 1.3.13 → 1.3.14
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/index.cjs +8 -0
- package/index.cjs.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +1 -1
- package/package.json +1 -1
- package/theme/ThemeDefaultOptions.cjs +17 -16
- package/theme/ThemeDefaultOptions.cjs.map +1 -1
- package/theme/ThemeDefaultOptions.js +17 -16
- package/theme/ThemeDefaultOptions.js.map +1 -1
- package/theme/core.cjs +13 -3
- package/theme/core.cjs.map +1 -1
- package/theme/core.d.ts +9 -1
- package/theme/core.js +14 -4
- package/theme/core.js.map +1 -1
- package/theme/index.cjs +8 -0
- package/theme/index.cjs.map +1 -1
- package/theme/index.js +1 -1
- package/theme/index.js.map +1 -1
- package/theme/types.d.ts +4 -4
package/index.cjs
CHANGED
|
@@ -58,6 +58,14 @@ exports.getValue = getValue;
|
|
|
58
58
|
exports.getProps = getProps;
|
|
59
59
|
exports.ThemeProvider = ThemeProvider;
|
|
60
60
|
exports.Easing = easing;
|
|
61
|
+
Object.defineProperty(exports, "DEFAULT_THEME_NAME", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return core.DEFAULT_THEME_NAME; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "THEME_MODE", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return core.THEME_MODE; }
|
|
68
|
+
});
|
|
61
69
|
exports.createTheme = core.createTheme;
|
|
62
70
|
exports.useTheme = core.useTheme;
|
|
63
71
|
exports.darkThemeOptions = ThemeDefaultOptions.darkThemeOptions;
|
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
|
@@ -21,10 +21,10 @@ export { breakpoints, css } from './css/index.js';
|
|
|
21
21
|
export { themeRootClass } from './theme/index.js';
|
|
22
22
|
export { Aliases, BreakpointKeys, CSSBreakpointType, CSSOptionProps, CSSProps, CSSValueType, FN, GlobalCSS } from './css/types.js';
|
|
23
23
|
export { CSSPropAsAttr, TagCSSProperties, TagComponentType, TagProps, TagPropsRoot } from './Tag/types.js';
|
|
24
|
-
export { BaseTypographyKeys, ColorsRefTypes, ObjectType, ThemeColorKeys, ThemeColorOption, ThemeInterface,
|
|
24
|
+
export { BaseTypographyKeys, ColorsRefTypes, ObjectType, ThemeColorKeys, ThemeColorOption, ThemeInterface, ThemeOptionInput, ThemeOptions, ThemeTypographyItem, TypographyRefTypes } from './theme/types.js';
|
|
25
25
|
export { default as getValue } from './css/getValue.js';
|
|
26
26
|
export { default as getProps } from './css/getProps.js';
|
|
27
27
|
export { default as ThemeProvider, ThemeProviderProps } from './theme/ThemeProvider.js';
|
|
28
28
|
export { default as Easing } from './animate/easing.js';
|
|
29
|
-
export { createTheme, useTheme } from './theme/core.js';
|
|
29
|
+
export { DEFAULT_THEME_NAME, THEME_MODE, createTheme, useTheme } from './theme/core.js';
|
|
30
30
|
export { darkThemeOptions, lightThemeOptions } from './theme/ThemeDefaultOptions.js';
|
package/index.js
CHANGED
|
@@ -23,6 +23,6 @@ export { default as getValue } from './css/getValue.js';
|
|
|
23
23
|
export { default as getProps } from './css/getProps.js';
|
|
24
24
|
export { default as ThemeProvider } from './theme/ThemeProvider.js';
|
|
25
25
|
export { default as Easing } from './animate/easing.js';
|
|
26
|
-
export { createTheme, useTheme } from './theme/core.js';
|
|
26
|
+
export { DEFAULT_THEME_NAME, THEME_MODE, createTheme, useTheme } from './theme/core.js';
|
|
27
27
|
export { darkThemeOptions, lightThemeOptions } from './theme/ThemeDefaultOptions.js';
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var core = require('./core.cjs');
|
|
3
4
|
var oklch = require('./oklch.cjs');
|
|
4
5
|
|
|
5
6
|
const lightShadows = [
|
|
@@ -68,37 +69,37 @@ const ThemeTypography = {
|
|
|
68
69
|
small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },
|
|
69
70
|
};
|
|
70
71
|
const lightThemeOptions = {
|
|
71
|
-
name:
|
|
72
|
-
mode:
|
|
72
|
+
name: core.DEFAULT_THEME_NAME.DARK,
|
|
73
|
+
mode: core.THEME_MODE.LIGTH,
|
|
73
74
|
rtl: false,
|
|
74
75
|
shadow: lightShadows,
|
|
75
76
|
globalStyle: {},
|
|
76
77
|
colors: {
|
|
77
78
|
default: oklch.createLightThemePalette("#FFFFFF"),
|
|
78
|
-
primary: oklch.createPalette("#2563EB",
|
|
79
|
-
accent: oklch.createPalette("#7C3AED",
|
|
80
|
-
success: oklch.createPalette("#16A34A",
|
|
81
|
-
info: oklch.createPalette("#06B6D4",
|
|
82
|
-
warning: oklch.createPalette("#ff8904",
|
|
83
|
-
danger: oklch.createPalette("#EF4444",
|
|
79
|
+
primary: oklch.createPalette("#2563EB", core.THEME_MODE.LIGTH),
|
|
80
|
+
accent: oklch.createPalette("#7C3AED", core.THEME_MODE.LIGTH),
|
|
81
|
+
success: oklch.createPalette("#16A34A", core.THEME_MODE.LIGTH),
|
|
82
|
+
info: oklch.createPalette("#06B6D4", core.THEME_MODE.LIGTH),
|
|
83
|
+
warning: oklch.createPalette("#ff8904", core.THEME_MODE.LIGTH),
|
|
84
|
+
danger: oklch.createPalette("#EF4444", core.THEME_MODE.LIGTH),
|
|
84
85
|
},
|
|
85
86
|
typography: ThemeTypography,
|
|
86
87
|
interfaces: {}
|
|
87
88
|
};
|
|
88
89
|
const darkThemeOptions = {
|
|
89
|
-
name:
|
|
90
|
-
mode:
|
|
90
|
+
name: core.DEFAULT_THEME_NAME.LIGHT,
|
|
91
|
+
mode: core.THEME_MODE.DARK,
|
|
91
92
|
rtl: false,
|
|
92
93
|
shadow: darkShadows,
|
|
93
94
|
globalStyle: {},
|
|
94
95
|
colors: {
|
|
95
96
|
default: oklch.createDarkThemePalette("#19191b"),
|
|
96
|
-
primary: oklch.createPalette("#2563EB",
|
|
97
|
-
accent: oklch.createPalette("#7C3AED",
|
|
98
|
-
success: oklch.createPalette("#16A34A",
|
|
99
|
-
info: oklch.createPalette("#06B6D4",
|
|
100
|
-
warning: oklch.createPalette("#ff8904",
|
|
101
|
-
danger: oklch.createPalette("#EF4444",
|
|
97
|
+
primary: oklch.createPalette("#2563EB", core.THEME_MODE.DARK),
|
|
98
|
+
accent: oklch.createPalette("#7C3AED", core.THEME_MODE.DARK),
|
|
99
|
+
success: oklch.createPalette("#16A34A", core.THEME_MODE.DARK),
|
|
100
|
+
info: oklch.createPalette("#06B6D4", core.THEME_MODE.DARK),
|
|
101
|
+
warning: oklch.createPalette("#ff8904", core.THEME_MODE.DARK),
|
|
102
|
+
danger: oklch.createPalette("#EF4444", core.THEME_MODE.DARK),
|
|
102
103
|
},
|
|
103
104
|
typography: ThemeTypography,
|
|
104
105
|
interfaces: {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeDefaultOptions.cjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createDarkThemePalette, createLightThemePalette, createPalette } from './oklch';\r\nimport { ThemeOptionInput, ThemeOptions } from './types'\r\n\r\nexport const lightShadows = [\r\n \"none\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\n]\r\n\r\nexport const darkShadows = [\r\n \"none\",\r\n\r\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n\r\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n\r\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n\r\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n\r\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\r\n]\r\n\r\n\r\nexport const ThemeTypography: ThemeOptions['typography'] = {\r\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\r\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\r\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\r\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\r\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\r\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\r\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\r\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\r\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\r\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\r\n}\r\n\r\n\r\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: \"default-light\",\r\n mode: \"light\",\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n default: createLightThemePalette(\"#FFFFFF\"),\r\n primary: createPalette(\"#2563EB\", \"light\"),\r\n accent: createPalette(\"#7C3AED\", \"light\"),\r\n success: createPalette(\"#16A34A\", \"light\"),\r\n info: createPalette(\"#06B6D4\", \"light\"),\r\n warning: createPalette(\"#ff8904\", \"light\"),\r\n danger: createPalette(\"#EF4444\", \"light\"),\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput;\r\n\r\nexport const darkThemeOptions: ThemeOptionInput = {\r\n name: \"default-dark\",\r\n mode: \"dark\",\r\n rtl: false,\r\n shadow: darkShadows,\r\n globalStyle: {},\r\n colors: {\r\n default: createDarkThemePalette(\"#19191b\"),\r\n primary: createPalette(\"#2563EB\", \"dark\"),\r\n accent: createPalette(\"#7C3AED\", \"dark\"),\r\n success: createPalette(\"#16A34A\", \"dark\"),\r\n info: createPalette(\"#06B6D4\", \"dark\"),\r\n warning: createPalette(\"#ff8904\", \"dark\"),\r\n danger: createPalette(\"#EF4444\", \"dark\"),\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput;\r\n\r\n\r\n"],"names":["createLightThemePalette","createPalette","createDarkThemePalette"],"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;IACzE,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAE1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;;AAItE,MAAM,eAAe,GAA+B;AACvD,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,QAA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CAAC;AAC1C,QAAA,IAAI,EAAEA,mBAAa,CAAC,SAAS,EAAE,OAAO,CAAC;AACvC,QAAA,OAAO,EAAEA,mBAAa,CAAC,SAAS,EAAE,OAAO,CAAC;AAC1C,QAAA,MAAM,EAAEA,mBAAa,CAAC,SAAS,EAAE,OAAO,CAAC;AAC5C,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;AAGT,MAAM,gBAAgB,GAAqB;AAC9C,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,MAAM,EAAE,WAAW;AACnB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,MAAM,EAAE;AACJ,QAAA,OAAO,EAAEC,4BAAsB,CAAC,SAAS,CAAC;AAC1C,QAAA,OAAO,EAAED,mBAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACzC,QAAA,MAAM,EAAEA,mBAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACxC,QAAA,OAAO,EAAEA,mBAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACzC,QAAA,IAAI,EAAEA,mBAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACtC,QAAA,OAAO,EAAEA,mBAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACzC,QAAA,MAAM,EAAEA,mBAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AAC3C,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ThemeDefaultOptions.cjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { DEFAULT_THEME_NAME, THEME_MODE } from './core';\r\nimport { createDarkThemePalette, createLightThemePalette, createPalette } from './oklch';\r\nimport { ThemeOptionInput, ThemeOptions } from './types'\r\n\r\nexport const lightShadows = [\r\n \"none\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\n]\r\n\r\nexport const darkShadows = [\r\n \"none\",\r\n\r\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n\r\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n\r\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n\r\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n\r\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\r\n]\r\n\r\n\r\nexport const ThemeTypography: ThemeOptions['typography'] = {\r\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\r\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\r\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\r\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\r\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\r\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\r\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\r\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\r\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\r\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\r\n}\r\n\r\n\r\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: DEFAULT_THEME_NAME.DARK,\r\n mode: THEME_MODE.LIGTH,\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n default: createLightThemePalette(\"#FFFFFF\"),\r\n primary: createPalette(\"#2563EB\", THEME_MODE.LIGTH),\r\n accent: createPalette(\"#7C3AED\", THEME_MODE.LIGTH),\r\n success: createPalette(\"#16A34A\", THEME_MODE.LIGTH),\r\n info: createPalette(\"#06B6D4\", THEME_MODE.LIGTH),\r\n warning: createPalette(\"#ff8904\", THEME_MODE.LIGTH),\r\n danger: createPalette(\"#EF4444\", THEME_MODE.LIGTH),\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput;\r\n\r\nexport const darkThemeOptions: ThemeOptionInput = {\r\n name: DEFAULT_THEME_NAME.LIGHT,\r\n mode: THEME_MODE.DARK,\r\n rtl: false,\r\n shadow: darkShadows,\r\n globalStyle: {},\r\n colors: {\r\n default: createDarkThemePalette(\"#19191b\"),\r\n primary: createPalette(\"#2563EB\", THEME_MODE.DARK),\r\n accent: createPalette(\"#7C3AED\", THEME_MODE.DARK),\r\n success: createPalette(\"#16A34A\", THEME_MODE.DARK),\r\n info: createPalette(\"#06B6D4\", THEME_MODE.DARK),\r\n warning: createPalette(\"#ff8904\", THEME_MODE.DARK),\r\n danger: createPalette(\"#EF4444\", THEME_MODE.DARK),\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput;\r\n\r\n\r\n"],"names":["DEFAULT_THEME_NAME","THEME_MODE","createLightThemePalette","createPalette","createDarkThemePalette"],"mappings":";;;;;AAIO,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;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EAAEF,eAAU,CAAC,IAAI,CAAC;QAC/C,OAAO,EAAEE,mBAAa,CAAC,SAAS,EAAEF,eAAU,CAAC,IAAI,CAAC;QAClD,MAAM,EAAEE,mBAAa,CAAC,SAAS,EAAEF,eAAU,CAAC,IAAI,CAAC;AACpD,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;;;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { THEME_MODE, DEFAULT_THEME_NAME } from './core.js';
|
|
1
2
|
import { createPalette, createLightThemePalette, createDarkThemePalette } from './oklch.js';
|
|
2
3
|
|
|
3
4
|
const lightShadows = [
|
|
@@ -66,37 +67,37 @@ const ThemeTypography = {
|
|
|
66
67
|
small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },
|
|
67
68
|
};
|
|
68
69
|
const lightThemeOptions = {
|
|
69
|
-
name:
|
|
70
|
-
mode:
|
|
70
|
+
name: DEFAULT_THEME_NAME.DARK,
|
|
71
|
+
mode: THEME_MODE.LIGTH,
|
|
71
72
|
rtl: false,
|
|
72
73
|
shadow: lightShadows,
|
|
73
74
|
globalStyle: {},
|
|
74
75
|
colors: {
|
|
75
76
|
default: createLightThemePalette("#FFFFFF"),
|
|
76
|
-
primary: createPalette("#2563EB",
|
|
77
|
-
accent: createPalette("#7C3AED",
|
|
78
|
-
success: createPalette("#16A34A",
|
|
79
|
-
info: createPalette("#06B6D4",
|
|
80
|
-
warning: createPalette("#ff8904",
|
|
81
|
-
danger: createPalette("#EF4444",
|
|
77
|
+
primary: createPalette("#2563EB", THEME_MODE.LIGTH),
|
|
78
|
+
accent: createPalette("#7C3AED", THEME_MODE.LIGTH),
|
|
79
|
+
success: createPalette("#16A34A", THEME_MODE.LIGTH),
|
|
80
|
+
info: createPalette("#06B6D4", THEME_MODE.LIGTH),
|
|
81
|
+
warning: createPalette("#ff8904", THEME_MODE.LIGTH),
|
|
82
|
+
danger: createPalette("#EF4444", THEME_MODE.LIGTH),
|
|
82
83
|
},
|
|
83
84
|
typography: ThemeTypography,
|
|
84
85
|
interfaces: {}
|
|
85
86
|
};
|
|
86
87
|
const darkThemeOptions = {
|
|
87
|
-
name:
|
|
88
|
-
mode:
|
|
88
|
+
name: DEFAULT_THEME_NAME.LIGHT,
|
|
89
|
+
mode: THEME_MODE.DARK,
|
|
89
90
|
rtl: false,
|
|
90
91
|
shadow: darkShadows,
|
|
91
92
|
globalStyle: {},
|
|
92
93
|
colors: {
|
|
93
94
|
default: createDarkThemePalette("#19191b"),
|
|
94
|
-
primary: createPalette("#2563EB",
|
|
95
|
-
accent: createPalette("#7C3AED",
|
|
96
|
-
success: createPalette("#16A34A",
|
|
97
|
-
info: createPalette("#06B6D4",
|
|
98
|
-
warning: createPalette("#ff8904",
|
|
99
|
-
danger: createPalette("#EF4444",
|
|
95
|
+
primary: createPalette("#2563EB", THEME_MODE.DARK),
|
|
96
|
+
accent: createPalette("#7C3AED", THEME_MODE.DARK),
|
|
97
|
+
success: createPalette("#16A34A", THEME_MODE.DARK),
|
|
98
|
+
info: createPalette("#06B6D4", THEME_MODE.DARK),
|
|
99
|
+
warning: createPalette("#ff8904", THEME_MODE.DARK),
|
|
100
|
+
danger: createPalette("#EF4444", THEME_MODE.DARK),
|
|
100
101
|
},
|
|
101
102
|
typography: ThemeTypography,
|
|
102
103
|
interfaces: {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeDefaultOptions.js","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createDarkThemePalette, createLightThemePalette, createPalette } from './oklch';\r\nimport { ThemeOptionInput, ThemeOptions } from './types'\r\n\r\nexport const lightShadows = [\r\n \"none\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\n]\r\n\r\nexport const darkShadows = [\r\n \"none\",\r\n\r\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n\r\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n\r\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n\r\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n\r\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\r\n]\r\n\r\n\r\nexport const ThemeTypography: ThemeOptions['typography'] = {\r\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\r\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\r\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\r\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\r\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\r\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\r\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\r\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\r\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\r\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\r\n}\r\n\r\n\r\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: \"default-light\",\r\n mode: \"light\",\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n default: createLightThemePalette(\"#FFFFFF\"),\r\n primary: createPalette(\"#2563EB\", \"light\"),\r\n accent: createPalette(\"#7C3AED\", \"light\"),\r\n success: createPalette(\"#16A34A\", \"light\"),\r\n info: createPalette(\"#06B6D4\", \"light\"),\r\n warning: createPalette(\"#ff8904\", \"light\"),\r\n danger: createPalette(\"#EF4444\", \"light\"),\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput;\r\n\r\nexport const darkThemeOptions: ThemeOptionInput = {\r\n name: \"default-dark\",\r\n mode: \"dark\",\r\n rtl: false,\r\n shadow: darkShadows,\r\n globalStyle: {},\r\n colors: {\r\n default: createDarkThemePalette(\"#19191b\"),\r\n primary: createPalette(\"#2563EB\", \"dark\"),\r\n accent: createPalette(\"#7C3AED\", \"dark\"),\r\n success: createPalette(\"#16A34A\", \"dark\"),\r\n info: createPalette(\"#06B6D4\", \"dark\"),\r\n warning: createPalette(\"#ff8904\", \"dark\"),\r\n danger: createPalette(\"#EF4444\", \"dark\"),\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput;\r\n\r\n\r\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,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,GAA+B;AACvD,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,GA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AAE,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC;AAC1C,QAAA,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC;AACvC,QAAA,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC;AAC1C,QAAA,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC;AAC5C,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;AAGT,MAAM,gBAAgB,GAAqB;AAC9C,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,MAAM,EAAE,WAAW;AACnB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,MAAM,EAAE;AACJ,QAAA,OAAO,EAAE,sBAAsB,CAAC,SAAS,CAAC;AAC1C,QAAA,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACzC,QAAA,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACxC,QAAA,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACzC,QAAA,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACtC,QAAA,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AACzC,QAAA,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC;AAC3C,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;;;;"}
|
|
1
|
+
{"version":3,"file":"ThemeDefaultOptions.js","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { DEFAULT_THEME_NAME, THEME_MODE } from './core';\r\nimport { createDarkThemePalette, createLightThemePalette, createPalette } from './oklch';\r\nimport { ThemeOptionInput, ThemeOptions } from './types'\r\n\r\nexport const lightShadows = [\r\n \"none\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\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)\",\r\n]\r\n\r\nexport const darkShadows = [\r\n \"none\",\r\n\r\n \"0px 1px 2px rgba(0,0,0,0.65), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 3px rgba(0,0,0,0.68), inset 0px 1px 0px rgba(255,255,255,0.04)\",\r\n \"0px 2px 4px rgba(0,0,0,0.7), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 3px 5px rgba(0,0,0,0.72), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n\r\n \"0px 4px 6px rgba(0,0,0,0.75), inset 0px 1px 0px rgba(255,255,255,0.05)\",\r\n \"0px 5px 8px rgba(0,0,0,0.78), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 6px 10px rgba(0,0,0,0.8), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 7px 12px rgba(0,0,0,0.82), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n \"0px 8px 14px rgba(0,0,0,0.84), inset 0px 1px 0px rgba(255,255,255,0.06)\",\r\n\r\n \"0px 9px 16px rgba(0,0,0,0.86), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 10px 18px rgba(0,0,0,0.88), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 11px 20px rgba(0,0,0,0.89), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 12px 22px rgba(0,0,0,0.9), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n \"0px 13px 24px rgba(0,0,0,0.91), inset 0px 1px 0px rgba(255,255,255,0.07)\",\r\n\r\n \"0px 14px 26px rgba(0,0,0,0.92), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 15px 28px rgba(0,0,0,0.93), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 16px 30px rgba(0,0,0,0.94), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 18px 32px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 20px 34px rgba(0,0,0,0.95), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n\r\n \"0px 22px 36px rgba(0,0,0,0.96), inset 0px 1px 0px rgba(255,255,255,0.08)\",\r\n \"0px 24px 38px rgba(0,0,0,0.97), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 26px 40px rgba(0,0,0,0.98), inset 0px 1px 0px rgba(255,255,255,0.09)\",\r\n \"0px 28px 42px rgba(0,0,0,0.99), inset 0px 1px 0px rgba(255,255,255,0.1)\",\r\n]\r\n\r\n\r\nexport const ThemeTypography: ThemeOptions['typography'] = {\r\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\r\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\r\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\r\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\r\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\r\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\r\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\r\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\r\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\r\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\r\n}\r\n\r\n\r\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: DEFAULT_THEME_NAME.DARK,\r\n mode: THEME_MODE.LIGTH,\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n default: createLightThemePalette(\"#FFFFFF\"),\r\n primary: createPalette(\"#2563EB\", THEME_MODE.LIGTH),\r\n accent: createPalette(\"#7C3AED\", THEME_MODE.LIGTH),\r\n success: createPalette(\"#16A34A\", THEME_MODE.LIGTH),\r\n info: createPalette(\"#06B6D4\", THEME_MODE.LIGTH),\r\n warning: createPalette(\"#ff8904\", THEME_MODE.LIGTH),\r\n danger: createPalette(\"#EF4444\", THEME_MODE.LIGTH),\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput;\r\n\r\nexport const darkThemeOptions: ThemeOptionInput = {\r\n name: DEFAULT_THEME_NAME.LIGHT,\r\n mode: THEME_MODE.DARK,\r\n rtl: false,\r\n shadow: darkShadows,\r\n globalStyle: {},\r\n colors: {\r\n default: createDarkThemePalette(\"#19191b\"),\r\n primary: createPalette(\"#2563EB\", THEME_MODE.DARK),\r\n accent: createPalette(\"#7C3AED\", THEME_MODE.DARK),\r\n success: createPalette(\"#16A34A\", THEME_MODE.DARK),\r\n info: createPalette(\"#06B6D4\", THEME_MODE.DARK),\r\n warning: createPalette(\"#ff8904\", THEME_MODE.DARK),\r\n danger: createPalette(\"#EF4444\", THEME_MODE.DARK),\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput;\r\n\r\n\r\n"],"names":[],"mappings":";;;AAIO,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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AAC;QAClD,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC;AACpD,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;;;;"}
|
package/theme/core.cjs
CHANGED
|
@@ -6,6 +6,16 @@ var index = require('../css/index.cjs');
|
|
|
6
6
|
var ThemeDefaultOptions = require('./ThemeDefaultOptions.cjs');
|
|
7
7
|
var oklch = require('./oklch.cjs');
|
|
8
8
|
|
|
9
|
+
exports.DEFAULT_THEME_NAME = void 0;
|
|
10
|
+
(function (DEFAULT_THEME_NAME) {
|
|
11
|
+
DEFAULT_THEME_NAME["DARK"] = "default-dark";
|
|
12
|
+
DEFAULT_THEME_NAME["LIGHT"] = "default-light";
|
|
13
|
+
})(exports.DEFAULT_THEME_NAME || (exports.DEFAULT_THEME_NAME = {}));
|
|
14
|
+
exports.THEME_MODE = void 0;
|
|
15
|
+
(function (THEME_MODE) {
|
|
16
|
+
THEME_MODE["DARK"] = "dark";
|
|
17
|
+
THEME_MODE["LIGTH"] = "light";
|
|
18
|
+
})(exports.THEME_MODE || (exports.THEME_MODE = {}));
|
|
9
19
|
const mergeObject = (a, b) => {
|
|
10
20
|
a = Object.assign({}, a);
|
|
11
21
|
b = Object.assign({}, b);
|
|
@@ -23,7 +33,7 @@ const mergeObject = (a, b) => {
|
|
|
23
33
|
const createTheme = (options) => {
|
|
24
34
|
var _a;
|
|
25
35
|
let mode = (_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : "light";
|
|
26
|
-
const defaultOptions = mode ===
|
|
36
|
+
const defaultOptions = mode === "dark" ? ThemeDefaultOptions.darkThemeOptions : ThemeDefaultOptions.lightThemeOptions;
|
|
27
37
|
for (let key in options === null || options === void 0 ? void 0 : options.colors) {
|
|
28
38
|
const color = options === null || options === void 0 ? void 0 : options.colors[key];
|
|
29
39
|
if (typeof color === "string") {
|
|
@@ -37,12 +47,12 @@ const createTheme = (options) => {
|
|
|
37
47
|
}
|
|
38
48
|
}
|
|
39
49
|
}
|
|
40
|
-
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({ name: mode === "dark" ?
|
|
50
|
+
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({ name: mode === "dark" ? exports.DEFAULT_THEME_NAME.DARK : exports.DEFAULT_THEME_NAME.LIGHT }, options), { breakpoints: index.breakpoints }));
|
|
41
51
|
return theme;
|
|
42
52
|
};
|
|
43
53
|
const ThemeContex = React.createContext({
|
|
44
54
|
theme: createTheme({
|
|
45
|
-
name: "default-
|
|
55
|
+
name: "default-light"
|
|
46
56
|
}),
|
|
47
57
|
onChange(theme) { },
|
|
48
58
|
});
|
package/theme/core.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.cjs","sources":["../../src/theme/core.ts"],"sourcesContent":["\"use client\"\r\nimport React, { useContext } from \"react\"\r\nimport { ObjectType, ThemeOptions, ThemeOptionInput } from \"./types\"\r\nimport { breakpoints } from \"../css\"\r\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\r\nimport { createPalette } from \"./oklch\"\r\n\r\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\r\n a = { ...a }\r\n b = { ...b }\r\n for (const key in b) {\r\n const v = (b as any)[key]\r\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\r\n a[key] = mergeObject(a[key], b[key])\r\n } else {\r\n a[key] = v\r\n }\r\n }\r\n return a\r\n}\r\n\r\n\r\nexport const createTheme = (options: ThemeOptionInput): ThemeOptions => {\r\n let mode = options?.mode ?? \"light\"\r\n const defaultOptions = mode ===
|
|
1
|
+
{"version":3,"file":"core.cjs","sources":["../../src/theme/core.ts"],"sourcesContent":["\"use client\"\r\nimport React, { useContext } from \"react\"\r\nimport { ObjectType, ThemeOptions, ThemeOptionInput } from \"./types\"\r\nimport { breakpoints } from \"../css\"\r\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\r\nimport { createPalette } from \"./oklch\"\r\n\r\nexport enum DEFAULT_THEME_NAME {\r\n DARK = \"default-dark\",\r\n LIGHT = \"default-light\"\r\n}\r\n\r\nexport enum THEME_MODE {\r\n DARK = \"dark\",\r\n LIGTH = \"light\"\r\n}\r\n\r\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\r\n a = { ...a }\r\n b = { ...b }\r\n for (const key in b) {\r\n const v = (b as any)[key]\r\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\r\n a[key] = mergeObject(a[key], b[key])\r\n } else {\r\n a[key] = v\r\n }\r\n }\r\n return a\r\n}\r\n\r\n\r\nexport const createTheme = (options: ThemeOptionInput): ThemeOptions => {\r\n let mode = options?.mode ?? \"light\"\r\n const defaultOptions = mode === \"dark\" ? darkThemeOptions : lightThemeOptions\r\n\r\n for (let key in options?.colors) {\r\n const color = (options as any)?.colors[key] as any\r\n if (typeof color === \"string\") {\r\n (options as any).colors[key] = createPalette(color)\r\n } else {\r\n const main = color.base\r\n if (main) {\r\n const pallate = createPalette(main);\r\n (options as any).colors[key] = {\r\n ...pallate,\r\n ...(options as any).colors[key],\r\n main: pallate.base\r\n }\r\n }\r\n }\r\n }\r\n\r\n let theme: any = mergeObject(defaultOptions, {\r\n name: mode === \"dark\" ? DEFAULT_THEME_NAME.DARK : DEFAULT_THEME_NAME.LIGHT,\r\n ...options,\r\n breakpoints: breakpoints\r\n })\r\n\r\n return theme as ThemeOptions\r\n}\r\n\r\nexport type ThemeCntextProps = {\r\n theme: ThemeOptions,\r\n onChange: (theme: ThemeOptions) => void\r\n}\r\n\r\nexport const ThemeContex = React.createContext<ThemeCntextProps>({\r\n theme: createTheme({\r\n name: \"default-light\"\r\n }),\r\n onChange(theme) { },\r\n})\r\n\r\nexport const useTheme = () => {\r\n const ctx = useContext(ThemeContex)\r\n const theme = ctx.theme\r\n theme.change = (theme: ThemeOptionInput) => ctx.onChange(createTheme(theme))\r\n return theme\r\n}\r\n\r\n"],"names":["DEFAULT_THEME_NAME","THEME_MODE"],"mappings":";;;;;;;;AAOYA;AAAZ;AACG;AACA;AACH;AAEYC;AAAZ;AACG;AACA;AACH;;;;AAKG;AACG;;AAEG;;;AAEA;;;AAGN;AACH;AAGO;;AACJ;AACA;;AAGG;AACA;;;;AAGG;;AAEG;;;;;AAUT;AAMA;AACH;AAOO;;AAED;;;AAGL;AAEM;AACJ;AACA;AACA;AACA;AACH;;;;;"}
|
package/theme/core.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { ThemeOptionInput, ThemeOptions } from './types.js';
|
|
2
2
|
|
|
3
|
+
declare enum DEFAULT_THEME_NAME {
|
|
4
|
+
DARK = "default-dark",
|
|
5
|
+
LIGHT = "default-light"
|
|
6
|
+
}
|
|
7
|
+
declare enum THEME_MODE {
|
|
8
|
+
DARK = "dark",
|
|
9
|
+
LIGTH = "light"
|
|
10
|
+
}
|
|
3
11
|
declare const createTheme: (options: ThemeOptionInput) => ThemeOptions;
|
|
4
12
|
declare const useTheme: () => ThemeOptions;
|
|
5
13
|
|
|
6
|
-
export { createTheme, useTheme };
|
|
14
|
+
export { DEFAULT_THEME_NAME, THEME_MODE, createTheme, useTheme };
|
package/theme/core.js
CHANGED
|
@@ -4,6 +4,16 @@ import { breakpoints } from '../css/index.js';
|
|
|
4
4
|
import { darkThemeOptions, lightThemeOptions } from './ThemeDefaultOptions.js';
|
|
5
5
|
import { createPalette } from './oklch.js';
|
|
6
6
|
|
|
7
|
+
var DEFAULT_THEME_NAME;
|
|
8
|
+
(function (DEFAULT_THEME_NAME) {
|
|
9
|
+
DEFAULT_THEME_NAME["DARK"] = "default-dark";
|
|
10
|
+
DEFAULT_THEME_NAME["LIGHT"] = "default-light";
|
|
11
|
+
})(DEFAULT_THEME_NAME || (DEFAULT_THEME_NAME = {}));
|
|
12
|
+
var THEME_MODE;
|
|
13
|
+
(function (THEME_MODE) {
|
|
14
|
+
THEME_MODE["DARK"] = "dark";
|
|
15
|
+
THEME_MODE["LIGTH"] = "light";
|
|
16
|
+
})(THEME_MODE || (THEME_MODE = {}));
|
|
7
17
|
const mergeObject = (a, b) => {
|
|
8
18
|
a = Object.assign({}, a);
|
|
9
19
|
b = Object.assign({}, b);
|
|
@@ -21,7 +31,7 @@ const mergeObject = (a, b) => {
|
|
|
21
31
|
const createTheme = (options) => {
|
|
22
32
|
var _a;
|
|
23
33
|
let mode = (_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : "light";
|
|
24
|
-
const defaultOptions = mode ===
|
|
34
|
+
const defaultOptions = mode === "dark" ? darkThemeOptions : lightThemeOptions;
|
|
25
35
|
for (let key in options === null || options === void 0 ? void 0 : options.colors) {
|
|
26
36
|
const color = options === null || options === void 0 ? void 0 : options.colors[key];
|
|
27
37
|
if (typeof color === "string") {
|
|
@@ -35,12 +45,12 @@ const createTheme = (options) => {
|
|
|
35
45
|
}
|
|
36
46
|
}
|
|
37
47
|
}
|
|
38
|
-
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({ name: mode === "dark" ?
|
|
48
|
+
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({ name: mode === "dark" ? DEFAULT_THEME_NAME.DARK : DEFAULT_THEME_NAME.LIGHT }, options), { breakpoints: breakpoints }));
|
|
39
49
|
return theme;
|
|
40
50
|
};
|
|
41
51
|
const ThemeContex = React__default.createContext({
|
|
42
52
|
theme: createTheme({
|
|
43
|
-
name: "default-
|
|
53
|
+
name: "default-light"
|
|
44
54
|
}),
|
|
45
55
|
onChange(theme) { },
|
|
46
56
|
});
|
|
@@ -51,5 +61,5 @@ const useTheme = () => {
|
|
|
51
61
|
return theme;
|
|
52
62
|
};
|
|
53
63
|
|
|
54
|
-
export { ThemeContex, createTheme, mergeObject, useTheme };
|
|
64
|
+
export { DEFAULT_THEME_NAME, THEME_MODE, ThemeContex, createTheme, mergeObject, useTheme };
|
|
55
65
|
//# sourceMappingURL=core.js.map
|
package/theme/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sources":["../../src/theme/core.ts"],"sourcesContent":["\"use client\"\r\nimport React, { useContext } from \"react\"\r\nimport { ObjectType, ThemeOptions, ThemeOptionInput } from \"./types\"\r\nimport { breakpoints } from \"../css\"\r\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\r\nimport { createPalette } from \"./oklch\"\r\n\r\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\r\n a = { ...a }\r\n b = { ...b }\r\n for (const key in b) {\r\n const v = (b as any)[key]\r\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\r\n a[key] = mergeObject(a[key], b[key])\r\n } else {\r\n a[key] = v\r\n }\r\n }\r\n return a\r\n}\r\n\r\n\r\nexport const createTheme = (options: ThemeOptionInput): ThemeOptions => {\r\n let mode = options?.mode ?? \"light\"\r\n const defaultOptions = mode ===
|
|
1
|
+
{"version":3,"file":"core.js","sources":["../../src/theme/core.ts"],"sourcesContent":["\"use client\"\r\nimport React, { useContext } from \"react\"\r\nimport { ObjectType, ThemeOptions, ThemeOptionInput } from \"./types\"\r\nimport { breakpoints } from \"../css\"\r\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\r\nimport { createPalette } from \"./oklch\"\r\n\r\nexport enum DEFAULT_THEME_NAME {\r\n DARK = \"default-dark\",\r\n LIGHT = \"default-light\"\r\n}\r\n\r\nexport enum THEME_MODE {\r\n DARK = \"dark\",\r\n LIGTH = \"light\"\r\n}\r\n\r\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\r\n a = { ...a }\r\n b = { ...b }\r\n for (const key in b) {\r\n const v = (b as any)[key]\r\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\r\n a[key] = mergeObject(a[key], b[key])\r\n } else {\r\n a[key] = v\r\n }\r\n }\r\n return a\r\n}\r\n\r\n\r\nexport const createTheme = (options: ThemeOptionInput): ThemeOptions => {\r\n let mode = options?.mode ?? \"light\"\r\n const defaultOptions = mode === \"dark\" ? darkThemeOptions : lightThemeOptions\r\n\r\n for (let key in options?.colors) {\r\n const color = (options as any)?.colors[key] as any\r\n if (typeof color === \"string\") {\r\n (options as any).colors[key] = createPalette(color)\r\n } else {\r\n const main = color.base\r\n if (main) {\r\n const pallate = createPalette(main);\r\n (options as any).colors[key] = {\r\n ...pallate,\r\n ...(options as any).colors[key],\r\n main: pallate.base\r\n }\r\n }\r\n }\r\n }\r\n\r\n let theme: any = mergeObject(defaultOptions, {\r\n name: mode === \"dark\" ? DEFAULT_THEME_NAME.DARK : DEFAULT_THEME_NAME.LIGHT,\r\n ...options,\r\n breakpoints: breakpoints\r\n })\r\n\r\n return theme as ThemeOptions\r\n}\r\n\r\nexport type ThemeCntextProps = {\r\n theme: ThemeOptions,\r\n onChange: (theme: ThemeOptions) => void\r\n}\r\n\r\nexport const ThemeContex = React.createContext<ThemeCntextProps>({\r\n theme: createTheme({\r\n name: \"default-light\"\r\n }),\r\n onChange(theme) { },\r\n})\r\n\r\nexport const useTheme = () => {\r\n const ctx = useContext(ThemeContex)\r\n const theme = ctx.theme\r\n theme.change = (theme: ThemeOptionInput) => ctx.onChange(createTheme(theme))\r\n return theme\r\n}\r\n\r\n"],"names":[],"mappings":";;;;;;;AAOA;AACG;AACA;AACH;;AAEA;AACG;AACA;AACH;;;;AAKG;AACG;;AAEG;;;AAEA;;;AAGN;AACH;AAGO;;AACJ;AACA;;AAGG;AACA;;;;AAGG;;AAEG;;;;;AAUT;AAMA;AACH;AAOO;;AAED;;;AAGL;AAEM;AACJ;AACA;AACA;AACA;AACH;;"}
|
package/theme/index.cjs
CHANGED
|
@@ -14,6 +14,14 @@ require('../css/CSSCacheProvider.cjs');
|
|
|
14
14
|
|
|
15
15
|
const themeRootClass = (theme) => `.xui-${theme}-theme-root`;
|
|
16
16
|
|
|
17
|
+
Object.defineProperty(exports, "DEFAULT_THEME_NAME", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return core.DEFAULT_THEME_NAME; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "THEME_MODE", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return core.THEME_MODE; }
|
|
24
|
+
});
|
|
17
25
|
exports.createTheme = core.createTheme;
|
|
18
26
|
exports.useTheme = core.useTheme;
|
|
19
27
|
exports.darkThemeOptions = ThemeDefaultOptions.darkThemeOptions;
|
package/theme/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["\"use client\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport { useTheme, createTheme } from './core'\r\nimport { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions'\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createTheme,\r\n useTheme,\r\n lightThemeOptions,\r\n darkThemeOptions\r\n}\r\n\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAMO
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["\"use client\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport { useTheme, createTheme, THEME_MODE, DEFAULT_THEME_NAME } from './core'\r\nimport { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions'\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createTheme,\r\n useTheme,\r\n lightThemeOptions,\r\n darkThemeOptions,\r\n THEME_MODE,\r\n DEFAULT_THEME_NAME\r\n}\r\n\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAMO;;;;;;;;;;;;;;"}
|
package/theme/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import 'tslib';
|
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../Tag/index.js';
|
|
6
|
-
export { createTheme, useTheme } from './core.js';
|
|
6
|
+
export { DEFAULT_THEME_NAME, THEME_MODE, createTheme, useTheme } from './core.js';
|
|
7
7
|
import '../css/getValue.js';
|
|
8
8
|
import 'oncss';
|
|
9
9
|
import '../Document/index.js';
|
package/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["\"use client\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport { useTheme, createTheme } from './core'\r\nimport { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions'\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createTheme,\r\n useTheme,\r\n lightThemeOptions,\r\n darkThemeOptions\r\n}\r\n\r\n"],"names":[],"mappings":";;;;;;;;;;;;AAMO;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["\"use client\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport { useTheme, createTheme, THEME_MODE, DEFAULT_THEME_NAME } from './core'\r\nimport { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions'\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createTheme,\r\n useTheme,\r\n lightThemeOptions,\r\n darkThemeOptions,\r\n THEME_MODE,\r\n DEFAULT_THEME_NAME\r\n}\r\n\r\n"],"names":[],"mappings":";;;;;;;;;;;;AAMO;;"}
|
package/theme/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GlobalCSS, BreakpointKeys } from '../css/types.js';
|
|
2
|
+
import { THEME_MODE } from './core.js';
|
|
2
3
|
|
|
3
4
|
type ObjectType = {
|
|
4
5
|
[key: string]: any;
|
|
@@ -21,10 +22,9 @@ type ThemeColorOption = {
|
|
|
21
22
|
ghost: string;
|
|
22
23
|
};
|
|
23
24
|
type ThemeInterface<T = any> = (defaultProps: T, theme: ThemeOptions) => T;
|
|
24
|
-
type ThemeMode = "dark" | "light";
|
|
25
25
|
type ThemeOptions = {
|
|
26
26
|
name: string;
|
|
27
|
-
mode?:
|
|
27
|
+
mode?: THEME_MODE;
|
|
28
28
|
rtl: boolean;
|
|
29
29
|
globalStyle: GlobalCSS;
|
|
30
30
|
breakpoints: {
|
|
@@ -38,7 +38,7 @@ type ThemeOptions = {
|
|
|
38
38
|
};
|
|
39
39
|
type ThemeOptionInput = {
|
|
40
40
|
name?: string;
|
|
41
|
-
mode?:
|
|
41
|
+
mode?: THEME_MODE;
|
|
42
42
|
rtl?: boolean;
|
|
43
43
|
globalStyle?: GlobalCSS;
|
|
44
44
|
shadow?: string[];
|
|
@@ -49,4 +49,4 @@ type ThemeOptionInput = {
|
|
|
49
49
|
type TypographyRefTypes = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "big" | "text" | "button" | "small";
|
|
50
50
|
type ColorsRefTypes = "default" | "default.base" | "default.surface" | "default.subtle" | "default.elevated" | "default.emphasis" | "default.contrast" | "default.muted" | "default.divider" | "default.ghost" | "primary" | "primary.base" | "primary.surface" | "primary.subtle" | "primary.elevated" | "primary.emphasis" | "primary.contrast" | "primary.muted" | "primary.divider" | "primary.ghost" | "accent" | "accent.base" | "accent.surface" | "accent.subtle" | "accent.elevated" | "accent.emphasis" | "accent.contrast" | "accent.muted" | "accent.divider" | "accent.ghost" | "success" | "success.base" | "success.surface" | "success.subtle" | "success.elevated" | "success.emphasis" | "success.contrast" | "success.muted" | "success.divider" | "success.ghost" | "info" | "info.base" | "info.surface" | "info.subtle" | "info.elevated" | "info.emphasis" | "info.contrast" | "info.muted" | "info.divider" | "info.ghost" | "warning" | "warning.base" | "warning.surface" | "warning.subtle" | "warning.elevated" | "warning.emphasis" | "warning.contrast" | "warning.muted" | "warning.divider" | "warning.ghost" | "danger" | "danger.base" | "danger.surface" | "danger.subtle" | "danger.elevated" | "danger.emphasis" | "danger.contrast" | "danger.muted" | "danger.divider" | "danger.ghost";
|
|
51
51
|
|
|
52
|
-
export type { BaseTypographyKeys, ColorsRefTypes, ObjectType, ThemeColorKeys, ThemeColorOption, ThemeInterface,
|
|
52
|
+
export type { BaseTypographyKeys, ColorsRefTypes, ObjectType, ThemeColorKeys, ThemeColorOption, ThemeInterface, ThemeOptionInput, ThemeOptions, ThemeTypographyItem, TypographyRefTypes };
|