@hyvnt/hyvui 0.1.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/README.md +253 -0
- package/dist/components/ambient/CornerBrackets.svelte +87 -0
- package/dist/components/ambient/CornerBrackets.svelte.d.ts +11 -0
- package/dist/components/ambient/DataStream.svelte +94 -0
- package/dist/components/ambient/DataStream.svelte.d.ts +13 -0
- package/dist/components/ambient/GlyphMark.svelte +69 -0
- package/dist/components/ambient/GlyphMark.svelte.d.ts +13 -0
- package/dist/components/ambient/GridOverlay.svelte +28 -0
- package/dist/components/ambient/GridOverlay.svelte.d.ts +7 -0
- package/dist/components/ambient/ParallaxLayer.svelte +41 -0
- package/dist/components/ambient/ParallaxLayer.svelte.d.ts +12 -0
- package/dist/components/ambient/ScanBand.svelte +91 -0
- package/dist/components/ambient/ScanBand.svelte.d.ts +17 -0
- package/dist/components/ambient/SignalRing.svelte +100 -0
- package/dist/components/ambient/SignalRing.svelte.d.ts +13 -0
- package/dist/components/ambient/ThreadLine.svelte +78 -0
- package/dist/components/ambient/ThreadLine.svelte.d.ts +17 -0
- package/dist/components/ambient/Vignette.svelte +26 -0
- package/dist/components/ambient/Vignette.svelte.d.ts +7 -0
- package/dist/components/depth/DepthLayer.svelte +27 -0
- package/dist/components/depth/DepthLayer.svelte.d.ts +15 -0
- package/dist/components/depth/DepthStage.svelte +62 -0
- package/dist/components/depth/DepthStage.svelte.d.ts +19 -0
- package/dist/components/depth/FloatCard.svelte +104 -0
- package/dist/components/depth/FloatCard.svelte.d.ts +14 -0
- package/dist/components/depth/HorizonGrid.svelte +160 -0
- package/dist/components/depth/HorizonGrid.svelte.d.ts +15 -0
- package/dist/components/depth/Plinth.svelte +57 -0
- package/dist/components/depth/Plinth.svelte.d.ts +13 -0
- package/dist/components/display/Avatar.svelte +69 -0
- package/dist/components/display/Avatar.svelte.d.ts +13 -0
- package/dist/components/display/Badge.svelte +63 -0
- package/dist/components/display/Badge.svelte.d.ts +12 -0
- package/dist/components/display/Blockquote.svelte +34 -0
- package/dist/components/display/Blockquote.svelte.d.ts +10 -0
- package/dist/components/display/CodeBlock.svelte +76 -0
- package/dist/components/display/CodeBlock.svelte.d.ts +13 -0
- package/dist/components/display/MetricCard.svelte +83 -0
- package/dist/components/display/MetricCard.svelte.d.ts +15 -0
- package/dist/components/display/Table.svelte +104 -0
- package/dist/components/display/Table.svelte.d.ts +19 -0
- package/dist/components/feedback/Alert.svelte +76 -0
- package/dist/components/feedback/Alert.svelte.d.ts +14 -0
- package/dist/components/feedback/EmptyState.svelte +68 -0
- package/dist/components/feedback/EmptyState.svelte.d.ts +14 -0
- package/dist/components/feedback/ErrorState.svelte +73 -0
- package/dist/components/feedback/ErrorState.svelte.d.ts +15 -0
- package/dist/components/feedback/Skeleton.svelte +52 -0
- package/dist/components/feedback/Skeleton.svelte.d.ts +13 -0
- package/dist/components/feedback/StatusDot.svelte +54 -0
- package/dist/components/feedback/StatusDot.svelte.d.ts +13 -0
- package/dist/components/feedback/StatusLine.svelte +122 -0
- package/dist/components/feedback/StatusLine.svelte.d.ts +17 -0
- package/dist/components/feedback/Toast.svelte +136 -0
- package/dist/components/feedback/Toast.svelte.d.ts +21 -0
- package/dist/components/inputs/Button.svelte +237 -0
- package/dist/components/inputs/Button.svelte.d.ts +30 -0
- package/dist/components/inputs/Checkbox.svelte +105 -0
- package/dist/components/inputs/Checkbox.svelte.d.ts +15 -0
- package/dist/components/inputs/FileUpload.svelte +163 -0
- package/dist/components/inputs/FileUpload.svelte.d.ts +17 -0
- package/dist/components/inputs/Input.svelte +147 -0
- package/dist/components/inputs/Input.svelte.d.ts +25 -0
- package/dist/components/inputs/Select.svelte +150 -0
- package/dist/components/inputs/Select.svelte.d.ts +23 -0
- package/dist/components/inputs/Textarea.svelte +154 -0
- package/dist/components/inputs/Textarea.svelte.d.ts +25 -0
- package/dist/components/inputs/Toggle.svelte +120 -0
- package/dist/components/inputs/Toggle.svelte.d.ts +15 -0
- package/dist/components/layout/Card.svelte +76 -0
- package/dist/components/layout/Card.svelte.d.ts +16 -0
- package/dist/components/layout/Drawer.svelte +109 -0
- package/dist/components/layout/Drawer.svelte.d.ts +18 -0
- package/dist/components/layout/Grid.svelte +43 -0
- package/dist/components/layout/Grid.svelte.d.ts +16 -0
- package/dist/components/layout/Modal.svelte +159 -0
- package/dist/components/layout/Modal.svelte.d.ts +20 -0
- package/dist/components/layout/Panel.svelte +54 -0
- package/dist/components/layout/Panel.svelte.d.ts +14 -0
- package/dist/components/layout/Popover.svelte +67 -0
- package/dist/components/layout/Popover.svelte.d.ts +14 -0
- package/dist/components/layout/Stack.svelte +53 -0
- package/dist/components/layout/Stack.svelte.d.ts +22 -0
- package/dist/components/navigation/Breadcrumb.svelte +73 -0
- package/dist/components/navigation/Breadcrumb.svelte.d.ts +13 -0
- package/dist/components/navigation/DropdownMenu.svelte +124 -0
- package/dist/components/navigation/DropdownMenu.svelte.d.ts +19 -0
- package/dist/components/navigation/SidebarNav.svelte +90 -0
- package/dist/components/navigation/SidebarNav.svelte.d.ts +16 -0
- package/dist/components/navigation/Tabs.svelte +86 -0
- package/dist/components/navigation/Tabs.svelte.d.ts +17 -0
- package/dist/components/navigation/Topbar.svelte +85 -0
- package/dist/components/navigation/Topbar.svelte.d.ts +14 -0
- package/dist/components/patterns/ActionBar.svelte +76 -0
- package/dist/components/patterns/ActionBar.svelte.d.ts +14 -0
- package/dist/components/patterns/ConfirmDialog.svelte +64 -0
- package/dist/components/patterns/ConfirmDialog.svelte.d.ts +23 -0
- package/dist/components/patterns/PageHeader.svelte +114 -0
- package/dist/components/patterns/PageHeader.svelte.d.ts +16 -0
- package/dist/components/patterns/SearchBar.svelte +59 -0
- package/dist/components/patterns/SearchBar.svelte.d.ts +15 -0
- package/dist/components/patterns/TerminalBoot.svelte +104 -0
- package/dist/components/patterns/TerminalBoot.svelte.d.ts +25 -0
- package/dist/components/primitives/Divider.svelte +29 -0
- package/dist/components/primitives/Divider.svelte.d.ts +9 -0
- package/dist/components/primitives/Icon.svelte +49 -0
- package/dist/components/primitives/Icon.svelte.d.ts +14 -0
- package/dist/components/primitives/Label.svelte +44 -0
- package/dist/components/primitives/Label.svelte.d.ts +14 -0
- package/dist/components/primitives/Surface.svelte +87 -0
- package/dist/components/primitives/Surface.svelte.d.ts +16 -0
- package/dist/components/primitives/Text.svelte +98 -0
- package/dist/components/primitives/Text.svelte.d.ts +19 -0
- package/dist/components/primitives/text.d.ts +1 -0
- package/dist/components/primitives/text.js +1 -0
- package/dist/components/scenes/ArchiveScene.svelte +95 -0
- package/dist/components/scenes/ArchiveScene.svelte.d.ts +16 -0
- package/dist/components/scenes/LogScene.svelte +77 -0
- package/dist/components/scenes/LogScene.svelte.d.ts +14 -0
- package/dist/components/scenes/NarrativeScene.svelte +92 -0
- package/dist/components/scenes/NarrativeScene.svelte.d.ts +16 -0
- package/dist/components/scenes/ReadoutScene.svelte +107 -0
- package/dist/components/scenes/ReadoutScene.svelte.d.ts +16 -0
- package/dist/components/scenes/StageScene.svelte +104 -0
- package/dist/components/scenes/StageScene.svelte.d.ts +18 -0
- package/dist/examples/FieldReport.svelte +223 -0
- package/dist/examples/FieldReport.svelte.d.ts +18 -0
- package/dist/examples/ObservationDeck.svelte +317 -0
- package/dist/examples/ObservationDeck.svelte.d.ts +3 -0
- package/dist/examples/SignalLost.svelte +191 -0
- package/dist/examples/SignalLost.svelte.d.ts +3 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +83 -0
- package/dist/system/actions/echo.d.ts +10 -0
- package/dist/system/actions/echo.js +46 -0
- package/dist/system/actions/resolve.d.ts +23 -0
- package/dist/system/actions/resolve.js +59 -0
- package/dist/system/actions/reveal.d.ts +18 -0
- package/dist/system/actions/reveal.js +54 -0
- package/dist/system/actions/surface.d.ts +14 -0
- package/dist/system/actions/surface.js +25 -0
- package/dist/system/depth/depth.css +49 -0
- package/dist/system/depth/depth.d.ts +15 -0
- package/dist/system/depth/depth.js +24 -0
- package/dist/system/expressions.css +80 -0
- package/dist/system/override-template.css +72 -0
- package/dist/system/register.css +74 -0
- package/dist/system/register.d.ts +11 -0
- package/dist/system/register.js +16 -0
- package/dist/tokens/tokens.css +86 -0
- package/dist/tokens/tokens.d.ts +25 -0
- package/dist/tokens/tokens.js +25 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +4 -0
- package/dist/utils/motion.d.ts +17 -0
- package/dist/utils/motion.js +11 -0
- package/package.json +60 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../utils/cn.js';
|
|
3
|
+
import EmptyState from '../feedback/EmptyState.svelte';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
|
|
6
|
+
interface TableColumn {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
align?: 'left' | 'center' | 'right';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
/** Column definitions. */
|
|
14
|
+
columns?: TableColumn[];
|
|
15
|
+
/** Row data objects. */
|
|
16
|
+
rows?: Record<string, any>[];
|
|
17
|
+
/** Additional CSS classes. */
|
|
18
|
+
class?: string;
|
|
19
|
+
/** Custom empty state slot. */
|
|
20
|
+
empty?: Snippet;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
columns = [],
|
|
25
|
+
rows = [],
|
|
26
|
+
class: className = '',
|
|
27
|
+
empty,
|
|
28
|
+
}: Props = $props();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if rows.length === 0}
|
|
32
|
+
{#if empty}
|
|
33
|
+
{@render empty()}
|
|
34
|
+
{:else}
|
|
35
|
+
<EmptyState title="no data" />
|
|
36
|
+
{/if}
|
|
37
|
+
{:else}
|
|
38
|
+
<div class={cn('hyvui-table-wrap', className)}>
|
|
39
|
+
<table class="hyvui-table">
|
|
40
|
+
<thead>
|
|
41
|
+
<tr>
|
|
42
|
+
{#each columns as col}
|
|
43
|
+
<th class="hyvui-table-th" style:text-align={col.align ?? 'left'}>{col.label}</th>
|
|
44
|
+
{/each}
|
|
45
|
+
</tr>
|
|
46
|
+
</thead>
|
|
47
|
+
<tbody>
|
|
48
|
+
{#each rows as row}
|
|
49
|
+
<tr class="hyvui-table-row">
|
|
50
|
+
{#each columns as col}
|
|
51
|
+
<td class="hyvui-table-td" style:text-align={col.align ?? 'left'}>
|
|
52
|
+
{row[col.key] ?? ''}
|
|
53
|
+
</td>
|
|
54
|
+
{/each}
|
|
55
|
+
</tr>
|
|
56
|
+
{/each}
|
|
57
|
+
</tbody>
|
|
58
|
+
</table>
|
|
59
|
+
</div>
|
|
60
|
+
{/if}
|
|
61
|
+
|
|
62
|
+
<style>
|
|
63
|
+
.hyvui-table-wrap {
|
|
64
|
+
overflow-x: auto;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.hyvui-table {
|
|
68
|
+
width: 100%;
|
|
69
|
+
border-collapse: collapse;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.hyvui-table-th {
|
|
73
|
+
font-family: var(--font-mono);
|
|
74
|
+
font-size: 0.68rem;
|
|
75
|
+
font-weight: 400;
|
|
76
|
+
letter-spacing: 0.14em;
|
|
77
|
+
text-transform: uppercase;
|
|
78
|
+
color: var(--muted-strong);
|
|
79
|
+
padding: 0.625rem 0.75rem;
|
|
80
|
+
border-bottom: 1px solid var(--line);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.hyvui-table-td {
|
|
84
|
+
font-family: var(--font-body);
|
|
85
|
+
font-size: 1rem;
|
|
86
|
+
color: var(--text-soft);
|
|
87
|
+
padding: 0.625rem 0.75rem;
|
|
88
|
+
border-bottom: 1px solid var(--line);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.hyvui-table-row {
|
|
92
|
+
transition: background-color var(--transition-fast);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.hyvui-table-row:hover {
|
|
96
|
+
background-color: rgba(199, 156, 87, 0.04);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (prefers-reduced-motion: reduce) {
|
|
100
|
+
.hyvui-table-row {
|
|
101
|
+
transition: none;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface TableColumn {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
align?: 'left' | 'center' | 'right';
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
/** Column definitions. */
|
|
9
|
+
columns?: TableColumn[];
|
|
10
|
+
/** Row data objects. */
|
|
11
|
+
rows?: Record<string, any>[];
|
|
12
|
+
/** Additional CSS classes. */
|
|
13
|
+
class?: string;
|
|
14
|
+
/** Custom empty state slot. */
|
|
15
|
+
empty?: Snippet;
|
|
16
|
+
}
|
|
17
|
+
declare const Table: import("svelte").Component<Props, {}, "">;
|
|
18
|
+
type Table = ReturnType<typeof Table>;
|
|
19
|
+
export default Table;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../utils/cn.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
/** Alert variant determining accent color. */
|
|
7
|
+
variant?: 'info' | 'warn' | 'error' | 'ok';
|
|
8
|
+
/** Optional title text. */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** Additional CSS classes. */
|
|
11
|
+
class?: string;
|
|
12
|
+
/** Alert body content. */
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
variant = 'info',
|
|
18
|
+
title = '',
|
|
19
|
+
class: className = '',
|
|
20
|
+
children,
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
|
|
23
|
+
const colorMap: Record<string, string> = {
|
|
24
|
+
info: 'var(--signal)',
|
|
25
|
+
warn: 'var(--status-warn)',
|
|
26
|
+
error: 'var(--status-fail)',
|
|
27
|
+
ok: 'var(--status-ok)',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const bgMap: Record<string, string> = {
|
|
31
|
+
info: 'rgba(121, 166, 163, 0.06)',
|
|
32
|
+
warn: 'rgba(199, 156, 87, 0.06)',
|
|
33
|
+
error: 'rgba(182, 106, 72, 0.06)',
|
|
34
|
+
ok: 'rgba(121, 166, 163, 0.06)',
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div
|
|
39
|
+
class={cn('hyvui-alert', className)}
|
|
40
|
+
style:border-left-color={colorMap[variant]}
|
|
41
|
+
style:background-color={bgMap[variant]}
|
|
42
|
+
role="alert"
|
|
43
|
+
>
|
|
44
|
+
{#if title}
|
|
45
|
+
<div class="hyvui-alert-title">{title}</div>
|
|
46
|
+
{/if}
|
|
47
|
+
{#if children}
|
|
48
|
+
<div class="hyvui-alert-body">
|
|
49
|
+
{@render children()}
|
|
50
|
+
</div>
|
|
51
|
+
{/if}
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<style>
|
|
55
|
+
.hyvui-alert {
|
|
56
|
+
border-left: 2px solid;
|
|
57
|
+
padding: 0.75rem 1rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.hyvui-alert-title {
|
|
61
|
+
font-family: var(--font-mono);
|
|
62
|
+
font-size: 0.75rem;
|
|
63
|
+
font-weight: 400;
|
|
64
|
+
letter-spacing: 0.08em;
|
|
65
|
+
text-transform: uppercase;
|
|
66
|
+
color: var(--text-soft);
|
|
67
|
+
margin-bottom: 0.375rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.hyvui-alert-body {
|
|
71
|
+
font-family: var(--font-body);
|
|
72
|
+
font-size: 0.9rem;
|
|
73
|
+
color: var(--text-soft);
|
|
74
|
+
line-height: 1.5;
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Alert variant determining accent color. */
|
|
4
|
+
variant?: 'info' | 'warn' | 'error' | 'ok';
|
|
5
|
+
/** Optional title text. */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Additional CSS classes. */
|
|
8
|
+
class?: string;
|
|
9
|
+
/** Alert body content. */
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
}
|
|
12
|
+
declare const Alert: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type Alert = ReturnType<typeof Alert>;
|
|
14
|
+
export default Alert;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../utils/cn.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
/** Primary message. */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Secondary description text. */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Additional CSS classes. */
|
|
11
|
+
class?: string;
|
|
12
|
+
/** Optional CTA slot (e.g. a Button). */
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
title = 'nothing here yet',
|
|
18
|
+
description = '',
|
|
19
|
+
class: className = '',
|
|
20
|
+
children,
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<div class={cn('hyvui-empty', className)}>
|
|
25
|
+
<p class="hyvui-empty-title">{title}</p>
|
|
26
|
+
{#if description}
|
|
27
|
+
<p class="hyvui-empty-desc">{description}</p>
|
|
28
|
+
{/if}
|
|
29
|
+
{#if children}
|
|
30
|
+
<div class="hyvui-empty-action">
|
|
31
|
+
{@render children()}
|
|
32
|
+
</div>
|
|
33
|
+
{/if}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<style>
|
|
37
|
+
.hyvui-empty {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
align-items: center;
|
|
41
|
+
text-align: center;
|
|
42
|
+
padding: 2rem;
|
|
43
|
+
gap: 0.75rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.hyvui-empty-title {
|
|
47
|
+
font-family: var(--font-body);
|
|
48
|
+
font-size: 1.2rem;
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
line-height: 0.93;
|
|
51
|
+
letter-spacing: -0.04em;
|
|
52
|
+
color: var(--text);
|
|
53
|
+
margin: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.hyvui-empty-desc {
|
|
57
|
+
font-family: var(--font-body);
|
|
58
|
+
font-size: 0.9rem;
|
|
59
|
+
color: var(--muted);
|
|
60
|
+
line-height: 1.5;
|
|
61
|
+
max-width: 24rem;
|
|
62
|
+
margin: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.hyvui-empty-action {
|
|
66
|
+
margin-top: 0.5rem;
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Primary message. */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Secondary description text. */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Additional CSS classes. */
|
|
8
|
+
class?: string;
|
|
9
|
+
/** Optional CTA slot (e.g. a Button). */
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
}
|
|
12
|
+
declare const EmptyState: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type EmptyState = ReturnType<typeof EmptyState>;
|
|
14
|
+
export default EmptyState;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../utils/cn.js';
|
|
3
|
+
import StatusDot from './StatusDot.svelte';
|
|
4
|
+
import Button from '../inputs/Button.svelte';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
/** Error condition title. Describes the condition, not the cause. */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Additional description text. */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Shows a retry button. */
|
|
12
|
+
retry?: boolean;
|
|
13
|
+
/** Additional CSS classes. */
|
|
14
|
+
class?: string;
|
|
15
|
+
/** Fires when the retry button is clicked. */
|
|
16
|
+
onretry?: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
title = 'the signal needs rest',
|
|
21
|
+
description = '',
|
|
22
|
+
retry = false,
|
|
23
|
+
class: className = '',
|
|
24
|
+
onretry,
|
|
25
|
+
}: Props = $props();
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div class={cn('hyvui-error', className)}>
|
|
29
|
+
<StatusDot status="fail" size={8} />
|
|
30
|
+
<p class="hyvui-error-title">{title}</p>
|
|
31
|
+
{#if description}
|
|
32
|
+
<p class="hyvui-error-desc">{description}</p>
|
|
33
|
+
{/if}
|
|
34
|
+
{#if retry}
|
|
35
|
+
<div class="hyvui-error-action">
|
|
36
|
+
<Button variant="ghost" onclick={() => onretry?.()}>retry</Button>
|
|
37
|
+
</div>
|
|
38
|
+
{/if}
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
.hyvui-error {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: center;
|
|
46
|
+
text-align: center;
|
|
47
|
+
padding: 2rem;
|
|
48
|
+
gap: 0.75rem;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.hyvui-error-title {
|
|
52
|
+
font-family: var(--font-body);
|
|
53
|
+
font-size: 1.2rem;
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
line-height: 0.93;
|
|
56
|
+
letter-spacing: -0.04em;
|
|
57
|
+
color: var(--text);
|
|
58
|
+
margin: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.hyvui-error-desc {
|
|
62
|
+
font-family: var(--font-body);
|
|
63
|
+
font-size: 0.9rem;
|
|
64
|
+
color: var(--muted);
|
|
65
|
+
line-height: 1.5;
|
|
66
|
+
max-width: 24rem;
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.hyvui-error-action {
|
|
71
|
+
margin-top: 0.5rem;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Error condition title. Describes the condition, not the cause. */
|
|
3
|
+
title?: string;
|
|
4
|
+
/** Additional description text. */
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Shows a retry button. */
|
|
7
|
+
retry?: boolean;
|
|
8
|
+
/** Additional CSS classes. */
|
|
9
|
+
class?: string;
|
|
10
|
+
/** Fires when the retry button is clicked. */
|
|
11
|
+
onretry?: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const ErrorState: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type ErrorState = ReturnType<typeof ErrorState>;
|
|
15
|
+
export default ErrorState;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../utils/cn.js';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
/** Width of the skeleton element. */
|
|
6
|
+
width?: string;
|
|
7
|
+
/** Height of the skeleton element. */
|
|
8
|
+
height?: string;
|
|
9
|
+
/** Shape variant. */
|
|
10
|
+
variant?: 'text' | 'card' | 'circle' | 'custom';
|
|
11
|
+
/** Additional CSS classes. */
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
width = '100%',
|
|
17
|
+
height = '1rem',
|
|
18
|
+
variant = 'text',
|
|
19
|
+
class: className = '',
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
class={cn('hyvui-skeleton', variant === 'circle' && 'hyvui-skeleton-circle', className)}
|
|
25
|
+
style:width={width}
|
|
26
|
+
style:height={height}
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
></div>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
.hyvui-skeleton {
|
|
32
|
+
background: linear-gradient(
|
|
33
|
+
90deg,
|
|
34
|
+
var(--bg-elev) 0%,
|
|
35
|
+
rgba(199, 156, 87, 0.06) 50%,
|
|
36
|
+
var(--bg-elev) 100%
|
|
37
|
+
);
|
|
38
|
+
background-size: 200% 100%;
|
|
39
|
+
animation: shimmer 2s linear infinite;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.hyvui-skeleton-circle {
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (prefers-reduced-motion: reduce) {
|
|
47
|
+
.hyvui-skeleton {
|
|
48
|
+
animation: none;
|
|
49
|
+
background: var(--bg-elev);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Width of the skeleton element. */
|
|
3
|
+
width?: string;
|
|
4
|
+
/** Height of the skeleton element. */
|
|
5
|
+
height?: string;
|
|
6
|
+
/** Shape variant. */
|
|
7
|
+
variant?: 'text' | 'card' | 'circle' | 'custom';
|
|
8
|
+
/** Additional CSS classes. */
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Skeleton: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type Skeleton = ReturnType<typeof Skeleton>;
|
|
13
|
+
export default Skeleton;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../utils/cn.js';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
/** Status state determining the dot color. */
|
|
6
|
+
status?: 'ok' | 'pend' | 'warn' | 'fail';
|
|
7
|
+
/** Enable pulse animation. */
|
|
8
|
+
pulse?: boolean;
|
|
9
|
+
/** Dot diameter in pixels. */
|
|
10
|
+
size?: number;
|
|
11
|
+
/** Additional CSS classes. */
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
status = 'ok',
|
|
17
|
+
pulse = true,
|
|
18
|
+
size = 6,
|
|
19
|
+
class: className = '',
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
|
|
22
|
+
const colorMap: Record<string, string> = {
|
|
23
|
+
ok: 'var(--status-ok)',
|
|
24
|
+
pend: 'var(--status-pend)',
|
|
25
|
+
warn: 'var(--status-warn)',
|
|
26
|
+
fail: 'var(--status-fail)',
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<span
|
|
31
|
+
class={cn('hyvui-status-dot', pulse && 'hyvui-status-dot-pulse', className)}
|
|
32
|
+
style:width="{size}px"
|
|
33
|
+
style:height="{size}px"
|
|
34
|
+
style:background-color={colorMap[status]}
|
|
35
|
+
aria-label="{status} status"
|
|
36
|
+
></span>
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
.hyvui-status-dot {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.hyvui-status-dot-pulse {
|
|
46
|
+
animation: pulse-dot 2s ease-in-out infinite;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@media (prefers-reduced-motion: reduce) {
|
|
50
|
+
.hyvui-status-dot-pulse {
|
|
51
|
+
animation: none;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Status state determining the dot color. */
|
|
3
|
+
status?: 'ok' | 'pend' | 'warn' | 'fail';
|
|
4
|
+
/** Enable pulse animation. */
|
|
5
|
+
pulse?: boolean;
|
|
6
|
+
/** Dot diameter in pixels. */
|
|
7
|
+
size?: number;
|
|
8
|
+
/** Additional CSS classes. */
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const StatusDot: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type StatusDot = ReturnType<typeof StatusDot>;
|
|
13
|
+
export default StatusDot;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../utils/cn.js';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
/** Status determining the glyph and color. */
|
|
6
|
+
status?: 'ok' | 'pend' | 'warn' | 'fail';
|
|
7
|
+
/** Message text displayed after the status glyph. */
|
|
8
|
+
message?: string;
|
|
9
|
+
/** Controls visibility with stagger animation. */
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
/** When true, the full line inherits the status tone. */
|
|
12
|
+
tone?: 'split' | 'line';
|
|
13
|
+
/** Shows a blinking cursor after the message. */
|
|
14
|
+
cursor?: boolean;
|
|
15
|
+
/** Additional CSS classes. */
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
status = 'ok',
|
|
21
|
+
message = '',
|
|
22
|
+
visible = false,
|
|
23
|
+
tone = 'split',
|
|
24
|
+
cursor = false,
|
|
25
|
+
class: className = '',
|
|
26
|
+
}: Props = $props();
|
|
27
|
+
|
|
28
|
+
const glyphMap: Record<string, string> = {
|
|
29
|
+
ok: '[ OK ]',
|
|
30
|
+
pend: '[ .. ]',
|
|
31
|
+
warn: '[WARN]',
|
|
32
|
+
fail: '[FAIL]',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const colorMap: Record<string, string> = {
|
|
36
|
+
ok: 'var(--status-ok)',
|
|
37
|
+
pend: 'var(--status-pend)',
|
|
38
|
+
warn: 'var(--status-warn)',
|
|
39
|
+
fail: 'var(--status-fail)',
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<div
|
|
44
|
+
class={cn(
|
|
45
|
+
'hyvui-status-line',
|
|
46
|
+
visible && 'hyvui-status-line-visible',
|
|
47
|
+
tone === 'line' && 'hyvui-status-line-tone-line',
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
style:color={tone === 'line' ? colorMap[status] : undefined}
|
|
51
|
+
aria-live="polite"
|
|
52
|
+
>
|
|
53
|
+
<span class="hyvui-status-glyph" style:color={tone === 'split' ? colorMap[status] : undefined}>
|
|
54
|
+
{glyphMap[status]}
|
|
55
|
+
</span>
|
|
56
|
+
<span class="hyvui-status-message">{message}</span>
|
|
57
|
+
{#if cursor}
|
|
58
|
+
<span class="hyvui-status-cursor" aria-hidden="true">_</span>
|
|
59
|
+
{/if}
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<style>
|
|
63
|
+
.hyvui-status-line {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: baseline;
|
|
66
|
+
gap: 0.75rem;
|
|
67
|
+
font-family: var(--font-mono);
|
|
68
|
+
font-size: 0.82rem;
|
|
69
|
+
opacity: 0;
|
|
70
|
+
transform: translateY(6px);
|
|
71
|
+
transition:
|
|
72
|
+
opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
|
|
73
|
+
transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.hyvui-status-line-visible {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
transform: translateY(0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.hyvui-status-glyph {
|
|
82
|
+
font-weight: 400;
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.hyvui-status-message {
|
|
88
|
+
color: var(--text-soft);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.hyvui-status-line-tone-line .hyvui-status-message,
|
|
92
|
+
.hyvui-status-line-tone-line .hyvui-status-glyph {
|
|
93
|
+
color: inherit;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.hyvui-status-cursor {
|
|
97
|
+
color: var(--muted-strong);
|
|
98
|
+
animation: blink 1s step-end infinite;
|
|
99
|
+
margin-left: 2px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@keyframes blink {
|
|
103
|
+
50% {
|
|
104
|
+
opacity: 0;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media (prefers-reduced-motion: reduce) {
|
|
109
|
+
.hyvui-status-line {
|
|
110
|
+
transition: none;
|
|
111
|
+
transform: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.hyvui-status-line-visible {
|
|
115
|
+
opacity: 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.hyvui-status-cursor {
|
|
119
|
+
animation: none;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Status determining the glyph and color. */
|
|
3
|
+
status?: 'ok' | 'pend' | 'warn' | 'fail';
|
|
4
|
+
/** Message text displayed after the status glyph. */
|
|
5
|
+
message?: string;
|
|
6
|
+
/** Controls visibility with stagger animation. */
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
/** When true, the full line inherits the status tone. */
|
|
9
|
+
tone?: 'split' | 'line';
|
|
10
|
+
/** Shows a blinking cursor after the message. */
|
|
11
|
+
cursor?: boolean;
|
|
12
|
+
/** Additional CSS classes. */
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const StatusLine: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type StatusLine = ReturnType<typeof StatusLine>;
|
|
17
|
+
export default StatusLine;
|