@fibery/ui-kit 1.40.3 → 1.41.0

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