compote-ui 0.67.1 → 0.68.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.
- package/dist/components/badge/badge.svelte +16 -0
- package/dist/components/badge/badge.svelte.d.ts +8 -0
- package/dist/components/badge/badge.variants.d.ts +46 -0
- package/dist/components/badge/badge.variants.js +40 -0
- package/dist/components/badge/types.d.ts +11 -0
- package/dist/components/badge/types.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -2
- package/package.json +15 -12
|
@@ -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';
|
|
@@ -25,8 +27,6 @@ export type { DatePickerProps } from './components/date-picker/types';
|
|
|
25
27
|
export * as Dialog from './components/dialog';
|
|
26
28
|
export { default as AlertDialog } from './components/dialog/alert-dialog.svelte';
|
|
27
29
|
export type { AlertDialogProps } from './components/dialog/dialog.types';
|
|
28
|
-
export * as DataTable from './components/data-table-v9';
|
|
29
|
-
export * as VirtualDataTable from './components/data-table-v9/virtual';
|
|
30
30
|
export * as Drawer from './components/drawer';
|
|
31
31
|
export { default as FileUploadDropzone } from './components/file-upload/file-upload-dropzone.svelte';
|
|
32
32
|
export { default as FileUpload } from './components/file-upload/file-upload.svelte';
|
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';
|
|
@@ -19,8 +20,10 @@ export { toDateValue, dateValueToString, dateValueToDate } from './utils/date';
|
|
|
19
20
|
export { default as DatePicker } from './components/date-picker/date-picker.svelte';
|
|
20
21
|
export * as Dialog from './components/dialog';
|
|
21
22
|
export { default as AlertDialog } from './components/dialog/alert-dialog.svelte';
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
// DataTable / VirtualDataTable are intentionally NOT re-exported here — they pull in the
|
|
24
|
+
// @tanstack/svelte-table peer dep for every consumer. Import them from the subpath exports:
|
|
25
|
+
// import * as DataTable from 'compote-ui/data-table';
|
|
26
|
+
// import * as VirtualDataTable from 'compote-ui/data-table/virtual';
|
|
24
27
|
export * as Drawer from './components/drawer';
|
|
25
28
|
export { default as FileUploadDropzone } from './components/file-upload/file-upload-dropzone.svelte';
|
|
26
29
|
export { default as FileUpload } from './components/file-upload/file-upload.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compote-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev --open",
|
|
@@ -50,6 +50,9 @@
|
|
|
50
50
|
"svelte": "^5.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
|
+
"@tanstack/svelte-table": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
53
56
|
"@tanstack/svelte-virtual": {
|
|
54
57
|
"optional": true
|
|
55
58
|
}
|
|
@@ -60,30 +63,30 @@
|
|
|
60
63
|
"@iconify-json/ph": "^1.2.2",
|
|
61
64
|
"@sveltejs/adapter-auto": "^7.0.0",
|
|
62
65
|
"@sveltejs/adapter-cloudflare": "^7.2.9",
|
|
63
|
-
"@sveltejs/kit": "^2.
|
|
66
|
+
"@sveltejs/kit": "^2.70.1",
|
|
64
67
|
"@sveltejs/package": "^2.5.8",
|
|
65
68
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
66
|
-
"@tailwindcss/vite": "^4.3.
|
|
69
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
67
70
|
"@tanstack/intent": "^0.3.6",
|
|
68
71
|
"@tanstack/svelte-table": "9.0.0-beta.47",
|
|
69
|
-
"@tanstack/svelte-virtual": "^3.13.
|
|
72
|
+
"@tanstack/svelte-virtual": "^3.13.33",
|
|
70
73
|
"@types/node": "^22.20.0",
|
|
71
74
|
"eslint": "^10.7.0",
|
|
72
75
|
"eslint-config-prettier": "^10.1.8",
|
|
73
|
-
"eslint-plugin-svelte": "^3.
|
|
76
|
+
"eslint-plugin-svelte": "^3.22.0",
|
|
74
77
|
"globals": "^17.5.0",
|
|
75
|
-
"prettier": "^3.9.
|
|
78
|
+
"prettier": "^3.9.6",
|
|
76
79
|
"prettier-plugin-svelte": "^4.1.1",
|
|
77
|
-
"prettier-plugin-tailwindcss": "^0.8.
|
|
80
|
+
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
78
81
|
"publint": "^0.3.21",
|
|
79
|
-
"svelte": "^5.56.
|
|
80
|
-
"svelte-check": "^4.7.
|
|
81
|
-
"tailwindcss": "^4.3.
|
|
82
|
+
"svelte": "^5.56.7",
|
|
83
|
+
"svelte-check": "^4.7.3",
|
|
84
|
+
"tailwindcss": "^4.3.3",
|
|
82
85
|
"tw-animate-css": "^1.4.0",
|
|
83
86
|
"typescript": "^6.0.3",
|
|
84
|
-
"typescript-eslint": "^8.
|
|
87
|
+
"typescript-eslint": "^8.65.0",
|
|
85
88
|
"unplugin-icons": "^23.0.1",
|
|
86
|
-
"vite": "^8.1.
|
|
89
|
+
"vite": "^8.1.5"
|
|
87
90
|
},
|
|
88
91
|
"keywords": [
|
|
89
92
|
"svelte",
|