@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.
Files changed (81) hide show
  1. package/dist/components/DateInput/DateInput.d.ts +2 -2
  2. package/dist/components/DatePicker/DatePicker.d.ts +2 -2
  3. package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.d.ts +2 -2
  4. package/dist/components/Flag/Flag.d.ts +2 -2
  5. package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.d.ts +2 -2
  6. package/dist/components/FloatDocActions/components/DocActions/DocActions.d.ts +2 -2
  7. package/dist/components/IncrementInput/IncrementInput.d.ts +2 -2
  8. package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.d.ts +2 -2
  9. package/dist/components/PhoneInput/PhoneInput.d.ts +2 -2
  10. package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.d.ts +2 -2
  11. package/dist/components/SearchInput/SearchInput.d.ts +3 -3
  12. package/dist/components/Select/Select.d.ts +2 -2
  13. package/dist/components/Skeleton/Skeleton.d.ts +2 -2
  14. package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.d.ts +2 -2
  15. package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.d.ts +2 -2
  16. package/dist/components/WithTooltip/WithTooltip.d.ts +2 -2
  17. package/dist/true-react-common-ui-kit.js +56 -56
  18. package/dist/true-react-common-ui-kit.js.map +1 -1
  19. package/dist/true-react-common-ui-kit.umd.cjs +1 -1
  20. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  21. package/dist/types.d.ts +1 -0
  22. package/package.json +1 -1
  23. package/src/components/AccountInfo/AccountInfo.tsx +1 -1
  24. package/src/components/AddButton/AddButton.tsx +1 -1
  25. package/src/components/Button/Button.tsx +1 -1
  26. package/src/components/Checkbox/Checkbox.tsx +1 -1
  27. package/src/components/CloseButton/CloseButton.tsx +1 -1
  28. package/src/components/ControlWrapper/ControlWrapper.tsx +1 -1
  29. package/src/components/CssBaseline/CssBaseline.tsx +1 -1
  30. package/src/components/DateInput/DateInput.tsx +6 -4
  31. package/src/components/DatePicker/DatePicker.tsx +5 -3
  32. package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.tsx +3 -3
  33. package/src/components/Description/Description.tsx +1 -1
  34. package/src/components/FileInput/FileInput.tsx +1 -1
  35. package/src/components/FileItem/FileItem.tsx +1 -1
  36. package/src/components/FiltersPane/FiltersPane.tsx +1 -1
  37. package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +1 -1
  38. package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +1 -1
  39. package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +1 -1
  40. package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +1 -1
  41. package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +1 -1
  42. package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +1 -1
  43. package/src/components/Flag/Flag.tsx +3 -3
  44. package/src/components/FlexibleTable/FlexibleTable.tsx +1 -1
  45. package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.tsx +3 -3
  46. package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +1 -1
  47. package/src/components/FloatDocActions/components/DocActions/DocActions.tsx +3 -4
  48. package/src/components/Icon/Icon.tsx +1 -1
  49. package/src/components/IconButton/IconButton.tsx +1 -1
  50. package/src/components/IncrementInput/IncrementInput.tsx +6 -4
  51. package/src/components/Input/InputBase.tsx +1 -1
  52. package/src/components/List/List.tsx +1 -1
  53. package/src/components/List/components/ListItem/ListItem.tsx +1 -1
  54. package/src/components/Modal/Modal.tsx +1 -1
  55. package/src/components/MoreMenu/MoreMenu.tsx +1 -1
  56. package/src/components/MultiSelect/MultiSelect.tsx +1 -1
  57. package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.tsx +3 -4
  58. package/src/components/MultiSelectList/MultiSelectList.tsx +1 -1
  59. package/src/components/NewMoreMenu/NewMoreMenu.tsx +1 -1
  60. package/src/components/Notification/Notification.tsx +1 -1
  61. package/src/components/PhoneInput/PhoneInput.tsx +5 -6
  62. package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +3 -3
  63. package/src/components/RadioButton/RadioButton.tsx +1 -1
  64. package/src/components/SearchInput/SearchInput.tsx +4 -5
  65. package/src/components/Select/Select.tsx +6 -4
  66. package/src/components/Select/components/SelectList/SelectList.tsx +1 -1
  67. package/src/components/Skeleton/Skeleton.tsx +3 -3
  68. package/src/components/Status/Status.tsx +1 -1
  69. package/src/components/Switch/Switch.tsx +1 -1
  70. package/src/components/TextArea/TextArea.tsx +1 -1
  71. package/src/components/TextButton/TextButton.tsx +1 -1
  72. package/src/components/TextWithInfo/TextWithInfo.tsx +1 -1
  73. package/src/components/TextWithTooltip/TextWithTooltip.tsx +1 -1
  74. package/src/components/ThemedPreloader/ThemedPreloader.tsx +1 -1
  75. package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.tsx +3 -3
  76. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +3 -3
  77. package/src/components/Toaster/Toaster.tsx +1 -1
  78. package/src/components/Tooltip/Tooltip.tsx +1 -1
  79. package/src/components/WithMessages/WithMessages.tsx +1 -1
  80. package/src/components/WithTooltip/WithTooltip.tsx +4 -5
  81. 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 { ICommonProps, IDropdownWithPopperOptions } from '../../types';
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<IInputProps, 'value' | 'onChange' | 'onBlur' | 'type' | 'tweakStyles'>,
48
- ICommonProps<ISelectStyles> {
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({ theme: tweakStyles });
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({ theme: tweakStyles });
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 { ICommonProps } from '../../types';
2
+ import { ITweakStylesProps } from '../../types';
3
3
  import { ISkeletonStyles, useStyles } from './Skeleton.styles';
4
4
 
5
- export interface ISkeletonProps extends Pick<ICommonProps<ISkeletonStyles>, 'tweakStyles'> {
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({ theme: tweakStyles });
10
+ const classes = useStyles({ tweakStyles });
11
11
  return <div className={classes.root} style={{ height }} />;
12
12
  };
@@ -31,7 +31,7 @@ export const Status: FC<IStatusProps> = ({
31
31
  testId,
32
32
  data,
33
33
  }) => {
34
- const classes = useStyles({ theme: tweakStyles });
34
+ const classes = useStyles({ tweakStyles });
35
35
 
36
36
  return (
37
37
  <span
@@ -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({ theme: tweakStyles });
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({ theme: tweakStyles });
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({ theme: tweakStyles });
63
+ const classes = useStyles({ tweakStyles });
64
64
 
65
65
  const tweakPreloaderStyles = useTweakStyles({
66
66
  innerStyles: preloaderStyles,
@@ -28,7 +28,7 @@ export const TextWithInfo: FC<ITextWithInfoProps> = ({
28
28
  data,
29
29
  tweakStyles,
30
30
  }) => {
31
- const classes = useStyles({ theme: tweakStyles });
31
+ const classes = useStyles({ tweakStyles });
32
32
 
33
33
  return (
34
34
  <div
@@ -49,7 +49,7 @@ export const TextWithTooltip: FC<ITextWithTooltipProps> = ({
49
49
  data,
50
50
  tweakStyles,
51
51
  }) => {
52
- const classes = useStyles({ theme: tweakStyles });
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({ theme: tweakStyles });
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 { ICommonProps } from '../../../../types';
2
+ import { ITweakStylesProps } from '../../../../types';
3
3
  import { useStyles, IDotsPreloaderStyles } from './DotsPreloader.styles';
4
4
 
5
- export type IDotsPreloaderProps = Pick<ICommonProps<IDotsPreloaderStyles>, 'tweakStyles'>;
5
+ export type IDotsPreloaderProps = ITweakStylesProps<IDotsPreloaderStyles>;
6
6
 
7
7
  export const DotsPreloader: FC<IDotsPreloaderProps> = ({ tweakStyles }) => {
8
- const classes = useStyles({ theme: tweakStyles });
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 { ICommonProps } from '../../../../types';
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 Pick<ICommonProps<ISvgPreloaderStyles>, 'tweakStyles'> {
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({ theme: tweakStyles });
13
+ const classes = useStyles({ tweakStyles });
14
14
 
15
15
  const theme = useTheme();
16
16
  const PreloaderIcon = theme.preloaders?.[type] ?? DefaultPreloader;
@@ -47,7 +47,7 @@ export const Toaster: FC<IToasterProps> = ({
47
47
  onClose,
48
48
  onTimeEnd,
49
49
  }) => {
50
- const classes = useStyles({ theme: tweakStyles });
50
+ const classes = useStyles({ tweakStyles });
51
51
 
52
52
  const tweakCloseButtonStyles = useTweakStyles({
53
53
  tweakStyles,
@@ -24,7 +24,7 @@ export const Tooltip: FC<ITooltipProps> = ({
24
24
  testId,
25
25
  tweakStyles,
26
26
  }) => {
27
- const classes = useStyles({ theme: tweakStyles });
27
+ const classes = useStyles({ tweakStyles });
28
28
 
29
29
  return (
30
30
  <div
@@ -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({ theme: tweakStyles });
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 { ICommonProps } from '../../types';
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
- IWithPopupProps,
12
- 'trigger' | 'children' | 'placement' | 'eventType' | 'isTriggerWrapped' | 'tweakStyles'
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;