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,6 +1,7 @@
1
1
  import type { DrawerTitleBaseProps } from '@ark-ui/svelte/drawer';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DrawerTitleBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DrawerTitle: import("svelte").Component<Props, {}, "">;
6
7
  type DrawerTitle = ReturnType<typeof DrawerTitle>;
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { Drawer } from '@ark-ui/svelte/drawer';
3
3
  import type { DrawerTriggerBaseProps } from '@ark-ui/svelte/drawer';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
 
5
6
  interface Props extends DrawerTriggerBaseProps {
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 { DrawerTriggerBaseProps } from '@ark-ui/svelte/drawer';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends DrawerTriggerBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  declare const DrawerTrigger: import("svelte").Component<Props, {}, "">;
6
7
  type DrawerTrigger = ReturnType<typeof DrawerTrigger>;
@@ -1,30 +1,31 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { FieldRootBaseProps, FieldLabelBaseProps, FieldInputProps as ArkFieldInputProps, FieldTextareaProps as ArkFieldTextareaProps, FieldHelperTextBaseProps, FieldErrorTextBaseProps } from '@ark-ui/svelte/field';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  export interface FormAdapter {
4
5
  invalid(field: string): boolean;
5
6
  isRequired(field: string): boolean;
6
7
  errors: Record<string, string[]>;
7
8
  }
8
9
  export interface FieldRootProps extends FieldRootBaseProps {
9
- class?: string;
10
+ class?: ClassValue;
10
11
  form?: FormAdapter;
11
12
  field?: string;
12
13
  helperText?: string;
13
14
  }
14
15
  export interface FieldLabelProps extends FieldLabelBaseProps {
15
- class?: string;
16
+ class?: ClassValue;
16
17
  }
17
18
  export interface FieldInputProps extends ArkFieldInputProps {
18
- class?: string;
19
+ class?: ClassValue;
19
20
  startIcon?: Snippet;
20
21
  endIcon?: Snippet;
21
22
  }
22
23
  export interface FieldTextareaProps extends ArkFieldTextareaProps {
23
- class?: string;
24
+ class?: ClassValue;
24
25
  }
25
26
  export interface FieldHelperTextProps extends FieldHelperTextBaseProps {
26
- class?: string;
27
+ class?: ClassValue;
27
28
  }
28
29
  export interface FieldErrorTextProps extends FieldErrorTextBaseProps {
29
- class?: string;
30
+ class?: ClassValue;
30
31
  }
@@ -1,13 +1,14 @@
1
1
  import type { FieldsetRootBaseProps, FieldsetLegendBaseProps, FieldsetHelperTextBaseProps, FieldsetErrorTextBaseProps } from '@ark-ui/svelte/fieldset';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  export interface FieldsetRootProps extends FieldsetRootBaseProps {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  }
5
6
  export interface FieldsetLegendProps extends FieldsetLegendBaseProps {
6
- class?: string;
7
+ class?: ClassValue;
7
8
  }
8
9
  export interface FieldsetHelperTextProps extends FieldsetHelperTextBaseProps {
9
- class?: string;
10
+ class?: ClassValue;
10
11
  }
11
12
  export interface FieldsetErrorTextProps extends FieldsetErrorTextBaseProps {
12
- class?: string;
13
+ class?: ClassValue;
13
14
  }
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import Dialog from '../dialog/dialog.svelte';
2
+ import * as Dialog from '../dialog';
3
3
  import ImageCropper from '../image-cropper/image-cropper.svelte';
4
4
  import { Button } from '../..';
5
5
  import { cropImage, processImage } from '../../utils/image-processing';
@@ -47,16 +47,17 @@
47
47
  }
48
48
  </script>
49
49
 
50
- <Dialog
50
+ <Dialog.Root
51
51
  bind:open
52
- {title}
53
- {description}
54
52
  onOpenChange={(details) => {
55
53
  if (!details.open) onCancel();
56
54
  }}
57
55
  >
