compote-ui 0.30.2 → 0.31.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.
Files changed (86) hide show
  1. package/dist/components/button/button.svelte +2 -1
  2. package/dist/components/button/button.svelte.d.ts +2 -1
  3. package/dist/components/button/link-button.svelte +2 -1
  4. package/dist/components/button/link-button.svelte.d.ts +2 -1
  5. package/dist/components/collapsible/collapsible-content.svelte +2 -1
  6. package/dist/components/collapsible/collapsible-content.svelte.d.ts +2 -1
  7. package/dist/components/collapsible/collapsible-indicator.svelte +2 -1
  8. package/dist/components/collapsible/collapsible-indicator.svelte.d.ts +2 -1
  9. package/dist/components/collapsible/collapsible-root.svelte +2 -1
  10. package/dist/components/collapsible/collapsible-root.svelte.d.ts +2 -1
  11. package/dist/components/collapsible/collapsible-trigger.svelte +2 -1
  12. package/dist/components/collapsible/collapsible-trigger.svelte.d.ts +2 -1
  13. package/dist/components/combobox/combobox.svelte +1 -1
  14. package/dist/components/dialog/alert-dialog.svelte +2 -2
  15. package/dist/components/dialog/dialog-close-trigger.svelte +2 -1
  16. package/dist/components/dialog/dialog-close-trigger.svelte.d.ts +2 -1
  17. package/dist/components/dialog/dialog-description.svelte +2 -1
  18. package/dist/components/dialog/dialog-description.svelte.d.ts +2 -1
  19. package/dist/components/dialog/dialog-footer.svelte +2 -1
  20. package/dist/components/dialog/dialog-footer.svelte.d.ts +2 -1
  21. package/dist/components/dialog/{dialog.svelte → dialog-root.svelte} +2 -2
  22. package/dist/components/dialog/dialog-root.svelte.d.ts +4 -0
  23. package/dist/components/dialog/dialog-title.svelte +2 -1
  24. package/dist/components/dialog/dialog-title.svelte.d.ts +2 -1
  25. package/dist/components/dialog/dialog-trigger.svelte +2 -1
  26. package/dist/components/dialog/dialog-trigger.svelte.d.ts +2 -1
  27. package/dist/components/dialog/dialog.types.d.ts +2 -1
  28. package/dist/components/dialog/index.d.ts +1 -1
  29. package/dist/components/dialog/index.js +1 -1
  30. package/dist/components/drawer/drawer-backdrop.svelte +12 -30
  31. package/dist/components/drawer/drawer-backdrop.svelte.d.ts +2 -1
  32. package/dist/components/drawer/drawer-close-trigger.svelte +2 -2
  33. package/dist/components/drawer/drawer-close-trigger.svelte.d.ts +2 -1
  34. package/dist/components/drawer/drawer-content.svelte +10 -3
  35. package/dist/components/drawer/drawer-content.svelte.d.ts +2 -1
  36. package/dist/components/drawer/drawer-grabber-indicator.svelte +4 -2
  37. package/dist/components/drawer/drawer-grabber-indicator.svelte.d.ts +2 -1
  38. package/dist/components/drawer/drawer-grabber.svelte +7 -3
  39. package/dist/components/drawer/drawer-grabber.svelte.d.ts +2 -1
  40. package/dist/components/drawer/drawer-positioner.svelte +10 -3
  41. package/dist/components/drawer/drawer-positioner.svelte.d.ts +2 -1
  42. package/dist/components/drawer/drawer-root.svelte +2 -6
  43. package/dist/components/drawer/drawer-title.svelte +4 -2
  44. package/dist/components/drawer/drawer-title.svelte.d.ts +2 -1
  45. package/dist/components/drawer/drawer-trigger.svelte +2 -1
  46. package/dist/components/drawer/drawer-trigger.svelte.d.ts +2 -1
  47. package/dist/components/field/types.d.ts +7 -6
  48. package/dist/components/fieldset/types.d.ts +5 -4
  49. package/dist/components/image-crop-dialog/image-crop-dialog.svelte +8 -7
  50. package/dist/components/listbox/listbox-content.svelte +2 -1
  51. package/dist/components/listbox/listbox-content.svelte.d.ts +2 -1
  52. package/dist/components/listbox/listbox-empty.svelte +2 -1
  53. package/dist/components/listbox/listbox-empty.svelte.d.ts +2 -1
  54. package/dist/components/listbox/listbox-input.svelte +2 -1
  55. package/dist/components/listbox/listbox-input.svelte.d.ts +2 -1
  56. package/dist/components/listbox/listbox-item-group-label.svelte +2 -1
  57. package/dist/components/listbox/listbox-item-group-label.svelte.d.ts +2 -1
  58. package/dist/components/listbox/listbox-item-group.svelte +2 -1
  59. package/dist/components/listbox/listbox-item-group.svelte.d.ts +2 -1
  60. package/dist/components/listbox/listbox-item-indicator.svelte +2 -1
  61. package/dist/components/listbox/listbox-item-indicator.svelte.d.ts +2 -1
  62. package/dist/components/listbox/listbox-item-text.svelte +2 -1
  63. package/dist/components/listbox/listbox-item-text.svelte.d.ts +2 -1
  64. package/dist/components/listbox/listbox-item.svelte +2 -1
  65. package/dist/components/listbox/listbox-item.svelte.d.ts +2 -1
  66. package/dist/components/listbox/listbox-label.svelte +2 -1
  67. package/dist/components/listbox/listbox-label.svelte.d.ts +2 -1
  68. package/dist/components/listbox/listbox-root.svelte +2 -1
  69. package/dist/components/listbox/listbox-root.svelte.d.ts +2 -1
  70. package/dist/components/listbox/listbox-value-text.svelte +2 -1
  71. package/dist/components/listbox/listbox-value-text.svelte.d.ts +2 -1
  72. package/dist/components/select/select.svelte +1 -1
  73. package/dist/components/toggle-group/toggle-group-item.svelte +3 -2
  74. package/dist/components/toggle-group/toggle-group-item.svelte.d.ts +2 -1
  75. package/dist/components/tooltip/index.d.ts +3 -0
  76. package/dist/components/tooltip/index.js +3 -0
  77. package/dist/components/tooltip/tooltip-content.svelte +68 -0
  78. package/dist/components/tooltip/tooltip-content.svelte.d.ts +10 -0
  79. package/dist/components/tooltip/tooltip-root.svelte +15 -0
  80. package/dist/components/tooltip/tooltip-root.svelte.d.ts +8 -0
  81. package/dist/components/tooltip/tooltip-trigger.svelte +30 -0
  82. package/dist/components/tooltip/tooltip-trigger.svelte.d.ts +12 -0
  83. package/dist/index.d.ts +1 -0
  84. package/dist/index.js +1 -0
  85. package/package.json +2 -1
  86. package/dist/components/dialog/dialog.svelte.d.ts +0 -5
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLButtonAttributes } from 'svelte/elements';
3
3
  import { button, type ButtonVariant, type ButtonSize } from './button.variants';
