@alfalab/core-components-picker-button 13.0.7 → 13.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Component.responsive.d.ts +10 -10
- package/cssm/Component.responsive.d.ts +10 -10
- package/cssm/desktop/Component.desktop.d.ts +6 -6
- package/cssm/field/Component.d.ts +1 -1
- package/cssm/mobile/Component.mobile.d.ts +2 -2
- package/cssm/option/Component.d.ts +1 -1
- package/cssm/types.d.ts +2 -2
- package/cssm/utils/index.js.map +1 -1
- package/desktop/Component.desktop.d.ts +6 -6
- package/esm/Component.responsive.d.ts +10 -10
- package/esm/desktop/Component.desktop.d.ts +6 -6
- package/esm/field/Component.d.ts +1 -1
- package/esm/field/index.css +5 -5
- package/esm/field/index.module.css.js +1 -1
- package/esm/field/index.module.css.js.map +1 -1
- package/esm/index.css +4 -4
- package/esm/index.module.css.js +1 -1
- package/esm/index.module.css.js.map +1 -1
- package/esm/mobile/Component.mobile.d.ts +2 -2
- package/esm/option/Component.d.ts +1 -1
- package/esm/option/index.css +3 -3
- package/esm/option/index.module.css.js +1 -1
- package/esm/option/index.module.css.js.map +1 -1
- package/esm/types.d.ts +2 -2
- package/esm/utils/index.js.map +1 -1
- package/field/Component.d.ts +1 -1
- package/field/index.css +5 -5
- package/field/index.module.css.js +1 -1
- package/field/index.module.css.js.map +1 -1
- package/index.css +4 -4
- package/index.module.css.js +1 -1
- package/index.module.css.js.map +1 -1
- package/mobile/Component.mobile.d.ts +2 -2
- package/modern/Component.responsive.d.ts +10 -10
- package/modern/desktop/Component.desktop.d.ts +6 -6
- package/modern/field/Component.d.ts +1 -1
- package/modern/field/index.css +5 -5
- package/modern/field/index.module.css.js +1 -1
- package/modern/field/index.module.css.js.map +1 -1
- package/modern/index.css +4 -4
- package/modern/index.module.css.js +1 -1
- package/modern/index.module.css.js.map +1 -1
- package/modern/mobile/Component.mobile.d.ts +2 -2
- package/modern/option/Component.d.ts +1 -1
- package/modern/option/index.css +3 -3
- package/modern/option/index.module.css.js +1 -1
- package/modern/option/index.module.css.js.map +1 -1
- package/modern/types.d.ts +2 -2
- package/modern/utils/index.js.map +1 -1
- package/moderncssm/Component.responsive.d.ts +10 -10
- package/moderncssm/desktop/Component.desktop.d.ts +6 -6
- package/moderncssm/field/Component.d.ts +1 -1
- package/moderncssm/mobile/Component.mobile.d.ts +2 -2
- package/moderncssm/option/Component.d.ts +1 -1
- package/moderncssm/types.d.ts +2 -2
- package/moderncssm/utils/index.js.map +1 -1
- package/option/Component.d.ts +1 -1
- package/option/index.css +3 -3
- package/option/index.module.css.js +1 -1
- package/option/index.module.css.js.map +1 -1
- package/package.json +6 -6
- package/src/field/index.module.css +1 -1
- package/src/index.module.css +1 -1
- package/src/option/index.module.css +1 -1
- package/types.d.ts +2 -2
- package/utils/index.js.map +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from './desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonResponsiveProps = PickerButtonDesktopProps & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,21 +13,21 @@ export declare type PickerButtonResponsiveProps = PickerButtonDesktopProps & Add
|
|
|
13
13
|
client?: 'desktop' | 'mobile';
|
|
14
14
|
};
|
|
15
15
|
export declare const PickerButtonResponsive: React.ForwardRefExoticComponent<Omit<import("@alfalab/core-components-select/typings").BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<import("@alfalab/core-components-button").ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
16
|
-
options:
|
|
17
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
18
|
-
}
|
|
19
|
-
size?: import("./types").PickerButtonSize
|
|
20
|
-
variant?: import("./types").PickerButtonVariant
|
|
21
|
-
showArrow?: boolean
|
|
22
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
16
|
+
options: Array<import("@alfalab/core-components-select/typings").BaseSelectProps["options"][0] & {
|
|
17
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
18
|
+
}>;
|
|
19
|
+
size?: import("./types").PickerButtonSize;
|
|
20
|
+
variant?: import("./types").PickerButtonVariant;
|
|
21
|
+
showArrow?: boolean;
|
|
22
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
23
23
|
} & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
24
24
|
/**
|
|
25
25
|
* Контрольная точка, с нее начинается desktop версия
|
|
26
26
|
* @default 1024
|
|
27
27
|
*/
|
|
28
|
-
breakpoint?: number
|
|
28
|
+
breakpoint?: number;
|
|
29
29
|
/**
|
|
30
30
|
* Версия, которая будет использоваться при серверном рендеринге
|
|
31
31
|
*/
|
|
32
|
-
client?: "
|
|
32
|
+
client?: "desktop" | "mobile";
|
|
33
33
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/cssm/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from './desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonResponsiveProps = PickerButtonDesktopProps & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,21 +13,21 @@ export declare type PickerButtonResponsiveProps = PickerButtonDesktopProps & Add
|
|
|
13
13
|
client?: 'desktop' | 'mobile';
|
|
14
14
|
};
|
|
15
15
|
export declare const PickerButtonResponsive: React.ForwardRefExoticComponent<Omit<import("@alfalab/core-components-select/typings").BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<import("@alfalab/core-components-button").ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
16
|
-
options:
|
|
17
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
18
|
-
}
|
|
19
|
-
size?: import("./types").PickerButtonSize
|
|
20
|
-
variant?: import("./types").PickerButtonVariant
|
|
21
|
-
showArrow?: boolean
|
|
22
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
16
|
+
options: Array<import("@alfalab/core-components-select/typings").BaseSelectProps["options"][0] & {
|
|
17
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
18
|
+
}>;
|
|
19
|
+
size?: import("./types").PickerButtonSize;
|
|
20
|
+
variant?: import("./types").PickerButtonVariant;
|
|
21
|
+
showArrow?: boolean;
|
|
22
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
23
23
|
} & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
24
24
|
/**
|
|
25
25
|
* Контрольная точка, с нее начинается desktop версия
|
|
26
26
|
* @default 1024
|
|
27
27
|
*/
|
|
28
|
-
breakpoint?: number
|
|
28
|
+
breakpoint?: number;
|
|
29
29
|
/**
|
|
30
30
|
* Версия, которая будет использоваться при серверном рендеринге
|
|
31
31
|
*/
|
|
32
|
-
client?: "
|
|
32
|
+
client?: "desktop" | "mobile";
|
|
33
33
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button/cssm';
|
|
3
3
|
import { type BaseSelectProps } from '@alfalab/core-components-select/cssm/shared';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
export
|
|
5
|
+
export type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' | 'autocomplete' | 'size' | 'onFocus' | 'selected' | 'closeOnSelect' | 'multiple' | 'hint' | 'allowUnselect' | 'options' | 'searchProps' | 'showSearch' | 'Search'> & Pick<ButtonProps, 'view' | 'loading' | 'leftAddons' | 'rightAddons'> & {
|
|
6
6
|
options: Array<BaseSelectProps['options'][0] & {
|
|
7
7
|
/**
|
|
8
8
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
@@ -29,7 +29,7 @@ export declare type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholde
|
|
|
29
29
|
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
30
30
|
};
|
|
31
31
|
export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
32
|
-
options: Array<BaseSelectProps[
|
|
32
|
+
options: Array<BaseSelectProps["options"][0] & {
|
|
33
33
|
/**
|
|
34
34
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
35
35
|
*/
|
|
@@ -39,18 +39,18 @@ export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<B
|
|
|
39
39
|
* Размер кнопки
|
|
40
40
|
* @default 56
|
|
41
41
|
*/
|
|
42
|
-
size?: PickerButtonSize
|
|
42
|
+
size?: PickerButtonSize;
|
|
43
43
|
/**
|
|
44
44
|
* Тип кнопки
|
|
45
45
|
*/
|
|
46
|
-
variant?: PickerButtonVariant
|
|
46
|
+
variant?: PickerButtonVariant;
|
|
47
47
|
/**
|
|
48
48
|
* Показывать стрелку
|
|
49
49
|
* @default true
|
|
50
50
|
*/
|
|
51
|
-
showArrow?: boolean
|
|
51
|
+
showArrow?: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* Кастомная иконка при variant = compact
|
|
54
54
|
*/
|
|
55
|
-
icon?:
|
|
55
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
56
56
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button/cssm';
|
|
3
3
|
import { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/cssm/typings';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
|
|
5
|
+
type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> & ButtonProps & {
|
|
6
6
|
buttonSize?: PickerButtonSize;
|
|
7
7
|
buttonVariant?: PickerButtonVariant;
|
|
8
8
|
showArrow?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/cssm/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from '../desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,5 +13,5 @@ export declare const PickerButtonMobile: React.ForwardRefExoticComponent<Omit<Pi
|
|
|
13
13
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
14
14
|
* @default 1024
|
|
15
15
|
*/
|
|
16
|
-
breakpoint?: number
|
|
16
|
+
breakpoint?: number;
|
|
17
17
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type FC, type SVGProps } from 'react';
|
|
2
2
|
import { type OptionProps as BaseOptionProps, type OptionShape } from '@alfalab/core-components-select/cssm/shared';
|
|
3
|
-
|
|
3
|
+
type OptionProps = Omit<BaseOptionProps, 'option'> & {
|
|
4
4
|
option: OptionShape & {
|
|
5
5
|
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
6
6
|
};
|
package/cssm/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type PickerButtonSize = 32 | 40 | 48 | 56 | 64 | 72;
|
|
2
|
+
export type PickerButtonVariant = 'default' | 'compact';
|
package/cssm/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":["MoreSIcon","MoreMIcon","ChevronDownCompactSIcon","ChevronDownMIcon"],"mappings":";;;;;;;;;AASa,IAAA,cAAc,GAAG,UAAC,IAAY,EAAE,IAA6C,EAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":["MoreSIcon","MoreMIcon","ChevronDownCompactSIcon","ChevronDownMIcon"],"mappings":";;;;;;;;;AASa,IAAA,cAAc,GAAG,UAAC,IAAY,EAAE,IAA6C,EAAA;IACtF,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;;IAGf,OAAO,IAAI,KAAK,SAAS,GAAGA,mBAAS,GAAGC,mBAAS;AACrD;IAEa,OAAO,GAAG,UACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,EAAA;AAE7C,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;;AAGrC,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAGC,+CAAuB,GAAGC,iCAAgB;AAC7F;;;;;"}
|
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button';
|
|
3
3
|
import { type BaseSelectProps } from '@alfalab/core-components-select/shared';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
export
|
|
5
|
+
export type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' | 'autocomplete' | 'size' | 'onFocus' | 'selected' | 'closeOnSelect' | 'multiple' | 'hint' | 'allowUnselect' | 'options' | 'searchProps' | 'showSearch' | 'Search'> & Pick<ButtonProps, 'view' | 'loading' | 'leftAddons' | 'rightAddons'> & {
|
|
6
6
|
options: Array<BaseSelectProps['options'][0] & {
|
|
7
7
|
/**
|
|
8
8
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
@@ -29,7 +29,7 @@ export declare type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholde
|
|
|
29
29
|
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
30
30
|
};
|
|
31
31
|
export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
32
|
-
options: Array<BaseSelectProps[
|
|
32
|
+
options: Array<BaseSelectProps["options"][0] & {
|
|
33
33
|
/**
|
|
34
34
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
35
35
|
*/
|
|
@@ -39,18 +39,18 @@ export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<B
|
|
|
39
39
|
* Размер кнопки
|
|
40
40
|
* @default 56
|
|
41
41
|
*/
|
|
42
|
-
size?: PickerButtonSize
|
|
42
|
+
size?: PickerButtonSize;
|
|
43
43
|
/**
|
|
44
44
|
* Тип кнопки
|
|
45
45
|
*/
|
|
46
|
-
variant?: PickerButtonVariant
|
|
46
|
+
variant?: PickerButtonVariant;
|
|
47
47
|
/**
|
|
48
48
|
* Показывать стрелку
|
|
49
49
|
* @default true
|
|
50
50
|
*/
|
|
51
|
-
showArrow?: boolean
|
|
51
|
+
showArrow?: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* Кастомная иконка при variant = compact
|
|
54
54
|
*/
|
|
55
|
-
icon?:
|
|
55
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
56
56
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/esm/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from './desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonResponsiveProps = PickerButtonDesktopProps & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,21 +13,21 @@ export declare type PickerButtonResponsiveProps = PickerButtonDesktopProps & Add
|
|
|
13
13
|
client?: 'desktop' | 'mobile';
|
|
14
14
|
};
|
|
15
15
|
export declare const PickerButtonResponsive: React.ForwardRefExoticComponent<Omit<import("@alfalab/core-components-select/typings").BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<import("@alfalab/core-components-button").ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
16
|
-
options:
|
|
17
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
18
|
-
}
|
|
19
|
-
size?: import("./types").PickerButtonSize
|
|
20
|
-
variant?: import("./types").PickerButtonVariant
|
|
21
|
-
showArrow?: boolean
|
|
22
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
16
|
+
options: Array<import("@alfalab/core-components-select/typings").BaseSelectProps["options"][0] & {
|
|
17
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
18
|
+
}>;
|
|
19
|
+
size?: import("./types").PickerButtonSize;
|
|
20
|
+
variant?: import("./types").PickerButtonVariant;
|
|
21
|
+
showArrow?: boolean;
|
|
22
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
23
23
|
} & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
24
24
|
/**
|
|
25
25
|
* Контрольная точка, с нее начинается desktop версия
|
|
26
26
|
* @default 1024
|
|
27
27
|
*/
|
|
28
|
-
breakpoint?: number
|
|
28
|
+
breakpoint?: number;
|
|
29
29
|
/**
|
|
30
30
|
* Версия, которая будет использоваться при серверном рендеринге
|
|
31
31
|
*/
|
|
32
|
-
client?: "
|
|
32
|
+
client?: "desktop" | "mobile";
|
|
33
33
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button/esm';
|
|
3
3
|
import { type BaseSelectProps } from '@alfalab/core-components-select/esm/shared';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
export
|
|
5
|
+
export type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' | 'autocomplete' | 'size' | 'onFocus' | 'selected' | 'closeOnSelect' | 'multiple' | 'hint' | 'allowUnselect' | 'options' | 'searchProps' | 'showSearch' | 'Search'> & Pick<ButtonProps, 'view' | 'loading' | 'leftAddons' | 'rightAddons'> & {
|
|
6
6
|
options: Array<BaseSelectProps['options'][0] & {
|
|
7
7
|
/**
|
|
8
8
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
@@ -29,7 +29,7 @@ export declare type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholde
|
|
|
29
29
|
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
30
30
|
};
|
|
31
31
|
export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
32
|
-
options: Array<BaseSelectProps[
|
|
32
|
+
options: Array<BaseSelectProps["options"][0] & {
|
|
33
33
|
/**
|
|
34
34
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
35
35
|
*/
|
|
@@ -39,18 +39,18 @@ export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<B
|
|
|
39
39
|
* Размер кнопки
|
|
40
40
|
* @default 56
|
|
41
41
|
*/
|
|
42
|
-
size?: PickerButtonSize
|
|
42
|
+
size?: PickerButtonSize;
|
|
43
43
|
/**
|
|
44
44
|
* Тип кнопки
|
|
45
45
|
*/
|
|
46
|
-
variant?: PickerButtonVariant
|
|
46
|
+
variant?: PickerButtonVariant;
|
|
47
47
|
/**
|
|
48
48
|
* Показывать стрелку
|
|
49
49
|
* @default true
|
|
50
50
|
*/
|
|
51
|
-
showArrow?: boolean
|
|
51
|
+
showArrow?: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* Кастомная иконка при variant = compact
|
|
54
54
|
*/
|
|
55
|
-
icon?:
|
|
55
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
56
56
|
} & React.RefAttributes<HTMLInputElement>>;
|
package/esm/field/Component.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button/esm';
|
|
3
3
|
import { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/esm/typings';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
|
|
5
|
+
type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> & ButtonProps & {
|
|
6
6
|
buttonSize?: PickerButtonSize;
|
|
7
7
|
buttonVariant?: PickerButtonVariant;
|
|
8
8
|
showArrow?: boolean;
|
package/esm/field/index.css
CHANGED
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
:root {
|
|
9
9
|
--arrow-transform: rotate(180deg);
|
|
10
10
|
}
|
|
11
|
-
.picker-
|
|
11
|
+
.picker-button__iconContainer_1sn73 {
|
|
12
12
|
display: flex;
|
|
13
13
|
transition: transform 0.15s ease-in-out;
|
|
14
14
|
}
|
|
15
|
-
.picker-
|
|
15
|
+
.picker-button__addonsContainer_1sn73 {
|
|
16
16
|
display: flex;
|
|
17
17
|
}
|
|
18
|
-
.picker-
|
|
18
|
+
.picker-button__addonsContainer_1sn73.picker-button__showControlIcon_1sn73 {
|
|
19
19
|
margin-right: var(--gap-4);
|
|
20
20
|
}
|
|
21
|
-
.picker-
|
|
21
|
+
.picker-button__open_1sn73 {
|
|
22
22
|
transform: var(--arrow-transform);
|
|
23
23
|
}
|
|
24
|
-
.picker-
|
|
24
|
+
.picker-button__linkOpen_1sn73:not(:hover) {
|
|
25
25
|
background-color: var(--color-light-transparent-default-hover);
|
|
26
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"iconContainer":"picker-
|
|
3
|
+
var styles = {"iconContainer":"picker-button__iconContainer_1sn73","addonsContainer":"picker-button__addonsContainer_1sn73","showControlIcon":"picker-button__showControlIcon_1sn73","open":"picker-button__open_1sn73","linkOpen":"picker-button__linkOpen_1sn73"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/field/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/field/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.iconContainer {\n display: flex;\n transition: transform 0.15s ease-in-out;\n}\n\n.addonsContainer {\n display: flex;\n\n &.showControlIcon {\n margin-right: var(--gap-4);\n }\n}\n\n.open {\n transform: var(--arrow-transform);\n}\n\n.linkOpen:not(:hover) {\n background-color: var(--color-light-transparent-default-hover);\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,eAAe,CAAC,oCAAoC,CAAC,iBAAiB,CAAC,sCAAsC,CAAC,iBAAiB,CAAC,sCAAsC,CAAC,MAAM,CAAC,2BAA2B,CAAC,UAAU,CAAC,+BAA+B,CAAC;;;;"}
|
package/esm/index.css
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
--gap-8: var(--gap-xs);
|
|
6
6
|
--gap-16: var(--gap-m);
|
|
7
7
|
}
|
|
8
|
-
.picker-
|
|
8
|
+
.picker-button__container_12oeh {
|
|
9
9
|
min-width: auto;
|
|
10
10
|
}
|
|
11
|
-
.picker-
|
|
11
|
+
.picker-button__optionsPopover_12oeh.picker-button__sideGap_12oeh.cc-picker-button {
|
|
12
12
|
padding: var(--gap-0) var(--gap-8);
|
|
13
13
|
}
|
|
14
|
-
.cc-picker-button .picker-
|
|
14
|
+
.cc-picker-button .picker-button__option_12oeh {
|
|
15
15
|
padding: var(--gap-0) var(--gap-16);
|
|
16
16
|
}
|
|
17
|
-
.cc-picker-button .picker-
|
|
17
|
+
.cc-picker-button .picker-button__option_12oeh:before {
|
|
18
18
|
display: none;
|
|
19
19
|
}
|
package/esm/index.module.css.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"container":"picker-
|
|
3
|
+
var styles = {"container":"picker-button__container_12oeh","optionsPopover":"picker-button__optionsPopover_12oeh","sideGap":"picker-button__sideGap_12oeh","option":"picker-button__option_12oeh"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n min-width: auto;\n}\n\n:global(.cc-picker-button) {\n &.optionsPopover {\n &.sideGap {\n padding: var(--gap-0) var(--gap-8);\n }\n }\n\n & .option {\n padding: var(--gap-0) var(--gap-16);\n\n &:before {\n /* Удаляем разделители у опций выпадающего списка. */\n display: none;\n }\n }\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,WAAW,CAAC,gCAAgC,CAAC,gBAAgB,CAAC,qCAAqC,CAAC,SAAS,CAAC,8BAA8B,CAAC,QAAQ,CAAC,6BAA6B,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/esm/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from '../desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,5 +13,5 @@ export declare const PickerButtonMobile: React.ForwardRefExoticComponent<Omit<Pi
|
|
|
13
13
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
14
14
|
* @default 1024
|
|
15
15
|
*/
|
|
16
|
-
breakpoint?: number
|
|
16
|
+
breakpoint?: number;
|
|
17
17
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type FC, type SVGProps } from 'react';
|
|
2
2
|
import { type OptionProps as BaseOptionProps, type OptionShape } from '@alfalab/core-components-select/esm/shared';
|
|
3
|
-
|
|
3
|
+
type OptionProps = Omit<BaseOptionProps, 'option'> & {
|
|
4
4
|
option: OptionShape & {
|
|
5
5
|
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
6
6
|
};
|
package/esm/option/index.css
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
--gap-s: 12px;
|
|
3
3
|
--gap-12: var(--gap-s);
|
|
4
4
|
}
|
|
5
|
-
.picker-
|
|
5
|
+
.picker-button__container_1afry {
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
}
|
|
9
|
-
.picker-
|
|
9
|
+
.picker-button__icon_1afry {
|
|
10
10
|
display: flex;
|
|
11
11
|
margin-right: var(--gap-12);
|
|
12
12
|
}
|
|
13
|
-
.picker-
|
|
13
|
+
.picker-button__content_1afry {
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
flex: 1;
|
|
16
16
|
text-overflow: ellipsis;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"container":"picker-
|
|
3
|
+
var styles = {"container":"picker-button__container_1afry","icon":"picker-button__icon_1afry","content":"picker-button__content_1afry"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/option/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/option/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n display: flex;\n align-items: center;\n}\n\n.icon {\n display: flex;\n margin-right: var(--gap-12);\n}\n\n.content {\n overflow: hidden;\n flex: 1;\n text-overflow: ellipsis;\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,WAAW,CAAC,gCAAgC,CAAC,MAAM,CAAC,2BAA2B,CAAC,SAAS,CAAC,8BAA8B,CAAC;;;;"}
|
package/esm/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type PickerButtonSize = 32 | 40 | 48 | 56 | 64 | 72;
|
|
2
|
+
export type PickerButtonVariant = 'default' | 'compact';
|
package/esm/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":[],"mappings":";;;;;AASa,IAAA,cAAc,GAAG,UAAC,IAAY,EAAE,IAA6C,EAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":[],"mappings":";;;;;AASa,IAAA,cAAc,GAAG,UAAC,IAAY,EAAE,IAA6C,EAAA;IACtF,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;;IAGf,OAAO,IAAI,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS;AACrD;IAEa,OAAO,GAAG,UACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,EAAA;AAE7C,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;;AAGrC,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,uBAAuB,GAAG,gBAAgB;AAC7F;;;;"}
|
package/field/Component.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button';
|
|
3
3
|
import { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/typings';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
|
|
5
|
+
type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> & ButtonProps & {
|
|
6
6
|
buttonSize?: PickerButtonSize;
|
|
7
7
|
buttonVariant?: PickerButtonVariant;
|
|
8
8
|
showArrow?: boolean;
|
package/field/index.css
CHANGED
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
:root {
|
|
9
9
|
--arrow-transform: rotate(180deg);
|
|
10
10
|
}
|
|
11
|
-
.picker-
|
|
11
|
+
.picker-button__iconContainer_1sn73 {
|
|
12
12
|
display: flex;
|
|
13
13
|
transition: transform 0.15s ease-in-out;
|
|
14
14
|
}
|
|
15
|
-
.picker-
|
|
15
|
+
.picker-button__addonsContainer_1sn73 {
|
|
16
16
|
display: flex;
|
|
17
17
|
}
|
|
18
|
-
.picker-
|
|
18
|
+
.picker-button__addonsContainer_1sn73.picker-button__showControlIcon_1sn73 {
|
|
19
19
|
margin-right: var(--gap-4);
|
|
20
20
|
}
|
|
21
|
-
.picker-
|
|
21
|
+
.picker-button__open_1sn73 {
|
|
22
22
|
transform: var(--arrow-transform);
|
|
23
23
|
}
|
|
24
|
-
.picker-
|
|
24
|
+
.picker-button__linkOpen_1sn73:not(:hover) {
|
|
25
25
|
background-color: var(--color-light-transparent-default-hover);
|
|
26
26
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"iconContainer":"picker-
|
|
5
|
+
var styles = {"iconContainer":"picker-button__iconContainer_1sn73","addonsContainer":"picker-button__addonsContainer_1sn73","showControlIcon":"picker-button__showControlIcon_1sn73","open":"picker-button__open_1sn73","linkOpen":"picker-button__linkOpen_1sn73"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/field/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/field/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.iconContainer {\n display: flex;\n transition: transform 0.15s ease-in-out;\n}\n\n.addonsContainer {\n display: flex;\n\n &.showControlIcon {\n margin-right: var(--gap-4);\n }\n}\n\n.open {\n transform: var(--arrow-transform);\n}\n\n.linkOpen:not(:hover) {\n background-color: var(--color-light-transparent-default-hover);\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,eAAe,CAAC,oCAAoC,CAAC,iBAAiB,CAAC,sCAAsC,CAAC,iBAAiB,CAAC,sCAAsC,CAAC,MAAM,CAAC,2BAA2B,CAAC,UAAU,CAAC,+BAA+B,CAAC;;;;"}
|
package/index.css
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
--gap-8: var(--gap-xs);
|
|
6
6
|
--gap-16: var(--gap-m);
|
|
7
7
|
}
|
|
8
|
-
.picker-
|
|
8
|
+
.picker-button__container_12oeh {
|
|
9
9
|
min-width: auto;
|
|
10
10
|
}
|
|
11
|
-
.picker-
|
|
11
|
+
.picker-button__optionsPopover_12oeh.picker-button__sideGap_12oeh.cc-picker-button {
|
|
12
12
|
padding: var(--gap-0) var(--gap-8);
|
|
13
13
|
}
|
|
14
|
-
.cc-picker-button .picker-
|
|
14
|
+
.cc-picker-button .picker-button__option_12oeh {
|
|
15
15
|
padding: var(--gap-0) var(--gap-16);
|
|
16
16
|
}
|
|
17
|
-
.cc-picker-button .picker-
|
|
17
|
+
.cc-picker-button .picker-button__option_12oeh:before {
|
|
18
18
|
display: none;
|
|
19
19
|
}
|
package/index.module.css.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"container":"picker-
|
|
5
|
+
var styles = {"container":"picker-button__container_12oeh","optionsPopover":"picker-button__optionsPopover_12oeh","sideGap":"picker-button__sideGap_12oeh","option":"picker-button__option_12oeh"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
package/index.module.css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n min-width: auto;\n}\n\n:global(.cc-picker-button) {\n &.optionsPopover {\n &.sideGap {\n padding: var(--gap-0) var(--gap-8);\n }\n }\n\n & .option {\n padding: var(--gap-0) var(--gap-16);\n\n &:before {\n /* Удаляем разделители у опций выпадающего списка. */\n display: none;\n }\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,gCAAgC,CAAC,gBAAgB,CAAC,qCAAqC,CAAC,SAAS,CAAC,8BAA8B,CAAC,QAAQ,CAAC,6BAA6B,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from '../desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,5 +13,5 @@ export declare const PickerButtonMobile: React.ForwardRefExoticComponent<Omit<Pi
|
|
|
13
13
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
14
14
|
* @default 1024
|
|
15
15
|
*/
|
|
16
|
-
breakpoint?: number
|
|
16
|
+
breakpoint?: number;
|
|
17
17
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/modern/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from './desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonResponsiveProps = PickerButtonDesktopProps & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,21 +13,21 @@ export declare type PickerButtonResponsiveProps = PickerButtonDesktopProps & Add
|
|
|
13
13
|
client?: 'desktop' | 'mobile';
|
|
14
14
|
};
|
|
15
15
|
export declare const PickerButtonResponsive: React.ForwardRefExoticComponent<Omit<import("@alfalab/core-components-select/typings").BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<import("@alfalab/core-components-button").ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
16
|
-
options:
|
|
17
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
18
|
-
}
|
|
19
|
-
size?: import("./types").PickerButtonSize
|
|
20
|
-
variant?: import("./types").PickerButtonVariant
|
|
21
|
-
showArrow?: boolean
|
|
22
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
16
|
+
options: Array<import("@alfalab/core-components-select/typings").BaseSelectProps["options"][0] & {
|
|
17
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
18
|
+
}>;
|
|
19
|
+
size?: import("./types").PickerButtonSize;
|
|
20
|
+
variant?: import("./types").PickerButtonVariant;
|
|
21
|
+
showArrow?: boolean;
|
|
22
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
23
23
|
} & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
24
24
|
/**
|
|
25
25
|
* Контрольная точка, с нее начинается desktop версия
|
|
26
26
|
* @default 1024
|
|
27
27
|
*/
|
|
28
|
-
breakpoint?: number
|
|
28
|
+
breakpoint?: number;
|
|
29
29
|
/**
|
|
30
30
|
* Версия, которая будет использоваться при серверном рендеринге
|
|
31
31
|
*/
|
|
32
|
-
client?: "
|
|
32
|
+
client?: "desktop" | "mobile";
|
|
33
33
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button/modern';
|
|
3
3
|
import { type BaseSelectProps } from '@alfalab/core-components-select/modern/shared';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
export
|
|
5
|
+
export type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' | 'autocomplete' | 'size' | 'onFocus' | 'selected' | 'closeOnSelect' | 'multiple' | 'hint' | 'allowUnselect' | 'options' | 'searchProps' | 'showSearch' | 'Search'> & Pick<ButtonProps, 'view' | 'loading' | 'leftAddons' | 'rightAddons'> & {
|
|
6
6
|
options: Array<BaseSelectProps['options'][0] & {
|
|
7
7
|
/**
|
|
8
8
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
@@ -29,7 +29,7 @@ export declare type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholde
|
|
|
29
29
|
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
30
30
|
};
|
|
31
31
|
export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
32
|
-
options: Array<BaseSelectProps[
|
|
32
|
+
options: Array<BaseSelectProps["options"][0] & {
|
|
33
33
|
/**
|
|
34
34
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
35
35
|
*/
|
|
@@ -39,18 +39,18 @@ export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<B
|
|
|
39
39
|
* Размер кнопки
|
|
40
40
|
* @default 56
|
|
41
41
|
*/
|
|
42
|
-
size?: PickerButtonSize
|
|
42
|
+
size?: PickerButtonSize;
|
|
43
43
|
/**
|
|
44
44
|
* Тип кнопки
|
|
45
45
|
*/
|
|
46
|
-
variant?: PickerButtonVariant
|
|
46
|
+
variant?: PickerButtonVariant;
|
|
47
47
|
/**
|
|
48
48
|
* Показывать стрелку
|
|
49
49
|
* @default true
|
|
50
50
|
*/
|
|
51
|
-
showArrow?: boolean
|
|
51
|
+
showArrow?: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* Кастомная иконка при variant = compact
|
|
54
54
|
*/
|
|
55
|
-
icon?:
|
|
55
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
56
56
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button/modern';
|
|
3
3
|
import { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/modern/typings';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
|
|
5
|
+
type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> & ButtonProps & {
|
|
6
6
|
buttonSize?: PickerButtonSize;
|
|
7
7
|
buttonVariant?: PickerButtonVariant;
|
|
8
8
|
showArrow?: boolean;
|
package/modern/field/index.css
CHANGED
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
:root {
|
|
9
9
|
--arrow-transform: rotate(180deg);
|
|
10
10
|
}
|
|
11
|
-
.picker-
|
|
11
|
+
.picker-button__iconContainer_1sn73 {
|
|
12
12
|
display: flex;
|
|
13
13
|
transition: transform 0.15s ease-in-out;
|
|
14
14
|
}
|
|
15
|
-
.picker-
|
|
15
|
+
.picker-button__addonsContainer_1sn73 {
|
|
16
16
|
display: flex;
|
|
17
17
|
}
|
|
18
|
-
.picker-
|
|
18
|
+
.picker-button__addonsContainer_1sn73.picker-button__showControlIcon_1sn73 {
|
|
19
19
|
margin-right: var(--gap-4);
|
|
20
20
|
}
|
|
21
|
-
.picker-
|
|
21
|
+
.picker-button__open_1sn73 {
|
|
22
22
|
transform: var(--arrow-transform);
|
|
23
23
|
}
|
|
24
|
-
.picker-
|
|
24
|
+
.picker-button__linkOpen_1sn73:not(:hover) {
|
|
25
25
|
background-color: var(--color-light-transparent-default-hover);
|
|
26
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"iconContainer":"picker-
|
|
3
|
+
const styles = {"iconContainer":"picker-button__iconContainer_1sn73","addonsContainer":"picker-button__addonsContainer_1sn73","showControlIcon":"picker-button__showControlIcon_1sn73","open":"picker-button__open_1sn73","linkOpen":"picker-button__linkOpen_1sn73"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/field/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/field/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.iconContainer {\n display: flex;\n transition: transform 0.15s ease-in-out;\n}\n\n.addonsContainer {\n display: flex;\n\n &.showControlIcon {\n margin-right: var(--gap-4);\n }\n}\n\n.open {\n transform: var(--arrow-transform);\n}\n\n.linkOpen:not(:hover) {\n background-color: var(--color-light-transparent-default-hover);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,eAAe,CAAC,oCAAoC,CAAC,iBAAiB,CAAC,sCAAsC,CAAC,iBAAiB,CAAC,sCAAsC,CAAC,MAAM,CAAC,2BAA2B,CAAC,UAAU,CAAC,+BAA+B,CAAC;;;;"}
|
package/modern/index.css
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
--gap-8: var(--gap-xs);
|
|
6
6
|
--gap-16: var(--gap-m);
|
|
7
7
|
}
|
|
8
|
-
.picker-
|
|
8
|
+
.picker-button__container_12oeh {
|
|
9
9
|
min-width: auto;
|
|
10
10
|
}
|
|
11
|
-
.picker-
|
|
11
|
+
.picker-button__optionsPopover_12oeh.picker-button__sideGap_12oeh.cc-picker-button {
|
|
12
12
|
padding: var(--gap-0) var(--gap-8);
|
|
13
13
|
}
|
|
14
|
-
.cc-picker-button .picker-
|
|
14
|
+
.cc-picker-button .picker-button__option_12oeh {
|
|
15
15
|
padding: var(--gap-0) var(--gap-16);
|
|
16
16
|
}
|
|
17
|
-
.cc-picker-button .picker-
|
|
17
|
+
.cc-picker-button .picker-button__option_12oeh:before {
|
|
18
18
|
display: none;
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"container":"picker-
|
|
3
|
+
const styles = {"container":"picker-button__container_12oeh","optionsPopover":"picker-button__optionsPopover_12oeh","sideGap":"picker-button__sideGap_12oeh","option":"picker-button__option_12oeh"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n min-width: auto;\n}\n\n:global(.cc-picker-button) {\n &.optionsPopover {\n &.sideGap {\n padding: var(--gap-0) var(--gap-8);\n }\n }\n\n & .option {\n padding: var(--gap-0) var(--gap-16);\n\n &:before {\n /* Удаляем разделители у опций выпадающего списка. */\n display: none;\n }\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,gCAAgC,CAAC,gBAAgB,CAAC,qCAAqC,CAAC,SAAS,CAAC,8BAA8B,CAAC,QAAQ,CAAC,6BAA6B,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/modern/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from '../desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,5 +13,5 @@ export declare const PickerButtonMobile: React.ForwardRefExoticComponent<Omit<Pi
|
|
|
13
13
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
14
14
|
* @default 1024
|
|
15
15
|
*/
|
|
16
|
-
breakpoint?: number
|
|
16
|
+
breakpoint?: number;
|
|
17
17
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type FC, type SVGProps } from 'react';
|
|
2
2
|
import { type OptionProps as BaseOptionProps, type OptionShape } from '@alfalab/core-components-select/modern/shared';
|
|
3
|
-
|
|
3
|
+
type OptionProps = Omit<BaseOptionProps, 'option'> & {
|
|
4
4
|
option: OptionShape & {
|
|
5
5
|
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
6
6
|
};
|
package/modern/option/index.css
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
--gap-s: 12px;
|
|
3
3
|
--gap-12: var(--gap-s);
|
|
4
4
|
}
|
|
5
|
-
.picker-
|
|
5
|
+
.picker-button__container_1afry {
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
}
|
|
9
|
-
.picker-
|
|
9
|
+
.picker-button__icon_1afry {
|
|
10
10
|
display: flex;
|
|
11
11
|
margin-right: var(--gap-12);
|
|
12
12
|
}
|
|
13
|
-
.picker-
|
|
13
|
+
.picker-button__content_1afry {
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
flex: 1;
|
|
16
16
|
text-overflow: ellipsis;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"container":"picker-
|
|
3
|
+
const styles = {"container":"picker-button__container_1afry","icon":"picker-button__icon_1afry","content":"picker-button__content_1afry"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/option/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/option/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n display: flex;\n align-items: center;\n}\n\n.icon {\n display: flex;\n margin-right: var(--gap-12);\n}\n\n.content {\n overflow: hidden;\n flex: 1;\n text-overflow: ellipsis;\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,gCAAgC,CAAC,MAAM,CAAC,2BAA2B,CAAC,SAAS,CAAC,8BAA8B,CAAC;;;;"}
|
package/modern/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type PickerButtonSize = 32 | 40 | 48 | 56 | 64 | 72;
|
|
2
|
+
export type PickerButtonVariant = 'default' | 'compact';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":[],"mappings":";;;;;MASa,cAAc,GAAG,CAAC,IAAY,EAAE,IAA6C,KAAI;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":[],"mappings":";;;;;MASa,cAAc,GAAG,CAAC,IAAY,EAAE,IAA6C,KAAI;IAC1F,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;;IAGf,OAAO,IAAI,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS;AACrD;AAEa,MAAA,OAAO,GAAG,CACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,KACL;AACxC,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;;AAGrC,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,uBAAuB,GAAG,gBAAgB;AAC7F;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/moderncssm/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from './desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonResponsiveProps = PickerButtonDesktopProps & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,21 +13,21 @@ export declare type PickerButtonResponsiveProps = PickerButtonDesktopProps & Add
|
|
|
13
13
|
client?: 'desktop' | 'mobile';
|
|
14
14
|
};
|
|
15
15
|
export declare const PickerButtonResponsive: React.ForwardRefExoticComponent<Omit<import("@alfalab/core-components-select/typings").BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<import("@alfalab/core-components-button").ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
16
|
-
options:
|
|
17
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
18
|
-
}
|
|
19
|
-
size?: import("./types").PickerButtonSize
|
|
20
|
-
variant?: import("./types").PickerButtonVariant
|
|
21
|
-
showArrow?: boolean
|
|
22
|
-
icon?: React.ComponentType<React.SVGProps<SVGSVGElement
|
|
16
|
+
options: Array<import("@alfalab/core-components-select/typings").BaseSelectProps["options"][0] & {
|
|
17
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
18
|
+
}>;
|
|
19
|
+
size?: import("./types").PickerButtonSize;
|
|
20
|
+
variant?: import("./types").PickerButtonVariant;
|
|
21
|
+
showArrow?: boolean;
|
|
22
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
23
23
|
} & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
24
24
|
/**
|
|
25
25
|
* Контрольная точка, с нее начинается desktop версия
|
|
26
26
|
* @default 1024
|
|
27
27
|
*/
|
|
28
|
-
breakpoint?: number
|
|
28
|
+
breakpoint?: number;
|
|
29
29
|
/**
|
|
30
30
|
* Версия, которая будет использоваться при серверном рендеринге
|
|
31
31
|
*/
|
|
32
|
-
client?: "
|
|
32
|
+
client?: "desktop" | "mobile";
|
|
33
33
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button/moderncssm';
|
|
3
3
|
import { type BaseSelectProps } from '@alfalab/core-components-select/moderncssm/shared';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
export
|
|
5
|
+
export type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' | 'autocomplete' | 'size' | 'onFocus' | 'selected' | 'closeOnSelect' | 'multiple' | 'hint' | 'allowUnselect' | 'options' | 'searchProps' | 'showSearch' | 'Search'> & Pick<ButtonProps, 'view' | 'loading' | 'leftAddons' | 'rightAddons'> & {
|
|
6
6
|
options: Array<BaseSelectProps['options'][0] & {
|
|
7
7
|
/**
|
|
8
8
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
@@ -29,7 +29,7 @@ export declare type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholde
|
|
|
29
29
|
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
30
30
|
};
|
|
31
31
|
export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "hint" | "placeholder" | "selected" | "multiple" | "Arrow" | "onFocus" | "autocomplete" | "closeOnSelect" | "allowUnselect" | "options" | "searchProps" | "showSearch" | "Search"> & Pick<ButtonProps, "view" | "rightAddons" | "leftAddons" | "loading"> & {
|
|
32
|
-
options: Array<BaseSelectProps[
|
|
32
|
+
options: Array<BaseSelectProps["options"][0] & {
|
|
33
33
|
/**
|
|
34
34
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
35
35
|
*/
|
|
@@ -39,18 +39,18 @@ export declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<B
|
|
|
39
39
|
* Размер кнопки
|
|
40
40
|
* @default 56
|
|
41
41
|
*/
|
|
42
|
-
size?: PickerButtonSize
|
|
42
|
+
size?: PickerButtonSize;
|
|
43
43
|
/**
|
|
44
44
|
* Тип кнопки
|
|
45
45
|
*/
|
|
46
|
-
variant?: PickerButtonVariant
|
|
46
|
+
variant?: PickerButtonVariant;
|
|
47
47
|
/**
|
|
48
48
|
* Показывать стрелку
|
|
49
49
|
* @default true
|
|
50
50
|
*/
|
|
51
|
-
showArrow?: boolean
|
|
51
|
+
showArrow?: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* Кастомная иконка при variant = compact
|
|
54
54
|
*/
|
|
55
|
-
icon?:
|
|
55
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
56
56
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
2
2
|
import { type ButtonProps } from '@alfalab/core-components-button/moderncssm';
|
|
3
3
|
import { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/moderncssm/typings';
|
|
4
4
|
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
|
-
|
|
5
|
+
type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> & ButtonProps & {
|
|
6
6
|
buttonSize?: PickerButtonSize;
|
|
7
7
|
buttonVariant?: PickerButtonVariant;
|
|
8
8
|
showArrow?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/moderncssm/shared';
|
|
3
3
|
import { type PickerButtonDesktopProps } from '../desktop';
|
|
4
|
-
export
|
|
4
|
+
export type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
7
7
|
* @default 1024
|
|
@@ -13,5 +13,5 @@ export declare const PickerButtonMobile: React.ForwardRefExoticComponent<Omit<Pi
|
|
|
13
13
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
14
14
|
* @default 1024
|
|
15
15
|
*/
|
|
16
|
-
breakpoint?: number
|
|
16
|
+
breakpoint?: number;
|
|
17
17
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type FC, type SVGProps } from 'react';
|
|
2
2
|
import { type OptionProps as BaseOptionProps, type OptionShape } from '@alfalab/core-components-select/moderncssm/shared';
|
|
3
|
-
|
|
3
|
+
type OptionProps = Omit<BaseOptionProps, 'option'> & {
|
|
4
4
|
option: OptionShape & {
|
|
5
5
|
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
6
6
|
};
|
package/moderncssm/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type PickerButtonSize = 32 | 40 | 48 | 56 | 64 | 72;
|
|
2
|
+
export type PickerButtonVariant = 'default' | 'compact';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":[],"mappings":";;;;;MASa,cAAc,GAAG,CAAC,IAAY,EAAE,IAA6C,KAAI;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":[],"mappings":";;;;;MASa,cAAc,GAAG,CAAC,IAAY,EAAE,IAA6C,KAAI;IAC1F,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;;IAGf,OAAO,IAAI,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS;AACrD;AAEa,MAAA,OAAO,GAAG,CACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,KACL;AACxC,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;;AAGrC,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,uBAAuB,GAAG,gBAAgB;AAC7F;;;;"}
|
package/option/Component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type FC, type SVGProps } from 'react';
|
|
2
2
|
import { type OptionProps as BaseOptionProps, type OptionShape } from '@alfalab/core-components-select/shared';
|
|
3
|
-
|
|
3
|
+
type OptionProps = Omit<BaseOptionProps, 'option'> & {
|
|
4
4
|
option: OptionShape & {
|
|
5
5
|
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
6
6
|
};
|
package/option/index.css
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
--gap-s: 12px;
|
|
3
3
|
--gap-12: var(--gap-s);
|
|
4
4
|
}
|
|
5
|
-
.picker-
|
|
5
|
+
.picker-button__container_1afry {
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
}
|
|
9
|
-
.picker-
|
|
9
|
+
.picker-button__icon_1afry {
|
|
10
10
|
display: flex;
|
|
11
11
|
margin-right: var(--gap-12);
|
|
12
12
|
}
|
|
13
|
-
.picker-
|
|
13
|
+
.picker-button__content_1afry {
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
flex: 1;
|
|
16
16
|
text-overflow: ellipsis;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"container":"picker-
|
|
5
|
+
var styles = {"container":"picker-button__container_1afry","icon":"picker-button__icon_1afry","content":"picker-button__content_1afry"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/option/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/option/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.container {\n display: flex;\n align-items: center;\n}\n\n.icon {\n display: flex;\n margin-right: var(--gap-12);\n}\n\n.content {\n overflow: hidden;\n flex: 1;\n text-overflow: ellipsis;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,gCAAgC,CAAC,MAAM,CAAC,2BAA2B,CAAC,SAAS,CAAC,8BAA8B,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-picker-button",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.8",
|
|
4
4
|
"description": "Picker button component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"main": "index.js",
|
|
11
11
|
"module": "./esm/index.js",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@alfalab/core-components-button": "^13.1.
|
|
14
|
-
"@alfalab/core-components-mq": "^6.0.
|
|
15
|
-
"@alfalab/core-components-popover": "^8.0.
|
|
16
|
-
"@alfalab/core-components-select": "^19.1.
|
|
13
|
+
"@alfalab/core-components-button": "^13.1.1",
|
|
14
|
+
"@alfalab/core-components-mq": "^6.0.3",
|
|
15
|
+
"@alfalab/core-components-popover": "^8.0.3",
|
|
16
|
+
"@alfalab/core-components-select": "^19.1.1",
|
|
17
17
|
"@alfalab/icons-glyph": "^2.260.0",
|
|
18
18
|
"classnames": "^2.5.1",
|
|
19
19
|
"tslib": "^2.4.0"
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"directory": "dist"
|
|
28
28
|
},
|
|
29
29
|
"themesVersion": "15.0.2",
|
|
30
|
-
"varsVersion": "11.0.
|
|
30
|
+
"varsVersion": "11.0.2"
|
|
31
31
|
}
|
package/src/index.module.css
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type PickerButtonSize = 32 | 40 | 48 | 56 | 64 | 72;
|
|
2
|
+
export type PickerButtonVariant = 'default' | 'compact';
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":["MoreSIcon","MoreMIcon","ChevronDownCompactSIcon","ChevronDownMIcon"],"mappings":";;;;;;;;;AASa,IAAA,cAAc,GAAG,UAAC,IAAY,EAAE,IAA6C,EAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/index.ts"],"sourcesContent":["import { type ComponentType, type SVGProps } from 'react';\n\nimport { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';\nimport { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';\nimport { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';\nimport { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';\n\nimport { type PickerButtonVariant } from '../types';\n\nexport const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {\n if (Icon) {\n return Icon;\n }\n\n return size === 'size-32' ? MoreSIcon : MoreMIcon;\n};\n\nexport const getIcon = (\n variant: PickerButtonVariant,\n size: string,\n Icon?: ComponentType<SVGProps<SVGSVGElement>>,\n): ComponentType<SVGProps<SVGSVGElement>> => {\n if (variant === 'compact') {\n return getCompactIcon(size, Icon);\n }\n\n return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;\n};\n"],"names":["MoreSIcon","MoreMIcon","ChevronDownCompactSIcon","ChevronDownMIcon"],"mappings":";;;;;;;;;AASa,IAAA,cAAc,GAAG,UAAC,IAAY,EAAE,IAA6C,EAAA;IACtF,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;;IAGf,OAAO,IAAI,KAAK,SAAS,GAAGA,mBAAS,GAAGC,mBAAS;AACrD;IAEa,OAAO,GAAG,UACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,EAAA;AAE7C,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;;AAGrC,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAGC,+CAAuB,GAAGC,iCAAgB;AAC7F;;;;;"}
|