@svadmin/ui 0.131.2 → 0.133.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.
Files changed (55) hide show
  1. package/dist/app.css +640 -250
  2. package/dist/app.theme.css +640 -250
  3. package/dist/components/AboutSettings.svelte +1 -1
  4. package/dist/components/BackTop.svelte +62 -8
  5. package/dist/components/BackTop.svelte.d.ts +8 -3
  6. package/dist/components/Carousel.svelte +59 -19
  7. package/dist/components/Carousel.svelte.d.ts +3 -1
  8. package/dist/components/Collapse.svelte +11 -7
  9. package/dist/components/EmptyState.svelte +33 -18
  10. package/dist/components/EmptyState.svelte.d.ts +3 -1
  11. package/dist/components/FileUpload.svelte +6 -4
  12. package/dist/components/Link.svelte +19 -7
  13. package/dist/components/Link.svelte.d.ts +5 -3
  14. package/dist/components/NotificationHost.svelte +8 -8
  15. package/dist/components/RadioGroup.svelte +3 -1
  16. package/dist/components/RadioGroup.svelte.d.ts +1 -0
  17. package/dist/components/RangeSlider.svelte +47 -29
  18. package/dist/components/RangeSlider.svelte.d.ts +1 -0
  19. package/dist/components/Slider.svelte +39 -18
  20. package/dist/components/Slider.svelte.d.ts +1 -0
  21. package/dist/components/Space.svelte +27 -0
  22. package/dist/components/Space.svelte.d.ts +1 -0
  23. package/dist/components/Statistic.svelte +14 -5
  24. package/dist/components/Statistic.svelte.d.ts +2 -0
  25. package/dist/components/Steps.svelte +5 -3
  26. package/dist/components/StepsForm.svelte +4 -2
  27. package/dist/components/TableToolbar.svelte +132 -0
  28. package/dist/components/TableToolbar.svelte.d.ts +26 -0
  29. package/dist/components/Tag.svelte +1 -1
  30. package/dist/components/TagsInput.svelte +47 -2
  31. package/dist/components/TagsInput.svelte.d.ts +2 -0
  32. package/dist/components/Timeline.svelte +8 -5
  33. package/dist/components/Tree.svelte +6 -5
  34. package/dist/components/TypographyEllipsis.svelte +1 -1
  35. package/dist/components/content/DataState.svelte +2 -2
  36. package/dist/components/content/DescriptionList.svelte +25 -21
  37. package/dist/components/ui/alert/alert.svelte +42 -1
  38. package/dist/components/ui/alert/alert.svelte.d.ts +5 -0
  39. package/dist/components/ui/card/card.svelte +29 -3
  40. package/dist/components/ui/card/card.svelte.d.ts +5 -2
  41. package/dist/components/ui/input/input.svelte +74 -17
  42. package/dist/components/ui/input/input.svelte.d.ts +5 -1
  43. package/dist/components/ui/pagination/pagination-link.svelte +2 -8
  44. package/dist/components/ui/pagination/pagination-next.svelte +2 -5
  45. package/dist/components/ui/pagination/pagination-previous.svelte +2 -5
  46. package/dist/components/ui/progress/progress.svelte +15 -12
  47. package/dist/components/ui/switch/switch.svelte +17 -3
  48. package/dist/components/ui/switch/switch.svelte.d.ts +2 -0
  49. package/dist/components/ui/textarea/textarea.svelte +69 -15
  50. package/dist/components/ui/textarea/textarea.svelte.d.ts +3 -0
  51. package/dist/components.css +9 -1
  52. package/dist/index.d.ts +2 -1
  53. package/dist/index.js +3 -1
  54. package/dist/page-chrome.css +2 -1
  55. package/package.json +1 -1
@@ -50,7 +50,7 @@
50
50
  <style>
51
51
  .svadmin-timeline {
52
52
  display: grid;
53
- gap: var(--svadmin-space-4);
53
+ gap: 0;
54
54
  margin: 0;
55
55
  padding: 0;
56
56
  list-style: none;
@@ -60,6 +60,9 @@
60
60
  display: grid;
61
61
  grid-template-columns: auto minmax(0, 1fr);
62
62
  gap: var(--svadmin-space-3);
63
+ min-height: 78px;
64
+ color: var(--foreground);
65
+ font-size: var(--svadmin-text-body);
63
66
  }
