compote-ui 0.27.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/components/button/button.variants.d.ts +6 -0
  2. package/dist/components/button/button.variants.js +3 -1
  3. package/dist/components/dialog/dialog-close-trigger.svelte +24 -0
  4. package/dist/components/dialog/dialog-close-trigger.svelte.d.ts +7 -0
  5. package/dist/components/dialog/dialog-description.svelte +14 -0
  6. package/dist/components/dialog/dialog-description.svelte.d.ts +7 -0
  7. package/dist/components/dialog/dialog-footer.svelte +14 -0
  8. package/dist/components/dialog/dialog-footer.svelte.d.ts +8 -0
  9. package/dist/components/dialog/dialog-title.svelte +14 -0
  10. package/dist/components/dialog/dialog-title.svelte.d.ts +7 -0
  11. package/dist/components/dialog/dialog-trigger.svelte +14 -0
  12. package/dist/components/dialog/dialog-trigger.svelte.d.ts +7 -0
  13. package/dist/components/dialog/dialog.svelte +1 -27
  14. package/dist/components/dialog/dialog.types.d.ts +0 -3
  15. package/dist/components/dialog/index.d.ts +7 -0
  16. package/dist/components/dialog/index.js +6 -0
  17. package/dist/components/drawer/drawer-backdrop.svelte +40 -0
  18. package/dist/components/drawer/drawer-backdrop.svelte.d.ts +7 -0
  19. package/dist/components/drawer/drawer-close-trigger.svelte +19 -0
  20. package/dist/components/drawer/drawer-close-trigger.svelte.d.ts +7 -0
  21. package/dist/components/drawer/drawer-content.svelte +157 -0
  22. package/dist/components/drawer/drawer-content.svelte.d.ts +7 -0
  23. package/dist/components/drawer/drawer-grabber-indicator.svelte +12 -0
  24. package/dist/components/drawer/drawer-grabber-indicator.svelte.d.ts +7 -0
  25. package/dist/components/drawer/drawer-grabber.svelte +18 -0
  26. package/dist/components/drawer/drawer-grabber.svelte.d.ts +7 -0
  27. package/dist/components/drawer/drawer-positioner.svelte +18 -0
  28. package/dist/components/drawer/drawer-positioner.svelte.d.ts +7 -0
  29. package/dist/components/drawer/drawer-root.svelte +18 -0
  30. package/dist/components/drawer/drawer-root.svelte.d.ts +7 -0
  31. package/dist/components/drawer/drawer-title.svelte +14 -0
  32. package/dist/components/drawer/drawer-title.svelte.d.ts +7 -0
  33. package/dist/components/drawer/drawer-trigger.svelte +14 -0
  34. package/dist/components/drawer/drawer-trigger.svelte.d.ts +7 -0
  35. package/dist/components/drawer/index.d.ts +9 -0
  36. package/dist/components/drawer/index.js +9 -0
  37. package/dist/index.d.ts +3 -2
  38. package/dist/index.js +2 -1
  39. package/package.json +4 -5
