@fibery/ui-kit 1.40.4 → 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 (141) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/eslint.config.mjs +16 -0
  3. package/package.json +8 -7
  4. package/src/a11y-color.test.ts +5 -24
  5. package/src/actions-menu/actions-menu-item.tsx +6 -9
  6. package/src/actions-menu/context-actions-menu.tsx +8 -3
  7. package/src/ai/model.tsx +0 -1
  8. package/src/ai/temperature.tsx +0 -1
  9. package/src/animated-height-container.tsx +3 -3
  10. package/src/antd/index.tsx +3 -0
  11. package/src/antd/input.tsx +0 -1
  12. package/src/antd/styles.ts +9 -9
  13. package/src/app-icon-with-fallback.tsx +5 -5
  14. package/src/app-icon-wrapper.tsx +2 -3
  15. package/src/app-icon.tsx +3 -3
  16. package/src/avatar.tsx +3 -3
  17. package/src/button/base-button.tsx +0 -1
  18. package/src/button/make-button-colors.ts +2 -2
  19. package/src/checkbox.tsx +1 -1
  20. package/src/collapsible-section.tsx +11 -1
  21. package/src/color-utils.test.ts +15 -25
  22. package/src/color-utils.ts +43 -8
  23. package/src/command-menu/index.tsx +1 -0
  24. package/src/context-menu/index.tsx +5 -5
  25. package/src/date-picker/contexts.ts +2 -2
  26. package/src/date-picker/date-range-picker.tsx +3 -4
  27. package/src/date-picker/single-date-picker.tsx +147 -119
  28. package/src/date-picker/types.ts +4 -3
  29. package/src/day-select/iso-week-day-select.tsx +2 -2
  30. package/src/day-select/week-day-select.tsx +2 -2
  31. package/src/delayed.tsx +0 -1
  32. package/src/design-system/alpha.test.ts +59 -0
  33. package/src/design-system/alpha.ts +41 -0
  34. package/src/design-system/animation.ts +10 -0
  35. package/src/design-system/colors-css.test.ts +39 -0
  36. package/src/design-system/colors-css.ts +25 -0
  37. package/src/design-system/colors-js.test.ts +232 -0
  38. package/src/design-system/colors-js.ts +107 -0
  39. package/src/design-system/colors.test.ts +74 -0
  40. package/src/{design-system.colors.ts → design-system/colors.ts} +133 -134
  41. package/src/design-system/date.ts +3 -0
  42. package/src/design-system/layout.ts +106 -0
  43. package/src/design-system/theme.test.ts +94 -0
  44. package/src/design-system/theme.ts +93 -0
  45. package/src/design-system/typography.ts +179 -0
  46. package/src/design-system/vars.test.ts +1679 -0
  47. package/src/design-system/vars.ts +52 -0
  48. package/src/design-system.test.ts +46 -303
  49. package/src/design-system.ts +25 -545
  50. package/src/dropdown-menu/index.tsx +5 -5
  51. package/src/emoji-picker/icon-emoji-picker.tsx +1 -1
  52. package/src/fibermoji-placeholder.tsx +3 -3
  53. package/src/field-container.tsx +11 -2
  54. package/src/file-item/file-icon.tsx +3 -3
  55. package/src/file-item-2.tsx +4 -10
  56. package/src/file-item.tsx +0 -1
  57. package/src/icons/ast/ChatBubble.ts +8 -0
  58. package/src/icons/ast/ChatFloat.ts +8 -0
  59. package/src/icons/ast/ChatSidebar.ts +8 -0
  60. package/src/icons/ast/FileOther.ts +8 -0
  61. package/src/icons/ast/NoBorder.ts +8 -0
  62. package/src/icons/ast/NoFill.ts +8 -0
  63. package/src/icons/ast/index.tsx +6 -0
  64. package/src/icons/react/ChatBubble.tsx +13 -0
  65. package/src/icons/react/ChatFloat.tsx +13 -0
  66. package/src/icons/react/ChatSidebar.tsx +13 -0
  67. package/src/icons/react/FileOther.tsx +13 -0
  68. package/src/icons/react/NoBorder.tsx +13 -0
  69. package/src/icons/react/NoFill.tsx +13 -0
  70. package/src/icons/react/index.tsx +6 -0
  71. package/src/icons/svg/chat-bubble.svg +4 -0
  72. package/src/icons/svg/chat-float.svg +4 -0
  73. package/src/icons/svg/chat-sidebar.svg +4 -0
  74. package/src/icons/svg/file-other.svg +3 -0
  75. package/src/icons/svg/no-border.svg +17 -0
  76. package/src/icons/svg/no-fill.svg +4 -0
  77. package/src/images-gallery/images-gallery.tsx +8 -6
  78. package/src/images-gallery/slide-buttons.tsx +2 -2
  79. package/src/is-iOS.ts +0 -1
  80. package/src/is-in-popup.ts +2 -1
  81. package/src/lists/actions-menu-row-surface.tsx +4 -4
  82. package/src/loading-sausage.tsx +2 -2
  83. package/src/media-query-utils.ts +1 -2
  84. package/src/mobile-keyboard-aware-popup.tsx +2 -2
  85. package/src/modal-menu/modal-menu-content.tsx +2 -2
  86. package/src/number-input/decimal.js +9 -7
  87. package/src/number-input/{number-inline-input-with-autosize.tsx → number-input-inline-with-autosize.tsx} +20 -41
  88. package/src/number-input/number-input-inline.tsx +118 -0
  89. package/src/number-input/{index.test.js → number-input.test.tsx} +38 -43
  90. package/src/number-input/number-input.tsx +63 -121
  91. package/src/number-input/types.ts +19 -0
  92. package/src/number-input/utils.ts +61 -0
  93. package/src/online-users.tsx +2 -2
  94. package/src/palette-generator.test.ts +24 -281
  95. package/src/palette-generator.ts +39 -45
  96. package/src/palettes/_.ts +72 -0
  97. package/src/palettes/slate-arch.colors-snapshot.test.ts +1689 -0
  98. package/src/palettes/slate-arch.ts +188 -0
  99. package/src/palettes/slate-user.colors-snapshot.test.ts +1689 -0
  100. package/src/palettes/slate-user.ts +187 -0
  101. package/src/palettes/warm-arch.colors-snapshot.test.ts +1689 -0
  102. package/src/palettes/warm-arch.ts +222 -0
  103. package/src/palettes/warm-user.colors-snapshot.test.ts +1689 -0
  104. package/src/palettes/warm-user.ts +222 -0
  105. package/src/popover/get-element-ref.ts +28 -0
  106. package/src/popover/index.tsx +232 -333
  107. package/src/popover/{mobile-popup-context.tsx → mobile-popover-context.tsx} +7 -7
  108. package/src/popover/mobile-popover.tsx +169 -0
  109. package/src/popover/modifiers.tsx +2 -2
  110. package/src/popover/popup-stack-context.tsx +8 -9
  111. package/src/root-theme-provider.test.tsx +114 -19
  112. package/src/scale-generator.ts +31 -22
  113. package/src/select/components/menu-list-virtualized.tsx +5 -3
  114. package/src/select/index.tsx +6 -5
  115. package/src/select/select.tsx +36 -38
  116. package/src/select/util.ts +1 -1
  117. package/src/static-palettes.ts +221 -11
  118. package/src/thematic-controls.tsx +6 -6
  119. package/src/thematic-scales.tsx +15 -15
  120. package/src/thematic-state.ts +57 -20
  121. package/src/thematic.tsx +36 -32
  122. package/src/theme-provider.test.tsx +31 -19
  123. package/src/theme-provider.tsx +41 -38
  124. package/src/theme-settings.ts +66 -11
  125. package/src/theme-styles.ts +53 -8
  126. package/src/toast/toast.tsx +1 -2
  127. package/src/toggle.tsx +2 -2
  128. package/src/tooltip.tsx +4 -3
  129. package/src/type-badge.tsx +4 -11
  130. package/src/unit/styles.ts +0 -23
  131. package/src/use-is-phone.tsx +7 -2
  132. package/src/use-on-screen-keyboard-data.tsx +2 -2
  133. package/src/with-data.tsx +4 -3
  134. package/src/workflow-progress-icon.tsx +2 -2
  135. package/.eslintignore +0 -3
  136. package/.eslintrc +0 -14
  137. package/src/__mocks__/createInlineTheme.js +0 -3
  138. package/src/__snapshots__/design-system.test.ts.snap +0 -7265
  139. package/src/create-inline-theme.ts +0 -67
  140. package/src/number-input/index.js +0 -191
  141. package/src/palette.ts +0 -253