64
67
  .svadmin-timeline__item:not(:last-child)::before {
65
68
  position: absolute;
@@ -84,9 +87,9 @@
84
87
  .svadmin-timeline__item[data-active='true'] .svadmin-timeline__marker { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
85
88
  .svadmin-timeline__custom-dot { display: inline-flex; align-items: center; justify-content: center; margin-block-start: 0.15rem; z-index: 1; color: var(--primary); }
86
89
  .svadmin-timeline__content { min-width: 0; }
87
- .svadmin-timeline__time { color: var(--muted-foreground); font-size: var(--svadmin-text-caption); }
88
- .svadmin-timeline__title { margin: 0; color: var(--foreground); font-size: var(--svadmin-text-body); font-weight: 600; }
89
- .svadmin-timeline__description { margin: var(--svadmin-space-1) 0 0; color: var(--muted-foreground); font-size: var(--svadmin-text-label); line-height: var(--svadmin-leading-body); }
90
+ .svadmin-timeline__time { color: var(--muted-foreground); font-size: var(--svadmin-text-caption); line-height: 1.667; }
91
+ .svadmin-timeline__title { margin: 0; color: var(--foreground); font-size: var(--svadmin-text-body); font-weight: 500; }
92
+ .svadmin-timeline__description { margin: var(--svadmin-space-1) 0 0; color: var(--muted-foreground); font-size: var(--svadmin-text-body); line-height: 1.5715; }
90
93
  .svadmin-timeline[data-mode='horizontal'] {
91
94
  grid-auto-flow: column;
92
95
  grid-auto-columns: minmax(10rem, 1fr);
@@ -96,4 +99,4 @@
96
99
  width: auto;
97
100
  height: 1px;
98
101
  }
99
- </style>
102
+ </style>
@@ -353,18 +353,19 @@
353
353
  display: grid;
354
354
  gap: 1px;
355
355
  color: var(--foreground);
356
- font-size: var(--svadmin-text-label);
356
+ font-size: var(--svadmin-text-body);
357
+ line-height: 1.5715;
357
358
  }
358
359
  .svadmin-tree__row {
359
360
  position: relative;
360
- border-radius: var(--radius-sm);
361
+ border-radius: 2px;
361
362
  cursor: pointer;
362
363
  outline: none;
363
364
  }
364
- .svadmin-tree__row:hover { background: var(--accent); }
365
- .svadmin-tree__row.is-selected { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
365
+ .svadmin-tree__row:hover { background: var(--svadmin-fill-2, var(--muted)); }
366
+ .svadmin-tree__row.is-selected { background: var(--svadmin-fill-2, var(--muted)); color: var(--primary); }
366
367
  .svadmin-tree__row:focus-visible { box-shadow: inset 0 0 0 var(--svadmin-focus-width) var(--ring); }
367
- .svadmin-tree__row.is-disabled { cursor: not-allowed; opacity: 0.5; }
368
+ .svadmin-tree__row.is-disabled { cursor: not-allowed; opacity: 1; color: var(--svadmin-text-4); }
368
369
  .svadmin-tree__row.is-dragging { opacity: 0.45; }
369
370
  .svadmin-tree__row[data-drop-position='inside'] { background: color-mix(in srgb, var(--primary) 14%, transparent); }
370
371
  .svadmin-tree__row[data-drop-position='before']::before,
@@ -95,7 +95,7 @@
95
95
  </div>
96
96
 
97
97
  <style>
98
- .svadmin-typography-ellipsis { color: var(--foreground); font-size: var(--svadmin-text-label); line-height: 1.5715; }
98
+ .svadmin-typography-ellipsis { color: var(--foreground); font-size: var(--svadmin-text-body); line-height: 1.5715; }
99
99
  .svadmin-typography-ellipsis__content { overflow-wrap: anywhere; }
100
100
  .svadmin-typography-ellipsis__content.is-clamped {
101
101
  display: -webkit-box;
@@ -77,7 +77,7 @@
77
77
  .empty-state { display: flex; align-items: flex-start; gap: 12px; padding: 16px; text-align: left; color: var(--foreground); }
78
78
  .empty-state__icon { display: flex; align-items: center; justify-content: center; flex: 0 0 32px; height: 32px; border-radius: 6px; background: var(--muted); color: var(--muted-foreground); }
79
79
  .empty-state__body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
80
- .empty-state h3 { margin: 0; font-size: var(--svadmin-text-label); line-height: var(--svadmin-leading-body); font-weight: 600; letter-spacing: 0; }
81
- .empty-state p { margin: var(--svadmin-space-1) 0 0; font-size: var(--svadmin-text-label); line-height: var(--svadmin-leading-body); color: var(--muted-foreground); }
80
+ .empty-state h3 { margin: 0; font-size: var(--svadmin-text-body); line-height: 1.5715; font-weight: 500; letter-spacing: 0; }
81
+ .empty-state p { margin: 4px 0 0; font-size: var(--svadmin-text-body); line-height: 1.5715; color: var(--muted-foreground); }
82
82
  .empty-state__action { margin-top: 12px; }
83
83
  </style>
@@ -61,19 +61,14 @@
61
61
  >
62
62
  <dt
63
63
  class={cn(
64
- 'bg-muted/30 font-medium text-muted-foreground shrink-0 border-b sm:border-b-0 sm:border-r border-border/30',
65
- 'px-4 py-2.5 text-xs sm:text-sm',
64
+ 'svadmin-description-list__label shrink-0 border-b sm:border-b-0 sm:border-r border-border/30 bg-muted/30',
65
+ 'px-4 py-2.5',
66
66
  isHorizontal ? 'sm:w-1/3' : '',
67
67
  )}
68
68
  >
69
69
  {item.label}
70
70
  </dt>
71
- <dd
72
- class={cn(
73
- 'break-words font-medium text-foreground bg-card flex-1 min-w-0',
74
- 'px-4 py-2.5 text-xs sm:text-sm',
75
- )}
76
- >
71
+ <dd class="svadmin-description-list__value bg-card px-4 py-2.5">
77
72
  {#if item.href}
78
73
  <a class="text-primary underline-offset-4 hover:underline" href={item.href}>{String(item.value ?? '—')}</a>
79
74
  {:else}
@@ -104,21 +99,10 @@
104
99
  spanClass(Math.min(item.span ?? 1, columns)),
105
100
  )}
106
101
  >
107
- <dt
108
- class={cn(
109
- 'font-medium text-muted-foreground',
110
- 'text-xs',
111
- isHorizontal ? 'shrink-0 min-w-20' : '',
112
- )}
113
- >
102
+ <dt class="svadmin-description-list__label">
114
103
  {item.label}
115
104
  </dt>
116
- <dd
117
- class={cn(
118
- 'break-words font-medium text-foreground min-w-0 flex-1',
119
- isHorizontal ? 'text-xs sm:text-sm' : 'mt-1 text-sm',
120
- )}
121
- >
105
+ <dd class="svadmin-description-list__value">
122
106
  {#if item.href}
123
107
  <a class="text-primary underline-offset-4 hover:underline" href={item.href}>{String(item.value ?? '—')}</a>
124
108
  {:else}
@@ -132,3 +116,23 @@
132
116
  {/each}
133
117
  </dl>
134
118
  {/if}
119
+
120
+ <style>
121
+ .svadmin-description-list__label {
122
+ color: var(--muted-foreground);
123
+ font-size: var(--svadmin-text-body);
124
+ font-weight: 500;
125
+ line-height: 1.5715;
126
+ }
127
+ .svadmin-description-list__value {
128
+ min-width: 0;
129
+ flex: 1;
130
+ color: var(--foreground);
131
+ font-size: var(--svadmin-text-body);
132
+ font-weight: 400;
133
+ line-height: 1.5715;
134
+ overflow-wrap: anywhere;
135
+ }
136
+ div.flex > .svadmin-description-list__label { flex: none; min-width: 5rem; }
137
+ div:not(.flex) > .svadmin-description-list__value { margin-top: 4px; }
138
+ </style>
@@ -8,12 +8,18 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import X from "@lucide/svelte/icons/x";
11
+ import { CheckCircle2, CircleAlert, Info, TriangleAlert } from "@lucide/svelte";
11
12
  import type { Snippet } from "svelte";
12
13
 
13
14
  type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
14
15
  variant?: AlertVariantValue;
15
16
  closable?: boolean;
16
17
  closeLabel?: string;
18
+ title?: string;
19
+ showIcon?: boolean;
20
+ banner?: boolean;
21
+ action?: Snippet;
22
+ icon?: Snippet;
17
23
  onclose?: (event: MouseEvent) => void;
18
24
  children?: Snippet;
19
25
  };
@@ -23,11 +29,25 @@
23
29
  variant = "default",
24
30
  closable = false,
25
31
  closeLabel = "Dismiss alert",
32
+ title,
33
+ showIcon = false,
34
+ banner = false,
35
+ action,
36
+ icon,
26
37
  onclose,
27
38
  class: className,
28
39
  children,
29
40
  ...restProps
30
41
  }: Props = $props();
42
+
43
+ const statusIcons = {
44
+ default: Info,
45
+ destructive: CircleAlert,
46
+ warning: TriangleAlert,
47
+ success: CheckCircle2,
48
+ } as const;
49
+
50
+ const IconComponent = $derived(statusIcons[variant] ?? Info);
31
51
  </script>
32
52
 
33
53
  <div
@@ -37,10 +57,31 @@
37
57
  data-feedback="static"
38
58
  data-variant={variant}
39
59
  data-closable={closable || undefined}
40
- class={cn(resolveAlertVariants({ variant }), className)}
60
+ class={cn(
61
+ resolveAlertVariants({ variant }),
62
+ banner && "svadmin-alert--banner rounded-none border-x-0 border-t-0 border-b border-border",
63
+ className
64
+ )}
41
65
  {...restProps}
42
66
  >
67
+ {#if icon}
68
+ {@render icon()}
69
+ {:else if showIcon}
70
+ <IconComponent class="svadmin-alert__icon" aria-hidden="true" />
71
+ {/if}
72
+
73
+ {#if title}
74
+ <div data-slot="alert-title" class="svadmin-alert-title font-semibold">{title}</div>
75
+ {/if}
76
+
43
77
  {@render children?.()}
78
+
79
+ {#if action}
80
+ <div class="svadmin-alert__action shrink-0 justify-self-end">
81
+ {@render action()}
82
+ </div>
83
+ {/if}
84
+
44
85
  {#if closable}
45
86
  <button type="button" class="svadmin-alert__close" aria-label={closeLabel} onclick={(event) => onclose?.(event)}>
46
87
  <X size={14} aria-hidden="true" />
@@ -7,6 +7,11 @@ type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
7
7
  variant?: AlertVariantValue;
8
8
  closable?: boolean;
9
9
  closeLabel?: string;
10
+ title?: string;
11
+ showIcon?: boolean;
12
+ banner?: boolean;
13
+ action?: Snippet;
14
+ icon?: Snippet;
10
15
  onclose?: (event: MouseEvent) => void;
11
16
  children?: Snippet;
12
17
  };
@@ -1,22 +1,48 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
3
  import { cn, type WithElementRef } from "../../../utils.js";
4
+ import { Skeleton } from "../skeleton/index.js";
5
+
6
+ type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
7
+ size?: "default" | "sm";
8
+ hoverable?: boolean;
9
+ bordered?: boolean;
10
+ loading?: boolean;
11
+ };
4
12
 
5
13
  let {
6
14
  ref = $bindable(null),
7
15
  class: className,
8
16
  children,
9
17
  size = "default",
18
+ hoverable = false,
19
+ bordered = true,
20
+ loading = false,
10
21
  ...restProps
11
- }: WithElementRef<HTMLAttributes<HTMLDivElement>> & { size?: "default" | "sm" } = $props();
22
+ }: Props = $props();
12
23
  </script>
13
24
 
14
25
  <div
15
26
  bind:this={ref}
16
27
  data-slot="card"
17
28
  data-size={size}
18
- class={cn("svadmin-card", className)}
29
+ data-hoverable={hoverable ? "true" : undefined}
30
+ class={cn(
31
+ "svadmin-card",
32
+ hoverable && "svadmin-card--hoverable",
33
+ !bordered && "border-0 shadow-none",
34
+ className
35
+ )}
19
36
  {...restProps}
20
37
  >
21
- {@render children?.()}
38
+ {#if loading}
39
+ <div class="space-y-3 p-6" data-slot="card-loading">
40
+ <Skeleton class="h-6 w-1/3" />
41
+ <Skeleton class="h-4 w-full" />
42
+ <Skeleton class="h-4 w-4/5" />
43
+ <Skeleton class="h-16 w-full mt-2" />
44
+ </div>
45
+ {:else}
46
+ {@render children?.()}
47
+ {/if}
22
48
  </div>
@@ -1,8 +1,11 @@
1
1
  import type { HTMLAttributes } from "svelte/elements";
2
2
  import { type WithElementRef } from "../../../utils.js";
3
- type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
3
+ type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
4
4
  size?: "default" | "sm";
5
+ hoverable?: boolean;
6
+ bordered?: boolean;
7
+ loading?: boolean;
5
8
  };
6
- declare const Card: import("svelte").Component<$$ComponentProps, {}, "ref">;
9
+ declare const Card: import("svelte").Component<Props, {}, "ref">;
7
10
  type Card = ReturnType<typeof Card>;
8
11
  export default Card;
@@ -3,6 +3,8 @@
3
3
  generics="Type extends HTMLInputTypeAttribute | undefined = undefined"
4
4
  >
5
5
  import type { HTMLInputAttributes, HTMLInputTypeAttribute } from "svelte/elements";
6
+ import type { Snippet } from "svelte";
7
+ import { CircleX } from "@lucide/svelte";
6
8
  import { useTranslation } from "@svadmin/core/i18n";
7
9
  import { definedOptions } from "@svadmin/core/options";
8
10
  import { cn, type WithElementRef } from "../../../utils.js";
@@ -22,8 +24,15 @@
22
24
  onselect?: HTMLInputAttributes["onselect"];
23
25
  };
24
26
 
25
- type Props = WithElementRef<Omit<HTMLInputAttributes, "type" | "value" | "size" | "onfocus" | "onblur" | "onselect">> &
26
- { size?: InputSize; nativeSize?: number; status?: InputStatus | undefined } &
27
+ type Props = WithElementRef<Omit<HTMLInputAttributes, "type" | "value" | "size" | "onfocus" | "onblur" | "onselect" | "prefix">> &
28
+ {
29
+ size?: InputSize;
30
+ nativeSize?: number;
31
+ status?: InputStatus | undefined;
32
+ allowClear?: boolean;
33
+ prefix?: Snippet;
34
+ suffix?: Snippet;
35
+ } &
27
36
  InputHandlers &
28
37
  (Type extends "file"
29
38
  ? { type: "file"; files?: FileList | undefined; value?: never }
@@ -38,6 +47,9 @@
38
47
  size: sizeProp,
39
48
  nativeSize,
40
49
  status,
50
+ allowClear = false,
51
+ prefix,
52
+ suffix,
41
53
  class: className,
42
54
  "data-slot": dataSlot = "input",
43
55
  "aria-invalid": ariaInvalid,
@@ -107,8 +119,34 @@
107
119
  textSelected = readSelected(event.currentTarget);
108
120
  onselect?.(event);
109
121
  }
122
+
123
+ function clearInput() {
124
+ if (disabled) return;
125
+ value = "" as InputValue;
126
+ }
127
+
128
+ const hasWrapper = $derived(!isFileInput && Boolean(allowClear || prefix || suffix));
110
129
  </script>
111
130
 
131
+ {#snippet inputElement()}
132
+ <input
133
+ bind:this={ref}
134
+ data-slot={dataSlot}
135
+ data-size={size}
136
+ data-input-state={inputState}
137
+ aria-invalid={ariaInvalid}
138
+ aria-busy={inputState === "loading" ? "true" : undefined}
139
+ class={cn("svadmin-input", hasWrapper && "border-0 shadow-none bg-transparent focus-visible:ring-0 px-0 h-full", className)}
140
+ {type}
141
+ lang={isDateInput ? i18n.locale : undefined}
142
+ bind:value
143
+ {...attributes}
144
+ onfocus={handleFocus}
145
+ onblur={handleBlur}
146
+ onselect={handleSelect}
147
+ />
148
+ {/snippet}
149
+
112
150
  {#if isFileInput}
113
151
  <div
114
152
  class={cn("svadmin-file-input", className)}
@@ -136,21 +174,40 @@
136
174
  <span class="svadmin-file-input__name">{selectedFileLabel}</span>
137
175
  </span>
138
176
  </div>
139
- {:else}
140
- <input
141
- bind:this={ref}
142
- data-slot={dataSlot}
177
+ {:else if hasWrapper}
178
+ <div
179
+ class={cn(
180
+ "svadmin-input-wrapper relative inline-flex items-center w-full rounded-sm border border-border bg-card px-2.5 transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:border-ring",
181
+ size === "compact" || size === "mini" ? "h-7 text-xs" : "h-8 text-sm",
182
+ disabled && "opacity-50 cursor-not-allowed bg-muted",
183
+ className
184
+ )}
185
+ data-slot="input-wrapper"
143
186
  data-size={size}
144
187
  data-input-state={inputState}
145
- aria-invalid={ariaInvalid}
146
- aria-busy={inputState === "loading" ? "true" : undefined}
147
- class={cn("svadmin-input", className)}
148
- {type}
149
- lang={isDateInput ? i18n.locale : undefined}
150
- bind:value
151
- {...attributes}
152
- onfocus={handleFocus}
153
- onblur={handleBlur}
154
- onselect={handleSelect}
155
- />
188
+ >
189
+ {#if prefix}
190
+ <span class="svadmin-input-prefix mr-2 text-muted-foreground shrink-0 flex items-center" aria-hidden="true">
191
+ {@render prefix()}
192
+ </span>
193
+ {/if}
194
+ {@render inputElement()}
195
+ {#if allowClear && filled && !disabled}
196
+ <button
197
+ type="button"
198
+ class="svadmin-input-clear text-muted-foreground hover:text-foreground shrink-0 ml-1 p-0.5 rounded-full cursor-pointer outline-none"
199
+ aria-label="Clear input"
200
+ onclick={clearInput}
201
+ >
202
+ <CircleX size={14} aria-hidden="true" />
203
+ </button>
204
+ {/if}
205
+ {#if suffix}
206
+ <span class="svadmin-input-suffix ml-2 text-muted-foreground shrink-0 flex items-center" aria-hidden="true">
207
+ {@render suffix()}
208
+ </span>
209
+ {/if}
210
+ </div>
211
+ {:else}
212
+ {@render inputElement()}
156
213
  {/if}
@@ -1,11 +1,15 @@
1
1
  import type { HTMLInputAttributes, HTMLInputTypeAttribute } from "svelte/elements";
2
+ import type { Snippet } from "svelte";
2
3
  declare function $$render<Type extends HTMLInputTypeAttribute | undefined = undefined>(): {
3
- props: Omit<HTMLInputAttributes, "type" | "value" | "size" | "onfocus" | "onblur" | "onselect"> & {
4
+ props: Omit<HTMLInputAttributes, "type" | "value" | "size" | "prefix" | "onfocus" | "onblur" | "onselect"> & {
4
5
  ref?: HTMLElement | null;
5
6
  } & {
6
7
  size?: "default" | "sm" | "lg" | "compact" | "mini";
7
8
  nativeSize?: number;
8
9
  status?: ("error" | "success" | "loading") | undefined;
10
+ allowClear?: boolean;
11
+ prefix?: Snippet;
12
+ suffix?: Snippet;
9
13
  } & {
10
14
  onfocus?: HTMLInputAttributes["onfocus"];
11
15
  onblur?: HTMLInputAttributes["onblur"];
@@ -2,7 +2,6 @@
2
2
  import { cn } from '../../../utils.js';
3
3
  import type { Snippet } from 'svelte';
4
4
  import type { HTMLButtonAttributes } from 'svelte/elements';
5
- import { buttonVariants } from '../button/index.js';
6
5
 
7
6
  let {
8
7
  class: className,
@@ -13,16 +12,11 @@
13
12
  </script>
14
13
 
15
14
  <button
15
+ type="button"
16
16
  aria-current={isActive ? 'page' : undefined}
17
- data-svadmin-button
18
- data-variant={isActive ? 'outline' : 'ghost'}
19
- data-size="icon-sm"
20
17
  data-slot="pagination-link"
21
18
  data-active={isActive}
22
- class={cn(
23
- buttonVariants({ variant: isActive ? 'outline' : 'ghost', size: 'icon-sm' }),
24
- className
25
- )}
19
+ class={cn('svadmin-pagination-item', className)}
26
20
  {...restProps}
27
21
  >
28
22
  {@render children?.()}
@@ -2,19 +2,16 @@
2
2
  import { cn } from '../../../utils.js';
3
3
  import type { Snippet } from 'svelte';
4
4
  import type { HTMLButtonAttributes } from 'svelte/elements';
5
- import { buttonVariants } from '../button/index.js';
6
5
  import { ChevronRight } from '@lucide/svelte';
7
6
 
8
7
  let { class: className, children, ...restProps }: HTMLButtonAttributes & { children?: Snippet } = $props();
9
8
  </script>
10
9
 
11
10
  <button
11
+ type="button"
12
12
  aria-label="Go to next page"
13
- data-svadmin-button
14
- data-variant="ghost"
15
- data-size="icon-sm"
16
13
  data-slot="pagination-next"
17
- class={cn(buttonVariants({ variant: 'ghost', size: 'icon-sm' }), "svadmin-pagination-control", className)}
14
+ class={cn('svadmin-pagination-item svadmin-pagination-control', className)}
18
15
  {...restProps}
19
16
  >
20
17
  {#if children}
@@ -2,19 +2,16 @@
2
2
  import { cn } from '../../../utils.js';
3
3
  import type { Snippet } from 'svelte';
4
4
  import type { HTMLButtonAttributes } from 'svelte/elements';
5
- import { buttonVariants } from '../button/index.js';
6
5
  import { ChevronLeft } from '@lucide/svelte';
7
6
 
8
7
  let { class: className, children, ...restProps }: HTMLButtonAttributes & { children?: Snippet } = $props();
9
8
  </script>
10
9
 
11
10
  <button
11
+ type="button"
12
12
  aria-label="Go to previous page"
13
- data-svadmin-button
14
- data-variant="ghost"
15
- data-size="icon-sm"
16
13
  data-slot="pagination-previous"
17
- class={cn(buttonVariants({ variant: 'ghost', size: 'icon-sm' }), "svadmin-pagination-control", className)}
14
+ class={cn('svadmin-pagination-item svadmin-pagination-control', className)}
18
15
  {...restProps}
19
16
  >
20
17
  {#if children}
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import { Check, X } from "@lucide/svelte";
2
3
  import { cn } from "../../../utils.js";
3
4
 
4
5
  type ProgressStatus = 'normal' | 'success' | 'warning' | 'danger';
@@ -10,7 +11,7 @@
10
11
  indeterminate = false,
11
12
  status = 'normal',
12
13
  size = 96,
13
- strokeWidth = 8,
14
+ strokeWidth = 4,
14
15
  showInfo = false,
15
16
  format,
16
17
  class: className,
@@ -59,7 +60,7 @@
59
60
  style:stroke-dashoffset={indeterminate ? circumference * 0.7 : dashOffset}
60
61
  />
61
62
  </svg>
62
- {#if showInfo}<span class="svadmin-progress__info">{indeterminate ? '…' : info}</span>{/if}
63
+ {#if showInfo}<span class="svadmin-progress__info flex items-center justify-center">{#if indeterminate}…{:else if status === "success"}<Check class="size-4 text-success" aria-hidden="true" />{:else if status === "danger"}<X class="size-4 text-destructive" aria-hidden="true" />{:else}{info}{/if}</span>{/if}
63
64
  </div>
64
65
  {:else}
65
66
  <div
@@ -76,7 +77,7 @@
76
77
  <div class="svadmin-progress__line-track">
77
78
  <div class="svadmin-progress-value" style:transform={indeterminate ? undefined : `translateX(-${100 - percentage}%)`}></div>
78
79
  </div>
79
- <span class="svadmin-progress__info">{indeterminate ? '…' : info}</span>
80
+ <span class="svadmin-progress__info flex items-center justify-end">{#if indeterminate}…{:else if status === "success"}<Check class="size-3.5 text-success" aria-hidden="true" />{:else if status === "danger"}<X class="size-3.5 text-destructive" aria-hidden="true" />{:else}{info}{/if}</span>
80
81
  {:else}
81
82
  <div class="svadmin-progress-value" style:transform={indeterminate ? undefined : `translateX(-${100 - percentage}%)`}></div>
82
83
  {/if}
@@ -87,22 +88,22 @@
87
88
  .svadmin-progress {
88
89
  position: relative;
89
90
  width: 100%;
90
- height: 0.5rem;
91
+ height: 4px;
91
92
  overflow: hidden;
92
93
  border-radius: 999px;
93
- background: var(--muted);
94
+ background: var(--svadmin-fill-3, var(--border));
94
95
  }
95
96
  .svadmin-progress-value {
96
97
  width: 100%;
97
98
  height: 100%;
98
99
  border-radius: inherit;
99
100
  background: var(--primary);
100
- transition: transform 160ms ease;
101
+ transition: transform 0.6s var(--svadmin-easing-standard, cubic-bezier(0.34, 0.69, 0.1, 1));
101
102
  }
102
103
  .svadmin-progress--with-info {
103
104
  display: flex;
104
105
  align-items: center;
105
- gap: var(--svadmin-space-2);
106
+ gap: 16px;
106
107
  height: auto;
107
108
  overflow: visible;
108
109
  background: transparent;
@@ -110,10 +111,10 @@
110
111
  .svadmin-progress__line-track {
111
112
  flex: 1;
112
113
  min-width: 0;
113
- height: 0.5rem;
114
+ height: 4px;
114
115
  overflow: hidden;
115
116
  border-radius: inherit;
116
- background: var(--muted);
117
+ background: var(--svadmin-fill-3, var(--border));
117
118
  }
118
119
  .svadmin-progress[data-status='success'] .svadmin-progress-value { background: var(--success); }
119
120
  .svadmin-progress[data-status='warning'] .svadmin-progress-value { background: var(--warning); }
@@ -143,11 +144,11 @@
143
144
  fill: none;
144
145
  stroke-width: var(--svadmin-progress-stroke);
145
146
  }
146
- .svadmin-progress__track { stroke: var(--muted); }
147
+ .svadmin-progress__track { stroke: var(--svadmin-fill-3, var(--border)); }
147
148
  .svadmin-progress__indicator {
148
149
  stroke: var(--primary);
149
150
  stroke-linecap: round;
150
- transition: stroke-dashoffset 160ms ease;
151
+ transition: stroke-dashoffset 0.6s var(--svadmin-easing-standard, cubic-bezier(0.34, 0.69, 0.1, 1));
151
152
  }
152
153
  .svadmin-progress--circle[data-status='success'] .svadmin-progress__indicator { stroke: var(--success); }
153
154
  .svadmin-progress--circle[data-status='warning'] .svadmin-progress__indicator { stroke: var(--warning); }
@@ -155,9 +156,11 @@
155
156
  .svadmin-progress--circle[data-indeterminate='true'] svg { animation: svadmin-progress-spin 1.1s linear infinite; }
156
157
  .svadmin-progress__info {
157
158
  position: relative;
158
- color: var(--foreground);
159
+ min-width: 32px;
160
+ color: var(--muted-foreground);
159
161
  font-size: var(--svadmin-text-caption);
160
162
  font-variant-numeric: tabular-nums;
163
+ text-align: end;
161
164
  }
162
165
  .svadmin-progress--circle .svadmin-progress__info { position: absolute; }
163
166
  @keyframes svadmin-progress-indeterminate {