@runwisp/ui 0.7.0 → 0.9.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 +4 -12
- package/src/lib/components/Alert.svelte +4 -4
- package/src/lib/components/Avatar.svelte +8 -8
- package/src/lib/components/Badge.svelte +23 -23
- package/src/lib/components/CronInput.svelte +1 -1
- package/src/lib/components/Dropdown.svelte +16 -3
- package/src/lib/components/DurationInput.svelte +4 -2
- package/src/lib/components/EmptyState.svelte +1 -1
- package/src/lib/components/FormField.svelte +4 -2
- package/src/lib/components/Input.svelte +4 -2
- package/src/lib/components/LogConsole.svelte +22 -29
- package/src/lib/components/Progress.svelte +4 -4
- package/src/lib/components/RadioGroup.svelte +3 -1
- package/src/lib/components/Select.svelte +1 -1
- package/src/lib/components/Sparkline.svelte +11 -3
- package/src/lib/components/TaskCard.svelte +4 -4
- package/src/lib/components/Textarea.svelte +2 -2
- package/src/lib/components/ToastContainer.svelte +4 -4
- package/src/lib/components/Tooltip.svelte +11 -2
- package/src/lib/components/dashboard/RunDetailPanel.svelte +34 -18
- package/src/lib/components/dashboard/RunsList.svelte +19 -2
- package/src/lib/components/dashboard/cron-format.test.ts +67 -0
- package/src/lib/components/dashboard/cron-format.ts +71 -0
- package/src/lib/components/dashboard/run-helpers.test.ts +25 -1
- package/src/lib/components/dashboard/run-helpers.ts +15 -0
- package/src/lib/components/dashboard/status-config.test.ts +18 -0
- package/src/lib/components/dashboard/status-config.ts +41 -0
- package/src/lib/index.ts +2 -5
- package/src/lib/log-console/ansi.test.ts +50 -0
- package/src/lib/log-console/ansi.ts +39 -0
- package/src/lib/theme-tokens.css +33 -0
- package/src/lib/theme.css +6 -0
- package/src/lib/utils/error.test.ts +34 -0
- package/src/lib/utils/format.test.ts +37 -1
- package/src/lib/utils/format.ts +8 -6
- package/src/lib/utils/id.test.ts +23 -0
- package/src/stories/Avatar.stories.svelte +1 -1
- package/src/stories/Breadcrumb.stories.svelte +3 -3
- package/src/stories/Card.stories.svelte +21 -19
- package/src/stories/Checkbox.stories.svelte +2 -2
- package/src/stories/DataGrid.stories.svelte +1 -1
- package/src/stories/Dropdown.stories.svelte +3 -3
- package/src/stories/EmptyState.stories.svelte +1 -1
- package/src/stories/LogConsole.stories.svelte +75 -0
- package/src/stories/LogConsoleDemo.svelte +60 -0
- package/src/stories/Logo.stories.svelte +9 -9
- package/src/stories/Modal.stories.svelte +12 -10
- package/src/stories/Progress.stories.svelte +6 -6
- package/src/stories/Tabs.stories.svelte +16 -12
- package/src/stories/Toggle.stories.svelte +2 -2
- package/src/stories/Tooltip.stories.svelte +5 -5
- package/src/lib/utils/toast.ts +0 -60
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
<Story name="Underline (Default)" asChild>
|
|
44
44
|
<Tabs tabs={basicTabs} variant="underline">
|
|
45
45
|
{#snippet children(activeTab)}
|
|
46
|
-
<div class="rounded-lg border border-
|
|
47
|
-
<p class="text-
|
|
46
|
+
<div class="rounded-lg border border-outline bg-white p-4">
|
|
47
|
+
<p class="text-on-surface-muted">Content for <strong>{activeTab}</strong> tab</p>
|
|
48
48
|
</div>
|
|
49
49
|
{/snippet}
|
|
50
50
|
</Tabs>
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
<Story name="Pills" asChild>
|
|
54
54
|
<Tabs tabs={basicTabs} variant="pills">
|
|
55
55
|
{#snippet children(activeTab)}
|
|
56
|
-
<div class="rounded-lg border border-
|
|
57
|
-
<p class="text-
|
|
56
|
+
<div class="rounded-lg border border-outline bg-white p-4">
|
|
57
|
+
<p class="text-on-surface-muted">Content for <strong>{activeTab}</strong> tab</p>
|
|
58
58
|
</div>
|
|
59
59
|
{/snippet}
|
|
60
60
|
</Tabs>
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
<Story name="Enclosed" asChild>
|
|
64
64
|
<Tabs tabs={basicTabs} variant="enclosed">
|
|
65
65
|
{#snippet children(activeTab)}
|
|
66
|
-
<div class="rounded-lg border border-
|
|
67
|
-
<p class="text-
|
|
66
|
+
<div class="rounded-lg border border-outline bg-white p-4">
|
|
67
|
+
<p class="text-on-surface-muted">Content for <strong>{activeTab}</strong> tab</p>
|
|
68
68
|
</div>
|
|
69
69
|
{/snippet}
|
|
70
70
|
</Tabs>
|
|
@@ -73,8 +73,10 @@
|
|
|
73
73
|
<Story name="With Icons and Badges" asChild>
|
|
74
74
|
<Tabs tabs={iconTabs} variant="underline">
|
|
75
75
|
{#snippet children(activeTab)}
|
|
76
|
-
<div class="rounded-lg border border-
|
|
77
|
-
<p class="text-
|
|
76
|
+
<div class="rounded-lg border border-outline bg-white p-4">
|
|
77
|
+
<p class="text-on-surface-muted">
|
|
78
|
+
You're viewing the <strong>{activeTab}</strong> section
|
|
79
|
+
</p>
|
|
78
80
|
</div>
|
|
79
81
|
{/snippet}
|
|
80
82
|
</Tabs>
|
|
@@ -84,8 +86,10 @@
|
|
|
84
86
|
<div class="max-w-md">
|
|
85
87
|
<Tabs tabs={basicTabs} variant="pills" fullWidth>
|
|
86
88
|
{#snippet children(activeTab)}
|
|
87
|
-
<div class="rounded-lg border border-
|
|
88
|
-
<p class="text-
|
|
89
|
+
<div class="rounded-lg border border-outline bg-white p-4">
|
|
90
|
+
<p class="text-on-surface-muted">
|
|
91
|
+
Content for <strong>{activeTab}</strong> tab
|
|
92
|
+
</p>
|
|
89
93
|
</div>
|
|
90
94
|
{/snippet}
|
|
91
95
|
</Tabs>
|
|
@@ -95,8 +99,8 @@
|
|
|
95
99
|
<Story name="With Disabled Tab" asChild>
|
|
96
100
|
<Tabs tabs={disabledTabs} variant="underline">
|
|
97
101
|
{#snippet children(activeTab)}
|
|
98
|
-
<div class="rounded-lg border border-
|
|
99
|
-
<p class="text-
|
|
102
|
+
<div class="rounded-lg border border-outline bg-white p-4">
|
|
103
|
+
<p class="text-on-surface-muted">Showing <strong>{activeTab}</strong> tasks</p>
|
|
100
104
|
</div>
|
|
101
105
|
{/snippet}
|
|
102
106
|
</Tabs>
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
</Story>
|
|
49
49
|
|
|
50
50
|
<Story name="Settings Panel" asChild>
|
|
51
|
-
<div class="max-w-md space-y-4 rounded-xl border border-
|
|
52
|
-
<h3 class="font-semibold text-
|
|
51
|
+
<div class="max-w-md space-y-4 rounded-xl border border-outline bg-white p-4">
|
|
52
|
+
<h3 class="font-semibold text-on-surface">Task Settings</h3>
|
|
53
53
|
<div class="space-y-4">
|
|
54
54
|
<Toggle
|
|
55
55
|
label="Enable task"
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
<Story name="On Icons" asChild>
|
|
49
49
|
<div class="flex items-center justify-center gap-6 py-8">
|
|
50
50
|
<Tooltip content="More information">
|
|
51
|
-
<button class="rounded-lg p-2 text-
|
|
51
|
+
<button class="rounded-lg p-2 text-on-surface-muted hover:bg-surface-sunken">
|
|
52
52
|
<Info size={20} />
|
|
53
53
|
</button>
|
|
54
54
|
</Tooltip>
|
|
55
55
|
<Tooltip content="Get help">
|
|
56
|
-
<button class="rounded-lg p-2 text-
|
|
56
|
+
<button class="rounded-lg p-2 text-on-surface-muted hover:bg-surface-sunken">
|
|
57
57
|
<CircleQuestionMark size={20} />
|
|
58
58
|
</button>
|
|
59
59
|
</Tooltip>
|
|
60
60
|
<Tooltip content="Settings">
|
|
61
|
-
<button class="rounded-lg p-2 text-
|
|
61
|
+
<button class="rounded-lg p-2 text-on-surface-muted hover:bg-surface-sunken">
|
|
62
62
|
<Settings size={20} />
|
|
63
63
|
</button>
|
|
64
64
|
</Tooltip>
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
|
|
68
68
|
<Story name="Usage Example" asChild>
|
|
69
69
|
<div class="flex items-center gap-2 py-8">
|
|
70
|
-
<span class="text-sm text-
|
|
70
|
+
<span class="text-sm text-on-surface-muted">Cron Expression</span>
|
|
71
71
|
<Tooltip content="Use standard cron syntax: minute hour day month weekday">
|
|
72
|
-
<button class="text-
|
|
72
|
+
<button class="text-on-surface-faint hover:text-on-surface-muted">
|
|
73
73
|
<CircleQuestionMark size={16} />
|
|
74
74
|
</button>
|
|
75
75
|
</Tooltip>
|
package/src/lib/utils/toast.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: PoppyCake, s.r.o.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { generateUlid } from "@runwisp/common";
|
|
5
|
-
|
|
6
|
-
export type ToastType = "success" | "error" | "warning" | "info";
|
|
7
|
-
|
|
8
|
-
export interface Toast {
|
|
9
|
-
id: string;
|
|
10
|
-
type: ToastType;
|
|
11
|
-
message: string;
|
|
12
|
-
duration?: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const DEFAULT_DURATION = 5000;
|
|
16
|
-
|
|
17
|
-
class ToastStore {
|
|
18
|
-
items = $state<Toast[]>([]);
|
|
19
|
-
|
|
20
|
-
add(type: ToastType, message: string, duration = DEFAULT_DURATION): string {
|
|
21
|
-
const id = generateUlid();
|
|
22
|
-
const t: Toast = { id, type, message, duration };
|
|
23
|
-
|
|
24
|
-
this.items = [...this.items, t];
|
|
25
|
-
|
|
26
|
-
if (duration > 0) {
|
|
27
|
-
setTimeout(() => {
|
|
28
|
-
this.remove(id);
|
|
29
|
-
}, duration);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return id;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
remove(id: string) {
|
|
36
|
-
this.items = this.items.filter((t) => t.id !== id);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
success(message: string, duration?: number): string {
|
|
40
|
-
return this.add("success", message, duration);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
error(message: string, duration?: number): string {
|
|
44
|
-
return this.add("error", message, duration);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
warning(message: string, duration?: number): string {
|
|
48
|
-
return this.add("warning", message, duration);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
info(message: string, duration?: number): string {
|
|
52
|
-
return this.add("info", message, duration);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
clear() {
|
|
56
|
-
this.items = [];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const toast = new ToastStore();
|