compote-ui 0.75.2 → 0.75.4

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.
@@ -13,7 +13,7 @@ export declare const badge: import("tailwind-variants").TVReturnType<{
13
13
  success: "";
14
14
  info: "";
15
15
  };
16
- }, undefined, "inline-flex w-fit items-center gap-1 rounded px-2 py-0.5 text-xs font-medium [&_svg]:size-3 [&_svg]:shrink-0", {
16
+ }, undefined, "inline-flex w-fit items-center gap-1 rounded px-2 py-0.5 text-xs font-medium **:data-[slot=icon]:size-3 [&_svg]:size-3 [&_svg]:shrink-0", {
17
17
  variant: {
18
18
  solid: "";
19
19
  subtle: "";
@@ -1,6 +1,6 @@
1
1
  import { tv } from 'tailwind-variants';
2
2
  export const badge = tv({
3
- base: 'inline-flex w-fit items-center gap-1 rounded px-2 py-0.5 text-xs font-medium [&_svg]:size-3 [&_svg]:shrink-0',
3
+ base: 'inline-flex w-fit items-center gap-1 rounded px-2 py-0.5 text-xs font-medium **:data-[slot=icon]:size-3 [&_svg]:size-3 [&_svg]:shrink-0',
4
4
  variants: {
5
5
  variant: {
6
6
  solid: '',
@@ -7,13 +7,13 @@ export declare const button: import("tailwind-variants").TVReturnType<{
7
7
  destructive: "bg-danger text-ink-inverse hover:bg-danger/90 active:bg-danger/80";
8
8
  };
9
9
  size: {
10
- sm: "h-8 gap-1.5 px-2 [&_svg]:size-3.5";
11
- default: "h-9 gap-2 px-3 [&_svg]:size-4";
12
- lg: "h-10 gap-2.5 px-4 [&_svg]:size-5";
13
- icon: "size-9 shrink-0 [&_svg]:size-6";
14
- 'icon-xs': "size-7 shrink-0 [&_svg]:size-4";
15
- 'icon-sm': "size-8 shrink-0 [&_svg]:size-5";
16
- 'icon-lg': "size-10 shrink-0 [&_svg]:size-7";
10
+ sm: "h-8 gap-1.5 px-2 **:data-[slot=icon]:size-3.5 [&_svg]:size-3.5";
11
+ default: "h-9 gap-2 px-3 **:data-[slot=icon]:size-4 [&_svg]:size-4";
12
+ lg: "h-10 gap-2.5 px-4 **:data-[slot=icon]:size-5 [&_svg]:size-5";
13
+ icon: "size-9 shrink-0 **:data-[slot=icon]:size-6 [&_svg]:size-6";
14
+ 'icon-xs': "size-7 shrink-0 **:data-[slot=icon]:size-4 [&_svg]:size-4";
15
+ 'icon-sm': "size-8 shrink-0 **:data-[slot=icon]:size-5 [&_svg]:size-5";
16
+ 'icon-lg': "size-10 shrink-0 **:data-[slot=icon]:size-7 [&_svg]:size-7";
17
17
  };
18
18
  }, undefined, "inline-flex cursor-pointer items-center justify-center rounded bg-transparent text-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0", {
19
19
  variant: {
@@ -23,13 +23,13 @@ export declare const button: import("tailwind-variants").TVReturnType<{
23
23
  destructive: "bg-danger text-ink-inverse hover:bg-danger/90 active:bg-danger/80";
24
24
  };
25
25
  size: {
26
- sm: "h-8 gap-1.5 px-2 [&_svg]:size-3.5";
27
- default: "h-9 gap-2 px-3 [&_svg]:size-4";
28
- lg: "h-10 gap-2.5 px-4 [&_svg]:size-5";
29
- icon: "size-9 shrink-0 [&_svg]:size-6";
30
- 'icon-xs': "size-7 shrink-0 [&_svg]:size-4";
31
- 'icon-sm': "size-8 shrink-0 [&_svg]:size-5";
32
- 'icon-lg': "size-10 shrink-0 [&_svg]:size-7";
26
+ sm: "h-8 gap-1.5 px-2 **:data-[slot=icon]:size-3.5 [&_svg]:size-3.5";
27
+ default: "h-9 gap-2 px-3 **:data-[slot=icon]:size-4 [&_svg]:size-4";
28
+ lg: "h-10 gap-2.5 px-4 **:data-[slot=icon]:size-5 [&_svg]:size-5";
29
+ icon: "size-9 shrink-0 **:data-[slot=icon]:size-6 [&_svg]:size-6";
30
+ 'icon-xs': "size-7 shrink-0 **:data-[slot=icon]:size-4 [&_svg]:size-4";
31
+ 'icon-sm': "size-8 shrink-0 **:data-[slot=icon]:size-5 [&_svg]:size-5";
32
+ 'icon-lg': "size-10 shrink-0 **:data-[slot=icon]:size-7 [&_svg]:size-7";
33
33
  };
34
34
  }, undefined, import("tailwind-variants").TVReturnTypeLike<{
35
35
  variant: {
@@ -39,13 +39,13 @@ export declare const button: import("tailwind-variants").TVReturnType<{
39
39
  destructive: "bg-danger text-ink-inverse hover:bg-danger/90 active:bg-danger/80";
40
40
  };
41
41
  size: {
42
- sm: "h-8 gap-1.5 px-2 [&_svg]:size-3.5";
43
- default: "h-9 gap-2 px-3 [&_svg]:size-4";
44
- lg: "h-10 gap-2.5 px-4 [&_svg]:size-5";
45
- icon: "size-9 shrink-0 [&_svg]:size-6";
46
- 'icon-xs': "size-7 shrink-0 [&_svg]:size-4";
47
- 'icon-sm': "size-8 shrink-0 [&_svg]:size-5";
48
- 'icon-lg': "size-10 shrink-0 [&_svg]:size-7";
42
+ sm: "h-8 gap-1.5 px-2 **:data-[slot=icon]:size-3.5 [&_svg]:size-3.5";
43
+ default: "h-9 gap-2 px-3 **:data-[slot=icon]:size-4 [&_svg]:size-4";
44
+ lg: "h-10 gap-2.5 px-4 **:data-[slot=icon]:size-5 [&_svg]:size-5";
45
+ icon: "size-9 shrink-0 **:data-[slot=icon]:size-6 [&_svg]:size-6";
46
+ 'icon-xs': "size-7 shrink-0 **:data-[slot=icon]:size-4 [&_svg]:size-4";
47
+ 'icon-sm': "size-8 shrink-0 **:data-[slot=icon]:size-5 [&_svg]:size-5";
48
+ 'icon-lg': "size-10 shrink-0 **:data-[slot=icon]:size-7 [&_svg]:size-7";
49
49
  };
50
50
  }, undefined>>;
51
51
  export type ButtonVariant = VariantProps<typeof button>['variant'];
@@ -9,13 +9,13 @@ export const button = tv({
9
9
  destructive: 'bg-danger text-ink-inverse hover:bg-danger/90 active:bg-danger/80'
10
10
  },
11
11
  size: {
12
- sm: 'h-8 gap-1.5 px-2 [&_svg]:size-3.5',
13
- default: 'h-9 gap-2 px-3 [&_svg]:size-4',
14
- lg: 'h-10 gap-2.5 px-4 [&_svg]:size-5',
15
- icon: 'size-9 shrink-0 [&_svg]:size-6',
16
- 'icon-xs': 'size-7 shrink-0 [&_svg]:size-4',
17
- 'icon-sm': 'size-8 shrink-0 [&_svg]:size-5',
18
- 'icon-lg': 'size-10 shrink-0 [&_svg]:size-7'
12
+ sm: 'h-8 gap-1.5 px-2 **:data-[slot=icon]:size-3.5 [&_svg]:size-3.5',
13
+ default: 'h-9 gap-2 px-3 **:data-[slot=icon]:size-4 [&_svg]:size-4',
14
+ lg: 'h-10 gap-2.5 px-4 **:data-[slot=icon]:size-5 [&_svg]:size-5',
15
+ icon: 'size-9 shrink-0 **:data-[slot=icon]:size-6 [&_svg]:size-6',
16
+ 'icon-xs': 'size-7 shrink-0 **:data-[slot=icon]:size-4 [&_svg]:size-4',
17
+ 'icon-sm': 'size-8 shrink-0 **:data-[slot=icon]:size-5 [&_svg]:size-5',
18
+ 'icon-lg': 'size-10 shrink-0 **:data-[slot=icon]:size-7 [&_svg]:size-7'
19
19
  }
20
20
  },
21
21
  defaultVariants: { variant: 'default', size: 'default' }
@@ -47,7 +47,7 @@
47
47
  {...rootProps}
48
48
  >
49
49
  <JsonTreeView.Tree
50
- class={cn('flex flex-col leading-[1.8] [&_svg]:size-3', treeClass)}
50
+ class={cn('flex flex-col leading-[1.8] **:data-[slot=icon]:size-3 [&_svg]:size-3', treeClass)}
51
51
  {indentGuide}
52
52
  {renderValue}
53
53
  >
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { Menu } from '@ark-ui/svelte/menu';
2
+ import { Menu, useMenuContext } from '@ark-ui/svelte/menu';
3
3
  import { Portal } from '@ark-ui/svelte/portal';
4
4
  import type { MenuContentBaseProps } from '@ark-ui/svelte/menu';
5
5
  import type { Snippet } from 'svelte';
@@ -11,6 +11,26 @@
11
11
  };
12
12
 
13
13
  const { class: className, children, ...restProps }: Props = $props();
14
+
15
+ const menu = useMenuContext();
16
+ const open = $derived(menu().open);
17
+
18
+ // Workaround for context menus opening at (0,0) the first time: zag skips
19
+ // `trackPositioning` for context triggers, so `currentPlacement` is first set in
20
+ // the popper's onComplete — after it wrote --x/--y. That changes the positioner
21
+ // style, and Svelte rewrites the whole `style` attribute, wiping --x/--y.
22
+ // Re-positioning once that settles makes the coordinates stick.
23
+ $effect(() => {
24
+ if (!open) return;
25
+ let inner = 0;
26
+ const outer = requestAnimationFrame(() => {
27
+ inner = requestAnimationFrame(() => menu().reposition());
28
+ });
29
+ return () => {
30
+ cancelAnimationFrame(outer);
31
+ cancelAnimationFrame(inner);
32
+ };
33
+ });
14
34
  </script>
15
35
 
16
36
  <Portal>
@@ -5,9 +5,9 @@ export declare const toggle: import("tailwind-variants").TVReturnType<{
5
5
  outline: "border border-border hover:bg-surface-2 hover:text-ink data-pressed:bg-surface-2 data-pressed:text-ink data-pressed:shadow-sm data-[state=on]:bg-surface-2 data-[state=on]:text-ink data-[state=on]:shadow-sm";
6
6
  };
7
7
  size: {
8
- sm: "h-8 min-w-8 gap-1 px-1.5 text-xs [&_svg]:size-3.5";
9
- md: "h-9 min-w-9 gap-1.5 px-2 text-sm [&_svg]:size-4";
10
- lg: "h-10 min-w-10 gap-2 px-2.5 text-sm [&_svg]:size-5";
8
+ sm: "h-8 min-w-8 gap-1 px-1.5 text-xs **:data-[slot=icon]:size-3.5 [&_svg]:size-3.5";
9
+ md: "h-9 min-w-9 gap-1.5 px-2 text-sm **:data-[slot=icon]:size-4 [&_svg]:size-4";
10
+ lg: "h-10 min-w-10 gap-2 px-2.5 text-sm **:data-[slot=icon]:size-5 [&_svg]:size-5";
11
11
  };
12
12
  icon: {
13
13
  true: "";
@@ -18,9 +18,9 @@ export declare const toggle: import("tailwind-variants").TVReturnType<{
18
18
  outline: "border border-border hover:bg-surface-2 hover:text-ink data-pressed:bg-surface-2 data-pressed:text-ink data-pressed:shadow-sm data-[state=on]:bg-surface-2 data-[state=on]:text-ink data-[state=on]:shadow-sm";
19
19
  };
20
20
  size: {
21
- sm: "h-8 min-w-8 gap-1 px-1.5 text-xs [&_svg]:size-3.5";
22
- md: "h-9 min-w-9 gap-1.5 px-2 text-sm [&_svg]:size-4";
23
- lg: "h-10 min-w-10 gap-2 px-2.5 text-sm [&_svg]:size-5";
21
+ sm: "h-8 min-w-8 gap-1 px-1.5 text-xs **:data-[slot=icon]:size-3.5 [&_svg]:size-3.5";
22
+ md: "h-9 min-w-9 gap-1.5 px-2 text-sm **:data-[slot=icon]:size-4 [&_svg]:size-4";
23
+ lg: "h-10 min-w-10 gap-2 px-2.5 text-sm **:data-[slot=icon]:size-5 [&_svg]:size-5";
24
24
  };
25
25
  icon: {
26
26
  true: "";
@@ -31,9 +31,9 @@ export declare const toggle: import("tailwind-variants").TVReturnType<{
31
31
  outline: "border border-border hover:bg-surface-2 hover:text-ink data-pressed:bg-surface-2 data-pressed:text-ink data-pressed:shadow-sm data-[state=on]:bg-surface-2 data-[state=on]:text-ink data-[state=on]:shadow-sm";
32
32
  };
33
33
  size: {
34
- sm: "h-8 min-w-8 gap-1 px-1.5 text-xs [&_svg]:size-3.5";
35
- md: "h-9 min-w-9 gap-1.5 px-2 text-sm [&_svg]:size-4";
36
- lg: "h-10 min-w-10 gap-2 px-2.5 text-sm [&_svg]:size-5";
34
+ sm: "h-8 min-w-8 gap-1 px-1.5 text-xs **:data-[slot=icon]:size-3.5 [&_svg]:size-3.5";
35
+ md: "h-9 min-w-9 gap-1.5 px-2 text-sm **:data-[slot=icon]:size-4 [&_svg]:size-4";
36
+ lg: "h-10 min-w-10 gap-2 px-2.5 text-sm **:data-[slot=icon]:size-5 [&_svg]:size-5";
37
37
  };
38
38
  icon: {
39
39
  true: "";
@@ -7,18 +7,18 @@ export const toggle = tv({
7
7
  outline: 'border border-border hover:bg-surface-2 hover:text-ink data-pressed:bg-surface-2 data-pressed:text-ink data-pressed:shadow-sm data-[state=on]:bg-surface-2 data-[state=on]:text-ink data-[state=on]:shadow-sm'
8
8
  },
9
9
  size: {
10
- sm: 'h-8 min-w-8 gap-1 px-1.5 text-xs [&_svg]:size-3.5',
11
- md: 'h-9 min-w-9 gap-1.5 px-2 text-sm [&_svg]:size-4',
12
- lg: 'h-10 min-w-10 gap-2 px-2.5 text-sm [&_svg]:size-5'
10
+ sm: 'h-8 min-w-8 gap-1 px-1.5 text-xs **:data-[slot=icon]:size-3.5 [&_svg]:size-3.5',
11
+ md: 'h-9 min-w-9 gap-1.5 px-2 text-sm **:data-[slot=icon]:size-4 [&_svg]:size-4',
12
+ lg: 'h-10 min-w-10 gap-2 px-2.5 text-sm **:data-[slot=icon]:size-5 [&_svg]:size-5'
13
13
  },
14
14
  icon: {
15
15
  true: ''
16
16
  }
17
17
  },
18
18
  compoundVariants: [
19
- { size: 'sm', icon: true, class: 'w-8 px-0 [&_svg]:size-5' },
20
- { size: 'md', icon: true, class: 'w-9 px-0 [&_svg]:size-6' },
21
- { size: 'lg', icon: true, class: 'w-10 px-0 [&_svg]:size-7' }
19
+ { size: 'sm', icon: true, class: 'w-8 px-0 **:data-[slot=icon]:size-5 [&_svg]:size-5' },
20
+ { size: 'md', icon: true, class: 'w-9 px-0 **:data-[slot=icon]:size-6 [&_svg]:size-6' },
21
+ { size: 'lg', icon: true, class: 'w-10 px-0 **:data-[slot=icon]:size-7 [&_svg]:size-7' }
22
22
  ],
23
23
  defaultVariants: { size: 'md', variant: 'ghost' }
24
24
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compote-ui",
3
- "version": "0.75.2",
3
+ "version": "0.75.4",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -71,12 +71,12 @@
71
71
  "@tailwindcss/vite": "^4.3.3",
72
72
  "@tanstack/intent": "^0.4.0",
73
73
  "@tanstack/svelte-table": "9.2.4",
74
- "@types/node": "^22.20.0",
74
+ "@types/node": "^24",
75
75
  "eslint": "^10.10.0",
76
76
  "eslint-config-prettier": "^10.1.8",
77
77
  "eslint-plugin-svelte": "^3.23.0",
78
78
  "globals": "^17.12.0",
79
- "prettier": "^3.9.6",
79
+ "prettier": "^3.9.7",
80
80
  "prettier-plugin-svelte": "^4.1.1",
81
81
  "prettier-plugin-tailwindcss": "^0.8.1",
82
82
  "publint": "^0.3.24",
@@ -86,22 +86,22 @@
86
86
  "tw-animate-css": "^1.4.0",
87
87
  "typescript": "^6.0.3",
88
88
  "typescript-eslint": "^8.70.0",
89
- "unplugin-icons": "^23.0.1",
89
+ "unplugin-icons": "^24.0.0",
90
90
  "vite": "^8.3.0",
91
- "vitest": "^5"
91
+ "vitest": "^5.0.1"
92
92
  },
93
93
  "keywords": [
94
94
  "svelte",
95
95
  "tanstack-intent"
96
96
  ],
97
97
  "dependencies": {
98
- "@ark-ui/svelte": "^5.24.1",
98
+ "@ark-ui/svelte": "^5.24.2",
99
99
  "@fontsource-variable/nunito-sans": "^5.2.7",
100
100
  "@internationalized/date": "^3.12.4",
101
- "@tanstack/svelte-virtual": "^3.13.37",
101
+ "@tanstack/svelte-virtual": "^3.13.39",
102
102
  "runed": "^0.37.1",
103
- "svelte-tel-input": "^4.3.2",
104
- "tailwind-merge": "^3.6.0",
103
+ "svelte-tel-input": "^4.3.3",
104
+ "tailwind-merge": "^3.7.0",
105
105
  "tailwind-variants": "^3.3.1"
106
106
  },
107
107
  "intent": {