@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,21 @@
1
+ <script lang="ts">
2
+ import 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<HTMLElement>> = $props();
11
+ </script>
12
+
13
+ <nav
14
+ bind:this={ref}
15
+ data-slot="breadcrumb"
16
+ class={className}
17
+ aria-label="breadcrumb"
18
+ {...restProps}
19
+ >
20
+ {@render children?.()}
21
+ </nav>
@@ -0,0 +1,25 @@
1
+ import Root from './breadcrumb.svelte';
2
+ import Ellipsis from './breadcrumb-ellipsis.svelte';
3
+ import Item from './breadcrumb-item.svelte';
4
+ import Separator from './breadcrumb-separator.svelte';
5
+ import Link from './breadcrumb-link.svelte';
6
+ import List from './breadcrumb-list.svelte';
7
+ import Page from './breadcrumb-page.svelte';
8
+
9
+ export {
10
+ Root,
11
+ Ellipsis,
12
+ Item,
13
+ Separator,
14
+ Link,
15
+ List,
16
+ Page,
17
+ //
18
+ Root as Breadcrumb,
19
+ Ellipsis as BreadcrumbEllipsis,
20
+ Item as BreadcrumbItem,
21
+ Separator as BreadcrumbSeparator,
22
+ Link as BreadcrumbLink,
23
+ List as BreadcrumbList,
24
+ Page as BreadcrumbPage
25
+ };
@@ -0,0 +1,82 @@
1
+ <script lang="ts" module>
2
+ import { cn, type WithElementRef } from '@lib/utils.js';
3
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
4
+ import { type VariantProps, tv } from 'tailwind-variants';
5
+
6
+ export const buttonVariants = tv({
7
+ 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 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
8
+ variants: {
9
+ variant: {
10
+ default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
11
+ destructive:
12
+ 'bg-destructive shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white',
13
+ outline:
14
+ 'bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border',
15
+ secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
16
+ ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
17
+ link: 'text-primary underline-offset-4 hover:underline'
18
+ },
19
+ size: {
20
+ default: 'h-9 px-4 py-2 has-[>svg]:px-3',
21
+ sm: 'h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5',
22
+ lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
23
+ icon: 'size-9',
24
+ 'icon-sm': 'size-8',
25
+ 'icon-lg': 'size-10'
26
+ }
27
+ },
28
+ defaultVariants: {
29
+ variant: 'default',
30
+ size: 'default'
31
+ }
32
+ });
33
+
34
+ export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
35
+ export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
36
+
37
+ export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
38
+ WithElementRef<HTMLAnchorAttributes> & {
39
+ variant?: ButtonVariant;
40
+ size?: ButtonSize;
41
+ };
42
+ </script>
43
+
44
+ <script lang="ts">
45
+ let {
46
+ class: className,
47
+ variant = 'default',
48
+ size = 'default',
49
+ ref = $bindable(null),
50
+ href = undefined,
51
+ type = 'button',
52
+ disabled,
53
+ children,
54
+ ...restProps
55
+ }: ButtonProps = $props();
56
+ </script>
57
+
58
+ {#if href}
59
+ <a
60
+ bind:this={ref}
61
+ data-slot="button"
62
+ class={cn(buttonVariants({ variant, size }), className)}
63
+ href={disabled ? undefined : href}
64
+ aria-disabled={disabled}
65
+ role={disabled ? 'link' : undefined}
66
+ tabindex={disabled ? -1 : undefined}
67
+ {...restProps}
68
+ >
69
+ {@render children?.()}
70
+ </a>
71
+ {:else}
72
+ <button
73
+ bind:this={ref}
74
+ data-slot="button"
75
+ class={cn(buttonVariants({ variant, size }), className)}
76
+ {type}
77
+ {disabled}
78
+ {...restProps}
79
+ >
80
+ {@render children?.()}
81
+ </button>
82
+ {/if}
@@ -0,0 +1,17 @@
1
+ import Root, {
2
+ type ButtonProps,
3
+ type ButtonSize,
4
+ type ButtonVariant,
5
+ buttonVariants
6
+ } from './button.svelte';
7
+
8
+ export {
9
+ Root,
10
+ type ButtonProps as Props,
11
+ //
12
+ Root as Button,
13
+ buttonVariants,
14
+ type ButtonProps,
15
+ type ButtonSize,
16
+ type ButtonVariant
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="card-action"
16
+ class={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,15 @@
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 bind:this={ref} data-slot="card-content" class={cn('px-6', className)} {...restProps}>
14
+ {@render children?.()}
15
+ </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<HTMLParagraphElement>> = $props();
11
+ </script>
12
+
13
+ <p
14
+ bind:this={ref}
15
+ data-slot="card-description"
16
+ class={cn('text-muted-foreground text-sm', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </p>
@@ -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="card-footer"
16
+ class={cn('[.border-t]:pt-6 flex items-center px-6', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,23 @@
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="card-header"
16
+ class={cn(
17
+ '@container/card-header has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6 grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6',
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="card-title"
16
+ class={cn('font-semibold leading-none', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -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="card"
16
+ class={cn(
17
+ 'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
18
+ className
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,25 @@
1
+ import Root from './card.svelte';
2
+ import Content from './card-content.svelte';
3
+ import Description from './card-description.svelte';
4
+ import Footer from './card-footer.svelte';
5
+ import Header from './card-header.svelte';
6
+ import Title from './card-title.svelte';
7
+ import Action from './card-action.svelte';
8
+
9
+ export {
10
+ Root,
11
+ Content,
12
+ Description,
13
+ Footer,
14
+ Header,
15
+ Title,
16
+ Action,
17
+ //
18
+ Root as Card,
19
+ Content as CardContent,
20
+ Description as CardDescription,
21
+ Footer as CardFooter,
22
+ Header as CardHeader,
23
+ Title as CardTitle,
24
+ Action as CardAction
25
+ };
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.ContentProps = $props();
5
+ </script>
6
+
7
+ <CollapsiblePrimitive.Content bind:ref data-slot="collapsible-content" {...restProps} />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <CollapsiblePrimitive.Trigger bind:ref data-slot="collapsible-trigger" {...restProps} />
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from 'bits-ui';
3
+
4
+ let {
5
+ ref = $bindable(null),
6
+ open = $bindable(false),
7
+ ...restProps
8
+ }: CollapsiblePrimitive.RootProps = $props();
9
+ </script>
10
+
11
+ <CollapsiblePrimitive.Root bind:ref bind:open data-slot="collapsible" {...restProps} />
@@ -0,0 +1,13 @@
1
+ import Root from './collapsible.svelte';
2
+ import Trigger from './collapsible-trigger.svelte';
3
+ import Content from './collapsible-content.svelte';
4
+
5
+ export {
6
+ Root,
7
+ Content,
8
+ Trigger,
9
+ //
10
+ Root as Collapsible,
11
+ Content as CollapsibleContent,
12
+ Trigger as CollapsibleTrigger
13
+ };
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+ import type { Command as CommandPrimitive, Dialog as DialogPrimitive } from 'bits-ui';
3
+ import type { Snippet } from 'svelte';
4
+ import Command from './command.svelte';
5
+ import * as Dialog from '@lib/components/ui/dialog/index.js';
6
+ import type { WithoutChildrenOrChild } from '@lib/utils.js';
7
+
8
+ let {
9
+ open = $bindable(false),
10
+ ref = $bindable(null),
11
+ value = $bindable(''),
12
+ title = 'Command Palette',
13
+ description = 'Search for a command to run',
14
+ portalProps,
15
+ children,
16
+ ...restProps
17
+ }: WithoutChildrenOrChild<DialogPrimitive.RootProps> &
18
+ WithoutChildrenOrChild<CommandPrimitive.RootProps> & {
19
+ portalProps?: DialogPrimitive.PortalProps;
20
+ children: Snippet;
21
+ title?: string;
22
+ description?: string;
23
+ } = $props();
24
+ </script>
25
+
26
+ <Dialog.Root bind:open {...restProps}>
27
+ <Dialog.Header class="sr-only">
28
+ <Dialog.Title>{title}</Dialog.Title>
29
+ <Dialog.Description>{description}</Dialog.Description>
30
+ </Dialog.Header>
31
+ <Dialog.Content class="overflow-hidden p-0" {portalProps}>
32
+ <Command
33
+ class="**:data-[slot=command-input-wrapper]:h-12 [&_[data-command-group]:not([hidden])_~[data-command-group]]:pt-0 [&_[data-command-group]]:px-2 [&_[data-command-input-wrapper]_svg]:h-5 [&_[data-command-input-wrapper]_svg]:w-5 [&_[data-command-input]]:h-12 [&_[data-command-item]]:px-2 [&_[data-command-item]]:py-3 [&_[data-command-item]_svg]:h-5 [&_[data-command-item]_svg]:w-5"
34
+ {...restProps}
35
+ bind:value
36
+ bind:ref
37
+ {children}
38
+ />
39
+ </Dialog.Content>
40
+ </Dialog.Root>
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CommandPrimitive.EmptyProps = $props();
10
+ </script>
11
+
12
+ <CommandPrimitive.Empty
13
+ bind:ref
14
+ data-slot="command-empty"
15
+ class={cn('py-6 text-center text-sm', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive, useId } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ heading,
10
+ value,
11
+ ...restProps
12
+ }: CommandPrimitive.GroupProps & {
13
+ heading?: string;
14
+ } = $props();
15
+ </script>
16
+
17
+ <CommandPrimitive.Group
18
+ bind:ref
19
+ data-slot="command-group"
20
+ class={cn('text-foreground overflow-hidden p-1', className)}
21
+ value={value ?? heading ?? `----${useId()}`}
22
+ {...restProps}
23
+ >
24
+ {#if heading}
25
+ <CommandPrimitive.GroupHeading class="text-muted-foreground px-2 py-1.5 text-xs font-medium">
26
+ {heading}
27
+ </CommandPrimitive.GroupHeading>
28
+ {/if}
29
+ <CommandPrimitive.GroupItems {children} />
30
+ </CommandPrimitive.Group>
@@ -0,0 +1,26 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import SearchIcon from '@lucide/svelte/icons/search';
4
+ import { cn } from '@lib/utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ value = $bindable(''),
10
+ ...restProps
11
+ }: CommandPrimitive.InputProps = $props();
12
+ </script>
13
+
14
+ <div class="flex h-9 items-center gap-2 border-b pl-3 pr-8" data-slot="command-input-wrapper">
15
+ <SearchIcon class="size-4 shrink-0 opacity-50" />
16
+ <CommandPrimitive.Input
17
+ data-slot="command-input"
18
+ class={cn(
19
+ 'placeholder:text-muted-foreground outline-hidden flex h-10 w-full rounded-md bg-transparent py-3 text-sm disabled:cursor-not-allowed disabled:opacity-50',
20
+ className
21
+ )}
22
+ bind:ref
23
+ {...restProps}
24
+ bind:value
25
+ />
26
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CommandPrimitive.ItemProps = $props();
10
+ </script>
11
+
12
+ <CommandPrimitive.Item
13
+ bind:ref
14
+ data-slot="command-item"
15
+ class={cn(
16
+ "aria-selected:bg-accent aria-selected:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
17
+ className
18
+ )}
19
+ {...restProps}
20
+ />
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CommandPrimitive.LinkItemProps = $props();
10
+ </script>
11
+
12
+ <CommandPrimitive.LinkItem
13
+ bind:ref
14
+ data-slot="command-item"
15
+ class={cn(
16
+ "aria-selected:bg-accent aria-selected:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
17
+ className
18
+ )}
19
+ {...restProps}
20
+ />
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CommandPrimitive.ListProps = $props();
10
+ </script>
11
+
12
+ <CommandPrimitive.List
13
+ bind:ref
14
+ data-slot="command-list"
15
+ class={cn('max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: CommandPrimitive.SeparatorProps = $props();
10
+ </script>
11
+
12
+ <CommandPrimitive.Separator
13
+ bind:ref
14
+ data-slot="command-separator"
15
+ class={cn('bg-border -mx-1 h-px', 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<HTMLSpanElement>> = $props();
11
+ </script>
12
+
13
+ <span
14
+ bind:this={ref}
15
+ data-slot="command-shortcut"
16
+ class={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </span>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { Command as CommandPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ value = $bindable(''),
8
+ class: className,
9
+ ...restProps
10
+ }: CommandPrimitive.RootProps = $props();
11
+ </script>
12
+
13
+ <CommandPrimitive.Root
14
+ bind:value
15
+ bind:ref
16
+ data-slot="command"
17
+ class={cn(
18
+ 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',
19
+ className
20
+ )}
21
+ {...restProps}
22
+ />
@@ -0,0 +1,40 @@
1
+ import { Command as CommandPrimitive } from 'bits-ui';
2
+
3
+ import Root from './command.svelte';
4
+ import Dialog from './command-dialog.svelte';
5
+ import Empty from './command-empty.svelte';
6
+ import Group from './command-group.svelte';
7
+ import Item from './command-item.svelte';
8
+ import Input from './command-input.svelte';
9
+ import List from './command-list.svelte';
10
+ import Separator from './command-separator.svelte';
11
+ import Shortcut from './command-shortcut.svelte';
12
+ import LinkItem from './command-link-item.svelte';
13
+
14
+ const Loading = CommandPrimitive.Loading;
15
+
16
+ export {
17
+ Root,
18
+ Dialog,
19
+ Empty,
20
+ Group,
21
+ Item,
22
+ LinkItem,
23
+ Input,
24
+ List,
25
+ Separator,
26
+ Shortcut,
27
+ Loading,
28
+ //
29
+ Root as Command,
30
+ Dialog as CommandDialog,
31
+ Empty as CommandEmpty,
32
+ Group as CommandGroup,
33
+ Item as CommandItem,
34
+ LinkItem as CommandLinkItem,
35
+ Input as CommandInput,
36
+ List as CommandList,
37
+ Separator as CommandSeparator,
38
+ Shortcut as CommandShortcut,
39
+ Loading as CommandLoading
40
+ };
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: DialogPrimitive.CloseProps = $props();
5
+ </script>
6
+
7
+ <DialogPrimitive.Close bind:ref data-slot="dialog-close" {...restProps} />