diff --git a/src/components/Card/_card.scss b/src/components/Card/_card.scss new file mode 100644 index 0000000..379567a --- /dev/null +++ b/src/components/Card/_card.scss @@ -0,0 +1,53 @@ +@use "../../styles/tokens/typography" as *; + +.card { + display: flex; + flex-direction: column; + background-color: var(--nds-surface); + border: var(--nds-border-width-thin) solid var(--nds-border); + border-radius: var(--nds-radius-lg); + overflow: hidden; + box-shadow: var(--nds-shadow-sm); + width: fit-content; + transition: + box-shadow 160ms ease, + border-color 160ms ease; + &:hover { + box-shadow: var(--nds-shadow-md); + } + + &__cover { + height: 150px; + background-position: center; + background-size: cover; + background-repeat: no-repeat; + } + &__body { + display: flex; + flex-direction: column; + gap: var(--nds-spacing-xs); + padding: var(--nds-spacing-md); + } + &__title { + @include text-xl; + color: var(--nds-text); + margin: 0; + } + &__subtitle { + @include text-base; + color: var(--nds-neutral); + margin: 0; + } + &__content { + @include text-base; + color: var(--nds-text); + &:empty { + display: none; + } + } + &__footer { + margin-top: var(--nds-spacing-2xs); + display: flex; + gap: var(--nds-spacing-xs); + } +} diff --git a/src/components/Card/card.astro b/src/components/Card/card.astro new file mode 100644 index 0000000..276b96d --- /dev/null +++ b/src/components/Card/card.astro @@ -0,0 +1,33 @@ +--- +export interface Props { + title?: string; + subtitle?: string; + cover?: string; +} +const { title, subtitle, cover } = Astro.props; +const hasFooter = Astro.slots.has("footer"); +--- + +
+ { + cover && ( +
+ ) + } +
+ {title &&

{title}

} + {subtitle &&

{subtitle}

} +
+ { + hasFooter && ( + + ) + } +
+
+ + diff --git a/src/components/Navbar/_navbar.scss b/src/components/Navbar/_navbar.scss new file mode 100644 index 0000000..8e9d6a2 --- /dev/null +++ b/src/components/Navbar/_navbar.scss @@ -0,0 +1,55 @@ +@use "../../styles/tokens/typography" as *; + +.navbar { + display: flex; + align-items: center; + gap: var(--nds-spacing-lg); + height: 60px; + padding: 0 var(--nds-spacing-lg); + background-color: var(--nds-surface); + border-bottom: var(--nds-border-width-thin) solid var(--nds-border); + + &__brand { + display: flex; + align-items: center; + gap: var(--nds-spacing-xs); + } + &__mark { + width: 24px; + height: 24px; + border-radius: var(--nds-radius-md); + background: linear-gradient(135deg, var(--nds-primary), var(--nds-accent)); + } + &__title { + @include text-xl; + font-size: 1rem; + color: var(--nds-text); + } + + &__links { + display: flex; + align-items: center; + gap: var(--nds-spacing-2xs); + flex: 1; + } + &__link { + padding: var(--nds-spacing-2xs) var(--nds-spacing-sm); + border-radius: var(--nds-radius-md); + @include text-label; + color: var(--nds-neutral); + text-decoration: none; + transition: all 120ms ease; + &:hover { + color: var(--nds-text); + background-color: var(--nds-surface-hover); + } + &--active { + color: var(--nds-text); + } + } + &__right { + display: flex; + align-items: center; + gap: var(--nds-spacing-sm); + } +} diff --git a/src/components/Navbar/navbar.astro b/src/components/Navbar/navbar.astro new file mode 100644 index 0000000..1d204a3 --- /dev/null +++ b/src/components/Navbar/navbar.astro @@ -0,0 +1,19 @@ +--- +export interface Props { + brand?: string; +} +const { brand = "Nova" } = Astro.props; +--- + + + + diff --git a/src/pages/index.astro b/src/pages/index.astro index d3a5ac2..63337dd 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,65 +1,108 @@ --- -import Layout from '../layouts/Layout.astro'; +import Layout from "../layouts/Layout.astro"; // Core -import Button from '../components/Button/button.astro'; -import Badge from '../components/Badge/badge.astro'; -import Avatar from '../components/Avatar/avatar.astro'; +import Button from "../components/Button/button.astro"; +import Badge from "../components/Badge/badge.astro"; +import Avatar from "../components/Avatar/avatar.astro"; // Forms -import Toggle from '../components/Toggle/toggle.astro'; -import Checkbox from '../components/Checkbox/checkbox.astro'; -import Radio from '../components/Radio/radio.astro'; -import TextField from '../components/textField/textField.astro'; -import Select from '../components/Select/select.astro'; -import SelectOption from '../components/Select/selectOption.astro'; -import NumericStepper from '../components/numericStepper/numericStepper.astro'; +import Toggle from "../components/Toggle/toggle.astro"; +import Checkbox from "../components/Checkbox/checkbox.astro"; +import Radio from "../components/Radio/radio.astro"; +import TextField from "../components/textField/textField.astro"; +import Select from "../components/Select/select.astro"; +import SelectOption from "../components/Select/selectOption.astro"; +import NumericStepper from "../components/numericStepper/numericStepper.astro"; // Navigation -import Tab from '../components/Tabs/tab.astro'; -import TabItem from '../components/Tabs/tabItem.astro'; -import TabContent from '../components/Tabs/tabContent.astro'; -import Link from '../components/Link/link.astro'; -import Breadcrumb from '../components/Breadcrumb/breadcrumb.astro'; -import BreadcrumbItem from '../components/Breadcrumb/breadcrumbItem.astro'; -import Pagination from '../components/pagination/pagination.astro'; -import PaginationNumber from '../components/pagination/paginationNumber.astro'; -import Navbar from '../components/Navbar/navbar.astro'; -import Sidebar from '../components/Sidebar/sidebar.astro'; -import SidebarItem from '../components/Sidebar/sidebarItem.astro'; +import Tab from "../components/Tabs/tab.astro"; +import TabItem from "../components/Tabs/tabItem.astro"; +import TabContent from "../components/Tabs/tabContent.astro"; +import Link from "../components/Link/link.astro"; +import Breadcrumb from "../components/Breadcrumb/breadcrumb.astro"; +import BreadcrumbItem from "../components/Breadcrumb/breadcrumbItem.astro"; +import Pagination from "../components/pagination/pagination.astro"; +import PaginationNumber from "../components/pagination/paginationNumber.astro"; +import Navbar from "../components/Navbar/navbar.astro"; +import Sidebar from "../components/Sidebar/sidebar.astro"; +import SidebarItem from "../components/Sidebar/sidebarItem.astro"; // Data -import Card from '../components/Card/card.astro'; -import ListItem from '../components/ListItem/listItem.astro'; -import ListItemTitle from '../components/ListItem/listItemTitle.astro'; -import ListItemSubtitle from '../components/ListItem/listItemSubtitle.astro'; +import Card from "../components/Card/card.astro"; +import ListItem from "../components/ListItem/listItem.astro"; +import ListItemTitle from "../components/ListItem/listItemTitle.astro"; +import ListItemSubtitle from "../components/ListItem/listItemSubtitle.astro"; // Feedback -import Notification from '../components/Notifications/notification.astro'; -import LoadingBar from '../components/LoadingBar/loadingBar.astro'; -import Tooltip from '../components/Tooltip/tooltip.astro'; -import Modal from '../components/Modal/modal.astro'; +import Notification from "../components/Notifications/notification.astro"; +import LoadingBar from "../components/LoadingBar/loadingBar.astro"; +import Tooltip from "../components/Tooltip/tooltip.astro"; +import Modal from "../components/Modal/modal.astro"; import { - Arrow2Icon, BinIcon, BurgerIcon, CalendarIcon, CheckIcon, CloseIcon, - CodeIcon, CubeIcon, DownloadIcon, FilterIcon, HelpIcon, HomeIcon, - LinkIcon, MinusIcon, MoreIcon, OverviewIcon, PlusIcon, ProfileIcon, - SearchIcon, SettingsIcon, ShareIcon, ShieldIcon, SortIcon, StatsIcon, + Arrow2Icon, + BinIcon, + BurgerIcon, + CalendarIcon, + CheckIcon, + CloseIcon, + CodeIcon, + CubeIcon, + DownloadIcon, + FilterIcon, + HelpIcon, + HomeIcon, + LinkIcon, + MinusIcon, + MoreIcon, + OverviewIcon, + PlusIcon, + ProfileIcon, + SearchIcon, + SettingsIcon, + ShareIcon, + ShieldIcon, + SortIcon, + StatsIcon, UploadIcon, -} from '../components/Icons/index.ts'; +} from "../components/Icons/index.ts"; -const tones = ['primary', 'neutral', 'success', 'warning', 'error', 'info'] as const; -const buttonTypes = ['primary', 'secondary', 'ghost', 'danger'] as const; -const sizes = ['sm', 'md', 'lg'] as const; +const tones = [ + "primary", + "neutral", + "success", + "warning", + "error", + "info", +] as const; +const buttonTypes = ["primary", "secondary", "ghost", "danger"] as const; +const sizes = ["sm", "md", "lg"] as const; const libraryIcons = [ - ['Profile', ProfileIcon], ['Search', SearchIcon], ['Settings', SettingsIcon], - ['Home', HomeIcon], ['Overview', OverviewIcon], ['Stats', StatsIcon], - ['Share', ShareIcon], ['Shield', ShieldIcon], ['Download', DownloadIcon], - ['Upload', UploadIcon], ['Filter', FilterIcon], ['Bin', BinIcon], - ['Burger', BurgerIcon], ['Calendar', CalendarIcon], ['Check', CheckIcon], - ['Close', CloseIcon], ['Code', CodeIcon], ['Cube', CubeIcon], - ['Help', HelpIcon], ['Link', LinkIcon], ['Minus', MinusIcon], - ['More', MoreIcon], ['Plus', PlusIcon], ['Sort', SortIcon], + ["Profile", ProfileIcon], + ["Search", SearchIcon], + ["Settings", SettingsIcon], + ["Home", HomeIcon], + ["Overview", OverviewIcon], + ["Stats", StatsIcon], + ["Share", ShareIcon], + ["Shield", ShieldIcon], + ["Download", DownloadIcon], + ["Upload", UploadIcon], + ["Filter", FilterIcon], + ["Bin", BinIcon], + ["Burger", BurgerIcon], + ["Calendar", CalendarIcon], + ["Check", CheckIcon], + ["Close", CloseIcon], + ["Code", CodeIcon], + ["Cube", CubeIcon], + ["Help", HelpIcon], + ["Link", LinkIcon], + ["Minus", MinusIcon], + ["More", MoreIcon], + ["Plus", PlusIcon], + ["Sort", SortIcon], ] as const; --- @@ -78,255 +121,419 @@ const libraryIcons = [

