@true-engineering/true-react-common-ui-kit 2.6.0 → 2.7.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.
Files changed (75) hide show
  1. package/README.md +26 -0
  2. package/dist/components/Button/Button.d.ts +2 -1
  3. package/dist/components/FiltersPane/components/Filter/Filter.d.ts +1 -1
  4. package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.d.ts +1 -1
  5. package/dist/components/FiltersPane/constants.d.ts +1 -1
  6. package/dist/components/FiltersPane/types.d.ts +1 -1
  7. package/dist/components/Icon/helpers.d.ts +1 -1
  8. package/dist/components/Icon/icons-list.d.ts +1 -1
  9. package/dist/components/Icon/index.d.ts +1 -0
  10. package/dist/{helpers/snippets.d.ts → components/Icon/snippet.d.ts} +1 -1
  11. package/dist/components/Icon/types.d.ts +2 -1
  12. package/dist/components/Input/Input.d.ts +2 -1
  13. package/dist/components/List/List.d.ts +1 -1
  14. package/dist/components/List/List.styles.d.ts +0 -28
  15. package/dist/components/List/index.d.ts +0 -1
  16. package/dist/components/ListItem/ListItem.d.ts +6 -0
  17. package/dist/components/ListItem/ListItem.styles.d.ts +35 -0
  18. package/dist/components/ListItem/constants.d.ts +1 -0
  19. package/dist/components/ListItem/index.d.ts +3 -0
  20. package/dist/components/{List → ListItem}/types.d.ts +6 -1
  21. package/dist/components/MoreMenu/MoreMenu.d.ts +2 -2
  22. package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.d.ts +1 -1
  23. package/dist/components/NumberInput/helpers.d.ts +1 -1
  24. package/dist/components/PhoneInput/index.d.ts +0 -1
  25. package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +1 -1
  26. package/dist/components/Select/Select.d.ts +2 -1
  27. package/dist/components/Tooltip/Tooltip.styles.d.ts +1 -1
  28. package/dist/components/index.d.ts +1 -0
  29. package/dist/constants/index.d.ts +1 -0
  30. package/dist/constants/phone-info.d.ts +2 -0
  31. package/dist/helpers/phone.d.ts +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/true-react-common-ui-kit.js +24633 -24533
  34. package/dist/true-react-common-ui-kit.js.map +1 -1
  35. package/dist/true-react-common-ui-kit.umd.cjs +24633 -24533
  36. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  37. package/dist/types.d.ts +2 -4
  38. package/package.json +2 -1
  39. package/src/components/Button/Button.tsx +2 -2
  40. package/src/components/FiltersPane/components/Filter/Filter.tsx +1 -1
  41. package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +1 -1
  42. package/src/components/FiltersPane/constants.ts +1 -1
  43. package/src/components/FiltersPane/types.ts +1 -1
  44. package/src/components/Icon/{helpers.ts → helpers.tsx} +1 -1
  45. package/src/components/Icon/icons-list.ts +30 -0
  46. package/src/components/Icon/index.ts +1 -0
  47. package/src/{helpers/snippets.tsx → components/Icon/snippet.tsx} +2 -2
  48. package/src/components/Icon/types.ts +3 -1
  49. package/src/components/Input/Input.tsx +2 -3
  50. package/src/components/List/List.stories.tsx +3 -3
  51. package/src/components/List/List.styles.ts +0 -38
  52. package/src/components/List/List.tsx +9 -27
  53. package/src/components/List/index.ts +0 -1
  54. package/src/components/ListItem/ListItem.stories.tsx +67 -0
  55. package/src/components/ListItem/ListItem.styles.ts +48 -0
  56. package/src/components/ListItem/ListItem.tsx +45 -0
  57. package/src/components/ListItem/constants.ts +5 -0
  58. package/src/components/ListItem/index.ts +3 -0
  59. package/src/components/ListItem/types.ts +19 -0
  60. package/src/components/MoreMenu/MoreMenu.tsx +2 -2
  61. package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.tsx +2 -1
  62. package/src/components/NumberInput/helpers.ts +1 -1
  63. package/src/components/PhoneInput/PhoneInput.stories.tsx +1 -1
  64. package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +1 -1
  65. package/src/components/PhoneInput/index.ts +0 -1
  66. package/src/components/Select/Select.tsx +2 -2
  67. package/src/components/Tooltip/Tooltip.styles.ts +1 -1
  68. package/src/components/index.ts +1 -0
  69. package/src/constants/index.ts +1 -0
  70. package/src/{components/PhoneInput → constants}/phone-info.ts +1 -1
  71. package/src/helpers/phone.ts +2 -1
  72. package/src/index.ts +1 -1
  73. package/src/types.ts +2 -10
  74. package/dist/components/PhoneInput/phone-info.d.ts +0 -2
  75. package/src/components/List/types.ts +0 -13
