@true-engineering/true-react-common-ui-kit 3.30.0 → 3.32.0

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/README.md CHANGED
@@ -11,6 +11,19 @@
11
11
 
12
12
  # Release Notes
13
13
 
14
+ ## 3.32.0
15
+
16
+ ### Changes
17
+
18
+ - **Notification**: Добавлен проп `icon`
19
+ - **Notification**: В проп `type` добавлен вариант `custom`
20
+
21
+ ## 3.31.0
22
+
23
+ ### Changes
24
+
25
+ - **FlexibleTable**: Добавлен экспорт `IFlexibleTableRowConfig`
26
+
14
27
  ## 3.30.0
15
28
 
16
29
  ### Changes
@@ -16,23 +16,24 @@ export interface IValueComponentProps<Values, Value> {
16
16
  isRowNestedComponentExpanded: boolean;
17
17
  onSetNestedComponent: (component?: ReactNode) => void;
18
18
  }
19
+ export interface IFlexibleTableRowConfig<Values extends ITableRow, Key extends keyof Values, HeaderContent extends IHeaderContent<Values> = IHeaderContent<Values>> {
20
+ title?: IRenderNode<ITitleComponentProps<HeaderContent[Key]>>;
21
+ component?: IRenderNode<IValueComponentProps<Values, NonNullable<Values[Key]>>>;
22
+ dateFormat?: string;
23
+ minWidth?: string | number;
24
+ width?: string | number;
25
+ maxWidth?: string | number;
26
+ /** @default 'left' */
27
+ titleAlign?: CSSProperties['textAlign'];
28
+ cellAlign?: CSSProperties['textAlign'];
29
+ cellVerticalAlign?: CSSProperties['verticalAlign'];
30
+ position?: CSSProperties['position'];
31
+ right?: number;
32
+ left?: number;
33
+ shouldRenderDataId?: boolean;
34
+ }
19
35
  export type IFlexibleTableConfigType<Values extends ITableRow, HeaderContent extends IHeaderContent<Values> = IHeaderContent<Values>> = {
20
- [Key in keyof Values]?: {
21
- title?: IRenderNode<ITitleComponentProps<HeaderContent[Key]>>;
22
- component?: IRenderNode<IValueComponentProps<Values, NonNullable<Values[Key]>>>;
23
- dateFormat?: string;
24
- minWidth?: string | number;
25
- width?: string | number;
26
- maxWidth?: string | number;
27
- /** @default 'left' */
28
- titleAlign?: CSSProperties['textAlign'];
29
- cellAlign?: CSSProperties['textAlign'];
30
- cellVerticalAlign?: CSSProperties['verticalAlign'];
31
- position?: CSSProperties['position'];
32
- right?: number;
33
- left?: number;
34
- shouldRenderDataId?: boolean;
35
- };
36
+ [Key in keyof Values]?: IFlexibleTableRowConfig<Values, Key, HeaderContent>;
36
37
  };
37
38
  export interface IInfinityScrollConfig {
38
39
  activePage: number;
@@ -1,5 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { ICommonProps } from '../../types';
3
+ import { IIcon } from '../Icon';
3
4
  import { INotificationType } from './types';
4
5
  import { INotificationStyles } from './Notification.styles';
5
6
  export interface INotificationProps extends ICommonProps<INotificationStyles> {
@@ -10,6 +11,7 @@ export interface INotificationProps extends ICommonProps<INotificationStyles> {
10
11
  title?: string;
11
12
  /** @default 's' */
12
13
  size?: 's' | 'm' | 'l';
14
+ icon?: IIcon;
13
15
  children?: ReactNode;
14
16
  }
15
17
  export declare const Notification: FC<INotificationProps>;
@@ -1,3 +1,3 @@
1
1
  import { ITweakStyles } from '../../theme';
2
- export declare const useStyles: import("../../theme").IUseStyles<"content" | "error" | "root" | "inline" | "text" | "icon" | "warning" | "s" | "m" | "l" | "info" | "body" | "title" | "withText" | "withTitle" | "ok" | "not-ok", unknown>;
2
+ export declare const useStyles: import("../../theme").IUseStyles<"content" | "error" | "root" | "inline" | "text" | "icon" | "warning" | "custom" | "s" | "m" | "l" | "info" | "body" | "title" | "withText" | "withTitle" | "ok" | "not-ok", unknown>;
3
3
  export type INotificationStyles = ITweakStyles<typeof useStyles>;
@@ -1 +1 @@
1
- export type INotificationType = 'error' | 'info' | 'warning' | 'ok' | 'not-ok';
1
+ export type INotificationType = 'error' | 'info' | 'warning' | 'ok' | 'not-ok' | 'custom';
@@ -27999,7 +27999,8 @@ var useStyles$b = createThemedStyles("Notification", {
27999
27999
  info: {},
28000
28000
  warning: {},
28001
28001
  ok: {},
28002
- "not-ok": {}
28002
+ "not-ok": {},
28003
+ custom: {}
28003
28004
  });
28004
28005
  function _define_property$e(obj, key, value) {
28005
28006
  if (key in obj) {
@@ -28054,20 +28055,22 @@ function _object_spread_props$c(target, source) {
28054
28055
  return target;
28055
28056
  }
28056
28057
  var Notification = function(param) {
28057
- var children = param.children, type = param.type, _param_isFullWidth = param.isFullWidth, isFullWidth = _param_isFullWidth === void 0 ? true : _param_isFullWidth, text = param.text, title = param.title, testId = param.testId, _param_size = param.size, size = _param_size === void 0 ? "s" : _param_size, data = param.data, tweakStyles = param.tweakStyles;
28058
+ var children = param.children, type = param.type, _param_isFullWidth = param.isFullWidth, isFullWidth = _param_isFullWidth === void 0 ? true : _param_isFullWidth, text = param.text, title = param.title, testId = param.testId, _param_size = param.size, size = _param_size === void 0 ? "s" : _param_size, data = param.data, icon = param.icon, tweakStyles = param.tweakStyles;
28058
28059
  var classes = useStyles$b({
28059
28060
  theme: tweakStyles
28060
28061
  });
28061
28062
  var hasText = isStringNotEmpty(text);
28062
28063
  var hasTitle = isStringNotEmpty(title);
28064
+ var isDefaultType = type !== "custom";
28065
+ var hasIcon = isReactNodeNotEmpty(icon) || isDefaultType;
28063
28066
  var _obj2;
28064
28067
  return /* @__PURE__ */ jsxs("div", _object_spread_props$c(_object_spread$d({
28065
28068
  className: clsx(classes.root, classes[size], classes[type], (_obj2 = {}, _define_property$e(_obj2, classes.inline, !isFullWidth), _define_property$e(_obj2, classes.withTitle, hasTitle), _define_property$e(_obj2, classes.withText, hasText), _obj2))
28066
28069
  }, addDataTestId(testId), addDataAttributes(data)), {
28067
28070
  children: [
28068
- /* @__PURE__ */ jsx("div", {
28071
+ hasIcon && /* @__PURE__ */ jsx("div", {
28069
28072
  className: classes.icon,
28070
- children: /* @__PURE__ */ jsx(Icon, {
28073
+ children: isReactNodeNotEmpty(icon) ? renderIcon(icon) : isDefaultType && /* @__PURE__ */ jsx(Icon, {
28071
28074
  type: "status-".concat(type)
28072
28075
  })
28073
28076
  }),