@xanui/core 1.2.8 → 1.2.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.
Files changed (80) hide show
  1. package/AppRoot/Renderar.js.map +1 -1
  2. package/AppRoot/Renderar.mjs.map +1 -1
  3. package/AppRoot/index.js.map +1 -1
  4. package/AppRoot/index.mjs.map +1 -1
  5. package/Tag/cssPropList.js.map +1 -1
  6. package/Tag/cssPropList.mjs.map +1 -1
  7. package/Tag/index.js.map +1 -1
  8. package/Tag/index.mjs.map +1 -1
  9. package/Tag/useTagProps.js +1 -1
  10. package/Tag/useTagProps.js.map +1 -1
  11. package/Tag/useTagProps.mjs +1 -1
  12. package/Tag/useTagProps.mjs.map +1 -1
  13. package/Transition/index.js.map +1 -1
  14. package/Transition/index.mjs.map +1 -1
  15. package/Transition/variants.js.map +1 -1
  16. package/Transition/variants.mjs.map +1 -1
  17. package/breakpoint/BreakpointProvider.js.map +1 -1
  18. package/breakpoint/BreakpointProvider.mjs.map +1 -1
  19. package/breakpoint/useBreakpoint.js.map +1 -1
  20. package/breakpoint/useBreakpoint.mjs.map +1 -1
  21. package/breakpoint/useBreakpointProps.js.map +1 -1
  22. package/breakpoint/useBreakpointProps.mjs.map +1 -1
  23. package/css/aliases.js.map +1 -1
  24. package/css/aliases.mjs.map +1 -1
  25. package/css/getProps.js +10 -24
  26. package/css/getProps.js.map +1 -1
  27. package/css/getProps.mjs +10 -24
  28. package/css/getProps.mjs.map +1 -1
  29. package/css/getValue.js +10 -11
  30. package/css/getValue.js.map +1 -1
  31. package/css/getValue.mjs +10 -11
  32. package/css/getValue.mjs.map +1 -1
  33. package/css/index.js.map +1 -1
  34. package/css/index.mjs.map +1 -1
  35. package/hooks/useAnimation.js.map +1 -1
  36. package/hooks/useAnimation.mjs.map +1 -1
  37. package/hooks/useColorTemplate.d.ts +8 -6
  38. package/hooks/useColorTemplate.js +42 -31
  39. package/hooks/useColorTemplate.js.map +1 -1
  40. package/hooks/useColorTemplate.mjs +42 -31
  41. package/hooks/useColorTemplate.mjs.map +1 -1
  42. package/hooks/useInterface.js.map +1 -1
  43. package/hooks/useInterface.mjs.map +1 -1
  44. package/hooks/usePortal.js.map +1 -1
  45. package/hooks/usePortal.mjs.map +1 -1
  46. package/hooks/useScrollbar.js.map +1 -1
  47. package/hooks/useScrollbar.mjs.map +1 -1
  48. package/index.d.ts +1 -2
  49. package/index.js +1 -1
  50. package/index.mjs +1 -1
  51. package/package.json +1 -1
  52. package/readme.md +109 -109
  53. package/theme/ThemeCssVars.js +1 -1
  54. package/theme/ThemeCssVars.js.map +1 -1
  55. package/theme/ThemeCssVars.mjs +1 -1
  56. package/theme/ThemeCssVars.mjs.map +1 -1
  57. package/theme/ThemeDefaultOptions.js +84 -8
  58. package/theme/ThemeDefaultOptions.js.map +1 -1
  59. package/theme/ThemeDefaultOptions.mjs +84 -8
  60. package/theme/ThemeDefaultOptions.mjs.map +1 -1
  61. package/theme/ThemeProvider.js +2 -2
  62. package/theme/ThemeProvider.js.map +1 -1
  63. package/theme/ThemeProvider.mjs +2 -2
  64. package/theme/ThemeProvider.mjs.map +1 -1
  65. package/theme/core.js.map +1 -1
  66. package/theme/core.mjs.map +1 -1
  67. package/theme/createTheme.js +9 -15
  68. package/theme/createTheme.js.map +1 -1
  69. package/theme/createTheme.mjs +9 -15
  70. package/theme/createTheme.mjs.map +1 -1
  71. package/theme/createThemeSwitcher.js.map +1 -1
  72. package/theme/createThemeSwitcher.mjs.map +1 -1
  73. package/theme/index.js.map +1 -1
  74. package/theme/index.mjs.map +1 -1
  75. package/theme/types.d.ts +35 -35
  76. package/theme/createColorScale.d.ts +0 -17
  77. package/theme/createColorScale.js +0 -55
  78. package/theme/createColorScale.js.map +0 -1
  79. package/theme/createColorScale.mjs +0 -55
  80. package/theme/createColorScale.mjs.map +0 -1
