@fibery/ui-kit 1.17.1 → 1.18.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/index.ts +1 -1
- package/package.json +26 -21
- package/src/Button/actions-button.tsx +2 -2
- package/src/Button/button-base.tsx +2 -2
- package/src/Button/button-group.tsx +1 -1
- package/src/Button/button.tsx +3 -3
- package/src/Button/icon-button.tsx +1 -0
- package/src/Select/custom-select-partials/clear-indicator.tsx +22 -0
- package/src/Select/custom-select-partials/drop-down-indicator.tsx +26 -0
- package/src/Select/custom-select-partials/group-heading.tsx +54 -0
- package/src/Select/custom-select-partials/menu.tsx +25 -0
- package/src/Select/custom-select-partials/no-option-message.tsx +10 -0
- package/src/Select/custom-select-partials/option.tsx +92 -0
- package/src/Select/index.tsx +18 -47
- package/src/Select/select-in-popover.tsx +2 -2
- package/src/Select/styles.ts +11 -53
- package/src/antd/styles.ts +1 -1
- package/src/back-button.tsx +3 -0
- package/src/create-inline-theme.ts +2 -0
- package/src/design-system.ts +961 -0
- package/src/emoji-picker/app-icon-picker.tsx +2 -2
- package/src/emoji-picker/emoji-picker-content-with-color.tsx +4 -4
- package/src/emoji-picker/emoji-picker.tsx +11 -5
- package/src/emoji-picker/icon-emoji-picker.tsx +2 -2
- package/src/emoji-picker/primitives/category.tsx +1 -1
- package/src/emoji-picker/primitives/content.tsx +3 -2
- package/src/emoji-picker/primitives/emoji.tsx +1 -1
- package/src/emoji-picker/primitives/footer.tsx +1 -1
- package/src/emoji-picker/primitives/header.tsx +1 -1
- package/src/emoji-picker/primitives/layout.ts +1 -1
- package/src/emoji-picker/primitives/search.tsx +1 -1
- package/src/emoji-picker/primitives/skin-tone.tsx +1 -1
- package/src/emoji-picker/stores/lazy-emoji-data-store.tsx +3 -3
- package/src/emoji-picker/stores/lazy-icon-data-store.tsx +1 -1
- package/src/error-alert.tsx +2 -2
- package/src/form-field-loader.tsx +1 -1
- package/src/icons/Icon.tsx +4 -4
- package/src/icons/ast/Activity.ts +1 -1
- package/src/icons/ast/BellFilled.ts +8 -0
- package/src/icons/ast/BellOff.ts +8 -0
- package/src/icons/ast/BellRinging.ts +8 -0
- package/src/icons/ast/Export.ts +8 -0
- package/src/icons/ast/Favorites.ts +1 -1
- package/src/icons/ast/FavoritesChecked.ts +1 -1
- package/src/icons/ast/FavoritesOff.ts +8 -0
- package/src/icons/ast/GlobeSimple.ts +8 -0
- package/src/icons/ast/Import.ts +8 -0
- package/src/icons/ast/Lab.ts +8 -0
- package/src/icons/ast/Link.ts +8 -0
- package/src/icons/ast/Network.ts +8 -0
- package/src/icons/ast/Pencil.ts +8 -0
- package/src/icons/ast/People.ts +8 -0
- package/src/icons/ast/RicheditorLinkCreate.ts +1 -1
- package/src/icons/ast/RicheditorOpenLink.ts +1 -1
- package/src/icons/ast/RicheditorUnlink.ts +1 -1
- package/src/icons/ast/ShieldKeyhole.ts +8 -0
- package/src/icons/ast/Terminal.ts +8 -0
- package/src/icons/ast/TypeUrl.ts +1 -1
- package/src/icons/ast/index.tsx +14 -4
- package/src/icons/{getIconContainerStyle.tsx → get-icon-container-style.tsx} +1 -1
- package/src/icons/react/BellFilled.tsx +12 -0
- package/src/icons/react/BellOff.tsx +12 -0
- package/src/icons/react/BellRinging.tsx +12 -0
- package/src/icons/react/Export.tsx +12 -0
- package/src/icons/react/FavoritesOff.tsx +12 -0
- package/src/icons/react/GlobeSimple.tsx +12 -0
- package/src/icons/react/Import.tsx +12 -0
- package/src/icons/react/Lab.tsx +12 -0
- package/src/icons/react/Link.tsx +12 -0
- package/src/icons/react/Network.tsx +12 -0
- package/src/icons/react/Pencil.tsx +12 -0
- package/src/icons/react/People.tsx +12 -0
- package/src/icons/react/ShieldKeyhole.tsx +12 -0
- package/src/icons/react/Terminal.tsx +12 -0
- package/src/icons/react/index.tsx +14 -4
- package/src/{Item.tsx → item.tsx} +1 -1
- package/src/loaders.tsx +19 -6
- package/src/loading-sausage.tsx +3 -1
- package/src/{ThemeProvider.tsx → theme-provider.tsx} +11 -1
- package/src/theme-styles.ts +2 -5
- package/src/toast/index.tsx +47 -0
- package/src/toast/primitives.tsx +140 -0
- package/src/tooltip.tsx +3 -3
- package/src/BackButton.tsx +0 -3
- package/src/Select/components.tsx +0 -90
- package/src/designSystem.ts +0 -951
- package/src/icons/ast/AppTemplatesOneColor.ts +0 -8
- package/src/icons/ast/CopyUrl.ts +0 -8
- package/src/icons/ast/FavoritesMenu.ts +0 -8
- package/src/icons/ast/Markdown.ts +0 -8
- package/src/icons/react/AppTemplatesOneColor.tsx +0 -12
- package/src/icons/react/CopyUrl.tsx +0 -12
- package/src/icons/react/FavoritesMenu.tsx +0 -12
- package/src/icons/react/Markdown.tsx +0 -12
- /package/src/Button/{AddButton.tsx → add-button.tsx} +0 -0
- /package/src/Button/{BackButton.tsx → back-button.tsx} +0 -0
- /package/src/{Button.tsx → button.tsx} +0 -0
- /package/src/icons/{generateIconFromAst.ts → generate-icon-from-ast.ts} +0 -0
- /package/src/icons/{IconAsPaths.ts → get-paths.ts} +0 -0
- /package/src/icons/{getShiftStyle.ts → get-shift-style.ts} +0 -0
- /package/src/{Pallete.ts → pallete.ts} +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {css, cx} from "@linaria/core";
|
|
2
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
3
|
+
import {ElementRef, forwardRef} from "react";
|
|
4
|
+
import {border, space, textStyles, themeVars} from "../design-system";
|
|
5
|
+
import CloseIcon from "../icons/react/Close";
|
|
6
|
+
import {IconButton} from "../Button/icon-button";
|
|
7
|
+
import {Button} from "../button";
|
|
8
|
+
import {ButtonProps} from "../Button/button";
|
|
9
|
+
import {useTheme} from "../theme-provider";
|
|
10
|
+
|
|
11
|
+
export const ToastProvider = ToastPrimitives.Provider;
|
|
12
|
+
|
|
13
|
+
const viewportCss = css`
|
|
14
|
+
position: fixed;
|
|
15
|
+
left: 50%;
|
|
16
|
+
transform: translateX(-50%);
|
|
17
|
+
bottom: 0;
|
|
18
|
+
margin: 0;
|
|
19
|
+
z-index: 1010; // inherited from old toast implementation
|
|
20
|
+
padding: ${space.xl}px;
|
|
21
|
+
list-style: none;
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
export const ToastViewport = forwardRef<
|
|
25
|
+
ElementRef<typeof ToastPrimitives.Viewport>,
|
|
26
|
+
ToastPrimitives.ToastViewportProps
|
|
27
|
+
>(({className, ...props}, ref) => {
|
|
28
|
+
return <ToastPrimitives.Viewport ref={ref} className={cx(viewportCss, className)} {...props} />;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const rootCss = css`
|
|
32
|
+
background-color: ${themeVars.colorBgToastDefault};
|
|
33
|
+
padding: ${space.m}px ${space.m * 2}px;
|
|
34
|
+
border-radius: ${border.radius6}px;
|
|
35
|
+
box-shadow: ${themeVars.shadowModal};
|
|
36
|
+
|
|
37
|
+
@keyframes hide {
|
|
38
|
+
from {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
}
|
|
41
|
+
to {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@keyframes slideIn {
|
|
47
|
+
from {
|
|
48
|
+
transform: translateY(100%);
|
|
49
|
+
}
|
|
50
|
+
to {
|
|
51
|
+
transform: translateY(0);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes swipeOut {
|
|
56
|
+
from {
|
|
57
|
+
transform: translateX(var(--radix-toast-swipe-end-x));
|
|
58
|
+
}
|
|
59
|
+
to {
|
|
60
|
+
transform: translateX(calc(150px + var(--radix-toast-swipe-end-x)));
|
|
61
|
+
opacity: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&[data-swipe="move"] {
|
|
66
|
+
transform: translateX(var(--radix-toast-swipe-move-x));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[data-swipe="cancel"] {
|
|
70
|
+
transform: translateX(0);
|
|
71
|
+
transition: transform 200ms ease-out;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
75
|
+
will-change: transform, opacity;
|
|
76
|
+
|
|
77
|
+
&[data-state="open"] {
|
|
78
|
+
animation: slideIn 200ms ease-out;
|
|
79
|
+
}
|
|
80
|
+
&[data-state="closed"] {
|
|
81
|
+
animation: hide 200ms ease-out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&[data-swipe="end"] {
|
|
85
|
+
animation: swipeOut 200ms ease-out;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
export const ToastRoot = forwardRef<ElementRef<typeof ToastPrimitives.Root>, ToastPrimitives.ToastProps>(
|
|
91
|
+
({className, ...props}, ref) => {
|
|
92
|
+
return <ToastPrimitives.Root ref={ref} className={cx(rootCss, className)} {...props}></ToastPrimitives.Root>;
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const titleCss = css`
|
|
97
|
+
${textStyles.heading5};
|
|
98
|
+
`;
|
|
99
|
+
|
|
100
|
+
export const ToastTitle = forwardRef<ElementRef<typeof ToastPrimitives.Title>, ToastPrimitives.ToastTitleProps>(
|
|
101
|
+
({className, ...props}, ref) => {
|
|
102
|
+
return <ToastPrimitives.Title ref={ref} className={cx(className, titleCss)} {...props} />;
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const descriptionCss = css`
|
|
107
|
+
${textStyles.small};
|
|
108
|
+
color: ${themeVars.accentTextColor};
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
export const ToastSubtitle = forwardRef<
|
|
112
|
+
ElementRef<typeof ToastPrimitives.Description>,
|
|
113
|
+
ToastPrimitives.ToastDescriptionProps
|
|
114
|
+
>(({className, ...props}, ref) => {
|
|
115
|
+
return <ToastPrimitives.Description ref={ref} className={cx(className, descriptionCss)} {...props} />;
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export const ToastAction = forwardRef<
|
|
119
|
+
ElementRef<typeof ToastPrimitives.Action>,
|
|
120
|
+
ButtonProps & {altText: ToastPrimitives.ToastActionProps["altText"]}
|
|
121
|
+
>(({children, altText, ...props}, ref) => {
|
|
122
|
+
const theme = useTheme();
|
|
123
|
+
return (
|
|
124
|
+
<ToastPrimitives.Action ref={ref} altText={altText} asChild>
|
|
125
|
+
<Button color={theme.textColor} {...props}>
|
|
126
|
+
{children}
|
|
127
|
+
</Button>
|
|
128
|
+
</ToastPrimitives.Action>
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export const ToastClose = () => {
|
|
133
|
+
return (
|
|
134
|
+
<ToastPrimitives.Close aria-label="Dismiss" asChild>
|
|
135
|
+
<IconButton>
|
|
136
|
+
<CloseIcon iconSize={16} />
|
|
137
|
+
</IconButton>
|
|
138
|
+
</ToastPrimitives.Close>
|
|
139
|
+
);
|
|
140
|
+
};
|
package/src/tooltip.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import {border, fontWeight, lineHeight, space, themeVars, tooltipDelay} from "./
|
|
4
|
+
import {border, fontWeight, lineHeight, space, themeVars, tooltipDelay} from "./design-system";
|
|
5
5
|
|
|
6
6
|
const preventDefaultAndStopPropagation = (e: SyntheticEvent) => {
|
|
7
7
|
e.preventDefault();
|
|
@@ -93,7 +93,7 @@ export const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps> =
|
|
|
93
93
|
<TooltipPrimitive.Provider disableHoverableContent skipDelayDuration={150} {...props} />
|
|
94
94
|
);
|
|
95
95
|
|
|
96
|
-
export type TooltipProps = Omit<
|
|
96
|
+
export type TooltipProps = Omit<TooltipPrimitive.TooltipTriggerProps, "title"> & {
|
|
97
97
|
title?: ReactNode;
|
|
98
98
|
description?: ReactNode;
|
|
99
99
|
content?: ReactNode;
|
|
@@ -115,7 +115,7 @@ export type TooltipProps = Omit<React.ComponentPropsWithoutRef<"button">, "title
|
|
|
115
115
|
* NOTE:
|
|
116
116
|
* When used together with other triggers (Collapsible, ActionsMenu...) of radix-based component it might
|
|
117
117
|
* overwrite [data-state] attribute of trigger element and make styling a bit harder. As a workaround you might:
|
|
118
|
-
* 1. Make sure that Tooltip is the lowest trigger. Usually we don't care about data-state of tooltip's trigger (e.g. `<CollapsibleTrigger
|
|
118
|
+
* 1. Make sure that Tooltip is the lowest trigger. Usually we don't care about data-state of tooltip's trigger (e.g. `<CollapsibleTrigger asChild><Tooltip><Button/></Tooltip></CollapsibleTrigger>`)
|
|
119
119
|
* 2. Use controlled state of components and add classes for open states
|
|
120
120
|
*
|
|
121
121
|
* Ref: https://github.com/radix-ui/primitives/issues/602
|
package/src/BackButton.tsx
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React, {ReactNode} from "react";
|
|
2
|
-
import {css} from "@linaria/core";
|
|
3
|
-
import {components} from "react-windowed-select";
|
|
4
|
-
import RemoveIcon from "../icons/react/Remove";
|
|
5
|
-
import {ClearIndicatorProps, DropdownIndicatorProps, GroupBase, MultiValueRemoveProps, OptionProps} from "react-select";
|
|
6
|
-
import {Button} from "../Button/button";
|
|
7
|
-
import {space, themeVars} from "../designSystem";
|
|
8
|
-
import ArrowCollapseVertical from "../icons/react/ArrowCollapseVertical";
|
|
9
|
-
import {expanderExpandedStyle, expanderStyle} from "./styles";
|
|
10
|
-
import cn from "classnames";
|
|
11
|
-
|
|
12
|
-
export const Option = <
|
|
13
|
-
TOption,
|
|
14
|
-
IsMulti extends boolean = boolean,
|
|
15
|
-
Group extends GroupBase<TOption> = GroupBase<TOption>
|
|
16
|
-
>({
|
|
17
|
-
children,
|
|
18
|
-
...props
|
|
19
|
-
}: OptionProps<TOption, IsMulti, Group>) => {
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
|
-
const {onMouseMove, onMouseOver, ...rest} = props.innerProps;
|
|
22
|
-
const newProps = Object.assign(props, {innerProps: rest});
|
|
23
|
-
return <components.Option {...newProps}>{children}</components.Option>;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export function DropdownIndicator<
|
|
27
|
-
TOption,
|
|
28
|
-
IsMulti extends boolean = boolean,
|
|
29
|
-
Group extends GroupBase<TOption> = GroupBase<TOption>
|
|
30
|
-
>(props: DropdownIndicatorProps<TOption, IsMulti, Group>) {
|
|
31
|
-
if (props.selectProps.isDisabled) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
return (
|
|
35
|
-
<div className={cn(expanderStyle, props.selectProps.menuIsOpen && expanderExpandedStyle)}>
|
|
36
|
-
<ArrowCollapseVertical color={themeVars.disabledTextColor} />
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function ClearIndicator<
|
|
42
|
-
TOption,
|
|
43
|
-
IsMulti extends boolean = boolean,
|
|
44
|
-
Group extends GroupBase<TOption> = GroupBase<TOption>
|
|
45
|
-
>({
|
|
46
|
-
innerProps,
|
|
47
|
-
selectProps,
|
|
48
|
-
}: ClearIndicatorProps<TOption, IsMulti, Group> | MultiValueRemoveProps<TOption, IsMulti, Group>) {
|
|
49
|
-
if (selectProps.isDisabled) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
return (
|
|
53
|
-
<div {...innerProps}>
|
|
54
|
-
<Button borderless Icon={RemoveIcon} disabled={selectProps.isDisabled} size={":button-size/super-small"} />
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const NoOptionsMessage = ({children}: {children: ReactNode}) => {
|
|
60
|
-
return (
|
|
61
|
-
<div
|
|
62
|
-
className={css`
|
|
63
|
-
${{
|
|
64
|
-
paddingLeft: space.l + 2,
|
|
65
|
-
paddingRight: space.l + 2,
|
|
66
|
-
paddingTop: space.m,
|
|
67
|
-
paddingBottom: space.m,
|
|
68
|
-
}}
|
|
69
|
-
`}
|
|
70
|
-
>
|
|
71
|
-
{children}
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const groupDividerContainerStyle = css`
|
|
77
|
-
padding: ${space.l}px 0;
|
|
78
|
-
box-sizing: content-box;
|
|
79
|
-
`;
|
|
80
|
-
|
|
81
|
-
const groupDividerStyle = css`
|
|
82
|
-
width: 100%;
|
|
83
|
-
border-top: 1px solid #eeeff1;
|
|
84
|
-
`;
|
|
85
|
-
|
|
86
|
-
export const GroupDivider = () => (
|
|
87
|
-
<div className={groupDividerContainerStyle}>
|
|
88
|
-
<div className={groupDividerStyle}></div>
|
|
89
|
-
</div>
|
|
90
|
-
);
|