@hyvnt/hyvui 0.2.0 → 0.3.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 (86) hide show
  1. package/README.md +264 -253
  2. package/dist/components/ambient/CornerBrackets.svelte +83 -87
  3. package/dist/components/ambient/DataStream.svelte +111 -94
  4. package/dist/components/ambient/GlyphMark.svelte +69 -69
  5. package/dist/components/ambient/GridOverlay.svelte +26 -28
  6. package/dist/components/ambient/ParallaxLayer.svelte +37 -41
  7. package/dist/components/ambient/ScanBand.svelte +95 -91
  8. package/dist/components/ambient/SignalRing.svelte +100 -100
  9. package/dist/components/ambient/ThreadLine.svelte +71 -78
  10. package/dist/components/ambient/Vignette.svelte +24 -26
  11. package/dist/components/depth/DepthLayer.svelte +22 -27
  12. package/dist/components/depth/DepthStage.svelte +63 -62
  13. package/dist/components/depth/FloatCard.svelte +113 -104
  14. package/dist/components/depth/HorizonGrid.svelte +216 -160
  15. package/dist/components/depth/Plinth.svelte +52 -57
  16. package/dist/components/display/Avatar.svelte +64 -69
  17. package/dist/components/display/Badge.svelte +59 -63
  18. package/dist/components/display/Blockquote.svelte +31 -34
  19. package/dist/components/display/CodeBlock.svelte +71 -76
  20. package/dist/components/display/MetricCard.svelte +77 -83
  21. package/dist/components/display/Table.svelte +99 -104
  22. package/dist/components/feedback/Alert.svelte +71 -76
  23. package/dist/components/feedback/EmptyState.svelte +68 -68
  24. package/dist/components/feedback/ErrorState.svelte +73 -73
  25. package/dist/components/feedback/Skeleton.svelte +52 -52
  26. package/dist/components/feedback/StatusDot.svelte +49 -54
  27. package/dist/components/feedback/StatusLine.svelte +122 -122
  28. package/dist/components/feedback/Toast.svelte +130 -136
  29. package/dist/components/inputs/Button.svelte +240 -237
  30. package/dist/components/inputs/Checkbox.svelte +104 -105
  31. package/dist/components/inputs/FileUpload.svelte +165 -163
  32. package/dist/components/inputs/Input.svelte +145 -147
  33. package/dist/components/inputs/Select.svelte +156 -150
  34. package/dist/components/inputs/Textarea.svelte +153 -154
  35. package/dist/components/inputs/Toggle.svelte +120 -120
  36. package/dist/components/layout/Card.svelte +70 -76
  37. package/dist/components/layout/Drawer.svelte +133 -109
  38. package/dist/components/layout/Grid.svelte +118 -43
  39. package/dist/components/layout/Grid.svelte.d.ts +8 -2
  40. package/dist/components/layout/Modal.svelte +176 -159
  41. package/dist/components/layout/Panel.svelte +49 -54
  42. package/dist/components/layout/Popover.svelte +178 -67
  43. package/dist/components/layout/Popover.svelte.d.ts +10 -1
  44. package/dist/components/layout/Stack.svelte +53 -53
  45. package/dist/components/navigation/Breadcrumb.svelte +70 -73
  46. package/dist/components/navigation/DropdownMenu.svelte +167 -124
  47. package/dist/components/navigation/DropdownMenu.svelte.d.ts +12 -2
  48. package/dist/components/navigation/SidebarNav.svelte +86 -90
  49. package/dist/components/navigation/Tabs.svelte +81 -86
  50. package/dist/components/navigation/Topbar.svelte +85 -85
  51. package/dist/components/patterns/ActionBar.svelte +71 -76
  52. package/dist/components/patterns/ConfirmDialog.svelte +63 -64
  53. package/dist/components/patterns/PageHeader.svelte +109 -114
  54. package/dist/components/patterns/SearchBar.svelte +54 -59
  55. package/dist/components/patterns/TerminalBoot.svelte +104 -104
  56. package/dist/components/primitives/Divider.svelte +26 -29
  57. package/dist/components/primitives/Icon.svelte +44 -49
  58. package/dist/components/primitives/Label.svelte +39 -44
  59. package/dist/components/primitives/Surface.svelte +89 -87
  60. package/dist/components/primitives/Text.svelte +98 -98
  61. package/dist/components/scenes/ArchiveScene.svelte +92 -95
  62. package/dist/components/scenes/ArchiveScene.svelte.d.ts +7 -1
  63. package/dist/components/scenes/LogScene.svelte +72 -77
  64. package/dist/components/scenes/NarrativeScene.svelte +91 -92
  65. package/dist/components/scenes/ReadoutScene.svelte +120 -107
  66. package/dist/components/scenes/ReadoutScene.svelte.d.ts +3 -1
  67. package/dist/components/scenes/StageScene.svelte +97 -104
  68. package/dist/examples/FieldReport.svelte +226 -223
  69. package/dist/examples/ObservationDeck.svelte +333 -317
  70. package/dist/examples/SignalLost.svelte +191 -191
  71. package/dist/styles.css +113 -0
  72. package/dist/system/actions/echo.js +9 -9
  73. package/dist/system/actions/resolve.js +9 -9
  74. package/dist/system/actions/reveal.js +1 -1
  75. package/dist/system/actions/surface.js +13 -1
  76. package/dist/system/depth/depth.css +49 -49
  77. package/dist/system/depth/depth.js +1 -1
  78. package/dist/system/expressions.css +80 -80
  79. package/dist/system/override-template.css +72 -72
  80. package/dist/system/register.css +74 -74
  81. package/dist/system/scroll-lock.d.ts +6 -0
  82. package/dist/system/scroll-lock.js +23 -0
  83. package/dist/tokens/tokens.css +100 -86
  84. package/dist/tokens/tokens.js +4 -4
  85. package/dist/utils/motion.js +1 -1
  86. package/package.json +67 -60