@@ -43,13 +43,48 @@ const lightThemeOptions = {
43
43
  shadow: lightShadows,
44
44
  globalStyle: {},
45
45
  colors: {
46
- common: "#FFFFFF",
47
- brand: "#2563EB",
48
- accent: "#0D9488",
49
- info: "#0284C7",
50
- success: "#16A34A",
51
- warning: "#D97706",
52
- danger: "#DC2626",
46
+ background: {
47
+ primary: "#FFFFFF", // main app background
48
+ secondary: "#F3F4F6", // slightly darker surface for sections/cards
49
+ },
50
+ divider: {
51
+ primary: "#E5E7EB", // soft divider, visible on #FFFFFF
52
+ secondary: "#D1D5DB", // stronger divider for emphasis
53
+ },
54
+ text: {
55
+ primary: "#111827",
56
+ secondary: "#6B7280",
57
+ },
58
+ brand: {
59
+ primary: "#2563EB",
60
+ secondary: "#1D4ED8",
61
+ text: "#F9FAFB",
62
+ },
63
+ accent: {
64
+ primary: "#7C3AED",
65
+ secondary: "#6D28D9",
66
+ text: "#F9FAFB",
67
+ },
68
+ success: {
69
+ primary: "#16A34A",
70
+ secondary: "#15803D",
71
+ text: "#F9FAFB",
72
+ },
73
+ info: {
74
+ primary: "#2563EB",
75
+ secondary: "#1D4ED8",
76
+ text: "#F9FAFB",
77
+ },
78
+ warning: {
79
+ primary: "#D97706",
80
+ secondary: "#B45309",
81
+ text: "#FFFBEB",
82
+ },
83
+ danger: {
84
+ primary: "#DC2626",
85
+ secondary: "#B91C1C",
86
+ text: "#FEF2F2",
87
+ },
53
88
  },
54
89
  typography: ThemeTypography,
55
90
  interfaces: {}
@@ -58,7 +93,48 @@ const createDefaultThemes = () => {
58
93
  createTheme("light", {});
59
94
  createTheme("dark", {
60
95
  colors: {
61
- common: "#0F172A",
96
+ background: {
97
+ primary: "#121212",
98
+ secondary: "#1E1E1E",
99
+ },
100
+ divider: {
101
+ primary: "#262626",
102
+ secondary: "#2E2E2E",
103
+ },
104
+ text: {
105
+ primary: "#F3F4F6", // main readable text
106
+ secondary: "#9CA3AF", // muted / secondary text
107
+ },
108
+ brand: {
109
+ primary: "#1D4ED8",
110
+ secondary: "#2563EB",
111
+ text: "#F9FAFB",
112
+ },
113
+ accent: {
114
+ primary: "#6D28D9",
115
+ secondary: "#7C3AED",
116
+ text: "#F9FAFB",
117
+ },
118
+ success: {
119
+ primary: "#15803D",
120
+ secondary: "#16A34A",
121
+ text: "#F9FAFB",
122
+ },
123
+ info: {
124
+ primary: "#1D4ED8",
125
+ secondary: "#2563EB",
126
+ text: "#F9FAFB",
127
+ },
128
+ warning: {
129
+ primary: "#B45309",
130
+ secondary: "#D97706",
131
+ text: "#FFFBEB",
132
+ },
133
+ danger: {
134
+ primary: "#B91C1C",
135
+ secondary: "#DC2626",
136
+ text: "#FEF2F2",
137
+ },
62
138
  }
63
139
  });
64
140
  };export{ThemeTypography,createDefaultThemes,lightShadows,lightThemeOptions};//# sourceMappingURL=ThemeDefaultOptions.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeDefaultOptions.mjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createTheme } from './createTheme'\r\nimport { ThemeOptionInput, ThemeTypographyType } 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 \"0px 2px 1px -1px rgba(255,255,255,0.05),0px 1px 1px 0px rgba(255,255,255,0.04),0px 1px 3px 0px rgba(255,255,255,0.03)\",\r\n \"0px 3px 1px -2px rgba(255,255,255,0.05),0px 2px 2px 0px rgba(255,255,255,0.04),0px 1px 5px 0px rgba(255,255,255,0.03)\",\r\n \"0px 3px 3px -2px rgba(255,255,255,0.05),0px 3px 4px 0px rgba(255,255,255,0.04),0px 1px 8px 0px rgba(255,255,255,0.03)\",\r\n \"0px 2px 4px -1px rgba(255,255,255,0.05),0px 4px 5px 0px rgba(255,255,255,0.04),0px 1px 10px 0px rgba(255,255,255,0.03)\",\r\n \"0px 3px 5px -1px rgba(255,255,255,0.05),0px 5px 8px 0px rgba(255,255,255,0.04),0px 1px 14px 0px rgba(255,255,255,0.03)\",\r\n \"0px 3px 5px -1px rgba(255,255,255,0.05),0px 6px 10px 0px rgba(255,255,255,0.04),0px 1px 18px 0px rgba(255,255,255,0.03)\",\r\n \"0px 4px 5px -2px rgba(255,255,255,0.05),0px 7px 10px 1px rgba(255,255,255,0.04),0px 2px 16px 1px rgba(255,255,255,0.03)\",\r\n \"0px 5px 5px -3px rgba(255,255,255,0.05),0px 8px 10px 1px rgba(255,255,255,0.04),0px 3px 14px 2px rgba(255,255,255,0.03)\",\r\n \"0px 5px 6px -3px rgba(255,255,255,0.05),0px 9px 12px 1px rgba(255,255,255,0.04),0px 3px 16px 2px rgba(255,255,255,0.03)\",\r\n \"0px 6px 6px -3px rgba(255,255,255,0.05),0px 10px 14px 1px rgba(255,255,255,0.04),0px 4px 18px 3px rgba(255,255,255,0.03)\",\r\n \"0px 6px 7px -4px rgba(255,255,255,0.05),0px 11px 15px 1px rgba(255,255,255,0.04),0px 4px 20px 3px rgba(255,255,255,0.03)\",\r\n \"0px 7px 8px -4px rgba(255,255,255,0.05),0px 12px 17px 2px rgba(255,255,255,0.04),0px 5px 22px 4px rgba(255,255,255,0.03)\",\r\n \"0px 7px 8px -4px rgba(255,255,255,0.05),0px 13px 19px 2px rgba(255,255,255,0.04),0px 5px 24px 4px rgba(255,255,255,0.03)\",\r\n \"0px 7px 9px -4px rgba(255,255,255,0.05),0px 14px 21px 2px rgba(255,255,255,0.04),0px 5px 26px 4px rgba(255,255,255,0.03)\",\r\n \"0px 8px 9px -5px rgba(255,255,255,0.05),0px 15px 22px 2px rgba(255,255,255,0.04),0px 6px 28px 5px rgba(255,255,255,0.03)\",\r\n \"0px 8px 10px -5px rgba(255,255,255,0.05),0px 16px 24px 2px rgba(255,255,255,0.04),0px 6px 30px 5px rgba(255,255,255,0.03)\",\r\n \"0px 8px 11px -5px rgba(255,255,255,0.05),0px 17px 26px 2px rgba(255,255,255,0.04),0px 6px 32px 5px rgba(255,255,255,0.03)\",\r\n \"0px 9px 11px -5px rgba(255,255,255,0.05),0px 18px 28px 2px rgba(255,255,255,0.04),0px 7px 34px 6px rgba(255,255,255,0.03)\",\r\n \"0px 9px 12px -6px rgba(255,255,255,0.05),0px 19px 29px 2px rgba(255,255,255,0.04),0px 7px 36px 6px rgba(255,255,255,0.03)\",\r\n \"0px 10px 13px -6px rgba(255,255,255,0.05),0px 20px 31px 3px rgba(255,255,255,0.04),0px 8px 38px 7px rgba(255,255,255,0.03)\",\r\n \"0px 10px 13px -6px rgba(255,255,255,0.05),0px 21px 33px 3px rgba(255,255,255,0.04),0px 8px 40px 7px rgba(255,255,255,0.03)\",\r\n \"0px 10px 14px -6px rgba(255,255,255,0.05),0px 22px 35px 3px rgba(255,255,255,0.04),0px 8px 42px 7px rgba(255,255,255,0.03)\",\r\n \"0px 11px 14px -7px rgba(255,255,255,0.05),0px 23px 36px 3px rgba(255,255,255,0.04),0px 9px 44px 8px rgba(255,255,255,0.03)\",\r\n \"0px 11px 15px -7px rgba(255,255,255,0.05),0px 24px 38px 3px rgba(255,255,255,0.04),0px 9px 46px 8px rgba(255,255,255,0.03)\",\r\n]\r\n\r\nexport const ThemeTypography: ThemeTypographyType = {\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\nexport const lightThemeOptions: ThemeOptionInput = {\r\n name: \"light\",\r\n rtl: false,\r\n shadow: lightShadows,\r\n globalStyle: {},\r\n colors: {\r\n common: \"#FFFFFF\",\r\n brand: \"#2563EB\",\r\n accent: \"#0D9488\",\r\n info: \"#0284C7\",\r\n success: \"#16A34A\",\r\n warning: \"#D97706\",\r\n danger: \"#DC2626\",\r\n },\r\n typography: ThemeTypography,\r\n interfaces: {}\r\n} as ThemeOptionInput\r\n\r\n\r\nexport const createDefaultThemes = () => {\r\n createTheme(\"light\", {})\r\n createTheme(\"dark\", {\r\n colors: {\r\n common: \"#0F172A\",\r\n }\r\n })\r\n}"],"names":[],"mappings":"4CAGO,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;;AA+BtG,MAAM,eAAe,GAAwB;AAChD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AACtD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE;AACvD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AACtD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE;AACvD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,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,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AACvD,IAAA,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AACxD,IAAA,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AAC1D,IAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;;AAGtD,MAAM,iBAAiB,GAAqB;AAC/C,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,MAAM,EAAE;AACJ,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,MAAM,EAAE,SAAS;AACpB,KAAA;AACD,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,UAAU,EAAE;;AAIT,MAAM,mBAAmB,GAAG,MAAK;AACpC,IAAA,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;IACxB,WAAW,CAAC,MAAM,EAAE;AAChB,QAAA,MAAM,EAAE;AACJ,YAAA,MAAM,EAAE,SAAS;AACpB;AACJ,KAAA,CAAC;AACN"}
1
+ {"version":3,"file":"ThemeDefaultOptions.mjs","sources":["../../src/theme/ThemeDefaultOptions.ts"],"sourcesContent":["import { createTheme } from './createTheme'\nimport { ThemeOptionInput, ThemeTypographyType } from './types'\n\nexport const lightShadows = [\n \"none\",\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\n]\n\nexport const darkShadows = [\n \"none\",\n \"0px 2px 1px -1px rgba(255,255,255,0.05),0px 1px 1px 0px rgba(255,255,255,0.04),0px 1px 3px 0px rgba(255,255,255,0.03)\",\n \"0px 3px 1px -2px rgba(255,255,255,0.05),0px 2px 2px 0px rgba(255,255,255,0.04),0px 1px 5px 0px rgba(255,255,255,0.03)\",\n \"0px 3px 3px -2px rgba(255,255,255,0.05),0px 3px 4px 0px rgba(255,255,255,0.04),0px 1px 8px 0px rgba(255,255,255,0.03)\",\n \"0px 2px 4px -1px rgba(255,255,255,0.05),0px 4px 5px 0px rgba(255,255,255,0.04),0px 1px 10px 0px rgba(255,255,255,0.03)\",\n \"0px 3px 5px -1px rgba(255,255,255,0.05),0px 5px 8px 0px rgba(255,255,255,0.04),0px 1px 14px 0px rgba(255,255,255,0.03)\",\n \"0px 3px 5px -1px rgba(255,255,255,0.05),0px 6px 10px 0px rgba(255,255,255,0.04),0px 1px 18px 0px rgba(255,255,255,0.03)\",\n \"0px 4px 5px -2px rgba(255,255,255,0.05),0px 7px 10px 1px rgba(255,255,255,0.04),0px 2px 16px 1px rgba(255,255,255,0.03)\",\n \"0px 5px 5px -3px rgba(255,255,255,0.05),0px 8px 10px 1px rgba(255,255,255,0.04),0px 3px 14px 2px rgba(255,255,255,0.03)\",\n \"0px 5px 6px -3px rgba(255,255,255,0.05),0px 9px 12px 1px rgba(255,255,255,0.04),0px 3px 16px 2px rgba(255,255,255,0.03)\",\n \"0px 6px 6px -3px rgba(255,255,255,0.05),0px 10px 14px 1px rgba(255,255,255,0.04),0px 4px 18px 3px rgba(255,255,255,0.03)\",\n \"0px 6px 7px -4px rgba(255,255,255,0.05),0px 11px 15px 1px rgba(255,255,255,0.04),0px 4px 20px 3px rgba(255,255,255,0.03)\",\n \"0px 7px 8px -4px rgba(255,255,255,0.05),0px 12px 17px 2px rgba(255,255,255,0.04),0px 5px 22px 4px rgba(255,255,255,0.03)\",\n \"0px 7px 8px -4px rgba(255,255,255,0.05),0px 13px 19px 2px rgba(255,255,255,0.04),0px 5px 24px 4px rgba(255,255,255,0.03)\",\n \"0px 7px 9px -4px rgba(255,255,255,0.05),0px 14px 21px 2px rgba(255,255,255,0.04),0px 5px 26px 4px rgba(255,255,255,0.03)\",\n \"0px 8px 9px -5px rgba(255,255,255,0.05),0px 15px 22px 2px rgba(255,255,255,0.04),0px 6px 28px 5px rgba(255,255,255,0.03)\",\n \"0px 8px 10px -5px rgba(255,255,255,0.05),0px 16px 24px 2px rgba(255,255,255,0.04),0px 6px 30px 5px rgba(255,255,255,0.03)\",\n \"0px 8px 11px -5px rgba(255,255,255,0.05),0px 17px 26px 2px rgba(255,255,255,0.04),0px 6px 32px 5px rgba(255,255,255,0.03)\",\n \"0px 9px 11px -5px rgba(255,255,255,0.05),0px 18px 28px 2px rgba(255,255,255,0.04),0px 7px 34px 6px rgba(255,255,255,0.03)\",\n \"0px 9px 12px -6px rgba(255,255,255,0.05),0px 19px 29px 2px rgba(255,255,255,0.04),0px 7px 36px 6px rgba(255,255,255,0.03)\",\n \"0px 10px 13px -6px rgba(255,255,255,0.05),0px 20px 31px 3px rgba(255,255,255,0.04),0px 8px 38px 7px rgba(255,255,255,0.03)\",\n \"0px 10px 13px -6px rgba(255,255,255,0.05),0px 21px 33px 3px rgba(255,255,255,0.04),0px 8px 40px 7px rgba(255,255,255,0.03)\",\n \"0px 10px 14px -6px rgba(255,255,255,0.05),0px 22px 35px 3px rgba(255,255,255,0.04),0px 8px 42px 7px rgba(255,255,255,0.03)\",\n \"0px 11px 14px -7px rgba(255,255,255,0.05),0px 23px 36px 3px rgba(255,255,255,0.04),0px 9px 44px 8px rgba(255,255,255,0.03)\",\n \"0px 11px 15px -7px rgba(255,255,255,0.05),0px 24px 38px 3px rgba(255,255,255,0.04),0px 9px 46px 8px rgba(255,255,255,0.03)\",\n]\n\nexport const ThemeTypography: ThemeTypographyType = {\n h1: { fontSize: 48, lineHeight: 1.3, fontWeight: 600 }, // bolder for emphasis\n h2: { fontSize: 40, lineHeight: 1.35, fontWeight: 500 },\n h3: { fontSize: 34, lineHeight: 1.4, fontWeight: 500 },\n h4: { fontSize: 28, lineHeight: 1.45, fontWeight: 500 },\n h5: { fontSize: 24, lineHeight: 1.5, fontWeight: 500 },\n h6: { fontSize: 20, lineHeight: 1.55, fontWeight: 500 },\n big: { fontSize: 18, lineHeight: 1.6, fontWeight: 400 },\n text: { fontSize: 16, lineHeight: 1.6, fontWeight: 400 },\n button: { fontSize: 14, lineHeight: 1.6, fontWeight: 500 },\n small: { fontSize: 12, lineHeight: 1.6, fontWeight: 400 },\n}\n\nexport const lightThemeOptions: ThemeOptionInput = {\n name: \"light\",\n rtl: false,\n shadow: lightShadows,\n globalStyle: {},\n colors: {\n background: {\n primary: \"#FFFFFF\", // main app background\n secondary: \"#F3F4F6\", // slightly darker surface for sections/cards\n },\n\n divider: {\n primary: \"#E5E7EB\", // soft divider, visible on #FFFFFF\n secondary: \"#D1D5DB\", // stronger divider for emphasis\n },\n\n text: {\n primary: \"#111827\",\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\n\nexport const createDefaultThemes = () => {\n createTheme(\"light\", {})\n createTheme(\"dark\", {\n colors: {\n background: {\n primary: \"#121212\",\n secondary: \"#1E1E1E\",\n },\n\n divider: {\n primary: \"#262626\",\n secondary: \"#2E2E2E\",\n },\n\n text: {\n primary: \"#F3F4F6\", // 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 })\n}"],"names":[],"mappings":"4CAGO,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;;AA+BtG,MAAM,eAAe,GAAwB;AAChD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;AACtD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE;AACvD,IAAA,EAAE,EAAE,EAAE,QAAQ,EAAE,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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AAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,IAAI,EAAE;AACF,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AAED,YAAA,MAAM,EAAE;AACJ,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,SAAS,EAAE,SAAS;AACpB,gBAAA,IAAI,EAAE,SAAS;AAClB,aAAA;AACJ;AACJ,KAAA,CAAC;AACN"}
@@ -19,9 +19,9 @@ const ThemeProvider = (_a) => {
19
19
  injectStyle: typeof window !== 'undefined'
20
20
  });