4
+ import type { ClassValue } from 'tailwind-variants';
4
5
 
5
6
  type Props = Omit<HTMLButtonAttributes, 'class'> & {
6
7
  variant?: ButtonVariant;
7
8
  size?: ButtonSize;
8
- class?: string;
9
+ class?: ClassValue;
9
10
  };
10
11
 
11
12
  let { variant, size, class: className, children, ...rest }: Props = $props();
@@ -1,9 +1,10 @@
1
1
  import type { HTMLButtonAttributes } from 'svelte/elements';
2
2
  import { type ButtonVariant, type ButtonSize } from './button.variants';
3
+ import type { ClassValue } from 'tailwind-variants';
3
4
  type Props = Omit<HTMLButtonAttributes, 'class'> & {
4
5
  variant?: ButtonVariant;
5
6
  size?: ButtonSize;
6
- class?: string;
7
+ class?: ClassValue;
7
8
  };
8
9
  declare const Button: import("svelte").Component<Props, {}, "">;
9
10
  type Button = ReturnType<typeof Button>;
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLAnchorAttributes } from 'svelte/elements';
3
3
  import { button, type ButtonVariant, type ButtonSize } from './button.variants';
4
+ import type { ClassValue } from 'tailwind-variants';
4
5
 
5
6
  type Props = Omit<HTMLAnchorAttributes, 'class'> & {
6
7
  variant?: ButtonVariant;
7
8
  size?: ButtonSize;
8
- class?: string;
9
+ class?: ClassValue;
9
10
  };
