@fibery/ui-kit 1.17.0 → 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.
Files changed (101) hide show
  1. package/index.ts +1 -1
  2. package/package.json +26 -21
  3. package/src/Button/actions-button.tsx +2 -2
  4. package/src/Button/button-base.tsx +2 -2
  5. package/src/Button/button-group.tsx +1 -1
  6. package/src/Button/button.tsx +3 -3
  7. package/src/Button/icon-button.tsx +1 -0
  8. package/src/Select/custom-select-partials/clear-indicator.tsx +22 -0
  9. package/src/Select/custom-select-partials/drop-down-indicator.tsx +26 -0
  10. package/src/Select/custom-select-partials/group-heading.tsx +54 -0
  11. package/src/Select/custom-select-partials/menu.tsx +25 -0
  12. package/src/Select/custom-select-partials/no-option-message.tsx +10 -0
  13. package/src/Select/custom-select-partials/option.tsx +92 -0
  14. package/src/Select/index.tsx +18 -47
  15. package/src/Select/select-in-popover.tsx +2 -2
  16. package/src/Select/styles.ts +11 -53
  17. package/src/antd/styles.ts +1 -1
  18. package/src/back-button.tsx +3 -0
  19. package/src/create-inline-theme.ts +2 -0
  20. package/src/design-system.ts +961 -0
  21. package/src/emoji-picker/app-icon-picker.tsx +2 -2
  22. package/src/emoji-picker/emoji-picker-content-with-color.tsx +4 -4
  23. package/src/emoji-picker/emoji-picker.tsx +11 -5
  24. package/src/emoji-picker/icon-emoji-picker.tsx +2 -2
  25. package/src/emoji-picker/primitives/category.tsx +2 -2
  26. package/src/emoji-picker/primitives/content.tsx +3 -2
  27. package/src/emoji-picker/primitives/emoji.tsx +6 -3
  28. package/src/emoji-picker/primitives/footer.tsx +1 -1
  29. package/src/emoji-picker/primitives/header.tsx +1 -1
  30. package/src/emoji-picker/primitives/layout.ts +1 -1
  31. package/src/emoji-picker/primitives/search.tsx +1 -1
  32. package/src/emoji-picker/primitives/skin-tone.tsx +1 -1
  33. package/src/emoji-picker/stores/lazy-emoji-data-store.tsx +3 -3
  34. package/src/emoji-picker/stores/lazy-icon-data-store.tsx +1 -1
  35. package/src/error-alert.tsx +2 -2
  36. package/src/form-field-loader.tsx +1 -1
  37. package/src/icons/Icon.tsx +4 -4
  38. package/src/icons/ast/Activity.ts +1 -1
  39. package/src/icons/ast/BellFilled.ts +8 -0
  40. package/src/icons/ast/BellOff.ts +8 -0
  41. package/src/icons/ast/BellRinging.ts +8 -0
  42. package/src/icons/ast/Export.ts +8 -0
  43. package/src/icons/ast/Favorites.ts +1 -1
  44. package/src/icons/ast/FavoritesChecked.ts +1 -1
  45. package/src/icons/ast/FavoritesOff.ts +8 -0
  46. package/src/icons/ast/GlobeSimple.ts +8 -0
  47. package/src/icons/ast/Import.ts +8 -0
  48. package/src/icons/ast/Lab.ts +8 -0
  49. package/src/icons/ast/Link.ts +8 -0
  50. package/src/icons/ast/Network.ts +8 -0
  51. package/src/icons/ast/Pencil.ts +8 -0
  52. package/src/icons/ast/People.ts +8 -0
  53. package/src/icons/ast/RicheditorLinkCreate.ts +1 -1
  54. package/src/icons/ast/RicheditorOpenLink.ts +1 -1
  55. package/src/icons/ast/RicheditorUnlink.ts +1 -1
  56. package/src/icons/ast/ShieldKeyhole.ts +8 -0
  57. package/src/icons/ast/Terminal.ts +8 -0
  58. package/src/icons/ast/TypeUrl.ts +1 -1
  59. package/src/icons/ast/index.tsx +14 -4
  60. package/src/icons/{getIconContainerStyle.tsx → get-icon-container-style.tsx} +1 -1
  61. package/src/icons/react/BellFilled.tsx +12 -0
  62. package/src/icons/react/BellOff.tsx +12 -0
  63. package/src/icons/react/BellRinging.tsx +12 -0
  64. package/src/icons/react/Export.tsx +12 -0
  65. package/src/icons/react/FavoritesOff.tsx +12 -0
  66. package/src/icons/react/GlobeSimple.tsx +12 -0
  67. package/src/icons/react/Import.tsx +12 -0
  68. package/src/icons/react/Lab.tsx +12 -0
  69. package/src/icons/react/Link.tsx +12 -0
  70. package/src/icons/react/Network.tsx +12 -0
  71. package/src/icons/react/Pencil.tsx +12 -0
  72. package/src/icons/react/People.tsx +12 -0
  73. package/src/icons/react/ShieldKeyhole.tsx +12 -0
  74. package/src/icons/react/Terminal.tsx +12 -0
  75. package/src/icons/react/index.tsx +14 -4
  76. package/src/{Item.tsx → item.tsx} +1 -1
  77. package/src/loaders.tsx +19 -6
  78. package/src/loading-sausage.tsx +3 -1
  79. package/src/{ThemeProvider.tsx → theme-provider.tsx} +11 -1
  80. package/src/theme-styles.ts +2 -5
  81. package/src/toast/index.tsx +47 -0
  82. package/src/toast/primitives.tsx +140 -0
  83. package/src/tooltip.tsx +3 -3
  84. package/src/BackButton.tsx +0 -3
  85. package/src/Select/components.tsx +0 -90
  86. package/src/designSystem.ts +0 -951
  87. package/src/icons/ast/AppTemplatesOneColor.ts +0 -8
  88. package/src/icons/ast/CopyUrl.ts +0 -8
  89. package/src/icons/ast/FavoritesMenu.ts +0 -8
  90. package/src/icons/ast/Markdown.ts +0 -8
  91. package/src/icons/react/AppTemplatesOneColor.tsx +0 -12
  92. package/src/icons/react/CopyUrl.tsx +0 -12
  93. package/src/icons/react/FavoritesMenu.tsx +0 -12
  94. package/src/icons/react/Markdown.tsx +0 -12
  95. /package/src/Button/{AddButton.tsx → add-button.tsx} +0 -0
  96. /package/src/Button/{BackButton.tsx → back-button.tsx} +0 -0
  97. /package/src/{Button.tsx → button.tsx} +0 -0
  98. /package/src/icons/{generateIconFromAst.ts → generate-icon-from-ast.ts} +0 -0
  99. /package/src/icons/{IconAsPaths.ts → get-paths.ts} +0 -0
  100. /package/src/icons/{getShiftStyle.ts → get-shift-style.ts} +0 -0
  101. /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 "./designSystem";
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<React.ComponentPropsWithoutRef<"button">, "title"> & {
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 asChilde><Tooltip><Button/></Tooltip></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
@@ -1,3 +0,0 @@
1
- import {BackButton} from "./Button/BackButton";
2
-
3
- export {BackButton};
@@ -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
- );