@xanui/core 1.3.8 → 1.3.10
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 +5 -4
- package/AppRoot/index.cjs.map +1 -1
- package/AppRoot/index.d.ts +2 -1
- package/AppRoot/index.js +5 -4
- package/AppRoot/index.js.map +1 -1
- package/Iframe/index.cjs +1 -0
- package/Iframe/index.cjs.map +1 -1
- package/Iframe/index.js +1 -0
- package/Iframe/index.js.map +1 -1
- package/Tag/types.d.ts +1 -1
- package/Tag/useTagProps.cjs +5 -1
- package/Tag/useTagProps.cjs.map +1 -1
- package/Tag/useTagProps.js +5 -1
- package/Tag/useTagProps.js.map +1 -1
- package/Transition/index.cjs +1 -1
- package/Transition/index.cjs.map +1 -1
- package/Transition/index.d.ts +7 -2
- package/Transition/index.js +1 -1
- package/Transition/index.js.map +1 -1
- package/css/getProps.cjs +5 -8
- package/css/getProps.cjs.map +1 -1
- package/css/getProps.js +5 -8
- package/css/getProps.js.map +1 -1
- package/css/getValue.cjs +12 -10
- package/css/getValue.cjs.map +1 -1
- package/css/getValue.js +12 -10
- package/css/getValue.js.map +1 -1
- package/css/index.cjs +0 -32
- package/css/index.cjs.map +1 -1
- package/css/index.d.ts +1 -4
- package/css/index.js +1 -30
- package/css/index.js.map +1 -1
- package/hooks/useColorTemplate.cjs +28 -31
- package/hooks/useColorTemplate.cjs.map +1 -1
- package/hooks/useColorTemplate.d.ts +8 -6
- package/hooks/useColorTemplate.js +28 -31
- package/hooks/useColorTemplate.js.map +1 -1
- package/hooks/useInterface.cjs +1 -0
- package/hooks/useInterface.cjs.map +1 -1
- package/hooks/useInterface.d.ts +1 -3
- package/hooks/useInterface.js +1 -0
- package/hooks/useInterface.js.map +1 -1
- package/index.cjs +0 -3
- package/index.cjs.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +1 -1
- package/package.json +1 -1
- package/readme.md +2 -2
- package/theme/ThemeCssVars.cjs +36 -147
- package/theme/ThemeCssVars.cjs.map +1 -1
- package/theme/ThemeCssVars.js +36 -147
- package/theme/ThemeCssVars.js.map +1 -1
- package/theme/ThemeDefaultOptions.cjs +20 -86
- package/theme/ThemeDefaultOptions.cjs.map +1 -1
- package/theme/ThemeDefaultOptions.js +20 -86
- package/theme/ThemeDefaultOptions.js.map +1 -1
- package/theme/ThemeProvider.cjs +7 -8
- package/theme/ThemeProvider.cjs.map +1 -1
- package/theme/ThemeProvider.d.ts +6 -1
- package/theme/ThemeProvider.js +7 -8
- package/theme/ThemeProvider.js.map +1 -1
- package/theme/core.cjs +14 -9
- package/theme/core.cjs.map +1 -1
- package/theme/core.js +15 -10
- package/theme/core.js.map +1 -1
- package/theme/index.cjs +3 -0
- package/theme/index.cjs.map +1 -1
- package/theme/index.js +1 -0
- package/theme/index.js.map +1 -1
- package/theme/oklch.cjs +246 -0
- package/theme/oklch.cjs.map +1 -0
- package/theme/oklch.js +241 -0
- package/theme/oklch.js.map +1 -0
- package/theme/types.d.ts +26 -72
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var oklch = require('./oklch.cjs');
|
|
4
|
+
|
|
3
5
|
const lightShadows = [
|
|
4
6
|
"none",
|
|
5
7
|
"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)",
|
|
@@ -66,105 +68,37 @@ const ThemeTypography = {
|
|
|
66
68
|
small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },
|
|
67
69
|
};
|
|
68
70
|
const lightThemeOptions = {
|
|
69
|
-
name: "light",
|
|
71
|
+
name: "default-light",
|
|
72
|
+
mode: "light",
|
|
70
73
|
rtl: false,
|
|
71
74
|
shadow: lightShadows,
|
|
72
75
|
globalStyle: {},
|
|
73
76
|
colors: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
text: {
|
|
83
|
-
primary: "#2E2E2E",
|
|
84
|
-
secondary: "#6B7280",
|
|
85
|
-
},
|
|
86
|
-
brand: {
|
|
87
|
-
primary: "#2563EB",
|
|
88
|
-
secondary: "#1D4ED8",
|
|
89
|
-
text: "#F9FAFB",
|
|
90
|
-
},
|
|
91
|
-
accent: {
|
|
92
|
-
primary: "#7C3AED",
|
|
93
|
-
secondary: "#6D28D9",
|
|
94
|
-
text: "#F9FAFB",
|
|
95
|
-
},
|
|
96
|
-
success: {
|
|
97
|
-
primary: "#16A34A",
|
|
98
|
-
secondary: "#15803D",
|
|
99
|
-
text: "#F9FAFB",
|
|
100
|
-
},
|
|
101
|
-
info: {
|
|
102
|
-
primary: "#2563EB",
|
|
103
|
-
secondary: "#1D4ED8",
|
|
104
|
-
text: "#F9FAFB",
|
|
105
|
-
},
|
|
106
|
-
warning: {
|
|
107
|
-
primary: "#D97706",
|
|
108
|
-
secondary: "#B45309",
|
|
109
|
-
text: "#FFFBEB",
|
|
110
|
-
},
|
|
111
|
-
danger: {
|
|
112
|
-
primary: "#DC2626",
|
|
113
|
-
secondary: "#B91C1C",
|
|
114
|
-
text: "#FEF2F2",
|
|
115
|
-
},
|
|
77
|
+
surface: oklch.createLightThemePalette("#FFFFFF"),
|
|
78
|
+
primary: oklch.createPalette("#2563EB", "light"),
|
|
79
|
+
accent: oklch.createPalette("#7C3AED", "light"),
|
|
80
|
+
success: oklch.createPalette("#16A34A", "light"),
|
|
81
|
+
info: oklch.createPalette("#06B6D4", "light"),
|
|
82
|
+
warning: oklch.createPalette("#ff8904", "light"),
|
|
83
|
+
danger: oklch.createPalette("#EF4444", "light"),
|
|
116
84
|
},
|
|
117
85
|
typography: ThemeTypography,
|
|
118
86
|
interfaces: {}
|
|
119
87
|
};
|
|
120
88
|
const darkThemeOptions = {
|
|
121
|
-
name: "
|
|
89
|
+
name: "default-dark",
|
|
90
|
+
mode: "dark",
|
|
122
91
|
rtl: false,
|
|
123
92
|
shadow: darkShadows,
|
|
124
93
|
globalStyle: {},
|
|
125
94
|
colors: {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
text: {
|
|
135
|
-
primary: "#E5E7EB", // main readable text
|
|
136
|
-
secondary: "#9CA3AF", // muted / secondary text
|
|
137
|
-
},
|
|
138
|
-
brand: {
|
|
139
|
-
primary: "#1D4ED8",
|
|
140
|
-
secondary: "#2563EB",
|
|
141
|
-
text: "#F9FAFB",
|
|
142
|
-
},
|
|
143
|
-
accent: {
|
|
144
|
-
primary: "#6D28D9",
|
|
145
|
-
secondary: "#7C3AED",
|
|
146
|
-
text: "#F9FAFB",
|
|
147
|
-
},
|
|
148
|
-
success: {
|
|
149
|
-
primary: "#15803D",
|
|
150
|
-
secondary: "#16A34A",
|
|
151
|
-
text: "#F9FAFB",
|
|
152
|
-
},
|
|
153
|
-
info: {
|
|
154
|
-
primary: "#1D4ED8",
|
|
155
|
-
secondary: "#2563EB",
|
|
156
|
-
text: "#F9FAFB",
|
|
157
|
-
},
|
|
158
|
-
warning: {
|
|
159
|
-
primary: "#B45309",
|
|
160
|
-
secondary: "#D97706",
|
|
161
|
-
text: "#FFFBEB",
|
|
162
|
-
},
|
|
163
|
-
danger: {
|
|
164
|
-
primary: "#B91C1C",
|
|
165
|
-
secondary: "#DC2626",
|
|
166
|
-
text: "#FEF2F2",
|
|
167
|
-
},
|
|
95
|
+
surface: oklch.createDarkThemePalette("#0F1115"),
|
|
96
|
+
primary: oklch.createPalette("#2563EB", "dark"),
|
|
97
|
+
accent: oklch.createPalette("#7C3AED", "dark"),
|
|
98
|
+
success: oklch.createPalette("#16A34A", "dark"),
|
|
99
|
+
info: oklch.createPalette("#06B6D4", "dark"),
|
|
100
|
+
warning: oklch.createPalette("#ff8904", "dark"),
|
|
101
|
+
danger: oklch.createPalette("#EF4444", "dark"),
|
|
168
102
|
},
|
|
169
103
|
typography: ThemeTypography,
|
|
170
104
|
interfaces: {}
|
|
@@ -1 +1 @@
|
|
|
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\",\n secondary: \"#e8e8e8\",\n },\n\n divider: {\n primary: \"#E5E7EB\",\n secondary: \"#D1D5DB\",\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: \"#212121\",\n secondary: \"#303030\",\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;IACv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AAI,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
|
+
{"version":3,"file":"ThemeDefaultOptions.cjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createDarkThemePalette, createLightThemePalette, createPalette } from './oklch';\nimport { ThemeOptionInput, ThemeOptions } 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: ThemeOptions['typography'] = {\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\n\nexport const lightThemeOptions: ThemeOptionInput = {\n name: \"default-light\",\n mode: \"light\",\n rtl: false,\n shadow: lightShadows,\n globalStyle: {},\n colors: {\n surface: createLightThemePalette(\"#FFFFFF\"),\n primary: createPalette(\"#2563EB\", \"light\"),\n accent: createPalette(\"#7C3AED\", \"light\"),\n success: createPalette(\"#16A34A\", \"light\"),\n info: createPalette(\"#06B6D4\", \"light\"),\n warning: createPalette(\"#ff8904\", \"light\"),\n danger: createPalette(\"#EF4444\", \"light\"),\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput;\n\nexport const darkThemeOptions: ThemeOptionInput = {\n name: \"default-dark\",\n mode: \"dark\",\n rtl: false,\n shadow: darkShadows,\n globalStyle: {},\n colors: {\n surface: createDarkThemePalette(\"#0F1115\"),\n primary: createPalette(\"#2563EB\", \"dark\"),\n accent: createPalette(\"#7C3AED\", \"dark\"),\n success: createPalette(\"#16A34A\", \"dark\"),\n info: createPalette(\"#06B6D4\", \"dark\"),\n warning: createPalette(\"#ff8904\", \"dark\"),\n danger: createPalette(\"#EF4444\", \"dark\"),\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput;\n\n\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,wEAAw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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,3 +1,5 @@
|
|
|
1
|
+
import { createPalette, createLightThemePalette, createDarkThemePalette } from './oklch.js';
|
|
2
|
+
|
|
1
3
|
const lightShadows = [
|
|
2
4
|
"none",
|
|
3
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)",
|
|
@@ -64,105 +66,37 @@ const ThemeTypography = {
|
|
|
64
66
|
small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },
|
|
65
67
|
};
|
|
66
68
|
const lightThemeOptions = {
|
|
67
|
-
name: "light",
|
|
69
|
+
name: "default-light",
|
|
70
|
+
mode: "light",
|
|
68
71
|
rtl: false,
|
|
69
72
|
shadow: lightShadows,
|
|
70
73
|
globalStyle: {},
|
|
71
74
|
colors: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
text: {
|
|
81
|
-
primary: "#2E2E2E",
|
|
82
|
-
secondary: "#6B7280",
|
|
83
|
-
},
|
|
84
|
-
brand: {
|
|
85
|
-
primary: "#2563EB",
|
|
86
|
-
secondary: "#1D4ED8",
|
|
87
|
-
text: "#F9FAFB",
|
|
88
|
-
},
|
|
89
|
-
accent: {
|
|
90
|
-
primary: "#7C3AED",
|
|
91
|
-
secondary: "#6D28D9",
|
|
92
|
-
text: "#F9FAFB",
|
|
93
|
-
},
|
|
94
|
-
success: {
|
|
95
|
-
primary: "#16A34A",
|
|
96
|
-
secondary: "#15803D",
|
|
97
|
-
text: "#F9FAFB",
|
|
98
|
-
},
|
|
99
|
-
info: {
|
|
100
|
-
primary: "#2563EB",
|
|
101
|
-
secondary: "#1D4ED8",
|
|
102
|
-
text: "#F9FAFB",
|
|
103
|
-
},
|
|
104
|
-
warning: {
|
|
105
|
-
primary: "#D97706",
|
|
106
|
-
secondary: "#B45309",
|
|
107
|
-
text: "#FFFBEB",
|
|
108
|
-
},
|
|
109
|
-
danger: {
|
|
110
|
-
primary: "#DC2626",
|
|
111
|
-
secondary: "#B91C1C",
|
|
112
|
-
text: "#FEF2F2",
|
|
113
|
-
},
|
|
75
|
+
surface: createLightThemePalette("#FFFFFF"),
|
|
76
|
+
primary: createPalette("#2563EB", "light"),
|
|
77
|
+
accent: createPalette("#7C3AED", "light"),
|
|
78
|
+
success: createPalette("#16A34A", "light"),
|
|
79
|
+
info: createPalette("#06B6D4", "light"),
|
|
80
|
+
warning: createPalette("#ff8904", "light"),
|
|
81
|
+
danger: createPalette("#EF4444", "light"),
|
|
114
82
|
},
|
|
115
83
|
typography: ThemeTypography,
|
|
116
84
|
interfaces: {}
|
|
117
85
|
};
|
|
118
86
|
const darkThemeOptions = {
|
|
119
|
-
name: "
|
|
87
|
+
name: "default-dark",
|
|
88
|
+
mode: "dark",
|
|
120
89
|
rtl: false,
|
|
121
90
|
shadow: darkShadows,
|
|
122
91
|
globalStyle: {},
|
|
123
92
|
colors: {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
text: {
|
|
133
|
-
primary: "#E5E7EB", // main readable text
|
|
134
|
-
secondary: "#9CA3AF", // muted / secondary text
|
|
135
|
-
},
|
|
136
|
-
brand: {
|
|
137
|
-
primary: "#1D4ED8",
|
|
138
|
-
secondary: "#2563EB",
|
|
139
|
-
text: "#F9FAFB",
|
|
140
|
-
},
|
|
141
|
-
accent: {
|
|
142
|
-
primary: "#6D28D9",
|
|
143
|
-
secondary: "#7C3AED",
|
|
144
|
-
text: "#F9FAFB",
|
|
145
|
-
},
|
|
146
|
-
success: {
|
|
147
|
-
primary: "#15803D",
|
|
148
|
-
secondary: "#16A34A",
|
|
149
|
-
text: "#F9FAFB",
|
|
150
|
-
},
|
|
151
|
-
info: {
|
|
152
|
-
primary: "#1D4ED8",
|
|
153
|
-
secondary: "#2563EB",
|
|
154
|
-
text: "#F9FAFB",
|
|
155
|
-
},
|
|
156
|
-
warning: {
|
|
157
|
-
primary: "#B45309",
|
|
158
|
-
secondary: "#D97706",
|
|
159
|
-
text: "#FFFBEB",
|
|
160
|
-
},
|
|
161
|
-
danger: {
|
|
162
|
-
primary: "#B91C1C",
|
|
163
|
-
secondary: "#DC2626",
|
|
164
|
-
text: "#FEF2F2",
|
|
165
|
-
},
|
|
93
|
+
surface: createDarkThemePalette("#0F1115"),
|
|
94
|
+
primary: createPalette("#2563EB", "dark"),
|
|
95
|
+
accent: createPalette("#7C3AED", "dark"),
|
|
96
|
+
success: createPalette("#16A34A", "dark"),
|
|
97
|
+
info: createPalette("#06B6D4", "dark"),
|
|
98
|
+
warning: createPalette("#ff8904", "dark"),
|
|
99
|
+
danger: createPalette("#EF4444", "dark"),
|
|
166
100
|
},
|
|
167
101
|
typography: ThemeTypography,
|
|
168
102
|
interfaces: {}
|
|
@@ -1 +1 @@
|
|
|
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\",\n secondary: \"#e8e8e8\",\n },\n\n divider: {\n primary: \"#E5E7EB\",\n secondary: \"#D1D5DB\",\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: \"#212121\",\n secondary: \"#303030\",\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,0EAA0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KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;;;;"}
|
|
1
|
+
{"version":3,"file":"ThemeDefaultOptions.js","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createDarkThemePalette, createLightThemePalette, createPalette } from './oklch';\nimport { ThemeOptionInput, ThemeOptions } 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: ThemeOptions['typography'] = {\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\n\nexport const lightThemeOptions: ThemeOptionInput = {\n name: \"default-light\",\n mode: \"light\",\n rtl: false,\n shadow: lightShadows,\n globalStyle: {},\n colors: {\n surface: createLightThemePalette(\"#FFFFFF\"),\n primary: createPalette(\"#2563EB\", \"light\"),\n accent: createPalette(\"#7C3AED\", \"light\"),\n success: createPalette(\"#16A34A\", \"light\"),\n info: createPalette(\"#06B6D4\", \"light\"),\n warning: createPalette(\"#ff8904\", \"light\"),\n danger: createPalette(\"#EF4444\", \"light\"),\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput;\n\nexport const darkThemeOptions: ThemeOptionInput = {\n name: \"default-dark\",\n mode: \"dark\",\n rtl: false,\n shadow: darkShadows,\n globalStyle: {},\n colors: {\n surface: createDarkThemePalette(\"#0F1115\"),\n primary: createPalette(\"#2563EB\", \"dark\"),\n accent: createPalette(\"#7C3AED\", \"dark\"),\n success: createPalette(\"#16A34A\", \"dark\"),\n info: createPalette(\"#06B6D4\", \"dark\"),\n warning: createPalette(\"#ff8904\", \"dark\"),\n danger: createPalette(\"#EF4444\", \"dark\"),\n },\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput;\n\n\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,E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#__PURE__*/_interopNamespaceDefault(React);
|
|
34
34
|
|
|
35
35
|
const ThemeProvider = (_a) => {
|
|
36
|
-
var { children, theme: THEME, onThemeChange, isRoot, noScrollbarCss } = _a, props = tslib.__rest(_a, ["children", "theme", "onThemeChange", "isRoot", "noScrollbarCss"]);
|
|
36
|
+
var { children, theme: THEME, scrollbar, onThemeChange, isRoot, noScrollbarCss } = _a, props = tslib.__rest(_a, ["children", "theme", "scrollbar", "onThemeChange", "isRoot", "noScrollbarCss"]);
|
|
37
37
|
const doc = index.useDocument();
|
|
38
38
|
const cacheId = CSSCacheProvider.useCSSCacheId();
|
|
39
39
|
const theme = React__namespace.useMemo(() => core.createTheme(THEME), [THEME]);
|
|
@@ -105,12 +105,13 @@ const ThemeProvider = (_a) => {
|
|
|
105
105
|
});
|
|
106
106
|
}, []);
|
|
107
107
|
const scrollbarCss = React__namespace.useMemo(() => {
|
|
108
|
+
var _a, _b, _c;
|
|
108
109
|
if (noScrollbarCss)
|
|
109
110
|
return;
|
|
110
111
|
const cls = (cls) => `${index$2.themeRootClass(theme.name)} ${cls}`;
|
|
111
|
-
let thumbSize =
|
|
112
|
-
let thumbColor = "var(--color-
|
|
113
|
-
let trackColor = "
|
|
112
|
+
let thumbSize = (_a = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.size) !== null && _a !== void 0 ? _a : 8;
|
|
113
|
+
let thumbColor = (_b = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.thumbColor) !== null && _b !== void 0 ? _b : "var(--color-surface-muted)";
|
|
114
|
+
let trackColor = (_c = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.trackColor) !== null && _c !== void 0 ? _c : "var(--color-surface-divider)";
|
|
114
115
|
return index$1.css({
|
|
115
116
|
"@global": {
|
|
116
117
|
[cls('*::-webkit-scrollbar')]: {
|
|
@@ -120,11 +121,9 @@ const ThemeProvider = (_a) => {
|
|
|
120
121
|
[cls("*::-webkit-scrollbar-thumb")]: {
|
|
121
122
|
backgroundColor: thumbColor,
|
|
122
123
|
borderRadius: "6px",
|
|
123
|
-
opacity: 0.6,
|
|
124
124
|
},
|
|
125
125
|
[cls("*::-webkit-scrollbar-thumb:hover")]: {
|
|
126
126
|
backgroundColor: thumbColor,
|
|
127
|
-
opacity: 0.0,
|
|
128
127
|
},
|
|
129
128
|
[cls("*::-webkit-scrollbar-track")]: {
|
|
130
129
|
backgroundColor: trackColor,
|
|
@@ -142,9 +141,9 @@ const ThemeProvider = (_a) => {
|
|
|
142
141
|
onChange: (t) => {
|
|
143
142
|
onThemeChange && onThemeChange(t);
|
|
144
143
|
}
|
|
145
|
-
}, children: [isRoot && jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ServerStyleTag, { factory: resetCss }), !noScrollbarCss && jsxRuntime.jsx(ServerStyleTag, { factory: scrollbarCss })] }), jsxRuntime.jsx(ServerStyleTag, { factory: themeGlobalStyle }), jsxRuntime.jsx(index$3, Object.assign({ minHeight: "100%", bgcolor: "
|
|
144
|
+
}, children: [isRoot && jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ServerStyleTag, { factory: resetCss }), !noScrollbarCss && jsxRuntime.jsx(ServerStyleTag, { factory: scrollbarCss })] }), jsxRuntime.jsx(ServerStyleTag, { factory: themeGlobalStyle }), jsxRuntime.jsx(index$3, Object.assign({ minHeight: "100%", bgcolor: "surface.main", color: "surface.contrast", fontSize: "text", fontWeight: "text", lineHeight: "text", fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
|
|
146
145
|
"& a": {
|
|
147
|
-
color: "
|
|
146
|
+
color: "primary.main",
|
|
148
147
|
},
|
|
149
148
|
}, baseClass: `${theme.name}-theme-root`, direction: theme.rtl ? "rtl" : "ltr", children: children }))] }));
|
|
150
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.cjs","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport { ThemeOptionInput, ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { createTheme, 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: ThemeOptionInput;\n onThemeChange?: (theme: ThemeOptions) => void\n isRoot?: boolean;\n noScrollbarCss?: boolean;\n}\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme: THEME, onThemeChange, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => {\n const doc = useDocument()\n const cacheId = useCSSCacheId()\n\n const theme = React.useMemo(() => createTheme(THEME), [THEME])\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 =
|
|
1
|
+
{"version":3,"file":"ThemeProvider.cjs","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport { ThemeOptionInput, ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { createTheme, 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: ThemeOptionInput;\n onThemeChange?: (theme: ThemeOptions) => void\n isRoot?: boolean;\n noScrollbarCss?: boolean;\n scrollbar?: {\n size?: number;\n thumbColor?: string;\n trackColor?: string;\n }\n}\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme: THEME, scrollbar, onThemeChange, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => {\n const doc = useDocument()\n const cacheId = useCSSCacheId()\n\n const theme = React.useMemo(() => createTheme(THEME), [THEME])\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 = scrollbar?.size ?? 8\n let thumbColor = scrollbar?.thumbColor ?? \"var(--color-surface-muted)\"\n let trackColor = scrollbar?.trackColor ?? \"var(--color-surface-divider)\"\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 },\n [cls(\"*::-webkit-scrollbar-thumb:hover\")]: {\n backgroundColor: thumbColor,\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=\"surface.main\"\n color=\"surface.contrast\"\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: \"primary.main\",\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AAA2D;AACxD;AACA;AAEA;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;AACA;AACA;AACA;AAEA;AACG;AACG;AACG;AACA;AACF;AACD;AACG;AACA;AACF;AACD;AACG;AACF;AACD;AACG;AACA;AACF;AACH;;AAED;AACA;;AAEF;AACJ;AAEA;;AAIS;AACG;;AAEL;AAqBK;AACG;AACF;;AAShB;;"}
|
package/theme/ThemeProvider.d.ts
CHANGED
|
@@ -7,8 +7,13 @@ type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {
|
|
|
7
7
|
onThemeChange?: (theme: ThemeOptions) => void;
|
|
8
8
|
isRoot?: boolean;
|
|
9
9
|
noScrollbarCss?: boolean;
|
|
10
|
+
scrollbar?: {
|
|
11
|
+
size?: number;
|
|
12
|
+
thumbColor?: string;
|
|
13
|
+
trackColor?: string;
|
|
14
|
+
};
|
|
10
15
|
};
|
|
11
|
-
declare const ThemeProvider: <T extends TagComponentType = "div">({ children, theme: THEME, onThemeChange, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => React.JSX.Element;
|
|
16
|
+
declare const ThemeProvider: <T extends TagComponentType = "div">({ children, theme: THEME, scrollbar, onThemeChange, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => React.JSX.Element;
|
|
12
17
|
|
|
13
18
|
export { ThemeProvider as default };
|
|
14
19
|
export type { ThemeProviderProps };
|
package/theme/ThemeProvider.js
CHANGED
|
@@ -12,7 +12,7 @@ import { themeRootClass } from './index.js';
|
|
|
12
12
|
import { useCSSCacheId } from '../css/CSSCacheProvider.js';
|
|
13
13
|
|
|
14
14
|
const ThemeProvider = (_a) => {
|
|
15
|
-
var { children, theme: THEME, onThemeChange, isRoot, noScrollbarCss } = _a, props = __rest(_a, ["children", "theme", "onThemeChange", "isRoot", "noScrollbarCss"]);
|
|
15
|
+
var { children, theme: THEME, scrollbar, onThemeChange, isRoot, noScrollbarCss } = _a, props = __rest(_a, ["children", "theme", "scrollbar", "onThemeChange", "isRoot", "noScrollbarCss"]);
|
|
16
16
|
const doc = useDocument();
|
|
17
17
|
const cacheId = useCSSCacheId();
|
|
18
18
|
const theme = React.useMemo(() => createTheme(THEME), [THEME]);
|
|
@@ -84,12 +84,13 @@ const ThemeProvider = (_a) => {
|
|
|
84
84
|
});
|
|
85
85
|
}, []);
|
|
86
86
|
const scrollbarCss = React.useMemo(() => {
|
|
87
|
+
var _a, _b, _c;
|
|
87
88
|
if (noScrollbarCss)
|
|
88
89
|
return;
|
|
89
90
|
const cls = (cls) => `${themeRootClass(theme.name)} ${cls}`;
|
|
90
|
-
let thumbSize =
|
|
91
|
-
let thumbColor = "var(--color-
|
|
92
|
-
let trackColor = "
|
|
91
|
+
let thumbSize = (_a = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.size) !== null && _a !== void 0 ? _a : 8;
|
|
92
|
+
let thumbColor = (_b = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.thumbColor) !== null && _b !== void 0 ? _b : "var(--color-surface-muted)";
|
|
93
|
+
let trackColor = (_c = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.trackColor) !== null && _c !== void 0 ? _c : "var(--color-surface-divider)";
|
|
93
94
|
return css({
|
|
94
95
|
"@global": {
|
|
95
96
|
[cls('*::-webkit-scrollbar')]: {
|
|
@@ -99,11 +100,9 @@ const ThemeProvider = (_a) => {
|
|
|
99
100
|
[cls("*::-webkit-scrollbar-thumb")]: {
|
|
100
101
|
backgroundColor: thumbColor,
|
|
101
102
|
borderRadius: "6px",
|
|
102
|
-
opacity: 0.6,
|
|
103
103
|
},
|
|
104
104
|
[cls("*::-webkit-scrollbar-thumb:hover")]: {
|
|
105
105
|
backgroundColor: thumbColor,
|
|
106
|
-
opacity: 0.0,
|
|
107
106
|
},
|
|
108
107
|
[cls("*::-webkit-scrollbar-track")]: {
|
|
109
108
|
backgroundColor: trackColor,
|
|
@@ -121,9 +120,9 @@ const ThemeProvider = (_a) => {
|
|
|
121
120
|
onChange: (t) => {
|
|
122
121
|
onThemeChange && onThemeChange(t);
|
|
123
122
|
}
|
|
124
|
-
}, children: [isRoot && jsxs(Fragment, { children: [jsx(ServerStyleTag, { factory: resetCss }), !noScrollbarCss && jsx(ServerStyleTag, { factory: scrollbarCss })] }), jsx(ServerStyleTag, { factory: themeGlobalStyle }), jsx(Tag, Object.assign({ minHeight: "100%", bgcolor: "
|
|
123
|
+
}, children: [isRoot && jsxs(Fragment, { children: [jsx(ServerStyleTag, { factory: resetCss }), !noScrollbarCss && jsx(ServerStyleTag, { factory: scrollbarCss })] }), jsx(ServerStyleTag, { factory: themeGlobalStyle }), jsx(Tag, Object.assign({ minHeight: "100%", bgcolor: "surface.main", color: "surface.contrast", fontSize: "text", fontWeight: "text", lineHeight: "text", fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
|
|
125
124
|
"& a": {
|
|
126
|
-
color: "
|
|
125
|
+
color: "primary.main",
|
|
127
126
|
},
|
|
128
127
|
}, baseClass: `${theme.name}-theme-root`, direction: theme.rtl ? "rtl" : "ltr", children: children }))] }));
|
|
129
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport { ThemeOptionInput, ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { createTheme, 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: ThemeOptionInput;\n onThemeChange?: (theme: ThemeOptions) => void\n isRoot?: boolean;\n noScrollbarCss?: boolean;\n}\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme: THEME, onThemeChange, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => {\n const doc = useDocument()\n const cacheId = useCSSCacheId()\n\n const theme = React.useMemo(() => createTheme(THEME), [THEME])\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 =
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport { ThemeOptionInput, ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { createTheme, 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: ThemeOptionInput;\n onThemeChange?: (theme: ThemeOptions) => void\n isRoot?: boolean;\n noScrollbarCss?: boolean;\n scrollbar?: {\n size?: number;\n thumbColor?: string;\n trackColor?: string;\n }\n}\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme: THEME, scrollbar, onThemeChange, isRoot, noScrollbarCss, ...props }: ThemeProviderProps<T>) => {\n const doc = useDocument()\n const cacheId = useCSSCacheId()\n\n const theme = React.useMemo(() => createTheme(THEME), [THEME])\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 = scrollbar?.size ?? 8\n let thumbColor = scrollbar?.thumbColor ?? \"var(--color-surface-muted)\"\n let trackColor = scrollbar?.trackColor ?? \"var(--color-surface-divider)\"\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 },\n [cls(\"*::-webkit-scrollbar-thumb:hover\")]: {\n backgroundColor: thumbColor,\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=\"surface.main\"\n color=\"surface.contrast\"\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: \"primary.main\",\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":";;;;;;;;;;;;;AAyBA;AAA2D;AACxD;AACA;AAEA;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;AACA;AACA;AACA;AAEA;AACG;AACG;AACG;AACA;AACF;AACD;AACG;AACA;AACF;AACD;AACG;AACF;AACD;AACG;AACA;AACF;AACH;;AAED;AACA;;AAEF;AACJ;AAEA;;AAIS;AACG;;AAEL;AAqBK;AACG;AACF;;AAShB;;"}
|
package/theme/core.cjs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('../css/index.cjs');
|
|
6
6
|
var ThemeDefaultOptions = require('./ThemeDefaultOptions.cjs');
|
|
7
|
+
var oklch = require('./oklch.cjs');
|
|
7
8
|
|
|
8
9
|
const mergeObject = (a, b) => {
|
|
9
10
|
a = Object.assign({}, a);
|
|
@@ -23,16 +24,20 @@ const createTheme = (options) => {
|
|
|
23
24
|
var _a;
|
|
24
25
|
let mode = (_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : "light";
|
|
25
26
|
const defaultOptions = mode === 'dark' ? ThemeDefaultOptions.darkThemeOptions : ThemeDefaultOptions.lightThemeOptions;
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
for (let key in options === null || options === void 0 ? void 0 : options.colors) {
|
|
28
|
+
const color = options === null || options === void 0 ? void 0 : options.colors[key];
|
|
29
|
+
if (typeof color === "string") {
|
|
30
|
+
options.colors[key] = oklch.createPalette(color);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const main = color.main;
|
|
34
|
+
if (main) {
|
|
35
|
+
const pallate = oklch.createPalette(main);
|
|
36
|
+
options.colors[key] = Object.assign(Object.assign(Object.assign({}, pallate), options.colors[key]), { main: pallate.main });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
35
39
|
}
|
|
40
|
+
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({ name: mode === "dark" ? "default-dark" : "default-light" }, options), { breakpoints: index.breakpoints }));
|
|
36
41
|
return theme;
|
|
37
42
|
};
|
|
38
43
|
const ThemeContex = React.createContext({
|
package/theme/core.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.cjs","sources":["../../src/theme/core.ts"],"sourcesContent":["\"use client\"\nimport React, { useContext } from \"react\"\nimport { ObjectType, ThemeOptions, ThemeOptionInput
|
|
1
|
+
{"version":3,"file":"core.cjs","sources":["../../src/theme/core.ts"],"sourcesContent":["\"use client\"\nimport React, { useContext } from \"react\"\nimport { ObjectType, ThemeOptions, ThemeOptionInput } from \"./types\"\nimport { breakpoints } from \"../css\"\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\nimport { createPalette } from \"./oklch\"\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 = (options: ThemeOptionInput): ThemeOptions => {\n let mode = options?.mode ?? \"light\"\n const defaultOptions = mode === 'dark' ? darkThemeOptions : lightThemeOptions\n\n for (let key in options?.colors) {\n const color = (options as any)?.colors[key] as any\n if (typeof color === \"string\") {\n (options as any).colors[key] = createPalette(color)\n } else {\n const main = color.main\n if (main) {\n const pallate = createPalette(main);\n (options as any).colors[key] = {\n ...pallate,\n ...(options as any).colors[key],\n main: pallate.main\n }\n }\n }\n }\n\n let theme: any = mergeObject(defaultOptions, {\n name: mode === \"dark\" ? \"default-dark\" : \"default-light\",\n ...options,\n breakpoints: breakpoints\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({\n name: \"default-light\"\n }),\n onChange(theme) { },\n})\n\nexport const useTheme = () => {\n const ctx = useContext(ThemeContex)\n const theme = ctx.theme\n theme.change = (theme: ThemeOptionInput) => ctx.onChange(createTheme(theme))\n return theme\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;AAUG;AACG;;AAEG;;;AAEA;;;AAGN;AACH;AAGO;;AACJ;AACA;;AAGG;AACA;;;;AAGG;;AAEG;;;;;;AAgBT;AACH;AAOO;;AAED;;;AAGL;AAEM;AACJ;AACA;AACA;AACA;AACH;;;;;"}
|