@true-engineering/true-react-common-ui-kit 4.0.0-alpha54 → 4.0.0-alpha61

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 (151) hide show
  1. package/README.md +1 -0
  2. package/dist/components/AddButton/AddButton.d.ts +1 -0
  3. package/dist/components/AddButton/AddButton.styles.d.ts +1 -1
  4. package/dist/components/Button/Button.styles.d.ts +1 -1
  5. package/dist/components/Checkbox/Checkbox.styles.d.ts +1 -1
  6. package/dist/components/ControlWrapper/ControlWrapper.d.ts +1 -1
  7. package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +1 -1
  8. package/dist/components/CssBaseline/CssBaseline.styles.d.ts +1 -1
  9. package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.d.ts +1 -1
  10. package/dist/components/Description/Description.styles.d.ts +1 -1
  11. package/dist/components/FileInput/FileInput.styles.d.ts +1 -1
  12. package/dist/components/FileItem/FileItem.styles.d.ts +1 -1
  13. package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.styles.d.ts +1 -1
  14. package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.styles.d.ts +2 -2
  15. package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +2 -2
  16. package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +1 -1
  17. package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +1 -1
  18. package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +1 -1
  19. package/dist/components/FiltersPane/types.d.ts +2 -1
  20. package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +1 -1
  21. package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +1 -1
  22. package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +1 -3
  23. package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.d.ts +1 -1
  24. package/dist/components/FloatDocActions/components/DocActions/DocActions.styles.d.ts +1 -1
  25. package/dist/components/IconButton/IconButton.styles.d.ts +1 -1
  26. package/dist/components/List/components/ListItem/ListItem.styles.d.ts +1 -1
  27. package/dist/components/Modal/Modal.styles.d.ts +1 -1
  28. package/dist/components/MoreMenu/MoreMenu.styles.d.ts +1 -1
  29. package/dist/components/MultiSelect/MultiSelect.styles.d.ts +1 -1
  30. package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.d.ts +1 -1
  31. package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +1 -1
  32. package/dist/components/NewMoreMenu/NewMoreMenu.styles.d.ts +1 -1
  33. package/dist/components/Notification/Notification.styles.d.ts +1 -1
  34. package/dist/components/PhoneInput/PhoneInput.styles.d.ts +1 -1
  35. package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +1 -1
  36. package/dist/components/RadioButton/RadioButton.styles.d.ts +1 -1
  37. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  38. package/dist/components/Select/Select.styles.d.ts +3 -3
  39. package/dist/components/Select/components/SelectList/SelectList.styles.d.ts +1 -1
  40. package/dist/components/Selector/Selector.styles.d.ts +1 -1
  41. package/dist/components/Status/Status.styles.d.ts +1 -1
  42. package/dist/components/Switch/Switch.d.ts +3 -2
  43. package/dist/components/Switch/Switch.styles.d.ts +3 -2
  44. package/dist/components/Switch/types.d.ts +3 -0
  45. package/dist/components/TextArea/TextArea.styles.d.ts +1 -1
  46. package/dist/components/TextButton/TextButton.styles.d.ts +1 -1
  47. package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +1 -1
  48. package/dist/components/TextWithTooltip/TextWithTooltip.d.ts +2 -0
  49. package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +1 -1
  50. package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +1 -1
  51. package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +1 -1
  52. package/dist/components/Toaster/Toaster.styles.d.ts +1 -1
  53. package/dist/components/Tooltip/Tooltip.d.ts +3 -0
  54. package/dist/components/Tooltip/Tooltip.styles.d.ts +2 -1
  55. package/dist/components/Tooltip/types.d.ts +3 -0
  56. package/dist/components/WithMessages/WithMessages.styles.d.ts +1 -1
  57. package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
  58. package/dist/components/WithTooltip/WithTooltip.d.ts +2 -0
  59. package/dist/helpers/misc.d.ts +2 -0
  60. package/dist/hooks/index.d.ts +1 -0
  61. package/dist/hooks/use-intersection-ref.d.ts +2 -1
  62. package/dist/hooks/use-resize-ref.d.ts +7 -0
  63. package/dist/hooks/use-tweak-styles.d.ts +3 -2
  64. package/dist/theme/Provider.d.ts +2 -12
  65. package/dist/theme/common.d.ts +34 -4
  66. package/dist/theme/helpers.d.ts +3 -16
  67. package/dist/theme/index.d.ts +0 -2
  68. package/dist/theme/types.d.ts +9 -8
  69. package/dist/true-react-common-ui-kit.js +12132 -10
  70. package/dist/true-react-common-ui-kit.js.map +1 -1
  71. package/dist/true-react-common-ui-kit.umd.cjs +2 -10
  72. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  73. package/dist/types.d.ts +3 -3
  74. package/package.json +1 -3
  75. package/src/components/AccountInfo/AccountInfo.tsx +2 -3
  76. package/src/components/AddButton/AddButton.tsx +3 -5
  77. package/src/components/Button/Button.tsx +76 -77
  78. package/src/components/CloseButton/CloseButton.tsx +2 -4
  79. package/src/components/Colors/Colors.stories.tsx +3 -2
  80. package/src/components/ControlWrapper/ControlWrapper.tsx +2 -2
  81. package/src/components/CssBaseline/CssBaseline.styles.ts +2 -0
  82. package/src/components/CssBaseline/CssBaseline.tsx +2 -3
  83. package/src/components/DateInput/DateInput.tsx +59 -61
  84. package/src/components/DatePicker/DatePicker.tsx +259 -262
  85. package/src/components/Description/Description.tsx +2 -3
  86. package/src/components/FileInput/FileInput.tsx +87 -95
  87. package/src/components/FileItem/FileItem.tsx +2 -4
  88. package/src/components/FiltersPane/FiltersPane.stories.tsx +3 -0
  89. package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +2 -3
  90. package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +6 -3
  91. package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +3 -2
  92. package/src/components/FiltersPane/types.ts +2 -0
  93. package/src/components/FlexibleTable/FlexibleTable.styles.ts +1 -0
  94. package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.ts +1 -0
  95. package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.tsx +5 -2
  96. package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +9 -7
  97. package/src/components/IconButton/IconButton.tsx +44 -48
  98. package/src/components/Input/Input.tsx +26 -24
  99. package/src/components/Input/InputBase.tsx +183 -187
  100. package/src/components/List/List.tsx +2 -3
  101. package/src/components/List/components/ListItem/ListItem.tsx +2 -4
  102. package/src/components/Modal/Modal.tsx +2 -4
  103. package/src/components/MoreMenu/MoreMenu.tsx +2 -4
  104. package/src/components/MultiSelect/MultiSelect.tsx +2 -4
  105. package/src/components/NewMoreMenu/NewMoreMenu.tsx +2 -4
  106. package/src/components/Notification/Notification.tsx +2 -3
  107. package/src/components/NumberInput/NumberInput.tsx +91 -93
  108. package/src/components/PhoneInput/PhoneInput.tsx +2 -3
  109. package/src/components/SearchInput/SearchInput.tsx +20 -19
  110. package/src/components/Select/Select.tsx +1 -1
  111. package/src/components/Selector/Selector.tsx +4 -6
  112. package/src/components/SmartInput/SmartInput.tsx +85 -87
  113. package/src/components/Status/Status.tsx +5 -4
  114. package/src/components/Switch/Switch.styles.ts +21 -13
  115. package/src/components/Switch/Switch.tsx +11 -6
  116. package/src/components/Switch/types.ts +5 -0
  117. package/src/components/TextArea/TextArea.tsx +128 -130
  118. package/src/components/TextButton/TextButton.tsx +68 -69
  119. package/src/components/TextWithInfo/TextWithInfo.tsx +2 -4
  120. package/src/components/TextWithTooltip/TextWithTooltip.tsx +6 -4
  121. package/src/components/ThemedPreloader/ThemedPreloader.tsx +2 -4
  122. package/src/components/Toaster/Toaster.tsx +2 -4
  123. package/src/components/Tooltip/Tooltip.stories.tsx +10 -0
  124. package/src/components/Tooltip/Tooltip.styles.ts +2 -1
  125. package/src/components/Tooltip/Tooltip.tsx +12 -5
  126. package/src/components/Tooltip/types.ts +5 -0
  127. package/src/components/WithMessages/WithMessages.tsx +41 -40
  128. package/src/components/WithTooltip/WithTooltip.tsx +4 -0
  129. package/src/helpers/misc.ts +6 -0
  130. package/src/hooks/index.ts +1 -0
  131. package/src/hooks/use-intersection-ref.ts +24 -6
  132. package/src/hooks/use-latest-ref.ts +6 -2
  133. package/src/hooks/use-resize-ref.ts +35 -0
  134. package/src/hooks/use-tweak-styles.ts +14 -51
  135. package/src/theme/Provider.tsx +4 -21
  136. package/src/theme/common.ts +33 -36
  137. package/src/theme/helpers.ts +50 -42
  138. package/src/theme/index.ts +0 -2
  139. package/src/theme/types.ts +13 -10
  140. package/src/types.ts +3 -3
  141. package/dist/theme/create-themed-styles.d.ts +0 -2
  142. package/dist/theme/true-jss/ThemedStylesManager.d.ts +0 -18
  143. package/dist/theme/true-jss/TweakStylesManager.d.ts +0 -34
  144. package/dist/theme/true-jss/index.d.ts +0 -2
  145. package/dist/theme/true-jss/jss-context.d.ts +0 -9
  146. package/dist/true-react-common-ui-kit.css +0 -756
  147. package/src/theme/create-themed-styles.ts +0 -78
  148. package/src/theme/true-jss/ThemedStylesManager.ts +0 -93
  149. package/src/theme/true-jss/TweakStylesManager.ts +0 -156
  150. package/src/theme/true-jss/index.ts +0 -2
  151. package/src/theme/true-jss/jss-context.tsx +0 -34