@@ -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,24 @@
1
+ <script lang="ts">
2
+ import { Dialog } from '@ark-ui/svelte/dialog';
3
+ import type { DialogCloseTriggerBaseProps } from '@ark-ui/svelte/dialog';
4
+ import { PhX } from '../../icons';
5
+
6
+ interface Props extends DialogCloseTriggerBaseProps {
7
+ class?: string;
8
+ }
9
+
10
+ let { class: className, children, ...rest }: Props = $props();
11
+ </script>
12
+
13
+ <Dialog.CloseTrigger
14
+ {...rest}
15
+ class={className ??
16
+ 'absolute top-3 right-3 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none active:opacity-50'}
17
+ >
18
+ {#if children}
19
+ {@render children()}
20
+ {:else}
21
+ <PhX class="size-4" />
22
+ <span class="sr-only">Close</span>
23
+ {/if}
24
+ </Dialog.CloseTrigger>
@@ -0,0 +1,7 @@
1
+ import type { DialogCloseTriggerBaseProps } from '@ark-ui/svelte/dialog';
2
+ interface Props extends DialogCloseTriggerBaseProps {
3
+ class?: string;
4
+ }
5
+ declare const DialogCloseTrigger: import("svelte").Component<Props, {}, "">;
6
+ type DialogCloseTrigger = ReturnType<typeof DialogCloseTrigger>;
7
+ export default DialogCloseTrigger;
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import { Dialog } from '@ark-ui/svelte/dialog';
3
+ import type { DialogDescriptionBaseProps } from '@ark-ui/svelte/dialog';
4
+
5
+ interface Props extends DialogDescriptionBaseProps {
6
+ class?: string;
7
+ }
8
+
9
+ let { class: className, children, ...rest }: Props = $props();
10
+ </script>
11
+
12
+ <Dialog.Description {...rest} class={className ?? 'mt-1 text-sm text-ink-dim'}>
13
+ {@render children?.()}
14
+ </Dialog.Description>
@@ -0,0 +1,7 @@
1
+ import type { DialogDescriptionBaseProps } from '@ark-ui/svelte/dialog';
2
+ interface Props extends DialogDescriptionBaseProps {
3
+ class?: string;
4
+ }
5
+ declare const DialogDescription: import("svelte").Component<Props, {}, "">;
6
+ type DialogDescription = ReturnType<typeof DialogDescription>;
7
+ export default DialogDescription;
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ class?: string;
6
+ children: Snippet;
7
+ }
8
+
9
+ let { class: className, children }: Props = $props();
10
+ </script>
11
+
12
+ <div class={className ?? 'mt-4 flex justify-end gap-3'}>
13
+ {@render children()}
14
+ </div>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ class?: string;
4
+ children: Snippet;
5
+ }
6
+ declare const DialogFooter: import("svelte").Component<Props, {}, "">;
7
+ type DialogFooter = ReturnType<typeof DialogFooter>;
8
+ export default DialogFooter;
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import { Dialog } from '@ark-ui/svelte/dialog';
3
+ import type { DialogTitleBaseProps } from '@ark-ui/svelte/dialog';
4
+
5
+ interface Props extends DialogTitleBaseProps {
6
+ class?: string;
7
+ }
8
+
9
+ let { class: className, children, ...rest }: Props = $props();
10
+ </script>
11
+
12
+ <Dialog.Title {...rest} class={className ?? 'text-lg font-semibold'}>
13
+ {@render children?.()}
14
+ </Dialog.Title>
@@ -0,0 +1,7 @@
1
+ import type { DialogTitleBaseProps } from '@ark-ui/svelte/dialog';
2
+ interface Props extends DialogTitleBaseProps {
3
+ class?: string;
4
+ }
5
+ declare const DialogTitle: import("svelte").Component<Props, {}, "">;
6
+ type DialogTitle = ReturnType<typeof DialogTitle>;
7
+ export default DialogTitle;
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import { Dialog } from '@ark-ui/svelte/dialog';
3
+ import type { DialogTriggerBaseProps } from '@ark-ui/svelte/dialog';
4
+
5
+ interface Props extends DialogTriggerBaseProps {
6
+ class?: string;
7
+ }
8
+
9
+ let { class: className, children, ...rest }: Props = $props();
10
+ </script>
11
+
12
+ <Dialog.Trigger {...rest} class={className}>
13
+ {@render children?.()}
14
+ </Dialog.Trigger>
@@ -0,0 +1,7 @@
1
+ import type { DialogTriggerBaseProps } from '@ark-ui/svelte/dialog';
2
+ interface Props extends DialogTriggerBaseProps {
3
+ class?: string;
4
+ }
5
+ declare const DialogTrigger: import("svelte").Component<Props, {}, "">;
6
+ type DialogTrigger = ReturnType<typeof DialogTrigger>;
7
+ export default DialogTrigger;
@@ -2,15 +2,11 @@
2
2
  import { Dialog } from '@ark-ui/svelte/dialog';
3
3
  import { Portal } from '@ark-ui/svelte/portal';
4
4
  import { cn } from 'tailwind-variants';
5
- import { PhX } from '../../icons';
6
5
  import type { DialogProps } from './dialog.types';
7
6
 
8
7
  let {
9
8
  open = $bindable(),
10
- title,
11
- description,
12
9
  children,
13
- footer,
14
10
  contentClass,
15
11
  lazyMount = true,
16
12
  unmountOnExit = true,
@@ -30,29 +26,7 @@
30
26
  contentClass
31
27
  )}
32
28
  >
