@svadmin/ui 0.5.14 → 0.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/ui",
3
- "version": "0.5.14",
3
+ "version": "0.6.0",
4
4
  "description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -22,7 +22,7 @@
22
22
  "peerDependencies": {
23
23
  "svelte": "^5.0.0",
24
24
  "@svadmin/core": "^0.5.0",
25
- "@tanstack/svelte-query": "^5.0.0",
25
+ "@tanstack/svelte-query": "^6.0.0",
26
26
  "bits-ui": "^2.0.0",
27
27
  "tailwind-variants": "^3.0.0",
28
28
  "clsx": "^2.0.0",
@@ -414,7 +414,7 @@
414
414
  {/if}
415
415
 
416
416
  <!-- Table (TanStack-powered) -->
417
- <div class="rounded-lg border border-border bg-card shadow-sm overflow-hidden">
417
+ <div class="rounded-lg bg-card shadow-sm overflow-hidden">
418
418
  {#if query.isLoading}
419
419
  <div class="p-4 space-y-3">
420
420
  <div class="flex gap-4 mb-2">
@@ -15,7 +15,7 @@
15
15
  </script>
16
16
 
17
17
  <div
18
- class="flex flex-col items-center justify-center p-8 text-center min-h-[300px] bg-card rounded-lg border border-dashed border-border/50 shadow-sm"
18
+ class="flex flex-col items-center justify-center p-8 text-center min-h-[300px] bg-card/50 rounded-lg shadow-sm"
19
19
  in:scale={{ start: 0.95, duration: 250, opacity: 0 }}
20
20
  >
21
21
  <div class="h-20 w-20 rounded-full bg-muted flex items-center justify-center mb-4">
@@ -21,7 +21,7 @@
21
21
  }>();
22
22
  </script>
23
23
 
24
- <header class="sticky top-0 z-30 flex h-14 w-full shrink-0 items-center justify-between border-b border-slate-200/60 dark:border-slate-800/60 bg-white/60 dark:bg-slate-900/60 backdrop-blur-md px-4 md:px-6">
24
+ <header class="sticky top-0 z-30 flex h-14 w-full shrink-0 items-center justify-between bg-white/60 dark:bg-slate-900/60 backdrop-blur-md px-4 md:px-6">
25
25
  <div class="flex items-center gap-4">
26
26
  {#if children}
27
27
  {@render children()}
@@ -64,7 +64,7 @@
64
64
  <div role="application" onkeydown={(e) => { if ((e.ctrlKey || e.metaKey) && e.key === 'k') { e.preventDefault(); commandOpen = true; } }}>
65
65
  {#if loading}
66
66
  <div class="flex h-screen" in:fade={{ duration: 150 }}>
67
- <div class="hidden md:block w-64 border-r bg-sidebar/80 p-4 space-y-4">
67
+ <div class="hidden md:block w-64 bg-sidebar/80 p-4 space-y-4">
68
68
  <Skeleton class="h-8 w-32" />
69
69
  <div class="space-y-2 mt-6">
70
70
  {#each Array(5) as _}
@@ -142,13 +142,13 @@
142
142
 
143
143
  <aside
144
144
  aria-label="Sidebar navigation"
145
- class="fixed inset-y-0 left-0 z-30 flex flex-col backdrop-blur-xl border-r border-sidebar-border transition-all duration-300"
145
+ class="fixed inset-y-0 left-0 z-30 flex flex-col backdrop-blur-xl transition-all duration-300"
146
146
  style="background-color: var(--sidebar);"
147
147
  class:w-64={!collapsed}
148
148
  class:w-16={collapsed}
149
149
  >
150
150
  <!-- Logo -->
151
- <div class="flex h-16 items-center justify-between border-b border-sidebar-border px-4">
151
+ <div class="flex h-16 items-center justify-between px-4">
152
152
  {#if !collapsed}
153
153
  <div class="flex items-center gap-3">
154
154
  <div class="w-8 h-8 rounded-lg bg-gradient-to-tr from-primary to-purple-500 shrink-0" style="box-shadow: 0 4px 12px oklch(0.488 0.243 264.376 / 20%);"></div>
@@ -245,7 +245,7 @@
245
245
  </ScrollArea>
246
246
 
247
247
  <!-- Footer -->
248
- <div class="border-t border-sidebar-border">
248
+ <div>
249
249
  <!-- Color theme picker -->
250
250
  {#if !collapsed}
251
251
  <div class="px-3 pt-3 pb-1">
@@ -14,7 +14,7 @@
14
14
  };
15
15
 
16
16
  const variantMap: Record<StyleVariant, string> = {
17
- default: 'border border-border bg-card shadow-sm',
17
+ default: 'bg-card shadow-sm hover:shadow-md transition-shadow duration-300',
18
18
  outline: 'border-2 border-border bg-transparent',
19
19
  filled: 'border-0 bg-muted/50 shadow-sm',
20
20
  };
@@ -19,7 +19,7 @@
19
19
  // AvatarSize type is exported from the package index.ts
20
20
  type AvatarSize = VariantProps<typeof avatarVariants>["size"];
21
21
 
22
- type Props = WithElementRef<HTMLImgAttributes> & {
22
+ type Props = WithElementRef<HTMLImgAttributes, HTMLImageElement> & {
23
23
  size?: AvatarSize;
24
24
  fallback?: string;
25
25
  };
@@ -34,8 +34,8 @@
34
34
  export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
35
35
  export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
36
36
 
37
- export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
38
- WithElementRef<HTMLAnchorAttributes> & {
37
+ export type ButtonProps = WithElementRef<HTMLButtonAttributes, HTMLButtonElement> &
38
+ WithElementRef<HTMLAnchorAttributes, HTMLAnchorElement> & {
39
39
  variant?: ButtonVariant;
40
40
  size?: ButtonSize;
41
41
  };
@@ -13,7 +13,7 @@
13
13
  <div
14
14
  bind:this={ref}
15
15
  data-slot="card-footer"
16
- class={cn("bg-muted/50 rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3 flex items-center", className)}
16
+ class={cn("bg-muted/50 rounded-b-xl p-4 group-data-[size=sm]/card:p-3 flex items-center", className)}
17
17
  {...restProps}
18
18
  >
19
19
  {@render children?.()}
@@ -15,7 +15,7 @@
15
15
  bind:this={ref}
16
16
  data-slot="card"
17
17
  data-size={size}
18
- class={cn("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col", className)}
18
+ class={cn("shadow-sm bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-sm has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col", className)}
19
19
  {...restProps}
20
20
  >
21
21
  {@render children?.()}
@@ -2,7 +2,7 @@
2
2
  import { cn, type WithElementRef } from "../../../utils.js";
3
3
  import type { HTMLButtonAttributes } from "svelte/elements";
4
4
 
5
- type Props = WithElementRef<HTMLButtonAttributes> & {
5
+ type Props = WithElementRef<HTMLButtonAttributes, HTMLButtonElement> & {
6
6
  checked?: boolean;
7
7
  onCheckedChange?: (checked: boolean) => void;
8
8
  };
@@ -2,7 +2,7 @@
2
2
  import { cn, type WithElementRef } from "../../../utils.js";
3
3
  import type { HTMLButtonAttributes } from "svelte/elements";
4
4
 
5
- type Props = WithElementRef<HTMLButtonAttributes> & {
5
+ type Props = WithElementRef<HTMLButtonAttributes, HTMLButtonElement> & {
6
6
  inset?: boolean;
7
7
  destructive?: boolean;
8
8
  };
@@ -2,7 +2,7 @@
2
2
  import { cn, type WithElementRef } from "../../../utils.js";
3
3
  import type { HTMLButtonAttributes } from "svelte/elements";
4
4
 
5
- type Props = WithElementRef<HTMLButtonAttributes>;
5
+ type Props = WithElementRef<HTMLButtonAttributes, HTMLButtonElement>;
6
6
 
7
7
  let {
8
8
  ref = $bindable(null),
@@ -2,7 +2,7 @@
2
2
  import { cn, type WithElementRef } from '../../../utils.js';
3
3
  import type { HTMLLabelAttributes } from 'svelte/elements';
4
4
 
5
- let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLLabelAttributes> = $props();
5
+ let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLLabelAttributes, HTMLLabelElement> = $props();
6
6
  </script>
7
7
 
8
8
  <label
@@ -2,7 +2,7 @@
2
2
  import { cn, type WithElementRef } from "../../../utils.js";
3
3
  import type { HTMLSelectAttributes } from "svelte/elements";
4
4
 
5
- type Props = WithElementRef<HTMLSelectAttributes> & {
5
+ type Props = WithElementRef<HTMLSelectAttributes, HTMLSelectElement> & {
6
6
  placeholder?: string;
7
7
  };
8
8
 
@@ -2,7 +2,7 @@
2
2
  import { cn, type WithElementRef } from "../../../utils.js";
3
3
  import type { HTMLButtonAttributes } from "svelte/elements";
4
4
 
5
- type Props = WithElementRef<HTMLButtonAttributes> & {
5
+ type Props = WithElementRef<HTMLButtonAttributes, HTMLButtonElement> & {
6
6
  checked?: boolean;
7
7
  disabled?: boolean;
8
8
  onCheckedChange?: (checked: boolean) => void;
@@ -10,6 +10,6 @@
10
10
  }: WithElementRef<HTMLAttributes<HTMLTableSectionElement>> = $props();
11
11
  </script>
12
12
 
13
- <tbody bind:this={ref} data-slot="table-body" class={cn("[&_tr:last-child]:border-0", className)} {...restProps}>
13
+ <tbody bind:this={ref} data-slot="table-body" class={cn(className)} {...restProps}>
14
14
  {@render children?.()}
15
15
  </tbody>
@@ -7,7 +7,7 @@
7
7
  class: className,
8
8
  children,
9
9
  ...restProps
10
- }: WithElementRef<HTMLTdAttributes> = $props();
10
+ }: WithElementRef<HTMLTdAttributes, HTMLTableCellElement> = $props();
11
11
  </script>
12
12
 
13
13
  <td bind:this={ref} data-slot="table-cell" class={cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className)} {...restProps}>
@@ -13,7 +13,7 @@
13
13
  <tfoot
14
14
  bind:this={ref}
15
15
  data-slot="table-footer"
16
- class={cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className)}
16
+ class={cn("bg-muted/50 font-medium", className)}
17
17
  {...restProps}
18
18
  >
19
19
  {@render children?.()}
@@ -7,7 +7,7 @@
7
7
  class: className,
8
8
  children,
9
9
  ...restProps
10
- }: WithElementRef<HTMLThAttributes> = $props();
10
+ }: WithElementRef<HTMLThAttributes, HTMLTableCellElement> = $props();
11
11
  </script>
12
12
 
13
13
  <th bind:this={ref} data-slot="table-head" class={cn("text-foreground h-9 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0", className)} {...restProps}>
@@ -13,7 +13,7 @@
13
13
  <thead
14
14
  bind:this={ref}
15
15
  data-slot="table-header"
16
- class={cn("[&_tr]:border-b", className)}
16
+ class={cn(className)}
17
17
  {...restProps}
18
18
  >
19
19
  {@render children?.()}
@@ -10,6 +10,6 @@
10
10
  }: WithElementRef<HTMLAttributes<HTMLTableRowElement>> = $props();
11
11
  </script>
12
12
 
13
- <tr bind:this={ref} data-slot="table-row" class={cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className)} {...restProps}>
13
+ <tr bind:this={ref} data-slot="table-row" class={cn("hover:bg-muted/50 data-[state=selected]:bg-muted transition-colors", className)} {...restProps}>
14
14
  {@render children?.()}
15
15
  </tr>
@@ -7,7 +7,7 @@
7
7
  class: className,
8
8
  children,
9
9
  ...restProps
10
- }: WithElementRef<HTMLTableAttributes> = $props();
10
+ }: WithElementRef<HTMLTableAttributes, HTMLTableElement> = $props();
11
11
  </script>
12
12
 
13
13
  <div data-slot="table-container" class="relative w-full overflow-x-auto">
@@ -2,7 +2,7 @@
2
2
  import { cn, type WithElementRef } from "../../../utils.js";
3
3
  import type { HTMLButtonAttributes } from "svelte/elements";
4
4
 
5
- type Props = WithElementRef<HTMLButtonAttributes> & {
5
+ type Props = WithElementRef<HTMLButtonAttributes, HTMLButtonElement> & {
6
6
  value: string;
7
7
  active?: boolean;
8
8
  };
@@ -2,7 +2,7 @@
2
2
  import type { HTMLTextareaAttributes } from "svelte/elements";
3
3
  import { cn, type WithElementRef } from "../../../utils.js";
4
4
 
5
- type Props = WithElementRef<HTMLTextareaAttributes>;
5
+ type Props = WithElementRef<HTMLTextareaAttributes, HTMLTextAreaElement>;
6
6
 
7
7
  let {
8
8
  ref = $bindable(null),