enzostvs HF Staff commited on
Commit
0eac98b
·
1 Parent(s): 59c9d94

run prettier

Browse files
Files changed (48) hide show
  1. src/lib/chat/triggerAiCall.ts +14 -15
  2. src/lib/components/chat/Assistant.svelte +1 -4
  3. src/lib/components/ui/checkbox/index.ts +2 -2
  4. src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte +6 -8
  5. src/lib/components/ui/context-menu/context-menu-content.svelte +6 -6
  6. src/lib/components/ui/context-menu/context-menu-group-heading.svelte +3 -3
  7. src/lib/components/ui/context-menu/context-menu-group.svelte +1 -1
  8. src/lib/components/ui/context-menu/context-menu-label.svelte +3 -3
  9. src/lib/components/ui/context-menu/context-menu-portal.svelte +1 -1
  10. src/lib/components/ui/context-menu/context-menu-radio-group.svelte +2 -2
  11. src/lib/components/ui/context-menu/context-menu-radio-item.svelte +5 -7
  12. src/lib/components/ui/context-menu/context-menu-separator.svelte +3 -3
  13. src/lib/components/ui/context-menu/context-menu-shortcut.svelte +3 -3
  14. src/lib/components/ui/context-menu/context-menu-sub-content.svelte +3 -3
  15. src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte +4 -4
  16. src/lib/components/ui/context-menu/context-menu-sub.svelte +1 -1
  17. src/lib/components/ui/context-menu/context-menu-trigger.svelte +1 -1
  18. src/lib/components/ui/context-menu/context-menu.svelte +1 -1
  19. src/lib/components/ui/context-menu/index.ts +17 -17
  20. src/lib/components/ui/input/index.ts +2 -2
  21. src/lib/components/ui/input/input.svelte +13 -13
  22. src/lib/components/ui/popover/index.ts +6 -6
  23. src/lib/components/ui/popover/popover-close.svelte +1 -1
  24. src/lib/components/ui/popover/popover-content.svelte +6 -6
  25. src/lib/components/ui/popover/popover-portal.svelte +1 -1
  26. src/lib/components/ui/popover/popover-trigger.svelte +3 -3
  27. src/lib/components/ui/popover/popover.svelte +1 -1
  28. src/lib/components/ui/select/index.ts +12 -12
  29. src/lib/components/ui/select/select-content.svelte +9 -9
  30. src/lib/components/ui/select/select-group-heading.svelte +4 -4
  31. src/lib/components/ui/select/select-group.svelte +1 -1
  32. src/lib/components/ui/select/select-label.svelte +3 -3
  33. src/lib/components/ui/select/select-portal.svelte +1 -1
  34. src/lib/components/ui/select/select-scroll-down-button.svelte +4 -4
  35. src/lib/components/ui/select/select-scroll-up-button.svelte +4 -4
  36. src/lib/components/ui/select/select-separator.svelte +4 -4
  37. src/lib/components/ui/select/select-trigger.svelte +6 -6
  38. src/lib/components/ui/select/select.svelte +1 -1
  39. src/lib/components/ui/separator/index.ts +2 -2
  40. src/lib/components/ui/separator/separator.svelte +4 -4
  41. src/lib/components/ui/slider/index.ts +2 -2
  42. src/lib/components/ui/slider/slider.svelte +7 -7
  43. src/lib/components/ui/tooltip/index.ts +6 -6
  44. src/lib/components/ui/tooltip/tooltip-content.svelte +12 -12
  45. src/lib/components/ui/tooltip/tooltip-portal.svelte +1 -1
  46. src/lib/components/ui/tooltip/tooltip-provider.svelte +1 -1
  47. src/lib/components/ui/tooltip/tooltip-trigger.svelte +1 -1
  48. src/lib/components/ui/tooltip/tooltip.svelte +1 -1
src/lib/chat/triggerAiCall.ts CHANGED
@@ -11,11 +11,7 @@ export interface TriggerAiCallContext {
11
  authToken: string;
12
  billingOption: string;
13
  abortSignal: AbortSignal | undefined;
14
- updateNodeData: (
15
- id: string,
16
- data: Record<string, unknown>,
17
- opts?: { replace?: boolean }
18
- ) => void;
19
  updateNodes: (fn: (nodes: Node[]) => Node[]) => void;
20
  updateEdges: (fn: (edges: Edge[]) => Edge[]) => void;
21
  onLoadingChange: (loading: boolean) => void;
@@ -32,8 +28,7 @@ function formatMessagesForModel(messages: ChatMessage[], modelId: string) {
32
  typeof modelData === 'object' && modelData && 'content' in modelData
33
  ? modelData.content
34
  : (Object.values(message).find(
35
- (m): m is { content: string } =>
36
- typeof m === 'object' && m !== null && 'content' in m
37
  )?.content ?? '');
38
  return { role: 'assistant' as const, content };
39
  });
@@ -114,14 +109,18 @@ export async function triggerAiCall(ctx: TriggerAiCallContext): Promise<void> {
114
  }
115
  }
116
  const end = Date.now();
117
- updateNodeData(node.id, {
118
- ...node.data,
119
- content,
120
- timestamp: end - start,
121
- loading: false,
122
- messages,
123
- usage
124
- } as Record<string, unknown>, { replace: true });
 
 
 
 
125
  return { [model.id]: { content, timestamp: String(end - start) } };
126
  }
127
  content += decoder.decode(value, { stream: true });
 
11
  authToken: string;
12
  billingOption: string;
13
  abortSignal: AbortSignal | undefined;
