@aphexcms/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/package.json +49 -0
  2. package/src/app.css +156 -0
  3. package/src/lib/components/app-sidebar.svelte +171 -0
  4. package/src/lib/components/nav-main.svelte +64 -0
  5. package/src/lib/components/nav-projects.svelte +76 -0
  6. package/src/lib/components/nav-user.svelte +87 -0
  7. package/src/lib/components/sidebar-07/+page.svelte +39 -0
  8. package/src/lib/components/team-switcher.svelte +67 -0
  9. package/src/lib/components/ui/alert/alert-description.svelte +23 -0
  10. package/src/lib/components/ui/alert/alert-title.svelte +20 -0
  11. package/src/lib/components/ui/alert/alert.svelte +44 -0
  12. package/src/lib/components/ui/alert/index.ts +14 -0
  13. package/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +18 -0
  14. package/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +18 -0
  15. package/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +27 -0
  16. package/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +17 -0
  17. package/src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte +20 -0
  18. package/src/lib/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
  19. package/src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte +20 -0
  20. package/src/lib/components/ui/alert-dialog/alert-dialog-title.svelte +17 -0
  21. package/src/lib/components/ui/alert-dialog/alert-dialog-trigger.svelte +7 -0
  22. package/src/lib/components/ui/alert-dialog/index.ts +39 -0
  23. package/src/lib/components/ui/avatar/avatar-fallback.svelte +17 -0
  24. package/src/lib/components/ui/avatar/avatar-image.svelte +17 -0
  25. package/src/lib/components/ui/avatar/avatar.svelte +19 -0
  26. package/src/lib/components/ui/avatar/index.ts +13 -0
  27. package/src/lib/components/ui/badge/badge.svelte +49 -0
  28. package/src/lib/components/ui/badge/index.ts +2 -0
  29. package/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
  30. package/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte +20 -0
  31. package/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte +31 -0
  32. package/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte +23 -0
  33. package/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte +23 -0
  34. package/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte +27 -0
  35. package/src/lib/components/ui/breadcrumb/breadcrumb.svelte +21 -0
  36. package/src/lib/components/ui/breadcrumb/index.ts +25 -0
  37. package/src/lib/components/ui/button/button.svelte +82 -0
  38. package/src/lib/components/ui/button/index.ts +17 -0
  39. package/src/lib/components/ui/card/card-action.svelte +20 -0
  40. package/src/lib/components/ui/card/card-content.svelte +15 -0
  41. package/src/lib/components/ui/card/card-description.svelte +20 -0
  42. package/src/lib/components/ui/card/card-footer.svelte +20 -0
  43. package/src/lib/components/ui/card/card-header.svelte +23 -0
  44. package/src/lib/components/ui/card/card-title.svelte +20 -0
  45. package/src/lib/components/ui/card/card.svelte +23 -0
  46. package/src/lib/components/ui/card/index.ts +25 -0
  47. package/src/lib/components/ui/collapsible/collapsible-content.svelte +7 -0
  48. package/src/lib/components/ui/collapsible/collapsible-trigger.svelte +7 -0
  49. package/src/lib/components/ui/collapsible/collapsible.svelte +11 -0
  50. package/src/lib/components/ui/collapsible/index.ts +13 -0
  51. package/src/lib/components/ui/command/command-dialog.svelte +40 -0
  52. package/src/lib/components/ui/command/command-empty.svelte +17 -0
  53. package/src/lib/components/ui/command/command-group.svelte +30 -0
  54. package/src/lib/components/ui/command/command-input.svelte +26 -0
  55. package/src/lib/components/ui/command/command-item.svelte +20 -0
  56. package/src/lib/components/ui/command/command-link-item.svelte +20 -0
  57. package/src/lib/components/ui/command/command-list.svelte +17 -0
  58. package/src/lib/components/ui/command/command-separator.svelte +17 -0
  59. package/src/lib/components/ui/command/command-shortcut.svelte +20 -0
  60. package/src/lib/components/ui/command/command.svelte +22 -0
  61. package/src/lib/components/ui/command/index.ts +40 -0
  62. package/src/lib/components/ui/dialog/dialog-close.svelte +7 -0
  63. package/src/lib/components/ui/dialog/dialog-content.svelte +43 -0
  64. package/src/lib/components/ui/dialog/dialog-description.svelte +17 -0
  65. package/src/lib/components/ui/dialog/dialog-footer.svelte +20 -0
  66. package/src/lib/components/ui/dialog/dialog-header.svelte +20 -0
  67. package/src/lib/components/ui/dialog/dialog-overlay.svelte +20 -0
  68. package/src/lib/components/ui/dialog/dialog-title.svelte +17 -0
  69. package/src/lib/components/ui/dialog/dialog-trigger.svelte +7 -0
  70. package/src/lib/components/ui/dialog/index.ts +37 -0
  71. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +41 -0
  72. package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +27 -0
  73. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
  74. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
  75. package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
  76. package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
  77. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
  78. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +31 -0
  79. package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
  80. package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
  81. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
  82. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
  83. package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
  84. package/src/lib/components/ui/dropdown-menu/index.ts +49 -0
  85. package/src/lib/components/ui/input/index.ts +7 -0
  86. package/src/lib/components/ui/input/input.svelte +52 -0
  87. package/src/lib/components/ui/label/index.ts +7 -0
  88. package/src/lib/components/ui/label/label.svelte +20 -0
  89. package/src/lib/components/ui/popover/index.ts +17 -0
  90. package/src/lib/components/ui/popover/popover-content.svelte +29 -0
  91. package/src/lib/components/ui/popover/popover-trigger.svelte +17 -0
  92. package/src/lib/components/ui/select/index.ts +37 -0
  93. package/src/lib/components/ui/select/select-content.svelte +40 -0
  94. package/src/lib/components/ui/select/select-group-heading.svelte +21 -0
  95. package/src/lib/components/ui/select/select-group.svelte +7 -0
  96. package/src/lib/components/ui/select/select-item.svelte +38 -0
  97. package/src/lib/components/ui/select/select-label.svelte +20 -0
  98. package/src/lib/components/ui/select/select-scroll-down-button.svelte +20 -0
  99. package/src/lib/components/ui/select/select-scroll-up-button.svelte +20 -0
  100. package/src/lib/components/ui/select/select-separator.svelte +18 -0
  101. package/src/lib/components/ui/select/select-trigger.svelte +29 -0
  102. package/src/lib/components/ui/separator/index.ts +7 -0
  103. package/src/lib/components/ui/separator/separator.svelte +21 -0
  104. package/src/lib/components/ui/sheet/index.ts +36 -0
  105. package/src/lib/components/ui/sheet/sheet-close.svelte +7 -0
  106. package/src/lib/components/ui/sheet/sheet-content.svelte +60 -0
  107. package/src/lib/components/ui/sheet/sheet-description.svelte +17 -0
  108. package/src/lib/components/ui/sheet/sheet-footer.svelte +20 -0
  109. package/src/lib/components/ui/sheet/sheet-header.svelte +20 -0
  110. package/src/lib/components/ui/sheet/sheet-overlay.svelte +20 -0
  111. package/src/lib/components/ui/sheet/sheet-title.svelte +17 -0
  112. package/src/lib/components/ui/sheet/sheet-trigger.svelte +7 -0
  113. package/src/lib/components/ui/sidebar/constants.ts +6 -0
  114. package/src/lib/components/ui/sidebar/context.svelte.ts +79 -0
  115. package/src/lib/components/ui/sidebar/index.ts +75 -0
  116. package/src/lib/components/ui/sidebar/sidebar-content.svelte +24 -0
  117. package/src/lib/components/ui/sidebar/sidebar-footer.svelte +21 -0
  118. package/src/lib/components/ui/sidebar/sidebar-group-action.svelte +36 -0
  119. package/src/lib/components/ui/sidebar/sidebar-group-content.svelte +21 -0
  120. package/src/lib/components/ui/sidebar/sidebar-group-label.svelte +34 -0
  121. package/src/lib/components/ui/sidebar/sidebar-group.svelte +21 -0
  122. package/src/lib/components/ui/sidebar/sidebar-header.svelte +21 -0
  123. package/src/lib/components/ui/sidebar/sidebar-input.svelte +21 -0
  124. package/src/lib/components/ui/sidebar/sidebar-inset.svelte +24 -0
  125. package/src/lib/components/ui/sidebar/sidebar-menu-action.svelte +43 -0
  126. package/src/lib/components/ui/sidebar/sidebar-menu-badge.svelte +29 -0
  127. package/src/lib/components/ui/sidebar/sidebar-menu-button.svelte +101 -0
  128. package/src/lib/components/ui/sidebar/sidebar-menu-item.svelte +21 -0
  129. package/src/lib/components/ui/sidebar/sidebar-menu-skeleton.svelte +36 -0
  130. package/src/lib/components/ui/sidebar/sidebar-menu-sub-button.svelte +43 -0
  131. package/src/lib/components/ui/sidebar/sidebar-menu-sub-item.svelte +21 -0
  132. package/src/lib/components/ui/sidebar/sidebar-menu-sub.svelte +25 -0
  133. package/src/lib/components/ui/sidebar/sidebar-menu.svelte +21 -0
  134. package/src/lib/components/ui/sidebar/sidebar-provider.svelte +53 -0
  135. package/src/lib/components/ui/sidebar/sidebar-rail.svelte +36 -0
  136. package/src/lib/components/ui/sidebar/sidebar-separator.svelte +19 -0
  137. package/src/lib/components/ui/sidebar/sidebar-trigger.svelte +35 -0
  138. package/src/lib/components/ui/sidebar/sidebar.svelte +101 -0
  139. package/src/lib/components/ui/skeleton/index.ts +7 -0
  140. package/src/lib/components/ui/skeleton/skeleton.svelte +17 -0
  141. package/src/lib/components/ui/tabs/index.ts +16 -0
  142. package/src/lib/components/ui/tabs/tabs-content.svelte +17 -0
  143. package/src/lib/components/ui/tabs/tabs-list.svelte +16 -0
  144. package/src/lib/components/ui/tabs/tabs-trigger.svelte +20 -0
  145. package/src/lib/components/ui/tabs/tabs.svelte +19 -0
  146. package/src/lib/components/ui/textarea/index.ts +7 -0
  147. package/src/lib/components/ui/textarea/textarea.svelte +22 -0
  148. package/src/lib/components/ui/tooltip/index.ts +21 -0
  149. package/src/lib/components/ui/tooltip/tooltip-content.svelte +47 -0
  150. package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +7 -0
  151. package/src/lib/hooks/is-mobile.svelte.ts +9 -0
  152. package/src/lib/utils.ts +13 -0
