@scbt-ecom/ui 0.0.18 → 0.0.22
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/dist/shared/constants/designSystem/others.d.ts +9 -1
- package/dist/shared/ui/ButtonIcon.d.ts +2 -2
- package/dist/shared/ui/CustomLink.d.ts +2 -2
- package/dist/shared/ui/Document.d.ts +13 -0
- package/dist/shared/ui/Loader.d.ts +13 -4
- package/dist/shared/ui/PhoneView.d.ts +8 -1
- package/dist/shared/ui/ProgressBar.d.ts +18 -0
- package/dist/shared/ui/Skeleton.d.ts +4 -0
- package/dist/shared/ui/TabsSwitcher.d.ts +33 -0
- package/dist/shared/ui/accordion/Accordion.d.ts +11 -5
- package/dist/shared/ui/accordion/model/types.d.ts +7 -6
- package/dist/shared/ui/accordion/ui/AccordionHeader.d.ts +5 -5
- package/dist/shared/ui/formControlElements/CheckboxControl.d.ts +3 -1
- package/dist/shared/ui/formControlElements/InputControl.d.ts +3 -3
- package/dist/shared/ui/formControlElements/InputControlMask.d.ts +3 -3
- package/dist/shared/ui/formControlElements/SelectControl.d.ts +27 -0
- package/dist/shared/ui/formControlElements/SwitchControl.d.ts +16 -0
- package/dist/shared/ui/formControlElements/TextareaControl.d.ts +11 -0
- package/dist/shared/ui/formControlElements/calendar/CalendarControl.d.ts +20 -0
- package/dist/shared/ui/formControlElements/calendar/index.d.ts +1 -0
- package/dist/shared/ui/formControlElements/calendar/model/animation.d.ts +18 -0
- package/dist/shared/ui/formControlElements/calendar/model/classes.d.ts +24 -0
- package/dist/shared/ui/formControlElements/calendar/model/helpers.d.ts +9 -0
- package/dist/shared/ui/formControlElements/calendar/model/hooks/index.d.ts +2 -0
- package/dist/shared/ui/formControlElements/calendar/model/hooks/useCalendarDropdowns.d.ts +9 -0
- package/dist/shared/ui/formControlElements/calendar/model/hooks/useDatePicker.d.ts +18 -0
- package/dist/shared/ui/formControlElements/calendar/ui/CalendarHeader.d.ts +15 -0
- package/dist/shared/ui/formControlElements/calendar/ui/Dropdown.d.ts +10 -0
- package/dist/shared/ui/formControlElements/calendar/ui/NavigationArrows.d.ts +5 -0
- package/dist/shared/ui/formControlElements/calendar/ui/Weekdays.d.ts +1 -0
- package/dist/shared/ui/formControlElements/calendar/ui/index.d.ts +2 -0
- package/dist/shared/ui/formControlElements/dadata/DadataInputControl.d.ts +3 -3
- package/dist/shared/ui/formControlElements/index.d.ts +5 -1
- package/dist/shared/ui/formControlElements/model/props-types.d.ts +7 -5
- package/dist/shared/ui/formControlElements/ui/FieldAttachment.d.ts +5 -1
- package/dist/shared/ui/formControlElements/ui/FieldContainer.d.ts +2 -1
- package/dist/shared/ui/formControlElements/ui/FieldWrapper.d.ts +2 -1
- package/dist/shared/ui/icon/Icon.d.ts +2 -2
- package/dist/shared/ui/icon/index.d.ts +1 -1
- package/dist/shared/ui/icon/sprite.gen.d.ts +4 -1
- package/dist/shared/ui/index.d.ts +7 -2
- package/dist/shared/ui/table/Table.d.ts +17 -0
- package/dist/shared/ui/table/index.d.ts +1 -0
- package/dist/shared/ui/table/type.d.ts +21 -0
- package/dist/shared/validation/messages.d.ts +2 -0
- package/dist/sprites/arrows.svg +1 -0
- package/dist/sprites/common.svg +1 -0
- package/dist/sprites/files.svg +1 -0
- package/dist/sprites/general.svg +1 -0
- package/dist/sprites/info.svg +1 -0
- package/dist/style.css +1 -1
- package/dist/ui.es.js +30959 -21689
- package/dist/ui.umd.js +109 -100
- package/dist/widgets/banner/Banner.d.ts +16 -1
- package/dist/widgets/banner/ui/BannerButtonsGroup.d.ts +7 -1
- package/dist/widgets/index.d.ts +1 -1
- package/dist/widgets/pageHeader/PageHeader.d.ts +2 -2
- package/dist/widgets/pageHeader/index.d.ts +1 -1
- package/package.json +9 -5
- package/dist/shared/utils/capitalize.test.d.ts +0 -1
- package/dist/sprites/common.5922c9ad.svg +0 -1
- package/public/sprites/brandLogos.aa92281d.svg +0 -1
- package/public/sprites/common.5922c9ad.svg +0 -1
- /package/dist/sprites/{brandLogos.aa92281d.svg → brandLogos.svg} +0 -0
|
@@ -5,4 +5,12 @@ declare const allowedBorderRadius: {
|
|
|
5
5
|
lg: string;
|
|
6
6
|
full: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
declare const allowedBackgroundDeg: {
|
|
9
|
+
30: string;
|
|
10
|
+
45: string;
|
|
11
|
+
80: string;
|
|
12
|
+
90: string;
|
|
13
|
+
110: string;
|
|
14
|
+
180: string;
|
|
15
|
+
};
|
|
16
|
+
export { allowedBorderRadius, allowedBackgroundDeg };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
type
|
|
3
|
+
type TButtonClasses = {
|
|
4
4
|
button: string;
|
|
5
5
|
icon: string;
|
|
6
6
|
};
|
|
@@ -11,7 +11,7 @@ declare const buttonConfig: (props?: ({
|
|
|
11
11
|
type TButtonProps = VariantProps<typeof buttonConfig>;
|
|
12
12
|
export interface IButtonIconProps extends ComponentProps<'button'>, TButtonProps {
|
|
13
13
|
children: ReactElement;
|
|
14
|
-
classes?: Partial<
|
|
14
|
+
classes?: Partial<TButtonClasses>;
|
|
15
15
|
}
|
|
16
16
|
export declare const ButtonIcon: import('react').ForwardRefExoticComponent<Omit<IButtonIconProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
17
17
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import {
|
|
3
|
+
import { TAllowedIcons } from './icon/Icon';
|
|
4
4
|
declare const customLinkConfig: (props?: ({
|
|
5
5
|
intent?: "white" | "blue" | null | undefined;
|
|
6
6
|
withIcon?: boolean | null | undefined;
|
|
@@ -9,7 +9,7 @@ declare const customLinkConfig: (props?: ({
|
|
|
9
9
|
type TCustomLinkConfig = VariantProps<typeof customLinkConfig>;
|
|
10
10
|
export interface ICustomLinkProps extends TCustomLinkConfig, ComponentProps<'a'> {
|
|
11
11
|
Component: 'a';
|
|
12
|
-
icon?:
|
|
12
|
+
icon?: TAllowedIcons;
|
|
13
13
|
}
|
|
14
14
|
export declare const CustomLink: ({ Component, intent, children, withIcon, disabled, icon, ...props }: ICustomLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const iconConfig: (props?: ({
|
|
3
|
+
intent?: "outline" | "filled" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
type TIconConfig = VariantProps<typeof iconConfig>;
|
|
6
|
+
export interface IDocumentProps extends TIconConfig {
|
|
7
|
+
text: string;
|
|
8
|
+
size: number;
|
|
9
|
+
sizeType: 'КБ' | 'МБ';
|
|
10
|
+
href: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Document: ({ text, size, sizeType, href, intent }: IDocumentProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { HTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const wrapperConfig: (props?: ({
|
|
4
|
+
position?: "fixed" | "absolute" | "static" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
3
6
|
declare const loaderConfig: (props?: ({
|
|
4
7
|
intent?: "primary" | "secondary" | null | undefined;
|
|
5
8
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
-
position?: "fixed" | "absolute" | "static" | null | undefined;
|
|
7
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
-
|
|
10
|
+
type ILoaderClasses = {
|
|
11
|
+
wrapper: string;
|
|
12
|
+
loader: string;
|
|
13
|
+
text: string;
|
|
14
|
+
};
|
|
15
|
+
export interface ILoaderProps extends VariantProps<typeof loaderConfig>, VariantProps<typeof wrapperConfig>, HTMLAttributes<HTMLDivElement> {
|
|
9
16
|
intent?: 'primary' | 'secondary';
|
|
17
|
+
text?: ReactElement | string;
|
|
18
|
+
classes?: Partial<ILoaderClasses>;
|
|
10
19
|
}
|
|
11
|
-
export declare const Loader: ({ size,
|
|
20
|
+
export declare const Loader: ({ size, classes, intent, position, text, ...props }: ILoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
21
|
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
interface IPhoneViewClasses {
|
|
2
|
+
wrapper: string;
|
|
3
|
+
link: string;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
1
6
|
export interface IPhoneViewProps {
|
|
2
7
|
phone: string;
|
|
3
8
|
text: string;
|
|
9
|
+
classes?: Partial<IPhoneViewClasses>;
|
|
4
10
|
}
|
|
5
|
-
export declare const PhoneView: ({ phone, text }: IPhoneViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const PhoneView: ({ phone, text, classes }: IPhoneViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
type IProgressBarClasses = {
|
|
3
|
+
wrapper: string;
|
|
4
|
+
topContent: string;
|
|
5
|
+
bottomContent: string;
|
|
6
|
+
progressBar: string;
|
|
7
|
+
progress: string;
|
|
8
|
+
loader: string;
|
|
9
|
+
};
|
|
10
|
+
export interface IProgressBarProps {
|
|
11
|
+
topContent?: ReactElement;
|
|
12
|
+
bottomContent?: ReactElement;
|
|
13
|
+
progress: number;
|
|
14
|
+
maxPercent?: number;
|
|
15
|
+
classes?: Partial<IProgressBarClasses>;
|
|
16
|
+
}
|
|
17
|
+
export declare const ProgressBar: ({ topContent, bottomContent, progress, maxPercent, classes }: IProgressBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} id - для триггера и для контента должен совпадать
|
|
4
|
+
*/
|
|
5
|
+
interface ITabsClasses {
|
|
6
|
+
root: string;
|
|
7
|
+
list: string;
|
|
8
|
+
trigger: string;
|
|
9
|
+
content: string;
|
|
10
|
+
contentsWrapper: string;
|
|
11
|
+
}
|
|
12
|
+
interface ITabContent {
|
|
13
|
+
id: string;
|
|
14
|
+
body: ReactElement | string;
|
|
15
|
+
accordion?: {
|
|
16
|
+
title: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
interface ITabTrigger {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ITabRenderContent {
|
|
24
|
+
triggers: ITabTrigger[];
|
|
25
|
+
contents: ITabContent[];
|
|
26
|
+
}
|
|
27
|
+
export interface ITabsSwitcherProps {
|
|
28
|
+
renderContent: ITabRenderContent;
|
|
29
|
+
defaultActiveTabId?: string;
|
|
30
|
+
classes?: Partial<ITabsClasses>;
|
|
31
|
+
}
|
|
32
|
+
export declare const TabsSwitcher: ({ renderContent, defaultActiveTabId, classes }: ITabsSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TAccordionHeaderClasses, TAccordionRootClasses } from './model/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* @param {string[]} defaultOpen - По умолчанию открытые аккордеоны необходимо указать тот же label явно руками.
|
|
5
|
+
* Пример defaultValue={['Заголовок аккордеона 1', 'Заголовок аккордеона 2']}
|
|
6
|
+
*/
|
|
2
7
|
export interface IAccordionProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
label: string | React.ReactElement;
|
|
10
|
+
classes?: Partial<TAccordionHeaderClasses> & Partial<TAccordionRootClasses>;
|
|
11
|
+
defaultOpen?: string[];
|
|
6
12
|
}
|
|
7
|
-
export declare const Accordion: ({
|
|
13
|
+
export declare const Accordion: ({ children, label, classes, defaultOpen }: IAccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export type TAccordionHeaderClasses = {
|
|
3
3
|
trigger: string;
|
|
4
4
|
icon: string;
|
|
5
5
|
header: string;
|
|
6
6
|
inner: string;
|
|
7
|
-
}
|
|
8
|
-
export
|
|
7
|
+
};
|
|
8
|
+
export type TAccordionRootClasses = {
|
|
9
9
|
item: string;
|
|
10
10
|
content: string;
|
|
11
|
+
contentInner: string;
|
|
11
12
|
accordion: string;
|
|
12
|
-
}
|
|
13
|
+
};
|
|
13
14
|
export interface IAccordionItem {
|
|
14
15
|
label: string;
|
|
15
|
-
content: ReactNode;
|
|
16
|
+
content: React.ReactNode;
|
|
16
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { TAccordionHeaderClasses } from '../model/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
interface IAccordionHeaderProps {
|
|
4
|
-
children?: ReactElement | string;
|
|
5
|
-
classes?: Partial<
|
|
4
|
+
children?: React.ReactElement | string;
|
|
5
|
+
classes?: Partial<TAccordionHeaderClasses>;
|
|
6
6
|
}
|
|
7
|
-
export declare const AccordionHeader:
|
|
7
|
+
export declare const AccordionHeader: React.ForwardRefExoticComponent<IAccordionHeaderProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
1
2
|
import { FieldValues } from 'react-hook-form';
|
|
2
3
|
import { TAdditionalInputPrimitiveClasses, TControlledInputPrimitiveProps } from './model';
|
|
3
4
|
type TCheckboxClasses = Partial<TAdditionalInputPrimitiveClasses> & {
|
|
4
5
|
wrapper?: string;
|
|
5
6
|
indicator?: string;
|
|
6
7
|
};
|
|
7
|
-
export interface ICheckboxControlProps<T extends FieldValues> extends TControlledInputPrimitiveProps<T> {
|
|
8
|
+
export interface ICheckboxControlProps<T extends FieldValues> extends Omit<TControlledInputPrimitiveProps<T>, 'label'> {
|
|
8
9
|
classes?: TCheckboxClasses;
|
|
10
|
+
label: ReactElement | string;
|
|
9
11
|
}
|
|
10
12
|
export declare const CheckboxControl: <T extends FieldValues>({ control, helperText, label, disabled, classes, ...props }: ICheckboxControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
-
import { TAdditionalInputClassesWithAttachment, TControlledInputProps } from './model';
|
|
3
|
-
export interface InputControlProps<T extends FieldValues> extends TControlledInputProps<T
|
|
2
|
+
import { TAdditionalInputClassesWithAttachment, TControlledInputProps, TInputCommonProps } from './model';
|
|
3
|
+
export interface InputControlProps<T extends FieldValues> extends TControlledInputProps<T>, TInputCommonProps {
|
|
4
4
|
classes?: Partial<TAdditionalInputClassesWithAttachment>;
|
|
5
5
|
}
|
|
6
|
-
export declare const InputControl: <T extends FieldValues>({ label, size, helperText, control, classes, badge, icon, disabled, ...props }: InputControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const InputControl: <T extends FieldValues>({ label, size, helperText, control, classes, badge, icon, swapPosition, disabled, ...props }: InputControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
-
import { TAdditionalInputClassesWithAttachment, TControlledInputProps } from './model';
|
|
3
|
-
export interface InputControlMaskProps<T extends FieldValues> extends TControlledInputProps<T
|
|
2
|
+
import { TAdditionalInputClassesWithAttachment, TControlledInputProps, TInputCommonProps } from './model';
|
|
3
|
+
export interface InputControlMaskProps<T extends FieldValues> extends TControlledInputProps<T>, TInputCommonProps {
|
|
4
4
|
format: string;
|
|
5
5
|
mask?: string | string[];
|
|
6
6
|
allowEmptyFormatting?: boolean;
|
|
7
7
|
onInputChange?: (arg?: string) => void;
|
|
8
8
|
classes?: Partial<TAdditionalInputClassesWithAttachment>;
|
|
9
9
|
}
|
|
10
|
-
export declare const InputControlMask: <T extends FieldValues>({ format, allowEmptyFormatting, mask, control, onInputChange, size, helperText, label, classes, disabled, badge, icon, ...props }: InputControlMaskProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const InputControlMask: <T extends FieldValues>({ format, allowEmptyFormatting, mask, control, onInputChange, size, helperText, label, classes, disabled, badge, icon, swapPosition, ...props }: InputControlMaskProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { TControlledInputProps } from './model';
|
|
3
|
+
interface ISelectControlClasses {
|
|
4
|
+
trigger: string;
|
|
5
|
+
options: string;
|
|
6
|
+
scrollArea: string;
|
|
7
|
+
option: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
message: string;
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ISelectOption {
|
|
14
|
+
id: string;
|
|
15
|
+
optionValue: string;
|
|
16
|
+
isDisabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ISelectControlProps<T extends FieldValues> extends TControlledInputProps<T> {
|
|
19
|
+
classes?: Partial<ISelectControlClasses>;
|
|
20
|
+
optionsList: ISelectOption[];
|
|
21
|
+
label: string;
|
|
22
|
+
multiple?: boolean;
|
|
23
|
+
intent?: 'filled' | 'clear';
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const SelectControl: <T extends FieldValues>({ size, control, helperText, disabled, classes, optionsList, label, multiple, intent, ...props }: ISelectControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { TControlledInputPrimitiveProps } from './model';
|
|
3
|
+
interface ISwitchClasses {
|
|
4
|
+
wrapper: string;
|
|
5
|
+
input: string;
|
|
6
|
+
thumb: string;
|
|
7
|
+
textBlock: string;
|
|
8
|
+
label: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ISwitchControlProps<T extends FieldValues> extends TControlledInputPrimitiveProps<T> {
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
classes?: Partial<ISwitchClasses>;
|
|
14
|
+
}
|
|
15
|
+
export declare const SwitchControl: <T extends FieldValues>({ disabled, classes, control, helperText, label, ...props }: ISwitchControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { TAdditionalInputClassesWithAttachment, TControlledInputProps, TTextareaCommonProps } from './model';
|
|
3
|
+
type TTextareaClasses = Partial<TAdditionalInputClassesWithAttachment> & {
|
|
4
|
+
head: string;
|
|
5
|
+
scrollArea: string;
|
|
6
|
+
};
|
|
7
|
+
export interface ITextareaControlProps<T extends FieldValues> extends TControlledInputProps<T>, TTextareaCommonProps {
|
|
8
|
+
classes?: Partial<TTextareaClasses>;
|
|
9
|
+
}
|
|
10
|
+
export declare const TextareaControl: <T extends FieldValues>({ label, size, helperText, control, classes, badge, icon, swapPosition, disabled, placeholder, ...props }: ITextareaControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DayPickerProps, PropsRange, PropsSingle } from 'react-day-picker';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { TAdditionalInputClassesWithAttachment, TControlledInputProps } from '../model';
|
|
4
|
+
type TCalendarClasses = Partial<TAdditionalInputClassesWithAttachment> & {
|
|
5
|
+
root: string;
|
|
6
|
+
wrapper: string;
|
|
7
|
+
calendar: string;
|
|
8
|
+
};
|
|
9
|
+
export type TCalendarMode = 'range' | 'single';
|
|
10
|
+
type TCalendarCommonProps = PropsSingle | PropsRange;
|
|
11
|
+
export type ICalendarControlProps<T extends FieldValues> = TControlledInputProps<T> & TCalendarCommonProps & DayPickerProps & {
|
|
12
|
+
maskFormat?: string;
|
|
13
|
+
mask?: string | string[];
|
|
14
|
+
allowEmptyFormatting?: boolean;
|
|
15
|
+
classes?: Partial<TCalendarClasses>;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onClickIcon?: (...args: unknown[]) => unknown;
|
|
18
|
+
};
|
|
19
|
+
export declare const CalendarControl: <T extends FieldValues>(props: ICalendarControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CalendarControl, type ICalendarControlProps } from './CalendarControl';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const calendarAnimation: {
|
|
2
|
+
initial: {
|
|
3
|
+
opacity: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
animate: {
|
|
7
|
+
opacity: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
exit: {
|
|
11
|
+
opacity: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
transition: {
|
|
15
|
+
duration: number;
|
|
16
|
+
ease: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const dayPickerClasses: (isRange?: boolean) => {
|
|
2
|
+
weekday: string;
|
|
3
|
+
months: string;
|
|
4
|
+
month: string;
|
|
5
|
+
caption: string;
|
|
6
|
+
today: string;
|
|
7
|
+
outside: string;
|
|
8
|
+
disabled: string;
|
|
9
|
+
hidden: string;
|
|
10
|
+
selected: string;
|
|
11
|
+
range_middle: string;
|
|
12
|
+
range_end: string;
|
|
13
|
+
range_start: string;
|
|
14
|
+
day: string;
|
|
15
|
+
day_button: string;
|
|
16
|
+
nav: string;
|
|
17
|
+
nav_button: string;
|
|
18
|
+
nav_button_previous: string;
|
|
19
|
+
nav_button_next: string;
|
|
20
|
+
table: string;
|
|
21
|
+
head_row: string;
|
|
22
|
+
head_cell: string;
|
|
23
|
+
row: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const useCalendarDropdowns: () => {
|
|
2
|
+
calendarSetter: (val?: boolean) => void;
|
|
3
|
+
toggleCalendar: (onClickIcon?: (...args: unknown[]) => unknown) => void;
|
|
4
|
+
isMonthOpen: boolean;
|
|
5
|
+
toggleMonthDropdown: () => void;
|
|
6
|
+
isYearsOpen: boolean;
|
|
7
|
+
toggleYearDropdown: () => void;
|
|
8
|
+
isCalendarOpen: boolean;
|
|
9
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TCalendarMode } from '../../CalendarControl';
|
|
2
|
+
export type TControlledDate = {
|
|
3
|
+
day: number;
|
|
4
|
+
month: number;
|
|
5
|
+
year: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const useDatePicker: () => {
|
|
8
|
+
formattedControlledDate: Date;
|
|
9
|
+
controlledDate: TControlledDate;
|
|
10
|
+
setControlledDate: import('react').Dispatch<import('react').SetStateAction<TControlledDate>>;
|
|
11
|
+
onClickDay: (date: Date, onChange: (...event: unknown[]) => void, mode: TCalendarMode, closeCalendar: () => void) => void;
|
|
12
|
+
onChangeMonth: (date: Date, onChange: (...event: unknown[]) => void) => void;
|
|
13
|
+
onSelectMonth: (month: number, onChange: (...event: unknown[]) => void) => void;
|
|
14
|
+
onSelectYear: (year: number, onChange: (...event: unknown[]) => void) => void;
|
|
15
|
+
onBlurInput: (inputValue: string, onChange: (...event: unknown[]) => void) => void;
|
|
16
|
+
onClickPrev: (event: React.MouseEvent<HTMLButtonElement>, onPreviousClick?: React.MouseEventHandler<HTMLButtonElement>) => void;
|
|
17
|
+
onClickNext: (event: React.MouseEvent<HTMLButtonElement>, onNextClick?: React.MouseEventHandler<HTMLButtonElement>) => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NavProps } from 'react-day-picker';
|
|
2
|
+
import { TControlledDate } from '../model/hooks';
|
|
3
|
+
interface ICalendarHeaderProps extends NavProps {
|
|
4
|
+
controlledDate: TControlledDate;
|
|
5
|
+
isMonthOpen: boolean;
|
|
6
|
+
toggleMonthDropdown: () => void;
|
|
7
|
+
isYearsOpen: boolean;
|
|
8
|
+
toggleYearDropdown: () => void;
|
|
9
|
+
onSelectMonth: (month: number) => void;
|
|
10
|
+
onSelectYear: (year: number) => void;
|
|
11
|
+
onClickPrev: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
12
|
+
onClickNext: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const CalendarHeader: ({ onSelectMonth, onSelectYear, onClickPrev, onClickNext, controlledDate, isMonthOpen, toggleMonthDropdown, isYearsOpen, toggleYearDropdown }: ICalendarHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface IDropdownProps<Value extends string | number> {
|
|
2
|
+
options: Value[];
|
|
3
|
+
isActive: boolean;
|
|
4
|
+
selectedDate: Value;
|
|
5
|
+
onClickTrigger: () => void;
|
|
6
|
+
onClickOption: (value: number) => void;
|
|
7
|
+
variant?: 'months' | 'years';
|
|
8
|
+
}
|
|
9
|
+
export declare const Dropdown: <Value extends string | number>({ options, isActive, selectedDate, onClickTrigger, onClickOption, variant }: IDropdownProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Weekdays: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
-
import { TAdditionalInputClassesWithAttachment, TControlledInputProps } from '../model';
|
|
2
|
+
import { TAdditionalInputClassesWithAttachment, TControlledInputProps, TInputCommonProps } from '../model';
|
|
3
3
|
import { TDadataBaseUrl, TDadataType } from './model/types';
|
|
4
4
|
type TDadataClasses = Partial<TAdditionalInputClassesWithAttachment> & {
|
|
5
5
|
options?: string;
|
|
6
6
|
indentMargin?: string;
|
|
7
7
|
};
|
|
8
|
-
export interface IDadataInputControlProps<T extends FieldValues> extends TControlledInputProps<T
|
|
8
|
+
export interface IDadataInputControlProps<T extends FieldValues> extends TControlledInputProps<T>, TInputCommonProps {
|
|
9
9
|
classes?: TDadataClasses;
|
|
10
10
|
dadataType?: TDadataType;
|
|
11
11
|
dadataBaseUrl?: TDadataBaseUrl;
|
|
12
12
|
}
|
|
13
|
-
export declare const DadataInputControl: <T extends FieldValues>({ control, helperText, classes, size, label, disabled, dadataType, dadataBaseUrl, badge, icon, ...props }: IDadataInputControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const DadataInputControl: <T extends FieldValues>({ control, helperText, classes, size, label, disabled, dadataType, dadataBaseUrl, badge, icon, swapPosition, ...props }: IDadataInputControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -3,4 +3,8 @@ export { InputControlMask, type InputControlMaskProps } from './InputControlMask
|
|
|
3
3
|
export { FormControl } from './FormControl';
|
|
4
4
|
export { DadataInputControl, type IDadataInputControlProps } from './dadata';
|
|
5
5
|
export { CheckboxControl, type ICheckboxControlProps } from './CheckboxControl';
|
|
6
|
-
export { RadioControl, type IRadioControlProps } from './RadioControl';
|
|
6
|
+
export { RadioControl, type IRadioControlProps, type IRadioGroupOption } from './RadioControl';
|
|
7
|
+
export { SwitchControl, type ISwitchControlProps } from './SwitchControl';
|
|
8
|
+
export { SelectControl, type ISelectControlProps, type ISelectOption } from './SelectControl';
|
|
9
|
+
export { TextareaControl, type ITextareaControlProps } from './TextareaControl';
|
|
10
|
+
export { CalendarControl, type ICalendarControlProps } from './calendar';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ComponentProps, ReactElement } from 'react';
|
|
2
1
|
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
3
2
|
import { TFieldContainerConfig } from '../ui/FieldContainer';
|
|
4
|
-
type
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
export type TInputCommonProps = Omit<React.ComponentProps<'input'>, 'name' | 'placeholder' | 'size' | 'type' | 'defaultValue'>;
|
|
5
|
+
export type TTextareaCommonProps = Omit<React.ComponentProps<'textarea'>, 'name' | 'size' | 'type' | 'defaultValue'>;
|
|
5
6
|
type TFieldControlledProps<T extends FieldValues> = {
|
|
6
7
|
name: Path<T>;
|
|
7
8
|
control: Control<T>;
|
|
@@ -11,8 +12,9 @@ type TFieldControlledProps<T extends FieldValues> = {
|
|
|
11
12
|
export type TFieldContainerSize = 'sm' | 'md' | 'lg' | 'full';
|
|
12
13
|
export type TFieldAttachment = {
|
|
13
14
|
badge?: string;
|
|
14
|
-
icon?: ReactElement;
|
|
15
|
+
icon?: React.ReactElement;
|
|
16
|
+
swapPosition?: boolean;
|
|
15
17
|
};
|
|
16
|
-
export type TControlledInputProps<T extends FieldValues> = TFieldContainerConfig &
|
|
17
|
-
export type TControlledInputPrimitiveProps<T extends FieldValues> =
|
|
18
|
+
export type TControlledInputProps<T extends FieldValues> = TFieldContainerConfig & TFieldAttachment & TFieldControlledProps<T>;
|
|
19
|
+
export type TControlledInputPrimitiveProps<T extends FieldValues> = TInputCommonProps & TFieldControlledProps<T>;
|
|
18
20
|
export {};
|
|
@@ -3,6 +3,10 @@ import { TFieldAttachment } from '../model/props-types';
|
|
|
3
3
|
interface IFieldAttachmentProps extends TFieldAttachment {
|
|
4
4
|
classes?: Partial<TFieldAttachmentClasses>;
|
|
5
5
|
error?: boolean;
|
|
6
|
+
isTextarea?: boolean;
|
|
7
|
+
swapPosition?: boolean;
|
|
8
|
+
onClickIcon?: (...args: unknown[]) => unknown;
|
|
9
|
+
onKeyDownIcon?: (event: React.KeyboardEvent) => unknown;
|
|
6
10
|
}
|
|
7
|
-
export declare const FieldAttachment: ({ badge, icon, error, classes }: IFieldAttachmentProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const FieldAttachment: ({ badge, icon, error, isTextarea, classes, swapPosition, onClickIcon, onKeyDownIcon }: IFieldAttachmentProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
12
|
export {};
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { TFieldContainerClasses } from '../model/classes-types';
|
|
4
4
|
declare const fieldContainerConfig: (props?: ({
|
|
5
|
+
intent?: "filled" | "clear" | null | undefined;
|
|
5
6
|
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
8
|
export type TFieldContainerConfig = VariantProps<typeof fieldContainerConfig>;
|
|
@@ -9,5 +10,5 @@ interface IFieldContainerProps extends TFieldContainerConfig {
|
|
|
9
10
|
classes?: Partial<TFieldContainerClasses>;
|
|
10
11
|
children: ReactNode;
|
|
11
12
|
}
|
|
12
|
-
export declare const FieldContainer: ({ size, classes, children }: IFieldContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const FieldContainer: ({ size, intent, classes, children }: IFieldContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -8,6 +8,7 @@ interface IFieldWrapperProps<V> {
|
|
|
8
8
|
error?: boolean;
|
|
9
9
|
classes?: Partial<TFieldWrapperClasses>;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
isTextarea?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare const FieldWrapper: <V>({ children, error, disabled, classes, fieldId, label, value }: IFieldWrapperProps<V>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const FieldWrapper: <V>({ children, error, disabled, classes, fieldId, label, value, isTextarea }: IFieldWrapperProps<V>) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
2
|
import { SpritesMap } from './sprite.gen';
|
|
3
3
|
export type IconName<Key extends keyof SpritesMap> = `${Key}/${SpritesMap[Key]}`;
|
|
4
|
-
export type
|
|
4
|
+
export type TAllowedIcons = {
|
|
5
5
|
[Key in keyof SpritesMap]: IconName<Key>;
|
|
6
6
|
}[keyof SpritesMap];
|
|
7
7
|
export interface IconProps extends SVGProps<SVGSVGElement> {
|
|
8
|
-
name:
|
|
8
|
+
name: TAllowedIcons;
|
|
9
9
|
}
|
|
10
10
|
export declare const Icon: ({ name, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Icon, type IconProps, type
|
|
1
|
+
export { Icon, type IconProps, type TAllowedIcons } from './Icon';
|
|
2
2
|
export * from './sprite.gen';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export interface SpritesMap {
|
|
2
|
+
arrows: 'arrowCircle' | 'arrowLink' | 'arrowRight';
|
|
2
3
|
brandLogos: 'logoBlack' | 'logoBusiness' | 'logoGray' | 'logoInsurance' | 'logoMain' | 'logoWhite';
|
|
3
|
-
|
|
4
|
+
files: 'documentFilled' | 'documentOutline';
|
|
5
|
+
general: 'calendar' | 'check' | 'close';
|
|
6
|
+
info: 'warningCircle';
|
|
4
7
|
}
|
|
5
8
|
export declare const SPRITES_META: {
|
|
6
9
|
[Key in keyof SpritesMap]: {
|