-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
360 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/ui/src/components/atom/collapsible/collapsible.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import { Collapsible } from 'bits-ui' | ||
import { ChevronDown } from 'lucide-svelte' | ||
import { slide } from 'svelte/transition' | ||
export let name = undefined | ||
</script> | ||
|
||
<Collapsible.Root class="relative"> | ||
<div class="flex flex-row md:gap-2"> | ||
<p class="text-primary text-button1 font-medium">{name}</p> | ||
<Collapsible.Trigger> | ||
<ChevronDown color="#4A70C6" class="hidden md:block" /> | ||
</Collapsible.Trigger> | ||
</div> | ||
<Collapsible.Content | ||
class="absolute top-8 right-0 w-28 bg-surface-container border-b-neutral-400 rounded-md" | ||
transition={slide} | ||
> | ||
<slot /> | ||
</Collapsible.Content> | ||
</Collapsible.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Root from './collapsible.svelte' | ||
|
||
export { | ||
Root as Collapsible, | ||
// | ||
Root, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
export { default as CourseCard } from './course-card.svelte' | ||
import type { Day } from '../day-chip' | ||
import type { Type } from '../gened-chip' | ||
|
||
type Course = { | ||
code: string | ||
name: string | ||
credit: number | ||
gened: Type[] | ||
seat: number | ||
maxseat: number | ||
review: number | ||
days: Day[] | ||
} | ||
|
||
export type { Course } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Root from './navbar.svelte' | ||
|
||
export { | ||
// | ||
Root as Navbar, | ||
Root, | ||
} |
41 changes: 41 additions & 0 deletions
41
packages/ui/src/components/organism/navbar/navbar.stories.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script module lang="ts"> | ||
import { defineMeta } from '@storybook/addon-svelte-csf' | ||
import { Navbar } from './index.js' | ||
const { Story } = defineMeta<typeof Navbar>({ | ||
title: 'Organism/Navbar', | ||
component: Navbar, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
isLoggedIn: { | ||
control: 'boolean', | ||
}, | ||
name: { | ||
control: 'text', | ||
}, | ||
}, | ||
}) | ||
</script> | ||
|
||
<Story | ||
name="Desktop" | ||
parameters={{ viewport: { defaultViewport: 'tablet' } }} | ||
/> | ||
|
||
<Story | ||
name="Desktop & Logged In" | ||
parameters={{ viewport: { defaultViewport: 'tablet' } }} | ||
args={{ isLoggedIn: true, name: 'Testname testname' }} | ||
/> | ||
|
||
<Story | ||
name="Mobile" | ||
parameters={{ viewport: { defaultViewport: 'mobile2' } }} | ||
/> | ||
|
||
<Story | ||
name="Mobile & Loggin In" | ||
parameters={{ viewport: { defaultViewport: 'mobile2' } }} | ||
args={{ isLoggedIn: true, name: 'Testname testname' }} | ||
/> |
Oops, something went wrong.