@zooid/ui 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 zooid-ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@zooid/ui",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "author": "Ori Ben",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/zooid-ai/zooid",
10
+ "directory": "packages/ui"
11
+ },
12
+ "files": [
13
+ "src"
14
+ ],
15
+ "svelte": "./src/index.ts",
16
+ "exports": {
17
+ ".": {
18
+ "svelte": "./src/index.ts"
19
+ },
20
+ "./components/*": {
21
+ "svelte": "./src/components/*/index.ts"
22
+ },
23
+ "./lib/*": "./src/lib/*",
24
+ "./styles/*": "./src/styles/*"
25
+ },
26
+ "dependencies": {
27
+ "bits-ui": "^1.3.7",
28
+ "clsx": "^2.1.1",
29
+ "tailwind-merge": "^3.3.0",
30
+ "tailwind-variants": "^1.0.0"
31
+ },
32
+ "peerDependencies": {
33
+ "svelte": "^5.0.0"
34
+ }
35
+ }
@@ -0,0 +1,43 @@
1
+ <script lang="ts" module>
2
+ import { tv, type VariantProps } from 'tailwind-variants';
3
+
4
+ export const badgeVariants = tv({
5
+ base: 'inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
6
+ variants: {
7
+ variant: {
8
+ default:
9
+ 'border-transparent bg-primary text-primary-foreground shadow',
10
+ secondary:
11
+ 'border-transparent bg-secondary text-secondary-foreground',
12
+ destructive:
13
+ 'border-transparent bg-destructive text-destructive-foreground shadow',
14
+ outline: 'text-foreground',
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: 'default',
19
+ },
20
+ });
21
+
22
+ export type Variant = VariantProps<typeof badgeVariants>['variant'];
23
+ </script>
24
+
25
+ <script lang="ts">
26
+ import { cn } from '../../lib/utils';
27
+ import type { Snippet } from 'svelte';
28
+ import type { HTMLAttributes } from 'svelte/elements';
29
+
30
+ let {
31
+ class: className,
32
+ variant = 'default',
33
+ children,
34
+ ...restProps
35
+ }: HTMLAttributes<HTMLDivElement> & {
36
+ variant?: Variant;
37
+ children?: Snippet;
38
+ } = $props();
39
+ </script>
40
+
41
+ <div class={cn(badgeVariants({ variant }), className)} {...restProps}>
42
+ {@render children?.()}
43
+ </div>
@@ -0,0 +1,2 @@
1
+ export { default as Badge } from './badge.svelte';
2
+ export { badgeVariants } from './badge.svelte';
@@ -0,0 +1,59 @@
1
+ <script lang="ts" module>
2
+ import { tv, type VariantProps } from 'tailwind-variants';
3
+
4
+ export const buttonVariants = tv({
5
+ base: 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
6
+ variants: {
7
+ variant: {
8
+ default:
9
+ 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
10
+ destructive:
11
+ 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
12
+ outline:
13
+ 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
14
+ secondary:
15
+ 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
16
+ ghost: 'hover:bg-accent hover:text-accent-foreground',
17
+ link: 'text-primary underline-offset-4 hover:underline',
18
+ },
19
+ size: {
20
+ default: 'h-9 px-4 py-2',
21
+ sm: 'h-8 rounded-md px-3 text-xs',
22
+ lg: 'h-10 rounded-md px-8',
23
+ icon: 'h-9 w-9',
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ variant: 'default',
28
+ size: 'default',
29
+ },
30
+ });
31
+
32
+ export type Variant = VariantProps<typeof buttonVariants>['variant'];
33
+ export type Size = VariantProps<typeof buttonVariants>['size'];
34
+ </script>
35
+
36
+ <script lang="ts">
37
+ import { cn } from '../../lib/utils';
38
+ import type { Snippet } from 'svelte';
39
+ import type { HTMLButtonAttributes } from 'svelte/elements';
40
+
41
+ let {
42
+ class: className,
43
+ variant = 'default',
44
+ size = 'default',
45
+ children,
46
+ ...restProps
47
+ }: HTMLButtonAttributes & {
48
+ variant?: Variant;
49
+ size?: Size;
50
+ children?: Snippet;
51
+ } = $props();
52
+ </script>
53
+
54
+ <button
55
+ class={cn(buttonVariants({ variant, size }), className)}
56
+ {...restProps}
57
+ >
58
+ {@render children?.()}
59
+ </button>
@@ -0,0 +1,2 @@
1
+ export { default as Button } from './button.svelte';
2
+ export { buttonVariants } from './button.svelte';
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../lib/utils';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let {
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <div class={cn('p-4 pt-0', className)} {...restProps}>
14
+ {@render children?.()}
15
+ </div>
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../lib/utils';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let {
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: HTMLAttributes<HTMLParagraphElement> & { children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <p class={cn('text-sm text-muted-foreground', className)} {...restProps}>
14
+ {@render children?.()}
15
+ </p>
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../lib/utils';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let {
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <div class={cn('flex flex-col gap-y-1.5 p-4', className)} {...restProps}>
14
+ {@render children?.()}
15
+ </div>
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../lib/utils';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let {
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: HTMLAttributes<HTMLHeadingElement> & { children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <h3
14
+ class={cn('font-semibold leading-none tracking-tight', className)}
15
+ {...restProps}
16
+ >
17
+ {@render children?.()}
18
+ </h3>
@@ -0,0 +1,21 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../lib/utils';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let {
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <div
14
+ class={cn(
15
+ 'rounded-xl border border-border bg-card text-card-foreground shadow',
16
+ className,
17
+ )}
18
+ {...restProps}
19
+ >
20
+ {@render children?.()}
21
+ </div>
@@ -0,0 +1,5 @@
1
+ export { default as Card } from './card.svelte';
2
+ export { default as CardHeader } from './card-header.svelte';
3
+ export { default as CardTitle } from './card-title.svelte';
4
+ export { default as CardDescription } from './card-description.svelte';
5
+ export { default as CardContent } from './card-content.svelte';
@@ -0,0 +1 @@
1
+ export { default as Input } from './input.svelte';
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../lib/utils';
3
+ import type { HTMLInputAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ class: className,
7
+ value = $bindable(),
8
+ ...restProps
9
+ }: HTMLInputAttributes & { value?: string } = $props();
10
+ </script>
11
+
12
+ <input
13
+ class={cn(
14
+ 'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
15
+ className,
16
+ )}
17
+ bind:value
18
+ {...restProps}
19
+ />
@@ -0,0 +1 @@
1
+ export { default as ScrollArea } from './scroll-area.svelte';
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../lib/utils';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let {
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <div
14
+ class={cn('relative overflow-auto', className)}
15
+ {...restProps}
16
+ >
17
+ {@render children?.()}
18
+ </div>
@@ -0,0 +1 @@
1
+ export { default as Separator } from './separator.svelte';
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../lib/utils';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ class: className,
7
+ orientation = 'horizontal',
8
+ ...restProps
9
+ }: HTMLAttributes<HTMLDivElement> & {
10
+ orientation?: 'horizontal' | 'vertical';
11
+ } = $props();
12
+ </script>
13
+
14
+ <div
15
+ role="separator"
16
+ aria-orientation={orientation}
17
+ class={cn(
18
+ 'shrink-0 bg-border',
19
+ orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
20
+ className,
21
+ )}
22
+ {...restProps}
23
+ ></div>
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ export { cn } from './lib/utils';
2
+ export { Card, CardHeader, CardTitle, CardDescription, CardContent } from './components/card/index';
3
+ export { Badge, badgeVariants } from './components/badge/index';
4
+ export { ScrollArea } from './components/scroll-area/index';
5
+ export { Input } from './components/input/index';
6
+ export { Button, buttonVariants } from './components/button/index';
7
+ export { Separator } from './components/separator/index';
@@ -0,0 +1,6 @@
1
+ import { type ClassValue, clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }
@@ -0,0 +1,43 @@
1
+ @import 'tailwindcss';
2
+
3
+ @custom-variant dark (&:where(.dark, .dark *));
4
+
5
+ @theme {
6
+ --color-background: oklch(0.145 0 0);
7
+ --color-foreground: oklch(0.985 0 0);
8
+ --color-card: oklch(0.17 0 0);
9
+ --color-card-foreground: oklch(0.985 0 0);
10
+ --color-popover: oklch(0.17 0 0);
11
+ --color-popover-foreground: oklch(0.985 0 0);
12
+ --color-primary: oklch(0.75 0.18 160);
13
+ --color-primary-foreground: oklch(0.145 0 0);
14
+ --color-secondary: oklch(0.25 0 0);
15
+ --color-secondary-foreground: oklch(0.985 0 0);
16
+ --color-muted: oklch(0.25 0 0);
17
+ --color-muted-foreground: oklch(0.65 0 0);
18
+ --color-accent: oklch(0.25 0 0);
19
+ --color-accent-foreground: oklch(0.985 0 0);
20
+ --color-destructive: oklch(0.55 0.2 27);
21
+ --color-destructive-foreground: oklch(0.985 0 0);
22
+ --color-border: oklch(0.3 0 0);
23
+ --color-input: oklch(0.3 0 0);
24
+ --color-ring: oklch(0.75 0.18 160);
25
+
26
+ --radius-sm: 0.25rem;
27
+ --radius-md: 0.375rem;
28
+ --radius-lg: 0.5rem;
29
+ --radius-xl: 0.75rem;
30
+ }
31
+
32
+ body {
33
+ background-color: var(--color-background);
34
+ color: var(--color-foreground);
35
+ font-family:
36
+ ui-monospace,
37
+ SFMono-Regular,
38
+ 'SF Mono',
39
+ Menlo,
40
+ Consolas,
41
+ 'Liberation Mono',
42
+ monospace;
43
+ }