@alfalab/core-components-picker-button 12.0.1 → 12.0.2
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 +2 -2
- package/Component.responsive.js.map +1 -1
- package/cssm/Component.responsive.d.ts +2 -2
- package/cssm/Component.responsive.js.map +1 -1
- package/cssm/desktop/Component.desktop.d.ts +4 -4
- package/cssm/desktop/Component.desktop.js.map +1 -1
- package/cssm/field/Component.d.ts +4 -4
- package/cssm/field/Component.js.map +1 -1
- package/cssm/field/index.module.css +1 -1
- package/cssm/index.module.css +2 -2
- package/cssm/mobile/Component.mobile.d.ts +2 -2
- package/cssm/mobile/Component.mobile.js.map +1 -1
- package/cssm/option/Component.d.ts +2 -2
- package/cssm/option/Component.js.map +1 -1
- package/cssm/utils/index.d.ts +2 -2
- package/cssm/utils/index.js.map +1 -1
- package/desktop/Component.desktop.d.ts +4 -4
- package/desktop/Component.desktop.js.map +1 -1
- package/esm/Component.responsive.d.ts +2 -2
- package/esm/Component.responsive.js.map +1 -1
- package/esm/desktop/Component.desktop.d.ts +4 -4
- package/esm/desktop/Component.desktop.js.map +1 -1
- package/esm/field/Component.d.ts +4 -4
- package/esm/field/Component.js.map +1 -1
- package/esm/field/index.css +6 -6
- package/esm/field/index.module.css.js +1 -1
- package/esm/field/index.module.css.js.map +1 -1
- package/esm/index.css +5 -5
- 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/mobile/Component.mobile.js.map +1 -1
- package/esm/option/Component.d.ts +2 -2
- package/esm/option/Component.js.map +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/utils/index.d.ts +2 -2
- package/esm/utils/index.js.map +1 -1
- package/field/Component.d.ts +4 -4
- package/field/Component.js.map +1 -1
- package/field/index.css +6 -6
- package/field/index.module.css.js +1 -1
- package/field/index.module.css.js.map +1 -1
- package/index.css +5 -5
- package/index.module.css.js +1 -1
- package/index.module.css.js.map +1 -1
- package/mobile/Component.mobile.d.ts +2 -2
- package/mobile/Component.mobile.js.map +1 -1
- package/modern/Component.responsive.d.ts +2 -2
- package/modern/Component.responsive.js.map +1 -1
- package/modern/desktop/Component.desktop.d.ts +4 -4
- package/modern/desktop/Component.desktop.js.map +1 -1
- package/modern/field/Component.d.ts +4 -4
- package/modern/field/Component.js.map +1 -1
- package/modern/field/index.css +6 -6
- package/modern/field/index.module.css.js +1 -1
- package/modern/field/index.module.css.js.map +1 -1
- package/modern/index.css +5 -5
- 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/mobile/Component.mobile.js.map +1 -1
- package/modern/option/Component.d.ts +2 -2
- package/modern/option/Component.js.map +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/utils/index.d.ts +2 -2
- package/modern/utils/index.js.map +1 -1
- package/moderncssm/Component.responsive.d.ts +2 -2
- package/moderncssm/Component.responsive.js.map +1 -1
- package/moderncssm/desktop/Component.desktop.d.ts +4 -4
- package/moderncssm/desktop/Component.desktop.js.map +1 -1
- package/moderncssm/field/Component.d.ts +4 -4
- package/moderncssm/field/Component.js.map +1 -1
- package/moderncssm/field/index.module.css +3 -1
- package/moderncssm/index.module.css +4 -2
- package/moderncssm/mobile/Component.mobile.d.ts +2 -2
- package/moderncssm/mobile/Component.mobile.js.map +1 -1
- package/moderncssm/option/Component.d.ts +2 -2
- package/moderncssm/option/Component.js.map +1 -1
- package/moderncssm/option/index.module.css +2 -0
- package/moderncssm/utils/index.d.ts +2 -2
- package/moderncssm/utils/index.js.map +1 -1
- package/option/Component.d.ts +2 -2
- package/option/Component.js.map +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 +3 -3
- package/src/Component.responsive.tsx +4 -4
- package/src/desktop/Component.desktop.tsx +4 -4
- package/src/field/Component.tsx +9 -4
- package/src/field/index.module.css +1 -1
- package/src/index.module.css +1 -1
- package/src/mobile/Component.mobile.tsx +3 -3
- package/src/option/Component.tsx +3 -3
- package/src/option/index.module.css +1 -1
- package/src/utils/index.ts +2 -2
- package/utils/index.d.ts +2 -2
- package/utils/index.js.map +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { ComponentType, SVGProps } from 'react';
|
|
2
|
-
import { ButtonProps } from '@alfalab/core-components-button/moderncssm';
|
|
3
|
-
import { FieldProps as BaseFieldProps } from '@alfalab/core-components-select/moderncssm/typings';
|
|
4
|
-
import type
|
|
1
|
+
import React, { type ComponentType, type SVGProps } from 'react';
|
|
2
|
+
import { type ButtonProps } from '@alfalab/core-components-button/moderncssm';
|
|
3
|
+
import { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/moderncssm/typings';
|
|
4
|
+
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
5
5
|
declare type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> & ButtonProps & {
|
|
6
6
|
buttonSize?: PickerButtonSize;
|
|
7
7
|
buttonVariant?: PickerButtonVariant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/field/Component.tsx"],"sourcesContent":["import React, { ButtonHTMLAttributes
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/field/Component.tsx"],"sourcesContent":["import React, {\n type ButtonHTMLAttributes,\n type ComponentType,\n Fragment,\n type SVGProps,\n} from 'react';\nimport cn from 'classnames';\n\nimport { Button, type ButtonProps } from '@alfalab/core-components-button';\nimport { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/typings';\n\nimport { type PickerButtonSize, type PickerButtonVariant } from '../types';\nimport { getIcon } from '../utils';\n\nimport styles from './index.module.css';\n\ntype FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> &\n ButtonProps & {\n buttonSize?: PickerButtonSize;\n buttonVariant?: PickerButtonVariant;\n showArrow?: boolean;\n icon?: ComponentType<SVGProps<SVGSVGElement>>;\n };\n\nconst SIZE_TO_CLASSNAME_MAP = {\n xxs: 'size-32',\n xs: 'size-40',\n s: 'size-48',\n m: 'size-56',\n l: 'size-64',\n xl: 'size-72',\n 32: 'size-32',\n 40: 'size-40',\n 48: 'size-48',\n 56: 'size-56',\n 64: 'size-64',\n 72: 'size-72',\n};\n\nexport const Field = ({\n buttonSize = 56,\n buttonVariant = 'default',\n view,\n label,\n open,\n multiple,\n rightAddons,\n Arrow,\n innerProps,\n className,\n selected,\n selectedMultiple,\n setSelectedItems,\n toggleMenu,\n valueRenderer,\n showArrow = true,\n labelView,\n FormControlComponent,\n icon,\n onClear,\n ...restProps\n}: FieldProps) => {\n const Icon: ComponentType<SVGProps<SVGSVGElement>> = getIcon(\n buttonVariant,\n SIZE_TO_CLASSNAME_MAP[buttonSize],\n icon,\n );\n\n const { ref, ...restInnerProps } = innerProps;\n\n const buttonProps = {\n ...restProps,\n ...restInnerProps,\n } as ButtonHTMLAttributes<HTMLButtonElement>;\n\n return (\n <div ref={ref}>\n <Button\n {...buttonProps}\n rightAddons={\n <Fragment>\n {rightAddons && (\n <span\n className={cn(styles.addonsContainer, {\n [styles.showControlIcon]:\n showArrow || buttonVariant === 'compact',\n })}\n >\n {rightAddons}\n </span>\n )}\n\n {(showArrow || buttonVariant === 'compact') && (\n <span\n className={cn(\n styles.iconContainer,\n buttonVariant !== 'compact' && open && styles.open,\n )}\n >\n <Icon data-test-id='picker-button-icon' />\n </span>\n )}\n </Fragment>\n }\n block={true}\n view={view}\n size={buttonSize}\n className={cn(className, {\n [styles.linkOpen]: view === 'link' && open,\n })}\n >\n {buttonVariant !== 'compact' && label}\n </Button>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,qBAAqB,GAAG;AAC1B,IAAA,GAAG,EAAE,SAAS;AACd,IAAA,EAAE,EAAE,SAAS;AACb,IAAA,CAAC,EAAE,SAAS;AACZ,IAAA,CAAC,EAAE,SAAS;AACZ,IAAA,CAAC,EAAE,SAAS;AACZ,IAAA,EAAE,EAAE,SAAS;AACb,IAAA,EAAE,EAAE,SAAS;AACb,IAAA,EAAE,EAAE,SAAS;AACb,IAAA,EAAE,EAAE,SAAS;AACb,IAAA,EAAE,EAAE,SAAS;AACb,IAAA,EAAE,EAAE,SAAS;AACb,IAAA,EAAE,EAAE,SAAS;CAChB;AAEY,MAAA,KAAK,GAAG,CAAC,EAClB,UAAU,GAAG,EAAE,EACf,aAAa,GAAG,SAAS,EACzB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,SAAS,GAAG,IAAI,EAChB,SAAS,EACT,oBAAoB,EACpB,IAAI,EACJ,OAAO,EACP,GAAG,SAAS,EACH,KAAI;AACb,IAAA,MAAM,IAAI,GAA2C,OAAO,CACxD,aAAa,EACb,qBAAqB,CAAC,UAAU,CAAC,EACjC,IAAI,CACP;IAED,MAAM,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,UAAU;AAE7C,IAAA,MAAM,WAAW,GAAG;AAChB,QAAA,GAAG,SAAS;AACZ,QAAA,GAAG,cAAc;KACuB;AAE5C,IAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,GAAG,EAAA;AACT,QAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EACC,EAAA,GAAA,WAAW,EACf,WAAW,EACP,oBAAC,QAAQ,EAAA,IAAA;gBACJ,WAAW,KACR,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,EAAE;wBAClC,CAAC,MAAM,CAAC,eAAe,GACnB,SAAS,IAAI,aAAa,KAAK,SAAS;qBAC/C,CAAC,EAAA,EAED,WAAW,CACT,CACV;gBAEA,CAAC,SAAS,IAAI,aAAa,KAAK,SAAS,MACtC,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACI,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,aAAa,EACpB,aAAa,KAAK,SAAS,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CACrD,EAAA;oBAED,KAAC,CAAA,aAAA,CAAA,IAAI,EAAc,EAAA,cAAA,EAAA,oBAAoB,EAAG,CAAA,CACvC,CACV,CACM,EAEf,KAAK,EAAE,IAAI,EACX,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE;gBACrB,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,KAAK,MAAM,IAAI,IAAI;aAC7C,CAAC,EAAA,EAED,aAAa,KAAK,SAAS,IAAI,KAAK,CAChC,CACP;AAEd;;;;"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
.container {
|
|
2
4
|
min-width: auto;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
|
-
:global(.cc-picker-button)
|
|
7
|
+
.optionsPopover.sideGap:global(.cc-picker-button) {
|
|
6
8
|
padding: var(--gap-0) var(--gap-8);
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
:global(.cc-picker-button) .option {
|
|
10
|
-
padding: var(--gap-0) var(--gap-16)
|
|
12
|
+
padding: var(--gap-0) var(--gap-16);
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
:global(.cc-picker-button) .option:before {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AdditionalMobileProps, BottomSheetSelectMobileProps } from '@alfalab/core-components-select/moderncssm/shared';
|
|
3
|
-
import type
|
|
2
|
+
import { type AdditionalMobileProps, type BottomSheetSelectMobileProps } from '@alfalab/core-components-select/moderncssm/shared';
|
|
3
|
+
import { type PickerButtonDesktopProps } from '../desktop';
|
|
4
4
|
export declare type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
5
5
|
/**
|
|
6
6
|
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.mobile.js","sources":["../../src/mobile/Component.mobile.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { SelectMobile } from '@alfalab/core-components-select/mobile';\nimport {\n AdditionalMobileProps,\n BottomSheetSelectMobileProps,\n Optgroup as DefaultOptgroup,\n} from '@alfalab/core-components-select/shared';\n\nimport type
|
|
1
|
+
{"version":3,"file":"Component.mobile.js","sources":["../../src/mobile/Component.mobile.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { SelectMobile } from '@alfalab/core-components-select/mobile';\nimport {\n type AdditionalMobileProps,\n type BottomSheetSelectMobileProps,\n Optgroup as DefaultOptgroup,\n} from '@alfalab/core-components-select/shared';\n\nimport { type PickerButtonDesktopProps } from '../desktop';\nimport { Field as DefaultField } from '../field';\nimport { Option as DefaultOption } from '../option';\n\nexport type PickerButtonMobileProps = Omit<\n PickerButtonDesktopProps,\n 'OptionsList' | 'Checkmark' | 'onScroll'\n> &\n AdditionalMobileProps &\n BottomSheetSelectMobileProps & {\n /**\n * Контрольная точка для кнопки, с нее начинается desktop версия\n * @default 1024\n */\n breakpoint?: number;\n };\n\nexport const PickerButtonMobile = forwardRef<HTMLInputElement, PickerButtonMobileProps>(\n (\n {\n options,\n label,\n Option = DefaultOption,\n Optgroup = DefaultOptgroup,\n view,\n loading,\n variant = 'default',\n leftAddons,\n rightAddons,\n size,\n bottomSheetProps,\n showArrow,\n Field = DefaultField,\n fieldProps = {},\n icon,\n breakpoint,\n ...restProps\n },\n ref,\n ) => {\n const fieldDefaultProps = {\n view,\n loading,\n /** size у select, button несовместимы */\n buttonSize: size,\n buttonVariant: variant,\n leftAddons,\n rightAddons,\n showArrow,\n breakpoint,\n icon,\n };\n\n return (\n <SelectMobile\n {...restProps}\n label={label}\n Option={Option}\n bottomSheetProps={{\n title: label,\n stickyHeader: true,\n showSwipeMarker: false,\n ...bottomSheetProps,\n }}\n Field={Field}\n Optgroup={Optgroup}\n size={size === 'm' || size === 56 ? 56 : 48}\n closeOnSelect={true}\n fieldProps={{\n ...fieldDefaultProps,\n ...(fieldProps as object),\n }}\n ref={ref}\n options={options}\n selected={[]}\n />\n );\n },\n);\n"],"names":["Option","DefaultOption","Optgroup","DefaultOptgroup","Field","DefaultField"],"mappings":";;;;;;AA0Ba,MAAA,kBAAkB,GAAG,UAAU,CACxC,CACI,EACI,OAAO,EACP,KAAK,UACLA,QAAM,GAAGC,MAAa,YACtBC,UAAQ,GAAGC,QAAe,EAC1B,IAAI,EACJ,OAAO,EACP,OAAO,GAAG,SAAS,EACnB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,gBAAgB,EAChB,SAAS,SACTC,OAAK,GAAGC,KAAY,EACpB,UAAU,GAAG,EAAE,EACf,IAAI,EACJ,UAAU,EACV,GAAG,SAAS,EACf,EACD,GAAG,KACH;AACA,IAAA,MAAM,iBAAiB,GAAG;QACtB,IAAI;QACJ,OAAO;;AAEP,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,aAAa,EAAE,OAAO;QACtB,UAAU;QACV,WAAW;QACX,SAAS;QACT,UAAU;QACV,IAAI;KACP;AAED,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,EAAA,GACL,SAAS,EACb,KAAK,EAAE,KAAK,EACZ,MAAM,EAAEL,QAAM,EACd,gBAAgB,EAAE;AACd,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,eAAe,EAAE,KAAK;AACtB,YAAA,GAAG,gBAAgB;AACtB,SAAA,EACD,KAAK,EAAEI,OAAK,EACZ,QAAQ,EAAEF,UAAQ,EAClB,IAAI,EAAE,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAC3C,aAAa,EAAE,IAAI,EACnB,UAAU,EAAE;AACR,YAAA,GAAG,iBAAiB;AACpB,YAAA,GAAI,UAAqB;AAC5B,SAAA,EACD,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,EAAE,EAAA,CACd;AAEV,CAAC;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { FC, SVGProps } from 'react';
|
|
2
|
-
import { OptionProps as BaseOptionProps, OptionShape } from '@alfalab/core-components-select/moderncssm/shared';
|
|
1
|
+
import React, { type FC, type SVGProps } from 'react';
|
|
2
|
+
import { type OptionProps as BaseOptionProps, type OptionShape } from '@alfalab/core-components-select/moderncssm/shared';
|
|
3
3
|
declare type OptionProps = Omit<BaseOptionProps, 'option'> & {
|
|
4
4
|
option: OptionShape & {
|
|
5
5
|
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/option/Component.tsx"],"sourcesContent":["import React, { FC, SVGProps } from 'react';\n\nimport {\n Option as BaseOption,\n OptionProps as BaseOptionProps,\n OptionShape,\n} from '@alfalab/core-components-select/shared';\n\nimport styles from './index.module.css';\n\ntype OptionProps = Omit<BaseOptionProps, 'option'> & {\n option: OptionShape & {\n icon?: FC<SVGProps<SVGSVGElement>>;\n };\n};\n\nexport const Option = ({ option, children, ...restProps }: OptionProps) => {\n const content = children || option.content || option.key;\n\n const Icon = option.icon;\n\n return (\n <BaseOption option={option} {...restProps}>\n <div className={styles.container}>\n {Icon && <Icon className={styles.icon} />}\n <div className={styles.content}>{content}</div>\n </div>\n </BaseOption>\n );\n};\n"],"names":["BaseOption"],"mappings":";;;;AAgBO,MAAM,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAe,KAAI;IACtE,MAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG;AAExD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI;IAExB,QACI,oBAACA,QAAU,EAAA,EAAC,MAAM,EAAE,MAAM,KAAM,SAAS,EAAA;AACrC,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,SAAS,EAAA;YAC3B,IAAI,IAAI,oBAAC,IAAI,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAI,CAAA;YACzC,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,OAAO,EAAG,EAAA,OAAO,CAAO,CAC7C,CACG;AAErB;;;;"}
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/option/Component.tsx"],"sourcesContent":["import React, { type FC, type SVGProps } from 'react';\n\nimport {\n Option as BaseOption,\n type OptionProps as BaseOptionProps,\n type OptionShape,\n} from '@alfalab/core-components-select/shared';\n\nimport styles from './index.module.css';\n\ntype OptionProps = Omit<BaseOptionProps, 'option'> & {\n option: OptionShape & {\n icon?: FC<SVGProps<SVGSVGElement>>;\n };\n};\n\nexport const Option = ({ option, children, ...restProps }: OptionProps) => {\n const content = children || option.content || option.key;\n\n const Icon = option.icon;\n\n return (\n <BaseOption option={option} {...restProps}>\n <div className={styles.container}>\n {Icon && <Icon className={styles.icon} />}\n <div className={styles.content}>{content}</div>\n </div>\n </BaseOption>\n );\n};\n"],"names":["BaseOption"],"mappings":";;;;AAgBO,MAAM,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAe,KAAI;IACtE,MAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG;AAExD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI;IAExB,QACI,oBAACA,QAAU,EAAA,EAAC,MAAM,EAAE,MAAM,KAAM,SAAS,EAAA;AACrC,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,SAAS,EAAA;YAC3B,IAAI,IAAI,oBAAC,IAAI,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAI,CAAA;YACzC,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,OAAO,EAAG,EAAA,OAAO,CAAO,CAC7C,CACG;AAErB;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, SVGProps } from 'react';
|
|
2
|
-
import { PickerButtonVariant } from '../types';
|
|
1
|
+
import { type ComponentType, type SVGProps } from 'react';
|
|
2
|
+
import { type PickerButtonVariant } from '../types';
|
|
3
3
|
export declare const getCompactIcon: (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => ComponentType<SVGProps<SVGSVGElement>>;
|
|
4
4
|
export declare const getIcon: (variant: PickerButtonVariant, size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => ComponentType<SVGProps<SVGSVGElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { ComponentType, 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 { 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;AAC1F,IAAA,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;AACd;IAED,OAAO,IAAI,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS;AACrD;AAEa,MAAA,OAAO,GAAG,CACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,KACL;IACxC,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;AACpC;AAED,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,uBAAuB,GAAG,gBAAgB;AAC7F;;;;"}
|
|
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;AAC1F,IAAA,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;AACd;IAED,OAAO,IAAI,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS;AACrD;AAEa,MAAA,OAAO,GAAG,CACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,KACL;IACxC,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;AACpC;AAED,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,uBAAuB,GAAG,gBAAgB;AAC7F;;;;"}
|
package/option/Component.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { FC, SVGProps } from 'react';
|
|
2
|
-
import { OptionProps as BaseOptionProps, OptionShape } from '@alfalab/core-components-select/shared';
|
|
1
|
+
import React, { type FC, type SVGProps } from 'react';
|
|
2
|
+
import { type OptionProps as BaseOptionProps, type OptionShape } from '@alfalab/core-components-select/shared';
|
|
3
3
|
declare type OptionProps = Omit<BaseOptionProps, 'option'> & {
|
|
4
4
|
option: OptionShape & {
|
|
5
5
|
icon?: FC<SVGProps<SVGSVGElement>>;
|
package/option/Component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/option/Component.tsx"],"sourcesContent":["import React, { FC, SVGProps } from 'react';\n\nimport {\n Option as BaseOption,\n OptionProps as BaseOptionProps,\n OptionShape,\n} from '@alfalab/core-components-select/shared';\n\nimport styles from './index.module.css';\n\ntype OptionProps = Omit<BaseOptionProps, 'option'> & {\n option: OptionShape & {\n icon?: FC<SVGProps<SVGSVGElement>>;\n };\n};\n\nexport const Option = ({ option, children, ...restProps }: OptionProps) => {\n const content = children || option.content || option.key;\n\n const Icon = option.icon;\n\n return (\n <BaseOption option={option} {...restProps}>\n <div className={styles.container}>\n {Icon && <Icon className={styles.icon} />}\n <div className={styles.content}>{content}</div>\n </div>\n </BaseOption>\n );\n};\n"],"names":["__rest","React","BaseOption","__assign","styles"],"mappings":";;;;;;;;;;;;;AAgBO,IAAM,MAAM,GAAG,UAAC,EAA+C,EAAA;IAA7C,IAAA,MAAM,YAAA,EAAE,QAAQ,cAAA,EAAK,SAAS,GAAhCA,YAAA,CAAA,EAAA,EAAA,CAAA,QAAA,EAAA,UAAA,CAAkC,CAAF;IACnD,IAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG;AAExD,IAAA,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI;IAExB,QACIC,qCAACC,aAAU,EAAAC,cAAA,CAAA,EAAC,MAAM,EAAE,MAAM,IAAM,SAAS,CAAA;AACrC,QAAAF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEG,YAAM,CAAC,SAAS,EAAA;YAC3B,IAAI,IAAIH,qCAAC,IAAI,EAAA,EAAC,SAAS,EAAEG,YAAM,CAAC,IAAI,EAAI,CAAA;YACzCH,sBAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEG,YAAM,CAAC,OAAO,EAAG,EAAA,OAAO,CAAO,CAC7C,CACG;AAErB;;;;"}
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/option/Component.tsx"],"sourcesContent":["import React, { type FC, type SVGProps } from 'react';\n\nimport {\n Option as BaseOption,\n type OptionProps as BaseOptionProps,\n type OptionShape,\n} from '@alfalab/core-components-select/shared';\n\nimport styles from './index.module.css';\n\ntype OptionProps = Omit<BaseOptionProps, 'option'> & {\n option: OptionShape & {\n icon?: FC<SVGProps<SVGSVGElement>>;\n };\n};\n\nexport const Option = ({ option, children, ...restProps }: OptionProps) => {\n const content = children || option.content || option.key;\n\n const Icon = option.icon;\n\n return (\n <BaseOption option={option} {...restProps}>\n <div className={styles.container}>\n {Icon && <Icon className={styles.icon} />}\n <div className={styles.content}>{content}</div>\n </div>\n </BaseOption>\n );\n};\n"],"names":["__rest","React","BaseOption","__assign","styles"],"mappings":";;;;;;;;;;;;;AAgBO,IAAM,MAAM,GAAG,UAAC,EAA+C,EAAA;IAA7C,IAAA,MAAM,YAAA,EAAE,QAAQ,cAAA,EAAK,SAAS,GAAhCA,YAAA,CAAA,EAAA,EAAA,CAAA,QAAA,EAAA,UAAA,CAAkC,CAAF;IACnD,IAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG;AAExD,IAAA,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI;IAExB,QACIC,qCAACC,aAAU,EAAAC,cAAA,CAAA,EAAC,MAAM,EAAE,MAAM,IAAM,SAAS,CAAA;AACrC,QAAAF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEG,YAAM,CAAC,SAAS,EAAA;YAC3B,IAAI,IAAIH,qCAAC,IAAI,EAAA,EAAC,SAAS,EAAEG,YAAM,CAAC,IAAI,EAAI,CAAA;YACzCH,sBAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEG,YAAM,CAAC,OAAO,EAAG,EAAA,OAAO,CAAO,CAC7C,CACG;AAErB;;;;"}
|
package/option/index.css
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-s: 12px;
|
|
3
3
|
--gap-12: var(--gap-s);
|
|
4
|
-
} .picker-
|
|
4
|
+
} .picker-button__container_zn51g {
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
|
-
} .picker-
|
|
7
|
+
} .picker-button__icon_zn51g {
|
|
8
8
|
display: flex;
|
|
9
9
|
margin-right: var(--gap-12);
|
|
10
|
-
} .picker-
|
|
10
|
+
} .picker-button__content_zn51g {
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
flex: 1;
|
|
13
13
|
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_zn51g","icon":"picker-button__icon_zn51g","content":"picker-button__content_zn51g"};
|
|
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/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;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/option/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-typography-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": "12.0.
|
|
3
|
+
"version": "12.0.2",
|
|
4
4
|
"description": "Picker button component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@alfalab/core-components-button": "^12.0.1",
|
|
14
14
|
"@alfalab/core-components-mq": "^5.0.1",
|
|
15
15
|
"@alfalab/core-components-popover": "^7.1.0",
|
|
16
|
-
"@alfalab/core-components-select": "^18.0
|
|
16
|
+
"@alfalab/core-components-select": "^18.1.0",
|
|
17
17
|
"@alfalab/icons-glyph": "^2.247.0",
|
|
18
18
|
"classnames": "^2.5.1",
|
|
19
19
|
"tslib": "^2.4.0"
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"access": "public",
|
|
27
27
|
"directory": "dist"
|
|
28
28
|
},
|
|
29
|
-
"themesVersion": "14.1.
|
|
29
|
+
"themesVersion": "14.1.2",
|
|
30
30
|
"varsVersion": "10.1.0"
|
|
31
31
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
|
|
3
3
|
import { useIsDesktop } from '@alfalab/core-components-mq';
|
|
4
|
-
import
|
|
5
|
-
AdditionalMobileProps,
|
|
6
|
-
BottomSheetSelectMobileProps,
|
|
4
|
+
import {
|
|
5
|
+
type AdditionalMobileProps,
|
|
6
|
+
type BottomSheetSelectMobileProps,
|
|
7
7
|
} from '@alfalab/core-components-select/shared';
|
|
8
8
|
|
|
9
|
-
import { PickerButtonDesktop, PickerButtonDesktopProps } from './desktop';
|
|
9
|
+
import { PickerButtonDesktop, type PickerButtonDesktopProps } from './desktop';
|
|
10
10
|
import { PickerButtonMobile } from './mobile';
|
|
11
11
|
|
|
12
12
|
export type PickerButtonResponsiveProps = PickerButtonDesktopProps &
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React, { ComponentType, forwardRef, SVGProps } from 'react';
|
|
1
|
+
import React, { type ComponentType, forwardRef, type SVGProps } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
import type
|
|
4
|
+
import { type ButtonProps } from '@alfalab/core-components-button';
|
|
5
5
|
import { Popover } from '@alfalab/core-components-popover';
|
|
6
6
|
import {
|
|
7
7
|
BaseSelect,
|
|
8
|
-
BaseSelectProps,
|
|
8
|
+
type BaseSelectProps,
|
|
9
9
|
Optgroup as DefaultOptgroup,
|
|
10
10
|
OptionsList as DefaultOptionsList,
|
|
11
11
|
} from '@alfalab/core-components-select/shared';
|
|
12
12
|
|
|
13
13
|
import { Field as DefaultField } from '../field';
|
|
14
14
|
import { Option as DefaultOption } from '../option';
|
|
15
|
-
import type
|
|
15
|
+
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
16
16
|
|
|
17
17
|
import styles from '../index.module.css';
|
|
18
18
|
|
package/src/field/Component.tsx
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
type ButtonHTMLAttributes,
|
|
3
|
+
type ComponentType,
|
|
4
|
+
Fragment,
|
|
5
|
+
type SVGProps,
|
|
6
|
+
} from 'react';
|
|
2
7
|
import cn from 'classnames';
|
|
3
8
|
|
|
4
|
-
import { Button, ButtonProps } from '@alfalab/core-components-button';
|
|
5
|
-
import { FieldProps as BaseFieldProps } from '@alfalab/core-components-select/typings';
|
|
9
|
+
import { Button, type ButtonProps } from '@alfalab/core-components-button';
|
|
10
|
+
import { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/typings';
|
|
6
11
|
|
|
7
|
-
import type
|
|
12
|
+
import { type PickerButtonSize, type PickerButtonVariant } from '../types';
|
|
8
13
|
import { getIcon } from '../utils';
|
|
9
14
|
|
|
10
15
|
import styles from './index.module.css';
|
package/src/index.module.css
CHANGED
|
@@ -2,12 +2,12 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { SelectMobile } from '@alfalab/core-components-select/mobile';
|
|
4
4
|
import {
|
|
5
|
-
AdditionalMobileProps,
|
|
6
|
-
BottomSheetSelectMobileProps,
|
|
5
|
+
type AdditionalMobileProps,
|
|
6
|
+
type BottomSheetSelectMobileProps,
|
|
7
7
|
Optgroup as DefaultOptgroup,
|
|
8
8
|
} from '@alfalab/core-components-select/shared';
|
|
9
9
|
|
|
10
|
-
import type
|
|
10
|
+
import { type PickerButtonDesktopProps } from '../desktop';
|
|
11
11
|
import { Field as DefaultField } from '../field';
|
|
12
12
|
import { Option as DefaultOption } from '../option';
|
|
13
13
|
|
package/src/option/Component.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { FC, SVGProps } from 'react';
|
|
1
|
+
import React, { type FC, type SVGProps } from 'react';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Option as BaseOption,
|
|
5
|
-
OptionProps as BaseOptionProps,
|
|
6
|
-
OptionShape,
|
|
5
|
+
type OptionProps as BaseOptionProps,
|
|
6
|
+
type OptionShape,
|
|
7
7
|
} from '@alfalab/core-components-select/shared';
|
|
8
8
|
|
|
9
9
|
import styles from './index.module.css';
|
package/src/utils/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ComponentType, SVGProps } from 'react';
|
|
1
|
+
import { type ComponentType, type SVGProps } from 'react';
|
|
2
2
|
|
|
3
3
|
import { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';
|
|
4
4
|
import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
5
5
|
import { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';
|
|
6
6
|
import { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';
|
|
7
7
|
|
|
8
|
-
import { PickerButtonVariant } from '../types';
|
|
8
|
+
import { type PickerButtonVariant } from '../types';
|
|
9
9
|
|
|
10
10
|
export const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {
|
|
11
11
|
if (Icon) {
|
package/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, SVGProps } from 'react';
|
|
2
|
-
import { PickerButtonVariant } from '../types';
|
|
1
|
+
import { type ComponentType, type SVGProps } from 'react';
|
|
2
|
+
import { type PickerButtonVariant } from '../types';
|
|
3
3
|
export declare const getCompactIcon: (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => ComponentType<SVGProps<SVGSVGElement>>;
|
|
4
4
|
export declare const getIcon: (variant: PickerButtonVariant, size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => ComponentType<SVGProps<SVGSVGElement>>;
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils/index.ts"],"sourcesContent":["import { ComponentType, 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 { 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;AACtF,IAAA,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;AACd;IAED,OAAO,IAAI,KAAK,SAAS,GAAGA,mBAAS,GAAGC,mBAAS;AACrD;IAEa,OAAO,GAAG,UACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,EAAA;IAE7C,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;AACpC;AAED,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAGC,+CAAuB,GAAGC,iCAAgB;AAC7F;;;;;"}
|
|
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;AACtF,IAAA,IAAI,IAAI,EAAE;AACN,QAAA,OAAO,IAAI;AACd;IAED,OAAO,IAAI,KAAK,SAAS,GAAGA,mBAAS,GAAGC,mBAAS;AACrD;IAEa,OAAO,GAAG,UACnB,OAA4B,EAC5B,IAAY,EACZ,IAA6C,EAAA;IAE7C,IAAI,OAAO,KAAK,SAAS,EAAE;AACvB,QAAA,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;AACpC;AAED,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAGC,+CAAuB,GAAGC,iCAAgB;AAC7F;;;;;"}
|