@ouraihub/aether-ui 0.0.0-stage → 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 (179) hide show
  1. package/LICENSE +789 -0
  2. package/fixtures/model-classify.json +42 -0
  3. package/fixtures/pricing-cost.json +56 -0
  4. package/fixtures/reasoning-infer.json +44 -0
  5. package/fixtures/sse/anthropic-messages/chinese.sse +24 -0
  6. package/fixtures/sse/anthropic-messages/multi-tool.sse +33 -0
  7. package/fixtures/sse/anthropic-messages/single-tool.sse +39 -0
  8. package/fixtures/sse/anthropic-messages/text.sse +27 -0
  9. package/fixtures/sse/anthropic-messages/truncated.sse +21 -0
  10. package/fixtures/sse/anthropic-messages/upstream-error.sse +12 -0
  11. package/fixtures/sse/expect.json +20 -0
  12. package/fixtures/sse/openai-chat/chinese.sse +14 -0
  13. package/fixtures/sse/openai-chat/multi-tool.sse +18 -0
  14. package/fixtures/sse/openai-chat/single-tool.sse +22 -0
  15. package/fixtures/sse/openai-chat/text.sse +14 -0
  16. package/fixtures/sse/openai-chat/truncated.sse +12 -0
  17. package/fixtures/sse/openai-chat/upstream-error.sse +6 -0
  18. package/fixtures/sse/openai-responses/chinese.sse +33 -0
  19. package/fixtures/sse/openai-responses/multi-tool.sse +36 -0
  20. package/fixtures/sse/openai-responses/single-tool.sse +27 -0
  21. package/fixtures/sse/openai-responses/text.sse +33 -0
  22. package/fixtures/sse/openai-responses/truncated.sse +30 -0
  23. package/fixtures/sse/openai-responses/upstream-error.sse +9 -0
  24. package/package.json +71 -3
  25. package/src/CopyInput.svelte +33 -0
  26. package/src/KitNotifier.svelte +33 -0
  27. package/src/chat/ApprovalCard.svelte +23 -0
  28. package/src/chat/ChatPanel.svelte +2097 -0
  29. package/src/chat/MessageItem.svelte +583 -0
  30. package/src/chat/SkillPicker.svelte +126 -0
  31. package/src/chat/ToolCallItem.svelte +23 -0
  32. package/src/chat/UsageDetails.svelte +138 -0
  33. package/src/chat/index.ts +2 -0
  34. package/src/chat/run-session.svelte.ts +556 -0
  35. package/src/components/ui/alert/alert-action.svelte +20 -0
  36. package/src/components/ui/alert/alert-description.svelte +23 -0
  37. package/src/components/ui/alert/alert-title.svelte +23 -0
  38. package/src/components/ui/alert/alert.svelte +43 -0
  39. package/src/components/ui/alert/index.ts +17 -0
  40. package/src/components/ui/alert-dialog/alert-dialog-action.svelte +27 -0
  41. package/src/components/ui/alert-dialog/alert-dialog-cancel.svelte +27 -0
  42. package/src/components/ui/alert-dialog/alert-dialog-content.svelte +32 -0
  43. package/src/components/ui/alert-dialog/alert-dialog-description.svelte +17 -0
  44. package/src/components/ui/alert-dialog/alert-dialog-footer.svelte +23 -0
  45. package/src/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
  46. package/src/components/ui/alert-dialog/alert-dialog-media.svelte +20 -0
  47. package/src/components/ui/alert-dialog/alert-dialog-overlay.svelte +17 -0
  48. package/src/components/ui/alert-dialog/alert-dialog-portal.svelte +7 -0
  49. package/src/components/ui/alert-dialog/alert-dialog-title.svelte +17 -0
  50. package/src/components/ui/alert-dialog/alert-dialog-trigger.svelte +7 -0
  51. package/src/components/ui/alert-dialog/alert-dialog.svelte +7 -0
  52. package/src/components/ui/alert-dialog/index.ts +40 -0
  53. package/src/components/ui/button/button.svelte +81 -0
  54. package/src/components/ui/button/index.ts +17 -0
  55. package/src/components/ui/dialog/dialog-close.svelte +11 -0
  56. package/src/components/ui/dialog/dialog-content.svelte +48 -0
  57. package/src/components/ui/dialog/dialog-description.svelte +17 -0
  58. package/src/components/ui/dialog/dialog-footer.svelte +32 -0
  59. package/src/components/ui/dialog/dialog-header.svelte +20 -0
  60. package/src/components/ui/dialog/dialog-overlay.svelte +17 -0
  61. package/src/components/ui/dialog/dialog-portal.svelte +7 -0
  62. package/src/components/ui/dialog/dialog-title.svelte +17 -0
  63. package/src/components/ui/dialog/dialog-trigger.svelte +11 -0
  64. package/src/components/ui/dialog/dialog.svelte +7 -0
  65. package/src/components/ui/dialog/index.ts +34 -0
  66. package/src/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
  67. package/src/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +46 -0
  68. package/src/components/ui/dropdown-menu/dropdown-menu-content.svelte +31 -0
  69. package/src/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
  70. package/src/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
  71. package/src/components/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
  72. package/src/components/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
  73. package/src/components/ui/dropdown-menu/dropdown-menu-portal.svelte +7 -0
  74. package/src/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +17 -0
  75. package/src/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +36 -0
  76. package/src/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
  77. package/src/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
  78. package/src/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +31 -0
  79. package/src/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
  80. package/src/components/ui/dropdown-menu/dropdown-menu-sub.svelte +7 -0
  81. package/src/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
  82. package/src/components/ui/dropdown-menu/dropdown-menu.svelte +7 -0
  83. package/src/components/ui/dropdown-menu/index.ts +54 -0
  84. package/src/components/ui/empty/empty-content.svelte +23 -0
  85. package/src/components/ui/empty/empty-description.svelte +23 -0
  86. package/src/components/ui/empty/empty-header.svelte +20 -0
  87. package/src/components/ui/empty/empty-media.svelte +41 -0
  88. package/src/components/ui/empty/empty-title.svelte +20 -0
  89. package/src/components/ui/empty/empty.svelte +23 -0
  90. package/src/components/ui/empty/index.ts +22 -0
  91. package/src/components/ui/field/field-content.svelte +20 -0
  92. package/src/components/ui/field/field-description.svelte +25 -0
  93. package/src/components/ui/field/field-error.svelte +58 -0
  94. package/src/components/ui/field/field-group.svelte +23 -0
  95. package/src/components/ui/field/field-label.svelte +25 -0
  96. package/src/components/ui/field/field-legend.svelte +24 -0
  97. package/src/components/ui/field/field-separator.svelte +35 -0
  98. package/src/components/ui/field/field-set.svelte +20 -0
  99. package/src/components/ui/field/field-title.svelte +20 -0
  100. package/src/components/ui/field/field.svelte +47 -0
  101. package/src/components/ui/field/index.ts +33 -0
  102. package/src/components/ui/input/index.ts +7 -0
  103. package/src/components/ui/input/input.svelte +48 -0
  104. package/src/components/ui/label/index.ts +7 -0
  105. package/src/components/ui/label/label.svelte +20 -0
  106. package/src/components/ui/select/index.ts +40 -0
  107. package/src/components/ui/select/select-content.svelte +45 -0
  108. package/src/components/ui/select/select-group-heading.svelte +21 -0
  109. package/src/components/ui/select/select-group.svelte +17 -0
  110. package/src/components/ui/select/select-item.svelte +43 -0
  111. package/src/components/ui/select/select-label.svelte +20 -0
  112. package/src/components/ui/select/select-portal.svelte +7 -0
  113. package/src/components/ui/select/select-scroll-down-button.svelte +20 -0
  114. package/src/components/ui/select/select-scroll-up-button.svelte +20 -0
  115. package/src/components/ui/select/select-separator.svelte +18 -0
  116. package/src/components/ui/select/select-trigger.svelte +29 -0
  117. package/src/components/ui/select/select-value.svelte +7 -0
  118. package/src/components/ui/select/select.svelte +11 -0
  119. package/src/components/ui/separator/index.ts +7 -0
  120. package/src/components/ui/separator/separator.svelte +21 -0
  121. package/src/components/ui/sonner/index.ts +1 -0
  122. package/src/components/ui/sonner/sonner.svelte +40 -0
  123. package/src/components/ui/switch/index.ts +7 -0
  124. package/src/components/ui/switch/switch.svelte +34 -0
  125. package/src/components/ui/textarea/index.ts +7 -0
  126. package/src/components/ui/textarea/textarea.svelte +22 -0
  127. package/src/context.ts +34 -0
  128. package/src/dev/Demo.svelte +45 -0
  129. package/src/dev/main.ts +7 -0
  130. package/src/i18n/en.ts +617 -0
  131. package/src/i18n/index.ts +23 -0
  132. package/src/i18n/zh-CN.ts +599 -0
  133. package/src/index.ts +10 -0
  134. package/src/logs/LogPanel.svelte +97 -0
  135. package/src/logs/LogSettings.svelte +56 -0
  136. package/src/logs/index.ts +5 -0
  137. package/src/logs/logger.ts +96 -0
  138. package/src/markdown.ts +8 -0
  139. package/src/mcp/McpClientSettings.svelte +491 -0
  140. package/src/mcp/McpServerSettings.svelte +327 -0
  141. package/src/mcp/config.ts +26 -0
  142. package/src/mcp/index.ts +3 -0
  143. package/src/mcp/input.ts +73 -0
  144. package/src/notify.svelte.ts +43 -0
  145. package/src/ports/contract.ts +165 -0
  146. package/src/ports/fake.ts +484 -0
  147. package/src/ports/index.ts +7 -0
  148. package/src/ports/search.ts +47 -0
  149. package/src/ports/skill-sources.ts +45 -0
  150. package/src/providers/EndpointKeysDialog.svelte +343 -0
  151. package/src/providers/EndpointPanel.svelte +491 -0
  152. package/src/providers/ModelPickerDialog.svelte +187 -0
  153. package/src/providers/ModelSelect.svelte +434 -0
  154. package/src/providers/ModelSettingsDialog.svelte +453 -0
  155. package/src/providers/ProvidersSettings.svelte +631 -0
  156. package/src/providers/RequestConfigDialog.svelte +250 -0
  157. package/src/providers/SecretInput.svelte +276 -0
  158. package/src/providers/draft.ts +329 -0
  159. package/src/providers/edit-session.ts +146 -0
  160. package/src/providers/index.ts +5 -0
  161. package/src/providers/reasoning.ts +41 -0
  162. package/src/providers/revision.svelte.ts +4 -0
  163. package/src/search/SearchSettings.svelte +703 -0
  164. package/src/search/index.ts +13 -0
  165. package/src/search/settings-flow.ts +62 -0
  166. package/src/session.ts +20 -0
  167. package/src/skills/SkillAdd.svelte +347 -0
  168. package/src/skills/SkillAuthoring.svelte +381 -0
  169. package/src/skills/SkillEditor.svelte +94 -0
  170. package/src/skills/SkillPreviewDialog.svelte +122 -0
  171. package/src/skills/SkillsSettings.svelte +140 -0
  172. package/src/skills/error.ts +32 -0
  173. package/src/skills/index.ts +4 -0
  174. package/src/styles/kit.css +137 -0
  175. package/src/styles/tokens.css +22 -0
  176. package/src/tauri/index.ts +282 -0
  177. package/src/utils.ts +22 -0
  178. package/src/web/index.ts +376 -0
  179. package/README.md +0 -3
