@alfalab/core-components-picker-button 11.6.8 → 11.7.1

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 (109) hide show
  1. package/{cssm/Component-57569e57.d.ts → Component-1fe708ea.d.ts} +1 -1
  2. package/Component-bdb4c6b9.d.ts +2 -1
  3. package/Component-c44170fe.d.ts +1 -1
  4. package/Component.responsive.d.ts +2 -1
  5. package/{esm/ResponsiveContext-88b743b5.d.ts → ResponsiveContext-d6bfd5b7.d.ts} +1 -1
  6. package/{Component-57569e57.d.ts → cssm/Component-1fe708ea.d.ts} +1 -1
  7. package/cssm/Component-bdb4c6b9.d.ts +2 -1
  8. package/cssm/Component-c44170fe.d.ts +1 -1
  9. package/cssm/Component.responsive.d.ts +2 -1
  10. package/{modern/ResponsiveContext-88b743b5.d.ts → cssm/ResponsiveContext-d6bfd5b7.d.ts} +1 -1
  11. package/cssm/desktop/Component.desktop.d.ts +11 -3
  12. package/cssm/desktop/Component.desktop.js +2 -1
  13. package/cssm/field/Component.d.ts +4 -2
  14. package/cssm/field/Component.js +2 -2
  15. package/cssm/iconMap-09d2f9c9.d.ts +4 -0
  16. package/cssm/index-09d2f9c9.d.ts +38 -0
  17. package/{esm/index-a5b021bd.d.ts → cssm/index-307da6d7.d.ts} +2 -1
  18. package/cssm/index-bdb4c6b9.d.ts +11 -4
  19. package/cssm/mobile/Component.mobile.js +2 -1
  20. package/{esm/types-667e33fd.d.ts → cssm/types-a870d1f8.d.ts} +2 -2
  21. package/cssm/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +17 -15
  22. package/{esm/typings-88b743b5.d.ts → cssm/typings-d6bfd5b7.d.ts} +4 -0
  23. package/cssm/use-skeleton-1328ead9.d.ts +4 -0
  24. package/cssm/utils/index.d.ts +5 -3
  25. package/cssm/utils/index.js +9 -2
  26. package/cssm/utils-89376c31.d.ts +1 -1
  27. package/desktop/Component.desktop.d.ts +11 -3
  28. package/desktop/Component.desktop.js +3 -2
  29. package/esm/{Component-57569e57.d.ts → Component-1fe708ea.d.ts} +1 -1
  30. package/esm/Component-bdb4c6b9.d.ts +2 -1
  31. package/esm/Component-c44170fe.d.ts +1 -1
  32. package/esm/Component.responsive.d.ts +2 -1
  33. package/{cssm/ResponsiveContext-88b743b5.d.ts → esm/ResponsiveContext-d6bfd5b7.d.ts} +1 -1
  34. package/esm/desktop/Component.desktop.d.ts +11 -3
  35. package/esm/desktop/Component.desktop.js +3 -2
  36. package/esm/field/Component.d.ts +4 -2
  37. package/esm/field/Component.js +3 -3
  38. package/esm/field/index.css +6 -6
  39. package/esm/iconMap-09d2f9c9.d.ts +4 -0
  40. package/esm/index-09d2f9c9.d.ts +38 -0
  41. package/{index-a5b021bd.d.ts → esm/index-307da6d7.d.ts} +2 -1
  42. package/esm/index-bdb4c6b9.d.ts +11 -4
  43. package/esm/index.css +5 -5
  44. package/esm/mobile/Component.mobile.js +2 -1
  45. package/esm/option/Component.js +1 -1
  46. package/esm/option/index.css +4 -4
  47. package/{modern/types-667e33fd.d.ts → esm/types-a870d1f8.d.ts} +2 -2
  48. package/esm/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +17 -15
  49. package/{modern/typings-88b743b5.d.ts → esm/typings-d6bfd5b7.d.ts} +4 -0
  50. package/esm/use-skeleton-1328ead9.d.ts +4 -0
  51. package/esm/utils/index.d.ts +5 -3
  52. package/esm/utils/index.js +9 -3
  53. package/esm/utils-89376c31.d.ts +1 -1
  54. package/field/Component.d.ts +4 -2
  55. package/field/Component.js +3 -3
  56. package/field/index.css +6 -6
  57. package/iconMap-09d2f9c9.d.ts +4 -0
  58. package/index-09d2f9c9.d.ts +38 -0
  59. package/{cssm/index-a5b021bd.d.ts → index-307da6d7.d.ts} +2 -1
  60. package/index-bdb4c6b9.d.ts +11 -4
  61. package/index.css +5 -5
  62. package/mobile/Component.mobile.js +2 -1
  63. package/modern/{Component-57569e57.d.ts → Component-1fe708ea.d.ts} +1 -1
  64. package/modern/Component-bdb4c6b9.d.ts +2 -1
  65. package/modern/Component-c44170fe.d.ts +1 -1
  66. package/modern/Component.responsive.d.ts +2 -1
  67. package/{ResponsiveContext-88b743b5.d.ts → modern/ResponsiveContext-d6bfd5b7.d.ts} +1 -1
  68. package/modern/desktop/Component.desktop.d.ts +11 -3
  69. package/modern/desktop/Component.desktop.js +3 -2
  70. package/modern/field/Component.d.ts +4 -2
  71. package/modern/field/Component.js +3 -3
  72. package/modern/field/index.css +6 -6
  73. package/modern/iconMap-09d2f9c9.d.ts +4 -0
  74. package/modern/index-09d2f9c9.d.ts +38 -0
  75. package/modern/{index-a5b021bd.d.ts → index-307da6d7.d.ts} +2 -1
  76. package/modern/index-bdb4c6b9.d.ts +11 -4
  77. package/modern/index.css +5 -5
  78. package/modern/mobile/Component.mobile.js +2 -1
  79. package/modern/option/Component.js +1 -1
  80. package/modern/option/index.css +4 -4
  81. package/{cssm/types-667e33fd.d.ts → modern/types-a870d1f8.d.ts} +2 -2
  82. package/modern/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +17 -15
  83. package/{cssm/typings-88b743b5.d.ts → modern/typings-d6bfd5b7.d.ts} +4 -0
  84. package/modern/use-skeleton-1328ead9.d.ts +4 -0
  85. package/modern/utils/index.d.ts +5 -3
  86. package/modern/utils/index.js +9 -3
  87. package/modern/utils-89376c31.d.ts +1 -1
  88. package/option/Component.js +1 -1
  89. package/option/index.css +4 -4
  90. package/package.json +3 -3
  91. package/src/desktop/Component.desktop.tsx +9 -2
  92. package/src/field/Component.tsx +6 -2
  93. package/src/mobile/Component.mobile.tsx +2 -0
  94. package/src/utils/index.ts +12 -3
  95. package/{types-667e33fd.d.ts → types-a870d1f8.d.ts} +2 -2
  96. package/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +17 -15
  97. package/{typings-88b743b5.d.ts → typings-d6bfd5b7.d.ts} +4 -0
  98. package/use-skeleton-1328ead9.d.ts +4 -0
  99. package/utils/index.d.ts +5 -3
  100. package/utils/index.js +9 -2
  101. package/utils-89376c31.d.ts +1 -1
  102. package/Component-064acd29.d.ts +0 -56
  103. package/cssm/Component-064acd29.d.ts +0 -56
  104. package/esm/Component-064acd29.d.ts +0 -56
  105. package/modern/Component-064acd29.d.ts +0 -56
  106. /package/{Component-a5b021bd.d.ts → Component-307da6d7.d.ts} +0 -0
  107. /package/cssm/{Component-a5b021bd.d.ts → Component-307da6d7.d.ts} +0 -0
  108. /package/esm/{Component-a5b021bd.d.ts → Component-307da6d7.d.ts} +0 -0
  109. /package/modern/{Component-a5b021bd.d.ts → Component-307da6d7.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- /* hash: 17l9j */
1
+ /* hash: 155u9 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -15,13 +15,13 @@
15
15
  --gap-s: 12px;
16
16
  } :root {
17
17
  } :root {
18
- } .picker-button__container_ceyn0 {
18
+ } .picker-button__container_g1kh7 {
19
19
  display: flex;
20
20
  align-items: center;
21
- } .picker-button__icon_ceyn0 {
21
+ } .picker-button__icon_g1kh7 {
22
22
  display: flex;
23
23
  margin-right: var(--gap-s);
24
- } .picker-button__content_ceyn0 {
24
+ } .picker-button__content_g1kh7 {
25
25
  overflow: hidden;
26
26
  flex: 1;
27
27
  text-overflow: ellipsis;
@@ -2,7 +2,7 @@
2
2
  import React from 'react';
3
3
  import { ReactNode } from "react";
4
4
  import { BackArrowAddonProps, CloserProps } from "./index-ebda875c";
5
- type NavigationBarProps = {
5
+ type NavigationBarPrivateProps = {
6
6
  /**
7
7
  * Контент шапки
8
8
  */
@@ -114,4 +114,4 @@ type ContentParams = {
114
114
  style?: React.CSSProperties;
115
115
  hidden?: boolean;
116
116
  };
117
- export { NavigationBarProps, ContentParams };
117
+ export { NavigationBarPrivateProps, ContentParams };
@@ -1,16 +1,17 @@
1
1
  /// <reference types="react-transition-group" />
2
2
  /// <reference types="react" />
3
3
  import React from "react";
4
- import { HTMLAttributes, ReactElement, ReactNode, RefObject, FC, AriaAttributes, FocusEvent, MouseEvent, RefAttributes, SVGProps } from "react";
4
+ import { HTMLAttributes, ReactElement, ReactNode, RefObject, FC, AriaAttributes, ComponentType, FocusEvent, MouseEvent, RefAttributes, SVGProps } from "react";
5
5
  import { HandledEvents } from "react-swipeable/es/types";
6
6
  import { TransitionProps } from "react-transition-group/Transition";
7
7
  import { BaseModalProps } from "./index-bdb4c6b9";
8
- import { NavigationBarProps } from "./types-667e33fd";
8
+ import { NavigationBarPrivateProps } from "./types-a870d1f8";
9
+ import { NavigationBarPrivateProps as NavigationBarProps } from "./types-a870d1f8";
9
10
  import { BackgroundColorType } from "./index-064acd29";
10
11
  import { BaseInputProps, BackdropProps } from "./index-ebda875c";
11
12
  import { SwipeableHandlers, SwipeDirections } from "react-swipeable";
12
13
  import { FormControlProps } from "./index-c44170fe";
13
- import { ModalResponsiveProps as ModalProps } from "./typings-88b743b5";
14
+ import { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
14
15
  import { PopoverProps } from "@alfalab/core-components-popover";
15
16
  import { UseSelectWithApplyProps } from "./field/Component";
16
17
  type BottomSheetTitleAlign = "center" | "left";
@@ -304,7 +305,7 @@ declare const Input: React.ForwardRefExoticComponent<Omit<BaseInputProps, "FormC
304
305
  breakpoint?: number | undefined;
305
306
  defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
306
307
  } & React.RefAttributes<HTMLInputElement>>;
307
- type HeaderProps = Omit<NavigationBarProps, "size" | "view" | "parentRef">;
308
+ type HeaderProps = Omit<NavigationBarPrivateProps, "size" | "view" | "parentRef">;
308
309
  type FooterProps = {
309
310
  /**
310
311
  * Контент футера
@@ -332,12 +333,13 @@ declare const ModalResponsive: React.ForwardRefExoticComponent<import("./index-b
332
333
  fullscreen?: boolean | undefined;
333
334
  fixedPosition?: boolean | undefined;
334
335
  hasCloser?: boolean | undefined;
336
+ iOSLock?: boolean | undefined;
335
337
  } & {
336
338
  breakpoint?: number | undefined;
337
339
  defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
338
340
  } & React.RefAttributes<HTMLDivElement>> & {
339
341
  Header: React.FC<HeaderProps>;
340
- Content: React.FC<import("./typings-88b743b5").ContentProps>;
342
+ Content: React.FC<import("./typings-d6bfd5b7").ContentProps>;
341
343
  Footer: React.FC<FooterProps>;
342
344
  Controls: React.FC<ControlsProps>;
343
345
  };
@@ -370,7 +372,7 @@ type FooterProps$0 = {
370
372
  dataTestId?: string;
371
373
  };
372
374
  declare const Footer$0: FC<FooterProps$0>;
373
- type HeaderProps$0 = Omit<NavigationBarProps, "view" | "size"> & {
375
+ type HeaderProps$0 = Omit<NavigationBarPrivateProps, "view" | "size"> & {
374
376
  headerRef: RefObject<HTMLDivElement>;
375
377
  headerOffset: number;
376
378
  };
@@ -591,11 +593,11 @@ type BaseSelectProps = {
591
593
  /**
592
594
  * Компонент стрелки
593
595
  */
594
- Arrow?: FC<ArrowProps> | null | false;
596
+ Arrow?: ComponentType<ArrowProps> | null | false;
595
597
  /**
596
598
  * Компонент поля
597
599
  */
598
- Field?: FC<FieldProps>;
600
+ Field?: ComponentType<FieldProps>;
599
601
  /**
600
602
  * Пропсы, которые будут прокинуты в компонент поля
601
603
  */
@@ -611,15 +613,15 @@ type BaseSelectProps = {
611
613
  /**
612
614
  * Компонент выпадающего меню
613
615
  */
614
- OptionsList?: FC<OptionsListProps & RefAttributes<HTMLDivElement>>;
616
+ OptionsList?: ComponentType<OptionsListProps & RefAttributes<HTMLDivElement>>;
615
617
  /**
616
618
  * Компонент группы
617
619
  */
618
- Optgroup?: FC<OptgroupProps>;
620
+ Optgroup?: ComponentType<OptgroupProps>;
619
621
  /**
620
622
  * Компонент пункта меню
621
623
  */
622
- Option?: FC<OptionProps>;
624
+ Option?: ComponentType<OptionProps>;
623
625
  /**
624
626
  * Включает отображение поиска
625
627
  */
@@ -627,7 +629,7 @@ type BaseSelectProps = {
627
629
  /**
628
630
  * Компонент поиска
629
631
  */
630
- Search?: FC<SearchProps>;
632
+ Search?: ComponentType<SearchProps>;
631
633
  /**
632
634
  * Настройки поиска
633
635
  */
@@ -789,7 +791,7 @@ type OptionsListProps = {
789
791
  /**
790
792
  * Компонент пункта меню
791
793
  */
792
- Option: FC<OptionProps>;
794
+ Option: ComponentType<OptionProps>;
793
795
  /**
794
796
  * Функция для получения пропсов для ячейки
795
797
  */
@@ -1066,8 +1068,8 @@ type SelectProps = BaseSelectProps & AdditionalMobileProps & ConditionalMobilePr
1066
1068
  };
1067
1069
  export { BottomSheet, CLOSE_OFFSET, HEADER_OFFSET, InputProps, Input, ModalResponsive as Modal, getModalTestIds, FooterProps$0 as FooterProps, Footer$0 as Footer, HeaderProps$0 as HeaderProps, Header$0 as Header, SwipeableBackdropProps, SwipeableBackdrop, horizontalDirections, ShouldSkipSwipingParams, SwipeDirection, AnyObject, OptionShape, GroupShape, BaseSelectChangePayload, BaseSelectProps, FieldProps, ArrowProps, OptionsListProps, OptgroupProps, OptionProps, CheckmarkProps, SearchProps, SelectFieldProps, AdditionalMobileProps, BottomSheetSelectMobileProps, ModalSelectMobileProps, SelectModalMobileProps, SelectMobileProps, SelectDesktopProps, SelectProps };
1068
1070
  export type { BottomSheetProps, BottomSheetTitleAlign, HeaderProps as ModalHeaderProps, FooterProps as ModalFooterProps };
1069
- export { ModalResponsiveProps as ModalProps } from "./typings-88b743b5";
1071
+ export { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
1070
1072
  export { ModalContext } from "./Context-c2e6f1b2";
1071
- export type { ContentProps as ModalContentProps } from "./typings-88b743b5";
1073
+ export type { ContentProps as ModalContentProps } from "./typings-d6bfd5b7";
1072
1074
  export * from "./Component.desktop-63dec22f";
1073
1075
  export * from "./Component.mobile-96988a65";
@@ -22,6 +22,10 @@ type ModalDesktopProps = BaseModalProps & {
22
22
  * @default false
23
23
  */
24
24
  hasCloser?: boolean;
25
+ /**
26
+ * Блокирует скролл когда модальное окно открыто. Работает только на iOS.
27
+ */
28
+ iOSLock?: boolean;
25
29
  };
26
30
  type ModalMobileProps = Omit<ModalDesktopProps, 'size' | 'fixedPosition' | 'fullscreen'>;
27
31
  type ModalResponsiveProps = ModalDesktopProps & {
@@ -19,6 +19,10 @@ type SkeletonProps = {
19
19
  * Дополнительные инлайн стили
20
20
  */
21
21
  style?: React.CSSProperties;
22
+ /**
23
+ * Включает размытие фона
24
+ */
25
+ allowBackdropBlur?: boolean;
22
26
  /**
23
27
  * Идентификатор для систем автоматизированного тестирования
24
28
  */
@@ -1,4 +1,6 @@
1
- import { FC, SVGProps } from 'react';
1
+ /// <reference types="react" />
2
+ import { ComponentType, SVGProps } from 'react';
2
3
  import { PickerButtonVariant } from "../types";
3
- declare const getIcon: (variant: PickerButtonVariant, size: string) => FC<SVGProps<SVGSVGElement>>;
4
- export { getIcon };
4
+ declare const getCompactIcon: (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => import("react").FC<SVGProps<SVGSVGElement>> | import("react").ComponentClass<SVGProps<SVGSVGElement>, any>;
5
+ declare const getIcon: (variant: PickerButtonVariant, size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => ComponentType<SVGProps<SVGSVGElement>>;
6
+ export { getCompactIcon, getIcon };
@@ -3,11 +3,17 @@ import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
3
3
  import { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';
4
4
  import { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';
5
5
 
6
- const getIcon = (variant, size) => {
6
+ const getCompactIcon = (size, Icon) => {
7
+ if (Icon) {
8
+ return Icon;
9
+ }
10
+ return size === 'size-32' ? MoreSIcon : MoreMIcon;
11
+ };
12
+ const getIcon = (variant, size, Icon) => {
7
13
  if (variant === 'compact') {
8
- return size === 'size-32' ? MoreSIcon : MoreMIcon;
14
+ return getCompactIcon(size, Icon);
9
15
  }
10
16
  return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;
11
17
  };
12
18
 
13
- export { getIcon };
19
+ export { getCompactIcon, getIcon };
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
- import { BaseSelectProps, GroupShape, OptionShape } from "./typings-57569e57";
2
+ import { BaseSelectProps, GroupShape, OptionShape } from "./typings-1fe708ea";
3
3
  declare const isGroup: (item: OptionShape | GroupShape) => item is GroupShape;
4
4
  declare const isOptionShape: (item: OptionShape | string | null) => item is OptionShape;
5
5
  declare const joinOptions: ({ selected, selectedMultiple, }: {
@@ -10,7 +10,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
10
10
 
11
11
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
12
12
 
13
- var styles = {"container":"picker-button__container_ceyn0","icon":"picker-button__icon_ceyn0","content":"picker-button__content_ceyn0"};
13
+ var styles = {"container":"picker-button__container_g1kh7","icon":"picker-button__icon_g1kh7","content":"picker-button__content_g1kh7"};
14
14
  require('./index.css')
15
15
 
16
16
  var Option = function (_a) {
package/option/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 17l9j */
1
+ /* hash: 155u9 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -15,13 +15,13 @@
15
15
  --gap-s: 12px;
16
16
  } :root {
17
17
  } :root {
18
- } .picker-button__container_ceyn0 {
18
+ } .picker-button__container_g1kh7 {
19
19
  display: flex;
20
20
  align-items: center;
21
- } .picker-button__icon_ceyn0 {
21
+ } .picker-button__icon_g1kh7 {
22
22
  display: flex;
23
23
  margin-right: var(--gap-s);
24
- } .picker-button__content_ceyn0 {
24
+ } .picker-button__content_g1kh7 {
25
25
  overflow: hidden;
26
26
  flex: 1;
27
27
  text-overflow: ellipsis;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-picker-button",
3
- "version": "11.6.8",
3
+ "version": "11.7.1",
4
4
  "description": "Picker button component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -15,8 +15,8 @@
15
15
  "react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
16
16
  },
17
17
  "dependencies": {
18
- "@alfalab/core-components-button": "^11.4.2",
19
- "@alfalab/core-components-select": "^17.4.2",
18
+ "@alfalab/core-components-button": "^11.4.3",
19
+ "@alfalab/core-components-select": "^17.4.4",
20
20
  "@alfalab/core-components-popover": "^6.2.1",
21
21
  "@alfalab/hooks": "^1.13.0",
22
22
  "@alfalab/icons-glyph": "^2.139.0",
@@ -1,4 +1,4 @@
1
- import React, { FC, forwardRef, SVGProps } from 'react';
1
+ import React, { ComponentType, forwardRef, SVGProps } from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
4
  import type { ButtonProps } from '@alfalab/core-components-button';
@@ -41,7 +41,7 @@ export type PickerButtonDesktopProps = Omit<
41
41
  /**
42
42
  * Иконка, отображающаяся слева от текстового представления пункта
43
43
  */
44
- icon?: FC<SVGProps<SVGSVGElement>>;
44
+ icon?: ComponentType<SVGProps<SVGSVGElement>>;
45
45
  }
46
46
  >;
47
47
 
@@ -61,6 +61,11 @@ export type PickerButtonDesktopProps = Omit<
61
61
  * @default true
62
62
  */
63
63
  showArrow?: boolean;
64
+
65
+ /**
66
+ * Кастомная иконка при variant = compact
67
+ */
68
+ icon?: ComponentType<SVGProps<SVGSVGElement>>;
64
69
  };
65
70
 
66
71
  export const PickerButtonDesktop = forwardRef<HTMLInputElement, PickerButtonDesktopProps>(
@@ -81,6 +86,7 @@ export const PickerButtonDesktop = forwardRef<HTMLInputElement, PickerButtonDesk
81
86
  showArrow,
82
87
  Field = DefaultField,
83
88
  fieldProps = {},
89
+ icon,
84
90
  ...restProps
85
91
  },
86
92
  ref,
@@ -98,6 +104,7 @@ export const PickerButtonDesktop = forwardRef<HTMLInputElement, PickerButtonDesk
98
104
  rightAddons,
99
105
  showArrow,
100
106
  breakpoint: 1,
107
+ icon,
101
108
  };
102
109
 
103
110
  return (
@@ -1,4 +1,4 @@
1
- import React, { ButtonHTMLAttributes, FC, Fragment, SVGProps } from 'react';
1
+ import React, { ButtonHTMLAttributes, ComponentType, Fragment, SVGProps } from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
4
  import { Button, ButtonProps } from '@alfalab/core-components-button';
@@ -14,6 +14,7 @@ type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | '
14
14
  buttonSize?: PickerButtonSize;
15
15
  buttonVariant?: PickerButtonVariant;
16
16
  showArrow?: boolean;
17
+ icon?: ComponentType<SVGProps<SVGSVGElement>>;
17
18
  };
18
19
 
19
20
  const SIZE_TO_CLASSNAME_MAP = {
@@ -49,11 +50,14 @@ export const Field = ({
49
50
  valueRenderer,
50
51
  showArrow = true,
51
52
  labelView,
53
+ FormControlComponent,
54
+ icon,
52
55
  ...restProps
53
56
  }: FieldProps) => {
54
- const Icon: FC<SVGProps<SVGSVGElement>> = getIcon(
57
+ const Icon: ComponentType<SVGProps<SVGSVGElement>> = getIcon(
55
58
  buttonVariant,
56
59
  SIZE_TO_CLASSNAME_MAP[buttonSize],
60
+ icon,
57
61
  );
58
62
 
59
63
  const { ref, ...restInnerProps } = innerProps;
@@ -41,6 +41,7 @@ export const PickerButtonMobile = forwardRef<HTMLInputElement, PickerButtonMobil
41
41
  showArrow,
42
42
  Field = DefaultField,
43
43
  fieldProps = {},
44
+ icon,
44
45
  breakpoint = 1024,
45
46
  ...restProps
46
47
  },
@@ -56,6 +57,7 @@ export const PickerButtonMobile = forwardRef<HTMLInputElement, PickerButtonMobil
56
57
  rightAddons,
57
58
  showArrow,
58
59
  breakpoint,
60
+ icon,
59
61
  };
60
62
 
61
63
  return (
@@ -1,4 +1,4 @@
1
- import { FC, SVGProps } from 'react';
1
+ import { ComponentType, SVGProps } from 'react';
2
2
 
3
3
  import { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';
4
4
  import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
@@ -7,12 +7,21 @@ import { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';
7
7
 
8
8
  import { PickerButtonVariant } from '../types';
9
9
 
10
+ export const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {
11
+ if (Icon) {
12
+ return Icon;
13
+ }
14
+
15
+ return size === 'size-32' ? MoreSIcon : MoreMIcon;
16
+ };
17
+
10
18
  export const getIcon = (
11
19
  variant: PickerButtonVariant,
12
20
  size: string,
13
- ): FC<SVGProps<SVGSVGElement>> => {
21
+ Icon?: ComponentType<SVGProps<SVGSVGElement>>,
22
+ ): ComponentType<SVGProps<SVGSVGElement>> => {
14
23
  if (variant === 'compact') {
15
- return size === 'size-32' ? MoreSIcon : MoreMIcon;
24
+ return getCompactIcon(size, Icon);
16
25
  }
17
26
 
18
27
  return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;
@@ -2,7 +2,7 @@
2
2
  import React from 'react';
3
3
  import { ReactNode } from "react";
4
4
  import { BackArrowAddonProps, CloserProps } from "./index-ebda875c";
5
- type NavigationBarProps = {
5
+ type NavigationBarPrivateProps = {
6
6
  /**
7
7
  * Контент шапки
8
8
  */
@@ -114,4 +114,4 @@ type ContentParams = {
114
114
  style?: React.CSSProperties;
115
115
  hidden?: boolean;
116
116
  };
117
- export { NavigationBarProps, ContentParams };
117
+ export { NavigationBarPrivateProps, ContentParams };
@@ -1,16 +1,17 @@
1
1
  /// <reference types="react-transition-group" />
2
2
  /// <reference types="react" />
3
3
  import React from "react";
4
- import { HTMLAttributes, ReactElement, ReactNode, RefObject, FC, AriaAttributes, FocusEvent, MouseEvent, RefAttributes, SVGProps } from "react";
4
+ import { HTMLAttributes, ReactElement, ReactNode, RefObject, FC, AriaAttributes, ComponentType, FocusEvent, MouseEvent, RefAttributes, SVGProps } from "react";
5
5
  import { HandledEvents } from "react-swipeable/es/types";
6
6
  import { TransitionProps } from "react-transition-group/Transition";
7
7
  import { BaseModalProps } from "./index-bdb4c6b9";
8
- import { NavigationBarProps } from "./types-667e33fd";
8
+ import { NavigationBarPrivateProps } from "./types-a870d1f8";
9
+ import { NavigationBarPrivateProps as NavigationBarProps } from "./types-a870d1f8";
9
10
  import { BackgroundColorType } from "./index-064acd29";
10
11
  import { BaseInputProps, BackdropProps } from "./index-ebda875c";
11
12
  import { SwipeableHandlers, SwipeDirections } from "react-swipeable";
12
13
  import { FormControlProps } from "./index-c44170fe";
13
- import { ModalResponsiveProps as ModalProps } from "./typings-88b743b5";
14
+ import { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
14
15
  import { PopoverProps } from "@alfalab/core-components-popover";
15
16
  import { UseSelectWithApplyProps } from "./field/Component";
16
17
  type BottomSheetTitleAlign = "center" | "left";
@@ -304,7 +305,7 @@ declare const Input: React.ForwardRefExoticComponent<Omit<BaseInputProps, "FormC
304
305
  breakpoint?: number | undefined;
305
306
  defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
306
307
  } & React.RefAttributes<HTMLInputElement>>;
307
- type HeaderProps = Omit<NavigationBarProps, "size" | "view" | "parentRef">;
308
+ type HeaderProps = Omit<NavigationBarPrivateProps, "size" | "view" | "parentRef">;
308
309
  type FooterProps = {
309
310
  /**
310
311
  * Контент футера
@@ -332,12 +333,13 @@ declare const ModalResponsive: React.ForwardRefExoticComponent<import("./index-b
332
333
  fullscreen?: boolean | undefined;
333
334
  fixedPosition?: boolean | undefined;
334
335
  hasCloser?: boolean | undefined;
336
+ iOSLock?: boolean | undefined;
335
337
  } & {
336
338
  breakpoint?: number | undefined;
337
339
  defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
338
340
  } & React.RefAttributes<HTMLDivElement>> & {
339
341
  Header: React.FC<HeaderProps>;
340
- Content: React.FC<import("./typings-88b743b5").ContentProps>;
342
+ Content: React.FC<import("./typings-d6bfd5b7").ContentProps>;
341
343
  Footer: React.FC<FooterProps>;
342
344
  Controls: React.FC<ControlsProps>;
343
345
  };
@@ -370,7 +372,7 @@ type FooterProps$0 = {
370
372
  dataTestId?: string;
371
373
  };
372
374
  declare const Footer$0: FC<FooterProps$0>;
373
- type HeaderProps$0 = Omit<NavigationBarProps, "view" | "size"> & {
375
+ type HeaderProps$0 = Omit<NavigationBarPrivateProps, "view" | "size"> & {
374
376
  headerRef: RefObject<HTMLDivElement>;
375
377
  headerOffset: number;
376
378
  };
@@ -591,11 +593,11 @@ type BaseSelectProps = {
591
593
  /**
592
594
  * Компонент стрелки
593
595
  */
594
- Arrow?: FC<ArrowProps> | null | false;
596
+ Arrow?: ComponentType<ArrowProps> | null | false;
595
597
  /**
596
598
  * Компонент поля
597
599
  */
598
- Field?: FC<FieldProps>;
600
+ Field?: ComponentType<FieldProps>;
599
601
  /**
600
602
  * Пропсы, которые будут прокинуты в компонент поля
601
603
  */
@@ -611,15 +613,15 @@ type BaseSelectProps = {
611
613
  /**
612
614
  * Компонент выпадающего меню
613
615
  */
614
- OptionsList?: FC<OptionsListProps & RefAttributes<HTMLDivElement>>;
616
+ OptionsList?: ComponentType<OptionsListProps & RefAttributes<HTMLDivElement>>;
615
617
  /**
616
618
  * Компонент группы
617
619
  */
618
- Optgroup?: FC<OptgroupProps>;
620
+ Optgroup?: ComponentType<OptgroupProps>;
619
621
  /**
620
622
  * Компонент пункта меню
621
623
  */
622
- Option?: FC<OptionProps>;
624
+ Option?: ComponentType<OptionProps>;
623
625
  /**
624
626
  * Включает отображение поиска
625
627
  */
@@ -627,7 +629,7 @@ type BaseSelectProps = {
627
629
  /**
628
630
  * Компонент поиска
629
631
  */
630
- Search?: FC<SearchProps>;
632
+ Search?: ComponentType<SearchProps>;
631
633
  /**
632
634
  * Настройки поиска
633
635
  */
@@ -789,7 +791,7 @@ type OptionsListProps = {
789
791
  /**
790
792
  * Компонент пункта меню
791
793
  */
792
- Option: FC<OptionProps>;
794
+ Option: ComponentType<OptionProps>;
793
795
  /**
794
796
  * Функция для получения пропсов для ячейки
795
797
  */
@@ -1066,8 +1068,8 @@ type SelectProps = BaseSelectProps & AdditionalMobileProps & ConditionalMobilePr
1066
1068
  };
1067
1069
  export { BottomSheet, CLOSE_OFFSET, HEADER_OFFSET, InputProps, Input, ModalResponsive as Modal, getModalTestIds, FooterProps$0 as FooterProps, Footer$0 as Footer, HeaderProps$0 as HeaderProps, Header$0 as Header, SwipeableBackdropProps, SwipeableBackdrop, horizontalDirections, ShouldSkipSwipingParams, SwipeDirection, AnyObject, OptionShape, GroupShape, BaseSelectChangePayload, BaseSelectProps, FieldProps, ArrowProps, OptionsListProps, OptgroupProps, OptionProps, CheckmarkProps, SearchProps, SelectFieldProps, AdditionalMobileProps, BottomSheetSelectMobileProps, ModalSelectMobileProps, SelectModalMobileProps, SelectMobileProps, SelectDesktopProps, SelectProps };
1068
1070
  export type { BottomSheetProps, BottomSheetTitleAlign, HeaderProps as ModalHeaderProps, FooterProps as ModalFooterProps };
1069
- export { ModalResponsiveProps as ModalProps } from "./typings-88b743b5";
1071
+ export { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
1070
1072
  export { ModalContext } from "./Context-c2e6f1b2";
1071
- export type { ContentProps as ModalContentProps } from "./typings-88b743b5";
1073
+ export type { ContentProps as ModalContentProps } from "./typings-d6bfd5b7";
1072
1074
  export * from "./Component.desktop-63dec22f";
1073
1075
  export * from "./Component.mobile-96988a65";
@@ -22,6 +22,10 @@ type ModalDesktopProps = BaseModalProps & {
22
22
  * @default false
23
23
  */
24
24
  hasCloser?: boolean;
25
+ /**
26
+ * Блокирует скролл когда модальное окно открыто. Работает только на iOS.
27
+ */
28
+ iOSLock?: boolean;
25
29
  };
26
30
  type ModalMobileProps = Omit<ModalDesktopProps, 'size' | 'fixedPosition' | 'fullscreen'>;
27
31
  type ModalResponsiveProps = ModalDesktopProps & {
@@ -19,6 +19,10 @@ type SkeletonProps = {
19
19
  * Дополнительные инлайн стили
20
20
  */
21
21
  style?: React.CSSProperties;
22
+ /**
23
+ * Включает размытие фона
24
+ */
25
+ allowBackdropBlur?: boolean;
22
26
  /**
23
27
  * Идентификатор для систем автоматизированного тестирования
24
28
  */
package/utils/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { FC, SVGProps } from 'react';
1
+ /// <reference types="react" />
2
+ import { ComponentType, SVGProps } from 'react';
2
3
  import { PickerButtonVariant } from "../types";
3
- declare const getIcon: (variant: PickerButtonVariant, size: string) => FC<SVGProps<SVGSVGElement>>;
4
- export { getIcon };
4
+ declare const getCompactIcon: (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => import("react").FC<SVGProps<SVGSVGElement>> | import("react").ComponentClass<SVGProps<SVGSVGElement>, any>;
5
+ declare const getIcon: (variant: PickerButtonVariant, size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => ComponentType<SVGProps<SVGSVGElement>>;
6
+ export { getCompactIcon, getIcon };
package/utils/index.js CHANGED
@@ -7,11 +7,18 @@ var ChevronDownMIcon = require('@alfalab/icons-glyph/ChevronDownMIcon');
7
7
  var MoreMIcon = require('@alfalab/icons-glyph/MoreMIcon');
8
8
  var MoreSIcon = require('@alfalab/icons-glyph/MoreSIcon');
9
9
 
10
- var getIcon = function (variant, size) {
10
+ var getCompactIcon = function (size, Icon) {
11
+ if (Icon) {
12
+ return Icon;
13
+ }
14
+ return size === 'size-32' ? MoreSIcon.MoreSIcon : MoreMIcon.MoreMIcon;
15
+ };
16
+ var getIcon = function (variant, size, Icon) {
11
17
  if (variant === 'compact') {
12
- return size === 'size-32' ? MoreSIcon.MoreSIcon : MoreMIcon.MoreMIcon;
18
+ return getCompactIcon(size, Icon);
13
19
  }
14
20
  return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon.ChevronDownCompactSIcon : ChevronDownMIcon.ChevronDownMIcon;
15
21
  };
16
22
 
23
+ exports.getCompactIcon = getCompactIcon;
17
24
  exports.getIcon = getIcon;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
- import { BaseSelectProps, GroupShape, OptionShape } from "./typings-57569e57";
2
+ import { BaseSelectProps, GroupShape, OptionShape } from "./typings-1fe708ea";
3
3
  declare const isGroup: (item: OptionShape | GroupShape) => item is GroupShape;
4
4
  declare const isOptionShape: (item: OptionShape | string | null) => item is OptionShape;
5
5
  declare const joinOptions: ({ selected, selectedMultiple, }: {