@fibery/ui-kit 1.40.2 → 1.40.4

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 (87) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +4 -7
  3. package/src/__snapshots__/design-system.test.ts.snap +7265 -0
  4. package/src/a11y-color.test.ts +181 -0
  5. package/src/a11y-color.ts +13 -20
  6. package/src/actions-menu/actions-menu-item.tsx +7 -7
  7. package/src/antd/ant-modal.tsx +10 -5
  8. package/src/antd/styles.ts +6 -6
  9. package/src/app-icon-with-fallback.tsx +2 -2
  10. package/src/app-icon.tsx +2 -2
  11. package/src/button/button.tsx +1 -0
  12. package/src/button/make-button-colors.ts +5 -13
  13. package/src/checkbox.tsx +2 -2
  14. package/src/color-picker/ColorPickerOrLoader.js +2 -2
  15. package/src/color-utils.test.ts +317 -0
  16. package/src/color-utils.ts +180 -0
  17. package/src/comment.tsx +3 -2
  18. package/src/context-menu/index.tsx +12 -7
  19. package/src/create-inline-theme.ts +9 -8
  20. package/src/design-system.colors.ts +760 -0
  21. package/src/design-system.test.ts +287 -7
  22. package/src/design-system.ts +146 -940
  23. package/src/dropdown-menu/index.tsx +21 -16
  24. package/src/emoji-picker/app-icon-picker.tsx +5 -5
  25. package/src/emoji-picker/emoji-picker-content-with-color.tsx +4 -4
  26. package/src/emoji-picker/icon-emoji-picker.tsx +2 -2
  27. package/src/favorites-icon.tsx +1 -1
  28. package/src/file-item/file-icon.tsx +169 -0
  29. package/src/file-item/file-menu-items.tsx +68 -0
  30. package/src/file-item/file-preview-actions.tsx +38 -0
  31. package/src/file-item/file-title.tsx +48 -0
  32. package/src/file-item/types.ts +27 -0
  33. package/src/file-item/use-register-in-image-gallery.tsx +70 -0
  34. package/src/file-item-2.tsx +35 -345
  35. package/src/file-item.tsx +6 -2
  36. package/src/hue-shift.test.ts +91 -0
  37. package/src/icons/Icon.tsx +1 -0
  38. package/src/icons/ast/FileCounter.ts +8 -0
  39. package/src/icons/ast/FileMultiple.ts +8 -0
  40. package/src/icons/ast/Print.ts +8 -0
  41. package/src/icons/ast/ValueEdit.ts +8 -0
  42. package/src/icons/ast/index.tsx +4 -0
  43. package/src/icons/react/Dividers.tsx +1 -1
  44. package/src/icons/react/FileCounter.tsx +13 -0
  45. package/src/icons/react/FileMultiple.tsx +13 -0
  46. package/src/icons/react/Print.tsx +13 -0
  47. package/src/icons/react/ValueEdit.tsx +13 -0
  48. package/src/icons/react/index.tsx +4 -0
  49. package/src/icons/svg/file-counter.svg +3 -0
  50. package/src/icons/svg/file-multiple.svg +3 -0
  51. package/src/icons/svg/print.svg +3 -0
  52. package/src/icons/svg/value-edit.svg +3 -0
  53. package/src/images-gallery/slide-buttons.tsx +4 -11
  54. package/src/lists/actions-menu-row-surface.tsx +5 -5
  55. package/src/mobile-keyboard-aware-popup.tsx +4 -3
  56. package/src/palette-generator.test.ts +566 -0
  57. package/src/palette-generator.ts +166 -0
  58. package/src/palette.ts +71 -55
  59. package/src/platform.ts +0 -3
  60. package/src/popover/index.tsx +20 -28
  61. package/src/progress.tsx +2 -2
  62. package/src/reactions/reaction-button.tsx +12 -6
  63. package/src/root-theme-provider.test.tsx +316 -0
  64. package/src/scale-generator.ts +347 -0
  65. package/src/select/components/menu-list-virtualized.tsx +7 -22
  66. package/src/select/components/menu.tsx +12 -2
  67. package/src/select/select.tsx +2 -1
  68. package/src/select/styles.ts +0 -1
  69. package/src/static-palettes.ts +146 -0
  70. package/src/thematic-color-picker.tsx +266 -0
  71. package/src/thematic-constants.tsx +27 -0
  72. package/src/thematic-controls.tsx +144 -0
  73. package/src/thematic-scales.tsx +122 -0
  74. package/src/thematic-state.ts +333 -0
  75. package/src/thematic.tsx +382 -0
  76. package/src/theme-provider.test.tsx +808 -0
  77. package/src/theme-provider.tsx +132 -69
  78. package/src/theme-settings.ts +1 -1
  79. package/src/theme-styles.ts +12 -5
  80. package/src/toast/toast-action.tsx +1 -1
  81. package/src/toggle-on-off.tsx +2 -2
  82. package/src/toggle.tsx +5 -6
  83. package/src/tooltip.tsx +13 -10
  84. package/src/type-badge.tsx +3 -3
  85. package/src/unit/styles.ts +2 -2
  86. package/src/unit/unit-with-tooltip.tsx +3 -2
  87. package/src/use-long-press.tsx +2 -2
