-
Notifications
You must be signed in to change notification settings - Fork 0
feat: migrate header, sidebar, maincontent inset to shadcn components #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <script lang="ts" setup> | ||
| import type { HTMLAttributes } from 'vue' | ||
| const props = defineProps<{ | ||
| class?: HTMLAttributes['class'] | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <nav | ||
| aria-label="breadcrumb" | ||
| data-slot="breadcrumb" | ||
| :class="props.class" | ||
| > | ||
| <slot /> | ||
| </nav> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <script lang="ts" setup> | ||
| import { cn } from '@frontend/lib/utils' | ||
| import { MoreHorizontal } from 'lucide-vue-next' | ||
| import type { HTMLAttributes } from 'vue' | ||
|
|
||
| const props = defineProps<{ | ||
| class?: HTMLAttributes['class'] | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <span | ||
| data-slot="breadcrumb-ellipsis" | ||
| role="presentation" | ||
| aria-hidden="true" | ||
| :class="cn('flex size-9 items-center justify-center', props.class)" | ||
| > | ||
| <slot> | ||
| <MoreHorizontal class="size-4" /> | ||
| </slot> | ||
| <span class="sr-only">More</span> | ||
| </span> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <script lang="ts" setup> | ||
| import { cn } from '@frontend/lib/utils' | ||
| import type { HTMLAttributes } from 'vue' | ||
|
|
||
| const props = defineProps<{ | ||
| class?: HTMLAttributes['class'] | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <li | ||
| data-slot="breadcrumb-item" | ||
| :class="cn('inline-flex items-center gap-1.5', props.class)" | ||
| > | ||
| <slot /> | ||
| </li> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <script lang="ts" setup> | ||
| import { cn } from '@frontend/lib/utils' | ||
| import type { PrimitiveProps } from 'reka-ui' | ||
| import { Primitive } from 'reka-ui' | ||
| import type { HTMLAttributes } from 'vue' | ||
|
|
||
| const props = withDefaults(defineProps<PrimitiveProps & { class?: HTMLAttributes['class'] }>(), { | ||
| as: 'a', | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <Primitive | ||
| data-slot="breadcrumb-link" | ||
| :as="as" | ||
| :as-child="asChild" | ||
| :class="cn('hover:text-foreground transition-colors', props.class)" | ||
| > | ||
| <slot /> | ||
| </Primitive> | ||
| </template> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <script lang="ts" setup> | ||
| import { cn } from '@frontend/lib/utils' | ||
| import type { HTMLAttributes } from 'vue' | ||
|
|
||
| const props = defineProps<{ | ||
| class?: HTMLAttributes['class'] | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <ol | ||
| data-slot="breadcrumb-list" | ||
| :class="cn('text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5', props.class)" | ||
| > | ||
| <slot /> | ||
| </ol> | ||
| </template> |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||||||||||||||||||||||||
| <script lang="ts" setup> | ||||||||||||||||||||||||||||||||||
| import { cn } from '@frontend/lib/utils' | ||||||||||||||||||||||||||||||||||
| import type { HTMLAttributes } from 'vue' | ||||||||||||||||||||||||||||||||||
| const props = defineProps<{ | ||||||||||||||||||||||||||||||||||
| class?: HTMLAttributes['class'] | ||||||||||||||||||||||||||||||||||
| }>() | ||||||||||||||||||||||||||||||||||
| </script> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| <template> | ||||||||||||||||||||||||||||||||||
| <span | ||||||||||||||||||||||||||||||||||
| data-slot="breadcrumb-page" | ||||||||||||||||||||||||||||||||||
| role="link" | ||||||||||||||||||||||||||||||||||
| aria-disabled="true" | ||||||||||||||||||||||||||||||||||
| aria-current="page" | ||||||||||||||||||||||||||||||||||
| :class="cn('text-foreground font-normal', props.class)" | ||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||
| <slot /> | ||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix incorrect ARIA semantics for breadcrumb page. The current breadcrumb page should not use Apply this diff to fix the accessibility issue: <span
data-slot="breadcrumb-page"
- role="link"
- aria-disabled="true"
aria-current="page"
:class="cn('text-foreground font-normal', props.class)"
>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| </template> | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <script lang="ts" setup> | ||
| import { cn } from '@frontend/lib/utils' | ||
| import { ChevronRight } from 'lucide-vue-next' | ||
| import type { HTMLAttributes } from 'vue' | ||
|
|
||
| const props = defineProps<{ | ||
| class?: HTMLAttributes['class'] | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <li | ||
| data-slot="breadcrumb-separator" | ||
| role="presentation" | ||
| aria-hidden="true" | ||
| :class="cn('[&>svg]:size-3.5', props.class)" | ||
| > | ||
| <slot> | ||
| <ChevronRight /> | ||
| </slot> | ||
| </li> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export { default as Breadcrumb } from './Breadcrumb.vue' | ||
| export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue' | ||
| export { default as BreadcrumbItem } from './BreadcrumbItem.vue' | ||
| export { default as BreadcrumbLink } from './BreadcrumbLink.vue' | ||
| export { default as BreadcrumbList } from './BreadcrumbList.vue' | ||
| export { default as BreadcrumbPage } from './BreadcrumbPage.vue' | ||
| export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Props scoping bug:
as/asChildare undefined in template.You created
props = defineProps(...)but referenceasandasChilddirectly. Useprops.as/props.asChild(or destructure viatoRefs).Alternatively:
📝 Committable suggestion
🤖 Prompt for AI Agents