@true-engineering/true-react-common-ui-kit 4.0.0-alpha70 → 4.0.0-alpha72
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/components/DateInput/DateInput.d.ts +2 -2
- package/dist/components/DatePicker/DatePicker.d.ts +2 -2
- package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.d.ts +2 -2
- package/dist/components/FiltersPane/types.d.ts +7 -1
- package/dist/components/Flag/Flag.d.ts +2 -2
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.d.ts +2 -2
- package/dist/components/FloatDocActions/components/DocActions/DocActions.d.ts +2 -2
- package/dist/components/IncrementInput/IncrementInput.d.ts +2 -2
- package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.d.ts +2 -2
- package/dist/components/PhoneInput/PhoneInput.d.ts +2 -2
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.d.ts +2 -2
- package/dist/components/SearchInput/SearchInput.d.ts +3 -3
- package/dist/components/Select/Select.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.d.ts +2 -2
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.d.ts +2 -2
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.d.ts +2 -2
- package/dist/components/WithTooltip/WithTooltip.d.ts +2 -2
- package/dist/true-react-common-ui-kit.js +56 -56
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/AccountInfo/AccountInfo.tsx +1 -1
- package/src/components/AddButton/AddButton.tsx +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/CloseButton/CloseButton.tsx +1 -1
- package/src/components/ControlWrapper/ControlWrapper.tsx +1 -1
- package/src/components/CssBaseline/CssBaseline.tsx +1 -1
- package/src/components/DateInput/DateInput.tsx +6 -4
- package/src/components/DatePicker/DatePicker.tsx +5 -3
- package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.tsx +3 -3
- package/src/components/Description/Description.tsx +1 -1
- package/src/components/FileInput/FileInput.tsx +1 -1
- package/src/components/FileItem/FileItem.tsx +1 -1
- package/src/components/FiltersPane/FiltersPane.tsx +1 -1
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +1 -1
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +1 -1
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +1 -1
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +1 -1
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +1 -1
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +1 -1
- package/src/components/FiltersPane/types.ts +8 -0
- package/src/components/Flag/Flag.tsx +3 -3
- package/src/components/FlexibleTable/FlexibleTable.tsx +1 -1
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.tsx +3 -3
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +1 -1
- package/src/components/FloatDocActions/components/DocActions/DocActions.tsx +3 -4
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/IconButton/IconButton.tsx +1 -1
- package/src/components/IncrementInput/IncrementInput.tsx +6 -4
- package/src/components/Input/InputBase.tsx +1 -1
- package/src/components/List/List.tsx +1 -1
- package/src/components/List/components/ListItem/ListItem.tsx +1 -1
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/MoreMenu/MoreMenu.tsx +1 -1
- package/src/components/MultiSelect/MultiSelect.tsx +1 -1
- package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.tsx +3 -4
- package/src/components/MultiSelectList/MultiSelectList.tsx +1 -1
- package/src/components/NewMoreMenu/NewMoreMenu.tsx +1 -1
- package/src/components/Notification/Notification.tsx +1 -1
- package/src/components/PhoneInput/PhoneInput.tsx +5 -6
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +3 -3
- package/src/components/RadioButton/RadioButton.tsx +1 -1
- package/src/components/SearchInput/SearchInput.tsx +4 -5
- package/src/components/Select/Select.tsx +6 -4
- package/src/components/Select/components/SelectList/SelectList.tsx +1 -1
- package/src/components/Skeleton/Skeleton.tsx +3 -3
- package/src/components/Status/Status.tsx +1 -1
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/TextArea/TextArea.tsx +1 -1
- package/src/components/TextButton/TextButton.tsx +1 -1
- package/src/components/TextWithInfo/TextWithInfo.tsx +1 -1
- package/src/components/TextWithTooltip/TextWithTooltip.tsx +1 -1
- package/src/components/ThemedPreloader/ThemedPreloader.tsx +1 -1
- package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.tsx +3 -3
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +3 -3
- package/src/components/Toaster/Toaster.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/WithMessages/WithMessages.tsx +1 -1
- package/src/components/WithTooltip/WithTooltip.tsx +4 -5
- package/src/types.ts +5 -0
package/dist/types.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface ITweakStylesProps<TweakStyles> {
|
|
|
15
15
|
tweakStyles?: IMaybeArray<TweakStyles>;
|
|
16
16
|
}
|
|
17
17
|
export type ICommonProps<TweakStyles> = IDataAttributesProps & ITweakStylesProps<TweakStyles>;
|
|
18
|
+
export type IReplaceTweakStylesProps<T extends ITweakStylesProps<unknown>, P> = ITweakStylesProps<P> & Omit<T, 'tweakStyles'>;
|
|
18
19
|
export interface IDropdownWithPopperOptions {
|
|
19
20
|
shouldUsePopper?: boolean;
|
|
20
21
|
shouldRenderInBody?: boolean;
|
package/package.json
CHANGED
|
@@ -70,7 +70,7 @@ export const Button = forwardRef<HTMLButtonElement, IButtonProps>(function Butto
|
|
|
70
70
|
},
|
|
71
71
|
ref,
|
|
72
72
|
) {
|
|
73
|
-
const classes = useStyles({
|
|
73
|
+
const classes = useStyles({ tweakStyles });
|
|
74
74
|
|
|
75
75
|
const tweakPreloaderStyles = useTweakStyles({
|
|
76
76
|
innerStyles: getPreloaderStyles(size),
|
|
@@ -48,7 +48,7 @@ export function Checkbox<V>({
|
|
|
48
48
|
tweakStyles,
|
|
49
49
|
onSelect,
|
|
50
50
|
}: ICheckboxProps<V>): JSX.Element {
|
|
51
|
-
const classes = useStyles({
|
|
51
|
+
const classes = useStyles({ tweakStyles });
|
|
52
52
|
|
|
53
53
|
const hasAction = !isDisabled && !isReadonly;
|
|
54
54
|
const isSelected = isChecked || isSemiChecked;
|
|
@@ -67,7 +67,7 @@ export const ControlWrapper: FC<IControlWrapperProps> = ({
|
|
|
67
67
|
data,
|
|
68
68
|
onClear,
|
|
69
69
|
}) => {
|
|
70
|
-
const classes = useStyles({
|
|
70
|
+
const classes = useStyles({ tweakStyles });
|
|
71
71
|
|
|
72
72
|
const [startControlsWidth, setStartControlsWidth] = useState<number>();
|
|
73
73
|
|
|
@@ -6,7 +6,7 @@ import { useStyles, ICssBaselineStyles } from './CssBaseline.styles';
|
|
|
6
6
|
export type ICssBaselineProps = ICommonProps<ICssBaselineStyles>;
|
|
7
7
|
|
|
8
8
|
export const CssBaseline: FC<ICssBaselineProps> = ({ data, testId, tweakStyles }) => {
|
|
9
|
-
const classes = useStyles({
|
|
9
|
+
const classes = useStyles({ tweakStyles });
|
|
10
10
|
|
|
11
11
|
return <div className={classes.root} {...addDataAttributes(data, testId)} />;
|
|
12
12
|
};
|
|
@@ -2,14 +2,16 @@ import { ChangeEvent, forwardRef } from 'react';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { addDataAttributes } from '@true-engineering/true-react-platform-helpers';
|
|
4
4
|
import { useTweakStyles } from '../../hooks';
|
|
5
|
-
import {
|
|
5
|
+
import { IReplaceTweakStylesProps } from '../../types';
|
|
6
6
|
import { IChangeInputEvent, IInputProps, Input } from '../Input';
|
|
7
7
|
import { EMPTY_DATE_INPUT_VALUE, EMPTY_DATE_RANGE_INPUT_VALUE } from './constants';
|
|
8
8
|
import { IDateInputStyles, useStyles } from './DateInput.styles';
|
|
9
9
|
|
|
10
10
|
export interface IDateInputProps
|
|
11
|
-
extends Omit<
|
|
12
|
-
|
|
11
|
+
extends Omit<
|
|
12
|
+
IReplaceTweakStylesProps<IInputProps, IDateInputStyles>,
|
|
13
|
+
'value' | 'beforeMaskedStateChange' | 'onChange'
|
|
14
|
+
> {
|
|
13
15
|
date?: string;
|
|
14
16
|
/** @default '' */
|
|
15
17
|
startDate?: string;
|
|
@@ -39,7 +41,7 @@ export const DateInput = forwardRef<HTMLInputElement, IDateInputProps>(function
|
|
|
39
41
|
},
|
|
40
42
|
ref,
|
|
41
43
|
) {
|
|
42
|
-
const classes = useStyles({
|
|
44
|
+
const classes = useStyles({ tweakStyles });
|
|
43
45
|
|
|
44
46
|
const tweakInputStyles = useTweakStyles({
|
|
45
47
|
tweakStyles,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from '@true-engineering/true-react-platform-helpers';
|
|
22
22
|
import { offset } from '@floating-ui/react';
|
|
23
23
|
import { useMergedRefs, useOnClickOutside, useTweakStyles } from '../../hooks';
|
|
24
|
-
import {
|
|
24
|
+
import { ITweakStylesProps } from '../../types';
|
|
25
25
|
import { DateInput, EMPTY_DATE_INPUT_VALUE, IDateInputProps } from '../DateInput';
|
|
26
26
|
import { DatePickerBase, DatePickerHeader, PopperContainer } from './components';
|
|
27
27
|
import {
|
|
@@ -34,7 +34,9 @@ import { areDatesEquals, getDateFormatter, getDateValueParser } from './helpers'
|
|
|
34
34
|
import { IDatePickerBaseProps, IRange } from './types';
|
|
35
35
|
import { IDatePickerStyles, useStyles } from './DatePicker.styles';
|
|
36
36
|
|
|
37
|
-
export interface IDatePickerProps
|
|
37
|
+
export interface IDatePickerProps
|
|
38
|
+
extends IDatePickerBaseProps,
|
|
39
|
+
ITweakStylesProps<IDatePickerStyles> {
|
|
38
40
|
selectedDate?: Date | null;
|
|
39
41
|
locale: IDatePickerLocale;
|
|
40
42
|
months?: string[];
|
|
@@ -105,7 +107,7 @@ export const DatePicker = forwardRef<ReactDatePicker, IDatePickerProps>(function
|
|
|
105
107
|
},
|
|
106
108
|
ref,
|
|
107
109
|
) {
|
|
108
|
-
const classes = useStyles({
|
|
110
|
+
const classes = useStyles({ tweakStyles });
|
|
109
111
|
|
|
110
112
|
const tweakDateInputStyles = useTweakStyles({
|
|
111
113
|
tweakStyles,
|
|
@@ -2,14 +2,14 @@ import { FC, useMemo } from 'react';
|
|
|
2
2
|
import { ReactDatePickerCustomHeaderProps as BaseProps } from 'react-datepicker';
|
|
3
3
|
import { getMonth, getYear } from 'date-fns';
|
|
4
4
|
import { useTweakStyles } from '../../../../hooks';
|
|
5
|
-
import {
|
|
5
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
6
6
|
import { Icon } from '../../../Icon';
|
|
7
7
|
import { Select } from '../../../Select';
|
|
8
8
|
import { IDatePickerHeaderStyles, selectStyles, useStyles } from './DatePickerHeader.styles';
|
|
9
9
|
|
|
10
10
|
export interface IDatePickerHeaderProps
|
|
11
11
|
extends BaseProps,
|
|
12
|
-
|
|
12
|
+
ITweakStylesProps<IDatePickerHeaderStyles> {
|
|
13
13
|
months?: string[];
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -24,7 +24,7 @@ export const DatePickerHeader: FC<IDatePickerHeaderProps> = ({
|
|
|
24
24
|
decreaseMonth,
|
|
25
25
|
increaseMonth,
|
|
26
26
|
}) => {
|
|
27
|
-
const classes = useStyles({
|
|
27
|
+
const classes = useStyles({ tweakStyles });
|
|
28
28
|
|
|
29
29
|
const tweakSelectStyles = useTweakStyles({
|
|
30
30
|
innerStyles: selectStyles,
|
|
@@ -24,7 +24,7 @@ export const Description: FC<IDescriptionProps> = ({
|
|
|
24
24
|
data,
|
|
25
25
|
tweakStyles,
|
|
26
26
|
}) => {
|
|
27
|
-
const classes = useStyles({
|
|
27
|
+
const classes = useStyles({ tweakStyles });
|
|
28
28
|
|
|
29
29
|
const isTooShort = text.length < truncateIndex;
|
|
30
30
|
const [isOpen, setIsOpen] = useState(isAlwaysOpen);
|
|
@@ -59,7 +59,7 @@ export const FileInput = forwardRef<HTMLInputElement, IFileInputProps>(function
|
|
|
59
59
|
},
|
|
60
60
|
ref,
|
|
61
61
|
) {
|
|
62
|
-
const classes = useStyles({
|
|
62
|
+
const classes = useStyles({ tweakStyles });
|
|
63
63
|
|
|
64
64
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
65
65
|
|
|
@@ -54,7 +54,7 @@ export function FiltersPane<Values extends Record<string, unknown>, Content = Va
|
|
|
54
54
|
onSettingsButtonClick,
|
|
55
55
|
onClear,
|
|
56
56
|
}: IFiltersPaneProps<Values, Content>): JSX.Element {
|
|
57
|
-
const classes = useStyles({
|
|
57
|
+
const classes = useStyles({ tweakStyles });
|
|
58
58
|
|
|
59
59
|
const tweakClearButtonStyles = useTweakStyles({
|
|
60
60
|
innerStyles: clearButtonStyles,
|
|
@@ -39,7 +39,7 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
|
|
|
39
39
|
toInput,
|
|
40
40
|
testId,
|
|
41
41
|
}) => {
|
|
42
|
-
const classes = useStyles({
|
|
42
|
+
const classes = useStyles({ tweakStyles });
|
|
43
43
|
|
|
44
44
|
const translates = useMemo(() => getLocale(localeKey, locale), [localeKey, locale]);
|
|
45
45
|
|
|
@@ -70,7 +70,7 @@ export function FilterSelect<Value>({
|
|
|
70
70
|
hasClearButton = true,
|
|
71
71
|
testId,
|
|
72
72
|
}: IFilterSelectProps<Value>): JSX.Element {
|
|
73
|
-
const classes = useStyles({
|
|
73
|
+
const classes = useStyles({ tweakStyles });
|
|
74
74
|
|
|
75
75
|
const tweakSearchInputStyles = useTweakStyles({
|
|
76
76
|
innerStyles: searchInputStyles,
|
|
@@ -47,7 +47,7 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
|
|
|
47
47
|
endPickerProps = DEFAULT_PICKER_PROPS,
|
|
48
48
|
isClearable = true,
|
|
49
49
|
}) => {
|
|
50
|
-
const classes = useStyles({
|
|
50
|
+
const classes = useStyles({ tweakStyles });
|
|
51
51
|
|
|
52
52
|
const tweakClearButtonStyles = useTweakStyles({
|
|
53
53
|
innerStyles: clearButtonStyles,
|
|
@@ -35,7 +35,7 @@ export const FilterWithPeriod: FC<IFilterWithPeriodProps> = ({
|
|
|
35
35
|
tweakStyles,
|
|
36
36
|
testId,
|
|
37
37
|
}) => {
|
|
38
|
-
const classes = useStyles({
|
|
38
|
+
const classes = useStyles({ tweakStyles });
|
|
39
39
|
|
|
40
40
|
const translates = useMemo(() => getLocale(localeKey, locale), [localeKey, locale]);
|
|
41
41
|
|
|
@@ -35,7 +35,7 @@ export function FilterWrapper<Values extends Record<string, unknown>, Key extend
|
|
|
35
35
|
onChange,
|
|
36
36
|
}: IFilterWrapperProps<Values, Key>): JSX.Element {
|
|
37
37
|
const tweakStyles = useMixedStyles(baseTweakStyles, filter.tweakWrapperStyles);
|
|
38
|
-
const classes = useStyles({
|
|
38
|
+
const classes = useStyles({ tweakStyles });
|
|
39
39
|
|
|
40
40
|
const tweakWithPopupStyles = useTweakStyles({
|
|
41
41
|
tweakStyles,
|
|
@@ -58,7 +58,7 @@ export function FiltersPaneSearch<Value>({
|
|
|
58
58
|
tweakStyles,
|
|
59
59
|
testId,
|
|
60
60
|
}: IFiltersPaneSearchProps<Value>): JSX.Element {
|
|
61
|
-
const classes = useStyles({
|
|
61
|
+
const classes = useStyles({ tweakStyles });
|
|
62
62
|
|
|
63
63
|
const tweakSearchInputStyles = useTweakStyles({
|
|
64
64
|
innerStyles: searchInputStyles,
|
|
@@ -117,6 +117,13 @@ export interface ICustomRangeConfigItem<Value> extends IConfigItemBasicBase<Valu
|
|
|
117
117
|
valueViewType?: 'range';
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
export interface ICustomSingularConfigItem<Value> extends IConfigItemBasicBase<Value> {
|
|
121
|
+
[key: string & {}]: any;
|
|
122
|
+
type: 'custom';
|
|
123
|
+
component: CustomComponent<Value>;
|
|
124
|
+
getSelectedValue?: (v: Value) => ReactNode;
|
|
125
|
+
}
|
|
126
|
+
|
|
120
127
|
export interface ICustomMultipleConfigItem<Value> extends IConfigItemBasicBase<Value> {
|
|
121
128
|
[key: string & {}]: any;
|
|
122
129
|
type: 'custom';
|
|
@@ -127,6 +134,7 @@ export interface ICustomMultipleConfigItem<Value> extends IConfigItemBasicBase<V
|
|
|
127
134
|
|
|
128
135
|
export type ICustomConfigItem<Value> =
|
|
129
136
|
| ICustomRangeConfigItem<Value>
|
|
137
|
+
| ICustomSingularConfigItem<Value>
|
|
130
138
|
| ICustomMultipleConfigItem<Value>;
|
|
131
139
|
|
|
132
140
|
export type ConfigItem<Value> =
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { hasFlag } from 'country-flag-icons';
|
|
3
3
|
import * as Flags from 'country-flag-icons/react/3x2';
|
|
4
|
-
import {
|
|
4
|
+
import { ITweakStylesProps } from '../../types';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
6
6
|
import { customFlags } from './customFlags';
|
|
7
7
|
import { IFlagStyles, useStyles } from './Flag.styles';
|
|
8
8
|
|
|
9
|
-
export interface IFlagProps extends
|
|
9
|
+
export interface IFlagProps extends ITweakStylesProps<IFlagStyles> {
|
|
10
10
|
/** @default '' */
|
|
11
11
|
countryCode?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const Flag: FC<IFlagProps> = ({ countryCode = '', tweakStyles }) => {
|
|
15
|
-
const classes = useStyles({
|
|
15
|
+
const classes = useStyles({ tweakStyles });
|
|
16
16
|
const countryFlagKey = countryCode.toUpperCase();
|
|
17
17
|
|
|
18
18
|
const hasFlagInLibrary = hasFlag(countryFlagKey);
|
|
@@ -94,7 +94,7 @@ export function FlexibleTable<
|
|
|
94
94
|
isExpandableRowComponentInitiallyOpen: isRowInitiallyOpen,
|
|
95
95
|
...restProps
|
|
96
96
|
}: IFlexibleTableProps<Row, HeaderContent, UniqueField>): JSX.Element {
|
|
97
|
-
const classes = useStyles({
|
|
97
|
+
const classes = useStyles({ tweakStyles });
|
|
98
98
|
|
|
99
99
|
const tweakTableRowStyles = useTweakStyles({
|
|
100
100
|
tweakStyles,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
isNotEmpty,
|
|
6
6
|
addDataAttributes,
|
|
7
7
|
} from '@true-engineering/true-react-platform-helpers';
|
|
8
|
-
import {
|
|
8
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
9
9
|
import { Skeleton } from '../../../Skeleton';
|
|
10
10
|
import { TableRenders } from '../../constants';
|
|
11
11
|
import { formatCellContent } from '../../helpers';
|
|
@@ -21,7 +21,7 @@ import { useStyles, IFlexibleTableCellStyles } from './FlexibleTableCell.styles'
|
|
|
21
21
|
export interface IFlexibleTableCellProps<
|
|
22
22
|
Row extends ITableRow,
|
|
23
23
|
HeaderContent extends IHeaderContent<Row>,
|
|
24
|
-
> extends
|
|
24
|
+
> extends ITweakStylesProps<IFlexibleTableCellStyles>,
|
|
25
25
|
Pick<
|
|
26
26
|
IValueComponentProps<Row, unknown>,
|
|
27
27
|
'isFocusedRow' | 'isActiveRow' | 'isNestedComponentExpanded' | 'isRowNestedComponentExpanded'
|
|
@@ -51,7 +51,7 @@ export function FlexibleTableCell<
|
|
|
51
51
|
tweakStyles,
|
|
52
52
|
...valueComponentProps
|
|
53
53
|
}: IFlexibleTableCellProps<Row, HeaderContent>): JSX.Element {
|
|
54
|
-
const classes = useStyles({
|
|
54
|
+
const classes = useStyles({ tweakStyles });
|
|
55
55
|
|
|
56
56
|
const value = row[columnName];
|
|
57
57
|
|
|
@@ -70,7 +70,7 @@ export const FlexibleTableRow = genericMemo(function FlexibleTableRow<
|
|
|
70
70
|
onRowHover,
|
|
71
71
|
onRowClick,
|
|
72
72
|
}: IFlexibleTableRowProps<Row, HeaderContent, UniqueField>): JSX.Element {
|
|
73
|
-
const classes = useStyles({
|
|
73
|
+
const classes = useStyles({ tweakStyles });
|
|
74
74
|
|
|
75
75
|
const tweakTableCellStyles = useTweakStyles({
|
|
76
76
|
tweakStyles,
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { useTweakStyles } from '../../../../hooks';
|
|
4
|
-
import {
|
|
4
|
+
import { IReplaceTweakStylesProps } from '../../../../types';
|
|
5
5
|
import { Checkbox, ICheckboxProps } from '../../../Checkbox';
|
|
6
6
|
import { IDocActionsView } from './types';
|
|
7
7
|
import { IDocActionsStyles, useStyles } from './DocActions.styles';
|
|
8
8
|
|
|
9
9
|
export interface IDocActionsProps
|
|
10
|
-
extends
|
|
11
|
-
ICommonProps<IDocActionsStyles> {
|
|
10
|
+
extends IReplaceTweakStylesProps<ICheckboxProps<never>, IDocActionsStyles> {
|
|
12
11
|
title: string;
|
|
13
12
|
/** @default 'neutral' */
|
|
14
13
|
view?: IDocActionsView;
|
|
@@ -22,7 +21,7 @@ export const DocActions: FC<IDocActionsProps> = ({
|
|
|
22
21
|
tweakStyles,
|
|
23
22
|
...checkBoxProps
|
|
24
23
|
}) => {
|
|
25
|
-
const classes = useStyles({
|
|
24
|
+
const classes = useStyles({ tweakStyles });
|
|
26
25
|
|
|
27
26
|
const tweakCheckboxStyles = useTweakStyles({
|
|
28
27
|
tweakStyles,
|
|
@@ -11,7 +11,7 @@ export interface IIconProps extends ICommonProps<IIconStyles> {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const Icon: FC<IIconProps> = ({ type, data, testId, tweakStyles }) => {
|
|
14
|
-
const classes = useStyles({
|
|
14
|
+
const classes = useStyles({ tweakStyles });
|
|
15
15
|
const theme = useTheme();
|
|
16
16
|
|
|
17
17
|
const icon = theme.icons?.[type] ?? iconsMap[type];
|
|
@@ -3,14 +3,16 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { isNotEmpty, isNumberInteger } from '@true-engineering/true-react-platform-helpers';
|
|
4
4
|
import { getNumberInRange, getNumberLength } from '../../helpers';
|
|
5
5
|
import { useTweakStyles } from '../../hooks';
|
|
6
|
-
import {
|
|
6
|
+
import { IReplaceTweakStylesProps } from '../../types';
|
|
7
7
|
import { Icon } from '../Icon';
|
|
8
8
|
import { INumberInputProps, NumberInput } from '../NumberInput';
|
|
9
9
|
import { useStyles, IIncrementInputStyles, inputStyles } from './IncrementInput.styles';
|
|
10
10
|
|
|
11
11
|
export interface IIncrementInputProps
|
|
12
|
-
extends Omit<
|
|
13
|
-
|
|
12
|
+
extends Omit<
|
|
13
|
+
IReplaceTweakStylesProps<INumberInputProps, IIncrementInputStyles>,
|
|
14
|
+
'canBeFloat' | 'precision'
|
|
15
|
+
> {
|
|
14
16
|
/** @default 1 */
|
|
15
17
|
step?: number;
|
|
16
18
|
}
|
|
@@ -35,7 +37,7 @@ export const IncrementInput: FC<IIncrementInputProps> = ({
|
|
|
35
37
|
currentComponentName: 'IncrementInput',
|
|
36
38
|
});
|
|
37
39
|
|
|
38
|
-
const classes = useStyles({
|
|
40
|
+
const classes = useStyles({ tweakStyles });
|
|
39
41
|
|
|
40
42
|
const isEditDisabled = isDisabled || isReadonly;
|
|
41
43
|
|
|
@@ -108,7 +108,7 @@ export const InputBase = forwardRef<HTMLInputElement, IInputBaseProps>(function
|
|
|
108
108
|
},
|
|
109
109
|
ref,
|
|
110
110
|
) {
|
|
111
|
-
const classes = useStyles({
|
|
111
|
+
const classes = useStyles({ tweakStyles });
|
|
112
112
|
|
|
113
113
|
const tweakControlWrapperStyles = useTweakStyles({
|
|
114
114
|
tweakStyles,
|
|
@@ -19,7 +19,7 @@ export interface IListProps extends ICommonProps<IListStyles> {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const List: FC<IListProps> = ({ items, size, testId, data, tweakStyles, onClick }) => {
|
|
22
|
-
const classes = useStyles({
|
|
22
|
+
const classes = useStyles({ tweakStyles });
|
|
23
23
|
|
|
24
24
|
const handleItemClick = (
|
|
25
25
|
event: MouseEvent | KeyboardEvent,
|
|
@@ -68,7 +68,7 @@ export const Modal: FC<IModalProps> = ({
|
|
|
68
68
|
onClose,
|
|
69
69
|
...restProps
|
|
70
70
|
}) => {
|
|
71
|
-
const classes = useStyles({
|
|
71
|
+
const classes = useStyles({ tweakStyles });
|
|
72
72
|
|
|
73
73
|
const tweakCloseButtonStyles = useTweakStyles({
|
|
74
74
|
innerStyles: closeButtonStyles,
|
|
@@ -46,7 +46,7 @@ export function MultiSelect<Value = string>({
|
|
|
46
46
|
fetchOptions,
|
|
47
47
|
tweakStyles,
|
|
48
48
|
}: IMultiSelectProps<Value>): JSX.Element {
|
|
49
|
-
const classes = useStyles({
|
|
49
|
+
const classes = useStyles({ tweakStyles });
|
|
50
50
|
|
|
51
51
|
const tweakMultiSelectListStyles = useTweakStyles({
|
|
52
52
|
innerStyles: multiSelectListStyles,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
3
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
4
4
|
import { Icon } from '../../../Icon';
|
|
5
5
|
import { IMultiSelectListValues } from '../../../MultiSelectList';
|
|
6
6
|
import { useStyles, IMultiSelectInputStyles } from './MultiSelectInput.styles';
|
|
7
7
|
|
|
8
|
-
export interface IMultiSelectInputProps<Value>
|
|
9
|
-
extends Pick<ICommonProps<IMultiSelectInputStyles>, 'tweakStyles'> {
|
|
8
|
+
export interface IMultiSelectInputProps<Value> extends ITweakStylesProps<IMultiSelectInputStyles> {
|
|
10
9
|
value?: IMultiSelectListValues<Value>;
|
|
11
10
|
isOpen: boolean;
|
|
12
11
|
isDisabled: boolean;
|
|
@@ -22,7 +21,7 @@ export function MultiSelectInput<Value>({
|
|
|
22
21
|
tweakStyles,
|
|
23
22
|
onToggle,
|
|
24
23
|
}: IMultiSelectInputProps<Value>): ReactElement | null {
|
|
25
|
-
const classes = useStyles({
|
|
24
|
+
const classes = useStyles({ tweakStyles });
|
|
26
25
|
|
|
27
26
|
const value = v?.include;
|
|
28
27
|
|
|
@@ -67,7 +67,7 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
67
67
|
testId,
|
|
68
68
|
}: IMultiSelectListProps<Value, Option>): JSX.Element {
|
|
69
69
|
const isMounted = useIsMounted();
|
|
70
|
-
const classes = useStyles({
|
|
70
|
+
const classes = useStyles({ tweakStyles });
|
|
71
71
|
|
|
72
72
|
const tweakCheckboxStyles = useTweakStyles({
|
|
73
73
|
innerStyles: checkboxStyles,
|
|
@@ -35,7 +35,7 @@ export const Notification: FC<INotificationProps> = ({
|
|
|
35
35
|
icon = type !== 'custom' ? `status-${type}` : undefined,
|
|
36
36
|
tweakStyles,
|
|
37
37
|
}) => {
|
|
38
|
-
const classes = useStyles({
|
|
38
|
+
const classes = useStyles({ tweakStyles });
|
|
39
39
|
|
|
40
40
|
const hasText = isReactNodeNotEmpty(text);
|
|
41
41
|
const hasTitle = isReactNodeNotEmpty(title);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
getPhoneObjFromString,
|
|
10
10
|
} from '../../helpers';
|
|
11
11
|
import { useOnClickOutsideWithRef, useTweakStyles } from '../../hooks';
|
|
12
|
-
import {
|
|
12
|
+
import { IReplaceTweakStylesProps } from '../../types';
|
|
13
13
|
import { Flag } from '../Flag';
|
|
14
14
|
import { Icon } from '../Icon';
|
|
15
15
|
import { IChangeInputEvent, IInputProps, Input } from '../Input';
|
|
@@ -20,10 +20,9 @@ import { inputStyles, IPhoneInputStyles, useStyles } from './PhoneInput.styles';
|
|
|
20
20
|
|
|
21
21
|
export interface IPhoneInputProps
|
|
22
22
|
extends Omit<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ICommonProps<IPhoneInputStyles> {
|
|
23
|
+
IReplaceTweakStylesProps<IInputProps, IPhoneInputStyles>,
|
|
24
|
+
'value' | 'onChange' | 'type' | 'mask' | 'units' | 'placeholder'
|
|
25
|
+
> {
|
|
27
26
|
/** @default 'ru' */
|
|
28
27
|
locale?: string;
|
|
29
28
|
/** @default 'Поиск' */
|
|
@@ -49,7 +48,7 @@ export const PhoneInput: FC<IPhoneInputProps> = ({
|
|
|
49
48
|
noMatchesLabel = 'Ничего не найдено',
|
|
50
49
|
...inputProps
|
|
51
50
|
}) => {
|
|
52
|
-
const classes = useStyles({
|
|
51
|
+
const classes = useStyles({ tweakStyles });
|
|
53
52
|
|
|
54
53
|
const tweakInputStyles = useTweakStyles({
|
|
55
54
|
innerStyles: inputStyles,
|
package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
sortCountriesByLocale,
|
|
9
9
|
} from '../../../../helpers';
|
|
10
10
|
import { useTweakStyles } from '../../../../hooks';
|
|
11
|
-
import {
|
|
11
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
12
12
|
import { Flag } from '../../../Flag';
|
|
13
13
|
import { Icon } from '../../../Icon';
|
|
14
14
|
import { IChangeInputEvent, Input } from '../../../Input';
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from './PhoneInputCountryList.styles';
|
|
22
22
|
|
|
23
23
|
export interface IPhoneInputCountryListProps
|
|
24
|
-
extends
|
|
24
|
+
extends ITweakStylesProps<IPhoneInputCountryListStyles> {
|
|
25
25
|
selectedCountryCode?: string;
|
|
26
26
|
locale: string;
|
|
27
27
|
placeholder: string;
|
|
@@ -39,7 +39,7 @@ export const PhoneInputCountryList: FC<IPhoneInputCountryListProps> = ({
|
|
|
39
39
|
onChange,
|
|
40
40
|
tweakStyles,
|
|
41
41
|
}) => {
|
|
42
|
-
const classes = useStyles({
|
|
42
|
+
const classes = useStyles({ tweakStyles });
|
|
43
43
|
|
|
44
44
|
const tweakInputStyles = useTweakStyles({
|
|
45
45
|
innerStyles: inputStyles,
|