package/README.md CHANGED
@@ -10,6 +10,32 @@
10
10
 
11
11
  # Release Notes
12
12
 
13
+ ## v2.7.0
14
+
15
+ ### Changes
16
+
17
+ - **ListItem**: вынесен компонент для отрисовки пункта из списка List
18
+ - **Icon**: добавлены иконки folder, folder-add, presentation
19
+
20
+ ## v2.6.0
21
+
22
+ ### Changes
23
+
24
+ - **Input**: изменен тип пропса `label` на ReactNode
25
+
26
+ ## v2.5.0
27
+
28
+ ### Changes
29
+
30
+ - **DatePicker**: добавлен тип для стилей `IDatePickerStyleProps`
31
+ - **Input**: добавлена пропса `shouldAlwaysShowPlaceholder`
32
+
33
+ ## v2.4.0
34
+
35
+ ### Changes
36
+
37
+ - Изменения по файловой структуре проекта
38
+
13
39
  ## v2.3.2
14
40
 
15
41
  ### Changes
@@ -1,5 +1,6 @@
1
1
  import { ReactNode, ButtonHTMLAttributes, MouseEvent } from 'react';
2
- import { ICommonProps, IIcon } from '../../types';
2
+ import { ICommonProps } from '../../types';
3
+ import { IIcon } from '../Icon';
3
4
  import { IThemedPreloaderProps } from '../ThemedPreloader';
4
5
  import { IButtonSize, IButtonView } from './types';
5
6
  import { ButtonStyles } from './Button.styles';
@@ -1,6 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
  import { Classes } from 'jss';
