@alfalab/core-components-picker-button 11.7.18 → 11.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cssm/fnUtils-e793ac44.d.ts +15 -0
- package/cssm/index-2f466837.d.ts +3 -15
- package/cssm/index.module.css +3 -2
- package/cssm/transformSize-ebda875c.d.ts +3 -0
- package/cssm/use-skeleton-1328ead9.d.ts +5 -0
- package/cssm/useIsMounted-e793ac44.d.ts +3 -0
- package/cssm/{utils-3942b092.d.ts → utils-1132e887.d.ts} +1 -1
- package/desktop/Component.desktop.js +1 -1
- package/esm/desktop/Component.desktop.js +1 -1
- package/esm/field/Component.js +1 -1
- package/esm/field/index.css +6 -6
- package/esm/fnUtils-e793ac44.d.ts +15 -0
- package/esm/index-2f466837.d.ts +3 -15
- package/esm/index.css +8 -7
- package/esm/option/Component.js +1 -1
- package/esm/option/index.css +4 -4
- package/esm/transformSize-ebda875c.d.ts +3 -0
- package/esm/use-skeleton-1328ead9.d.ts +5 -0
- package/esm/useIsMounted-e793ac44.d.ts +3 -0
- package/esm/{utils-3942b092.d.ts → utils-1132e887.d.ts} +1 -1
- package/field/Component.js +1 -1
- package/field/index.css +6 -6
- package/fnUtils-e793ac44.d.ts +15 -0
- package/index-2f466837.d.ts +3 -15
- package/index.css +8 -7
- package/modern/desktop/Component.desktop.js +1 -1
- package/modern/field/Component.js +1 -1
- package/modern/field/index.css +6 -6
- package/modern/fnUtils-e793ac44.d.ts +15 -0
- package/modern/index-2f466837.d.ts +3 -15
- package/modern/index.css +8 -7
- package/modern/option/Component.js +1 -1
- package/modern/option/index.css +4 -4
- package/modern/transformSize-ebda875c.d.ts +3 -0
- package/modern/use-skeleton-1328ead9.d.ts +5 -0
- package/modern/useIsMounted-e793ac44.d.ts +3 -0
- package/modern/{utils-3942b092.d.ts → utils-1132e887.d.ts} +1 -1
- package/moderncssm/Component-11f20b2e.d.ts +13 -0
- package/moderncssm/Component-2f466837.d.ts +171 -0
- package/moderncssm/Component-7d83ec1e.d.ts +5 -0
- package/moderncssm/Component-c44170fe.d.ts +291 -0
- package/moderncssm/Component.desktop-63dec22f.d.ts +6 -0
- package/moderncssm/Component.desktop-ebda875c.d.ts +6 -0
- package/moderncssm/Component.mobile-96988a65.d.ts +6 -0
- package/moderncssm/Component.mobile-ebda875c.d.ts +6 -0
- package/moderncssm/Component.responsive.d.ts +27 -0
- package/moderncssm/Component.responsive.js +15 -0
- package/moderncssm/Context-c2e6f1b2.d.ts +4 -0
- package/moderncssm/ResponsiveContext-d6bfd5b7.d.ts +5 -0
- package/moderncssm/browser-a216f694.d.ts +6 -0
- package/moderncssm/colors-facf1d2a.d.ts +3 -0
- package/moderncssm/component-03d088c4.d.ts +32 -0
- package/moderncssm/component-eb15729d.d.ts +123 -0
- package/moderncssm/consts-6c9aad46.d.ts +12 -0
- package/moderncssm/consts-ef43bf1b.d.ts +12 -0
- package/moderncssm/desktop/Component.desktop.d.ts +59 -0
- package/moderncssm/desktop/Component.desktop.js +32 -0
- package/moderncssm/desktop/index.d.ts +2 -0
- package/moderncssm/desktop/index.js +1 -0
- package/moderncssm/field/Component.d.ts +14 -0
- package/moderncssm/field/Component.js +39 -0
- package/moderncssm/field/index.d.ts +1 -0
- package/moderncssm/field/index.js +1 -0
- package/moderncssm/field/index.module.css +22 -0
- package/moderncssm/fnUtils-e793ac44.d.ts +15 -0
- package/moderncssm/iconMap-09d2f9c9.d.ts +4 -0
- package/moderncssm/index-03d088c4.d.ts +20 -0
- package/moderncssm/index-064acd29.d.ts +13 -0
- package/moderncssm/index-09d2f9c9.d.ts +38 -0
- package/moderncssm/index-11f20b2e.d.ts +215 -0
- package/moderncssm/index-281accb7.d.ts +19 -0
- package/moderncssm/index-2f466837.d.ts +62 -0
- package/moderncssm/index-3109f463.d.ts +66 -0
- package/moderncssm/index-63dec22f.d.ts +2 -0
- package/moderncssm/index-96988a65.d.ts +2 -0
- package/moderncssm/index-c44170fe.d.ts +19 -0
- package/moderncssm/index-d691530f.d.ts +1 -0
- package/moderncssm/index-ebda875c.d.ts +3 -0
- package/moderncssm/index.d.ts +2 -0
- package/moderncssm/index.js +1 -0
- package/moderncssm/index.module.css +18 -0
- package/moderncssm/mobile/Component.mobile.d.ts +19 -0
- package/moderncssm/mobile/Component.mobile.js +30 -0
- package/moderncssm/mobile/index.d.ts +2 -0
- package/moderncssm/mobile/index.js +1 -0
- package/moderncssm/option/Component.d.ts +12 -0
- package/moderncssm/option/Component.js +14 -0
- package/moderncssm/option/index.d.ts +1 -0
- package/moderncssm/option/index.js +1 -0
- package/moderncssm/option/index.module.css +17 -0
- package/moderncssm/shared/index.d.ts +2 -0
- package/moderncssm/shared/index.js +1 -0
- package/moderncssm/transformSize-ebda875c.d.ts +3 -0
- package/moderncssm/types-1328ead9.d.ts +21 -0
- package/moderncssm/types-a870d1f8.d.ts +117 -0
- package/moderncssm/types.d.ts +3 -0
- package/moderncssm/types.js +1 -0
- package/moderncssm/typings-7d83ec1e.d.ts +1160 -0
- package/moderncssm/typings-d6bfd5b7.d.ts +62 -0
- package/moderncssm/use-skeleton-1328ead9.d.ts +49 -0
- package/moderncssm/use-visualviewport-size-2f466837.d.ts +3 -0
- package/moderncssm/useCustomWebkitScrollbar-a216f694.d.ts +2 -0
- package/moderncssm/useIsMounted-e793ac44.d.ts +3 -0
- package/moderncssm/usePortalContainer-2f466837.d.ts +2 -0
- package/moderncssm/utils/index.d.ts +6 -0
- package/moderncssm/utils/index.js +19 -0
- package/{utils-3942b092.d.ts → moderncssm/utils-1132e887.d.ts} +1 -1
- package/moderncssm/utils-ed29dc0e.d.ts +5 -0
- package/option/Component.js +1 -1
- package/option/index.css +4 -4
- package/package.json +6 -6
- package/src/field/index.module.css +1 -1
- package/src/index.module.css +3 -3
- package/src/option/index.module.css +1 -1
- package/transformSize-ebda875c.d.ts +3 -0
- package/use-skeleton-1328ead9.d.ts +5 -0
- package/useIsMounted-e793ac44.d.ts +3 -0
- package/utils-1132e887.d.ts +81 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PickerButtonDesktop } from './Component.desktop.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ComponentType, SVGProps } from "react";
|
|
4
|
+
import { ButtonProps } from "@alfalab/core-components-button";
|
|
5
|
+
import { FieldProps as BaseFieldProps } from "../typings-7d83ec1e";
|
|
6
|
+
import { PickerButtonSize, PickerButtonVariant } from "../types";
|
|
7
|
+
type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> & ButtonProps & {
|
|
8
|
+
buttonSize?: PickerButtonSize;
|
|
9
|
+
buttonVariant?: PickerButtonVariant;
|
|
10
|
+
showArrow?: boolean;
|
|
11
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
12
|
+
};
|
|
13
|
+
declare const Field: ({ buttonSize, buttonVariant, view, label, open, multiple, rightAddons, Arrow, innerProps, className, selected, selectedMultiple, setSelectedItems, toggleMenu, valueRenderer, showArrow, labelView, FormControlComponent, icon, ...restProps }: FieldProps) => React.JSX.Element;
|
|
14
|
+
export { Field };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { Button } from '@alfalab/core-components-button/moderncssm';
|
|
4
|
+
import { getIcon } from '../utils/index.js';
|
|
5
|
+
import styles from './index.module.css';
|
|
6
|
+
|
|
7
|
+
const SIZE_TO_CLASSNAME_MAP = {
|
|
8
|
+
xxs: 'size-32',
|
|
9
|
+
xs: 'size-40',
|
|
10
|
+
s: 'size-48',
|
|
11
|
+
m: 'size-56',
|
|
12
|
+
l: 'size-64',
|
|
13
|
+
xl: 'size-72',
|
|
14
|
+
32: 'size-32',
|
|
15
|
+
40: 'size-40',
|
|
16
|
+
48: 'size-48',
|
|
17
|
+
56: 'size-56',
|
|
18
|
+
64: 'size-64',
|
|
19
|
+
72: 'size-72',
|
|
20
|
+
};
|
|
21
|
+
const Field = ({ buttonSize = 56, buttonVariant = 'default', view, label, open, multiple, rightAddons, Arrow, innerProps, className, selected, selectedMultiple, setSelectedItems, toggleMenu, valueRenderer, showArrow = true, labelView, FormControlComponent, icon, ...restProps }) => {
|
|
22
|
+
const Icon = getIcon(buttonVariant, SIZE_TO_CLASSNAME_MAP[buttonSize], icon);
|
|
23
|
+
const { ref, ...restInnerProps } = innerProps;
|
|
24
|
+
const buttonProps = {
|
|
25
|
+
...restProps,
|
|
26
|
+
...restInnerProps,
|
|
27
|
+
};
|
|
28
|
+
return (React.createElement("div", { ref: ref },
|
|
29
|
+
React.createElement(Button, { ...buttonProps, rightAddons: React.createElement(Fragment, null,
|
|
30
|
+
rightAddons && (React.createElement("span", { className: cn(styles.addonsContainer, {
|
|
31
|
+
[styles.showControlIcon]: showArrow || buttonVariant === 'compact',
|
|
32
|
+
}) }, rightAddons)),
|
|
33
|
+
(showArrow || buttonVariant === 'compact') && (React.createElement("span", { className: cn(styles.iconContainer, buttonVariant !== 'compact' && open && styles.open) },
|
|
34
|
+
React.createElement(Icon, { "data-test-id": 'picker-button-icon' })))), block: true, view: view, size: buttonSize, className: cn(className, {
|
|
35
|
+
[styles.linkOpen]: view === 'link' && open,
|
|
36
|
+
}) }, buttonVariant !== 'compact' && label)));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { Field };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Field } from './Component.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
.iconContainer {
|
|
4
|
+
display: flex;
|
|
5
|
+
transition: transform 0.15s ease-in-out;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.addonsContainer {
|
|
9
|
+
display: flex
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.addonsContainer.showControlIcon {
|
|
13
|
+
margin-right: var(--gap-4);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.open {
|
|
17
|
+
transform: var(--arrow-transform);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.linkOpen:not(:hover) {
|
|
21
|
+
background-color: var(--color-light-transparent-default-hover);
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Возвращает true, если значение равно null или undefined
|
|
3
|
+
*/
|
|
4
|
+
declare function isNil<T>(value: T): value is T & (null | undefined);
|
|
5
|
+
/**
|
|
6
|
+
* Выбор значения между min max границами
|
|
7
|
+
*/
|
|
8
|
+
declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
|
|
9
|
+
declare function noop(): void;
|
|
10
|
+
declare const fnUtils: {
|
|
11
|
+
clamp: typeof clamp;
|
|
12
|
+
noop: typeof noop;
|
|
13
|
+
isNil: typeof isNil;
|
|
14
|
+
};
|
|
15
|
+
export { fnUtils };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TitleProps } from "./component-eb15729d";
|
|
4
|
+
declare const Title: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"> & {
|
|
5
|
+
tag: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
6
|
+
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
|
|
7
|
+
color?: "link" | "accent" | "primary" | "primary-inverted" | "secondary" | "secondary-inverted" | "tertiary" | "tertiary-inverted" | "attention" | "positive" | "negative" | "static-accent" | "disabled" | "static-primary-light" | "static-secondary-light" | "static-tertiary-light" | "static-primary-dark" | "static-secondary-dark" | "static-tertiary-dark" | undefined;
|
|
8
|
+
weight?: "bold" | "regular" | "medium" | "semibold" | undefined;
|
|
9
|
+
font?: "styrene" | "system" | undefined;
|
|
10
|
+
defaultMargins?: boolean | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
dataTestId?: string | undefined;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
rowLimit?: 1 | 2 | 3 | undefined;
|
|
15
|
+
showSkeleton?: boolean | undefined;
|
|
16
|
+
skeletonProps?: import("./types-1328ead9").TextSkeletonProps | undefined;
|
|
17
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
18
|
+
} & React.RefAttributes<HTMLDivElement | HTMLHeadingElement>>;
|
|
19
|
+
export { Title };
|
|
20
|
+
export type { TitleProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type BackgroundColorType = 'accent' | 'info' | 'attention-muted' | 'positive-muted' | 'negative-muted' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'specialbg-component' | 'specialbg-component-inverted' | 'specialbg-primary-grouped' | 'specialbg-secondary-grouped' | 'specialbg-tertiary-grouped' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
|
|
2
|
+
type BorderColorType = 'accent' | 'key' | 'key-inverted' | 'link' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'underline' | 'underline-inverted' | 'graphic-attention' | 'graphic-link' | 'graphic-negative' | 'graphic-positive' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
|
|
3
|
+
type GraphicColorType = 'accent' | 'link' | 'attention' | 'positive' | 'negative' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'static-light' | 'static-accent' | 'static-dark';
|
|
4
|
+
type ShadowType = 'shadow-xs' | 'shadow-s' | 'shadow-m' | 'shadow-l' | 'shadow-xl' | 'shadow-xs-hard' | 'shadow-s-hard' | 'shadow-m-hard' | 'shadow-l-hard' | 'shadow-xl-hard' | 'shadow-xs-up' | 'shadow-s-up' | 'shadow-m-up' | 'shadow-l-up' | 'shadow-xl-up' | 'shadow-xs-hard-up' | 'shadow-s-hard-up' | 'shadow-m-hard-up' | 'shadow-l-hard-up' | 'shadow-xl-hard-up';
|
|
5
|
+
type GapType = '3xs' | '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl';
|
|
6
|
+
type PaddingType = number | string | {
|
|
7
|
+
top?: number;
|
|
8
|
+
right?: number;
|
|
9
|
+
bottom?: number;
|
|
10
|
+
left?: number;
|
|
11
|
+
};
|
|
12
|
+
type TypographyType = 'accent-caps' | 'accent-component-primary' | 'accent-component-secondary' | 'accent-primary-large' | 'accent-primary-medium' | 'accent-primary-small' | 'accent-secondary-large' | 'accent-secondary-medium' | 'accent-secondary-small' | 'action-caps' | 'action-component-primary' | 'action-component-secondary' | 'action-primary-large' | 'action-primary-medium' | 'action-primary-small' | 'action-secondary-large' | 'action-secondary-medium' | 'action-secondary-small' | 'headline-mobile-large' | 'headline-mobile-medium' | 'headline-mobile-small' | 'headline-mobile-xlarge' | 'headline-mobile-xsmall' | 'headline-system-mobile-large' | 'headline-system-mobile-medium' | 'headline-system-mobile-small' | 'headline-system-mobile-xlarge' | 'headline-system-mobile-xsmall' | 'headline-system-large' | 'headline-system-medium' | 'headline-system-small' | 'headline-system-xlarge' | 'headline-system-xsmall' | 'headline-large' | 'headline-medium' | 'headline-small' | 'headline-xlarge' | 'headline-xsmall' | 'key-large' | 'key-medium' | 'key-small' | 'key-xlarge' | 'key-xsmall' | 'paragraph-caps' | 'paragraph-component-primary' | 'paragraph-component-secondary' | 'paragraph-primary-large' | 'paragraph-primary-medium' | 'paragraph-primary-small' | 'paragraph-secondary-large' | 'paragraph-secondary-medium' | 'paragraph-secondary-small' | 'promo-mobile-large' | 'promo-mobile-medium' | 'promo-mobile-small' | 'promo-mobile-xlarge' | 'promo-mobile-xsmall' | 'promo-system-mobile-large' | 'promo-system-mobile-medium' | 'promo-system-mobile-small' | 'promo-system-mobile-xlarge' | 'promo-system-mobile-xsmall' | 'promo-system-large' | 'promo-system-medium' | 'promo-system-small' | 'promo-system-xlarge' | 'promo-system-xsmall' | 'promo-large' | 'promo-medium' | 'promo-small' | 'promo-xlarge' | 'promo-xsmall' | 'accent-component' | 'action-component' | 'paragraph-component';
|
|
13
|
+
export { BackgroundColorType, BorderColorType, GraphicColorType, ShadowType, GapType, PaddingType, TypographyType };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
type StatusBadgeViews = "positive-checkmark" | "negative-cross" | "negative-alert" | "negative-block" | "attention-alert" | "neutral-information" | "neutral-operation" | "neutral-cross";
|
|
4
|
+
type StatusBadgeSizes = 16 | 20 | 24 | 32 | 40;
|
|
5
|
+
type StatusBadgeIcon = React.FC<React.SVGProps<SVGSVGElement>>;
|
|
6
|
+
type StatusBadgeCustomIcon = Partial<Record<StatusBadgeViews, Partial<Record<StatusBadgeSizes, StatusBadgeIcon>>>>;
|
|
7
|
+
type StatusBadgeProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Дополнительный класс
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Размер компонента
|
|
14
|
+
* @default 24
|
|
15
|
+
*/
|
|
16
|
+
size?: StatusBadgeSizes;
|
|
17
|
+
/**
|
|
18
|
+
* Набор цветов для компонента
|
|
19
|
+
*/
|
|
20
|
+
colors?: "default" | "inverted";
|
|
21
|
+
/**
|
|
22
|
+
* Вид бейджа.
|
|
23
|
+
*/
|
|
24
|
+
view: StatusBadgeViews;
|
|
25
|
+
/**
|
|
26
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
27
|
+
*/
|
|
28
|
+
dataTestId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Кастомные иконки
|
|
31
|
+
*/
|
|
32
|
+
customIcons?: StatusBadgeCustomIcon;
|
|
33
|
+
};
|
|
34
|
+
declare const StatusBadge: ({ className, dataTestId, size, view, colors, customIcons }: StatusBadgeProps) => React.JSX.Element;
|
|
35
|
+
declare const useStatusBadgeIcon: (view: StatusBadgeViews, size: StatusBadgeSizes, customIcons?: StatusBadgeCustomIcon) => {
|
|
36
|
+
Icon: StatusBadgeIcon;
|
|
37
|
+
};
|
|
38
|
+
export { StatusBadgeProps, StatusBadge, useStatusBadgeIcon, StatusBadgeViews, StatusBadgeSizes, StatusBadgeIcon, StatusBadgeCustomIcon };
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react-transition-group" />
|
|
3
|
+
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { ComponentType, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref, FC } from "react";
|
|
6
|
+
import { TransitionProps } from "react-transition-group/Transition";
|
|
7
|
+
import { BackdropProps } from "./index-ebda875c";
|
|
8
|
+
type PortalProps = {
|
|
9
|
+
/** Контент */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Функция, возвращающая контейнер, в который будут рендериться дочерние элементы
|
|
13
|
+
*/
|
|
14
|
+
getPortalContainer?: () => Element;
|
|
15
|
+
/**
|
|
16
|
+
* Немедленно отрендерить дочерние элементы (false - контент будет отрендерен на след. рендер).
|
|
17
|
+
*/
|
|
18
|
+
immediateMount?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type BaseModalProps = {
|
|
21
|
+
/**
|
|
22
|
+
* Контент
|
|
23
|
+
*/
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Компонент бэкдропа
|
|
27
|
+
*/
|
|
28
|
+
Backdrop?: ComponentType<BackdropProps>;
|
|
29
|
+
/**
|
|
30
|
+
* Свойства для Бэкдропа
|
|
31
|
+
*/
|
|
32
|
+
backdropProps?: Partial<BackdropProps> & Record<string, unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* Нода, компонент или функция возвращающая их
|
|
35
|
+
*
|
|
36
|
+
* Контейнер к которому будут добавляться порталы
|
|
37
|
+
*/
|
|
38
|
+
container?: PortalProps["getPortalContainer"];
|
|
39
|
+
/**
|
|
40
|
+
* Отключает автоматический перевод фокуса на модалку при открытии
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
disableAutoFocus?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Отключает ловушку фокуса
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
disableFocusLock?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Отключает восстановление фокуса на предыдущем элементе после закрытия модалки
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
disableRestoreFocus?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Отключает вызов `callback` при нажатии Escape
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
disableEscapeKeyDown?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Отключает вызов `callback` при клике на бэкдроп
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
disableBackdropClick?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Отключает блокировку скролла при открытии модального окна
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
disableBlockingScroll?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Содержимое модалки всегда в DOM
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
keepMounted?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Управление видимостью модалки
|
|
76
|
+
*/
|
|
77
|
+
open: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Дополнительный класс
|
|
80
|
+
*/
|
|
81
|
+
className?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Дополнительный класс
|
|
84
|
+
*/
|
|
85
|
+
contentClassName?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Дополнительные пропсы на dialog wrapper
|
|
88
|
+
*/
|
|
89
|
+
wrapperProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
90
|
+
/**
|
|
91
|
+
* Дополнительные пропсы на обертку контента
|
|
92
|
+
*/
|
|
93
|
+
contentProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
94
|
+
/**
|
|
95
|
+
* Дополнительные пропсы на компонентную обертку контента
|
|
96
|
+
*/
|
|
97
|
+
componentDivProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
98
|
+
/**
|
|
99
|
+
* Дополнительный класс для обертки (Modal)
|
|
100
|
+
*/
|
|
101
|
+
wrapperClassName?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Обработчик скролла контента
|
|
104
|
+
*/
|
|
105
|
+
scrollHandler?: "wrapper" | "content" | MutableRefObject<HTMLDivElement | null>;
|
|
106
|
+
/**
|
|
107
|
+
* Пропсы для анимации (CSSTransition)
|
|
108
|
+
*/
|
|
109
|
+
transitionProps?: Partial<TransitionProps>;
|
|
110
|
+
/**
|
|
111
|
+
* Рендерить ли в контейнер через портал.
|
|
112
|
+
* @default true
|
|
113
|
+
*/
|
|
114
|
+
usePortal?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Обработчик события нажатия на бэкдроп
|
|
117
|
+
*/
|
|
118
|
+
onBackdropClick?: (event: MouseEvent) => void;
|
|
119
|
+
/**
|
|
120
|
+
* Обработчик события нажатия на Escape
|
|
121
|
+
*
|
|
122
|
+
* Если `disableEscapeKeyDown` - false и модальное окно в фокусе
|
|
123
|
+
*/
|
|
124
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
125
|
+
/**
|
|
126
|
+
* Обработчик закрытия
|
|
127
|
+
*/
|
|
128
|
+
onClose?: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
|
|
129
|
+
/**
|
|
130
|
+
* Обработчик события onEntered компонента Transition
|
|
131
|
+
*/
|
|
132
|
+
onMount?: () => void;
|
|
133
|
+
/**
|
|
134
|
+
* Обработчик события onExited компонента Transition
|
|
135
|
+
*/
|
|
136
|
+
onUnmount?: () => void;
|
|
137
|
+
/**
|
|
138
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
139
|
+
*/
|
|
140
|
+
dataTestId?: string;
|
|
141
|
+
/**
|
|
142
|
+
* z-index компонента
|
|
143
|
+
*/
|
|
144
|
+
zIndex?: number;
|
|
145
|
+
/**
|
|
146
|
+
* Реф, который должен быть установлен компонентной области
|
|
147
|
+
*/
|
|
148
|
+
componentRef?: MutableRefObject<HTMLDivElement | null>;
|
|
149
|
+
/**
|
|
150
|
+
* Блокирует скролл когда модальное окно открыто. Работает только на iOS.
|
|
151
|
+
*/
|
|
152
|
+
iOSLock?: boolean;
|
|
153
|
+
};
|
|
154
|
+
type BaseModalContext = {
|
|
155
|
+
parentRef: React.RefObject<HTMLDivElement>;
|
|
156
|
+
componentRef: React.RefObject<HTMLDivElement>;
|
|
157
|
+
hasFooter?: boolean;
|
|
158
|
+
hasHeader?: boolean;
|
|
159
|
+
hasScroll?: boolean;
|
|
160
|
+
headerHighlighted?: boolean;
|
|
161
|
+
footerHighlighted?: boolean;
|
|
162
|
+
headerOffset?: number;
|
|
163
|
+
setHeaderOffset: (offset: number) => void;
|
|
164
|
+
contentRef: Ref<HTMLElement>;
|
|
165
|
+
setHasHeader: (exists: boolean) => void;
|
|
166
|
+
setHasFooter: (exists: boolean) => void;
|
|
167
|
+
onClose: Required<BaseModalProps>["onClose"];
|
|
168
|
+
};
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
170
|
+
declare const BaseModalContext: React.Context<BaseModalContext>;
|
|
171
|
+
declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
172
|
+
declare function isScrolledToTop(target: HTMLElement): boolean;
|
|
173
|
+
declare function isScrolledToBottom(target: HTMLElement): boolean;
|
|
174
|
+
declare function hasScrollbar(target: HTMLElement): boolean;
|
|
175
|
+
declare const restoreContainerStyles: (container: HTMLElement) => void;
|
|
176
|
+
declare const handleContainer: (container?: HTMLElement, shouldIOSLock?: boolean) => void;
|
|
177
|
+
declare const lockScroll: () => void;
|
|
178
|
+
declare const unlockScroll: () => void;
|
|
179
|
+
declare const syncHeight: () => void;
|
|
180
|
+
type StackProps = {
|
|
181
|
+
/**
|
|
182
|
+
* Render prop, в который передается функция.
|
|
183
|
+
* Функция принимает аргумент со значением z-index из текущего контекста.
|
|
184
|
+
*/
|
|
185
|
+
children: (value: number) => ReactNode;
|
|
186
|
+
/**
|
|
187
|
+
* Исходное значение для z-index.
|
|
188
|
+
* @default 5
|
|
189
|
+
*/
|
|
190
|
+
value?: number;
|
|
191
|
+
};
|
|
192
|
+
declare const Stack: FC<StackProps>;
|
|
193
|
+
type SavedStyle = {
|
|
194
|
+
value: string;
|
|
195
|
+
key: string;
|
|
196
|
+
el: HTMLElement;
|
|
197
|
+
};
|
|
198
|
+
type RestoreStyle = {
|
|
199
|
+
container: HTMLElement;
|
|
200
|
+
modals: number;
|
|
201
|
+
styles: SavedStyle[];
|
|
202
|
+
};
|
|
203
|
+
declare class ModalStore {
|
|
204
|
+
private readonly restoreStyles;
|
|
205
|
+
constructor();
|
|
206
|
+
getRestoreStyles: () => RestoreStyle[];
|
|
207
|
+
}
|
|
208
|
+
declare const getModalStore: () => ModalStore;
|
|
209
|
+
declare class GlobalStore {
|
|
210
|
+
private readonly modalStore;
|
|
211
|
+
constructor();
|
|
212
|
+
getModalStore: () => ModalStore;
|
|
213
|
+
}
|
|
214
|
+
export { BaseModalProps, BaseModalContext, BaseModal, isScrolledToTop, isScrolledToBottom, hasScrollbar, restoreContainerStyles, handleContainer, lockScroll, unlockScroll, syncHeight, StackProps, Stack, getModalStore, GlobalStore };
|
|
215
|
+
export type { SavedStyle };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare const TitleMobile: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"> & {
|
|
4
|
+
tag: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
|
+
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
|
|
6
|
+
color?: "link" | "accent" | "primary" | "primary-inverted" | "secondary" | "secondary-inverted" | "tertiary" | "tertiary-inverted" | "attention" | "positive" | "negative" | "static-accent" | "disabled" | "static-primary-light" | "static-secondary-light" | "static-tertiary-light" | "static-primary-dark" | "static-secondary-dark" | "static-tertiary-dark" | undefined;
|
|
7
|
+
weight?: "bold" | "regular" | "medium" | "semibold" | undefined;
|
|
8
|
+
font?: "styrene" | "system" | undefined;
|
|
9
|
+
defaultMargins?: boolean | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
dataTestId?: string | undefined;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
rowLimit?: 1 | 2 | 3 | undefined;
|
|
14
|
+
showSkeleton?: boolean | undefined;
|
|
15
|
+
skeletonProps?: import("./types-1328ead9").TextSkeletonProps | undefined;
|
|
16
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement | HTMLHeadingElement>>;
|
|
18
|
+
export { TitleMobile };
|
|
19
|
+
export type { TitleProps as TitleMobileProps } from "./component-eb15729d";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PaddingType } from "./index-064acd29";
|
|
4
|
+
/* eslint-disable no-plusplus, no-param-reassign */
|
|
5
|
+
import { MaskitoPlugin, MaskitoPostprocessor, MaskitoPreprocessor } from "@maskito/core";
|
|
6
|
+
import { useCustomWebkitScrollbar } from "./useCustomWebkitScrollbar-a216f694";
|
|
7
|
+
declare const isClient: () => boolean;
|
|
8
|
+
declare function isApplePlatform(): boolean;
|
|
9
|
+
declare function isIOS(): boolean;
|
|
10
|
+
declare const os: {
|
|
11
|
+
isIOS: typeof isIOS;
|
|
12
|
+
isApplePlatform: typeof isApplePlatform;
|
|
13
|
+
};
|
|
14
|
+
declare function getDataTestId(dataTestId: string, element: string): string;
|
|
15
|
+
declare function getDataTestId(dataTestId?: string, element?: string): string | undefined;
|
|
16
|
+
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
17
|
+
declare function easeInOutQuad(x: number): number;
|
|
18
|
+
declare const easingFns: {
|
|
19
|
+
easeInOutQuad: typeof easeInOutQuad;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Запрещает каретке становиться за указанные границы
|
|
23
|
+
*/
|
|
24
|
+
declare function caretGuard(guard: (value: string, selection: readonly [
|
|
25
|
+
from: number,
|
|
26
|
+
to: number
|
|
27
|
+
]) => [
|
|
28
|
+
from: number,
|
|
29
|
+
to: number
|
|
30
|
+
]): MaskitoPlugin;
|
|
31
|
+
/**
|
|
32
|
+
* Запрещает удалять указанный префикс
|
|
33
|
+
*/
|
|
34
|
+
declare function prefixPostprocessor(prefix: string): MaskitoPostprocessor;
|
|
35
|
+
/**
|
|
36
|
+
* Препроцессор необходим для правильной вставки/автокомплита телефонного номера
|
|
37
|
+
*/
|
|
38
|
+
declare function insertionPhonePreprocessor(mask: Array<string | RegExp>, countryCode: string | undefined, clearableCountryCode: boolean | undefined): MaskitoPreprocessor;
|
|
39
|
+
/**
|
|
40
|
+
* Препроцессор необходим для сохранения кода страны при автозаполнении
|
|
41
|
+
*/
|
|
42
|
+
declare function preserveCountryCodePreprocessor(countryCode: string | undefined, preserveCountryCode: boolean): MaskitoPreprocessor;
|
|
43
|
+
declare const maskUtils: {
|
|
44
|
+
insertionPhonePreprocessor: typeof insertionPhonePreprocessor;
|
|
45
|
+
prefixPostprocessor: typeof prefixPostprocessor;
|
|
46
|
+
caretGuard: typeof caretGuard;
|
|
47
|
+
preserveCountryCodePreprocessor: typeof preserveCountryCodePreprocessor;
|
|
48
|
+
};
|
|
49
|
+
declare const hooks: {
|
|
50
|
+
useCustomWebkitScrollbar: typeof useCustomWebkitScrollbar;
|
|
51
|
+
};
|
|
52
|
+
declare function preventDefault(e: React.UIEvent): void;
|
|
53
|
+
declare const dom: {
|
|
54
|
+
preventDefault: typeof preventDefault;
|
|
55
|
+
};
|
|
56
|
+
declare const exhaustiveCheck: (value: never) => never;
|
|
57
|
+
type PortalContextType = () => Element | null;
|
|
58
|
+
declare const PortalContext: import("react").Context<PortalContextType>;
|
|
59
|
+
export { isClient, os, getDataTestId, createPaddingStyle, easingFns, maskUtils, hooks, dom, exhaustiveCheck, PortalContext };
|
|
60
|
+
export { useIsMounted } from "./useIsMounted-e793ac44";
|
|
61
|
+
export * from "./fnUtils-e793ac44";
|
|
62
|
+
export * from "./browser-a216f694";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
type MqProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
5
|
+
*/
|
|
6
|
+
query?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Запрос на поддержку тач-событий
|
|
9
|
+
*/
|
|
10
|
+
touch?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
13
|
+
*/
|
|
14
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
15
|
+
/**
|
|
16
|
+
* Дочерние элементы.
|
|
17
|
+
*/
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Обработчик изменений в совпадении запросов
|
|
21
|
+
*/
|
|
22
|
+
onMatchChange?: (isMatched: boolean) => void;
|
|
23
|
+
};
|
|
24
|
+
declare const Mq: FC<MqProps>;
|
|
25
|
+
/**
|
|
26
|
+
* Хук для медиа запросов.
|
|
27
|
+
* @param query media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
28
|
+
* @param defaultValue Значение по-умолчанию.
|
|
29
|
+
*/
|
|
30
|
+
declare const useMatchMedia: (query: string, defaultValue?: boolean | (() => boolean)) => boolean[];
|
|
31
|
+
/**
|
|
32
|
+
* Возвращает MediaQueryList для заданного media-выражения.
|
|
33
|
+
*
|
|
34
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
35
|
+
*/
|
|
36
|
+
declare function getMatchMedia(queryProp: string): MediaQueryList;
|
|
37
|
+
/**
|
|
38
|
+
* Удаляет MediaQueryList.
|
|
39
|
+
*
|
|
40
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
41
|
+
*/
|
|
42
|
+
declare function releaseMatchMedia(queryProp: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Возвращает `true`, если есть поддержка `Pointer Events`
|
|
45
|
+
*/
|
|
46
|
+
declare function isPointerEventsSupported(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Возвращает `true`, если есть поддержка `Touch Events`
|
|
49
|
+
*/
|
|
50
|
+
declare function isTouchSupported(): boolean;
|
|
51
|
+
declare const _exports: {
|
|
52
|
+
"--mobile-xs": string;
|
|
53
|
+
"--mobile-s": string;
|
|
54
|
+
"--mobile-m": string;
|
|
55
|
+
"--mobile-l": string;
|
|
56
|
+
"--mobile": string;
|
|
57
|
+
"--tablet-s": string;
|
|
58
|
+
"--tablet-m": string;
|
|
59
|
+
"--tablet": string;
|
|
60
|
+
"--desktop-s": string;
|
|
61
|
+
"--desktop-m": string;
|
|
62
|
+
"--desktop-l": string;
|
|
63
|
+
"--desktop-xl": string;
|
|
64
|
+
"--desktop": string;
|
|
65
|
+
};
|
|
66
|
+
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlProps = Omit<BaseFormControlProps, "styles" | "colorStyles"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
7
|
+
* @default 1024
|
|
8
|
+
*/
|
|
9
|
+
breakpoint?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
12
|
+
*/
|
|
13
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
14
|
+
};
|
|
15
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<BaseFormControlProps, "styles" | "colorStyles"> & {
|
|
16
|
+
breakpoint?: number | undefined;
|
|
17
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
18
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export { FormControlProps, FormControl };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./use-skeleton-1328ead9";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PickerButtonResponsive as PickerButton } from './Component.responsive.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
.container {
|
|
4
|
+
min-width: auto;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:global(.cc-picker-button).optionsPopover.sideGap {
|
|
8
|
+
padding: var(--gap-0) var(--gap-8);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:global(.cc-picker-button) .option {
|
|
12
|
+
padding: var(--gap-0) var(--gap-16)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:global(.cc-picker-button) .option:before {
|
|
16
|
+
/* Удаляем разделители у опций выпадающего списка. */
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AdditionalMobileProps, BottomSheetSelectMobileProps } from "@alfalab/core-components-select/shared";
|
|
4
|
+
import { PickerButtonDesktopProps } from "../desktop/index";
|
|
5
|
+
type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
6
|
+
/**
|
|
7
|
+
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
8
|
+
* @default 1024
|
|
9
|
+
*/
|
|
10
|
+
breakpoint?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const PickerButtonMobile: React.ForwardRefExoticComponent<Omit<PickerButtonDesktopProps, "onScroll" | "Checkmark" | "OptionsList"> & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
13
|
+
/**
|
|
14
|
+
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
15
|
+
* @default 1024
|
|
16
|
+
*/
|
|
17
|
+
breakpoint?: number | undefined;
|
|
18
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
19
|
+
export { PickerButtonMobileProps, PickerButtonMobile };
|