@fibery/ui-kit 1.0.6 → 1.1.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/package.json +4 -3
- package/src/Button.d.ts +3 -1
- package/src/Button.js +4 -6
- package/src/Pallete.ts +16 -16
- package/src/Select/components.tsx +5 -9
- package/src/Select/styles.ts +4 -4
- package/src/ThemeProvider.tsx +83 -46
- package/src/antd/styles.ts +3 -3
- package/src/designSystem.ts +92 -157
- package/src/icons/ast/AppStoreOneColor.ts +1 -1
- package/src/icons/ast/Email.ts +8 -0
- package/src/icons/ast/SidebarFields.ts +8 -0
- package/src/icons/ast/SidebarFieldsOpened.ts +8 -0
- package/src/icons/ast/SlackIcon.ts +8 -0
- package/src/icons/ast/SlideMenu.ts +8 -0
- package/src/icons/ast/SlideMenuOpened.ts +8 -0
- package/src/icons/ast/index.tsx +6 -0
- package/src/icons/react/Email.tsx +12 -0
- package/src/icons/react/SidebarFields.tsx +12 -0
- package/src/icons/react/SidebarFieldsOpened.tsx +12 -0
- package/src/icons/react/SlackIcon.tsx +12 -0
- package/src/icons/react/SlideMenu.tsx +12 -0
- package/src/icons/react/SlideMenuOpened.tsx +12 -0
- package/src/icons/react/index.tsx +6 -0
- package/src/loading-sausage.tsx +1 -1
- package/src/theme-settings.ts +67 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/ui-kit",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
@@ -35,13 +35,14 @@
|
|
|
35
35
|
"@linaria/core": "3.0.0-beta.15",
|
|
36
36
|
"@linaria/react": "3.0.0-beta.15",
|
|
37
37
|
"@popperjs/core": "2.9.3",
|
|
38
|
-
"@radix-ui/react-dropdown-menu": "0.
|
|
38
|
+
"@radix-ui/react-dropdown-menu": "1.0.0",
|
|
39
39
|
"antd": "4.18.8",
|
|
40
40
|
"chroma-js": "2.1.2",
|
|
41
41
|
"classnames": "2.3.1",
|
|
42
42
|
"color-hash": "1.0.3",
|
|
43
43
|
"d3-shape": "1.3.7",
|
|
44
44
|
"emoji-mart": "3.0.1",
|
|
45
|
+
"invariant": "2.2.4",
|
|
45
46
|
"lodash": "4.17.21",
|
|
46
47
|
"md5": "2.2.1",
|
|
47
48
|
"moment": "2.20.1",
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
66
|
"@fibery/babel-preset": "7.2.0",
|
|
66
|
-
"@fibery/eslint-config": "
|
|
67
|
+
"@fibery/eslint-config": "8.1.0",
|
|
67
68
|
"@fibery/text-editor": "1.0.0",
|
|
68
69
|
"@linaria/babel-preset": "3.0.0-beta.15",
|
|
69
70
|
"@types/chroma-js": "2.1.3",
|
package/src/Button.d.ts
CHANGED
|
@@ -21,4 +21,6 @@ export const ActionsButton: FunctionComponent<{
|
|
|
21
21
|
color?: string;
|
|
22
22
|
onClick?: Props["onClick"];
|
|
23
23
|
}>;
|
|
24
|
-
export const ActionsButtonCompact: FunctionComponent<
|
|
24
|
+
export const ActionsButtonCompact: FunctionComponent<
|
|
25
|
+
{inverted?: boolean} & Omit<Props, "color" | "borderless" | "Icon" | "size">
|
|
26
|
+
>;
|
package/src/Button.js
CHANGED
|
@@ -87,9 +87,6 @@ const getMainColor = ({color, dangerous, theme}) => {
|
|
|
87
87
|
if (!theme) {
|
|
88
88
|
return colors.primary;
|
|
89
89
|
}
|
|
90
|
-
if (theme.mode === "old") {
|
|
91
|
-
return theme.primary;
|
|
92
|
-
}
|
|
93
90
|
return theme.buttonColor;
|
|
94
91
|
};
|
|
95
92
|
|
|
@@ -347,15 +344,16 @@ export function ActionsButton({onClick, label = ``, disabled}) {
|
|
|
347
344
|
return <Button Icon={MoreIcon} onClick={onClick} borderless aria-label={label} disabled={disabled} />;
|
|
348
345
|
}
|
|
349
346
|
|
|
350
|
-
export
|
|
347
|
+
export const ActionsButtonCompact = forwardRef(({inverted, ...rest}, ref) => {
|
|
351
348
|
const theme = useTheme();
|
|
352
349
|
return (
|
|
353
350
|
<Button
|
|
351
|
+
ref={ref}
|
|
354
352
|
size={":button-size/small"}
|
|
355
353
|
Icon={MoreCompactIcon}
|
|
356
|
-
onClick={onClick}
|
|
357
354
|
color={inverted ? colors.inversedTextColor : theme.buttonColor}
|
|
358
355
|
borderless
|
|
356
|
+
{...rest}
|
|
359
357
|
/>
|
|
360
358
|
);
|
|
361
|
-
}
|
|
359
|
+
});
|
package/src/Pallete.ts
CHANGED
|
@@ -11,7 +11,7 @@ export const slate = {
|
|
|
11
11
|
slate10: "hsl(205, 9.0%, 47.3%)",
|
|
12
12
|
slate11: "hsl(204, 14.0%, 37.3%)",
|
|
13
13
|
slate12: "hsl(200, 7.0%, 8.8%)",
|
|
14
|
-
};
|
|
14
|
+
} as const;
|
|
15
15
|
|
|
16
16
|
export const slateDark = {
|
|
17
17
|
slate1: "hsl(200, 7.0%, 8.8%)",
|
|
@@ -26,7 +26,7 @@ export const slateDark = {
|
|
|
26
26
|
slate10: "hsl(206, 5.2%, 49.5%)",
|
|
27
27
|
slate11: "hsl(206, 6.0%, 63.0%)",
|
|
28
28
|
slate12: "hsl(210, 6.0%, 93.0%)",
|
|
29
|
-
};
|
|
29
|
+
} as const;
|
|
30
30
|
|
|
31
31
|
export const sage = {
|
|
32
32
|
sage1: "hsl(155, 30.0%, 98.8%)",
|
|
@@ -41,7 +41,7 @@ export const sage = {
|
|
|
41
41
|
sage10: "hsl(154, 2.8%, 51.7%)",
|
|
42
42
|
sage11: "hsl(155, 3.0%, 43.0%)",
|
|
43
43
|
sage12: "hsl(155, 24.0%, 9.0%)",
|
|
44
|
-
};
|
|
44
|
+
} as const;
|
|
45
45
|
|
|
46
46
|
export const sageDark = {
|
|
47
47
|
sage1: "hsl(160, 7.0%, 8.4%)",
|
|
@@ -56,7 +56,7 @@ export const sageDark = {
|
|
|
56
56
|
sage10: "hsl(153, 4.8%, 48.2%)",
|
|
57
57
|
sage11: "hsl(155, 5.0%, 61.8%)",
|
|
58
58
|
sage12: "hsl(155, 6.0%, 93.0%)",
|
|
59
|
-
};
|
|
59
|
+
} as const;
|
|
60
60
|
|
|
61
61
|
export const teal = {
|
|
62
62
|
teal1: "hsl(165, 60.0%, 98.8%)",
|
|
@@ -71,7 +71,7 @@ export const teal = {
|
|
|
71
71
|
teal10: "hsl(173, 83.4%, 32.5%)",
|
|
72
72
|
teal11: "hsl(174, 90.0%, 25.2%)",
|
|
73
73
|
teal12: "hsl(170, 50.0%, 12.5%)",
|
|
74
|
-
};
|
|
74
|
+
} as const;
|
|
75
75
|
|
|
76
76
|
export const tealDark = {
|
|
77
77
|
teal1: "hsl(168, 48.0%, 6.5%)",
|
|
@@ -86,7 +86,7 @@ export const tealDark = {
|
|
|
86
86
|
teal10: "hsl(174, 83.9%, 38.2%)",
|
|
87
87
|
teal11: "hsl(174, 90.0%, 40.7%)",
|
|
88
88
|
teal12: "hsl(166, 73.0%, 93.1%)",
|
|
89
|
-
};
|
|
89
|
+
} as const;
|
|
90
90
|
|
|
91
91
|
export const indigo = {
|
|
92
92
|
indigo1: "hsl(225, 60.0%, 99.4%)",
|
|
@@ -101,7 +101,7 @@ export const indigo = {
|
|
|
101
101
|
indigo10: "hsl(226, 58.6%, 51.3%)",
|
|
102
102
|
indigo11: "hsl(226, 55.0%, 45.0%)",
|
|
103
103
|
indigo12: "hsl(226, 62.0%, 17.0%)",
|
|
104
|
-
};
|
|
104
|
+
} as const;
|
|
105
105
|
|
|
106
106
|
export const indigoDark = {
|
|
107
107
|
indigo1: "hsl(229, 24.0%, 10.0%)",
|
|
@@ -116,7 +116,7 @@ export const indigoDark = {
|
|
|
116
116
|
indigo10: "hsl(227, 75.2%, 61.6%)",
|
|
117
117
|
indigo11: "hsl(228, 100%, 75.9%)",
|
|
118
118
|
indigo12: "hsl(226, 83.0%, 96.3%)",
|
|
119
|
-
};
|
|
119
|
+
} as const;
|
|
120
120
|
|
|
121
121
|
export const red = {
|
|
122
122
|
red1: "hsl(359, 100%, 99.4%)",
|
|
@@ -131,7 +131,7 @@ export const red = {
|
|
|
131
131
|
red10: "hsl(358, 69.4%, 55.2%)",
|
|
132
132
|
red11: "hsl(358, 65.0%, 48.7%)",
|
|
133
133
|
red12: "hsl(354, 50.0%, 14.6%)",
|
|
134
|
-
};
|
|
134
|
+
} as const;
|
|
135
135
|
|
|
136
136
|
export const redDark = {
|
|
137
137
|
red1: "hsl(353, 23.0%, 9.8%)",
|
|
@@ -146,7 +146,7 @@ export const redDark = {
|
|
|
146
146
|
red10: "hsl(358, 85.3%, 64.0%)",
|
|
147
147
|
red11: "hsl(358, 100%, 69.5%)",
|
|
148
148
|
red12: "hsl(351, 89.0%, 96.0%)",
|
|
149
|
-
};
|
|
149
|
+
} as const;
|
|
150
150
|
|
|
151
151
|
export const blue = {
|
|
152
152
|
blue1: "hsl(206, 100%, 99.2%)",
|
|
@@ -161,7 +161,7 @@ export const blue = {
|
|
|
161
161
|
blue10: "hsl(208, 100%, 47.3%)",
|
|
162
162
|
blue11: "hsl(211, 100%, 43.2%)",
|
|
163
163
|
blue12: "hsl(211, 100%, 15.0%)",
|
|
164
|
-
};
|
|
164
|
+
} as const;
|
|
165
165
|
|
|
166
166
|
export const blueDark = {
|
|
167
167
|
blue1: "hsl(212, 35.0%, 9.2%)",
|
|
@@ -176,7 +176,7 @@ export const blueDark = {
|
|
|
176
176
|
blue10: "hsl(209, 100%, 60.6%)",
|
|
177
177
|
blue11: "hsl(210, 100%, 66.1%)",
|
|
178
178
|
blue12: "hsl(206, 98.0%, 95.8%)",
|
|
179
|
-
};
|
|
179
|
+
} as const;
|
|
180
180
|
|
|
181
181
|
export const yellow = {
|
|
182
182
|
yellow1: "hsl(60, 54.0%, 98.5%)",
|
|
@@ -191,7 +191,7 @@ export const yellow = {
|
|
|
191
191
|
yellow10: "hsl(50, 100%, 48.5%)",
|
|
192
192
|
yellow11: "hsl(42, 100%, 29.0%)",
|
|
193
193
|
yellow12: "hsl(40, 55.0%, 13.5%)",
|
|
194
|
-
};
|
|
194
|
+
} as const;
|
|
195
195
|
|
|
196
196
|
export const yellowDark = {
|
|
197
197
|
yellow1: "hsl(45, 100%, 5.5%)",
|
|
@@ -206,7 +206,7 @@ export const yellowDark = {
|
|
|
206
206
|
yellow10: "hsl(54, 100%, 68.0%)",
|
|
207
207
|
yellow11: "hsl(48, 100%, 47.0%)",
|
|
208
208
|
yellow12: "hsl(53, 100%, 91.0%)",
|
|
209
|
-
};
|
|
209
|
+
} as const;
|
|
210
210
|
|
|
211
211
|
export const blackA = {
|
|
212
212
|
blackA0: "#000000",
|
|
@@ -222,7 +222,7 @@ export const blackA = {
|
|
|
222
222
|
blackA10: "hsla(0, 0%, 0%, 0.478)",
|
|
223
223
|
blackA11: "hsla(0, 0%, 0%, 0.565)",
|
|
224
224
|
blackA12: "hsla(0, 0%, 0%, 0.910)",
|
|
225
|
-
};
|
|
225
|
+
} as const;
|
|
226
226
|
|
|
227
227
|
export const whiteA = {
|
|
228
228
|
whiteA0: "#FFFFFF",
|
|
@@ -238,4 +238,4 @@ export const whiteA = {
|
|
|
238
238
|
whiteA10: "hsla(0, 0%, 100%, 0.446)",
|
|
239
239
|
whiteA11: "hsla(0, 0%, 100%, 0.592)",
|
|
240
240
|
whiteA12: "hsla(0, 0%, 100%, 0.923)",
|
|
241
|
-
};
|
|
241
|
+
} as const;
|
|
@@ -5,8 +5,9 @@ import RemoveIcon from "../icons/react/Remove";
|
|
|
5
5
|
import {OptionProps, DropdownIndicatorProps, ClearIndicatorProps, MultiValueRemoveProps, GroupBase} from "react-select";
|
|
6
6
|
import {Button} from "../Button";
|
|
7
7
|
import {themeVars, space} from "../designSystem";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
8
|
+
import ArrowCollapseVertical from "../icons/react/ArrowCollapseVertical";
|
|
9
|
+
import {expanderStyle, expanderExpandedStyle} from "./styles";
|
|
10
|
+
import cn from "classnames";
|
|
10
11
|
|
|
11
12
|
export const Option = <
|
|
12
13
|
TOption,
|
|
@@ -28,13 +29,8 @@ export function DropdownIndicator<
|
|
|
28
29
|
Group extends GroupBase<TOption> = GroupBase<TOption>
|
|
29
30
|
>(props: DropdownIndicatorProps<TOption, IsMulti, Group>) {
|
|
30
31
|
return (
|
|
31
|
-
<div
|
|
32
|
-
|
|
33
|
-
style={{
|
|
34
|
-
transform: props.selectProps.menuIsOpen ? "rotate(180deg)" : "",
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
<ArrowBottom iconSize={dropdownIndicatorSize} color={themeVars.disabledTextColor} />
|
|
32
|
+
<div className={cn(expanderStyle, props.selectProps.menuIsOpen && expanderExpandedStyle)}>
|
|
33
|
+
<ArrowCollapseVertical color={themeVars.disabledTextColor} />
|
|
38
34
|
</div>
|
|
39
35
|
);
|
|
40
36
|
}
|
package/src/Select/styles.ts
CHANGED
|
@@ -4,15 +4,14 @@ import type {StylesConfig, CSSObjectWithLabel, ControlProps} from "react-select"
|
|
|
4
4
|
import {inputOverrides} from "../antd/styles";
|
|
5
5
|
import {border, layout, space, textStyles, themeVars, transition} from "../designSystem";
|
|
6
6
|
|
|
7
|
-
export const dropdownIndicatorSize = 16;
|
|
8
|
-
|
|
9
7
|
export const expanderStyle = css`
|
|
10
8
|
${{
|
|
11
9
|
transition: `transform ${transition}`,
|
|
12
|
-
width: dropdownIndicatorSize,
|
|
13
|
-
height: dropdownIndicatorSize,
|
|
14
10
|
}}
|
|
15
11
|
`;
|
|
12
|
+
export const expanderExpandedStyle = css`
|
|
13
|
+
transform: rotate(180deg);
|
|
14
|
+
`;
|
|
16
15
|
|
|
17
16
|
function createControlStyle({
|
|
18
17
|
isSingleLine,
|
|
@@ -128,6 +127,7 @@ export const componentsStyles: StylesConfig = {
|
|
|
128
127
|
}),
|
|
129
128
|
menu: (provided) => ({
|
|
130
129
|
...provided,
|
|
130
|
+
color: themeVars.disabledTextColor,
|
|
131
131
|
zIndex: 1050,
|
|
132
132
|
backgroundColor: themeVars.actionMenuInnerBg,
|
|
133
133
|
boxShadow: themeVars.actionMenuShadow as unknown as Property.BoxShadow,
|
package/src/ThemeProvider.tsx
CHANGED
|
@@ -1,67 +1,53 @@
|
|
|
1
|
-
import
|
|
1
|
+
import invariant from "invariant";
|
|
2
|
+
import {createContext, ReactNode, useContext, useEffect, useState} from "react";
|
|
2
3
|
import {colors, createInlineTheme, getThemeColors, ThemeColors} from "./designSystem";
|
|
3
4
|
import {
|
|
5
|
+
subscribeOnThemeMenuPreferenceChange,
|
|
4
6
|
subscribeOnThemeModeChange,
|
|
5
7
|
subscribeOnThemePreferenceChange,
|
|
8
|
+
ThemeMenuPreference,
|
|
6
9
|
ThemeMode,
|
|
7
10
|
ThemePreference,
|
|
8
11
|
} from "./theme-settings";
|
|
9
12
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
13
|
+
const FiberyThemePreferenceContext = createContext<ThemePreference | null>(null);
|
|
14
|
+
const FiberyThemeMenuPreferenceContext = createContext<ThemeMenuPreference | null>(null);
|
|
15
|
+
|
|
14
16
|
const FiberyThemeContext = createContext<ThemeColors>(getThemeColors(colors.brandColors.blue, "light"));
|
|
15
17
|
|
|
16
18
|
function ThemeProvider({theme, children}: {theme: ThemeColors; children: ReactNode}): JSX.Element {
|
|
17
19
|
return <FiberyThemeContext.Provider value={theme}>{children}</FiberyThemeContext.Provider>;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
function ThemeModeProvider({
|
|
21
|
-
oldTheming = true,
|
|
22
|
-
initialThemeMode,
|
|
23
|
-
initialPreference,
|
|
24
|
-
children,
|
|
25
|
-
}: {
|
|
26
|
-
oldTheming: boolean;
|
|
27
|
-
initialThemeMode: ThemeMode;
|
|
28
|
-
initialPreference: ThemePreference;
|
|
29
|
-
children: ReactNode;
|
|
30
|
-
}): JSX.Element {
|
|
31
|
-
const [themeMode, setThemeMode] = useState<ThemeMode>(initialThemeMode);
|
|
32
|
-
const [themePreference, setThemePreference] = useState<ThemePreference>(initialPreference);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (!oldTheming) {
|
|
35
|
-
const unsubscribeMode = subscribeOnThemeModeChange(setThemeMode);
|
|
36
|
-
const unsubscribePreference = subscribeOnThemePreferenceChange(setThemePreference);
|
|
37
|
-
return () => {
|
|
38
|
-
unsubscribeMode();
|
|
39
|
-
unsubscribePreference();
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
43
|
-
return () => {};
|
|
44
|
-
}, [oldTheming]);
|
|
45
|
-
const value = useMemo(
|
|
46
|
-
() => ({
|
|
47
|
-
themeMode,
|
|
48
|
-
themePreference,
|
|
49
|
-
}),
|
|
50
|
-
[themeMode, themePreference]
|
|
51
|
-
);
|
|
52
|
-
return <FiberyThemeModeContext.Provider value={value}>{children}</FiberyThemeModeContext.Provider>;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
22
|
export function useTheme(): ThemeColors {
|
|
56
23
|
return useContext(FiberyThemeContext);
|
|
57
24
|
}
|
|
58
25
|
|
|
59
26
|
export function useThemeMode(): ThemeMode {
|
|
60
|
-
|
|
27
|
+
const theme = useTheme();
|
|
28
|
+
return theme.mode;
|
|
61
29
|
}
|
|
62
30
|
|
|
63
31
|
export function useThemePreference(): ThemePreference {
|
|
64
|
-
|
|
32
|
+
const themePreference = useContext(FiberyThemePreferenceContext);
|
|
33
|
+
|
|
34
|
+
invariant(
|
|
35
|
+
themePreference,
|
|
36
|
+
"could not find theme preference context value; please ensure the component is wrapped in a <FiberyThemePreferenceContext>"
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return themePreference;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function useThemeMenuPreference(): ThemeMenuPreference {
|
|
43
|
+
const themeMenuPreference = useContext(FiberyThemeMenuPreferenceContext);
|
|
44
|
+
|
|
45
|
+
invariant(
|
|
46
|
+
themeMenuPreference,
|
|
47
|
+
"could not find theme menu preference context value; please ensure the component is wrapped in a <FiberyThemeMenuPreferenceContext>"
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return themeMenuPreference;
|
|
65
51
|
}
|
|
66
52
|
|
|
67
53
|
export function applyThemeToRoot(theme: ThemeColors) {
|
|
@@ -71,13 +57,64 @@ export function applyThemeToRoot(theme: ThemeColors) {
|
|
|
71
57
|
});
|
|
72
58
|
}
|
|
73
59
|
|
|
74
|
-
export function RootThemeProvider({
|
|
75
|
-
|
|
60
|
+
export function RootThemeProvider({
|
|
61
|
+
initialThemeMode,
|
|
62
|
+
initialPreference,
|
|
63
|
+
initialMenuPreference,
|
|
64
|
+
children,
|
|
65
|
+
}: {
|
|
66
|
+
initialThemeMode: ThemeMode;
|
|
67
|
+
initialPreference: ThemePreference;
|
|
68
|
+
initialMenuPreference: ThemeMenuPreference;
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
}): JSX.Element {
|
|
71
|
+
const [themeMode, setThemeMode] = useState<ThemeMode>(initialThemeMode);
|
|
72
|
+
const [themePreference, setThemePreference] = useState<ThemePreference>(initialPreference);
|
|
73
|
+
const [themeMenuPreference, setThemeMenuPreference] = useState<ThemeMenuPreference>(initialMenuPreference);
|
|
76
74
|
const theme = getThemeColors(colors.brandColors.blue, themeMode);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
const unsubscribeMode = subscribeOnThemeModeChange(setThemeMode);
|
|
77
|
+
const unsubscribePreference = subscribeOnThemePreferenceChange(setThemePreference);
|
|
78
|
+
const unsubscribeMenuPreference = subscribeOnThemeMenuPreferenceChange(setThemeMenuPreference);
|
|
79
|
+
return () => {
|
|
80
|
+
unsubscribeMode();
|
|
81
|
+
unsubscribePreference();
|
|
82
|
+
unsubscribeMenuPreference();
|
|
83
|
+
};
|
|
84
|
+
}, []);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
const darkThemeClassName = "dark-theme";
|
|
87
|
+
const lightThemeAndDarkMenuClassName = "light-theme-and-dark-menu";
|
|
88
|
+
const meta = document.querySelector('meta[name="color-scheme"]');
|
|
89
|
+
let colorScheme = "light";
|
|
90
|
+
const documentElement = document.documentElement;
|
|
91
|
+
documentElement.classList.remove(darkThemeClassName);
|
|
92
|
+
documentElement.classList.remove(lightThemeAndDarkMenuClassName);
|
|
93
|
+
if (themeMode === "dark") {
|
|
94
|
+
documentElement.classList.add(darkThemeClassName);
|
|
95
|
+
colorScheme = "dark";
|
|
96
|
+
} else if (themeMode === "light2") {
|
|
97
|
+
documentElement.classList.add(lightThemeAndDarkMenuClassName);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
documentElement.style.colorScheme = colorScheme;
|
|
101
|
+
meta?.setAttribute("content", colorScheme);
|
|
102
|
+
|
|
103
|
+
return () => {
|
|
104
|
+
documentElement.classList.remove(darkThemeClassName);
|
|
105
|
+
documentElement.classList.remove(lightThemeAndDarkMenuClassName);
|
|
106
|
+
};
|
|
107
|
+
}, [themeMode]);
|
|
77
108
|
useEffect(() => {
|
|
78
109
|
applyThemeToRoot(theme);
|
|
79
110
|
}, [theme]);
|
|
80
|
-
return
|
|
111
|
+
return (
|
|
112
|
+
<FiberyThemePreferenceContext.Provider value={themePreference}>
|
|
113
|
+
<FiberyThemeMenuPreferenceContext.Provider value={themeMenuPreference}>
|
|
114
|
+
<ThemeProvider theme={theme}>{children}</ThemeProvider>
|
|
115
|
+
</FiberyThemeMenuPreferenceContext.Provider>
|
|
116
|
+
</FiberyThemePreferenceContext.Provider>
|
|
117
|
+
);
|
|
81
118
|
}
|
|
82
119
|
|
|
83
120
|
interface WithThemeModeProps {
|
|
@@ -100,4 +137,4 @@ export function withThemeMode<T extends WithThemeModeProps = WithThemeModeProps>
|
|
|
100
137
|
return ComponentWithThemeMode;
|
|
101
138
|
}
|
|
102
139
|
|
|
103
|
-
export {ThemeProvider
|
|
140
|
+
export {ThemeProvider};
|
package/src/antd/styles.ts
CHANGED
|
@@ -32,15 +32,15 @@ export const inputOverrides = {
|
|
|
32
32
|
transition: `box-shadow ${transition}`,
|
|
33
33
|
},
|
|
34
34
|
disabled: {
|
|
35
|
-
color: `${themeVars.accentTextColor}`,
|
|
35
|
+
color: `${themeVars.accentTextColor} !important`,
|
|
36
36
|
backgroundColor: `${themeVars.inputDisabledBgColor} !important`,
|
|
37
37
|
borderColor: colors.transparent,
|
|
38
|
-
boxShadow: `${themeVars.
|
|
38
|
+
boxShadow: `${themeVars.inputDisabledBorderColor} !important`,
|
|
39
39
|
transition: `box-shadow ${transition}`,
|
|
40
40
|
WebkitTextFillColor: "currentColor",
|
|
41
41
|
cursor: "default",
|
|
42
42
|
":hover": {
|
|
43
|
-
boxShadow: `${themeVars.
|
|
43
|
+
boxShadow: `${themeVars.inputDisabledBorderColor}`,
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
};
|
package/src/designSystem.ts
CHANGED
|
@@ -129,7 +129,7 @@ const lightColors = {
|
|
|
129
129
|
pageBg: whiteA.whiteA0,
|
|
130
130
|
pageContentBg: whiteA.whiteA0,
|
|
131
131
|
sidebarBg: whiteA.whiteA0,
|
|
132
|
-
sidebarShadow: `-3px 0px 10px 0px ${getOpacities(
|
|
132
|
+
sidebarShadow: `-3px 0px 10px 0px ${getOpacities(slate.slate10).opacity10}`,
|
|
133
133
|
menuBg: sage.sage3,
|
|
134
134
|
menuFooterColor: getOpacities(whiteA.whiteA0).opacity20,
|
|
135
135
|
menuFooterHoverColor: getOpacities(whiteA.whiteA0).opacity40,
|
|
@@ -137,7 +137,7 @@ const lightColors = {
|
|
|
137
137
|
textSelectionColor: getOpacities(blue.blue10).opacity20,
|
|
138
138
|
accentTextColor: slate.slate10,
|
|
139
139
|
disabledTextColor: slate.slate9,
|
|
140
|
-
inversedTextColor:
|
|
140
|
+
inversedTextColor: slate.slate3,
|
|
141
141
|
linkColor: indigoDark.indigo10,
|
|
142
142
|
linkBorder: `1px solid ${getOpacities(indigoDark.indigo10).opacity20}`,
|
|
143
143
|
linkHoverColor: indigo.indigo10,
|
|
@@ -154,12 +154,14 @@ const lightColors = {
|
|
|
154
154
|
shortcutBorderColor: `1px solid ${getOpacities(slate.slate8).opacity20}`,
|
|
155
155
|
inputBgColor: whiteA.whiteA0,
|
|
156
156
|
inputDisabledBgColor: slate.slate2,
|
|
157
|
+
inputDisabledBorderColor: `0 0 0 1px ${getOpacities(slate.slate6).opacity20}`,
|
|
157
158
|
inputCopyBgColor: slate.slate3,
|
|
158
159
|
inputBorderColor: `0 0 0 1px ${getOpacities(slate.slate6).opacity70}`,
|
|
159
160
|
inputBorderHoverColor: `0 0 0 1px ${getOpacities(slate.slate6).opacity100}`,
|
|
160
161
|
inputPlaceholderTextColor: slate.slate10,
|
|
161
162
|
buttonColor: slate.slate10,
|
|
162
163
|
buttonPrimaryTextColor: slate.slate2,
|
|
164
|
+
checkboxColor: slate.slate10,
|
|
163
165
|
menuTextColor: slate.slate12,
|
|
164
166
|
selectedMenuTextColor: slate.slate2,
|
|
165
167
|
actionMenuBg: whiteA.whiteA0,
|
|
@@ -171,6 +173,12 @@ const lightColors = {
|
|
|
171
173
|
actionMenuInnerHover: slate.slate3,
|
|
172
174
|
actionMenuButtonColor: whiteA.whiteA0,
|
|
173
175
|
actionMenuButtonHoverColor: slate.slate1,
|
|
176
|
+
actionMenuButtonShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
177
|
+
getOpacities(slate.slate10).opacity20
|
|
178
|
+
}`,
|
|
179
|
+
actionMenuButtonShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 6px 8px -4px ${
|
|
180
|
+
getOpacities(slate.slate10).opacity30
|
|
181
|
+
}`,
|
|
174
182
|
separatorColor: getOpacities(slate.slate4).opacity50,
|
|
175
183
|
iconColor: slate.slate10,
|
|
176
184
|
menuIconColor: getOpacities(slate.slate10).opacity90,
|
|
@@ -184,8 +192,8 @@ const lightColors = {
|
|
|
184
192
|
entityCardShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
185
193
|
getOpacities(slate.slate10).opacity20
|
|
186
194
|
}`,
|
|
187
|
-
entityCardShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0
|
|
188
|
-
getOpacities(slate.slate10).
|
|
195
|
+
entityCardShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
196
|
+
getOpacities(slate.slate10).opacity20
|
|
189
197
|
}`,
|
|
190
198
|
unitBg: slate.slate3,
|
|
191
199
|
unitBgHover: slate.slate4,
|
|
@@ -198,8 +206,10 @@ const lightColors = {
|
|
|
198
206
|
commentColor: getOpacities(yellow.yellow6).opacity60,
|
|
199
207
|
cellBorderColor: getOpacities(slate.slate8).opacity50,
|
|
200
208
|
tableRowWarningColor: getOpacities(yellow.yellow6).opacity60,
|
|
201
|
-
|
|
209
|
+
errorBgColor: getOpacities(red.red9).opacity60,
|
|
210
|
+
warningBgColor: getOpacities(yellow.yellow6).opacity60,
|
|
202
211
|
warningButtonColor: yellow.yellow11,
|
|
212
|
+
infoBox: getOpacities(yellow.yellow4).opacity50,
|
|
203
213
|
appCardBgColor: whiteA.whiteA0,
|
|
204
214
|
appCardHoverColor: getOpacities(slate.slate1).opacity95,
|
|
205
215
|
appCardShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
@@ -209,6 +219,17 @@ const lightColors = {
|
|
|
209
219
|
getOpacities(slate.slate10).opacity30
|
|
210
220
|
}`,
|
|
211
221
|
modalBg: getOpacities(slate.slate11).opacity20,
|
|
222
|
+
modalShadow: `${getOpacities(slate.slate10).opacity10} 0px 16px 70px`,
|
|
223
|
+
modalContentBg: whiteA.whiteA0,
|
|
224
|
+
progressIconBg: getOpacities(slate.slate12).opacity10,
|
|
225
|
+
progressIconFill: getOpacities(slate.slate12).opacity80,
|
|
226
|
+
progressIconDoneBg: getOpacities(slate.slate12).opacity80,
|
|
227
|
+
progressIconDoneFill: getOpacities(slate.slate1).opacity95,
|
|
228
|
+
instrumentsMenuBg: getOpacities(whiteA.whiteA0).opacity85,
|
|
229
|
+
instrumentsMenuShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
230
|
+
getOpacities(slate.slate10).opacity20
|
|
231
|
+
}`,
|
|
232
|
+
selectedColorBorder: getOpacities(slate.slate6).opacity50,
|
|
212
233
|
//end
|
|
213
234
|
placeholderTextColor: "#65788B",
|
|
214
235
|
disabledInversedTextColor: shades.light,
|
|
@@ -218,7 +239,6 @@ const lightColors = {
|
|
|
218
239
|
cardBg: "#FFFFFF",
|
|
219
240
|
cardSelected: "#FFFB8F",
|
|
220
241
|
cardSelectedHover: "rgba(240, 244, 247, 0.6)",
|
|
221
|
-
infoBox: "rgba(255, 212, 0, 0.2)",
|
|
222
242
|
errorBg: "rgba(255, 241, 240, 1)",
|
|
223
243
|
timelineCard: "#FCE07D",
|
|
224
244
|
transparent,
|
|
@@ -228,6 +248,22 @@ const lightColors = {
|
|
|
228
248
|
inversedSeparators,
|
|
229
249
|
} as const;
|
|
230
250
|
|
|
251
|
+
const darkMenu = {
|
|
252
|
+
menuBg: slateDark.slate2,
|
|
253
|
+
menuFooterColor: getOpacities(slateDark.slate3).opacity20,
|
|
254
|
+
menuFooterHoverColor: getOpacities(slateDark.slate3).opacity40,
|
|
255
|
+
menuTextColor: slate.slate8,
|
|
256
|
+
menuIconColor: getOpacities(slate.slate10).opacity90,
|
|
257
|
+
selectedMenuIconColor: getOpacities(slate.slate1).opacity90,
|
|
258
|
+
selectedMenuTextColor: slate.slate2,
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const light2Colors = {
|
|
262
|
+
...lightColors,
|
|
263
|
+
...darkMenu,
|
|
264
|
+
mode: "light2",
|
|
265
|
+
} as const;
|
|
266
|
+
|
|
231
267
|
const darkColors = {
|
|
232
268
|
mode: "dark",
|
|
233
269
|
brandColors,
|
|
@@ -240,16 +276,13 @@ const darkColors = {
|
|
|
240
276
|
panelContentBg: slateDark.slate2,
|
|
241
277
|
pageBg: slateDark.slate1,
|
|
242
278
|
pageContentBg: slateDark.slate2,
|
|
243
|
-
sidebarBg: slateDark.
|
|
279
|
+
sidebarBg: slateDark.slate3,
|
|
244
280
|
sidebarShadow: `-3px 0px 10px 0px ${getOpacities(slateDark.slate1).opacity80}`,
|
|
245
|
-
menuBg: slateDark.slate2,
|
|
246
|
-
menuFooterColor: getOpacities(slateDark.slate3).opacity20,
|
|
247
|
-
menuFooterHoverColor: getOpacities(slateDark.slate3).opacity40,
|
|
248
281
|
textColor: slate.slate6,
|
|
249
282
|
textSelectionColor: getOpacities(blueDark.blue10).opacity40,
|
|
250
283
|
accentTextColor: slate.slate10,
|
|
251
284
|
disabledTextColor: slateDark.slate9,
|
|
252
|
-
inversedTextColor:
|
|
285
|
+
inversedTextColor: slateDark.slate6,
|
|
253
286
|
linkColor: indigoDark.indigo11,
|
|
254
287
|
linkBorder: `1px solid ${getOpacities(indigoDark.indigo11).opacity40}`,
|
|
255
288
|
linkHoverColor: indigoDark.indigo10,
|
|
@@ -266,14 +299,14 @@ const darkColors = {
|
|
|
266
299
|
shortcutBorderColor: `1px solid ${getOpacities(slateDark.slate10).opacity20}`,
|
|
267
300
|
inputBgColor: slateDark.slate2,
|
|
268
301
|
inputDisabledBgColor: slateDark.slate3,
|
|
302
|
+
inputDisabledBorderColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity20}`,
|
|
269
303
|
inputCopyBgColor: slateDark.slate4,
|
|
270
304
|
inputBorderColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity70}`,
|
|
271
305
|
inputBorderHoverColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity70}`,
|
|
272
306
|
inputPlaceholderTextColor: slate.slate10,
|
|
273
307
|
buttonColor: slateDark.slate10,
|
|
274
308
|
buttonPrimaryTextColor: slate.slate6,
|
|
275
|
-
|
|
276
|
-
selectedMenuTextColor: slate.slate2,
|
|
309
|
+
checkboxColor: slateDark.slate10,
|
|
277
310
|
actionMenuBg: slateDark.slate4,
|
|
278
311
|
actionMenuInnerBg: slateDark.slate5,
|
|
279
312
|
actionMenuShadow: `0 0 0 1px ${getOpacities(slateDark.slate1).opacity10}, 0 12px 16px -4px ${
|
|
@@ -283,10 +316,14 @@ const darkColors = {
|
|
|
283
316
|
actionMenuInnerHover: getOpacities(slateDark.slate7).opacity50,
|
|
284
317
|
actionMenuButtonColor: slateDark.slate2,
|
|
285
318
|
actionMenuButtonHoverColor: slateDark.slate3,
|
|
319
|
+
actionMenuButtonShadow: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${
|
|
320
|
+
getOpacities(slateDark.slate2).opacity20
|
|
321
|
+
}`,
|
|
322
|
+
actionMenuButtonShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 6px 8px -4px ${
|
|
323
|
+
getOpacities(slateDark.slate2).opacity30
|
|
324
|
+
}`,
|
|
286
325
|
separatorColor: getOpacities(slateDark.slate8).opacity50,
|
|
287
326
|
iconColor: slate.slate9,
|
|
288
|
-
menuIconColor: getOpacities(slate.slate10).opacity90,
|
|
289
|
-
selectedMenuIconColor: getOpacities(slate.slate1).opacity90,
|
|
290
327
|
appIconColor: getOpacities(slate.slate2).opacity70,
|
|
291
328
|
mentionBgColor: slateDark.slate5,
|
|
292
329
|
entityCardBgColor: slateDark.slate4,
|
|
@@ -296,8 +333,8 @@ const darkColors = {
|
|
|
296
333
|
entityCardShadow: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${
|
|
297
334
|
getOpacities(slateDark.slate2).opacity20
|
|
298
335
|
}`,
|
|
299
|
-
entityCardShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0
|
|
300
|
-
getOpacities(slateDark.slate2).
|
|
336
|
+
entityCardShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${
|
|
337
|
+
getOpacities(slateDark.slate2).opacity20
|
|
301
338
|
}`,
|
|
302
339
|
unitBg: slateDark.slate6,
|
|
303
340
|
unitBgHover: slateDark.slate7,
|
|
@@ -310,8 +347,10 @@ const darkColors = {
|
|
|
310
347
|
commentColor: getOpacities(yellowDark.yellow9).opacity40,
|
|
311
348
|
cellBorderColor: getOpacities(slateDark.slate9).opacity50,
|
|
312
349
|
tableRowWarningColor: getOpacities(yellowDark.yellow9).opacity40,
|
|
313
|
-
|
|
350
|
+
errorBgColor: getOpacities(redDark.red9).opacity60,
|
|
351
|
+
warningBgColor: getOpacities(yellowDark.yellow8).opacity60,
|
|
314
352
|
warningButtonColor: yellowDark.yellow11,
|
|
353
|
+
infoBox: getOpacities(yellowDark.yellow8).opacity40,
|
|
315
354
|
appCardBgColor: slateDark.slate2,
|
|
316
355
|
appCardHoverColor: slateDark.slate2,
|
|
317
356
|
appCardShadow: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity50}, 0 2px 4px -4px ${
|
|
@@ -320,7 +359,16 @@ const darkColors = {
|
|
|
320
359
|
appCardShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity60}, 0 6px 8px -4px ${
|
|
321
360
|
getOpacities(slateDark.slate1).opacity100
|
|
322
361
|
}`,
|
|
323
|
-
modalBg: getOpacities(slateDark.
|
|
362
|
+
modalBg: getOpacities(slateDark.slate2).opacity50,
|
|
363
|
+
modalShadow: `${getOpacities(slateDark.slate1).opacity40} 0px 16px 70px`,
|
|
364
|
+
modalContentBg: slateDark.slate3,
|
|
365
|
+
progressIconBg: getOpacities(slate.slate1).opacity10,
|
|
366
|
+
progressIconFill: getOpacities(slate.slate1).opacity60,
|
|
367
|
+
progressIconDoneBg: getOpacities(slate.slate1).opacity10,
|
|
368
|
+
progressIconDoneFill: getOpacities(slate.slate1).opacity80,
|
|
369
|
+
instrumentsMenuBg: getOpacities(slateDark.slate4).opacity95,
|
|
370
|
+
instrumentsMenuShadow: `0px 2px 8px ${getOpacities(slate.slate2).opacity95}`,
|
|
371
|
+
selectedColorBorder: getOpacities(slate.slate6).opacity20,
|
|
324
372
|
//end
|
|
325
373
|
placeholderTextColor: "#65788B",
|
|
326
374
|
disabledInversedTextColor: lights.light,
|
|
@@ -330,113 +378,6 @@ const darkColors = {
|
|
|
330
378
|
cardBg: slateDark.slate6,
|
|
331
379
|
cardSelected: slateDark.slate5,
|
|
332
380
|
cardSelectedHover: slateDark.slate5,
|
|
333
|
-
infoBox: "rgba(255, 212, 0, 0.2)",
|
|
334
|
-
errorBg: "rgba(255, 241, 240, 1)",
|
|
335
|
-
timelineCard: "#FCE07D",
|
|
336
|
-
transparent,
|
|
337
|
-
shades,
|
|
338
|
-
lights,
|
|
339
|
-
separators: inversedSeparators,
|
|
340
|
-
inversedSeparators: separators,
|
|
341
|
-
} as const;
|
|
342
|
-
|
|
343
|
-
const oldColors = {
|
|
344
|
-
mode: "old",
|
|
345
|
-
brandColors,
|
|
346
|
-
stateColors,
|
|
347
|
-
//old theme
|
|
348
|
-
whiteColor: whiteA.whiteA0,
|
|
349
|
-
blackColor: blackA.blackA0,
|
|
350
|
-
mainBg: sage.sage3,
|
|
351
|
-
panelBg: whiteA.whiteA0,
|
|
352
|
-
panelContentBg: sage.sage2,
|
|
353
|
-
pageBg: whiteA.whiteA0,
|
|
354
|
-
pageContentBg: whiteA.whiteA0,
|
|
355
|
-
sidebarBg: whiteA.whiteA0,
|
|
356
|
-
sidebarShadow: `-3px 0px 10px 0px ${getOpacities(sage.sage2).opacity80}`,
|
|
357
|
-
menuBg: "#132331",
|
|
358
|
-
menuFooterColor: "rgba(255, 255, 255, 0.05)",
|
|
359
|
-
menuFooterHoverColor: "rgba(255, 255, 255, 0.08)",
|
|
360
|
-
textColor: "#2A3844",
|
|
361
|
-
textSelectionColor: getOpacities(blue.blue10).opacity20,
|
|
362
|
-
accentTextColor: "#65788B",
|
|
363
|
-
disabledTextColor: shades.regular,
|
|
364
|
-
inversedTextColor: "#FFFFFF",
|
|
365
|
-
linkColor: indigoDark.indigo10,
|
|
366
|
-
linkBorder: `1px solid ${getOpacities(indigoDark.indigo10).opacity30}`,
|
|
367
|
-
linkHoverColor: indigo.indigo10,
|
|
368
|
-
linkBorderHover: `1px solid ${getOpacities(indigo.indigo10).opacity80}`,
|
|
369
|
-
codeColor: red.red9,
|
|
370
|
-
codeBgColor: makeChromaColor("#F24461").luminance(0.92).css(),
|
|
371
|
-
codeBlockBgColor: sage.sage3,
|
|
372
|
-
entityNodeColor: slateDark.slate3,
|
|
373
|
-
entityNodeBorder: `1px solid ${getOpacities(slateDark.slate3).opacity30}`,
|
|
374
|
-
entityNodeHoverColor: slateDark.slate7,
|
|
375
|
-
entityNodeBorderHover: `1px solid ${getOpacities(slate.slate11).opacity80}`,
|
|
376
|
-
entityNodeBgColor: getOpacities(slate.slate3).opacity80,
|
|
377
|
-
shortcutTextColor: slate.slate9,
|
|
378
|
-
shortcutBorderColor: `1px solid ${getOpacities(slate.slate8).opacity20}`,
|
|
379
|
-
inputBgColor: whiteA.whiteA0,
|
|
380
|
-
inputDisabledBgColor: slate.slate2,
|
|
381
|
-
inputCopyBgColor: slate.slate2,
|
|
382
|
-
inputBorderColor: `0 0 0 1px ${shades.thin}`,
|
|
383
|
-
inputBorderHoverColor: `0 0 0 1px ${shades.light}`,
|
|
384
|
-
inputPlaceholderTextColor: "#65788B",
|
|
385
|
-
buttonColor: slate.slate10,
|
|
386
|
-
buttonPrimaryTextColor: slate.slate6,
|
|
387
|
-
menuTextColor: "#FFFFFF",
|
|
388
|
-
selectedMenuTextColor: "#FFFFFF",
|
|
389
|
-
actionMenuBg: whiteA.whiteA0,
|
|
390
|
-
actionMenuInnerBg: whiteA.whiteA0,
|
|
391
|
-
actionMenuShadow: `0 0 0 1px rgba(17, 33, 58, 0.05), 0 16px 24px -8px rgba(17, 33, 58, 0.32)`,
|
|
392
|
-
actionMenuHover: "rgba(240, 244, 247, 1)",
|
|
393
|
-
actionMenuInnerHover: "rgba(240, 244, 247, 1)",
|
|
394
|
-
actionMenuButtonColor: whiteA.whiteA0,
|
|
395
|
-
actionMenuButtonHoverColor: slate.slate1,
|
|
396
|
-
separatorColor: slate.slate3,
|
|
397
|
-
iconColor: "#65788B",
|
|
398
|
-
menuIconColor: "#65788B",
|
|
399
|
-
selectedMenuIconColor: whiteA.whiteA0,
|
|
400
|
-
appIconColor: getOpacities(whiteA.whiteA0).opacity90,
|
|
401
|
-
mentionBgColor: slate.slate3,
|
|
402
|
-
entityCardBgColor: "#FFFFFF",
|
|
403
|
-
entityCardSelectedColor: "#FFFB8F",
|
|
404
|
-
entityCardHoverColor: "#FFFFFF",
|
|
405
|
-
entityCardDoneColor: lights.regular,
|
|
406
|
-
entityCardShadow: `0 0 0 1px rgba(17, 33, 58, .08), 0 4px 4px -4px rgba(17, 33, 58, .40)`,
|
|
407
|
-
entityCardShadowHover: `0 0 0 1px rgba(17, 33, 58, .1), 0 4px 8px -4px rgba(17, 33, 58, .68)`,
|
|
408
|
-
unitBg: "rgba(220, 224, 228, 0.33)",
|
|
409
|
-
unitBgHover: "rgba(220, 224, 228, 0.63)",
|
|
410
|
-
badgeBgColor: getOpacities("#65788B").regular,
|
|
411
|
-
tooltipBgColor: slateDark.slate5,
|
|
412
|
-
todayMarkerColor: red.red8,
|
|
413
|
-
viewBgOverlayColor: getOpacities(slate.slate8).opacity20,
|
|
414
|
-
floatEditorMenuBg: slate.slate1,
|
|
415
|
-
floatEditorActiveColor: indigoDark.indigo10,
|
|
416
|
-
commentColor: getOpacities(yellow.yellow6).opacity60,
|
|
417
|
-
cellBorderColor: getOpacities(slate.slate4).opacity50,
|
|
418
|
-
tableRowWarningColor: getOpacities(yellow.yellow6).opacity60,
|
|
419
|
-
warningBgColor: yellow.yellow6,
|
|
420
|
-
warningButtonColor: yellow.yellow11,
|
|
421
|
-
appCardBgColor: whiteA.whiteA0,
|
|
422
|
-
appCardHoverColor: getOpacities(slate.slate1).opacity95,
|
|
423
|
-
appCardShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
|
|
424
|
-
getOpacities(slate.slate10).opacity20
|
|
425
|
-
}`,
|
|
426
|
-
appCardShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 6px 8px -4px ${
|
|
427
|
-
getOpacities(slate.slate10).opacity30
|
|
428
|
-
}`,
|
|
429
|
-
modalBg: getOpacities(slate.slate11).opacity20,
|
|
430
|
-
//end
|
|
431
|
-
placeholderTextColor: "#65788B",
|
|
432
|
-
disabledInversedTextColor: lights.light,
|
|
433
|
-
danger: brandColors.red,
|
|
434
|
-
active: brandColors.red,
|
|
435
|
-
warning: "#FFD41E",
|
|
436
|
-
cardBg: "#FFFFFF",
|
|
437
|
-
cardSelected: "#FFFB8F",
|
|
438
|
-
cardSelectedHover: "rgba(240, 244, 247, 0.6)",
|
|
439
|
-
infoBox: "rgba(255, 212, 0, 0.2)",
|
|
440
381
|
errorBg: "rgba(255, 241, 240, 1)",
|
|
441
382
|
timelineCard: "#FCE07D",
|
|
442
383
|
transparent,
|
|
@@ -444,6 +385,7 @@ const oldColors = {
|
|
|
444
385
|
lights,
|
|
445
386
|
separators: inversedSeparators,
|
|
446
387
|
inversedSeparators: separators,
|
|
388
|
+
...darkMenu,
|
|
447
389
|
} as const;
|
|
448
390
|
|
|
449
391
|
export function getLightColors(): typeof lightColors {
|
|
@@ -460,19 +402,22 @@ export function getDarkColors(): typeof darkColors {
|
|
|
460
402
|
return darkColors;
|
|
461
403
|
}
|
|
462
404
|
|
|
463
|
-
export function
|
|
405
|
+
export function getLight2Colors(): typeof light2Colors {
|
|
464
406
|
if (process.env.NODE_ENV !== "test") {
|
|
465
407
|
throw new Error("Only for test purpose");
|
|
466
408
|
}
|
|
467
|
-
return
|
|
409
|
+
return light2Colors;
|
|
468
410
|
}
|
|
469
411
|
|
|
470
412
|
const getDefaultTheme = (): never => {
|
|
471
413
|
throw Error("Please specify theme mode");
|
|
472
414
|
};
|
|
473
415
|
|
|
474
|
-
export function getThemeValue<T>(theme: ThemeMode, values:
|
|
475
|
-
|
|
416
|
+
export function getThemeValue<T>(theme: ThemeMode, values: {light: T; light2?: T; dark: T}): T {
|
|
417
|
+
if (theme in values) {
|
|
418
|
+
return values[theme] as T;
|
|
419
|
+
}
|
|
420
|
+
return values.light;
|
|
476
421
|
}
|
|
477
422
|
|
|
478
423
|
function getTypeColors(themeColor: string, theme: ThemeMode) {
|
|
@@ -486,19 +431,6 @@ function getTypeColors(themeColor: string, theme: ThemeMode) {
|
|
|
486
431
|
}
|
|
487
432
|
const boardBg = chroma(color).luminance(0.85).desaturate(0.2).set("hsl.h", "+2");
|
|
488
433
|
|
|
489
|
-
const oldTypeColors = {
|
|
490
|
-
primary: color,
|
|
491
|
-
opacity: getOpacities(color),
|
|
492
|
-
darkenPrimary: getDarkenColor(color),
|
|
493
|
-
brightenPrimary: chroma(color).luminance(0.92).desaturate(0.1).alpha(0.98).css(),
|
|
494
|
-
boardBg: boardBg.hex(),
|
|
495
|
-
boardBgOverlay: boardBg.alpha(0.8).css(),
|
|
496
|
-
headerBg: chroma(color).luminance(0.7).desaturate(0.5).set("hsl.h", "+2").css(),
|
|
497
|
-
detailsBg: chroma(color).luminance(0.85).hex(),
|
|
498
|
-
focus: chroma(color).alpha(0.25).css(),
|
|
499
|
-
separator: chroma(color).alpha(0.3).css(),
|
|
500
|
-
};
|
|
501
|
-
|
|
502
434
|
const lightTypeColors = {
|
|
503
435
|
primary: color,
|
|
504
436
|
opacity: getOpacities(color),
|
|
@@ -530,21 +462,21 @@ function getTypeColors(themeColor: string, theme: ThemeMode) {
|
|
|
530
462
|
return lightTypeColors;
|
|
531
463
|
case "dark":
|
|
532
464
|
return darkTypeColors;
|
|
533
|
-
case "
|
|
534
|
-
return
|
|
465
|
+
case "light2":
|
|
466
|
+
return lightTypeColors;
|
|
535
467
|
default:
|
|
536
|
-
return
|
|
468
|
+
return lightTypeColors;
|
|
537
469
|
}
|
|
538
470
|
}
|
|
539
471
|
|
|
540
|
-
type DesignColor = typeof darkColors | typeof lightColors | typeof
|
|
472
|
+
type DesignColor = typeof darkColors | typeof lightColors | typeof light2Colors;
|
|
541
473
|
|
|
542
474
|
export type ThemeColors = ReturnType<typeof getTypeColors> & DesignColor;
|
|
543
475
|
|
|
544
476
|
const colorsByTheme: Record<string, DesignColor> = {
|
|
545
477
|
dark: darkColors,
|
|
546
478
|
light: lightColors,
|
|
547
|
-
|
|
479
|
+
light2: light2Colors,
|
|
548
480
|
};
|
|
549
481
|
|
|
550
482
|
export const getThemeColors: (themeColor: string, theme: ThemeMode) => ThemeColors = _.memoize(
|
|
@@ -569,11 +501,20 @@ export const getBrightenColor = (color: string): string => {
|
|
|
569
501
|
export const getLinkedHighlightBackgroundColor = (themeColors: ThemeColors, color: string): string => {
|
|
570
502
|
switch (themeColors.mode) {
|
|
571
503
|
case "dark":
|
|
572
|
-
return makeChromaColor(color).alpha(0.4).luminance(0.5).css(
|
|
504
|
+
return makeChromaColor(color).alpha(0.4).luminance(0.5).css();
|
|
573
505
|
case "light":
|
|
574
|
-
return makeChromaColor(color).alpha(0.3).luminance(0.6).css(
|
|
506
|
+
return makeChromaColor(color).alpha(0.3).luminance(0.6).css();
|
|
507
|
+
default:
|
|
508
|
+
return makeChromaColor(color).alpha(0.3).luminance(0.6).css();
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
export const getEnumBackgroundColor = (themeMode: ThemeMode, color: string) => {
|
|
513
|
+
switch (themeMode) {
|
|
514
|
+
case "dark":
|
|
515
|
+
return makeChromaColor(color).darken(2.2).alpha(0.5).saturate(1).css();
|
|
575
516
|
default:
|
|
576
|
-
return
|
|
517
|
+
return color;
|
|
577
518
|
}
|
|
578
519
|
};
|
|
579
520
|
|
|
@@ -616,7 +557,6 @@ export const colors = {
|
|
|
616
557
|
cardSelectedHover: "rgba(240, 244, 247, 0.6)",
|
|
617
558
|
unitBg: "rgba(220, 224, 228, 0.33)",
|
|
618
559
|
infoBox: "rgba(255, 212, 0, 0.2)",
|
|
619
|
-
modalBg: "rgba(26, 42, 94, 0.3)",
|
|
620
560
|
errorBg: "rgba(255, 241, 240, 1)",
|
|
621
561
|
timelineCard: "#FCE07D",
|
|
622
562
|
timelineScaleSelectBorderColor: chroma("#FFFFFF").alpha(opacity.regular).css(),
|
|
@@ -709,13 +649,8 @@ export const viewBoxSize = "0 0 20 20";
|
|
|
709
649
|
export const avatarSize = 24;
|
|
710
650
|
|
|
711
651
|
export const shadows = {
|
|
712
|
-
light: `0 1px 3px ${shades.hairline}`,
|
|
713
|
-
lightReverted: `0 -1px 3px ${shades.hairline}`,
|
|
714
652
|
border: `0 0 0 1px ${shades.thin}`,
|
|
715
653
|
inversedBorder: `0 0 0 1px ${lights.thin}`,
|
|
716
|
-
cardRegular: "0 0 0 1px rgba(17, 33, 58, .08), 0 4px 4px -4px rgba(17, 33, 58, .40)",
|
|
717
|
-
cardHover: "0 0 0 1px rgba(17, 33, 58, .1), 0 4px 8px -4px rgba(17, 33, 58, .68)",
|
|
718
|
-
dragging: "0 0 0 1px rgba(17, 33, 58, .08), 0 4px 4px -4px rgba(17, 33, 58, .40)",
|
|
719
654
|
videoPreview: "0 4px 30px 4px rgba(0, 0, 0, .15)",
|
|
720
655
|
} as const;
|
|
721
656
|
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { IconDefinition } from '../types';
|
|
5
5
|
|
|
6
|
-
const AppStoreOneColor: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fill":"
|
|
6
|
+
const AppStoreOneColor: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"g","properties":{"fill":"#51B69D"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M13.73 8.229v4.488a.9.9 0 0 1-.9.9h-4.5a.9.9 0 1 1 0-1.8h2.328L5.794 6.954A.9.9 0 0 1 7.067 5.68l4.863 4.863V8.23a.9.9 0 0 1 1.8 0Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M1.03 5.7c0-4.113.588-4.7 4.7-4.7 4.113 0 4.7.587 4.7 4.7 0 .43-.006.821-.022 1.177l-1.59-1.59c-.01-.718-.046-1.24-.12-1.631-.084-.45-.197-.602-.259-.665-.062-.062-.215-.174-.664-.26-.462-.086-1.108-.121-2.045-.121-.937 0-1.582.035-2.044.122-.45.085-.602.197-.665.26-.062.062-.174.214-.259.664-.087.462-.122 1.107-.122 2.044s.035 1.582.122 2.044c.085.45.197.602.26.665.062.062.214.174.664.26.408.076.959.112 1.727.12l1.584 1.584c-.38.02-.8.027-1.267.027-4.113 0-4.7-.587-4.7-4.7ZM13.56 18.295c-3.555 0-4.48-.245-4.663-3.022h1.619c.018.213.046.203.076.366.085.45.197.602.26.665.062.062.214.174.664.259.462.087 1.108.122 2.045.122.937 0 1.582-.035 2.044-.122.45-.085.602-.197.664-.26.063-.062.175-.214.26-.664.087-.462.122-1.107.122-2.044s-.035-1.583-.122-2.045c-.085-.45-.197-.602-.26-.664-.062-.062-.214-.175-.664-.26-.163-.03-.157-.035-.37-.054V8.953c2.778.184 3.026 1.085 3.026 4.642 0 4.112-.588 4.7-4.7 4.7Z"},"children":[]}]}],"metadata":""}]},"name":"app-store-one-color"};
|
|
7
7
|
|
|
8
8
|
export default AppStoreOneColor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const Email: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"d":"M4.74 16H15.4c1.32 0 2.1-.79 2.1-2.268V6.268C17.5 4.79 16.72 4 15.26 4H4.595C3.273 4 2.5 4.79 2.5 6.268v7.464C2.5 15.217 3.28 16 4.74 16Zm4.543-5.831L4.593 5.43c.054-.007.113-.007.173-.007h10.462c.066 0 .132 0 .191.014l-4.69 4.73c-.27.27-.488.385-.726.385-.23 0-.449-.121-.72-.384ZM3.867 6.47l3.468 3.49-3.468 3.51v-7Zm8.811 3.483 3.448-3.463v6.966l-3.448-3.503Zm-7.912 4.63a1.21 1.21 0 0 1-.225-.02l3.672-3.72.317.318c.49.492.965.702 1.473.702.515 0 .991-.21 1.473-.702l.317-.317 3.673 3.718c-.073.014-.152.02-.238.02H4.766Z"},"children":[]}],"metadata":""}]},"name":"email"};
|
|
7
|
+
|
|
8
|
+
export default Email;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SidebarFields: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"d":"M15.237 7.492h-1.601a.516.516 0 0 1-.508-.5c0-.265.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492c0 .266-.234.5-.516.5ZM15.237 9.586h-1.601a.516.516 0 0 1-.508-.5c0-.266.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492c0 .266-.234.5-.516.5ZM13.636 11.672h1.601a.51.51 0 0 0 .516-.492.51.51 0 0 0-.516-.492h-1.601a.509.509 0 0 0-.508.492c0 .265.234.492.508.492Z"},"children":[]},{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M15.447 17H4.553C2.872 17 2 16.143 2 14.492V5.508C2 3.857 2.872 3 4.553 3h10.894C17.128 3 18 3.857 18 5.508v8.984C18 16.136 17.128 17 15.447 17ZM3.525 14.36c0 .75.397 1.127 1.121 1.127h6.233V4.513H4.646c-.724 0-1.12.37-1.12 1.119v8.729Zm12.95-8.728c0-.749-.405-1.12-1.121-1.12h-3.027v10.975h3.027c.716 0 1.12-.378 1.12-1.127V5.633Z"},"children":[]}],"metadata":""}]},"name":"sidebar-fields"};
|
|
7
|
+
|
|
8
|
+
export default SidebarFields;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SidebarFieldsOpened: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.553 17h10.894C17.128 17 18 16.136 18 14.492V5.508C18 3.857 17.128 3 15.447 3H4.553C2.872 3 2 3.857 2 5.508v8.984C2 16.143 2.872 17 4.553 17Zm.093-1.513c-.724 0-1.12-.378-1.12-1.127V5.633c0-.749.396-1.12 1.12-1.12h6.233v10.975H4.646Zm10.591-7.995h-1.601a.516.516 0 0 1-.508-.5c0-.265.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492c0 .266-.234.5-.516.5Zm0 2.094h-1.601a.516.516 0 0 1-.508-.5c0-.266.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492c0 .266-.234.5-.516.5Zm0 2.086h-1.601a.509.509 0 0 1-.508-.492c0-.266.234-.492.508-.492h1.601a.51.51 0 0 1 .516.492.51.51 0 0 1-.516.492Z"},"children":[]}],"metadata":""}]},"name":"sidebar-fields-opened"};
|
|
7
|
+
|
|
8
|
+
export default SidebarFieldsOpened;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SlackIcon: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M7.597 3.107a1.404 1.404 0 0 1 1.527.304 1.398 1.398 0 0 1 .41.99V5.8h-1.4a1.404 1.404 0 0 1-1.4-1.4 1.396 1.396 0 0 1 .863-1.293ZM4.4 6.733h3.733a1.404 1.404 0 0 1 1.4 1.4 1.396 1.396 0 0 1-.863 1.293c-.17.07-.353.107-.537.107H4.4a1.404 1.404 0 0 1-1.294-.864 1.396 1.396 0 0 1 .304-1.525 1.402 1.402 0 0 1 .99-.41Zm12.494.865a1.395 1.395 0 0 1 0 1.07 1.398 1.398 0 0 1-1.294.865h-1.4v-1.4a1.395 1.395 0 0 1 .864-1.293 1.404 1.404 0 0 1 1.526.304c.13.13.234.284.304.454ZM13.267 4.4v3.733a1.397 1.397 0 0 1-1.4 1.4 1.403 1.403 0 0 1-1.4-1.4V4.4a1.395 1.395 0 0 1 .864-1.293 1.403 1.403 0 0 1 1.526.304 1.398 1.398 0 0 1 .41.99Zm-1.4 12.6a1.404 1.404 0 0 0 1.4-1.4 1.397 1.397 0 0 0-1.4-1.4h-1.4v1.4a1.395 1.395 0 0 0 .864 1.293c.17.07.352.107.536.107Zm0-3.733H15.6a1.405 1.405 0 0 0 1.294-.865 1.395 1.395 0 0 0 0-1.07 1.4 1.4 0 0 0-1.294-.865h-3.733a1.403 1.403 0 0 0-1.4 1.4 1.397 1.397 0 0 0 1.4 1.4Zm-8.76-.865a1.396 1.396 0 0 1 .302-1.525 1.402 1.402 0 0 1 .991-.41h1.4v1.4a1.396 1.396 0 0 1-1.4 1.4 1.405 1.405 0 0 1-1.294-.865ZM3 11.867ZM6.733 15.6v-3.733a1.396 1.396 0 0 1 1.4-1.4 1.402 1.402 0 0 1 1.4 1.4V15.6a1.396 1.396 0 0 1-1.4 1.4 1.403 1.403 0 0 1-1.4-1.4Z"},"children":[]}],"metadata":""}]},"name":"slack-icon"};
|
|
7
|
+
|
|
8
|
+
export default SlackIcon;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SlideMenu: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"d":"M6.331 7.877H4.984c-.233 0-.384-.143-.384-.368V6.176c0-.233.143-.376.384-.376H6.33c.226 0 .369.143.369.376V7.51c0 .225-.15.368-.369.368ZM6.331 10.956H4.984c-.233 0-.384-.15-.384-.369v-1.34c0-.225.143-.376.384-.376H6.33c.226 0 .369.15.369.376v1.34c0 .218-.15.369-.369.369ZM4.984 14.02H6.33c.218 0 .369-.144.369-.37v-1.332c0-.226-.143-.376-.369-.376H4.984c-.241 0-.384.15-.384.376v1.333c0 .225.15.368.384.368Z"},"children":[]},{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M15.447 17H4.553C2.872 17 2 16.136 2 14.492V5.508C2 3.857 2.872 3 4.553 3h10.894C17.128 3 18 3.857 18 5.508v8.984C18 16.143 17.128 17 15.447 17Zm-.093-1.513c.724 0 1.12-.378 1.12-1.127V5.633c0-.749-.396-1.12-1.12-1.12H9.12v10.975h6.233ZM4.646 4.513c-.716 0-1.12.37-1.12 1.119v8.729c0 .748.404 1.126 1.12 1.126h3.028V4.513H4.646Z"},"children":[]}],"metadata":""}]},"name":"slide-menu"};
|
|
7
|
+
|
|
8
|
+
export default SlideMenu;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const SlideMenuOpened: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"width":20,"height":20},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.553 17h10.894C17.128 17 18 16.143 18 14.492V5.508C18 3.857 17.128 3 15.447 3H4.553C2.872 3 2 3.857 2 5.508v8.984C2 16.136 2.872 17 4.553 17Zm11.922-2.64c0 .75-.397 1.127-1.121 1.127H9.12V4.513h6.233c.724 0 1.12.37 1.12 1.119v8.729ZM6.33 7.878H4.984c-.233 0-.384-.143-.384-.368V6.176c0-.233.143-.376.384-.376H6.33c.226 0 .369.143.369.376V7.51c0 .225-.15.368-.369.368Zm0 3.079H4.984c-.233 0-.384-.15-.384-.369v-1.34c0-.225.143-.376.384-.376H6.33c.226 0 .369.15.369.376v1.34c0 .218-.15.369-.369.369Zm0 3.063H4.984c-.233 0-.384-.143-.384-.368v-1.333c0-.226.143-.376.384-.376H6.33c.226 0 .369.15.369.376v1.333c0 .225-.15.368-.369.368Z"},"children":[]}],"metadata":""}]},"name":"slide-menu-opened"};
|
|
7
|
+
|
|
8
|
+
export default SlideMenuOpened;
|
package/src/icons/ast/index.tsx
CHANGED
|
@@ -40,6 +40,7 @@ export { default as DoubleArrowLeft } from './DoubleArrowLeft';
|
|
|
40
40
|
export { default as DoubleArrowRight } from './DoubleArrowRight';
|
|
41
41
|
export { default as DragBlockHandle } from './DragBlockHandle';
|
|
42
42
|
export { default as DragHandle } from './DragHandle';
|
|
43
|
+
export { default as Email } from './Email';
|
|
43
44
|
export { default as ExtensionAssignments } from './ExtensionAssignments';
|
|
44
45
|
export { default as ExtensionAvatar } from './ExtensionAvatar';
|
|
45
46
|
export { default as ExtensionComments } from './ExtensionComments';
|
|
@@ -131,8 +132,13 @@ export { default as SelfReferenceOn } from './SelfReferenceOn';
|
|
|
131
132
|
export { default as Settings } from './Settings';
|
|
132
133
|
export { default as Share } from './Share';
|
|
133
134
|
export { default as Shared } from './Shared';
|
|
135
|
+
export { default as SidebarFieldsOpened } from './SidebarFieldsOpened';
|
|
136
|
+
export { default as SidebarFields } from './SidebarFields';
|
|
134
137
|
export { default as Sidebar } from './Sidebar';
|
|
138
|
+
export { default as SlackIcon } from './SlackIcon';
|
|
135
139
|
export { default as Slack } from './Slack';
|
|
140
|
+
export { default as SlideMenuOpened } from './SlideMenuOpened';
|
|
141
|
+
export { default as SlideMenu } from './SlideMenu';
|
|
136
142
|
export { default as SmartFolder } from './SmartFolder';
|
|
137
143
|
export { default as SortOnBottom } from './SortOnBottom';
|
|
138
144
|
export { default as SortOnTop } from './SortOnTop';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import EmailSvg from '../ast/Email';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const Email = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={EmailSvg} />;
|
|
10
|
+
|
|
11
|
+
Email.displayName = 'Email';
|
|
12
|
+
export default Email;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SidebarFieldsSvg from '../ast/SidebarFields';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SidebarFields = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SidebarFieldsSvg} />;
|
|
10
|
+
|
|
11
|
+
SidebarFields.displayName = 'SidebarFields';
|
|
12
|
+
export default SidebarFields;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SidebarFieldsOpenedSvg from '../ast/SidebarFieldsOpened';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SidebarFieldsOpened = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SidebarFieldsOpenedSvg} />;
|
|
10
|
+
|
|
11
|
+
SidebarFieldsOpened.displayName = 'SidebarFieldsOpened';
|
|
12
|
+
export default SidebarFieldsOpened;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SlackIconSvg from '../ast/SlackIcon';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SlackIcon = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SlackIconSvg} />;
|
|
10
|
+
|
|
11
|
+
SlackIcon.displayName = 'SlackIcon';
|
|
12
|
+
export default SlackIcon;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SlideMenuSvg from '../ast/SlideMenu';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SlideMenu = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SlideMenuSvg} />;
|
|
10
|
+
|
|
11
|
+
SlideMenu.displayName = 'SlideMenu';
|
|
12
|
+
export default SlideMenu;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import SlideMenuOpenedSvg from '../ast/SlideMenuOpened';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { IconBaseProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const SlideMenuOpened = (
|
|
8
|
+
props: IconBaseProps,
|
|
9
|
+
): JSX.Element => <Icon {...props} icon={SlideMenuOpenedSvg} />;
|
|
10
|
+
|
|
11
|
+
SlideMenuOpened.displayName = 'SlideMenuOpened';
|
|
12
|
+
export default SlideMenuOpened;
|
|
@@ -40,6 +40,7 @@ export { default as DoubleArrowLeft } from './DoubleArrowLeft';
|
|
|
40
40
|
export { default as DoubleArrowRight } from './DoubleArrowRight';
|
|
41
41
|
export { default as DragBlockHandle } from './DragBlockHandle';
|
|
42
42
|
export { default as DragHandle } from './DragHandle';
|
|
43
|
+
export { default as Email } from './Email';
|
|
43
44
|
export { default as ExtensionAssignments } from './ExtensionAssignments';
|
|
44
45
|
export { default as ExtensionAvatar } from './ExtensionAvatar';
|
|
45
46
|
export { default as ExtensionComments } from './ExtensionComments';
|
|
@@ -131,8 +132,13 @@ export { default as SelfReferenceOn } from './SelfReferenceOn';
|
|
|
131
132
|
export { default as Settings } from './Settings';
|
|
132
133
|
export { default as Share } from './Share';
|
|
133
134
|
export { default as Shared } from './Shared';
|
|
135
|
+
export { default as SidebarFieldsOpened } from './SidebarFieldsOpened';
|
|
136
|
+
export { default as SidebarFields } from './SidebarFields';
|
|
134
137
|
export { default as Sidebar } from './Sidebar';
|
|
138
|
+
export { default as SlackIcon } from './SlackIcon';
|
|
135
139
|
export { default as Slack } from './Slack';
|
|
140
|
+
export { default as SlideMenuOpened } from './SlideMenuOpened';
|
|
141
|
+
export { default as SlideMenu } from './SlideMenu';
|
|
136
142
|
export { default as SmartFolder } from './SmartFolder';
|
|
137
143
|
export { default as SortOnBottom } from './SortOnBottom';
|
|
138
144
|
export { default as SortOnTop } from './SortOnTop';
|
package/src/loading-sausage.tsx
CHANGED
|
@@ -139,7 +139,7 @@ type SausageListProps = {
|
|
|
139
139
|
amount?: number;
|
|
140
140
|
minAmount?: number;
|
|
141
141
|
maxAmount?: number;
|
|
142
|
-
WrapperComponent?: ({children}: {children: JSX.Element}) => JSX.Element;
|
|
142
|
+
WrapperComponent?: ({children}: {children: JSX.Element}) => JSX.Element | null;
|
|
143
143
|
} & Omit<Props, "index">;
|
|
144
144
|
export const LoadingSausageList = memo<SausageListProps>(function LoadingSausageList({
|
|
145
145
|
amount,
|
package/src/theme-settings.ts
CHANGED
|
@@ -2,12 +2,15 @@ import {getMediaQueryList, subscribeOnChange as subscribeOnMediaQueryChange} fro
|
|
|
2
2
|
|
|
3
3
|
const listenersThemeMode = new Map();
|
|
4
4
|
const listenersThemePreference = new Map();
|
|
5
|
+
const listenersThemeMenuPreference = new Map();
|
|
5
6
|
|
|
6
7
|
const themePreferenceKey = "theme-preference";
|
|
8
|
+
const themeMenuPreferenceKey = "theme-menu-preference";
|
|
7
9
|
|
|
8
10
|
export type ThemePreference = "dark" | "light" | "auto";
|
|
11
|
+
export type ThemeMenuPreference = "dark" | "auto";
|
|
9
12
|
|
|
10
|
-
export type ThemeMode = "dark" | "light" | "
|
|
13
|
+
export type ThemeMode = "dark" | "light" | "light2";
|
|
11
14
|
|
|
12
15
|
export function getThemePreference(): ThemePreference {
|
|
13
16
|
try {
|
|
@@ -19,6 +22,18 @@ export function getThemePreference(): ThemePreference {
|
|
|
19
22
|
} else if (item === "light") {
|
|
20
23
|
return "light";
|
|
21
24
|
}
|
|
25
|
+
} catch (e) {
|
|
26
|
+
return "light";
|
|
27
|
+
}
|
|
28
|
+
return "light";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getThemeMenuPreference(): ThemeMenuPreference {
|
|
32
|
+
try {
|
|
33
|
+
const item = localStorage.getItem(themeMenuPreferenceKey);
|
|
34
|
+
if (item === "dark") {
|
|
35
|
+
return "dark";
|
|
36
|
+
}
|
|
22
37
|
} catch (e) {
|
|
23
38
|
return "auto";
|
|
24
39
|
}
|
|
@@ -33,15 +48,42 @@ function getDarkMediaQuery() {
|
|
|
33
48
|
|
|
34
49
|
export function getThemeMode(): ThemeMode {
|
|
35
50
|
const preference = getThemePreference();
|
|
51
|
+
const menuPreference = getThemeMenuPreference();
|
|
36
52
|
|
|
37
53
|
if (preference === "auto") {
|
|
38
|
-
|
|
54
|
+
const matches = getDarkMediaQuery().matches;
|
|
55
|
+
if (matches) {
|
|
56
|
+
return "dark";
|
|
57
|
+
}
|
|
58
|
+
if (menuPreference === "dark") {
|
|
59
|
+
return "light2";
|
|
60
|
+
}
|
|
61
|
+
return "light";
|
|
39
62
|
} else if (preference === "dark") {
|
|
40
63
|
return "dark";
|
|
41
64
|
}
|
|
65
|
+
if (menuPreference === "dark") {
|
|
66
|
+
return "light2";
|
|
67
|
+
}
|
|
42
68
|
return "light";
|
|
43
69
|
}
|
|
44
70
|
|
|
71
|
+
export function setThemeMenuPreference(menuPreference: ThemeMenuPreference) {
|
|
72
|
+
try {
|
|
73
|
+
if (getThemeMenuPreference() !== menuPreference) {
|
|
74
|
+
localStorage.setItem(themeMenuPreferenceKey, menuPreference);
|
|
75
|
+
listenersThemeMode.forEach((cb) => {
|
|
76
|
+
cb(getThemeMode());
|
|
77
|
+
});
|
|
78
|
+
listenersThemeMenuPreference.forEach((cb) => {
|
|
79
|
+
cb(menuPreference);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
} catch (e) {
|
|
83
|
+
// skip error
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
45
87
|
export function setThemePreference(preference: ThemePreference) {
|
|
46
88
|
try {
|
|
47
89
|
if (getThemePreference() !== preference) {
|
|
@@ -58,6 +100,25 @@ export function setThemePreference(preference: ThemePreference) {
|
|
|
58
100
|
}
|
|
59
101
|
}
|
|
60
102
|
|
|
103
|
+
export function subscribeOnThemeMenuPreferenceChange(
|
|
104
|
+
cb: (themeMenuPreference: ThemeMenuPreference) => void
|
|
105
|
+
): () => void {
|
|
106
|
+
listenersThemeMenuPreference.set(cb, cb);
|
|
107
|
+
let currentPref = getThemeMenuPreference();
|
|
108
|
+
const storageListener = () => {
|
|
109
|
+
const newMenuPref = getThemeMenuPreference();
|
|
110
|
+
if (currentPref !== newMenuPref) {
|
|
111
|
+
currentPref = newMenuPref;
|
|
112
|
+
cb(newMenuPref);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
window.addEventListener("storage", storageListener);
|
|
116
|
+
return () => {
|
|
117
|
+
listenersThemeMenuPreference.delete(cb);
|
|
118
|
+
window.removeEventListener("storage", storageListener);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
61
122
|
export function subscribeOnThemePreferenceChange(cb: (themePreference: ThemePreference) => void): () => void {
|
|
62
123
|
listenersThemePreference.set(cb, cb);
|
|
63
124
|
let currentPref = getThemePreference();
|
|
@@ -78,11 +139,14 @@ export function subscribeOnThemePreferenceChange(cb: (themePreference: ThemePref
|
|
|
78
139
|
export function subscribeOnThemeModeChange(cb: (themeMode: ThemeMode) => void): () => void {
|
|
79
140
|
listenersThemeMode.set(cb, cb);
|
|
80
141
|
let currentPref = getThemePreference();
|
|
142
|
+
let currentMenuPref = getThemeMenuPreference();
|
|
81
143
|
const darkMediaQuery = getDarkMediaQuery();
|
|
82
144
|
const storageListener = () => {
|
|
83
145
|
const newPref = getThemePreference();
|
|
84
|
-
|
|
146
|
+
const newMenuPref = getThemeMenuPreference();
|
|
147
|
+
if (currentPref !== newPref || currentMenuPref !== newMenuPref) {
|
|
85
148
|
currentPref = newPref;
|
|
149
|
+
currentMenuPref = newMenuPref;
|
|
86
150
|
cb(getThemeMode());
|
|
87
151
|
}
|
|
88
152
|
};
|