10
11
 
11
12
  let { variant, size, class: className, children, ...rest }: Props = $props();
@@ -1,9 +1,10 @@
1
1
  import type { HTMLAnchorAttributes } from 'svelte/elements';
2
2
  import { type ButtonVariant, type ButtonSize } from './button.variants';
3
+ import type { ClassValue } from 'tailwind-variants';
3
4
  type Props = Omit<HTMLAnchorAttributes, 'class'> & {
4
5
  variant?: ButtonVariant;
5
6
  size?: ButtonSize;
6
- class?: string;
7
+ class?: ClassValue;
7
8
  };
8
9
  declare const LinkButton: import("svelte").Component<Props, {}, "">;
9
10
  type LinkButton = ReturnType<typeof LinkButton>;
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { Collapsible } from '@ark-ui/svelte/collapsible';
3
3
  import type { CollapsibleContentBaseProps } from '@ark-ui/svelte/collapsible';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
  import { cn } from 'tailwind-variants';
5
6
 
6
7
  interface Props extends CollapsibleContentBaseProps {
7
- class?: string;
8
+ class?: ClassValue;
8
9
  }
9
10
 
10
11
  let { class: className, children, ...rest }: Props = $props();
@@ -1,6 +1,7 @@
1
1
  import type { CollapsibleContentBaseProps } from '@ark-ui/svelte/collapsible';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends CollapsibleContentBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const CollapsibleContent: import("svelte").Component<Props, {}, "">;
6
7
  type CollapsibleContent = ReturnType<typeof CollapsibleContent>;
@@ -4,9 +4,10 @@
4
4
  import type { Snippet } from 'svelte';
5
5
  import { cn } from 'tailwind-variants';
6
6
  import PhCaretRight from '../../icons/PhCaretRight.svelte';
7
+ import type { ClassValue } from 'svelte/elements';
7
8
 
8
9
  interface Props extends CollapsibleIndicatorBaseProps {
9
- class?: string;
10
+ class?: ClassValue;
10
11
  children?: Snippet;
11
12
  }
12
13
 
@@ -1,7 +1,8 @@
1
1
  import type { CollapsibleIndicatorBaseProps } from '@ark-ui/svelte/collapsible';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  interface Props extends CollapsibleIndicatorBaseProps {
4
- class?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  }
7
8
  declare const CollapsibleIndicator: import("svelte").Component<Props, {}, "">;
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { Collapsible } from '@ark-ui/svelte/collapsible';
3
3
  import type { CollapsibleRootBaseProps } from '@ark-ui/svelte/collapsible';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
  import { cn } from 'tailwind-variants';
5
6
 
6
7
  interface Props extends CollapsibleRootBaseProps {
7
- class?: string;
8
+ class?: ClassValue;
8
9
  }
9
10
 
10
11
  let { class: className, children, ...rest }: Props = $props();
@@ -1,6 +1,7 @@
1
1
  import type { CollapsibleRootBaseProps } from '@ark-ui/svelte/collapsible';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends CollapsibleRootBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const CollapsibleRoot: import("svelte").Component<Props, {}, "">;
6
7
  type CollapsibleRoot = ReturnType<typeof CollapsibleRoot>;
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { Collapsible } from '@ark-ui/svelte/collapsible';
3
3
  import type { CollapsibleTriggerBaseProps } from '@ark-ui/svelte/collapsible';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
  import { cn } from 'tailwind-variants';
5
6
 
6
7
  interface Props extends CollapsibleTriggerBaseProps {
7
- class?: string;
8
+ class?: ClassValue;
8
9
  }
9
10
 
10
11
  let { class: className, children, ...rest }: Props = $props();
@@ -1,6 +1,7 @@
1
1
  import type { CollapsibleTriggerBaseProps } from '@ark-ui/svelte/collapsible';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends CollapsibleTriggerBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const CollapsibleTrigger: import("svelte").Component<Props, {}, "">;
