compote-ui 0.47.3 → 0.48.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.
@@ -2,20 +2,42 @@
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
+ import {
6
+ button,
7
+ type ButtonVariant,
8
+ type ButtonSize
9
+ } from '../button/button.variants';
10
+ import type { ClassValue } from 'tailwind-variants';
6
11
 
7
12
  interface Props extends DialogCloseTriggerBaseProps {
13
+ variant?: ButtonVariant;
14
+ size?: ButtonSize;
8
15
  class?: ClassValue;
9
16
  }
10
17
 
11
- let { class: className, children, ...rest }: Props = $props();
18
+ let { class: className, variant, size, children, ...rest }: Props = $props();
19
+
20
+ const isIconMode = $derived(!children);
21
+
22
+ const classes = $derived(
23
+ isIconMode
24
+ ? button({
25
+ variant: variant ?? 'ghost',
26
+ size: size ?? 'icon-sm',
27
+ class: [
28
+ 'absolute top-3 right-3 opacity-70 hover:opacity-100 active:opacity-50',
29
+ className
30
+ ]
31
+ })
32
+ : button({
33
+ variant: variant ?? 'outline',
34
+ size: size ?? 'default',
35
+ class: className
36
+ })
37
+ );
12
38
  </script>
13
39
 
14
- <Dialog.CloseTrigger
15
- {...rest}
16
- class={className ??
17
- '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'}
18
- >
40
+ <Dialog.CloseTrigger {...rest} class={classes}>
19
41
  {#if children}
20
42
  {@render children()}
21
43
  {:else}
@@ -1,6 +1,9 @@
1
1
  import type { DialogCloseTriggerBaseProps } from '@ark-ui/svelte/dialog';
2
- import type { ClassValue } from 'svelte/elements';
2
+ import { type ButtonVariant, type ButtonSize } from '../button/button.variants';
3
+ import type { ClassValue } from 'tailwind-variants';
3
4
  interface Props extends DialogCloseTriggerBaseProps {
5
+ variant?: ButtonVariant;
6
+ size?: ButtonSize;
4
7
  class?: ClassValue;
5
8
  }
6
9
  declare const DialogCloseTrigger: import("svelte").Component<Props, {}, "">;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
4
+ import { cn } from 'tailwind-variants';
5
+ import { ScrollArea } from '../..';
6
+
7
+ interface Props {
8
+ class?: ClassValue;
9
+ children: Snippet;
10
+ }
11
+
12
+ let { class: className, children }: Props = $props();
13
+ </script>
14
+
15
+ <ScrollArea.Root class={cn('min-h-0 flex-1', className)}>
16
+ <ScrollArea.Viewport>
17
+ <ScrollArea.Content>
18
+ {@render children()}
19
+ </ScrollArea.Content>
20
+ </ScrollArea.Viewport>
21
+ <ScrollArea.Scrollbar>
22
+ <ScrollArea.Thumb />
23
+ </ScrollArea.Scrollbar>
24
+ <ScrollArea.Corner />
25
+ </ScrollArea.Root>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ClassValue } from 'svelte/elements';
3
+ interface Props {
4
+ class?: ClassValue;
5
+ children: Snippet;
6
+ }
7
+ declare const DrawerBody: import("svelte").Component<Props, {}, "">;
8
+ type DrawerBody = ReturnType<typeof DrawerBody>;
9
+ export default DrawerBody;
@@ -0,0 +1,21 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
4
+ import { cn } from 'tailwind-variants';
5
+
6
+ interface Props {
7
+ class?: ClassValue;
8
+ children: Snippet;
9
+ }
10
+
11
+ let { class: className, children }: Props = $props();
12
+ </script>
13
+
14
+ <div
15
+ class={cn(
16
+ 'mt-auto flex flex-row items-center justify-end gap-2 border-t border-border p-4',
17
+ className
18
+ )}
19
+ >
20
+ {@render children()}
21
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ClassValue } from 'svelte/elements';
3
+ interface Props {
4
+ class?: ClassValue;
5
+ children: Snippet;
6
+ }
7
+ declare const DrawerFooter: import("svelte").Component<Props, {}, "">;
8
+ type DrawerFooter = ReturnType<typeof DrawerFooter>;
9
+ export default DrawerFooter;
@@ -9,3 +9,5 @@ export { default as Header } from './drawer-header.svelte';
9
9
  export { default as Title } from './drawer-title.svelte';
10
10
  export { default as Description } from './drawer-description.svelte';
11
11
  export { default as CloseTrigger } from './drawer-close-trigger.svelte';
12
+ export { default as Body } from './drawer-body.svelte';
13
+ export { default as Footer } from './drawer-footer.svelte';
@@ -9,3 +9,5 @@ export { default as Header } from './drawer-header.svelte';
9
9
  export { default as Title } from './drawer-title.svelte';
10
10
  export { default as Description } from './drawer-description.svelte';
11
11
  export { default as CloseTrigger } from './drawer-close-trigger.svelte';
12
+ export { default as Body } from './drawer-body.svelte';
13
+ export { default as Footer } from './drawer-footer.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compote-ui",
3
- "version": "0.47.3",
3
+ "version": "0.48.1",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev --open",