svelte-docsmith 0.3.0 → 0.5.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 +9 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +9 -1
- package/dist/generate-llms.d.ts +31 -0
- package/dist/generate-llms.js +63 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -0
- package/dist/llms.d.ts +11 -0
- package/dist/llms.js +4 -0
- package/dist/normalize-path.d.ts +6 -0
- package/dist/normalize-path.js +8 -0
- package/dist/preprocess.js +11 -2
- package/dist/sitemap.d.ts +27 -0
- package/dist/sitemap.js +44 -0
- package/dist/ui/layouts/copy-page-menu.svelte +113 -0
- package/dist/ui/layouts/copy-page-menu.svelte.d.ts +9 -0
- package/dist/ui/layouts/docs-header.svelte +1 -1
- package/dist/ui/layouts/docs-mobile-header.svelte +1 -1
- package/dist/ui/layouts/docs-shell.svelte +83 -9
- package/dist/ui/layouts/docs-shell.svelte.d.ts +6 -0
- package/dist/ui/layouts/docs-sidebar.svelte +3 -2
- package/dist/ui/layouts/prev-next-nav.svelte +9 -2
- package/dist/ui/layouts/prev-next-nav.svelte.d.ts +1 -0
- package/dist/ui/layouts/seo-head.svelte +2 -1
- package/dist/ui/markdown/pre.svelte +78 -28
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-checkbox-group.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-checkbox-item.svelte +44 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +9 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-content.svelte +31 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-content.svelte.d.ts +10 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +8 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-group.svelte +7 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-group.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-item.svelte +27 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-item.svelte.d.ts +8 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-label.svelte +27 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-label.svelte.d.ts +8 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-portal.svelte +7 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-portal.svelte.d.ts +3 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-radio-item.svelte +34 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-separator.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-shortcut.svelte +23 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +5 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +7 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-sub.svelte +7 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-sub.svelte.d.ts +3 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu-trigger.svelte.d.ts +4 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu.svelte +7 -0
- package/dist/ui/shadcn/dropdown-menu/dropdown-menu.svelte.d.ts +3 -0
- package/dist/ui/shadcn/dropdown-menu/index.d.ts +18 -0
- package/dist/ui/shadcn/dropdown-menu/index.js +18 -0
- package/dist/vite.d.ts +8 -1
- package/dist/vite.js +60 -3
- package/package.json +7 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { page } from '$app/state';
|
|
3
3
|
import { cn } from '../../shadcn.js';
|
|
4
|
+
import { normalizePath } from '../../normalize-path.js';
|
|
4
5
|
import type { NavGroup } from '../../config.js';
|
|
5
6
|
|
|
6
7
|
const { nav, class: className = '' }: { nav: NavGroup[]; class?: string } = $props();
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
|
|
9
10
|
<aside class={cn('sticky top-24 hidden h-screen w-56 shrink-0 bg-transparent lg:block', className)}>
|
|
10
11
|
<div class="max-h-[calc(100vh-10rem)] overflow-y-auto px-4">
|
|
11
|
-
<nav class="space-y-6">
|
|
12
|
+
<nav aria-label="Documentation" class="space-y-6">
|
|
12
13
|
{#each nav as group (group.title)}
|
|
13
14
|
<div class="space-y-3">
|
|
14
15
|
<h4 class="text-foreground px-2 text-sm font-semibold">{group.title}</h4>
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
href={item.url}
|
|
20
21
|
class={cn(
|
|
21
22
|
'hover:text-primary hover:bg-primary/20 block rounded-md px-2 py-1.5 text-sm transition-colors',
|
|
22
|
-
page.url.pathname === item.url
|
|
23
|
+
normalizePath(page.url.pathname) === item.url
|
|
23
24
|
? 'text-primary bg-primary/20 font-medium'
|
|
24
25
|
: 'text-muted-foreground'
|
|
25
26
|
)}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { NavItem } from '../../config.js';
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const {
|
|
5
|
+
prev,
|
|
6
|
+
next,
|
|
7
|
+
bordered = true
|
|
8
|
+
}: { prev?: NavItem; next?: NavItem; bordered?: boolean } = $props();
|
|
5
9
|
</script>
|
|
6
10
|
|
|
7
11
|
{#if prev || next}
|
|
8
|
-
<nav
|
|
12
|
+
<nav
|
|
13
|
+
aria-label="Pagination"
|
|
14
|
+
class="flex justify-between gap-4 {bordered ? 'border-border mt-8 border-t pt-8' : 'mt-6'}"
|
|
15
|
+
>
|
|
9
16
|
{#if prev}
|
|
10
17
|
<a
|
|
11
18
|
href={prev.url}
|
|
@@ -2,6 +2,7 @@ import type { NavItem } from '../../config.js';
|
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
prev?: NavItem;
|
|
4
4
|
next?: NavItem;
|
|
5
|
+
bordered?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const PrevNextNav: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
8
|
type PrevNextNav = ReturnType<typeof PrevNextNav>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { page } from '$app/state';
|
|
3
|
+
import { normalizePath } from '../../normalize-path.js';
|
|
3
4
|
import type { DocsmithConfig } from '../../config.js';
|
|
4
5
|
|
|
5
6
|
const {
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
|
|
24
25
|
const origin = $derived(config.url?.replace(/\/$/, ''));
|
|
25
26
|
// Absolute URLs need a configured origin; otherwise canonical/og:url are omitted.
|
|
26
|
-
const canonical = $derived(origin ? origin + page.url.pathname : undefined);
|
|
27
|
+
const canonical = $derived(origin ? origin + normalizePath(page.url.pathname) : undefined);
|
|
27
28
|
const image = $derived.by(() => {
|
|
28
29
|
const src = config.ogImage;
|
|
29
30
|
if (!src) return undefined;
|
|
@@ -20,24 +20,6 @@
|
|
|
20
20
|
<pre class="not-prose shiki max-h-[32rem] flex shrink" use:clipboard.readText>
|
|
21
21
|
{@render children()}
|
|
22
22
|
</pre>
|
|
23
|
-
|
|
24
|
-
<!-- Scroll indicators with increased fade intensity -->
|
|
25
|
-
<div
|
|
26
|
-
class="absolute bottom-0 left-0 right-0 h-4 bg-gradient-to-t from-muted via-muted/70 to-transparent pointer-events-none"
|
|
27
|
-
aria-hidden="true"
|
|
28
|
-
></div>
|
|
29
|
-
<div
|
|
30
|
-
class="absolute top-0 left-0 right-0 h-4 bg-gradient-to-b from-muted via-muted/70 to-transparent pointer-events-none"
|
|
31
|
-
aria-hidden="true"
|
|
32
|
-
></div>
|
|
33
|
-
<div
|
|
34
|
-
class="absolute top-0 bottom-0 right-0 w-4 bg-gradient-to-l from-muted via-muted/70 to-transparent pointer-events-none"
|
|
35
|
-
aria-hidden="true"
|
|
36
|
-
></div>
|
|
37
|
-
<div
|
|
38
|
-
class="absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r from-muted via-muted/70 to-transparent pointer-events-none"
|
|
39
|
-
aria-hidden="true"
|
|
40
|
-
></div>
|
|
41
23
|
</ScrollArea>
|
|
42
24
|
</div>
|
|
43
25
|
|
|
@@ -62,27 +44,95 @@
|
|
|
62
44
|
padding-inline: 1rem;
|
|
63
45
|
}
|
|
64
46
|
|
|
47
|
+
/* Two tiers of annotation. EMPHASIS (highlight, word) tints with the theme's
|
|
48
|
+
--primary, so it reads as the brand pointing at a line and recolors with
|
|
49
|
+
the active theme. SEMANTIC (diff, error, warning) uses fixed OKLCH hues so
|
|
50
|
+
green/red/amber stay legible on any theme. All are translucent washes over
|
|
51
|
+
the code background via color-mix. */
|
|
52
|
+
|
|
53
|
+
/* --- Line highlight (// [!code highlight] and {1,3} meta) --- */
|
|
65
54
|
:global(pre span.line.highlighted) {
|
|
66
|
-
background
|
|
55
|
+
background: color-mix(in oklch, var(--primary) 12%, transparent);
|
|
67
56
|
}
|
|
68
|
-
|
|
69
57
|
:global(.dark pre span.line.highlighted) {
|
|
70
|
-
background
|
|
58
|
+
background: color-mix(in oklch, var(--primary) 20%, transparent);
|
|
71
59
|
}
|
|
72
60
|
|
|
61
|
+
/* --- Diff (// [!code ++] / [!code --]) with +/- gutter glyphs --- */
|
|
62
|
+
:global(pre span.line.diff) {
|
|
63
|
+
position: relative;
|
|
64
|
+
}
|
|
73
65
|
:global(pre span.line.diff.add) {
|
|
74
|
-
background
|
|
66
|
+
background: color-mix(in oklch, oklch(0.7 0.16 150) 15%, transparent);
|
|
75
67
|
}
|
|
76
|
-
|
|
77
68
|
:global(pre span.line.diff.remove) {
|
|
78
|
-
background
|
|
69
|
+
background: color-mix(in oklch, oklch(0.62 0.2 25) 14%, transparent);
|
|
79
70
|
}
|
|
80
|
-
|
|
81
71
|
:global(.dark pre span.line.diff.add) {
|
|
82
|
-
background
|
|
72
|
+
background: color-mix(in oklch, oklch(0.7 0.16 150) 22%, transparent);
|
|
83
73
|
}
|
|
84
|
-
|
|
85
74
|
:global(.dark pre span.line.diff.remove) {
|
|
86
|
-
background
|
|
75
|
+
background: color-mix(in oklch, oklch(0.62 0.2 25) 22%, transparent);
|
|
76
|
+
}
|
|
77
|
+
:global(pre span.line.diff::before) {
|
|
78
|
+
position: absolute;
|
|
79
|
+
left: 0.45rem;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
}
|
|
82
|
+
:global(pre span.line.diff.add::before) {
|
|
83
|
+
content: '+';
|
|
84
|
+
color: oklch(0.6 0.15 150);
|
|
85
|
+
}
|
|
86
|
+
:global(pre span.line.diff.remove::before) {
|
|
87
|
+
content: '−';
|
|
88
|
+
color: oklch(0.58 0.19 25);
|
|
89
|
+
}
|
|
90
|
+
:global(.dark pre span.line.diff.add::before) {
|
|
91
|
+
color: oklch(0.78 0.17 150);
|
|
92
|
+
}
|
|
93
|
+
:global(.dark pre span.line.diff.remove::before) {
|
|
94
|
+
color: oklch(0.72 0.18 25);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* --- Error / warning severity (// [!code error] / [!code warning]).
|
|
98
|
+
No gutter glyph, so they stay distinct from the +/- diff lines. --- */
|
|
99
|
+
:global(pre span.line.highlighted.error) {
|
|
100
|
+
background: color-mix(in oklch, oklch(0.62 0.2 25) 18%, transparent);
|
|
101
|
+
}
|
|
102
|
+
:global(pre span.line.highlighted.warning) {
|
|
103
|
+
background: color-mix(in oklch, oklch(0.8 0.13 85) 22%, transparent);
|
|
104
|
+
}
|
|
105
|
+
:global(.dark pre span.line.highlighted.error) {
|
|
106
|
+
background: color-mix(in oklch, oklch(0.62 0.2 25) 26%, transparent);
|
|
107
|
+
}
|
|
108
|
+
:global(.dark pre span.line.highlighted.warning) {
|
|
109
|
+
background: color-mix(in oklch, oklch(0.8 0.13 85) 20%, transparent);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* --- Focus (// [!code focus]): dim the other lines and restore on hover.
|
|
113
|
+
A clean opacity fade reads calmer than a muddy blur. `:has` recreates
|
|
114
|
+
Shiki's stripped container flag from the line classes alone. --- */
|
|
115
|
+
:global(pre code:has(span.line.focused) span.line:not(.focused)) {
|
|
116
|
+
opacity: 0.42;
|
|
117
|
+
transition: opacity 0.25s ease;
|
|
118
|
+
}
|
|
119
|
+
:global(pre:hover code:has(span.line.focused) span.line:not(.focused)) {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
}
|
|
122
|
+
@media (prefers-reduced-motion: reduce) {
|
|
123
|
+
:global(pre code:has(span.line.focused) span.line:not(.focused)) {
|
|
124
|
+
transition: none;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* --- Word highlight (// [!code word:name]): a primary-tinted inline pill --- */
|
|
129
|
+
:global(pre .highlighted-word) {
|
|
130
|
+
border-radius: 0.3rem;
|
|
131
|
+
padding: 0.1rem 0.3rem;
|
|
132
|
+
background: color-mix(in oklch, var(--primary) 16%, transparent);
|
|
133
|
+
box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 35%, transparent);
|
|
134
|
+
}
|
|
135
|
+
:global(.dark pre .highlighted-word) {
|
|
136
|
+
background: color-mix(in oklch, var(--primary) 24%, transparent);
|
|
87
137
|
}
|
|
88
138
|
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
value = $bindable([]),
|
|
7
|
+
...restProps
|
|
8
|
+
}: DropdownMenuPrimitive.CheckboxGroupProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.CheckboxGroup
|
|
12
|
+
bind:ref
|
|
13
|
+
bind:value
|
|
14
|
+
data-slot="dropdown-menu-checkbox-group"
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
declare const DropdownMenuCheckboxGroup: import("svelte").Component<DropdownMenuPrimitive.CheckboxGroupProps, {}, "value" | "ref">;
|
|
3
|
+
type DropdownMenuCheckboxGroup = ReturnType<typeof DropdownMenuCheckboxGroup>;
|
|
4
|
+
export default DropdownMenuCheckboxGroup;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 '../../../shadcn.js';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
checked = $bindable(false),
|
|
11
|
+
indeterminate = $bindable(false),
|
|
12
|
+
class: className,
|
|
13
|
+
children: childrenProp,
|
|
14
|
+
...restProps
|
|
15
|
+
}: WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
} = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
21
|
+
bind:ref
|
|
22
|
+
bind:checked
|
|
23
|
+
bind:indeterminate
|
|
24
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
25
|
+
class={cn(
|
|
26
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm data-inset:pl-8 [&_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",
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...restProps}
|
|
30
|
+
>
|
|
31
|
+
{#snippet children({ checked, indeterminate })}
|
|
32
|
+
<span
|
|
33
|
+
class="absolute right-2 flex items-center justify-center pointer-events-none"
|
|
34
|
+
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
35
|
+
>
|
|
36
|
+
{#if indeterminate}
|
|
37
|
+
<MinusIcon />
|
|
38
|
+
{:else if checked}
|
|
39
|
+
<CheckIcon />
|
|
40
|
+
{/if}
|
|
41
|
+
</span>
|
|
42
|
+
{@render childrenProp?.()}
|
|
43
|
+
{/snippet}
|
|
44
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
import { type WithoutChildrenOrChild } from '../../../shadcn.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
type $$ComponentProps = WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const DropdownMenuCheckboxItem: import("svelte").Component<$$ComponentProps, {}, "ref" | "checked" | "indeterminate">;
|
|
8
|
+
type DropdownMenuCheckboxItem = ReturnType<typeof DropdownMenuCheckboxItem>;
|
|
9
|
+
export default DropdownMenuCheckboxItem;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithoutChildrenOrChild } from '../../../shadcn.js';
|
|
3
|
+
import DropdownMenuPortal from './dropdown-menu-portal.svelte';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
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-md p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-(--bits-dropdown-menu-anchor-width) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden',
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...restProps}
|
|
30
|
+
/>
|
|
31
|
+
</DropdownMenuPortal>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type WithoutChildrenOrChild } from '../../../shadcn.js';
|
|
2
|
+
import DropdownMenuPortal from './dropdown-menu-portal.svelte';
|
|
3
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
4
|
+
import type { ComponentProps } from 'svelte';
|
|
5
|
+
type $$ComponentProps = DropdownMenuPrimitive.ContentProps & {
|
|
6
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DropdownMenuPortal>>;
|
|
7
|
+
};
|
|
8
|
+
declare const DropdownMenuContent: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
9
|
+
type DropdownMenuContent = ReturnType<typeof DropdownMenuContent>;
|
|
10
|
+
export default DropdownMenuContent;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
import type { ComponentProps } from 'svelte';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
inset,
|
|
10
|
+
...restProps
|
|
11
|
+
}: ComponentProps<typeof DropdownMenuPrimitive.GroupHeading> & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
} = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<DropdownMenuPrimitive.GroupHeading
|
|
17
|
+
bind:ref
|
|
18
|
+
data-slot="dropdown-menu-group-heading"
|
|
19
|
+
data-inset={inset}
|
|
20
|
+
class={cn('px-2 py-1.5 text-sm font-semibold data-[inset]:ps-8', className)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
/>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type $$ComponentProps = ComponentProps<typeof DropdownMenuPrimitive.GroupHeading> & {
|
|
4
|
+
inset?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const DropdownMenuGroupHeading: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type DropdownMenuGroupHeading = ReturnType<typeof DropdownMenuGroupHeading>;
|
|
8
|
+
export default DropdownMenuGroupHeading;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
let { ref = $bindable(null), ...restProps }: DropdownMenuPrimitive.GroupProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<DropdownMenuPrimitive.Group bind:ref data-slot="dropdown-menu-group" {...restProps} />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../../shadcn.js';
|
|
3
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
inset,
|
|
9
|
+
variant = 'default',
|
|
10
|
+
...restProps
|
|
11
|
+
}: DropdownMenuPrimitive.ItemProps & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
variant?: 'default' | 'destructive';
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<DropdownMenuPrimitive.Item
|
|
18
|
+
bind:ref
|
|
19
|
+
data-slot="dropdown-menu-item"
|
|
20
|
+
data-inset={inset}
|
|
21
|
+
data-variant={variant}
|
|
22
|
+
class={cn(
|
|
23
|
+
"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-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_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 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
type $$ComponentProps = DropdownMenuPrimitive.ItemProps & {
|
|
3
|
+
inset?: boolean;
|
|
4
|
+
variant?: 'default' | 'destructive';
|
|
5
|
+
};
|
|
6
|
+
declare const DropdownMenuItem: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type DropdownMenuItem = ReturnType<typeof DropdownMenuItem>;
|
|
8
|
+
export default DropdownMenuItem;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
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(
|
|
21
|
+
'text-muted-foreground px-2 py-1.5 text-xs font-medium data-inset:pl-8 data-[inset]:pl-8',
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...restProps}
|
|
25
|
+
>
|
|
26
|
+
{@render children?.()}
|
|
27
|
+
</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
|
+
inset?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const DropdownMenuLabel: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type DropdownMenuLabel = ReturnType<typeof DropdownMenuLabel>;
|
|
8
|
+
export default DropdownMenuLabel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
value = $bindable(),
|
|
7
|
+
...restProps
|
|
8
|
+
}: DropdownMenuPrimitive.RadioGroupProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.RadioGroup
|
|
12
|
+
bind:ref
|
|
13
|
+
bind:value
|
|
14
|
+
data-slot="dropdown-menu-radio-group"
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
declare const DropdownMenuRadioGroup: import("svelte").Component<DropdownMenuPrimitive.RadioGroupProps, {}, "value" | "ref">;
|
|
3
|
+
type DropdownMenuRadioGroup = ReturnType<typeof DropdownMenuRadioGroup>;
|
|
4
|
+
export default DropdownMenuRadioGroup;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 '../../../shadcn.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children: childrenProp,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithoutChild<DropdownMenuPrimitive.RadioItemProps> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<DropdownMenuPrimitive.RadioItem
|
|
15
|
+
bind:ref
|
|
16
|
+
data-slot="dropdown-menu-radio-item"
|
|
17
|
+
class={cn(
|
|
18
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm data-inset:pl-8 [&_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",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
>
|
|
23
|
+
{#snippet children({ checked })}
|
|
24
|
+
<span
|
|
25
|
+
class="absolute right-2 flex items-center justify-center pointer-events-none"
|
|
26
|
+
data-slot="dropdown-menu-radio-item-indicator"
|
|
27
|
+
>
|
|
28
|
+
{#if checked}
|
|
29
|
+
<CheckIcon />
|
|
30
|
+
{/if}
|
|
31
|
+
</span>
|
|
32
|
+
{@render childrenProp?.({ checked })}
|
|
33
|
+
{/snippet}
|
|
34
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
declare const DropdownMenuRadioItem: import("svelte").Component<Omit<DropdownMenuPrimitive.RadioItemProps, "child">, {}, "ref">;
|
|
3
|
+
type DropdownMenuRadioItem = ReturnType<typeof DropdownMenuRadioItem>;
|
|
4
|
+
export default DropdownMenuRadioItem;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.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,4 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
declare const DropdownMenuSeparator: import("svelte").Component<DropdownMenuPrimitive.SeparatorProps, {}, "ref">;
|
|
3
|
+
type DropdownMenuSeparator = ReturnType<typeof DropdownMenuSeparator>;
|
|
4
|
+
export default DropdownMenuSeparator;
|
|
@@ -0,0 +1,23 @@
|
|
|
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<HTMLSpanElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<span
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="dropdown-menu-shortcut"
|
|
16
|
+
class={cn(
|
|
17
|
+
'text-muted-foreground group-focus/dropdown-menu-item:text-accent-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 { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../shadcn.js';
|
|
3
|
+
declare const DropdownMenuShortcut: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLSpanElement>>, {}, "ref">;
|
|
4
|
+
type DropdownMenuShortcut = ReturnType<typeof DropdownMenuShortcut>;
|
|
5
|
+
export default DropdownMenuShortcut;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
3
|
+
import { cn } from '../../../shadcn.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DropdownMenuPrimitive.SubContentProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DropdownMenuPrimitive.SubContent
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dropdown-menu-sub-content"
|
|
15
|
+
class={cn(
|
|
16
|
+
'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-md p-1 shadow-lg ring-1 duration-100 w-auto',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
declare const DropdownMenuSubContent: import("svelte").Component<DropdownMenuPrimitive.SubContentProps, {}, "ref">;
|
|
3
|
+
type DropdownMenuSubContent = ReturnType<typeof DropdownMenuSubContent>;
|
|
4
|
+
export default DropdownMenuSubContent;
|
|
@@ -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 '../../../shadcn.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-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
<ChevronRightIcon class="ml-auto" />
|
|
29
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
2
|
+
type $$ComponentProps = DropdownMenuPrimitive.SubTriggerProps & {
|
|
3
|
+
inset?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const DropdownMenuSubTrigger: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
6
|
+
type DropdownMenuSubTrigger = ReturnType<typeof DropdownMenuSubTrigger>;
|
|
7
|
+
export default DropdownMenuSubTrigger;
|