@runwisp/ui 1.5.0 → 1.5.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.
Files changed (32) hide show
  1. package/package.json +4 -4
  2. package/src/lib/actions/focusTrap.ts +3 -3
  3. package/src/lib/components/Badge.svelte +1 -1
  4. package/src/lib/components/DataGrid.svelte +5 -5
  5. package/src/lib/components/FilterBar.svelte +1 -1
  6. package/src/lib/components/FilterPill.svelte +2 -2
  7. package/src/lib/components/FormField.svelte +1 -1
  8. package/src/lib/components/LogConsole.svelte +10 -10
  9. package/src/lib/components/SearchInput.svelte +1 -1
  10. package/src/lib/components/Select.svelte +3 -2
  11. package/src/lib/components/Sparkline.svelte +2 -2
  12. package/src/lib/components/StatusDot.svelte +1 -1
  13. package/src/lib/components/Tooltip.svelte +1 -1
  14. package/src/lib/components/dashboard/RunDetailPanel.svelte +15 -16
  15. package/src/lib/components/dashboard/RunFilterPopover.svelte +5 -5
  16. package/src/lib/components/dashboard/RunsList.svelte +8 -8
  17. package/src/lib/components/dashboard/cron-format.test.ts +1 -1
  18. package/src/lib/components/dashboard/cron-format.ts +2 -2
  19. package/src/lib/components/dashboard/run-filters.test.ts +2 -2
  20. package/src/lib/components/dashboard/run-filters.ts +27 -94
  21. package/src/lib/components/dashboard/run-helpers.test.ts +9 -0
  22. package/src/lib/components/dashboard/run-helpers.ts +28 -38
  23. package/src/lib/components/data-grid-selection.ts +2 -9
  24. package/src/lib/components/filter-spec.ts +3 -3
  25. package/src/lib/log-console/LogCache.svelte.ts +1 -1
  26. package/src/lib/log-console/ansi.ts +1 -1
  27. package/src/lib/theme-tokens.css +21 -21
  28. package/src/lib/theme.css +13 -13
  29. package/src/lib/utils/format.test.ts +3 -3
  30. package/src/lib/utils/format.ts +4 -4
  31. package/src/lib/utils/toast.svelte.ts +2 -3
  32. package/src/stories/LogConsole.stories.svelte +2 -2
package/src/lib/theme.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /* Copyright (c) PoppyCake, s.r.o. SPDX-License-Identifier: Apache-2.0 */
2
2
 
3
- /* RunWisp Design System — Tailwind v4 entrypoint.
3
+ /* RunWisp Design System, Tailwind v4 entrypoint.
4
4
  *
5
5
  * Raw OKLch palette + semantic tokens live in ./theme-tokens.css (plain CSS),
6
6
  * so apps/docs (Starlight, no Tailwind pipeline) can consume the same source.
@@ -23,7 +23,7 @@
23
23
  * side for good; below it the operator can fold the first two away. */
24
24
  --breakpoint-3xl: 100rem;
25
25
 
26
- /* Palette aliases — Tailwind utilities (bg-wisp-500, text-mist-900, …)
26
+ /* Palette aliases, Tailwind utilities (bg-wisp-500, text-mist-900, …)
27
27
  * resolve through to --rw-color-* declared in theme-tokens.css. */
28
28
  --color-wisp-50: var(--rw-color-wisp-50);
29
29
  --color-wisp-100: var(--rw-color-wisp-100);
@@ -87,7 +87,7 @@
87
87
  --color-warning-600: var(--rw-color-warning-600);
88
88
  --color-warning-700: var(--rw-color-warning-700);
89
89
 
90
- /* Typography — stacks and @font-face live in theme-tokens.css so the
90
+ /* Typography, stacks and @font-face live in theme-tokens.css so the
91
91
  * non-Tailwind consumers (apps/docs) share one definition. */
92
92
  --font-sans: var(--rw-font-sans);
93
93
  --font-mono: var(--rw-font-mono);
@@ -126,18 +126,18 @@
126
126
  --spacing-20: 5rem;
127
127
  --spacing-24: 6rem;
128
128
 
129
- /* Border radius — runbook scale (small radii are signature). lg/xl/2xl/3xl
129
+ /* Border radius, runbook scale (small radii are signature). lg/xl/2xl/3xl
130
130
  * remain for legacy call sites but should not be used going forward. */
131
131
  --radius-none: 0;
132
- --radius-sm: 0.1875rem; /* 3px — controls */
133
- --radius-md: 0.25rem; /* 4px — panels / cards */
132
+ --radius-sm: 0.1875rem; /* 3px, controls */
133
+ --radius-md: 0.25rem; /* 4px, panels / cards */
134
134
  --radius-lg: 0.5rem;
135
135
  --radius-xl: 0.75rem;
136
136
  --radius-2xl: 1rem;
137
137
  --radius-3xl: 1.5rem;
138
138
  --radius-full: 9999px;
