svelte-docsmith 0.1.1 → 0.3.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.
- package/README.md +57 -25
- package/dist/clipboard.svelte.d.ts +1 -1
- package/dist/clipboard.svelte.js +15 -8
- package/dist/config.d.ts +41 -6
- package/dist/config.js +33 -7
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -0
- package/dist/markdown-layout.svelte +14 -1
- package/dist/markdown-layout.svelte.d.ts +2 -0
- package/dist/preprocess.d.ts +4 -5
- package/dist/preprocess.js +4 -5
- package/dist/search/context.svelte.d.ts +7 -0
- package/dist/search/context.svelte.js +20 -0
- package/dist/search/create-search.d.ts +14 -0
- package/dist/search/create-search.js +56 -0
- package/dist/search/snippet.d.ts +7 -0
- package/dist/search/snippet.js +43 -0
- package/dist/search.d.ts +10 -0
- package/dist/search.js +4 -0
- package/dist/theme.css +25 -0
- package/dist/themes/darkmatter.css +81 -0
- package/dist/types.d.ts +0 -6
- package/dist/ui/badge.svelte +10 -1
- package/dist/ui/badge.svelte.d.ts +2 -0
- package/dist/ui/callout.svelte +9 -9
- package/dist/ui/callout.svelte.d.ts +3 -3
- package/dist/ui/layouts/docs-footer.svelte +32 -6
- package/dist/ui/layouts/docs-header.svelte +5 -11
- package/dist/ui/layouts/docs-header.svelte.d.ts +0 -6
- package/dist/ui/layouts/docs-mobile-header.svelte +40 -8
- package/dist/ui/layouts/docs-mobile-header.svelte.d.ts +5 -4
- package/dist/ui/layouts/docs-shell.svelte +49 -5
- package/dist/ui/layouts/docs-shell.svelte.d.ts +16 -1
- package/dist/ui/layouts/error-page.svelte +82 -0
- package/dist/ui/layouts/error-page.svelte.d.ts +25 -0
- package/dist/ui/layouts/seo-head.svelte +65 -0
- package/dist/ui/layouts/seo-head.svelte.d.ts +11 -0
- package/dist/ui/markdown/h2.svelte +7 -3
- package/dist/ui/markdown/h3.svelte +7 -3
- package/dist/ui/markdown/pre.svelte +1 -1
- package/dist/ui/prop.svelte +71 -36
- package/dist/ui/prop.svelte.d.ts +1 -1
- package/dist/ui/props-table.svelte +10 -62
- package/dist/ui/search-trigger.svelte +31 -0
- package/dist/ui/search-trigger.svelte.d.ts +6 -0
- package/dist/ui/search.svelte +167 -0
- package/dist/ui/search.svelte.d.ts +13 -0
- package/dist/ui/shadcn/accordion/accordion.svelte.d.ts +1 -1
- package/dist/ui/shadcn/command/command-dialog.svelte +42 -0
- package/dist/ui/shadcn/command/command-dialog.svelte.d.ts +14 -0
- package/dist/ui/shadcn/command/command-empty.svelte +17 -0
- package/dist/ui/shadcn/command/command-empty.svelte.d.ts +4 -0
- package/dist/ui/shadcn/command/command-group.svelte +33 -0
- package/dist/ui/shadcn/command/command-group.svelte.d.ts +7 -0
- package/dist/ui/shadcn/command/command-input.svelte +36 -0
- package/dist/ui/shadcn/command/command-input.svelte.d.ts +4 -0
- package/dist/ui/shadcn/command/command-item.svelte +27 -0
- package/dist/ui/shadcn/command/command-item.svelte.d.ts +4 -0
- package/dist/ui/shadcn/command/command-link-item.svelte +20 -0
- package/dist/ui/shadcn/command/command-link-item.svelte.d.ts +4 -0
- package/dist/ui/shadcn/command/command-list.svelte +20 -0
- package/dist/ui/shadcn/command/command-list.svelte.d.ts +4 -0
- package/dist/ui/shadcn/command/command-loading.svelte +7 -0
- package/dist/ui/shadcn/command/command-loading.svelte.d.ts +4 -0
- package/dist/ui/shadcn/command/command-separator.svelte +17 -0
- package/dist/ui/shadcn/command/command-separator.svelte.d.ts +4 -0
- package/dist/ui/shadcn/command/command-shortcut.svelte +23 -0
- package/dist/ui/shadcn/command/command-shortcut.svelte.d.ts +5 -0
- package/dist/ui/shadcn/command/command.svelte +28 -0
- package/dist/ui/shadcn/command/command.svelte.d.ts +8 -0
- package/dist/ui/shadcn/command/index.d.ts +12 -0
- package/dist/ui/shadcn/command/index.js +14 -0
- package/dist/ui/shadcn/dialog/dialog-close.svelte +11 -0
- package/dist/ui/shadcn/dialog/dialog-close.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dialog/dialog-content.svelte +48 -0
- package/dist/ui/shadcn/dialog/dialog-content.svelte.d.ts +13 -0
- package/dist/ui/shadcn/dialog/dialog-description.svelte +20 -0
- package/dist/ui/shadcn/dialog/dialog-description.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dialog/dialog-footer.svelte +32 -0
- package/dist/ui/shadcn/dialog/dialog-footer.svelte.d.ts +8 -0
- package/dist/ui/shadcn/dialog/dialog-header.svelte +20 -0
- package/dist/ui/shadcn/dialog/dialog-header.svelte.d.ts +5 -0
- package/dist/ui/shadcn/dialog/dialog-overlay.svelte +20 -0
- package/dist/ui/shadcn/dialog/dialog-overlay.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dialog/dialog-portal.svelte +7 -0
- package/dist/ui/shadcn/dialog/dialog-portal.svelte.d.ts +3 -0
- package/dist/ui/shadcn/dialog/dialog-title.svelte +17 -0
- package/dist/ui/shadcn/dialog/dialog-title.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dialog/dialog-trigger.svelte +11 -0
- package/dist/ui/shadcn/dialog/dialog-trigger.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dialog/dialog.svelte +7 -0
- package/dist/ui/shadcn/dialog/dialog.svelte.d.ts +3 -0
- package/dist/ui/shadcn/dialog/index.d.ts +11 -0
- package/dist/ui/shadcn/dialog/index.js +13 -0
- package/dist/ui/shadcn/input/index.d.ts +2 -0
- package/dist/ui/shadcn/input/index.js +4 -0
- package/dist/ui/shadcn/input/input.svelte +48 -0
- package/dist/ui/shadcn/input/input.svelte.d.ts +13 -0
- package/dist/ui/shadcn/input-group/index.d.ts +7 -0
- package/dist/ui/shadcn/input-group/index.js +9 -0
- package/dist/ui/shadcn/input-group/input-group-addon.svelte +53 -0
- package/dist/ui/shadcn/input-group/input-group-addon.svelte.d.ts +32 -0
- package/dist/ui/shadcn/input-group/input-group-button.svelte +49 -0
- package/dist/ui/shadcn/input-group/input-group-button.svelte.d.ts +32 -0
- package/dist/ui/shadcn/input-group/input-group-input.svelte +23 -0
- package/dist/ui/shadcn/input-group/input-group-input.svelte.d.ts +11 -0
- package/dist/ui/shadcn/input-group/input-group-text.svelte +22 -0
- package/dist/ui/shadcn/input-group/input-group-text.svelte.d.ts +5 -0
- package/dist/ui/shadcn/input-group/input-group-textarea.svelte +23 -0
- package/dist/ui/shadcn/input-group/input-group-textarea.svelte.d.ts +3 -0
- package/dist/ui/shadcn/input-group/input-group.svelte +24 -0
- package/dist/ui/shadcn/input-group/input-group.svelte.d.ts +5 -0
- package/dist/ui/shadcn/tabs/tabs.svelte.d.ts +1 -1
- package/dist/ui/shadcn/textarea/index.d.ts +2 -0
- package/dist/ui/shadcn/textarea/index.js +4 -0
- package/dist/ui/shadcn/textarea/textarea.svelte +23 -0
- package/dist/ui/shadcn/textarea/textarea.svelte.d.ts +5 -0
- package/dist/ui/tab-item.svelte +35 -9
- package/dist/ui/tab-item.svelte.d.ts +9 -4
- package/dist/ui/tabs-phase.svelte +19 -0
- package/dist/ui/tabs-phase.svelte.d.ts +9 -0
- package/dist/ui/tabs.svelte +47 -24
- package/dist/ui/tabs.svelte.d.ts +16 -6
- package/dist/vite.d.ts +8 -6
- package/dist/vite.js +140 -47
- package/package.json +8 -2
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Command as CommandPrimitive, Dialog as DialogPrimitive } from 'bits-ui';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import Command from './command.svelte';
|
|
5
|
+
import * as Dialog from '../dialog/index.js';
|
|
6
|
+
import { cn, type WithoutChildrenOrChild } from '../../../shadcn.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
open = $bindable(false),
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
value = $bindable(''),
|
|
12
|
+
title = 'Command Palette',
|
|
13
|
+
description = 'Search for a command to run...',
|
|
14
|
+
showCloseButton = false,
|
|
15
|
+
portalProps,
|
|
16
|
+
children,
|
|
17
|
+
class: className,
|
|
18
|
+
...restProps
|
|
19
|
+
}: WithoutChildrenOrChild<DialogPrimitive.RootProps> &
|
|
20
|
+
WithoutChildrenOrChild<CommandPrimitive.RootProps> & {
|
|
21
|
+
portalProps?: DialogPrimitive.PortalProps;
|
|
22
|
+
children: Snippet;
|
|
23
|
+
title?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
showCloseButton?: boolean;
|
|
26
|
+
class?: string;
|
|
27
|
+
} = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<Dialog.Root bind:open {...restProps}>
|
|
31
|
+
<Dialog.Header class="sr-only">
|
|
32
|
+
<Dialog.Title>{title}</Dialog.Title>
|
|
33
|
+
<Dialog.Description>{description}</Dialog.Description>
|
|
34
|
+
</Dialog.Header>
|
|
35
|
+
<Dialog.Content
|
|
36
|
+
class={cn('rounded-xl! top-1/3 translate-y-0 overflow-hidden p-0', className)}
|
|
37
|
+
{showCloseButton}
|
|
38
|
+
{portalProps}
|
|
39
|
+
>
|
|
40
|
+
<Command {...restProps} bind:value bind:ref {children} />
|
|
41
|
+
</Dialog.Content>
|
|
42
|
+
</Dialog.Root>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Command as CommandPrimitive, Dialog as DialogPrimitive } from 'bits-ui';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { type WithoutChildrenOrChild } from '../../../shadcn.js';
|
|
4
|
+
type $$ComponentProps = WithoutChildrenOrChild<DialogPrimitive.RootProps> & WithoutChildrenOrChild<CommandPrimitive.RootProps> & {
|
|
5
|
+
portalProps?: DialogPrimitive.PortalProps;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const CommandDialog: import("svelte").Component<$$ComponentProps, {}, "value" | "ref" | "open">;
|
|
13
|
+
type CommandDialog = ReturnType<typeof CommandDialog>;
|
|
14
|
+
export default CommandDialog;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: CommandPrimitive.EmptyProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CommandPrimitive.Empty
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="command-empty"
|
|
15
|
+
class={cn('py-6 text-center text-sm', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Command as CommandPrimitive, useId } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
heading,
|
|
10
|
+
value,
|
|
11
|
+
...restProps
|
|
12
|
+
}: CommandPrimitive.GroupProps & {
|
|
13
|
+
heading?: string;
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<CommandPrimitive.Group
|
|
18
|
+
bind:ref
|
|
19
|
+
data-slot="command-group"
|
|
20
|
+
class={cn(
|
|
21
|
+
'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
value={value ?? heading ?? `----${useId()}`}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
{#if heading}
|
|
28
|
+
<CommandPrimitive.GroupHeading class="text-muted-foreground px-2 py-1.5 text-xs font-medium">
|
|
29
|
+
{heading}
|
|
30
|
+
</CommandPrimitive.GroupHeading>
|
|
31
|
+
{/if}
|
|
32
|
+
<CommandPrimitive.GroupItems {children} />
|
|
33
|
+
</CommandPrimitive.Group>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
2
|
+
type $$ComponentProps = CommandPrimitive.GroupProps & {
|
|
3
|
+
heading?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const CommandGroup: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
6
|
+
type CommandGroup = ReturnType<typeof CommandGroup>;
|
|
7
|
+
export default CommandGroup;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
import * as InputGroup from '../input-group/index.js';
|
|
5
|
+
import SearchIcon from '@lucide/svelte/icons/search';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
value = $bindable(''),
|
|
11
|
+
...restProps
|
|
12
|
+
}: CommandPrimitive.InputProps = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div data-slot="command-input-wrapper" class="p-1 pb-0">
|
|
16
|
+
<InputGroup.Root
|
|
17
|
+
class="bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!"
|
|
18
|
+
>
|
|
19
|
+
<CommandPrimitive.Input
|
|
20
|
+
{value}
|
|
21
|
+
data-slot="command-input"
|
|
22
|
+
class={cn(
|
|
23
|
+
'w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
>
|
|
28
|
+
{#snippet child({ props })}
|
|
29
|
+
<InputGroup.Input {...props} bind:value bind:ref />
|
|
30
|
+
{/snippet}
|
|
31
|
+
</CommandPrimitive.Input>
|
|
32
|
+
<InputGroup.Addon>
|
|
33
|
+
<SearchIcon class="size-4 shrink-0 opacity-50" />
|
|
34
|
+
</InputGroup.Addon>
|
|
35
|
+
</InputGroup.Root>
|
|
36
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
import CheckIcon from '@lucide/svelte/icons/check';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: CommandPrimitive.ItemProps = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<CommandPrimitive.Item
|
|
15
|
+
bind:ref
|
|
16
|
+
data-slot="command-item"
|
|
17
|
+
class={cn(
|
|
18
|
+
"group/command-item data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
>
|
|
23
|
+
{@render children?.()}
|
|
24
|
+
<CheckIcon
|
|
25
|
+
class="cn-command-item-indicator ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"
|
|
26
|
+
/>
|
|
27
|
+
</CommandPrimitive.Item>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: CommandPrimitive.LinkItemProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CommandPrimitive.LinkItem
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="command-item"
|
|
15
|
+
class={cn(
|
|
16
|
+
"aria-selected:bg-accent aria-selected:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: CommandPrimitive.ListProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CommandPrimitive.List
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="command-list"
|
|
15
|
+
class={cn(
|
|
16
|
+
'no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: CommandPrimitive.SeparatorProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CommandPrimitive.Separator
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="command-separator"
|
|
15
|
+
class={cn('bg-border -mx-1 h-px w-auto', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from '../../../shadcn.js';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<span
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="command-shortcut"
|
|
16
|
+
class={cn(
|
|
17
|
+
'text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-xs tracking-widest',
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</span>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from '../../../shadcn.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
declare const CommandShortcut: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLSpanElement>>, {}, "ref">;
|
|
4
|
+
type CommandShortcut = ReturnType<typeof CommandShortcut>;
|
|
5
|
+
export default CommandShortcut;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../../shadcn.js';
|
|
3
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
4
|
+
|
|
5
|
+
export type CommandRootApi = CommandPrimitive.Root;
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
api = $bindable(null),
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
value = $bindable(''),
|
|
11
|
+
class: className,
|
|
12
|
+
...restProps
|
|
13
|
+
}: CommandPrimitive.RootProps & {
|
|
14
|
+
api?: CommandRootApi | null;
|
|
15
|
+
} = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<CommandPrimitive.Root
|
|
19
|
+
bind:this={api}
|
|
20
|
+
bind:value
|
|
21
|
+
bind:ref
|
|
22
|
+
data-slot="command"
|
|
23
|
+
class={cn(
|
|
24
|
+
'bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden',
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...restProps}
|
|
28
|
+
/>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'bits-ui';
|
|
2
|
+
export type CommandRootApi = CommandPrimitive.Root;
|
|
3
|
+
type $$ComponentProps = CommandPrimitive.RootProps & {
|
|
4
|
+
api?: CommandRootApi | null;
|
|
5
|
+
};
|
|
6
|
+
declare const Command: import("svelte").Component<$$ComponentProps, {}, "value" | "ref" | "api">;
|
|
7
|
+
type Command = ReturnType<typeof Command>;
|
|
8
|
+
export default Command;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Root from './command.svelte';
|
|
2
|
+
import Loading from './command-loading.svelte';
|
|
3
|
+
import Dialog from './command-dialog.svelte';
|
|
4
|
+
import Empty from './command-empty.svelte';
|
|
5
|
+
import Group from './command-group.svelte';
|
|
6
|
+
import Item from './command-item.svelte';
|
|
7
|
+
import Input from './command-input.svelte';
|
|
8
|
+
import List from './command-list.svelte';
|
|
9
|
+
import Separator from './command-separator.svelte';
|
|
10
|
+
import Shortcut from './command-shortcut.svelte';
|
|
11
|
+
import LinkItem from './command-link-item.svelte';
|
|
12
|
+
export { Root, Dialog, Empty, Group, Item, LinkItem, Input, List, Separator, Shortcut, Loading, Root as Command, Dialog as CommandDialog, Empty as CommandEmpty, Group as CommandGroup, Item as CommandItem, LinkItem as CommandLinkItem, Input as CommandInput, List as CommandList, Separator as CommandSeparator, Shortcut as CommandShortcut, Loading as CommandLoading };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Root from './command.svelte';
|
|
2
|
+
import Loading from './command-loading.svelte';
|
|
3
|
+
import Dialog from './command-dialog.svelte';
|
|
4
|
+
import Empty from './command-empty.svelte';
|
|
5
|
+
import Group from './command-group.svelte';
|
|
6
|
+
import Item from './command-item.svelte';
|
|
7
|
+
import Input from './command-input.svelte';
|
|
8
|
+
import List from './command-list.svelte';
|
|
9
|
+
import Separator from './command-separator.svelte';
|
|
10
|
+
import Shortcut from './command-shortcut.svelte';
|
|
11
|
+
import LinkItem from './command-link-item.svelte';
|
|
12
|
+
export { Root, Dialog, Empty, Group, Item, LinkItem, Input, List, Separator, Shortcut, Loading,
|
|
13
|
+
//
|
|
14
|
+
Root as Command, Dialog as CommandDialog, Empty as CommandEmpty, Group as CommandGroup, Item as CommandItem, LinkItem as CommandLinkItem, Input as CommandInput, List as CommandList, Separator as CommandSeparator, Shortcut as CommandShortcut, Loading as CommandLoading };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
type = 'button',
|
|
7
|
+
...restProps
|
|
8
|
+
}: DialogPrimitive.CloseProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DialogPrimitive.Close bind:ref data-slot="dialog-close" {type} {...restProps} />
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from 'bits-ui';
|
|
3
|
+
import DialogPortal from './dialog-portal.svelte';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
import * as Dialog from './index.js';
|
|
6
|
+
import { cn, type WithoutChildrenOrChild } from '../../../shadcn.js';
|
|
7
|
+
import type { ComponentProps } from 'svelte';
|
|
8
|
+
import { Button } from '../button/index.js';
|
|
9
|
+
import XIcon from '@lucide/svelte/icons/x';
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
ref = $bindable(null),
|
|
13
|
+
class: className,
|
|
14
|
+
portalProps,
|
|
15
|
+
children,
|
|
16
|
+
showCloseButton = true,
|
|
17
|
+
...restProps
|
|
18
|
+
}: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
|
|
19
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DialogPortal>>;
|
|
20
|
+
children: Snippet;
|
|
21
|
+
showCloseButton?: boolean;
|
|
22
|
+
} = $props();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<DialogPortal {...portalProps}>
|
|
26
|
+
<Dialog.Overlay />
|
|
27
|
+
<DialogPrimitive.Content
|
|
28
|
+
bind:ref
|
|
29
|
+
data-slot="dialog-content"
|
|
30
|
+
class={cn(
|
|
31
|
+
'bg-popover text-popover-foreground 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 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-xl p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...restProps}
|
|
35
|
+
>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
{#if showCloseButton}
|
|
38
|
+
<DialogPrimitive.Close data-slot="dialog-close">
|
|
39
|
+
{#snippet child({ props })}
|
|
40
|
+
<Button variant="ghost" class="absolute top-4 right-4" size="icon-sm" {...props}>
|
|
41
|
+
<XIcon />
|
|
42
|
+
<span class="sr-only">Close</span>
|
|
43
|
+
</Button>
|
|
44
|
+
{/snippet}
|
|
45
|
+
</DialogPrimitive.Close>
|
|
46
|
+
{/if}
|
|
47
|
+
</DialogPrimitive.Content>
|
|
48
|
+
</DialogPortal>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from 'bits-ui';
|
|
2
|
+
import DialogPortal from './dialog-portal.svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import { type WithoutChildrenOrChild } from '../../../shadcn.js';
|
|
5
|
+
import type { ComponentProps } from 'svelte';
|
|
6
|
+
type $$ComponentProps = WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
|
|
7
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DialogPortal>>;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const DialogContent: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
12
|
+
type DialogContent = ReturnType<typeof DialogContent>;
|
|
13
|
+
export default DialogContent;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.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(
|
|
16
|
+
'text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from '../../../shadcn.js';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import { Dialog as DialogPrimitive } from 'bits-ui';
|
|
5
|
+
import { Button } from '../button/index.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
showCloseButton = false,
|
|
12
|
+
...restProps
|
|
13
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
14
|
+
showCloseButton?: boolean;
|
|
15
|
+
} = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div
|
|
19
|
+
bind:this={ref}
|
|
20
|
+
data-slot="dialog-footer"
|
|
21
|
+
class={cn('gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
{#if showCloseButton}
|
|
26
|
+
<DialogPrimitive.Close>
|
|
27
|
+
{#snippet child({ props })}
|
|
28
|
+
<Button variant="outline" {...props}>Close</Button>
|
|
29
|
+
{/snippet}
|
|
30
|
+
</DialogPrimitive.Close>
|
|
31
|
+
{/if}
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type WithElementRef } from '../../../shadcn.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
4
|
+
showCloseButton?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const DialogFooter: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type DialogFooter = ReturnType<typeof DialogFooter>;
|
|
8
|
+
export default DialogFooter;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../shadcn.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('gap-2 flex flex-col', className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../shadcn.js';
|
|
3
|
+
declare const DialogHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type DialogHeader = ReturnType<typeof DialogHeader>;
|
|
5
|
+
export default DialogHeader;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.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-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-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 '../../../shadcn.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('leading-none font-medium', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|