@fibery/ui-kit 1.4.0 → 1.5.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 +7 -4
- package/src/BackButton.tsx +27 -0
- package/src/Button.d.ts +3 -1
- package/src/Item.tsx +4 -1
- package/src/Select/index.tsx +39 -6
- package/src/antd/ant-tooltip.tsx +5 -0
- package/src/antd/styles.ts +2 -4
- package/src/designSystem.ts +53 -32
- package/src/icons/ast/ArrowBottom.ts +27 -3
- package/src/icons/ast/ArrowCollapse.ts +27 -3
- package/src/icons/ast/ArrowCollapseVertical.ts +27 -3
- package/src/icons/ast/ArrowLeft.ts +27 -3
- package/src/icons/ast/ArrowRight.ts +27 -3
- package/src/icons/ast/ArrowTop.ts +27 -3
- package/src/icons/ast/ExtensionAssignments.ts +35 -3
- package/src/icons/ast/Minus.ts +28 -0
- package/src/icons/ast/ViewForm.ts +30 -0
- package/src/icons/ast/index.tsx +1 -0
- package/src/icons/react/Minus.tsx +10 -0
- package/src/icons/react/ViewForm.tsx +10 -0
- package/src/icons/react/index.tsx +1 -0
- package/src/tooltip.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"src/Select",
|
|
22
22
|
"src/error-alert.tsx",
|
|
23
23
|
"src/Pallete.ts",
|
|
24
|
-
"src/tooltip.tsx"
|
|
24
|
+
"src/tooltip.tsx",
|
|
25
|
+
"src/antd/ant-tooltip.tsx",
|
|
26
|
+
"src/BackButton.tsx"
|
|
25
27
|
],
|
|
26
28
|
"license": "UNLICENSED",
|
|
27
29
|
"scripts": {
|
|
@@ -36,7 +38,8 @@
|
|
|
36
38
|
"@linaria/core": "3.0.0-beta.15",
|
|
37
39
|
"@linaria/react": "3.0.0-beta.15",
|
|
38
40
|
"@popperjs/core": "2.9.3",
|
|
39
|
-
"@radix-ui/react-
|
|
41
|
+
"@radix-ui/react-collapsible": "1.0.1",
|
|
42
|
+
"@radix-ui/react-dropdown-menu": "2.0.1",
|
|
40
43
|
"antd": "4.18.8",
|
|
41
44
|
"chroma-js": "2.1.2",
|
|
42
45
|
"chrono-node": "^2.4.1",
|
|
@@ -67,7 +70,7 @@
|
|
|
67
70
|
},
|
|
68
71
|
"devDependencies": {
|
|
69
72
|
"@fibery/babel-preset": "7.2.0",
|
|
70
|
-
"@fibery/eslint-config": "8.
|
|
73
|
+
"@fibery/eslint-config": "8.2.0",
|
|
71
74
|
"@fibery/text-editor": "1.0.0",
|
|
72
75
|
"@linaria/babel-preset": "3.0.0-beta.15",
|
|
73
76
|
"@types/chroma-js": "2.1.3",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {Button} from "@fibery/ui-kit";
|
|
2
|
+
import BackIcon from "./icons/react/Back";
|
|
3
|
+
import {Size} from "@fibery/ui-kit/src/Button";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
pending?: boolean;
|
|
8
|
+
onClick: () => unknown;
|
|
9
|
+
size?: Size;
|
|
10
|
+
color?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function BackButton({disabled, onClick, pending, size, color}: Props) {
|
|
14
|
+
return (
|
|
15
|
+
<Button
|
|
16
|
+
borderless
|
|
17
|
+
Icon={BackIcon}
|
|
18
|
+
disabled={disabled}
|
|
19
|
+
onClick={onClick}
|
|
20
|
+
pending={pending}
|
|
21
|
+
size={size}
|
|
22
|
+
color={color}
|
|
23
|
+
>
|
|
24
|
+
Back
|
|
25
|
+
</Button>
|
|
26
|
+
);
|
|
27
|
+
}
|
package/src/Button.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {ComponentPropsWithRef, FunctionComponent} from "react";
|
|
2
2
|
import {IconBaseProps} from "./icons/types";
|
|
3
|
-
type Size = ":button-size/super-small" | ":button-size/small" | ":button-size/normal" | ":button-size/big";
|
|
3
|
+
export type Size = ":button-size/super-small" | ":button-size/small" | ":button-size/normal" | ":button-size/big";
|
|
4
|
+
type PositionInGroup = "first" | "middle" | "last";
|
|
4
5
|
type Props = {
|
|
5
6
|
size?: Size;
|
|
6
7
|
borderless?: boolean;
|
|
@@ -10,6 +11,7 @@ type Props = {
|
|
|
10
11
|
pending?: boolean;
|
|
11
12
|
width?: string | number;
|
|
12
13
|
height?: string | number;
|
|
14
|
+
inGroup?: PositionInGroup;
|
|
13
15
|
} & Omit<ComponentPropsWithRef<"button">, "size" | "width" | "height">;
|
|
14
16
|
|
|
15
17
|
export const Button: FunctionComponent<Props>;
|
package/src/Item.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import {forwardRef, ReactNode, MouseEvent, CSSProperties} from "react";
|
|
3
|
+
import {forwardRef, Ref, ReactNode, MouseEvent, CSSProperties} from "react";
|
|
4
4
|
import {themeVars} from "./designSystem";
|
|
5
5
|
|
|
6
6
|
const getGridStyle = ({
|
|
@@ -44,6 +44,7 @@ const singleLineTextStyle: CSSProperties = {
|
|
|
44
44
|
|
|
45
45
|
type Props = {
|
|
46
46
|
children: ReactNode;
|
|
47
|
+
textRef?: Ref<HTMLDivElement>;
|
|
47
48
|
className?: string;
|
|
48
49
|
leftContainer?: ReactNode;
|
|
49
50
|
rightContainer?: ReactNode;
|
|
@@ -85,6 +86,7 @@ export const Item = forwardRef<HTMLDivElement, Props>(function Item(
|
|
|
85
86
|
hoverable,
|
|
86
87
|
title,
|
|
87
88
|
dataId,
|
|
89
|
+
textRef,
|
|
88
90
|
style = {},
|
|
89
91
|
},
|
|
90
92
|
ref
|
|
@@ -115,6 +117,7 @@ export const Item = forwardRef<HTMLDivElement, Props>(function Item(
|
|
|
115
117
|
{leftContainer && <div className={cx(containerClassName)}>{leftContainer}</div>}
|
|
116
118
|
{children ? (
|
|
117
119
|
<div
|
|
120
|
+
ref={textRef}
|
|
118
121
|
className={cx(textClassName)}
|
|
119
122
|
style={multiline ? {} : noOverflow ? singleLineTextStyleNoOverflow : singleLineTextStyle}
|
|
120
123
|
>
|
package/src/Select/index.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
1
2
|
import cn from "classnames";
|
|
2
|
-
import {useCallback, forwardRef} from "react";
|
|
3
|
+
import {useCallback, forwardRef, useState} from "react";
|
|
3
4
|
import BaseSelect, {
|
|
4
5
|
GroupHeadingProps,
|
|
5
6
|
MenuProps,
|
|
@@ -14,7 +15,7 @@ import BaseSelect, {
|
|
|
14
15
|
MultiValue,
|
|
15
16
|
mergeStyles,
|
|
16
17
|
} from "react-select";
|
|
17
|
-
import BaseCreatableSelect from "react-select/creatable";
|
|
18
|
+
import BaseCreatableSelect, {CreatableProps} from "react-select/creatable";
|
|
18
19
|
import WindowedSelect, {components, WindowedMenuList} from "react-windowed-select";
|
|
19
20
|
import {createInlineTheme} from "../designSystem";
|
|
20
21
|
import {useTheme} from "../ThemeProvider";
|
|
@@ -100,16 +101,28 @@ export const Select = forwardRef(function Select<
|
|
|
100
101
|
onKeyDown,
|
|
101
102
|
styles = {},
|
|
102
103
|
virtualized = true,
|
|
104
|
+
onMenuOpen,
|
|
105
|
+
onMenuClose,
|
|
103
106
|
...rest
|
|
104
107
|
}: SelectProps<Option, IsMulti, Group>,
|
|
105
108
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
106
109
|
forwardedRef: any
|
|
107
110
|
) {
|
|
111
|
+
const [menuOpenState, setMenuOpenState] = useState(rest.defaultMenuIsOpen);
|
|
112
|
+
const onMenuOpenWrapped = useCallback(() => {
|
|
113
|
+
setMenuOpenState(true);
|
|
114
|
+
onMenuOpen && onMenuOpen();
|
|
115
|
+
}, [onMenuOpen]);
|
|
116
|
+
const onMenuCloseWrapped = useCallback(() => {
|
|
117
|
+
setMenuOpenState(false);
|
|
118
|
+
onMenuClose && onMenuClose();
|
|
119
|
+
}, [onMenuClose]);
|
|
108
120
|
const handleKeyDown = useCallback(
|
|
109
121
|
(e) => {
|
|
110
122
|
switch (e.key) {
|
|
111
123
|
case "Escape":
|
|
112
|
-
|
|
124
|
+
// we cannot rely on "menuIsOpen" prop here, as user may not pass this prop and rely on internal component behavior instead.
|
|
125
|
+
if (menuOpenState) {
|
|
113
126
|
e.stopPropagation();
|
|
114
127
|
}
|
|
115
128
|
break;
|
|
@@ -135,7 +148,7 @@ export const Select = forwardRef(function Select<
|
|
|
135
148
|
}
|
|
136
149
|
onKeyDown && onKeyDown(e);
|
|
137
150
|
},
|
|
138
|
-
[onKeyDown,
|
|
151
|
+
[onKeyDown, menuOpenState]
|
|
139
152
|
);
|
|
140
153
|
|
|
141
154
|
const SelectComponent = (virtualized ? WindowedSelect : BaseSelect) as unknown as typeof BaseSelect;
|
|
@@ -164,6 +177,8 @@ export const Select = forwardRef(function Select<
|
|
|
164
177
|
}}
|
|
165
178
|
{...rest}
|
|
166
179
|
onKeyDown={handleKeyDown}
|
|
180
|
+
onMenuOpen={onMenuOpenWrapped}
|
|
181
|
+
onMenuClose={onMenuCloseWrapped}
|
|
167
182
|
isDisabled={rest.disabled}
|
|
168
183
|
/>
|
|
169
184
|
);
|
|
@@ -173,13 +188,31 @@ export const Select = forwardRef(function Select<
|
|
|
173
188
|
props: SelectProps<Option, IsMulti, Group> & {ref?: any}
|
|
174
189
|
) => JSX.Element;
|
|
175
190
|
|
|
176
|
-
export
|
|
191
|
+
export const CreatableSelect = forwardRef(CreatableSelectInner) as <
|
|
177
192
|
Option = unknown,
|
|
178
193
|
IsMulti extends boolean = boolean,
|
|
179
194
|
Group extends GroupBase<Option> = GroupBase<Option>
|
|
180
|
-
>(
|
|
195
|
+
>(
|
|
196
|
+
props: CreatableProps<Option, IsMulti, Group> & SelectProps<Option, IsMulti, Group>
|
|
197
|
+
) => ReturnType<typeof CreatableSelectInner>;
|
|
198
|
+
|
|
199
|
+
export function CreatableSelectInner<
|
|
200
|
+
Option = unknown,
|
|
201
|
+
IsMulti extends boolean = boolean,
|
|
202
|
+
Group extends GroupBase<Option> = GroupBase<Option>
|
|
203
|
+
>(
|
|
204
|
+
{
|
|
205
|
+
components,
|
|
206
|
+
isCollectionMode,
|
|
207
|
+
menuPortalTarget,
|
|
208
|
+
styles = {},
|
|
209
|
+
...rest
|
|
210
|
+
}: CreatableProps<Option, IsMulti, Group> & SelectProps<Option, IsMulti, Group>,
|
|
211
|
+
ref: any
|
|
212
|
+
) {
|
|
181
213
|
return (
|
|
182
214
|
<BaseCreatableSelect
|
|
215
|
+
ref={ref}
|
|
183
216
|
menuPortalTarget={menuPortalTarget}
|
|
184
217
|
menuPlacement={"auto"}
|
|
185
218
|
styles={combineStyles<Option, IsMulti, Group>([
|
package/src/antd/styles.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
|
-
import {colors, layout,
|
|
2
|
+
import {colors, layout, border, shadows, space, textStyles, themeVars, transition} from "../designSystem";
|
|
3
3
|
|
|
4
4
|
export const inputOverrides = {
|
|
5
5
|
main: {
|
|
@@ -20,7 +20,6 @@ export const inputOverrides = {
|
|
|
20
20
|
letterSpacing: 0,
|
|
21
21
|
"::placeholder": {
|
|
22
22
|
color: themeVars.inputPlaceholderTextColor,
|
|
23
|
-
opacity: 1,
|
|
24
23
|
},
|
|
25
24
|
},
|
|
26
25
|
hover: {
|
|
@@ -110,8 +109,7 @@ export const inputStyles = css`
|
|
|
110
109
|
"&& .ant-input-disabled, && .ant-input-disabled:hover, && .ant-input-disabled:focus, && .ant-input-disabled:active":
|
|
111
110
|
inputOverrides.disabled,
|
|
112
111
|
"&& input::placeholder, && textarea::placeholder": {
|
|
113
|
-
color: themeVars.
|
|
114
|
-
opacity: opacity.regular,
|
|
112
|
+
color: themeVars.inputPlaceholderTextColor,
|
|
115
113
|
},
|
|
116
114
|
"& .ant-input-affix-wrapper .ant-input-prefix": {left: space.s},
|
|
117
115
|
"& .ant-input-affix-wrapper .ant-input:not(:first-child)": {paddingLeft: space.s + space.xl + space.m}, // Match TitlePreview spacing
|
package/src/designSystem.ts
CHANGED
|
@@ -112,9 +112,9 @@ const brandColors = {
|
|
|
112
112
|
blue: "#4568FB",
|
|
113
113
|
} as const;
|
|
114
114
|
|
|
115
|
-
export const getDarkenColor = (color: string): string => {
|
|
115
|
+
export const getDarkenColor = _.memoize((color: string): string => {
|
|
116
116
|
return makeChromaColor(color).darken(0.4).css();
|
|
117
|
-
};
|
|
117
|
+
});
|
|
118
118
|
|
|
119
119
|
const lightColors = {
|
|
120
120
|
mode: "light",
|
|
@@ -150,7 +150,7 @@ const lightColors = {
|
|
|
150
150
|
entityNodeHoverColor: slateDark.slate7,
|
|
151
151
|
entityNodeBorderHover: `1px solid ${getOpacities(slate.slate11).opacity80}`,
|
|
152
152
|
entityNodeBgColor: slate.slate2,
|
|
153
|
-
shortcutTextColor: slate.
|
|
153
|
+
shortcutTextColor: slate.slate8,
|
|
154
154
|
shortcutBorderColor: `1px solid ${getOpacities(slate.slate8).opacity20}`,
|
|
155
155
|
inputBgColor: whiteA.whiteA0,
|
|
156
156
|
inputDisabledBgColor: getOpacities(slate.slate6).opacity30,
|
|
@@ -160,7 +160,7 @@ const lightColors = {
|
|
|
160
160
|
inputBorderHoverColor: `0 0 0 1px ${getOpacities(slate.slate7).opacity100}`,
|
|
161
161
|
inputBorderFocusColor: `0 0 0 1px ${getOpacities(slate.slate8).opacity100}`,
|
|
162
162
|
inputBorderBlendMode: "multiply",
|
|
163
|
-
inputPlaceholderTextColor: slate.
|
|
163
|
+
inputPlaceholderTextColor: slate.slate9,
|
|
164
164
|
buttonColor: slate.slate10,
|
|
165
165
|
buttonPrimaryTextColor: slate.slate2,
|
|
166
166
|
checkboxColor: slate.slate10,
|
|
@@ -211,8 +211,8 @@ const lightColors = {
|
|
|
211
211
|
cellBackgroundHoverColor: getOpacities(sage.sage6).opacity30,
|
|
212
212
|
cellBorderColor: getOpacities(slate.slate8).opacity50,
|
|
213
213
|
tableRowWarningColor: getOpacities(yellow.yellow6).opacity60,
|
|
214
|
-
errorBgColor: getOpacities(red.red9).
|
|
215
|
-
errorTextColor: red.
|
|
214
|
+
errorBgColor: getOpacities(red.red9).opacity20,
|
|
215
|
+
errorTextColor: red.red11,
|
|
216
216
|
errorButtonColor: red.red9,
|
|
217
217
|
warningBgColor: getOpacities(yellow.yellow6).opacity60,
|
|
218
218
|
warningButtonColor: yellow.yellow11,
|
|
@@ -237,6 +237,9 @@ const lightColors = {
|
|
|
237
237
|
getOpacities(slate.slate10).opacity20
|
|
238
238
|
}`,
|
|
239
239
|
selectedColorBorder: getOpacities(slate.slate6).opacity50,
|
|
240
|
+
formBg: sage.sage2,
|
|
241
|
+
formHeaderShadow: `${getOpacities(slate.slate10).opacity10} 0px 0px 6px`,
|
|
242
|
+
formEditorFieldBg: sage.sage3,
|
|
240
243
|
//end
|
|
241
244
|
disabledInversedTextColor: shades.light,
|
|
242
245
|
danger: brandColors.red,
|
|
@@ -309,7 +312,7 @@ const darkColors = {
|
|
|
309
312
|
inputBorderHoverColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity100}`,
|
|
310
313
|
inputBorderFocusColor: `0 0 0 1px ${getOpacities(slateDark.slate9).opacity100}`,
|
|
311
314
|
inputBorderBlendMode: "lighten",
|
|
312
|
-
inputPlaceholderTextColor:
|
|
315
|
+
inputPlaceholderTextColor: slateDark.slate9,
|
|
313
316
|
buttonColor: slateDark.slate10,
|
|
314
317
|
buttonPrimaryTextColor: slate.slate6,
|
|
315
318
|
checkboxColor: slateDark.slate10,
|
|
@@ -357,7 +360,7 @@ const darkColors = {
|
|
|
357
360
|
cellBorderColor: getOpacities(slateDark.slate9).opacity50,
|
|
358
361
|
tableRowWarningColor: getOpacities(yellowDark.yellow9).opacity40,
|
|
359
362
|
errorBgColor: getOpacities(redDark.red9).opacity60,
|
|
360
|
-
errorTextColor:
|
|
363
|
+
errorTextColor: red.red7,
|
|
361
364
|
errorButtonColor: redDark.red10,
|
|
362
365
|
warningBgColor: getOpacities(yellowDark.yellow8).opacity60,
|
|
363
366
|
warningButtonColor: yellowDark.yellow11,
|
|
@@ -380,6 +383,9 @@ const darkColors = {
|
|
|
380
383
|
instrumentsMenuBg: getOpacities(slateDark.slate4).opacity95,
|
|
381
384
|
instrumentsMenuShadow: `0px 2px 8px ${getOpacities(slate.slate2).opacity95}`,
|
|
382
385
|
selectedColorBorder: getOpacities(slate.slate6).opacity20,
|
|
386
|
+
formBg: slateDark.slate2,
|
|
387
|
+
formHeaderShadow: `${getOpacities(slateDark.slate1).opacity40} 0px 0px 6px`,
|
|
388
|
+
formEditorFieldBg: slateDark.slate4,
|
|
383
389
|
//end
|
|
384
390
|
disabledInversedTextColor: lights.light,
|
|
385
391
|
danger: redDark.red9,
|
|
@@ -498,33 +504,39 @@ export const getThemeColors: (themeColor: string, theme: ThemeMode) => ThemeColo
|
|
|
498
504
|
(themeColor, theme) => themeColor + theme
|
|
499
505
|
);
|
|
500
506
|
|
|
501
|
-
export const getTextColor = (color: string): string => {
|
|
507
|
+
export const getTextColor = _.memoize((color: string): string => {
|
|
502
508
|
return makeChromaColor(color).luminance() > 0.45 ? makeChromaColor(color).luminance(0.1).saturate(3).hex() : "white";
|
|
503
|
-
};
|
|
509
|
+
});
|
|
504
510
|
|
|
505
|
-
export const getBrightenColor = (color: string): string => {
|
|
511
|
+
export const getBrightenColor = _.memoize((color: string): string => {
|
|
506
512
|
return makeChromaColor(color).brighten(0.15).hex();
|
|
507
|
-
};
|
|
513
|
+
});
|
|
508
514
|
|
|
509
|
-
export const getLinkedHighlightBackgroundColor = (
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
}
|
|
515
|
+
export const getLinkedHighlightBackgroundColor = _.memoize(
|
|
516
|
+
(themeColors: ThemeColors, color: string): string => {
|
|
517
|
+
switch (themeColors.mode) {
|
|
518
|
+
case "dark":
|
|
519
|
+
return makeChromaColor(color).alpha(0.4).luminance(0.5).css();
|
|
520
|
+
case "light":
|
|
521
|
+
return makeChromaColor(color).alpha(0.3).luminance(0.6).css();
|
|
522
|
+
default:
|
|
523
|
+
return makeChromaColor(color).alpha(0.3).luminance(0.6).css();
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
(themeMode, color) => `${themeMode}-${color}`
|
|
527
|
+
);
|
|
519
528
|
|
|
520
|
-
export const getEnumBackgroundColor = (
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
529
|
+
export const getEnumBackgroundColor = _.memoize(
|
|
530
|
+
(themeMode: ThemeMode, color: string) => {
|
|
531
|
+
switch (themeMode) {
|
|
532
|
+
case "dark":
|
|
533
|
+
return makeChromaColor(color).darken(2.2).alpha(0.5).saturate(1).css();
|
|
534
|
+
default:
|
|
535
|
+
return color;
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
(themeMode, color) => `${themeMode}-${color}`
|
|
539
|
+
);
|
|
528
540
|
|
|
529
541
|
export const cardTypeColors = [
|
|
530
542
|
"#D40915",
|
|
@@ -614,6 +626,7 @@ export const layout = {
|
|
|
614
626
|
checkboxSize: 17,
|
|
615
627
|
fakeBoardWidth: 260,
|
|
616
628
|
fakeBoardHeight: 160,
|
|
629
|
+
inlineInputHeight: 32,
|
|
617
630
|
menuHeight: 32,
|
|
618
631
|
popupTopMargin: 48,
|
|
619
632
|
unitHeight: 18,
|
|
@@ -729,8 +742,16 @@ export const themeVars = Object.keys(getThemeColors(brandColors.green, "light"))
|
|
|
729
742
|
return vars;
|
|
730
743
|
}, {} as Record<string, string | {[k: string]: string}>) as ThemeColors;
|
|
731
744
|
|
|
732
|
-
|
|
733
|
-
|
|
745
|
+
const DEFAULT_REJECT_KEYS = Object.keys(lightColors);
|
|
746
|
+
export const createInlineTheme = _.memoize(
|
|
747
|
+
(theme: ThemeColors, rejectKeys = DEFAULT_REJECT_KEYS) => {
|
|
748
|
+
return createInlineStyles<ThemeColors>(theme, rejectKeys);
|
|
749
|
+
},
|
|
750
|
+
(theme, rejectKeys = DEFAULT_REJECT_KEYS) => {
|
|
751
|
+
const rejectKeysLabel = rejectKeys === DEFAULT_REJECT_KEYS ? "DEFAULT_REJECT_KEYS" : JSON.stringify(rejectKeys);
|
|
752
|
+
return `${theme.mode}__${theme.primary}__${rejectKeysLabel}`;
|
|
753
|
+
}
|
|
754
|
+
);
|
|
734
755
|
|
|
735
756
|
export const textStyles = {
|
|
736
757
|
heading1: {
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
2
1
|
// This icon file is generated automatically.
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
5
4
|
|
|
6
|
-
const ArrowBottom: IconDefinition = {
|
|
5
|
+
const ArrowBottom: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {viewBox: "0 0 20 20"},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M5.434 7.434a.8.8 0 0 1 1.132 0L10 10.87l3.434-3.435a.8.8 0 0 1 1.132 1.132l-4 4a.8.8 0 0 1-1.132 0l-4-4a.8.8 0 0 1 0-1.132Z",
|
|
21
|
+
},
|
|
22
|
+
children: [],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
metadata: "",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
name: "arrow-bottom",
|
|
30
|
+
};
|
|
7
31
|
|
|
8
32
|
export default ArrowBottom;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
2
1
|
// This icon file is generated automatically.
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
5
4
|
|
|
6
|
-
const ArrowCollapse: IconDefinition = {
|
|
5
|
+
const ArrowCollapse: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {viewBox: "0 0 20 20"},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M7.434 14.566a.8.8 0 0 1 0-1.132L10.87 10 7.434 6.566a.8.8 0 1 1 1.132-1.132l4 4a.8.8 0 0 1 0 1.132l-4 4a.8.8 0 0 1-1.132 0Z",
|
|
21
|
+
},
|
|
22
|
+
children: [],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
metadata: "",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
name: "arrow-collapse",
|
|
30
|
+
};
|
|
7
31
|
|
|
8
32
|
export default ArrowCollapse;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
2
1
|
// This icon file is generated automatically.
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
5
4
|
|
|
6
|
-
const ArrowCollapseVertical: IconDefinition = {
|
|
5
|
+
const ArrowCollapseVertical: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {viewBox: "0 0 20 20"},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M5.434 7.434a.8.8 0 0 1 1.132 0L10 10.87l3.434-3.435a.8.8 0 0 1 1.132 1.132l-4 4a.8.8 0 0 1-1.132 0l-4-4a.8.8 0 0 1 0-1.132Z",
|
|
21
|
+
},
|
|
22
|
+
children: [],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
metadata: "",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
name: "arrow-collapse-vertical",
|
|
30
|
+
};
|
|
7
31
|
|
|
8
32
|
export default ArrowCollapseVertical;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
2
1
|
// This icon file is generated automatically.
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
5
4
|
|
|
6
|
-
const ArrowLeft: IconDefinition = {
|
|
5
|
+
const ArrowLeft: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {viewBox: "0 0 20 20"},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M12.566 5.434a.8.8 0 0 1 0 1.132L9.13 10l3.435 3.434a.8.8 0 1 1-1.132 1.132l-4-4a.8.8 0 0 1 0-1.132l4-4a.8.8 0 0 1 1.132 0Z",
|
|
21
|
+
},
|
|
22
|
+
children: [],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
metadata: "",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
name: "arrow-left",
|
|
30
|
+
};
|
|
7
31
|
|
|
8
32
|
export default ArrowLeft;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
2
1
|
// This icon file is generated automatically.
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
5
4
|
|
|
6
|
-
const ArrowRight: IconDefinition = {
|
|
5
|
+
const ArrowRight: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {viewBox: "0 0 20 20"},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M7.434 14.566a.8.8 0 0 1 0-1.132L10.87 10 7.434 6.566a.8.8 0 1 1 1.132-1.132l4 4a.8.8 0 0 1 0 1.132l-4 4a.8.8 0 0 1-1.132 0Z",
|
|
21
|
+
},
|
|
22
|
+
children: [],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
metadata: "",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
name: "arrow-right",
|
|
30
|
+
};
|
|
7
31
|
|
|
8
32
|
export default ArrowRight;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
|
|
2
1
|
// This icon file is generated automatically.
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
5
4
|
|
|
6
|
-
const ArrowTop: IconDefinition = {
|
|
5
|
+
const ArrowTop: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {viewBox: "0 0 20 20"},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M14.566 12.566a.8.8 0 0 1-1.132 0L10 9.13l-3.434 3.435a.8.8 0 1 1-1.132-1.132l4-4a.8.8 0 0 1 1.132 0l4 4a.8.8 0 0 1 0 1.132Z",
|
|
21
|
+
},
|
|
22
|
+
children: [],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
metadata: "",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
name: "arrow-top",
|
|
30
|
+
};
|
|
7
31
|
|
|
8
32
|
export default ArrowTop;
|
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
|
|
2
1
|
// This icon file is generated automatically.
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
5
4
|
|
|
6
|
-
const ExtensionAssignments: IconDefinition = {
|
|
5
|
+
const ExtensionAssignments: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {viewBox: "0 0 20 20"},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M13 3.25c-1.73 0-3 1.531-3 3.25s1.27 3.25 3 3.25c1.729 0 3-1.531 3-3.25s-1.271-3.25-3-3.25ZM11.5 6.5c0-1.043.744-1.75 1.5-1.75s1.5.707 1.5 1.75c0 1.043-.744 1.75-1.5 1.75s-1.5-.707-1.5-1.75ZM6.25 4.25c-1.6 0-2.75 1.429-2.75 3s1.15 3 2.75 3S9 8.821 9 7.25s-1.15-3-2.75-3ZM5 7.25c0-.914.64-1.5 1.25-1.5s1.25.586 1.25 1.5-.64 1.5-1.25 1.5S5 8.164 5 7.25ZM8.29 11.84c1.051-.965 2.617-1.59 4.71-1.59s3.658.625 4.71 1.59c1.045.96 1.536 2.217 1.54 3.38.003.99-.873 1.53-1.625 1.53H8.374c-.752 0-1.628-.54-1.624-1.53.004-1.163.494-2.42 1.54-3.38Zm1.014 1.105a3.243 3.243 0 0 0-1.04 2.053c-.013.139.1.252.239.252h8.996a.233.233 0 0 0 .238-.252 3.248 3.248 0 0 0-1.042-2.053c-.726-.667-1.907-1.195-3.695-1.195-1.789 0-2.97.528-3.696 1.195Z",
|
|
21
|
+
},
|
|
22
|
+
children: [],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: "element",
|
|
26
|
+
tagName: "path",
|
|
27
|
+
properties: {
|
|
28
|
+
d: "M6.249 10.75c.573 0 1.102.056 1.586.16a5.89 5.89 0 0 0-1.198 1.351 6.983 6.983 0 0 0-.388-.011c-1.49 0-2.472.45-3.08 1.016a2.91 2.91 0 0 0-.902 1.776.188.188 0 0 0 .192.207l3.29-.013a2.38 2.38 0 0 0 .516 1.514H2.37c-.753 0-1.648-.548-1.618-1.558a4.327 4.327 0 0 1 1.396-3.024c.929-.864 2.296-1.418 4.102-1.418Z",
|
|
29
|
+
},
|
|
30
|
+
children: [],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
metadata: "",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
name: "extension-assignments",
|
|
38
|
+
};
|
|
7
39
|
|
|
8
40
|
export default ExtensionAssignments;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
4
|
+
|
|
5
|
+
const Minus: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {width: 20, height: 20},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {d: "M4.75 9.25a.75.75 0 0 0 0 1.5h10.5a.75.75 0 0 0 0-1.5H4.75Z"},
|
|
18
|
+
children: [],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
metadata: "",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
name: "minus",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default Minus;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import {IconDefinition} from "../types";
|
|
4
|
+
|
|
5
|
+
const ViewForm: IconDefinition = {
|
|
6
|
+
icon: {
|
|
7
|
+
type: "root",
|
|
8
|
+
children: [
|
|
9
|
+
{
|
|
10
|
+
type: "element",
|
|
11
|
+
tagName: "svg",
|
|
12
|
+
properties: {viewBox: "0 0 20 20"},
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: "element",
|
|
16
|
+
tagName: "path",
|
|
17
|
+
properties: {
|
|
18
|
+
d: "M16 5.5A1.5 1.5 0 0 0 14.5 4h-9A1.5 1.5 0 0 0 4 5.5v4.25a1.5 1.5 0 0 0 1.5 1.5h9a1.5 1.5 0 0 0 1.5-1.5V5.5ZM15 14.5a1.5 1.5 0 0 0-1.5-1.5h-7a1.5 1.5 0 0 0 0 3h7a1.5 1.5 0 0 0 1.5-1.5Z",
|
|
19
|
+
},
|
|
20
|
+
children: [],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
metadata: "",
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
name: "view-form",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default ViewForm;
|
package/src/icons/ast/index.tsx
CHANGED
|
@@ -174,6 +174,7 @@ export {default as ViewChart} from "./ViewChart";
|
|
|
174
174
|
export {default as ViewDetails} from "./ViewDetails";
|
|
175
175
|
export {default as ViewDocument} from "./ViewDocument";
|
|
176
176
|
export {default as ViewFeed} from "./ViewFeed";
|
|
177
|
+
export {default as ViewForm} from "./ViewForm";
|
|
177
178
|
export {default as ViewList} from "./ViewList";
|
|
178
179
|
export {default as ViewPage} from "./ViewPage";
|
|
179
180
|
export {default as ViewTable} from "./ViewTable";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import MinusSvg from "../ast/Minus";
|
|
4
|
+
import {Icon} from "../Icon";
|
|
5
|
+
import {IconBaseProps} from "../types";
|
|
6
|
+
|
|
7
|
+
const Minus = (props: IconBaseProps): JSX.Element => <Icon {...props} icon={MinusSvg} />;
|
|
8
|
+
|
|
9
|
+
Minus.displayName = "Minus";
|
|
10
|
+
export default Minus;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
|
|
3
|
+
import ViewFormSvg from "../ast/ViewForm";
|
|
4
|
+
import {Icon} from "../Icon";
|
|
5
|
+
import {IconBaseProps} from "../types";
|
|
6
|
+
|
|
7
|
+
const ViewForm = (props: IconBaseProps): JSX.Element => <Icon {...props} icon={ViewFormSvg} />;
|
|
8
|
+
|
|
9
|
+
ViewForm.displayName = "ViewForm";
|
|
10
|
+
export default ViewForm;
|
|
@@ -174,6 +174,7 @@ export {default as ViewChart} from "./ViewChart";
|
|
|
174
174
|
export {default as ViewDetails} from "./ViewDetails";
|
|
175
175
|
export {default as ViewDocument} from "./ViewDocument";
|
|
176
176
|
export {default as ViewFeed} from "./ViewFeed";
|
|
177
|
+
export {default as ViewForm} from "./ViewForm";
|
|
177
178
|
export {default as ViewList} from "./ViewList";
|
|
178
179
|
export {default as ViewPage} from "./ViewPage";
|
|
179
180
|
export {default as ViewTable} from "./ViewTable";
|
package/src/tooltip.tsx
CHANGED
|
@@ -15,7 +15,7 @@ const titleStyle = css`
|
|
|
15
15
|
|
|
16
16
|
const descriptionStyle = css`
|
|
17
17
|
${{
|
|
18
|
-
color: themeVars.
|
|
18
|
+
color: themeVars.shortcutTextColor,
|
|
19
19
|
fontWeight: 400,
|
|
20
20
|
}}
|
|
21
21
|
`;
|
|
@@ -164,7 +164,7 @@ export function Tooltip(props: Props) {
|
|
|
164
164
|
mouseEnterDelay={mouseEnterDelay || (instant ? 0 : tooltipDelay.enter)}
|
|
165
165
|
mouseLeaveDelay={instant ? 0 : tooltipDelay.leave}
|
|
166
166
|
overlayClassName={cx(tooltipStyle, {[whiteBgStyle]: whiteBg})}
|
|
167
|
-
align={align || (placement === "bottom" ? alignByPlacement
|
|
167
|
+
align={align || (placement === "bottom" ? alignByPlacement.bottom : undefined)}
|
|
168
168
|
onVisibleChange={onVisibleChange}
|
|
169
169
|
destroyTooltipOnHide={destroyTooltipOnHide}
|
|
170
170
|
getPopupContainer={getPopupContainer}
|