6
7
  type CollapsibleTrigger = ReturnType<typeof CollapsibleTrigger>;
@@ -133,7 +133,7 @@
133
133
  <Portal>
134
134
  <Combobox.Positioner class="data-[state=closed]:pointer-events-none">
135
135
  <Combobox.Content
136
- class="data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 max-h-60 min-w-(--reference-width) overflow-auto rounded-md border bg-surface-document p-1 shadow-md"
136
+ class="z-50 max-h-60 min-w-(--reference-width) overflow-auto rounded-md border bg-surface-document p-1 shadow-md data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95"
137
137
  >
138
138
  {#if loading}
139
139
  <div class="flex items-center justify-center py-4">
@@ -28,11 +28,11 @@
28
28
  <Dialog.Root role="alertdialog" bind:open {lazyMount} {unmountOnExit} {...restProps}>
29
29
  <Portal>
30
30
  <Dialog.Backdrop
31
- class="data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/50"
31
+ class="fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
32
32
  />
33
33
  <Dialog.Positioner class="fixed inset-0 z-50 flex items-center justify-center">
34
34
  <Dialog.Content
35
- class="data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 relative w-full max-w-md rounded-lg border bg-surface-1 p-6 shadow-xl"
35
+ class="relative w-full max-w-md rounded-lg border bg-surface-1 p-6 shadow-xl data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95"
36
36
  >
37
37
  <Dialog.Title class="text-lg leading-none font-semibold tracking-tight">
38
38
  {title}
@@ -2,9 +2,10 @@
2
2
  import { Dialog } from '@ark-ui/svelte/dialog';
3
3
  import type { DialogCloseTriggerBaseProps } from '@ark-ui/svelte/dialog';
4
4
  import { PhX } from '../../icons';
5
+ import type { ClassValue } from 'svelte/elements';
5
6
 
6
7
  interface Props extends DialogCloseTriggerBaseProps {
7
- class?: string;
8
+ class?: ClassValue;
8
9
  }
9
10
 
10
11
  let { class: className, children, ...rest }: Props = $props();
@@ -1,6 +1,7 @@
1
1
  import type { DialogCloseTriggerBaseProps } from '@ark-ui/svelte/dialog';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DialogCloseTriggerBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DialogCloseTrigger: import("svelte").Component<Props, {}, "">;
6
7
  type DialogCloseTrigger = ReturnType<typeof DialogCloseTrigger>;
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { Dialog } from '@ark-ui/svelte/dialog';
3
3
  import type { DialogDescriptionBaseProps } from '@ark-ui/svelte/dialog';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
 
5
6
  interface Props extends DialogDescriptionBaseProps {
6
- class?: string;
7
+ class?: ClassValue;
7
8
  }
8
9
 
9
10
  let { class: className, children, ...rest }: Props = $props();
@@ -1,6 +1,7 @@
1
1
  import type { DialogDescriptionBaseProps } from '@ark-ui/svelte/dialog';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DialogDescriptionBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DialogDescription: import("svelte").Component<Props, {}, "">;
6
7
  type DialogDescription = ReturnType<typeof DialogDescription>;
@@ -1,8 +1,9 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
 
4
5
  interface Props {
5
- class?: string;
6
+ class?: ClassValue;
6
7
  children: Snippet;
7
8
  }
8
9
 
@@ -1,6 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  children: Snippet;
5
6
  }
6
7
  declare const DialogFooter: import("svelte").Component<Props, {}, "">;
@@ -17,12 +17,12 @@
17
17
  <Dialog.Root bind:open {lazyMount} {unmountOnExit} {...restProps}>
18
18
  <Portal>
19
19
  <Dialog.Backdrop
20
- class="data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/50"
20
+ class="fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
21
21
  />
22
22
  <Dialog.Positioner class="fixed inset-0 z-50 flex items-center justify-center p-4">
23
23
  <Dialog.Content
24
24
  class={cn(
25
- 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 relative w-full max-w-2xl rounded-lg border bg-surface-1 p-6 shadow-xl',
25
+ 'relative w-full max-w-2xl rounded-lg border bg-surface-1 p-6 shadow-xl data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
26
26
  contentClass
27
27
  )}
