@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,105 +1,104 @@
1
- <script lang="ts">
2
- import { cn } from '../../utils/cn.js';
3
-
4
- interface Props {
5
- /** Whether the checkbox is checked (bindable). */
6
- checked?: boolean;
7
- /** Label text. */
8
- label?: string;
9
- /** Disables the checkbox. */
10
- disabled?: boolean;
11
- /** Additional CSS classes. */
12
- class?: string;
13
- /** Change handler. */
14
- onchange?: (e: Event) => void;
15
- }
16
-
17
- let {
18
- checked = $bindable(false),
19
- label = '',
20
- disabled = false,
21
- class: className = '',
22
- onchange,
23
- }: Props = $props();
24
- </script>
25
-
26
- <label class={cn('hyvui-checkbox', disabled && 'hyvui-checkbox-disabled', className)}>
27
- <input
28
- type="checkbox"
29
- bind:checked
30
- {disabled}
31
- class="hyvui-checkbox-input"
32
- {onchange}
33
- />
34
- <span class="hyvui-checkbox-box" class:hyvui-checkbox-checked={checked}>
35
- {#if checked}
36
- <svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
37
- <path d="M2 5.5L4 7.5L8 3" stroke="var(--bg)" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
38
- </svg>
39
- {/if}
40
- </span>
41
- {#if label}
42
- <span class="hyvui-checkbox-label">{label}</span>
43
- {/if}
44
- </label>
45
-
46
- <style>
47
- .hyvui-checkbox {
48
- display: inline-flex;
49
- align-items: flex-start;
50
- gap: var(--space-sm);
51
- cursor: pointer;
52
- min-width: 0;
53
- }
54
-
55
- .hyvui-checkbox-disabled {
56
- opacity: 0.4;
57
- cursor: not-allowed;
58
- }
59
-
60
- .hyvui-checkbox-input {
61
- position: absolute;
62
- opacity: 0;
63
- width: 0;
64
- height: 0;
65
- pointer-events: none;
66
- }
67
-
68
- .hyvui-checkbox-box {
69
- width: 16px;
70
- height: 16px;
71
- margin-top: 0.1rem;
72
- border: 1px solid var(--line-strong);
73
- border-radius: var(--radius-sm);
74
- background:
75
- linear-gradient(180deg, rgba(240, 232, 218, 0.02), transparent 48%),
76
- var(--bg-elev);
77
- display: inline-flex;
78
- align-items: center;
79
- justify-content: center;
80
- flex-shrink: 0;
81
- transition:
82
- background-color var(--transition-fast),
83
- border-color var(--transition-fast),
84
- box-shadow var(--transition-fast);
85
- box-shadow: inset 0 1px 0 rgba(240, 232, 218, 0.03);
86
- }
87
-
88
- .hyvui-checkbox-checked {
89
- background-color: var(--accent);
90
- border-color: var(--accent);
91
- }
92
-
93
- .hyvui-checkbox-label {
94
- font-family: var(--font-body);
95
- font-size: 0.98rem;
96
- color: var(--text-soft);
97
- line-height: 1.5;
98
- }
99
-
100
- @media (prefers-reduced-motion: reduce) {
101
- .hyvui-checkbox-box {
102
- transition: none;
103
- }
104
- }
105
- </style>
1
+ <script lang="ts">
2
+ import { cn } from '../../utils/cn.js';
3
+
4
+ interface Props {
5
+ /** Whether the checkbox is checked (bindable). */
6
+ checked?: boolean;
7
+ /** Label text. */
8
+ label?: string;
9
+ /** Disables the checkbox. */
10
+ disabled?: boolean;
11
+ /** Additional CSS classes. */
12
+ class?: string;
13
+ /** Change handler. */
14
+ onchange?: (e: Event) => void;
15
+ }
16
+
17
+ let {
18
+ checked = $bindable(false),
19
+ label = '',
20
+ disabled = false,
21
+ class: className = '',
22
+ onchange
23
+ }: Props = $props();
24
+ </script>
25
+
26
+ <label class={cn('hyvui-checkbox', disabled && 'hyvui-checkbox-disabled', className)}>
27
+ <input type="checkbox" bind:checked {disabled} class="hyvui-checkbox-input" {onchange} />
28
+ <span class="hyvui-checkbox-box" class:hyvui-checkbox-checked={checked}>
29
+ {#if checked}
30
+ <svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
31
+ <path
32
+ d="M2 5.5L4 7.5L8 3"
33
+ stroke="var(--bg)"
34
+ stroke-width="1.5"
35
+ fill="none"
36
+ stroke-linecap="round"
37
+ stroke-linejoin="round"
38
+ />
39
+ </svg>
40
+ {/if}
41
+ </span>
42
+ {#if label}
43
+ <span class="hyvui-checkbox-label">{label}</span>
44
+ {/if}
45
+ </label>
46
+
47
+ <style>
48
+ .hyvui-checkbox {
49
+ display: inline-flex;
50
+ align-items: flex-start;
51
+ gap: var(--space-sm);
52
+ cursor: pointer;
53
+ min-width: 0;
54
+ }
55
+
56
+ .hyvui-checkbox-disabled {
57
+ opacity: 0.4;
58
+ cursor: not-allowed;
59
+ }
60
+
61
+ .hyvui-checkbox-input {
62
+ position: absolute;
63
+ opacity: 0;
64
+ width: 0;
65
+ height: 0;
66
+ pointer-events: none;
67
+ }
68
+
69
+ .hyvui-checkbox-box {
70
+ width: 16px;
71
+ height: 16px;
72
+ margin-top: 0.1rem;
73
+ border: 1px solid var(--line-strong);
74
+ border-radius: var(--radius-sm);
75
+ background: linear-gradient(180deg, rgba(240, 232, 218, 0.02), transparent 48%), var(--bg-elev);
76
+ display: inline-flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ flex-shrink: 0;
80
+ transition:
81
+ background-color var(--transition-fast),
82
+ border-color var(--transition-fast),
83
+ box-shadow var(--transition-fast);
84
+ box-shadow: inset 0 1px 0 rgba(240, 232, 218, 0.03);
85
+ }
86
+
87
+ .hyvui-checkbox-checked {
88
+ background-color: var(--accent);
89
+ border-color: var(--accent);
90
+ }
91
+
92
+ .hyvui-checkbox-label {
93
+ font-family: var(--font-body);
94
+ font-size: 0.98rem;
95
+ color: var(--text-soft);
96
+ line-height: 1.5;
97
+ }
98
+
99
+ @media (prefers-reduced-motion: reduce) {
100
+ .hyvui-checkbox-box {
101
+ transition: none;
102
+ }
103
+ }
104
+ </style>
@@ -1,163 +1,165 @@
1
- <script lang="ts">
2
- import { cn } from '../../utils/cn.js';
3
-
4
- interface Props {
5
- /** Accepted file types (e.g. "image/*"). */
6
- accept?: string;
7
- /** Allow multiple file selection. */
8
- multiple?: boolean;
9
- /** Disables the upload zone. */
10
- disabled?: boolean;
11
- /** Label text displayed in the zone. */
12
- label?: string;
13
- /** Additional CSS classes. */
14
- class?: string;
15
- /** Fires with the selected files. */
16
- onfiles?: (files: File[]) => void;
17
- }
18
-
19
- let {
20
- accept = '',
21
- multiple = false,
22
- disabled = false,
23
- label = 'drop files here or click to browse',
24
- class: className = '',
25
- onfiles,
26
- }: Props = $props();
27
-
28
- let dragging = $state(false);
29
- let fileNames = $state<string[]>([]);
30
- let inputEl: HTMLInputElement | undefined = $state();
31
-
32
- function handleFiles(fileList: FileList | null) {
33
- if (!fileList) return;
34
- const files = Array.from(fileList);
35
- fileNames = files.map((f) => f.name);
36
- onfiles?.(files);
37
- }
38
-
39
- function onDrop(e: DragEvent) {
40
- e.preventDefault();
41
- dragging = false;
42
- if (disabled) return;
43
- handleFiles(e.dataTransfer?.files ?? null);
44
- }
45
-
46
- function onDragOver(e: DragEvent) {
47
- e.preventDefault();
48
- if (!disabled) dragging = true;
49
- }
50
-
51
- function onDragLeave() {
52
- dragging = false;
53
- }
54
-
55
- function onClick() {
56
- if (!disabled) inputEl?.click();
57
- }
58
-
59
- function onInputChange(e: Event) {
60
- const target = e.target as HTMLInputElement;
61
- handleFiles(target.files);
62
- }
63
- </script>
64
-
65
- <div class={cn('hyvui-file-upload', className)}>
66
- <button
67
- type="button"
68
- class={cn(
69
- 'hyvui-file-zone',
70
- dragging && 'hyvui-file-zone-active',
71
- disabled && 'hyvui-file-zone-disabled'
72
- )}
73
- ondrop={onDrop}
74
- ondragover={onDragOver}
75
- ondragleave={onDragLeave}
76
- onclick={onClick}
77
- {disabled}
78
- >
79
- <span class="hyvui-file-label">{label}</span>
80
- </button>
81
- <input
82
- bind:this={inputEl}
83
- type="file"
84
- {accept}
85
- {multiple}
86
- class="hyvui-file-input"
87
- onchange={onInputChange}
88
- tabindex="-1"
89
- />
90
- {#if fileNames.length > 0}
91
- <div class="hyvui-file-names">
92
- {#each fileNames as name}
93
- <span class="hyvui-file-name">{name}</span>
94
- {/each}
95
- </div>
96
- {/if}
97
- </div>
98
-
99
- <style>
100
- .hyvui-file-upload {
101
- display: flex;
102
- flex-direction: column;
103
- gap: 0.5rem;
104
- }
105
-
106
- .hyvui-file-zone {
107
- border: 1px dashed var(--line);
108
- background: transparent;
109
- padding: 2rem;
110
- display: flex;
111
- align-items: center;
112
- justify-content: center;
113
- cursor: pointer;
114
- transition: border-color var(--transition-fast), background-color var(--transition-fast);
115
- width: 100%;
116
- }
117
-
118
- .hyvui-file-zone:hover:not(:disabled),
119
- .hyvui-file-zone-active {
120
- border-color: var(--line-strong);
121
- background-color: rgba(199, 156, 87, 0.04);
122
- }
123
-
124
- .hyvui-file-zone-disabled {
125
- opacity: 0.4;
126
- cursor: not-allowed;
127
- }
128
-
129
- .hyvui-file-label {
130
- font-family: var(--font-mono);
131
- font-size: 0.75rem;
132
- color: var(--muted);
133
- letter-spacing: 0.08em;
134
- }
135
-
136
- .hyvui-file-input {
137
- position: absolute;
138
- width: 0;
139
- height: 0;
140
- opacity: 0;
141
- pointer-events: none;
142
- }
143
-
144
- .hyvui-file-names {
145
- display: flex;
146
- flex-wrap: wrap;
147
- gap: 0.375rem;
148
- }
149
-
150
- .hyvui-file-name {
151
- font-family: var(--font-mono);
152
- font-size: 0.68rem;
153
- letter-spacing: 0.14em;
154
- text-transform: uppercase;
155
- color: var(--muted-strong);
156
- }
157
-
158
- @media (prefers-reduced-motion: reduce) {
159
- .hyvui-file-zone {
160
- transition: none;
161
- }
162
- }
163
- </style>
1
+ <script lang="ts">
2
+ import { cn } from '../../utils/cn.js';
3
+
4
+ interface Props {
5
+ /** Accepted file types (e.g. "image/*"). */
6
+ accept?: string;
7
+ /** Allow multiple file selection. */
8
+ multiple?: boolean;
9
+ /** Disables the upload zone. */
10
+ disabled?: boolean;
11
+ /** Label text displayed in the zone. */
12
+ label?: string;
13
+ /** Additional CSS classes. */
14
+ class?: string;
15
+ /** Fires with the selected files. */
16
+ onfiles?: (files: File[]) => void;
17
+ }
18
+
19
+ let {
20
+ accept = '',
21
+ multiple = false,
22
+ disabled = false,
23
+ label = 'drop files here or click to browse',
24
+ class: className = '',
25
+ onfiles
26
+ }: Props = $props();
27
+
28
+ let dragging = $state(false);
29
+ let fileNames = $state<string[]>([]);
30
+ let inputEl: HTMLInputElement | undefined = $state();
31
+
32
+ function handleFiles(fileList: FileList | null) {
33
+ if (!fileList) return;
34
+ const files = Array.from(fileList);
35
+ fileNames = files.map((f) => f.name);
36
+ onfiles?.(files);
37
+ }
38
+
39
+ function onDrop(e: DragEvent) {
40
+ e.preventDefault();
41
+ dragging = false;
42
+ if (disabled) return;
43
+ handleFiles(e.dataTransfer?.files ?? null);
44
+ }
45
+
46
+ function onDragOver(e: DragEvent) {
47
+ e.preventDefault();
48
+ if (!disabled) dragging = true;
49
+ }
50
+
51
+ function onDragLeave() {
52
+ dragging = false;
53
+ }
54
+
55
+ function onClick() {
56
+ if (!disabled) inputEl?.click();
57
+ }
58
+
59
+ function onInputChange(e: Event) {
60
+ const target = e.target as HTMLInputElement;
61
+ handleFiles(target.files);
62
+ }
63
+ </script>
64
+
65
+ <div class={cn('hyvui-file-upload', className)}>
66
+ <button
67
+ type="button"
68
+ class={cn(
69
+ 'hyvui-file-zone',
70
+ dragging && 'hyvui-file-zone-active',
71
+ disabled && 'hyvui-file-zone-disabled'
72
+ )}
73
+ ondrop={onDrop}
74
+ ondragover={onDragOver}
75
+ ondragleave={onDragLeave}
76
+ onclick={onClick}
77
+ {disabled}
78
+ >
79
+ <span class="hyvui-file-label">{label}</span>
80
+ </button>
81
+ <input
82
+ bind:this={inputEl}
83
+ type="file"
84
+ {accept}
85
+ {multiple}
86
+ class="hyvui-file-input"
87
+ onchange={onInputChange}
88
+ tabindex="-1"
89
+ />
90
+ {#if fileNames.length > 0}
91
+ <div class="hyvui-file-names">
92
+ {#each fileNames as name}
93
+ <span class="hyvui-file-name">{name}</span>
94
+ {/each}
95
+ </div>
96
+ {/if}
97
+ </div>
98
+
99
+ <style>
100
+ .hyvui-file-upload {
101
+ display: flex;
102
+ flex-direction: column;
103
+ gap: 0.5rem;
104
+ }
105
+
106
+ .hyvui-file-zone {
107
+ border: 1px dashed var(--line);
108
+ background: transparent;
109
+ padding: 2rem;
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ cursor: pointer;
114
+ transition:
115
+ border-color var(--transition-fast),
116
+ background-color var(--transition-fast);
117
+ width: 100%;
118
+ }
119
+
120
+ .hyvui-file-zone:hover:not(:disabled),
121
+ .hyvui-file-zone-active {
122
+ border-color: var(--line-strong);
123
+ background-color: rgba(199, 156, 87, 0.04);
124
+ }
125
+
126
+ .hyvui-file-zone-disabled {
127
+ opacity: 0.4;
128
+ cursor: not-allowed;
129
+ }
130
+
131
+ .hyvui-file-label {
132
+ font-family: var(--font-mono);
133
+ font-size: 0.75rem;
134
+ color: var(--muted);
135
+ letter-spacing: 0.08em;
136
+ }
137
+
138
+ .hyvui-file-input {
139
+ position: absolute;
140
+ width: 0;
141
+ height: 0;
142
+ opacity: 0;
143
+ pointer-events: none;
144
+ }
145
+
146
+ .hyvui-file-names {
147
+ display: flex;
148
+ flex-wrap: wrap;
149
+ gap: 0.375rem;
150
+ }
151
+
152
+ .hyvui-file-name {
153
+ font-family: var(--font-mono);
154
+ font-size: 0.68rem;
155
+ letter-spacing: 0.14em;
156
+ text-transform: uppercase;
157
+ color: var(--muted-strong);
158
+ }
159
+
160
+ @media (prefers-reduced-motion: reduce) {
161
+ .hyvui-file-zone {
162
+ transition: none;
163
+ }
164
+ }
165
+ </style>