@@ -1,17 +1,10 @@
1
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;
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";
15
8
 
16
9
  export const cardTypeColors = [
17
10
  "#4A4A4A",
@@ -39,39 +32,6 @@ const swatches = {
39
32
  green: "#69AC5E",
40
33
  };
41
34
 
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
35
  type ThemeColorsDef = Record<
76
36
  string,
77
37
  | readonly [lightColor: string, darkColor: string]
@@ -93,6 +53,8 @@ type ThemeFnsDef = Record<
93
53
  export function makeThemeDefs({
94
54
  white,
95
55
  black,
56
+ whiteA,
57
+ blackA,
96
58
  base,
97
59
  baseDark,
98
60
  accent,
@@ -104,27 +66,25 @@ export function makeThemeDefs({
104
66
  yellow,
105
67
  yellowDark,
106
68
  }: ThemePalette) {
107
- const shades = getOpacities(black[0]);
69
+ const blackish = produceColor(black, (x) => set(x, "hsl.l", (x) => x + 5));
70
+
71
+ const shades = getOpacities(black);
108
72
  const separators = {
109
- ..._.mapValues(shades, (shade) => `0.5px solid ${shade}`),
73
+ ...mapValues(shades, (shade) => `0.5px solid ${shade}`),
110
74
  } as const;
111
75
 
112
- const lights = getOpacities(white[0]);
76
+ const lights = getOpacities(white);
113
77
  const inversedSeparators = {
114
- ..._.mapValues(lights, (light) => `0.5px solid ${light}`),
78
+ ...mapValues(lights, (light) => `0.5px solid ${light}`),
115
79
  } as const;
116
80
 
117
81
  const colors = {
118
82
  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
83
 
124
84
  // 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]}`],
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]}`],
128
88
 
129
89
  // Shadows and effects / Elevation
130
90
  shadow50: [
@@ -178,38 +138,39 @@ export function makeThemeDefs({
178
138
 
179
139
  // Rubbish dump
180
140
  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]],
141
+ whiteColor: [white, white],
142
+ blackColor: [black, black],
143
+ mainBg: [base[3], blackish],
144
+ panelBg: [white, baseDark[1]],
185
145
  panelContentBg: [base[2], baseDark[1]],
186
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]],
187
153
  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]],
154
+ // Other colors
155
+ pageContentBg: [white, baseDark[2]],
156
+ colorBgPopup: [white, baseDark[4]],
157
+ menuBg: [base[3], blackish],
158
+ menuTextColor: [base[12], baseDark[12]],
192
159
  menuItemHoverColor: [base[5], baseDark[6]],
193
160
  menuSelectedTextColor: [base[2], base[2]],
194
161
  menuIconColor: [getOpacities(base[12]).opacity70, getOpacities(baseDark[12]).opacity70],
195
162
 
196
163
  // Text, links colors
197
- textColor: [baseDark[5], base[6]],
164
+ textColor: [base[12], baseDark[12]],
198
165
  textSelectionColor: [getOpacities(accent[9]).opacity20, getOpacities(accentDark[9]).opacity40],
199
166
  accentTextColor: [base[10], baseDark[10]],
200
167
  disabledTextColor: [base[9], baseDark[9]],
201
168
  inversedTextColor: [base[3], baseDark[6]],
202
169
  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
- ],
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)"`],
213
174
  codeColor: [red[9], red[8]],
214
175
  codeBgColor: [base[3], baseDark[4]],
215
176
  codeBlockBgColor: [base[3], baseDark[4]],
@@ -236,7 +197,7 @@ export function makeThemeDefs({
236
197
  shortcutBorderColor: [getOpacities(base[8]).opacity50, getOpacities(baseDark[10]).opacity20],
237
198
 
238
199
  // Input
239
- inputBgColor: [white[0], baseDark[2]],
200
+ inputBgColor: [white, baseDark[2]],
240
201
  inputDisabledBgColor: [getOpacities(base[6]).opacity30, getOpacities(baseDark[6]).opacity30],
241
202
  inputDisabledBorderColor: [
242
203
  `0 0 0 1px ${getOpacities(base[6]).opacity20}`,
@@ -277,25 +238,25 @@ export function makeThemeDefs({
277
238
  colorBorderBlockQuote: [base[11], baseDark[11]],
278
239
 
279
240
  // Actions menu
280
- colorBgActionsMenu: [white[0], baseDark[3]],
281
- colorBgActionsMenuItemHover: [getOpacities(base[11]).opacity10, getOpacities(baseDark[11]).opacity10],
241
+ colorBgActionsMenu: [white, baseDark[3]],
242
+ colorBgActionsMenuItemHover: [base[4], baseDark[5]],
282
243
  colorBgActionsMenuItemSelected: [getOpacities(accent[4]).opacity80, getOpacities(accentDark[4]).opacity80],
283
244
  colorBgActionsMenuItemSelectedHover: [getOpacities(accent[5]).opacity80, getOpacities(accentDark[6]).opacity80],
284
245
  colorBgActionsMenuItemDangerHover: [getOpacities(red[9]).opacity10, getOpacities(redDark[10]).opacity10],
285
246
  colorBgActionsMenuItemDangerActive: [getOpacities(red[9]).opacity80, getOpacities(redDark[10]).opacity80],
286
- actionMenuBg: [white[0], baseDark[3]],
287
- actionMenuInnerBg: [white[0], baseDark[4]],
247
+ actionMenuBg: [white, baseDark[3]],
248
+ actionMenuInnerBg: [white, baseDark[4]],
288
249
  actionMenuHover: [base[4], baseDark[5]],
289
250
  actionMenuInnerHover: [base[4], getOpacities(baseDark[6]).opacity50],
290
- actionMenuButtonColor: [white[0], baseDark[2]],
251
+ actionMenuButtonColor: [white, baseDark[2]],
291
252
  actionMenuButtonHoverColor: [base[1], baseDark[3]],
292
253
  actionMenuButtonShadow: [
293
254
  `0 0 0 1px ${getOpacities(base[10]).opacity10}, 0 2px 4px -4px ${getOpacities(base[10]).opacity20}`,
294
255
  `0 0 0 1px ${getOpacities(baseDark[2]).opacity10}, 0 2px 4px -4px ${getOpacities(baseDark[2]).opacity20}`,
295
256
  ],
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],
257
+ actionMenuSeparatorColor: [getOpacities(black).opacity10, getOpacities(white).opacity15],
258
+ separatorColor: [getOpacities(black).opacity10, getOpacities(white).opacity10],
259
+ separatorColorDimmed: [getOpacities(black).opacity5, getOpacities(white).opacity5],
299
260
  separatorBreadcrumbsColor: [base[8], baseDark[8]],
300
261
  iconColor: [getOpacities(base[12]).opacity70, getOpacities(baseDark[12]).opacity70],
301
262
  appIconColor: [getOpacities(base[2]).opacity90, getOpacities(base[2]).opacity70],
@@ -327,27 +288,27 @@ export function makeThemeDefs({
327
288
  opacitySearchItemDone: [`${opacity.opacity40}`, `${opacity.opacity40}`],
328
289
  // Entity Box Style And States
329
290
  // Basic Entity Box State
330
- colorBgEntityBoxDefault: [white[0], baseDark[3]],
291
+ colorBgEntityBoxDefault: [white, baseDark[3]],
331
292
  shadowStrokeEntityBoxDefault: [`0 0 0 1px ${base[5]}`, `0 0 0 1px ${baseDark[5]}`],
332
293
  shadowEntityBoxDefault: [
333
294
  `0px 2px 4px 0px ${getOpacities(base[12]).opacity5}`,
334
295
  `0px 2px 4px 0px ${getOpacities(baseDark[1]).opacity5}`,
335
296
  ],
336
297
  // :hover
337
- colorBgEntityBoxDefaultHover: [white[0], baseDark[4]],
298
+ colorBgEntityBoxDefaultHover: [white, baseDark[4]],
338
299
  shadowEntityBoxDefaultHover: [
339
300
  `0px 4px 8px 0px ${getOpacities(base[12]).opacity10}`,
340
301
  `0px 4px 8px 0px ${getOpacities(baseDark[1]).opacity10}`,
341
302
  ],
342
303
  // :focus
343
- colorBgEntityBoxDefaultFocus: [white[0], baseDark[3]],
304
+ colorBgEntityBoxDefaultFocus: [white, baseDark[3]],
344
305
  colorOverlayEntityBoxDefaultFocus: [accent[9], accentDark[9]],
345
306
  shadowStrokeEntityBoxDefaultFocus: [
346
307
  `0 0 0 2px ${getOpacities(accent[9]).opacity40}`,
347
308
  `0 0 0 2px ${getOpacities(accentDark[9]).opacity40}`,
348
309
  ],
349
310
  // :focus:hover
350
- colorBgEntityBoxDefaultFocusHover: [white[0], baseDark[4]],
311
+ colorBgEntityBoxDefaultFocusHover: [white, baseDark[4]],
351
312
  colorOverlayEntityBoxDefaultFocusHover: [accent[9], accentDark[9]],
352
313
  shadowStrokeEntityBoxDefaultFocusHover: [
353
314
  `0 0 0 2px ${getOpacities(accent[9]).opacity60}`,
@@ -386,7 +347,7 @@ export function makeThemeDefs({
386
347
  // :drag
387
348
  opacityEntityBoxDisabledDrag: [`${opacity.opacity40}`, `${opacity.opacity40}`],
388
349
  // Entity Old
389
- entityCardBgColor: [white[0], baseDark[5]],
350
+ entityCardBgColor: [white, baseDark[5]],
390
351
  entityCardSelectedColor: [getOpacities(base[2]).opacity80, getOpacities(baseDark[6]).opacity50],
391
352
  entityCardHoverColor: [getOpacities(base[2]).opacity80, getOpacities(baseDark[6]).opacity50],
392
353
  entityCardDoneColor: [getOpacities(base[4]).opacity30, getOpacities(baseDark[5]).opacity30],
@@ -399,7 +360,7 @@ export function makeThemeDefs({
399
360
  `0 0 0 1px ${getOpacities(baseDark[2]).opacity10}, 0 2px 4px -4px ${getOpacities(baseDark[2]).opacity20}`,
400
361
  ],
401
362
  colorBgSegmentedControl: [getOpacities(base[5]).opacity80, getOpacities(baseDark[3]).opacity80],
402
- colorBgMenuHeaderAvatar: [white[0], baseDark[2]],
363
+ colorBgMenuHeaderAvatar: [white, baseDark[2]],
403
364
  shadowMenuHeaderAvatar: [
404
365
  `0px 1px 4px ${getOpacities(base[11]).opacity10}, 0 0 0 0.5px ${getOpacities(base[5]).opacity50}`,
405
366
  `0 0 0 1px ${getOpacities(baseDark[9]).opacity20}`,
@@ -409,7 +370,8 @@ export function makeThemeDefs({
409
370
  opacityMenuItemDragged: [`${opacity.opacity40}`, `${opacity.opacity40}`],
410
371
  colorBgMenuItemSelectedDragged: [accent[6], accentDark[6]],
411
372
  // Default
412
- colorTextMenuItem: [baseDark[5], getOpacities(baseDark[12]).opacity90],
373
+ colorTextMenuItem: [getOpacities(base[12]).opacity90, getOpacities(baseDark[12]).opacity90],
374
+
413
375
  colorBgMenuItem: [transparent, transparent],
414
376
  // :hover
415
377
  colorBgMenuItemHover: [base[5], baseDark[2]],
@@ -467,12 +429,12 @@ export function makeThemeDefs({
467
429
  warningBgColor: [getOpacities(yellow[6]).opacity60, getOpacities(yellowDark[8]).opacity60],
468
430
  warningButtonColor: [yellow[11], yellowDark[11]],
469
431
  infoBox: [getOpacities(yellow[4]).opacity50, getOpacities(yellowDark[9]).opacity20],
470
- appCardBgColor: [white[0], baseDark[2]],
432
+ appCardBgColor: [white, baseDark[2]],
471
433
  appCardHoverColor: [getOpacities(base[1]).opacity95, baseDark[2]],
472
434
  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]],
435
+ modalContentBg: [white, baseDark[3]],
436
+ progressIconBg: [blackA[7], whiteA[7]],
437
+ progressIconFill: [blackA[11], whiteA[11]],
476
438
  formBg: [base[2], baseDark[2]],
477
439
  formHeaderShadow: [
478
440
  `${getOpacities(base[10]).opacity10} 0px 0px 6px`,
@@ -481,7 +443,7 @@ export function makeThemeDefs({
481
443
  formEditorFieldBg: [base[3], baseDark[4]],
482
444
  filterGroup1Bg: [base[2], baseDark[6]],
483
445
  filterGroup2Bg: [base[3], baseDark[7]],
484
- filterGroupBorder: [black[3], white[3]],
446
+ filterGroupBorder: [blackA[3], whiteA[3]],
485
447
  colorBgNotificationHover: [base[3], baseDark[4]],
486
448
  colorBgNotificationSelected: [accent[3], accentDark[4]],
487
449
  colorBgNotificationSelectedHover: [accent[4], accentDark[6]],
@@ -490,25 +452,24 @@ export function makeThemeDefs({
490
452
  danger: [red[9], redDark[10]],
491
453
  active: [red[9], redDark[10]],
492
454
  warning: [yellow[9], yellowDark[8]],
493
- cardBg: [white[0], baseDark[6]],
494
- selectedImageBorder: [black[8], white[11]],
455
+ cardBg: [white, baseDark[6]],
456
+ selectedImageBorder: [blackA[8], whiteA[11]],
495
457
  transparent: [transparent, transparent],
496
458
  shades: [lights, shades],
497
459
  lights: [shades, lights],
498
460
  separators: [separators, inversedSeparators],
499
- inversedSeparators: [inversedSeparators, separators],
500
461
  // FIXME: lack of baseDark scale usage, same values!
501
462
  progressBg: [base[4], base[4]],
502
463
  progressText: [base[11], base[11]],
503
464
  progressFillBg: [base[11], base[11]],
504
- progressFillText: [white[0], white[0]],
465
+ progressFillText: [white, white],
505
466
  progressBarFillNeutral: [getOpacities(base[9]).opacity20, getOpacities(baseDark[9]).opacity20],
506
467
  progressBarFill: [accent[9], accentDark[10]],
507
468
  progressBarBg: [getOpacities(accent[9]).opacity25, getOpacities(accentDark[10]).opacity25],
508
469
  // 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]],
470
+ colorPickerSwatchBorder: [blackA[7], blackA[7]],
471
+ colorBorderRichTextMedia: [blackA[7], blackA[7]],
472
+ richTextTableBorder: [blackA[5], whiteA[7]],
512
473
 
513
474
  // Drag and drop
514
475
  colorBgDropLine: [accent[8], accentDark[8]],
@@ -527,7 +488,7 @@ export function makeThemeDefs({
527
488
  gridHeaderBgColor: [base[2], baseDark[3]],
528
489
  gridHeaderHoverBgColor: [base[3], baseDark[4]],
529
490
  gridHeaderTextColor: [base[10], baseDark[11]],
530
- gridCellBgColor: [white[0], baseDark[2]],
491
+ gridCellBgColor: [white, baseDark[2]],
531
492
  gridCellBorderColor: [base[5], baseDark[6]],
532
493
  gridDisabledCellBgColor: [base[2], baseDark[3]],
533
494
  gridSelectedCellBgColor: [accent[3], accentDark[3]],
@@ -552,27 +513,27 @@ export function makeThemeDefs({
552
513
  colorBgButtonSolidAccentDefault: [accent[9], accentDark[9]],
553
514
  colorBgButtonSolidAccentHover: [accent[11], accentDark[10]],
554
515
  colorBgButtonSolidNeutralDefault: [base[12], baseDark[12]],
555
- colorBgButtonSolidNeutralHover: [getOpacities(base[12]).opacity85, white[0]],
516
+ colorBgButtonSolidNeutralHover: [getOpacities(base[12]).opacity85, white],
556
517
  colorBgButtonSolidDestructiveDefault: [red[9], redDark[9]],
557
518
  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]],
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],
567
528
  // outline
568
529
  colorBorderButtonOutlineAccentDefault: [accent[8], accentDark[8]],
569
530
  colorBorderButtonOutlineNeutralDefault: [base[8], baseDark[7]],
570
531
  colorBorderButtonOutlineDestructiveDefault: [red[7], redDark[7]],
571
- colorBgButtonOutlineAccentDefault: [white[0], baseDark[1]],
532
+ colorBgButtonOutlineAccentDefault: [white, baseDark[1]],
572
533
  colorBgButtonOutlineAccentHover: [accent[3], accentDark[3]],
573
- colorBgButtonOutlineNeutralDefault: [white[0], baseDark[1]],
534
+ colorBgButtonOutlineNeutralDefault: [white, baseDark[1]],
574
535
  colorBgButtonOutlineNeutralHover: [base[4], baseDark[4]],
575
- colorBgButtonOutlineDestructiveDefault: [white[0], baseDark[1]],
536
+ colorBgButtonOutlineDestructiveDefault: [white, baseDark[1]],
576
537
  colorBgButtonOutlineDestructiveHover: [red[4], redDark[4]],
577
538
  colorTextButtonOutlineAccent: [accent[11], accentDark[11]],
578
539
  colorTextButtonOutlineAccentActive: [getOpacities(accent[11]).opacity80, getOpacities(accentDark[11]).opacity80],
@@ -621,7 +582,7 @@ export function makeThemeDefs({
621
582
  colorBorderNeutralFocusRing: [getOpacities(base[9]).opacity30, getOpacities(base[9]).opacity30],
622
583
  colorBorderDestructiveFocusRing: [getOpacities(red[9]).opacity30, getOpacities(red[9]).opacity30],
623
584
 
624
- colorBgReactionsDefault: [white[0], baseDark[2]],
585
+ colorBgReactionsDefault: [white, baseDark[2]],
625
586
  colorBgReactionsHover: [base[3], baseDark[6]],
626
587
  colorBorderReactionsHover: [base[8], baseDark[9]],
627
588
  colorBgReactionsSelectedDefault: [accent[3], accentDark[8]],
@@ -636,7 +597,7 @@ export function makeThemeDefs({
636
597
  colorBgTabHover: [getOpacities(base[11]).opacity10, getOpacities(baseDark[11]).opacity10],
637
598
 
638
599
  // Chat
639
- colorBgMessageContainer: [black[3], baseDark[6]],
600
+ colorBgMessageContainer: [blackA[3], baseDark[6]],
640
601
  colorBgMessageContainerHover: [base[2], baseDark[3]],
641
602
  colorBgEntityAvatarDefault: [accent[1], accentDark[1]],
642
603
  colorBgEntityAvatarHover: [accent[3], accentDark[3]],
@@ -650,7 +611,30 @@ export function makeThemeDefs({
650
611
  colorMermaidLineColor: [base[10], baseDark[9]],
651
612
 
652
613
  //Whiteboard
653
- instrumentsMenuBg: [getOpacities(white[0]).opacity100, getOpacities(baseDark[4]).opacity100],
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],
654
638
  instrumentsMenuShadow: [
655
639
  `0px 0px 1px 0px ${getOpacities(base[11]).opacity20}, 0px 4px 6px 0px ${
656
640
  getOpacities(base[11]).opacity5
@@ -659,7 +643,7 @@ export function makeThemeDefs({
659
643
  getOpacities(baseDark[1]).opacity5
660
644
  }, 0px 3px 12px 0px ${getOpacities(baseDark[1]).opacity15}`,
661
645
  ],
662
- commentBubbleBg: [white[0], baseDark[6]],
646
+ commentBubbleBg: [white, baseDark[6]],
663
647
  commentsPanelShadow: [
664
648
  `0 0 0 1px ${getOpacities(base[10]).opacity10}, 0 2px 4px -4px ${getOpacities(base[10]).opacity20}`,
665
649
  `0 0 0 1px ${getOpacities(baseDark[2]).opacity10}, 0 2px 4px -4px ${getOpacities(baseDark[2]).opacity20}`,
@@ -685,25 +669,28 @@ export function makeThemeDefs({
685
669
  colorBorderLogoGrid: [base[4], baseDark[4]],
686
670
  colorBorderLogoGridSubtle: [getOpacities(base[4]).opacity20, baseDark[4]],
687
671
  colorBorderLogoGridMedium: [getOpacities(base[4]).opacity40, baseDark[4]],
688
- colorStrokeLogoDashed: [base[6], baseDark[6]],
689
- colorBgLogoCardTransparent: [white[0], baseDark[2]],
672
+ colorStrokeLogoDashed: [base[6], baseDark[8]],
673
+ colorBgLogoCardTransparent: [white, baseDark[2]],
690
674
  colorBgLogoCardDark: [base[8], baseDark[8]],
691
675
  colorBgLogoCardMedium: [base[4], baseDark[4]],
676
+
677
+ // Preloader / chrome
678
+ scrollbar: [getOpacities(base[9]).opacity50, getOpacities(baseDark[7]).opacity50],
692
679
  } as const satisfies ThemeColorsDef;
693
680
 
694
681
  const fns = {
695
682
  getEnumBackground: {
696
- light: (color: string) => a11yColor(getOpacities(color).opacity15, white[0], 1),
697
- dark: (color: string) => a11yColor(getOpacities(color).opacity30, baseDark[0], 1.3),
683
+ light: (color: string) => a11yColor(getOpacities(color).opacity15, white, 1),
684
+ dark: (color: string) => a11yColor(getOpacities(color).opacity30, blackish, 1.3),
698
685
  },
699
686
  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),
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),
703
690
  },
704
691
  getIconColor: {
705
- light: (color: string) => a11yColor(getOpacities(color).opacity95, white[0], 3),
706
- dark: (color: string) => a11yColor(getOpacities(color).opacity95, baseDark[0], 5),
692
+ light: (color: string) => a11yColor(getOpacities(color).opacity95, white, 3),
693
+ dark: (color: string) => a11yColor(getOpacities(color).opacity95, blackish, 5),
707
694
  },
708
695
  getLinkedHighlightBackground: {
709
696
  light: (color: string) => produceColor(color, [(c) => setAlpha(c, 0.3), (c) => setLuminanceChroma(c, 0.6)]),
@@ -744,17 +731,29 @@ function pickColorsByIndex<I extends 0 | 1>(colors: ThemeDefsColors, idx: I): Ge
744
731
  ) as GetThemeColors<I>;
745
732
  }
746
733
 
747
- export function pickLightColors(themeDefs: ThemeDefs) {
734
+ function pickLightColors(themeDefs: ThemeDefs) {
748
735
  return pickColorsByIndex(themeDefs.colors, 0);
749
736
  }
750
737
 
751
- export function pickDarkColors(themeDefs: ThemeDefs) {
738
+ function pickDarkColors(themeDefs: ThemeDefs) {
752
739
  return pickColorsByIndex(themeDefs.colors, 1);
753
740
  }
754
741
 
755
- export function pickLight2Colors(themeDefs: ThemeDefs) {
742
+ function pickLight2Colors(themeDefs: ThemeDefs) {
756
743
  return {
757
744
  ...pickLightColors(themeDefs),
758
745
  mode: "light2",
759
746
  } as const;
760
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>;
@@ -0,0 +1,3 @@
1
+ export const dateFormat = "MMM D, YYYY";
2
+ export const dateTimeFormat = "MMM D, YYYY HH:mm";
3
+ export const timeFormat = "HH:mm";
@@ -0,0 +1,106 @@
1
+ export const iconSize = 20;
2
+ export const viewBoxSize = "0 0 20 20";
3
+
4
+ export const minPanelWidth = 490;
5
+
6
+ /** Token for nested items spacing in nested trees */
7
+ export const spaceNestedTreeLevel = 12;
8
+ export const spaceNestedTreeInterval = 0;
9
+
10
+ export const space = {
11
+ spaceAuto: "auto",
12
+ s0: 0,
13
+ s1: 1,
14
+ s2: 2,
15
+ s3: 3,
16
+ s4: 4,
17
+ s5: 5,
18
+ s6: 6,
19
+ s8: 8,
20
+ s10: 10,
21
+ s12: 12,
22
+ s14: 14,
23
+ s16: 16,
24
+ s18: 18,
25
+ s20: 20,
26
+ s24: 24,
27
+ s28: 28,
28
+ s32: 32,
29
+ s36: 36,
30
+ s40: 40,
31
+ s44: 44,
32
+ s48: 48,
33
+ s56: 56,
34
+ s60: 60,
35
+ s64: 64,
36
+ s80: 80,
37
+ s96: 96,
38
+ s112: 112,
39
+ s128: 128,
40
+ } as const;
41
+
42
+ export const layout = {
43
+ logoSize: 18,
44
+ menuDefaultWidth: 243,
45
+ fiberyAiSidebarDefaultWidth: 420,
46
+ fiberyAiSidebarMaxWidth: 920,
47
+ desktopToolbarHeight: 32,
48
+ desktopMenuMinWidth: 240,
49
+ collapsedMenuMinWidth: 47,
50
+ menuMinWidth: 284,
51
+ menuMaxWidth: 480,
52
+ menuItemMinWidth: 80,
53
+ menuGroupHeaderIndent: 28, // I'm ok
54
+ menuItemLevelIndent: 24,
55
+ listItemHeight: 38,
56
+ mobileListItemHeight: 44,
57
+ itemHeight: 36,
58
+ itemWithSubtitleHeight: 52,
59
+ groupTitleHeight: 30,
60
+ enumItemHeight: 32,
61
+ menuItemHeight: 32,
62
+ mobileMenuItemHeight: 44,
63
+ newMenuItemHeight: 28, // I'm ok
64
+ mobileSidebarMenuItemHeight: 44,
65
+ newMenuIconSize: 18,
66
+ mobileSidebarIconSize: 20,
67
+ viewHeaderHeight: space.s12 * 7,
68
+ viewHeaderCompactHeight: 52,
69
+ columnMinWidth: 240,
70
+ columnWidths: {compact: 200, default: 240, list: 280, full: 320},
71
+ objectEditorMinWidth: 480,
72
+ typeEditorWidth: "30vw",
73
+ typeEditorMinWidth: 480,
74
+ viewSetupWidth: "30vw",
75
+ viewSetupMinWidth: 380,
76
+ inputHeight: 36, //TODO: merge input and item height?
77
+ timelineToolbarHeight: 48,
78
+ timelineLineHeight: 40,
79
+ timelineItemHeight: 32,
80
+ timelineGroupPadding: 0,
81
+ timelineHeaderHeight: 48,
82
+ calendarEventHeight: 30,
83
+ calendarHeaderHeight: 30,
84
+ calendarToolbarHeight: 48,
85
+ checkboxSize: 15,
86
+ fakeBoardWidth: 260,
87
+ fakeBoardHeight: 160,
88
+ inlineInputHeight: 32,
89
+ menuHeight: 32,
90
+ popupTopMargin: 48,
91
+ unitHeight: 18,
92
+ } as const;
93
+
94
+ export const border = {
95
+ radius0: 0,
96
+ radius1: 1,
97
+ radius2: 2,
98
+ radius4: 4,
99
+ radius5: 5,
100
+ radius6: 6,
101
+ radius8: 8,
102
+ radius10: 10,
103
+ radius12: 12,
104
+ radius16: 16,
105
+ radius9999: 9999,
106
+ } as const;