@true-engineering/true-react-common-ui-kit 3.0.6 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -0
- package/dist/components/Notification/Notification.d.ts +0 -1
- package/dist/components/Selector/Selector.d.ts +21 -0
- package/dist/components/Selector/Selector.stories.d.ts +8 -0
- package/dist/components/Selector/Selector.styles.d.ts +9 -0
- package/dist/components/Selector/index.d.ts +2 -0
- package/dist/components/Selector/types.d.ts +10 -0
- package/dist/components/Status/Status.d.ts +16 -0
- package/dist/components/Status/Status.stories.d.ts +8 -0
- package/dist/components/Status/Status.styles.d.ts +3 -0
- package/dist/components/Status/constants.d.ts +2 -0
- package/dist/components/Status/index.d.ts +2 -0
- package/dist/components/Status/types.d.ts +3 -0
- package/dist/components/TextButton/TextButton.d.ts +30 -0
- package/dist/components/TextButton/TextButton.stories.d.ts +6 -0
- package/dist/components/TextButton/TextButton.styles.d.ts +7 -0
- package/dist/components/TextButton/index.d.ts +3 -0
- package/dist/components/index.d.ts +7 -4
- package/dist/theme/types.d.ts +4 -1
- package/dist/true-react-common-ui-kit.js +2286 -1487
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +2285 -1486
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Notification/Notification.tsx +0 -2
- package/src/components/Selector/Selector.stories.tsx +62 -0
- package/src/components/Selector/Selector.styles.ts +164 -0
- package/src/components/Selector/Selector.tsx +115 -0
- package/src/components/Selector/index.ts +2 -0
- package/src/components/Selector/types.ts +12 -0
- package/src/components/Status/Status.stories.tsx +73 -0
- package/src/components/Status/Status.styles.ts +143 -0
- package/src/components/Status/Status.tsx +49 -0
- package/src/components/Status/constants.ts +11 -0
- package/src/components/Status/index.ts +3 -0
- package/src/components/Status/types.ts +5 -0
- package/src/components/TextButton/TextButton.stories.tsx +46 -0
- package/src/components/TextButton/TextButton.styles.ts +129 -0
- package/src/components/TextButton/TextButton.tsx +103 -0
- package/src/components/TextButton/index.ts +4 -0
- package/src/components/index.ts +7 -4
- package/src/theme/types.ts +11 -5
package/README.md
CHANGED
|
@@ -10,6 +10,49 @@
|
|
|
10
10
|
|
|
11
11
|
# Release Notes
|
|
12
12
|
|
|
13
|
+
## v3.1.1
|
|
14
|
+
|
|
15
|
+
- **Status** фикс цветов
|
|
16
|
+
|
|
17
|
+
## v3.1.0
|
|
18
|
+
|
|
19
|
+
- Добавлены компоненты **Selector** **Status** **TextButton**
|
|
20
|
+
|
|
21
|
+
## v3.0.0
|
|
22
|
+
|
|
23
|
+
- Функции isDateValid / parseStringToDate / и константа DATE_FORMAT -> удалены
|
|
24
|
+
- isInt -> isNumberInteger -> (TE_Helpers)
|
|
25
|
+
- isNotEmpty -> Проверяет только null и undefined (как и должна) -> (TE_Helpers)
|
|
26
|
+
- isEmpty / isStringNotEmpty / addDataTestId / getTestId / getSelectKeyHandler / addClickHandler / createFilter -> (TE_Helpers)
|
|
27
|
+
- В очень многих местах где были ReactNode проперти усилена проверка (теперь не допускаются false и пустые строки)
|
|
28
|
+
- commonTheme -> **common**
|
|
29
|
+
- Подключение провайдера темы теперь через <ThemeProvider theme={u6Theme}>
|
|
30
|
+
- **Tooltip** - добавлены классы .error .info (вместо использования стилевых переменных)
|
|
31
|
+
|
|
32
|
+
- **Notification** - добавлены классы .error .info .warning .ok .not-ok (вместо использования стилевых переменных)
|
|
33
|
+
|
|
34
|
+
- **AccountInfo**, **MultiSelectList**, **FilterSelect** так же лишились стилевых переменных (bye bye width)
|
|
35
|
+
|
|
36
|
+
- **DatePicker** - topPosition / leftPosition - используйте tweakStyles для .popper (marginTop, marginLeft)
|
|
37
|
+
|
|
38
|
+
- **Checkbox** - alignItems / size / textMargin удалены. отступы через марджин заменены на gap (перепроверьте чекбоксы!)
|
|
39
|
+
|
|
40
|
+
- Все типы переименованы по паттерну I{TypeName} (все стилевые типы, а так же связанные с темизацией)
|
|
41
|
+
|
|
42
|
+
- **ThemedPreloader** (изменены tweakStyles -> tweakSvgPreloader + tweakDotsPreloader)
|
|
43
|
+
|
|
44
|
+
- **FilterWithPeriod** -> tweakSelect -> tweakFilterSelect
|
|
45
|
+
|
|
46
|
+
- **FlexibleTable** - чайлдовые компоненты переименованы в FlexibleTableRow и FlexibleTableCell. Теперь у них
|
|
47
|
+
свои tweakStyles: tweakTableRow / tweakTableCell (чайлд для FlexibleTableRow)
|
|
48
|
+
Классы - root + active + editable / root + sticky + second
|
|
49
|
+
.row БОЛЬШЕ НЕ РАСПРОСТРАНЯЕТСЯ на .headerRow (раньше они были вместе)
|
|
50
|
+
classes.horizontallyScrolled - удален. заменено на [data-scrolled]
|
|
51
|
+
рендер теперь зависит от конфига, а не от первого ряда. т.е. используется не Object.keys(content[0]) а Object.entries(config)
|
|
52
|
+
|
|
53
|
+
- **ComponentStyles** -> ITweakStyles
|
|
54
|
+
- Проверьте все места 'as Styles', возможно там больше это не нужно
|
|
55
|
+
|
|
13
56
|
## v2.7.0
|
|
14
57
|
|
|
15
58
|
### Changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ICommonProps } from '../../types';
|
|
2
|
+
import { ISelectorOption, ISelectorValue } from './types';
|
|
3
|
+
import { ISelectorStyles } from './Selector.styles';
|
|
4
|
+
export interface ISelectorProps<V extends ISelectorValue> extends ICommonProps<ISelectorStyles> {
|
|
5
|
+
options: Array<ISelectorOption<V>>;
|
|
6
|
+
value?: V;
|
|
7
|
+
/** @default false */
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
/** @default false */
|
|
10
|
+
isRequired?: boolean;
|
|
11
|
+
/** @default false */
|
|
12
|
+
isInvalid?: boolean;
|
|
13
|
+
/** @default true */
|
|
14
|
+
hasSameOptionsWidth?: boolean;
|
|
15
|
+
/** @default 'left' */
|
|
16
|
+
iconPosition?: 'left' | 'right';
|
|
17
|
+
/** @default 'l' */
|
|
18
|
+
size?: 's' | 'm' | 'l';
|
|
19
|
+
onChange: (value: V) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function Selector<V extends ISelectorValue>({ options, value, isDisabled, isRequired, isInvalid, hasSameOptionsWidth, iconPosition, size, testId, data, tweakStyles, onChange, }: ISelectorProps<V>): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ITweakStyles } from '../../theme';
|
|
3
|
+
export declare const SELECTOR_GAP: number;
|
|
4
|
+
export declare const getSelectorLineStyle: (activeElementData?: {
|
|
5
|
+
clientWidth: number;
|
|
6
|
+
offsetLeft: number;
|
|
7
|
+
}) => CSSProperties | undefined;
|
|
8
|
+
export declare const useStyles: import("../../theme").IUseStyles<"invalid" | "root" | "active" | "disabled" | "iconFromRight" | "s" | "m" | "l" | "option" | "required" | "optionWrapper" | "optionIcon" | "optionText" | "line" | "selector" | "autoWidth", unknown>;
|
|
9
|
+
export type ISelectorStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { IIcon } from '../Icon';
|
|
3
|
+
export type ISelectorValue = string | number | boolean;
|
|
4
|
+
export interface ISelectorOption<V> {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
icon?: IIcon;
|
|
7
|
+
value: V;
|
|
8
|
+
/** @default false */
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ICommonProps } from '../../types';
|
|
3
|
+
import { IIcon } from '../Icon';
|
|
4
|
+
import { IStatusColor, IStatusSize } from './types';
|
|
5
|
+
import { IStatusStyles } from './Status.styles';
|
|
6
|
+
export interface IStatusProps extends ICommonProps<IStatusStyles> {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
color: IStatusColor;
|
|
9
|
+
icon?: IIcon;
|
|
10
|
+
/** @default 's' */
|
|
11
|
+
size?: IStatusSize;
|
|
12
|
+
/** @default 'right' */
|
|
13
|
+
iconPosition?: 'left' | 'right';
|
|
14
|
+
badge?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare const Status: FC<IStatusProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentStory } from '@storybook/react';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<import("./Status").IStatusProps>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: ComponentStory<import("react").FC<import("./Status").IStatusProps>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ITweakStyles } from '../../theme';
|
|
2
|
+
export declare const useStyles: import("../../theme").IUseStyles<"root" | "text" | "blue" | "green" | "grey" | "orange" | "red" | "teal" | "violet" | "icon" | "custom" | "s" | "m" | "iconLeft" | "badge" | "xs", unknown>;
|
|
3
|
+
export type IStatusStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, FC, ReactNode } from 'react';
|
|
2
|
+
import { ICommonProps } from '../../types';
|
|
3
|
+
import { IIcon } from '../Icon';
|
|
4
|
+
import { IThemedPreloaderProps } from '../ThemedPreloader';
|
|
5
|
+
import { ITextButtonStyles } from './TextButton.styles';
|
|
6
|
+
export interface ITextButtonProps extends ICommonProps<ITextButtonStyles>, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'disabled'> {
|
|
7
|
+
/** @default 'undefined' */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** @default 'undefined' */
|
|
10
|
+
icon?: IIcon;
|
|
11
|
+
/** @default 'primary' */
|
|
12
|
+
view?: 'primary' | 'secondary' | 'custom';
|
|
13
|
+
/** @default false */
|
|
14
|
+
isBold?: boolean;
|
|
15
|
+
/** @default false */
|
|
16
|
+
hasCircleUnderIcon?: boolean;
|
|
17
|
+
/** @default false */
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
/** @default false */
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
/** @default false */
|
|
22
|
+
isActive?: boolean;
|
|
23
|
+
/** @default 'l' */
|
|
24
|
+
size?: 'l' | 'xl';
|
|
25
|
+
/** @default 'left' */
|
|
26
|
+
iconPosition?: 'left' | 'right';
|
|
27
|
+
/** @default `dots` */
|
|
28
|
+
preloaderType?: IThemedPreloaderProps['type'];
|
|
29
|
+
}
|
|
30
|
+
export declare const TextButton: FC<ITextButtonProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { TextButton } from './TextButton';
|
|
4
|
+
declare const _default: ComponentMeta<import("react").FC<import("./TextButton").ITextButtonProps>>;
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const Default: ComponentStory<typeof TextButton>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ITweakStyles } from '../../theme';
|
|
2
|
+
import { IThemedPreloaderStyles } from '../ThemedPreloader';
|
|
3
|
+
export declare const useStyles: import("../../theme").IUseStyles<"content" | "root" | "bold" | "circle" | "icon" | "active" | "disabled" | "primary" | "secondary" | "custom" | "l" | "xl" | "loader" | "loading" | "iconContainer" | "reverseContent", unknown>;
|
|
4
|
+
export declare const preloaderStyles: IThemedPreloaderStyles;
|
|
5
|
+
export type ITextButtonStyles = ITweakStyles<typeof useStyles, {
|
|
6
|
+
tweakPreloader: IThemedPreloaderStyles;
|
|
7
|
+
}>;
|
|
@@ -21,17 +21,20 @@ export * from './MultiSelect';
|
|
|
21
21
|
export * from './MultiSelectList';
|
|
22
22
|
export * from './Notification';
|
|
23
23
|
export * from './NumberInput';
|
|
24
|
-
export * from './SearchInput';
|
|
25
|
-
export * from './SmartInput';
|
|
26
24
|
export * from './PhoneInput';
|
|
27
25
|
export * from './RadioButton';
|
|
26
|
+
export * from './ScrollIntoViewIfNeeded';
|
|
27
|
+
export * from './SearchInput';
|
|
28
28
|
export * from './Select';
|
|
29
|
+
export * from './Selector';
|
|
30
|
+
export * from './Skeleton';
|
|
31
|
+
export * from './SmartInput';
|
|
32
|
+
export * from './Status';
|
|
29
33
|
export * from './Switch';
|
|
30
34
|
export * from './TextArea';
|
|
35
|
+
export * from './TextButton';
|
|
31
36
|
export * from './TextWithInfo';
|
|
32
37
|
export * from './TextWithTooltip';
|
|
33
38
|
export * from './ThemedPreloader';
|
|
34
39
|
export * from './Toaster';
|
|
35
40
|
export * from './Tooltip';
|
|
36
|
-
export * from './ScrollIntoViewIfNeeded';
|
|
37
|
-
export * from './Skeleton';
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Styles } from 'react-jss';
|
|
2
2
|
import { Classes, JssValue } from 'jss';
|
|
3
|
-
import type { IAccountInfoStyles, IAddButtonStyles, IButtonStyles, ICheckboxStyles, ICloseButtonStyles, ICommonIcon, IComplexIcon, ICssBaselineStyles, IDateInputStyles, IDatePickerHeaderStyles, IDatePickerStyles, IDescriptionStyles, IDotsPreloaderStyles, IFilterIntervalStyles, IFilterSelectStyles, IFiltersPaneSearchStyles, IFiltersPaneStyles, IFilterWithDatesStyles, IFilterWithPeriodStyles, IFilterWrapperStyles, IFlagStyles, IFlexibleTableStyles, IIconStyles, IIncrementInputStyles, IInputStyles, IListStyles, IModalStyles, IMoreMenuStyles, IMultiSelectInputStyles, IMultiSelectListStyles, IMultiSelectStyles, INotificationStyles, IPhoneInputCountryListStyles, IPhoneInputStyles, IPreloaderSvgType, IRadioButtonStyles, ISearchInputStyles, ISelectListStyles, ISelectStyles,
|
|
3
|
+
import type { IAccountInfoStyles, IAddButtonStyles, IButtonStyles, ICheckboxStyles, ICloseButtonStyles, ICommonIcon, IComplexIcon, ICssBaselineStyles, IDateInputStyles, IDatePickerHeaderStyles, IDatePickerStyles, IDescriptionStyles, IDotsPreloaderStyles, IFilterIntervalStyles, IFilterSelectStyles, IFiltersPaneSearchStyles, IFiltersPaneStyles, IFilterWithDatesStyles, IFilterWithPeriodStyles, IFilterWrapperStyles, IFlagStyles, IFlexibleTableStyles, IIconStyles, IIncrementInputStyles, IInputStyles, IListStyles, IModalStyles, IMoreMenuStyles, IMultiSelectInputStyles, IMultiSelectListStyles, IMultiSelectStyles, INotificationStyles, IPhoneInputCountryListStyles, IPhoneInputStyles, IPreloaderSvgType, IRadioButtonStyles, ISearchInputStyles, ISelectListStyles, ISelectStyles, IFilterValueViewStyles, IFlexibleTableCellStyles, IFlexibleTableRowStyles, IListItemStyles, ISelectorStyles, ISkeletonStyles, ISvgIcon, ISvgPreloaderStyles, ISwitchStyles, ITextAreaStyles, ITextButtonStyles, ITextWithInfoStyles, IStatusStyles, ITextWithTooltipStyles, IThemedPreloaderStyles, IToasterStyles, ITooltipStyles } from '../components';
|
|
4
4
|
export type IStyles<C extends string, P> = Styles<C, P, Partial<Styles<C, P>>>;
|
|
5
5
|
export type IUseStyles<C extends string, P = unknown> = (data?: P & {
|
|
6
6
|
theme?: Partial<Styles<C, P>>;
|
|
@@ -48,11 +48,14 @@ export interface IComponentStyles {
|
|
|
48
48
|
SearchInput: ISearchInputStyles;
|
|
49
49
|
Select: ISelectStyles;
|
|
50
50
|
SelectList: ISelectListStyles;
|
|
51
|
+
Selector: ISelectorStyles;
|
|
51
52
|
Skeleton: ISkeletonStyles;
|
|
52
53
|
Switch: ISwitchStyles;
|
|
54
|
+
TextButton: ITextButtonStyles;
|
|
53
55
|
TextArea: ITextAreaStyles;
|
|
54
56
|
TextWithInfo: ITextWithInfoStyles;
|
|
55
57
|
TextWithTooltip: ITextWithTooltipStyles;
|
|
58
|
+
Status: IStatusStyles;
|
|
56
59
|
ThemedPreloader: IThemedPreloaderStyles;
|
|
57
60
|
Tooltip: ITooltipStyles;
|
|
58
61
|
Toaster: IToasterStyles;
|