@runwisp/ui 0.13.0 → 0.15.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 +39 -47
- package/src/astro/CTABand.astro +19 -12
- package/src/astro/Hero.astro +3 -3
- package/src/astro/SiteFooter.astro +4 -4
- package/src/astro/SiteHeader.astro +4 -4
- package/src/lib/actions/portal.ts +0 -3
- package/src/lib/assets/runwisp-logo.svg +1 -8
- package/src/lib/components/AccordionItem.svelte +4 -10
- package/src/lib/components/Alert.svelte +11 -11
- package/src/lib/components/Avatar.svelte +1 -1
- package/src/lib/components/Badge.svelte +13 -13
- package/src/lib/components/Breadcrumb.svelte +3 -3
- package/src/lib/components/Button.svelte +2 -2
- package/src/lib/components/Card.svelte +4 -4
- package/src/lib/components/Checkbox.svelte +12 -10
- package/src/lib/components/CodeBlock.svelte +7 -13
- package/src/lib/components/CronInput.svelte +12 -15
- package/src/lib/components/DataGrid.svelte +14 -13
- package/src/lib/components/Drawer.svelte +9 -9
- package/src/lib/components/Dropdown.svelte +12 -20
- package/src/lib/components/DurationInput.svelte +10 -14
- package/src/lib/components/EmptyState.svelte +1 -1
- package/src/lib/components/ErrorState.svelte +4 -4
- package/src/lib/components/FeatureCard.svelte +4 -4
- package/src/lib/components/FormField.svelte +4 -6
- package/src/lib/components/Heading.svelte +4 -1
- package/src/lib/components/Input.svelte +10 -12
- package/src/lib/components/Kbd.svelte +1 -1
- package/src/lib/components/Link.svelte +2 -3
- package/src/lib/components/LinkButton.svelte +2 -2
- package/src/lib/components/LogConsole.svelte +22 -21
- package/src/lib/components/Logo.svelte +3 -1
- package/src/lib/components/Modal.svelte +9 -11
- package/src/lib/components/PageContainer.svelte +1 -1
- package/src/lib/components/PageHeader.svelte +1 -1
- package/src/lib/components/Pagination.svelte +4 -4
- package/src/lib/components/Popover.svelte +5 -7
- package/src/lib/components/Progress.svelte +6 -4
- package/src/lib/components/Prose.svelte +4 -4
- package/src/lib/components/Radio.svelte +11 -10
- package/src/lib/components/RadioGroup.svelte +3 -5
- package/src/lib/components/Select.svelte +23 -36
- package/src/lib/components/Separator.svelte +4 -1
- package/src/lib/components/Skeleton.svelte +6 -6
- package/src/lib/components/StatusIndicator.svelte +7 -18
- package/src/lib/components/Table.svelte +1 -1
- package/src/lib/components/TableCell.svelte +1 -1
- package/src/lib/components/TableRow.svelte +1 -5
- package/src/lib/components/Tabs.svelte +10 -13
- package/src/lib/components/TaskCard.svelte +7 -4
- package/src/lib/components/Textarea.svelte +10 -11
- package/src/lib/components/ThemeToggle.svelte +1 -1
- package/src/lib/components/ToastContainer.svelte +3 -8
- package/src/lib/components/Toggle.svelte +2 -3
- package/src/lib/components/Tooltip.svelte +12 -10
- package/src/lib/components/button-styles.ts +17 -18
- package/src/lib/components/dashboard/RunDetailPanel.svelte +160 -249
- package/src/lib/components/dashboard/RunFilterPopover.svelte +31 -25
- package/src/lib/components/dashboard/RunsList.svelte +55 -50
- package/src/lib/components/dashboard/run-filters.test.ts +31 -33
- package/src/lib/components/dashboard/run-filters.ts +33 -33
- package/src/lib/components/dashboard/run-helpers.test.ts +42 -17
- package/src/lib/components/dashboard/run-helpers.ts +53 -17
- package/src/lib/components/dashboard/status-config.ts +9 -8
- package/src/lib/theme-tokens.css +179 -114
- package/src/lib/theme.css +49 -35
- package/src/lib/utils/error.ts +0 -3
- package/src/lib/utils/format.test.ts +2 -6
- package/src/lib/utils/format.ts +28 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runwisp/ui",
|
|
3
3
|
"description": "Svelte 5 UI component library for RunWisp dashboards and admin interfaces.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -47,44 +47,37 @@
|
|
|
47
47
|
"svelte": "^5.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@chromatic-com/storybook": "^
|
|
51
|
-
"@eslint/
|
|
52
|
-
"@eslint
|
|
53
|
-
"@runwisp/
|
|
54
|
-
"@
|
|
55
|
-
"@storybook/addon-
|
|
56
|
-
"@storybook/addon-
|
|
57
|
-
"@storybook/
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@tailwindcss/
|
|
63
|
-
"@tailwindcss/typography": "^0.5.19",
|
|
64
|
-
"@tailwindcss/vite": "^4.1.17",
|
|
65
|
-
"@types/dlv": "^1.1.5",
|
|
50
|
+
"@chromatic-com/storybook": "^5.2.1",
|
|
51
|
+
"@eslint/js": "^10.0.1",
|
|
52
|
+
"@runwisp/eslint-config": "0.15.0",
|
|
53
|
+
"@runwisp/typescript-config": "0.15.0",
|
|
54
|
+
"@storybook/addon-a11y": "^10.5.5",
|
|
55
|
+
"@storybook/addon-docs": "^10.5.5",
|
|
56
|
+
"@storybook/addon-svelte-csf": "^5.1.2",
|
|
57
|
+
"@storybook/sveltekit": "^10.5.5",
|
|
58
|
+
"@sveltejs/kit": "^2.70.2",
|
|
59
|
+
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
60
|
+
"@tailwindcss/forms": "^0.5.11",
|
|
61
|
+
"@tailwindcss/typography": "^0.5.20",
|
|
62
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
66
63
|
"@types/ms": "^2.1.0",
|
|
67
|
-
"@types/node": "^
|
|
68
|
-
"
|
|
69
|
-
"@vitest/coverage-v8": "^4.0.15",
|
|
70
|
-
"eslint": "^9.39.1",
|
|
64
|
+
"@types/node": "^26.1.2",
|
|
65
|
+
"eslint": "^10.8.0",
|
|
71
66
|
"eslint-config-prettier": "^10.1.8",
|
|
72
|
-
"eslint-plugin-sonarjs": "^4.
|
|
73
|
-
"eslint-plugin-storybook": "^10.
|
|
74
|
-
"eslint-plugin-svelte": "^3.
|
|
75
|
-
"globals": "^
|
|
76
|
-
"
|
|
77
|
-
"prettier": "^
|
|
78
|
-
"prettier-plugin-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"svelte": "^
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"typescript": "
|
|
85
|
-
"
|
|
86
|
-
"vite": "^7.2.6",
|
|
87
|
-
"vitest": "^4.0.15"
|
|
67
|
+
"eslint-plugin-sonarjs": "^4.2.0",
|
|
68
|
+
"eslint-plugin-storybook": "^10.5.5",
|
|
69
|
+
"eslint-plugin-svelte": "^3.22.0",
|
|
70
|
+
"globals": "^17.9.0",
|
|
71
|
+
"prettier": "^3.9.6",
|
|
72
|
+
"prettier-plugin-svelte": "^4.1.1",
|
|
73
|
+
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
74
|
+
"storybook": "^10.5.5",
|
|
75
|
+
"svelte": "^5.56.8",
|
|
76
|
+
"svelte-check": "^4.7.4",
|
|
77
|
+
"tailwindcss": "^4.3.3",
|
|
78
|
+
"typescript": "6.0.3",
|
|
79
|
+
"typescript-eslint": "^8.65.0",
|
|
80
|
+
"vite": "^8.2.0"
|
|
88
81
|
},
|
|
89
82
|
"keywords": [
|
|
90
83
|
"svelte",
|
|
@@ -96,17 +89,16 @@
|
|
|
96
89
|
"runwisp"
|
|
97
90
|
],
|
|
98
91
|
"dependencies": {
|
|
99
|
-
"@floating-ui/dom": "^1.
|
|
100
|
-
"@fontsource/
|
|
101
|
-
"@
|
|
102
|
-
"@
|
|
103
|
-
"@
|
|
92
|
+
"@floating-ui/dom": "^1.8.0",
|
|
93
|
+
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
94
|
+
"@fontsource/tasa-orbiter": "^5.3.0",
|
|
95
|
+
"@lucide/svelte": "^1.28.0",
|
|
96
|
+
"@runwisp/common": "0.15.0",
|
|
97
|
+
"@tanstack/svelte-virtual": "^3.13.35",
|
|
104
98
|
"ansi-to-html": "^0.7.2",
|
|
105
|
-
"cron-parser": "^5.
|
|
106
|
-
"cronstrue": "^3.
|
|
107
|
-
"
|
|
108
|
-
"dlv": "^1.1.3",
|
|
109
|
-
"fuse.js": "^7.1.0",
|
|
99
|
+
"cron-parser": "^5.7.0",
|
|
100
|
+
"cronstrue": "^3.24.0",
|
|
101
|
+
"fuse.js": "^7.5.0",
|
|
110
102
|
"ms": "^2.1.3"
|
|
111
103
|
}
|
|
112
104
|
}
|
package/src/astro/CTABand.astro
CHANGED
|
@@ -12,21 +12,28 @@ interface Props {
|
|
|
12
12
|
const { heading, sub, tone = "default", class: className = "" } = Astro.props;
|
|
13
13
|
|
|
14
14
|
const surface =
|
|
15
|
-
tone === "primary" ? "bg-primary text-on-primary" : "bg-surface-
|
|
15
|
+
tone === "primary" ? "bg-primary text-on-primary" : "bg-surface-raised text-on-surface";
|
|
16
16
|
const subTone = tone === "primary" ? "text-on-primary/80" : "text-on-surface-muted";
|
|
17
17
|
const hasCtas = Astro.slots.has("ctas");
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
<section class:list={[
|
|
21
|
-
<div class="mx-auto max-w-5xl px-6 py-16
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
<section class:list={[className]}>
|
|
21
|
+
<div class="mx-auto max-w-5xl px-6 py-16 sm:py-20">
|
|
22
|
+
<div
|
|
23
|
+
class:list={[
|
|
24
|
+
surface,
|
|
25
|
+
"rounded-[4px] border border-outline px-6 py-12 text-center shadow-sm sm:px-10",
|
|
26
|
+
]}
|
|
27
|
+
>
|
|
28
|
+
<h2 class="font-mono text-3xl font-extrabold sm:text-4xl">{heading}</h2>
|
|
29
|
+
{sub && <p class:list={[subTone, "mt-4 font-sans text-lg"]}>{sub}</p>}
|
|
30
|
+
{
|
|
31
|
+
hasCtas && (
|
|
32
|
+
<div class="mt-8 flex flex-wrap items-center justify-center gap-3">
|
|
33
|
+
<slot name="ctas" />
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
</div>
|
|
31
38
|
</div>
|
|
32
39
|
</section>
|
package/src/astro/Hero.astro
CHANGED
|
@@ -29,15 +29,15 @@ const ctaAlign = align === "center" && !hasMedia ? "justify-center" : "";
|
|
|
29
29
|
<div class={textAlign}>
|
|
30
30
|
{
|
|
31
31
|
eyebrow && (
|
|
32
|
-
<p class="text-
|
|
32
|
+
<p class="text-info mb-4 font-mono text-[11.5px] font-medium tracking-[0.16em] uppercase">
|
|
33
33
|
{eyebrow}
|
|
34
34
|
</p>
|
|
35
35
|
)
|
|
36
36
|
}
|
|
37
|
-
<h1 class:list={["text-on-surface font-
|
|
37
|
+
<h1 class:list={["text-on-surface font-mono font-extrabold", headlineSize]}>
|
|
38
38
|
{headline}
|
|
39
39
|
</h1>
|
|
40
|
-
{sub && <p class="text-on-surface-muted mt-6 text-lg sm:text-xl">{sub}</p>}
|
|
40
|
+
{sub && <p class="text-on-surface-muted mt-6 font-sans text-lg sm:text-xl">{sub}</p>}
|
|
41
41
|
{
|
|
42
42
|
hasCtas && (
|
|
43
43
|
<div class:list={["mt-8 flex flex-wrap items-center gap-3", ctaAlign]}>
|
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
class?: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const { tagline = "
|
|
10
|
+
const { tagline = "Built by operators, for operators.", class: className = "" } =
|
|
11
11
|
Astro.props;
|
|
12
12
|
|
|
13
13
|
const hasTeaser = Astro.slots.has("teaser");
|
|
@@ -19,20 +19,20 @@ const hasBadges = Astro.slots.has("badges");
|
|
|
19
19
|
<div class="mx-auto max-w-6xl px-6 py-12">
|
|
20
20
|
{
|
|
21
21
|
hasTeaser && (
|
|
22
|
-
<div class="bg-surface-raised mb-10 rounded-
|
|
22
|
+
<div class="bg-surface-raised mb-10 rounded-[4px] border border-outline p-6 shadow-sm">
|
|
23
23
|
<slot name="teaser" />
|
|
24
24
|
</div>
|
|
25
25
|
)
|
|
26
26
|
}
|
|
27
27
|
{
|
|
28
28
|
hasColumns && (
|
|
29
|
-
<div class="grid gap-8 sm:grid-cols-2 lg:grid-cols-4">
|
|
29
|
+
<div class="grid gap-8 font-mono sm:grid-cols-2 lg:grid-cols-4 [&_a]:block [&_a]:text-on-surface-muted [&_a]:[&_a:hover]:text-primary [&_h4]:mb-3 [&_h4]:text-xs [&_h4]:font-medium [&_h4]:uppercase [&_h4]:tracking-[0.16em] [&_h4]:text-on-surface-faint [&_h4]:before:mr-1.5 [&_h4]:before:content-['──']">
|
|
30
30
|
<slot name="columns" />
|
|
31
31
|
</div>
|
|
32
32
|
)
|
|
33
33
|
}
|
|
34
34
|
<div
|
|
35
|
-
class="text-on-surface-muted mt-10 flex flex-col items-start justify-between gap-4 border-t border-outline-faint pt-6 text-
|
|
35
|
+
class="text-on-surface-muted mt-10 flex flex-col items-start justify-between gap-4 border-t border-outline-faint pt-6 font-mono text-xs sm:flex-row sm:items-center"
|
|
36
36
|
>
|
|
37
37
|
<p>{tagline}</p>
|
|
38
38
|
{
|
|
@@ -15,20 +15,20 @@ const hasNav = Astro.slots.has("nav");
|
|
|
15
15
|
const hasActions = Astro.slots.has("actions");
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
<header class:list={["rw-bg-glass sticky top-0 z-40 border-b border-outline
|
|
19
|
-
<div class="mx-auto flex max-w-6xl items-center justify-between gap-6 px-6
|
|
18
|
+
<header class:list={["rw-bg-glass sticky top-0 z-40 border-b border-outline", className]}>
|
|
19
|
+
<div class="mx-auto flex h-[52px] max-w-6xl items-center justify-between gap-6 px-6">
|
|
20
20
|
<a
|
|
21
21
|
href={homeHref}
|
|
22
22
|
class="text-on-surface flex items-center gap-2"
|
|
23
23
|
aria-label={`${wordmark} home`}
|
|
24
24
|
>
|
|
25
25
|
<Logo size="md" />
|
|
26
|
-
<span class="font-bold tracking-tight">{wordmark}</span>
|
|
26
|
+
<span class="font-mono font-bold tracking-tight">{wordmark}</span>
|
|
27
27
|
</a>
|
|
28
28
|
{
|
|
29
29
|
hasNav && (
|
|
30
30
|
<nav
|
|
31
|
-
class="text-on-surface-muted hidden gap-6 text-sm
|
|
31
|
+
class="text-on-surface-muted hidden gap-6 font-mono text-sm sm:flex [&_a]:[&_a:hover]:text-primary"
|
|
32
32
|
aria-label="Primary"
|
|
33
33
|
>
|
|
34
34
|
<slot name="nav" />
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
<svg width="512" height="512" version="1.1" viewBox="0 0 5120 5120" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<defs>
|
|
3
|
-
<linearGradient id="b">
|
|
4
|
-
<stop stop-color="#15a0a8" offset="0"/>
|
|
5
|
-
<stop stop-color="#0e7c86" offset="1"/>
|
|
6
|
-
</linearGradient>
|
|
7
|
-
<radialGradient id="a" cx="2375.3" cy="3240.7" r="1333.9" gradientTransform="matrix(1.01 -.012494 .026846 2.1701 -110.74 -3341.2)" gradientUnits="userSpaceOnUse" href="#b"/>
|
|
8
|
-
</defs>
|
|
9
2
|
<g fill="currentColor">
|
|
10
|
-
<g transform="matrix(1.1828 0 0 1.1828 -308.66 -422.68)"
|
|
3
|
+
<g transform="matrix(1.1828 0 0 1.1828 -308.66 -422.68)" stroke-width=".69118">
|
|
11
4
|
<path d="m1337.7 3078.1c-148.18-155.91-250.14-363.35-245.9-581.62-4.9405-143.31 33.544-285.11 105.17-408.87 53.884-96.655 144.6-165.07 216.94-247.17 183.01-186.28 363.71-375.11 552.07-555.94 29.831 190.66 135.62 362.63 276.82 491.77 29.939 18.759-21.226 37.649-30.616 56.472-195.88 199.8-397.96 393.69-588.19 598.91-152.46 182.9-237.05 424.04-218.75 662.75 5.6183 42.874 1.3956 73.556-30.679 24.283-12.387-13.436-24.662-26.974-36.862-40.58z"/>
|
|
12
5
|
<path d="m2283.9 4565.5c51.838-97.456 67.044-158.97 68.426-264.03 0-96.074-14.515-161.74-55.985-239.84-34.559-66.353-81.559-117.5-336.6-371.16-237.76-236.38-268.18-273.01-310.34-371.16-33.868-79.485-46.309-134.09-51.147-224.63-6.9117-134.09 20.735-260.57 84.324-386.37 108.51-213.57 334.53-427.84 532.9-504.56 138.24-53.221 255.74-54.603 351.81-4.8382l27.647 14.515-26.265 5.5294c-76.721 16.588-123.72 80.176-111.97 152.06 5.5294 33.176 40.088 79.485 72.574 96.074 69.809 37.324 169.34-8.9853 184.54-85.706 5.5294-26.265 13.132-16.588 25.574 33.176 12.441 45.618 13.824 123.72 4.1471 165.88-3.4559 15.206-4.8383 28.338-4.1471 29.721 1.3824 0.6912 17.279-13.824 35.941-33.176 116.12-120.96 142.38-281.31 70.5-428.53-18.662-39.397-55.294-79.485-305.5-331.76-246.75-249.51-288.22-293.75-315.87-342.13-100.22-172.79-121.65-355.26-63.588-539.12 46.309-145.84 134.09-274.4 273.71-398.81 58.75-51.838 163.12-129.94 174.18-129.94 2.0736 0-2.0735 8.9853-10.368 20.735-27.647 38.706-69.118 136.16-83.632 197.68-31.103 127.18-16.588 248.13 43.544 364.94 26.956 52.53 46.309 73.265 296.51 325.54 283.38 285.46 311.03 318.63 351.12 419.54 40.088 101.6 45.618 130.63 44.926 257.81 0 106.44-1.3824 124.41-18.662 186.62-24.191 89.162-87.779 217.72-147.91 297.21-94 125.79-230.85 245.37-347.66 304.12-95.382 47.691-163.12 66.353-259.19 70.5-76.721 3.4559-87.088 2.0735-137.54-14.515-64.971-22.118-98.147-43.544-151.37-99.529-66.353-69.809-92.618-145.84-85.706-248.82 2.0735-31.794 0.6911-56.676-2.0736-55.294-13.824 5.5294-71.191 80.868-93.309 123.72-59.441 113.35-56.676 246.06 7.603 358.03 11.059 17.971 135.47 149.99 293.06 308.26 150.68 152.06 283.38 290.29 295.13 307.57 86.397 127.87 129.25 300.66 112.66 449.96-10.368 92.618-29.721 157.59-72.574 244.68-66.353 134.78-161.74 243.29-314.49 357.34-40.088 29.721-74.647 53.912-77.412 53.912s11.75-31.794 32.485-71.191z"/>
|
|
13
6
|
<path d="m2881.7 3745.7c-31.13-173.6-122.18-331.84-246.22-455.86-14.352-19.305-55.137-38.918-18.602-57.632 207.7-210.04 420.06-415.65 622.16-631.1 146.07-182.43 225.82-418.38 206.48-652.47-4.5024-33.687-4.181-60.898 26.761-25.766 148.94 150.92 277.41 342.97 283.4 561.68 11.697 142.68-4.4537 290.19-73.137 417.9-34.008 81.467-90.87 148.51-154.3 208.53-213.07 217.42-425.06 436.12-643.78 647.84l-1.9007-3.7151z"/>
|
|
@@ -34,9 +34,8 @@
|
|
|
34
34
|
onclick={toggle}
|
|
35
35
|
{disabled}
|
|
36
36
|
class="
|
|
37
|
-
flex w-full items-center justify-between gap-3 py-4 text-left text-sm
|
|
38
|
-
text-on-surface
|
|
39
|
-
hover:text-on-surface-muted
|
|
37
|
+
flex w-full items-center justify-between gap-3 py-4 text-left font-mono text-sm
|
|
38
|
+
text-on-surface hover:text-primary
|
|
40
39
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
41
40
|
"
|
|
42
41
|
aria-expanded={open}
|
|
@@ -48,16 +47,11 @@
|
|
|
48
47
|
{title}
|
|
49
48
|
{/if}
|
|
50
49
|
</span>
|
|
51
|
-
<ChevronDown
|
|
52
|
-
size={16}
|
|
53
|
-
class="shrink-0 text-on-surface-faint transition-transform duration-200 {open
|
|
54
|
-
? 'rotate-180'
|
|
55
|
-
: ''}"
|
|
56
|
-
/>
|
|
50
|
+
<ChevronDown size={16} class="shrink-0 text-on-surface-faint {open ? 'rotate-180' : ''}" />
|
|
57
51
|
</button>
|
|
58
52
|
|
|
59
53
|
<div
|
|
60
|
-
class="grid transition-[grid-template-rows] duration-
|
|
54
|
+
class="grid transition-[grid-template-rows] duration-150 ease-out {open
|
|
61
55
|
? 'grid-rows-[1fr]'
|
|
62
56
|
: 'grid-rows-[0fr]'}"
|
|
63
57
|
>
|
|
@@ -34,28 +34,28 @@
|
|
|
34
34
|
{ bg: string; border: string; icon: typeof Info; iconColor: string }
|
|
35
35
|
> = {
|
|
36
36
|
info: {
|
|
37
|
-
bg: "bg-info-soft",
|
|
37
|
+
bg: "bg-info-soft text-info-soft-text",
|
|
38
38
|
border: "border-info-soft-border",
|
|
39
39
|
icon: Info,
|
|
40
|
-
iconColor: "text-info",
|
|
40
|
+
iconColor: "text-info-soft-text",
|
|
41
41
|
},
|
|
42
42
|
success: {
|
|
43
|
-
bg: "bg-success-soft",
|
|
43
|
+
bg: "bg-success-soft text-success-soft-text",
|
|
44
44
|
border: "border-success-soft-border",
|
|
45
45
|
icon: CircleCheckBig,
|
|
46
|
-
iconColor: "text-success-
|
|
46
|
+
iconColor: "text-success-soft-text",
|
|
47
47
|
},
|
|
48
48
|
warning: {
|
|
49
|
-
bg: "bg-warning-soft",
|
|
49
|
+
bg: "bg-warning-soft text-warning-soft-text",
|
|
50
50
|
border: "border-warning-soft-border",
|
|
51
51
|
icon: TriangleAlert,
|
|
52
|
-
iconColor: "text-warning-
|
|
52
|
+
iconColor: "text-warning-soft-text",
|
|
53
53
|
},
|
|
54
54
|
danger: {
|
|
55
|
-
bg: "bg-danger-soft",
|
|
55
|
+
bg: "bg-danger-soft text-danger-soft-text",
|
|
56
56
|
border: "border-danger-soft-border",
|
|
57
57
|
icon: CircleX,
|
|
58
|
-
iconColor: "text-danger-
|
|
58
|
+
iconColor: "text-danger-soft-text",
|
|
59
59
|
},
|
|
60
60
|
};
|
|
61
61
|
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
<div
|
|
66
66
|
class="
|
|
67
|
-
flex gap-3 rounded-
|
|
67
|
+
flex gap-3 rounded-[4px] border p-4
|
|
68
68
|
{config.bg} {config.border}
|
|
69
69
|
{className}
|
|
70
70
|
"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
|
|
82
82
|
<div class="min-w-0 flex-1">
|
|
83
83
|
{#if title}
|
|
84
|
-
<h4 class="mb-1 text-sm font-semibold text-on-surface">{title}</h4>
|
|
84
|
+
<h4 class="mb-1 font-mono text-sm font-semibold text-on-surface">{title}</h4>
|
|
85
85
|
{/if}
|
|
86
86
|
{#if children}
|
|
87
87
|
<div class="text-sm text-on-surface-muted">
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
{#if dismissible}
|
|
99
99
|
<button
|
|
100
100
|
onclick={onDismiss}
|
|
101
|
-
class="shrink-0 rounded-
|
|
101
|
+
class="shrink-0 rounded-[3px] p-1 text-on-surface-faint hover:bg-surface-raised hover:text-on-surface-muted"
|
|
102
102
|
aria-label="Dismiss"
|
|
103
103
|
>
|
|
104
104
|
<X size={16} />
|
|
@@ -29,34 +29,34 @@
|
|
|
29
29
|
|
|
30
30
|
const baseClasses = `
|
|
31
31
|
inline-flex items-center gap-1.5
|
|
32
|
-
font-
|
|
32
|
+
font-mono tracking-wide rounded-[3px]
|
|
33
33
|
whitespace-nowrap
|
|
34
34
|
`;
|
|
35
35
|
|
|
36
36
|
const variantClasses: Record<BadgeVariant, { solid: string; outline: string }> = {
|
|
37
37
|
default: {
|
|
38
|
-
solid: "bg-surface-sunken text-on-surface-muted",
|
|
38
|
+
solid: "bg-surface-sunken text-on-surface-muted border border-outline",
|
|
39
39
|
outline: "bg-transparent border border-outline-hover text-on-surface-muted",
|
|
40
40
|
},
|
|
41
41
|
primary: {
|
|
42
|
-
solid: "bg-primary-soft text-primary-soft-text",
|
|
43
|
-
outline: "bg-transparent border border-
|
|
42
|
+
solid: "bg-primary-soft text-primary-soft-text border border-primary-soft-border",
|
|
43
|
+
outline: "bg-transparent border border-primary-soft-border text-primary-soft-text",
|
|
44
44
|
},
|
|
45
45
|
success: {
|
|
46
|
-
solid: "bg-success-soft text-success-soft-text",
|
|
47
|
-
outline: "bg-transparent border border-success-
|
|
46
|
+
solid: "bg-success-soft text-success-soft-text border border-success-soft-border",
|
|
47
|
+
outline: "bg-transparent border border-success-soft-border text-success-soft-text",
|
|
48
48
|
},
|
|
49
49
|
warning: {
|
|
50
|
-
solid: "bg-warning-soft text-warning-soft-text",
|
|
51
|
-
outline: "bg-transparent border border-warning-
|
|
50
|
+
solid: "bg-warning-soft text-warning-soft-text border border-warning-soft-border",
|
|
51
|
+
outline: "bg-transparent border border-warning-soft-border text-warning-soft-text",
|
|
52
52
|
},
|
|
53
53
|
danger: {
|
|
54
|
-
solid: "bg-danger-soft text-danger-soft-text",
|
|
55
|
-
outline: "bg-transparent border border-danger-
|
|
54
|
+
solid: "bg-danger-soft text-danger-soft-text border border-danger-soft-border",
|
|
55
|
+
outline: "bg-transparent border border-danger-soft-border text-danger-soft-text",
|
|
56
56
|
},
|
|
57
57
|
info: {
|
|
58
|
-
solid: "bg-info-soft text-info-soft-text",
|
|
59
|
-
outline: "bg-transparent border border-
|
|
58
|
+
solid: "bg-info-soft text-info-soft-text border border-info-soft-border",
|
|
59
|
+
outline: "bg-transparent border border-info-soft-border text-info-soft-text",
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const dotColors: Record<BadgeVariant, string> = {
|
|
70
|
-
default: "bg-
|
|
70
|
+
default: "bg-on-surface-faint",
|
|
71
71
|
primary: "bg-primary",
|
|
72
72
|
success: "bg-success-surface",
|
|
73
73
|
warning: "bg-warning-surface",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<nav aria-label="Breadcrumb" class={className}>
|
|
24
|
-
<ol class="flex items-center gap-1.5 text-sm">
|
|
24
|
+
<ol class="flex items-center gap-1.5 font-mono text-sm">
|
|
25
25
|
{#each items as item, idx (idx)}
|
|
26
26
|
<li class="flex items-center gap-1.5">
|
|
27
27
|
{#if idx > 0}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
{#if item.href && idx < items.length - 1}
|
|
36
36
|
<a
|
|
37
37
|
href={item.href}
|
|
38
|
-
class="flex items-center gap-1.5 text-on-surface-muted
|
|
38
|
+
class="flex items-center gap-1.5 text-on-surface-muted hover:text-primary"
|
|
39
39
|
>
|
|
40
40
|
{#if item.icon}
|
|
41
41
|
{@const Icon = item.icon}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<span>{item.label}</span>
|
|
45
45
|
</a>
|
|
46
46
|
{:else}
|
|
47
|
-
<span class="flex items-center gap-1.5
|
|
47
|
+
<span class="flex items-center gap-1.5 text-on-surface">
|
|
48
48
|
{#if item.icon}
|
|
49
49
|
{@const Icon = item.icon}
|
|
50
50
|
<Icon size={14} />
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
></path>
|
|
55
55
|
</svg>
|
|
56
56
|
{:else if icon}
|
|
57
|
-
<span class="shrink-0
|
|
57
|
+
<span class="shrink-0 group-active:scale-95">
|
|
58
58
|
{@render icon()}
|
|
59
59
|
</span>
|
|
60
60
|
{/if}
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
{@render children()}
|
|
63
63
|
{/if}
|
|
64
64
|
{#if iconRight && !loading}
|
|
65
|
-
<span class="shrink-0
|
|
65
|
+
<span class="shrink-0 group-active:scale-95">
|
|
66
66
|
{@render iconRight()}
|
|
67
67
|
</span>
|
|
68
68
|
{/if}
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
|
|
47
47
|
<div
|
|
48
48
|
class="
|
|
49
|
-
overflow-hidden rounded-
|
|
49
|
+
overflow-hidden rounded-[4px] bg-surface-raised
|
|
50
50
|
{border ? 'border border-outline' : ''}
|
|
51
51
|
{shadowClasses[shadow]}
|
|
52
|
-
{hover ? '
|
|
52
|
+
{hover ? 'hover:border-outline-hover hover:shadow-md' : ''}
|
|
53
53
|
{className}
|
|
54
54
|
"
|
|
55
55
|
>
|
|
56
56
|
{#if header}
|
|
57
|
-
<div class="border-b border-outline
|
|
57
|
+
<div class="border-b border-outline bg-surface-sunken/50 px-4 py-3">
|
|
58
58
|
{@render header()}
|
|
59
59
|
</div>
|
|
60
60
|
{/if}
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
</div>
|
|
67
67
|
|
|
68
68
|
{#if footer}
|
|
69
|
-
<div class="border-t border-outline
|
|
69
|
+
<div class="border-t border-outline bg-surface-sunken/50 px-4 py-3">
|
|
70
70
|
{@render footer()}
|
|
71
71
|
</div>
|
|
72
72
|
{/if}
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
bind:checked
|
|
46
46
|
{disabled}
|
|
47
47
|
class="
|
|
48
|
-
peer {sizeClasses[size].box}
|
|
49
|
-
cursor-pointer appearance-none rounded
|
|
50
|
-
border
|
|
51
|
-
bg-surface-raised
|
|
52
|
-
checked:bg-primary hover:border-
|
|
53
|
-
focus:ring-2 focus:ring-ring
|
|
54
|
-
focus:
|
|
55
|
-
disabled:cursor-not-allowed disabled:hover:border-outline
|
|
48
|
+
peer {sizeClasses[size].box}
|
|
49
|
+
cursor-pointer appearance-none rounded-[3px]
|
|
50
|
+
border border-outline
|
|
51
|
+
bg-surface-raised checked:border-primary
|
|
52
|
+
checked:bg-primary hover:border-outline-hover checked:hover:border-primary-hover checked:hover:bg-primary-hover
|
|
53
|
+
focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
54
|
+
focus:outline-none
|
|
55
|
+
disabled:cursor-not-allowed disabled:hover:border-outline
|
|
56
56
|
disabled:checked:hover:bg-primary
|
|
57
57
|
"
|
|
58
58
|
{...restProps}
|
|
59
59
|
/>
|
|
60
60
|
<div
|
|
61
|
-
class="
|
|
61
|
+
class="pointer-events-none absolute text-on-primary opacity-0 peer-checked:opacity-100"
|
|
62
62
|
>
|
|
63
63
|
{#if indeterminate}
|
|
64
64
|
<svg
|
|
@@ -80,7 +80,9 @@
|
|
|
80
80
|
{#if label || description}
|
|
81
81
|
<div class="flex flex-col gap-0.5">
|
|
82
82
|
{#if label}
|
|
83
|
-
<span class="{sizeClasses[size].text} font-medium text-on-surface"
|
|
83
|
+
<span class="{sizeClasses[size].text} font-mono font-medium text-on-surface"
|
|
84
|
+
>{label}</span
|
|
85
|
+
>
|
|
84
86
|
{/if}
|
|
85
87
|
{#if description}
|
|
86
88
|
<span class="text-sm text-on-surface-muted">{description}</span>
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
3
3
|
|
|
4
4
|
<script lang="ts">
|
|
5
|
-
import { Check, Copy } from "@lucide/svelte";
|
|
6
|
-
|
|
7
5
|
interface Props {
|
|
8
6
|
code: string;
|
|
9
7
|
language?: string;
|
|
@@ -35,32 +33,28 @@
|
|
|
35
33
|
}
|
|
36
34
|
</script>
|
|
37
35
|
|
|
38
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
class="overflow-hidden rounded-[4px] border border-term-line bg-term text-term-text {className}"
|
|
38
|
+
>
|
|
39
39
|
{#if filename || language}
|
|
40
40
|
<div
|
|
41
|
-
class="flex items-center justify-between border-b border-
|
|
41
|
+
class="flex items-center justify-between border-b border-term-line-2 bg-term-2 px-4 py-2 font-mono text-xs text-term-muted"
|
|
42
42
|
>
|
|
43
43
|
<span>{filename ?? language}</span>
|
|
44
44
|
</div>
|
|
45
45
|
{/if}
|
|
46
46
|
<div class="relative">
|
|
47
47
|
<pre
|
|
48
|
-
class="overflow-x-auto px-4 py-4 font-mono text-sm leading-relaxed text-
|
|
48
|
+
class="overflow-x-auto px-4 py-4 font-mono text-sm leading-relaxed text-term-text"><code
|
|
49
49
|
>{code}</code
|
|
50
50
|
></pre>
|
|
51
51
|
<button
|
|
52
52
|
type="button"
|
|
53
53
|
onclick={handleCopy}
|
|
54
|
-
class="absolute top-2 right-2 inline-flex items-center
|
|
54
|
+
class="absolute top-2 right-2 inline-flex items-center rounded-[3px] border border-term-line-2 bg-term-2 px-2 py-1 font-mono text-xs text-term-muted hover:border-term-teal hover:text-term-teal"
|
|
55
55
|
aria-label={copied ? "Copied" : "Copy to clipboard"}
|
|
56
56
|
>
|
|
57
|
-
{
|
|
58
|
-
<Check size={14} class="text-success-surface" />
|
|
59
|
-
<span>Copied</span>
|
|
60
|
-
{:else}
|
|
61
|
-
<Copy size={14} />
|
|
62
|
-
<span>Copy</span>
|
|
63
|
-
{/if}
|
|
57
|
+
{copied ? "[copied]" : "[copy]"}
|
|
64
58
|
</button>
|
|
65
59
|
</div>
|
|
66
60
|
</div>
|