@@ -0,0 +1,760 @@
1
+ /* eslint-disable max-lines */
2
+ import {ThemePalette} from "./palette-generator";
3
+ import _ from "lodash";
4
+ import {a11yColor} from "./a11y-color";
5
+ import {darkenChroma, produceColor, setAlpha, setLuminanceChroma} from "./color-utils";
6
+ import {ThemeMode} from "./theme-settings";
7
+
8
+ const transparent = "rgba(255, 255, 255, 0)";
9
+
10
+ export const brandColors = {
11
+ red: "#FF5400",
12
+ green: "#08BD9F",
13
+ blue: "#4978D4",
14
+ } as const;
15
+
16
+ export const cardTypeColors = [
17
+ "#4A4A4A",
18
+ "#6A849B",
19
+ "#99A2AB",
20
+ "#D40915",
21
+ "#E72065",
22
+ "#9C2BAF",
23
+ "#673DB6",
24
+ "#3E53B4",
25
+ "#2978FB",
26
+ "#199EE3",
27
+ "#1FBED3",
28
+ "#159789",
29
+ "#4FAF54",
30
+ "#8EC351",
31
+ "#FBA32F",
32
+ "#FC551F",
33
+ "#B04E31",
34
+ ] as const;
35
+
36
+ const swatches = {
37
+ "gray-light": cardTypeColors[1],
38
+ yellow: cardTypeColors[14],
39
+ green: "#69AC5E",
40
+ };
41
+
42
+ export const opacity = {
43
+ opacity100: 1,
44
+ opacity95: 0.95,
45
+ opacity90: 0.9,
46
+ opacity85: 0.85,
47
+ opacity80: 0.8,
48
+ opacity75: 0.75,
49
+ opacity70: 0.7,
50
+ opacity65: 0.65,
51
+ opacity60: 0.6,
52
+ opacity55: 0.55,
53
+ opacity50: 0.5,
54
+ opacity45: 0.45,
55
+ opacity40: 0.4,
56
+ opacity35: 0.35,
57
+ opacity30: 0.3,
58
+ opacity25: 0.25,
59
+ opacity20: 0.2,
60
+ opacity15: 0.15,
61
+ opacity10: 0.1,
62
+ opacity5: 0.05,
63
+ opacity0: 0,
64
+ } as const;
65
+
66
+ export const getOpacities = _.memoize((color: string) =>
67
+ _.mapValues(opacity, (opacityValue) => {
68
+ if (color === transparent) {
69
+ return transparent;
70
+ }
71
+ return produceColor(color, (c) => setAlpha(c, opacityValue));
72
+ })
73
+ );
74
+
75
+ type ThemeColorsDef = Record<
76
+ string,
77
+ | readonly [lightColor: string, darkColor: string]
78
+ | readonly [Record<string, string>, Record<string, string>]
79
+ | readonly ["light", "dark"]
80
+ >;
81
+
82
+ type ThemeFnsDef = Record<
83
+ string,
84
+ {
85
+ light: (color: string) => string;
86
+ dark: (color: string) => string;
87
+ // light2 is "dark menu on light rest".
88
+ // defaults to 'light'
89
+ light2?: (color: string) => string;
90
+ }
91
+ >;
92
+
93
+ export function makeThemeDefs({
94
+ white,
95
+ black,
96
+ base,
97
+ baseDark,
98
+ accent,
99
+ accentDark,
100
+ red,
101
+ redDark,
102
+ teal,
103
+ tealDark,
104
+ yellow,
105
+ yellowDark,
106
+ }: ThemePalette) {
107
+ const shades = getOpacities(black[0]);
108
+ const separators = {
109
+ ..._.mapValues(shades, (shade) => `0.5px solid ${shade}`),
110
+ } as const;
111
+
112
+ const lights = getOpacities(white[0]);
113
+ const inversedSeparators = {
114
+ ..._.mapValues(lights, (light) => `0.5px solid ${light}`),
115
+ } as const;
116
+
117
+ const colors = {
118
+ mode: ["light", "dark"],
119
+ brandColors: [brandColors, brandColors],
120
+ colorAI: ["hsla(271, 57%, 61%, 1)", "hsla(272, 43%, 50%, 1)"],
121
+ colorBgAI: ["hsla(271, 57%, 61%, 0.09)", "hsla(272, 43%, 50%, 0.2)"],
122
+ colorSubtleBgAI: ["hsla(271, 57%, 61%, 0.05)", "hsla(272, 43%, 50%, 0.1)"],
123
+
124
+ // Elevations
125
+ surfaceElevationS: [`0 2px 4px 0 ${black[3]}`, `0 2px 4px 0 ${white[3]}`],
126
+ surfaceElevationM: [`0 4px 8px 0 ${black[5]}`, `0 4px 8px 0 ${white[5]}`],
127
+ surfaceElevationL: [`0 8px 12px 0 ${black[5]}`, `0 8px 12px 0 ${white[5]}`],
128
+
129
+ // Shadows and effects / Elevation
130
+ shadow50: [
131
+ `0px 0px 0px 1px ${getOpacities(base[12]).opacity5}`,
132
+ `0px 0px 0px 1px ${getOpacities(baseDark[12]).opacity10}`,
133
+ ],
134
+ shadow100: [
135
+ `0px 1px 4px 0px ${getOpacities(base[12]).opacity5}`,
136
+ `0px 1px 4px 0px ${getOpacities(base[12]).opacity10}`,
137
+ ],
138
+ shadow200: [
139
+ `0px 2px 6px 0px ${getOpacities(base[12]).opacity5}`,
140
+ `0px 2px 6px 0px ${getOpacities(base[12]).opacity10}`,
141
+ ],
142
+ shadow300: [
143
+ `0px 3px 6px -3px ${getOpacities(base[12]).opacity10}, 0px 8px 20px -4px ${getOpacities(base[12]).opacity15}`,
144
+ `0px 3px 6px -3px ${getOpacities(base[12]).opacity10}, 0px 8px 20px -4px ${getOpacities(base[12]).opacity15}`,
145
+ ],
146
+ shadow400: [
147
+ `0px 0px 1px 0px ${getOpacities(base[12]).opacity20}, 0px 16px 40px 0px ${getOpacities(base[12]).opacity15}`,
148
+ `0px 0px 1px 0px ${getOpacities(base[12]).opacity20}, 0px 16px 40px 0px ${getOpacities(base[12]).opacity15}`,
149
+ ],
150
+ shadow500: [
151
+ `0px 0px 1px 0px ${getOpacities(base[12]).opacity20}, 0px 20px 50px 0px ${getOpacities(base[12]).opacity15}`,
152
+ `0px 0px 1px 0px ${getOpacities(base[12]).opacity20}, 0px 20px 50px 0px ${getOpacities(base[12]).opacity15}`,
153
+ ],
154
+ shadow600: [
155
+ `0px 0px 1px 0px ${getOpacities(base[12]).opacity20}, 0px 26px 80px 0px ${getOpacities(base[12]).opacity20}`,
156
+ `0px 0px 1px 0px ${getOpacities(base[12]).opacity20}, 0px 26px 80px 0px ${getOpacities(base[12]).opacity20}`,
157
+ ],
158
+ actionMenuShadow: [
159
+ `0px 0px 2px 0px ${getOpacities(base[11]).opacity30}, 0px 4px 6px 0px ${
160
+ getOpacities(base[11]).opacity5
161
+ }, 0px 10px 26px 0px ${getOpacities(base[11]).opacity15}`,
162
+ `0px 0px 0px 1px ${getOpacities(baseDark[6]).opacity100}, 0px 4px 6px 0px ${
163
+ getOpacities(baseDark[1]).opacity5
164
+ }, 0px 10px 26px 0px ${getOpacities(baseDark[1]).opacity15}`,
165
+ ],
166
+ shadowPopup: [
167
+ `0px 0px 2px 0px ${getOpacities(base[11]).opacity30}, 0px 4px 6px 0px ${
168
+ getOpacities(base[11]).opacity5
169
+ }, 0px 10px 26px 0px ${getOpacities(base[11]).opacity15}`,
170
+ `0px 0px 0px 1px ${getOpacities(baseDark[6]).opacity100}, 0px 4px 6px 0px ${
171
+ getOpacities(baseDark[1]).opacity5
172
+ }, 0px 10px 26px 0px ${getOpacities(baseDark[1]).opacity15}`,
173
+ ],
174
+ shadowSidebar: [
175
+ `-3px 0px 10px 0px ${getOpacities(base[10]).opacity10}`,
176
+ `-3px 0px 10px 0px ${getOpacities(baseDark[1]).opacity80}`,
177
+ ],
178
+
179
+ // Rubbish dump
180
+ primaryBlue: [accent[9], accentDark[9]],
181
+ whiteColor: [white[0], white[0]],
182
+ blackColor: [black[0], black[0]],
183
+ mainBg: [base[3], baseDark[0]],
184
+ panelBg: [white[0], baseDark[1]],
185
+ panelContentBg: [base[2], baseDark[1]],
186
+ colorBgRelationContainer: [base[2], baseDark[1]],
187
+ colorBgAISidebarContent: [base[1], baseDark[1]],
188
+ pageContentBg: [white[0], baseDark[2]],
189
+ colorBgPopup: [white[0], baseDark[4]],
190
+ menuBg: [base[3], baseDark[0]],
191
+ menuTextColor: [baseDark[5], base[8]],
192
+ menuItemHoverColor: [base[5], baseDark[6]],
193
+ menuSelectedTextColor: [base[2], base[2]],
194
+ menuIconColor: [getOpacities(base[12]).opacity70, getOpacities(baseDark[12]).opacity70],
195
+
196
+ // Text, links colors
197
+ textColor: [baseDark[5], base[6]],
198
+ textSelectionColor: [getOpacities(accent[9]).opacity20, getOpacities(accentDark[9]).opacity40],
199
+ accentTextColor: [base[10], baseDark[10]],
200
+ disabledTextColor: [base[9], baseDark[9]],
201
+ inversedTextColor: [base[3], baseDark[6]],
202
+ colorTextSecondary: [getOpacities(base[12]).opacity70, getOpacities(baseDark[12]).opacity65],
203
+ linkColor: [accentDark[10], accentDark[10]],
204
+ linkBorder: [
205
+ `0.5px solid ${getOpacities(accentDark[10]).opacity40}`,
206
+ `0.5px solid ${getOpacities(accentDark[11]).opacity40}`,
207
+ ],
208
+ linkHoverColor: [accent[10], accentDark[11]],
209
+ linkBorderHover: [
210
+ `0.5px solid ${getOpacities(accent[10]).opacity80}`,
211
+ `0.5px solid ${getOpacities(accentDark[10]).opacity70}`,
212
+ ],
213
+ codeColor: [red[9], red[8]],
214
+ codeBgColor: [base[3], baseDark[4]],
215
+ codeBlockBgColor: [base[3], baseDark[4]],
216
+ addedDiffTextColor: [teal[9], tealDark[11]],
217
+ removedDiffTextColor: [red[11], redDark[11]],
218
+
219
+ // Entity
220
+ entityNodeColor: [baseDark[3], base[8]],
221
+ entityNodeBorder: [
222
+ `0.5px solid ${getOpacities(baseDark[3]).opacity30}`,
223
+ `0.5px solid ${getOpacities(base[8]).opacity40}`,
224
+ ],
225
+ entityNodeHoverColor: [baseDark[7], base[7]],
226
+ entityNodeBorderHover: [
227
+ `0.5px solid ${getOpacities(base[11]).opacity80}`,
228
+ `0.5px solid ${getOpacities(base[7]).opacity80}`,
229
+ ],
230
+ entityNodeBgColor: [base[2], baseDark[3]],
231
+ shortcutTextColor: [base[9], baseDark[11]],
232
+ shortcutBorder: [
233
+ `1px solid ${getOpacities(base[8]).opacity50}`,
234
+ `1px solid ${getOpacities(baseDark[10]).opacity20}`,
235
+ ],
236
+ shortcutBorderColor: [getOpacities(base[8]).opacity50, getOpacities(baseDark[10]).opacity20],
237
+
238
+ // Input
239
+ inputBgColor: [white[0], baseDark[2]],
240
+ inputDisabledBgColor: [getOpacities(base[6]).opacity30, getOpacities(baseDark[6]).opacity30],
241
+ inputDisabledBorderColor: [
242
+ `0 0 0 1px ${getOpacities(base[6]).opacity20}`,
243
+ `0 0 0 1px ${getOpacities(baseDark[8]).opacity20}`,
244
+ ],
245
+ inputCopyBgColor: [base[3], baseDark[4]],
246
+ inputBorderColor: [
247
+ `0 0 0 1px ${getOpacities(base[6]).opacity70}`,
248
+ `0 0 0 1px ${getOpacities(baseDark[8]).opacity70}`,
249
+ ],
250
+ inputBorderHoverColor: [
251
+ `0 0 0 1px ${getOpacities(base[7]).opacity100}`,
252
+ `0 0 0 1px ${getOpacities(baseDark[8]).opacity100}`,
253
+ ],
254
+ inputBorderFocusColor: [
255
+ `0 0 0 1px ${getOpacities(base[8]).opacity100}`,
256
+ `0 0 0 1px ${getOpacities(baseDark[9]).opacity100}`,
257
+ ],
258
+ inputBorderBlendMode: ["multiply", "lighten"],
259
+ inputPlaceholderTextColor: [base[9], baseDark[9]],
260
+ inputErrorBorderColor: [`0 0 0 1px ${red[11]}`, `0 0 0 1px ${red[7]}`],
261
+ inputErrorBorderHoverColor: [
262
+ `0 0 0 1px ${getOpacities(red[11]).opacity40}`,
263
+ `0 0 0 1px ${getOpacities(red[7]).opacity40}`,
264
+ ],
265
+ inputErrorBorderFocusColor: [
266
+ `0 0 0 1px ${getOpacities(red[11]).opacity25}`,
267
+ `0 0 0 1px ${getOpacities(red[7]).opacity25}`,
268
+ ],
269
+ inputErrorBorderFocusShadow: [
270
+ `0 0 0 3px ${getOpacities(red[11]).opacity25}`,
271
+ `0 0 0 3px ${getOpacities(red[7]).opacity25}`,
272
+ ],
273
+ buttonPrimaryColor: [accent[9], accentDark[9]],
274
+ buttonColor: [base[10], baseDark[10]],
275
+ buttonPrimaryTextColor: [base[2], base[6]],
276
+ checkboxColor: [getOpacities(base[12]).opacity70, getOpacities(baseDark[12]).opacity70],
277
+ colorBorderBlockQuote: [base[11], baseDark[11]],
278
+
279
+ // Actions menu
280
+ colorBgActionsMenu: [white[0], baseDark[3]],
281
+ colorBgActionsMenuItemHover: [getOpacities(base[11]).opacity10, getOpacities(baseDark[11]).opacity10],
282
+ colorBgActionsMenuItemSelected: [getOpacities(accent[4]).opacity80, getOpacities(accentDark[4]).opacity80],
283
+ colorBgActionsMenuItemSelectedHover: [getOpacities(accent[5]).opacity80, getOpacities(accentDark[6]).opacity80],
284
+ colorBgActionsMenuItemDangerHover: [getOpacities(red[9]).opacity10, getOpacities(redDark[10]).opacity10],
285
+ colorBgActionsMenuItemDangerActive: [getOpacities(red[9]).opacity80, getOpacities(redDark[10]).opacity80],
286
+ actionMenuBg: [white[0], baseDark[3]],
287
+ actionMenuInnerBg: [white[0], baseDark[4]],
288
+ actionMenuHover: [base[4], baseDark[5]],
289
+ actionMenuInnerHover: [base[4], getOpacities(baseDark[6]).opacity50],
290
+ actionMenuButtonColor: [white[0], baseDark[2]],
291
+ actionMenuButtonHoverColor: [base[1], baseDark[3]],
292
+ actionMenuButtonShadow: [
293
+ `0 0 0 1px ${getOpacities(base[10]).opacity10}, 0 2px 4px -4px ${getOpacities(base[10]).opacity20}`,
294
+ `0 0 0 1px ${getOpacities(baseDark[2]).opacity10}, 0 2px 4px -4px ${getOpacities(baseDark[2]).opacity20}`,
295
+ ],
296
+ actionMenuSeparatorColor: [getOpacities(black[0]).opacity10, getOpacities(white[0]).opacity15],
297
+ separatorColor: [getOpacities(black[0]).opacity10, getOpacities(white[0]).opacity10],
298
+ separatorColorDimmed: [getOpacities(black[0]).opacity5, getOpacities(white[0]).opacity5],
299
+ separatorBreadcrumbsColor: [base[8], baseDark[8]],
300
+ iconColor: [getOpacities(base[12]).opacity70, getOpacities(baseDark[12]).opacity70],
301
+ appIconColor: [getOpacities(base[2]).opacity90, getOpacities(base[2]).opacity70],
302
+ appIconBgColor: [getOpacities(base[1]).opacity90, getOpacities(base[2]).opacity50],
303
+ mentionBgColor: [getOpacities(base[7]).opacity30, getOpacities(baseDark[7]).opacity40],
304
+ colorBgSelectMenu: [base[1], baseDark[3]],
305
+ shadowSelectMenu: [
306
+ `0px 0px 2px 0px ${getOpacities(base[11]).opacity30}, 0px 4px 6px 0px ${
307
+ getOpacities(base[11]).opacity5
308
+ }, 0px 10px 26px 0px ${getOpacities(base[11]).opacity15}`,
309
+ `0px 0px 0px 1px ${getOpacities(baseDark[6]).opacity100}, 0px 4px 6px 0px ${
310
+ getOpacities(baseDark[1]).opacity5
311
+ }, 0px 10px 26px 0px ${getOpacities(baseDark[1]).opacity15}`,
312
+ ],
313
+ colorBgListItemGeneral: [transparent, transparent],
314
+ colorBgListItemGeneralHover: [base[3], baseDark[4]],
315
+ colorBgListItemGeneralFocus: [base[4], baseDark[6]],
316
+ colorBgListItemGeneralSelected: [accent[3], accentDark[4]],
317
+ colorBgListItemGeneralSelectedHover: [accent[4], accentDark[6]],
318
+ colorBgListItemGeneralSelectedFocus: [accent[4], accentDark[6]],
319
+ colorBgListItemGeneralDisabled: [transparent, transparent],
320
+ colorTextListItemGeneralDisabled: [base[9], baseDark[9]],
321
+ colorBgListItemGeneralSelectedDisabled: [accent[5], accentDark[5]],
322
+ opacityListItemGeneralDisabled: [`${opacity.opacity40}`, `${opacity.opacity40}`],
323
+
324
+ // Search Items
325
+ colorBgSearchRowHover: [base[4], baseDark[5]],
326
+ colorBgSearchRowCreateHover: [accent[4], accentDark[4]],
327
+ opacitySearchItemDone: [`${opacity.opacity40}`, `${opacity.opacity40}`],
328
+ // Entity Box Style And States
329
+ // Basic Entity Box State
330
+ colorBgEntityBoxDefault: [white[0], baseDark[3]],
331
+ shadowStrokeEntityBoxDefault: [`0 0 0 1px ${base[5]}`, `0 0 0 1px ${baseDark[5]}`],
332
+ shadowEntityBoxDefault: [
333
+ `0px 2px 4px 0px ${getOpacities(base[12]).opacity5}`,
334
+ `0px 2px 4px 0px ${getOpacities(baseDark[1]).opacity5}`,
335
+ ],
336
+ // :hover
337
+ colorBgEntityBoxDefaultHover: [white[0], baseDark[4]],
338
+ shadowEntityBoxDefaultHover: [
339
+ `0px 4px 8px 0px ${getOpacities(base[12]).opacity10}`,
340
+ `0px 4px 8px 0px ${getOpacities(baseDark[1]).opacity10}`,
341
+ ],
342
+ // :focus
343
+ colorBgEntityBoxDefaultFocus: [white[0], baseDark[3]],
344
+ colorOverlayEntityBoxDefaultFocus: [accent[9], accentDark[9]],
345
+ shadowStrokeEntityBoxDefaultFocus: [
346
+ `0 0 0 2px ${getOpacities(accent[9]).opacity40}`,
347
+ `0 0 0 2px ${getOpacities(accentDark[9]).opacity40}`,
348
+ ],
349
+ // :focus:hover
350
+ colorBgEntityBoxDefaultFocusHover: [white[0], baseDark[4]],
351
+ colorOverlayEntityBoxDefaultFocusHover: [accent[9], accentDark[9]],
352
+ shadowStrokeEntityBoxDefaultFocusHover: [
353
+ `0 0 0 2px ${getOpacities(accent[9]).opacity60}`,
354
+ `0 0 0 2px ${getOpacities(accentDark[9]).opacity60}`,
355
+ ],
356
+ //::drag
357
+ opacityEntityBoxDefaultDrag: [`${opacity.opacity40}`, `${opacity.opacity40}`],
358
+ shadowEntityBoxDefaultDrag: [
359
+ `0px 8px 12px 0px ${getOpacities(base[12]).opacity10}`,
360
+ `0px 8px 12px 0px ${getOpacities(baseDark[1]).opacity10}`,
361
+ ],
362
+ // Selected Entity Box State
363
+ colorBgEntityBoxSelected: [accent[2], accentDark[3]],
364
+ shadowStrokeEntityBoxSelected: [
365
+ `0 0 0 1px ${getOpacities(accent[9]).opacity40}, 0 0 0 3px ${getOpacities(accent[9]).opacity40}`,
366
+ `0 0 0 1px ${accentDark[9]}, 0 0 0 3px ${getOpacities(accentDark[9]).opacity40}`,
367
+ ],
368
+ // :hover
369
+ colorBgEntityBoxSelectedHover: [accent[3], accentDark[3]],
370
+ shadowStrokeEntityBoxSelectedHover: [
371
+ `0 0 0 1px ${getOpacities(accent[9]).opacity60}, 0 0 0 3px ${getOpacities(accent[9]).opacity40}`,
372
+ `0 0 0 1px ${accentDark[9]}, 0 0 0 3px ${getOpacities(accentDark[9]).opacity40}`,
373
+ ],
374
+ //::drag
375
+ colorBgEntityBoxSelectedDrag: [accent[3], accentDark[3]],
376
+ shadowStrokeEntityBoxSelectedDrag: [
377
+ `0 0 0 1px ${getOpacities(accent[9]).opacity40}, 0 0 0 3px ${getOpacities(accent[9]).opacity40}`,
378
+ `0 0 0 1px ${accentDark[9]}, 0 0 0 3px ${getOpacities(accentDark[9]).opacity40}`,
379
+ ],
380
+ // Disabled Entity Box State (done)
381
+ opacityEntityBoxDisabled: [`${opacity.opacity65}`, `${opacity.opacity65}`],
382
+ // :hover
383
+ opacityEntityBoxDisabledHover: [`${opacity.opacity75}`, `${opacity.opacity75}`],
384
+ // :focus
385
+ opacityEntityBoxDisabledFocus: [`${opacity.opacity75}`, `${opacity.opacity75}`],
386
+ // :drag
387
+ opacityEntityBoxDisabledDrag: [`${opacity.opacity40}`, `${opacity.opacity40}`],
388
+ // Entity Old
389
+ entityCardBgColor: [white[0], baseDark[5]],
390
+ entityCardSelectedColor: [getOpacities(base[2]).opacity80, getOpacities(baseDark[6]).opacity50],
391
+ entityCardHoverColor: [getOpacities(base[2]).opacity80, getOpacities(baseDark[6]).opacity50],
392
+ entityCardDoneColor: [getOpacities(base[4]).opacity30, getOpacities(baseDark[5]).opacity30],
393
+ entityCardShadow: [
394
+ `0 0 0 1px ${getOpacities(base[10]).opacity10}, 0 2px 4px -4px ${getOpacities(base[10]).opacity20}`,
395
+ `0 0 0 1px ${getOpacities(baseDark[2]).opacity10}, 0 2px 4px -4px ${getOpacities(baseDark[2]).opacity20}`,
396
+ ],
397
+ entityCardShadowHover: [
398
+ `0 0 0 1px ${getOpacities(base[10]).opacity10}, 0 2px 4px -4px ${getOpacities(base[10]).opacity20}`,
399
+ `0 0 0 1px ${getOpacities(baseDark[2]).opacity10}, 0 2px 4px -4px ${getOpacities(baseDark[2]).opacity20}`,
400
+ ],
401
+ colorBgSegmentedControl: [getOpacities(base[5]).opacity80, getOpacities(baseDark[3]).opacity80],
402
+ colorBgMenuHeaderAvatar: [white[0], baseDark[2]],
403
+ shadowMenuHeaderAvatar: [
404
+ `0px 1px 4px ${getOpacities(base[11]).opacity10}, 0 0 0 0.5px ${getOpacities(base[5]).opacity50}`,
405
+ `0 0 0 1px ${getOpacities(baseDark[9]).opacity20}`,
406
+ ],
407
+ // Main Menu Items Styles and States
408
+ // Dragged
409
+ opacityMenuItemDragged: [`${opacity.opacity40}`, `${opacity.opacity40}`],
410
+ colorBgMenuItemSelectedDragged: [accent[6], accentDark[6]],
411
+ // Default
412
+ colorTextMenuItem: [baseDark[5], getOpacities(baseDark[12]).opacity90],
413
+ colorBgMenuItem: [transparent, transparent],
414
+ // :hover
415
+ colorBgMenuItemHover: [base[5], baseDark[2]],
416
+ // :focus
417
+ colorBgMenuItemFocus: [base[6], baseDark[5]],
418
+ // Selected
419
+ colorBgMenuItemSelected: [getOpacities(accent[5]).opacity80, accentDark[3]],
420
+ // :hover
421
+ colorBgMenuItemSelectedHover: [getOpacities(accent[6]).opacity70, accentDark[5]],
422
+ // :focus, :focus:hover
423
+ colorBgPinnedFieldsLabel: [base[11], baseDark[11]],
424
+ colorBgObjectEditorSeparator: [base[12], baseDark[12]],
425
+ colorBgMenuItemSelectedFocused: [accent[6], accentDark[5]],
426
+ colorBgFieldEditorContainer: [base[2], baseDark[3]],
427
+ colorBgFieldEditorLinkEqualSign: [base[6], baseDark[2]],
428
+ allowedDropColor: [base[4], baseDark[4]],
429
+ relationViewBgColor: [base[2], baseDark[3]],
430
+
431
+ mySpaceIconColor: [swatches["gray-light"], swatches["gray-light"]],
432
+ mySpaceIconBg: [getOpacities(swatches["gray-light"]).opacity20, getOpacities(swatches["gray-light"]).opacity20],
433
+ privateIconColor: [swatches.green, swatches.green],
434
+ privateIconBg: [getOpacities(swatches.green).opacity20, getOpacities(swatches.green).opacity20],
435
+ favoritesIconColor: [swatches.yellow, swatches.yellow],
436
+ favoritesIconBg: [getOpacities(swatches.yellow).opacity20, getOpacities(swatches.yellow).opacity20],
437
+
438
+ // Unit
439
+ unitBg: [base[3], baseDark[6]],
440
+ unitBgHover: [base[4], baseDark[7]],
441
+
442
+ // Badges
443
+ colorBgBadgeNeutral: [getOpacities(accent[5]).opacity70, getOpacities(accentDark[4]).opacity80],
444
+ colorBgBadgeSuccess: [teal[5], tealDark[5]],
445
+ colorBgBadgeWarning: [yellow[5], yellowDark[5]],
446
+ colorBgBadgeError: [red[5], redDark[5]],
447
+ colorTextBadgeNeutral: [accent[11], accentDark[11]],
448
+ colorTextBadgeSuccess: [teal[11], tealDark[11]],
449
+ colorTextBadgeWarning: [yellow[11], yellowDark[11]],
450
+ colorTextBadgeError: [red[11], redDark[11]],
451
+ // FIXME: lack of baseDark usage; same values!
452
+ badgeBgColor: [getOpacities(base[10]).opacity20, getOpacities(base[10]).opacity20],
453
+ tooltipBgColor: [baseDark[5], baseDark[6]],
454
+ todayMarkerColor: [red[8], redDark[6]],
455
+ viewBgOverlayColor: [getOpacities(base[8]).opacity20, getOpacities(baseDark[1]).opacity60],
456
+ floatEditorMenuBg: [base[1], baseDark[6]],
457
+ floatEditorActiveColor: [accent[11], accentDark[11]],
458
+ commentColor: [getOpacities(yellow[6]).opacity60, getOpacities(yellowDark[9]).opacity40],
459
+ cellBackgroundColor: [base[2], baseDark[2]],
460
+ cellBackgroundHoverColor: [getOpacities(base[6]).opacity30, getOpacities(baseDark[6]).opacity30],
461
+ cellBorderColor: [getOpacities(base[8]).opacity50, getOpacities(baseDark[9]).opacity50],
462
+ cellPinnedBorderColor: [getOpacities(base[8]).opacity70, getOpacities(baseDark[9]).opacity70],
463
+ tableRowWarningColor: [getOpacities(yellow[6]).opacity60, getOpacities(yellowDark[9]).opacity40],
464
+ errorBgColor: [getOpacities(red[9]).opacity20, getOpacities(redDark[9]).opacity60],
465
+ errorTextColor: [red[11], red[7]],
466
+ errorButtonColor: [red[9], redDark[10]],
467
+ warningBgColor: [getOpacities(yellow[6]).opacity60, getOpacities(yellowDark[8]).opacity60],
468
+ warningButtonColor: [yellow[11], yellowDark[11]],
469
+ infoBox: [getOpacities(yellow[4]).opacity50, getOpacities(yellowDark[9]).opacity20],
470
+ appCardBgColor: [white[0], baseDark[2]],
471
+ appCardHoverColor: [getOpacities(base[1]).opacity95, baseDark[2]],
472
+ modalBg: [getOpacities(base[11]).opacity20, getOpacities(baseDark[2]).opacity50],
473
+ modalContentBg: [white[0], baseDark[3]],
474
+ progressIconBg: [black[7], white[7]],
475
+ progressIconFill: [black[11], white[11]],
476
+ formBg: [base[2], baseDark[2]],
477
+ formHeaderShadow: [
478
+ `${getOpacities(base[10]).opacity10} 0px 0px 6px`,
479
+ `${getOpacities(baseDark[1]).opacity40} 0px 0px 6px`,
480
+ ],
481
+ formEditorFieldBg: [base[3], baseDark[4]],
482
+ filterGroup1Bg: [base[2], baseDark[6]],
483
+ filterGroup2Bg: [base[3], baseDark[7]],
484
+ filterGroupBorder: [black[3], white[3]],
485
+ colorBgNotificationHover: [base[3], baseDark[4]],
486
+ colorBgNotificationSelected: [accent[3], accentDark[4]],
487
+ colorBgNotificationSelectedHover: [accent[4], accentDark[6]],
488
+ disabledInversedTextColor: [shades.opacity25, lights.opacity25],
489
+ success: [teal[9], tealDark[9]],
490
+ danger: [red[9], redDark[10]],
491
+ active: [red[9], redDark[10]],
492
+ warning: [yellow[9], yellowDark[8]],
493
+ cardBg: [white[0], baseDark[6]],
494
+ selectedImageBorder: [black[8], white[11]],
495
+ transparent: [transparent, transparent],
496
+ shades: [lights, shades],
497
+ lights: [shades, lights],
498
+ separators: [separators, inversedSeparators],
499
+ inversedSeparators: [inversedSeparators, separators],
500
+ // FIXME: lack of baseDark scale usage, same values!
501
+ progressBg: [base[4], base[4]],
502
+ progressText: [base[11], base[11]],
503
+ progressFillBg: [base[11], base[11]],
504
+ progressFillText: [white[0], white[0]],
505
+ progressBarFillNeutral: [getOpacities(base[9]).opacity20, getOpacities(baseDark[9]).opacity20],
506
+ progressBarFill: [accent[9], accentDark[10]],
507
+ progressBarBg: [getOpacities(accent[9]).opacity25, getOpacities(accentDark[10]).opacity25],
508
+ // FIXME: lack of inverse scale usage, same values!
509
+ colorPickerSwatchBorder: [black[7], black[7]],
510
+ colorBorderRichTextMedia: [black[7], black[7]],
511
+ richTextTableBorder: [black[5], white[7]],
512
+
513
+ // Drag and drop
514
+ colorBgDropLine: [accent[8], accentDark[8]],
515
+
516
+ // Views
517
+ viewBg: [base[1], baseDark[1]],
518
+ viewSecondaryBg: [base[2], baseDark[2]],
519
+ viewHighlightBg: [accent[3], accentDark[3]],
520
+
521
+ // Board
522
+ boardBg: [base[1], baseDark[1]],
523
+ boardBgWithOpacity80: [getOpacities(base[1]).opacity80, getOpacities(baseDark[1]).opacity80],
524
+ boardAxisBgHover: [base[4], baseDark[4]],
525
+
526
+ // Grid
527
+ gridHeaderBgColor: [base[2], baseDark[3]],
528
+ gridHeaderHoverBgColor: [base[3], baseDark[4]],
529
+ gridHeaderTextColor: [base[10], baseDark[11]],
530
+ gridCellBgColor: [white[0], baseDark[2]],
531
+ gridCellBorderColor: [base[5], baseDark[6]],
532
+ gridDisabledCellBgColor: [base[2], baseDark[3]],
533
+ gridSelectedCellBgColor: [accent[3], accentDark[3]],
534
+ gridHighlightedCellBgColor: [accent[4], accentDark[5]],
535
+ gridSelectedCellBorderColor: [accent[6], accentDark[7]],
536
+ gridSelectedPinnedCellBorderColor: [accent[7], accentDark[7]],
537
+ gridDisabledSelectedCellBgColor: [accent[4], accentDark[5]],
538
+ gridActiveCellBorderColor: [accent[8], accentDark[9]],
539
+
540
+ //timeline
541
+ timelineEntityHandleColor: [accent[7], accentDark[7]],
542
+ timelineDependencyHoverBgColor: [accent[8], accentDark[8]],
543
+ timelineDependencyOverlapBgColor: [red[9], redDark[9]],
544
+ timelineDependencyOverlapHoverBgColor: [red[11], redDark[11]],
545
+ timelineCellBgColor: [base[1], baseDark[1]],
546
+ timelineCellWeekendBgColor: [base[2], baseDark[2]],
547
+ timelineCellTodayBgColor: [accent[4], accentDark[2]],
548
+ timelineCreateEntityPlaceholderBgColor: [getOpacities(base[11]).opacity20, baseDark[7]],
549
+
550
+ // #region buttons
551
+ // solid
552
+ colorBgButtonSolidAccentDefault: [accent[9], accentDark[9]],
553
+ colorBgButtonSolidAccentHover: [accent[11], accentDark[10]],
554
+ colorBgButtonSolidNeutralDefault: [base[12], baseDark[12]],
555
+ colorBgButtonSolidNeutralHover: [getOpacities(base[12]).opacity85, white[0]],
556
+ colorBgButtonSolidDestructiveDefault: [red[9], redDark[9]],
557
+ colorBgButtonSolidDestructiveHover: [red[11], redDark[10]],
558
+ colorTextButtonSolidAccent: [white[0], white[0]],
559
+ colorTextButtonSolidAccentActive: [getOpacities(white[0]).opacity80, getOpacities(white[0]).opacity80],
560
+ colorTextButtonSolidNeutral: [white[0], baseDark[2]],
561
+ colorTextButtonSolidNeutralActive: [white[0], getOpacities(baseDark[2]).opacity80],
562
+ colorTextButtonSolidDestructive: [white[0], white[0]],
563
+ colorTextButtonSolidDestructiveActive: [getOpacities(white[0]).opacity80, getOpacities(white[0]).opacity80],
564
+ colorIconButtonSolidAccent: [white[0], white[0]],
565
+ colorIconButtonSolidNeutral: [white[0], baseDark[8]],
566
+ colorIconButtonSolidDestructive: [white[0], white[0]],
567
+ // outline
568
+ colorBorderButtonOutlineAccentDefault: [accent[8], accentDark[8]],
569
+ colorBorderButtonOutlineNeutralDefault: [base[8], baseDark[7]],
570
+ colorBorderButtonOutlineDestructiveDefault: [red[7], redDark[7]],
571
+ colorBgButtonOutlineAccentDefault: [white[0], baseDark[1]],
572
+ colorBgButtonOutlineAccentHover: [accent[3], accentDark[3]],
573
+ colorBgButtonOutlineNeutralDefault: [white[0], baseDark[1]],
574
+ colorBgButtonOutlineNeutralHover: [base[4], baseDark[4]],
575
+ colorBgButtonOutlineDestructiveDefault: [white[0], baseDark[1]],
576
+ colorBgButtonOutlineDestructiveHover: [red[4], redDark[4]],
577
+ colorTextButtonOutlineAccent: [accent[11], accentDark[11]],
578
+ colorTextButtonOutlineAccentActive: [getOpacities(accent[11]).opacity80, getOpacities(accentDark[11]).opacity80],
579
+ colorTextButtonOutlineNeutral: [base[11], baseDark[11]],
580
+ colorTextButtonOutlineNeutralActive: [getOpacities(base[12]).opacity80, getOpacities(baseDark[12]).opacity80],
581
+ colorTextButtonOutlineDestructive: [red[11], redDark[11]],
582
+ colorTextButtonOutlineDestructiveActive: [getOpacities(red[11]).opacity80, getOpacities(redDark[11]).opacity80],
583
+ colorIconButtonOutlineAccent: [accent[11], accentDark[11]],
584
+ colorIconButtonOutlineNeutral: [base[11], baseDark[11]],
585
+ colorIconButtonOutlineDestructive: [red[11], redDark[11]],
586
+ // soft
587
+ colorBgButtonSoftAccentDefault: [accent[3], accentDark[4]],
588
+ colorBgButtonSoftAccentHover: [accent[5], accentDark[6]],
589
+ colorBgButtonSoftNeutralDefault: [base[3], baseDark[3]],
590
+ colorBgButtonSoftNeutralHover: [base[7], baseDark[7]],
591
+ colorBgButtonSoftDestructiveDefault: [red[4], redDark[4]],
592
+ colorBgButtonSoftDestructiveHover: [red[6], redDark[6]],
593
+ colorTextButtonSoftAccent: [accent[11], accentDark[11]],
594
+ colorTextButtonSoftAccentActive: [getOpacities(accent[11]).opacity80, getOpacities(accentDark[11]).opacity80],
595
+ colorTextButtonSoftNeutral: [base[11], baseDark[11]],
596
+ colorTextButtonSoftNeutralActive: [getOpacities(base[11]).opacity80, getOpacities(baseDark[11]).opacity80],
597
+ colorTextButtonSoftDestructive: [red[11], redDark[11]],
598
+ colorTextButtonSoftDestructiveActive: [getOpacities(red[11]).opacity80, getOpacities(redDark[11]).opacity80],
599
+ colorIconButtonSoftAccent: [accent[11], accentDark[11]],
600
+ colorIconButtonSoftNeutral: [base[11], baseDark[11]],
601
+ colorIconButtonSoftDestructive: [red[11], redDark[11]],
602
+ // ghost
603
+ colorBgButtonGhostAccentDefault: [transparent, transparent],
604
+ colorBgButtonGhostAccentHover: [getOpacities(accent[4]).opacity80, getOpacities(accentDark[4]).opacity80],
605
+ colorBgButtonGhostNeutralDefault: [transparent, transparent],
606
+ colorBgButtonGhostNeutralHover: [getOpacities(base[7]).opacity50, getOpacities(baseDark[6]).opacity80],
607
+ colorBgButtonGhostDestructiveDefault: [transparent, transparent],
608
+ colorBgButtonGhostDestructiveHover: [red[4], redDark[4]],
609
+ colorTextButtonGhostAccent: [accent[11], accentDark[11]],
610
+ colorTextButtonGhostAccentActive: [getOpacities(accent[11]).opacity80, getOpacities(accentDark[11]).opacity80],
611
+ colorTextButtonGhostNeutral: [base[11], baseDark[11]],
612
+ colorTextButtonGhostNeutralActive: [getOpacities(base[11]).opacity80, getOpacities(baseDark[11]).opacity80],
613
+ colorTextButtonGhostDestructive: [red[11], redDark[11]],
614
+ colorTextButtonGhostDestructiveActive: [getOpacities(red[11]).opacity80, getOpacities(redDark[11]).opacity80],
615
+ colorIconButtonGhostAccent: [accent[11], accentDark[11]],
616
+ colorIconButtonGhostNeutral: [base[11], baseDark[11]],
617
+ colorIconButtonGhostDestructive: [red[11], redDark[11]],
618
+ // #endregion
619
+
620
+ colorBorderAccentFocusRing: [getOpacities(accent[9]).opacity30, getOpacities(accent[9]).opacity30],
621
+ colorBorderNeutralFocusRing: [getOpacities(base[9]).opacity30, getOpacities(base[9]).opacity30],
622
+ colorBorderDestructiveFocusRing: [getOpacities(red[9]).opacity30, getOpacities(red[9]).opacity30],
623
+
624
+ colorBgReactionsDefault: [white[0], baseDark[2]],
625
+ colorBgReactionsHover: [base[3], baseDark[6]],
626
+ colorBorderReactionsHover: [base[8], baseDark[9]],
627
+ colorBgReactionsSelectedDefault: [accent[3], accentDark[8]],
628
+ colorBorderReactionsSelectedDefault: [accent[8], accentDark[8]],
629
+ // FIXME: lack of accentDark scale usage
630
+ colorBgReactionsSelectedHover: [accent[2], accent[10]],
631
+ colorBorderReactionsSelectedHover: [accent[9], accent[10]],
632
+ colorTextReactionsSelected: [accent[10], baseDark[12]],
633
+ colorBgToastDefault: [base[1], baseDark[1]],
634
+ colorBgDbTabHover: [base[3], baseDark[4]],
635
+ colorBgDbTabFocus: [base[6], baseDark[6]],
636
+ colorBgTabHover: [getOpacities(base[11]).opacity10, getOpacities(baseDark[11]).opacity10],
637
+
638
+ // Chat
639
+ colorBgMessageContainer: [black[3], baseDark[6]],
640
+ colorBgMessageContainerHover: [base[2], baseDark[3]],
641
+ colorBgEntityAvatarDefault: [accent[1], accentDark[1]],
642
+ colorBgEntityAvatarHover: [accent[3], accentDark[3]],
643
+ colorTextEntityAvatarDefault: [accent[8], accentDark[8]],
644
+ colorTextEntityAvatarHover: [accent[9], accentDark[9]],
645
+
646
+ // Text editor
647
+ colorBgEditorImageZoomed: [base[3], baseDark[6]],
648
+ colorMermaidPrimaryColor: [base[2], baseDark[8]],
649
+ colorMermaidPrimaryBorderColor: [base[9], baseDark[9]],
650
+ colorMermaidLineColor: [base[10], baseDark[9]],
651
+
652
+ //Whiteboard
653
+ instrumentsMenuBg: [getOpacities(white[0]).opacity100, getOpacities(baseDark[4]).opacity100],
654
+ instrumentsMenuShadow: [
655
+ `0px 0px 1px 0px ${getOpacities(base[11]).opacity20}, 0px 4px 6px 0px ${
656
+ getOpacities(base[11]).opacity5
657
+ }, 0px 3px 12px 0px ${getOpacities(base[11]).opacity10}`,
658
+ `0px 0px 1px 0px ${getOpacities(baseDark[6]).opacity100}, 0px 4px 6px 0px ${
659
+ getOpacities(baseDark[1]).opacity5
660
+ }, 0px 3px 12px 0px ${getOpacities(baseDark[1]).opacity15}`,
661
+ ],
662
+ commentBubbleBg: [white[0], baseDark[6]],
663
+ commentsPanelShadow: [
664
+ `0 0 0 1px ${getOpacities(base[10]).opacity10}, 0 2px 4px -4px ${getOpacities(base[10]).opacity20}`,
665
+ `0 0 0 1px ${getOpacities(baseDark[2]).opacity10}, 0 2px 4px -4px ${getOpacities(baseDark[2]).opacity20}`,
666
+ ],
667
+ searchFiltersBg: [base[1], baseDark[2]],
668
+ selectedColorBorder: [getOpacities(base[6]).opacity25, getOpacities(base[6]).opacity25],
669
+
670
+ // SegmentedControl
671
+ colorBgSegmentedControlDefault: [base[3], baseDark[1]],
672
+ colorBgSegmentedControlActive: [base[1], baseDark[6]],
673
+ colorBgSegmentedControlHover: [base[5], baseDark[4]],
674
+ colorBorderSegmentedControlDefault: [base[6], baseDark[7]],
675
+
676
+ // Chargebee info
677
+ colorBgChargebeeInfoBox: [base[3], baseDark[1]],
678
+
679
+ // Various found direct palette references
680
+ // FIXME: lack of redDark scale usage, same values!
681
+ newCommentHorizontalRulerColor: [red[8], red[8]],
682
+ colorBgErrorMessage: [red[8], red[8]],
683
+
684
+ // Logo/illustration specific colors
685
+ colorBorderLogoGrid: [base[4], baseDark[4]],
686
+ colorBorderLogoGridSubtle: [getOpacities(base[4]).opacity20, baseDark[4]],
687
+ colorBorderLogoGridMedium: [getOpacities(base[4]).opacity40, baseDark[4]],
688
+ colorStrokeLogoDashed: [base[6], baseDark[6]],
689
+ colorBgLogoCardTransparent: [white[0], baseDark[2]],
690
+ colorBgLogoCardDark: [base[8], baseDark[8]],
691
+ colorBgLogoCardMedium: [base[4], baseDark[4]],
692
+ } as const satisfies ThemeColorsDef;
693
+
694
+ const fns = {
695
+ getEnumBackground: {
696
+ light: (color: string) => a11yColor(getOpacities(color).opacity15, white[0], 1),
697
+ dark: (color: string) => a11yColor(getOpacities(color).opacity30, baseDark[0], 1.3),
698
+ },
699
+ getAppIconBackground: {
700
+ light: (color: string) => a11yColor(getOpacities(color).opacity15, white[0], 1),
701
+ dark: (color: string) => a11yColor(getOpacities(color).opacity30, baseDark[0], 1.3),
702
+ light2: (color: string) => a11yColor(getOpacities(color).opacity30, baseDark[0], 1.3),
703
+ },
704
+ getIconColor: {
705
+ light: (color: string) => a11yColor(getOpacities(color).opacity95, white[0], 3),
706
+ dark: (color: string) => a11yColor(getOpacities(color).opacity95, baseDark[0], 5),
707
+ },
708
+ getLinkedHighlightBackground: {
709
+ light: (color: string) => produceColor(color, [(c) => setAlpha(c, 0.3), (c) => setLuminanceChroma(c, 0.6)]),
710
+ dark: (color: string) => produceColor(color, [(c) => setAlpha(c, 0.4), (c) => setLuminanceChroma(c, 0.5)]),
711
+ },
712
+ getLinkedHighlightDecorationBackground: {
713
+ light: (color: string) => produceColor(color, [(c) => setAlpha(c, 0.9), (c) => setLuminanceChroma(c, 0.5)]),
714
+ dark: (color: string) =>
715
+ produceColor(color, [(c) => setAlpha(c, 0.9), (c) => setLuminanceChroma(c, 0.5), (c) => darkenChroma(c, 0.2)]),
716
+ },
717
+ } as const satisfies ThemeFnsDef;
718
+
719
+ return {colors, fns} as const;
720
+ }
721
+
722
+ export type ThemeDefs = ReturnType<typeof makeThemeDefs>;
723
+
724
+ type ThemeFns = {
725
+ [K in keyof ThemeDefs["fns"]]: ThemeDefs["fns"][K]["light"];
726
+ };
727
+
728
+ export function pickFns(fns: ThemeFnsDef, mode: ThemeMode) {
729
+ return Object.fromEntries(
730
+ Object.entries(fns).map(([key, modeFns]) => [key, modeFns[mode] ?? modeFns.light])
731
+ ) as ThemeFns;
732
+ }
733
+
734
+ type ThemeDefsColors = ThemeDefs["colors"];
735
+
736
+ type GetThemeColors<idx extends number> = {
737
+ [k in keyof ThemeDefsColors]: ThemeDefsColors[k][idx];
738
+ };
739
+
740
+ function pickColorsByIndex<I extends 0 | 1>(colors: ThemeDefsColors, idx: I): GetThemeColors<I> {
741
+ type ColorTuple = readonly [unknown, unknown];
742
+ return Object.fromEntries(
743
+ (Object.entries(colors) as [string, ColorTuple][]).map(([k, v]) => [k, v[idx]])
744
+ ) as GetThemeColors<I>;
745
+ }
746
+
747
+ export function pickLightColors(themeDefs: ThemeDefs) {
748
+ return pickColorsByIndex(themeDefs.colors, 0);
749
+ }
750
+
751
+ export function pickDarkColors(themeDefs: ThemeDefs) {
752
+ return pickColorsByIndex(themeDefs.colors, 1);
753
+ }
754
+
755
+ export function pickLight2Colors(themeDefs: ThemeDefs) {
756
+ return {
757
+ ...pickLightColors(themeDefs),
758
+ mode: "light2",
759
+ } as const;
760
+ }