@@ -0,0 +1,67 @@
1
+ <script lang="ts">
2
+ import * as DropdownMenu from '@lib/components/ui/dropdown-menu/index.js';
3
+ import * as Sidebar from '@lib/components/ui/sidebar/index.js';
4
+ import { useSidebar } from '@lib/components/ui/sidebar/index.js';
5
+ import ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';
6
+ import PlusIcon from '@lucide/svelte/icons/plus';
7
+
8
+ // This should be `Component` after @lucide/svelte updates types
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ let { teams }: { teams: { name: string; logo: any; plan: string }[] } = $props();
11
+ const sidebar = useSidebar();
12
+
13
+ let activeTeam = $state(teams[0]);
14
+ </script>
15
+
16
+ <Sidebar.Menu>
17
+ <Sidebar.MenuItem>
18
+ <DropdownMenu.Root>
19
+ <DropdownMenu.Trigger>
20
+ {#snippet child({ props })}
21
+ <Sidebar.MenuButton
22
+ {...props}
23
+ size="lg"
24
+ class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
25
+ >
26
+ <div
27
+ class="bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg"
28
+ >
29
+ <activeTeam.logo class="size-4" />
30
+ </div>
31
+ <div class="grid flex-1 text-left text-sm leading-tight">
32
+ <span class="truncate font-medium">
33
+ {activeTeam.name}
34
+ </span>
35
+ <span class="truncate text-xs">{activeTeam.plan}</span>
36
+ </div>
37
+ <ChevronsUpDownIcon class="ml-auto" />
38
+ </Sidebar.MenuButton>
39
+ {/snippet}
40
+ </DropdownMenu.Trigger>
41
+ <DropdownMenu.Content
42
+ class="w-(--bits-dropdown-menu-anchor-width) min-w-56 rounded-lg"
43
+ align="start"
44
+ side={sidebar.isMobile ? 'bottom' : 'right'}
45
+ sideOffset={4}
46
+ >
47
+ <DropdownMenu.Label class="text-muted-foreground text-xs">Teams</DropdownMenu.Label>
48
+ {#each teams as team, index (team.name)}
49
+ <DropdownMenu.Item onSelect={() => (activeTeam = team)} class="gap-2 p-2">
50
+ <div class="flex size-6 items-center justify-center rounded-md border">
51
+ <team.logo class="size-3.5 shrink-0" />
52
+ </div>
53
+ {team.name}
54
+ <DropdownMenu.Shortcut>⌘{index + 1}</DropdownMenu.Shortcut>
55
+ </DropdownMenu.Item>
56
+ {/each}
57
+ <DropdownMenu.Separator />
58
+ <DropdownMenu.Item class="gap-2 p-2">
59
+ <div class="flex size-6 items-center justify-center rounded-md border bg-transparent">
60
+ <PlusIcon class="size-4" />
61
+ </div>
62
+ <div class="text-muted-foreground font-medium">Add team</div>
63
+ </DropdownMenu.Item>
64
+ </DropdownMenu.Content>
65
+ </DropdownMenu.Root>
66
+ </Sidebar.MenuItem>
67
+ </Sidebar.Menu>
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="alert-description"
16
+ class={cn(
17
+ 'text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',
18
+ className
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="alert-title"
16
+ class={cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,44 @@
1
+ <script lang="ts" module>
2
+ import { type VariantProps, tv } from 'tailwind-variants';
3
+
4
+ export const alertVariants = tv({
5
+ base: 'relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',
6
+ variants: {
7
+ variant: {
8
+ default: 'bg-card text-card-foreground',
9
+ destructive:
10
+ 'text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current'
11
+ }
12
+ },
13
+ defaultVariants: {
14
+ variant: 'default'
15
+ }
16
+ });
17
+
18
+ export type AlertVariant = VariantProps<typeof alertVariants>['variant'];
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ import type { HTMLAttributes } from 'svelte/elements';
23
+ import { cn, type WithElementRef } from '@lib/utils.js';
24
+
25
+ let {
26
+ ref = $bindable(null),
27
+ class: className,
28
+ variant = 'default',
29
+ children,
30
+ ...restProps
31
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
32
+ variant?: AlertVariant;
33
+ } = $props();
34
+ </script>
35
+
36
+ <div
37
+ bind:this={ref}
38
+ data-slot="alert"
39
+ class={cn(alertVariants({ variant }), className)}
40
+ {...restProps}
41
+ role="alert"
42
+ >
43
+ {@render children?.()}
44
+ </div>
@@ -0,0 +1,14 @@
1
+ import Root from './alert.svelte';
2
+ import Description from './alert-description.svelte';
3
+ import Title from './alert-title.svelte';
4
+ export { alertVariants, type AlertVariant } from './alert.svelte';
5
+
6
+ export {
7
+ Root,
8
+ Description,
9
+ Title,
10
+ //
11
+ Root as Alert,
12
+ Description as AlertDescription,
13
+ Title as AlertTitle
14
+ };
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
+ import { buttonVariants } from '@lib/components/ui/button/index.js';
4
+ import { cn } from '@lib/utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ ...restProps
10
+ }: AlertDialogPrimitive.ActionProps = $props();
11
+ </script>
12
+
13
+ <AlertDialogPrimitive.Action
14
+ bind:ref
15
+ data-slot="alert-dialog-action"
16
+ class={cn(buttonVariants(), className)}
17
+ {...restProps}
18
+ />
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
+ import { buttonVariants } from '@lib/components/ui/button/index.js';
4
+ import { cn } from '@lib/utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ ...restProps
10
+ }: AlertDialogPrimitive.CancelProps = $props();
11
+ </script>
12
+
13
+ <AlertDialogPrimitive.Cancel
14
+ bind:ref
15
+ data-slot="alert-dialog-cancel"
16
+ class={cn(buttonVariants({ variant: 'outline' }), className)}
17
+ {...restProps}
18
+ />
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
+ import AlertDialogOverlay from './alert-dialog-overlay.svelte';
4
+ import { cn, type WithoutChild, type WithoutChildrenOrChild } from '@lib/utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ portalProps,
10
+ ...restProps
11
+ }: WithoutChild<AlertDialogPrimitive.ContentProps> & {
12
+ portalProps?: WithoutChildrenOrChild<AlertDialogPrimitive.PortalProps>;
13
+ } = $props();
14
+ </script>
15
+
16
+ <AlertDialogPrimitive.Portal {...portalProps}>
17
+ <AlertDialogOverlay />
18
+ <AlertDialogPrimitive.Content
19
+ bind:ref
20
+ data-slot="alert-dialog-content"
21
+ class={cn(
22
+ 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
23
+ className
24
+ )}
25
+ {...restProps}
26
+ />
27
+ </AlertDialogPrimitive.Portal>
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: AlertDialogPrimitive.DescriptionProps = $props();
10
+ </script>
11
+
12
+ <AlertDialogPrimitive.Description
13
+ bind:ref
14
+ data-slot="alert-dialog-description"
15
+ class={cn('text-muted-foreground text-sm', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from '@lib/utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="alert-dialog-footer"
16
+ class={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="alert-dialog-header"
16
+ class={cn('flex flex-col gap-2 text-center sm:text-left', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: AlertDialogPrimitive.OverlayProps = $props();
10
+ </script>
11
+
12
+ <AlertDialogPrimitive.Overlay
13
+ bind:ref
14
+ data-slot="alert-dialog-overlay"
15
+ class={cn(
16
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
17
+ className
18
+ )}
19
+ {...restProps}
20
+ />
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: AlertDialogPrimitive.TitleProps = $props();
10
+ </script>
11
+
12
+ <AlertDialogPrimitive.Title
13
+ bind:ref
14
+ data-slot="alert-dialog-title"
15
+ class={cn('text-lg font-semibold', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: AlertDialogPrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <AlertDialogPrimitive.Trigger bind:ref data-slot="alert-dialog-trigger" {...restProps} />
@@ -0,0 +1,39 @@
1
+ import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
2
+ import Trigger from './alert-dialog-trigger.svelte';
3
+ import Title from './alert-dialog-title.svelte';
4
+ import Action from './alert-dialog-action.svelte';
5
+ import Cancel from './alert-dialog-cancel.svelte';
6
+ import Footer from './alert-dialog-footer.svelte';
7
+ import Header from './alert-dialog-header.svelte';
8
+ import Overlay from './alert-dialog-overlay.svelte';
9
+ import Content from './alert-dialog-content.svelte';
10
+ import Description from './alert-dialog-description.svelte';
11
+
12
+ const Root = AlertDialogPrimitive.Root;
13
+ const Portal = AlertDialogPrimitive.Portal;
14
+
15
+ export {
16
+ Root,
17
+ Title,
18
+ Action,
19
+ Cancel,
20
+ Portal,
21
+ Footer,
22
+ Header,
23
+ Trigger,
24
+ Overlay,
25
+ Content,
26
+ Description,
27
+ //
28
+ Root as AlertDialog,
29
+ Title as AlertDialogTitle,
30
+ Action as AlertDialogAction,
31
+ Cancel as AlertDialogCancel,
32
+ Portal as AlertDialogPortal,
33
+ Footer as AlertDialogFooter,
34
+ Header as AlertDialogHeader,
35
+ Trigger as AlertDialogTrigger,
36
+ Overlay as AlertDialogOverlay,
37
+ Content as AlertDialogContent,
38
+ Description as AlertDialogDescription
39
+ };
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: AvatarPrimitive.FallbackProps = $props();
10
+ </script>
11
+
12
+ <AvatarPrimitive.Fallback
13
+ bind:ref
14
+ data-slot="avatar-fallback"
15
+ class={cn('bg-muted flex size-full items-center justify-center rounded-full', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: AvatarPrimitive.ImageProps = $props();
10
+ </script>
11
+
12
+ <AvatarPrimitive.Image
13
+ bind:ref
14
+ data-slot="avatar-image"
15
+ class={cn('aspect-square size-full', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ loadingStatus = $bindable('loading'),
8
+ class: className,
9
+ ...restProps
10
+ }: AvatarPrimitive.RootProps = $props();
11
+ </script>
12
+
13
+ <AvatarPrimitive.Root
14
+ bind:ref
15
+ bind:loadingStatus
16
+ data-slot="avatar"
17
+ class={cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className)}
18
+ {...restProps}
19
+ />
@@ -0,0 +1,13 @@
1
+ import Root from './avatar.svelte';
2
+ import Image from './avatar-image.svelte';
3
+ import Fallback from './avatar-fallback.svelte';
4
+
5
+ export {
6
+ Root,
7
+ Image,
8
+ Fallback,
9
+ //
10
+ Root as Avatar,
11
+ Image as AvatarImage,
12
+ Fallback as AvatarFallback
13
+ };
@@ -0,0 +1,49 @@
1
+ <script lang="ts" module>
2
+ import { type VariantProps, tv } from 'tailwind-variants';
3
+
4
+ export const badgeVariants = tv({
5
+ base: 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3',
6
+ variants: {
7
+ variant: {
8
+ default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent',
9
+ secondary:
10
+ 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent',
11
+ destructive:
12
+ 'bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70 border-transparent text-white',
13
+ outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground'
14
+ }
15
+ },
16
+ defaultVariants: {
17
+ variant: 'default'
18
+ }
19
+ });
20
+
21
+ export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
22
+ </script>
23
+
24
+ <script lang="ts">
25
+ import type { HTMLAnchorAttributes } from 'svelte/elements';
26
+ import { cn, type WithElementRef } from '@lib/utils.js';
27
+
28
+ let {
29
+ ref = $bindable(null),
30
+ href,
31
+ class: className,
32
+ variant = 'default',
33
+ children,
34
+ ...restProps
35
+ }: WithElementRef<HTMLAnchorAttributes> & {
36
+ variant?: BadgeVariant;
37
+ } = $props();
38
+ </script>
39
+
40
+ <svelte:element
41
+ this={href ? 'a' : 'span'}
42
+ bind:this={ref}
43
+ data-slot="badge"
44
+ {href}
45
+ class={cn(badgeVariants({ variant }), className)}
46
+ {...restProps}
47
+ >
48
+ {@render children?.()}
49
+ </svelte:element>
@@ -0,0 +1,2 @@
1
+ export { default as Badge } from './badge.svelte';
2
+ export { badgeVariants, type BadgeVariant } from './badge.svelte';
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ import { cn, type WithElementRef, type WithoutChildren } from '@lib/utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ ...restProps
10
+ }: WithoutChildren<WithElementRef<HTMLAttributes<HTMLSpanElement>>> = $props();
11
+ </script>
12
+
13
+ <span
14
+ bind:this={ref}
15
+ data-slot="breadcrumb-ellipsis"
16
+ role="presentation"
17
+ aria-hidden="true"
18
+ class={cn('flex size-9 items-center justify-center', className)}
19
+ {...restProps}
20
+ >
21
+ <EllipsisIcon class="size-4" />
22
+ <span class="sr-only">More</span>
23
+ </span>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLLiAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLLiAttributes> = $props();
11
+ </script>
12
+
13
+ <li
14
+ bind:this={ref}
15
+ data-slot="breadcrumb-item"
16
+ class={cn('inline-flex items-center gap-1.5', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </li>
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import type { HTMLAnchorAttributes } from 'svelte/elements';
3
+ import type { Snippet } from 'svelte';
4
+ import { cn, type WithElementRef } from '@lib/utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ href = undefined,
10
+ child,
11
+ children,
12
+ ...restProps
13
+ }: WithElementRef<HTMLAnchorAttributes> & {
14
+ child?: Snippet<[{ props: HTMLAnchorAttributes }]>;
15
+ } = $props();
16
+
17
+ const attrs = $derived({
18
+ 'data-slot': 'breadcrumb-link',
19
+ class: cn('hover:text-foreground transition-colors', className),
20
+ href,
21
+ ...restProps
22
+ });
23
+ </script>
24
+
25
+ {#if child}
26
+ {@render child({ props: attrs })}
27
+ {:else}
28
+ <a bind:this={ref} {...attrs}>
29
+ {@render children?.()}
30
+ </a>
31
+ {/if}
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { HTMLOlAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLOlAttributes> = $props();
11
+ </script>
12
+
13
+ <ol
14
+ bind:this={ref}
15
+ data-slot="breadcrumb-list"
16
+ class={cn(
17
+ 'text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5',
18
+ className
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </ol>
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
11
+ </script>
12
+
13
+ <span
14
+ bind:this={ref}
15
+ data-slot="breadcrumb-page"
16
+ role="link"
17
+ aria-disabled="true"
18
+ aria-current="page"
19
+ class={cn('text-foreground font-normal', className)}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </span>
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
3
+ import { cn, type WithElementRef } from '@lib/utils.js';
4
+ import type { HTMLLiAttributes } from 'svelte/elements';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLLiAttributes> = $props();
12
+ </script>
13
+
14
+ <li
15
+ bind:this={ref}
16
+ data-slot="breadcrumb-separator"
17
+ role="presentation"
18
+ aria-hidden="true"
19
+ class={cn('[&>svg]:size-3.5', className)}
20
+ {...restProps}
21
+ >
22
+ {#if children}
23
+ {@render children?.()}
24
+ {:else}
25
+ <ChevronRightIcon />
26
+ {/if}
27
+ </li>