@open-pioneer/base-theme 3.0.0-dev.20250221111321 → 4.0.0-dev-chakra-3.20250225100939

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/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @open-pioneer/base-theme
2
2
 
3
- ## 3.0.0-dev.20250221111321
3
+ ## 4.0.0-dev-chakra-3.20250225100939
4
+
5
+ ## 3.0.0
4
6
 
5
7
  ### Major Changes
6
8
 
@@ -17,7 +19,7 @@
17
19
  ### Patch Changes
18
20
 
19
21
  - Updated dependencies [9477e54]
20
- - @open-pioneer/chakra-integration@3.0.0-dev.20250221111321
22
+ - @open-pioneer/chakra-integration@3.0.0
21
23
 
22
24
  ## 2.4.0
23
25
 
package/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { theme } from "./theme";
1
+ export { config } from "./theme";
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { theme } from './theme.js';
1
+ export { config } from './theme.js';
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/base-theme",
4
- "version": "3.0.0-dev.20250221111321",
4
+ "version": "4.0.0-dev-chakra-3.20250225100939",
5
5
  "description": "This package provides the default theme for all Open Pioneer Trails applications.",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -14,7 +14,7 @@
14
14
  "directory": "src/packages/base-theme"
15
15
  },
16
16
  "dependencies": {
17
- "@open-pioneer/chakra-integration": "^3.0.0-dev.20250221111321"
17
+ "@chakra-ui/react": "^3.8.1"
18
18
  },