@@ -1,3 +1,3 @@
1
1
  import { ITweakStyles } from '../../theme';
2
- export declare const useStyles: import('../../theme').IUseStyles<"active" | "disabled" | "clickable" | "animationEnd" | "animationStart" | "arrow" | "trigger" | "popup" | "dropdown-initial" | "dropdown-open" | "dropdown-close" | "dropdown-unmounted">;
2
+ export declare const useStyles: import('../../theme').IUseStyles<"trigger" | "clickable" | "active" | "disabled" | "popup" | "arrow" | "animationEnd" | "animationStart" | "dropdown-initial" | "dropdown-open" | "dropdown-close" | "dropdown-unmounted">;
3
3
  export type IWithPopupStyles = ITweakStyles<typeof useStyles>;
@@ -14,5 +14,7 @@ export interface IWithTooltipProps extends Omit<IWithPopupProps, 'trigger' | 'ch
14
14
  tooltipView?: ITooltipProps['view'];
15
15
  /** @default 'info' */
16
16
  tooltipType?: ITooltipProps['type'];
17
+ /** @default 'undefined' */
18
+ tooltipSize?: ITooltipProps['size'];
17
19
  }
18
20
  export declare const WithTooltip: FC<IWithTooltipProps>;
@@ -1,3 +1,4 @@
1
+ import { ComponentType, memo } from 'react';
1
2
  import { IDataAttributes } from '../types';
