@fibery/ui-kit 1.17.0 → 1.18.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.
- package/index.ts +1 -1
- package/package.json +26 -21
- package/src/Button/actions-button.tsx +2 -2
- package/src/Button/button-base.tsx +2 -2
- package/src/Button/button-group.tsx +1 -1
- package/src/Button/button.tsx +3 -3
- package/src/Button/icon-button.tsx +1 -0
- package/src/Select/custom-select-partials/clear-indicator.tsx +22 -0
- package/src/Select/custom-select-partials/drop-down-indicator.tsx +26 -0
- package/src/Select/custom-select-partials/group-heading.tsx +54 -0
- package/src/Select/custom-select-partials/menu.tsx +25 -0
- package/src/Select/custom-select-partials/no-option-message.tsx +10 -0
- package/src/Select/custom-select-partials/option.tsx +92 -0
- package/src/Select/index.tsx +18 -47
- package/src/Select/select-in-popover.tsx +2 -2
- package/src/Select/styles.ts +11 -53
- package/src/antd/styles.ts +1 -1
- package/src/back-button.tsx +3 -0
- package/src/create-inline-theme.ts +2 -0
- package/src/design-system.ts +961 -0
- package/src/emoji-picker/app-icon-picker.tsx +2 -2
- package/src/emoji-picker/emoji-picker-content-with-color.tsx +4 -4
- package/src/emoji-picker/emoji-picker.tsx +11 -5
- package/src/emoji-picker/icon-emoji-picker.tsx +2 -2
- package/src/emoji-picker/primitives/category.tsx +2 -2
- package/src/emoji-picker/primitives/content.tsx +3 -2
- package/src/emoji-picker/primitives/emoji.tsx +6 -3
- package/src/emoji-picker/primitives/footer.tsx +1 -1
- package/src/emoji-picker/primitives/header.tsx +1 -1
- package/src/emoji-picker/primitives/layout.ts +1 -1
- package/src/emoji-picker/primitives/search.tsx +1 -1
- package/src/emoji-picker/primitives/skin-tone.tsx +1 -1
- package/src/emoji-picker/stores/lazy-emoji-data-store.tsx +3 -3
- package/src/emoji-picker/stores/lazy-icon-data-store.tsx +1 -1
- package/src/error-alert.tsx +2 -2
- package/src/form-field-loader.tsx +1 -1
- package/src/icons/Icon.tsx +4 -4
- package/src/icons/ast/Activity.ts +1 -1
- package/src/icons/ast/BellFilled.ts +8 -0
- package/src/icons/ast/BellOff.ts +8 -0
- package/src/icons/ast/BellRinging.ts +8 -0
- package/src/icons/ast/Export.ts +8 -0
- package/src/icons/ast/Favorites.ts +1 -1
- package/src/icons/ast/FavoritesChecked.ts +1 -1
- package/src/icons/ast/FavoritesOff.ts +8 -0
- package/src/icons/ast/GlobeSimple.ts +8 -0
- package/src/icons/ast/Import.ts +8 -0
- package/src/icons/ast/Lab.ts +8 -0
- package/src/icons/ast/Link.ts +8 -0
- package/src/icons/ast/Network.ts +8 -0
- package/src/icons/ast/Pencil.ts +8 -0
- package/src/icons/ast/People.ts +8 -0
- package/src/icons/ast/RicheditorLinkCreate.ts +1 -1
- package/src/icons/ast/RicheditorOpenLink.ts +1 -1
- package/src/icons/ast/RicheditorUnlink.ts +1 -1
- package/src/icons/ast/ShieldKeyhole.ts +8 -0
- package/src/icons/ast/Terminal.ts +8 -0
- package/src/icons/ast/TypeUrl.ts +1 -1
- package/src/icons/ast/index.tsx +14 -4
- package/src/icons/{getIconContainerStyle.tsx → get-icon-container-style.tsx} +1 -1
- package/src/icons/react/BellFilled.tsx +12 -0
- package/src/icons/react/BellOff.tsx +12 -0
- package/src/icons/react/BellRinging.tsx +12 -0
- package/src/icons/react/Export.tsx +12 -0
- package/src/icons/react/FavoritesOff.tsx +12 -0
- package/src/icons/react/GlobeSimple.tsx +12 -0
- package/src/icons/react/Import.tsx +12 -0
- package/src/icons/react/Lab.tsx +12 -0
- package/src/icons/react/Link.tsx +12 -0
- package/src/icons/react/Network.tsx +12 -0
- package/src/icons/react/Pencil.tsx +12 -0
- package/src/icons/react/People.tsx +12 -0
- package/src/icons/react/ShieldKeyhole.tsx +12 -0
- package/src/icons/react/Terminal.tsx +12 -0
- package/src/icons/react/index.tsx +14 -4
- package/src/{Item.tsx → item.tsx} +1 -1
- package/src/loaders.tsx +19 -6
- package/src/loading-sausage.tsx +3 -1
- package/src/{ThemeProvider.tsx → theme-provider.tsx} +11 -1
- package/src/theme-styles.ts +2 -5
- package/src/toast/index.tsx +47 -0
- package/src/toast/primitives.tsx +140 -0
- package/src/tooltip.tsx +3 -3
- package/src/BackButton.tsx +0 -3
- package/src/Select/components.tsx +0 -90
- package/src/designSystem.ts +0 -951
- package/src/icons/ast/AppTemplatesOneColor.ts +0 -8
- package/src/icons/ast/CopyUrl.ts +0 -8
- package/src/icons/ast/FavoritesMenu.ts +0 -8
- package/src/icons/ast/Markdown.ts +0 -8
- package/src/icons/react/AppTemplatesOneColor.tsx +0 -12
- package/src/icons/react/CopyUrl.tsx +0 -12
- package/src/icons/react/FavoritesMenu.tsx +0 -12
- package/src/icons/react/Markdown.tsx +0 -12
- /package/src/Button/{AddButton.tsx → add-button.tsx} +0 -0
- /package/src/Button/{BackButton.tsx → back-button.tsx} +0 -0
- /package/src/{Button.tsx → button.tsx} +0 -0
- /package/src/icons/{generateIconFromAst.ts → generate-icon-from-ast.ts} +0 -0
- /package/src/icons/{IconAsPaths.ts → get-paths.ts} +0 -0
- /package/src/icons/{getShiftStyle.ts → get-shift-style.ts} +0 -0
- /package/src/{Pallete.ts → pallete.ts} +0 -0
package/src/designSystem.ts
DELETED
|
@@ -1,951 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
|
-
import chroma from "chroma-js";
|
|
3
|
-
import {ThemeMode} from "./theme-settings";
|
|
4
|
-
import ColorHash from "color-hash";
|
|
5
|
-
import {
|
|
6
|
-
blackA,
|
|
7
|
-
blue,
|
|
8
|
-
blueDark,
|
|
9
|
-
indigo,
|
|
10
|
-
indigoDark,
|
|
11
|
-
red,
|
|
12
|
-
redDark,
|
|
13
|
-
slate,
|
|
14
|
-
slateDark,
|
|
15
|
-
whiteA,
|
|
16
|
-
yellow,
|
|
17
|
-
yellowDark,
|
|
18
|
-
} from "./Pallete";
|
|
19
|
-
import _ from "lodash";
|
|
20
|
-
import {createInlineTheme as createInlineStyles, varPrefix} from "./create-inline-theme";
|
|
21
|
-
import {a11yColor} from "./a11y-color";
|
|
22
|
-
|
|
23
|
-
export const typeSizes = [28, 24, 18, 16, 14, 12, 10, 8] as const;
|
|
24
|
-
|
|
25
|
-
export const fontWeight = {
|
|
26
|
-
light: 300,
|
|
27
|
-
regular: 400,
|
|
28
|
-
medium: 500,
|
|
29
|
-
semibold: 600,
|
|
30
|
-
bold: 700,
|
|
31
|
-
} as const;
|
|
32
|
-
|
|
33
|
-
const transparent = "rgba(255, 255, 255, 0)";
|
|
34
|
-
|
|
35
|
-
export const opacity = {
|
|
36
|
-
opacity100: 1,
|
|
37
|
-
opacity95: 0.95,
|
|
38
|
-
opacity90: 0.9,
|
|
39
|
-
opacity85: 0.85,
|
|
40
|
-
opacity80: 0.8,
|
|
41
|
-
opacity75: 0.75,
|
|
42
|
-
opacity70: 0.7,
|
|
43
|
-
opacity65: 0.65,
|
|
44
|
-
opacity60: 0.6,
|
|
45
|
-
opacity55: 0.55,
|
|
46
|
-
opacity50: 0.5,
|
|
47
|
-
opacity45: 0.45,
|
|
48
|
-
opacity40: 0.4,
|
|
49
|
-
opacity35: 0.35,
|
|
50
|
-
opacity30: 0.3,
|
|
51
|
-
opacity25: 0.25,
|
|
52
|
-
opacity20: 0.2,
|
|
53
|
-
opacity15: 0.15,
|
|
54
|
-
opacity10: 0.1,
|
|
55
|
-
opacity5: 0.05,
|
|
56
|
-
opacity0: 0,
|
|
57
|
-
} as const;
|
|
58
|
-
|
|
59
|
-
// switch to chroma.valid once we start using 2.0.1
|
|
60
|
-
const makeChromaColor = (color: string) => {
|
|
61
|
-
try {
|
|
62
|
-
return chroma(color);
|
|
63
|
-
} catch (e) {
|
|
64
|
-
return chroma(brandColors.blue);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const getOpacities = _.memoize((color: string) =>
|
|
69
|
-
_.mapValues(opacity, (opacity) => {
|
|
70
|
-
if (color === transparent) {
|
|
71
|
-
return transparent;
|
|
72
|
-
}
|
|
73
|
-
return makeChromaColor(color).alpha(opacity).css();
|
|
74
|
-
})
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
const shades = getOpacities("#000000");
|
|
78
|
-
const lights = getOpacities("#FFFFFF");
|
|
79
|
-
|
|
80
|
-
export const separators = {
|
|
81
|
-
..._.mapValues(shades, (shade) => `1px solid ${shade}`),
|
|
82
|
-
} as const;
|
|
83
|
-
|
|
84
|
-
export const inversedSeparators = {
|
|
85
|
-
..._.mapValues(lights, (light) => `1px solid ${light}`),
|
|
86
|
-
} as const;
|
|
87
|
-
|
|
88
|
-
export const fontFamily =
|
|
89
|
-
"ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', 'Arial', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'";
|
|
90
|
-
|
|
91
|
-
const stateColors = {
|
|
92
|
-
success: "rgba(8, 189, 159, 1)",
|
|
93
|
-
error: "rgba(234, 105, 63, 1)",
|
|
94
|
-
progress: "rgba(74, 126, 244, 1)",
|
|
95
|
-
canceled: "rgba(233, 163, 76, 1)",
|
|
96
|
-
unknown: "rgba(147, 157, 168, 1)",
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const brandColors = {
|
|
100
|
-
red: "#FF5400",
|
|
101
|
-
green: "#08BD9F",
|
|
102
|
-
blue: "#4568FB",
|
|
103
|
-
} as const;
|
|
104
|
-
|
|
105
|
-
export const getDarkenColor = _.memoize((color: string): string => {
|
|
106
|
-
return makeChromaColor(color).darken(0.6).css();
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
const lightColors = {
|
|
110
|
-
mode: "light",
|
|
111
|
-
brandColors,
|
|
112
|
-
stateColors,
|
|
113
|
-
primaryBlue: indigo.indigo10,
|
|
114
|
-
whiteColor: whiteA.whiteA0,
|
|
115
|
-
blackColor: blackA.blackA0,
|
|
116
|
-
mainBg: slate.slate2,
|
|
117
|
-
panelBg: whiteA.whiteA0,
|
|
118
|
-
panelContentBg: slate.slate2,
|
|
119
|
-
pageBg: whiteA.whiteA0,
|
|
120
|
-
pageContentBg: whiteA.whiteA0,
|
|
121
|
-
sidebarBg: whiteA.whiteA0,
|
|
122
|
-
sidebarShadow: `-3px 0px 10px 0px ${getOpacities(slate.slate10).opacity10}`,
|
|
123
|
-
menuBg: slate.slate2,
|
|
124
|
-
menuTextColor: slate.slate12,
|
|
125
|
-
menuItemHoverColor: slate.slate4,
|
|
126
|
-
menuItemSettingsHoverBg: slate.slate5,
|
|
127
|
-
menuSelectedTextColor: slate.slate2,
|
|
128
|
-
menuFooterColor: getOpacities(whiteA.whiteA0).opacity20,
|
|
129
|
-
menuFooterHoverColor: getOpacities(whiteA.whiteA0).opacity60,
|
|
130
|
-
menuIconColor: getOpacities(slate.slate10).opacity90,
|
|
131
|
-
menuSelectedIconColor: getOpacities(slate.slate1).opacity90,
|
|
132
|
-
textColor: slateDark.slate3,
|
|
133
|
-
textSelectionColor: getOpacities(blue.blue10).opacity20,
|
|
134
|
-
accentTextColor: slate.slate10,
|
|
135
|
-
disabledTextColor: slate.slate9,
|
|
136
|
-
inversedTextColor: slate.slate3,
|
|
137
|
-
linkColor: indigoDark.indigo10,
|
|
138
|
-
linkBorder: `1px solid ${getOpacities(indigoDark.indigo10).opacity20}`,
|
|
139
|
-
linkHoverColor: indigo.indigo10,
|
|
140
|
-
linkBorderHover: `1px solid ${getOpacities(indigo.indigo10).opacity80}`,
|
|
141
|
-
codeColor: red.red9,
|
|
142
|
-
codeBgColor: slate.slate3,
|
|
143
|
-
codeBlockBgColor: slate.slate3,
|
|
144
|
-
entityNodeColor: slateDark.slate3,
|
|
145
|
-
entityNodeBorder: `1px solid ${getOpacities(slateDark.slate3).opacity30}`,
|
|
146
|
-
entityNodeHoverColor: slateDark.slate7,
|
|
147
|
-
entityNodeBorderHover: `1px solid ${getOpacities(slate.slate11).opacity80}`,
|
|
148
|
-
entityNodeBgColor: slate.slate2,
|
|
149
|
-
shortcutTextColor: slate.slate9,
|
|
150
|
-
shortcutBorderColor: `1px solid ${getOpacities(slate.slate8).opacity50}`,
|
|
151
|
-
inputBgColor: whiteA.whiteA0,
|
|
152
|
-
inputDisabledBgColor: getOpacities(slate.slate6).opacity30,
|
|
153
|
-
inputDisabledBorderColor: `0 0 0 1px ${getOpacities(slate.slate6).opacity20}`,
|
|
154
|
-
inputCopyBgColor: slate.slate3,
|
|
155
|
-
inputBorderColor: `0 0 0 1px ${getOpacities(slate.slate6).opacity70}`,
|
|
156
|
-
inputBorderHoverColor: `0 0 0 1px ${getOpacities(slate.slate7).opacity100}`,
|
|
157
|
-
inputBorderFocusColor: `0 0 0 1px ${getOpacities(slate.slate8).opacity100}`,
|
|
158
|
-
inputBorderBlendMode: "multiply",
|
|
159
|
-
inputPlaceholderTextColor: slate.slate9,
|
|
160
|
-
inputErrorBorderColor: `0 0 0 1px ${red.red11}`,
|
|
161
|
-
inputErrorBorderHoverColor: `0 0 0 1px ${getOpacities(red.red11).opacity40}`,
|
|
162
|
-
inputErrorBorderFocusColor: `0 0 0 1px ${getOpacities(red.red11).opacity25}`,
|
|
163
|
-
inputErrorBorderFocusShadow: `0 0 0 3px ${getOpacities(red.red11).opacity25}`,
|
|
164
|
-
buttonPrimaryColor: indigo.indigo10,
|
|
165
|
-
buttonColor: slate.slate10,
|
|
166
|
-
buttonPrimaryTextColor: slate.slate2,
|
|
167
|
-
checkboxColor: slate.slate10,
|
|
168
|
-
actionMenuBg: whiteA.whiteA0,
|
|
169
|
-
actionMenuInnerBg: whiteA.whiteA0,
|
|
170
|
-
actionMenuShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 12px 16px -4px ${
|
|
171
|
-
getOpacities(slate.slate10).opacity30
|
|
172
|
-
}`,
|
|
173
|
-
actionMenuHover: slate.slate4,
|
|
174
|
-
actionMenuInnerHover: slate.slate4,
|
|
175
|
-
actionMenuButtonColor: whiteA.whiteA0,
|
|
176
|
-
actionMenuButtonHoverColor: slate.slate1,
|
|
177
|
-
actionMenuButtonShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
178
|
-
getOpacities(slate.slate10).opacity20
|
|
179
|
-
}`,
|
|
180
|
-
actionMenuButtonShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 6px 8px -4px ${
|
|
181
|
-
getOpacities(slate.slate10).opacity30
|
|
182
|
-
}`,
|
|
183
|
-
separatorColor: getOpacities(slate.slate4).opacity50,
|
|
184
|
-
separatorBreadcrumbsColor: slate.slate8,
|
|
185
|
-
iconColor: slate.slate10,
|
|
186
|
-
appIconColor: getOpacities(slate.slate2).opacity90,
|
|
187
|
-
appIconBgColor: getOpacities(slate.slate1).opacity90,
|
|
188
|
-
mentionBgColor: slate.slate3,
|
|
189
|
-
entityCardBgColor: whiteA.whiteA0,
|
|
190
|
-
entityCardSelectedColor: getOpacities(slate.slate2).opacity80,
|
|
191
|
-
entityCardHoverColor: getOpacities(slate.slate2).opacity80,
|
|
192
|
-
entityCardDoneColor: getOpacities(slate.slate4).opacity30,
|
|
193
|
-
entityCardShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
194
|
-
getOpacities(slate.slate10).opacity20
|
|
195
|
-
}`,
|
|
196
|
-
entityCardShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
197
|
-
getOpacities(slate.slate10).opacity20
|
|
198
|
-
}`,
|
|
199
|
-
allowedDropColor: getOpacities(slate.slate3).opacity80,
|
|
200
|
-
relationViewBgColor: slate.slate2,
|
|
201
|
-
unitBg: slate.slate3,
|
|
202
|
-
unitBgHover: slate.slate4,
|
|
203
|
-
badgeBgColor: getOpacities(slate.slate10).opacity20,
|
|
204
|
-
tooltipBgColor: slateDark.slate5,
|
|
205
|
-
todayMarkerColor: red.red8,
|
|
206
|
-
viewBgOverlayColor: getOpacities(slate.slate8).opacity20,
|
|
207
|
-
floatEditorMenuBg: slate.slate1,
|
|
208
|
-
floatEditorActiveColor: indigoDark.indigo10,
|
|
209
|
-
planBadgeBgColor: yellow.yellow10,
|
|
210
|
-
commentColor: getOpacities(yellow.yellow6).opacity60,
|
|
211
|
-
cellBackgroundColor: slate.slate2,
|
|
212
|
-
cellBackgroundHoverColor: getOpacities(slate.slate6).opacity30,
|
|
213
|
-
cellBorderColor: getOpacities(slate.slate8).opacity50,
|
|
214
|
-
cellPinnedBorderColor: getOpacities(slate.slate8).opacity70,
|
|
215
|
-
tableRowWarningColor: getOpacities(yellow.yellow6).opacity60,
|
|
216
|
-
errorBgColor: getOpacities(red.red9).opacity20,
|
|
217
|
-
errorTextColor: red.red11,
|
|
218
|
-
errorButtonColor: red.red9,
|
|
219
|
-
warningBgColor: getOpacities(yellow.yellow6).opacity60,
|
|
220
|
-
warningButtonColor: yellow.yellow11,
|
|
221
|
-
infoBox: getOpacities(yellow.yellow4).opacity50,
|
|
222
|
-
appCardBgColor: whiteA.whiteA0,
|
|
223
|
-
appCardHoverColor: getOpacities(slate.slate1).opacity95,
|
|
224
|
-
appCardShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
225
|
-
getOpacities(slate.slate10).opacity20
|
|
226
|
-
}`,
|
|
227
|
-
appCardShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 6px 8px -4px ${
|
|
228
|
-
getOpacities(slate.slate10).opacity30
|
|
229
|
-
}`,
|
|
230
|
-
modalBg: getOpacities(slate.slate11).opacity20,
|
|
231
|
-
modalShadow: `${getOpacities(slate.slate10).opacity20} 0px 16px 70px`,
|
|
232
|
-
modalContentBg: whiteA.whiteA0,
|
|
233
|
-
progressIconBg: getOpacities(slate.slate12).opacity10,
|
|
234
|
-
progressIconFill: getOpacities(slate.slate12).opacity80,
|
|
235
|
-
progressIconDoneBg: getOpacities(slate.slate12).opacity80,
|
|
236
|
-
progressIconDoneFill: getOpacities(slate.slate1).opacity95,
|
|
237
|
-
instrumentsMenuBg: getOpacities(whiteA.whiteA0).opacity85,
|
|
238
|
-
instrumentsMenuShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
239
|
-
getOpacities(slate.slate10).opacity20
|
|
240
|
-
}`,
|
|
241
|
-
selectedColorBorder: getOpacities(slate.slate6).opacity50,
|
|
242
|
-
formBg: slate.slate2,
|
|
243
|
-
formHeaderShadow: `${getOpacities(slate.slate10).opacity10} 0px 0px 6px`,
|
|
244
|
-
formEditorFieldBg: slate.slate3,
|
|
245
|
-
filterGroup1Bg: slate.slate2,
|
|
246
|
-
filterGroup2Bg: slate.slate3,
|
|
247
|
-
filterGroupBorder: blackA.blackA3,
|
|
248
|
-
colorBgNotificationFocusedDefault: indigo.indigo3,
|
|
249
|
-
colorBgNotificationFocusedHover: indigo.indigo4,
|
|
250
|
-
//end
|
|
251
|
-
disabledInversedTextColor: shades.opacity25,
|
|
252
|
-
danger: red.red9,
|
|
253
|
-
active: red.red9,
|
|
254
|
-
warning: "#FFD41E",
|
|
255
|
-
cardBg: "#FFFFFF",
|
|
256
|
-
cardSelected: "#FFFB8F",
|
|
257
|
-
cardSelectedHover: "rgba(240, 244, 247, 0.6)",
|
|
258
|
-
selectedImageBorder: blackA.blackA8,
|
|
259
|
-
transparent,
|
|
260
|
-
shades: lights,
|
|
261
|
-
lights: shades,
|
|
262
|
-
separators,
|
|
263
|
-
inversedSeparators,
|
|
264
|
-
progressBg: slate.slate4,
|
|
265
|
-
progressText: slate.slate11,
|
|
266
|
-
progressFillBg: slate.slate11,
|
|
267
|
-
progressFillText: whiteA.whiteA0,
|
|
268
|
-
searchFiltersBg: slate.slate1,
|
|
269
|
-
colorPickerSwatchBorder: blackA.blackA7,
|
|
270
|
-
richTextTableBorder: blackA.blackA5,
|
|
271
|
-
// GRID
|
|
272
|
-
// header
|
|
273
|
-
gridHeaderBgColor: slate.slate2,
|
|
274
|
-
gridHeaderHoverBgColor: slate.slate3,
|
|
275
|
-
gridHeaderTextColor: slate.slate9,
|
|
276
|
-
// cell
|
|
277
|
-
gridCellBgColor: whiteA.whiteA0,
|
|
278
|
-
gridCellBorderColor: slate.slate5,
|
|
279
|
-
gridPinnedCellBorderColor: slate.slate8,
|
|
280
|
-
gridDisabledCellBgColor: slate.slate2,
|
|
281
|
-
gridSelectedCellBgColor: indigo.indigo3,
|
|
282
|
-
gridHighlightedCellBgColor: indigo.indigo4,
|
|
283
|
-
gridSelectedCellBorderColor: indigo.indigo6,
|
|
284
|
-
gridSelectedPinnedCellBorderColor: indigo.indigo7,
|
|
285
|
-
gridDisabledSelectedCellBgColor: indigo.indigo4,
|
|
286
|
-
gridActiveCellBorderColor: indigo.indigo8,
|
|
287
|
-
} as const;
|
|
288
|
-
|
|
289
|
-
const darkMenu = {
|
|
290
|
-
menuBg: slateDark.slate2,
|
|
291
|
-
menuFooterColor: getOpacities(slateDark.slate3).opacity40,
|
|
292
|
-
menuFooterHoverColor: slateDark.slate4,
|
|
293
|
-
menuTextColor: slate.slate8,
|
|
294
|
-
menuIconColor: getOpacities(slate.slate10).opacity90,
|
|
295
|
-
menuSelectedIconColor: getOpacities(slate.slate1).opacity90,
|
|
296
|
-
menuSelectedTextColor: slate.slate2,
|
|
297
|
-
menuItemHoverColor: slateDark.slate6,
|
|
298
|
-
menuItemSettingsHoverBg: slateDark.slate5,
|
|
299
|
-
appIconBgColor: getOpacities(slate.slate2).opacity50,
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
const light2Colors = {
|
|
303
|
-
...lightColors,
|
|
304
|
-
...darkMenu,
|
|
305
|
-
mode: "light2",
|
|
306
|
-
} as const;
|
|
307
|
-
|
|
308
|
-
const darkColors = {
|
|
309
|
-
mode: "dark",
|
|
310
|
-
brandColors,
|
|
311
|
-
stateColors,
|
|
312
|
-
primaryBlue: indigoDark.indigo10,
|
|
313
|
-
whiteColor: whiteA.whiteA0,
|
|
314
|
-
blackColor: blackA.blackA0,
|
|
315
|
-
mainBg: slateDark.slate1,
|
|
316
|
-
panelBg: slateDark.slate2,
|
|
317
|
-
panelContentBg: slateDark.slate2,
|
|
318
|
-
pageBg: slateDark.slate1,
|
|
319
|
-
pageContentBg: slateDark.slate2,
|
|
320
|
-
sidebarBg: slateDark.slate3,
|
|
321
|
-
sidebarShadow: `-3px 0px 10px 0px ${getOpacities(slateDark.slate1).opacity80}`,
|
|
322
|
-
textColor: slate.slate6,
|
|
323
|
-
textSelectionColor: getOpacities(blueDark.blue10).opacity40,
|
|
324
|
-
accentTextColor: slateDark.slate10,
|
|
325
|
-
disabledTextColor: slateDark.slate9,
|
|
326
|
-
inversedTextColor: slateDark.slate6,
|
|
327
|
-
linkColor: indigoDark.indigo11,
|
|
328
|
-
linkBorder: `1px solid ${getOpacities(indigoDark.indigo11).opacity40}`,
|
|
329
|
-
linkHoverColor: indigoDark.indigo10,
|
|
330
|
-
linkBorderHover: `1px solid ${getOpacities(indigoDark.indigo10).opacity80}`,
|
|
331
|
-
codeColor: red.red8,
|
|
332
|
-
codeBgColor: slateDark.slate4,
|
|
333
|
-
codeBlockBgColor: slateDark.slate4,
|
|
334
|
-
entityNodeColor: slate.slate8,
|
|
335
|
-
entityNodeBorder: `1px solid ${getOpacities(slate.slate8).opacity40}`,
|
|
336
|
-
entityNodeHoverColor: slate.slate7,
|
|
337
|
-
entityNodeBorderHover: `1px solid ${getOpacities(slate.slate7).opacity80}`,
|
|
338
|
-
entityNodeBgColor: slateDark.slate3,
|
|
339
|
-
shortcutTextColor: slateDark.slate11,
|
|
340
|
-
shortcutBorderColor: `1px solid ${getOpacities(slateDark.slate10).opacity20}`,
|
|
341
|
-
inputBgColor: slateDark.slate2,
|
|
342
|
-
inputDisabledBgColor: getOpacities(slateDark.slate6).opacity30,
|
|
343
|
-
inputDisabledBorderColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity20}`,
|
|
344
|
-
inputCopyBgColor: slateDark.slate4,
|
|
345
|
-
inputBorderColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity70}`,
|
|
346
|
-
inputBorderHoverColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity100}`,
|
|
347
|
-
inputBorderFocusColor: `0 0 0 1px ${getOpacities(slateDark.slate9).opacity100}`,
|
|
348
|
-
inputBorderBlendMode: "lighten",
|
|
349
|
-
inputPlaceholderTextColor: slateDark.slate9,
|
|
350
|
-
inputErrorBorderColor: `0 0 0 1px ${red.red7}`,
|
|
351
|
-
inputErrorBorderHoverColor: `0 0 0 1px ${getOpacities(red.red7).opacity40}`,
|
|
352
|
-
inputErrorBorderFocusColor: `0 0 0 1px ${getOpacities(red.red7).opacity25}`,
|
|
353
|
-
inputErrorBorderFocusShadow: `0 0 0 3px ${getOpacities(red.red7).opacity25}`,
|
|
354
|
-
buttonPrimaryColor: indigoDark.indigo10,
|
|
355
|
-
buttonColor: slateDark.slate10,
|
|
356
|
-
buttonPrimaryTextColor: slate.slate6,
|
|
357
|
-
checkboxColor: slateDark.slate10,
|
|
358
|
-
actionMenuBg: slateDark.slate4,
|
|
359
|
-
actionMenuInnerBg: slateDark.slate5,
|
|
360
|
-
actionMenuShadow: `0 0 0 1px ${getOpacities(slateDark.slate1).opacity10}, 0 12px 16px -4px ${
|
|
361
|
-
getOpacities(slateDark.slate1).opacity40
|
|
362
|
-
}`,
|
|
363
|
-
actionMenuHover: slateDark.slate6,
|
|
364
|
-
actionMenuInnerHover: getOpacities(slateDark.slate7).opacity50,
|
|
365
|
-
actionMenuButtonColor: slateDark.slate2,
|
|
366
|
-
actionMenuButtonHoverColor: slateDark.slate3,
|
|
367
|
-
actionMenuButtonShadow: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${
|
|
368
|
-
getOpacities(slateDark.slate2).opacity20
|
|
369
|
-
}`,
|
|
370
|
-
actionMenuButtonShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 6px 8px -4px ${
|
|
371
|
-
getOpacities(slateDark.slate2).opacity30
|
|
372
|
-
}`,
|
|
373
|
-
separatorColor: getOpacities(slateDark.slate8).opacity50,
|
|
374
|
-
separatorBreadcrumbsColor: slateDark.slate8,
|
|
375
|
-
iconColor: slateDark.slate10,
|
|
376
|
-
appIconColor: getOpacities(slate.slate2).opacity70,
|
|
377
|
-
mentionBgColor: slateDark.slate5,
|
|
378
|
-
entityCardBgColor: slateDark.slate5,
|
|
379
|
-
entityCardSelectedColor: getOpacities(slateDark.slate6).opacity50,
|
|
380
|
-
entityCardHoverColor: getOpacities(slateDark.slate6).opacity50,
|
|
381
|
-
entityCardDoneColor: getOpacities(slateDark.slate5).opacity30,
|
|
382
|
-
entityCardShadow: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${
|
|
383
|
-
getOpacities(slateDark.slate2).opacity20
|
|
384
|
-
}`,
|
|
385
|
-
entityCardShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${
|
|
386
|
-
getOpacities(slateDark.slate2).opacity20
|
|
387
|
-
}`,
|
|
388
|
-
allowedDropColor: getOpacities(slateDark.slate3).opacity80,
|
|
389
|
-
relationViewBgColor: slateDark.slate3,
|
|
390
|
-
unitBg: slateDark.slate6,
|
|
391
|
-
unitBgHover: slateDark.slate7,
|
|
392
|
-
badgeBgColor: getOpacities(slate.slate10).opacity20,
|
|
393
|
-
tooltipBgColor: slateDark.slate6,
|
|
394
|
-
todayMarkerColor: redDark.red6,
|
|
395
|
-
viewBgOverlayColor: getOpacities(slateDark.slate1).opacity60,
|
|
396
|
-
floatEditorMenuBg: slateDark.slate6,
|
|
397
|
-
floatEditorActiveColor: indigoDark.indigo11,
|
|
398
|
-
planBadgeBgColor: yellowDark.yellow10,
|
|
399
|
-
commentColor: getOpacities(yellowDark.yellow9).opacity40,
|
|
400
|
-
cellBackgroundColor: slateDark.slate2,
|
|
401
|
-
cellBackgroundHoverColor: getOpacities(slateDark.slate6).opacity30,
|
|
402
|
-
cellBorderColor: getOpacities(slateDark.slate9).opacity50,
|
|
403
|
-
cellPinnedBorderColor: getOpacities(slateDark.slate9).opacity70,
|
|
404
|
-
tableRowWarningColor: getOpacities(yellowDark.yellow9).opacity40,
|
|
405
|
-
errorBgColor: getOpacities(redDark.red9).opacity60,
|
|
406
|
-
errorTextColor: red.red7,
|
|
407
|
-
errorButtonColor: redDark.red10,
|
|
408
|
-
warningBgColor: getOpacities(yellowDark.yellow8).opacity60,
|
|
409
|
-
warningButtonColor: yellowDark.yellow11,
|
|
410
|
-
infoBox: getOpacities(yellowDark.yellow9).opacity20,
|
|
411
|
-
appCardBgColor: slateDark.slate2,
|
|
412
|
-
appCardHoverColor: slateDark.slate2,
|
|
413
|
-
appCardShadow: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity50}, 0 2px 4px -4px ${
|
|
414
|
-
getOpacities(slateDark.slate1).opacity50
|
|
415
|
-
}`,
|
|
416
|
-
appCardShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity60}, 0 6px 8px -4px ${
|
|
417
|
-
getOpacities(slateDark.slate1).opacity100
|
|
418
|
-
}`,
|
|
419
|
-
modalBg: getOpacities(slateDark.slate2).opacity50,
|
|
420
|
-
modalShadow: `${getOpacities(slateDark.slate1).opacity40} 0px 16px 70px`,
|
|
421
|
-
modalContentBg: slateDark.slate3,
|
|
422
|
-
progressIconBg: getOpacities(slateDark.slate12).opacity10,
|
|
423
|
-
progressIconFill: getOpacities(slateDark.slate12).opacity80,
|
|
424
|
-
progressIconDoneBg: getOpacities(slateDark.slate12).opacity90,
|
|
425
|
-
progressIconDoneFill: getOpacities(slateDark.slate1).opacity80,
|
|
426
|
-
instrumentsMenuBg: getOpacities(slateDark.slate4).opacity95,
|
|
427
|
-
instrumentsMenuShadow: `0px 2px 8px ${getOpacities(slate.slate2).opacity95}`,
|
|
428
|
-
selectedColorBorder: getOpacities(slate.slate6).opacity20,
|
|
429
|
-
formBg: slateDark.slate2,
|
|
430
|
-
formHeaderShadow: `${getOpacities(slateDark.slate1).opacity40} 0px 0px 6px`,
|
|
431
|
-
formEditorFieldBg: slateDark.slate4,
|
|
432
|
-
filterGroup1Bg: slateDark.slate6,
|
|
433
|
-
filterGroup2Bg: slateDark.slate7,
|
|
434
|
-
filterGroupBorder: whiteA.whiteA3,
|
|
435
|
-
colorBgNotificationFocusedDefault: getOpacities(indigoDark.indigo11).opacity20,
|
|
436
|
-
colorBgNotificationFocusedHover: getOpacities(indigoDark.indigo11).opacity30,
|
|
437
|
-
//end
|
|
438
|
-
disabledInversedTextColor: lights.opacity25,
|
|
439
|
-
danger: redDark.red10,
|
|
440
|
-
active: redDark.red10,
|
|
441
|
-
warning: "#FFD41E",
|
|
442
|
-
cardBg: slateDark.slate6,
|
|
443
|
-
cardSelected: slateDark.slate5,
|
|
444
|
-
cardSelectedHover: slateDark.slate5,
|
|
445
|
-
selectedImageBorder: whiteA.whiteA11,
|
|
446
|
-
transparent,
|
|
447
|
-
shades,
|
|
448
|
-
lights,
|
|
449
|
-
separators: inversedSeparators,
|
|
450
|
-
inversedSeparators: separators,
|
|
451
|
-
progressBg: slate.slate4,
|
|
452
|
-
progressText: slate.slate11,
|
|
453
|
-
progressFillBg: slate.slate11,
|
|
454
|
-
progressFillText: whiteA.whiteA0,
|
|
455
|
-
searchFiltersBg: slateDark.slate2,
|
|
456
|
-
colorPickerSwatchBorder: blackA.blackA7,
|
|
457
|
-
richTextTableBorder: whiteA.whiteA7,
|
|
458
|
-
// GRID
|
|
459
|
-
// header
|
|
460
|
-
gridHeaderBgColor: slateDark.slate3,
|
|
461
|
-
gridHeaderHoverBgColor: slateDark.slate4,
|
|
462
|
-
gridHeaderTextColor: slateDark.slate10,
|
|
463
|
-
// cell
|
|
464
|
-
gridCellBgColor: slateDark.slate2,
|
|
465
|
-
gridCellBorderColor: slateDark.slate6,
|
|
466
|
-
gridPinnedCellBorderColor: slateDark.slate8,
|
|
467
|
-
gridDisabledCellBgColor: slateDark.slate3,
|
|
468
|
-
gridSelectedCellBgColor: indigoDark.indigo3,
|
|
469
|
-
gridHighlightedCellBgColor: indigoDark.indigo5,
|
|
470
|
-
gridSelectedCellBorderColor: indigoDark.indigo7,
|
|
471
|
-
gridSelectedPinnedCellBorderColor: indigoDark.indigo7,
|
|
472
|
-
gridDisabledSelectedCellBgColor: indigoDark.indigo5,
|
|
473
|
-
gridActiveCellBorderColor: indigoDark.indigo9,
|
|
474
|
-
...darkMenu,
|
|
475
|
-
} as const;
|
|
476
|
-
|
|
477
|
-
export function getLightColors(): typeof lightColors {
|
|
478
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
479
|
-
// @ts-ignore
|
|
480
|
-
if (process.env.NODE_ENV !== "test") {
|
|
481
|
-
throw new Error("Only for test purpose");
|
|
482
|
-
}
|
|
483
|
-
return lightColors;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
export function getDarkColors(): typeof darkColors {
|
|
487
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
488
|
-
// @ts-ignore
|
|
489
|
-
if (process.env.NODE_ENV !== "test") {
|
|
490
|
-
throw new Error("Only for test purpose");
|
|
491
|
-
}
|
|
492
|
-
return darkColors;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
export function getLight2Colors(): typeof light2Colors {
|
|
496
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
497
|
-
// @ts-ignore
|
|
498
|
-
if (process.env.NODE_ENV !== "test") {
|
|
499
|
-
throw new Error("Only for test purpose");
|
|
500
|
-
}
|
|
501
|
-
return light2Colors;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
const getDefaultTheme = (): never => {
|
|
505
|
-
throw Error("Please specify theme mode");
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
export function getThemeValue<T>(theme: ThemeMode, values: {light: T; light2?: T; dark: T}): T {
|
|
509
|
-
if (theme in values) {
|
|
510
|
-
return values[theme] as T;
|
|
511
|
-
}
|
|
512
|
-
return values.light;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
function getTypeColors(themeColor: string, theme: ThemeMode) {
|
|
516
|
-
let color;
|
|
517
|
-
// switch to chroma.valid once we start using 2.0.1
|
|
518
|
-
try {
|
|
519
|
-
chroma(themeColor);
|
|
520
|
-
color = themeColor;
|
|
521
|
-
} catch (e) {
|
|
522
|
-
color = brandColors.green;
|
|
523
|
-
}
|
|
524
|
-
const boardBg = chroma(color).luminance(0.85).desaturate(0.2).set("hsl.h", "+2");
|
|
525
|
-
|
|
526
|
-
const lightTypeColors = {
|
|
527
|
-
primary: color,
|
|
528
|
-
opacity: getOpacities(color),
|
|
529
|
-
darkenPrimary: getDarkenColor(color),
|
|
530
|
-
brightenPrimary: chroma(color).luminance(0.92).desaturate(0.1).alpha(0.98).css(),
|
|
531
|
-
boardBg: boardBg.hex(),
|
|
532
|
-
boardBgOverlay: boardBg.alpha(0.8).css(),
|
|
533
|
-
headerBg: chroma(color).luminance(0.7).desaturate(0.5).set("hsl.h", "+2").css(),
|
|
534
|
-
detailsBg: chroma(color).alpha(0.5).luminance(0.85).hex(),
|
|
535
|
-
focus: chroma(color).alpha(0.25).css(),
|
|
536
|
-
separator: chroma(color).alpha(0.3).css(),
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
const darkTypeColors = {
|
|
540
|
-
primary: color,
|
|
541
|
-
opacity: getOpacities(color),
|
|
542
|
-
darkenPrimary: getDarkenColor(color),
|
|
543
|
-
brightenPrimary: chroma(color).luminance(0.92).desaturate(0.1).alpha(0.98).css(),
|
|
544
|
-
boardBg: boardBg.hex(),
|
|
545
|
-
boardBgOverlay: boardBg.alpha(0.8).css(),
|
|
546
|
-
headerBg: chroma(color).luminance(0.7).desaturate(0.5).set("hsl.h", "+2").css(),
|
|
547
|
-
detailsBg: chroma(color).alpha(0.03).luminance(0.8).desaturate(0.8).darken(0.1).hex(),
|
|
548
|
-
focus: chroma(color).alpha(0.25).css(),
|
|
549
|
-
separator: chroma(color).alpha(0.3).css(),
|
|
550
|
-
};
|
|
551
|
-
|
|
552
|
-
switch (theme) {
|
|
553
|
-
case "light":
|
|
554
|
-
return lightTypeColors;
|
|
555
|
-
case "dark":
|
|
556
|
-
return darkTypeColors;
|
|
557
|
-
case "light2":
|
|
558
|
-
return lightTypeColors;
|
|
559
|
-
default:
|
|
560
|
-
return lightTypeColors;
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
type DesignColor = typeof darkColors | typeof lightColors | typeof light2Colors;
|
|
565
|
-
|
|
566
|
-
export type ThemeColors = ReturnType<typeof getTypeColors> & DesignColor;
|
|
567
|
-
|
|
568
|
-
const colorsByTheme: Record<string, DesignColor> = {
|
|
569
|
-
dark: darkColors,
|
|
570
|
-
light: lightColors,
|
|
571
|
-
light2: light2Colors,
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
export const getThemeColors: (themeColor: string, theme: ThemeMode) => ThemeColors = _.memoize(
|
|
575
|
-
(themeColor: string, theme: ThemeMode = getDefaultTheme()): ThemeColors => {
|
|
576
|
-
const colors = colorsByTheme[theme];
|
|
577
|
-
return {
|
|
578
|
-
...getTypeColors(themeColor, theme),
|
|
579
|
-
...colors,
|
|
580
|
-
};
|
|
581
|
-
},
|
|
582
|
-
(themeColor, theme) => themeColor + theme
|
|
583
|
-
);
|
|
584
|
-
|
|
585
|
-
export const getTextColor = _.memoize((color: string): string => {
|
|
586
|
-
return makeChromaColor(color).hex();
|
|
587
|
-
});
|
|
588
|
-
|
|
589
|
-
export const getLinkedHighlightBackgroundColor = _.memoize(
|
|
590
|
-
(themeColors: ThemeColors, color: string): string => {
|
|
591
|
-
switch (themeColors.mode) {
|
|
592
|
-
case "dark":
|
|
593
|
-
return makeChromaColor(color).alpha(0.4).luminance(0.5).css();
|
|
594
|
-
case "light":
|
|
595
|
-
return makeChromaColor(color).alpha(0.3).luminance(0.6).css();
|
|
596
|
-
default:
|
|
597
|
-
return makeChromaColor(color).alpha(0.3).luminance(0.6).css();
|
|
598
|
-
}
|
|
599
|
-
},
|
|
600
|
-
(themeMode, color) => `${themeMode}-${color}`
|
|
601
|
-
);
|
|
602
|
-
|
|
603
|
-
export const getEnumBackgroundColor = _.memoize(
|
|
604
|
-
(mode: ThemeMode, color: string) => {
|
|
605
|
-
return getThemeValue(mode, {
|
|
606
|
-
light: a11yColor(getOpacities(color).opacity20, lightColors.whiteColor, 1),
|
|
607
|
-
dark: a11yColor(getOpacities(color).opacity30, darkColors.menuBg, 1.3),
|
|
608
|
-
});
|
|
609
|
-
},
|
|
610
|
-
(themeMode, color) => `${themeMode}-${color}`
|
|
611
|
-
);
|
|
612
|
-
|
|
613
|
-
// TODO: fix color for light2. It should same as 'dark' only on dark menu but same as 'light' on other parts of application
|
|
614
|
-
export const getAppIconBackgroundColor = (mode: ThemeMode, color: string) =>
|
|
615
|
-
getThemeValue(mode, {
|
|
616
|
-
dark: a11yColor(getOpacities(color).opacity30, darkColors.menuBg, 1.3),
|
|
617
|
-
light: a11yColor(getOpacities(color).opacity15, lightColors.whiteColor, 1),
|
|
618
|
-
light2: a11yColor(getOpacities(color).opacity30, darkColors.menuBg, 1.3),
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
export const getIconColor = _.memoize(
|
|
622
|
-
(mode: ThemeMode, color: string) =>
|
|
623
|
-
getThemeValue(mode, {
|
|
624
|
-
light: a11yColor(getOpacities(color).opacity95, lightColors.whiteColor, 3),
|
|
625
|
-
dark: a11yColor(getOpacities(color).opacity95, darkColors.menuBg, 5),
|
|
626
|
-
}),
|
|
627
|
-
(themeMode, color) => `${themeMode}-${color}`
|
|
628
|
-
);
|
|
629
|
-
|
|
630
|
-
export const cardTypeColors = [
|
|
631
|
-
"#4A4A4A",
|
|
632
|
-
"#6A849B",
|
|
633
|
-
"#BEC5CC",
|
|
634
|
-
"#D40915",
|
|
635
|
-
"#E72065",
|
|
636
|
-
"#9C2BAF",
|
|
637
|
-
"#673DB6",
|
|
638
|
-
"#3E53B4",
|
|
639
|
-
"#2978FB",
|
|
640
|
-
"#199EE3",
|
|
641
|
-
"#1FBED3",
|
|
642
|
-
"#159789",
|
|
643
|
-
"#4FAF54",
|
|
644
|
-
"#8EC351",
|
|
645
|
-
"#FBA32F",
|
|
646
|
-
"#FC551F",
|
|
647
|
-
"#B04E31",
|
|
648
|
-
] as const;
|
|
649
|
-
|
|
650
|
-
export const dropCursorColor = chroma(brandColors.blue).alpha(0.7).css();
|
|
651
|
-
export const colors = {
|
|
652
|
-
...getTypeColors(brandColors.green, "light"),
|
|
653
|
-
brandColors,
|
|
654
|
-
stateColors,
|
|
655
|
-
transparent,
|
|
656
|
-
shades,
|
|
657
|
-
lights,
|
|
658
|
-
inversedTextColor: "#FFFFFF",
|
|
659
|
-
disabledInversedTextColor: lights.opacity25,
|
|
660
|
-
} as const;
|
|
661
|
-
|
|
662
|
-
export const space = {
|
|
663
|
-
xxs: 2, // Not recommended
|
|
664
|
-
xs: 4,
|
|
665
|
-
s: 6,
|
|
666
|
-
m: 8,
|
|
667
|
-
l: 12,
|
|
668
|
-
xl: 24,
|
|
669
|
-
xxl: 48, // Not recommended
|
|
670
|
-
} as const;
|
|
671
|
-
|
|
672
|
-
export const layout = {
|
|
673
|
-
logoSize: 24,
|
|
674
|
-
menuDefaultWidth: 243,
|
|
675
|
-
menuMinWidth: 46, //TODO: make dependency to itemHeight
|
|
676
|
-
menuMaxWidth: 480,
|
|
677
|
-
menuItemMinWidth: 80,
|
|
678
|
-
menuGroupHeaderIndent: 40, // I'm ok
|
|
679
|
-
menuItemLevelIndent: 24,
|
|
680
|
-
listItemHeight: 38,
|
|
681
|
-
itemHeight: 36,
|
|
682
|
-
itemWithSubtitleHeight: 52,
|
|
683
|
-
groupTitleHeight: 30,
|
|
684
|
-
menuItemHeight: 32,
|
|
685
|
-
newMenuItemHeight: 30, // I'm ok
|
|
686
|
-
viewHeaderHeight: space.l * 7,
|
|
687
|
-
viewHeaderCompactHeight: 52,
|
|
688
|
-
columnMinWidth: 240,
|
|
689
|
-
columnWidths: {compact: 200, default: 240, list: 280, full: 320},
|
|
690
|
-
objectEditorMinWidth: 480,
|
|
691
|
-
typeEditorWidth: "30vw",
|
|
692
|
-
typeEditorMinWidth: 480,
|
|
693
|
-
viewSetupWidth: "30vw",
|
|
694
|
-
viewSetupMinWidth: 525,
|
|
695
|
-
inputHeight: 36, //TODO: merge input and item height?
|
|
696
|
-
timelineLineHeight: 40,
|
|
697
|
-
timelineGroupPadding: 6,
|
|
698
|
-
timelineItemHeightRatio: 34 / 40,
|
|
699
|
-
timelineHeaderHeight: 30,
|
|
700
|
-
calendarEventHeight: 30,
|
|
701
|
-
calendarHeaderHeight: 30,
|
|
702
|
-
calendarToolbarHeight: 60,
|
|
703
|
-
checkboxSize: 17,
|
|
704
|
-
fakeBoardWidth: 260,
|
|
705
|
-
fakeBoardHeight: 160,
|
|
706
|
-
inlineInputHeight: 32,
|
|
707
|
-
menuHeight: 32,
|
|
708
|
-
popupTopMargin: 48,
|
|
709
|
-
unitHeight: 18,
|
|
710
|
-
} as const;
|
|
711
|
-
|
|
712
|
-
export const radius = 3;
|
|
713
|
-
|
|
714
|
-
export const border = {
|
|
715
|
-
radius0: 0,
|
|
716
|
-
radius1: 1,
|
|
717
|
-
radius2: 2,
|
|
718
|
-
radius3: 3,
|
|
719
|
-
radius4: 4,
|
|
720
|
-
radius5: 5,
|
|
721
|
-
radius6: 6,
|
|
722
|
-
radius8: 8,
|
|
723
|
-
radius10: 10,
|
|
724
|
-
radius12: 12,
|
|
725
|
-
} as const;
|
|
726
|
-
|
|
727
|
-
export const lineHeight = {
|
|
728
|
-
text: 1.6,
|
|
729
|
-
regular: 1.5,
|
|
730
|
-
heading: 1.25,
|
|
731
|
-
nowrap: 1,
|
|
732
|
-
} as const;
|
|
733
|
-
|
|
734
|
-
export const tooltipDelay = {
|
|
735
|
-
enter: 500,
|
|
736
|
-
leave: 0,
|
|
737
|
-
} as const;
|
|
738
|
-
|
|
739
|
-
export const duration = 120;
|
|
740
|
-
export const easing = "ease-in-out";
|
|
741
|
-
export const transition = `${duration}ms ${easing}`;
|
|
742
|
-
|
|
743
|
-
export const iconSize = 20;
|
|
744
|
-
export const viewBoxSize = "0 0 20 20";
|
|
745
|
-
export const avatarSize = 24;
|
|
746
|
-
|
|
747
|
-
export const shadows = {
|
|
748
|
-
border: `0 0 0 1px ${shades.opacity10}`,
|
|
749
|
-
inversedBorder: `0 0 0 1px ${lights.opacity10}`,
|
|
750
|
-
videoPreview: "0 4px 30px 4px rgba(0, 0, 0, .15)",
|
|
751
|
-
} as const;
|
|
752
|
-
|
|
753
|
-
export const dateFormat = "MMM D, YYYY";
|
|
754
|
-
export const dateTimeFormat = "MMM D, YYYY HH:mm";
|
|
755
|
-
export const timeFormat = "HH:mm";
|
|
756
|
-
|
|
757
|
-
export const getLinearGradient = (backgroundColors: Array<string>): string => {
|
|
758
|
-
const parts = _.flatMap(
|
|
759
|
-
backgroundColors.map((color, index, arr) => [
|
|
760
|
-
`${color} ${(index / arr.length) * 100}%`,
|
|
761
|
-
`${color} ${((index + 1) / arr.length) * 100}%`,
|
|
762
|
-
])
|
|
763
|
-
);
|
|
764
|
-
return `linear-gradient(to bottom, ${parts.join(", ")})`;
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
export const getObjectColorMemoized = _.memoize((name) => {
|
|
768
|
-
if (!name) {
|
|
769
|
-
return "#999999";
|
|
770
|
-
}
|
|
771
|
-
const colorHash = new ColorHash({
|
|
772
|
-
lightness: [0.5, 0.6, 0.7],
|
|
773
|
-
saturation: [0.6, 0.7, 0.8, 0.9, 1],
|
|
774
|
-
});
|
|
775
|
-
return colorHash.hex(name);
|
|
776
|
-
});
|
|
777
|
-
|
|
778
|
-
export const themeVars = Object.keys(getThemeColors(brandColors.green, "light")).reduce((vars, key) => {
|
|
779
|
-
if (key === "opacity") {
|
|
780
|
-
vars[key] = Object.fromEntries(
|
|
781
|
-
Object.keys(opacity).map((opacityKey) => [opacityKey, `var(--${varPrefix}-opacity-${opacityKey})`])
|
|
782
|
-
);
|
|
783
|
-
} else if (key === "stateColors") {
|
|
784
|
-
vars[key] = Object.fromEntries(
|
|
785
|
-
Object.keys(stateColors).map((stateColorKey) => [
|
|
786
|
-
stateColorKey,
|
|
787
|
-
`var(--${varPrefix}-state-colors-${stateColorKey})`,
|
|
788
|
-
])
|
|
789
|
-
);
|
|
790
|
-
} else if (key === "brandColors") {
|
|
791
|
-
vars[key] = Object.fromEntries(
|
|
792
|
-
Object.keys(brandColors).map((brandColorKey) => [
|
|
793
|
-
brandColorKey,
|
|
794
|
-
`var(--${varPrefix}-brand-colors-${brandColorKey})`,
|
|
795
|
-
])
|
|
796
|
-
);
|
|
797
|
-
} else if (key === "shades") {
|
|
798
|
-
vars[key] = Object.fromEntries(
|
|
799
|
-
Object.keys(shades).map((shadeKey) => [shadeKey, `var(--${varPrefix}-shades-${shadeKey})`])
|
|
800
|
-
);
|
|
801
|
-
} else if (key === "lights") {
|
|
802
|
-
vars[key] = Object.fromEntries(
|
|
803
|
-
Object.keys(lights).map((lightKey) => [lightKey, `var(--${varPrefix}-lights-${lightKey})`])
|
|
804
|
-
);
|
|
805
|
-
} else if (key === "separators") {
|
|
806
|
-
vars[key] = Object.fromEntries(
|
|
807
|
-
Object.keys(separators).map((separatorKey) => [separatorKey, `var(--${varPrefix}-separator-${separatorKey})`])
|
|
808
|
-
);
|
|
809
|
-
} else if (key === "inversedSeparators") {
|
|
810
|
-
vars[key] = Object.fromEntries(
|
|
811
|
-
Object.keys(inversedSeparators).map((separatorKey) => [
|
|
812
|
-
separatorKey,
|
|
813
|
-
`var(--${varPrefix}-inversed-separator-${separatorKey})`,
|
|
814
|
-
])
|
|
815
|
-
);
|
|
816
|
-
} else {
|
|
817
|
-
vars[key] = `var(--${varPrefix}-color-${key})`;
|
|
818
|
-
}
|
|
819
|
-
return vars;
|
|
820
|
-
}, {} as Record<string, string | {[k: string]: string}>) as ThemeColors;
|
|
821
|
-
|
|
822
|
-
const DEFAULT_REJECT_KEYS = Object.keys(lightColors);
|
|
823
|
-
export const createInlineTheme = _.memoize(
|
|
824
|
-
(theme: ThemeColors, rejectKeys = DEFAULT_REJECT_KEYS) => {
|
|
825
|
-
return createInlineStyles<ThemeColors>(theme, rejectKeys);
|
|
826
|
-
},
|
|
827
|
-
(theme, rejectKeys = DEFAULT_REJECT_KEYS) => {
|
|
828
|
-
const rejectKeysLabel = rejectKeys === DEFAULT_REJECT_KEYS ? "DEFAULT_REJECT_KEYS" : JSON.stringify(rejectKeys);
|
|
829
|
-
return `${theme.mode}__${theme.primary}__${rejectKeysLabel}`;
|
|
830
|
-
}
|
|
831
|
-
);
|
|
832
|
-
|
|
833
|
-
export const textStyles = {
|
|
834
|
-
heading1: {
|
|
835
|
-
fontFamily,
|
|
836
|
-
fontSize: typeSizes[0],
|
|
837
|
-
letterSpacing: "-0.003em",
|
|
838
|
-
lineHeight: lineHeight.heading,
|
|
839
|
-
fontWeight: fontWeight.medium,
|
|
840
|
-
color: themeVars.textColor,
|
|
841
|
-
},
|
|
842
|
-
heading2: {
|
|
843
|
-
fontFamily,
|
|
844
|
-
fontSize: typeSizes[1],
|
|
845
|
-
letterSpacing: "-0.002em",
|
|
846
|
-
lineHeight: lineHeight.heading,
|
|
847
|
-
fontWeight: fontWeight.medium,
|
|
848
|
-
color: themeVars.textColor,
|
|
849
|
-
},
|
|
850
|
-
heading3: {
|
|
851
|
-
fontFamily,
|
|
852
|
-
fontSize: typeSizes[2],
|
|
853
|
-
letterSpacing: "-0.002em",
|
|
854
|
-
lineHeight: lineHeight.heading,
|
|
855
|
-
fontWeight: fontWeight.medium,
|
|
856
|
-
color: themeVars.textColor,
|
|
857
|
-
},
|
|
858
|
-
heading4: {
|
|
859
|
-
fontFamily,
|
|
860
|
-
fontSize: typeSizes[3],
|
|
861
|
-
lineHeight: lineHeight.heading,
|
|
862
|
-
fontWeight: fontWeight.medium,
|
|
863
|
-
color: themeVars.textColor,
|
|
864
|
-
},
|
|
865
|
-
heading5: {
|
|
866
|
-
fontFamily,
|
|
867
|
-
fontSize: typeSizes[4],
|
|
868
|
-
lineHeight: lineHeight.heading,
|
|
869
|
-
fontWeight: fontWeight.medium,
|
|
870
|
-
color: themeVars.textColor,
|
|
871
|
-
},
|
|
872
|
-
heading6: {
|
|
873
|
-
fontFamily,
|
|
874
|
-
fontSize: typeSizes[5],
|
|
875
|
-
lineHeight: lineHeight.heading,
|
|
876
|
-
letterSpacing: 0.6,
|
|
877
|
-
textTransform: "uppercase",
|
|
878
|
-
fontWeight: fontWeight.regular,
|
|
879
|
-
color: themeVars.textColor,
|
|
880
|
-
},
|
|
881
|
-
heading7: {
|
|
882
|
-
fontFamily,
|
|
883
|
-
fontSize: typeSizes[6],
|
|
884
|
-
lineHeight: lineHeight.heading,
|
|
885
|
-
letterSpacing: 0.6,
|
|
886
|
-
textTransform: "uppercase",
|
|
887
|
-
fontWeight: fontWeight.regular,
|
|
888
|
-
color: themeVars.textColor,
|
|
889
|
-
},
|
|
890
|
-
big: {
|
|
891
|
-
fontFamily,
|
|
892
|
-
fontSize: typeSizes[3],
|
|
893
|
-
lineHeight: lineHeight.regular,
|
|
894
|
-
fontWeight: fontWeight.regular,
|
|
895
|
-
color: themeVars.textColor,
|
|
896
|
-
},
|
|
897
|
-
regular: {
|
|
898
|
-
fontFamily,
|
|
899
|
-
fontSize: typeSizes[4],
|
|
900
|
-
lineHeight: lineHeight.regular,
|
|
901
|
-
fontWeight: fontWeight.regular,
|
|
902
|
-
color: themeVars.textColor,
|
|
903
|
-
textTransform: "none",
|
|
904
|
-
letterSpacing: "normal",
|
|
905
|
-
},
|
|
906
|
-
small: {
|
|
907
|
-
fontFamily,
|
|
908
|
-
fontSize: typeSizes[5],
|
|
909
|
-
lineHeight: lineHeight.regular,
|
|
910
|
-
fontWeight: fontWeight.regular,
|
|
911
|
-
color: themeVars.textColor,
|
|
912
|
-
textTransform: "none",
|
|
913
|
-
},
|
|
914
|
-
code: {
|
|
915
|
-
fontFamily: '"SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace',
|
|
916
|
-
fontSize: typeSizes[4],
|
|
917
|
-
lineHeight: lineHeight.regular,
|
|
918
|
-
fontWeight: fontWeight.regular,
|
|
919
|
-
color: themeVars.textColor,
|
|
920
|
-
},
|
|
921
|
-
link: {
|
|
922
|
-
color: themeVars.linkColor,
|
|
923
|
-
borderBottom: themeVars.linkBorder,
|
|
924
|
-
textDecoration: "none",
|
|
925
|
-
cursor: "pointer",
|
|
926
|
-
transition: `border ${transition}`,
|
|
927
|
-
},
|
|
928
|
-
inversedLink: {
|
|
929
|
-
color: colors.inversedTextColor,
|
|
930
|
-
cursor: "pointer",
|
|
931
|
-
textDecoration: "underline",
|
|
932
|
-
textDecorationColor: lights.opacity25,
|
|
933
|
-
},
|
|
934
|
-
note: {
|
|
935
|
-
fontFamily,
|
|
936
|
-
fontSize: typeSizes[3],
|
|
937
|
-
lineHeight: lineHeight.regular,
|
|
938
|
-
fontWeight: fontWeight.regular,
|
|
939
|
-
color: themeVars.textColor,
|
|
940
|
-
borderRadius: radius,
|
|
941
|
-
},
|
|
942
|
-
important: {
|
|
943
|
-
fontFamily,
|
|
944
|
-
fontSize: typeSizes[3],
|
|
945
|
-
lineHeight: lineHeight.regular,
|
|
946
|
-
fontWeight: fontWeight.regular,
|
|
947
|
-
color: themeVars.textColor,
|
|
948
|
-
border: `1px solid ${themeVars.active}`,
|
|
949
|
-
borderRadius: radius,
|
|
950
|
-
},
|
|
951
|
-
} as const;
|