33
- <Dialog.Title class="text-lg font-semibold">{title}</Dialog.Title>
34
- {#if description}
35
- <Dialog.Description class="mt-1 text-sm text-ink-dim">
36
- {description}
37
- </Dialog.Description>
38
- {/if}
39
-
40
- <div class="mt-4">
41
- {@render children()}
42
- </div>
43
-
44
- {#if footer}
45
- <div class="mt-4 flex justify-end gap-3">
46
- {@render footer()}
47
- </div>
48
- {/if}
49
-
50
- <Dialog.CloseTrigger
51
- class="absolute top-3 right-3 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none active:opacity-50"
52
- >
53
- <PhX class="size-4" />
54
- <span class="sr-only">Close</span>
55
- </Dialog.CloseTrigger>
29
+ {@render children()}
56
30
  </Dialog.Content>
57
31
  </Dialog.Positioner>
58
32
  </Portal>
@@ -4,10 +4,7 @@ export type { DialogRootBaseProps };
4
4
  type DialogSharedProps = Pick<DialogRootBaseProps, 'closeOnEscape' | 'closeOnInteractOutside' | 'onOpenChange' | 'lazyMount' | 'unmountOnExit'>;
5
5
  export interface DialogProps extends DialogSharedProps {
6
6
  open: boolean;
7
- title: string;
8
- description?: string;
9
7
  children: Snippet;
10
- footer?: Snippet;
11
8
  contentClass?: string;
12
9
  initialFocusEl?: DialogRootBaseProps['initialFocusEl'];
13
10
  }
@@ -0,0 +1,7 @@
1
+ export { default as Root } from './dialog.svelte';
2
+ export { default as Title } from './dialog-title.svelte';
3
+ export { default as Description } from './dialog-description.svelte';
4
+ export { default as Trigger } from './dialog-trigger.svelte';
5
+ export { default as CloseTrigger } from './dialog-close-trigger.svelte';
6
+ export { default as Footer } from './dialog-footer.svelte';
7
+ export type { DialogProps, AlertDialogProps, DialogRootBaseProps } from './dialog.types';
@@ -0,0 +1,6 @@
1
+ export { default as Root } from './dialog.svelte';
2
+ export { default as Title } from './dialog-title.svelte';
3
+ export { default as Description } from './dialog-description.svelte';
4
+ export { default as Trigger } from './dialog-trigger.svelte';
5
+ export { default as CloseTrigger } from './dialog-close-trigger.svelte';
6
+ export { default as Footer } from './dialog-footer.svelte';
@@ -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';
package/dist/index.d.ts CHANGED
@@ -11,9 +11,10 @@ export * as Carousel from './components/carousel';
11
11
  export { default as Checkbox } from './components/checkbox/checkbox.svelte';
12
12
  export { default as CheckboxGroup } from './components/checkbox/checkbox-group.svelte';
13
13
  export { default as Combobox } from './components/combobox/combobox.svelte';
14
- export { default as Dialog } from './components/dialog/dialog.svelte';
14
+ export * as Dialog from './components/dialog';
15
15
  export { default as AlertDialog } from './components/dialog/alert-dialog.svelte';
16
- export type { DialogProps, AlertDialogProps } from './components/dialog/dialog.types';
16
+ export type { 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
@@ -10,8 +10,9 @@ export * as Carousel from './components/carousel';
10
10
  export { default as Checkbox } from './components/checkbox/checkbox.svelte';
11
11
  export { default as CheckboxGroup } from './components/checkbox/checkbox-group.svelte';
12
12
  export { default as Combobox } from './components/combobox/combobox.svelte';
13
- export { default as Dialog } from './components/dialog/dialog.svelte';
13
+ export * as Dialog from './components/dialog';
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.27.0",
3
+ "version": "0.29.0",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -50,16 +50,15 @@
50
50
  "globals": "^17.5.0",
51
51
  "prettier": "^3.8.3",
52
52
  "prettier-plugin-svelte": "^3.4.1",
53
- "prettier-plugin-tailwindcss": "^0.7.2",
53
+ "prettier-plugin-tailwindcss": "^0.7.4",
54
54
  "publint": "^0.3.17",
55
55
  "svelte": "^5.55.4",
56
56
  "svelte-check": "^4.4.6",
57
57
  "tailwindcss": "^4.2.4",
58
58
  "typescript": "^6.0.3",
59
- "typescript-eslint": "^8.58.2",
59
+ "typescript-eslint": "^8.59.1",
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"