56
+ <Dialog.Title>{title}</Dialog.Title>
57
+ <Dialog.Description>{description}</Dialog.Description>
58
+
58
59
  <ImageCropper bind:getCropData src={imageSrc} alt="Crop preview" {aspectRatio} />
59
- {#snippet footer()}
60
+ <Dialog.Footer>
60
61
  <Button variant="outline" onclick={onCancel} disabled={processing}>Cancel</Button>
61
62
  {#if showSkipCrop}
62
63
  <Button variant="outline" onclick={handleSkipCrop} disabled={processing}>
@@ -66,5 +67,5 @@
66
67
  <Button onclick={handleCrop} disabled={processing}>
67
68
  {processing ? 'Processing...' : confirmLabel}
68
69
  </Button>
69
- {/snippet}
70
- </Dialog>
70
+ </Dialog.Footer>
71
+ </Dialog.Root>
@@ -5,9 +5,10 @@
5
5
  import type { ListItem } from '../../utils/collections';
6
6
  import { cn } from 'tailwind-variants';
7
7
  import { getListboxContext } from './listbox-context';
8
+ import type { ClassValue } from 'svelte/elements';
8
9
 
9
10
  type Props = ListboxContentBaseProps & {
10
- class?: string;
11
+ class?: ClassValue;
11
12
  items?: Snippet<[{ items: ListItem[]; group: [string, ListItem[]][] }]>;
12
13
  };
13
14
 
@@ -1,8 +1,9 @@
1
1
  import type { ListboxContentBaseProps } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { ListItem } from '../../utils/collections';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
  type Props = ListboxContentBaseProps & {
5
- class?: string;
6
+ class?: ClassValue;
6
7
  items?: Snippet<[{
7
8
  items: ListItem[];
8
9
  group: [string, ListItem[]][];
@@ -2,10 +2,11 @@
2
2
  import { Listbox } from '@ark-ui/svelte/listbox';
3
3
  import type { ListboxEmptyBaseProps } from '@ark-ui/svelte/listbox';
4
4
  import type { Snippet } from 'svelte';
5
+ import type { ClassValue } from 'svelte/elements';
5
6
  import { cn } from 'tailwind-variants';
6
7
 
7
8
  type Props = ListboxEmptyBaseProps & {
8
- class?: string;
9
+ class?: ClassValue;
9
10
  children?: Snippet;
10
11
  };
11
12
 
@@ -1,7 +1,8 @@
1
1
  import type { ListboxEmptyBaseProps } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  type Props = ListboxEmptyBaseProps & {
4
- class?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  };
7
8
  declare const ListboxEmpty: import("svelte").Component<Props, {}, "">;
@@ -3,9 +3,10 @@
3
3
  import type { ListboxInputBaseProps } from '@ark-ui/svelte/listbox';
4
4
  import { cn } from 'tailwind-variants';
5
5
  import { getListboxContext } from './listbox-context';
6
+ import type { ClassValue } from 'svelte/elements';
6
7
 
7
8
  type Props = ListboxInputBaseProps & {
8
- class?: string;
9
+ class?: ClassValue;
9
10
  placeholder?: string;
10
11
  oninput?: (event: Event & { currentTarget: HTMLInputElement }) => void;
11
12
  };
@@ -1,6 +1,7 @@
1
1
  import type { ListboxInputBaseProps } from '@ark-ui/svelte/listbox';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  type Props = ListboxInputBaseProps & {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  placeholder?: string;
5
6
  oninput?: (event: Event & {
6
7
  currentTarget: HTMLInputElement;
@@ -2,10 +2,11 @@
2
2
  import { Listbox } from '@ark-ui/svelte/listbox';
3
3
  import type { ListboxItemGroupLabelBaseProps } from '@ark-ui/svelte/listbox';
4
4
  import type { Snippet } from 'svelte';
5
+ import type { ClassValue } from 'svelte/elements';
5
6
  import { cn } from 'tailwind-variants';
6
7
 
7
8
  type Props = ListboxItemGroupLabelBaseProps & {
8
- class?: string;
9
+ class?: ClassValue;
9
10
  children?: Snippet;
10
11
  };
11
12
 
@@ -1,7 +1,8 @@
1
1
  import type { ListboxItemGroupLabelBaseProps } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  type Props = ListboxItemGroupLabelBaseProps & {
4
- class?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  };
7
8
  declare const ListboxItemGroupLabel: import("svelte").Component<Props, {}, "">;
@@ -2,10 +2,11 @@
2
2
  import { Listbox } from '@ark-ui/svelte/listbox';
3
3
  import type { ListboxItemGroupBaseProps } from '@ark-ui/svelte/listbox';
4
4
  import type { Snippet } from 'svelte';
5
+ import type { ClassValue } from 'svelte/elements';
5
6
  import { cn } from 'tailwind-variants';
6
7
 
7
8
  type Props = ListboxItemGroupBaseProps & {
8
- class?: string;
9
+ class?: ClassValue;
9
10
  children?: Snippet;
10
11
  };
11
12
 
@@ -1,7 +1,8 @@
1
1
  import type { ListboxItemGroupBaseProps } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  type Props = ListboxItemGroupBaseProps & {
4
- class?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  };
7
8
  declare const ListboxItemGroup: import("svelte").Component<Props, {}, "">;
@@ -4,9 +4,10 @@
4
4
  import type { Snippet } from 'svelte';
5
5
  import { cn } from 'tailwind-variants';
6
6
  import { PhCheck } from '../../icons';
7
+ import type { ClassValue } from 'svelte/elements';
7
8
 
8
9
  type Props = ListboxItemIndicatorBaseProps & {
9
- class?: string;
10
+ class?: ClassValue;
10
11
  children?: Snippet;
11
12
  };
12
13
 
@@ -1,7 +1,8 @@
1
1
  import type { ListboxItemIndicatorBaseProps } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  type Props = ListboxItemIndicatorBaseProps & {
4
- class?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  };
7
8
  declare const ListboxItemIndicator: import("svelte").Component<Props, {}, "">;
@@ -2,10 +2,11 @@
2
2
  import { Listbox } from '@ark-ui/svelte/listbox';
3
3
  import type { ListboxItemTextBaseProps } from '@ark-ui/svelte/listbox';
4
4
  import type { Snippet } from 'svelte';
5
+ import type { ClassValue } from 'svelte/elements';
5
6
  import { cn } from 'tailwind-variants';
6
7
 
7
8
  type Props = ListboxItemTextBaseProps & {
8
- class?: string;
9
+ class?: ClassValue;
9
10
  children?: Snippet;
10
11
  };
11
12
 
@@ -1,7 +1,8 @@
1
1
  import type { ListboxItemTextBaseProps } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  type Props = ListboxItemTextBaseProps & {
4
- class?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  };
7
8
  declare const ListboxItemText: import("svelte").Component<Props, {}, "">;
@@ -2,10 +2,11 @@
2
2
  import { Listbox } from '@ark-ui/svelte/listbox';
3
3
  import type { ListboxItemBaseProps } from '@ark-ui/svelte/listbox';
4
4
  import type { Snippet } from 'svelte';
5
+ import type { ClassValue } from 'svelte/elements';
5
6
  import { cn } from 'tailwind-variants';
6
7
 
7
8
  type Props = ListboxItemBaseProps & {
8
- class?: string;
9
+ class?: ClassValue;
9
10
  children?: Snippet;
10
11
  };
11
12
 
@@ -1,7 +1,8 @@
1
1
  import type { ListboxItemBaseProps } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  type Props = ListboxItemBaseProps & {
4
- class?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  };
7
8
  declare const ListboxItem: import("svelte").Component<Props, {}, "">;
@@ -2,10 +2,11 @@
2
2
  import { Listbox } from '@ark-ui/svelte/listbox';
3
3
  import type { ListboxLabelBaseProps } from '@ark-ui/svelte/listbox';
4
4
  import type { Snippet } from 'svelte';
5
+ import type { ClassValue } from 'svelte/elements';
5
6
  import { cn } from 'tailwind-variants';
6
7
 
7
8
  type Props = ListboxLabelBaseProps & {
8
- class?: string;
9
+ class?: ClassValue;
9
10
  children?: Snippet;
10
11
  };
11
12
 
@@ -1,7 +1,8 @@
1
1
  import type { ListboxLabelBaseProps } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
  type Props = ListboxLabelBaseProps & {
4
- class?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  };
7
8
  declare const ListboxLabel: import("svelte").Component<Props, {}, "">;
@@ -7,12 +7,13 @@
7
7
  import type { ListItem } from '../../utils/collections';
8
8
  import { cn } from 'tailwind-variants';
9
9
  import { setListboxContext } from './listbox-context';
10
+ import type { ClassValue } from 'svelte/elements';
10
11
 
11
12
  type Props = Omit<ListboxRootBaseProps<ListItem<T>>, 'collection' | 'value'> & {
12
13
  items: ListItem<T>[];
13
14
  value?: T[];
14
15
  name?: string;
15
- class?: string;
16
+ class?: ClassValue;
16
17
  children?: Snippet;
17
18
  };
18
19
 
@@ -1,12 +1,13 @@
1
1
  import { Listbox } from '@ark-ui/svelte/listbox';
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { ListItem } from '../../utils/collections';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
  declare function $$render<T extends string | number = string>(): {
5
6
  props: Omit<Listbox.RootBaseProps<ListItem<T>>, "value" | "collection"> & {
6
7
  items: ListItem<T>[];
7
8
  value?: T[];
8
9
  name?: string;
9
- class?: string;
10
+ class?: ClassValue;
10
11
  children?: Snippet;
11
12
  };
12
13
  exports: {};
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { Listbox } from '@ark-ui/svelte/listbox';
3
3
  import type { ListboxValueTextBaseProps } from '@ark-ui/svelte/listbox';
4
+ import type { ClassValue } from 'svelte/elements';
4
5
  import { cn } from 'tailwind-variants';
5
6
 
6
7
  type Props = ListboxValueTextBaseProps & {
7
- class?: string;
8
+ class?: ClassValue;
8
9
  };
9
10
 
10
11
  let { class: className, ...restProps }: Props = $props();
@@ -1,6 +1,7 @@
1
1
  import type { ListboxValueTextBaseProps } from '@ark-ui/svelte/listbox';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  type Props = ListboxValueTextBaseProps & {
3
- class?: string;
4
+ class?: ClassValue;
4
5
  };
5
6
  declare const ListboxValueText: import("svelte").Component<Props, {}, "">;
6
7
  type ListboxValueText = ReturnType<typeof ListboxValueText>;
@@ -65,7 +65,7 @@
65
65
  <Portal>
66
66
  <Select.Positioner>
67
67
  <Select.Content
68
- 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 text-ink shadow-md"
68
+ class="z-50 max-h-60 min-w-(--reference-width) overflow-auto rounded-md border bg-surface-document p-1 text-ink 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"
69
69
  >
70
70
  <Select.ItemGroup>
71
71
  {#each items as item (item.value)}
@@ -2,9 +2,10 @@
2
2
  import { ToggleGroup } from '@ark-ui/svelte/toggle-group';
3
3
  import type { ToggleGroupItemBaseProps } from '@ark-ui/svelte/toggle-group';
4
4
  import { cn } from 'tailwind-variants';
5
+ import type { ClassValue } from 'svelte/elements';
5
6
 
6
7
  interface Props extends ToggleGroupItemBaseProps {
7
- class?: string;
8
+ class?: ClassValue | null;
8
9
  }
9
10
 
10
11
  let { class: className, children, ...rest }: Props = $props();
@@ -14,7 +15,7 @@
14
15
  {...rest}
15
16
  class={cn(
16
17
  'inline-flex h-8 min-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
+ className as never
18
19
  )}
19
20
  >
20
21
  {@render children?.()}
@@ -1,6 +1,7 @@
1
1
  import type { ToggleGroupItemBaseProps } from '@ark-ui/svelte/toggle-group';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props extends ToggleGroupItemBaseProps {
3
- class?: string;
4
+ class?: ClassValue | null;
4
5
  }
5
6
  declare const ToggleGroupItem: import("svelte").Component<Props, {}, "">;
6
7
  type ToggleGroupItem = ReturnType<typeof ToggleGroupItem>;
@@ -0,0 +1,3 @@
1
+ export { default as Root } from './tooltip-root.svelte';
2
+ export { default as Trigger } from './tooltip-trigger.svelte';
3
+ export { default as Content } from './tooltip-content.svelte';
@@ -0,0 +1,3 @@
1
+ export { default as Root } from './tooltip-root.svelte';
2
+ export { default as Trigger } from './tooltip-trigger.svelte';
3
+ export { default as Content } from './tooltip-content.svelte';
@@ -0,0 +1,68 @@
1
+ <script lang="ts">
2
+ import { Portal } from '@ark-ui/svelte/portal';
3
+ import { Tooltip } from '@ark-ui/svelte/tooltip';
4
+ import type { TooltipContentBaseProps } from '@ark-ui/svelte/tooltip';
5
+ import type { Snippet } from 'svelte';
6
+ import { cn } from 'tailwind-variants';
7
+
8
+ type Props = TooltipContentBaseProps & {
9
+ class?: string;
10
+ children: Snippet;
11
+ showArrow?: boolean;
12
+ };
13
+
14
+ const { class: className, children, showArrow = true, ...restProps }: Props = $props();
15
+ </script>
16
+
17
+ <Portal>
18
+ <Tooltip.Positioner>
19
+ <Tooltip.Content
20
+ {...restProps}
21
+ class={cn(
22
+ 'z-50 max-w-80 rounded-md border bg-well px-2.5 py-1.5 text-xs font-medium text-ink shadow-md outline-none [--arrow-background:var(--compote-well)] [--arrow-size:10px]',
23
+ className
24
+ )}
25
+ >
26
+ {#if showArrow}
27
+ <Tooltip.Arrow>
28
+ <Tooltip.ArrowTip class="border-t border-l" />
29
+ </Tooltip.Arrow>
30
+ {/if}
31
+ {@render children()}
32
+ </Tooltip.Content>
33
+ </Tooltip.Positioner>
34
+ </Portal>
35
+
36
+ <style>
37
+ :global([data-scope='tooltip'][data-part='content'][data-state='open']) {
38
+ animation: tooltip-scale-fade-in 0.15s ease-out;
39
+ transform-origin: var(--transform-origin);
40
+ }
41
+
42
+ :global([data-scope='tooltip'][data-part='content'][data-state='closed']) {
43
+ animation: tooltip-scale-fade-out 0.1s ease-in;
44
+ transform-origin: var(--transform-origin);
45
+ }
46
+
47
+ @keyframes tooltip-scale-fade-in {
48
+ from {
49
+ opacity: 0;
50
+ transform: scale(0.96);
51
+ }
52
+ to {
53
+ opacity: 1;
54
+ transform: scale(1);
55
+ }
56
+ }
57
+
58
+ @keyframes tooltip-scale-fade-out {
59
+ from {
60
+ opacity: 1;
61
+ transform: scale(1);
62
+ }
63
+ to {
64
+ opacity: 0;
65
+ transform: scale(0.96);
66
+ }
67
+ }
68
+ </style>
@@ -0,0 +1,10 @@
1
+ import type { TooltipContentBaseProps } from '@ark-ui/svelte/tooltip';
2
+ import type { Snippet } from 'svelte';
3
+ type Props = TooltipContentBaseProps & {
4
+ class?: string;
5
+ children: Snippet;
6
+ showArrow?: boolean;
7
+ };
8
+ declare const TooltipContent: import("svelte").Component<Props, {}, "">;
9
+ type TooltipContent = ReturnType<typeof TooltipContent>;
10
+ export default TooltipContent;
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import { Tooltip } from '@ark-ui/svelte/tooltip';
3
+ import type { TooltipRootBaseProps } from '@ark-ui/svelte/tooltip';
4
+ import type { Snippet } from 'svelte';
5
+
6
+ type Props = TooltipRootBaseProps & {
7
+ children?: Snippet;
8
+ };
9
+
10
+ const { children, ...restProps }: Props = $props();
11
+ </script>
12
+
13
+ <Tooltip.Root {...restProps}>
14
+ {@render children?.()}
15
+ </Tooltip.Root>
@@ -0,0 +1,8 @@
1
+ import type { TooltipRootBaseProps } from '@ark-ui/svelte/tooltip';
2
+ import type { Snippet } from 'svelte';
3
+ type Props = TooltipRootBaseProps & {
4
+ children?: Snippet;
5
+ };
6
+ declare const TooltipRoot: import("svelte").Component<Props, {}, "">;
7
+ type TooltipRoot = ReturnType<typeof TooltipRoot>;
8
+ export default TooltipRoot;
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+ import { Tooltip } from '@ark-ui/svelte/tooltip';
3
+ import type { TooltipTriggerBaseProps } from '@ark-ui/svelte/tooltip';
4
+ import type { Snippet } from 'svelte';
5
+ import { button, type ButtonSize, type ButtonVariant } from '../button/button.variants';
6
+
7
+ type Props = TooltipTriggerBaseProps & {
8
+ variant?: ButtonVariant;
9
+ size?: ButtonSize;
10
+ class?: string;
11
+ children?: Snippet;
12
+ };
13
+
14
+ const {
15
+ asChild,
16
+ variant = 'ghost',
17
+ size = 'icon',
18
+ class: className,
19
+ children,
20
+ ...restProps
21
+ }: Props = $props();
22
+ </script>
23
+
24
+ <Tooltip.Trigger
25
+ {...restProps}
26
+ {asChild}
27
+ class={asChild ? className : button({ variant, size, class: className })}
28
+ >
29
+ {@render children?.()}
30
+ </Tooltip.Trigger>
@@ -0,0 +1,12 @@
1
+ import type { TooltipTriggerBaseProps } from '@ark-ui/svelte/tooltip';
2
+ import type { Snippet } from 'svelte';
3
+ import { type ButtonSize, type ButtonVariant } from '../button/button.variants';
4
+ type Props = TooltipTriggerBaseProps & {
5
+ variant?: ButtonVariant;
6
+ size?: ButtonSize;
7
+ class?: string;
8
+ children?: Snippet;
9
+ };
10
+ declare const TooltipTrigger: import("svelte").Component<Props, {}, "">;
11
+ type TooltipTrigger = ReturnType<typeof TooltipTrigger>;
12
+ export default TooltipTrigger;
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export { default as Switch } from './components/switch/switch.svelte';
32
32
  export * as Tabs from './components/tabs';
33
33
  export * as ToggleGroup from './components/toggle-group';
34
34
  export * as Menu from './components/menu';
35
+ export * as Tooltip from './components/tooltip';
35
36
  export * as Field from './components/field';
36
37
  export * as Fieldset from './components/fieldset';
37
38
  export { default as TreeView } from './components/tree-view/tree-view.svelte';
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ export { default as Switch } from './components/switch/switch.svelte';
25
25
  export * as Tabs from './components/tabs';
26
26
  export * as ToggleGroup from './components/toggle-group';
27
27
  export * as Menu from './components/menu';
28
+ export * as Tooltip from './components/tooltip';
28
29
  export * as Field from './components/field';
29
30
  export * as Fieldset from './components/fieldset';
30
31
  export { default as TreeView } from './components/tree-view/tree-view.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compote-ui",
3
- "version": "0.30.2",
3
+ "version": "0.31.1",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev --open",
@@ -55,6 +55,7 @@
55
55
  "svelte": "^5.55.4",
56
56
  "svelte-check": "^4.4.6",
57
57
  "tailwindcss": "^4.2.4",
58
+ "tw-animate-css": "^1.4.0",
58
59
  "typescript": "^6.0.3",
59
60
  "typescript-eslint": "^8.59.1",
60
61
  "unplugin-icons": "^23.0.1",