compote-ui 0.67.1 → 0.68.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.
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { badge } from './badge.variants';
4
+ import type { BadgeProps } from './types';
5
+
6
+ type Props = BadgeProps & {
7
+ children?: Snippet;
8
+ };
9
+
10
+ let { variant, color, icon, class: className, children, ...rest }: Props = $props();
11
+ </script>
12
+
13
+ <span class={badge({ variant, color, class: className })} {...rest}>
14
+ {@render icon?.()}
15
+ {@render children?.()}
16
+ </span>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { BadgeProps } from './types';
3
+ type Props = BadgeProps & {
4
+ children?: Snippet;
5
+ };
6
+ declare const Badge: import("svelte").Component<Props, {}, "">;
7
+ type Badge = ReturnType<typeof Badge>;
8
+ export default Badge;
@@ -0,0 +1,46 @@
1
+ import { type VariantProps } from 'tailwind-variants';
2
+ export declare const badge: import("tailwind-variants").TVReturnType<{
3
+ variant: {
4
+ solid: string;
5
+ subtle: string;
6
+ outline: string;
7
+ };
8
+ color: {
9
+ neutral: string;
10
+ primary: string;
11
+ danger: string;
12
+ warning: string;
13
+ success: string;
14
+ info: string;
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", {
17
+ variant: {
18
+ solid: string;
19
+ subtle: string;
20
+ outline: string;
21
+ };
22
+ color: {
23
+ neutral: string;
24
+ primary: string;
25
+ danger: string;
26
+ warning: string;
27
+ success: string;
28
+ info: string;
29
+ };
30
+ }, undefined, import("tailwind-variants").TVReturnType<{
31
+ variant: {
32
+ solid: string;
33
+ subtle: string;
34
+ outline: string;
35
+ };
36
+ color: {
37
+ neutral: string;
38
+ primary: string;
39
+ danger: string;
40
+ warning: string;
41
+ success: string;
42
+ info: string;
43
+ };
44
+ }, 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", unknown, unknown, undefined>>;
45
+ export type BadgeVariant = NonNullable<VariantProps<typeof badge>['variant']>;
46
+ export type BadgeColor = NonNullable<VariantProps<typeof badge>['color']>;
@@ -0,0 +1,40 @@
1
+ import { tv } from 'tailwind-variants';
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',
4
+ variants: {
5
+ variant: {
6
+ solid: '',
7
+ subtle: '',
8
+ outline: 'border bg-transparent'
9
+ },
10
+ color: {
11
+ neutral: '',
12
+ primary: '',
13
+ danger: '',
14
+ warning: '',
15
+ success: '',
16
+ info: ''
17
+ }
18
+ },
19
+ compoundVariants: [
20
+ { variant: 'solid', color: 'neutral', class: 'bg-surface-3 text-ink' },
21
+ { variant: 'solid', color: 'primary', class: 'bg-primary text-ink-inverse' },
22
+ { variant: 'solid', color: 'danger', class: 'bg-danger text-ink-inverse' },
23
+ { variant: 'solid', color: 'warning', class: 'bg-warning text-ink-inverse' },
24
+ { variant: 'solid', color: 'success', class: 'bg-success text-ink-inverse' },
25
+ { variant: 'solid', color: 'info', class: 'bg-info text-ink-inverse' },
26
+ { variant: 'subtle', color: 'neutral', class: 'bg-surface-2 text-ink-dim' },
27
+ { variant: 'subtle', color: 'primary', class: 'bg-primary/10 text-primary' },
28
+ { variant: 'subtle', color: 'danger', class: 'bg-danger/10 text-danger' },
29
+ { variant: 'subtle', color: 'warning', class: 'bg-warning/10 text-warning' },
30
+ { variant: 'subtle', color: 'success', class: 'bg-success/10 text-success' },
31
+ { variant: 'subtle', color: 'info', class: 'bg-info/10 text-info' },
32
+ { variant: 'outline', color: 'neutral', class: 'border-border text-ink-dim' },
33
+ { variant: 'outline', color: 'primary', class: 'border-primary text-primary' },
34
+ { variant: 'outline', color: 'danger', class: 'border-danger text-danger' },
35
+ { variant: 'outline', color: 'warning', class: 'border-warning text-warning' },
36
+ { variant: 'outline', color: 'success', class: 'border-success text-success' },
37
+ { variant: 'outline', color: 'info', class: 'border-info text-info' }
38
+ ],
39
+ defaultVariants: { variant: 'subtle', color: 'neutral' }
40
+ });
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import type { ClassValue } from 'tailwind-variants';
4
+ import type { BadgeColor, BadgeVariant } from './badge.variants';
5
+ export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'class'> {
6
+ variant?: BadgeVariant;
7
+ color?: BadgeColor;
8
+ icon?: Snippet;
9
+ class?: ClassValue;
10
+ }
11
+ export type { BadgeColor, BadgeVariant };
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * as AppShell from './components/app-shell';
2
2
  export { default as Avatar } from './components/avatar/avatar.svelte';
