@fibery/ui-kit 4.0.0 → 4.1.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 (54) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/esfint.config.mjs +0 -17
  3. package/package.json +5 -6
  4. package/scripts/generate-icons.mjs +45 -44
  5. package/src/actions-menu/actions-menu-item.tsx +1 -1
  6. package/src/actions-menu/context-actions-menu.tsx +1 -1
  7. package/src/animated-height-container.tsx +1 -1
  8. package/src/antd/ant-modal.tsx +21 -21
  9. package/src/antd/styles.ts +2 -0
  10. package/src/app-icon-with-fallback.tsx +3 -7
  11. package/src/app-icon-wrapper.tsx +1 -13
  12. package/src/breadcrumb.tsx +5 -1
  13. package/src/color-utils.test.ts +2 -2
  14. package/src/color-utils.ts +2 -2
  15. package/src/copy-to-clipboard.ts +14 -3
  16. package/src/date-picker/contexts.ts +6 -3
  17. package/src/date-picker/date-range-picker.tsx +1 -2
  18. package/src/date-picker/single-date-picker.tsx +1 -2
  19. package/src/day-select/iso-week-day-select.tsx +2 -2
  20. package/src/design-system/colors.ts +3 -3
  21. package/src/emoji-picker/icon-emoji-picker.tsx +3 -3
  22. package/src/icons/ast/index.tsx +446 -446
  23. package/src/icons/icon.tsx +14 -2
  24. package/src/icons/icons-integrity.test.ts +145 -0
  25. package/src/icons/react/index.tsx +446 -446
  26. package/src/images-gallery/images-gallery.tsx +2 -2
  27. package/src/images-gallery/slide-buttons.tsx +2 -4
  28. package/src/lists/actions-menu-row-surface.tsx +1 -1
  29. package/src/media-query-utils.ts +1 -1
  30. package/src/mobile-keyboard-aware-popup.tsx +1 -1
  31. package/src/number-input/decimal.ts +6 -9
  32. package/src/number-input/number-input-inline-with-autosize.tsx +1 -1
  33. package/src/online-users.tsx +4 -5
  34. package/src/palettes/inspect.defs.colors.neutral-arch.test.ts +4 -4
  35. package/src/palettes/inspect.defs.colors.neutral-user.test.ts +4 -4
  36. package/src/palettes/inspect.defs.colors.warm-arch.test.ts +4 -4
  37. package/src/palettes/inspect.defs.colors.warm-user.test.ts +4 -4
  38. package/src/popover/index.tsx +4 -4
  39. package/src/popover/mobile-popover-context.tsx +1 -1
  40. package/src/popover/modifiers.tsx +1 -1
  41. package/src/rich-input-loader.tsx +1 -1
  42. package/src/select/components/menu-list-virtua.tsx +15 -16
  43. package/src/select/components/menu-list-virtualized.tsx +26 -29
  44. package/src/select/components/menu.tsx +3 -3
  45. package/src/select/index.tsx +1 -1
  46. package/src/select/reflection.ts +4 -5
  47. package/src/select/select.tsx +3 -3
  48. package/src/select/styles.ts +1 -7
  49. package/src/select/util.ts +2 -2
  50. package/src/theming.generated.css +8 -8
  51. package/src/theming.generated.ts +8 -8
  52. package/src/type-badge.tsx +1 -2
  53. package/src/use-on-screen-keyboard-data.tsx +1 -1
  54. package/src/with-data.tsx +1 -1
@@ -1,8 +1,8 @@
1
- import {createContext} from "@fibery/react/src/create-context";
1
+ import {noop} from "@fibery/helpers/src/_";
2
2
 
3
3
  import "photoswipe/style.css";
4
+ import {createContext} from "@fibery/react/src/create-context";
4
5
  import {css} from "@linaria/core";
5
- import noop from "lodash/noop";
6
6
  /* eslint-disable max-lines */
7
7
  import PhotoSwipeLightbox, {type PhotoSwipeEventsMap, type PhotoSwipeOptions} from "photoswipe/lightbox";
8
8
  import type {PropsWithChildren} from "react";
@@ -245,11 +245,9 @@ function CopyURLButton({pswp, showUI}: {pswp: PhotoSwipe; showUI: () => void}) {
245
245
  if (src) {
246
246
  copyUrlToClipboard({url: src, label: pswp.currSlide.data.label})
247
247
  .then(() => {
248
- toast.success({title: "Copied!"});
248
+ toast.success({title: "Link copied to clipboard"});
249
249
  })
250
- .catch(() => {
251
- toast.error({title: "Unable to copy."});
252
- });
250
+ .catch((error) => toast.error({title: "Unable to copy link to clipboard", subTitle: error.message}));
253
251
  }
254
252
  }}
