diff --git a/src/components/Notifications/_notification.scss b/src/components/Notifications/_notification.scss new file mode 100644 index 0000000..044041d --- /dev/null +++ b/src/components/Notifications/_notification.scss @@ -0,0 +1,67 @@ +.notification { + display: flex; + align-items: center; + gap: var(--nds-spacing-sm); + padding: var(--nds-spacing-sm) var(--nds-spacing-md); + border-radius: var(--nds-radius-md); + border: var(--nds-border-width-thin) solid; + font-family: var(--nds-font-family-base); + font-size: var(--nds-type-body-medium-size); + font-weight: var(--nds-type-body-medium-weight); + letter-spacing: var(--nds-type-body-medium-letter-spacing); + + &__content { + flex: 1; + line-height: 1.5; + } + + &__close { + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + background: none; + border: none; + padding: 0; + cursor: pointer; + color: inherit; + opacity: 0.7; + + &:hover { + opacity: 1; + } + + &:focus-visible { + outline: 2px solid var(--nds-focus-ring); + outline-offset: 2px; + border-radius: var(--nds-radius-xs); + } + &--error { + color: var(--nds-error-medium); + } + } + + &--info { + background-color: var(--nds-info-low); + border-color: var(--nds-info-medium); + color: var(--nds-info-high); + } + + &--success { + background-color: var(--nds-correct-low); + border-color: var(--nds-correct-medium); + color: var(--nds-correct-high); + } + + &--warning { + background-color: var(--nds-warning-low); + border-color: var(--nds-warning-medium); + color: var(--nds-warning-high); + } + + &--error { + background-color: var(--nds-error-low); + border-color: var(--nds-error-medium); + color: var(--nds-error-high); + } +} diff --git a/src/components/Notifications/notification.astro b/src/components/Notifications/notification.astro new file mode 100644 index 0000000..dfd0c57 --- /dev/null +++ b/src/components/Notifications/notification.astro @@ -0,0 +1,23 @@ +--- +import { CloseIcon } from "../Icons"; + + +export interface Props { + type: 'info' | 'success' | 'warning' | 'error'; +} +const notificationUUID = `notification-${Math.random().toString(36).substr(2, 9)}`; +const { type } = Astro.props; +--- + + + + \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index 0dd518a..768d912 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,3 +1,4 @@ // Auto-generated by scripts/generate-barrel.mjs — do not edit manually. export * from './Icons/index.ts'; +export { default as Notification } from './Notifications/notification.astro'; diff --git a/src/pages/index.astro b/src/pages/index.astro index 8eb774d..a141fe0 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -7,11 +7,20 @@ import { SearchIcon, SettingsIcon, ShareIcon, ShieldIcon, SortIcon, StatsIcon, UploadIcon, } from '../components/Icons/index.ts'; +import Notification from '../components/Notifications/notification.astro'; ---

Nova Design System

+
+

Notifications — Error / Warning / Success / Info

+
+ + An error occurred during the operation. Please try again. + +
+

Icon — 16 / 24 / 32