@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
package/src/theme-styles.ts
CHANGED
|
@@ -1,22 +1,67 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import {createInlineStyles, getThemeColors, ThemeColors, ThemeStyles} from "./design-system";
|
|
3
|
+
import {warmUserPalette} from "./palettes/warm-user";
|
|
4
|
+
import {slateUserPalette} from "./palettes/slate-user";
|
|
5
|
+
import {ThemeMode} from "./theme-settings";
|
|
4
6
|
|
|
5
|
-
export const defaultPalette =
|
|
7
|
+
export const defaultPalette = slateUserPalette;
|
|
8
|
+
export const defaultLightTheme = getThemeColors(null, "light", defaultPalette);
|
|
9
|
+
export const defaultDarkTheme = getThemeColors(null, "dark", defaultPalette);
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
const warmPalette = warmUserPalette;
|
|
12
|
+
const warmLightTheme = getThemeColors(null, "light", warmPalette);
|
|
13
|
+
const warmDarkTheme = getThemeColors(null, "dark", warmPalette);
|
|
9
14
|
|
|
10
|
-
export const defaultLightThemeStyles =
|
|
11
|
-
export const defaultDarkThemeStyles =
|
|
15
|
+
export const defaultLightThemeStyles = createInlineStyles(defaultLightTheme);
|
|
16
|
+
export const defaultDarkThemeStyles = createInlineStyles(defaultDarkTheme);
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
const warmLightThemeStyles = createInlineStyles(warmLightTheme);
|
|
19
|
+
const warmDarkThemeStyles = createInlineStyles(warmDarkTheme);
|
|
20
|
+
|
|
21
|
+
export function selectGlobalTheme(warm: boolean, dark: boolean): [colors: ThemeColors, styles: ThemeStyles] {
|
|
22
|
+
if (warm) {
|
|
23
|
+
return dark ? [warmDarkTheme, warmDarkThemeStyles] : [warmLightTheme, warmLightThemeStyles];
|
|
24
|
+
} else {
|
|
25
|
+
return dark ? [defaultDarkTheme, defaultDarkThemeStyles] : [defaultLightTheme, defaultLightThemeStyles];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const darkClassName = "dark-theme";
|
|
30
|
+
const light2ClassName = "light-theme-and-dark-menu";
|
|
31
|
+
const warmClassName = "warm-palette";
|
|
32
|
+
|
|
33
|
+
export function chooseGlobalStyles(themeMode: ThemeMode, warm: boolean) {
|
|
34
|
+
const htmlElement = document.documentElement;
|
|
35
|
+
htmlElement.classList.toggle(darkClassName, themeMode === "dark");
|
|
36
|
+
htmlElement.classList.toggle(light2ClassName, themeMode === "light2");
|
|
37
|
+
htmlElement.classList.toggle(warmClassName, warm);
|
|
38
|
+
|
|
39
|
+
const colorScheme = themeMode === "dark" ? "dark" : "light";
|
|
40
|
+
htmlElement.style.colorScheme = colorScheme;
|
|
41
|
+
|
|
42
|
+
// Multiple color schemes (FIXME: missing, unknown implications) "light" | "dark" | "light dark" | "dark light"
|
|
43
|
+
// indicates that the first scheme is preferred by the document, but that the second scheme is acceptable if the user prefers it.
|
|
44
|
+
// see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/color-scheme#usage_notes
|
|
45
|
+
const colorSchemeMeta = document.querySelector('meta[name="color-scheme"]');
|
|
46
|
+
colorSchemeMeta?.setAttribute("content", colorScheme);
|
|
47
|
+
|
|
48
|
+
htmlElement.classList.add(globals);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const globals = css`
|
|
14
52
|
:global() {
|
|
15
53
|
html:root {
|
|
16
54
|
${defaultLightThemeStyles}
|
|
17
55
|
&.dark-theme {
|
|
18
56
|
${defaultDarkThemeStyles}
|
|
19
57
|
}
|
|
58
|
+
|
|
59
|
+
&.warm-palette {
|
|
60
|
+
${warmLightThemeStyles}
|
|
61
|
+
&.dark-theme {
|
|
62
|
+
${warmDarkThemeStyles}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
20
65
|
}
|
|
21
66
|
}
|
|
22
67
|
`;
|
package/src/toast/toast.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {useCallbackRef} from "@fibery/react/src/use-callback-ref";
|
|
2
2
|
import {useControllableState} from "@fibery/react/src/use-controllable-state";
|
|
3
3
|
import {css, cx} from "@linaria/core";
|
|
4
|
-
import {useEffect, useRef
|
|
4
|
+
import {useCallback, useEffect, useRef} from "react";
|
|
5
5
|
import {space, themeVars} from "../design-system";
|
|
6
6
|
import Spinner from "../icons/react/Spinner";
|
|
7
7
|
import CheckCircleFilled from "../icons/react/CheckCircleFilled";
|
|
@@ -115,7 +115,6 @@ export const Toast: React.FC<ToastProps> = (props) => {
|
|
|
115
115
|
clearTimeout(emergencyTimeout);
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
119
118
|
return () => {};
|
|
120
119
|
}, [isOpen, onHideCb]);
|
|
121
120
|
|
package/src/toggle.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import {css, cx} from "@linaria/core";
|
|
|
2
2
|
import {styled} from "@linaria/react";
|
|
3
3
|
import {ComponentProps, FC, ReactNode} from "react";
|
|
4
4
|
import {space, textStyles, transition} from "./design-system";
|
|
5
|
-
import
|
|
5
|
+
import memoize from "lodash/memoize";
|
|
6
6
|
import SpinnerIcon from "./icons/react/Spinner";
|
|
7
7
|
import {mobileRootSelector} from "./mobile-styles";
|
|
8
8
|
import {darkenChroma, getAlpha, produceColor, setAlpha} from "./color-utils";
|
|
@@ -48,7 +48,7 @@ const labelWrapperStyle = css`
|
|
|
48
48
|
align-items: center;
|
|
49
49
|
`;
|
|
50
50
|
|
|
51
|
-
const getOutlineColor =
|
|
51
|
+
const getOutlineColor = memoize((color: string) => {
|
|
52
52
|
const alpha = getAlpha(color);
|
|
53
53
|
if (alpha < 1) {
|
|
54
54
|
return produceColor(color, (c) => setAlpha(c, Math.min(1, alpha + 0.3)));
|
package/src/tooltip.tsx
CHANGED
|
@@ -2,8 +2,9 @@ import {css, cx} from "@linaria/core";
|
|
|
2
2
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
3
|
import {forwardRef, type ReactNode, type SyntheticEvent} from "react";
|
|
4
4
|
import {border, fontWeight, lineHeight, space, themeVars, tooltipDelay} from "./design-system";
|
|
5
|
-
import {
|
|
5
|
+
import {RadixPortalThemeProvider} from "./theme-provider";
|
|
6
6
|
|
|
7
|
+
// FIXME consolidate as common util
|
|
7
8
|
const isFlagPresent = (flag: string) => new RegExp(`[?&]${flag}\\b`).test(window.location.search);
|
|
8
9
|
|
|
9
10
|
const preventDefaultAndStopPropagation = (e: SyntheticEvent) => {
|
|
@@ -205,7 +206,7 @@ export const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(
|
|
|
205
206
|
{children}
|
|
206
207
|
</TooltipPrimitive.Trigger>
|
|
207
208
|
<TooltipPrimitive.Portal container={container}>
|
|
208
|
-
<
|
|
209
|
+
<RadixPortalThemeProvider>
|
|
209
210
|
<TooltipPrimitive.Content
|
|
210
211
|
ref={setContentElement}
|
|
211
212
|
side={side}
|
|
@@ -216,7 +217,7 @@ export const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(
|
|
|
216
217
|
>
|
|
217
218
|
{content}
|
|
218
219
|
</TooltipPrimitive.Content>
|
|
219
|
-
</
|
|
220
|
+
</RadixPortalThemeProvider>
|
|
220
221
|
</TooltipPrimitive.Portal>
|
|
221
222
|
</TooltipPrimitive.Root>
|
|
222
223
|
);
|
package/src/type-badge.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import
|
|
3
|
+
import isString from "lodash/isString";
|
|
4
4
|
import {CSSProperties, forwardRef, memo, ReactNode} from "react";
|
|
5
5
|
import {a11yColor} from "./a11y-color";
|
|
6
6
|
import {
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
fontWeight,
|
|
9
9
|
getDarkenColor,
|
|
10
10
|
getTextColor,
|
|
11
|
-
getThemeValue,
|
|
12
11
|
opacity,
|
|
13
12
|
space,
|
|
14
13
|
textStyles,
|
|
@@ -180,7 +179,7 @@ export const TypeBadge = memo(
|
|
|
180
179
|
) {
|
|
181
180
|
const TagName = onClick ? "button" : "div";
|
|
182
181
|
const title =
|
|
183
|
-
|
|
182
|
+
isString(children) && abbr ? (
|
|
184
183
|
noTooltip ? (
|
|
185
184
|
makeAbbreviation(children)
|
|
186
185
|
) : (
|
|
@@ -196,13 +195,9 @@ export const TypeBadge = memo(
|
|
|
196
195
|
|
|
197
196
|
const baseColor = color || theme.iconColor;
|
|
198
197
|
|
|
199
|
-
const textBadgeColor =
|
|
200
|
-
dark: a11yColor(getTextColor(baseColor), getDarkenColor(baseColor), 12),
|
|
201
|
-
light: a11yColor(getTextColor(baseColor), getDarkenColor(baseColor), 12),
|
|
202
|
-
light2: a11yColor(getTextColor(baseColor), getDarkenColor(baseColor), 12),
|
|
203
|
-
});
|
|
198
|
+
const textBadgeColor = a11yColor(getTextColor(baseColor), getDarkenColor(baseColor), 12);
|
|
204
199
|
|
|
205
|
-
const backgroundBadgeColor =
|
|
200
|
+
const backgroundBadgeColor = theme.select({
|
|
206
201
|
dark: getDarkenColor(baseColor),
|
|
207
202
|
light: baseColor,
|
|
208
203
|
light2: baseColor,
|
|
@@ -211,9 +206,7 @@ export const TypeBadge = memo(
|
|
|
211
206
|
const resultingStyle = {
|
|
212
207
|
...style,
|
|
213
208
|
[colorProp]: baseColor ? textBadgeColor : themeVars.inversedTextColor,
|
|
214
|
-
//[colorProp]: baseColor ? getTextColor(baseColor) : colors.inversedTextColor,
|
|
215
209
|
[colorBackgroundProp]: backgroundBadgeColor || themeVars.shades.opacity25,
|
|
216
|
-
//[colorBackgroundProp]: baseColor || colors.shades.opacity25,
|
|
217
210
|
[colorBorderProp]: backgroundBadgeColor,
|
|
218
211
|
[colorDarkProp]: getDarkenColor(baseColor),
|
|
219
212
|
} as CSSProperties;
|
package/src/unit/styles.ts
CHANGED
|
@@ -62,7 +62,6 @@ export const unitWithTitleClassName = css`
|
|
|
62
62
|
`;
|
|
63
63
|
|
|
64
64
|
export const invalidUnitClassName = css``;
|
|
65
|
-
export const invalidUnitClassNameInForm = css``;
|
|
66
65
|
|
|
67
66
|
export const clickableClassName = css`
|
|
68
67
|
cursor: pointer;
|
|
@@ -97,14 +96,6 @@ export const borderClassName = css`
|
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
&.${invalidUnitClassName} {
|
|
100
|
-
padding-left: 20px;
|
|
101
|
-
&:has(button) {
|
|
102
|
-
padding-left: 0;
|
|
103
|
-
}
|
|
104
|
-
& button {
|
|
105
|
-
padding-left: 20px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
99
|
&::before {
|
|
109
100
|
box-shadow: none;
|
|
110
101
|
border: 1px solid ${themeVars.colorBorderButtonOutlineAccentDefault};
|
|
@@ -119,20 +110,6 @@ export const borderClassName = css`
|
|
|
119
110
|
box-shadow: ${themeVars.inputBorderFocusColor} inset;
|
|
120
111
|
border: none;
|
|
121
112
|
}
|
|
122
|
-
&::after {
|
|
123
|
-
content: "";
|
|
124
|
-
position: absolute;
|
|
125
|
-
top: 0;
|
|
126
|
-
width: 20px;
|
|
127
|
-
left: 4px;
|
|
128
|
-
right: 0;
|
|
129
|
-
bottom: 0;
|
|
130
|
-
background-image: url("./required-indicator.svg");
|
|
131
|
-
background-repeat: no-repeat;
|
|
132
|
-
background-size: 16px 16px;
|
|
133
|
-
background-position: center;
|
|
134
|
-
pointer-events: none;
|
|
135
|
-
}
|
|
136
113
|
}
|
|
137
114
|
`;
|
|
138
115
|
|
package/src/use-is-phone.tsx
CHANGED
|
@@ -20,8 +20,13 @@ function isVerticalMobileBreakpointDisabled() {
|
|
|
20
20
|
) {
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
|
|
24
|
+
if (globalThis.URLSearchParams) {
|
|
25
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
26
|
+
return urlParams.has("no-vertical-mobile-breakpoint");
|
|
27
|
+
} else {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
export const isPhoneApp = () =>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ReactNode, useEffect, useState} from "react";
|
|
2
2
|
import {createContext} from "@fibery/react/src/create-context";
|
|
3
|
-
import
|
|
3
|
+
import noop from "lodash/noop";
|
|
4
4
|
import {isPhoneApp} from "./use-is-phone";
|
|
5
5
|
import {keyboardHeightVar, mobileKeyboardOpenClassName} from "./mobile-styles";
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ export function OnScreenKeyboardContextProvider({children}: {children: ReactNode
|
|
|
23
23
|
useEffect(() => {
|
|
24
24
|
const viewport = window.visualViewport;
|
|
25
25
|
if (!viewport || !isPhoneApp()) {
|
|
26
|
-
return
|
|
26
|
+
return noop;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
function viewportHandler() {
|
package/src/with-data.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import mapValues from "lodash/mapValues";
|
|
2
|
+
import noop from "lodash/noop";
|
|
2
3
|
import {PureComponent, ComponentType} from "react";
|
|
3
4
|
import {asError} from "./errors";
|
|
4
5
|
import {$TSFixMe} from "./tsfixme";
|
|
@@ -25,7 +26,7 @@ type ProvidedState = Record<string, FetchState>;
|
|
|
25
26
|
export function provideData<T>({sources}: {sources: Record<string, () => Promise<$TSFixMe>>}) {
|
|
26
27
|
return (Component: ComponentType<T & ProvidedState>) =>
|
|
27
28
|
class DataProvider extends PureComponent<T, ProvidedState> {
|
|
28
|
-
state =
|
|
29
|
+
state = mapValues(
|
|
29
30
|
sources,
|
|
30
31
|
(): FetchState => ({
|
|
31
32
|
fetchState: ":fetch-state/start",
|
|
@@ -66,7 +67,7 @@ export function provideData<T>({sources}: {sources: Record<string, () => Promise
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
componentWillUnmount() {
|
|
69
|
-
this.setStateIfMounted =
|
|
70
|
+
this.setStateIfMounted = noop;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
render() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import {arc} from "d3-shape";
|
|
3
|
-
import
|
|
3
|
+
import memoize from "lodash/memoize";
|
|
4
4
|
import {FC} from "react";
|
|
5
5
|
import {themeVars} from "./design-system";
|
|
6
6
|
|
|
@@ -52,7 +52,7 @@ export const WorkflowProgressIcon: FC<WorkflowProgressIcon> = ({
|
|
|
52
52
|
);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const getPath =
|
|
55
|
+
const getPath = memoize(
|
|
56
56
|
(index, total, size) => {
|
|
57
57
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
58
58
|
// @ts-ignore bad d3-shape typings
|
package/.eslintignore
DELETED
package/.eslintrc
DELETED