255
253
  size={isPhone ? "large" : "medium"}
@@ -1,7 +1,7 @@
1
+ import {noop} from "@fibery/helpers/src/_";
1
2
  import {stopPropagation} from "@fibery/react/src/stop-propagation";
2
3
  import {useCallbackRef} from "@fibery/react/src/use-callback-ref";
3
4
  import {css, cx} from "@linaria/core";
4
- import noop from "lodash/noop";
5
5
  import {forwardRef, useId} from "react";
6
6
 
7
7
  import {useActionsMenuContext} from "../actions-menu";
@@ -1,4 +1,4 @@
1
- import noop from "lodash/noop";
1
+ import {noop} from "@fibery/helpers/src/_";
2
2
  export function getMediaQueryList(query: string) {
3
3
  // need for test
4
4
  return typeof window !== "undefined" && window.matchMedia
@@ -1,5 +1,5 @@
1
+ import {noop} from "@fibery/helpers/src/_";
1
2
  import {css, cx} from "@linaria/core";
2
- import noop from "lodash/noop";
3
3
  import type {ReactNode} from "react";
4
4
  import {useEffect, useRef} from "react";
5
5
  import {createPortal} from "react-dom";
@@ -1,12 +1,9 @@
1
- import isNil from "lodash/isNil";
2
- import trimEnd from "lodash/trimEnd";
1
+ import {truthy} from "@fibery/helpers/src/_";
3
2
 
4
3
  type NumericValue = string | number | null | undefined;
5
4
 
6
- const isEmpty = (value: NumericValue): value is null | undefined | "" => isNil(value) || value === "";
7
-
8
5
  const getPrecision = (value: NumericValue) => {
9
- if (isEmpty(value)) {
6
+ if (!truthy(value)) {
10
7
  return 0;
11
8
  }
12
9
  const [, decimalPart = ""] = String(value).split(".");
@@ -14,11 +11,11 @@ const getPrecision = (value: NumericValue) => {
14
11
  };
15
12
 
16
13
  const removeTrailingZeros = (value: string) => {
17
- if (isEmpty(value)) {
14
+ if (!truthy(value)) {
18
15
  return value;
19
16
  }
20
17
  const hasDecimalPart = value.indexOf(".") > 0;
21
- return hasDecimalPart ? trimEnd(trimEnd(value, "0"), ".") : value;
18
+ return hasDecimalPart ? value.replace(/\.?0+$/, "") : value;
22
19
  };
23
20
 
24
21
  export const add = (first: NumericValue, second: NumericValue) => {
@@ -32,7 +29,7 @@ export const sub = (first: NumericValue, second: NumericValue) => {
32
29
  };
33
30
 
34
31
  export const multiplyByHundred = (value: NumericValue) => {
35
- if (isEmpty(value)) {
32
+ if (!truthy(value)) {
36
33
  return value;
37
34
  }
38
35
  const result = Number(value) * 100;
@@ -41,7 +38,7 @@ export const multiplyByHundred = (value: NumericValue) => {
41
38
  };
42
39
 
43
40
  export const divideByHundred = (value: NumericValue) => {
44
- if (isEmpty(value)) {
41
+ if (!truthy(value)) {
45
42
  return value;
46
43
  }
47
44
  const result = Number(value) / 100;
@@ -1,6 +1,6 @@
1
+ import {identity} from "@fibery/helpers/src/_";
1
2
  import {stopPropagation} from "@fibery/react/src/stop-propagation";
2
3
  import {css, cx} from "@linaria/core";
3
- import identity from "lodash/identity";
4
4
  import InputNumber from "rc-input-number";
5
5
  import {useCallback, useMemo, useRef, useState} from "react";
6
6
 
@@ -1,5 +1,4 @@
1
1
  import {css, cx} from "@linaria/core";
2
- import take from "lodash/take";
3
2
  import {useEffect, useRef, useState} from "react";
4
3
 
5
4
  import {AvatarImage} from "./avatar";
@@ -151,8 +150,9 @@ export function OnlineUsers({
151
150
  </Tooltip>
152
151
  </div>
153
152
 
154
- {take(users, users.length === maxVisibleUsers ? maxVisibleUsers : maxVisibleUsers - 1).map(
155
- ({id, avatarUrl, hasAccess, name, callBack, isFollowed}, index) => {
153
+ {users
154
+ .slice(0, users.length === maxVisibleUsers ? maxVisibleUsers : maxVisibleUsers - 1)
155
+ .map(({id, avatarUrl, hasAccess, name, callBack, isFollowed}, index) => {
156
156
  const tooltipDescription = callBack ? "Click to follow" : "";
157
157
  const tooltipTitle = hasAccess ? name : "Private User";
158
158
  const userBorderColor = theme.fns.deneutralize(getObjectColorMemoized(name));
@@ -187,8 +187,7 @@ export function OnlineUsers({
187
187
  </Tooltip>
188
188
  </div>
189
189
  );
190
- }
191
- )}
190
+ })}
192
191
  </div>
193
192
  {Boolean(triggerElement) && users.length > maxVisibleUsers && (
194
193
  <Popover.Root open={visible} onOpen={() => onShow()} onClose={() => onHide()}>
@@ -741,19 +741,19 @@ test("snapshot", () => {
741
741
  "#292929 | hsl(none 0% 16%) | oklch(0.28 0 none)",
742
742
  ],
743
743
  "colorBgListItemGeneralSelected": [
744
- "#FDF3EE | hsl( 20 79% 96%) | oklch(0.97 0.01 49 )",
745
- "#432412 | hsl( 22 58% 17%) | oklch(0.3 0.06 50 )",
744
+ "#F7E0D3 | hsl( 22 69% 90%) | oklch(0.92 0.03 52 )",
745
+ "#4C2A16 | hsl( 22 55% 19%) | oklch(0.32 0.06 50 )",
746
746
  ],
747
747
  "colorBgListItemGeneralSelectedDisabled": [
748
748
  "#F7E0D3 | hsl( 22 69% 90%) | oklch(0.92 0.03 52 )",
749
749
  "#4C2A16 | hsl( 22 55% 19%) | oklch(0.32 0.06 50 )",
750
750
  ],
751
751
  "colorBgListItemGeneralSelectedFocus": [
752
- "#FAEBE3 | hsl( 21 70% 94%) | oklch(0.95 0.02 50 )",
752
+ "#F1D1C0 | hsl( 21 64% 85%) | oklch(0.88 0.04 50 )",
753
753
  "#58321C | hsl( 22 52% 23%) | oklch(0.36 0.06 50 )",
754
754
  ],
755
755
  "colorBgListItemGeneralSelectedHover": [
756
- "#FAEBE3 | hsl( 21 70% 94%) | oklch(0.95 0.02 50 )",
756
+ "#F1D1C0 | hsl( 21 64% 85%) | oklch(0.88 0.04 50 )",
757
757
  "#58321C | hsl( 22 52% 23%) | oklch(0.36 0.06 50 )",
758
758
  ],
759
759
  "colorBgLogoCardDark": [
@@ -741,19 +741,19 @@ test("snapshot", () => {
741
741
  "#292929 | hsl(none 0% 16%) | oklch(0.28 0 none)",
742
742
  ],
743
743
  "colorBgListItemGeneralSelected": [
744
- "#F1F5FE | hsl( 222 87% 97%) | oklch(0.97 0.01 267 )",
745
- "#1C2B4F | hsl( 222 48% 21%) | oklch(0.3 0.07 265 )",
744
+ "#DBE5FA | hsl( 221 76% 92%) | oklch(0.92 0.03 265 )",
745
+ "#223259 | hsl( 223 45% 24%) | oklch(0.32 0.07 266 )",
746
746
  ],
747
747
  "colorBgListItemGeneralSelectedDisabled": [
748
748
  "#DBE5FA | hsl( 221 76% 92%) | oklch(0.92 0.03 265 )",
749
749
  "#223259 | hsl( 223 45% 24%) | oklch(0.32 0.07 266 )",
750
750
  ],
751
751
  "colorBgListItemGeneralSelectedFocus": [
752
- "#E8EFFD | hsl( 220 84% 95%) | oklch(0.95 0.02 264 )",
752
+ "#CAD9F6 | hsl( 220 71% 88%) | oklch(0.88 0.04 264 )",
753
753
  "#293B66 | hsl( 222 43% 28%) | oklch(0.36 0.08 266 )",
754
754
  ],
755
755
  "colorBgListItemGeneralSelectedHover": [
756
- "#E8EFFD | hsl( 220 84% 95%) | oklch(0.95 0.02 264 )",
756
+ "#CAD9F6 | hsl( 220 71% 88%) | oklch(0.88 0.04 264 )",
757
757
  "#293B66 | hsl( 222 43% 28%) | oklch(0.36 0.08 266 )",
758
758
  ],
759
759
  "colorBgLogoCardDark": [
@@ -743,19 +743,19 @@ test("snapshot", () => {
743
743
  "#2D2826 | hsl( 17 8% 16%) | oklch(0.28 0.01 43 )",
744
744
  ],
745
745
  "colorBgListItemGeneralSelected": [
746
- "#FEF3EA | hsl( 27 91% 96%) | oklch(0.97 0.02 62 )",
747
- "#482106 | hsl( 25 85% 15%) | oklch(0.3 0.07 51 )",
746
+ "#FBDFCA | hsl( 26 86% 89%) | oklch(0.92 0.04 59 )",
747
+ "#522609 | hsl( 24 80% 18%) | oklch(0.32 0.08 50 )",
748
748
  ],
749
749
  "colorBgListItemGeneralSelectedDisabled": [
750
750
  "#FBDFCA | hsl( 26 86% 89%) | oklch(0.92 0.04 59 )",
751
751
  "#522609 | hsl( 24 80% 18%) | oklch(0.32 0.08 50 )",
752
752
  ],
753
753
  "colorBgListItemGeneralSelectedFocus": [
754
- "#FDEBDC | hsl( 27 89% 93%) | oklch(0.95 0.03 62 )",
754
+ "#F7D0B2 | hsl( 26 81% 83%) | oklch(0.88 0.06 59 )",
755
755
  "#5E2E0E | hsl( 24 74% 21%) | oklch(0.36 0.08 50 )",
756
756
  ],
757
757
  "colorBgListItemGeneralSelectedHover": [
758
- "#FDEBDC | hsl( 27 89% 93%) | oklch(0.95 0.03 62 )",
758
+ "#F7D0B2 | hsl( 26 81% 83%) | oklch(0.88 0.06 59 )",
759
759
  "#5E2E0E | hsl( 24 74% 21%) | oklch(0.36 0.08 50 )",
760
760
  ],
761
761
  "colorBgLogoCardDark": [
@@ -743,19 +743,19 @@ test("snapshot", () => {
743
743
  "#2D2826 | hsl( 17 8% 16%) | oklch(0.28 0.01 43 )",
744
744
  ],
745
745
  "colorBgListItemGeneralSelected": [
746
- "#EEF7F9 | hsl( 191 48% 95%) | oklch(0.97 0.01 213 )",
747
- "#01333F | hsl( 192 97% 13%) | oklch(0.3 0.05 219 )",
746
+ "#D5E9F0 | hsl( 196 47% 89%) | oklch(0.92 0.02 221 )",
747
+ "#043A48 | hsl( 192 89% 15%) | oklch(0.32 0.06 221 )",
748
748
  ],
749
749
  "colorBgListItemGeneralSelectedDisabled": [
750
750
  "#D5E9F0 | hsl( 196 47% 89%) | oklch(0.92 0.02 221 )",
751
751
  "#043A48 | hsl( 192 89% 15%) | oklch(0.32 0.06 221 )",
752
752
  ],
753
753
  "colorBgListItemGeneralSelectedFocus": [
754
- "#E4F1F6 | hsl( 197 50% 93%) | oklch(0.95 0.02 223 )",
754
+ "#C2DEE8 | hsl( 196 45% 84%) | oklch(0.88 0.03 221 )",
755
755
  "#074453 | hsl( 192 84% 18%) | oklch(0.36 0.06 220 )",
756
756
  ],
757
757
  "colorBgListItemGeneralSelectedHover": [
758
- "#E4F1F6 | hsl( 197 50% 93%) | oklch(0.95 0.02 223 )",
758
+ "#C2DEE8 | hsl( 196 45% 84%) | oklch(0.88 0.03 221 )",
759
759
  "#074453 | hsl( 192 84% 18%) | oklch(0.36 0.06 220 )",
760
760
  ],
761
761
  "colorBgLogoCardDark": [
@@ -1,3 +1,4 @@
1
+ import {truthy} from "@fibery/helpers/src/_";
1
2
  import {composeEventHandlers} from "@fibery/react/src/compose-event-handlers";
2
3
  import {createContext} from "@fibery/react/src/create-context";
3
4
  // oxlint-disable max-lines
@@ -13,7 +14,6 @@ import type {Options as PreventOverflowOptions} from "@popperjs/core/lib/modifie
13
14
  import type {FocusScopeProps} from "@radix-ui/react-focus-scope";
14
15
  import {FocusScope} from "@radix-ui/react-focus-scope";
15
16
  import cx from "classnames";
16
- import compact from "lodash/compact";
17
17
  import type {CSSProperties, MouseEvent, ReactNode} from "react";
18
18
  import {
19
19
  cloneElement,
@@ -369,7 +369,7 @@ const Content = forwardRef<ContentRef, PopoverContentProps>((props, ref) => {
369
369
  }, [padding, preventOverflowOptions, shrinkable]);
370
370
 
371
371
  const modifiers = useMemo(() => {
372
- return compact([
372
+ return [
373
373
  {
374
374
  name: "flip",
375
375
  options: {
@@ -399,7 +399,7 @@ const Content = forwardRef<ContentRef, PopoverContentProps>((props, ref) => {
399
399
  ...shrinkableModifiers,
400
400
  ...additionalModifiers,
401
401
  ...(popupModifiers.additionalModifiers ?? []),
402
- ]);
402
+ ].filter(truthy);
403
403
  }, [
404
404
  additionalModifiers,
405
405
  flipOptions,
@@ -424,7 +424,7 @@ const Content = forwardRef<ContentRef, PopoverContentProps>((props, ref) => {
424
424
  }
425
425
  const target = event.target;
426
426
  if (target instanceof Node) {
427
- const ignoreElements = compact([isElementReference(triggerElement) && triggerElement]);
427
+ const ignoreElements = [isElementReference(triggerElement) && triggerElement].filter(truthy);
428
428
  if (ignoreElements.some((element) => element.contains(target))) {
429
429
  return;
430
430
  }
@@ -1,5 +1,5 @@
1
+ import {noop} from "@fibery/helpers/src/_";
1
2
  import {createContext} from "@fibery/react/src/create-context";
2
- import noop from "lodash/noop";
3
3
  import type {FC, ReactNode} from "react";
4
4
  import {useState, useMemo} from "react";
5
5
 
@@ -1,7 +1,7 @@
1
+ import {noop} from "@fibery/helpers/src/_";
1
2
  import {getResizeListener} from "@fibery/helpers/utils/resize-listener";
2
3
  import type {Modifier, ModifierArguments, Placement, Boundary, RootBoundary, Padding, Context} from "@popperjs/core";
3
4
  import type {Options as PreventOverflowOptions} from "@popperjs/core/lib/modifiers/preventOverflow";
4
- import noop from "lodash/noop";
5
5
  import maxSize from "popper-max-size-modifier";
6
6
 
7
7
  import {isElementReference} from "./reference";
@@ -1,6 +1,6 @@
1
+ import {noop} from "@fibery/helpers/src/_";
1
2
  import {css, cx} from "@linaria/core";
2
3
  import {styled} from "@linaria/react";
3
- import noop from "lodash/noop";
4
4
  import {memo, createContext, useContext, useState, useEffect, useMemo} from "react";
5
5
 
6
6
  import {regularRichEditorHTMLStyles} from "./html-styles";
@@ -1,4 +1,4 @@
1
- import compact from "lodash/compact";
1
+ import {truthy} from "@fibery/helpers/src/_";
2
2
  import type {ComponentType, CSSProperties, ReactNode} from "react";
3
3
  import {Children, useContext, useEffect, useMemo, useRef, useState} from "react";
4
4
  import type {GroupHeadingProps, GroupProps, MenuListProps} from "react-select";
@@ -15,22 +15,21 @@ function flattenGroupChildren(
15
15
  children: ReactNode,
16
16
  renderGroup: (Component: ComponentType<GroupHeadingProps>, props: GroupProps["headingProps"]) => ReactNode
17
17
  ): ReactNode[] {
18
- return compact(
19
- Children.toArray(children)
20
- .map((child) => {
21
- if (isReactElementWithProps(child) && isGroupChild(child)) {
22
- const {props} = child;
23
- const groupChildren = compact(Children.toArray(props.children));
24
- if (!groupChildren.length) {
25
- return [];
26
- }
27
- const heading = renderGroup(props.Heading, props.headingProps);
28
- return [heading, ...groupChildren];
18
+ return Children.toArray(children)
19
+ .map((child) => {
20
+ if (isReactElementWithProps(child) && isGroupChild(child)) {
21
+ const {props} = child;
22
+ const groupChildren = Children.toArray(props.children).filter(truthy);
23
+ if (!groupChildren.length) {
24
+ return [];
29
25
  }
30
- return child;
31
- })
32
- .flat()
33
- );
26
+ const heading = renderGroup(props.Heading, props.headingProps);
27
+ return [heading, ...groupChildren];
28
+ }
29
+ return child;
30
+ })
31
+ .flat()
32
+ .filter(truthy);
34
33
  }
35
34
 
36
35
  /**
@@ -1,6 +1,4 @@
1
- import compact from "lodash/compact";
2
- import isFunction from "lodash/isFunction";
3
- import isObject from "lodash/isObject";
1
+ import {isRecord, truthy} from "@fibery/helpers/src/_";
4
2
  import type {ComponentType, CSSProperties, ReactNode} from "react";
5
3
  import {Children, useContext, useEffect, useMemo, useRef, useState} from "react";
6
4
  import type {GroupHeadingProps, GroupProps, MenuListProps} from "react-select";
@@ -20,12 +18,12 @@ function isGroupChild<Option, isMulty extends boolean, Group extends GroupBase<O
20
18
  props: unknown
21
19
  ): props is GroupProps<Option, isMulty, Group> {
22
20
  return (
23
- isObject(props) &&
21
+ isRecord(props) &&
24
22
  "options" in props &&
25
23
  "Heading" in props &&
26
- isFunction(props.Heading) &&
24
+ typeof props.Heading === "function" &&
27
25
  "headingProps" in props &&
28
- isObject(props.headingProps)
26
+ isRecord(props.headingProps)
29
27
  );
30
28
  }
31
29
 
@@ -33,27 +31,26 @@ const flattenGroupChildren: (
33
31
  children: ReactNode,
34
32
  renderGroup: (Component: ComponentType<GroupHeadingProps>, props: GroupProps["headingProps"]) => ReactNode
35
33
  ) => ReactNode[] = (children, renderGroup) => {
36
- return compact(
37
- Children.toArray(children)
38
- .map((child) => {
39
- if (isObject(child) && "props" in child && isObject(child.props)) {
40
- const {props} = child;
41
- if (isGroupChild(props)) {
42
- //well, it's a group
43
- const children = compact(Children.toArray(props.children));
44
- if (!children.length) {
45
- // do not render empty groups
46
- return [];
47
- }
48
- const heading = renderGroup(props.Heading, props.headingProps);
49
- return [heading, ...children];
34
+ return Children.toArray(children)
35
+ .map((child) => {
36
+ if (isRecord(child) && "props" in child && isRecord(child.props)) {
37
+ const {props} = child;
38
+ if (isGroupChild(props)) {
39
+ //well, it's a group
40
+ const children = Children.toArray(props.children).filter(truthy);
41
+ if (!children.length) {
42
+ // do not render empty groups
43
+ return [];
50
44
  }
45
+ const heading = renderGroup(props.Heading, props.headingProps);
46
+ return [heading, ...children];
51
47
  }
52
- //if not a group, just keep child as is
53
- return child;
54
- })
55
- .flat()
56
- );
48
+ }
49
+ //if not a group, just keep child as is
50
+ return child;
51
+ })
52
+ .flat()
53
+ .filter(truthy);
57
54
  };
58
55
 
59
56
  const drawListElement: ItemContent<ReactNode, never> = (index, child) => child;
@@ -111,7 +108,7 @@ export function MenuListVirtualized<
111
108
  return -1;
112
109
  }
113
110
  return flattenChildren.findIndex((child) => {
114
- if (isObject(child) && "props" in child && isObject(child.props) && "data" in child.props) {
111
+ if (isRecord(child) && "props" in child && isRecord(child.props) && "data" in child.props) {
115
112
  return child.props.data === focusedOption;
116
113
  }
117
114
  return false;
@@ -128,14 +125,14 @@ export function MenuListVirtualized<
128
125
  for (let i = 0; i < flattenChildren.length; i++) {
129
126
  const child = flattenChildren[i];
130
127
  if (
131
- isObject(child) &&
128
+ isRecord(child) &&
132
129
  "props" in child &&
133
- isObject(child.props) &&
130
+ isRecord(child.props) &&
134
131
  "type" in child.props &&
135
132
  child.props.type === "option" &&
136
133
  "isSelected" in child.props
137
134
  ) {
138
- if ("data" in child.props && isObject(child.props.data)) {
135
+ if ("data" in child.props && isRecord(child.props.data)) {
139
136
  if ("isSelected" in child.props && child.props.isSelected) {
140
137
  selectedOption = child.props.data;
141
138
  break;
@@ -13,12 +13,12 @@ export const MenuListNulledStyles: CSSObjectWithLabel = {
13
13
  };
14
14
  export const MenuNulledStyles: CSSObjectWithLabel = {
15
15
  backgroundColor: "",
16
- borderRadius: "",
17
16
  boxShadow: "",
18
17
  marginTop: 0,
19
18
  marginBottom: 0,
20
- paddingTop: space.s8,
21
- paddingBottom: space.s8,
19
+ paddingTop: space.s6,
20
+ paddingBottom: space.s6,
21
+ borderRadius: border.radius8,
22
22
  };
23
23
 
24
24
  const menuCss = css`
@@ -1,5 +1,5 @@
1
1
  import {css, cx} from "@linaria/core";
2
- import type {ForwardedRef} from "react";
2
+ import {type ForwardedRef} from "react";
3
3
  import React, {forwardRef} from "react";
4
4
 
5
5
  import type {$TSFixMe} from "../tsfixme";
@@ -1,5 +1,4 @@
1
- import isFunction from "lodash/isFunction";
2
- import isObject from "lodash/isObject";
1
+ import {isRecord} from "@fibery/helpers/src/_";
3
2
  import type {GroupProps} from "react-select/dist/declarations/src";
4
3
 
5
4
  import type {GroupBase} from "./util";
@@ -7,7 +6,7 @@ import type {GroupBase} from "./util";
7
6
  type ReactElementWithProps<P = object> = {props: P};
8
7
 
9
8
  export function isReactElementWithProps(node: unknown): node is ReactElementWithProps {
10
- return isObject(node) && "props" in node && isObject(node.props);
9
+ return isRecord(node) && "props" in node && isRecord(node.props);
11
10
  }
12
11
 
13
12
  export function isGroupChild<Option, IsMulti extends boolean, Group extends GroupBase<Option> = GroupBase<Option>>(
@@ -16,8 +15,8 @@ export function isGroupChild<Option, IsMulti extends boolean, Group extends Grou
16
15
  return (
17
16
  "options" in node.props &&
18
17
  "Heading" in node.props &&
19
- isFunction(node.props.Heading) &&
18
+ typeof node.props.Heading === "function" &&
20
19
  "headingProps" in node.props &&
21
- isObject(node.props.headingProps)
20
+ isRecord(node.props.headingProps)
22
21
  );
23
22
  }
@@ -1,6 +1,6 @@
1
+ import {truthy} from "@fibery/helpers/src/_";
1
2
  import {composeEventHandlers} from "@fibery/react/src/compose-event-handlers";
2
3
  import {useComposedRefs} from "@fibery/react/src/use-composed-refs";
3
- import compact from "lodash/compact";
4
4
  import type {ForwardedRef, RefObject} from "react";
5
5
  import {forwardRef, useCallback, useMemo, useRef, useState} from "react";
6
6
  import type {
@@ -128,12 +128,12 @@ function useSelectStyles<T, U extends boolean, V extends GroupBase<T>>({
128
128
  }) {
129
129
  return useMemo(() => {
130
130
  return composeStyles<T, U, V>(
131
- compact([
131
+ [
132
132
  makeComponentsStyles<T, U, V>(),
133
133
  virtualized ? makeVirtualizedStyles<T, U, V>() : makeNonVirtualizedStyles<T, U, V>(),
134
134
  zIndex ? makeZIndexStyles<T, U, V>(zIndex) : null,
135
135
  styles,
136
- ])
136
+ ].filter(truthy)
137
137
  );
138
138
  }, [styles, virtualized, zIndex]);
139
139
  }
@@ -53,13 +53,7 @@ export const makeVirtualizedStyles = <T, U extends boolean, V extends GroupBase<
53
53
  }),
54
54
  });
55
55
 
56
- export const makeNonVirtualizedStyles = <T, U extends boolean, V extends GroupBase<T>>(): StylesConfig<T, U, V> => ({
57
- menuList: (provided) => ({
58
- ...provided,
59
- paddingTop: 6,
60
- paddingBottom: 6,
61
- }),
62
- });
56
+ export const makeNonVirtualizedStyles = <T, U extends boolean, V extends GroupBase<T>>(): StylesConfig<T, U, V> => ({});
63
57
 
64
58
  export const makeZIndexStyles = <T, U extends boolean, V extends GroupBase<T>>(
65
59
  zIndex: number
@@ -1,4 +1,4 @@
1
- import isObject from "lodash/isObject";
1
+ import {isRecord} from "@fibery/helpers/src/_";
2
2
  import type {ReactNode, RefObject} from "react";
3
3
  import {Children, createContext} from "react";
4
4
  import type {GroupBase as ReactSelectGroupBase, OptionsOrGroups, SelectInstance} from "react-select";
@@ -11,7 +11,7 @@ export type GroupBase<T> = ReactSelectGroupBase<T> & {separator?: boolean; separ
11
11
  export function isGroup<Option, Group extends GroupBase<Option>>(
12
12
  optionOrGroup: Option | Group
13
13
  ): optionOrGroup is Group {
14
- return isObject(optionOrGroup) && "options" in optionOrGroup;
14
+ return isRecord(optionOrGroup) && "options" in optionOrGroup;
15
15
  }
16
16
 
17
17
  export function countOptions<Option, Group extends GroupBase<Option>>(
@@ -160,9 +160,9 @@
160
160
  --fibery-color-colorBgListItemGeneral: rgba(255, 255, 255, 0);
161
161
  --fibery-color-colorBgListItemGeneralHover: rgb(245, 245, 245);
162
162
  --fibery-color-colorBgListItemGeneralFocus: rgb(237, 237, 237);
163
- --fibery-color-colorBgListItemGeneralSelected: #f1f5fe;
164
- --fibery-color-colorBgListItemGeneralSelectedHover: #e8effd;
165
- --fibery-color-colorBgListItemGeneralSelectedFocus: #e8effd;
163
+ --fibery-color-colorBgListItemGeneralSelected: #dbe5fa;
164
+ --fibery-color-colorBgListItemGeneralSelectedHover: #cad9f6;
165
+ --fibery-color-colorBgListItemGeneralSelectedFocus: #cad9f6;
166
166
  --fibery-color-colorBgListItemGeneralDisabled: rgba(255, 255, 255, 0);
167
167
  --fibery-color-colorTextListItemGeneralDisabled: rgb(158, 158, 158);
168
168
  --fibery-color-colorBgListItemGeneralSelectedDisabled: #dbe5fa;
@@ -661,7 +661,7 @@
661
661
  --fibery-color-colorBgListItemGeneral: rgba(255, 255, 255, 0);
662
662
  --fibery-color-colorBgListItemGeneralHover: rgb(41, 41, 41);
663
663
  --fibery-color-colorBgListItemGeneralFocus: rgb(51, 51, 51);
664
- --fibery-color-colorBgListItemGeneralSelected: #1c2b4f;
664
+ --fibery-color-colorBgListItemGeneralSelected: #223259;
665
665
  --fibery-color-colorBgListItemGeneralSelectedHover: #293b66;
666
666
  --fibery-color-colorBgListItemGeneralSelectedFocus: #293b66;
667
667
  --fibery-color-colorBgListItemGeneralDisabled: rgba(255, 255, 255, 0);
@@ -1160,9 +1160,9 @@
1160
1160
  --fibery-color-colorBgListItemGeneral: rgba(255, 255, 255, 0);
1161
1161
  --fibery-color-colorBgListItemGeneralHover: rgb(250, 244, 236);
1162
1162
  --fibery-color-colorBgListItemGeneralFocus: rgb(243, 236, 229);
1163
- --fibery-color-colorBgListItemGeneralSelected: rgb(238, 247, 249);
1164
- --fibery-color-colorBgListItemGeneralSelectedHover: rgb(228, 241, 246);
1165
- --fibery-color-colorBgListItemGeneralSelectedFocus: rgb(228, 241, 246);
1163
+ --fibery-color-colorBgListItemGeneralSelected: rgb(213, 233, 240);
1164
+ --fibery-color-colorBgListItemGeneralSelectedHover: rgb(194, 222, 232);
1165
+ --fibery-color-colorBgListItemGeneralSelectedFocus: rgb(194, 222, 232);
1166
1166
  --fibery-color-colorBgListItemGeneralDisabled: rgba(255, 255, 255, 0);
1167
1167
  --fibery-color-colorTextListItemGeneralDisabled: rgb(163, 157, 150);
1168
1168
  --fibery-color-colorBgListItemGeneralSelectedDisabled: rgb(213, 233, 240);
@@ -1659,7 +1659,7 @@
1659
1659
  --fibery-color-colorBgListItemGeneral: rgba(255, 255, 255, 0);
1660
1660
  --fibery-color-colorBgListItemGeneralHover: rgb(45, 40, 38);
1661
1661
  --fibery-color-colorBgListItemGeneralFocus: rgb(55, 50, 48);
1662
- --fibery-color-colorBgListItemGeneralSelected: rgb(1, 51, 63);
1662
+ --fibery-color-colorBgListItemGeneralSelected: rgb(4, 58, 72);
1663
1663
  --fibery-color-colorBgListItemGeneralSelectedHover: rgb(7, 68, 83);
1664
1664
  --fibery-color-colorBgListItemGeneralSelectedFocus: rgb(7, 68, 83);
1665
1665
  --fibery-color-colorBgListItemGeneralDisabled: rgba(255, 255, 255, 0);