@fibery/ui-kit 1.31.0 → 1.32.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 +3 -6
- package/src/actions-menu/actions-menu-confirmation.tsx +3 -3
- package/src/actions-menu/actions-menu-sub-menu.tsx +5 -2
- package/src/actions-menu/actions-menu.tsx +6 -1
- package/src/actions-menu/contexts/actions-menu-context.tsx +11 -2
- package/src/button/actions-button-compact.tsx +1 -1
- package/src/button/actions-button.tsx +1 -17
- package/src/button/add-button.tsx +13 -6
- package/src/button/back-button.tsx +12 -23
- package/src/button/base-button.tsx +189 -0
- package/src/button/button.tsx +84 -237
- package/src/button/icon-button.tsx +71 -0
- package/src/button/make-button-colors.ts +33 -0
- package/src/design-system.ts +6 -5
- package/src/dropdown-menu/index.tsx +15 -14
- package/src/emoji-picker/emoji-picker-content-with-color.tsx +1 -1
- package/src/emoji-picker/emoji-picker-preview-footer.tsx +2 -2
- package/src/emoji-picker/icon-emoji-picker.tsx +3 -3
- package/src/emoji-picker/primitives/category-label.tsx +1 -1
- package/src/emoji-picker/primitives/grid-item.tsx +1 -1
- package/src/emoji-picker/primitives/search.tsx +1 -1
- package/src/emoji-picker/primitives/skin-tone.tsx +1 -1
- package/src/error-alert/error-alert-action.tsx +9 -6
- package/src/error-alert/error-alert.tsx +1 -1
- package/src/icons/Icon.tsx +1 -0
- package/src/icons/ast/Folder.ts +8 -0
- package/src/icons/ast/SmartFolder.ts +1 -1
- package/src/icons/ast/index.tsx +1 -0
- package/src/icons/react/Folder.tsx +13 -0
- package/src/icons/react/index.tsx +1 -0
- package/src/integration-compact-info-button.tsx +4 -3
- package/src/select/custom-select-partials/clear-indicator.tsx +1 -1
- package/src/toast/primitives.tsx +1 -1
- package/src/toast/toast-action.tsx +3 -6
- package/src/toggle.tsx +22 -16
- package/src/back-button.tsx +0 -3
- package/src/button/button-base.tsx +0 -180
- package/src/button.tsx +0 -3
- package/src/icon-button.tsx +0 -3
package/src/button/button.tsx
CHANGED
|
@@ -1,258 +1,105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type PositionInGroup = "first" | "middle" | "last";
|
|
17
|
-
|
|
18
|
-
export const ButtonSize = {
|
|
19
|
-
superSmall: ":button-size/super-small",
|
|
20
|
-
smaller: ":button-size/smaller",
|
|
21
|
-
small: ":button-size/small",
|
|
22
|
-
normal: ":button-size/normal",
|
|
23
|
-
big: ":button-size/big",
|
|
24
|
-
} as const;
|
|
25
|
-
export type ButtonSize = (typeof ButtonSize)[keyof typeof ButtonSize];
|
|
26
|
-
|
|
27
|
-
const FontSizes = {
|
|
28
|
-
":button-size/super-small": 10,
|
|
29
|
-
":button-size/smaller": 12,
|
|
30
|
-
":button-size/small": 12,
|
|
31
|
-
":button-size/normal": 14,
|
|
32
|
-
":button-size/big": 16,
|
|
33
|
-
} as const;
|
|
34
|
-
|
|
35
|
-
const HorizontalPaddings = {
|
|
36
|
-
":button-size/super-small": 6,
|
|
37
|
-
":button-size/smaller": 8,
|
|
38
|
-
":button-size/small": 8,
|
|
39
|
-
":button-size/normal": 12,
|
|
40
|
-
":button-size/big": 16,
|
|
41
|
-
} as const;
|
|
42
|
-
|
|
43
|
-
const IconSizes = {
|
|
44
|
-
":button-size/super-small": 14,
|
|
45
|
-
":button-size/smaller": 16,
|
|
46
|
-
":button-size/small": 18,
|
|
47
|
-
":button-size/normal": 18,
|
|
48
|
-
":button-size/big": 20,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
type StyledProps = {
|
|
52
|
-
buttonSize: ButtonSize;
|
|
53
|
-
borderless?: boolean;
|
|
54
|
-
buttonWidth?: number | string;
|
|
55
|
-
buttonHeight?: number | string;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const getFontSize = ({buttonSize}: StyledProps) => FontSizes[buttonSize];
|
|
59
|
-
const getButtonMinSize = ({buttonSize}: StyledProps) => FontSizes[buttonSize] * 2;
|
|
60
|
-
const getHorizontalPadding = ({buttonSize, borderless}: StyledProps) =>
|
|
61
|
-
borderless ? HorizontalPaddings[buttonSize] : HorizontalPaddings[buttonSize] - buttonBorderWidth;
|
|
1
|
+
import {css, cx} from "@linaria/core";
|
|
2
|
+
import {forwardRef} from "react";
|
|
3
|
+
import {border, fontWeight, space, textStyles} from "../design-system";
|
|
4
|
+
import {iconSizeVar} from "../icons/Icon";
|
|
5
|
+
import SpinnerIcon from "../icons/react/Spinner";
|
|
6
|
+
import {BaseButtonProps, BaseButton, ButtonSize} from "./base-button";
|
|
7
|
+
|
|
8
|
+
export type ButtonProps = {
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
pending?: boolean;
|
|
11
|
+
shortcut?: string;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
iconStart?: React.ReactNode;
|
|
14
|
+
iconEnd?: React.ReactNode;
|
|
15
|
+
} & BaseButtonProps;
|
|
62
16
|
|
|
63
|
-
const
|
|
17
|
+
const button = css`
|
|
64
18
|
display: flex;
|
|
65
|
-
justify-content: center;
|
|
66
19
|
align-items: center;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
height: ${({buttonHeight = "auto"}) => (typeof buttonHeight === "string" ? buttonHeight : `${buttonHeight}px`)};
|
|
20
|
+
justify-content: center;
|
|
21
|
+
font-weight: ${fontWeight.medium};
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
`;
|
|
72
24
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
padding-right: ${getHorizontalPadding}px;
|
|
25
|
+
const shortcutContainer = css`
|
|
26
|
+
font-size: ${textStyles.small.fontSize}px;
|
|
27
|
+
font-weight: ${fontWeight.regular};
|
|
28
|
+
opacity: 0.7;
|
|
78
29
|
`;
|
|
79
|
-
export const buttonClassName = StyledButton;
|
|
80
30
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
${{
|
|
92
|
-
display: "inline-flex",
|
|
93
|
-
borderRadius: border.radius0,
|
|
94
|
-
marginRight: -1,
|
|
95
|
-
}}
|
|
31
|
+
const buttonSize = {
|
|
32
|
+
tiny: css`
|
|
33
|
+
font-size: 10px;
|
|
34
|
+
line-height: 14px;
|
|
35
|
+
border-radius: ${border.radius4}px;
|
|
36
|
+
min-height: 20px;
|
|
37
|
+
padding: ${space.s2}px ${space.s6}px;
|
|
38
|
+
gap: ${space.s2}px;
|
|
39
|
+
|
|
40
|
+
${iconSizeVar}: 14px;
|
|
96
41
|
`,
|
|
97
|
-
|
|
98
|
-
${
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
42
|
+
small: css`
|
|
43
|
+
font-size: ${textStyles.small.fontSize}px;
|
|
44
|
+
line-height: 16px;
|
|
45
|
+
border-radius: ${border.radius5}px;
|
|
46
|
+
min-height: 24px;
|
|
47
|
+
padding: ${space.s4}px ${space.s8}px;
|
|
48
|
+
gap: ${space.s4}px;
|
|
49
|
+
|
|
50
|
+
${iconSizeVar}: 16px;
|
|
102
51
|
`,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return colors.inversedTextColor;
|
|
108
|
-
}
|
|
109
|
-
return mainColor;
|
|
110
|
-
};
|
|
52
|
+
medium: css`
|
|
53
|
+
font-size: ${textStyles.regular.fontSize}px;
|
|
54
|
+
line-height: 20px;
|
|
55
|
+
letter-spacing: ${textStyles.regular.letterSpacing};
|
|
111
56
|
|
|
112
|
-
|
|
113
|
-
|
|
57
|
+
border-radius: ${border.radius6}px;
|
|
58
|
+
min-height: 28px;
|
|
59
|
+
padding: ${space.s4}px ${space.s12}px;
|
|
60
|
+
gap: ${space.s6}px;
|
|
114
61
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
62
|
+
${iconSizeVar}: 18px;
|
|
63
|
+
`,
|
|
64
|
+
large: css`
|
|
65
|
+
font-size: ${textStyles.regular.fontSize}px;
|
|
66
|
+
line-height: 20px;
|
|
67
|
+
letter-spacing: ${textStyles.regular.letterSpacing};
|
|
119
68
|
|
|
120
|
-
|
|
121
|
-
|
|
69
|
+
border-radius: ${border.radius6}px;
|
|
70
|
+
min-height: 32px;
|
|
71
|
+
padding: ${space.s6}px ${space.s14}px;
|
|
72
|
+
gap: ${space.s8}px;
|
|
122
73
|
|
|
123
|
-
|
|
124
|
-
${{
|
|
125
|
-
...textStyles.small,
|
|
126
|
-
color: "currentColor",
|
|
127
|
-
borderRadius: border.radius4,
|
|
128
|
-
paddingLeft: space.s4,
|
|
129
|
-
paddingRight: space.s4,
|
|
130
|
-
paddingBottom: space.s2,
|
|
131
|
-
marginRight: -space.s4,
|
|
132
|
-
marginLeft: space.s2,
|
|
133
|
-
opacity: opacity.opacity80,
|
|
134
|
-
display: "inline-block",
|
|
135
|
-
}}
|
|
136
|
-
`;
|
|
74
|
+
${iconSizeVar}: 18px;
|
|
137
75
|
|
|
138
|
-
|
|
76
|
+
& > .${shortcutContainer} {
|
|
77
|
+
font-size: ${textStyles.regular.fontSize}px;
|
|
78
|
+
}
|
|
79
|
+
`,
|
|
80
|
+
} as const;
|
|
139
81
|
|
|
140
|
-
const
|
|
141
|
-
|
|
82
|
+
const fullWidthMod = css`
|
|
83
|
+
width: 100%;
|
|
142
84
|
`;
|
|
143
85
|
|
|
144
|
-
export
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
shortcut?: string;
|
|
150
|
-
noOverflow?: boolean;
|
|
151
|
-
width?: string | number;
|
|
152
|
-
height?: string | number;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
export const ButtonComponent = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
|
|
156
|
-
{
|
|
157
|
-
disabled,
|
|
158
|
-
pending,
|
|
159
|
-
Icon,
|
|
160
|
-
inGroup,
|
|
161
|
-
shortcut,
|
|
162
|
-
noOverflow = true,
|
|
163
|
-
width,
|
|
164
|
-
height,
|
|
165
|
-
size = ":button-size/normal",
|
|
166
|
-
className,
|
|
167
|
-
children,
|
|
168
|
-
...baseProps
|
|
169
|
-
},
|
|
170
|
-
forwardedRef
|
|
171
|
-
) {
|
|
172
|
-
const theme = useTheme();
|
|
173
|
-
const mainColor = getMainColor({color: baseProps.color, dangerous: baseProps.dangerous, theme});
|
|
174
|
-
const textColor = getTextColor({mainColor, primary: baseProps.primary, theme});
|
|
175
|
-
const spinnerBgColor = getOpacities(textColor).opacity25;
|
|
176
|
-
const spinnerColor = getSpinnerColor({mainColor, primary: baseProps.primary});
|
|
177
|
-
|
|
178
|
-
const {iconSize, spinnerSize, leftContainerSize, leftContainerMarginRight} = getIconMagicConstants(size);
|
|
179
|
-
|
|
180
|
-
const leftContainer = pending ? (
|
|
181
|
-
<Spinner
|
|
182
|
-
backgroundColor={spinnerBgColor}
|
|
183
|
-
color={spinnerColor}
|
|
184
|
-
size={spinnerSize}
|
|
185
|
-
containerSize={leftContainerSize}
|
|
186
|
-
/>
|
|
187
|
-
) : Icon ? (
|
|
188
|
-
<Icon color={textColor} iconSize={iconSize} containerSize={leftContainerSize} />
|
|
189
|
-
) : null;
|
|
190
|
-
|
|
191
|
-
const styleVariable: StyledProps = {
|
|
192
|
-
buttonHeight: height,
|
|
193
|
-
buttonWidth: width,
|
|
194
|
-
buttonSize: size,
|
|
195
|
-
borderless: baseProps.borderless,
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
const isDisabled = disabled || pending;
|
|
199
|
-
|
|
200
|
-
return (
|
|
201
|
-
<StyledButton
|
|
202
|
-
{...styleVariable}
|
|
203
|
-
ref={forwardedRef}
|
|
204
|
-
onClick={!isDisabled && baseProps.onClick ? baseProps.onClick : _.noop}
|
|
205
|
-
disabled={isDisabled}
|
|
206
|
-
className={cx(className, inGroup && ordersInGroup[inGroup])}
|
|
207
|
-
{...baseProps}
|
|
208
|
-
>
|
|
209
|
-
<Item
|
|
210
|
-
leftContainer={leftContainer}
|
|
211
|
-
style={
|
|
212
|
-
{
|
|
213
|
-
[leftContainerMarginRightVar]: `${leftContainerMarginRight}px`,
|
|
214
|
-
} as React.CSSProperties
|
|
215
|
-
}
|
|
216
|
-
containerClassName={cx({[leftContainerClassName]: leftContainer && hasNonEmptyChild(children)})}
|
|
217
|
-
rightContainer={shortcut && <span className={cx(shortcutStyle)}>{shortcut}</span>}
|
|
218
|
-
noOverflow={noOverflow}
|
|
219
|
-
>
|
|
220
|
-
{children}
|
|
221
|
-
</Item>
|
|
222
|
-
</StyledButton>
|
|
223
|
-
);
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
/** @deprecated Please consider using ButtonV2 */
|
|
227
|
-
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(props, ref) {
|
|
228
|
-
if (isButtonsV2) {
|
|
229
|
-
const {
|
|
230
|
-
Icon,
|
|
231
|
-
dangerous,
|
|
232
|
-
borderless,
|
|
233
|
-
size = ":button-size/normal",
|
|
234
|
-
primary,
|
|
235
|
-
className,
|
|
236
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
237
|
-
noOverflow: _noOverflow,
|
|
238
|
-
width,
|
|
239
|
-
...buttonProps
|
|
240
|
-
} = props;
|
|
241
|
-
|
|
242
|
-
const newSize = size === ":button-size/big" || size === ":button-size/normal" ? "medium" : "small";
|
|
243
|
-
|
|
86
|
+
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
87
|
+
(
|
|
88
|
+
{size = "medium", iconStart, iconEnd, className, children, pending, disabled, shortcut, fullWidth, ...buttonProps},
|
|
89
|
+
ref
|
|
90
|
+
) => {
|
|
244
91
|
return (
|
|
245
|
-
<
|
|
92
|
+
<BaseButton
|
|
246
93
|
ref={ref}
|
|
247
|
-
|
|
94
|
+
disabled={disabled || pending}
|
|
95
|
+
className={cx(className, button, buttonSize[size], fullWidth && fullWidthMod)}
|
|
248
96
|
{...buttonProps}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
97
|
+
>
|
|
98
|
+
{pending ? <SpinnerIcon /> : iconStart}
|
|
99
|
+
{children}
|
|
100
|
+
{iconEnd}
|
|
101
|
+
{shortcut ? <span className={shortcutContainer}>{shortcut}</span> : null}
|
|
102
|
+
</BaseButton>
|
|
255
103
|
);
|
|
256
104
|
}
|
|
257
|
-
|
|
258
|
-
});
|
|
105
|
+
);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {css, cx} from "@linaria/core";
|
|
2
|
+
import {forwardRef} from "react";
|
|
3
|
+
import {BaseButtonProps, BaseButton, ButtonSize} from "./base-button";
|
|
4
|
+
import {border, space} from "../design-system";
|
|
5
|
+
import {iconSizeVar} from "../icons/Icon";
|
|
6
|
+
import Spinner from "../icons/react/Spinner";
|
|
7
|
+
|
|
8
|
+
export type IconButtonProps = {
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
pending?: boolean;
|
|
11
|
+
} & BaseButtonProps;
|
|
12
|
+
|
|
13
|
+
const iconButton = css`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
gap: ${space.s2}px;
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
const iconButtonSizes = {
|
|
21
|
+
tiny: css`
|
|
22
|
+
padding: ${space.s2}px;
|
|
23
|
+
min-width: 20px;
|
|
24
|
+
min-height: 20px;
|
|
25
|
+
border-radius: ${border.radius4}px;
|
|
26
|
+
|
|
27
|
+
${iconSizeVar}: 16px;
|
|
28
|
+
`,
|
|
29
|
+
small: css`
|
|
30
|
+
padding: ${space.s4}px;
|
|
31
|
+
min-width: 24px;
|
|
32
|
+
min-height: 24px;
|
|
33
|
+
border-radius: ${border.radius5}px;
|
|
34
|
+
|
|
35
|
+
${iconSizeVar}: 16px;
|
|
36
|
+
`,
|
|
37
|
+
medium: css`
|
|
38
|
+
padding: ${space.s4}px;
|
|
39
|
+
min-width: 28px;
|
|
40
|
+
min-height: 28px;
|
|
41
|
+
border-radius: ${border.radius6}px;
|
|
42
|
+
|
|
43
|
+
${iconSizeVar}: 18px;
|
|
44
|
+
`,
|
|
45
|
+
large: css`
|
|
46
|
+
padding: ${space.s6}px;
|
|
47
|
+
|
|
48
|
+
min-width: 32px;
|
|
49
|
+
min-height: 32px;
|
|
50
|
+
border-radius: ${border.radius6}px;
|
|
51
|
+
|
|
52
|
+
${iconSizeVar}: 18px;
|
|
53
|
+
`,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(
|
|
57
|
+
{size = "medium", className, variant = "ghost", color = "neutral", pending, children, ...rest},
|
|
58
|
+
ref
|
|
59
|
+
) {
|
|
60
|
+
return (
|
|
61
|
+
<BaseButton
|
|
62
|
+
ref={ref}
|
|
63
|
+
className={cx(className, iconButton, iconButtonSizes[size])}
|
|
64
|
+
variant={variant}
|
|
65
|
+
color={color}
|
|
66
|
+
{...rest}
|
|
67
|
+
>
|
|
68
|
+
{pending ? <Spinner /> : children}
|
|
69
|
+
</BaseButton>
|
|
70
|
+
);
|
|
71
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// TODO: this can be incorporated inside Button component
|
|
2
|
+
// but let's keep it separate while migration is on
|
|
3
|
+
// so it's easier to find buttons with custom colors
|
|
4
|
+
|
|
5
|
+
import {CSSProperties} from "@linaria/core";
|
|
6
|
+
import {getDarkenColor, getOpacities, themeVars} from "../design-system";
|
|
7
|
+
import {ButtonVariant} from "./base-button";
|
|
8
|
+
|
|
9
|
+
export const makeButtonColors = (color: string, variant: ButtonVariant) => {
|
|
10
|
+
if (variant === "solid") {
|
|
11
|
+
return {
|
|
12
|
+
"--fibery-button-color": color,
|
|
13
|
+
"--fibery-button-hover-color": getDarkenColor(color),
|
|
14
|
+
"--fibery-button-text-color": themeVars.buttonPrimaryTextColor,
|
|
15
|
+
"--fibery-button-text-active-color": themeVars.buttonPrimaryTextColor,
|
|
16
|
+
"--fibery-button-focus-color": getOpacities(color).opacity30,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
"--fibery-button-color": "transparent",
|
|
22
|
+
"--fibery-button-hover-color": getOpacities(color).opacity15,
|
|
23
|
+
"--fibery-button-text-color": color,
|
|
24
|
+
"--fibery-button-text-active-color": getOpacities(color).opacity80,
|
|
25
|
+
"--fibery-button-focus-color": getOpacities(color).opacity30,
|
|
26
|
+
|
|
27
|
+
...(variant === "outline"
|
|
28
|
+
? {
|
|
29
|
+
"--fibery-button-border-color": getOpacities(color).opacity30,
|
|
30
|
+
}
|
|
31
|
+
: undefined),
|
|
32
|
+
} as CSSProperties;
|
|
33
|
+
};
|
package/src/design-system.ts
CHANGED
|
@@ -591,7 +591,7 @@ export const themeColors = {
|
|
|
591
591
|
colorBgButtonGhostAccentDefault: [transparent, transparent],
|
|
592
592
|
colorBgButtonGhostAccentHover: [indigo.indigo3, indigoDark.indigo3],
|
|
593
593
|
colorBgButtonGhostNeutralDefault: [transparent, transparent],
|
|
594
|
-
colorBgButtonGhostNeutralHover: [slate.
|
|
594
|
+
colorBgButtonGhostNeutralHover: [getOpacities(slate.slate6).opacity60, getOpacities(slateDark.slate6).opacity80],
|
|
595
595
|
colorBgButtonGhostDestructiveDefault: [transparent, transparent],
|
|
596
596
|
colorBgButtonGhostDestructiveHover: [red.red4, redDark.red4],
|
|
597
597
|
colorTextButtonGhostAccent: [indigo.indigo11, indigoDark.indigo11],
|
|
@@ -880,14 +880,14 @@ export const space = {
|
|
|
880
880
|
s128: 128,
|
|
881
881
|
} as const;
|
|
882
882
|
/** Token for nested items spacing in nested trees */
|
|
883
|
-
export const spaceNestedTreeLevel =
|
|
883
|
+
export const spaceNestedTreeLevel = 12;
|
|
884
884
|
export const spaceNestedTreeInterval = 0;
|
|
885
885
|
export const layout = {
|
|
886
|
-
logoSize:
|
|
886
|
+
logoSize: 15,
|
|
887
887
|
menuDefaultWidth: 243,
|
|
888
888
|
desktopToolbarHeight: 32,
|
|
889
889
|
desktopMenuMinWidth: 240,
|
|
890
|
-
collapsedMenuMinWidth:
|
|
890
|
+
collapsedMenuMinWidth: 48,
|
|
891
891
|
menuMinWidth: 240, //TODO: make dependency to itemHeight
|
|
892
892
|
menuMaxWidth: 480,
|
|
893
893
|
menuItemMinWidth: 80,
|
|
@@ -899,7 +899,8 @@ export const layout = {
|
|
|
899
899
|
groupTitleHeight: 30,
|
|
900
900
|
enumItemHeight: 32,
|
|
901
901
|
menuItemHeight: 32,
|
|
902
|
-
newMenuItemHeight:
|
|
902
|
+
newMenuItemHeight: 28, // I'm ok
|
|
903
|
+
newMenuIconSize: 20,
|
|
903
904
|
viewHeaderHeight: space.s12 * 7,
|
|
904
905
|
viewHeaderCompactHeight: 52,
|
|
905
906
|
columnMinWidth: 240,
|
|
@@ -133,20 +133,21 @@ export const Content = forwardRef<HTMLDivElement, ContentProps>(function Dropdow
|
|
|
133
133
|
|
|
134
134
|
export const Sub = DropdownMenuPrimitive.Sub;
|
|
135
135
|
|
|
136
|
-
export const SubContent = forwardRef<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
);
|
|
136
|
+
export const SubContent = forwardRef<
|
|
137
|
+
HTMLDivElement,
|
|
138
|
+
DropdownMenuPrimitive.DropdownMenuSubContentProps & {container?: HTMLElement | null}
|
|
139
|
+
>(function DropdownMenuSubContent({className, collisionPadding = space.s12, container, ...rest}, ref) {
|
|
140
|
+
return (
|
|
141
|
+
<DropdownMenuPrimitive.Portal container={container}>
|
|
142
|
+
<DropdownMenuPrimitive.SubContent
|
|
143
|
+
ref={ref}
|
|
144
|
+
className={cx(dropdownMenuContentStyles, className)}
|
|
145
|
+
collisionPadding={collisionPadding}
|
|
146
|
+
{...rest}
|
|
147
|
+
/>
|
|
148
|
+
</DropdownMenuPrimitive.Portal>
|
|
149
|
+
);
|
|
150
|
+
});
|
|
150
151
|
|
|
151
152
|
export const SubTrigger = styled(DropdownMenuPrimitive.SubTrigger)`
|
|
152
153
|
${rowItemStyles}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import {useRef, useState} from "react";
|
|
3
|
-
import {IconButton} from "../button
|
|
3
|
+
import {IconButton} from "../button/icon-button";
|
|
4
4
|
import {CollapsibleContent, CollapsibleRoot, CollapsibleTrigger} from "../collapsible";
|
|
5
5
|
import {ColorPicker} from "../color-picker";
|
|
6
6
|
import {getIconColor, space} from "../design-system";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {EmojiItem} from "@fibery/emoji-data";
|
|
2
2
|
import {measureScrollbar} from "@fibery/helpers/utils/measure-scrollbar";
|
|
3
3
|
import {css} from "@linaria/core";
|
|
4
|
-
import {Button} from "../button";
|
|
4
|
+
import {Button} from "../button/button";
|
|
5
5
|
import {fontFamily, space, themeVars, typeSizes} from "../design-system";
|
|
6
6
|
import {Emoji} from "./primitives/emoji";
|
|
7
7
|
import {EmojiPickerFooter} from "./primitives/footer";
|
|
@@ -70,7 +70,7 @@ export const EmojiPickerPreviewFooter: React.FC<{
|
|
|
70
70
|
{emojiPreview ? (
|
|
71
71
|
<EmojiPreview emoji={emojiPreview.emoji} />
|
|
72
72
|
) : onAddCustomEmoji ? (
|
|
73
|
-
<Button size="
|
|
73
|
+
<Button variant="outline" color="neutral" size="small" onClick={onAddCustomEmoji}>
|
|
74
74
|
Add Emoji
|
|
75
75
|
</Button>
|
|
76
76
|
) : null}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import {compact} from "lodash";
|
|
3
|
-
import {Button} from "../button";
|
|
4
3
|
import {AntTabs} from "../antd/Tabs";
|
|
4
|
+
import {Button} from "../button/button";
|
|
5
5
|
import {space, textStyles} from "../design-system";
|
|
6
|
+
import EmojiDelete from "../icons/react/EmojiDelete";
|
|
6
7
|
import {$TSFixMe} from "../tsfixme";
|
|
7
8
|
import {AppIconPicker, AppIconPickerProps} from "./app-icon-picker";
|
|
8
9
|
import {EmojiPicker, EmojiPickerProps} from "./emoji-picker";
|
|
9
|
-
import EmojiDelete from "../icons/react/EmojiDelete";
|
|
10
10
|
|
|
11
11
|
const TabHeader: React.FC<React.PropsWithChildren> = ({children}) => (
|
|
12
12
|
<div
|
|
@@ -89,7 +89,7 @@ export const IconEmojiPicker: React.FC<IconEmojiPickerProps> = ({
|
|
|
89
89
|
padding-right: ${space.s12}px;
|
|
90
90
|
`}
|
|
91
91
|
>
|
|
92
|
-
<Button
|
|
92
|
+
<Button variant="outline" color="neutral" iconStart={<EmojiDelete />} size={"small"} onClick={onReset}>
|
|
93
93
|
{resetLabel}
|
|
94
94
|
</Button>
|
|
95
95
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {Category} from "@fibery/emoji-data";
|
|
2
2
|
|
|
3
3
|
import {css} from "@linaria/core";
|
|
4
|
-
import {IconButton} from "../../button
|
|
4
|
+
import {IconButton} from "../../button/icon-button";
|
|
5
5
|
import {space, textStyles, themeVars} from "../../design-system";
|
|
6
6
|
import Settings from "../../icons/react/Settings";
|
|
7
7
|
import {useEmojiPickerCtx, useEmojiPickerI18N} from "./root";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {EmojiItem} from "@fibery/emoji-data";
|
|
2
2
|
import {css} from "@linaria/core";
|
|
3
3
|
import {memo} from "react";
|
|
4
|
-
import {IconButton} from "../../button
|
|
4
|
+
import {IconButton} from "../../button/icon-button";
|
|
5
5
|
import {themeVars} from "../../design-system";
|
|
6
6
|
import {useEmojiDataStoreSelector} from "../stores/emoji-data-store";
|
|
7
7
|
import {useEmojiPickerContentSettings} from "./content";
|
|
@@ -2,7 +2,7 @@ import {EmojiItem} from "@fibery/emoji-data";
|
|
|
2
2
|
import {useComposedRefs} from "@fibery/react/src/use-composed-refs";
|
|
3
3
|
import {css, cx} from "@linaria/core";
|
|
4
4
|
import {startTransition, useId, useRef} from "react";
|
|
5
|
-
import {IconButton} from "../../button
|
|
5
|
+
import {IconButton} from "../../button/icon-button";
|
|
6
6
|
import {border, space, textStyles, themeVars} from "../../design-system";
|
|
7
7
|
import Close from "../../icons/react/Close";
|
|
8
8
|
import Search from "../../icons/react/Search";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {EmojiSkin} from "@fibery/emoji-data";
|
|
2
2
|
import {css, cx} from "@linaria/core";
|
|
3
3
|
import {useState} from "react";
|
|
4
|
-
import {IconButton} from "../../button
|
|
4
|
+
import {IconButton} from "../../button/icon-button";
|
|
5
5
|
import {textStyles, themeVars} from "../../design-system";
|
|
6
6
|
import {Emoji} from "./emoji";
|
|
7
7
|
import {useEmojiPickerCtx, useEmojiPickerI18N} from "./root";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {useTheme} from "../theme-provider";
|
|
1
|
+
import {ButtonProps, Button} from "../button/button";
|
|
3
2
|
|
|
4
|
-
export const ErrorAlertAction
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export const ErrorAlertAction = ({
|
|
4
|
+
size = "small",
|
|
5
|
+
variant = "outline",
|
|
6
|
+
color = "neutral",
|
|
7
|
+
className,
|
|
8
|
+
...rest
|
|
9
|
+
}: ButtonProps) => {
|
|
10
|
+
return <Button size={size} variant={variant} color={color} className={className} {...rest} />;
|
|
8
11
|
};
|
|
9
12
|
export type ErrorAlertActionElement = React.ReactElement<typeof ErrorAlertAction>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
|
-
import {IconButton} from "../button
|
|
2
|
+
import {IconButton} from "../button/icon-button";
|
|
3
3
|
import {border, layout, space, textStyles, themeVars} from "../design-system";
|
|
4
4
|
import CloseIcon from "../icons/react/Close";
|
|
5
5
|
import WarningIcon from "../icons/react/WarningTriangle";
|
package/src/icons/Icon.tsx
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// This icon file is generated automatically.
|
|
3
|
+
|
|
4
|
+
import { IconDefinition } from '../types';
|
|
5
|
+
|
|
6
|
+
const Folder: IconDefinition = {"icon":{"type":"root","children":[{"type":"element","tagName":"svg","properties":{"viewBox":"0 0 20 20"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","clipRule":"evenodd","d":"M4.417 4.583A.917.917 0 0 0 3.5 5.5v9.167a.917.917 0 0 0 .917.917h11.149c.006-.001.03-.005.074-.015a2.051 2.051 0 0 0 .472-.173.565.565 0 0 0 .12-.081.917.917 0 0 0 .268-.648V8a.917.917 0 0 0-.917-.917H10a.75.75 0 0 1-.53-.22l-2.28-2.28H4.416Zm-1.71-.792a2.417 2.417 0 0 1 1.71-.708H7.5a.75.75 0 0 1 .53.22l2.28 2.28h5.273A2.417 2.417 0 0 1 18 8v6.667c0 .64-.255 1.255-.708 1.709-.274.273-.645.441-.912.537-.26.093-.572.17-.797.17H4.417A2.417 2.417 0 0 1 2 14.668V5.5c0-.64.255-1.255.708-1.709Z"},"children":[]}],"metadata":""}]},"name":"folder"};
|
|
7
|
+
|
|
8
|
+
export default Folder;
|