14
+ updateNodeData: (id: string, data: Record<string, unknown>, opts?: { replace?: boolean }) => void;
 
 
 
 
15
  updateNodes: (fn: (nodes: Node[]) => Node[]) => void;
16
  updateEdges: (fn: (edges: Edge[]) => Edge[]) => void;
17
  onLoadingChange: (loading: boolean) => void;
 
28
  typeof modelData === 'object' && modelData && 'content' in modelData
29
  ? modelData.content
30
  : (Object.values(message).find(
31
+ (m): m is { content: string } => typeof m === 'object' && m !== null && 'content' in m
 
32
  )?.content ?? '');
33
  return { role: 'assistant' as const, content };
34
  });
 
109
  }
110
  }
111
  const end = Date.now();
112
+ updateNodeData(
113
+ node.id,
114
+ {
115
+ ...node.data,
116
+ content,
117
+ timestamp: end - start,
118
+ loading: false,
119
+ messages,
120
+ usage
121
+ } as Record<string, unknown>,
122
+ { replace: true }
123
+ );
124
  return { [model.id]: { content, timestamp: String(end - start) } };
125
  }
126
  content += decoder.decode(value, { stream: true });
src/lib/components/chat/Assistant.svelte CHANGED
@@ -148,10 +148,7 @@
148
  <div class="mt-3 flex items-center justify-between gap-2 border-t border-border pt-3">
149
  <p class="text-xs text-muted-foreground">
150
  {usage.total_tokens} tokens
151
- {#if formatUsageCost(
152
- selectedModel.providers.find((p) => p.provider === provider)?.pricing,
153
- usage
154
- )}
155
  <span class="mx-0.5">&middot;</span>