@@ -1,63 +1,59 @@
1
- <script lang="ts">
2
- import { cn } from '../../utils/cn.js';
3
- import type { Snippet } from 'svelte';
4
-
5
- interface Props {
6
- /** Badge color variant. */
7
- variant?: 'default' | 'accent' | 'signal' | 'ok' | 'warn' | 'fail';
8
- /** Additional CSS classes. */
9
- class?: string;
10
- /** Badge text. */
11
- children?: Snippet;
12
- }
13
-
14
- let {
15
- variant = 'default',
16
- class: className = '',
17
- children,
18
- }: Props = $props();
19
-
20
- const colorMap: Record<string, string> = {
21
- default: 'var(--muted)',
22
- accent: 'var(--accent)',
23
- signal: 'var(--signal)',
24
- ok: 'var(--status-ok)',
25
- warn: 'var(--status-warn)',
26
- fail: 'var(--status-fail)',
27
- };
28
-
29
- const bgMap: Record<string, string> = {
30
- default: 'rgba(167, 157, 139, 0.08)',
31
- accent: 'rgba(199, 156, 87, 0.08)',
32
- signal: 'rgba(121, 166, 163, 0.08)',
33
- ok: 'rgba(121, 166, 163, 0.08)',
34
- warn: 'rgba(199, 156, 87, 0.08)',
35
- fail: 'rgba(182, 106, 72, 0.08)',
36
- };
37
- </script>
38
-
39
- <span
40
- class={cn('hyvui-badge', className)}
41
- style:color={colorMap[variant]}
42
- style:background-color={bgMap[variant]}
43
- style:border-color={colorMap[variant]}
44
- >
45
- {#if children}{@render children()}{/if}
46
- </span>
47
-
48
- <style>
49
- .hyvui-badge {
50
- display: inline-flex;
51
- align-items: center;
52
- font-family: var(--font-mono);
53
- font-size: 0.62rem;
54
- font-weight: 400;
55
- letter-spacing: 0.12em;
56
- text-transform: uppercase;
57
- line-height: 1;
58
- padding: 0.25rem 0.5rem;
59
- border: 1px solid;
60
- border-color: currentColor;
61
- opacity: 0.8;
62
- }
63
- </style>
1
+ <script lang="ts">
2
+ import { cn } from '../../utils/cn.js';
3
+ import type { Snippet } from 'svelte';
4
+
5
+ interface Props {
6
+ /** Badge color variant. */
7
+ variant?: 'default' | 'accent' | 'signal' | 'ok' | 'warn' | 'fail';
8
+ /** Additional CSS classes. */
9
+ class?: string;
10
+ /** Badge text. */
11
+ children?: Snippet;
12
+ }
13
+
14
+ let { variant = 'default', class: className = '', children }: Props = $props();
15
+
16
+ const colorMap: Record<string, string> = {
17
+ default: 'var(--muted)',
18
+ accent: 'var(--accent)',
19
+ signal: 'var(--signal)',
20
+ ok: 'var(--status-ok)',
21
+ warn: 'var(--status-warn)',
22
+ fail: 'var(--status-fail)'
23
+ };
24
+
25
+ const bgMap: Record<string, string> = {
26
+ default: 'rgba(167, 157, 139, 0.08)',
27
+ accent: 'rgba(199, 156, 87, 0.08)',
28
+ signal: 'rgba(121, 166, 163, 0.08)',
29
+ ok: 'rgba(121, 166, 163, 0.08)',
30
+ warn: 'rgba(199, 156, 87, 0.08)',
31
+ fail: 'rgba(182, 106, 72, 0.08)'
32
+ };
33
+ </script>
34
+
35
+ <span
36
+ class={cn('hyvui-badge', className)}
37
+ style:color={colorMap[variant]}
38
+ style:background-color={bgMap[variant]}
39
+ style:border-color={colorMap[variant]}
40
+ >
41
+ {#if children}{@render children()}{/if}
42
+ </span>
43
+
44
+ <style>
45
+ .hyvui-badge {
46
+ display: inline-flex;
47
+ align-items: center;
48
+ font-family: var(--font-mono);
49
+ font-size: 0.62rem;
50
+ font-weight: 400;
51
+ letter-spacing: 0.12em;
52
+ text-transform: uppercase;
53
+ line-height: 1;
54
+ padding: 0.25rem 0.5rem;
55
+ border: 1px solid;
56
+ border-color: currentColor;
57
+ opacity: 0.8;
58
+ }
59
+ </style>
@@ -1,34 +1,31 @@
1
- <script lang="ts">
2
- import { cn } from '../../utils/cn.js';
3
- import type { Snippet } from 'svelte';
4
-
5
- interface Props {
6
- /** Additional CSS classes. */
7
- class?: string;
8
- /** Quote content. */
9
- children?: Snippet;
10
- }
11
-
12
- let {
13
- class: className = '',
14
- children,
15
- }: Props = $props();
16
- </script>
17
-
18
- <blockquote class={cn('hyvui-blockquote', className)}>
19
- {#if children}{@render children()}{/if}
20
- </blockquote>
21
-
22
- <style>
23
- .hyvui-blockquote {
24
- font-family: var(--font-body);
25
- font-style: italic;
26
- font-weight: 400;
27
- color: var(--text-soft);
28
- line-height: 1.6;
29
- margin: 0;
30
- padding: 1rem 1.25rem;
31
- border-left: 2px solid var(--line-strong);
32
- background: linear-gradient(135deg, rgba(199, 156, 87, 0.06), transparent 60%);
33
- }
34
- </style>
1
+ <script lang="ts">
2
+ import { cn } from '../../utils/cn.js';
3
+ import type { Snippet } from 'svelte';
4
+
5
+ interface Props {
6
+ /** Additional CSS classes. */
7
+ class?: string;
8
+ /** Quote content. */
9
+ children?: Snippet;
10
+ }
11
+
12
+ let { class: className = '', children }: Props = $props();
13
+ </script>
14
+
15
+ <blockquote class={cn('hyvui-blockquote', className)}>
16
+ {#if children}{@render children()}{/if}
17
+ </blockquote>
18
+
19
+ <style>
20
+ .hyvui-blockquote {
21
+ font-family: var(--font-body);
22
+ font-style: italic;
23
+ font-weight: 400;
24
+ color: var(--text-soft);
25
+ line-height: 1.6;
26
+ margin: 0;
27
+ padding: 1rem 1.25rem;
28
+ border-left: 2px solid var(--line-strong);
29
+ background: linear-gradient(135deg, rgba(199, 156, 87, 0.06), transparent 60%);
30
+ }
31
+ </style>
@@ -1,76 +1,71 @@
1
- <script lang="ts">
2
- import { cn } from '../../utils/cn.js';
3
- import Button from '../inputs/Button.svelte';
4
-
5
- interface Props {
6
- /** Code string to display. */
7
- code?: string;
8
- /** Language label (informational only, no syntax highlighting built-in). */
9
- language?: string;
10
- /** Show copy-to-clipboard button. */
11
- copyable?: boolean;
12
- /** Additional CSS classes. */
13
- class?: string;
14
- }
15
-
16
- let {
17
- code = '',
18
- language = '',
19
- copyable = true,
20
- class: className = '',
21
- }: Props = $props();
22
-
23
- let copied = $state(false);
24
-
25
- async function copyCode() {
26
- try {
27
- await navigator.clipboard.writeText(code);
28
- copied = true;
29
- setTimeout(() => {
30
- copied = false;
31
- }, 2000);
32
- } catch {
33
- // clipboard access denied
34
- }
35
- }
36
- </script>
37
-
38
- <div class={cn('hyvui-codeblock', className)}>
39
- {#if copyable}
40
- <div class="hyvui-codeblock-actions">
41
- <Button variant="ghost" size="sm" onclick={copyCode}>
42
- {copied ? 'copied' : 'copy'}
43
- </Button>
44
- </div>
45
- {/if}
46
- <pre class="hyvui-codeblock-pre"><code class="hyvui-codeblock-code">{code}</code></pre>
47
- </div>
48
-
49
- <style>
50
- .hyvui-codeblock {
51
- position: relative;
52
- background-color: var(--bg-elev);
53
- border: 1px solid var(--line);
54
- overflow: hidden;
55
- }
56
-
57
- .hyvui-codeblock-actions {
58
- position: absolute;
59
- top: 0.375rem;
60
- right: 0.375rem;
61
- z-index: 1;
62
- }
63
-
64
- .hyvui-codeblock-pre {
65
- margin: 0;
66
- padding: 1rem;
67
- overflow-x: auto;
68
- }
69
-
70
- .hyvui-codeblock-code {
71
- font-family: var(--font-mono);
72
- font-size: 0.82rem;
73
- color: var(--text-soft);
74
- line-height: 1.6;
75
- }
76
- </style>
1
+ <script lang="ts">
2
+ import { cn } from '../../utils/cn.js';
3
+ import Button from '../inputs/Button.svelte';
4
+
5
+ interface Props {
6
+ /** Code string to display. */
7
+ code?: string;
8
+ /** Language label (informational only, no syntax highlighting built-in). */
9
+ language?: string;
10
+ /** Show copy-to-clipboard button. */
11
+ copyable?: boolean;
12
+ /** Additional CSS classes. */
13
+ class?: string;
14
+ }
15
+
16
+ let { code = '', language = '', copyable = true, class: className = '' }: Props = $props();
17
+
18
+ let copied = $state(false);
19
+
20
+ async function copyCode() {
21
+ try {
22
+ await navigator.clipboard.writeText(code);
23
+ copied = true;
24
+ setTimeout(() => {
25
+ copied = false;
26
+ }, 2000);
27
+ } catch {
28
+ // clipboard access denied
29
+ }
30
+ }
31
+ </script>
32
+
33
+ <div class={cn('hyvui-codeblock', className)}>
34
+ {#if copyable}
35
+ <div class="hyvui-codeblock-actions">
36
+ <Button variant="ghost" size="sm" onclick={copyCode}>
37
+ {copied ? 'copied' : 'copy'}
38
+ </Button>
39
+ </div>
40
+ {/if}
41
+ <pre class="hyvui-codeblock-pre"><code class="hyvui-codeblock-code">{code}</code></pre>
42
+ </div>
43
+
44
+ <style>
45
+ .hyvui-codeblock {
46
+ position: relative;
47
+ background-color: var(--bg-elev);
48
+ border: 1px solid var(--line);
49
+ overflow: hidden;
50
+ }
51
+
52
+ .hyvui-codeblock-actions {
53
+ position: absolute;
54
+ top: 0.375rem;
55
+ right: 0.375rem;
56
+ z-index: 1;
57
+ }
58
+
59
+ .hyvui-codeblock-pre {
60
+ margin: 0;
61
+ padding: 1rem;
62
+ overflow-x: auto;
63
+ }
64
+
65
+ .hyvui-codeblock-code {
66
+ font-family: var(--font-mono);
67
+ font-size: 0.82rem;
68
+ color: var(--text-soft);
69
+ line-height: 1.6;
70
+ }
71
+ </style>
@@ -1,83 +1,77 @@
1
- <script lang="ts">
2
- import { cn } from '../../utils/cn.js';
3
- import Surface from '../primitives/Surface.svelte';
4
-
5
- interface Props {
6
- /** Metric label. */
7
- label?: string;
8
- /** Metric value. */
9
- value?: string | number;
10
- /** Trend direction. */
11
- trend?: 'up' | 'down' | 'neutral';
12
- /** Trend value string (e.g. "+12%"). */
13
- trendValue?: string;
14
- /** Additional CSS classes. */
15
- class?: string;
16
- }
17
-
18
- let {
19
- label = '',
20
- value = '',
21
- trend,
22
- trendValue = '',
23
- class: className = '',
24
- }: Props = $props();
25
-
26
- const trendArrow: Record<string, string> = {
27
- up: '\u2191',
28
- down: '\u2193',
29
- neutral: '\u2014',
30
- };
31
-
32
- const trendColor: Record<string, string> = {
33
- up: 'var(--status-ok)',
34
- down: 'var(--status-fail)',
35
- neutral: 'var(--muted)',
36
- };
37
- </script>
38
-
39
- <Surface variant="card" class={cn('hyvui-metric', className)}>
40
- <span class="hyvui-metric-label">{label}</span>
41
- <span class="hyvui-metric-value">{value}</span>
42
- {#if trend}
43
- <span class="hyvui-metric-trend" style:color={trendColor[trend]}>
44
- {trendArrow[trend]}{#if trendValue}{' '}{trendValue}{/if}
45
- </span>
46
- {/if}
47
- </Surface>
48
-
49
- <style>
50
- :global(.hyvui-metric) {
51
- padding: var(--space-card);
52
- display: flex;
53
- flex-direction: column;
54
- gap: var(--space-sm);
55
- }
56
-
57
- .hyvui-metric-label {
58
- font-family: var(--font-mono);
59
- font-size: 0.68rem;
60
- font-weight: 400;
61
- letter-spacing: 0.16em;
62
- text-transform: uppercase;
63
- color: var(--muted-strong);
64
- line-height: 1.2;
65
- }
66
-
67
- .hyvui-metric-value {
68
- font-family: var(--font-body);
69
- font-size: clamp(2rem, 5vw, 3rem);
70
- font-weight: 400;
71
- line-height: 0.95;
72
- letter-spacing: -0.05em;
73
- color: var(--text);
74
- }
75
-
76
- .hyvui-metric-trend {
77
- font-family: var(--font-mono);
78
- font-size: 0.72rem;
79
- font-weight: 400;
80
- letter-spacing: 0.12em;
81
- text-transform: uppercase;
82
- }
83
- </style>
1
+ <script lang="ts">
2
+ import { cn } from '../../utils/cn.js';
3
+ import Surface from '../primitives/Surface.svelte';
4
+
5
+ interface Props {
6
+ /** Metric label. */
7
+ label?: string;
8
+ /** Metric value. */
9
+ value?: string | number;
10
+ /** Trend direction. */
11
+ trend?: 'up' | 'down' | 'neutral';
12
+ /** Trend value string (e.g. "+12%"). */
13
+ trendValue?: string;
14
+ /** Additional CSS classes. */
15
+ class?: string;
16
+ }
17
+
18
+ let { label = '', value = '', trend, trendValue = '', class: className = '' }: Props = $props();
19
+
20
+ const trendArrow: Record<string, string> = {
21
+ up: '\u2191',
22
+ down: '\u2193',
23
+ neutral: '\u2014'
24
+ };
25
+
26
+ const trendColor: Record<string, string> = {
27
+ up: 'var(--status-ok)',
28
+ down: 'var(--status-fail)',
29
+ neutral: 'var(--muted)'
30
+ };
31
+ </script>
32
+
33
+ <Surface variant="card" class={cn('hyvui-metric', className)}>
34
+ <span class="hyvui-metric-label">{label}</span>
35
+ <span class="hyvui-metric-value">{value}</span>
36
+ {#if trend}
37
+ <span class="hyvui-metric-trend" style:color={trendColor[trend]}>
38
+ {trendArrow[trend]}{#if trendValue}{' '}{trendValue}{/if}
39
+ </span>
40
+ {/if}
41
+ </Surface>
42
+
43
+ <style>
44
+ :global(.hyvui-metric) {
45
+ padding: var(--space-card);
46
+ display: flex;
47
+ flex-direction: column;
48
+ gap: var(--space-sm);
49
+ }
50
+
51
+ .hyvui-metric-label {
52
+ font-family: var(--font-mono);
53
+ font-size: 0.68rem;
54
+ font-weight: 400;
55
+ letter-spacing: 0.16em;
56
+ text-transform: uppercase;
57
+ color: var(--muted-strong);
58
+ line-height: 1.2;
59
+ }
60
+
61
+ .hyvui-metric-value {
62
+ font-family: var(--font-body);
63
+ font-size: clamp(2rem, 5vw, 3rem);
64
+ font-weight: 400;
65
+ line-height: 0.95;
66
+ letter-spacing: -0.05em;
67
+ color: var(--text);
68
+ }
69
+
70
+ .hyvui-metric-trend {
71
+ font-family: var(--font-mono);
72
+ font-size: 0.72rem;
73
+ font-weight: 400;
74
+ letter-spacing: 0.12em;
75
+ text-transform: uppercase;
76
+ }
77
+ </style>