2
3
  export { default as rgba } from 'hex-to-rgba';
3
4
  /** @deprecated Используйте `toKebabCase` из `true-react-platform-helpers` */
@@ -19,3 +20,4 @@ export declare const trimStringToMaxLength: (val: string, maxLength: number) =>
19
20
  /** @deprecated Используйте `addDataAttributes` из `true-react-platform-helpers` */
20
21
  export declare const addDataAttributes: (data?: IDataAttributes) => IDataAttributes;
21
22
  export declare const excludeStorybookParams: (params: string[]) => RegExp;
23
+ export declare const genericMemo: <T extends ComponentType<any>>(...args: Parameters<typeof memo<T>>) => T;
@@ -1,6 +1,7 @@
1
1
  export * from './use-did-mount-effect';
2
2
  export * from './use-dropdown';
3
3
  export * from './use-intersection-ref';
4
+ export * from './use-resize-ref';
4
5
  export * from './use-is-mounted';
5
6
  export * from './use-latest-ref';
6
7
  export * from './use-merge';
@@ -4,5 +4,6 @@ export interface IInsertionRefOptions {
4
4
  isDisabled?: boolean;
5
5
  onIntersection?: VoidFunction;
6
6
  onIntersectionEnd?: VoidFunction;
7
+ observerOptions?: IntersectionObserverInit;
7
8
  }
8
- export declare const useIntersectionRef: (options?: IInsertionRefOptions) => RefCallback<Element>;
9
+ export declare const useIntersectionRef: ({ observerOptions, ...options }: IInsertionRefOptions) => RefCallback<Element>;
@@ -0,0 +1,7 @@
1
+ import { RefCallback } from 'react';
2
+ export interface IResizeRefOptions {
3
+ /** @default false */
4
+ isDisabled?: boolean;
5
+ onChange: (entry: ResizeObserverEntry) => void;
6
+ }
7
+ export declare const useResizeRef: (options: IResizeRefOptions) => RefCallback<Element>;
@@ -1,4 +1,5 @@
1
- import { IComponentName, IMaybeArray, IMixedStyles } from '../theme';
1
+ import { IMaybeArray } from '@true-engineering/true-react-platform-helpers';
2
+ import { IComponentName, IMixedStyles } from '../theme';
2
3
  export declare const useTweakStyles: <StyleSheet, ClassName extends keyof StyleSheet & `tweak${string}`>({ innerStyles, tweakStyles, className, currentComponentName, }: {
3
4
  /**
4
5
  * Это tweakStyles, определенные в родительском компоненте
@@ -15,7 +16,7 @@ export declare const useTweakStyles: <StyleSheet, ClassName extends keyof StyleS
15
16
  */
16
17
  className: ClassName;
17
18
  /**
18
- * Название компонента который вызывает useTweakStyles. (В данном примере 'Select')
19
+ * Название компонента который вызывает useTweakStyles
19
20
  */
20
21
  currentComponentName?: IComponentName;
21
22
  }) => Array<NonNullable<StyleSheet[ClassName]>>;