28
28
  >
@@ -0,0 +1,4 @@
1
+ import type { DialogProps } from './dialog.types';
2
+ declare const DialogRoot: import("svelte").Component<DialogProps, {}, "open">;
3
+ type DialogRoot = ReturnType<typeof DialogRoot>;
4
+ export default DialogRoot;
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { Dialog } from '@ark-ui/svelte/dialog';
3
3
  import type { DialogTitleBaseProps } from '@ark-ui/svelte/dialog';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
 
5
6
  interface Props extends DialogTitleBaseProps {
6
- class?: string;
7
+ class?: ClassValue;
7
8
  }
8
9
 
9
10
  let { class: className, children, ...rest }: Props = $props();
@@ -1,6 +1,7 @@
1
1
  import type { DialogTitleBaseProps } from '@ark-ui/svelte/dialog';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DialogTitleBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DialogTitle: import("svelte").Component<Props, {}, "">;
6
7
  type DialogTitle = ReturnType<typeof DialogTitle>;
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { Dialog } from '@ark-ui/svelte/dialog';
3
3
  import type { DialogTriggerBaseProps } from '@ark-ui/svelte/dialog';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
 
5
6
  interface Props extends DialogTriggerBaseProps {
6
- class?: string;
7
+ class?: ClassValue;
7
8
  }
8
9
 
9
10
  let { class: className, children, ...rest }: Props = $props();
@@ -1,6 +1,7 @@
1
1
  import type { DialogTriggerBaseProps } from '@ark-ui/svelte/dialog';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DialogTriggerBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DialogTrigger: import("svelte").Component<Props, {}, "">;
6
7
  type DialogTrigger = ReturnType<typeof DialogTrigger>;
@@ -1,11 +1,12 @@
1
1
  import type { DialogRootBaseProps } from '@ark-ui/svelte/dialog';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  export type { DialogRootBaseProps };
4
5
  type DialogSharedProps = Pick<DialogRootBaseProps, 'closeOnEscape' | 'closeOnInteractOutside' | 'onOpenChange' | 'lazyMount' | 'unmountOnExit'>;
5
6
  export interface DialogProps extends DialogSharedProps {
6
7
  open: boolean;
7
8
  children: Snippet;
8
- contentClass?: string;
9
+ contentClass?: ClassValue;
9
10
  initialFocusEl?: DialogRootBaseProps['initialFocusEl'];
10
11
  }
11
12
  export type AlertDialogVariant = 'default' | 'destructive';
@@ -1,4 +1,4 @@
1
- export { default as Root } from './dialog.svelte';
1
+ export { default as Root } from './dialog-root.svelte';
2
2
  export { default as Title } from './dialog-title.svelte';
3
3
  export { default as Description } from './dialog-description.svelte';
4
4
  export { default as Trigger } from './dialog-trigger.svelte';
@@ -1,4 +1,4 @@
1
- export { default as Root } from './dialog.svelte';
1
+ export { default as Root } from './dialog-root.svelte';
2
2
  export { default as Title } from './dialog-title.svelte';
3
3
  export { default as Description } from './dialog-description.svelte';
4
4
  export { default as Trigger } from './dialog-trigger.svelte';
@@ -1,40 +1,22 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
3
  import type { DrawerBackdropBaseProps } from '@ark-ui/svelte/drawer';
4
+ import type { ClassValue } from 'svelte/elements';
5
+ import { cn } from 'tailwind-variants';
4
6
 
5
7
  interface Props extends DrawerBackdropBaseProps {
6
- class?: string;
8
+ class?: ClassValue;
7
9
  }
8
10
 
9
11
  let { class: className, ...rest }: Props = $props();
10
12
  </script>
11
13
 
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>
14
+ <Drawer.Backdrop
15
+ {...rest}
16
+ class={cn(
17
+ 'fixed inset-0 z-50 bg-black/50',
18
+ 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0',
19
+ 'data-[state=open]:animate-in data-[state=open]:fade-in-0',
20
+ className
21
+ )}
22
+ />
@@ -1,6 +1,7 @@
1
1
  import type { DrawerBackdropBaseProps } from '@ark-ui/svelte/drawer';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DrawerBackdropBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DrawerBackdrop: import("svelte").Component<Props, {}, "">;
