@fibery/ui-kit 1.40.4 → 1.42.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/CHANGELOG.md +18 -0
- package/eslint.config.mjs +16 -0
- package/package.json +10 -9
- package/src/a11y-color.test.ts +5 -24
- package/src/actions-menu/actions-menu-item.tsx +6 -9
- package/src/actions-menu/context-actions-menu.tsx +8 -3
- package/src/ai/model.tsx +0 -1
- package/src/ai/temperature.tsx +0 -1
- package/src/animated-height-container.tsx +3 -3
- package/src/antd/index.tsx +3 -0
- package/src/antd/input.tsx +0 -1
- package/src/antd/styles.ts +9 -9
- package/src/app-icon-with-fallback.tsx +5 -5
- package/src/app-icon-wrapper.tsx +2 -3
- package/src/app-icon.tsx +3 -3
- package/src/avatar.tsx +3 -3
- package/src/button/base-button.tsx +0 -1
- package/src/button/make-button-colors.ts +2 -2
- package/src/checkbox.tsx +1 -1
- package/src/collapsible-section.tsx +11 -1
- package/src/color-utils.test.ts +15 -25
- package/src/color-utils.ts +43 -8
- package/src/command-menu/index.tsx +1 -0
- package/src/context-menu/index.tsx +5 -5
- package/src/date-picker/contexts.ts +2 -2
- package/src/date-picker/date-range-picker-popup-content.tsx +1 -2
- package/src/date-picker/date-range-picker.tsx +29 -31
- package/src/date-picker/single-date-picker-popup-content.tsx +1 -2
- package/src/date-picker/single-date-picker.tsx +149 -124
- package/src/date-picker/types.ts +4 -4
- package/src/day-select/iso-week-day-select.tsx +2 -2
- package/src/day-select/week-day-select.tsx +2 -2
- package/src/delayed.tsx +0 -1
- package/src/design-system/alpha.test.ts +59 -0
- package/src/design-system/alpha.ts +41 -0
- package/src/design-system/animation.ts +10 -0
- package/src/design-system/colors-css.test.ts +39 -0
- package/src/design-system/colors-css.ts +25 -0
- package/src/design-system/colors-js.test.ts +232 -0
- package/src/design-system/colors-js.ts +107 -0
- package/src/design-system/colors.test.ts +74 -0
- package/src/{design-system.colors.ts → design-system/colors.ts} +133 -134
- package/src/design-system/date.ts +3 -0
- package/src/design-system/layout.ts +106 -0
- package/src/design-system/theme.test.ts +94 -0
- package/src/design-system/theme.ts +93 -0
- package/src/design-system/typography.ts +179 -0
- package/src/design-system/vars.test.ts +1679 -0
- package/src/design-system/vars.ts +52 -0
- package/src/design-system.test.ts +46 -303
- package/src/design-system.ts +25 -545
- package/src/dropdown-menu/index.tsx +5 -5
- package/src/emoji-picker/icon-emoji-picker.tsx +1 -1
- package/src/fibermoji-placeholder.tsx +3 -3
- package/src/field-container.tsx +11 -2
- package/src/file-item/file-icon.tsx +3 -3
- package/src/file-item-2.tsx +4 -10
- package/src/file-item.tsx +0 -1
- package/src/icons/ast/ChatBubble.ts +8 -0
- package/src/icons/ast/ChatFloat.ts +8 -0
- package/src/icons/ast/ChatSidebar.ts +8 -0
- package/src/icons/ast/FileOther.ts +8 -0
- package/src/icons/ast/NoBorder.ts +8 -0
- package/src/icons/ast/NoFill.ts +8 -0
- package/src/icons/ast/index.tsx +6 -0
- package/src/icons/react/ChatBubble.tsx +13 -0
- package/src/icons/react/ChatFloat.tsx +13 -0
- package/src/icons/react/ChatSidebar.tsx +13 -0
- package/src/icons/react/FileOther.tsx +13 -0
- package/src/icons/react/NoBorder.tsx +13 -0
- package/src/icons/react/NoFill.tsx +13 -0
- package/src/icons/react/index.tsx +6 -0
- package/src/icons/svg/chat-bubble.svg +4 -0
- package/src/icons/svg/chat-float.svg +4 -0
- package/src/icons/svg/chat-sidebar.svg +4 -0
- package/src/icons/svg/file-other.svg +3 -0
- package/src/icons/svg/no-border.svg +17 -0
- package/src/icons/svg/no-fill.svg +4 -0
- package/src/images-gallery/images-gallery.tsx +8 -6
- package/src/images-gallery/slide-buttons.tsx +2 -2
- package/src/is-iOS.ts +0 -1
- package/src/is-in-popup.ts +2 -1
- package/src/lists/actions-menu-row-surface.tsx +4 -4
- package/src/loading-sausage.tsx +2 -2
- package/src/media-query-utils.ts +1 -2
- package/src/mobile-keyboard-aware-popup.tsx +2 -2
- package/src/modal-menu/modal-menu-content.tsx +2 -2
- package/src/number-input/decimal.js +9 -7
- package/src/number-input/{number-inline-input-with-autosize.tsx → number-input-inline-with-autosize.tsx} +20 -41
- package/src/number-input/number-input-inline.tsx +118 -0
- package/src/number-input/{index.test.js → number-input.test.tsx} +38 -43
- package/src/number-input/number-input.tsx +63 -121
- package/src/number-input/types.ts +19 -0
- package/src/number-input/utils.ts +61 -0
- package/src/online-users.tsx +2 -2
- package/src/palette-generator.test.ts +24 -281
- package/src/palette-generator.ts +39 -45
- package/src/palettes/_.ts +72 -0
- package/src/palettes/slate-arch.colors-snapshot.test.ts +1689 -0
- package/src/palettes/slate-arch.ts +188 -0
- package/src/palettes/slate-user.colors-snapshot.test.ts +1689 -0
- package/src/palettes/slate-user.ts +187 -0
- package/src/palettes/warm-arch.colors-snapshot.test.ts +1689 -0
- package/src/palettes/warm-arch.ts +222 -0
- package/src/palettes/warm-user.colors-snapshot.test.ts +1689 -0
- package/src/palettes/warm-user.ts +222 -0
- package/src/popover/get-element-ref.ts +28 -0
- package/src/popover/index.tsx +232 -333
- package/src/popover/{mobile-popup-context.tsx → mobile-popover-context.tsx} +7 -7
- package/src/popover/mobile-popover.tsx +169 -0
- package/src/popover/modifiers.tsx +2 -2
- package/src/popover/popup-stack-context.tsx +8 -9
- package/src/root-theme-provider.test.tsx +114 -19
- package/src/scale-generator.ts +31 -22
- package/src/select/components/menu-list-virtualized.tsx +5 -3
- package/src/select/index.tsx +6 -5
- package/src/select/select.tsx +36 -38
- package/src/select/util.ts +1 -1
- package/src/static-palettes.ts +221 -11
- package/src/thematic-controls.tsx +6 -6
- package/src/thematic-scales.tsx +15 -15
- package/src/thematic-state.ts +57 -20
- package/src/thematic.tsx +36 -32
- package/src/theme-provider.test.tsx +31 -19
- package/src/theme-provider.tsx +41 -38
- package/src/theme-settings.ts +66 -11
- package/src/theme-styles.ts +53 -8
- package/src/toast/toast.tsx +1 -2
- package/src/toggle.tsx +2 -2
- package/src/tooltip.tsx +4 -3
- package/src/type-badge.tsx +4 -11
- package/src/unit/styles.ts +0 -23
- package/src/use-is-phone.tsx +7 -2
- package/src/use-on-screen-keyboard-data.tsx +2 -2
- package/src/with-data.tsx +4 -3
- package/src/workflow-progress-icon.tsx +2 -2
- package/.eslintignore +0 -3
- package/.eslintrc +0 -14
- package/src/__mocks__/createInlineTheme.js +0 -3
- package/src/__snapshots__/design-system.test.ts.snap +0 -7265
- package/src/create-inline-theme.ts +0 -67
- package/src/number-input/index.js +0 -191
- package/src/palette.ts +0 -253
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {ThemeColors} from "../design-system";
|
|
2
|
+
import {typedObjectEntries} from "@fibery/helpers/utils/object";
|
|
3
|
+
import type {Assert, Equals} from "@fibery/helpers/utils/types";
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
export const varPrefix = process.env.VAR_THEME_PREFIX || "fibery";
|
|
8
|
+
|
|
9
|
+
export type ThemeVars = Omit<ThemeColors, "key" | "fns" | "select">;
|
|
10
|
+
|
|
11
|
+
export function makeThemeVars(sample: ThemeColors) {
|
|
12
|
+
const vars = {} as Record<string, string | {[k: string]: string}>;
|
|
13
|
+
for (const [key, value] of typedObjectEntries(sample)) {
|
|
14
|
+
// LINT.IfChange("skipMetaKeys")
|
|
15
|
+
if (key === "key" || key === "fns" || key === "select") {
|
|
16
|
+
// LINT.ThenChange(["./theme.ts#skipMetaKeys", "./theme.test.ts#skipMetaKeys"])
|
|
17
|
+
} else if (key === "opacity") {
|
|
18
|
+
vars[key] = Object.fromEntries(
|
|
19
|
+
Object.keys(value).map((opacityKey) => [opacityKey, `var(--${varPrefix}-opacity-${opacityKey})`])
|
|
20
|
+
);
|
|
21
|
+
} else if (key === "shades") {
|
|
22
|
+
vars[key] = Object.fromEntries(
|
|
23
|
+
Object.keys(value).map((shadeKey) => [shadeKey, `var(--${varPrefix}-shades-${shadeKey})`])
|
|
24
|
+
);
|
|
25
|
+
} else if (key === "lights") {
|
|
26
|
+
vars[key] = Object.fromEntries(
|
|
27
|
+
Object.keys(value).map((lightKey) => [lightKey, `var(--${varPrefix}-lights-${lightKey})`])
|
|
28
|
+
);
|
|
29
|
+
} else if (key === "separators") {
|
|
30
|
+
vars[key] = Object.fromEntries(
|
|
31
|
+
Object.keys(value).map((separatorKey) => [separatorKey, `var(--${varPrefix}-separator-${separatorKey})`])
|
|
32
|
+
);
|
|
33
|
+
} else {
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
|
+
type _ = Assert<Equals<typeof value, string>>;
|
|
36
|
+
vars[key] = `var(--${varPrefix}-color-${key})`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return vars as ThemeVars;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const menuItemHeightVar = `--${varPrefix}-layout-menuItemHeight`;
|
|
43
|
+
export const sidebarMenuItemHeightVar = `--${varPrefix}-layout-sidebarMenuItemHeight`;
|
|
44
|
+
export const sidebarMenuIconSizeVar = `--${varPrefix}-layout-sidebarMenuIconSize`;
|
|
45
|
+
export const listRowSurfaceFontSizeVar = `--${varPrefix}-layout-listRowSurfaceFontSize`;
|
|
46
|
+
|
|
47
|
+
export const layoutVars = {
|
|
48
|
+
menuItemHeight: `var(${menuItemHeightVar})`,
|
|
49
|
+
sidebarMenuItemHeight: `var(${sidebarMenuItemHeightVar})`,
|
|
50
|
+
sidebarMenuIconSize: `var(${sidebarMenuIconSizeVar})`,
|
|
51
|
+
listRowSurfaceFontSize: `var(${listRowSurfaceFontSizeVar})`,
|
|
52
|
+
};
|
|
@@ -1,304 +1,47 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// different modes → same keys
|
|
48
|
-
expect(new Set(themes.map(({fns: _, key: _k, ...colors}) => getKeys(colors).join(",")))).toMatchObject({size: 1});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("snapshot rest", () => {
|
|
52
|
-
expect(rest).toMatchSnapshot();
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
test("snapshot themeColors", () => {
|
|
56
|
-
const {colors, ...rest} = makeThemeDefs(makeDefaultPalette());
|
|
57
|
-
expect({...colors, ...rest}).toMatchSnapshot();
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
test("snapshot themeVars", () => {
|
|
61
|
-
expect(themeVars).toMatchSnapshot();
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const testColors = [
|
|
65
|
-
"#FF5400", // brand red
|
|
66
|
-
"#4978D4", // brand blue
|
|
67
|
-
"#08BD9F", // brand green
|
|
68
|
-
"#000000", // black
|
|
69
|
-
"#FFFFFF", // white
|
|
70
|
-
"rgb(73, 120, 212)", // rgb format
|
|
71
|
-
"hsl(220, 62%, 56%)", // hsl format
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
const testColorsForThemed = [
|
|
75
|
-
"#FF5400", // red
|
|
76
|
-
"#4978D4", // blue
|
|
77
|
-
"#08BD9F", // green
|
|
78
|
-
"#FBA32F", // yellow/orange
|
|
79
|
-
"#673DB6", // purple
|
|
80
|
-
"#000000", // black
|
|
81
|
-
"#FFFFFF", // white
|
|
82
|
-
];
|
|
83
|
-
|
|
84
|
-
describe("getOpacities", () => {
|
|
85
|
-
test.each(testColors)("snapshot for %s", (color) => {
|
|
86
|
-
expect(getOpacities(color)).toMatchSnapshot();
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
test("transparent color", () => {
|
|
90
|
-
expect(getOpacities("rgba(255, 255, 255, 0)")).toMatchSnapshot();
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
describe("getDarkenColor", () => {
|
|
95
|
-
test.each(testColors)("snapshot for %s", (color) => {
|
|
96
|
-
expect(getDarkenColor(color)).toMatchSnapshot();
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
describe("getTextColor", () => {
|
|
101
|
-
test.each(testColors)("snapshot for %s", (color) => {
|
|
102
|
-
expect(getTextColor(color)).toMatchSnapshot();
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
describe("getLinearGradient", () => {
|
|
107
|
-
test("single color", () => {
|
|
108
|
-
expect(getLinearGradient(["#FF5400"])).toMatchSnapshot();
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
test("two colors", () => {
|
|
112
|
-
expect(getLinearGradient(["#FF5400", "#4978D4"])).toMatchSnapshot();
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
test("three colors", () => {
|
|
116
|
-
expect(getLinearGradient(["#FF5400", "#4978D4", "#08BD9F"])).toMatchSnapshot();
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
test("four colors", () => {
|
|
120
|
-
expect(getLinearGradient(["#FF5400", "#4978D4", "#08BD9F", "#FFFFFF"])).toMatchSnapshot();
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test("card type colors subset", () => {
|
|
124
|
-
expect(getLinearGradient(["#4A4A4A", "#6A849B", "#99A2AB", "#D40915", "#E72065"])).toMatchSnapshot();
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
describe("getThemeColors", () => {
|
|
129
|
-
test("light theme", () => {
|
|
130
|
-
expect(getThemeColors("#4978D4", "light")).toMatchSnapshot();
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
test("dark theme", () => {
|
|
134
|
-
expect(getThemeColors("#4978D4", "dark")).toMatchSnapshot();
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
test("light2 theme", () => {
|
|
138
|
-
expect(getThemeColors("#4978D4", "light2")).toMatchSnapshot();
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
describe("getThemeValue", () => {
|
|
143
|
-
const values = {light: "light-value", light2: "light2-value", dark: "dark-value"};
|
|
144
|
-
|
|
145
|
-
test("light theme", () => {
|
|
146
|
-
expect(getThemeValue("light", values)).toMatchSnapshot();
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
test("dark theme", () => {
|
|
150
|
-
expect(getThemeValue("dark", values)).toMatchSnapshot();
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
test("light2 theme", () => {
|
|
154
|
-
expect(getThemeValue("light2", values)).toMatchSnapshot();
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
test("fallback to light when key missing", () => {
|
|
158
|
-
expect(getThemeValue("light", {light: "fallback", dark: "dark"})).toMatchSnapshot();
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
describe("getLightColors", () => {
|
|
163
|
-
test("snapshot", () => {
|
|
164
|
-
expect(pickLightColors(makeThemeDefs(makeDefaultPalette()))).toMatchSnapshot();
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
describe("getDarkColors", () => {
|
|
169
|
-
test("snapshot", () => {
|
|
170
|
-
expect(pickDarkColors(makeThemeDefs(makeDefaultPalette()))).toMatchSnapshot();
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
describe("getLight2Colors", () => {
|
|
175
|
-
test("snapshot", () => {
|
|
176
|
-
expect(pickLight2Colors(makeThemeDefs(makeDefaultPalette()))).toMatchSnapshot();
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
const themes = {
|
|
181
|
-
light: getThemeColors(null, "light"),
|
|
182
|
-
dark: getThemeColors(null, "dark"),
|
|
183
|
-
light2: getThemeColors(null, "light2"),
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
describe("getEnumBackgroundColor", () => {
|
|
187
|
-
describe.each(["light", "dark", "light2"] as const)("%s theme", (mode) => {
|
|
188
|
-
test.each(testColorsForThemed)("snapshot for %s", (color) => {
|
|
189
|
-
expect(themes[mode].fns.getEnumBackground(color)).toMatchSnapshot();
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
describe("getIconColor", () => {
|
|
195
|
-
describe.each(["light", "dark"] as const)("%s theme", (mode) => {
|
|
196
|
-
test.each(testColorsForThemed)("snapshot for %s", (color) => {
|
|
197
|
-
expect(themes[mode].fns.getIconColor(color)).toMatchSnapshot();
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
describe("getAppIconBackgroundColor", () => {
|
|
203
|
-
describe.each(["light", "dark", "light2"] as const)("%s theme", (mode) => {
|
|
204
|
-
test.each(testColorsForThemed)("snapshot for %s", (color) => {
|
|
205
|
-
expect(themes[mode].fns.getAppIconBackground(color)).toMatchSnapshot();
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
describe("getLinkedHighlightBackgroundColor", () => {
|
|
211
|
-
const highlightColors = ["#FF5400", "#4978D4", "#08BD9F", "#FBA32F", "#673DB6"];
|
|
212
|
-
|
|
213
|
-
describe.each(["light", "dark"] as const)("%s theme", (mode) => {
|
|
214
|
-
test.each(highlightColors)("snapshot for %s", (color) => {
|
|
215
|
-
expect(themes[mode].fns.getLinkedHighlightBackground(color)).toMatchSnapshot();
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
describe("getLinkedHighlightDecorationBackgroundColor", () => {
|
|
221
|
-
const highlightColors = ["#FF5400", "#4978D4", "#08BD9F", "#FBA32F", "#673DB6"];
|
|
222
|
-
|
|
223
|
-
describe.each(["light", "dark"] as const)("%s theme", (mode) => {
|
|
224
|
-
test.each(highlightColors)("snapshot for %s", (color) => {
|
|
225
|
-
expect(themes[mode].fns.getLinkedHighlightDecorationBackground(color)).toMatchSnapshot();
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
describe("getEnumTextColor", () => {
|
|
231
|
-
test.each(testColorsForThemed)("snapshot for %s", (color) => {
|
|
232
|
-
expect(getEnumTextColor(color)).toMatchSnapshot();
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
describe("getObjectColorMemoized", () => {
|
|
237
|
-
test("empty name returns default", () => {
|
|
238
|
-
expect(getObjectColorMemoized("")).toMatchSnapshot();
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
test("null/undefined returns default", () => {
|
|
242
|
-
expect(getObjectColorMemoized(null)).toMatchSnapshot();
|
|
243
|
-
expect(getObjectColorMemoized(undefined)).toMatchSnapshot();
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
test("typical entity names", () => {
|
|
247
|
-
expect(getObjectColorMemoized("Task")).toMatchSnapshot();
|
|
248
|
-
expect(getObjectColorMemoized("Feature")).toMatchSnapshot();
|
|
249
|
-
expect(getObjectColorMemoized("Bug")).toMatchSnapshot();
|
|
250
|
-
expect(getObjectColorMemoized("User Story")).toMatchSnapshot();
|
|
251
|
-
expect(getObjectColorMemoized("Epic")).toMatchSnapshot();
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
test("database names", () => {
|
|
255
|
-
expect(getObjectColorMemoized("Product Management")).toMatchSnapshot();
|
|
256
|
-
expect(getObjectColorMemoized("Engineering")).toMatchSnapshot();
|
|
257
|
-
expect(getObjectColorMemoized("Design")).toMatchSnapshot();
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
test("special characters", () => {
|
|
261
|
-
expect(getObjectColorMemoized("Task #1")).toMatchSnapshot();
|
|
262
|
-
expect(getObjectColorMemoized("Feature (v2)")).toMatchSnapshot();
|
|
263
|
-
expect(getObjectColorMemoized("Bug-123")).toMatchSnapshot();
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
test("long names", () => {
|
|
267
|
-
expect(
|
|
268
|
-
getObjectColorMemoized("This is a very long entity name that might be used in some cases")
|
|
269
|
-
).toMatchSnapshot();
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
test("unicode names", () => {
|
|
273
|
-
expect(getObjectColorMemoized("Задача")).toMatchSnapshot();
|
|
274
|
-
expect(getObjectColorMemoized("機能")).toMatchSnapshot();
|
|
275
|
-
expect(getObjectColorMemoized("🚀 Feature")).toMatchSnapshot();
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
describe("createInlineTheme", () => {
|
|
280
|
-
test("light theme with default reject keys", () => {
|
|
281
|
-
const theme = getThemeColors("#4978D4", "light");
|
|
282
|
-
expect(createInlineTheme(theme)).toMatchSnapshot();
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
test("dark theme with default reject keys", () => {
|
|
286
|
-
const theme = getThemeColors("#4978D4", "dark");
|
|
287
|
-
expect(createInlineTheme(theme)).toMatchSnapshot();
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
test("light2 theme with default reject keys", () => {
|
|
291
|
-
const theme = getThemeColors("#4978D4", "light2");
|
|
292
|
-
expect(createInlineTheme(theme)).toMatchSnapshot();
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
test("with custom reject keys (empty array - include all)", () => {
|
|
296
|
-
const theme = getThemeColors("#4978D4", "light");
|
|
297
|
-
expect(createInlineTheme(theme, [])).toMatchSnapshot();
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
test("with custom reject keys (specific keys)", () => {
|
|
301
|
-
const theme = getThemeColors("#4978D4", "light");
|
|
302
|
-
expect(createInlineTheme(theme, ["primary", "darkenPrimary"])).toMatchSnapshot();
|
|
303
|
-
});
|
|
1
|
+
import * as exports from "./design-system";
|
|
2
|
+
|
|
3
|
+
test("exports", () => {
|
|
4
|
+
expect(Object.keys(exports).toSorted()).toEqual(
|
|
5
|
+
[
|
|
6
|
+
"border",
|
|
7
|
+
"cardTypeColors",
|
|
8
|
+
"createInlineStyles",
|
|
9
|
+
"dateFormat",
|
|
10
|
+
"dateTimeFormat",
|
|
11
|
+
"dropCursorColor",
|
|
12
|
+
"duration",
|
|
13
|
+
"easing",
|
|
14
|
+
"fontFamily",
|
|
15
|
+
"fontSize",
|
|
16
|
+
"fontWeight",
|
|
17
|
+
"getDarkenColor",
|
|
18
|
+
"getEnumTextColor",
|
|
19
|
+
"getLinearGradient",
|
|
20
|
+
"getObjectColorMemoized",
|
|
21
|
+
"getOpacities",
|
|
22
|
+
"getTextColor",
|
|
23
|
+
"getThemeColors",
|
|
24
|
+
"iconSize",
|
|
25
|
+
"layout",
|
|
26
|
+
"layoutVars",
|
|
27
|
+
"lineHeight",
|
|
28
|
+
"listRowSurfaceFontSizeVar",
|
|
29
|
+
"menuItemHeightVar",
|
|
30
|
+
"minPanelWidth",
|
|
31
|
+
"opacity",
|
|
32
|
+
"shadows",
|
|
33
|
+
"sidebarMenuIconSizeVar",
|
|
34
|
+
"sidebarMenuItemHeightVar",
|
|
35
|
+
"space",
|
|
36
|
+
"spaceNestedTreeInterval",
|
|
37
|
+
"spaceNestedTreeLevel",
|
|
38
|
+
"textStyles",
|
|
39
|
+
"themeVars",
|
|
40
|
+
"timeFormat",
|
|
41
|
+
"tooltipDelay",
|
|
42
|
+
"transition",
|
|
43
|
+
"typeSizes",
|
|
44
|
+
"viewBoxSize",
|
|
45
|
+
].toSorted()
|
|
46
|
+
);
|
|
304
47
|
});
|