156
  {formatUsageCost(
157
  selectedModel.providers.find((p) => p.provider === provider)?.pricing,
 
148
  <div class="mt-3 flex items-center justify-between gap-2 border-t border-border pt-3">
149
  <p class="text-xs text-muted-foreground">
150
  {usage.total_tokens} tokens
151
+ {#if formatUsageCost(selectedModel.providers.find((p) => p.provider === provider)?.pricing, usage)}
 
 
 
152
  <span class="mx-0.5">&middot;</span>
153
  {formatUsageCost(
154
  selectedModel.providers.find((p) => p.provider === provider)?.pricing,
src/lib/components/ui/checkbox/index.ts CHANGED
@@ -1,6 +1,6 @@
1
- import Root from "./checkbox.svelte";
2
  export {
3
  Root,
4
  //
5
- Root as Checkbox,
6
  };
 
1
+ import Root from './checkbox.svelte';
2
  export {
3
  Root,
4
  //
5
+ Root as Checkbox
6
  };
src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte CHANGED
@@ -1,8 +1,8 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
- import CheckIcon from "@lucide/svelte/icons/check";
4
- import { cn, type WithoutChildrenOrChild } from "$lib/utils.js";
5
- import type { Snippet } from "svelte";
6
 
7
  let {
8
  ref = $bindable(null),
@@ -22,15 +22,13 @@
22
  bind:indeterminate
23
  data-slot="context-menu-checkbox-item"
24
  class={cn(
25
- "data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
26
  className
27
  )}
28
  {...restProps}
29
  >
30
  {#snippet children({ checked })}
31
- <span
32
- class="pointer-events-none absolute start-2 flex size-3.5 items-center justify-center"
33
- >
34
  {#if checked}
35
  <CheckIcon class="size-4" />
36
  {/if}
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
+ import CheckIcon from '@lucide/svelte/icons/check';
4
+ import { cn, type WithoutChildrenOrChild } from '$lib/utils.js';
5
+ import type { Snippet } from 'svelte';
6
 
7
  let {
8
  ref = $bindable(null),
 
22
  bind:indeterminate
23
  data-slot="context-menu-checkbox-item"
24
  class={cn(
25
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
26
  className
27
  )}
28
  {...restProps}
29
  >
30
  {#snippet children({ checked })}
31
+ <span class="pointer-events-none absolute start-2 flex size-3.5 items-center justify-center">
 
 
32
  {#if checked}
33
  <CheckIcon class="size-4" />
34
  {/if}
src/lib/components/ui/context-menu/context-menu-content.svelte CHANGED
@@ -1,9 +1,9 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
- import { cn } from "$lib/utils.js";
4
- import ContextMenuPortal from "./context-menu-portal.svelte";
5
- import type { ComponentProps } from "svelte";
6
- import type { WithoutChildrenOrChild } from "$lib/utils.js";
7
 
8
  let {
9
  ref = $bindable(null),
@@ -20,7 +20,7 @@
20
  bind:ref
21
  data-slot="context-menu-content"
22
  class={cn(
23
- "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-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--bits-context-menu-content-available-height) min-w-[8rem] origin-(--bits-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
24
  className
25
  )}
26
  {...restProps}
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '$lib/utils.js';
4
+ import ContextMenuPortal from './context-menu-portal.svelte';
5
+ import type { ComponentProps } from 'svelte';
6
+ import type { WithoutChildrenOrChild } from '$lib/utils.js';
7
 
8
  let {
9
  ref = $bindable(null),
 
20
  bind:ref
21
  data-slot="context-menu-content"
22
  class={cn(
23
+ 'z-50 max-h-(--bits-context-menu-content-available-height) min-w-[8rem] origin-(--bits-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
24
  className
25
  )}
26
  {...restProps}
src/lib/components/ui/context-menu/context-menu-group-heading.svelte CHANGED
@@ -1,6 +1,6 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
- import { cn } from "$lib/utils.js";
4
 
5
  let {
6
  ref = $bindable(null),
@@ -16,6 +16,6 @@
16
  bind:ref
17
  data-slot="context-menu-group-heading"
18
  data-inset={inset}
19
- class={cn("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:ps-8", className)}
20
  {...restProps}
21
  />
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '$lib/utils.js';
4
 
5
  let {
6
  ref = $bindable(null),
 
16
  bind:ref
17
  data-slot="context-menu-group-heading"
18
  data-inset={inset}
19
+ class={cn('px-2 py-1.5 text-sm font-medium text-foreground data-[inset]:ps-8', className)}
20
  {...restProps}
21
  />
src/lib/components/ui/context-menu/context-menu-group.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
 
4
  let { ref = $bindable(null), ...restProps }: ContextMenuPrimitive.GroupProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
 
4
  let { ref = $bindable(null), ...restProps }: ContextMenuPrimitive.GroupProps = $props();
5
  </script>
src/lib/components/ui/context-menu/context-menu-label.svelte CHANGED
@@ -1,6 +1,6 @@
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),
@@ -17,7 +17,7 @@
17
  bind:this={ref}
18
  data-slot="context-menu-label"
19
  data-inset={inset}
20
- class={cn("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:ps-8", className)}
21
  {...restProps}
22
  >
23
  {@render children?.()}
 
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),
 
17
  bind:this={ref}
18
  data-slot="context-menu-label"
19
  data-inset={inset}
20
+ class={cn('px-2 py-1.5 text-sm font-medium text-foreground data-[inset]:ps-8', className)}
21
  {...restProps}
22
  >
23
  {@render children?.()}
src/lib/components/ui/context-menu/context-menu-portal.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
 
4
  let { ...restProps }: ContextMenuPrimitive.PortalProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
 
4
  let { ...restProps }: ContextMenuPrimitive.PortalProps = $props();
5
  </script>
src/lib/components/ui/context-menu/context-menu-radio-group.svelte CHANGED
@@ -1,9 +1,9 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
 
4
  let {
5
  ref = $bindable(null),
6
- value = $bindable(""),
7
  ...restProps
8
  }: ContextMenuPrimitive.RadioGroupProps = $props();
9
  </script>
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
 
4
  let {
5
  ref = $bindable(null),
6
+ value = $bindable(''),
7
  ...restProps
8
  }: ContextMenuPrimitive.RadioGroupProps = $props();
9
  </script>
src/lib/components/ui/context-menu/context-menu-radio-item.svelte CHANGED
@@ -1,7 +1,7 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } 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),
@@ -15,15 +15,13 @@
15
  bind:ref
16
  data-slot="context-menu-radio-item"
17
  class={cn(
18
- "data-highlighted:bg-accent data-highlighted:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
19
  className
20
  )}
21
  {...restProps}
22
  >
23
  {#snippet children({ checked })}
24
- <span
25
- class="pointer-events-none absolute start-2 flex size-3.5 items-center justify-center"
26
- >
27
  {#if checked}
28
  <CircleIcon class="size-2 fill-current" />
29
  {/if}
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } 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),
 
15
  bind:ref
16
  data-slot="context-menu-radio-item"
17
  class={cn(
18
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
19
  className
20
  )}
21
  {...restProps}
22
  >
23
  {#snippet children({ checked })}
24
+ <span class="pointer-events-none absolute start-2 flex size-3.5 items-center justify-center">
 
 
25
  {#if checked}
26
  <CircleIcon class="size-2 fill-current" />
27
  {/if}
src/lib/components/ui/context-menu/context-menu-separator.svelte CHANGED
@@ -1,6 +1,6 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
- import { cn } from "$lib/utils.js";
4
 
5
  let {
6
  ref = $bindable(null),
@@ -12,6 +12,6 @@
12
  <ContextMenuPrimitive.Separator
13
  bind:ref
14
  data-slot="context-menu-separator"
15
- class={cn("bg-border -mx-1 my-1 h-px", className)}
16
  {...restProps}
17
  />
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '$lib/utils.js';
4
 
5
  let {
6
  ref = $bindable(null),
 
12
  <ContextMenuPrimitive.Separator
13
  bind:ref
14
  data-slot="context-menu-separator"
15
+ class={cn('-mx-1 my-1 h-px bg-border', className)}
16
  {...restProps}
17
  />
src/lib/components/ui/context-menu/context-menu-shortcut.svelte CHANGED
@@ -1,6 +1,6 @@
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),
@@ -13,7 +13,7 @@
13
  <span
14
  bind:this={ref}
15
  data-slot="context-menu-shortcut"
16
- class={cn("text-muted-foreground ms-auto text-xs tracking-widest", className)}
17
  {...restProps}
18
  >
19
  {@render children?.()}
 
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),
 
13
  <span
14
  bind:this={ref}
15
  data-slot="context-menu-shortcut"
16
+ class={cn('ms-auto text-xs tracking-widest text-muted-foreground', className)}
17
  {...restProps}
18
  >
19
  {@render children?.()}
src/lib/components/ui/context-menu/context-menu-sub-content.svelte CHANGED
@@ -1,6 +1,6 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
- import { cn } from "$lib/utils.js";
4
 
5
  let {
6
  ref = $bindable(null),
@@ -13,7 +13,7 @@
13
  bind:ref
14
  data-slot="context-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-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--bits-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
17
  className
18
  )}
19
  {...restProps}
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
+ import { cn } from '$lib/utils.js';
4
 
5
  let {
6
  ref = $bindable(null),
 
13
  bind:ref
14
  data-slot="context-menu-sub-content"
15
  class={cn(
16
+ 'z-50 min-w-[8rem] origin-(--bits-context-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
17
  className
18
  )}
19
  {...restProps}
src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte CHANGED
@@ -1,7 +1,7 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
- import ChevronRightIcon from "@lucide/svelte/icons/chevron-right";
4
- import { cn, type WithoutChild } from "$lib/utils.js";
5
 
6
  let {
7
  ref = $bindable(null),
@@ -19,7 +19,7 @@
19
  data-slot="context-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 [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
23
  className
24
  )}
25
  {...restProps}
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
+ import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
4
+ import { cn, type WithoutChild } from '$lib/utils.js';
5
 
6
  let {
7
  ref = $bindable(null),
 
19
  data-slot="context-menu-sub-trigger"
20
  data-inset={inset}
21
  class={cn(
22
+ "flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
23
  className
24
  )}
25
  {...restProps}
src/lib/components/ui/context-menu/context-menu-sub.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
 
4
  let { open = $bindable(false), ...restProps }: ContextMenuPrimitive.SubProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
 
4
  let { open = $bindable(false), ...restProps }: ContextMenuPrimitive.SubProps = $props();
5
  </script>
src/lib/components/ui/context-menu/context-menu-trigger.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
 
4
  let { ref = $bindable(null), ...restProps }: ContextMenuPrimitive.TriggerProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
 
4
  let { ref = $bindable(null), ...restProps }: ContextMenuPrimitive.TriggerProps = $props();
5
  </script>
src/lib/components/ui/context-menu/context-menu.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
3
 
4
  let { open = $bindable(false), ...restProps }: ContextMenuPrimitive.RootProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui';
3
 
4
  let { open = $bindable(false), ...restProps }: ContextMenuPrimitive.RootProps = $props();
5
  </script>
src/lib/components/ui/context-menu/index.ts CHANGED
@@ -1,19 +1,19 @@
1
- import Root from "./context-menu.svelte";
2
- import Sub from "./context-menu-sub.svelte";
3
- import Portal from "./context-menu-portal.svelte";
4
- import Trigger from "./context-menu-trigger.svelte";
5
- import Group from "./context-menu-group.svelte";
6
- import RadioGroup from "./context-menu-radio-group.svelte";
7
- import Item from "./context-menu-item.svelte";
8
- import GroupHeading from "./context-menu-group-heading.svelte";
9
- import Content from "./context-menu-content.svelte";
10
- import Shortcut from "./context-menu-shortcut.svelte";
11
- import RadioItem from "./context-menu-radio-item.svelte";
12
- import Separator from "./context-menu-separator.svelte";
13
- import SubContent from "./context-menu-sub-content.svelte";
14
- import SubTrigger from "./context-menu-sub-trigger.svelte";
15
- import CheckboxItem from "./context-menu-checkbox-item.svelte";
16
- import Label from "./context-menu-label.svelte";
17
 
18
  export {
19
  Root,
@@ -48,5 +48,5 @@ export {
48
  SubContent as ContextMenuSubContent,
49
  SubTrigger as ContextMenuSubTrigger,
50
  CheckboxItem as ContextMenuCheckboxItem,
51
- Label as ContextMenuLabel,
52
  };
 
1
+ import Root from './context-menu.svelte';
2
+ import Sub from './context-menu-sub.svelte';
3
+ import Portal from './context-menu-portal.svelte';
4
+ import Trigger from './context-menu-trigger.svelte';
5
+ import Group from './context-menu-group.svelte';
6
+ import RadioGroup from './context-menu-radio-group.svelte';
7
+ import Item from './context-menu-item.svelte';
8
+ import GroupHeading from './context-menu-group-heading.svelte';
9
+ import Content from './context-menu-content.svelte';
10
+ import Shortcut from './context-menu-shortcut.svelte';
11
+ import RadioItem from './context-menu-radio-item.svelte';
12
+ import Separator from './context-menu-separator.svelte';
13
+ import SubContent from './context-menu-sub-content.svelte';
14
+ import SubTrigger from './context-menu-sub-trigger.svelte';
15
+ import CheckboxItem from './context-menu-checkbox-item.svelte';
16
+ import Label from './context-menu-label.svelte';
17
 
18
  export {
19
  Root,
 
48
  SubContent as ContextMenuSubContent,
49
  SubTrigger as ContextMenuSubTrigger,
50
  CheckboxItem as ContextMenuCheckboxItem,
51
+ Label as ContextMenuLabel
52
  };
src/lib/components/ui/input/index.ts CHANGED
@@ -1,7 +1,7 @@
1
- import Root from "./input.svelte";
2
 
3
  export {
4
  Root,
5
  //
6
- Root as Input,
7
  };
 
1
+ import Root from './input.svelte';
2
 
3
  export {
4
  Root,
5
  //
6
+ Root as Input
7
  };
src/lib/components/ui/input/input.svelte CHANGED
@@ -1,12 +1,12 @@
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 {
@@ -15,19 +15,19 @@
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 flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs transition-[color,box-shadow] outline-none 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"
@@ -40,9 +40,9 @@
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 flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none 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}
 
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 {
 
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
+ 'flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30',
29
+ 'focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50',
30
+ 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',
31
  className
32
  )}
33
  type="file"
 
40
  bind:this={ref}
41
  data-slot={dataSlot}
42
  class={cn(
43
+ 'flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30',
44
+ 'focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50',
45
+ 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',
46
  className
47
  )}
48
  {type}
src/lib/components/ui/popover/index.ts CHANGED
@@ -1,8 +1,8 @@
1
- import Root from "./popover.svelte";
2
- import Close from "./popover-close.svelte";
3
- import Content from "./popover-content.svelte";
4
- import Trigger from "./popover-trigger.svelte";
5
- import Portal from "./popover-portal.svelte";
6
 
7
  export {
8
  Root,
@@ -15,5 +15,5 @@ export {
15
  Content as PopoverContent,
16
  Trigger as PopoverTrigger,
17
  Close as PopoverClose,
18
- Portal as PopoverPortal,
19
  };
 
1
+ import Root from './popover.svelte';
2
+ import Close from './popover-close.svelte';
3
+ import Content from './popover-content.svelte';
4
+ import Trigger from './popover-trigger.svelte';
5
+ import Portal from './popover-portal.svelte';
6
 
7
  export {
8
  Root,
 
15
  Content as PopoverContent,
16
  Trigger as PopoverTrigger,
17
  Close as PopoverClose,
18
+ Portal as PopoverPortal
19
  };
src/lib/components/ui/popover/popover-close.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Popover as PopoverPrimitive } from "bits-ui";
3
 
4
  let { ref = $bindable(null), ...restProps }: PopoverPrimitive.CloseProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Popover as PopoverPrimitive } from 'bits-ui';
3
 
4
  let { ref = $bindable(null), ...restProps }: PopoverPrimitive.CloseProps = $props();
5
  </script>
src/lib/components/ui/popover/popover-content.svelte CHANGED
@@ -1,14 +1,14 @@
1
  <script lang="ts">
2
- import { Popover as PopoverPrimitive } from "bits-ui";
3
- import PopoverPortal from "./popover-portal.svelte";
4
- import { cn, type WithoutChildrenOrChild } from "$lib/utils.js";
5
- import type { ComponentProps } from "svelte";
6
 
7
  let {
8
  ref = $bindable(null),
9
  class: className,
10
  sideOffset = 4,
11
- align = "center",
12
  portalProps,
13
  ...restProps
14
  }: PopoverPrimitive.ContentProps & {
@@ -23,7 +23,7 @@
23
  {sideOffset}
24
  {align}
25
  class={cn(
26
- "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-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--bits-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
27
  className
28
  )}
29
  {...restProps}
 
1
  <script lang="ts">
2
+ import { Popover as PopoverPrimitive } from 'bits-ui';
3
+ import PopoverPortal from './popover-portal.svelte';
4
+ import { cn, type WithoutChildrenOrChild } from '$lib/utils.js';
5
+ import type { ComponentProps } from 'svelte';
6
 
7
  let {
8
  ref = $bindable(null),
9
  class: className,
10
  sideOffset = 4,
11
+ align = 'center',
12
  portalProps,
13
  ...restProps
14
  }: PopoverPrimitive.ContentProps & {
 
23
  {sideOffset}
24
  {align}
25
  class={cn(
26
+ 'z-50 w-72 origin-(--bits-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
27
  className
28
  )}
29
  {...restProps}
src/lib/components/ui/popover/popover-portal.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Popover as PopoverPrimitive } from "bits-ui";
3
 
4
  let { ...restProps }: PopoverPrimitive.PortalProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Popover as PopoverPrimitive } from 'bits-ui';
3
 
4
  let { ...restProps }: PopoverPrimitive.PortalProps = $props();
5
  </script>
src/lib/components/ui/popover/popover-trigger.svelte CHANGED
@@ -1,6 +1,6 @@
1
  <script lang="ts">
2
- import { cn } from "$lib/utils.js";
3
- import { Popover as PopoverPrimitive } from "bits-ui";
4
 
5
  let {
6
  ref = $bindable(null),
@@ -12,6 +12,6 @@
12
  <PopoverPrimitive.Trigger
13
  bind:ref
14
  data-slot="popover-trigger"
15
- class={cn("", className)}
16
  {...restProps}
17
  />
 
1
  <script lang="ts">
2
+ import { cn } from '$lib/utils.js';
3
+ import { Popover as PopoverPrimitive } from 'bits-ui';
4
 
5
  let {
6
  ref = $bindable(null),
 
12
  <PopoverPrimitive.Trigger
13
  bind:ref
14
  data-slot="popover-trigger"
15
+ class={cn('', className)}
16
  {...restProps}
17
  />
src/lib/components/ui/popover/popover.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Popover as PopoverPrimitive } from "bits-ui";
3
 
4
  let { open = $bindable(false), ...restProps }: PopoverPrimitive.RootProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Popover as PopoverPrimitive } from 'bits-ui';
3
 
4
  let { open = $bindable(false), ...restProps }: PopoverPrimitive.RootProps = $props();
5
  </script>
src/lib/components/ui/select/index.ts CHANGED
@@ -1,14 +1,14 @@
1
- import Root from "./select.svelte";
2
- import Group from "./select-group.svelte";
3
- import Label from "./select-label.svelte";
4
- import Item from "./select-item.svelte";
5
- import Content from "./select-content.svelte";
6
- import Trigger from "./select-trigger.svelte";
7
- import Separator from "./select-separator.svelte";
8
- import ScrollDownButton from "./select-scroll-down-button.svelte";
9
- import ScrollUpButton from "./select-scroll-up-button.svelte";
10
- import GroupHeading from "./select-group-heading.svelte";
11
- import Portal from "./select-portal.svelte";
12
 
13
  export {
14
  Root,
@@ -33,5 +33,5 @@ export {
33
  ScrollDownButton as SelectScrollDownButton,
34
  ScrollUpButton as SelectScrollUpButton,
35
  GroupHeading as SelectGroupHeading,
36
- Portal as SelectPortal,
37
  };
 
1
+ import Root from './select.svelte';
2
+ import Group from './select-group.svelte';
3
+ import Label from './select-label.svelte';
4
+ import Item from './select-item.svelte';
5
+ import Content from './select-content.svelte';
6
+ import Trigger from './select-trigger.svelte';
7
+ import Separator from './select-separator.svelte';
8
+ import ScrollDownButton from './select-scroll-down-button.svelte';
9
+ import ScrollUpButton from './select-scroll-up-button.svelte';
10
+ import GroupHeading from './select-group-heading.svelte';
11
+ import Portal from './select-portal.svelte';
12
 
13
  export {
14
  Root,
 
33
  ScrollDownButton as SelectScrollDownButton,
34
  ScrollUpButton as SelectScrollUpButton,
35
  GroupHeading as SelectGroupHeading,
36
+ Portal as SelectPortal
37
  };
src/lib/components/ui/select/select-content.svelte CHANGED
@@ -1,11 +1,11 @@
1
  <script lang="ts">
2
- import { Select as SelectPrimitive } from "bits-ui";
3
- import SelectPortal from "./select-portal.svelte";
4
- import SelectScrollUpButton from "./select-scroll-up-button.svelte";
5
- import SelectScrollDownButton from "./select-scroll-down-button.svelte";
6
- import { cn, type WithoutChild } from "$lib/utils.js";
7
- import type { ComponentProps } from "svelte";
8
- import type { WithoutChildrenOrChild } from "$lib/utils.js";
9
 
10
  let {
11
  ref = $bindable(null),
@@ -27,7 +27,7 @@
27
  {preventScroll}
28
  data-slot="select-content"
29
  class={cn(
30
- "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-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
31
  className
32
  )}
33
  {...restProps}
@@ -35,7 +35,7 @@
35
  <SelectScrollUpButton />
36
  <SelectPrimitive.Viewport
37
  class={cn(
38
- "h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1"
39
  )}
40
  >
41
  {@render children?.()}
 
1
  <script lang="ts">
2
+ import { Select as SelectPrimitive } from 'bits-ui';
3
+ import SelectPortal from './select-portal.svelte';
4
+ import SelectScrollUpButton from './select-scroll-up-button.svelte';
5
+ import SelectScrollDownButton from './select-scroll-down-button.svelte';
6
+ import { cn, type WithoutChild } from '$lib/utils.js';
7
+ import type { ComponentProps } from 'svelte';
8
+ import type { WithoutChildrenOrChild } from '$lib/utils.js';
9
 
10
  let {
11
  ref = $bindable(null),
 
27
  {preventScroll}
28
  data-slot="select-content"
29
  class={cn(
30
+ 'relative z-50 max-h-(--bits-select-content-available-height) min-w-[8rem] origin-(--bits-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:translate-y-1 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:-translate-x-1 data-[side=left]:slide-in-from-end-2 data-[side=right]:translate-x-1 data-[side=right]:slide-in-from-start-2 data-[side=top]:-translate-y-1 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
31
  className
32
  )}
33
  {...restProps}
 
35
  <SelectScrollUpButton />
36
  <SelectPrimitive.Viewport
37
  class={cn(
38
+ 'h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1'
39
  )}
40
  >
41
  {@render children?.()}
src/lib/components/ui/select/select-group-heading.svelte CHANGED
@@ -1,7 +1,7 @@
1
  <script lang="ts">
2
- import { Select as SelectPrimitive } from "bits-ui";
3
- import { cn } from "$lib/utils.js";
4
- import type { ComponentProps } from "svelte";
5
 
6
  let {
7
  ref = $bindable(null),
@@ -14,7 +14,7 @@
14
  <SelectPrimitive.GroupHeading
15
  bind:ref
16
  data-slot="select-group-heading"
17
- class={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
18
  {...restProps}
19
  >
20
  {@render children?.()}
 
1
  <script lang="ts">
2
+ import { Select as SelectPrimitive } from 'bits-ui';
3
+ import { cn } from '$lib/utils.js';
4
+ import type { ComponentProps } from 'svelte';
5
 
6
  let {
7
  ref = $bindable(null),
 
14
  <SelectPrimitive.GroupHeading
15
  bind:ref
16
  data-slot="select-group-heading"
17
+ class={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}
18
  {...restProps}
19
  >
20
  {@render children?.()}
src/lib/components/ui/select/select-group.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Select as SelectPrimitive } from "bits-ui";
3
 
4
  let { ref = $bindable(null), ...restProps }: SelectPrimitive.GroupProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Select as SelectPrimitive } from 'bits-ui';
3
 
4
  let { ref = $bindable(null), ...restProps }: SelectPrimitive.GroupProps = $props();
5
  </script>
src/lib/components/ui/select/select-label.svelte CHANGED
@@ -1,6 +1,6 @@
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),
@@ -13,7 +13,7 @@
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?.()}
 
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),
 
13
  <div
14
  bind:this={ref}
15
  data-slot="select-label"
16
+ class={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}
17
  {...restProps}
18
  >
19
  {@render children?.()}
src/lib/components/ui/select/select-portal.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Select as SelectPrimitive } from "bits-ui";
3
 
4
  let { ...restProps }: SelectPrimitive.PortalProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Select as SelectPrimitive } from 'bits-ui';
3
 
4
  let { ...restProps }: SelectPrimitive.PortalProps = $props();
5
  </script>
src/lib/components/ui/select/select-scroll-down-button.svelte CHANGED
@@ -1,7 +1,7 @@
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),
@@ -13,7 +13,7 @@
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" />
 
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),
 
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" />
src/lib/components/ui/select/select-scroll-up-button.svelte CHANGED
@@ -1,7 +1,7 @@
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),
@@ -13,7 +13,7 @@
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" />
 
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),
 
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" />
src/lib/components/ui/select/select-separator.svelte CHANGED
@@ -1,7 +1,7 @@
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),
@@ -13,6 +13,6 @@
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
  <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),
 
13
  <Separator
14
  bind:ref
15
  data-slot="select-separator"
16
+ class={cn('pointer-events-none -mx-1 my-1 h-px bg-border', className)}
17
  {...restProps}
18
  />
src/lib/components/ui/select/select-trigger.svelte CHANGED
@@ -1,16 +1,16 @@
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
 
@@ -19,7 +19,7 @@
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 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none select-none 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]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
23
  className
24
  )}
25
  {...restProps}
 
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
 
 
19
  data-slot="select-trigger"
20
  data-size={size}
21
  class={cn(
22
+ "flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground 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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
23
  className
24
  )}
25
  {...restProps}
src/lib/components/ui/select/select.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Select as SelectPrimitive } from "bits-ui";
3
 
4
  let {
5
  open = $bindable(false),
 
1
  <script lang="ts">
2
+ import { Select as SelectPrimitive } from 'bits-ui';
3
 
4
  let {
5
  open = $bindable(false),
src/lib/components/ui/separator/index.ts CHANGED
@@ -1,7 +1,7 @@
1
- import Root from "./separator.svelte";
2
 
3
  export {
4
  Root,
5
  //
6
- Root as Separator,
7
  };
 
1
+ import Root from './separator.svelte';
2
 
3
  export {
4
  Root,
5
  //
6
+ Root as Separator
7
  };
src/lib/components/ui/separator/separator.svelte CHANGED
@@ -1,11 +1,11 @@
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>
@@ -14,7 +14,7 @@
14
  bind:ref
15
  data-slot={dataSlot}
16
  class={cn(
17
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:min-h-full data-[orientation=vertical]:w-px",
18
  className
19
  )}
20
  {...restProps}
 
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>
 
14
  bind:ref
15
  data-slot={dataSlot}
16
  class={cn(
17
+ 'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:min-h-full data-[orientation=vertical]:w-px',
18
  className
19
  )}
20
  {...restProps}
src/lib/components/ui/slider/index.ts CHANGED
@@ -1,7 +1,7 @@
1
- import Root from "./slider.svelte";
2
 
3
  export {
4
  Root,
5
  //
6
- Root as Slider,
7
  };
 
1
+ import Root from './slider.svelte';
2
 
3
  export {
4
  Root,
5
  //
6
+ Root as Slider
7
  };
src/lib/components/ui/slider/slider.svelte CHANGED
@@ -1,11 +1,11 @@
1
  <script lang="ts">
2
- import { Slider as SliderPrimitive } from "bits-ui";
3
- import { cn, type WithoutChildrenOrChild } from "$lib/utils.js";
4
 
5
  let {
6
  ref = $bindable(null),
7
  value = $bindable(),
8
- orientation = "horizontal",
9
  class: className,
10
  ...restProps
11
  }: WithoutChildrenOrChild<SliderPrimitive.RootProps> = $props();
@@ -21,7 +21,7 @@ get along, so we shut typescript up by casting `value` to `never`.
21
  data-slot="slider"
22
  {orientation}
23
  class={cn(
24
- "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
25
  className
26
  )}
27
  {...restProps}
@@ -31,13 +31,13 @@ get along, so we shut typescript up by casting `value` to `never`.
31
  data-orientation={orientation}
32
  data-slot="slider-track"
33
  class={cn(
34
- "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
35
  )}
36
  >
37
  <SliderPrimitive.Range
38
  data-slot="slider-range"
39
  class={cn(
40
- "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
41
  )}
42
  />
43
  </span>
@@ -45,7 +45,7 @@ get along, so we shut typescript up by casting `value` to `never`.
45
  <SliderPrimitive.Thumb
46
  data-slot="slider-thumb"
47
  index={thumb}
48
- class="border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
49
  />
50
  {/each}
51
  {/snippet}
 
1
  <script lang="ts">
2
+ import { Slider as SliderPrimitive } from 'bits-ui';
3
+ import { cn, type WithoutChildrenOrChild } from '$lib/utils.js';
4
 
5
  let {
6
  ref = $bindable(null),
7
  value = $bindable(),
8
+ orientation = 'horizontal',
9
  class: className,
10
  ...restProps
11
  }: WithoutChildrenOrChild<SliderPrimitive.RootProps> = $props();
 
21
  data-slot="slider"
22
  {orientation}
23
  class={cn(
24
+ 'relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col',
25
  className
26
  )}
27
  {...restProps}
 
31
  data-orientation={orientation}
32
  data-slot="slider-track"
33
  class={cn(
34
+ 'relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5'
35
  )}
36
  >
37
  <SliderPrimitive.Range
38
  data-slot="slider-range"
39
  class={cn(
40
+ 'absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full'
41
  )}
42
  />
43
  </span>
 
45
  <SliderPrimitive.Thumb
46
  data-slot="slider-thumb"
47
  index={thumb}
48
+ class="block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
49
  />
50
  {/each}
51
  {/snippet}
src/lib/components/ui/tooltip/index.ts CHANGED
@@ -1,8 +1,8 @@
1
- import Root from "./tooltip.svelte";
2
- import Trigger from "./tooltip-trigger.svelte";
3
- import Content from "./tooltip-content.svelte";
4
- import Provider from "./tooltip-provider.svelte";
5
- import Portal from "./tooltip-portal.svelte";
6
 
7
  export {
8
  Root,
@@ -15,5 +15,5 @@ export {
15
  Content as TooltipContent,
16
  Trigger as TooltipTrigger,
17
  Provider as TooltipProvider,
18
- Portal as TooltipPortal,
19
  };
 
1
+ import Root from './tooltip.svelte';
2
+ import Trigger from './tooltip-trigger.svelte';
3
+ import Content from './tooltip-content.svelte';
4
+ import Provider from './tooltip-provider.svelte';
5
+ import Portal from './tooltip-portal.svelte';
6
 
7
  export {
8
  Root,
 
15
  Content as TooltipContent,
16
  Trigger as TooltipTrigger,
17
  Provider as TooltipProvider,
18
+ Portal as TooltipPortal
19
  };
src/lib/components/ui/tooltip/tooltip-content.svelte CHANGED
@@ -1,15 +1,15 @@
1
  <script lang="ts">
2
- import { Tooltip as TooltipPrimitive } from "bits-ui";
3
- import { cn } from "$lib/utils.js";
4
- import TooltipPortal from "./tooltip-portal.svelte";
5
- import type { ComponentProps } from "svelte";
6
- import type { WithoutChildrenOrChild } from "$lib/utils.js";
7
 
8
  let {
9
  ref = $bindable(null),
10
  class: className,
11
  sideOffset = 0,
12
- side = "top",
13
  children,
14
  arrowClasses,
15
  portalProps,
@@ -27,7 +27,7 @@
27
  {sideOffset}
28
  {side}
29
  class={cn(
30
- "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--bits-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
31
  className
32
  )}
33
  {...restProps}
@@ -37,11 +37,11 @@
37
  {#snippet child({ props })}
38
  <div
39
  class={cn(
40
- "bg-foreground z-50 size-2.5 rotate-45 rounded-[2px]",
41
- "data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_2px)]",
42
- "data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%_+_1px)]",
43
- "data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2",
44
- "data-[side=left]:-translate-y-[calc(50%_-_3px)]",
45
  arrowClasses
46
  )}
47
  {...props}
 
1
  <script lang="ts">
2
+ import { Tooltip as TooltipPrimitive } from 'bits-ui';
3
+ import { cn } from '$lib/utils.js';
4
+ import TooltipPortal from './tooltip-portal.svelte';
5
+ import type { ComponentProps } from 'svelte';
6
+ import type { WithoutChildrenOrChild } from '$lib/utils.js';
7
 
8
  let {
9
  ref = $bindable(null),
10
  class: className,
11
  sideOffset = 0,
12
+ side = 'top',
13
  children,
14
  arrowClasses,
15
  portalProps,
 
27
  {sideOffset}
28
  {side}
29
  class={cn(
30
+ 'z-50 w-fit origin-(--bits-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',
31
  className
32
  )}
33
  {...restProps}
 
37
  {#snippet child({ props })}
38
  <div
39
  class={cn(
40
+ 'z-50 size-2.5 rotate-45 rounded-[2px] bg-foreground',
41
+ 'data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_2px)]',
42
+ 'data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%_+_1px)]',
43
+ 'data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2',
44
+ 'data-[side=left]:-translate-y-[calc(50%_-_3px)]',
45
  arrowClasses
46
  )}
47
  {...props}
src/lib/components/ui/tooltip/tooltip-portal.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Tooltip as TooltipPrimitive } from "bits-ui";
3
 
4
  let { ...restProps }: TooltipPrimitive.PortalProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Tooltip as TooltipPrimitive } from 'bits-ui';
3
 
4
  let { ...restProps }: TooltipPrimitive.PortalProps = $props();
5
  </script>
src/lib/components/ui/tooltip/tooltip-provider.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Tooltip as TooltipPrimitive } from "bits-ui";
3
 
4
  let { ...restProps }: TooltipPrimitive.ProviderProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Tooltip as TooltipPrimitive } from 'bits-ui';
3
 
4
  let { ...restProps }: TooltipPrimitive.ProviderProps = $props();
5
  </script>
src/lib/components/ui/tooltip/tooltip-trigger.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Tooltip as TooltipPrimitive } from "bits-ui";
3
 
4
  let { ref = $bindable(null), ...restProps }: TooltipPrimitive.TriggerProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Tooltip as TooltipPrimitive } from 'bits-ui';
3
 
4
  let { ref = $bindable(null), ...restProps }: TooltipPrimitive.TriggerProps = $props();
5
  </script>
src/lib/components/ui/tooltip/tooltip.svelte CHANGED
@@ -1,5 +1,5 @@
1
  <script lang="ts">
2
- import { Tooltip as TooltipPrimitive } from "bits-ui";
3
 
4
  let { open = $bindable(false), ...restProps }: TooltipPrimitive.RootProps = $props();
5
  </script>
 
1
  <script lang="ts">
2
+ import { Tooltip as TooltipPrimitive } from 'bits-ui';
3
 
4
  let { open = $bindable(false), ...restProps }: TooltipPrimitive.RootProps = $props();
5
  </script>