3
- import { IFilterWrapperProps } from '../FilterWrapper';
3
+ import type { IFilterWrapperProps } from '../FilterWrapper';
4
4
  export interface IFilterProps<Values, Key extends keyof Values> extends IFilterWrapperProps<Values, Key> {
5
5
  parentRef?: RefObject<HTMLElement>;
6
6
  isInline?: boolean;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { IFilterWrapperProps } from '../FilterWrapper';
2
+ import type { IFilterWrapperProps } from '../FilterWrapper';
3
3
  export declare function FilterValueView<Values, Key extends keyof Values>({ locale, localeKey, filter, value, }: Omit<IFilterWrapperProps<Values, Key>, 'onChange' | 'filtersPaneRef'>): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { IFilterLocale, IFilterLocaleKey, IPeriodGetter, ISelectLocale, ISelectLocaleKey } from './types';
1
+ import type { IFilterLocale, IFilterLocaleKey, IPeriodGetter, ISelectLocale, ISelectLocaleKey } from './types';
2
2
  export declare const PERIODS: readonly ["THIS_MONTH", "LAST_MONTH", "THIS_YEAR", "LAST_YEAR", "CUSTOM"];
3
3
  export declare const SelectLocales: Record<string, ISelectLocale>;
4
4
  export declare const FilterLocales: Record<string, IFilterLocale>;
@@ -1,7 +1,7 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { IDatePickerProps } from '../DatePicker';
3
3
  import { IMultiSelectListValues } from '../MultiSelectList';
4
- import { IFilterIntervalProps, IFilterMultiSelectProps, IFilterSelectProps, IFilterWithDatesProps, IFilterWithPeriodProps } from './components';
4
+ import type { IFilterIntervalProps, IFilterMultiSelectProps, IFilterSelectProps, IFilterWithDatesProps, IFilterWithPeriodProps } from './components';
5
5
  import { FilterLocales, PERIODS, SelectLocales } from './constants';
6
6
  export declare type IPeriodType = (typeof PERIODS)[number];
7
7
  export declare type IFilterMultiSelectValues<Option = string> = IMultiSelectListValues<Option>;
@@ -1,4 +1,4 @@
1
- import { IIconType, ISvgIcon } from './types';
1
+ import type { IIconType, ISvgIcon } from './types';
2
2
  export declare const isComplexIcon: (type: IIconType) => type is "avatar";
3
3
  /**
4
4
  * Эта функция позволяет корректно определить ключи в типе
@@ -1 +1 @@
1
- export declare const iconsList: Record<"direction" | "filter" | "search" | "repeat" | "link" | "sort" | "document" | "vendor-service" | "aircraft-takeoff" | "archive" | "arrow" | "arrow-right" | "baggage" | "balloon" | "bluetooth" | "bonus" | "book" | "box" | "business" | "calendar" | "cancel" | "check" | "check-big" | "check-all" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chevron-down-small" | "chevron-left-small" | "chevron-right-small" | "chevron-up-small" | "circle-check" | "close" | "close-large" | "close-window" | "copy" | "copy-outline" | "crane" | "danger" | "download" | "email" | "eye" | "eye-closed" | "female" | "food" | "information" | "insurance" | "list" | "lock" | "lock-open" | "male" | "menu" | "minus" | "burger-menu" | "pencil" | "pin" | "plane" | "plane-circle" | "plus" | "print" | "question" | "refresh" | "rocket" | "round-trip" | "vendor-logo" | "scan" | "send-email" | "settings" | "sign-out" | "size" | "sort-asc" | "sort-desc" | "sort-list-asc" | "sort-list-desc" | "star" | "status-error" | "status-info" | "status-not-ok" | "status-ok" | "status-warning" | "three-circles" | "ticket-revert" | "ticket" | "time" | "trash-can" | "upgrade" | "user" | "user-group" | "voucher", import("./types").ISvgIcon>;
1
+ export declare const iconsList: Record<"direction" | "filter" | "search" | "repeat" | "link" | "sort" | "document" | "vendor-service" | "aircraft-takeoff" | "archive" | "arrow" | "arrow-right" | "baggage" | "balloon" | "bluetooth" | "bonus" | "book" | "box" | "business" | "calendar" | "cancel" | "check" | "check-big" | "check-all" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chevron-down-small" | "chevron-left-small" | "chevron-right-small" | "chevron-up-small" | "circle-check" | "close" | "close-large" | "close-window" | "copy" | "copy-outline" | "crane" | "danger" | "download" | "email" | "eye" | "eye-closed" | "female" | "folder" | "folder-add" | "food" | "information" | "insurance" | "list" | "lock" | "lock-open" | "male" | "menu" | "minus" | "burger-menu" | "pencil" | "pin" | "plane" | "plane-circle" | "plus" | "presentation" | "print" | "question" | "refresh" | "rocket" | "round-trip" | "vendor-logo" | "scan" | "send-email" | "settings" | "sign-out" | "size" | "sort-asc" | "sort-desc" | "sort-list-asc" | "sort-list-desc" | "star" | "status-error" | "status-info" | "status-not-ok" | "status-ok" | "status-warning" | "three-circles" | "ticket-revert" | "ticket" | "time" | "trash-can" | "upgrade" | "user" | "user-group" | "voucher", import("./types").ISvgIcon>;
@@ -1,4 +1,5 @@
1
1
  export * from './Icon';
2
2
  export * from './types';
3
3
  export { iconsList } from './icons-list';
4
+ export * from './snippet';
4
5
  export type { IconStyles } from './Icon.styles';
@@ -1,3 +1,3 @@
1
1
  import { ReactNode } from 'react';
2
- import { IIcon } from '../types';
2
+ import { IIcon } from './types';
3
3
  export declare const renderIcon: (icon: IIcon) => ReactNode;
@@ -1,4 +1,4 @@
1
- import { SVGAttributes } from 'react';
1
+ import { ReactElement, SVGAttributes } from 'react';
2
2
  import { complexIcons } from './complexIcons';
3
3
  import { iconsList } from './icons-list';
4
4
  export interface ISvgIcon {
@@ -10,3 +10,4 @@ export interface ISvgIcon {
10
10
  export declare type ICommonIcon = keyof typeof iconsList;
11
11
  export declare type IComplexIcon = keyof typeof complexIcons;
12
12
  export declare type IIconType = ICommonIcon | IComplexIcon;
13
+ export declare type IIcon = IIconType | ReactElement;
@@ -1,5 +1,6 @@
1
1
  import { FormEvent, FocusEvent, KeyboardEvent, ClipboardEvent, ReactNode } from 'react';
2
- import { ICommonProps, IIcon } from '../../types';
2
+ import { ICommonProps } from '../../types';
3
+ import { IIcon } from '../Icon';
3
4
  import { IReactInputMaskProps } from './types';
4
5
  import { InputStyles } from './Input.styles';
5
6
  export interface IInputProps extends ICommonProps, IReactInputMaskProps {
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { ICommonProps } from '../../types';
3
- import { IListItem } from './types';
3
+ import { IListItem } from '../ListItem';
4
4
  import { ListStyles } from './List.styles';
5
5
  export interface IListProps extends ICommonProps {
6
6
  tweakStyles?: ListStyles;
@@ -7,33 +7,5 @@ export declare const styles: {
7
7
  listStyle: string;
8
8
  margin: number;
9
9
  };
10
- item: {
11
- display: string;
12
- alignItems: string;
13
- boxSizing: string;
14
- fontSize: number;
15
- whiteSpace: string;
16
- minHeight: number;
17
- padding: number[];
18
- transition: string;
19
- cursor: string;
20
- };
21
- disabledItem: {
22
- cursor: string;
23
- };
24
- spacer: {
25
- height: number;
26
- backgroundColor: "#dde3ed";
27
- };
28
- withIconGap: {
29
- paddingLeft: number;
30
- };
31
- icon: {
32
- width: number;
33
- height: number;
34
- marginRight: number;
35
- flexShrink: number;
36
- };
37
- content: {};
38
10
  };
39
11
  export declare type ListStyles = ComponentStyles<typeof styles>;
@@ -1,3 +1,2 @@
1
1
  export * from './List';
2
- export * from './types';
3
2
  export type { ListStyles } from './List.styles';
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ import { ICommonProps } from '../../types';
3
+ import { IListItem } from './types';
4
+ export interface IListItemProps extends ICommonProps, IListItem {
5
+ }
6
+ export declare const ListItem: FC<IListItemProps>;
@@ -0,0 +1,35 @@
1
+ import type { ComponentStyles } from '../../types';
2
+ export declare const styles: {
3
+ item: {
4
+ display: string;
5
+ alignItems: string;
6
+ boxSizing: string;
7
+ fontSize: number;
8
+ whiteSpace: string;
9
+ minHeight: number;
10
+ padding: number[];
11
+ transition: string;
12
+ cursor: string;
13
+ };
14
+ default: {};
15
+ destructive: {};
16
+ custom: {};
17
+ disabledItem: {
18
+ cursor: string;
19
+ };
20
+ spacer: {
21
+ height: number;
22
+ backgroundColor: "#dde3ed";
23
+ };
24
+ withIconGap: {
25
+ paddingLeft: number;
26
+ };
27
+ icon: {
28
+ width: number;
29
+ height: number;
30
+ marginRight: number;
31
+ flexShrink: number;
32
+ };
33
+ content: {};
34
+ };
35
+ export declare type ListItemStyles = ComponentStyles<typeof styles>;
@@ -0,0 +1 @@
1
+ export declare const LIST_ITEM_VIEW: readonly ["default", "destructive", "custom"];
@@ -0,0 +1,3 @@
1
+ export * from './ListItem';
2
+ export * from './types';
3
+ export type { ListItemStyles } from './ListItem.styles';
@@ -1,12 +1,17 @@
1
1
  import { ReactNode } from 'react';
2
- import { IIcon } from '../../types';
2
+ import { IIcon } from '../Icon';
3
+ import { LIST_ITEM_VIEW } from './constants';
4
+ import type { ListItemStyles } from './ListItem.styles';
5
+ export declare type IListItemView = (typeof LIST_ITEM_VIEW)[number];
3
6
  export interface IListItem {
4
7
  item: ReactNode;
8
+ view?: IListItemView;
5
9
  icon?: IIcon;
6
10
  disabled?: boolean;
7
11
  shouldDrawSpacerAbove?: boolean;
8
12
  shouldDrawSpacerBelow?: boolean;
9
13
  withIconGap?: boolean;
10
14
  testId?: string;
15
+ tweakStyles?: ListItemStyles;
11
16
  onClick(): void;
12
17
  }
@@ -1,10 +1,10 @@
1
1
  import { FC } from 'react';
2
2
  import { ICommonProps } from '../../types';
3
- import { IListItem } from '../List';
3
+ import { IListProps } from '../List';
4
4
  import { MoreMenuStyles } from './MoreMenu.styles';
5
5
  export interface IMoreMenuProps extends ICommonProps {
6
6
  tweakStyles?: MoreMenuStyles;
7
- items: IListItem[];
7
+ items: IListProps['items'];
8
8
  isDisabled?: boolean;
9
9
  /**
10
10
  * @default true
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ICommonProps } from '../../../../types';
3
- import { IMultiSelectListValues } from '../../../index';
3
+ import type { IMultiSelectListValues } from '../../../MultiSelectList';
4
4
  export interface IMultiSelectInputProps<Value> extends ICommonProps {
5
5
  value?: IMultiSelectListValues<Value>;
6
6
  isOpen: boolean;
@@ -1,4 +1,4 @@
1
- import { INumberInputProps } from './NumberInput';
1
+ import type { INumberInputProps } from './NumberInput';
2
2
  export declare const getNewCaretPosition: (defaultPosition: number, oldValue: string, newValue: string, isDeleteForwardAction?: boolean) => number;
3
3
  export declare const formatNumberWithDefault: (value: number | undefined, defaultValue?: number) => string;
4
4
  export declare const constructRegExp: ({ canBeFloat, canBeNegative, intPartPrecision, precision, }: Pick<INumberInputProps, 'canBeFloat' | 'canBeNegative' | 'intPartPrecision' | 'precision'>) => string;
@@ -1,5 +1,4 @@
1
1
  export * from './PhoneInput';
2
- export { phoneInfo } from './phone-info';
3
2
  export * from './types';
4
3
  export type { PhoneInputStyles } from './PhoneInput.styles';
5
4
  export type { PhoneInputCountryListStyles } from './components';
@@ -180,7 +180,7 @@ export declare class ScrollIntoViewIfNeeded extends PureComponent<IScrollIntoVie
180
180
  'aria-expanded'?: (boolean | "false" | "true") | undefined;
181
181
  'aria-flowto'?: string | undefined;
182
182
  'aria-grabbed'?: (boolean | "false" | "true") | undefined;
183
- 'aria-haspopup'?: boolean | "grid" | "menu" | "dialog" | "listbox" | "false" | "true" | "tree" | undefined;
183
+ 'aria-haspopup'?: boolean | "grid" | "menu" | "listbox" | "false" | "true" | "dialog" | "tree" | undefined;
184
184
  'aria-hidden'?: (boolean | "false" | "true") | undefined;
185
185
  'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
186
186
  'aria-keyshortcuts'?: string | undefined;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode, SyntheticEvent } from 'react';
2
- import { IDropdownWithPopperOptions, IIcon } from '../../types';
2
+ import { IDropdownWithPopperOptions } from '../../types';
3
+ import { IIcon } from '../Icon';
3
4
  import { IInputProps } from '../Input';
4
5
  import { ISearchInputProps } from '../SearchInput';
5
6
  import { IMultipleSelectValue } from './types';
@@ -1,5 +1,5 @@
1
1
  import { ComponentStyles } from '../../types';
2
- import { ITooltipProps } from './Tooltip';
2
+ import type { ITooltipProps } from './Tooltip';
3
3
  interface IStyleProps {
4
4
  type: NonNullable<ITooltipProps['type']>;
5
5
  }
@@ -15,6 +15,7 @@ export * from './Icon';
15
15
  export * from './IncrementInput';
16
16
  export * from './Input';
17
17
  export * from './List';
18
+ export * from './ListItem';
18
19
  export * from './Modal';
19
20
  export * from './MoreMenu';
20
21
  export * from './MultiSelect';
@@ -0,0 +1 @@
1
+ export * from './phone-info';
@@ -0,0 +1,2 @@
1
+ import type { IPhoneInfo } from '../components';
2
+ export declare const phoneInfo: IPhoneInfo[];
@@ -1,4 +1,4 @@
1
- import { IPhoneInfo, IPhoneValue } from '../components';
1
+ import type { IPhoneInfo, IPhoneValue } from '../components';
2
2
  export declare const findCountryByCode: (countryCode?: string, countriesList?: IPhoneInfo[]) => IPhoneInfo | undefined;
3
3
  export declare const findCountryIndexByCode: (countryCode?: string, countriesList?: IPhoneInfo[]) => number;
4
4
  export declare const getCountryTextByLocale: (country: IPhoneInfo, locale: string) => string;
package/dist/index.d.ts CHANGED
@@ -2,5 +2,5 @@ export { commonTheme } from './theme';
2
2
  export * from './components';
3
3
  export * from './hooks';
4
4
  export * from './types';
5
+ export * from './constants';
5
6
  export * from './helpers';
6
- export * from './helpers/snippets';