Button

Variants, sizes, icon and disabled states.

-
Variants × md
- {buttonTypes.map((t) => )} -
-
Sizes (primary)
- {sizes.map((s) => )} -
-
With icon · icon-only
- - - -
-
Disabled
- {buttonTypes.map((t) => )} -
+
+ Variants × md
+ { + buttonTypes.map((t) => ( + + )) + } +
+
+
+ Sizes (primary)
+ { + sizes.map((s) => ( + + )) + } +
+
+
+ With icon · icon-only
+ + + +
+
+
+ Disabled
+ { + buttonTypes.map((t) => ( + + )) + } +
+

Badge

Tones × soft / solid.

-
Soft
- {tones.map((t) => {t})} -
-
Solid
- {tones.map((t) => {t})} -
+
+ Soft
+ { + tones.map((t) => ( + + {t} + + )) + } +
+
+
+ Solid
+ { + tones.map((t) => ( + + {t} + + )) + } +
+

Toggle · Checkbox · Radio

Selection controls in every state.

-
Toggle — off / on
- - -
-
Checkbox
- Unchecked - Checked - Disabled -
-
Radio group
- On-demand - Reserved - Spot -
+
+ Toggle — off / on
+ + +
+
+
+ Checkbox
+ Unchecked + Checked + Disabled +
+
+
+ Radio group
+ On-demand + Reserved + Spot +
+

TextField

Text, email, password, textarea.

-
Fields
- - - - -
+
+ Fields
+ + + + +
+

Select

Default and disabled.

-
Select
- - -
+
+ Select
+ + +
+

Numeric stepper

Increment / decrement control.

-
Stepper
- -
+
+ Stepper
+ +
+

Avatar

Photo and initials.

-
Types
- - - -
+
+ Types
+ + + +
+

Loading bar

Determinate and indeterminate.

-
Known 75% · indeterminate
- - -
+
+ Known 75% · indeterminate
+ + +
+

List item

Title and subtitle rows.

-
List
- - api-gateway - Edge routing · eu-west-1 - - - postgres-main - Database · eu-west-1 - -
+
+ List
+ + api-gateway + Edge routing · eu-west-1 + + + postgres-main + Database · eu-west-1 + +
+

Tabs

Underline tabs with panels.

-
Tabs
- - Images - Videos - Documents - -

🖼️ Image gallery content.

-

🎬 Video player here.

-

📄 Document list here.

-
+
+ Tabs
+ + Images + Videos + Documents + +

🖼️ Image gallery content.

+

🎬 Video player here.

+

📄 Document list here.

+
+

Pagination

Page numbers with disabled edges.

-
Pagination
- - 1 - 2 - 3 - 4 - 5 - -
+
+ Pagination
+ + 1 + 2 + 3 + 4 + 5 + +
+

Notification

Info, success, warning and error.

-
All types
- Information about the operation. - The operation completed successfully. - A warning occurred. Please check the details. - An error occurred. Please try again. -
+
+ All types
+ Information about the operation. + The operation completed successfully. + A warning occurred. Please check the details. + An error occurred. Please try again. +
+

Tooltip

Four positions — hover the buttons.

-
Positions
- - - - -
+
+ Positions
+ + + + +
+

Card

With cover, plain and with footer.

-
Cards
- -
Live
-
- - -
- - -
-
-
+
+ Cards
+ +
+ Live +
+
+ + +
+ + +
+
+
+

Navbar · Sidebar

App chrome.

-
Navbar
- - Services - Incidents - Settings - - -
-
Sidebar
- - Overview - Metrics - Security - Settings - -
+
+ Navbar
+ + Services + Incidents + Settings + + +
+
+
+ Sidebar
+ + Overview + Metrics + Security + Settings + +
+