21
21
  }, [theme]);
22
- return (jsxRuntime.jsxs(core.ThemeContex.Provider, { value: theme, children: [typeof window === 'undefined' && jsxRuntime.jsx("style", { precedence: globalStyle.classname, href: globalStyle.classname, dangerouslySetInnerHTML: { __html: globalStyle.css } }), jsxRuntime.jsx(index$1.default, Object.assign({ minHeight: "100%", bgcolor: THEME.colors.common.base, color: THEME.colors.common.text, fontSize: THEME.typography.text.fontSize, fontWeight: THEME.typography.text.fontWeight, lineHeight: THEME.typography.text.lineHeight, fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
22
+ return (jsxRuntime.jsxs(core.ThemeContex.Provider, { value: theme, children: [typeof window === 'undefined' && jsxRuntime.jsx("style", { precedence: globalStyle.classname, href: globalStyle.classname, dangerouslySetInnerHTML: { __html: globalStyle.css } }), jsxRuntime.jsx(index$1.default, Object.assign({ minHeight: "100%", bgcolor: THEME.colors.background.primary, color: THEME.colors.text.primary, fontSize: THEME.typography.text.fontSize, fontWeight: THEME.typography.text.fontWeight, lineHeight: THEME.typography.text.lineHeight, fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
23
23
  "& a": {
24
- color: THEME.colors.brand.base || 'inherit',
24
+ color: THEME.colors.brand.primary || 'inherit',
25
25
  },
26
26
  }, baseClass: `${theme}-theme-root`, direction: THEME.rtl ? "rtl" : "ltr", children: children }))] }));
27
27
  };exports.default=ThemeProvider;//# sourceMappingURL=ThemeProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from \"react\"\r\nimport { ThemeOptions } from \"./types\"\r\nimport Tag from \"../Tag\"\r\nimport { TagComponentType, TagProps } from \"../Tag/types\"\r\nimport { ThemeContex, ThemeFactory } from \"./core\"\r\nimport ThemeCssVars from \"./ThemeCssVars\"\r\nimport { css } from \"../css\"\r\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\r\n\r\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\r\n theme: string;\r\n}\r\n\r\ncreateDefaultThemes()\r\n\r\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\r\n let THEME = ThemeFactory.get(theme) as ThemeOptions\r\n if (!THEME) {\r\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\r\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\r\n }\r\n\r\n const globalStyle: any = React.useMemo(() => {\r\n const root_cls = `.xui-${theme}-theme-root`\r\n let gkeys = Object.keys(THEME.globalStyle || {})\r\n let gstyles: any = {}\r\n gkeys.forEach((key) => {\r\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\r\n })\r\n\r\n return css({\r\n \"@global\": {\r\n ...gstyles,\r\n [root_cls]: ThemeCssVars(THEME)\r\n }\r\n }, {\r\n injectStyle: typeof window !== 'undefined'\r\n })\r\n }, [theme])\r\n\r\n return (\r\n <ThemeContex.Provider value={theme}>\r\n {\r\n typeof window === 'undefined' && <style\r\n precedence={globalStyle.classname}\r\n href={globalStyle.classname}\r\n dangerouslySetInnerHTML={{ __html: globalStyle.css }}\r\n />\r\n }\r\n <Tag\r\n minHeight=\"100%\"\r\n bgcolor={THEME.colors.common.base}\r\n color={THEME.colors.common.text}\r\n fontSize={THEME.typography.text.fontSize}\r\n fontWeight={THEME.typography.text.fontWeight}\r\n lineHeight={THEME.typography.text.lineHeight}\r\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\r\n {...props}\r\n sxr={{\r\n \"& a\": {\r\n color: THEME.colors.brand.base || 'inherit',\r\n },\r\n }}\r\n baseClass={`${theme}-theme-root`}\r\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\r\n >\r\n {children}\r\n </Tag>\r\n </ThemeContex.Provider>\r\n )\r\n}\r\n\r\nexport default ThemeProvider"],"names":["createDefaultThemes","__rest","ThemeFactory","React","css","ThemeCssVars","_jsxs","ThemeContex","_jsx","Tag"],"mappings":"gsBAaAA,uCAAmB,EAAE;AAErB,MAAM,aAAa,GAAG,CAAqC,EAAoD,KAAI;QAAxD,EAAE,QAAQ,EAAE,KAAK,EAAA,GAAA,EAAmC,EAA9B,KAAK,GAAAC,YAAA,CAAA,EAAA,EAA3B,qBAA6B,CAAF;IACnF,IAAI,KAAK,GAAGC,iBAAY,CAAC,GAAG,CAAC,KAAK,CAAiB;IACnD,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,KAAK,CAAA,6DAAA,CAA+D,CAAC;AAChH,QAAA,KAAK,GAAGA,iBAAY,CAAC,GAAG,CAAC,OAAO,CAAiB;IACp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AM,CAAC,IAAI,EAC/B,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EACxC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAC5C,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAC5C,UAAU,EAAE,gGAAgG,EAAA,EACxG,KAAK,EAAA,EACT,GAAG,EAAE;AACF,oBAAA,KAAK,EAAE;wBACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS;AAC7C,qBAAA;iBACH,EACD,SAAS,EAAE,CAAA,EAAG,KAAK,CAAA,WAAA,CAAa,EAChC,SAAS,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,GAAG,KAAK,YAEnC,QAAQ,EAAA,CAAA,CACN,CAAA,EAAA,CACc;AAE7B"}
1
+ {"version":3,"file":"ThemeProvider.js","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex, ThemeFactory } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: string;\n}\n\ncreateDefaultThemes()\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\n let THEME = ThemeFactory.get(theme) as ThemeOptions\n if (!THEME) {\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\n }\n\n const globalStyle: any = React.useMemo(() => {\n const root_cls = `.xui-${theme}-theme-root`\n let gkeys = Object.keys(THEME.globalStyle || {})\n let gstyles: any = {}\n gkeys.forEach((key) => {\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\n })\n\n return css({\n \"@global\": {\n ...gstyles,\n [root_cls]: ThemeCssVars(THEME)\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n })\n }, [theme])\n\n return (\n <ThemeContex.Provider value={theme}>\n {\n typeof window === 'undefined' && <style\n precedence={globalStyle.classname}\n href={globalStyle.classname}\n dangerouslySetInnerHTML={{ __html: globalStyle.css }}\n />\n }\n <Tag\n minHeight=\"100%\"\n bgcolor={THEME.colors.background.primary}\n color={THEME.colors.text.primary}\n fontSize={THEME.typography.text.fontSize}\n fontWeight={THEME.typography.text.fontWeight}\n lineHeight={THEME.typography.text.lineHeight}\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\n {...props}\n sxr={{\n \"& a\": {\n color: THEME.colors.brand.primary || 'inherit',\n },\n }}\n baseClass={`${theme}-theme-root`}\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n </Tag>\n </ThemeContex.Provider>\n )\n}\n\nexport default ThemeProvider"],"names":["createDefaultThemes","__rest","ThemeFactory","React","css","ThemeCssVars","_jsxs","ThemeContex","_jsx","Tag"],"mappings":"gsBAaAA,uCAAmB,EAAE;AAErB,MAAM,aAAa,GAAG,CAAqC,EAAoD,KAAI;QAAxD,EAAE,QAAQ,EAAE,KAAK,EAAA,GAAA,EAAmC,EAA9B,KAAK,GAAAC,YAAA,CAAA,EAAA,EAA3B,qBAA6B,CAAF;IACnF,IAAI,KAAK,GAAGC,iBAAY,CAAC,GAAG,CAAC,KAAK,CAAiB;IACnD,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,KAAK,CAAA,6DAAA,CAA+D,CAAC;AAChH,QAAA,KAAK,GAAGA,iBAAY,CAAC,GAAG,CAAC,OAAO,CAAiB;IACpD;AAEA,IAAA,MAAM,WAAW,GAAQC,gBAAK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,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EACxC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAC5C,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAC5C,UAAU,EAAE,gGAAgG,EAAA,EACxG,KAAK,EAAA,EACT,GAAG,EAAE;AACF,oBAAA,KAAK,EAAE;wBACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,SAAS;AAChD,qBAAA;iBACH,EACD,SAAS,EAAE,CAAA,EAAG,KAAK,CAAA,WAAA,CAAa,EAChC,SAAS,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,GAAG,KAAK,YAEnC,QAAQ,EAAA,CAAA,CACN,CAAA,EAAA,CACc;AAE7B"}
@@ -19,9 +19,9 @@ const ThemeProvider = (_a) => {
19
19
  injectStyle: typeof window !== 'undefined'
20
20
  });
21
21
  }, [theme]);
22
- return (jsxs(ThemeContex.Provider, { value: theme, children: [typeof window === 'undefined' && jsx("style", { precedence: globalStyle.classname, href: globalStyle.classname, dangerouslySetInnerHTML: { __html: globalStyle.css } }), jsx(Tag, Object.assign({ minHeight: "100%", bgcolor: THEME.colors.common.base, color: THEME.colors.common.text, fontSize: THEME.typography.text.fontSize, fontWeight: THEME.typography.text.fontWeight, lineHeight: THEME.typography.text.lineHeight, fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
22
+ return (jsxs(ThemeContex.Provider, { value: theme, children: [typeof window === 'undefined' && jsx("style", { precedence: globalStyle.classname, href: globalStyle.classname, dangerouslySetInnerHTML: { __html: globalStyle.css } }), jsx(Tag, Object.assign({ minHeight: "100%", bgcolor: THEME.colors.background.primary, color: THEME.colors.text.primary, fontSize: THEME.typography.text.fontSize, fontWeight: THEME.typography.text.fontWeight, lineHeight: THEME.typography.text.lineHeight, fontFamily: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` }, props, { sxr: {
23
23
  "& a": {
24
- color: THEME.colors.brand.base || 'inherit',
24
+ color: THEME.colors.brand.primary || 'inherit',
25
25
  },
26
26
  }, baseClass: `${theme}-theme-root`, direction: THEME.rtl ? "rtl" : "ltr", children: children }))] }));
27
27
  };export{ThemeProvider as default};//# sourceMappingURL=ThemeProvider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.mjs","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from \"react\"\r\nimport { ThemeOptions } from \"./types\"\r\nimport Tag from \"../Tag\"\r\nimport { TagComponentType, TagProps } from \"../Tag/types\"\r\nimport { ThemeContex, ThemeFactory } from \"./core\"\r\nimport ThemeCssVars from \"./ThemeCssVars\"\r\nimport { css } from \"../css\"\r\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\r\n\r\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\r\n theme: string;\r\n}\r\n\r\ncreateDefaultThemes()\r\n\r\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\r\n let THEME = ThemeFactory.get(theme) as ThemeOptions\r\n if (!THEME) {\r\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\r\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\r\n }\r\n\r\n const globalStyle: any = React.useMemo(() => {\r\n const root_cls = `.xui-${theme}-theme-root`\r\n let gkeys = Object.keys(THEME.globalStyle || {})\r\n let gstyles: any = {}\r\n gkeys.forEach((key) => {\r\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\r\n })\r\n\r\n return css({\r\n \"@global\": {\r\n ...gstyles,\r\n [root_cls]: ThemeCssVars(THEME)\r\n }\r\n }, {\r\n injectStyle: typeof window !== 'undefined'\r\n })\r\n }, [theme])\r\n\r\n return (\r\n <ThemeContex.Provider value={theme}>\r\n {\r\n typeof window === 'undefined' && <style\r\n precedence={globalStyle.classname}\r\n href={globalStyle.classname}\r\n dangerouslySetInnerHTML={{ __html: globalStyle.css }}\r\n />\r\n }\r\n <Tag\r\n minHeight=\"100%\"\r\n bgcolor={THEME.colors.common.base}\r\n color={THEME.colors.common.text}\r\n fontSize={THEME.typography.text.fontSize}\r\n fontWeight={THEME.typography.text.fontWeight}\r\n lineHeight={THEME.typography.text.lineHeight}\r\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\r\n {...props}\r\n sxr={{\r\n \"& a\": {\r\n color: THEME.colors.brand.base || 'inherit',\r\n },\r\n }}\r\n baseClass={`${theme}-theme-root`}\r\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\r\n >\r\n {children}\r\n </Tag>\r\n </ThemeContex.Provider>\r\n )\r\n}\r\n\r\nexport default ThemeProvider"],"names":["_jsxs","_jsx"],"mappings":"gUAaA,mBAAmB,EAAE;AAErB,MAAM,aAAa,GAAG,CAAqC,EAAoD,KAAI;QAAxD,EAAE,QAAQ,EAAE,KAAK,EAAA,GAAA,EAAmC,EAA9B,KAAK,GAAA,MAAA,CAAA,EAAA,EAA3B,qBAA6B,CAAF;IACnF,IAAI,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAiB;IACnD,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,KAAK,CAAA,6DAAA,CAA+D,CAAC;AAChH,QAAA,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAiB;IACpD;AAEA,IAAA,MAAM,WAAW,GAAQ,KAAK,CAAC,OAAO,CAAC,MAAK;AACzC,QAAA,MAAM,QAAQ,GAAG,CAAA,KAAA,EAAQ,KAAK,aAAa;AAC3C,QAAA,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,E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EAAE,gGAAgG,EAAA,EACxG,KAAK,EAAA,EACT,GAAG,EAAE;AACF,oBAAA,KAAK,EAAE;wBACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS;AAC7C,qBAAA;iBACH,EACD,SAAS,EAAE,CAAA,EAAG,KAAK,CAAA,WAAA,CAAa,EAChC,SAAS,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,GAAG,KAAK,YAEnC,QAAQ,EAAA,CAAA,CACN,CAAA,EAAA,CACc;AAE7B"}
1
+ {"version":3,"file":"ThemeProvider.mjs","sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { ThemeContex, ThemeFactory } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\nimport { createDefaultThemes } from \"./ThemeDefaultOptions\"\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: string;\n}\n\ncreateDefaultThemes()\n\nconst ThemeProvider = <T extends TagComponentType = 'div'>({ children, theme, ...props }: ThemeProviderProps<T>) => {\n let THEME = ThemeFactory.get(theme) as ThemeOptions\n if (!THEME) {\n console.error(`ThemeProvider: The theme '${theme}' is not defined. Please make sure to use a valid theme name.`)\n THEME = ThemeFactory.get(\"light\") as ThemeOptions\n }\n\n const globalStyle: any = React.useMemo(() => {\n const root_cls = `.xui-${theme}-theme-root`\n let gkeys = Object.keys(THEME.globalStyle || {})\n let gstyles: any = {}\n gkeys.forEach((key) => {\n gstyles[`${root_cls} ${key}`] = THEME.globalStyle[key as any]\n })\n\n return css({\n \"@global\": {\n ...gstyles,\n [root_cls]: ThemeCssVars(THEME)\n }\n }, {\n injectStyle: typeof window !== 'undefined'\n })\n }, [theme])\n\n return (\n <ThemeContex.Provider value={theme}>\n {\n typeof window === 'undefined' && <style\n precedence={globalStyle.classname}\n href={globalStyle.classname}\n dangerouslySetInnerHTML={{ __html: globalStyle.css }}\n />\n }\n <Tag\n minHeight=\"100%\"\n bgcolor={THEME.colors.background.primary}\n color={THEME.colors.text.primary}\n fontSize={THEME.typography.text.fontSize}\n fontWeight={THEME.typography.text.fontWeight}\n lineHeight={THEME.typography.text.lineHeight}\n fontFamily={`system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`}\n {...props}\n sxr={{\n \"& a\": {\n color: THEME.colors.brand.primary || 'inherit',\n },\n }}\n baseClass={`${theme}-theme-root`}\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n </Tag>\n </ThemeContex.Provider>\n )\n}\n\nexport default ThemeProvider"],"names":["_jsxs","_jsx"],"mappings":"gUAaA,mBAAmB,EAAE;AAErB,MAAM,aAAa,GAAG,CAAqC,EAAoD,KAAI;QAAxD,EAAE,QAAQ,EAAE,KAAK,EAAA,GAAA,EAAmC,EAA9B,KAAK,GAAA,MAAA,CAAA,EAAA,EAA3B,qBAA6B,CAAF;IACnF,IAAI,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAiB;IACnD,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,KAAK,CAAA,6DAAA,CAA+D,CAAC;AAChH,QAAA,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAiB;IACpD;AAEA,IAAA,MAAM,WAAW,GAAQ,KAAK,CAAC,OAAO,CAAC,MAAK;AACzC,QAAA,MAAM,QAAQ,GAAG,CAAA,KAAA,EAAQ,KAAK,aAAa;AAC3C,QAAA,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;QAChD,IAAI,OAAO,GAAQ,EAAE;AACrB,QAAA,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;AACnB,YAAA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C,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,SAAS;AAChD,qBAAA;iBACH,EACD,SAAS,EAAE,CAAA,EAAG,KAAK,CAAA,WAAA,CAAa,EAChC,SAAS,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,GAAG,KAAK,YAEnC,QAAQ,EAAA,CAAA,CACN,CAAA,EAAA,CACc;AAE7B"}
package/theme/core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sources":["../../src/theme/core.ts"],"sourcesContent":["import React from \"react\"\r\nimport { ObjectType, ThemeOptions } from \"./types\"\r\n\r\nexport const ThemeFactory = new Map<string, ThemeOptions>()\r\nexport const ThemeContex = React.createContext(\"light\")\r\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\r\nexport const useTheme = (): ThemeOptions => {\r\n const theme = ThemeFactory.get(React.useContext(ThemeContex)) as any\r\n if (!theme) {\r\n console.error(\"Theme not found, returning light theme as fallback\")\r\n return ThemeFactory.get(\"light\") as any\r\n }\r\n return theme\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"],"names":[],"mappings":"iGAGO,MAAM,YAAY,GAAG,IAAI,GAAG;AAC5B,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO;AAC/C,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAK,YAAY,CAAC,GAAG,CAAC,KAAK;AAC1D,MAAM,QAAQ,GAAG,MAAmB;AACxC,IAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAQ;IACpE,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC;AACnE,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,CAAQ;IAC1C;AACA,IAAA,OAAO,KAAK;AACf;MAEa,WAAW,GAAG,CAAC,CAAa,EAAE,CAAa,KAAI;IACzD,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;IACZ,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;AACZ,IAAA,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE;AAClB,QAAA,MAAM,CAAC,GAAI,CAAS,CAAC,GAAG,CAAC;QACzB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;AACzE,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC;aAAO;AACJ,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACb;IACH;AACA,IAAA,OAAO,CAAC;AACX"}
1
+ {"version":3,"file":"core.js","sources":["../../src/theme/core.ts"],"sourcesContent":["import React from \"react\"\nimport { ObjectType, ThemeOptions } from \"./types\"\n\nexport const ThemeFactory = new Map<string, ThemeOptions>()\nexport const ThemeContex = React.createContext(\"light\")\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\nexport const useTheme = (): ThemeOptions => {\n const theme = ThemeFactory.get(React.useContext(ThemeContex)) as any\n if (!theme) {\n console.error(\"Theme not found, returning light theme as fallback\")\n return ThemeFactory.get(\"light\") as any\n }\n return theme\n}\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] = m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ourcesContent":["import React from \"react\"\r\nimport { ObjectType, ThemeOptions } from \"./types\"\r\n\r\nexport const ThemeFactory = new Map<string, ThemeOptions>()\r\nexport const ThemeContex = React.createContext(\"light\")\r\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\r\nexport const useTheme = (): ThemeOptions => {\r\n const theme = ThemeFactory.get(React.useContext(ThemeContex)) as any\r\n if (!theme) {\r\n console.error(\"Theme not found, returning light theme as fallback\")\r\n return ThemeFactory.get(\"light\") as any\r\n }\r\n return theme\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"],"names":["React"],"mappings":"kCAGO,MAAM,YAAY,GAAG,IAAI,GAAG;AAC5B,MAAM,WAAW,GAAGA,cAAK,CAAC,aAAa,CAAC,OAAO;AAC/C,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAK,YAAY,CAAC,GAAG,CAAC,KAAK;AAC1D,MAAM,QAAQ,GAAG,MAAmB;AACxC,IAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAACA,cAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAQ;IACpE,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC;AACnE,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,CAAQ;IAC1C;AACA,IAAA,OAAO,KAAK;AACf;MAEa,WAAW,GAAG,CAAC,CAAa,EAAE,CAAa,KAAI;IACzD,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;IACZ,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;AACZ,IAAA,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE;AAClB,QAAA,MAAM,CAAC,GAAI,CAAS,CAAC,GAAG,CAAC;QACzB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAACA,cAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;AACzE,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC;aAAO;AACJ,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACb;IACH;AACA,IAAA,OAAO,CAAC;AACX"}
1
+ {"version":3,"file":"core.mjs","sources":["../../src/theme/core.ts"],"sourcesContent":["import React from \"react\"\nimport { ObjectType, ThemeOptions } from \"./types\"\n\nexport const ThemeFactory = new Map<string, ThemeOptions>()\nexport const ThemeContex = React.createContext(\"light\")\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\nexport const useTheme = (): ThemeOptions => {\n const theme = ThemeFactory.get(React.useContext(ThemeContex)) as any\n if (!theme) {\n console.error(\"Theme not found, returning light theme as fallback\")\n return ThemeFactory.get(\"light\") as any\n }\n return theme\n}\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"],"names":["React"],"mappings":"kCAGO,MAAM,YAAY,GAAG,IAAI,GAAG;AAC5B,MAAM,WAAW,GAAGA,cAAK,CAAC,aAAa,CAAC,OAAO;AAC/C,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAK,YAAY,CAAC,GAAG,CAAC,KAAK;AAC1D,MAAM,QAAQ,GAAG,MAAmB;AACxC,IAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAACA,cAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAQ;IACpE,IAAI,CAAC,KAAK,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC;AACnE,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,CAAQ;IAC1C;AACA,IAAA,OAAO,KAAK;AACf;MAEa,WAAW,GAAG,CAAC,CAAa,EAAE,CAAa,KAAI;IACzD,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;IACZ,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,CAAC,CAAE;AACZ,IAAA,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE;AAClB,QAAA,MAAM,CAAC,GAAI,CAAS,CAAC,GAAG,CAAC;QACzB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAACA,cAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;AACzE,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC;aAAO;AACJ,YAAA,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACb;IACH;AACA,IAAA,OAAO,CAAC;AACX"}
@@ -1,24 +1,18 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var core=require('./core.js'),index=require('../css/index.js'),ThemeDefaultOptions=require('./ThemeDefaultOptions.js'),createColorScale=require('./createColorScale.js');const createTheme = (name, options) => {
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var core=require('./core.js'),index=require('../css/index.js'),ThemeDefaultOptions=require('./ThemeDefaultOptions.js');const createTheme = (name, options) => {
2
2
  if (core.ThemeFactory.has(name)) {
3
3
  console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`);
4
4
  return core.ThemeFactory.get(name);
5
5
  }
6
6
  let theme = core.mergeObject(ThemeDefaultOptions.lightThemeOptions, Object.assign(Object.assign({}, options), { name, breakpoints: index.breakpoints }));
7
- // create color scales if needed
8
- for (let key in theme.colors) {
9
- const color = theme.colors[key];
10
- if (typeof color === "string") {
11
- theme.colors[key] = createColorScale.default(color);
12
- delete theme.colors[key].mode;
13
- }
14
- else {
15
- const c = createColorScale.default(color.base);
16
- delete c.mode;
17
- theme.colors[key] = Object.assign(Object.assign({}, c), theme.colors[key]);
18
- }
7
+ // add alpha colors
8
+ for (let color in theme.colors) {
9
+ const c = theme.colors[color];
10
+ const is_common = color === 'divider' || color === 'background' || color === 'text';
11
+ c.soft = {
12
+ primary: is_common ? index.alpha(c.primary, 0.60) : index.alpha(c.primary, 0.08),
13
+ secondary: is_common ? index.alpha(c.primary, 0.90) : index.alpha(c.primary, 0.12)
14
+ };
19
15
  }
20
- const c = createColorScale.default(theme.colors.common.base);
21
- theme.isDark = c.mode === "black";
22
16
  core.ThemeFactory.set(name, theme);
23
17
  return theme;
24
18
  };exports.createTheme=createTheme;//# sourceMappingURL=createTheme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTheme.js","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput } from \"./types\"\r\nimport { mergeObject, ThemeFactory } from \"./core\"\r\nimport { breakpoints } from \"../css\"\r\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\r\nimport createColorScale from \"./createColorScale\"\r\n\r\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\r\n if (ThemeFactory.has(name)) {\r\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\r\n return ThemeFactory.get(name) as ThemeOptions\r\n }\r\n\r\n let theme: any = mergeObject(lightThemeOptions, {\r\n ...options,\r\n name,\r\n breakpoints: breakpoints\r\n })\r\n\r\n // create color scales if needed\r\n for (let key in theme.colors) {\r\n const color = theme.colors[key]\r\n if (typeof color === \"string\") {\r\n theme.colors[key] = createColorScale(color)\r\n delete theme.colors[key].mode\r\n } else {\r\n const c = createColorScale(color.base)\r\n delete (c as any).mode\r\n theme.colors[key] = {\r\n ...c,\r\n ...theme.colors[key],\r\n }\r\n }\r\n }\r\n\r\n const c = createColorScale(theme.colors.common.base)\r\n theme.isDark = c.mode === \"black\"\r\n\r\n ThemeFactory.set(name, theme)\r\n\r\n return theme as ThemeOptions\r\n}\r\n"],"names":["ThemeFactory","mergeObject","lightThemeOptions","breakpoints","createColorScale"],"mappings":"qPAMa,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,KAAkB;AAClF,IAAA,IAAIA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAA,mEAAA,CAAqE,CAAC;AACnH,QAAA,OAAOA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;IAChD;AAEA,IAAA,IAAI,KAAK,GAAQC,gBAAW,CAACC,qCAAiB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACxC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAEC,iBAAW,IACzB;;AAGF,IAAA,KAAK,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AAC/B,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC5B,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAGC,wBAAgB,CAAC,KAAK,CAAC;YAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI;QAChC;aAAO;YACJ,MAAM,CAAC,GAAGA,wBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;YACtC,OAAQ,CAAS,CAAC,IAAI;AACtB,YAAA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACX,CAAC,CAAA,EACD,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CACtB;QACJ;IACH;AAEA,IAAA,MAAM,CAAC,GAAGA,wBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACpD,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO;AAEjC,IAAAJ,iBAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B"}
1
+ {"version":3,"file":"createTheme.js","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\nimport createColorScale from \"./createColorScale\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\n if (ThemeFactory.has(name)) {\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\n return ThemeFactory.get(name) as ThemeOptions\n }\n\n let theme: any = mergeObject(lightThemeOptions, {\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n // add alpha colors\n for (let color in theme.colors) {\n const c = theme.colors[color] as ThemeOptionsColor\n const is_common = color === 'divider' || color === 'background' || color === 'text'\n c.soft = {\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\n }\n }\n\n ThemeFactory.set(name, theme)\n\n return theme as ThemeOptions\n}\n"],"names":["ThemeFactory","mergeObject","lightThemeOptions","breakpoints","alpha"],"mappings":"mMAMa,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,KAAkB;AAClF,IAAA,IAAIA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAA,mEAAA,CAAqE,CAAC;AACnH,QAAA,OAAOA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;IAChD;AAEA,IAAA,IAAI,KAAK,GAAQC,gBAAW,CAACC,qCAAiB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACxC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAEC,iBAAW,IACzB;;AAGF,IAAA,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAsB;AAClD,QAAA,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM;QACnF,CAAC,CAAC,IAAI,GAAG;YACN,OAAO,EAAE,SAAS,GAAGC,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;YACpE,SAAS,EAAE,SAAS,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI;SACvE;IACJ;AAEA,IAAAJ,iBAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B"}
@@ -1,24 +1,18 @@
1
- import {ThemeFactory,mergeObject}from'./core.mjs';import {breakpoints}from'../css/index.mjs';import {lightThemeOptions}from'./ThemeDefaultOptions.mjs';import createColorScale from'./createColorScale.mjs';const createTheme = (name, options) => {
1
+ import {ThemeFactory,mergeObject}from'./core.mjs';import {breakpoints,alpha}from'../css/index.mjs';import {lightThemeOptions}from'./ThemeDefaultOptions.mjs';const createTheme = (name, options) => {
2
2
  if (ThemeFactory.has(name)) {
3
3
  console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`);
4
4
  return ThemeFactory.get(name);
5
5
  }
6
6
  let theme = mergeObject(lightThemeOptions, Object.assign(Object.assign({}, options), { name, breakpoints: breakpoints }));
7
- // create color scales if needed
8
- for (let key in theme.colors) {
9
- const color = theme.colors[key];
10
- if (typeof color === "string") {
11
- theme.colors[key] = createColorScale(color);
12
- delete theme.colors[key].mode;
13
- }
14
- else {
15
- const c = createColorScale(color.base);
16
- delete c.mode;
17
- theme.colors[key] = Object.assign(Object.assign({}, c), theme.colors[key]);
18
- }
7
+ // add alpha colors
8
+ for (let color in theme.colors) {
9
+ const c = theme.colors[color];
10
+ const is_common = color === 'divider' || color === 'background' || color === 'text';
11
+ c.soft = {
12
+ primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),
13
+ secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)
14
+ };
19
15
  }
20
- const c = createColorScale(theme.colors.common.base);
21
- theme.isDark = c.mode === "black";
22
16
  ThemeFactory.set(name, theme);
23
17
  return theme;
24
18
  };export{createTheme};//# sourceMappingURL=createTheme.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTheme.mjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput } from \"./types\"\r\nimport { mergeObject, ThemeFactory } from \"./core\"\r\nimport { breakpoints } from \"../css\"\r\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\r\nimport createColorScale from \"./createColorScale\"\r\n\r\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\r\n if (ThemeFactory.has(name)) {\r\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\r\n return ThemeFactory.get(name) as ThemeOptions\r\n }\r\n\r\n let theme: any = mergeObject(lightThemeOptions, {\r\n ...options,\r\n name,\r\n breakpoints: breakpoints\r\n })\r\n\r\n // create color scales if needed\r\n for (let key in theme.colors) {\r\n const color = theme.colors[key]\r\n if (typeof color === \"string\") {\r\n theme.colors[key] = createColorScale(color)\r\n delete theme.colors[key].mode\r\n } else {\r\n const c = createColorScale(color.base)\r\n delete (c as any).mode\r\n theme.colors[key] = {\r\n ...c,\r\n ...theme.colors[key],\r\n }\r\n }\r\n }\r\n\r\n const c = createColorScale(theme.colors.common.base)\r\n theme.isDark = c.mode === \"black\"\r\n\r\n ThemeFactory.set(name, theme)\r\n\r\n return theme as ThemeOptions\r\n}\r\n"],"names":[],"mappings":"kNAMa,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,KAAkB;AAClF,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAA,mEAAA,CAAqE,CAAC;AACnH,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;IAChD;AAEA,IAAA,IAAI,KAAK,GAAQ,WAAW,CAAC,iBAAiB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACxC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAE,WAAW,IACzB;;AAGF,IAAA,KAAK,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AAC/B,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC5B,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC;YAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI;QAChC;aAAO;YACJ,MAAM,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;YACtC,OAAQ,CAAS,CAAC,IAAI;AACtB,YAAA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACX,CAAC,CAAA,EACD,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CACtB;QACJ;IACH;AAEA,IAAA,MAAM,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACpD,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO;AAEjC,IAAA,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B"}
1
+ {"version":3,"file":"createTheme.mjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\nimport createColorScale from \"./createColorScale\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\n if (ThemeFactory.has(name)) {\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\n return ThemeFactory.get(name) as ThemeOptions\n }\n\n let theme: any = mergeObject(lightThemeOptions, {\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n // add alpha colors\n for (let color in theme.colors) {\n const c = theme.colors[color] as ThemeOptionsColor\n const is_common = color === 'divider' || color === 'background' || color === 'text'\n c.soft = {\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\n }\n }\n\n ThemeFactory.set(name, theme)\n\n return theme as ThemeOptions\n}\n"],"names":[],"mappings":"mKAMa,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,KAAkB;AAClF,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAA,mEAAA,CAAqE,CAAC;AACnH,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;IAChD;AAEA,IAAA,IAAI,KAAK,GAAQ,WAAW,CAAC,iBAAiB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACxC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAE,WAAW,IACzB;;AAGF,IAAA,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAsB;AAClD,QAAA,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM;QACnF,CAAC,CAAC,IAAI,GAAG;YACN,OAAO,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;YACpE,SAAS,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI;SACvE;IACJ;AAEA,IAAA,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"createThemeSwitcher.js","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["import { createBucket, xv } from \"react-state-bucket\"\r\nimport { getTheme } from \"./core\"\r\nimport { BucketOptions } from \"react-state-bucket/Bucket\"\r\n\r\nexport type ThemeSwitcherOption = {\r\n store?: BucketOptions['store'],\r\n onChange?: (theme: string) => void\r\n}\r\n\r\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\r\n\r\n const useThemeState = createBucket({ name: xv.string().default(defaultTheme) }, {\r\n store: option?.store || \"memory\",\r\n onChange: (_key, value) => {\r\n option?.onChange && option?.onChange(value)\r\n }\r\n })\r\n\r\n const useThemeSwitcher = () => {\r\n const state = useThemeState()\r\n return {\r\n name: state.get(\"name\"),\r\n theme: getTheme(state.get(\"name\")),\r\n change: (theme: string) => state.set(\"name\", theme)\r\n }\r\n }\r\n return useThemeSwitcher\r\n}\r\n\r\nexport default createThemeSwitcher"],"names":["createBucket","xv","getTheme"],"mappings":"mJASA,MAAM,mBAAmB,GAAG,CAAC,YAAoB,EAAE,MAA4B,KAAI;AAEhF,IAAA,MAAM,aAAa,GAAGA,6BAAY,CAAC,EAAE,IAAI,EAAEC,mBAAE,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE;QAC7E,KAAK,EAAE,CAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,KAAI,QAAQ;AAChC,QAAA,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAI;AACvB,YAAA,CAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAI,MAAM,aAAN,MAAM,KAAA,MAAA,GAAA,MAAA,GAAN,MAAM,CAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC9C;AACF,KAAA,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAK;AAC3B,QAAA,MAAM,KAAK,GAAG,aAAa,EAAE;QAC7B,OAAO;AACJ,YAAA,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;YACvB,KAAK,EAAEC,aAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClC,YAAA,MAAM,EAAE,CAAC,KAAa,KAAK,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK;SACpD;AACJ,IAAA,CAAC;AACD,IAAA,OAAO,gBAAgB;AAC1B"}
1
+ {"version":3,"file":"createThemeSwitcher.js","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["import { createBucket, xv } from \"react-state-bucket\"\nimport { getTheme } from \"./core\"\nimport { BucketOptions } from \"react-state-bucket/Bucket\"\n\nexport type ThemeSwitcherOption = {\n store?: BucketOptions['store'],\n onChange?: (theme: string) => void\n}\n\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\n\n const useThemeState = createBucket({ name: xv.string().default(defaultTheme) }, {\n store: option?.store || \"memory\",\n onChange: (_key, value) => {\n option?.onChange && option?.onChange(value)\n }\n })\n\n const useThemeSwitcher = () => {\n const state = useThemeState()\n return {\n name: state.get(\"name\"),\n theme: getTheme(state.get(\"name\")),\n change: (theme: string) => state.set(\"name\", theme)\n }\n }\n return useThemeSwitcher\n}\n\nexport default createThemeSwitcher"],"names":["createBucket","xv","getTheme"],"mappings":"mJASA,MAAM,mBAAmB,GAAG,CAAC,YAAoB,EAAE,MAA4B,KAAI;AAEhF,IAAA,MAAM,aAAa,GAAGA,6BAAY,CAAC,EAAE,IAAI,EAAEC,mBAAE,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE;QAC7E,KAAK,EAAE,CAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,KAAI,QAAQ;AAChC,QAAA,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAI;AACvB,YAAA,CAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAI,MAAM,aAAN,MAAM,KAAA,MAAA,GAAA,MAAA,GAAN,MAAM,CAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC9C;AACF,KAAA,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAK;AAC3B,QAAA,MAAM,KAAK,GAAG,aAAa,EAAE;QAC7B,OAAO;AACJ,YAAA,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;YACvB,KAAK,EAAEC,aAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClC,YAAA,MAAM,EAAE,CAAC,KAAa,KAAK,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK;SACpD;AACJ,IAAA,CAAC;AACD,IAAA,OAAO,gBAAgB;AAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"createThemeSwitcher.mjs","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["import { createBucket, xv } from \"react-state-bucket\"\r\nimport { getTheme } from \"./core\"\r\nimport { BucketOptions } from \"react-state-bucket/Bucket\"\r\n\r\nexport type ThemeSwitcherOption = {\r\n store?: BucketOptions['store'],\r\n onChange?: (theme: string) => void\r\n}\r\n\r\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\r\n\r\n const useThemeState = createBucket({ name: xv.string().default(defaultTheme) }, {\r\n store: option?.store || \"memory\",\r\n onChange: (_key, value) => {\r\n option?.onChange && option?.onChange(value)\r\n }\r\n })\r\n\r\n const useThemeSwitcher = () => {\r\n const state = useThemeState()\r\n return {\r\n name: state.get(\"name\"),\r\n theme: getTheme(state.get(\"name\")),\r\n change: (theme: string) => state.set(\"name\", theme)\r\n }\r\n }\r\n return useThemeSwitcher\r\n}\r\n\r\nexport default createThemeSwitcher"],"names":[],"mappings":"mFASA,MAAM,mBAAmB,GAAG,CAAC,YAAoB,EAAE,MAA4B,KAAI;AAEhF,IAAA,MAAM,aAAa,GAAG,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE;QAC7E,KAAK,EAAE,CAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,KAAI,QAAQ;AAChC,QAAA,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAI;AACvB,YAAA,CAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAI,MAAM,aAAN,MAAM,KAAA,MAAA,GAAA,MAAA,GAAN,MAAM,CAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC9C;AACF,KAAA,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAK;AAC3B,QAAA,MAAM,KAAK,GAAG,aAAa,EAAE;QAC7B,OAAO;AACJ,YAAA,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;YACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClC,YAAA,MAAM,EAAE,CAAC,KAAa,KAAK,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK;SACpD;AACJ,IAAA,CAAC;AACD,IAAA,OAAO,gBAAgB;AAC1B"}
1
+ {"version":3,"file":"createThemeSwitcher.mjs","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["import { createBucket, xv } from \"react-state-bucket\"\nimport { getTheme } from \"./core\"\nimport { BucketOptions } from \"react-state-bucket/Bucket\"\n\nexport type ThemeSwitcherOption = {\n store?: BucketOptions['store'],\n onChange?: (theme: string) => void\n}\n\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\n\n const useThemeState = createBucket({ name: xv.string().default(defaultTheme) }, {\n store: option?.store || \"memory\",\n onChange: (_key, value) => {\n option?.onChange && option?.onChange(value)\n }\n })\n\n const useThemeSwitcher = () => {\n const state = useThemeState()\n return {\n name: state.get(\"name\"),\n theme: getTheme(state.get(\"name\")),\n change: (theme: string) => state.set(\"name\", theme)\n }\n }\n return useThemeSwitcher\n}\n\nexport default createThemeSwitcher"],"names":[],"mappings":"mFASA,MAAM,mBAAmB,GAAG,CAAC,YAAoB,EAAE,MAA4B,KAAI;AAEhF,IAAA,MAAM,aAAa,GAAG,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE;QAC7E,KAAK,EAAE,CAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,KAAI,QAAQ;AAChC,QAAA,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAI;AACvB,YAAA,CAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAI,MAAM,aAAN,MAAM,KAAA,MAAA,GAAA,MAAA,GAAN,MAAM,CAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC9C;AACF,KAAA,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAK;AAC3B,QAAA,MAAM,KAAK,GAAG,aAAa,EAAE;QAC7B,OAAO;AACJ,YAAA,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;YACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClC,YAAA,MAAM,EAAE,CAAC,KAAa,KAAK,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK;SACpD;AACJ,IAAA,CAAC;AACD,IAAA,OAAO,gBAAgB;AAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport createThemeSwitcher from './createThemeSwitcher'\r\nimport { getTheme, useTheme } from './core'\r\nimport createColorScale from \"./createColorScale\"\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createThemeSwitcher,\r\n createTheme,\r\n createColorScale,\r\n getTheme,\r\n useTheme\r\n}\r\n\r\n"],"names":[],"mappings":"iOAQO,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,CAAA,KAAA,EAAQ,KAAK,CAAA,WAAA"}
1
+ {"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\nimport ThemeProvider from './ThemeProvider'\nimport createThemeSwitcher from './createThemeSwitcher'\nimport { getTheme, useTheme } from './core'\nexport type { ThemeProviderProps } from './ThemeProvider'\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\n\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\n\nexport {\n ThemeProvider,\n createThemeSwitcher,\n createTheme,\n getTheme,\n useTheme\n}\n\n"],"names":[],"mappings":"iOAOO,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,CAAA,KAAA,EAAQ,KAAK,CAAA,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\r\nimport ThemeProvider from './ThemeProvider'\r\nimport createThemeSwitcher from './createThemeSwitcher'\r\nimport { getTheme, useTheme } from './core'\r\nimport createColorScale from \"./createColorScale\"\r\nexport type { ThemeProviderProps } from './ThemeProvider'\r\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\r\n\r\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\r\n\r\nexport {\r\n ThemeProvider,\r\n createThemeSwitcher,\r\n createTheme,\r\n createColorScale,\r\n getTheme,\r\n useTheme\r\n}\r\n\r\n"],"names":[],"mappings":"yKAQO,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,CAAA,KAAA,EAAQ,KAAK,CAAA,WAAA"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\nimport ThemeProvider from './ThemeProvider'\nimport createThemeSwitcher from './createThemeSwitcher'\nimport { getTheme, useTheme } from './core'\nexport type { ThemeProviderProps } from './ThemeProvider'\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\n\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\n\nexport {\n ThemeProvider,\n createThemeSwitcher,\n createTheme,\n getTheme,\n useTheme\n}\n\n"],"names":[],"mappings":"yKAOO,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,CAAA,KAAA,EAAQ,KAAK,CAAA,WAAA"}
package/theme/types.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { GlobalCSS, BreakpointKeys } from '../css/types.js';
2
- import { ColorScale } from './createColorScale.js';
3
2
 
4
3
  type ObjectType = {
5
4
  [key: string]: any;
@@ -9,15 +8,6 @@ type ThemeTypographyItem = {
9
8
  lineHeight: number;
10
9
  fontWeight: number;
11
10
  };
12
- type ThemeColor = {
13
- common: ColorScale;
14
- brand: ColorScale;
15
- accent: ColorScale;
16
- success: ColorScale;
17
- info: ColorScale;
18
- warning: ColorScale;
19
- danger: ColorScale;
20
- };
21
11
  type ThemeTypographyType = {
22
12
  h1: ThemeTypographyItem;
23
13
  h2: ThemeTypographyItem;
@@ -30,9 +20,19 @@ type ThemeTypographyType = {
30
20
  button: ThemeTypographyItem;
31
21
  small: ThemeTypographyItem;
32
22
  };
23
+ type ThemeColorOption = {
24
+ primary: string;
25
+ secondary: string;
26
+ text: string;
27
+ };
28
+ type ThemeOptionsColor = ThemeColorOption & {
29
+ soft: {
30
+ primary: string;
31
+ secondary: string;
32
+ };
33
+ };
33
34
  interface ThemeOptions {
34
35
  name: string;
35
- isDark: boolean;
36
36
  rtl: boolean;
37
37
  globalStyle: GlobalCSS;
38
38
  breakpoints: {
@@ -42,29 +42,19 @@ interface ThemeOptions {
42
42
  interfaces: {
43
43
  [name: string]: <P extends object>(defaultProps: P, theme: ThemeOptions) => P;
44
44
  };
45
- colors: ThemeColor;
45
+ colors: {
46
+ background: Omit<ThemeOptionsColor, 'text'>;
47
+ text: Omit<ThemeOptionsColor, 'text'>;
48
+ divider: Omit<ThemeOptionsColor, 'text'>;
49
+ brand: ThemeOptionsColor;
50
+ accent: ThemeOptionsColor;
51
+ success: ThemeOptionsColor;
52
+ info: ThemeOptionsColor;
53
+ warning: ThemeOptionsColor;
54
+ danger: ThemeOptionsColor;
55
+ };
46
56
  typography: ThemeTypographyType;
47
57
  }
48
- type ThemeColorItemInput = string | {
49
- base: string;
50
- light?: string;
51
- lighter?: string;
52
- dark?: string;
53
- darker?: string;
54
- soft?: string;
55
- softer?: string;
56
- text?: string;
57
- subtext?: string;
58
- };
59
- type ThemeColorInput = {
60
- common?: ThemeColorItemInput;
61
- brand?: ThemeColorItemInput;
62
- accent?: ThemeColorItemInput;
63
- success?: ThemeColorItemInput;
64
- info?: ThemeColorItemInput;
65
- warning?: ThemeColorItemInput;
66
- danger?: ThemeColorItemInput;
67
- };
68
58
  type ThemeTypographyItemInput = Partial<ThemeTypographyItem>;
69
59
  type ThemeTypographyInputType = {
70
60
  h1?: ThemeTypographyItemInput;
@@ -83,10 +73,20 @@ interface ThemeOptionInput {
83
73
  interfaces?: {
84
74
  [name: string]: <P extends object>(defaultProps: P, theme: ThemeOptions) => P;
85
75
  };
86
- colors?: ThemeColorInput;
76
+ colors?: {
77
+ background?: Omit<ThemeColorOption, 'text'>;
78
+ text?: Omit<ThemeColorOption, 'text'>;
79
+ divider?: Omit<ThemeColorOption, 'text'>;
80
+ brand?: ThemeColorOption;
81
+ accent?: ThemeColorOption;
82
+ success?: ThemeColorOption;
83
+ info?: ThemeColorOption;
84
+ warning?: ThemeColorOption;
85
+ danger?: ThemeColorOption;
86
+ };
87
87
  typography?: ThemeTypographyInputType;
88
88
  }
89
89
  type TypographyRefTypes = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "text" | "button" | "small";
90
- type ColorsRefTypes = "common" | "common.light" | "common.lighter" | "common.dark" | "common.darker" | "common.soft" | "common.softer" | "common.text" | "common.subtext" | "brand" | "brand.light" | "brand.lighter" | "brand.dark" | "brand.darker" | "brand.soft" | "brand.softer" | "brand.text" | "brand.subtext" | "accent" | "accent.light" | "accent.lighter" | "accent.dark" | "accent.darker" | "accent.soft" | "accent.softer" | "accent.text" | "accent.subtext" | "info" | "info.light" | "info.lighter" | "info.dark" | "info.darker" | "info.soft" | "info.softer" | "info.text" | "info.subtext" | "success" | "success.light" | "success.lighter" | "success.dark" | "success.darker" | "success.soft" | "success.softer" | "success.text" | "success.subtext" | "warning" | "warning.light" | "warning.lighter" | "warning.dark" | "warning.darker" | "warning.soft" | "warning.softer" | "warning.text" | "warning.subtext" | "danger" | "danger.light" | "danger.lighter" | "danger.dark" | "danger.darker" | "danger.soft" | "danger.softer" | "danger.text" | "danger.subtext";
90
+ type ColorsRefTypes = "background" | "background.primary" | "background.secondary" | "text" | "text.primary" | "text.secondary" | "divider" | "divider.primary" | "divider.secondary" | "divider.soft.primary" | "divider.soft.secondary" | "brand" | "brand.primary" | "brand.secondary" | "brand.text" | "brand.soft.primary" | "brand.soft.secondary" | "accent" | "accent.primary" | "accent.secondary" | "accent.text" | "accent.soft.primary" | "accent.soft.secondary" | "info" | "info.primary" | "info.secondary" | "info.text" | "info.soft.primary" | "info.soft.secondary" | "success" | "success.primary" | "success.secondary" | "success.text" | "success.soft.primary" | "success.soft.secondary" | "warning" | "warning.primary" | "warning.secondary" | "warning.text" | "warning.soft.primary" | "warning.soft.secondary" | "danger" | "danger.primary" | "danger.secondary" | "danger.text" | "danger.soft.primary" | "danger.soft.secondary";
91
91
 
92
- export type { ColorsRefTypes, ObjectType, ThemeColor, ThemeColorInput, ThemeColorItemInput, ThemeOptionInput, ThemeOptions, ThemeTypographyInputType, ThemeTypographyItem, ThemeTypographyItemInput, ThemeTypographyType, TypographyRefTypes };
92
+ export type { ColorsRefTypes, ObjectType, ThemeColorOption, ThemeOptionInput, ThemeOptions, ThemeOptionsColor, ThemeTypographyInputType, ThemeTypographyItem, ThemeTypographyItemInput, ThemeTypographyType, TypographyRefTypes };
@@ -1,17 +0,0 @@
1
- type ColorScale = {
2
- mode: "black" | "white" | "other";
3
- base: string;
4
- light: string;
5
- lighter: string;
6
- dark: string;
7
- darker: string;
8
- soft: string;
9
- softer: string;
10
- divider: string;
11
- text: string;
12
- subtext: string;
13
- };
14
- declare function createColorScale(hex: string): ColorScale;
15
-
16
- export { createColorScale as default };
17
- export type { ColorScale };