6
7
  type DrawerBackdrop = ReturnType<typeof DrawerBackdrop>;
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
3
  import type { DrawerCloseTriggerBaseProps } from '@ark-ui/svelte/drawer';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
 
5
6
  interface Props extends DrawerCloseTriggerBaseProps {
6
- class?: string;
7
+ class?: ClassValue;
7
8
  }
8
9
 
9
10
  let { class: className, children, ...rest }: Props = $props();
@@ -11,7 +12,6 @@
11
12
 
12
13
  <Drawer.CloseTrigger
13
14
  {...rest}
14
- onclick={() => console.log('Click:')}
15
15
  class={className ??
16
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
17
  >
@@ -1,6 +1,7 @@
1
1
  import type { DrawerCloseTriggerBaseProps } from '@ark-ui/svelte/drawer';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DrawerCloseTriggerBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DrawerCloseTrigger: import("svelte").Component<Props, {}, "">;
6
7
  type DrawerCloseTrigger = ReturnType<typeof DrawerCloseTrigger>;
@@ -1,9 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
3
  import type { DrawerContentBaseProps } from '@ark-ui/svelte/drawer';
4
+ import type { ClassValue } from 'svelte/elements';
5
+ import { cn } from 'tailwind-variants';
4
6
 
5
7
  interface Props extends DrawerContentBaseProps {
6
- class?: string;
8
+ class?: ClassValue;
7
9
  }
8
10
 
9
11
  let { class: className, children, ...rest }: Props = $props();
@@ -11,8 +13,13 @@
11
13
 
12
14
  <Drawer.Content
13
15
  {...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
+ class={cn(
17
+ 'relative flex h-full max-h-[96svh] w-full flex-col rounded-t-2xl bg-surface-1 px-5 shadow-xl outline-none',
18
+ 'data-[swipe-direction=left]:rounded-none data-[swipe-direction=left]:rounded-r-2xl',
19
+ 'data-[swipe-direction=right]:rounded-none data-[swipe-direction=right]:rounded-l-2xl',
20
+ 'data-[swipe-direction=up]:rounded-none data-[swipe-direction=up]:rounded-b-2xl',
21
+ className
22
+ )}
16
23
  >
17
24
  {@render children?.()}
18
25
  </Drawer.Content>
@@ -1,6 +1,7 @@
1
1
  import type { DrawerContentBaseProps } from '@ark-ui/svelte/drawer';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DrawerContentBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DrawerContent: import("svelte").Component<Props, {}, "">;
6
7
  type DrawerContent = ReturnType<typeof DrawerContent>;
@@ -1,12 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
3
  import type { DrawerGrabberIndicatorBaseProps } from '@ark-ui/svelte/drawer';
4
+ import type { ClassValue } from 'svelte/elements';
5
+ import { cn } from 'tailwind-variants';
4
6
 
5
7
  interface Props extends DrawerGrabberIndicatorBaseProps {
6
- class?: string;
8
+ class?: ClassValue;
7
9
  }
8
10
 
9
11
  let { class: className, ...rest }: Props = $props();
10
12
  </script>
11
13
 
12
- <Drawer.GrabberIndicator {...rest} class={className ?? 'h-1 w-10 rounded-full bg-border'} />
14
+ <Drawer.GrabberIndicator {...rest} class={cn('h-1 w-10 rounded-full bg-border', className)} />
@@ -1,6 +1,7 @@
1
1
  import type { DrawerGrabberIndicatorBaseProps } from '@ark-ui/svelte/drawer';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DrawerGrabberIndicatorBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DrawerGrabberIndicator: import("svelte").Component<Props, {}, "">;
6
7
  type DrawerGrabberIndicator = ReturnType<typeof DrawerGrabberIndicator>;
@@ -1,9 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
3
  import type { DrawerGrabberBaseProps } from '@ark-ui/svelte/drawer';
4
+ import type { ClassValue } from 'svelte/elements';
5
+ import { cn } from 'tailwind-variants';
4
6
 
5
7
  interface Props extends DrawerGrabberBaseProps {
6
- class?: string;
8
+ class?: ClassValue;
7
9
  }
8
10
 
9
11
  let { class: className, children, ...rest }: Props = $props();
@@ -11,8 +13,10 @@
11
13
 
12
14
  <Drawer.Grabber
13
15
  {...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
+ class={cn(
17
+ 'flex w-full shrink-0 cursor-grab touch-none items-center justify-center py-5 select-none active:cursor-grabbing',
18
+ className
19
+ )}
16
20
  >
17
21
  {@render children?.()}
18
22
  </Drawer.Grabber>
@@ -1,6 +1,7 @@
1
1
  import type { DrawerGrabberBaseProps } from '@ark-ui/svelte/drawer';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DrawerGrabberBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DrawerGrabber: import("svelte").Component<Props, {}, "">;
6
7
  type DrawerGrabber = ReturnType<typeof DrawerGrabber>;
@@ -1,9 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
3
  import type { DrawerPositionerBaseProps } from '@ark-ui/svelte/drawer';
4
+ import type { ClassValue } from 'svelte/elements';
5
+ import { cn } from 'tailwind-variants';
4
6
 
5
7
  interface Props extends DrawerPositionerBaseProps {
6
- class?: string;
8
+ class?: ClassValue;
7
9
  }
8
10
 
9
11
  let { class: className, children, ...rest }: Props = $props();
@@ -11,8 +13,13 @@
11
13
 
12
14
  <Drawer.Positioner
13
15
  {...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
+ class={cn(
17
+ 'fixed inset-0 z-50 flex items-end justify-center',
18
+ 'data-[swipe-direction=left]:items-stretch data-[swipe-direction=left]:justify-start',
19
+ 'data-[swipe-direction=right]:items-stretch data-[swipe-direction=right]:justify-end',
20
+ 'data-[swipe-direction=up]:items-start',
21
+ className
22
+ )}
16
23
  >
17
24
  {@render children?.()}
18
25
  </Drawer.Positioner>
@@ -1,6 +1,7 @@
1
1
  import type { DrawerPositionerBaseProps } from '@ark-ui/svelte/drawer';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DrawerPositionerBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DrawerPositioner: import("svelte").Component<Props, {}, "">;
6
7
  type DrawerPositioner = ReturnType<typeof DrawerPositioner>;
@@ -1,18 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
- import type { DrawerRootProps, DrawerOpenChangeDetails } from '@ark-ui/svelte/drawer';
3
+ import type { DrawerRootProps } from '@ark-ui/svelte/drawer';
4
4
 
5
5
  interface Props extends Omit<DrawerRootProps, 'open' | 'onOpenChange'> {
6
6
  open?: boolean;
7
7
  }
8
8
 
9
9
  let { children, open = $bindable(), ...rest }: Props = $props();
10
-
11
- const handleOpenChange = (details: DrawerOpenChangeDetails) => {
12
- open = details.open;
13
- };
14
10
  </script>
15
11
 
16
- <Drawer.Root {open} onOpenChange={handleOpenChange} {...rest}>
12
+ <Drawer.Root bind:open {...rest}>
17
13
  {@render children?.()}
18
14
  </Drawer.Root>
@@ -1,14 +1,16 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
3
  import type { DrawerTitleBaseProps } from '@ark-ui/svelte/drawer';
4
+ import type { ClassValue } from 'svelte/elements';
5
+ import { cn } from 'tailwind-variants';
4
6
 
5
7
  interface Props extends DrawerTitleBaseProps {
6
- class?: string;
8
+ class?: ClassValue;
7
9
  }
8
10
 
9
11
  let { class: className, children, ...rest }: Props = $props();
10
12
  </script>
11
13
 
12
- <Drawer.Title {...rest} class={className ?? 'mb-2 text-lg leading-7 font-medium text-ink'}>
14
+ <Drawer.Title {...rest} class={cn('mb-2 text-lg leading-7 font-medium text-ink', className)}>
13
15
  {@render children?.()}
14
16
  </Drawer.Title>