@true-engineering/true-react-common-ui-kit 4.0.0-alpha67 → 4.0.0-alpha68
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/Notification/Notification.d.ts +3 -3
- package/dist/true-react-common-ui-kit.js +4 -6
- 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/package.json +1 -1
- package/src/components/Notification/Notification.stories.tsx +3 -1
- package/src/components/Notification/Notification.tsx +9 -17
|
@@ -7,11 +7,11 @@ export interface INotificationProps extends ICommonProps<INotificationStyles> {
|
|
|
7
7
|
type: INotificationType;
|
|
8
8
|
/** @default true */
|
|
9
9
|
isFullWidth?: boolean;
|
|
10
|
-
text?:
|
|
11
|
-
title?:
|
|
10
|
+
text?: ReactNode;
|
|
11
|
+
title?: ReactNode;
|
|
12
12
|
/** @default 's' */
|
|
13
13
|
size?: 's' | 'm' | 'l';
|
|
14
|
-
icon?: IIcon;
|
|
14
|
+
icon?: IIcon | null;
|
|
15
15
|
children?: ReactNode;
|
|
16
16
|
}
|
|
17
17
|
export declare const Notification: FC<INotificationProps>;
|
|
@@ -10333,14 +10333,12 @@ const Notification = ({
|
|
|
10333
10333
|
testId,
|
|
10334
10334
|
size: size2 = "s",
|
|
10335
10335
|
data,
|
|
10336
|
-
icon,
|
|
10336
|
+
icon = type !== "custom" ? `status-${type}` : void 0,
|
|
10337
10337
|
tweakStyles
|
|
10338
10338
|
}) => {
|
|
10339
10339
|
const classes = useStyles$b({ theme: tweakStyles });
|
|
10340
|
-
const hasText =
|
|
10341
|
-
const hasTitle =
|
|
10342
|
-
const isDefaultType = type !== "custom";
|
|
10343
|
-
const hasIcon = isReactNodeNotEmpty(icon) || isDefaultType;
|
|
10340
|
+
const hasText = isReactNodeNotEmpty(text);
|
|
10341
|
+
const hasTitle = isReactNodeNotEmpty(title);
|
|
10344
10342
|
return /* @__PURE__ */ jsxs(
|
|
10345
10343
|
"div",
|
|
10346
10344
|
{
|
|
@@ -10351,7 +10349,7 @@ const Notification = ({
|
|
|
10351
10349
|
}),
|
|
10352
10350
|
...addDataAttributes$1(data, testId),
|
|
10353
10351
|
children: [
|
|
10354
|
-
|
|
10352
|
+
isNotEmpty(icon) && /* @__PURE__ */ jsx("div", { className: classes.icon, children: renderIcon(icon) }),
|
|
10355
10353
|
/* @__PURE__ */ jsxs("div", { className: classes.body, children: [
|
|
10356
10354
|
hasTitle && /* @__PURE__ */ jsx("span", { className: classes.title, ...addDataTestId(testId, "title"), children: title }),
|
|
10357
10355
|
hasText && /* @__PURE__ */ jsx("span", { className: classes.text, ...addDataTestId(testId, "text"), children: text }),
|