@uva-glass/component-library 3.33.4 → 3.34.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.
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export type NotificationVariant = 'default' | 'bar';
|
|
3
3
|
export type NotificationLevel = 'neutral' | 'information' | 'success' | 'warning' | 'danger';
|
|
4
4
|
export interface NotificationProps {
|
|
5
|
-
title
|
|
5
|
+
title?: string;
|
|
6
6
|
subtitle?: string;
|
|
7
7
|
action?: ReactNode;
|
|
8
8
|
variant?: NotificationVariant;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { Icon as
|
|
2
|
+
import { c as f } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Icon as s } from "../Icon/Icon.js";
|
|
4
4
|
import '../../assets/Notification.css';const w = "_notification_qwbrb_1", t = {
|
|
5
5
|
notification: w,
|
|
6
6
|
"notification--default": "_notification--default_qwbrb_7",
|
|
@@ -25,18 +25,18 @@ import '../../assets/Notification.css';const w = "_notification_qwbrb_1", t = {
|
|
|
25
25
|
"notification-close-button--danger": "_notification-close-button--danger_qwbrb_127",
|
|
26
26
|
"notification-close-button--bar--success": "_notification-close-button--bar--success_qwbrb_140",
|
|
27
27
|
"notification-close-button--bar--warning": "_notification-close-button--bar--warning_qwbrb_143"
|
|
28
|
-
}, g = ({ title:
|
|
29
|
-
const l =
|
|
28
|
+
}, g = ({ title: a, subtitle: r, action: b, variant: e = "default", level: n, onClose: _ }) => {
|
|
29
|
+
const l = e === "bar";
|
|
30
30
|
function u(o) {
|
|
31
31
|
return o === "neutral" ? "CalendarEdit" : o === "information" ? "SquareInfo" : o === "success" ? "CheckCircle" : "ExclamationTriangleMini";
|
|
32
32
|
}
|
|
33
|
-
return /* @__PURE__ */ c("div", { className:
|
|
33
|
+
return /* @__PURE__ */ c("div", { className: f(t.notification, t[`notification--${e}`], t[`notification--${n}`]), children: [
|
|
34
34
|
/* @__PURE__ */ c("div", { className: t["notification-content"], children: [
|
|
35
|
-
/* @__PURE__ */ i(
|
|
35
|
+
/* @__PURE__ */ i(s, { name: u(n) }),
|
|
36
36
|
/* @__PURE__ */ c("div", { className: t["notification-content--text"], children: [
|
|
37
|
-
/* @__PURE__ */ i("p", { className: t["notification-title"], children:
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
a && /* @__PURE__ */ i("p", { className: t["notification-title"], children: a }),
|
|
38
|
+
r && /* @__PURE__ */ i("p", { className: t["notification-subtitle"], children: r }),
|
|
39
|
+
b && /* @__PURE__ */ i("div", { className: t["notification-action"], children: b })
|
|
40
40
|
] })
|
|
41
41
|
] }),
|
|
42
42
|
_ && /* @__PURE__ */ i(
|
|
@@ -44,10 +44,10 @@ import '../../assets/Notification.css';const w = "_notification_qwbrb_1", t = {
|
|
|
44
44
|
{
|
|
45
45
|
type: "button",
|
|
46
46
|
"aria-label": "close",
|
|
47
|
-
className:
|
|
47
|
+
className: f(t["notification-close-button"], t[`notification-close-button--${n}`], {
|
|
48
48
|
[t[`notification-close-button--bar--${n}`]]: l
|
|
49
49
|
}),
|
|
50
|
-
children: /* @__PURE__ */ i(
|
|
50
|
+
children: /* @__PURE__ */ i(s, { name: "Cross", size: 24 })
|
|
51
51
|
}
|
|
52
52
|
)
|
|
53
53
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './Notification.module.css';\n\nimport { Icon } from 'components/Icon';\n\nexport type NotificationVariant = 'default' | 'bar';\nexport type NotificationLevel = 'neutral' | 'information' | 'success' | 'warning' | 'danger';\n\nexport interface NotificationProps {\n title
|
|
1
|
+
{"version":3,"file":"Notification.js","sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './Notification.module.css';\n\nimport { Icon } from 'components/Icon';\n\nexport type NotificationVariant = 'default' | 'bar';\nexport type NotificationLevel = 'neutral' | 'information' | 'success' | 'warning' | 'danger';\n\nexport interface NotificationProps {\n title?: string;\n subtitle?: string;\n action?: ReactNode;\n variant?: NotificationVariant;\n level: NotificationLevel;\n onClose?: () => void;\n}\n\nexport const Notification = ({ title, subtitle, action, variant = 'default', level, onClose }: NotificationProps) => {\n const isBar = variant === 'bar';\n\n function setIconName(toastType: NotificationLevel) {\n if (toastType === 'neutral') return 'CalendarEdit';\n if (toastType === 'information') return 'SquareInfo';\n if (toastType === 'success') return 'CheckCircle';\n return 'ExclamationTriangleMini';\n }\n\n return (\n <div className={clsx(styles['notification'], styles[`notification--${variant}`], styles[`notification--${level}`])}>\n <div className={styles['notification-content']}>\n <Icon name={setIconName(level)} />\n <div className={styles['notification-content--text']}>\n {title && <p className={styles['notification-title']}>{title}</p>}\n {subtitle && <p className={styles['notification-subtitle']}>{subtitle}</p>}\n {action && <div className={styles['notification-action']}>{action}</div>}\n </div>\n </div>\n {onClose && (\n <button\n type=\"button\"\n aria-label=\"close\"\n className={clsx(styles['notification-close-button'], styles[`notification-close-button--${level}`], {\n [styles[`notification-close-button--bar--${level}`]]: isBar,\n })}\n >\n <Icon name=\"Cross\" size={24} />\n </button>\n )}\n </div>\n );\n};\n"],"names":["Notification","title","subtitle","action","variant","level","onClose","isBar","setIconName","toastType","clsx","styles","jsxs","jsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;GAoBaA,IAAe,CAAC,EAAE,OAAAC,GAAO,UAAAC,GAAU,QAAAC,GAAQ,SAAAC,IAAU,WAAW,OAAAC,GAAO,SAAAC,QAAiC;AACnH,QAAMC,IAAQH,MAAY;AAE1B,WAASI,EAAYC,GAA8B;AACjD,WAAIA,MAAc,YAAkB,iBAChCA,MAAc,gBAAsB,eACpCA,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