compote-ui 0.26.0 → 0.28.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/dist/components/avatar/avatar.svelte +10 -3
- package/dist/components/button/button.variants.d.ts +6 -0
- package/dist/components/button/button.variants.js +3 -1
- package/dist/components/drawer/drawer-backdrop.svelte +40 -0
- package/dist/components/drawer/drawer-backdrop.svelte.d.ts +7 -0
- package/dist/components/drawer/drawer-close-trigger.svelte +19 -0
- package/dist/components/drawer/drawer-close-trigger.svelte.d.ts +7 -0
- package/dist/components/drawer/drawer-content.svelte +157 -0
- package/dist/components/drawer/drawer-content.svelte.d.ts +7 -0
- package/dist/components/drawer/drawer-grabber-indicator.svelte +12 -0
- package/dist/components/drawer/drawer-grabber-indicator.svelte.d.ts +7 -0
- package/dist/components/drawer/drawer-grabber.svelte +18 -0
- package/dist/components/drawer/drawer-grabber.svelte.d.ts +7 -0
- package/dist/components/drawer/drawer-positioner.svelte +18 -0
- package/dist/components/drawer/drawer-positioner.svelte.d.ts +7 -0
- package/dist/components/drawer/drawer-root.svelte +18 -0
- package/dist/components/drawer/drawer-root.svelte.d.ts +7 -0
- package/dist/components/drawer/drawer-title.svelte +14 -0
- package/dist/components/drawer/drawer-title.svelte.d.ts +7 -0
- package/dist/components/drawer/drawer-trigger.svelte +14 -0
- package/dist/components/drawer/drawer-trigger.svelte.d.ts +7 -0
- package/dist/components/drawer/index.d.ts +9 -0
- package/dist/components/drawer/index.js +9 -0
- package/dist/components/image-cropper/image-cropper.svelte +1 -3
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tabs/tab-content.svelte +1 -1
- package/dist/components/tabs/tab-indicator.svelte +16 -0
- package/dist/components/tabs/tab-indicator.svelte.d.ts +7 -0
- package/dist/components/tabs/tab-list.svelte +18 -0
- package/dist/components/tabs/tab-list.svelte.d.ts +7 -0
- package/dist/components/tabs/tab-trigger.svelte +1 -1
- package/dist/components/tabs/tabs.svelte +0 -14
- package/dist/components/tabs/tabs.svelte.d.ts +1 -2
- package/dist/components/tabs/types.d.ts +1 -7
- package/dist/components/toggle-group/toggle-group-item.svelte +21 -18
- package/dist/components/toggle-group/toggle-group.svelte +22 -19
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -3
|
@@ -20,14 +20,21 @@
|
|
|
20
20
|
.toUpperCase();
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
let {
|
|
23
|
+
let {
|
|
24
|
+
src,
|
|
25
|
+
alt,
|
|
26
|
+
fallback,
|
|
27
|
+
size = 'md',
|
|
28
|
+
class: className,
|
|
29
|
+
...rest
|
|
30
|
+
}: AvatarProps & { class?: string } = $props();
|
|
24
31
|
|
|
25
32
|
const displayFallback = $derived(fallback ? getInitials(fallback) : '');
|
|
26
33
|
</script>
|
|
27
34
|
|
|
28
35
|
<Avatar.Root
|
|
29
36
|
class={cn(
|
|
30
|
-
'inline-flex items-center justify-center
|
|
37
|
+
'relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-surface-2 font-medium text-ink select-none',
|
|
31
38
|
sizeClasses[size],
|
|
32
39
|
className
|
|
33
40
|
)}
|
|
@@ -36,7 +43,7 @@
|
|
|
36
43
|
<Avatar.Image
|
|
37
44
|
{src}
|
|
38
45
|
{alt}
|
|
39
|
-
class="
|
|
46
|
+
class="h-full w-full rounded-[inherit] object-cover data-[state=hidden]:hidden"
|
|
40
47
|
/>
|
|
41
48
|
<Avatar.Fallback class="data-[state=hidden]:hidden">
|
|
42
49
|
{displayFallback}
|
|
@@ -4,12 +4,14 @@ export declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
4
4
|
default: string;
|
|
5
5
|
outline: string;
|
|
6
6
|
ghost: string;
|
|
7
|
+
destructive: string;
|
|
7
8
|
};
|
|
8
9
|
size: {
|
|
9
10
|
sm: string;
|
|
10
11
|
default: string;
|
|
11
12
|
lg: string;
|
|
12
13
|
icon: string;
|
|
14
|
+
"icon-xs": string;
|
|
13
15
|
'icon-sm': string;
|
|
14
16
|
'icon-lg': string;
|
|
15
17
|
};
|
|
@@ -18,12 +20,14 @@ export declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
18
20
|
default: string;
|
|
19
21
|
outline: string;
|
|
20
22
|
ghost: string;
|
|
23
|
+
destructive: string;
|
|
21
24
|
};
|
|
22
25
|
size: {
|
|
23
26
|
sm: string;
|
|
24
27
|
default: string;
|
|
25
28
|
lg: string;
|
|
26
29
|
icon: string;
|
|
30
|
+
"icon-xs": string;
|
|
27
31
|
'icon-sm': string;
|
|
28
32
|
'icon-lg': string;
|
|
29
33
|
};
|
|
@@ -32,12 +36,14 @@ export declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
32
36
|
default: string;
|
|
33
37
|
outline: string;
|
|
34
38
|
ghost: string;
|
|
39
|
+
destructive: string;
|
|
35
40
|
};
|
|
36
41
|
size: {
|
|
37
42
|
sm: string;
|
|
38
43
|
default: string;
|
|
39
44
|
lg: string;
|
|
40
45
|
icon: string;
|
|
46
|
+
"icon-xs": string;
|
|
41
47
|
'icon-sm': string;
|
|
42
48
|
'icon-lg': string;
|
|
43
49
|
};
|
|
@@ -5,13 +5,15 @@ export const button = tv({
|
|
|
5
5
|
variant: {
|
|
6
6
|
default: 'bg-primary text-ink-inverse hover:bg-primary/90 active:bg-primary/80',
|
|
7
7
|
outline: 'border text-ink hover:bg-surface-2',
|
|
8
|
-
ghost: 'text-ink hover:bg-surface-2'
|
|
8
|
+
ghost: 'text-ink hover:bg-surface-2',
|
|
9
|
+
destructive: 'bg-danger text-ink-inverse hover:bg-danger/90 active:bg-danger/80'
|
|
9
10
|
},
|
|
10
11
|
size: {
|
|
11
12
|
sm: 'h-8 gap-1.5 px-2',
|
|
12
13
|
default: 'h-9 gap-2 px-3',
|
|
13
14
|
lg: 'h-10 gap-2.5 px-4',
|
|
14
15
|
icon: 'size-9',
|
|
16
|
+
"icon-xs": "size-6",
|
|
15
17
|
'icon-sm': 'size-8',
|
|
16
18
|
'icon-lg': 'size-10'
|
|
17
19
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerBackdropBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends DrawerBackdropBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Drawer.Backdrop {...rest} class={className ?? 'fixed inset-0 z-50 bg-black/50'} />
|
|
13
|
+
|
|
14
|
+
<style>
|
|
15
|
+
:global([data-scope='drawer'][data-part='backdrop'][data-state='open']) {
|
|
16
|
+
animation: fade-in 0.5s cubic-bezier(0.32, 0.72, 0, 1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:global([data-scope='drawer'][data-part='backdrop'][data-state='closed']) {
|
|
20
|
+
animation: fade-out 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes fade-in {
|
|
24
|
+
from {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
}
|
|
27
|
+
to {
|
|
28
|
+
opacity: 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@keyframes fade-out {
|
|
33
|
+
from {
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
36
|
+
to {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerBackdropBaseProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends DrawerBackdropBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerBackdrop: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type DrawerBackdrop = ReturnType<typeof DrawerBackdrop>;
|
|
7
|
+
export default DrawerBackdrop;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerCloseTriggerBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends DrawerCloseTriggerBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Drawer.CloseTrigger
|
|
13
|
+
{...rest}
|
|
14
|
+
onclick={()=>console.log("Click:")}
|
|
15
|
+
class={className ??
|
|
16
|
+
'absolute top-12 right-4 flex h-7 w-7 cursor-pointer items-center justify-center rounded border-none bg-transparent text-ink-dim hover:bg-surface-2 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-[-1px]'}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</Drawer.CloseTrigger>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerCloseTriggerBaseProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends DrawerCloseTriggerBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerCloseTrigger: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type DrawerCloseTrigger = ReturnType<typeof DrawerCloseTrigger>;
|
|
7
|
+
export default DrawerCloseTrigger;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerContentBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends DrawerContentBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Drawer.Content
|
|
13
|
+
{...rest}
|
|
14
|
+
class={className ??
|
|
15
|
+
'relative flex h-full max-h-[96svh] w-full flex-col rounded-t-2xl bg-surface-1 px-5 shadow-xl outline-none data-[swipe-direction=left]:rounded-none data-[swipe-direction=left]:rounded-r-2xl data-[swipe-direction=right]:rounded-none data-[swipe-direction=right]:rounded-l-2xl data-[swipe-direction=up]:rounded-none data-[swipe-direction=up]:rounded-b-2xl'}
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</Drawer.Content>
|
|
19
|
+
|
|
20
|
+
<style>
|
|
21
|
+
/* Bottom bleed pseudo-element so background extends below rounded corners */
|
|
22
|
+
:global([data-scope='drawer'][data-part='content'])::after {
|
|
23
|
+
content: '';
|
|
24
|
+
position: absolute;
|
|
25
|
+
bottom: -50px;
|
|
26
|
+
left: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
height: 50px;
|
|
29
|
+
background: inherit;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Slide animations for bottom drawer (default) */
|
|
33
|
+
:global(
|
|
34
|
+
[data-scope='drawer'][data-part='content']:not([data-swipe-direction])[data-state='open'],
|
|
35
|
+
[data-scope='drawer'][data-part='content'][data-swipe-direction='down'][data-state='open']
|
|
36
|
+
) {
|
|
37
|
+
animation: slide-in-bottom 0.5s cubic-bezier(0.32, 0.72, 0, 1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:global(
|
|
41
|
+
[data-scope='drawer'][data-part='content']:not([data-swipe-direction])[data-state='closed'],
|
|
42
|
+
[data-scope='drawer'][data-part='content'][data-swipe-direction='down'][data-state='closed']
|
|
43
|
+
) {
|
|
44
|
+
animation: slide-out-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Slide animations for top drawer */
|
|
48
|
+
:global(
|
|
49
|
+
[data-scope='drawer'][data-part='content'][data-swipe-direction='up'][data-state='open']
|
|
50
|
+
) {
|
|
51
|
+
animation: slide-in-top 0.5s cubic-bezier(0.32, 0.72, 0, 1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:global(
|
|
55
|
+
[data-scope='drawer'][data-part='content'][data-swipe-direction='up'][data-state='closed']
|
|
56
|
+
) {
|
|
57
|
+
animation: slide-out-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Slide animations for left drawer */
|
|
61
|
+
:global(
|
|
62
|
+
[data-scope='drawer'][data-part='content'][data-swipe-direction='left'][data-state='open']
|
|
63
|
+
) {
|
|
64
|
+
animation: slide-in-left 0.5s cubic-bezier(0.32, 0.72, 0, 1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:global(
|
|
68
|
+
[data-scope='drawer'][data-part='content'][data-swipe-direction='left'][data-state='closed']
|
|
69
|
+
) {
|
|
70
|
+
animation: slide-out-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Slide animations for right drawer */
|
|
74
|
+
:global(
|
|
75
|
+
[data-scope='drawer'][data-part='content'][data-swipe-direction='right'][data-state='open']
|
|
76
|
+
) {
|
|
77
|
+
animation: slide-in-right 0.5s cubic-bezier(0.32, 0.72, 0, 1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:global(
|
|
81
|
+
[data-scope='drawer'][data-part='content'][data-swipe-direction='right'][data-state='closed']
|
|
82
|
+
) {
|
|
83
|
+
animation: slide-out-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes slide-in-bottom {
|
|
87
|
+
from {
|
|
88
|
+
transform: translate3d(0, 100%, 0);
|
|
89
|
+
}
|
|
90
|
+
to {
|
|
91
|
+
transform: translate3d(var(--drawer-translate-x, 0), var(--drawer-translate-y, 0), 0);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@keyframes slide-out-bottom {
|
|
96
|
+
from {
|
|
97
|
+
transform: translate3d(var(--drawer-translate-x, 0), var(--drawer-translate-y, 0), 0);
|
|
98
|
+
}
|
|
99
|
+
to {
|
|
100
|
+
transform: translate3d(0, 100%, 0);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@keyframes slide-in-top {
|
|
105
|
+
from {
|
|
106
|
+
transform: translate3d(0, -100%, 0);
|
|
107
|
+
}
|
|
108
|
+
to {
|
|
109
|
+
transform: translate3d(var(--drawer-translate-x, 0), var(--drawer-translate-y, 0), 0);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@keyframes slide-out-top {
|
|
114
|
+
from {
|
|
115
|
+
transform: translate3d(var(--drawer-translate-x, 0), var(--drawer-translate-y, 0), 0);
|
|
116
|
+
}
|
|
117
|
+
to {
|
|
118
|
+
transform: translate3d(0, -100%, 0);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes slide-in-left {
|
|
123
|
+
from {
|
|
124
|
+
transform: translate3d(-100%, 0, 0);
|
|
125
|
+
}
|
|
126
|
+
to {
|
|
127
|
+
transform: translate3d(var(--drawer-translate-x, 0), var(--drawer-translate-y, 0), 0);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@keyframes slide-out-left {
|
|
132
|
+
from {
|
|
133
|
+
transform: translate3d(var(--drawer-translate-x, 0), var(--drawer-translate-y, 0), 0);
|
|
134
|
+
}
|
|
135
|
+
to {
|
|
136
|
+
transform: translate3d(-100%, 0, 0);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@keyframes slide-in-right {
|
|
141
|
+
from {
|
|
142
|
+
transform: translate3d(100%, 0, 0);
|
|
143
|
+
}
|
|
144
|
+
to {
|
|
145
|
+
transform: translate3d(var(--drawer-translate-x, 0), var(--drawer-translate-y, 0), 0);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@keyframes slide-out-right {
|
|
150
|
+
from {
|
|
151
|
+
transform: translate3d(var(--drawer-translate-x, 0), var(--drawer-translate-y, 0), 0);
|
|
152
|
+
}
|
|
153
|
+
to {
|
|
154
|
+
transform: translate3d(100%, 0, 0);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerContentBaseProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends DrawerContentBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerContent: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type DrawerContent = ReturnType<typeof DrawerContent>;
|
|
7
|
+
export default DrawerContent;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerGrabberIndicatorBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends DrawerGrabberIndicatorBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Drawer.GrabberIndicator {...rest} class={className ?? 'h-1 w-10 rounded-full bg-border'} />
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerGrabberIndicatorBaseProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends DrawerGrabberIndicatorBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerGrabberIndicator: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type DrawerGrabberIndicator = ReturnType<typeof DrawerGrabberIndicator>;
|
|
7
|
+
export default DrawerGrabberIndicator;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerGrabberBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends DrawerGrabberBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Drawer.Grabber
|
|
13
|
+
{...rest}
|
|
14
|
+
class={className ??
|
|
15
|
+
'flex w-full shrink-0 cursor-grab touch-none items-center justify-center py-5 select-none active:cursor-grabbing'}
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</Drawer.Grabber>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerGrabberBaseProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends DrawerGrabberBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerGrabber: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type DrawerGrabber = ReturnType<typeof DrawerGrabber>;
|
|
7
|
+
export default DrawerGrabber;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerPositionerBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends DrawerPositionerBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Drawer.Positioner
|
|
13
|
+
{...rest}
|
|
14
|
+
class={className ??
|
|
15
|
+
'fixed inset-0 z-50 flex items-end justify-center data-[swipe-direction=left]:items-stretch data-[swipe-direction=left]:justify-start data-[swipe-direction=right]:items-stretch data-[swipe-direction=right]:justify-end data-[swipe-direction=up]:items-start'}
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</Drawer.Positioner>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerPositionerBaseProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends DrawerPositionerBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerPositioner: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type DrawerPositioner = ReturnType<typeof DrawerPositioner>;
|
|
7
|
+
export default DrawerPositioner;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerRootProps, DrawerOpenChangeDetails } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends Omit<DrawerRootProps, 'open' | 'onOpenChange'> {
|
|
6
|
+
open?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { children, open = $bindable(), ...rest }: Props = $props();
|
|
10
|
+
|
|
11
|
+
const handleOpenChange = (details: DrawerOpenChangeDetails) => {
|
|
12
|
+
open = details.open;
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<Drawer.Root {open} onOpenChange={handleOpenChange} {...rest}>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</Drawer.Root>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerRootProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends Omit<DrawerRootProps, 'open' | 'onOpenChange'> {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerRoot: import("svelte").Component<Props, {}, "open">;
|
|
6
|
+
type DrawerRoot = ReturnType<typeof DrawerRoot>;
|
|
7
|
+
export default DrawerRoot;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerTitleBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends DrawerTitleBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Drawer.Title {...rest} class={className ?? 'mb-2 text-lg leading-7 font-medium text-ink'}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</Drawer.Title>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerTitleBaseProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends DrawerTitleBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerTitle: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type DrawerTitle = ReturnType<typeof DrawerTitle>;
|
|
7
|
+
export default DrawerTitle;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
|
+
import type { DrawerTriggerBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
|
+
|
|
5
|
+
interface Props extends DrawerTriggerBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Drawer.Trigger {...rest} class={className}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</Drawer.Trigger>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerTriggerBaseProps } from '@ark-ui/svelte/drawer';
|
|
2
|
+
interface Props extends DrawerTriggerBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const DrawerTrigger: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type DrawerTrigger = ReturnType<typeof DrawerTrigger>;
|
|
7
|
+
export default DrawerTrigger;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Root } from './drawer-root.svelte';
|
|
2
|
+
export { default as Trigger } from './drawer-trigger.svelte';
|
|
3
|
+
export { default as Backdrop } from './drawer-backdrop.svelte';
|
|
4
|
+
export { default as Positioner } from './drawer-positioner.svelte';
|
|
5
|
+
export { default as Content } from './drawer-content.svelte';
|
|
6
|
+
export { default as Grabber } from './drawer-grabber.svelte';
|
|
7
|
+
export { default as GrabberIndicator } from './drawer-grabber-indicator.svelte';
|
|
8
|
+
export { default as Title } from './drawer-title.svelte';
|
|
9
|
+
export { default as CloseTrigger } from './drawer-close-trigger.svelte';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Root } from './drawer-root.svelte';
|
|
2
|
+
export { default as Trigger } from './drawer-trigger.svelte';
|
|
3
|
+
export { default as Backdrop } from './drawer-backdrop.svelte';
|
|
4
|
+
export { default as Positioner } from './drawer-positioner.svelte';
|
|
5
|
+
export { default as Content } from './drawer-content.svelte';
|
|
6
|
+
export { default as Grabber } from './drawer-grabber.svelte';
|
|
7
|
+
export { default as GrabberIndicator } from './drawer-grabber-indicator.svelte';
|
|
8
|
+
export { default as Title } from './drawer-title.svelte';
|
|
9
|
+
export { default as CloseTrigger } from './drawer-close-trigger.svelte';
|
|
@@ -112,9 +112,7 @@
|
|
|
112
112
|
>
|
|
113
113
|
<PhArrowClockwise class="size-4" />
|
|
114
114
|
</Button>
|
|
115
|
-
<Button variant="outline" size="sm" onclick={handleTrim} disabled={trimming}>
|
|
116
|
-
Trim
|
|
117
|
-
</Button>
|
|
115
|
+
<Button variant="outline" size="sm" onclick={handleTrim} disabled={trimming}>Trim</Button>
|
|
118
116
|
</div>
|
|
119
117
|
</div>
|
|
120
118
|
<p>Width: {cropData.width}px / Height: {cropData.height}px</p>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { default as Root } from './tabs.svelte';
|
|
2
|
+
export { default as List } from './tab-list.svelte';
|
|
2
3
|
export { default as Trigger } from './tab-trigger.svelte';
|
|
4
|
+
export { default as Indicator } from './tab-indicator.svelte';
|
|
3
5
|
export { default as Content } from './tab-content.svelte';
|
|
4
6
|
export type { TabsProps } from './types';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { default as Root } from './tabs.svelte';
|
|
2
|
+
export { default as List } from './tab-list.svelte';
|
|
2
3
|
export { default as Trigger } from './tab-trigger.svelte';
|
|
4
|
+
export { default as Indicator } from './tab-indicator.svelte';
|
|
3
5
|
export { default as Content } from './tab-content.svelte';
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<Tabs.Content
|
|
13
13
|
{...rest}
|
|
14
14
|
class={className ??
|
|
15
|
-
'flex-1 pt-4 outline-none data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4'}
|
|
15
|
+
'flex-1 pt-4 outline-none focus-visible:rounded-sm focus-visible:outline-2 focus-visible:-outline-offset-2 data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4'}
|
|
16
16
|
>
|
|
17
17
|
{@render children?.()}
|
|
18
18
|
</Tabs.Content>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Tabs } from '@ark-ui/svelte/tabs';
|
|
3
|
+
import type { TabIndicatorBaseProps } from '@ark-ui/svelte/tabs';
|
|
4
|
+
|
|
5
|
+
interface Props extends TabIndicatorBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Tabs.Indicator
|
|
13
|
+
{...rest}
|
|
14
|
+
class={className ??
|
|
15
|
+
"absolute -z-10 rounded-md bg-surface-2 transition-[width,height,left,top] duration-200 ease-out data-[orientation='horizontal']:h-8 data-[orientation='horizontal']:w-(--width) data-[orientation='vertical']:h-(--height) data-[orientation='vertical']:w-full"}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TabIndicatorBaseProps } from '@ark-ui/svelte/tabs';
|
|
2
|
+
interface Props extends TabIndicatorBaseProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const TabIndicator: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type TabIndicator = ReturnType<typeof TabIndicator>;
|
|
7
|
+
export default TabIndicator;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Tabs } from '@ark-ui/svelte/tabs';
|
|
3
|
+
import type { TabListBaseProps } from '@ark-ui/svelte/tabs';
|
|
4
|
+
|
|
5
|
+
interface Props extends TabListBaseProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Tabs.List
|
|
13
|
+
{...rest}
|
|
14
|
+
class={className ??
|
|
15
|
+
"relative isolate inline-flex gap-1 data-[orientation='horizontal']:flex-row data-[orientation='vertical']:flex-col"}
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</Tabs.List>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<Tabs.Trigger
|
|
13
13
|
{...rest}
|
|
14
14
|
class={className ??
|
|
15
|
-
'inline-flex h-8 items-center justify-center gap-2 rounded-md bg-transparent px-3 text-sm whitespace-nowrap text-ink-dim transition-colors outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 data-selected:font-medium data-selected:text-ink data-[orientation=vertical]:w-full data-[orientation=vertical]:justify-start data-[orientation=vertical]:py-2'}
|
|
15
|
+
'inline-flex h-8 items-center justify-center gap-2 rounded-md bg-transparent px-3 text-sm whitespace-nowrap text-ink-dim transition-colors outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-disabled:grayscale data-selected:font-medium data-selected:text-ink data-[orientation=vertical]:w-full data-[orientation=vertical]:justify-start data-[orientation=vertical]:py-2'}
|
|
16
16
|
>
|
|
17
17
|
{@render children?.()}
|
|
18
18
|
</Tabs.Trigger>
|
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
import type { TabsProps } from './types';
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
|
-
indicator = false,
|
|
8
7
|
value = $bindable(),
|
|
9
8
|
defaultValue,
|
|
10
9
|
orientation = 'horizontal',
|
|
11
|
-
triggers,
|
|
12
10
|
children,
|
|
13
11
|
...rootProps
|
|
14
12
|
}: TabsProps = $props();
|
|
@@ -22,18 +20,6 @@
|
|
|
22
20
|
{orientation}
|
|
23
21
|
class="flex data-[orientation='horizontal']:flex-col data-[orientation='vertical']:flex-row"
|
|
24
22
|
>
|
|
25
|
-
<Tabs.List
|
|
26
|
-
class="relative isolate inline-flex gap-1 data-[orientation='horizontal']:flex-row data-[orientation='vertical']:flex-col"
|
|
27
|
-
>
|
|
28
|
-
{#if triggers}
|
|
29
|
-
{@render triggers()}
|
|
30
|
-
{/if}
|
|
31
|
-
{#if indicator}
|
|
32
|
-
<Tabs.Indicator
|
|
33
|
-
class="absolute -z-10 rounded-md bg-surface-2 transition-[width,height,left,top] duration-200 ease-out data-[orientation='horizontal']:h-8 data-[orientation='horizontal']:w-(--width) data-[orientation='vertical']:h-(--height) data-[orientation='vertical']:w-full"
|
|
34
|
-
/>
|
|
35
|
-
{/if}
|
|
36
|
-
</Tabs.List>
|
|
37
23
|
{@render children?.()}
|
|
38
24
|
</Tabs.Root>
|
|
39
25
|
</ClientOnly>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tabs } from '@ark-ui/svelte/tabs';
|
|
2
|
-
|
|
3
|
-
declare const Tabs: import("svelte").Component<TabsProps, {}, "value">;
|
|
2
|
+
declare const Tabs: import("svelte").Component<Tabs.RootBaseProps, {}, "value">;
|
|
4
3
|
type Tabs = ReturnType<typeof Tabs>;
|
|
5
4
|
export default Tabs;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import type { TabsRootBaseProps } from '@ark-ui/svelte/tabs';
|
|
2
|
-
|
|
3
|
-
export interface TabsProps extends TabsRootBaseProps {
|
|
4
|
-
/** Whether to show the animated indicator behind the active tab */
|
|
5
|
-
indicator?: boolean;
|
|
6
|
-
/** Snippet for rendering tab triggers inside the list */
|
|
7
|
-
triggers?: Snippet;
|
|
8
|
-
}
|
|
2
|
+
export type TabsProps = TabsRootBaseProps;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { ToggleGroup } from '@ark-ui/svelte/toggle-group';
|
|
3
|
-
import type { ToggleGroupItemBaseProps } from '@ark-ui/svelte/toggle-group';
|
|
4
|
-
import { cn } from 'tailwind-variants';
|
|
5
|
-
|
|
6
|
-
interface Props extends ToggleGroupItemBaseProps {
|
|
7
|
-
class?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
let { class: className, children, ...rest }: Props = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<ToggleGroup.Item
|
|
14
|
-
{...rest}
|
|
15
|
-
class={cn(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ToggleGroup } from '@ark-ui/svelte/toggle-group';
|
|
3
|
+
import type { ToggleGroupItemBaseProps } from '@ark-ui/svelte/toggle-group';
|
|
4
|
+
import { cn } from 'tailwind-variants';
|
|
5
|
+
|
|
6
|
+
interface Props extends ToggleGroupItemBaseProps {
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { class: className, children, ...rest }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<ToggleGroup.Item
|
|
14
|
+
{...rest}
|
|
15
|
+
class={cn(
|
|
16
|
+
'inline-flex h-8 w-8 items-center justify-center rounded-md text-sm text-ink-dim transition-colors select-none hover:bg-surface-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[state=on]:bg-surface-2 data-[state=on]:text-ink data-[state=on]:shadow-sm',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</ToggleGroup.Item>
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { ToggleGroup } from '@ark-ui/svelte/toggle-group';
|
|
3
|
-
import type { ToggleGroupRootBaseProps } from '@ark-ui/svelte/toggle-group';
|
|
4
|
-
import { cn } from 'tailwind-variants';
|
|
5
|
-
|
|
6
|
-
interface Props extends ToggleGroupRootBaseProps {
|
|
7
|
-
class?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
let { class: className, children, value = $bindable(), ...rootProps }: Props = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<ToggleGroup.Root
|
|
14
|
-
{...rootProps}
|
|
15
|
-
bind:value
|
|
16
|
-
class={cn(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ToggleGroup } from '@ark-ui/svelte/toggle-group';
|
|
3
|
+
import type { ToggleGroupRootBaseProps } from '@ark-ui/svelte/toggle-group';
|
|
4
|
+
import { cn } from 'tailwind-variants';
|
|
5
|
+
|
|
6
|
+
interface Props extends ToggleGroupRootBaseProps {
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { class: className, children, value = $bindable(), ...rootProps }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<ToggleGroup.Root
|
|
14
|
+
{...rootProps}
|
|
15
|
+
bind:value
|
|
16
|
+
class={cn(
|
|
17
|
+
'inline-flex gap-1 rounded-lg border border-border bg-surface-1 p-1 data-[orientation=vertical]:flex-col',
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</ToggleGroup.Root>
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { default as Combobox } from './components/combobox/combobox.svelte';
|
|
|
14
14
|
export { default as Dialog } from './components/dialog/dialog.svelte';
|
|
15
15
|
export { default as AlertDialog } from './components/dialog/alert-dialog.svelte';
|
|
16
16
|
export type { DialogProps, AlertDialogProps } from './components/dialog/dialog.types';
|
|
17
|
+
export * as Drawer from './components/drawer';
|
|
17
18
|
export { default as FileUploadDropzone } from './components/file-upload/file-upload-dropzone.svelte';
|
|
18
19
|
export { default as FileUpload } from './components/file-upload/file-upload.svelte';
|
|
19
20
|
export type { FileUploadProps, FileUploadFileChangeDetails, FileType } from './components/file-upload/types';
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { default as CheckboxGroup } from './components/checkbox/checkbox-group.s
|
|
|
12
12
|
export { default as Combobox } from './components/combobox/combobox.svelte';
|
|
13
13
|
export { default as Dialog } from './components/dialog/dialog.svelte';
|
|
14
14
|
export { default as AlertDialog } from './components/dialog/alert-dialog.svelte';
|
|
15
|
+
export * as Drawer from './components/drawer';
|
|
15
16
|
export { default as FileUploadDropzone } from './components/file-upload/file-upload-dropzone.svelte';
|
|
16
17
|
export { default as FileUpload } from './components/file-upload/file-upload.svelte';
|
|
17
18
|
export { default as ImageCropper } from './components/image-cropper/image-cropper.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compote-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
@@ -58,8 +58,7 @@
|
|
|
58
58
|
"typescript": "^6.0.3",
|
|
59
59
|
"typescript-eslint": "^8.58.2",
|
|
60
60
|
"unplugin-icons": "^23.0.1",
|
|
61
|
-
"vite": "^8.0.10"
|
|
62
|
-
"vite-plugin-devtools-json": "^1.0.0"
|
|
61
|
+
"vite": "^8.0.10"
|
|
63
62
|
},
|
|
64
63
|
"keywords": [
|
|
65
64
|
"svelte"
|