compote-ui 0.66.0 → 0.67.1
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/dist/components/app-shell/app-shell-aside.svelte +16 -0
- package/dist/components/app-shell/app-shell-aside.svelte.d.ts +4 -0
- package/dist/components/app-shell/app-shell-footer.svelte +16 -0
- package/dist/components/app-shell/app-shell-footer.svelte.d.ts +4 -0
- package/dist/components/app-shell/app-shell-header.svelte +16 -0
- package/dist/components/app-shell/app-shell-header.svelte.d.ts +4 -0
- package/dist/components/app-shell/app-shell-main.svelte +10 -0
- package/dist/components/app-shell/app-shell-main.svelte.d.ts +4 -0
- package/dist/components/app-shell/app-shell-navbar.svelte +16 -0
- package/dist/components/app-shell/app-shell-navbar.svelte.d.ts +4 -0
- package/dist/components/app-shell/app-shell-section.svelte +17 -0
- package/dist/components/app-shell/app-shell-section.svelte.d.ts +7 -0
- package/dist/components/app-shell/app-shell.svelte +16 -0
- package/dist/components/app-shell/app-shell.svelte.d.ts +4 -0
- package/dist/components/app-shell/index.d.ts +7 -0
- package/dist/components/app-shell/index.js +7 -0
- package/dist/components/nav-rail/index.d.ts +2 -0
- package/dist/components/nav-rail/index.js +2 -0
- package/dist/components/nav-rail/nav-rail-item.svelte +54 -0
- package/dist/components/nav-rail/nav-rail-item.svelte.d.ts +12 -0
- package/dist/components/nav-rail/nav-rail.svelte +23 -0
- package/dist/components/nav-rail/nav-rail.svelte.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...rest }: HTMLAttributes<HTMLElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<aside
|
|
9
|
+
class={cn(
|
|
10
|
+
'col-start-3 row-start-2 flex w-72 flex-col overflow-hidden border-l border-border bg-surface-1',
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...rest}
|
|
14
|
+
>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</aside>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...rest }: HTMLAttributes<HTMLElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<footer
|
|
9
|
+
class={cn(
|
|
10
|
+
'col-span-full row-start-3 flex items-center border-t border-border bg-surface-1 px-4',
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...rest}
|
|
14
|
+
>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</footer>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...rest }: HTMLAttributes<HTMLElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<header
|
|
9
|
+
class={cn(
|
|
10
|
+
'col-span-full row-start-1 flex items-center border-b border-border bg-surface-1 px-4',
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...rest}
|
|
14
|
+
>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</header>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...rest }: HTMLAttributes<HTMLElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<main class={cn('col-start-2 row-start-2 min-w-0 overflow-y-auto p-6', className)} {...rest}>
|
|
9
|
+
{@render children?.()}
|
|
10
|
+
</main>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...rest }: HTMLAttributes<HTMLElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<nav
|
|
9
|
+
class={cn(
|
|
10
|
+
'col-start-1 row-start-2 flex w-60 flex-col overflow-hidden border-r border-border bg-surface-1',
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...rest}
|
|
14
|
+
>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</nav>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
grow?: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
let { grow = false, class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
class={cn(grow ? 'min-h-0 flex-1 overflow-x-hidden overflow-y-auto' : 'shrink-0', className)}
|
|
14
|
+
{...rest}
|
|
15
|
+
>
|
|
16
|
+
{@render children?.()}
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
type Props = HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
grow?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const AppShellSection: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type AppShellSection = ReturnType<typeof AppShellSection>;
|
|
7
|
+
export default AppShellSection;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...rest }: HTMLAttributes<HTMLDivElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
class={cn(
|
|
10
|
+
'relative grid h-dvh grid-cols-[auto_1fr_auto] grid-rows-[auto_1fr_auto] bg-surface-document text-ink',
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...rest}
|
|
14
|
+
>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Root } from './app-shell.svelte';
|
|
2
|
+
export { default as Header } from './app-shell-header.svelte';
|
|
3
|
+
export { default as Navbar } from './app-shell-navbar.svelte';
|
|
4
|
+
export { default as Main } from './app-shell-main.svelte';
|
|
5
|
+
export { default as Aside } from './app-shell-aside.svelte';
|
|
6
|
+
export { default as Footer } from './app-shell-footer.svelte';
|
|
7
|
+
export { default as Section } from './app-shell-section.svelte';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Root } from './app-shell.svelte';
|
|
2
|
+
export { default as Header } from './app-shell-header.svelte';
|
|
3
|
+
export { default as Navbar } from './app-shell-navbar.svelte';
|
|
4
|
+
export { default as Main } from './app-shell-main.svelte';
|
|
5
|
+
export { default as Aside } from './app-shell-aside.svelte';
|
|
6
|
+
export { default as Footer } from './app-shell-footer.svelte';
|
|
7
|
+
export { default as Section } from './app-shell-section.svelte';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
4
|
+
import { cn, type ClassValue } from 'tailwind-variants';
|
|
5
|
+
|
|
6
|
+
type Props = Omit<HTMLAnchorAttributes, 'class'> &
|
|
7
|
+
Omit<HTMLButtonAttributes, 'class'> & {
|
|
8
|
+
icon?: Snippet;
|
|
9
|
+
label: string;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
class?: ClassValue;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
let { icon, label, active = false, class: className, ...rest }: Props = $props();
|
|
15
|
+
|
|
16
|
+
const base = $derived(
|
|
17
|
+
cn(
|
|
18
|
+
'flex items-center gap-3 w-full rounded-md p-2 text-left text-ink-dim transition-colors',
|
|
19
|
+
'hover:bg-surface-2 hover:text-ink data-active:bg-surface-2 data-active:text-primary',
|
|
20
|
+
className
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const iconBox = 'grid size-6 shrink-0 place-items-center [&>svg]:size-5';
|
|
25
|
+
const labelClass = cn(
|
|
26
|
+
'min-w-0 truncate whitespace-nowrap opacity-0 transition-opacity',
|
|
27
|
+
'group-hover:opacity-100 group-focus-within:opacity-100 group-data-expanded:opacity-100'
|
|
28
|
+
);
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if rest.href}
|
|
32
|
+
<a
|
|
33
|
+
title={label}
|
|
34
|
+
aria-current={active ? 'page' : undefined}
|
|
35
|
+
data-active={active || undefined}
|
|
36
|
+
class={base}
|
|
37
|
+
{...rest}
|
|
38
|
+
>
|
|
39
|
+
<span class={iconBox}>{@render icon?.()}</span>
|
|
40
|
+
<span class={labelClass}>{label}</span>
|
|
41
|
+
</a>
|
|
42
|
+
{:else}
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
title={label}
|
|
46
|
+
aria-current={active ? 'page' : undefined}
|
|
47
|
+
data-active={active || undefined}
|
|
48
|
+
class={base}
|
|
49
|
+
{...rest}
|
|
50
|
+
>
|
|
51
|
+
<span class={iconBox}>{@render icon?.()}</span>
|
|
52
|
+
<span class={labelClass}>{label}</span>
|
|
53
|
+
</button>
|
|
54
|
+
{/if}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import { type ClassValue } from 'tailwind-variants';
|
|
4
|
+
type Props = Omit<HTMLAnchorAttributes, 'class'> & Omit<HTMLButtonAttributes, 'class'> & {
|
|
5
|
+
icon?: Snippet;
|
|
6
|
+
label: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
class?: ClassValue;
|
|
9
|
+
};
|
|
10
|
+
declare const NavRailItem: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type NavRailItem = ReturnType<typeof NavRailItem>;
|
|
12
|
+
export default NavRailItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<HTMLElement> & {
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
let { expanded = $bindable(false), class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<nav
|
|
13
|
+
data-expanded={expanded || undefined}
|
|
14
|
+
class={cn(
|
|
15
|
+
'group absolute inset-y-0 left-0 z-20 flex w-16 flex-col overflow-hidden',
|
|
16
|
+
'border-r border-border bg-surface-1 transition-[width] duration-200',
|
|
17
|
+
'hover:w-60 focus-within:w-60 data-expanded:w-60',
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...rest}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</nav>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
type Props = HTMLAttributes<HTMLElement> & {
|
|
3
|
+
expanded?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const NavRail: import("svelte").Component<Props, {}, "expanded">;
|
|
6
|
+
type NavRail = ReturnType<typeof NavRail>;
|
|
7
|
+
export default NavRail;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * as AppShell from './components/app-shell';
|
|
1
2
|
export { default as Avatar } from './components/avatar/avatar.svelte';
|
|
2
3
|
export type { AvatarProps, AvatarSize } from './components/avatar/avatar.types';
|
|
3
4
|
export { default as Button } from './components/button/button.svelte';
|
|
@@ -65,6 +66,7 @@ export { default as Toggle } from './components/toggle/toggle.svelte';
|
|
|
65
66
|
export type { ToggleProps, ToggleSize } from './components/toggle/types';
|
|
66
67
|
export * as ToggleGroup from './components/toggle-group';
|
|
67
68
|
export * as Menu from './components/menu';
|
|
69
|
+
export * as NavRail from './components/nav-rail';
|
|
68
70
|
export * as Tooltip from './components/tooltip';
|
|
69
71
|
export * as Field from './components/field';
|
|
70
72
|
export * as Fieldset from './components/fieldset';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Reexport your entry components here
|
|
2
|
+
export * as AppShell from './components/app-shell';
|
|
2
3
|
export { default as Avatar } from './components/avatar/avatar.svelte';
|
|
3
4
|
export { default as Button } from './components/button/button.svelte';
|
|
4
5
|
export { default as LinkButton } from './components/button/link-button.svelte';
|
|
@@ -46,6 +47,7 @@ export { createToaster } from '@ark-ui/svelte/toast';
|
|
|
46
47
|
export { default as Toggle } from './components/toggle/toggle.svelte';
|
|
47
48
|
export * as ToggleGroup from './components/toggle-group';
|
|
48
49
|
export * as Menu from './components/menu';
|
|
50
|
+
export * as NavRail from './components/nav-rail';
|
|
49
51
|
export * as Tooltip from './components/tooltip';
|
|
50
52
|
export * as Field from './components/field';
|
|
51
53
|
export * as Fieldset from './components/fieldset';
|