@@ -0,0 +1,46 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+ import MinusIcon from '@lucide/svelte/icons/minus';
4
+ import CheckIcon from '@lucide/svelte/icons/check';
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
+ closeOnSelect = false,
15
+ ...restProps
16
+ }: WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
17
+ children?: Snippet;
18
+ } = $props();
19
+ </script>
20
+
21
+ <DropdownMenuPrimitive.CheckboxItem
22
+ bind:ref
23
+ {closeOnSelect}
24
+ bind:checked
25
+ bind:indeterminate
26
+ data-slot="dropdown-menu-checkbox-item"
27
+ class={cn(
28
+ "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
29
+ className
30
+ )}
31
+ {...restProps}
32
+ >
33
+ {#snippet children({ checked, indeterminate })}
34
+ <span
35
+ class="absolute right-2 flex items-center justify-center pointer-events-none"
36
+ data-slot="dropdown-menu-checkbox-item-indicator"
37
+ >
38
+ {#if indeterminate}
39
+ <MinusIcon />
40
+ {:else if checked}
41
+ <CheckIcon />
42
+ {/if}
43
+ </span>
44
+ {@render childrenProp?.()}
45
+ {/snippet}
46
+ </DropdownMenuPrimitive.CheckboxItem>
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+ import { cn, type WithoutChildrenOrChild } from "#lib/utils.js";
4
+ import DropdownMenuPortal from "./dropdown-menu-portal.svelte";
5
+ import type { ComponentProps } from "svelte";
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ sideOffset = 4,
10
+ align = "start",
11
+ portalProps,
12
+ class: className,
13
+ ...restProps
14
+ }: DropdownMenuPrimitive.ContentProps & {
15
+ portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DropdownMenuPortal>>;
16
+ } = $props();
17
+ </script>
18
+
19
+ <DropdownMenuPortal {...portalProps}>
20
+ <DropdownMenuPrimitive.Content
21
+ bind:ref
22
+ data-slot="dropdown-menu-content"
23
+ {sideOffset}
24
+ {align}
25
+ class={cn(
26
+ "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--bits-dropdown-menu-content-available-height) w-(--bits-dropdown-menu-anchor-width) origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-closed:overflow-hidden",
27
+ className
28
+ )}
29
+ {...restProps}
30
+ />
31
+ </DropdownMenuPortal>
@@ -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("text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:pl-7", 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 { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+ import { cn } from "#lib/utils.js";
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
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_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("text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:pl-7", className)}
21
+ {...restProps}
22
+ >
23
+ {@render children?.()}
24
+ </div>
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+
4
+ let { ...restProps }: DropdownMenuPrimitive.PortalProps = $props();
5
+ </script>
6
+
7
+ <DropdownMenuPrimitive.Portal {...restProps} />
@@ -0,0 +1,17 @@
1
+ <!-- Local change: `value as never` like select.svelte, as exactOptionalPropertyTypes rejects the bound `string | undefined` (docs/04 §4). -->
2
+ <script lang="ts">
3
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ value = $bindable(),
8
+ ...restProps
9
+ }: DropdownMenuPrimitive.RadioGroupProps = $props();
10
+ </script>
11
+
12
+ <DropdownMenuPrimitive.RadioGroup
13
+ bind:ref
14
+ bind:value={value as never}
15
+ data-slot="dropdown-menu-radio-group"
16
+ {...restProps}
17
+ />
@@ -0,0 +1,36 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+ import CheckIcon from '@lucide/svelte/icons/check';
4
+ import { cn, type WithoutChild } from "#lib/utils.js";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children: childrenProp,
10
+ closeOnSelect = false,
11
+ ...restProps
12
+ }: WithoutChild<DropdownMenuPrimitive.RadioItemProps> = $props();
13
+ </script>
14
+
15
+ <DropdownMenuPrimitive.RadioItem
16
+ bind:ref
17
+ {closeOnSelect}
18
+ data-slot="dropdown-menu-radio-item"
19
+ class={cn(
20
+ "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
21
+ className
22
+ )}
23
+ {...restProps}
24
+ >
25
+ {#snippet children({ checked })}
26
+ <span
27
+ class="absolute right-2 flex items-center justify-center pointer-events-none"
28
+ data-slot="dropdown-menu-radio-item-indicator"
29
+ >
30
+ {#if checked}
31
+ <CheckIcon />
32
+ {/if}
33
+ </span>
34
+ {@render childrenProp?.({ checked })}
35
+ {/snippet}
36
+ </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 { cn, type WithElementRef } from "#lib/utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
11
+ </script>
12
+
13
+ <span
14
+ bind:this={ref}
15
+ data-slot="dropdown-menu-shortcut"
16
+ class={cn("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </span>
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+ import { cn, type WithoutChildrenOrChild } from "#lib/utils.js";
4
+ import DropdownMenuPortal from "./dropdown-menu-portal.svelte";
5
+ import type { ComponentProps } from "svelte";
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ class: className,
10
+ align = "start",
11
+ alignOffset = -3,
12
+ portalProps,
13
+ ...restProps
14
+ }: DropdownMenuPrimitive.SubContentProps & {
15
+ portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DropdownMenuPortal>>;
16
+ } = $props();
17
+ </script>
18
+
19
+ <DropdownMenuPortal {...portalProps}>
20
+ <DropdownMenuPrimitive.SubContent
21
+ bind:ref
22
+ data-slot="dropdown-menu-sub-content"
23
+ {align}
24
+ {alignOffset}
25
+ class={cn(
26
+ "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100 z-50 origin-(--bits-dropdown-menu-content-transform-origin) overflow-hidden",
27
+ className
28
+ )}
29
+ {...restProps}
30
+ />
31
+ </DropdownMenuPortal>
@@ -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
+ "focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
23
+ className
24
+ )}
25
+ {...restProps}
26
+ >
27
+ {@render children?.()}
28
+ <ChevronRightIcon class="cn-rtl-flip ml-auto" />
29
+ </DropdownMenuPrimitive.SubTrigger>
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+
4
+ let { open = $bindable(false), ...restProps }: DropdownMenuPrimitive.SubProps = $props();
5
+ </script>
6
+
7
+ <DropdownMenuPrimitive.Sub bind:open {...restProps} />
@@ -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,7 @@
1
+ <script lang="ts">
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
3
+
4
+ let { open = $bindable(false), ...restProps }: DropdownMenuPrimitive.RootProps = $props();
5
+ </script>
6
+
7
+ <DropdownMenuPrimitive.Root bind:open {...restProps} />
@@ -0,0 +1,54 @@
1
+ import CheckboxGroup from "./dropdown-menu-checkbox-group.svelte";
2
+ import CheckboxItem from "./dropdown-menu-checkbox-item.svelte";
3
+ import Content from "./dropdown-menu-content.svelte";
4
+ import GroupHeading from "./dropdown-menu-group-heading.svelte";
5
+ import Group from "./dropdown-menu-group.svelte";
6
+ import Item from "./dropdown-menu-item.svelte";
7
+ import Label from "./dropdown-menu-label.svelte";
8
+ import Portal from "./dropdown-menu-portal.svelte";
9
+ import RadioGroup from "./dropdown-menu-radio-group.svelte";
10
+ import RadioItem from "./dropdown-menu-radio-item.svelte";
11
+ import Separator from "./dropdown-menu-separator.svelte";
12
+ import Shortcut from "./dropdown-menu-shortcut.svelte";
13
+ import SubContent from "./dropdown-menu-sub-content.svelte";
14
+ import SubTrigger from "./dropdown-menu-sub-trigger.svelte";
15
+ import Sub from "./dropdown-menu-sub.svelte";
16
+ import Trigger from "./dropdown-menu-trigger.svelte";
17
+ import Root from "./dropdown-menu.svelte";
18
+
19
+ export {
20
+ CheckboxGroup,
21
+ CheckboxItem,
22
+ Content,
23
+ Portal,
24
+ Root as DropdownMenu,
25
+ CheckboxGroup as DropdownMenuCheckboxGroup,
26
+ CheckboxItem as DropdownMenuCheckboxItem,
27
+ Content as DropdownMenuContent,
28
+ Portal as DropdownMenuPortal,
29
+ Group as DropdownMenuGroup,
30
+ Item as DropdownMenuItem,
31
+ Label as DropdownMenuLabel,
32
+ RadioGroup as DropdownMenuRadioGroup,
33
+ RadioItem as DropdownMenuRadioItem,
34
+ Separator as DropdownMenuSeparator,
35
+ Shortcut as DropdownMenuShortcut,
36
+ Sub as DropdownMenuSub,
37
+ SubContent as DropdownMenuSubContent,
38
+ SubTrigger as DropdownMenuSubTrigger,
39
+ Trigger as DropdownMenuTrigger,
40
+ GroupHeading as DropdownMenuGroupHeading,
41
+ Group,
42
+ GroupHeading,
43
+ Item,
44
+ Label,
45
+ RadioGroup,
46
+ RadioItem,
47
+ Root,
48
+ Separator,
49
+ Shortcut,
50
+ Sub,
51
+ SubContent,
52
+ SubTrigger,
53
+ Trigger,
54
+ };
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "#lib/utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="empty-content"
16
+ class={cn(
17
+ "gap-2.5 text-kit-base flex w-full max-w-sm min-w-0 flex-col items-center text-balance",
18
+ className
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "#lib/utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="empty-description"
16
+ class={cn(
17
+ "text-kit-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
18
+ className
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -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="empty-header"
16
+ class={cn("gap-2 flex max-w-sm flex-col items-center", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,41 @@
1
+ <script lang="ts" module>
2
+ import { tv, type VariantProps } from "#lib/utils.js";
3
+
4
+ export const emptyMediaVariants = tv({
5
+ base: "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
6
+ variants: {
7
+ variant: {
8
+ default: "bg-transparent",
9
+ icon: "bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-kit [&_svg:not([class*='size-'])]:size-4",
10
+ },
11
+ },
12
+ defaultVariants: {
13
+ variant: "default",
14
+ },
15
+ });
16
+
17
+ export type EmptyMediaVariant = VariantProps<typeof emptyMediaVariants>["variant"];
18
+ </script>
19
+
20
+ <script lang="ts">
21
+ import { cn, type WithElementRef } from "#lib/utils.js";
22
+ import type { HTMLAttributes } from "svelte/elements";
23
+
24
+ let {
25
+ ref = $bindable(null),
26
+ class: className,
27
+ children,
28
+ variant = "default",
29
+ ...restProps
30
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> & { variant?: EmptyMediaVariant } = $props();
31
+ </script>
32
+
33
+ <div
34
+ bind:this={ref}
35
+ data-slot="empty-icon"
36
+ data-variant={variant}
37
+ class={cn(emptyMediaVariants({ variant }), className)}
38
+ {...restProps}
39
+ >
40
+ {@render children?.()}
41
+ </div>
@@ -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="empty-title"
16
+ class={cn("text-kit-base font-medium tracking-tight", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "#lib/utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="empty"
16
+ class={cn(
17
+ "gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance",
18
+ className
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,22 @@
1
+ import Content from "./empty-content.svelte";
2
+ import Description from "./empty-description.svelte";
3
+ import Header from "./empty-header.svelte";
4
+ import Media from "./empty-media.svelte";
5
+ import Title from "./empty-title.svelte";
6
+ import Root from "./empty.svelte";
7
+
8
+ export {
9
+ Root,
10
+ Header,
11
+ Media,
12
+ Title,
13
+ Description,
14
+ Content,
15
+ //
16
+ Root as Empty,
17
+ Header as EmptyHeader,
18
+ Media as EmptyMedia,
19
+ Title as EmptyTitle,
20
+ Description as EmptyDescription,
21
+ Content as EmptyContent,
22
+ };
@@ -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="field-content"
16
+ class={cn("gap-0.5 group/field-content flex flex-1 flex-col leading-snug", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,25 @@
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<HTMLParagraphElement>> = $props();
11
+ </script>
12
+
13
+ <p
14
+ bind:this={ref}
15
+ data-slot="field-description"
16
+ class={cn(
17
+ "text-muted-foreground text-left text-kit-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance",
18
+ "last:mt-0 nth-last-2:-mt-1",
19
+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
20
+ className
21
+ )}
22
+ {...restProps}
23
+ >
24
+ {@render children?.()}
25
+ </p>