@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.
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 +1 -1
  26. package/src/emoji-picker/primitives/content.tsx +3 -2
  27. package/src/emoji-picker/primitives/emoji.tsx +1 -1
  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
package/index.ts CHANGED
@@ -1 +1 @@
1
- export * from "./src/designSystem";
1
+ export * from "./src/design-system";
package/package.json CHANGED
@@ -1,40 +1,45 @@
1
1
  {
2
2
  "name": "@fibery/ui-kit",
3
- "version": "1.17.1",
3
+ "version": "1.18.0",
4
4
  "main": "index.ts",
5
5
  "private": false,
6
6
  "files": [
7
7
  "src/antd/styles.ts",
8
- "src/Button.tsx",
9
- "src/designSystem.ts",
8
+ "src/button.tsx",
9
+ "src/design-system.ts",
10
10
  "src/theme-styles.ts",
11
11
  "src/theme-settings.ts",
12
12
  "src/media-query-utils.ts",
13
13
  "src/create-inline-theme.ts",
14
14
  "src/form-field-loader.tsx",
15
- "src/ThemeProvider.tsx",
16
- "src/Item.tsx",
15
+ "src/theme-provider.tsx",
16
+ "src/item.tsx",
17
17
  "src/loaders.tsx",
18
18
  "src/loading-sausage.tsx",
19
19
  "src/icons/**/*.ts*",
20
20
  "src/Select",
21
21
  "src/error-alert.tsx",
22
- "src/Pallete.ts",
22
+ "src/pallete.ts",
23
23
  "src/tooltip.tsx",
24
- "src/BackButton.tsx",
24
+ "src/back-button.tsx",
25
25
  "src/Button",
26
26
  "src/emoji-picker/**/*.ts*",
27
+ "src/toast/**/*.ts*",
27
28
  "src/a11y-color.ts"
28
29
  ],
29
30
  "license": "UNLICENSED",
30
31
  "dependencies": {
31
- "@linaria/core": "3.0.0-beta.15",
32
- "@linaria/react": "3.0.0-beta.15",
32
+ "@linaria/core": "5.0.1",
33
+ "@linaria/react": "5.0.1",
33
34
  "@popperjs/core": "2.11.6",
34
- "@radix-ui/react-collapsible": "1.0.1",
35
- "@radix-ui/react-context-menu": "2.1.1",
36
- "@radix-ui/react-dropdown-menu": "2.0.3-rc.7",
37
- "@radix-ui/react-tooltip": "1.0.3",
35
+ "@radix-ui/react-collapsible": "1.0.3",
36
+ "@radix-ui/react-context-menu": "2.1.5",
37
+ "@radix-ui/react-dropdown-menu": "2.0.6",
38
+ "@radix-ui/react-toast": "1.1.5",
39
+ "@radix-ui/react-tooltip": "1.0.7",
40
+ "@types/d3-shape": "^3.1.3",
41
+ "@types/react-select-country-list": "^2.2.1",
42
+ "@types/setimmediate": "^1.0.2",
38
43
  "@types/ua-parser-js": "0.7.36",
39
44
  "antd": "4.24.7",
40
45
  "chroma-js": "2.1.2",
@@ -61,9 +66,9 @@
61
66
  "react-windowed-select": "5.0.0",
62
67
  "screenfull": "6.0.1",
63
68
  "ua-parser-js": "0.7.24",
64
- "@fibery/emoji-data": "2.1.1",
65
- "@fibery/helpers": "1.1.0",
66
- "@fibery/react": "1.0.3"
69
+ "@fibery/helpers": "1.2.0",
70
+ "@fibery/emoji-data": "2.2.0",
71
+ "@fibery/react": "1.1.0"
67
72
  },
68
73
  "peerDependencies": {
69
74
  "react": "^18.2.0",
@@ -72,7 +77,7 @@
72
77
  "devDependencies": {
73
78
  "@babel/core": "7.20.5",
74
79
  "@babel/runtime": "7.20.6",
75
- "@linaria/babel-preset": "3.0.0-beta.15",
80
+ "@linaria/babel-preset": "5.0.3",
76
81
  "@testing-library/dom": "8.19.1",
77
82
  "@testing-library/jest-dom": "5.16.5",
78
83
  "@testing-library/react": "13.4.0",
@@ -95,8 +100,8 @@
95
100
  "svgo": "2.8.0",
96
101
  "typescript": "5.1.6",
97
102
  "unist-util-reduce": "0.2.2",
98
- "@fibery/babel-preset": "7.2.0",
99
- "@fibery/eslint-config": "8.3.0"
103
+ "@fibery/babel-preset": "7.3.0",
104
+ "@fibery/eslint-config": "8.4.0"
100
105
  },
101
106
  "jest": {
102
107
  "testEnvironment": "jsdom",
@@ -124,8 +129,8 @@
124
129
  },
125
130
  "scripts": {
126
131
  "test": "TZ=Europe/Minsk jest",
127
- "test:ci": "yarn test --reporters=default --reporters=jest-junit",
128
- "test:coverage": "yarn test --coverage --coverageDirectory=${JEST_COVERAGE_RESULT_DIR:-$(pwd)}/coverage/ui-kit --reporters=default --reporters=jest-junit",
132
+ "test:ci": "pnpm run test --reporters=default --reporters=jest-junit",
133
+ "test:coverage": "pnpm run test --coverage --coverageDirectory=${JEST_COVERAGE_RESULT_DIR:-$(pwd)}/coverage/ui-kit --reporters=default --reporters=jest-junit",
129
134
  "lint": "eslint .",
130
135
  "generate-icons": "node scripts/generate-icons.mjs"
131
136
  }
@@ -2,7 +2,7 @@ import {IconButton, IconButtonProps} from "./icon-button";
2
2
  import MoreCompact from "../icons/react/MoreCompact";
3
3
  import {forwardRef} from "react";
4
4
  import {css} from "@linaria/core";
5
- import {border, themeVars} from "../designSystem";
5
+ import {border, themeVars} from "../design-system";
6
6
 
7
7
  export const ActionsButton = forwardRef<HTMLButtonElement, IconButtonProps>(function ActionsButtonComponent(
8
8
  {...rest},
@@ -19,7 +19,7 @@ export const ActionsButton = forwardRef<HTMLButtonElement, IconButtonProps>(func
19
19
  export const actionButtonInlineStyle = css`
20
20
  background-color: ${themeVars.actionMenuButtonColor};
21
21
  box-shadow: ${themeVars.entityCardShadow};
22
- border-radius: ${border.radius6};
22
+ border-radius: ${border.radius6}px;
23
23
 
24
24
  .Button:hover {
25
25
  background-color: ${themeVars.actionMenuButtonHoverColor} !important;
@@ -1,7 +1,7 @@
1
1
  import {styled} from "@linaria/react";
2
2
  import {ComponentPropsWithoutRef, forwardRef} from "react";
3
- import {border, colors, fontWeight, getDarkenColor, getOpacities, opacity, ThemeColors} from "../designSystem";
4
- import {useTheme} from "../ThemeProvider";
3
+ import {border, colors, fontWeight, getDarkenColor, getOpacities, opacity, ThemeColors} from "../design-system";
4
+ import {useTheme} from "../theme-provider";
5
5
 
6
6
  export const getMainColor = ({color, dangerous, theme}: {color?: string; dangerous?: boolean; theme: ThemeColors}) => {
7
7
  if (color) {
@@ -1,6 +1,6 @@
1
1
  import {Children, cloneElement, CSSProperties, ReactElement} from "react";
2
2
  import {css, cx} from "@linaria/core";
3
- import {border} from "../designSystem";
3
+ import {border} from "../design-system";
4
4
 
5
5
  const ordersInRowGroup = {
6
6
  first: css`
@@ -4,9 +4,9 @@ import {styled} from "@linaria/react";
4
4
  import cx from "classnames";
5
5
  import _ from "lodash";
6
6
  import React, {forwardRef} from "react";
7
- import {Item} from "../Item";
8
- import {useTheme} from "../ThemeProvider";
9
- import {border, colors, getOpacities, opacity, space, textStyles} from "../designSystem";
7
+ import {Item} from "../item";
8
+ import {useTheme} from "../theme-provider";
9
+ import {border, colors, getOpacities, opacity, space, textStyles} from "../design-system";
10
10
  import {IconBaseProps} from "../icons/types";
11
11
  import {Spinner} from "../loaders";
12
12
  import {ButtonBase, ButtonBaseProps, buttonBorderWidth, getMainColor, getTextColor} from "./button-base";
@@ -7,6 +7,7 @@ export type IconButtonSize = "super-small" | "small" | "normal" | "big";
7
7
 
8
8
  export type IconButtonProps = Omit<ButtonBaseProps, "borderless"> & {
9
9
  size?: IconButtonSize;
10
+ classNameOverride?: string;
10
11
  };
11
12
 
12
13
  const Paddings = {
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import RemoveIcon from "../../icons/react/Remove";
3
+ import {ClearIndicatorProps, GroupBase, MultiValueRemoveProps} from "react-select";
4
+ import {Button} from "../../Button/button";
5
+
6
+ export function ClearIndicator<
7
+ TOption,
8
+ IsMulti extends boolean = boolean,
9
+ Group extends GroupBase<TOption> = GroupBase<TOption>
10
+ >({
11
+ innerProps,
12
+ selectProps,
13
+ }: ClearIndicatorProps<TOption, IsMulti, Group> | MultiValueRemoveProps<TOption, IsMulti, Group>) {
14
+ if (selectProps.isDisabled) {
15
+ return null;
16
+ }
17
+ return (
18
+ <div {...innerProps}>
19
+ <Button borderless Icon={RemoveIcon} disabled={selectProps.isDisabled} size={":button-size/super-small"} />
20
+ </div>
21
+ );
22
+ }
@@ -0,0 +1,26 @@
1
+ import cn from "classnames";
2
+ import {DropdownIndicatorProps} from "react-select";
3
+ import {expanderExpandedStyle} from "../styles";
4
+ import ArrowCollapseVertical from "../../icons/react/ArrowCollapseVertical";
5
+ import {themeVars, transition} from "../../design-system";
6
+ import React from "react";
7
+ import {css} from "@linaria/core";
8
+ import {GroupBase} from "../index";
9
+
10
+ const expanderStyle = css`
11
+ transition: transform ${transition};
12
+ `;
13
+ export function DropdownIndicator<
14
+ TOption,
15
+ IsMulti extends boolean = boolean,
16
+ Group extends GroupBase<TOption> = GroupBase<TOption>
17
+ >(props: DropdownIndicatorProps<TOption, IsMulti, Group>) {
18
+ if (props.selectProps.isDisabled) {
19
+ return null;
20
+ }
21
+ return (
22
+ <div className={cn(expanderStyle, props.selectProps.menuIsOpen && expanderExpandedStyle)}>
23
+ <ArrowCollapseVertical color={themeVars.disabledTextColor} />
24
+ </div>
25
+ );
26
+ }
@@ -0,0 +1,54 @@
1
+ import {GroupBase} from "../index";
2
+ import {components} from "react-windowed-select";
3
+ import {GroupHeadingProps} from "react-select";
4
+ import {css} from "@linaria/core";
5
+ import {layout, space, textStyles, themeVars} from "../../design-system";
6
+ import React from "react";
7
+ export const groupHeadingNulledStyles = {
8
+ paddingLeft: "",
9
+ paddingRight: "",
10
+ paddingTop: "",
11
+ margin: "",
12
+ ...textStyles.small,
13
+ color: "",
14
+ height: layout.menuItemHeight,
15
+ };
16
+ const groupHeadingClass = css`
17
+ white-space: nowrap;
18
+ overflow: hidden;
19
+ text-overflow: ellipsis;
20
+ padding: ${space.m + space.xs}px ${space.m}px ${space.l}px ${space.m}px;
21
+ color: ${themeVars.disabledTextColor};
22
+ `;
23
+ const groupDividerContainerStyle = css`
24
+ padding: ${space.l}px 0;
25
+ box-sizing: content-box;
26
+ `;
27
+
28
+ const groupDividerStyle = css`
29
+ width: 100%;
30
+ border-top: 1px solid #eeeff1;
31
+ `;
32
+ const GroupDivider = () => (
33
+ <div className={groupDividerContainerStyle}>
34
+ <div className={groupDividerStyle}></div>
35
+ </div>
36
+ );
37
+ export function GroupHeading<
38
+ Option,
39
+ IsMulti extends boolean = false,
40
+ Group extends GroupBase<Option> = GroupBase<Option>
41
+ >({children, ...props}: GroupHeadingProps<Option, IsMulti, Group>) {
42
+ if (props.data.separator) {
43
+ return <GroupDivider />;
44
+ }
45
+
46
+ if (!children) {
47
+ return null;
48
+ }
49
+ return (
50
+ <components.GroupHeading {...props} className={groupHeadingClass}>
51
+ {children}
52
+ </components.GroupHeading>
53
+ );
54
+ }
@@ -0,0 +1,25 @@
1
+ import {GroupBase} from "../index";
2
+ import {CSSObjectWithLabel, MenuProps} from "react-select";
3
+ import cn from "classnames";
4
+ import {components} from "react-windowed-select";
5
+ import {css} from "@linaria/core";
6
+ import {border, themeVars} from "../../design-system";
7
+
8
+ export const MenuNulledStyles: CSSObjectWithLabel = {
9
+ backgroundColor: "",
10
+ borderRadius: "",
11
+ boxShadow: "",
12
+ };
13
+ const MenuRootClass = css`
14
+ color: ${themeVars.disabledTextColor};
15
+ z-index: 1050;
16
+ background-color: ${themeVars.colorBgSelectMenu};
17
+ box-shadow: ${themeVars.shadowSelectMenu};
18
+ border-radius: ${border.radius6}px;
19
+ overflow: hidden;
20
+ `;
21
+ export function Menu<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(
22
+ props: MenuProps<Option, IsMulti, Group>
23
+ ) {
24
+ return <components.Menu {...props} className={cn(props.className, MenuRootClass, "react-select-menu")} />;
25
+ }
@@ -0,0 +1,10 @@
1
+ import React, {ReactNode} from "react";
2
+ import {css} from "@linaria/core";
3
+ import {space} from "../../design-system";
4
+
5
+ const NopOptionMessageClass = css`
6
+ padding: ${space.l + 2}px ${space.m}px;
7
+ `;
8
+ export const NoOptionsMessage = ({children}: {children: ReactNode}) => {
9
+ return <div className={NopOptionMessageClass}>{children}</div>;
10
+ };
@@ -0,0 +1,92 @@
1
+ import {OptionProps} from "react-select";
2
+ import {components} from "react-windowed-select";
3
+ import {GroupBase} from "../index";
4
+ import {css, cx} from "@linaria/core";
5
+ import {border, layout, space, textStyles, themeVars, transition} from "../../design-system";
6
+ import {useMemo} from "react";
7
+
8
+ export const OptionNulledStyles = {
9
+ height: layout.menuItemHeight,
10
+ };
11
+ const OptionWrapperClass = css`
12
+ max-width: 100%;
13
+ flex-basis: 100%;
14
+ display: flex;
15
+ align-items: center;
16
+ align-content: center;
17
+ ${{...textStyles.regular}};
18
+ color: ${themeVars.textColor};
19
+ background: ${themeVars.colorBgSelectOptionDefault};
20
+ border-radius: ${border.radius6}px;
21
+ padding: 0 ${space.s}px;
22
+ column-gap: ${space.xs}px;
23
+ transition: background-color ${transition}, color ${transition};
24
+ `;
25
+ const OptionRootClass = css`
26
+ padding: 0 ${space.s}px ${space.xxs}px;
27
+ display: flex;
28
+ align-items: stretch;
29
+ justify-content: stretch;
30
+ cursor: pointer;
31
+ &:hover {
32
+ .${OptionWrapperClass} {
33
+ background: ${themeVars.colorBgSelectOptionDefaultHover};
34
+ }
35
+ }
36
+ `;
37
+
38
+ const DisabledOptionClass = css`
39
+ cursor: not-allowed;
40
+ .${OptionWrapperClass} {
41
+ > * {
42
+ opacity: ${themeVars.opacitySelectOptionDisabled};
43
+ }
44
+ background: ${themeVars.colorBgSelectOptionDisabled};
45
+ }
46
+ &:hover {
47
+ .${OptionWrapperClass} {
48
+ background: ${themeVars.colorBgSelectOptionDisabled};
49
+ }
50
+ }
51
+ `;
52
+ const SelectedOptionClass = css`
53
+ cursor: default;
54
+ .${OptionWrapperClass} {
55
+ background: ${themeVars.colorBgSelectOptionSelected};
56
+ }
57
+ &:hover {
58
+ .${OptionWrapperClass} {
59
+ background: ${themeVars.colorBgSelectOptionSelectedHover};
60
+ }
61
+ }
62
+ &.${DisabledOptionClass} {
63
+ background: ${themeVars.colorBgSelectOptionSelectedDisabled};
64
+ &:hover {
65
+ background: ${themeVars.colorBgSelectOptionSelectedDisabled};
66
+ }
67
+ }
68
+ `;
69
+ export function Option<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(
70
+ props: OptionProps<Option, IsMulti, Group>
71
+ ) {
72
+ const {children, ...rest} = props;
73
+ const {isDisabled, isFocused} = rest;
74
+ const className = useMemo(
75
+ () =>
76
+ cx(
77
+ rest.innerProps.className,
78
+ OptionRootClass,
79
+ isFocused && SelectedOptionClass, //do not use isSelected as flag to determine if item is selected. It is not always true, bug
80
+ isDisabled && DisabledOptionClass
81
+ ),
82
+ [rest.innerProps.className, isDisabled, isFocused]
83
+ );
84
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
85
+ const {onMouseMove, onMouseOver, ...truncatedProps} = rest.innerProps;
86
+ const newProps = Object.assign(rest, {innerProps: truncatedProps});
87
+ return (
88
+ <components.Option {...newProps} className={className}>
89
+ <div className={OptionWrapperClass}>{children}</div>
90
+ </components.Option>
91
+ );
92
+ }
@@ -1,39 +1,33 @@
1
- /* eslint-disable */
2
- import cn from "classnames";
3
1
  import {forwardRef, useCallback, useMemo, useState} from "react";
4
2
  import BaseSelect, {
3
+ ActionMeta,
4
+ components as reactSelectComponents,
5
5
  createFilter,
6
6
  GroupBase as ReactSelectGroupBase,
7
- GroupHeadingProps,
8
7
  MenuListProps,
9
8
  MenuProps,
10
9
  mergeStyles,
11
10
  MultiValue,
12
11
  MultiValueProps,
12
+ OnChangeValue,
13
13
  OptionProps,
14
14
  OptionsOrGroups,
15
15
  Props as BaseSelectProps,
16
+ PropsValue,
16
17
  SingleValue,
17
18
  SingleValueProps,
18
19
  StylesConfig,
19
- ActionMeta,
20
- OnChangeValue,
21
- PropsValue,
22
- components as reactSelectComponents,
23
20
  } from "react-select";
24
21
  import BaseCreatableSelect, {CreatableProps} from "react-select/creatable";
25
22
  import WindowedSelect, {components, WindowedMenuList} from "react-windowed-select";
26
- import {createInlineTheme} from "../designSystem";
27
- import {useTheme} from "../ThemeProvider";
28
- import {
29
- ClearIndicator,
30
- DropdownIndicator,
31
- GroupDivider,
32
- NoOptionsMessage,
33
- Option as OptionComponent,
34
- } from "./components";
35
23
  import {componentsStyles, singleLineComponentsStyle, virtualizedStyles, zIndexStyles} from "./styles";
36
24
  import {useSelectControlSettings} from "./select-control-settings-context";
25
+ import {Option} from "./custom-select-partials/option";
26
+ import {Menu} from "./custom-select-partials/menu";
27
+ import {GroupHeading} from "./custom-select-partials/group-heading";
28
+ import {DropdownIndicator} from "./custom-select-partials/drop-down-indicator";
29
+ import {NoOptionsMessage} from "./custom-select-partials/no-option-message";
30
+ import {ClearIndicator} from "./custom-select-partials/clear-indicator";
37
31
 
38
32
  type GroupBase<T> = ReactSelectGroupBase<T> & {separator?: boolean};
39
33
 
@@ -52,32 +46,6 @@ export type {
52
46
  OnChangeValue,
53
47
  PropsValue,
54
48
  };
55
-
56
- function GroupHeading<
57
- Option = unknown,
58
- IsMulti extends boolean = boolean,
59
- Group extends GroupBase<Option> = GroupBase<Option>
60
- >({children, ...props}: GroupHeadingProps<Option, IsMulti, Group>) {
61
- if (props.data.separator) {
62
- return <GroupDivider />;
63
- }
64
-
65
- if (!children) {
66
- return null;
67
- }
68
-
69
- return <components.GroupHeading {...props}>{children}</components.GroupHeading>;
70
- }
71
-
72
- function Menu<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>>(
73
- props: MenuProps<Option, IsMulti, Group>
74
- ) {
75
- const theme = useTheme();
76
- const {innerProps, className} = props;
77
- const overridedInnerProps = {...innerProps, style: {...innerProps.style, ...createInlineTheme(theme)}};
78
- return <components.Menu {...props} innerProps={overridedInnerProps} className={cn(className, "react-select-menu")} />;
79
- }
80
-
81
49
  export {WindowedMenuList};
82
50
 
83
51
  export {components};
@@ -191,7 +159,7 @@ export const Select = forwardRef(function Select<
191
159
  zIndex ? zIndexStyles(zIndex) : {},
192
160
  styles,
193
161
  ] as StylesConfig<Option, IsMulti, Group>[]);
194
- }, [styles, virtualized]);
162
+ }, [styles, virtualized, zIndex]);
195
163
 
196
164
  return (
197
165
  <SelectComponent
@@ -205,10 +173,10 @@ export const Select = forwardRef(function Select<
205
173
  backspaceRemovesValue={isCollectionMode}
206
174
  tabSelectsValue={false}
207
175
  components={{
208
- Menu,
176
+ Menu: Menu,
209
177
  DropdownIndicator,
210
178
  ClearIndicator,
211
- Option: OptionComponent,
179
+ Option,
212
180
  MultiValueRemove: ClearIndicator,
213
181
  NoOptionsMessage,
214
182
  GroupHeading,
@@ -231,8 +199,10 @@ export const Select = forwardRef(function Select<
231
199
  export const CreatableSelect = forwardRef(CreatableSelectInner) as <
232
200
  Option = unknown,
233
201
  IsMulti extends boolean = boolean,
202
+ // eslint-disable-next-line no-use-before-define
234
203
  Group extends GroupBase<Option> = GroupBase<Option>
235
204
  >(
205
+ // eslint-disable-next-line no-use-before-define
236
206
  props: CreatableProps<Option, IsMulti, Group> & SelectProps<Option, IsMulti, Group>
237
207
  ) => ReturnType<typeof CreatableSelectInner>;
238
208
 
@@ -249,6 +219,7 @@ export function CreatableSelectInner<
249
219
  virtualized = true,
250
220
  ...rest
251
221
  }: CreatableProps<Option, IsMulti, Group> & SelectProps<Option, IsMulti, Group>,
222
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
252
223
  ref: any
253
224
  ) {
254
225
  return (
@@ -264,11 +235,11 @@ export function CreatableSelectInner<
264
235
  backspaceRemovesValue={isCollectionMode}
265
236
  tabSelectsValue={false}
266
237
  components={{
267
- Menu,
238
+ Menu: Menu,
268
239
  MenuList: virtualized ? WindowedMenuList : reactSelectComponents.MenuList,
269
240
  DropdownIndicator,
270
241
  ClearIndicator,
271
- Option: OptionComponent,
242
+ Option,
272
243
  MultiValueRemove: ClearIndicator,
273
244
  NoOptionsMessage,
274
245
  GroupHeading,
@@ -1,5 +1,5 @@
1
1
  import {css, cx} from "@linaria/core";
2
- import {border, radius, space, textStyles} from "../designSystem";
2
+ import {border, radius, space, textStyles} from "../design-system";
3
3
  import {inputOverrides} from "../antd/styles";
4
4
  import React, {
5
5
  ComponentType,
@@ -72,7 +72,7 @@ export const selectInPopupStyles = {
72
72
  }),
73
73
  option: (props: $TSFixMe) => ({
74
74
  ...props,
75
- borderRadius: border.radius3,
75
+ borderRadius: border.radius4,
76
76
  }),
77
77
  menu: (props: $TSFixMe) => ({
78
78
  ...props,
@@ -1,14 +1,11 @@
1
1
  import {css} from "@linaria/core";
2
- import {Property} from "csstype";
3
- import type {StylesConfig, CSSObjectWithLabel, ControlProps} from "react-select";
2
+ import type {ControlProps, CSSObjectWithLabel, StylesConfig} from "react-select";
4
3
  import {inputOverrides} from "../antd/styles";
5
- import {border, layout, space, textStyles, themeVars, transition} from "../designSystem";
4
+ import {layout, space, themeVars} from "../design-system";
5
+ import {OptionNulledStyles} from "./custom-select-partials/option";
6
+ import {MenuNulledStyles} from "./custom-select-partials/menu";
7
+ import {groupHeadingNulledStyles} from "./custom-select-partials/group-heading";
6
8
 
7
- export const expanderStyle = css`
8
- ${{
9
- transition: `transform ${transition}`,
10
- }}
11
- `;
12
9
  export const expanderExpandedStyle = css`
13
10
  transform: rotate(180deg);
14
11
  `;
@@ -45,10 +42,7 @@ function createControlStyle({
45
42
  }
46
43
 
47
44
  export const virtualizedStyles: StylesConfig = {
48
- option: (provided) => ({
49
- ...provided,
50
- height: layout.menuItemHeight,
51
- }),
45
+ option: () => OptionNulledStyles,
52
46
  groupHeading: (provided) => ({
53
47
  ...provided,
54
48
  height: layout.menuItemHeight,
@@ -70,36 +64,9 @@ export const zIndexStyles = (zIndex: number): StylesConfig => ({
70
64
  });
71
65
 
72
66
  export const componentsStyles: StylesConfig = {
73
- option: (provided, state) => {
74
- const disabledStyles = {
75
- cursor: "not-allowed",
76
- color: themeVars.disabledTextColor,
77
- };
78
- const enabledStyles = {
79
- ":hover": {
80
- backgroundColor: state.isFocused ? themeVars.actionMenuInnerHover : themeVars.actionMenuInnerHover,
81
- },
82
- ":active": {
83
- backgroundColor: themeVars.actionMenuInnerHover,
84
- },
85
- };
86
- return {
87
- ...provided,
88
- ...textStyles.regular,
89
- minHeight: layout.menuItemHeight,
90
- paddingLeft: space.l,
91
- paddingRight: space.l,
92
- paddingTop: 0,
93
- paddingBottom: 0,
94
- margin: 0,
95
- backgroundColor: state.isFocused ? themeVars.actionMenuInnerHover : themeVars.actionMenuInnerBg,
96
- cursor: "pointer",
97
- display: "flex",
98
- alignItems: "center",
99
- justifyContent: "stretch",
100
- ...(state.isDisabled ? disabledStyles : enabledStyles),
101
- };
102
- },
67
+ option: () => ({
68
+ minHeight: layout.menuItemHeight,
69
+ }),
103
70
  placeholder: (provided) => ({
104
71
  ...provided,
105
72
  color: themeVars.disabledTextColor,
@@ -140,12 +107,7 @@ export const componentsStyles: StylesConfig = {
140
107
  multiValueLabel: () => ({}),
141
108
  groupHeading: (provided) => ({
142
109
  ...provided,
143
- paddingLeft: space.l,
144
- paddingRight: space.m,
145
- paddingTop: space.m + space.xs,
146
- margin: 0,
147
- ...textStyles.small,
148
- color: themeVars.disabledTextColor,
110
+ ...groupHeadingNulledStyles,
149
111
  }),
150
112
  menuPortal: (provided) => ({
151
113
  ...provided,
@@ -153,11 +115,7 @@ export const componentsStyles: StylesConfig = {
153
115
  }),
154
116
  menu: (provided) => ({
155
117
  ...provided,
156
- color: themeVars.disabledTextColor,
157
- zIndex: 1050,
158
- backgroundColor: themeVars.actionMenuInnerBg,
159
- boxShadow: themeVars.actionMenuShadow as unknown as Property.BoxShadow,
160
- borderRadius: border.radius6,
118
+ ...MenuNulledStyles,
161
119
  }),
162
120
  container: (provided, state) => ({
163
121
  ...provided,
@@ -1,5 +1,5 @@
1
1
  import {css} from "@linaria/core";
2
- import {colors, layout, border, shadows, space, textStyles, themeVars, transition} from "../designSystem";
2
+ import {colors, layout, border, shadows, space, textStyles, themeVars, transition} from "../design-system";
3
3
 
4
4
  const inputVariables = {
5
5
  default: {
@@ -0,0 +1,3 @@
1
+ import {BackButton} from "./Button/back-button";
2
+
3
+ export {BackButton};
@@ -1,3 +1,5 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-ignore
1
3
  export const varPrefix = process.env.VAR_THEME_PREFIX || "fibery";
2
4
 
3
5
  export function createInlineTheme<T extends Record<string, unknown>>(