@soul-refiner/design-system 0.2.9 → 0.2.11

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.
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  type BannerTypes = 'error' | 'info' | 'success' | 'warning';
3
3
  export interface BannerProps {
4
4
  content: string;
5
- href: string;
6
- onClose: () => void;
5
+ href?: string;
6
+ onClose?: () => void;
7
7
  title: string;
8
8
  type: BannerTypes;
9
9
  }
@@ -16,8 +16,8 @@ export const Banner = ({ content, href, onClose, title, type, }) => {
16
16
  React.createElement(Box, { "$dir": "row", "$gap": 4, "$align": "center" },
17
17
  React.createElement(P, { as: "span", "$semiBold": true }, title),
18
18
  React.createElement(P, { as: "span" }, content),
19
- React.createElement(P, { as: "a", href: href, "$color": "primary-blue-2" }, "Read more")),
20
- React.createElement(Button, { icon: React.createElement(Close, { size: 24 }), onClick: onClose, type: "special" })));
19
+ href && (React.createElement(P, { as: "a", href: href, "$color": "primary-blue-2" }, "Read more"))),
20
+ onClose && (React.createElement(Button, { icon: React.createElement(Close, { size: 24 }), onClick: onClose, type: "special" }))));
21
21
  };
22
22
  const Wrapper = styled.output `
23
23
  width: 100%;
@@ -3,7 +3,7 @@ type NotificationTypes = 'error' | 'info' | 'success' | 'warning';
3
3
  export interface NotificationProps {
4
4
  content: string;
5
5
  href?: string;
6
- onClose: () => void;
6
+ onClose?: () => void;
7
7
  sx?: string;
8
8
  title: string;
9
9
  type: NotificationTypes;
@@ -15,7 +15,7 @@ export const Notification = ({ content, href, onClose, sx, title, type, }) => {
15
15
  React.createElement(Box, { "$dir": "row", "$gap": 8, "$flex": 1 },
16
16
  iconLookup[type],
17
17
  React.createElement(P, { as: "span", "$semiBold": true }, title),
18
- React.createElement(Button, { icon: React.createElement(Close, { size: 24 }), onClick: onClose, sx: "margin-left: auto;", type: "special" })),
18
+ onClose && (React.createElement(Button, { icon: React.createElement(Close, { size: 24 }), onClick: onClose, sx: "margin-left: auto;", type: "special" }))),
19
19
  React.createElement(Box, { "$align": "center", "$dir": "row", "$gap": 4 },
20
20
  React.createElement(P, { as: "span", sx: "padding-left: 32px;" }, content))));
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {