diff --git a/src/components/LoadingBar/_loadingBar.scss b/src/components/LoadingBar/_loadingBar.scss new file mode 100644 index 0000000..34b1543 --- /dev/null +++ b/src/components/LoadingBar/_loadingBar.scss @@ -0,0 +1,37 @@ +@use '../../styles/tokens/typography' as *; + +.loading-bar { + position: relative; + width: 100%; + height: 6px; + background-color: var(--nds-text); + overflow: hidden; + border-radius: var(--nds-radius-sm); + + &__progress { + height: 100%; + background-color: var(--nds-primary); + transition: width 0.3s ease; + border-radius: var(--nds-radius-sm); + } + + &__unknown { + position: absolute; + top: 0; + left: -50%; + width: 50%; + height: 100%; + background-color: var(--nds-primary); + border-radius: var(--nds-radius-sm); + animation: loadingBarIndeterminate 1.5s infinite; + } + + @keyframes loadingBarIndeterminate { + from { + left: -50%; + } + to { + left: 100%; + } + } +} \ No newline at end of file diff --git a/src/components/LoadingBar/loadingBar.astro b/src/components/LoadingBar/loadingBar.astro new file mode 100644 index 0000000..da89a86 --- /dev/null +++ b/src/components/LoadingBar/loadingBar.astro @@ -0,0 +1,19 @@ +--- +export interface Props { + type: 'known' | 'unknown'; + percentage?: number; + width?: string; +} +const { type, percentage, width } = Astro.props; +--- +
+ {type === 'known' && percentage !== undefined ? ( +
+ ) : ( +
+ )} +
+ + \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index 49f7886..bdd4d0d 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -10,4 +10,5 @@ export { default as Button } from './Button/button.astro'; export { default as Link } from './Link/link.astro'; export { default as ListItem } from './ListItem/listItem.astro'; export { default as ListItemTitle } from './ListItem/listItemTitle.astro'; -export { default as ListItemSubtitle } from './ListItem/listItemSubtitle.astro'; \ No newline at end of file +export { default as ListItemSubtitle } from './ListItem/listItemSubtitle.astro'; +export { default as LoadingBar } from './LoadingBar/loadingBar.astro'; \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 9a603d4..f74958e 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -10,6 +10,7 @@ import Link from '../components/Link/link.astro'; import ListItem from '../components/ListItem/listItem.astro'; import ListItemTitle from '../components/ListItem/listItemTitle.astro'; import ListItemSubtitle from '../components/ListItem/listItemSubtitle.astro'; +import LoadingBar from '../components/LoadingBar/loadingBar.astro'; import { Arrow2Icon, BinIcon, BurgerIcon, CalendarIcon, CheckIcon, CloseIcon, CodeIcon, CubeIcon, DownloadIcon, FilterIcon, HelpIcon, HomeIcon, @@ -24,6 +25,14 @@ const initialChecked = true;

Nova Design System

+
+

Loading Bar

+
+ + +
+ +

List Item