@aphexcms/ui 0.1.1 → 0.1.2

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 (151) hide show
  1. package/package.json +2 -2
  2. package/src/lib/components/app-sidebar.svelte +0 -171
  3. package/src/lib/components/nav-main.svelte +0 -64
  4. package/src/lib/components/nav-projects.svelte +0 -76
  5. package/src/lib/components/nav-user.svelte +0 -87
  6. package/src/lib/components/sidebar-07/+page.svelte +0 -39
  7. package/src/lib/components/team-switcher.svelte +0 -67
  8. package/src/lib/components/ui/alert/alert-description.svelte +0 -23
  9. package/src/lib/components/ui/alert/alert-title.svelte +0 -20
  10. package/src/lib/components/ui/alert/alert.svelte +0 -44
  11. package/src/lib/components/ui/alert/index.ts +0 -14
  12. package/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +0 -18
  13. package/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +0 -18
  14. package/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +0 -27
  15. package/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +0 -17
  16. package/src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte +0 -20
  17. package/src/lib/components/ui/alert-dialog/alert-dialog-header.svelte +0 -20
  18. package/src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte +0 -20
  19. package/src/lib/components/ui/alert-dialog/alert-dialog-title.svelte +0 -17
  20. package/src/lib/components/ui/alert-dialog/alert-dialog-trigger.svelte +0 -7
  21. package/src/lib/components/ui/alert-dialog/index.ts +0 -39
  22. package/src/lib/components/ui/avatar/avatar-fallback.svelte +0 -17
  23. package/src/lib/components/ui/avatar/avatar-image.svelte +0 -17
  24. package/src/lib/components/ui/avatar/avatar.svelte +0 -19
  25. package/src/lib/components/ui/avatar/index.ts +0 -13
  26. package/src/lib/components/ui/badge/badge.svelte +0 -49
  27. package/src/lib/components/ui/badge/index.ts +0 -2
  28. package/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +0 -23
  29. package/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte +0 -20
  30. package/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte +0 -31
  31. package/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte +0 -23
  32. package/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte +0 -23
  33. package/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte +0 -27
  34. package/src/lib/components/ui/breadcrumb/breadcrumb.svelte +0 -21
  35. package/src/lib/components/ui/breadcrumb/index.ts +0 -25
  36. package/src/lib/components/ui/button/button.svelte +0 -82
  37. package/src/lib/components/ui/button/index.ts +0 -17
  38. package/src/lib/components/ui/card/card-action.svelte +0 -20
  39. package/src/lib/components/ui/card/card-content.svelte +0 -15
  40. package/src/lib/components/ui/card/card-description.svelte +0 -20
  41. package/src/lib/components/ui/card/card-footer.svelte +0 -20
  42. package/src/lib/components/ui/card/card-header.svelte +0 -23
  43. package/src/lib/components/ui/card/card-title.svelte +0 -20
  44. package/src/lib/components/ui/card/card.svelte +0 -23
  45. package/src/lib/components/ui/card/index.ts +0 -25
  46. package/src/lib/components/ui/collapsible/collapsible-content.svelte +0 -7
  47. package/src/lib/components/ui/collapsible/collapsible-trigger.svelte +0 -7
  48. package/src/lib/components/ui/collapsible/collapsible.svelte +0 -11
  49. package/src/lib/components/ui/collapsible/index.ts +0 -13
  50. package/src/lib/components/ui/command/command-dialog.svelte +0 -40
  51. package/src/lib/components/ui/command/command-empty.svelte +0 -17
  52. package/src/lib/components/ui/command/command-group.svelte +0 -30
  53. package/src/lib/components/ui/command/command-input.svelte +0 -26
  54. package/src/lib/components/ui/command/command-item.svelte +0 -20
  55. package/src/lib/components/ui/command/command-link-item.svelte +0 -20
  56. package/src/lib/components/ui/command/command-list.svelte +0 -17
  57. package/src/lib/components/ui/command/command-separator.svelte +0 -17
  58. package/src/lib/components/ui/command/command-shortcut.svelte +0 -20
  59. package/src/lib/components/ui/command/command.svelte +0 -22
  60. package/src/lib/components/ui/command/index.ts +0 -40
  61. package/src/lib/components/ui/dialog/dialog-close.svelte +0 -7
  62. package/src/lib/components/ui/dialog/dialog-content.svelte +0 -43
  63. package/src/lib/components/ui/dialog/dialog-description.svelte +0 -17
  64. package/src/lib/components/ui/dialog/dialog-footer.svelte +0 -20
  65. package/src/lib/components/ui/dialog/dialog-header.svelte +0 -20
  66. package/src/lib/components/ui/dialog/dialog-overlay.svelte +0 -20
  67. package/src/lib/components/ui/dialog/dialog-title.svelte +0 -17
  68. package/src/lib/components/ui/dialog/dialog-trigger.svelte +0 -7
  69. package/src/lib/components/ui/dialog/index.ts +0 -37
  70. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -41
  71. package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +0 -27
  72. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +0 -22
  73. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +0 -7
  74. package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +0 -27
  75. package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +0 -24
  76. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +0 -16
  77. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +0 -31
  78. package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +0 -17
  79. package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +0 -20
  80. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +0 -20
  81. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +0 -29
  82. package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +0 -7
  83. package/src/lib/components/ui/dropdown-menu/index.ts +0 -49
  84. package/src/lib/components/ui/input/index.ts +0 -7
  85. package/src/lib/components/ui/input/input.svelte +0 -52
  86. package/src/lib/components/ui/label/index.ts +0 -7
  87. package/src/lib/components/ui/label/label.svelte +0 -20
  88. package/src/lib/components/ui/popover/index.ts +0 -17
  89. package/src/lib/components/ui/popover/popover-content.svelte +0 -29
  90. package/src/lib/components/ui/popover/popover-trigger.svelte +0 -17
  91. package/src/lib/components/ui/select/index.ts +0 -37
  92. package/src/lib/components/ui/select/select-content.svelte +0 -40
  93. package/src/lib/components/ui/select/select-group-heading.svelte +0 -21
  94. package/src/lib/components/ui/select/select-group.svelte +0 -7
  95. package/src/lib/components/ui/select/select-item.svelte +0 -38
  96. package/src/lib/components/ui/select/select-label.svelte +0 -20
  97. package/src/lib/components/ui/select/select-scroll-down-button.svelte +0 -20
  98. package/src/lib/components/ui/select/select-scroll-up-button.svelte +0 -20
  99. package/src/lib/components/ui/select/select-separator.svelte +0 -18
  100. package/src/lib/components/ui/select/select-trigger.svelte +0 -29
  101. package/src/lib/components/ui/separator/index.ts +0 -7
  102. package/src/lib/components/ui/separator/separator.svelte +0 -21
  103. package/src/lib/components/ui/sheet/index.ts +0 -36
  104. package/src/lib/components/ui/sheet/sheet-close.svelte +0 -7
  105. package/src/lib/components/ui/sheet/sheet-content.svelte +0 -60
  106. package/src/lib/components/ui/sheet/sheet-description.svelte +0 -17
  107. package/src/lib/components/ui/sheet/sheet-footer.svelte +0 -20
  108. package/src/lib/components/ui/sheet/sheet-header.svelte +0 -20
  109. package/src/lib/components/ui/sheet/sheet-overlay.svelte +0 -20
  110. package/src/lib/components/ui/sheet/sheet-title.svelte +0 -17
  111. package/src/lib/components/ui/sheet/sheet-trigger.svelte +0 -7
  112. package/src/lib/components/ui/sidebar/constants.ts +0 -6
  113. package/src/lib/components/ui/sidebar/context.svelte.ts +0 -79
  114. package/src/lib/components/ui/sidebar/index.ts +0 -75
  115. package/src/lib/components/ui/sidebar/sidebar-content.svelte +0 -24
  116. package/src/lib/components/ui/sidebar/sidebar-footer.svelte +0 -21
  117. package/src/lib/components/ui/sidebar/sidebar-group-action.svelte +0 -36
  118. package/src/lib/components/ui/sidebar/sidebar-group-content.svelte +0 -21
  119. package/src/lib/components/ui/sidebar/sidebar-group-label.svelte +0 -34
  120. package/src/lib/components/ui/sidebar/sidebar-group.svelte +0 -21
  121. package/src/lib/components/ui/sidebar/sidebar-header.svelte +0 -21
  122. package/src/lib/components/ui/sidebar/sidebar-input.svelte +0 -21
  123. package/src/lib/components/ui/sidebar/sidebar-inset.svelte +0 -24
  124. package/src/lib/components/ui/sidebar/sidebar-menu-action.svelte +0 -43
  125. package/src/lib/components/ui/sidebar/sidebar-menu-badge.svelte +0 -29
  126. package/src/lib/components/ui/sidebar/sidebar-menu-button.svelte +0 -101
  127. package/src/lib/components/ui/sidebar/sidebar-menu-item.svelte +0 -21
  128. package/src/lib/components/ui/sidebar/sidebar-menu-skeleton.svelte +0 -36
  129. package/src/lib/components/ui/sidebar/sidebar-menu-sub-button.svelte +0 -43
  130. package/src/lib/components/ui/sidebar/sidebar-menu-sub-item.svelte +0 -21
  131. package/src/lib/components/ui/sidebar/sidebar-menu-sub.svelte +0 -25
  132. package/src/lib/components/ui/sidebar/sidebar-menu.svelte +0 -21
  133. package/src/lib/components/ui/sidebar/sidebar-provider.svelte +0 -53
  134. package/src/lib/components/ui/sidebar/sidebar-rail.svelte +0 -36
  135. package/src/lib/components/ui/sidebar/sidebar-separator.svelte +0 -19
  136. package/src/lib/components/ui/sidebar/sidebar-trigger.svelte +0 -35
  137. package/src/lib/components/ui/sidebar/sidebar.svelte +0 -101
  138. package/src/lib/components/ui/skeleton/index.ts +0 -7
  139. package/src/lib/components/ui/skeleton/skeleton.svelte +0 -17
  140. package/src/lib/components/ui/tabs/index.ts +0 -16
  141. package/src/lib/components/ui/tabs/tabs-content.svelte +0 -17
  142. package/src/lib/components/ui/tabs/tabs-list.svelte +0 -16
  143. package/src/lib/components/ui/tabs/tabs-trigger.svelte +0 -20
  144. package/src/lib/components/ui/tabs/tabs.svelte +0 -19
  145. package/src/lib/components/ui/textarea/index.ts +0 -7
  146. package/src/lib/components/ui/textarea/textarea.svelte +0 -22
  147. package/src/lib/components/ui/tooltip/index.ts +0 -21
  148. package/src/lib/components/ui/tooltip/tooltip-content.svelte +0 -47
  149. package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +0 -7
  150. package/src/lib/hooks/is-mobile.svelte.ts +0 -9
  151. package/src/lib/utils.ts +0 -13
