@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,43 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+ import XIcon from '@lucide/svelte/icons/x';
4
+ import type { Snippet } from 'svelte';
5
+ import * as Dialog from './index.js';
6
+ import { cn, type WithoutChildrenOrChild } from '@lib/utils.js';
7
+
8
+ let {
9
+ ref = $bindable(null),
10
+ class: className,
11
+ portalProps,
12
+ children,
13
+ showCloseButton = true,
14
+ ...restProps
15
+ }: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
16
+ portalProps?: DialogPrimitive.PortalProps;
17
+ children: Snippet;
18
+ showCloseButton?: boolean;
19
+ } = $props();
20
+ </script>
21
+
22
+ <Dialog.Portal {...portalProps}>
23
+ <Dialog.Overlay />
24
+ <DialogPrimitive.Content
25
+ bind:ref
26
+ data-slot="dialog-content"
27
+ class={cn(
28
+ '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',
29
+ className
30
+ )}
31
+ {...restProps}
32
+ >
33
+ {@render children?.()}
34
+ {#if showCloseButton}
35
+ <DialogPrimitive.Close
36
+ class="ring-offset-background focus:ring-ring rounded-xs focus:outline-hidden absolute end-4 top-4 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"
37
+ >
38
+ <XIcon />
39
+ <span class="sr-only">Close</span>
40
+ </DialogPrimitive.Close>
41
+ {/if}
42
+ </DialogPrimitive.Content>
43
+ </Dialog.Portal>
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DialogPrimitive.DescriptionProps = $props();
10
+ </script>
11
+
12
+ <DialogPrimitive.Description
13
+ bind:ref
14
+ data-slot="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="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="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 { Dialog as DialogPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DialogPrimitive.OverlayProps = $props();
10
+ </script>
11
+
12
+ <DialogPrimitive.Overlay
13
+ bind:ref
14
+ data-slot="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 { Dialog as DialogPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DialogPrimitive.TitleProps = $props();
10
+ </script>
11
+
12
+ <DialogPrimitive.Title
13
+ bind:ref
14
+ data-slot="dialog-title"
15
+ class={cn('text-lg font-semibold leading-none', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: DialogPrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <DialogPrimitive.Trigger bind:ref data-slot="dialog-trigger" {...restProps} />
@@ -0,0 +1,37 @@
1
+ import { Dialog as DialogPrimitive } from 'bits-ui';
2
+
3
+ import Title from './dialog-title.svelte';
4
+ import Footer from './dialog-footer.svelte';
5
+ import Header from './dialog-header.svelte';
6
+ import Overlay from './dialog-overlay.svelte';
7
+ import Content from './dialog-content.svelte';
8
+ import Description from './dialog-description.svelte';
9
+ import Trigger from './dialog-trigger.svelte';
10
+ import Close from './dialog-close.svelte';
11
+
12
+ const Root = DialogPrimitive.Root;
13
+ const Portal = DialogPrimitive.Portal;
14
+
15
+ export {
16
+ Root,
17
+ Title,
18
+ Portal,
19
+ Footer,
20
+ Header,
21
+ Trigger,
22
+ Overlay,
23
+ Content,
24
+ Description,
25
+ Close,
26
+ //
27
+ Root as Dialog,
28
+ Title as DialogTitle,
29
+ Portal as DialogPortal,
30
+ Footer as DialogFooter,
31
+ Header as DialogHeader,
32
+ Trigger as DialogTrigger,
33
+ Overlay as DialogOverlay,
34
+ Content as DialogContent,
35
+ Description as DialogDescription,
36
+ Close as DialogClose
37
+ };
@@ -0,0 +1,41 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import CheckIcon from '@lucide/svelte/icons/check';
4
+ import MinusIcon from '@lucide/svelte/icons/minus';
5
+ import { cn, type WithoutChildrenOrChild } from '@lib/utils.js';
6
+ import type { Snippet } from 'svelte';
7
+
8
+ let {
9
+ ref = $bindable(null),
10
+ checked = $bindable(false),
11
+ indeterminate = $bindable(false),
12
+ class: className,
13
+ children: childrenProp,
14
+ ...restProps
15
+ }: WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
16
+ children?: Snippet;
17
+ } = $props();
18
+ </script>
19
+
20
+ <DropdownMenuPrimitive.CheckboxItem
21
+ bind:ref
22
+ bind:checked
23
+ bind:indeterminate
24
+ data-slot="dropdown-menu-checkbox-item"
25
+ class={cn(
26
+ "focus:bg-accent focus:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
27
+ className
28
+ )}
29
+ {...restProps}
30
+ >
31
+ {#snippet children({ checked, indeterminate })}
32
+ <span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
33
+ {#if indeterminate}
34
+ <MinusIcon class="size-4" />
35
+ {:else}
36
+ <CheckIcon class={cn('size-4', !checked && 'text-transparent')} />
37
+ {/if}
38
+ </span>
39
+ {@render childrenProp?.()}
40
+ {/snippet}
41
+ </DropdownMenuPrimitive.CheckboxItem>
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import { cn } from '@lib/utils.js';
3
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ sideOffset = 4,
8
+ portalProps,
9
+ class: className,
10
+ ...restProps
11
+ }: DropdownMenuPrimitive.ContentProps & {
12
+ portalProps?: DropdownMenuPrimitive.PortalProps;
13
+ } = $props();
14
+ </script>
15
+
16
+ <DropdownMenuPrimitive.Portal {...portalProps}>
17
+ <DropdownMenuPrimitive.Content
18
+ bind:ref
19
+ data-slot="dropdown-menu-content"
20
+ {sideOffset}
21
+ class={cn(
22
+ 'bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--bits-dropdown-menu-content-available-height) origin-(--bits-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md outline-none',
23
+ className
24
+ )}
25
+ {...restProps}
26
+ />
27
+ </DropdownMenuPrimitive.Portal>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+ import type { ComponentProps } from 'svelte';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ inset,
10
+ ...restProps
11
+ }: ComponentProps<typeof DropdownMenuPrimitive.GroupHeading> & {
12
+ inset?: boolean;
13
+ } = $props();
14
+ </script>
15
+
16
+ <DropdownMenuPrimitive.GroupHeading
17
+ bind:ref
18
+ data-slot="dropdown-menu-group-heading"
19
+ data-inset={inset}
20
+ class={cn('px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8', className)}
21
+ {...restProps}
22
+ />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.GroupProps = $props();
5
+ </script>
6
+
7
+ <DropdownMenuPrimitive.Group bind:ref data-slot="dropdown-menu-group" {...restProps} />
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import { cn } from '@lib/utils.js';
3
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ inset,
9
+ variant = 'default',
10
+ ...restProps
11
+ }: DropdownMenuPrimitive.ItemProps & {
12
+ inset?: boolean;
13
+ variant?: 'default' | 'destructive';
14
+ } = $props();
15
+ </script>
16
+
17
+ <DropdownMenuPrimitive.Item
18
+ bind:ref
19
+ data-slot="dropdown-menu-item"
20
+ data-inset={inset}
21
+ data-variant={variant}
22
+ class={cn(
23
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
24
+ className
25
+ )}
26
+ {...restProps}
27
+ />
@@ -0,0 +1,24 @@
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
+ inset,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
12
+ inset?: boolean;
13
+ } = $props();
14
+ </script>
15
+
16
+ <div
17
+ bind:this={ref}
18
+ data-slot="dropdown-menu-label"
19
+ data-inset={inset}
20
+ class={cn('px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8', className)}
21
+ {...restProps}
22
+ >
23
+ {@render children?.()}
24
+ </div>
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+
4
+ let {
5
+ ref = $bindable(null),
6
+ value = $bindable(),
7
+ ...restProps
8
+ }: DropdownMenuPrimitive.RadioGroupProps = $props();
9
+ </script>
10
+
11
+ <DropdownMenuPrimitive.RadioGroup
12
+ bind:ref
13
+ bind:value
14
+ data-slot="dropdown-menu-radio-group"
15
+ {...restProps}
16
+ />
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import CircleIcon from '@lucide/svelte/icons/circle';
4
+ import { cn, type WithoutChild } from '@lib/utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children: childrenProp,
10
+ ...restProps
11
+ }: WithoutChild<DropdownMenuPrimitive.RadioItemProps> = $props();
12
+ </script>
13
+
14
+ <DropdownMenuPrimitive.RadioItem
15
+ bind:ref
16
+ data-slot="dropdown-menu-radio-item"
17
+ class={cn(
18
+ "focus:bg-accent focus:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
19
+ className
20
+ )}
21
+ {...restProps}
22
+ >
23
+ {#snippet children({ checked })}
24
+ <span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
25
+ {#if checked}
26
+ <CircleIcon class="size-2 fill-current" />
27
+ {/if}
28
+ </span>
29
+ {@render childrenProp?.({ checked })}
30
+ {/snippet}
31
+ </DropdownMenuPrimitive.RadioItem>
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DropdownMenuPrimitive.SeparatorProps = $props();
10
+ </script>
11
+
12
+ <DropdownMenuPrimitive.Separator
13
+ bind:ref
14
+ data-slot="dropdown-menu-separator"
15
+ class={cn('bg-border -mx-1 my-1 h-px', className)}
16
+ {...restProps}
17
+ />
@@ -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<HTMLSpanElement>> = $props();
11
+ </script>
12
+
13
+ <span
14
+ bind:this={ref}
15
+ data-slot="dropdown-menu-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,20 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DropdownMenuPrimitive.SubContentProps = $props();
10
+ </script>
11
+
12
+ <DropdownMenuPrimitive.SubContent
13
+ bind:ref
14
+ data-slot="dropdown-menu-sub-content"
15
+ class={cn(
16
+ 'bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--bits-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg',
17
+ className
18
+ )}
19
+ {...restProps}
20
+ />
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+ import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
4
+ import { cn } from '@lib/utils.js';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ inset,
10
+ children,
11
+ ...restProps
12
+ }: DropdownMenuPrimitive.SubTriggerProps & {
13
+ inset?: boolean;
14
+ } = $props();
15
+ </script>
16
+
17
+ <DropdownMenuPrimitive.SubTrigger
18
+ bind:ref
19
+ data-slot="dropdown-menu-sub-trigger"
20
+ data-inset={inset}
21
+ class={cn(
22
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground outline-hidden [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
23
+ className
24
+ )}
25
+ {...restProps}
26
+ >
27
+ {@render children?.()}
28
+ <ChevronRightIcon class="ml-auto size-4" />
29
+ </DropdownMenuPrimitive.SubTrigger>
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <DropdownMenuPrimitive.Trigger bind:ref data-slot="dropdown-menu-trigger" {...restProps} />
@@ -0,0 +1,49 @@
1
+ import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
2
+ import CheckboxItem from './dropdown-menu-checkbox-item.svelte';
3
+ import Content from './dropdown-menu-content.svelte';
4
+ import Group from './dropdown-menu-group.svelte';
5
+ import Item from './dropdown-menu-item.svelte';
6
+ import Label from './dropdown-menu-label.svelte';
7
+ import RadioGroup from './dropdown-menu-radio-group.svelte';
8
+ import RadioItem from './dropdown-menu-radio-item.svelte';
9
+ import Separator from './dropdown-menu-separator.svelte';
10
+ import Shortcut from './dropdown-menu-shortcut.svelte';
11
+ import Trigger from './dropdown-menu-trigger.svelte';
12
+ import SubContent from './dropdown-menu-sub-content.svelte';
13
+ import SubTrigger from './dropdown-menu-sub-trigger.svelte';
14
+ import GroupHeading from './dropdown-menu-group-heading.svelte';
15
+ const Sub = DropdownMenuPrimitive.Sub;
16
+ const Root = DropdownMenuPrimitive.Root;
17
+
18
+ export {
19
+ CheckboxItem,
20
+ Content,
21
+ Root as DropdownMenu,
22
+ CheckboxItem as DropdownMenuCheckboxItem,
23
+ Content as DropdownMenuContent,
24
+ Group as DropdownMenuGroup,
25
+ Item as DropdownMenuItem,
26
+ Label as DropdownMenuLabel,
27
+ RadioGroup as DropdownMenuRadioGroup,
28
+ RadioItem as DropdownMenuRadioItem,
29
+ Separator as DropdownMenuSeparator,
30
+ Shortcut as DropdownMenuShortcut,
31
+ Sub as DropdownMenuSub,
32
+ SubContent as DropdownMenuSubContent,
33
+ SubTrigger as DropdownMenuSubTrigger,
34
+ Trigger as DropdownMenuTrigger,
35
+ GroupHeading as DropdownMenuGroupHeading,
36
+ Group,
37
+ GroupHeading,
38
+ Item,
39
+ Label,
40
+ RadioGroup,
41
+ RadioItem,
42
+ Root,
43
+ Separator,
44
+ Shortcut,
45
+ Sub,
46
+ SubContent,
47
+ SubTrigger,
48
+ Trigger
49
+ };
@@ -0,0 +1,7 @@
1
+ import Root from './input.svelte';
2
+
3
+ export {
4
+ Root,
5
+ //
6
+ Root as Input
7
+ };
@@ -0,0 +1,52 @@
1
+ <script lang="ts">
2
+ import type { HTMLInputAttributes, HTMLInputTypeAttribute } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '@lib/utils.js';
4
+
5
+ type InputType = Exclude<HTMLInputTypeAttribute, 'file'>;
6
+
7
+ type Props = WithElementRef<
8
+ Omit<HTMLInputAttributes, 'type'> &
9
+ ({ type: 'file'; files?: FileList } | { type?: InputType; files?: undefined })
10
+ >;
11
+
12
+ let {
13
+ ref = $bindable(null),
14
+ value = $bindable(),
15
+ type,
16
+ files = $bindable(),
17
+ class: className,
18
+ 'data-slot': dataSlot = 'input',
19
+ ...restProps
20
+ }: Props = $props();
21
+ </script>
22
+
23
+ {#if type === 'file'}
24
+ <input
25
+ bind:this={ref}
26
+ data-slot={dataSlot}
27
+ class={cn(
28
+ 'selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50',
29
+ 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
30
+ 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
31
+ className
32
+ )}
33
+ type="file"
34
+ bind:files
35
+ bind:value
36
+ {...restProps}
37
+ />
38
+ {:else}
39
+ <input
40
+ bind:this={ref}
41
+ data-slot={dataSlot}
42
+ class={cn(
43
+ 'border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
44
+ 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
45
+ 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
46
+ className
47
+ )}
48
+ {type}
49
+ bind:value
50
+ {...restProps}
51
+ />
52
+ {/if}
@@ -0,0 +1,7 @@
1
+ import Root from './label.svelte';
2
+
3
+ export {
4
+ Root,
5
+ //
6
+ Root as Label
7
+ };
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { Label as LabelPrimitive } from 'bits-ui';
3
+ import { cn } from '@lib/utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: LabelPrimitive.RootProps = $props();
10
+ </script>
11
+
12
+ <LabelPrimitive.Root
13
+ bind:ref
14
+ data-slot="label"
15
+ class={cn(
16
+ 'flex select-none items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50',
17
+ className
18
+ )}
19
+ {...restProps}
20
+ />
@@ -0,0 +1,17 @@
1
+ import { Popover as PopoverPrimitive } from 'bits-ui';
2
+ import Content from './popover-content.svelte';
3
+ import Trigger from './popover-trigger.svelte';
4
+ const Root = PopoverPrimitive.Root;
5
+ const Close = PopoverPrimitive.Close;
6
+
7
+ export {
8
+ Root,
9
+ Content,
10
+ Trigger,
11
+ Close,
12
+ //
13
+ Root as Popover,
14
+ Content as PopoverContent,
15
+ Trigger as PopoverTrigger,
16
+ Close as PopoverClose
17
+ };