@@ -1,14 +1,4 @@
1
- import { FC, ReactNode } from 'react';
2
1
  import { IUiKitTheme } from './types';
3
- export interface IThemedProviderProps {
4
- theme: IUiKitTheme;
5
- children: ReactNode;
6
- }
7
- export declare const getTheme: () => IUiKitTheme;
8
- interface ThemeContextValue {
9
- theme: IUiKitTheme;
10
- }
11
- export declare const ThemeContext: import('react').Context<ThemeContextValue>;
12
- export declare const ThemeProvider: FC<IThemedProviderProps>;
2
+ export declare const ThemeContext: import('react').Context<IUiKitTheme>;
3
+ export declare const ThemeProvider: import('react').Provider<IUiKitTheme>;
13
4
  export declare const useTheme: () => IUiKitTheme;
14
- export {};
@@ -1,4 +1,3 @@
1
- import { Styles } from 'react-jss';
2
1
  import { IUiKitTheme } from './types';
3
2
  export declare const colors: {
4
3
  readonly FONT_MAIN: "#222a37";
@@ -43,10 +42,41 @@ export declare const dimensions: {
43
42
  };
44
43
  };
45
44
  export declare const helpers: {
46
- withAngle: (angleSize?: number, position?: "left" | "right", distance?: number) => Styles;
45
+ withAngle: (angleSize?: number, position?: "left" | "right", distance?: number) => {
46
+ display: "inline-block";
47
+ position: "relative";
48
+ marginTop: number;
49
+ boxShadow: "0 8px 20px 0 rgba(0, 0, 0, 0.04)";
50
+ border: (string | number)[];
51
+ borderRadius: 4;
52
+ '&:before': {
53
+ content: "\"\"";
54
+ position: "absolute";
55
+ top: number;
56
+ left: number | false;
57
+ right: number | false;
58
+ width: number;
59
+ height: number;
60
+ borderLeft: (string | number)[];
61
+ borderRight: (string | number)[];
62
+ borderBottom: (string | number)[];
63
+ };
64
+ '&:after': {
65
+ content: "\"\"";
66
+ position: "absolute";
67
+ top: number;
68
+ left: number | false;
69
+ right: number | false;
70
+ width: number;
71
+ height: number;
72
+ borderLeft: (string | number)[];
73
+ borderRight: (string | number)[];
74
+ borderBottom: (string | number)[];
75
+ };
76
+ };
47
77
  withScrollBar: {
48
- boxSizing: string;
49
- overflow: string;
78
+ boxSizing: "border-box";
79
+ overflow: "auto";
50
80
  '@supports selector(::-webkit-scrollbar)': {
51
81
  '--webkit-scrollbar-width': string;
52
82
  '--webkit-scrollbar-height': string;
@@ -1,16 +1,3 @@
1
- import { IMaybeArray } from './types';
2
- export declare const isTweakStyle: (key: string) => boolean;
3
- export declare const isStylesNotEmpty: <T>(tweakStyles?: T) => tweakStyles is NonNullable<T>;
4
- export declare const cleanStyles: <T>(tweakStyles?: T) => T;
5
- export declare const mergeTweakStyles: <T>(tweakStyles?: IMaybeArray<T>) => T | undefined;
6
- export declare const checkStyles: (componentName: string, styles: Record<string, unknown>) => void;
7
- export declare const areStylesThemed: (styles: Record<string, unknown>) => boolean;
8
- /**
9
- * Подмешивает стили из темы. Мутирует, добавляя специально поле,
10
- * по которому можно определить была ли уже произведена мутация ранее,
11
- * тем самым сохраняя ссылку на объект и позволяя этим кэшировать JSS стили
12
- */
13
- export declare const themedStyles: <T>(styles: T, themeComponentStyles: T) => T;
14
- type TweakStylesCache = (styles: object[], prev?: object[]) => object | undefined;
15
- export declare const getTweakStylesCache: () => TweakStylesCache;
16
- export {};
1
+ import { IComponentName, IStyles, IUseStyles } from './types';
2
+ export declare const useThemeComponentStyles: <T>(componentName?: IComponentName) => Partial<T> | undefined;
3
+ export declare const createThemedStyles: <C extends string>(...args: [IStyles<C>] | [IComponentName, IStyles<C>]) => IUseStyles<C>;
@@ -1,6 +1,4 @@
1
1
  export * from './Provider';
2
- export * from './true-jss';
3
2
  export * from './common';
4
3
  export * from './types';
5
4
  export * from './helpers';
6
- export * from './create-themed-styles';
@@ -1,13 +1,14 @@
1
- import { Styles } from 'react-jss';
2
- import { Classes, JssValue } from 'jss';
1
+ import { Classes, JssStyle, JssValue, Styles } from 'jss';
2
+ import { IMaybeArray } from '@true-engineering/true-react-platform-helpers';
3
3
  import { IAccountInfoStyles, IAddButtonStyles, IButtonStyles, ICheckboxStyles, ICloseButtonStyles, IControlWrapperStyles, ICssBaselineStyles, IDateInputStyles, IDatePickerHeaderStyles, IDatePickerStyles, IDescriptionStyles, IDocActionsStyles, IDotsPreloaderStyles, IFileInputStyles, IFileItemStyles, IFilterIntervalStyles, IFilterSelectStyles, IFiltersPaneSearchStyles, IFiltersPaneStyles, IFilterValueViewStyles, IFilterWithDatesStyles, IFilterWithPeriodStyles, IFilterWrapperStyles, IFlagStyles, IFlexibleTableCellStyles, IFlexibleTableRowStyles, IFlexibleTableStyles, IIconButtonStyles, IIconStyles, IIconType, IIncrementInputStyles, IInputStyles, IListItemStyles, IListStyles, IModalStyles, IMoreMenuStyles, IMultiSelectInputStyles, IMultiSelectListStyles, IMultiSelectStyles, INewMoreMenuStyles, INotificationStyles, IPhoneInputCountryListStyles, IPhoneInputStyles, IPreloaderSvgType, IRadioButtonStyles, ISearchInputStyles, ISelectListStyles, ISelectorStyles, ISelectStyles, ISkeletonStyles, IStatusStyles, ISvgIcon, ISvgPreloaderStyles, ISwitchStyles, ITextAreaStyles, ITextButtonStyles, ITextWithInfoStyles, ITextWithTooltipStyles, IThemedPreloaderStyles, IToasterStyles, ITooltipStyles, IWithMessagesStyles, IWithPopupStyles, IWithTooltipStyles } from '../components';
4
- export type IStyles<C extends string, P = unknown> = Styles<C, P, Partial<Styles<C, P>>>;
5
- export type IMaybeArray<T> = T[] | T;
4
+ export type IStyles<C extends string> = Styles<C>;
5
+ export type IStyle = JssStyle;
6
6
  export type IMixedStyles<T> = IMaybeArray<T | boolean | undefined>;
7
- export type IUseStyles<C extends string, P = unknown> = (data?: P & {
8
- theme?: IMaybeArray<Partial<Styles<C, P>>>;
7
+ export type IUseStyles<C extends string> = (data: {
8
+ theme?: IMaybeArray<Partial<IStyles<C>>>;
9
+ tweakStyles?: IMaybeArray<Partial<IStyles<C>>>;
9
10
  }) => Classes<C>;
10
- export type ITweakStyles<StyleCreator, ChildTweakStyles = unknown> = StyleCreator extends IUseStyles<infer C, infer P> ? Partial<Styles<C, P>> & Partial<ChildTweakStyles> : never;
11
+ export type ITweakStyles<StyleCreator, ChildTweakStyles = unknown> = StyleCreator extends IUseStyles<infer C> ? Partial<IStyles<C>> & Partial<ChildTweakStyles> : never;
11
12
  export interface IComponentStyles {
12
13
  AccountInfo: IAccountInfoStyles;
13
14
  AddButton: IAddButtonStyles;
@@ -73,7 +74,7 @@ export interface IComponentStyles {
73
74
  }
74
75
  export type IComponentName = keyof IComponentStyles;
75
76
  export type IUiKitAnimations = Record<string, any>;
76
- export type IUiKitHelpers = Record<string, Styles | (() => Styles)>;
77
+ export type IUiKitHelpers = Record<string, IStyle | (() => IStyle)>;
77
78
  export interface IUiKitTheme {
78
79
  components?: Partial<IComponentStyles>;
79
80
  icons?: Partial<Record<IIconType, ISvgIcon>>;