@@ -1,20 +0,0 @@
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="select-label"
16
- class={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}
17
- {...restProps}
18
- >
19
- {@render children?.()}
20
- </div>
@@ -1,20 +0,0 @@
1
- <script lang="ts">
2
- import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
3
- import { Select as SelectPrimitive } from 'bits-ui';
4
- import { cn, type WithoutChildrenOrChild } from '@lib/utils.js';
5
-
6
- let {
7
- ref = $bindable(null),
8
- class: className,
9
- ...restProps
10
- }: WithoutChildrenOrChild<SelectPrimitive.ScrollDownButtonProps> = $props();
11
- </script>
12
-
13
- <SelectPrimitive.ScrollDownButton
14
- bind:ref
15
- data-slot="select-scroll-down-button"
16
- class={cn('flex cursor-default items-center justify-center py-1', className)}
17
- {...restProps}
18
- >
19
- <ChevronDownIcon class="size-4" />
20
- </SelectPrimitive.ScrollDownButton>
@@ -1,20 +0,0 @@
1
- <script lang="ts">
2
- import ChevronUpIcon from '@lucide/svelte/icons/chevron-up';
3
- import { Select as SelectPrimitive } from 'bits-ui';
4
- import { cn, type WithoutChildrenOrChild } from '@lib/utils.js';
5
-
6
- let {
7
- ref = $bindable(null),
8
- class: className,
9
- ...restProps
10
- }: WithoutChildrenOrChild<SelectPrimitive.ScrollUpButtonProps> = $props();
11
- </script>
12
-
13
- <SelectPrimitive.ScrollUpButton
14
- bind:ref
15
- data-slot="select-scroll-up-button"
16
- class={cn('flex cursor-default items-center justify-center py-1', className)}
17
- {...restProps}
18
- >
19
- <ChevronUpIcon class="size-4" />
20
- </SelectPrimitive.ScrollUpButton>
@@ -1,18 +0,0 @@
1
- <script lang="ts">
2
- import type { Separator as SeparatorPrimitive } from 'bits-ui';
3
- import { Separator } from '@lib/components/ui/separator/index.js';
4
- import { cn } from '@lib/utils.js';
5
-
6
- let {
7
- ref = $bindable(null),
8
- class: className,
9
- ...restProps
10
- }: SeparatorPrimitive.RootProps = $props();
11
- </script>
12
-
13
- <Separator
14
- bind:ref
15
- data-slot="select-separator"
16
- class={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}
17
- {...restProps}
18
- />
@@ -1,29 +0,0 @@
1
- <script lang="ts">
2
- import { Select as SelectPrimitive } from 'bits-ui';
3
- import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
4
- import { cn, type WithoutChild } from '@lib/utils.js';
5
-
6
- let {
7
- ref = $bindable(null),
8
- class: className,
9
- children,
10
- size = 'default',
11
- ...restProps
12
- }: WithoutChild<SelectPrimitive.TriggerProps> & {
13
- size?: 'sm' | 'default';
14
- } = $props();
15
- </script>
16
-
17
- <SelectPrimitive.Trigger
18
- bind:ref
19
- data-slot="select-trigger"
20
- data-size={size}
21
- class={cn(
22
- "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 shadow-xs flex w-fit select-none items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
23
- className
24
- )}
25
- {...restProps}
26
- >
27
- {@render children?.()}
28
- <ChevronDownIcon class="size-4 opacity-50" />
29
- </SelectPrimitive.Trigger>
@@ -1,7 +0,0 @@
1
- import Root from './separator.svelte';
2
-
3
- export {
4
- Root,
5
- //
6
- Root as Separator
7
- };
@@ -1,21 +0,0 @@
1
- <script lang="ts">
2
- import { Separator as SeparatorPrimitive } from 'bits-ui';
3
- import { cn } from '@lib/utils.js';
4
-
5
- let {
6
- ref = $bindable(null),
7
- class: className,
8
- 'data-slot': dataSlot = 'separator',
9
- ...restProps
10
- }: SeparatorPrimitive.RootProps = $props();
11
- </script>
12
-
13
- <SeparatorPrimitive.Root
14
- bind:ref
15
- data-slot={dataSlot}
16
- class={cn(
17
- 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px',
18
- className
19
- )}
20
- {...restProps}
21
- />
@@ -1,36 +0,0 @@
1
- import { Dialog as SheetPrimitive } from 'bits-ui';
2
- import Trigger from './sheet-trigger.svelte';
3
- import Close from './sheet-close.svelte';
4
- import Overlay from './sheet-overlay.svelte';
5
- import Content from './sheet-content.svelte';
6
- import Header from './sheet-header.svelte';
7
- import Footer from './sheet-footer.svelte';
8
- import Title from './sheet-title.svelte';
9
- import Description from './sheet-description.svelte';
10
-
11
- const Root = SheetPrimitive.Root;
12
- const Portal = SheetPrimitive.Portal;
13
-
14
- export {
15
- Root,
16
- Close,
17
- Trigger,
18
- Portal,
19
- Overlay,
20
- Content,
21
- Header,
22
- Footer,
23
- Title,
24
- Description,
25
- //
26
- Root as Sheet,
27
- Close as SheetClose,
28
- Trigger as SheetTrigger,
29
- Portal as SheetPortal,
30
- Overlay as SheetOverlay,
31
- Content as SheetContent,
32
- Header as SheetHeader,
33
- Footer as SheetFooter,
34
- Title as SheetTitle,
35
- Description as SheetDescription
36
- };
@@ -1,7 +0,0 @@
1
- <script lang="ts">
2
- import { Dialog as SheetPrimitive } from 'bits-ui';
3
-
4
- let { ref = $bindable(null), ...restProps }: SheetPrimitive.CloseProps = $props();
5
- </script>
6
-
7
- <SheetPrimitive.Close bind:ref data-slot="sheet-close" {...restProps} />
@@ -1,60 +0,0 @@
1
- <script lang="ts" module>
2
- import { tv, type VariantProps } from 'tailwind-variants';
3
- export const sheetVariants = tv({
4
- base: 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
5
- variants: {
6
- side: {
7
- top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
8
- bottom:
9
- 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
10
- left: 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
11
- right:
12
- 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm'
13
- }
14
- },
15
- defaultVariants: {
16
- side: 'right'
17
- }
18
- });
19
-
20
- export type Side = VariantProps<typeof sheetVariants>['side'];
21
- </script>
22
-
23
- <script lang="ts">
24
- import { Dialog as SheetPrimitive } from 'bits-ui';
25
- import XIcon from '@lucide/svelte/icons/x';
26
- import type { Snippet } from 'svelte';
27
- import SheetOverlay from './sheet-overlay.svelte';
28
- import { cn, type WithoutChildrenOrChild } from '@lib/utils.js';
29
-
30
- let {
31
- ref = $bindable(null),
32
- class: className,
33
- side = 'right',
34
- portalProps,
35
- children,
36
- ...restProps
37
- }: WithoutChildrenOrChild<SheetPrimitive.ContentProps> & {
38
- portalProps?: SheetPrimitive.PortalProps;
39
- side?: Side;
40
- children: Snippet;
41
- } = $props();
42
- </script>
43
-
44
- <SheetPrimitive.Portal {...portalProps}>
45
- <SheetOverlay />
46
- <SheetPrimitive.Content
47
- bind:ref
48
- data-slot="sheet-content"
49
- class={cn(sheetVariants({ side }), className)}
50
- {...restProps}
51
- >
52
- {@render children?.()}
53
- <SheetPrimitive.Close
54
- class="ring-offset-background focus-visible:ring-ring rounded-xs focus-visible:outline-hidden absolute right-4 top-4 opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none"
55
- >
56
- <XIcon class="size-4" />
57
- <span class="sr-only">Close</span>
58
- </SheetPrimitive.Close>
59
- </SheetPrimitive.Content>
60
- </SheetPrimitive.Portal>
@@ -1,17 +0,0 @@
1
- <script lang="ts">
2
- import { Dialog as SheetPrimitive } from 'bits-ui';
3
- import { cn } from '@lib/utils.js';
4
-
5
- let {
6
- ref = $bindable(null),
7
- class: className,
8
- ...restProps
9
- }: SheetPrimitive.DescriptionProps = $props();
10
- </script>
11
-
12
- <SheetPrimitive.Description
13
- bind:ref
14
- data-slot="sheet-description"
15
- class={cn('text-muted-foreground text-sm', className)}
16
- {...restProps}
17
- />
@@ -1,20 +0,0 @@
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="sheet-footer"
16
- class={cn('mt-auto flex flex-col gap-2 p-4', className)}
17
- {...restProps}
18
- >
19
- {@render children?.()}
20
- </div>
@@ -1,20 +0,0 @@
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="sheet-header"
16
- class={cn('flex flex-col gap-1.5 p-4', className)}
17
- {...restProps}
18
- >
19
- {@render children?.()}
20
- </div>
@@ -1,20 +0,0 @@
1
- <script lang="ts">
2
- import { Dialog as SheetPrimitive } from 'bits-ui';
3
- import { cn } from '@lib/utils.js';
4
-
5
- let {
6
- ref = $bindable(null),
7
- class: className,
8
- ...restProps
9
- }: SheetPrimitive.OverlayProps = $props();
10
- </script>
11
-
12
- <SheetPrimitive.Overlay
13
- bind:ref
14
- data-slot="sheet-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
- />
@@ -1,17 +0,0 @@
1
- <script lang="ts">
2
- import { Dialog as SheetPrimitive } from 'bits-ui';
3
- import { cn } from '@lib/utils.js';
4
-
5
- let {
6
- ref = $bindable(null),
7
- class: className,
8
- ...restProps
9
- }: SheetPrimitive.TitleProps = $props();
10
- </script>
11
-
12
- <SheetPrimitive.Title
13
- bind:ref
14
- data-slot="sheet-title"
15
- class={cn('text-foreground font-semibold', className)}
16
- {...restProps}
17
- />
@@ -1,7 +0,0 @@
1
- <script lang="ts">
2
- import { Dialog as SheetPrimitive } from 'bits-ui';
3
-
4
- let { ref = $bindable(null), ...restProps }: SheetPrimitive.TriggerProps = $props();
5
- </script>
6
-
7
- <SheetPrimitive.Trigger bind:ref data-slot="sheet-trigger" {...restProps} />
@@ -1,6 +0,0 @@
1
- export const SIDEBAR_COOKIE_NAME = 'sidebar:state';
2
- export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
3
- export const SIDEBAR_WIDTH = '16rem';
4
- export const SIDEBAR_WIDTH_MOBILE = '18rem';
5
- export const SIDEBAR_WIDTH_ICON = '3rem';
6
- export const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
@@ -1,79 +0,0 @@
1
- import { IsMobile } from '@lib/hooks/is-mobile.svelte.js';
2
- import { getContext, setContext } from 'svelte';
3
- import { SIDEBAR_KEYBOARD_SHORTCUT } from './constants.js';
4
-
5
- type Getter<T> = () => T;
6
-
7
- export type SidebarStateProps = {
8
- /**
9
- * A getter function that returns the current open state of the sidebar.
10
- * We use a getter function here to support `bind:open` on the `Sidebar.Provider`
11
- * component.
12
- */
13
- open: Getter<boolean>;
14
-
15
- /**
16
- * A function that sets the open state of the sidebar. To support `bind:open`, we need
17
- * a source of truth for changing the open state to ensure it will be synced throughout
18
- * the sub-components and any `bind:` references.
19
- */
20
- setOpen: (open: boolean) => void;
21
- };
22
-
23
- class SidebarState {
24
- readonly props: SidebarStateProps;
25
- open = $derived.by(() => this.props.open());
26
- openMobile = $state(false);
27
- setOpen: SidebarStateProps['setOpen'];
28
- #isMobile: IsMobile;
29
- state = $derived.by(() => (this.open ? 'expanded' : 'collapsed'));
30
-
31
- constructor(props: SidebarStateProps) {
32
- this.setOpen = props.setOpen;
33
- this.#isMobile = new IsMobile();
34
- this.props = props;
35
- }
36
-
37
- // Convenience getter for checking if the sidebar is mobile
38
- // without this, we would need to use `sidebar.isMobile.current` everywhere
39
- get isMobile() {
40
- return this.#isMobile.current;
41
- }
42
-
43
- // Event handler to apply to the `<svelte:window>`
44
- handleShortcutKeydown = (e: KeyboardEvent) => {
45
- if (e.key === SIDEBAR_KEYBOARD_SHORTCUT && (e.metaKey || e.ctrlKey)) {
46
- e.preventDefault();
47
- this.toggle();
48
- }
49
- };
50
-
51
- setOpenMobile = (value: boolean) => {
52
- this.openMobile = value;
53
- };
54
-
55
- toggle = () => {
56
- return this.#isMobile.current ? (this.openMobile = !this.openMobile) : this.setOpen(!this.open);
57
- };
58
- }
59
-
60
- const SYMBOL_KEY = 'scn-sidebar';
61
-
62
- /**
63
- * Instantiates a new `SidebarState` instance and sets it in the context.
64
- *
65
- * @param props The constructor props for the `SidebarState` class.
66
- * @returns The `SidebarState` instance.
67
- */
68
- export function setSidebar(props: SidebarStateProps): SidebarState {
69
- return setContext(Symbol.for(SYMBOL_KEY), new SidebarState(props));
70
- }
71
-
72
- /**
73
- * Retrieves the `SidebarState` instance from the context. This is a class instance,
74
- * so you cannot destructure it.
75
- * @returns The `SidebarState` instance.
76
- */
77
- export function useSidebar(): SidebarState {
78
- return getContext(Symbol.for(SYMBOL_KEY));
79
- }
@@ -1,75 +0,0 @@
1
- import { useSidebar } from './context.svelte.js';
2
- import Content from './sidebar-content.svelte';
3
- import Footer from './sidebar-footer.svelte';
4
- import GroupAction from './sidebar-group-action.svelte';
5
- import GroupContent from './sidebar-group-content.svelte';
6
- import GroupLabel from './sidebar-group-label.svelte';
7
- import Group from './sidebar-group.svelte';
8
- import Header from './sidebar-header.svelte';
9
- import Input from './sidebar-input.svelte';
10
- import Inset from './sidebar-inset.svelte';
11
- import MenuAction from './sidebar-menu-action.svelte';
12
- import MenuBadge from './sidebar-menu-badge.svelte';
13
- import MenuButton from './sidebar-menu-button.svelte';
14
- import MenuItem from './sidebar-menu-item.svelte';
15
- import MenuSkeleton from './sidebar-menu-skeleton.svelte';
16
- import MenuSubButton from './sidebar-menu-sub-button.svelte';
17
- import MenuSubItem from './sidebar-menu-sub-item.svelte';
18
- import MenuSub from './sidebar-menu-sub.svelte';
19
- import Menu from './sidebar-menu.svelte';
20
- import Provider from './sidebar-provider.svelte';
21
- import Rail from './sidebar-rail.svelte';
22
- import Separator from './sidebar-separator.svelte';
23
- import Trigger from './sidebar-trigger.svelte';
24
- import Root from './sidebar.svelte';
25
-
26
- export {
27
- Content,
28
- Footer,
29
- Group,
30
- GroupAction,
31
- GroupContent,
32
- GroupLabel,
33
- Header,
34
- Input,
35
- Inset,
36
- Menu,
37
- MenuAction,
38
- MenuBadge,
39
- MenuButton,
40
- MenuItem,
41
- MenuSkeleton,
42
- MenuSub,
43
- MenuSubButton,
44
- MenuSubItem,
45
- Provider,
46
- Rail,
47
- Root,
48
- Separator,
49
- //
50
- Root as Sidebar,
51
- Content as SidebarContent,
52
- Footer as SidebarFooter,
53
- Group as SidebarGroup,
54
- GroupAction as SidebarGroupAction,
55
- GroupContent as SidebarGroupContent,
56
- GroupLabel as SidebarGroupLabel,
57
- Header as SidebarHeader,
58
- Input as SidebarInput,
59
- Inset as SidebarInset,
60
- Menu as SidebarMenu,
61
- MenuAction as SidebarMenuAction,
62
- MenuBadge as SidebarMenuBadge,
63
- MenuButton as SidebarMenuButton,
64
- MenuItem as SidebarMenuItem,
65
- MenuSkeleton as SidebarMenuSkeleton,
66
- MenuSub as SidebarMenuSub,
67
- MenuSubButton as SidebarMenuSubButton,
68
- MenuSubItem as SidebarMenuSubItem,
69
- Provider as SidebarProvider,
70
- Rail as SidebarRail,
71
- Separator as SidebarSeparator,
72
- Trigger as SidebarTrigger,
73
- Trigger,
74
- useSidebar
75
- };
@@ -1,24 +0,0 @@
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<HTMLElement>> = $props();
11
- </script>
12
-
13
- <div
14
- bind:this={ref}
15
- data-slot="sidebar-content"
16
- data-sidebar="content"
17
- class={cn(
18
- 'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',
19
- className
20
- )}
21
- {...restProps}
22
- >
23
- {@render children?.()}
24
- </div>
@@ -1,21 +0,0 @@
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<HTMLElement>> = $props();
11
- </script>
12
-
13
- <div
14
- bind:this={ref}
15
- data-slot="sidebar-footer"
16
- data-sidebar="footer"
17
- class={cn('flex flex-col gap-2 p-2', className)}
18
- {...restProps}
19
- >
20
- {@render children?.()}
21
- </div>
@@ -1,36 +0,0 @@
1
- <script lang="ts">
2
- import { cn, type WithElementRef } from '@lib/utils.js';
3
- import type { Snippet } from 'svelte';
4
- import type { HTMLButtonAttributes } from 'svelte/elements';
5
-
6
- let {
7
- ref = $bindable(null),
8
- class: className,
9
- children,
10
- child,
11
- ...restProps
12
- }: WithElementRef<HTMLButtonAttributes> & {
13
- child?: Snippet<[{ props: Record<string, unknown> }]>;
14
- } = $props();
15
-
16
- const mergedProps = $derived({
17
- class: cn(
18
- 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground outline-hidden absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
19
- // Increases the hit area of the button on mobile.
20
- 'after:absolute after:-inset-2 md:after:hidden',
21
- 'group-data-[collapsible=icon]:hidden',
22
- className
23
- ),
24
- 'data-slot': 'sidebar-group-action',
25
- 'data-sidebar': 'group-action',
26
- ...restProps
27
- });
28
- </script>
29
-
30
- {#if child}
31
- {@render child({ props: mergedProps })}
32
- {:else}
33
- <button bind:this={ref} {...mergedProps}>
34
- {@render children?.()}
35
- </button>
36
- {/if}
@@ -1,21 +0,0 @@
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="sidebar-group-content"
16
- data-sidebar="group-content"
17
- class={cn('w-full text-sm', className)}
18
- {...restProps}
19
- >
20
- {@render children?.()}
21
- </div>
@@ -1,34 +0,0 @@
1
- <script lang="ts">
2
- import { cn, type WithElementRef } from '@lib/utils.js';
3
- import type { Snippet } from 'svelte';
4
- import type { HTMLAttributes } from 'svelte/elements';
5
-
6
- let {
7
- ref = $bindable(null),
8
- children,
9
- child,
10
- class: className,
11
- ...restProps
12
- }: WithElementRef<HTMLAttributes<HTMLElement>> & {
13
- child?: Snippet<[{ props: Record<string, unknown> }]>;
14
- } = $props();
15
-
16
- const mergedProps = $derived({
17
- class: cn(
18
- 'text-sidebar-foreground/70 ring-sidebar-ring outline-hidden flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
19
- 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',
20
- className
21
- ),
22
- 'data-slot': 'sidebar-group-label',
23
- 'data-sidebar': 'group-label',
24
- ...restProps
25
- });
26
- </script>
27
-
28
- {#if child}
29
- {@render child({ props: mergedProps })}
30
- {:else}
31
- <div bind:this={ref} {...mergedProps}>
32
- {@render children?.()}
33
- </div>
34
- {/if}