@dnanpm/ui-components 0.0.5 → 0.1.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 +10 -41
- package/dist/components/Accordion/Accordion.cjs +26 -0
- package/dist/components/Accordion/Accordion.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.css +19 -0
- package/dist/components/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion/Accordion.js +26 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Accordion/Accordion.module.css.cjs +12 -0
- package/dist/components/Accordion/Accordion.module.css.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.module.css.js +12 -0
- package/dist/components/Accordion/Accordion.module.css.js.map +1 -0
- package/dist/components/Accordion/Accordion.types.d.ts +21 -0
- package/dist/components/Accordion/Accordion.types.d.ts.map +1 -0
- package/dist/components/Accordion/Accordion.utils.cjs +8 -0
- package/dist/components/Accordion/Accordion.utils.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.utils.d.ts +8 -0
- package/dist/components/Accordion/Accordion.utils.d.ts.map +1 -0
- package/dist/components/Accordion/Accordion.utils.js +8 -0
- package/dist/components/Accordion/Accordion.utils.js.map +1 -0
- package/dist/components/Accordion/index.d.ts +3 -0
- package/dist/components/Accordion/index.d.ts.map +1 -0
- package/dist/components/AccordionItem/AccordionItem.cjs +57 -0
- package/dist/components/AccordionItem/AccordionItem.cjs.map +1 -0
- package/dist/components/AccordionItem/AccordionItem.css +128 -0
- package/dist/components/AccordionItem/AccordionItem.d.ts +3 -0
- package/dist/components/AccordionItem/AccordionItem.d.ts.map +1 -0
- package/dist/components/AccordionItem/AccordionItem.js +57 -0
- package/dist/components/AccordionItem/AccordionItem.js.map +1 -0
- package/dist/components/AccordionItem/AccordionItem.module.css.cjs +17 -0
- package/dist/components/AccordionItem/AccordionItem.module.css.cjs.map +1 -0
- package/dist/components/AccordionItem/AccordionItem.module.css.js +18 -0
- package/dist/components/AccordionItem/AccordionItem.module.css.js.map +1 -0
- package/dist/components/AccordionItem/AccordionItem.types.d.ts +32 -0
- package/dist/components/AccordionItem/AccordionItem.types.d.ts.map +1 -0
- package/dist/components/AccordionItem/index.d.ts +3 -0
- package/dist/components/AccordionItem/index.d.ts.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.cjs +73 -0
- package/dist/components/Breadcrumb/Breadcrumb.cjs.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.css +72 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +3 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +73 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +25 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.css.js +25 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.css.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +46 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts.map +1 -0
- package/dist/components/Breadcrumb/index.d.ts +3 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/Label/Label.cjs +20 -0
- package/dist/components/Label/Label.cjs.map +1 -0
- package/dist/components/Label/Label.css +40 -0
- package/dist/components/Label/Label.d.ts +3 -0
- package/dist/components/Label/Label.d.ts.map +1 -0
- package/dist/components/Label/Label.js +20 -0
- package/dist/components/Label/Label.js.map +1 -0
- package/dist/components/Label/Label.module.css.cjs +16 -0
- package/dist/components/Label/Label.module.css.cjs.map +1 -0
- package/dist/components/Label/Label.module.css.js +16 -0
- package/dist/components/Label/Label.module.css.js.map +1 -0
- package/dist/components/Label/Label.types.d.ts +28 -0
- package/dist/components/Label/Label.types.d.ts.map +1 -0
- package/dist/components/Label/index.d.ts +3 -0
- package/dist/components/Label/index.d.ts.map +1 -0
- package/dist/components/Notification/Notification.cjs +58 -0
- package/dist/components/Notification/Notification.cjs.map +1 -0
- package/dist/components/Notification/Notification.css +91 -0
- package/dist/components/Notification/Notification.d.ts +3 -0
- package/dist/components/Notification/Notification.d.ts.map +1 -0
- package/dist/components/Notification/Notification.js +58 -0
- package/dist/components/Notification/Notification.js.map +1 -0
- package/dist/components/Notification/Notification.module.css.cjs +24 -0
- package/dist/components/Notification/Notification.module.css.cjs.map +1 -0
- package/dist/components/Notification/Notification.module.css.js +24 -0
- package/dist/components/Notification/Notification.module.css.js.map +1 -0
- package/dist/components/Notification/Notification.types.d.ts +40 -0
- package/dist/components/Notification/Notification.types.d.ts.map +1 -0
- package/dist/components/Notification/index.d.ts +3 -0
- package/dist/components/Notification/index.d.ts.map +1 -0
- package/dist/font-definitions.css +61 -0
- package/dist/index.cjs +13 -10027
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -10009
- package/dist/index.js.map +1 -1
- package/dist/styles/utils/elevation.css +28 -0
- package/dist/styles/utils/elevation.module.css.cjs +10 -0
- package/dist/styles/utils/elevation.module.css.cjs.map +1 -0
- package/dist/styles/utils/elevation.module.css.js +10 -0
- package/dist/styles/utils/elevation.module.css.js.map +1 -0
- package/dist/styles/utils/focus.css +59 -0
- package/dist/styles/utils/focus.module.css.cjs +16 -0
- package/dist/styles/utils/focus.module.css.cjs.map +1 -0
- package/dist/styles/utils/focus.module.css.js +16 -0
- package/dist/styles/utils/focus.module.css.js.map +1 -0
- package/dist/styles/utils/text-decoration.css +7 -0
- package/dist/styles/utils/text-decoration.module.css.cjs +10 -0
- package/dist/styles/utils/text-decoration.module.css.cjs.map +1 -0
- package/dist/styles/utils/text-decoration.module.css.js +10 -0
- package/dist/styles/utils/text-decoration.module.css.js.map +1 -0
- package/dist/styles.css +49 -347
- package/dist/utils/cn/cn.cjs +8 -0
- package/dist/utils/cn/cn.cjs.map +1 -0
- package/dist/utils/cn/cn.js +8 -0
- package/dist/utils/cn/cn.js.map +1 -0
- package/package.json +9 -7
- package/dist/components/Box/Box.d.ts +0 -2
- package/dist/components/Box/Box.d.ts.map +0 -1
- package/dist/components/Box/Box.types.d.ts +0 -24
- package/dist/components/Box/Box.types.d.ts.map +0 -1
- package/dist/components/Box/index.d.ts +0 -3
- package/dist/components/Box/index.d.ts.map +0 -1
- package/dist/components/Button/Button.d.ts +0 -3
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/Button/Button.types.d.ts +0 -51
- package/dist/components/Button/Button.types.d.ts.map +0 -1
- package/dist/components/Button/index.d.ts +0 -3
- package/dist/components/Button/index.d.ts.map +0 -1
- package/dist/components/Dialog/Dialog.d.ts +0 -3
- package/dist/components/Dialog/Dialog.d.ts.map +0 -1
- package/dist/components/Dialog/Dialog.types.d.ts +0 -45
- package/dist/components/Dialog/Dialog.types.d.ts.map +0 -1
- package/dist/components/Dialog/index.d.ts +0 -3
- package/dist/components/Dialog/index.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +0 -3
- package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.types.d.ts +0 -39
- package/dist/components/Tooltip/Tooltip.types.d.ts.map +0 -1
- package/dist/components/Tooltip/index.d.ts +0 -3
- package/dist/components/Tooltip/index.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.d.ts.map +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@layer dna-design-system {/**
|
|
2
|
+
* Notification Component Styles
|
|
3
|
+
*
|
|
4
|
+
* Design tokens are consumed via CSS custom properties (variables).
|
|
5
|
+
* These variables come from @dnanpm/design-tokens package.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
._notification_1glup_8 {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: var(--spacing-ui-md);
|
|
12
|
+
padding-right: var(--spacing-ui-lg);
|
|
13
|
+
border: 2px solid var(--notification-color);
|
|
14
|
+
border-radius: var(--radius-semantic-sm);
|
|
15
|
+
overflow: clip;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Variant colors */
|
|
19
|
+
._notification--info_1glup_19 {
|
|
20
|
+
--notification-color: var(--colors-semantic-status-info);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
._notification--success_1glup_23 {
|
|
24
|
+
--notification-color: var(--colors-semantic-status-success);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
._notification--warning_1glup_27 {
|
|
28
|
+
--notification-color: var(--colors-semantic-status-warning);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
._notification--error_1glup_31 {
|
|
32
|
+
--notification-color: var(--colors-semantic-status-error);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Icon container */
|
|
36
|
+
._notification__icon-container_1glup_36 {
|
|
37
|
+
/* The colored area size should be 48x48px on one line content, so we adjust padding based on whether the border is present or not */
|
|
38
|
+
--_icon-padding-with-border: 10px;
|
|
39
|
+
--_icon-padding-without-border: 12px;
|
|
40
|
+
|
|
41
|
+
flex: 0 0 auto;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
align-self: stretch;
|
|
46
|
+
padding: var(--_icon-padding-with-border) var(--_icon-padding-without-border)
|
|
47
|
+
var(--_icon-padding-with-border) var(--_icon-padding-with-border);
|
|
48
|
+
background-color: var(--notification-color);
|
|
49
|
+
color: var(--colors-semantic-foreground-inverse);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
._notification__icon_1glup_36 {
|
|
53
|
+
width: 24px;
|
|
54
|
+
height: 24px;
|
|
55
|
+
flex: 0 0 auto;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Content */
|
|
59
|
+
._notification__content_1glup_59 {
|
|
60
|
+
flex: 1 1 auto;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
padding: var(--spacing-ui-xs) 0;
|
|
63
|
+
font-size: 1rem;
|
|
64
|
+
line-height: 1.5;
|
|
65
|
+
color: var(--colors-semantic-foreground-default);
|
|
66
|
+
text-wrap: pretty;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Close button */
|
|
70
|
+
._notification__close_1glup_70 {
|
|
71
|
+
flex: 0 0 auto;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
width: 32px;
|
|
76
|
+
height: 32px;
|
|
77
|
+
padding: 0;
|
|
78
|
+
/* Negative margin to offset the button's size and maintain consistent spacing with the content */
|
|
79
|
+
margin: 0 calc(var(--spacing-ui-xxs) * -1);
|
|
80
|
+
border: none;
|
|
81
|
+
border-radius: var(--radius-semantic-sm);
|
|
82
|
+
background: none;
|
|
83
|
+
color: var(--colors-semantic-foreground-default);
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
._notification__close_1glup_70 svg {
|
|
88
|
+
width: 24px;
|
|
89
|
+
height: 24px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/Notification.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,sBAAsB,CAAC;AAgBnF,eAAO,MAAM,YAAY,8GAsCvB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Error, Warning, Check, Info, Close } from "@dnanpm/icons";
|
|
4
|
+
import focusStyles from "../../styles/utils/focus.module.css.js";
|
|
5
|
+
import styles from "./Notification.module.css.js";
|
|
6
|
+
import { cn } from "../../utils/cn/cn.js";
|
|
7
|
+
const variantIcons = {
|
|
8
|
+
info: Info,
|
|
9
|
+
success: Check,
|
|
10
|
+
warning: Warning,
|
|
11
|
+
error: Error
|
|
12
|
+
};
|
|
13
|
+
const variantRoles = {
|
|
14
|
+
info: "status",
|
|
15
|
+
success: "status",
|
|
16
|
+
warning: "alert",
|
|
17
|
+
error: "alert"
|
|
18
|
+
};
|
|
19
|
+
const Notification = forwardRef(function Notification2({
|
|
20
|
+
variant,
|
|
21
|
+
children,
|
|
22
|
+
closable = false,
|
|
23
|
+
onClose,
|
|
24
|
+
closeLabel = "Sulje ilmoitus",
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}, ref) {
|
|
28
|
+
const Icon = variantIcons[variant];
|
|
29
|
+
const role = variantRoles[variant];
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
ref,
|
|
34
|
+
role,
|
|
35
|
+
className: cn(styles.notification, styles[`notification--${variant}`], className),
|
|
36
|
+
...props,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsx("div", { className: styles["notification__icon-container"], children: /* @__PURE__ */ jsx(Icon, { className: styles.notification__icon, "aria-hidden": "true" }) }),
|
|
39
|
+
/* @__PURE__ */ jsx("div", { className: styles.notification__content, children }),
|
|
40
|
+
closable && /* @__PURE__ */ jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
className: cn(styles.notification__close, focusStyles.focusable),
|
|
45
|
+
onClick: onClose,
|
|
46
|
+
"aria-label": closeLabel,
|
|
47
|
+
children: /* @__PURE__ */ jsx(Close, { "aria-hidden": "true" })
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
Notification.displayName = "Notification";
|
|
55
|
+
export {
|
|
56
|
+
Notification
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=Notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.js","sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef, type ComponentType, type SVGProps } from 'react';\nimport { Check, Close, Error as ErrorIcon, Info, Warning } from '@dnanpm/icons';\nimport { cn } from '../../utils/cn';\nimport focusStyles from '../../styles/utils/focus.module.css';\nimport styles from './Notification.module.css';\nimport type { NotificationProps, NotificationVariant } from './Notification.types';\n\nconst variantIcons: Record<NotificationVariant, ComponentType<SVGProps<SVGSVGElement>>> = {\n info: Info,\n success: Check,\n warning: Warning,\n error: ErrorIcon,\n};\n\nconst variantRoles: Record<NotificationVariant, 'status' | 'alert'> = {\n info: 'status',\n success: 'status',\n warning: 'alert',\n error: 'alert',\n};\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(function Notification(\n {\n variant,\n children,\n closable = false,\n onClose,\n closeLabel = 'Sulje ilmoitus',\n className,\n ...props\n },\n ref,\n) {\n const Icon = variantIcons[variant];\n const role = variantRoles[variant];\n\n return (\n <div\n ref={ref}\n role={role}\n className={cn(styles.notification, styles[`notification--${variant}`], className)}\n {...props}\n >\n <div className={styles['notification__icon-container']}>\n <Icon className={styles.notification__icon} aria-hidden=\"true\" />\n </div>\n <div className={styles.notification__content}>{children}</div>\n {closable && (\n <button\n type=\"button\"\n className={cn(styles.notification__close, focusStyles.focusable)}\n onClick={onClose}\n aria-label={closeLabel}\n >\n <Close aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n});\n\nNotification.displayName = 'Notification';\n"],"names":["ErrorIcon","Notification"],"mappings":";;;;;;AAOA,MAAM,eAAoF;AAAA,EACtF,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAOA;AACX;AAEA,MAAM,eAAgE;AAAA,EAClE,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX;AAEO,MAAM,eAAe,WAA8C,SAASC,cAC/E;AAAA,EACI;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,GAAG;AACP,GACA,KACF;AACE,QAAM,OAAO,aAAa,OAAO;AACjC,QAAM,OAAO,aAAa,OAAO;AAEjC,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA;AAAA,MACA,WAAW,GAAG,OAAO,cAAc,OAAO,iBAAiB,OAAO,EAAE,GAAG,SAAS;AAAA,MAC/E,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,OAAA,EAAI,WAAW,OAAO,8BAA8B,GACjD,UAAA,oBAAC,MAAA,EAAK,WAAW,OAAO,oBAAoB,eAAY,OAAA,CAAO,GACnE;AAAA,QACA,oBAAC,OAAA,EAAI,WAAW,OAAO,uBAAwB,UAAS;AAAA,QACvD,YACG;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,MAAK;AAAA,YACL,WAAW,GAAG,OAAO,qBAAqB,YAAY,SAAS;AAAA,YAC/D,SAAS;AAAA,YACT,cAAY;AAAA,YAEZ,UAAA,oBAAC,OAAA,EAAM,eAAY,OAAA,CAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MAC9B;AAAA,IAAA;AAAA,EAAA;AAIhB,CAAC;AAED,aAAa,cAAc;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require('./Notification.css');
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4
|
+
const notification = "_notification_1glup_8";
|
|
5
|
+
const notification__icon = "_notification__icon_1glup_36";
|
|
6
|
+
const notification__content = "_notification__content_1glup_59";
|
|
7
|
+
const notification__close = "_notification__close_1glup_70";
|
|
8
|
+
const styles = {
|
|
9
|
+
notification,
|
|
10
|
+
"notification--info": "_notification--info_1glup_19",
|
|
11
|
+
"notification--success": "_notification--success_1glup_23",
|
|
12
|
+
"notification--warning": "_notification--warning_1glup_27",
|
|
13
|
+
"notification--error": "_notification--error_1glup_31",
|
|
14
|
+
"notification__icon-container": "_notification__icon-container_1glup_36",
|
|
15
|
+
notification__icon,
|
|
16
|
+
notification__content,
|
|
17
|
+
notification__close
|
|
18
|
+
};
|
|
19
|
+
exports.default = styles;
|
|
20
|
+
exports.notification = notification;
|
|
21
|
+
exports.notification__close = notification__close;
|
|
22
|
+
exports.notification__content = notification__content;
|
|
23
|
+
exports.notification__icon = notification__icon;
|
|
24
|
+
//# sourceMappingURL=Notification.module.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import './Notification.css';
|
|
2
|
+
const notification = "_notification_1glup_8";
|
|
3
|
+
const notification__icon = "_notification__icon_1glup_36";
|
|
4
|
+
const notification__content = "_notification__content_1glup_59";
|
|
5
|
+
const notification__close = "_notification__close_1glup_70";
|
|
6
|
+
const styles = {
|
|
7
|
+
notification,
|
|
8
|
+
"notification--info": "_notification--info_1glup_19",
|
|
9
|
+
"notification--success": "_notification--success_1glup_23",
|
|
10
|
+
"notification--warning": "_notification--warning_1glup_27",
|
|
11
|
+
"notification--error": "_notification--error_1glup_31",
|
|
12
|
+
"notification__icon-container": "_notification__icon-container_1glup_36",
|
|
13
|
+
notification__icon,
|
|
14
|
+
notification__content,
|
|
15
|
+
notification__close
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
styles as default,
|
|
19
|
+
notification,
|
|
20
|
+
notification__close,
|
|
21
|
+
notification__content,
|
|
22
|
+
notification__icon
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Notification.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export type NotificationVariant = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
interface NotificationBaseProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* Visual variant determining the color and icon.
|
|
6
|
+
*/
|
|
7
|
+
readonly variant: NotificationVariant;
|
|
8
|
+
/**
|
|
9
|
+
* Notification message content.
|
|
10
|
+
*/
|
|
11
|
+
readonly children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
interface NotificationClosableProps extends NotificationBaseProps {
|
|
14
|
+
/**
|
|
15
|
+
* Whether to show the close button.
|
|
16
|
+
*/
|
|
17
|
+
readonly closable: true;
|
|
18
|
+
/**
|
|
19
|
+
* Callback fired when the close button is clicked.
|
|
20
|
+
* Required when `closable` is true.
|
|
21
|
+
* The consuming application is responsible for handling dismiss logic.
|
|
22
|
+
*/
|
|
23
|
+
readonly onClose: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Accessible label for the close button.
|
|
26
|
+
*/
|
|
27
|
+
readonly closeLabel?: string;
|
|
28
|
+
}
|
|
29
|
+
interface NotificationStaticProps extends NotificationBaseProps {
|
|
30
|
+
/**
|
|
31
|
+
* Whether to show the close button.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
readonly closable?: false;
|
|
35
|
+
readonly onClose?: never;
|
|
36
|
+
readonly closeLabel?: never;
|
|
37
|
+
}
|
|
38
|
+
export type NotificationProps = NotificationClosableProps | NotificationStaticProps;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=Notification.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.types.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/Notification.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3E,UAAU,qBAAsB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC3F;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CACtC;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC7D;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,UAAU,uBAAwB,SAAQ,qBAAqB;IAC3D;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;CAC/B;AAED,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* DNA Text font definition */
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'DNA Text';
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-weight: 400;
|
|
6
|
+
font-display: swap;
|
|
7
|
+
src:
|
|
8
|
+
url('https://www.dna.fi/fonts/DNAText-Regular.woff2') format('woff2'),
|
|
9
|
+
url('https://www.dna.fi/fonts/DNAText-Regular.woff') format('woff');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: 'DNA Text';
|
|
14
|
+
font-style: normal;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
font-display: swap;
|
|
17
|
+
src:
|
|
18
|
+
url('https://www.dna.fi/fonts/DNAText-Medium.woff2') format('woff2'),
|
|
19
|
+
url('https://www.dna.fi/fonts/DNAText-Medium.woff') format('woff');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: 'DNA Text';
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: 700;
|
|
26
|
+
font-display: swap;
|
|
27
|
+
src:
|
|
28
|
+
url('https://www.dna.fi/fonts/DNAText-Bold.woff2') format('woff2'),
|
|
29
|
+
url('https://www.dna.fi/fonts/DNAText-Bold.woff') format('woff');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* DNA Heading font definition */
|
|
33
|
+
@font-face {
|
|
34
|
+
font-family: 'DNA Heading';
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
font-display: swap;
|
|
38
|
+
src:
|
|
39
|
+
url('https://www.dna.fi/fonts/DNAHeading-DemiBold.woff2') format('woff2'),
|
|
40
|
+
url('https://www.dna.fi/fonts/DNAHeading-DemiBold.woff') format('woff');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@font-face {
|
|
44
|
+
font-family: 'DNA Heading';
|
|
45
|
+
font-style: normal;
|
|
46
|
+
font-weight: 700;
|
|
47
|
+
font-display: swap;
|
|
48
|
+
src:
|
|
49
|
+
url('https://www.dna.fi/fonts/DNAHeading-Bold.woff2') format('woff2'),
|
|
50
|
+
url('https://www.dna.fi/fonts/DNAHeading-Bold.woff') format('woff');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@font-face {
|
|
54
|
+
font-family: 'DNA Heading';
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 900;
|
|
57
|
+
font-display: swap;
|
|
58
|
+
src:
|
|
59
|
+
url('https://www.dna.fi/fonts/DNAHeading-Black.woff2') format('woff2'),
|
|
60
|
+
url('https://www.dna.fi/fonts/DNAHeading-Black.woff') format('woff');
|
|
61
|
+
}
|