19
19
  "exports": {
20
20
  "./package.json": "./package.json",
package/theme.d.ts CHANGED
@@ -1,15 +1,30 @@
1
+ export declare const colorPalette: {
2
+ trails: {
3
+ 50: string;
4
+ 100: string;
5
+ 200: string;
6
+ 300: string;
7
+ 400: string;
8
+ 500: string;
9
+ 600: string;
10
+ 700: string;
11
+ 800: string;
12
+ 900: string;
13
+ 950: string;
14
+ };
15
+ };
1
16
  /**
2
17
  * Base theme for Open Pioneer Trails applications.
3
18
  *
4
19
  * All custom themes should extend this theme:
5
20
  *
6
21
  * ```ts
7
- * import { extendTheme } from "@open-pioneer/chakra-integration";
8
- * import { theme as baseTheme } from "@open-pioneer/base-theme";
22
+ * import { mergeConfigs } from "@chakra-ui/react";
23
+ * import { config as defaultTrailsConfig } from "@open-pioneer/base-theme";
9
24
  *
10
- * export const theme = extendTheme({
25
+ * export const themeConfig = mergeConfigs(defaultTrailsConfig, {
11
26
  * // Your overrides
12
- * }, baseTheme);
27
+ * });
13
28
  * ```
14
29
  */
15
- export declare const theme: Record<string, any>;
30
+ export declare const config: import("@chakra-ui/react").SystemConfig;
package/theme.js CHANGED
@@ -1,10 +1,6 @@
1
- import { extendTheme, theme as theme$1, withDefaultColorScheme } from '@open-pioneer/chakra-integration';
1
+ import { defineConfig } from '@chakra-ui/react';
2
2
 
3
- const fonts = {
4
- /* heading: "Tahoma",
5
- body: "Courier New" */
6
- };
7
- const colors = {
3
+ const colorPalette = {
8
4
  //trails = default color scheme
9
5
  trails: {
10
6
  50: "#eaf2f5",
@@ -16,242 +12,67 @@ const colors = {
16
12
  600: "#24647f",
17
13
  700: "#1b4b5f",
18
14
  800: "#123240",
19
- 900: "#091920"
15
+ 900: "#091920",
16
+ 950: "#050505"
20
17
  }
21
18
  };
22
19
  const semanticTokens = {
23
20
  colors: {
24
- "background_body": "white",
25
- "background_primary": "trails.500",
26
- "background_light": "trails.50",
27
- //"background_secondary": "trails.700",
28
- "placeholder": "gray.500",
29
- "font_primary": "black",
30
- //"font_secondary": "gray.500",
31
- "font_inverse": "white",
32
- "font_link": "trails.600",
33
- "border": "gray.300",
21
+ trails: {
22
+ solid: { value: "{colors.trails.500}" },
23
+ contrast: { value: "{colors.trails.100}" },
24
+ fg: { value: "{colors.trails.700}" },
25
+ muted: { value: "{colors.trails.100}" },
26
+ subtle: { value: "{colors.trails.200}" },
27
+ emphasized: { value: "{colors.trails.300}" },
28
+ focusRing: { value: "{colors.trails.500}" }
29
+ },
30
+ background_body: { value: "{colors.white}" },
31
+ background_primary: { value: "{colors.trails.500}" },
32
+ background_light: { value: "{colors.trails.50}" },
33
+ //background_secondary: { value: "{colors.trails.70}0"},
34
+ placeholder: { value: "{colors.gray.500}" },
35
+ font_primary: { value: "{colors.black}" },
36
+ //font_secondary: { value: "{colors.gray.50}0"},
37
+ font_inverse: { value: "{colors.white}" },
38
+ font_link: { value: "{colors.trails.600}" },
39
+ border: { value: "{colors.gray.300}" },
34
40
  //override internal chakra theming variables
35
- //https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/theme/src/semantic-tokens.ts
36
- "chakra-body-text": "font_primary",
37
- "chakra-body-bg": "background_body",
38
- "chakra-border-color": "border",
39
- "chakra-placeholder-color": "placeholder"
40
- //"chakra-inverse-text": "font_inverse",
41
- //"chakra-subtle-bg": "background_secondary",
42
- //"chakra-subtle-text": "font_secondary"
43
- }
44
- };
45
- const intermediateTheme = extendTheme({ fonts, colors, semanticTokens }, theme$1);
46
- const getColor = (semanticToken, theme2) => {
47
- const color = theme2.semanticTokens.colors[semanticToken];
48
- if (color && color.includes(".")) {
49
- const kvp = color.split(".");
50
- const key = kvp[0], value = kvp[1];
51
- return theme2.colors[key][value];
52
- }
53
- return color;
54
- };
55
- const theme = extendTheme(
56
- withDefaultColorScheme({ colorScheme: "trails" }),
57
- {
58
- styles: {
59
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
- global({ theme: theme2 }) {
61
- return {
62
- ".chakra-host": {
63
- //TODO: Hack! Additional Hex digits only work because colors are hex, too
64
- //opacity-to-hex: 0.6 => 99
65
- "--trails-theme-shadow-color": `${getColor("background_primary", theme2)}99`
66
- }
67
- };
41
+ //https://github.com/chakra-ui/chakra-ui/blob/main/packages/react/src/theme/semantic-tokens/colors.ts
42
+ // examples:
43
+ fg: {
44
+ DEFAULT: {
45
+ value: "{colors.font_primary}"
68
46
  }
69
47
  },
70
- shadows: {
71
- outline: `0 0 0 3px var(--trails-theme-shadow-color)`
48
+ bg: {
49
+ DEFAULT: {
50
+ value: "{colors.background_body}"
51
+ }
52
+ }
53
+ /*
54
+ "chakra-border-color": "border", // todo?
55
+ "chakra-placeholder-color": "placeholder" // todo? */
56
+ }
57
+ };
58
+ const config = defineConfig({
59
+ globalCss: { html: { colorPalette: "trails" } },
60
+ theme: {
61
+ tokens: {
62
+ // todo typescript
63
+ colors: colorPalette
64
+ // eslint-disable-line @typescript-eslint/no-explicit-any
72
65
  },
73
- components: {
74
- Button: {
75
- defaultProps: {
76
- //colorScheme: "gray"
77
- //size: "md", //"lg" | "md" | "sm" | "xs"
78
- //variant: "solid" //"primary" | "secondary" | "cancel" | "solid" | "outline" | "ghost" | "link"
79
- }
80
- },
81
- Checkbox: {
82
- defaultProps: {
83
- //colorScheme: "blue"
84
- //size: "md" //"lg" | "md" | "sm"
85
- }
86
- },
87
- Divider: {
88
- baseStyle: {
66
+ semanticTokens,
67
+ recipes: {
68
+ separator: {
69
+ base: {
89
70
  borderColor: "background_primary"
90
71
  }
91
- },
92
- Input: {
93
- defaultProps: {
94
- //size: "md" //"lg" | "md" | "sm" | "xs"
95
- //variant: "outline" //"outline" | "filled" | "flushed" | "unstyled"
96
- },
97
- variants: {
98
- outline({ theme: theme2 }) {
99
- return {
100
- field: {
101
- borderColor: "border",
102
- _focusVisible: {
103
- borderColor: "background_primary",
104
- boxShadow: `0 0 0 1px ${getColor("background_primary", theme2)}`
105
- }
106
- },
107
- addon: {
108
- borderColor: "border",
109
- bg: "background_primary"
110
- }
111
- };
112
- },
113
- filled: {
114
- field: {
115
- _focusVisible: {
116
- borderColor: "background_primary"
117
- }
118
- },
119
- addon: {
120
- bg: "background_primary"
121
- }
122
- },
123
- flushed({ theme: theme2 }) {
124
- return {
125
- field: {
126
- _focusVisible: {
127
- borderColor: "background_primary",
128
- boxShadow: `0px 1px 0px 0px ${getColor(
129
- "background_primary",
130
- theme2
131
- )}`
132
- }
133
- }
134
- };
135
- }
136
- }
137
- },
138
- Link: {
139
- baseStyle: {
140
- color: "font_link"
141
- }
142
- },
143
- Radio: {
144
- defaultProps: {
145
- //colorScheme: "blue",
146
- //size: "md" //"lg" | "md" | "sm"
147
- }
148
- },
149
- Select: {
150
- defaultProps: {
151
- //size: "md" //"lg" | "md" | "sm" | "xs"
152
- //variant: "outline" //"outline" | "filled" | "flushed" | "unstyled"
153
- },
154
- variants: {
155
- outline({ theme: theme2 }) {
156
- return {
157
- field: {
158
- borderColor: "border",
159
- _focusVisible: {
160
- borderColor: "background_primary",
161
- boxShadow: `0 0 0 1px ${getColor("background_primary", theme2)}`
162
- }
163
- }
164
- };
165
- },
166
- filled: {
167
- field: {
168
- _focusVisible: {
169
- borderColor: "background_primary"
170
- }
171
- },
172
- addon: {
173
- bg: "background_primary"
174
- }
175
- },
176
- flushed({ theme: theme2 }) {
177
- return {
178
- field: {
179
- _focusVisible: {
180
- borderColor: "background_primary",
181
- boxShadow: `0px 1px 0px 0px ${getColor(
182
- "background_primary",
183
- theme2
184
- )}`
185
- }
186
- }
187
- };
188
- }
189
- }
190
- },
191
- Slider: {
192
- defaultProps: {
193
- //colorScheme: "blue"
194
- //size: "md" //"lg" | "md" | "sm"
195
- },
196
- baseStyle: {
197
- thumb: {
198
- borderColor: "background_primary",
199
- _hover: {
200
- bg: "background_primary"
201
- }
202
- }
203
- }
204
- },
205
- Switch: {
206
- defaultProps: {
207
- //colorScheme: "blue",
208
- //size: "md" //"lg" | "md" | "sm"
209
- }
210
- },
211
- Textarea: {
212
- defaultProps: {
213
- //size: "md", //"lg" | "md" | "sm" | "xs"
214
- //variant: "outline" //"outline" | "filled" | "flushed" | "unstyled"
215
- },
216
- variants: {
217
- outline({ theme: theme2 }) {
218
- return {
219
- borderColor: "border",
220
- _focusVisible: {
221
- borderColor: "background_primary",
222
- boxShadow: `0 0 0 1px ${getColor("background_primary", theme2)}`
223
- }
224
- };
225
- },
226
- filled: {
227
- _focusVisible: {
228
- borderColor: "background_primary"
229
- }
230
- },
231
- flushed({ theme: theme2 }) {
232
- return {
233
- _focusVisible: {
234
- borderColor: "background_primary",
235
- boxShadow: `0px 1px 0px 0px ${getColor(
236
- "background_primary",
237
- theme2
238
- )}`
239
- }
240
- };
241
- }
242
- }
243
- },
244
- Tooltip: {
245
- baseStyle: {
246
- //bg: "background_primary",
247
- //color: "font_inverse",
248
- borderRadius: "md"
249
- }
250
72
  }
251
73
  }
252
- },
253
- intermediateTheme
254
- );
74
+ }
75
+ });
255
76
 
256
- export { theme };
77
+ export { colorPalette, config };
257
78
  //# sourceMappingURL=theme.js.map
package/theme.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sources":["theme.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {\n StyleFunctionProps,\n extendTheme,\n withDefaultColorScheme,\n theme as baseTheme\n} from \"@open-pioneer/chakra-integration\";\n\nconst fonts = {\n /* heading: \"Tahoma\",\n body: \"Courier New\" */\n};\n\n//10 colors as hex values from 50 to 900 (light to dark)\nconst colors = {\n //trails = default color scheme\n trails: {\n 50: \"#eaf2f5\",\n 100: \"#d5e5ec\",\n 200: \"#abcbd9\",\n 300: \"#81b1c5\",\n 400: \"#5797b2\",\n 500: \"#2d7d9f\",\n 600: \"#24647f\",\n 700: \"#1b4b5f\",\n 800: \"#123240\",\n 900: \"#091920\"\n }\n};\n\nconst semanticTokens = {\n colors: {\n \"background_body\": \"white\",\n \"background_primary\": \"trails.500\",\n \"background_light\": \"trails.50\",\n //\"background_secondary\": \"trails.700\",\n \"placeholder\": \"gray.500\",\n \"font_primary\": \"black\",\n //\"font_secondary\": \"gray.500\",\n \"font_inverse\": \"white\",\n \"font_link\": \"trails.600\",\n \"border\": \"gray.300\",\n\n //override internal chakra theming variables\n //https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/theme/src/semantic-tokens.ts\n \"chakra-body-text\": \"font_primary\",\n \"chakra-body-bg\": \"background_body\",\n \"chakra-border-color\": \"border\",\n \"chakra-placeholder-color\": \"placeholder\"\n //\"chakra-inverse-text\": \"font_inverse\",\n //\"chakra-subtle-bg\": \"background_secondary\",\n //\"chakra-subtle-text\": \"font_secondary\"\n }\n};\n\n//Create an intermediate theme to have access to all colors and semantic tokens (function: getColor)\nconst intermediateTheme = extendTheme({ fonts, colors, semanticTokens }, baseTheme);\n\n//Get the color defined by a semantic token.\n//If it points to a color (e.g. red.500), get the hex color value out of the color scheme.\n//Overrides: \"boxShadow\" and \"outline\"\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst getColor = (semanticToken: string, theme: any) => {\n const color = theme.semanticTokens.colors[semanticToken];\n if (color && color.includes(\".\")) {\n const kvp = color.split(\".\");\n const key = kvp[0],\n value = kvp[1];\n return theme.colors[key][value];\n }\n return color;\n};\n\n/**\n * Base theme for Open Pioneer Trails applications.\n *\n * All custom themes should extend this theme:\n *\n * ```ts\n * import { extendTheme } from \"@open-pioneer/chakra-integration\";\n * import { theme as baseTheme } from \"@open-pioneer/base-theme\";\n *\n * export const theme = extendTheme({\n * // Your overrides\n * }, baseTheme);\n * ```\n */\nexport const theme = extendTheme(\n withDefaultColorScheme({ colorScheme: \"trails\" }),\n {\n styles: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n global({ theme }: any) {\n return {\n \".chakra-host\": {\n //TODO: Hack! Additional Hex digits only work because colors are hex, too\n //opacity-to-hex: 0.6 => 99\n \"--trails-theme-shadow-color\": `${getColor(\"background_primary\", theme)}99`\n }\n };\n }\n },\n shadows: {\n outline: `0 0 0 3px var(--trails-theme-shadow-color)`\n },\n components: {\n Button: {\n defaultProps: {\n //colorScheme: \"gray\"\n //size: \"md\", //\"lg\" | \"md\" | \"sm\" | \"xs\"\n //variant: \"solid\" //\"primary\" | \"secondary\" | \"cancel\" | \"solid\" | \"outline\" | \"ghost\" | \"link\"\n }\n },\n Checkbox: {\n defaultProps: {\n //colorScheme: \"blue\"\n //size: \"md\" //\"lg\" | \"md\" | \"sm\"\n }\n },\n Divider: {\n baseStyle: {\n borderColor: \"background_primary\"\n }\n },\n Input: {\n defaultProps: {\n //size: \"md\" //\"lg\" | \"md\" | \"sm\" | \"xs\"\n //variant: \"outline\" //\"outline\" | \"filled\" | \"flushed\" | \"unstyled\"\n },\n variants: {\n outline({ theme }: StyleFunctionProps) {\n return {\n field: {\n borderColor: \"border\",\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0 0 0 1px ${getColor(\"background_primary\", theme)}`\n }\n },\n addon: {\n borderColor: \"border\",\n bg: \"background_primary\"\n }\n };\n },\n filled: {\n field: {\n _focusVisible: {\n borderColor: \"background_primary\"\n }\n },\n addon: {\n bg: \"background_primary\"\n }\n },\n flushed({ theme }: StyleFunctionProps) {\n return {\n field: {\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0px 1px 0px 0px ${getColor(\n \"background_primary\",\n theme\n )}`\n }\n }\n };\n }\n }\n },\n Link: {\n baseStyle: {\n color: \"font_link\"\n }\n },\n Radio: {\n defaultProps: {\n //colorScheme: \"blue\",\n //size: \"md\" //\"lg\" | \"md\" | \"sm\"\n }\n },\n Select: {\n defaultProps: {\n //size: \"md\" //\"lg\" | \"md\" | \"sm\" | \"xs\"\n //variant: \"outline\" //\"outline\" | \"filled\" | \"flushed\" | \"unstyled\"\n },\n variants: {\n outline({ theme }: StyleFunctionProps) {\n return {\n field: {\n borderColor: \"border\",\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0 0 0 1px ${getColor(\"background_primary\", theme)}`\n }\n }\n };\n },\n filled: {\n field: {\n _focusVisible: {\n borderColor: \"background_primary\"\n }\n },\n addon: {\n bg: \"background_primary\"\n }\n },\n flushed({ theme }: StyleFunctionProps) {\n return {\n field: {\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0px 1px 0px 0px ${getColor(\n \"background_primary\",\n theme\n )}`\n }\n }\n };\n }\n }\n },\n Slider: {\n defaultProps: {\n //colorScheme: \"blue\"\n //size: \"md\" //\"lg\" | \"md\" | \"sm\"\n },\n baseStyle: {\n thumb: {\n borderColor: \"background_primary\",\n _hover: {\n bg: \"background_primary\"\n }\n }\n }\n },\n Switch: {\n defaultProps: {\n //colorScheme: \"blue\",\n //size: \"md\" //\"lg\" | \"md\" | \"sm\"\n }\n },\n Textarea: {\n defaultProps: {\n //size: \"md\", //\"lg\" | \"md\" | \"sm\" | \"xs\"\n //variant: \"outline\" //\"outline\" | \"filled\" | \"flushed\" | \"unstyled\"\n },\n variants: {\n outline({ theme }: StyleFunctionProps) {\n return {\n borderColor: \"border\",\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0 0 0 1px ${getColor(\"background_primary\", theme)}`\n }\n };\n },\n filled: {\n _focusVisible: {\n borderColor: \"background_primary\"\n }\n },\n flushed({ theme }: StyleFunctionProps) {\n return {\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0px 1px 0px 0px ${getColor(\n \"background_primary\",\n theme\n )}`\n }\n };\n }\n }\n },\n Tooltip: {\n baseStyle: {\n //bg: \"background_primary\",\n //color: \"font_inverse\",\n borderRadius: \"md\"\n }\n }\n }\n },\n intermediateTheme\n);\n"],"names":["baseTheme","theme"],"mappings":";;AASA,MAAM,KAAQ,GAAA;AAAA;AAAA;AAGd,CAAA;AAGA,MAAM,MAAS,GAAA;AAAA;AAAA,EAEX,MAAQ,EAAA;AAAA,IACJ,EAAI,EAAA,SAAA;AAAA,IACJ,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA;AAA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GP,YAAc,EAAA;AAAA;AAClB;AACJ;AACJ,GACJ;AAAA,EACA;AACJ;;;;"}
1
+ {"version":3,"file":"theme.js","sources":["theme.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { defineConfig } from \"@chakra-ui/react\";\n\n//11 colors as hex values from 50 to 950 (light to dark)\nexport const colorPalette = {\n //trails = default color scheme\n trails: {\n 50: \"#eaf2f5\",\n 100: \"#d5e5ec\",\n 200: \"#abcbd9\",\n 300: \"#81b1c5\",\n 400: \"#5797b2\",\n 500: \"#2d7d9f\",\n 600: \"#24647f\",\n 700: \"#1b4b5f\",\n 800: \"#123240\",\n 900: \"#091920\",\n 950: \"#050505\"\n }\n};\n\nconst semanticTokens = {\n colors: {\n trails: {\n solid: { value: \"{colors.trails.500}\" },\n contrast: { value: \"{colors.trails.100}\" },\n fg: { value: \"{colors.trails.700}\" },\n muted: { value: \"{colors.trails.100}\" },\n subtle: { value: \"{colors.trails.200}\" },\n emphasized: { value: \"{colors.trails.300}\" },\n focusRing: { value: \"{colors.trails.500}\" }\n },\n background_body: { value: \"{colors.white}\" },\n background_primary: { value: \"{colors.trails.500}\" },\n background_light: { value: \"{colors.trails.50}\" },\n //background_secondary: { value: \"{colors.trails.70}0\"},\n placeholder: { value: \"{colors.gray.500}\" },\n font_primary: { value: \"{colors.black}\" },\n //font_secondary: { value: \"{colors.gray.50}0\"},\n font_inverse: { value: \"{colors.white}\" },\n font_link: { value: \"{colors.trails.600}\" },\n border: { value: \"{colors.gray.300}\" },\n\n //override internal chakra theming variables\n //https://github.com/chakra-ui/chakra-ui/blob/main/packages/react/src/theme/semantic-tokens/colors.ts\n // examples:\n fg: {\n DEFAULT: {\n value: \"{colors.font_primary}\"\n }\n },\n bg: {\n DEFAULT: {\n value: \"{colors.background_body}\"\n }\n }\n\n /*\n \"chakra-border-color\": \"border\", // todo?\n \"chakra-placeholder-color\": \"placeholder\" // todo? */\n }\n};\n\n// todo transfer old props:\n// components to recipes -> recipes for components are linked at the top of the docu page of each component\n/*const old_theme = {\n components: {\n Input: {\n variants: {\n outline({ theme }) {\n return {\n field: {\n borderColor: \"border\",\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0 0 0 1px ${getColor(\"background_primary\", theme)}`\n }\n },\n addon: {\n borderColor: \"border\",\n bg: \"background_primary\"\n }\n };\n },\n filled: {\n field: {\n _focusVisible: {\n borderColor: \"background_primary\"\n }\n },\n addon: {\n bg: \"background_primary\"\n }\n },\n flushed({ theme }) {\n return {\n field: {\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0px 1px 0px 0px ${getColor(\n \"background_primary\",\n theme\n )}`\n }\n }\n };\n }\n }\n },\n Link: {\n baseStyle: {\n color: \"font_link\"\n }\n },\n Select: {\n variants: {\n outline({ theme }: StyleFunctionProps) {\n return {\n field: {\n borderColor: \"border\",\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0 0 0 1px ${getColor(\"background_primary\", theme)}`\n }\n }\n };\n },\n filled: {\n field: {\n _focusVisible: {\n borderColor: \"background_primary\"\n }\n },\n addon: {\n bg: \"background_primary\"\n }\n },\n flushed({ theme }: StyleFunctionProps) {\n return {\n field: {\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0px 1px 0px 0px ${getColor(\n \"background_primary\",\n theme\n )}`\n }\n }\n };\n }\n }\n },\n Slider: {\n baseStyle: {\n thumb: {\n borderColor: \"background_primary\",\n _hover: {\n bg: \"background_primary\"\n }\n }\n }\n },\n Textarea: {\n variants: {\n outline({ theme }: StyleFunctionProps) {\n return {\n borderColor: \"border\",\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0 0 0 1px ${getColor(\"background_primary\", theme)}`\n }\n };\n },\n filled: {\n _focusVisible: {\n borderColor: \"background_primary\"\n }\n },\n flushed({ theme }: StyleFunctionProps) {\n return {\n _focusVisible: {\n borderColor: \"background_primary\",\n boxShadow: `0px 1px 0px 0px ${getColor(\"background_primary\", theme)}`\n }\n };\n }\n }\n },\n Tooltip: {\n baseStyle: {\n borderRadius: \"md\"\n }\n }\n }\n};*/\n\n/**\n * Base theme for Open Pioneer Trails applications.\n *\n * All custom themes should extend this theme:\n *\n * ```ts\n * import { mergeConfigs } from \"@chakra-ui/react\";\n * import { config as defaultTrailsConfig } from \"@open-pioneer/base-theme\";\n *\n * export const themeConfig = mergeConfigs(defaultTrailsConfig, {\n * // Your overrides\n * });\n * ```\n */\n// todo typscript support? https://www.chakra-ui.com/docs/theming/tokens#using-tokens\nexport const config = defineConfig({\n globalCss: { html: { colorPalette: \"trails\" } },\n theme: {\n tokens: {\n // todo typescript\n colors: colorPalette as any // eslint-disable-line @typescript-eslint/no-explicit-any\n },\n semanticTokens: semanticTokens,\n recipes: {\n separator: {\n base: {\n borderColor: \"background_primary\"\n }\n }\n }\n }\n});\n"],"names":[],"mappings":";;AAKO,MAAM,YAAe,GAAA;AAAA;AAAA,EAExB,MAAQ,EAAA;AAAA,IACJ,EAAI,EAAA,SAAA;AAAA,IACJ,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA,SAAA;AAAA,IACL,GAAK,EAAA;AAAA;AAEb;AAEA,MAAM,cAAiB,GAAA;AAAA,EACnB,MAAQ,EAAA;AAAA,IACJ,MAAQ,EAAA;AAAA,MACJ,KAAA,EAAO,EAAE,KAAA,EAAO,qBAAsB,EAAA;AAAA,MACtC,QAAA,EAAU,EAAE,KAAA,EAAO,qBAAsB,EAAA;AAAA,MACzC,EAAA,EAAI,EAAE,KAAA,EAAO,qBAAsB,EAAA;AAAA,MACnC,KAAA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