3
3
  export type { AvatarProps, AvatarSize } from './components/avatar/avatar.types';
4
+ export { default as Badge } from './components/badge/badge.svelte';
5
+ export type { BadgeProps, BadgeVariant, BadgeColor } from './components/badge/types';
4
6
  export { default as Button } from './components/button/button.svelte';
5
7
  export { default as LinkButton } from './components/button/link-button.svelte';
6
8
  export * as Card from './components/card';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Reexport your entry components here
2
2
  export * as AppShell from './components/app-shell';
3
3
  export { default as Avatar } from './components/avatar/avatar.svelte';
4
+ export { default as Badge } from './components/badge/badge.svelte';
4
5
  export { default as Button } from './components/button/button.svelte';
5
6
  export { default as LinkButton } from './components/button/link-button.svelte';
6
7
  export * as Card from './components/card';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compote-ui",
3
- "version": "0.67.1",
3
+ "version": "0.68.0",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev --open",
@@ -60,30 +60,30 @@
60
60
  "@iconify-json/ph": "^1.2.2",
61
61
  "@sveltejs/adapter-auto": "^7.0.0",
62
62
  "@sveltejs/adapter-cloudflare": "^7.2.9",
63
- "@sveltejs/kit": "^2.69.3",
63
+ "@sveltejs/kit": "^2.70.1",
64
64
  "@sveltejs/package": "^2.5.8",
65
65
  "@sveltejs/vite-plugin-svelte": "^7.2.0",
66
- "@tailwindcss/vite": "^4.3.2",
66
+ "@tailwindcss/vite": "^4.3.3",
67
67
  "@tanstack/intent": "^0.3.6",
68
68
  "@tanstack/svelte-table": "9.0.0-beta.47",
69
- "@tanstack/svelte-virtual": "^3.13.32",
69
+ "@tanstack/svelte-virtual": "^3.13.33",
70
70
  "@types/node": "^22.20.0",
71
71
  "eslint": "^10.7.0",
72
72
  "eslint-config-prettier": "^10.1.8",
73
- "eslint-plugin-svelte": "^3.19.0",
73
+ "eslint-plugin-svelte": "^3.22.0",
74
74
  "globals": "^17.5.0",
75
- "prettier": "^3.9.5",
75
+ "prettier": "^3.9.6",
76
76
  "prettier-plugin-svelte": "^4.1.1",
77
- "prettier-plugin-tailwindcss": "^0.8.0",
77
+ "prettier-plugin-tailwindcss": "^0.8.1",
78
78
  "publint": "^0.3.21",
79
- "svelte": "^5.56.5",
80
- "svelte-check": "^4.7.2",
81
- "tailwindcss": "^4.3.2",
79
+ "svelte": "^5.56.7",
80
+ "svelte-check": "^4.7.3",
81
+ "tailwindcss": "^4.3.3",
82
82
  "tw-animate-css": "^1.4.0",
83
83
  "typescript": "^6.0.3",
84
- "typescript-eslint": "^8.64.0",
84
+ "typescript-eslint": "^8.65.0",
85
85
  "unplugin-icons": "^23.0.1",
86
- "vite": "^8.1.4"
86
+ "vite": "^8.1.5"
87
87
  },
88
88
  "keywords": [
89
89
  "svelte",