@true-engineering/true-react-common-ui-kit 4.0.0-alpha70 → 4.0.0-alpha71
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/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/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
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from '@true-engineering/true-react-platform-helpers';
|
|
28
28
|
import { hasExactParent } from '../../helpers';
|
|
29
29
|
import { useDropdown, useIsMounted, useOnClickOutsideWithRef, useTweakStyles } from '../../hooks';
|
|
30
|
-
import {
|
|
30
|
+
import { IDropdownWithPopperOptions, IReplaceTweakStylesProps } from '../../types';
|
|
31
31
|
import { IIcon, renderIcon } from '../Icon';
|
|
32
32
|
import { IChangeInputEvent, IInputProps, InputBase } from '../Input';
|
|
33
33
|
import { ISearchInputProps, SearchInput } from '../SearchInput';
|
|
@@ -44,8 +44,10 @@ import { IChangeSelectEvent, IMultipleSelectValue, ISelectFooter } from './types
|
|
|
44
44
|
import { getInputStyles, ISelectStyles, useStyles } from './Select.styles';
|
|
45
45
|
|
|
46
46
|
export interface ISelectProps<Value>
|
|
47
|
-
extends Omit<
|
|
48
|
-
|
|
47
|
+
extends Omit<
|
|
48
|
+
IReplaceTweakStylesProps<IInputProps, ISelectStyles>,
|
|
49
|
+
'value' | 'onChange' | 'onBlur' | 'type'
|
|
50
|
+
> {
|
|
49
51
|
header?: ReactNode;
|
|
50
52
|
footer?: ISelectFooter<Value>;
|
|
51
53
|
defaultOptionLabel?: ReactNode;
|
|
@@ -143,7 +145,7 @@ export function Select<Value>(
|
|
|
143
145
|
size,
|
|
144
146
|
...inputProps
|
|
145
147
|
} = props;
|
|
146
|
-
const classes = useStyles({
|
|
148
|
+
const classes = useStyles({ tweakStyles });
|
|
147
149
|
|
|
148
150
|
const { shouldRenderInList: shouldRenderSearchInputInList = false, ...searchInputProps } =
|
|
149
151
|
searchInput ?? {};
|
|
@@ -59,7 +59,7 @@ export function SelectList<Value>({
|
|
|
59
59
|
convertValueToReactNode = convertValueToString,
|
|
60
60
|
convertValueToId,
|
|
61
61
|
}: ISelectListProps<Value>): JSX.Element {
|
|
62
|
-
const classes = useStyles({
|
|
62
|
+
const classes = useStyles({ tweakStyles });
|
|
63
63
|
|
|
64
64
|
const isHeaderNotEmpty = isReactNodeNotEmpty(customListHeader);
|
|
65
65
|
const isFooterNotEmpty = isReactNodeNotEmpty(customListFooter);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ITweakStylesProps } from '../../types';
|
|
3
3
|
import { ISkeletonStyles, useStyles } from './Skeleton.styles';
|
|
4
4
|
|
|
5
|
-
export interface ISkeletonProps extends
|
|
5
|
+
export interface ISkeletonProps extends ITweakStylesProps<ISkeletonStyles> {
|
|
6
6
|
height?: CSSProperties['height'];
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const Skeleton: FC<ISkeletonProps> = ({ height, tweakStyles }) => {
|
|
10
|
-
const classes = useStyles({
|
|
10
|
+
const classes = useStyles({ tweakStyles });
|
|
11
11
|
return <div className={classes.root} style={{ height }} />;
|
|
12
12
|
};
|
|
@@ -41,7 +41,7 @@ export const Switch = <V extends string>({
|
|
|
41
41
|
testId,
|
|
42
42
|
onChange,
|
|
43
43
|
}: ISwitchProps<V>): JSX.Element => {
|
|
44
|
-
const classes = useStyles({
|
|
44
|
+
const classes = useStyles({ tweakStyles });
|
|
45
45
|
|
|
46
46
|
const handleChange = () => onChange({ name: value, isEnabled: !isChecked });
|
|
47
47
|
|
|
@@ -87,7 +87,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, ITextAreaProps>(function
|
|
|
87
87
|
},
|
|
88
88
|
ref,
|
|
89
89
|
) {
|
|
90
|
-
const classes = useStyles({
|
|
90
|
+
const classes = useStyles({ tweakStyles });
|
|
91
91
|
|
|
92
92
|
const shouldShowCounter = hasCounter && isNotEmpty(maxLength);
|
|
93
93
|
const counterString = `${value.length} / ${maxLength}`;
|
|
@@ -60,7 +60,7 @@ export const TextButton = forwardRef<HTMLButtonElement, ITextButtonProps>(functi
|
|
|
60
60
|
},
|
|
61
61
|
ref,
|
|
62
62
|
) {
|
|
63
|
-
const classes = useStyles({
|
|
63
|
+
const classes = useStyles({ tweakStyles });
|
|
64
64
|
|
|
65
65
|
const tweakPreloaderStyles = useTweakStyles({
|
|
66
66
|
innerStyles: preloaderStyles,
|
|
@@ -49,7 +49,7 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
|
|
|
49
49
|
data,
|
|
50
50
|
tweakStyles,
|
|
51
51
|
}) => {
|
|
52
|
-
const classes = useStyles({
|
|
52
|
+
const classes = useStyles({ tweakStyles });
|
|
53
53
|
|
|
54
54
|
const tweakTooltipStyles = useTweakStyles({
|
|
55
55
|
tweakStyles,
|
|
@@ -21,7 +21,7 @@ export const ThemedPreloader: FC<IThemedPreloaderProps> = ({
|
|
|
21
21
|
testId,
|
|
22
22
|
tweakStyles,
|
|
23
23
|
}) => {
|
|
24
|
-
const classes = useStyles({
|
|
24
|
+
const classes = useStyles({ tweakStyles });
|
|
25
25
|
|
|
26
26
|
const tweakDotsPreloaderStyles = useTweakStyles({
|
|
27
27
|
tweakStyles,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
3
3
|
import { useStyles, IDotsPreloaderStyles } from './DotsPreloader.styles';
|
|
4
4
|
|
|
5
|
-
export type IDotsPreloaderProps =
|
|
5
|
+
export type IDotsPreloaderProps = ITweakStylesProps<IDotsPreloaderStyles>;
|
|
6
6
|
|
|
7
7
|
export const DotsPreloader: FC<IDotsPreloaderProps> = ({ tweakStyles }) => {
|
|
8
|
-
const classes = useStyles({
|
|
8
|
+
const classes = useStyles({ tweakStyles });
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<div className={classes.root}>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { useTheme } from '../../../../theme';
|
|
3
|
-
import {
|
|
3
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
4
4
|
import { IPreloaderSvgType } from '../../types';
|
|
5
5
|
import { DefaultPreloader } from '../DefaultPreloader';
|
|
6
6
|
import { ISvgPreloaderStyles, useStyles } from './SvgPreloader.styles';
|
|
7
7
|
|
|
8
|
-
export interface ISvgPreloaderProps extends
|
|
8
|
+
export interface ISvgPreloaderProps extends ITweakStylesProps<ISvgPreloaderStyles> {
|
|
9
9
|
type: IPreloaderSvgType;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const SvgPreloader: FC<ISvgPreloaderProps> = ({ type = 'default', tweakStyles }) => {
|
|
13
|
-
const classes = useStyles({
|
|
13
|
+
const classes = useStyles({ tweakStyles });
|
|
14
14
|
|
|
15
15
|
const theme = useTheme();
|
|
16
16
|
const PreloaderIcon = theme.preloaders?.[type] ?? DefaultPreloader;
|
|
@@ -19,7 +19,7 @@ export const WithMessages = forwardRef<HTMLDivElement, IWithMessagesProps>(funct
|
|
|
19
19
|
{ children, infoMessage, errorMessage, controlsDirection, tweakStyles, testId, data },
|
|
20
20
|
ref,
|
|
21
21
|
) {
|
|
22
|
-
const classes = useStyles({
|
|
22
|
+
const classes = useStyles({ tweakStyles });
|
|
23
23
|
|
|
24
24
|
const shouldShowError = isReactNodeNotEmpty(errorMessage);
|
|
25
25
|
const shouldShowInfo = isReactNodeNotEmpty(infoMessage) && !shouldShowError;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { getTestId, isReactNodeNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
3
3
|
import { useTweakStyles } from '../../hooks';
|
|
4
|
-
import {
|
|
4
|
+
import { IReplaceTweakStylesProps } from '../../types';
|
|
5
5
|
import { ITooltipProps, Tooltip } from '../Tooltip';
|
|
6
6
|
import { IWithPopupProps, WithPopup } from '../WithPopup';
|
|
7
7
|
import { IWithTooltipStyles, withPopupStyles } from './WithTooltip.styles';
|
|
8
8
|
|
|
9
9
|
export interface IWithTooltipProps
|
|
10
10
|
extends Omit<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ICommonProps<IWithTooltipStyles> {
|
|
11
|
+
IReplaceTweakStylesProps<IWithPopupProps, IWithTooltipStyles>,
|
|
12
|
+
'trigger' | 'children' | 'placement' | 'eventType' | 'isTriggerWrapped'
|
|
13
|
+
> {
|
|
15
14
|
children: IWithPopupProps['trigger'];
|
|
16
15
|
/** @default 'hover' */
|
|
17
16
|
eventType?: IWithPopupProps['eventType'];
|
package/src/types.ts
CHANGED
|
@@ -29,6 +29,11 @@ export interface ITweakStylesProps<TweakStyles> {
|
|
|
29
29
|
|
|
30
30
|
export type ICommonProps<TweakStyles> = IDataAttributesProps & ITweakStylesProps<TweakStyles>;
|
|
31
31
|
|
|
32
|
+
export type IReplaceTweakStylesProps<
|
|
33
|
+
T extends ITweakStylesProps<unknown>,
|
|
34
|
+
P,
|
|
35
|
+
> = ITweakStylesProps<P> & Omit<T, 'tweakStyles'>;
|
|
36
|
+
|
|
32
37
|
export interface IDropdownWithPopperOptions {
|
|
33
38
|
shouldUsePopper?: boolean;
|
|
34
39
|
shouldRenderInBody?: boolean;
|