139
139
 
140
- /* Shadows — mapped to the flip tokens in theme-tokens.css so every
140
+ /* Shadows, mapped to the flip tokens in theme-tokens.css so every
141
141
  * shadow-* utility resolves to `none` in dark (borders-only look). */
142
142
  --shadow-xs: var(--rw-shadow-xs);
143
143
  --shadow-sm: var(--rw-shadow-sm);
@@ -146,7 +146,7 @@
146
146
  --shadow-xl: var(--rw-shadow-xl);
147
147
  }
148
148
 
149
- /* Semantic Design Tokens — Tailwind utility aliases.
149
+ /* Semantic Design Tokens, Tailwind utility aliases.
150
150
  * Components use `bg-surface`, `text-primary`, etc.; the values live in
151
151
  * theme-tokens.css under the --rw-* namespace and flip on light/dark. */
152
152
 
@@ -206,7 +206,7 @@
206
206
  --color-warning-soft-border: var(--rw-warning-soft-border);
207
207
  --color-info-soft-border: var(--rw-info-soft-border);
208
208
 
209
- /* Terminal surface — fixed dark in both themes */
209
+ /* Terminal surface, fixed dark in both themes */
210
210
  --color-term: var(--rw-term);
211
211
  --color-term-2: var(--rw-term-2);
212
212
  --color-term-line: var(--rw-term-line);
@@ -228,8 +228,8 @@
228
228
 
229
229
  /* Motion. Deliberately minimal: hover, focus and state changes are
230
230
  * instant, so there is no scale of durations to pick from. The few things
231
- * that still move — a drawer sliding, a toggle knob, an accordion's
232
- * height, a progress bar's width — set their own timing inline. */
231
+ * that still move, a drawer sliding, a toggle knob, an accordion's
232
+ * height, a progress bar's width, set their own timing inline. */
233
233
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
234
234
  }
235
235
 
@@ -255,7 +255,7 @@ body {
255
255
  color: var(--rw-on-surface);
256
256
  }
257
257
 
