@ivds/core 0.1.1
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/CHANGELOG.md +45 -0
- package/README.md +215 -0
- package/lib/all.css +6802 -0
- package/lib/all.min.css +1 -0
- package/lib/base/base.css +215 -0
- package/lib/base/base.min.css +1 -0
- package/lib/components/_breadcrumb-mixins.scss +173 -0
- package/lib/components/_button-mixin.scss +120 -0
- package/lib/components/_card-mixin.scss +196 -0
- package/lib/components/_checkbox-mixin.scss +208 -0
- package/lib/components/_footer-mixin.scss +385 -0
- package/lib/components/_header-mixin.scss +275 -0
- package/lib/components/_navigation-mixins.scss +270 -0
- package/lib/components/_notification-mixin.scss +239 -0
- package/lib/components/_pagination-mixins.scss +280 -0
- package/lib/components/_radio-button-mixin.scss +207 -0
- package/lib/components/_tag-mixin.scss +261 -0
- package/lib/components/_text-input-mixin.scss +203 -0
- package/lib/components/all.css +3005 -0
- package/lib/components/all.min.css +1 -0
- package/lib/components/breadcrumb/breadcrumb.css +141 -0
- package/lib/components/breadcrumb/breadcrumb.min.css +1 -0
- package/lib/components/button/button.css +221 -0
- package/lib/components/button/button.min.css +1 -0
- package/lib/components/card/card.css +236 -0
- package/lib/components/card/card.min.css +1 -0
- package/lib/components/checkbox/checkbox.css +305 -0
- package/lib/components/checkbox/checkbox.min.css +1 -0
- package/lib/components/footer/footer.css +466 -0
- package/lib/components/footer/footer.min.css +1 -0
- package/lib/components/header/header.css +274 -0
- package/lib/components/header/header.min.css +1 -0
- package/lib/components/navigation/navigation.css +214 -0
- package/lib/components/navigation/navigation.min.css +1 -0
- package/lib/components/notification/notification.css +253 -0
- package/lib/components/notification/notification.min.css +1 -0
- package/lib/components/pagination/pagination.css +221 -0
- package/lib/components/pagination/pagination.min.css +1 -0
- package/lib/components/radio-button/radio-button.css +326 -0
- package/lib/components/radio-button/radio-button.min.css +1 -0
- package/lib/components/tag/tag.css +367 -0
- package/lib/components/tag/tag.min.css +1 -0
- package/lib/components/text-input/text-input.css +243 -0
- package/lib/components/text-input/text-input.min.css +1 -0
- package/lib/icons/icon-arrow-left.css +139 -0
- package/lib/icons/icon-arrow-left.min.css +1 -0
- package/lib/icons/icon-arrow-right.css +139 -0
- package/lib/icons/icon-arrow-right.min.css +1 -0
- package/lib/icons/icon-check.css +139 -0
- package/lib/icons/icon-check.min.css +1 -0
- package/lib/icons/icon-close.css +140 -0
- package/lib/icons/icon-close.min.css +1 -0
- package/lib/icons/icon-error.css +140 -0
- package/lib/icons/icon-error.min.css +1 -0
- package/lib/icons/icon-info.css +140 -0
- package/lib/icons/icon-info.min.css +1 -0
- package/lib/icons/icon-success.css +139 -0
- package/lib/icons/icon-success.min.css +1 -0
- package/lib/icons/icon-warning.css +139 -0
- package/lib/icons/icon-warning.min.css +1 -0
- package/lib/icons/icons.css +1158 -0
- package/lib/icons/icons.min.css +1 -0
- package/lib/utils/_flex.scss +200 -0
- package/lib/utils/_grid.scss +211 -0
- package/lib/utils/_layout.scss +253 -0
- package/lib/utils/_spacing.scss +260 -0
- package/lib/utils/_typography.scss +111 -0
- package/lib/utils/utils.css +2434 -0
- package/lib/utils/utils.min.css +1 -0
- package/lib/utils-only.css +2801 -0
- package/lib/utils-only.min.css +1 -0
- package/lib/variables/variables.css +2 -0
- package/lib/variables/variables.min.css +0 -0
- package/package.json +194 -0
- package/src/__tests__/example.test.scss +12 -0
- package/src/accessibility.stories.js +416 -0
- package/src/all.scss +9 -0
- package/src/base/_layout.scss +97 -0
- package/src/base/_reset.scss +85 -0
- package/src/base/_typography.scss +105 -0
- package/src/base/base.scss +6 -0
- package/src/components/all.scss +22 -0
- package/src/components/breadcrumb/_breadcrumb-mixins.scss +173 -0
- package/src/components/breadcrumb/breadcrumb.scss +68 -0
- package/src/components/breadcrumb/breadcrumb.stories.js +483 -0
- package/src/components/button/__tests__/button-mixins.test.scss +35 -0
- package/src/components/button/_button-mixin.scss +120 -0
- package/src/components/button/button.scss +126 -0
- package/src/components/button/button.stories.js +364 -0
- package/src/components/card/__tests__/card-mixins.test.scss +36 -0
- package/src/components/card/_card-mixin.scss +196 -0
- package/src/components/card/card.scss +193 -0
- package/src/components/card/card.stories.js +635 -0
- package/src/components/checkbox/_checkbox-mixin.scss +208 -0
- package/src/components/checkbox/checkbox.scss +141 -0
- package/src/components/checkbox/checkbox.stories.js +303 -0
- package/src/components/footer/_footer-mixin.scss +385 -0
- package/src/components/footer/footer.scss +86 -0
- package/src/components/footer/footer.stories.js +740 -0
- package/src/components/header/_header-mixin.scss +275 -0
- package/src/components/header/header.scss +84 -0
- package/src/components/header/header.stories.js +450 -0
- package/src/components/navigation/_navigation-mixins.scss +270 -0
- package/src/components/navigation/navigation.scss +64 -0
- package/src/components/navigation/navigation.stories.js +410 -0
- package/src/components/notification/_notification-mixin.scss +239 -0
- package/src/components/notification/notification.scss +118 -0
- package/src/components/notification/notification.stories.js +378 -0
- package/src/components/overview.stories.js +473 -0
- package/src/components/pagination/_pagination-mixins.scss +280 -0
- package/src/components/pagination/pagination.scss +76 -0
- package/src/components/pagination/pagination.stories.js +729 -0
- package/src/components/radio-button/_radio-button-mixin.scss +207 -0
- package/src/components/radio-button/radio-button.scss +178 -0
- package/src/components/radio-button/radio-button.stories.js +379 -0
- package/src/components/tag/_tag-mixin.scss +261 -0
- package/src/components/tag/tag.scss +244 -0
- package/src/components/tag/tag.stories.js +482 -0
- package/src/components/text-input/_text-input-mixin.scss +203 -0
- package/src/components/text-input/text-input.scss +150 -0
- package/src/components/text-input/text-input.stories.js +723 -0
- package/src/icons/_icon.scss +121 -0
- package/src/icons/icon-arrow-left.scss +23 -0
- package/src/icons/icon-arrow-right.scss +23 -0
- package/src/icons/icon-check.scss +23 -0
- package/src/icons/icon-close.scss +24 -0
- package/src/icons/icon-error.scss +24 -0
- package/src/icons/icon-info.scss +24 -0
- package/src/icons/icon-success.scss +23 -0
- package/src/icons/icon-warning.scss +23 -0
- package/src/icons/icons.scss +12 -0
- package/src/icons/icons.stories.js +249 -0
- package/src/icons/svg/arrow-left.svg +3 -0
- package/src/icons/svg/arrow-right.svg +3 -0
- package/src/icons/svg/check.svg +3 -0
- package/src/icons/svg/close.svg +4 -0
- package/src/icons/svg/error.svg +5 -0
- package/src/icons/svg/info.svg +5 -0
- package/src/icons/svg/success.svg +4 -0
- package/src/icons/svg/warning.svg +5 -0
- package/src/utils/__tests__/utilities.test.scss +37 -0
- package/src/utils/_flex.scss +200 -0
- package/src/utils/_grid.scss +211 -0
- package/src/utils/_layout.scss +253 -0
- package/src/utils/_spacing.scss +260 -0
- package/src/utils/_typography.scss +111 -0
- package/src/utils/utils.scss +8 -0
- package/src/variables/_borders.scss +15 -0
- package/src/variables/_breakpoints.scss +11 -0
- package/src/variables/_colors.scss +97 -0
- package/src/variables/_shadows.scss +14 -0
- package/src/variables/_spacing.scss +24 -0
- package/src/variables/_typography.scss +47 -0
- package/src/variables/variables.scss +9 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Notification component styles
|
|
2
|
+
// Provides styling for the IVDS notification component with all variants, dismissible functionality, and states
|
|
3
|
+
|
|
4
|
+
@use '_notification-mixin' as notification;
|
|
5
|
+
|
|
6
|
+
// Notification Base
|
|
7
|
+
.ivds-notification {
|
|
8
|
+
@include notification.notification-base;
|
|
9
|
+
|
|
10
|
+
// Notification elements
|
|
11
|
+
&__icon {
|
|
12
|
+
@include notification.notification-icon;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&__content {
|
|
16
|
+
@include notification.notification-content;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__title {
|
|
20
|
+
@include notification.notification-title;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&__message {
|
|
24
|
+
@include notification.notification-message;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&__actions {
|
|
28
|
+
@include notification.notification-actions;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Dismiss button (added when dismissible)
|
|
32
|
+
&__dismiss {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
width: 1.5rem;
|
|
37
|
+
height: 1.5rem;
|
|
38
|
+
|
|
39
|
+
svg {
|
|
40
|
+
width: 1rem;
|
|
41
|
+
height: 1rem;
|
|
42
|
+
fill: currentcolor;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Notification Variants
|
|
48
|
+
.ivds-notification--success {
|
|
49
|
+
@include notification.notification-variant(
|
|
50
|
+
var(--color-semantic-success-50, #f0fdf4),
|
|
51
|
+
var(--color-semantic-success-500, #22c55e),
|
|
52
|
+
var(--color-semantic-success-700, #15803d),
|
|
53
|
+
var(--color-semantic-success-800, #166534)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ivds-notification--warning {
|
|
58
|
+
@include notification.notification-variant(
|
|
59
|
+
var(--color-semantic-warning-50, #fffbeb),
|
|
60
|
+
var(--color-semantic-warning-500, #f59e0b),
|
|
61
|
+
var(--color-semantic-warning-700, #b45309),
|
|
62
|
+
var(--color-semantic-warning-800, #92400e)
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ivds-notification--error {
|
|
67
|
+
@include notification.notification-variant(
|
|
68
|
+
var(--color-semantic-error-50, #fef2f2),
|
|
69
|
+
var(--color-semantic-error-500, #ef4444),
|
|
70
|
+
var(--color-semantic-error-700, #b91c1c),
|
|
71
|
+
var(--color-semantic-error-800, #991b1b)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ivds-notification--info {
|
|
76
|
+
@include notification.notification-variant(
|
|
77
|
+
var(--color-semantic-info-50, #eff6ff),
|
|
78
|
+
var(--color-semantic-info-500, #3b82f6),
|
|
79
|
+
var(--color-semantic-info-700, #1d4ed8),
|
|
80
|
+
var(--color-semantic-info-800, #1e40af)
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Dismissible notifications
|
|
85
|
+
.ivds-notification--dismissible {
|
|
86
|
+
@include notification.notification-dismissible;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Size variants
|
|
90
|
+
.ivds-notification--compact {
|
|
91
|
+
@include notification.notification-compact;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ivds-notification--spacious {
|
|
95
|
+
@include notification.notification-spacious;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Notifications with actions
|
|
99
|
+
.ivds-notification--with-actions {
|
|
100
|
+
@include notification.notification-with-actions;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Animation classes
|
|
104
|
+
.ivds-notification--slide-in {
|
|
105
|
+
@include notification.notification-slide-in;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ivds-notification--slide-out {
|
|
109
|
+
@include notification.notification-slide-out;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ivds-notification--fade-in {
|
|
113
|
+
@include notification.notification-fade-in;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ivds-notification--fade-out {
|
|
117
|
+
@include notification.notification-fade-out;
|
|
118
|
+
}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
// Notification component stories for Storybook
|
|
2
|
+
// Showcases all notification variants, dismissible functionality, and states
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Core/Notification',
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: 'CSS-only notification component using IVDS design tokens. Provides success, warning, error, and info variants with dismissible functionality and icon support.'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
a11y: {
|
|
13
|
+
config: {
|
|
14
|
+
rules: [
|
|
15
|
+
{
|
|
16
|
+
id: 'color-contrast',
|
|
17
|
+
enabled: true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'focus-order-semantics',
|
|
21
|
+
enabled: true
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Basic notification variants
|
|
30
|
+
export const Success = () => `
|
|
31
|
+
<div class="ivds-notification ivds-notification--success">
|
|
32
|
+
<div class="ivds-notification__icon">
|
|
33
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
34
|
+
<path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
35
|
+
</svg>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="ivds-notification__content">
|
|
38
|
+
<div class="ivds-notification__title">Success!</div>
|
|
39
|
+
<div class="ivds-notification__message">Your changes have been saved successfully.</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
export const Warning = () => `
|
|
45
|
+
<div class="ivds-notification ivds-notification--warning">
|
|
46
|
+
<div class="ivds-notification__icon">
|
|
47
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
48
|
+
<path d="M12 9V13M12 17H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
49
|
+
</svg>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="ivds-notification__content">
|
|
52
|
+
<div class="ivds-notification__title">Warning</div>
|
|
53
|
+
<div class="ivds-notification__message">Please review your input before proceeding.</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
export const Error = () => `
|
|
59
|
+
<div class="ivds-notification ivds-notification--error">
|
|
60
|
+
<div class="ivds-notification__icon">
|
|
61
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
62
|
+
<path d="M12 8V12M12 16H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
63
|
+
</svg>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="ivds-notification__content">
|
|
66
|
+
<div class="ivds-notification__title">Error</div>
|
|
67
|
+
<div class="ivds-notification__message">Something went wrong. Please try again later.</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
export const Info = () => `
|
|
73
|
+
<div class="ivds-notification ivds-notification--info">
|
|
74
|
+
<div class="ivds-notification__icon">
|
|
75
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
76
|
+
<path d="M13 16H12V12H11M12 8H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
77
|
+
</svg>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="ivds-notification__content">
|
|
80
|
+
<div class="ivds-notification__title">Information</div>
|
|
81
|
+
<div class="ivds-notification__message">Here's some helpful information for you to know.</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
// Dismissible notifications
|
|
87
|
+
export const Dismissible = () => `
|
|
88
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
89
|
+
<div class="ivds-notification ivds-notification--success ivds-notification--dismissible">
|
|
90
|
+
<div class="ivds-notification__icon">
|
|
91
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
92
|
+
<path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
93
|
+
</svg>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="ivds-notification__content">
|
|
96
|
+
<div class="ivds-notification__title">Success!</div>
|
|
97
|
+
<div class="ivds-notification__message">This notification can be dismissed by clicking the X button.</div>
|
|
98
|
+
</div>
|
|
99
|
+
<button class="ivds-notification__dismiss" aria-label="Dismiss notification">
|
|
100
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
101
|
+
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
102
|
+
</svg>
|
|
103
|
+
</button>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div class="ivds-notification ivds-notification--warning ivds-notification--dismissible">
|
|
107
|
+
<div class="ivds-notification__icon">
|
|
108
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
109
|
+
<path d="M12 9V13M12 17H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
110
|
+
</svg>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="ivds-notification__content">
|
|
113
|
+
<div class="ivds-notification__title">Warning</div>
|
|
114
|
+
<div class="ivds-notification__message">This warning can be dismissed when you're ready.</div>
|
|
115
|
+
</div>
|
|
116
|
+
<button class="ivds-notification__dismiss" aria-label="Dismiss notification">
|
|
117
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
118
|
+
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
119
|
+
</svg>
|
|
120
|
+
</button>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
// Size variants
|
|
126
|
+
export const Sizes = () => `
|
|
127
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
128
|
+
<div class="ivds-notification ivds-notification--info ivds-notification--compact">
|
|
129
|
+
<div class="ivds-notification__icon">
|
|
130
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
131
|
+
<path d="M13 16H12V12H11M12 8H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
132
|
+
</svg>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="ivds-notification__content">
|
|
135
|
+
<div class="ivds-notification__title">Compact Size</div>
|
|
136
|
+
<div class="ivds-notification__message">This is a compact notification with smaller padding and text.</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div class="ivds-notification ivds-notification--info">
|
|
141
|
+
<div class="ivds-notification__icon">
|
|
142
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
143
|
+
<path d="M13 16H12V12H11M12 8H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
144
|
+
</svg>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="ivds-notification__content">
|
|
147
|
+
<div class="ivds-notification__title">Default Size</div>
|
|
148
|
+
<div class="ivds-notification__message">This is the default notification size with standard padding and text.</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<div class="ivds-notification ivds-notification--info ivds-notification--spacious">
|
|
153
|
+
<div class="ivds-notification__icon">
|
|
154
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
155
|
+
<path d="M13 16H12V12H11M12 8H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
156
|
+
</svg>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="ivds-notification__content">
|
|
159
|
+
<div class="ivds-notification__title">Spacious Size</div>
|
|
160
|
+
<div class="ivds-notification__message">This is a spacious notification with larger padding, bigger text, and more breathing room.</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
`;
|
|
165
|
+
|
|
166
|
+
// Notifications with actions
|
|
167
|
+
export const WithActions = () => `
|
|
168
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
169
|
+
<div class="ivds-notification ivds-notification--warning ivds-notification--with-actions">
|
|
170
|
+
<div class="ivds-notification__icon">
|
|
171
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
172
|
+
<path d="M12 9V13M12 17H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
173
|
+
</svg>
|
|
174
|
+
</div>
|
|
175
|
+
<div class="ivds-notification__content">
|
|
176
|
+
<div class="ivds-notification__title">Update Available</div>
|
|
177
|
+
<div class="ivds-notification__message">A new version of the application is available. Would you like to update now?</div>
|
|
178
|
+
<div class="ivds-notification__actions">
|
|
179
|
+
<button class="ivds-button ivds-button--warning ivds-button--small">Update Now</button>
|
|
180
|
+
<button class="ivds-button ivds-button--tertiary ivds-button--small">Later</button>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div class="ivds-notification ivds-notification--error ivds-notification--with-actions ivds-notification--dismissible">
|
|
186
|
+
<div class="ivds-notification__icon">
|
|
187
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
188
|
+
<path d="M12 8V12M12 16H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
189
|
+
</svg>
|
|
190
|
+
</div>
|
|
191
|
+
<div class="ivds-notification__content">
|
|
192
|
+
<div class="ivds-notification__title">Connection Failed</div>
|
|
193
|
+
<div class="ivds-notification__message">Unable to connect to the server. Please check your internet connection.</div>
|
|
194
|
+
<div class="ivds-notification__actions">
|
|
195
|
+
<button class="ivds-button ivds-button--danger ivds-button--small">Retry</button>
|
|
196
|
+
<button class="ivds-button ivds-button--tertiary ivds-button--small">Go Offline</button>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
<button class="ivds-notification__dismiss" aria-label="Dismiss notification">
|
|
200
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
201
|
+
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
202
|
+
</svg>
|
|
203
|
+
</button>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
`;
|
|
207
|
+
|
|
208
|
+
// Without icons
|
|
209
|
+
export const WithoutIcons = () => `
|
|
210
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
211
|
+
<div class="ivds-notification ivds-notification--success">
|
|
212
|
+
<div class="ivds-notification__content">
|
|
213
|
+
<div class="ivds-notification__title">Success!</div>
|
|
214
|
+
<div class="ivds-notification__message">Your changes have been saved successfully.</div>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<div class="ivds-notification ivds-notification--info ivds-notification--dismissible">
|
|
219
|
+
<div class="ivds-notification__content">
|
|
220
|
+
<div class="ivds-notification__title">Information</div>
|
|
221
|
+
<div class="ivds-notification__message">This notification doesn't have an icon but still maintains proper spacing.</div>
|
|
222
|
+
</div>
|
|
223
|
+
<button class="ivds-notification__dismiss" aria-label="Dismiss notification">
|
|
224
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
225
|
+
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
226
|
+
</svg>
|
|
227
|
+
</button>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
`;
|
|
231
|
+
|
|
232
|
+
// Message only (no title)
|
|
233
|
+
export const MessageOnly = () => `
|
|
234
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
235
|
+
<div class="ivds-notification ivds-notification--success">
|
|
236
|
+
<div class="ivds-notification__icon">
|
|
237
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
238
|
+
<path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
239
|
+
</svg>
|
|
240
|
+
</div>
|
|
241
|
+
<div class="ivds-notification__content">
|
|
242
|
+
<div class="ivds-notification__message">File uploaded successfully.</div>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
<div class="ivds-notification ivds-notification--error ivds-notification--dismissible">
|
|
247
|
+
<div class="ivds-notification__icon">
|
|
248
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
249
|
+
<path d="M12 8V12M12 16H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
250
|
+
</svg>
|
|
251
|
+
</div>
|
|
252
|
+
<div class="ivds-notification__content">
|
|
253
|
+
<div class="ivds-notification__message">Unable to save changes. Please try again.</div>
|
|
254
|
+
</div>
|
|
255
|
+
<button class="ivds-notification__dismiss" aria-label="Dismiss notification">
|
|
256
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
257
|
+
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
258
|
+
</svg>
|
|
259
|
+
</button>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
`;
|
|
263
|
+
|
|
264
|
+
// All variants showcase
|
|
265
|
+
export const AllVariants = () => `
|
|
266
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
267
|
+
<div class="ivds-notification ivds-notification--success">
|
|
268
|
+
<div class="ivds-notification__icon">
|
|
269
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
270
|
+
<path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
271
|
+
</svg>
|
|
272
|
+
</div>
|
|
273
|
+
<div class="ivds-notification__content">
|
|
274
|
+
<div class="ivds-notification__title">Success</div>
|
|
275
|
+
<div class="ivds-notification__message">Operation completed successfully.</div>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
|
|
279
|
+
<div class="ivds-notification ivds-notification--warning">
|
|
280
|
+
<div class="ivds-notification__icon">
|
|
281
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
282
|
+
<path d="M12 9V13M12 17H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
283
|
+
</svg>
|
|
284
|
+
</div>
|
|
285
|
+
<div class="ivds-notification__content">
|
|
286
|
+
<div class="ivds-notification__title">Warning</div>
|
|
287
|
+
<div class="ivds-notification__message">Please review before proceeding.</div>
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<div class="ivds-notification ivds-notification--error">
|
|
292
|
+
<div class="ivds-notification__icon">
|
|
293
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
294
|
+
<path d="M12 8V12M12 16H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12 2C6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
295
|
+
</svg>
|
|
296
|
+
</div>
|
|
297
|
+
<div class="ivds-notification__content">
|
|
298
|
+
<div class="ivds-notification__title">Error</div>
|
|
299
|
+
<div class="ivds-notification__message">Something went wrong.</div>
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<div class="ivds-notification ivds-notification--info">
|
|
304
|
+
<div class="ivds-notification__icon">
|
|
305
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
306
|
+
<path d="M13 16H12V12H11M12 8H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
307
|
+
</svg>
|
|
308
|
+
</div>
|
|
309
|
+
<div class="ivds-notification__content">
|
|
310
|
+
<div class="ivds-notification__title">Information</div>
|
|
311
|
+
<div class="ivds-notification__message">Here's some helpful information.</div>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
`;
|
|
316
|
+
|
|
317
|
+
// Accessibility example
|
|
318
|
+
export const AccessibilityFeatures = () => `
|
|
319
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
320
|
+
<div class="ivds-notification ivds-notification--success" role="alert" aria-live="polite">
|
|
321
|
+
<div class="ivds-notification__icon" aria-hidden="true">
|
|
322
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
323
|
+
<path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
324
|
+
</svg>
|
|
325
|
+
</div>
|
|
326
|
+
<div class="ivds-notification__content">
|
|
327
|
+
<div class="ivds-notification__title">Success</div>
|
|
328
|
+
<div class="ivds-notification__message">This notification uses proper ARIA attributes for screen readers.</div>
|
|
329
|
+
</div>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
<div class="ivds-notification ivds-notification--error ivds-notification--dismissible" role="alert" aria-live="assertive">
|
|
333
|
+
<div class="ivds-notification__icon" aria-hidden="true">
|
|
334
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
335
|
+
<path d="M12 8V12M12 16H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
336
|
+
</svg>
|
|
337
|
+
</div>
|
|
338
|
+
<div class="ivds-notification__content">
|
|
339
|
+
<div class="ivds-notification__title">Critical Error</div>
|
|
340
|
+
<div class="ivds-notification__message">This error notification uses aria-live="assertive" for immediate attention.</div>
|
|
341
|
+
</div>
|
|
342
|
+
<button class="ivds-notification__dismiss" aria-label="Dismiss critical error notification">
|
|
343
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
344
|
+
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
345
|
+
</svg>
|
|
346
|
+
</button>
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
`;
|
|
350
|
+
|
|
351
|
+
// Animation examples (for demonstration)
|
|
352
|
+
export const AnimationExamples = () => `
|
|
353
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
354
|
+
<div class="ivds-notification ivds-notification--info ivds-notification--fade-in">
|
|
355
|
+
<div class="ivds-notification__icon">
|
|
356
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
357
|
+
<path d="M13 16H12V12H11M12 8H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
358
|
+
</svg>
|
|
359
|
+
</div>
|
|
360
|
+
<div class="ivds-notification__content">
|
|
361
|
+
<div class="ivds-notification__title">Fade In Animation</div>
|
|
362
|
+
<div class="ivds-notification__message">This notification fades in with a subtle scale effect.</div>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
|
|
366
|
+
<div class="ivds-notification ivds-notification--success ivds-notification--slide-in">
|
|
367
|
+
<div class="ivds-notification__icon">
|
|
368
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
369
|
+
<path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
370
|
+
</svg>
|
|
371
|
+
</div>
|
|
372
|
+
<div class="ivds-notification__content">
|
|
373
|
+
<div class="ivds-notification__title">Slide In Animation</div>
|
|
374
|
+
<div class="ivds-notification__message">This notification slides in from the right side.</div>
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
`;
|