258
- /* Headings are mono chrome — the runbook voice. Unlayered, so it beats the
258
+ /* Headings are mono chrome, the runbook voice. Unlayered, so it beats the
259
259
  weight/leading/tracking utilities on a raw <h1>-<h3>: every heading reads the
260
260
  same. The Heading component opts out (data-rw-heading) and carries this look
261
261
  in its own classes, so its props are the source of truth. :is()/:where()
@@ -295,7 +295,7 @@ body {
295
295
  backdrop-filter: var(--rw-glass-blur);
296
296
  }
297
297
 
298
- /* Legacy aliases — prefer .rw-bg-glass which adapts to light/dark */
298
+ /* Legacy aliases, prefer .rw-bg-glass which adapts to light/dark */
299
299
  .rw-bg-glass-dark {
300
300
  background: var(--rw-glass);
301
301
  backdrop-filter: var(--rw-glass-blur);
@@ -86,7 +86,7 @@ describe("formatRelativeTimeWithAbsolute", () => {
86
86
  it("uses time-only format (HH:MM) for dates within the same day", () => {
87
87
  const recent = new Date(Date.now() - 30 * 60_000).toISOString();
88
88
  const r = formatRelativeTimeWithAbsolute(recent);
89
- // Same-day branch produces `relative (HH:MM)` — assert on the colon
89
+ // Same-day branch produces `relative (HH:MM)`, assert on the colon
90
90
  // that only appears inside the time format.
91
91
  expect(r).toMatch(/\(\d{1,2}:\d{2}\)$/);
92
92
  });
@@ -131,13 +131,13 @@ describe("formatRelativeTime", () => {
131
131
 
132
132
  describe("formatClockTime", () => {
133
133
  it("renders three numeric groups (hours, minutes, seconds)", () => {
134
- // 24-hour h:m:s — the seconds component is what sets it apart from formatTimeHM.
134
+ // 24-hour h:m:s, the seconds component is what sets it apart from formatTimeHM.
135
135
  expect(numericGroups(formatClockTime("2026-06-22T17:15:02Z"))).toBe(3);
136
136
  });
137
137
  });
138
138
 
139
139
  describe("formatTimeHM", () => {
140
- it("renders two numeric groups (hours, minutes) — no seconds", () => {
140
+ it("renders two numeric groups (hours, minutes), no seconds", () => {
141
141
  expect(numericGroups(formatTimeHM("2026-06-22T17:15:02Z"))).toBe(2);
142
142
  });
143
143
  });
@@ -41,7 +41,7 @@ export const formatDateTime = dateFormatter({
41
41
  minute: "2-digit",
42
42
  });
43
43
 
44
- /** Wall-clock time of day, seconds included, 24-hour — e.g. "17:15:02". */
44
+ /** Wall-clock time of day, seconds included, 24-hour, e.g. "17:15:02". */
45
45
  export const formatClockTime = dateFormatter({
46
46
  hour: "2-digit",
47
47
  minute: "2-digit",
@@ -49,17 +49,17 @@ export const formatClockTime = dateFormatter({
49
49
  hour12: false,
50
50
  });
51
51
 
52
- /** Calendar date without the time — e.g. "22 Jun 2026". */
52
+ /** Calendar date without the time, e.g. "22 Jun 2026". */
53
53
  export const formatCalendarDate = dateFormatter({
54
54
  year: "numeric",
55
55
  month: "short",
56
56
  day: "numeric",
57
57
  });
58
58
 
59
- /** Time of day, no seconds, 24-hour — e.g. "17:15". */
59
+ /** Time of day, no seconds, 24-hour, e.g. "17:15". */
60
60
  export const formatTimeHM = dateFormatter({ hour: "2-digit", minute: "2-digit", hour12: false });
61
61
 
62
- /** Day and month, no year — e.g. "22 Jun". */
62
+ /** Day and month, no year, e.g. "22 Jun". */
63
63
  export const formatDayMonth = dateFormatter({ month: "short", day: "numeric" });
64
64
 
65
65
  export const formatFullDateTime = dateFormatter({
@@ -1,8 +1,6 @@
1
1
  // SPDX-FileCopyrightText: PoppyCake, s.r.o.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { generateUlid } from "@runwisp/common";
5
-
6
4
  type ToastType = "success" | "error" | "warning" | "info";
7
5
 
8
6
  interface ToastAction {
@@ -28,6 +26,7 @@ const DEFAULT_DURATION = 5000;
28
26
  class ToastStore {
29
27
  items = $state<Toast[]>([]);
30
28
  private readonly timers = new Map<string, ReturnType<typeof setTimeout>>();
29
+ private nextId = 0;
31
30
 
32
31
  add(type: ToastType, message: string, opts: ToastOptions = {}): string {
33
32
  const duration = opts.duration ?? DEFAULT_DURATION;
@@ -37,7 +36,7 @@ class ToastStore {
37
36
  return existing.id;
38
37
  }
39
38
 
40
- const id = generateUlid();
39
+ const id = `toast-${String(++this.nextId)}`;
41
40
  const next: Toast = { id, type, message, duration };
42
41
  if (opts.action) next.action = opts.action;
43
42
  this.items = [...this.items, next];
@@ -24,7 +24,7 @@
24
24
  ` ${ESC}32m✓${ESC}0m users ${ESC}90m(184,221 rows, 48 MB)${ESC}0m`,
25
25
  ` ${ESC}32m✓${ESC}0m sessions ${ESC}90m(902,114 rows, 210 MB)${ESC}0m`,
26
26
  ` ${ESC}32m✓${ESC}0m invoices ${ESC}90m(45,002 rows, 12 MB)${ESC}0m`,
27
- `${ESC}33m[warn]${ESC}0m table ${ESC}1maudit_log${ESC}0m exceeds 1 GB — consider partitioning`,
27
+ `${ESC}33m[warn]${ESC}0m table ${ESC}1maudit_log${ESC}0m exceeds 1 GB, consider partitioning`,
28
28
  ` ${ESC}32m✓${ESC}0m audit_log ${ESC}90m(7,212,330 rows, 1.2 GB)${ESC}0m`,
29
29
  `${ESC}31m[error]${ESC}0m checksum mismatch on chunk 7, retrying ${ESC}90m(attempt 1/3)${ESC}0m`,
30
30
  ` ${ESC}32m✓${ESC}0m retry succeeded`,
@@ -53,7 +53,7 @@
53
53
  const LONG_LINES = [
54
54
  `${ESC}36m[info]${ESC}0m starting request trace`,
55
55
  `${ESC}90m2026-06-05T03:00:00Z${ESC}0m GET /api/v1/tasks?include=runs,logs,schedule&limit=100&offset=0 → ${ESC}32m200${ESC}0m ${ESC}90m{"trace":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","upstream":"https://internal.example.com/very/long/path/segment/that/keeps/going/and/going","latency_ms":1287,"bytes":204812}${ESC}0m`,
56
- `${ESC}31m[error]${ESC}0m panic: runtime error: index out of range [12] with length 8 — goroutine 42 [running]: main.process(0xc0000b4000, 0x1f4) /home/runner/work/app/app/internal/pipeline/process.go:317 +0x4a5`,
56
+ `${ESC}31m[error]${ESC}0m panic: runtime error: index out of range [12] with length 8, goroutine 42 [running]: main.process(0xc0000b4000, 0x1f4) /home/runner/work/app/app/internal/pipeline/process.go:317 +0x4a5`,
57
57
  " short line in between",
58
58
  `tab-separated\tcolumns\there\tshould\tstay\taligned\tand\textend\tfar\tpast\tthe\tviewport\tedge\tto\tprove\thorizontal\tscroll`,
59
59
  `${ESC}32m[done]${ESC}0m ${"=".repeat(400)}|END`,