@hyvnt/hyvui 0.3.0 → 0.4.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 (170) hide show
  1. package/README.md +37 -7
  2. package/dist/components/ambient/ArcaneVein.svelte +151 -0
  3. package/dist/components/ambient/ArcaneVein.svelte.d.ts +31 -0
  4. package/dist/components/ambient/BrassFiligree.svelte +109 -0
  5. package/dist/components/ambient/BrassFiligree.svelte.d.ts +20 -0
  6. package/dist/components/ambient/CornerBrackets.svelte +8 -0
  7. package/dist/components/ambient/CornerBrackets.svelte.d.ts +8 -0
  8. package/dist/components/ambient/CrystalShard.svelte +151 -0
  9. package/dist/components/ambient/CrystalShard.svelte.d.ts +19 -0
  10. package/dist/components/ambient/DataStream.svelte +7 -1
  11. package/dist/components/ambient/DataStream.svelte.d.ts +6 -0
  12. package/dist/components/ambient/EnergyArc.svelte +189 -0
  13. package/dist/components/ambient/EnergyArc.svelte.d.ts +32 -0
  14. package/dist/components/ambient/GlyphMark.svelte +6 -0
  15. package/dist/components/ambient/GlyphMark.svelte.d.ts +6 -0
  16. package/dist/components/ambient/GridOverlay.svelte +8 -0
  17. package/dist/components/ambient/GridOverlay.svelte.d.ts +8 -0
  18. package/dist/components/ambient/HexGrid.svelte +119 -0
  19. package/dist/components/ambient/HexGrid.svelte.d.ts +21 -0
  20. package/dist/components/ambient/ParallaxLayer.svelte +9 -1
  21. package/dist/components/ambient/ParallaxLayer.svelte.d.ts +7 -0
  22. package/dist/components/ambient/ScanBand.svelte +8 -0
  23. package/dist/components/ambient/ScanBand.svelte.d.ts +8 -0
  24. package/dist/components/ambient/ShimmerCloud.svelte +180 -0
  25. package/dist/components/ambient/ShimmerCloud.svelte.d.ts +21 -0
  26. package/dist/components/ambient/SignalRing.svelte +7 -1
  27. package/dist/components/ambient/SignalRing.svelte.d.ts +6 -0
  28. package/dist/components/ambient/ThreadLine.svelte +7 -0
  29. package/dist/components/ambient/ThreadLine.svelte.d.ts +7 -0
  30. package/dist/components/ambient/Vignette.svelte +6 -0
  31. package/dist/components/ambient/Vignette.svelte.d.ts +6 -0
  32. package/dist/components/depth/DepthLayer.svelte +8 -0
  33. package/dist/components/depth/DepthLayer.svelte.d.ts +8 -0
  34. package/dist/components/depth/DepthStage.svelte +8 -4
  35. package/dist/components/depth/DepthStage.svelte.d.ts +8 -0
  36. package/dist/components/depth/FloatCard.svelte +17 -1
  37. package/dist/components/depth/FloatCard.svelte.d.ts +8 -0
  38. package/dist/components/depth/HorizonGrid.svelte +25 -0
  39. package/dist/components/depth/HorizonGrid.svelte.d.ts +9 -0
  40. package/dist/components/depth/Plinth.svelte +10 -0
  41. package/dist/components/depth/Plinth.svelte.d.ts +10 -0
  42. package/dist/components/display/Avatar.svelte +5 -0
  43. package/dist/components/display/Avatar.svelte.d.ts +5 -0
  44. package/dist/components/display/Badge.svelte +16 -0
  45. package/dist/components/display/Badge.svelte.d.ts +6 -0
  46. package/dist/components/display/Blockquote.svelte +4 -0
  47. package/dist/components/display/Blockquote.svelte.d.ts +4 -0
  48. package/dist/components/display/CodeBlock.svelte +5 -0
  49. package/dist/components/display/CodeBlock.svelte.d.ts +5 -0
  50. package/dist/components/display/MetricCard.svelte +23 -0
  51. package/dist/components/display/MetricCard.svelte.d.ts +6 -0
  52. package/dist/components/display/Table.svelte +7 -0
  53. package/dist/components/display/Table.svelte.d.ts +7 -0
  54. package/dist/components/feedback/Alert.svelte +24 -0
  55. package/dist/components/feedback/Alert.svelte.d.ts +6 -0
  56. package/dist/components/feedback/EmptyState.svelte +7 -0
  57. package/dist/components/feedback/EmptyState.svelte.d.ts +7 -0
  58. package/dist/components/feedback/ErrorState.svelte +5 -0
  59. package/dist/components/feedback/ErrorState.svelte.d.ts +5 -0
  60. package/dist/components/feedback/Skeleton.svelte +6 -0
  61. package/dist/components/feedback/Skeleton.svelte.d.ts +6 -0
  62. package/dist/components/feedback/StatusDot.svelte +36 -1
  63. package/dist/components/feedback/StatusDot.svelte.d.ts +6 -0
  64. package/dist/components/feedback/StatusLine.svelte +8 -2
  65. package/dist/components/feedback/StatusLine.svelte.d.ts +6 -0
  66. package/dist/components/feedback/Toast.svelte +16 -2
  67. package/dist/components/feedback/Toast.svelte.d.ts +10 -0
  68. package/dist/components/inputs/Button.svelte +74 -4
  69. package/dist/components/inputs/Button.svelte.d.ts +8 -0
  70. package/dist/components/inputs/Checkbox.svelte +5 -0
  71. package/dist/components/inputs/Checkbox.svelte.d.ts +5 -0
  72. package/dist/components/inputs/FileUpload.svelte +5 -0
  73. package/dist/components/inputs/FileUpload.svelte.d.ts +5 -0
  74. package/dist/components/inputs/Input.svelte +10 -2
  75. package/dist/components/inputs/Input.svelte.d.ts +7 -0
  76. package/dist/components/inputs/Select.svelte +8 -0
  77. package/dist/components/inputs/Select.svelte.d.ts +8 -0
  78. package/dist/components/inputs/Textarea.svelte +9 -2
  79. package/dist/components/inputs/Textarea.svelte.d.ts +6 -0
  80. package/dist/components/inputs/Toggle.svelte +6 -1
  81. package/dist/components/inputs/Toggle.svelte.d.ts +5 -0
  82. package/dist/components/layout/Card.svelte +11 -0
  83. package/dist/components/layout/Card.svelte.d.ts +11 -0
  84. package/dist/components/layout/Drawer.svelte +7 -0
  85. package/dist/components/layout/Drawer.svelte.d.ts +6 -0
  86. package/dist/components/layout/Grid.svelte +10 -0
  87. package/dist/components/layout/Grid.svelte.d.ts +10 -0
  88. package/dist/components/layout/Modal.svelte +15 -0
  89. package/dist/components/layout/Modal.svelte.d.ts +10 -0
  90. package/dist/components/layout/Panel.svelte +9 -0
  91. package/dist/components/layout/Panel.svelte.d.ts +9 -0
  92. package/dist/components/layout/Popover.svelte +10 -0
  93. package/dist/components/layout/Popover.svelte.d.ts +9 -0
  94. package/dist/components/layout/Stack.svelte +12 -0
  95. package/dist/components/layout/Stack.svelte.d.ts +12 -0
  96. package/dist/components/navigation/Breadcrumb.svelte +8 -0
  97. package/dist/components/navigation/Breadcrumb.svelte.d.ts +8 -0
  98. package/dist/components/navigation/DropdownMenu.svelte +12 -0
  99. package/dist/components/navigation/DropdownMenu.svelte.d.ts +12 -0
  100. package/dist/components/navigation/SidebarNav.svelte +10 -0
  101. package/dist/components/navigation/SidebarNav.svelte.d.ts +9 -0
  102. package/dist/components/navigation/Tabs.svelte +26 -1
  103. package/dist/components/navigation/Tabs.svelte.d.ts +8 -0
  104. package/dist/components/navigation/Topbar.svelte +9 -0
  105. package/dist/components/navigation/Topbar.svelte.d.ts +9 -0
  106. package/dist/components/patterns/ActionBar.svelte +11 -0
  107. package/dist/components/patterns/ActionBar.svelte.d.ts +10 -0
  108. package/dist/components/patterns/ChapterMark.svelte +152 -0
  109. package/dist/components/patterns/ChapterMark.svelte.d.ts +19 -0
  110. package/dist/components/patterns/ConfirmDialog.svelte +12 -0
  111. package/dist/components/patterns/ConfirmDialog.svelte.d.ts +12 -0
  112. package/dist/components/patterns/DepthPortal.svelte +123 -0
  113. package/dist/components/patterns/DepthPortal.svelte.d.ts +24 -0
  114. package/dist/components/patterns/Manifesto.svelte +171 -0
  115. package/dist/components/patterns/Manifesto.svelte.d.ts +25 -0
  116. package/dist/components/patterns/PageHeader.svelte +8 -0
  117. package/dist/components/patterns/PageHeader.svelte.d.ts +8 -0
  118. package/dist/components/patterns/PullQuote.svelte +145 -0
  119. package/dist/components/patterns/PullQuote.svelte.d.ts +23 -0
  120. package/dist/components/patterns/RegisterSwitcher.svelte +132 -0
  121. package/dist/components/patterns/RegisterSwitcher.svelte.d.ts +21 -0
  122. package/dist/components/patterns/SearchBar.svelte +5 -0
  123. package/dist/components/patterns/SearchBar.svelte.d.ts +5 -0
  124. package/dist/components/patterns/ShowcaseFrame.svelte +117 -0
  125. package/dist/components/patterns/ShowcaseFrame.svelte.d.ts +28 -0
  126. package/dist/components/patterns/TerminalBoot.svelte +15 -1
  127. package/dist/components/patterns/TerminalBoot.svelte.d.ts +12 -0
  128. package/dist/components/primitives/Divider.svelte +30 -0
  129. package/dist/components/primitives/Divider.svelte.d.ts +5 -0
  130. package/dist/components/primitives/Icon.svelte +9 -0
  131. package/dist/components/primitives/Icon.svelte.d.ts +9 -0
  132. package/dist/components/primitives/Label.svelte +6 -0
  133. package/dist/components/primitives/Label.svelte.d.ts +6 -0
  134. package/dist/components/primitives/Surface.svelte +67 -2
  135. package/dist/components/primitives/Surface.svelte.d.ts +7 -0
  136. package/dist/components/primitives/Text.svelte +32 -0
  137. package/dist/components/primitives/Text.svelte.d.ts +7 -0
  138. package/dist/components/scenes/ArchiveScene.svelte +10 -0
  139. package/dist/components/scenes/ArchiveScene.svelte.d.ts +10 -0
  140. package/dist/components/scenes/DepthScene.svelte +128 -0
  141. package/dist/components/scenes/DepthScene.svelte.d.ts +36 -0
  142. package/dist/components/scenes/LogScene.svelte +14 -0
  143. package/dist/components/scenes/LogScene.svelte.d.ts +14 -0
  144. package/dist/components/scenes/NarrativeScene.svelte +9 -0
  145. package/dist/components/scenes/NarrativeScene.svelte.d.ts +9 -0
  146. package/dist/components/scenes/ReadoutScene.svelte +11 -0
  147. package/dist/components/scenes/ReadoutScene.svelte.d.ts +11 -0
  148. package/dist/components/scenes/StageScene.svelte +14 -0
  149. package/dist/components/scenes/StageScene.svelte.d.ts +14 -0
  150. package/dist/components/system/AppShell.svelte +62 -0
  151. package/dist/components/system/AppShell.svelte.d.ts +32 -0
  152. package/dist/examples/ArcaneShard.svelte +364 -0
  153. package/dist/examples/ArcaneShard.svelte.d.ts +3 -0
  154. package/dist/examples/HextechForge.svelte +324 -0
  155. package/dist/examples/HextechForge.svelte.d.ts +3 -0
  156. package/dist/index.d.ts +15 -1
  157. package/dist/index.js +16 -1
  158. package/dist/styles.css +2 -0
  159. package/dist/system/actions/echo.js +13 -4
  160. package/dist/system/actions/resolve.js +20 -6
  161. package/dist/system/actions/reveal.js +1 -1
  162. package/dist/system/actions/surface.js +1 -3
  163. package/dist/system/register.d.ts +1 -1
  164. package/dist/system/register.js +5 -1
  165. package/dist/tokens/arcane.css +96 -0
  166. package/dist/tokens/hextech.css +96 -0
  167. package/dist/tokens/tokens.css +6 -4
  168. package/dist/tokens/tokens.d.ts +41 -0
  169. package/dist/tokens/tokens.js +41 -0
  170. package/package.json +6 -2
@@ -1,6 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { cn } from '../../utils/cn.js';
3
3
 
4
+ /**
5
+ * Decorative pulsing sonar rings. Renders `aria-hidden`.
6
+ * @example
7
+ * <SignalRing size={160} color="var(--signal)" />
8
+ * <SignalRing active={isLive} size={200} />
9
+ */
4
10
  interface Props {
5
11
  /** Enable the pulsing animation. */
6
12
  active?: boolean;
@@ -56,7 +62,7 @@
56
62
  border-radius: 50%;
57
63
  border: 1px solid;
58
64
  opacity: 0;
59
- animation: signal-ring-expand 3.6s ease-out infinite;
65
+ animation: signal-ring-expand 3.6s var(--ease-smooth) infinite;
60
66
  }
61
67
 
62
68
  .hyvui-signal-ring-1 {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Decorative pulsing sonar rings. Renders `aria-hidden`.
3
+ * @example
4
+ * <SignalRing size={160} color="var(--signal)" />
5
+ * <SignalRing active={isLive} size={200} />
6
+ */
1
7
  interface Props {
2
8
  /** Enable the pulsing animation. */
3
9
  active?: boolean;
@@ -1,6 +1,13 @@
1
1
  <script lang="ts">
2
2
  import { cn } from '../../utils/cn.js';
3
3
 
4
+ /**
5
+ * Decorative SVG line with an optional traveling dot. Parent must have `position: relative`. Renders `aria-hidden`.
6
+ * @example
7
+ * <div style="position: relative; height: 200px;">
8
+ * <ThreadLine x1="0%" y1="0%" x2="100%" y2="100%" animated />
9
+ * </div>
10
+ */
4
11
  interface Props {
5
12
  /** Start x position (CSS value). */
6
13
  x1?: string;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Decorative SVG line with an optional traveling dot. Parent must have `position: relative`. Renders `aria-hidden`.
3
+ * @example
4
+ * <div style="position: relative; height: 200px;">
5
+ * <ThreadLine x1="0%" y1="0%" x2="100%" y2="100%" animated />
6
+ * </div>
7
+ */
1
8
  interface Props {
2
9
  /** Start x position (CSS value). */
3
10
  x1?: string;
@@ -1,6 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { cn } from '../../utils/cn.js';
3
3
 
4
+ /**
5
+ * Fixed-position dark vignette overlay. Place once in root layout. Renders `aria-hidden`.
6
+ * @example
7
+ * <!-- in +layout.svelte (or use AppShell which adds it automatically) -->
8
+ * <Vignette />
9
+ */
4
10
  interface Props {
5
11
  /** Additional CSS classes. */
6
12
  class?: string;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Fixed-position dark vignette overlay. Place once in root layout. Renders `aria-hidden`.
3
+ * @example
4
+ * <!-- in +layout.svelte (or use AppShell which adds it automatically) -->
5
+ * <Vignette />
6
+ */
1
7
  interface Props {
2
8
  /** Additional CSS classes. */
3
9
  class?: string;
@@ -3,6 +3,14 @@
3
3
  import type { DepthLevel } from '../../system/depth/depth.js';
4
4
  import type { Snippet } from 'svelte';
5
5
 
6
+ /**
7
+ * Places children at a named z-level within a DepthStage.
8
+ * @example
9
+ * <DepthStage>
10
+ * <DepthLayer level="ground"><HorizonGrid /></DepthLayer>
11
+ * <DepthLayer level="foreground"><Text variant="heading">in front</Text></DepthLayer>
12
+ * </DepthStage>
13
+ */
6
14
  interface Props {
7
15
  /** Z-level within a parent DepthStage. */
8
16
  level?: DepthLevel;
@@ -1,5 +1,13 @@
1
1
  import type { DepthLevel } from '../../system/depth/depth.js';
2
2
  import type { Snippet } from 'svelte';
3
+ /**
4
+ * Places children at a named z-level within a DepthStage.
5
+ * @example
6
+ * <DepthStage>
7
+ * <DepthLayer level="ground"><HorizonGrid /></DepthLayer>
8
+ * <DepthLayer level="foreground"><Text variant="heading">in front</Text></DepthLayer>
9
+ * </DepthStage>
10
+ */
3
11
  interface Props {
4
12
  /** Z-level within a parent DepthStage. */
5
13
  level?: DepthLevel;
@@ -3,6 +3,14 @@
3
3
  import type { PerspectivePreset } from '../../system/depth/depth.js';
4
4
  import type { Snippet } from 'svelte';
5
5
 
6
+ /**
7
+ * Establishes CSS 3D perspective context. Wrap any 3D composition in this.
8
+ * @example
9
+ * <DepthStage perspective="mid">
10
+ * <DepthLayer level="ground"><HorizonGrid /></DepthLayer>
11
+ * <DepthLayer level="raised"><FloatCard>content</FloatCard></DepthLayer>
12
+ * </DepthStage>
13
+ */
6
14
  interface Props {
7
15
  /** Perspective distance preset. */
8
16
  perspective?: PerspectivePreset;
@@ -50,10 +58,6 @@
50
58
  position: relative;
51
59
  }
52
60
 
53
- .hyvui-depth-stage > :global(*) {
54
- transform-style: preserve-3d;
55
- }
56
-
57
61
  @media (prefers-reduced-motion: reduce) {
58
62
  .hyvui-depth-stage {
59
63
  perspective: none !important;
@@ -1,5 +1,13 @@
1
1
  import type { PerspectivePreset } from '../../system/depth/depth.js';
2
2
  import type { Snippet } from 'svelte';
3
+ /**
4
+ * Establishes CSS 3D perspective context. Wrap any 3D composition in this.
5
+ * @example
6
+ * <DepthStage perspective="mid">
7
+ * <DepthLayer level="ground"><HorizonGrid /></DepthLayer>
8
+ * <DepthLayer level="raised"><FloatCard>content</FloatCard></DepthLayer>
9
+ * </DepthStage>
10
+ */
3
11
  interface Props {
4
12
  /** Perspective distance preset. */
5
13
  perspective?: PerspectivePreset;
@@ -5,6 +5,14 @@
5
5
  import type { Snippet } from 'svelte';
6
6
  import { onMount } from 'svelte';
7
7
 
8
+ /**
9
+ * Self-contained pointer-tilt card. Works standalone or inside a DepthStage.
10
+ * @example
11
+ * <FloatCard tiltMax={6}>
12
+ * <Text variant="heading">floating content</Text>
13
+ * <Text>card body</Text>
14
+ * </FloatCard>
15
+ */
8
16
  interface Props {
9
17
  /** Maximum tilt angle in degrees. */
10
18
  tiltMax?: number;
@@ -41,6 +49,7 @@
41
49
  lastX = (e.clientX - rect.left) / rect.width;
42
50
  lastY = (e.clientY - rect.top) / rect.height;
43
51
 
52
+ if (!innerEl.style.willChange) innerEl.style.willChange = 'transform';
44
53
  innerEl.classList.remove('hyvui-float-card-leaving');
45
54
  if (frame) return;
46
55
  frame = requestAnimationFrame(() => {
@@ -57,6 +66,13 @@
57
66
  frame = 0;
58
67
  innerEl.classList.add('hyvui-float-card-leaving');
59
68
  innerEl.style.transform = 'rotateX(0deg) rotateY(0deg) translateZ(0px)';
69
+ innerEl.addEventListener(
70
+ 'transitionend',
71
+ () => {
72
+ if (innerEl) innerEl.style.willChange = '';
73
+ },
74
+ { once: true }
75
+ );
60
76
  }
61
77
  </script>
62
78
 
@@ -85,7 +101,7 @@
85
101
 
86
102
  .hyvui-float-card-inner {
87
103
  transform-style: preserve-3d;
88
- will-change: transform;
104
+ backface-visibility: hidden;
89
105
  }
90
106
 
91
107
  .hyvui-float-card-leaving {
@@ -1,4 +1,12 @@
1
1
  import type { Snippet } from 'svelte';
2
+ /**
3
+ * Self-contained pointer-tilt card. Works standalone or inside a DepthStage.
4
+ * @example
5
+ * <FloatCard tiltMax={6}>
6
+ * <Text variant="heading">floating content</Text>
7
+ * <Text>card body</Text>
8
+ * </FloatCard>
9
+ */
2
10
  interface Props {
3
11
  /** Maximum tilt angle in degrees. */
4
12
  tiltMax?: number;
@@ -2,6 +2,15 @@
2
2
  import { cn } from '../../utils/cn.js';
3
3
  import { onMount } from 'svelte';
4
4
 
5
+ /**
6
+ * Canvas-drawn perspective grid with gold-to-teal gradient. Typically placed at ground level in a DepthStage.
7
+ * @example
8
+ * <DepthStage>
9
+ * <DepthLayer level="ground">
10
+ * <HorizonGrid rows={16} cols={10} vanishY={0.4} animated />
11
+ * </DepthLayer>
12
+ * </DepthStage>
13
+ */
5
14
  interface Props {
6
15
  /** Number of horizontal lines receding toward the vanishing point. */
7
16
  rows?: number;
@@ -105,6 +114,10 @@
105
114
  }
106
115
 
107
116
  const dt = lastT ? t - lastT : 16;
117
+ if (lastT && dt < 32) {
118
+ animFrame = requestAnimationFrame(tick);
119
+ return;
120
+ }
108
121
  lastT = t;
109
122
 
110
123
  // Drift speed tuned to roughly match the previous "0.003 per frame" feel.
@@ -168,10 +181,22 @@
168
181
  else if (animated && !prefersReduced && isVisible) start();
169
182
  }
170
183
 
184
+ let scrollTimer = 0;
185
+ function onScroll() {
186
+ stop();
187
+ clearTimeout(scrollTimer);
188
+ scrollTimer = window.setTimeout(() => {
189
+ if (animated && !prefersReduced && isVisible && !document.hidden) start();
190
+ }, 150);
191
+ }
192
+
171
193
  document.addEventListener('visibilitychange', onVisibility);
194
+ window.addEventListener('scroll', onScroll, { passive: true });
172
195
 
173
196
  return () => {
174
197
  document.removeEventListener('visibilitychange', onVisibility);
198
+ window.removeEventListener('scroll', onScroll);
199
+ clearTimeout(scrollTimer);
175
200
  io.disconnect();
176
201
  ro.disconnect();
177
202
  stop();
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Canvas-drawn perspective grid with gold-to-teal gradient. Typically placed at ground level in a DepthStage.
3
+ * @example
4
+ * <DepthStage>
5
+ * <DepthLayer level="ground">
6
+ * <HorizonGrid rows={16} cols={10} vanishY={0.4} animated />
7
+ * </DepthLayer>
8
+ * </DepthStage>
9
+ */
1
10
  interface Props {
2
11
  /** Number of horizontal lines receding toward the vanishing point. */
3
12
  rows?: number;
@@ -1,6 +1,16 @@
1
1
  <script lang="ts">
2
2
  import { cn } from '../../utils/cn.js';
3
3
 
4
+ /**
5
+ * Near-invisible receding surface for anchoring floating elements in a DepthStage.
6
+ * @example
7
+ * <DepthStage>
8
+ * <DepthLayer level="raised">
9
+ * <FloatCard>content</FloatCard>
10
+ * <Plinth width="80%" depth="30px" />
11
+ * </DepthLayer>
12
+ * </DepthStage>
13
+ */
4
14
  interface Props {
5
15
  /** Width of the plinth surface. */
6
16
  width?: string;
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Near-invisible receding surface for anchoring floating elements in a DepthStage.
3
+ * @example
4
+ * <DepthStage>
5
+ * <DepthLayer level="raised">
6
+ * <FloatCard>content</FloatCard>
7
+ * <Plinth width="80%" depth="30px" />
8
+ * </DepthLayer>
9
+ * </DepthStage>
10
+ */
1
11
  interface Props {
2
12
  /** Width of the plinth surface. */
3
13
  width?: string;
@@ -1,6 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { cn } from '../../utils/cn.js';
3
3
 
4
+ /**
5
+ * @example
6
+ * <Avatar name="Jane Doe" size={40} />
7
+ * <Avatar src="/avatars/user.jpg" name="Jane Doe" size={32} />
8
+ */
4
9
  interface Props {
5
10
  /** Image source URL. */
6
11
  src?: string;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @example
3
+ * <Avatar name="Jane Doe" size={40} />
4
+ * <Avatar src="/avatars/user.jpg" name="Jane Doe" size={32} />
5
+ */
1
6
  interface Props {
2
7
  /** Image source URL. */
3
8
  src?: string;
@@ -2,6 +2,12 @@
2
2
  import { cn } from '../../utils/cn.js';
3
3
  import type { Snippet } from 'svelte';
4
4
 
5
+ /**
6
+ * @example
7
+ * <Badge variant="ok">online</Badge>
8
+ * <Badge variant="warn">degraded</Badge>
9
+ * <Badge variant="accent">new</Badge>
10
+ */
5
11
  interface Props {
6
12
  /** Badge color variant. */
7
13
  variant?: 'default' | 'accent' | 'signal' | 'ok' | 'warn' | 'fail';
@@ -56,4 +62,14 @@
56
62
  border-color: currentColor;
57
63
  opacity: 0.8;
58
64
  }
65
+
66
+ /* ── hextech: clipped top-left corner (hex gem cut) ───────────────── */
67
+ :global([data-register='hextech']) .hyvui-badge {
68
+ clip-path: polygon(6px 0%, 100% 0%, 100% 100%, 0% 100%, 0% 6px);
69
+ }
70
+
71
+ /* ── arcane: diagonal parallelogram cut ───────────────────────────── */
72
+ :global([data-register='arcane']) .hyvui-badge {
73
+ clip-path: polygon(5px 0%, 100% 0%, calc(100% - 5px) 100%, 0% 100%);
74
+ }
59
75
  </style>
@@ -1,4 +1,10 @@
1
1
  import type { Snippet } from 'svelte';
2
+ /**
3
+ * @example
4
+ * <Badge variant="ok">online</Badge>
5
+ * <Badge variant="warn">degraded</Badge>
6
+ * <Badge variant="accent">new</Badge>
7
+ */
2
8
  interface Props {
3
9
  /** Badge color variant. */
4
10
  variant?: 'default' | 'accent' | 'signal' | 'ok' | 'warn' | 'fail';
@@ -2,6 +2,10 @@
2
2
  import { cn } from '../../utils/cn.js';
3
3
  import type { Snippet } from 'svelte';
4
4
 
5
+ /**
6
+ * @example
7
+ * <Blockquote>the signal arrives before the message.</Blockquote>
8
+ */
5
9
  interface Props {
6
10
  /** Additional CSS classes. */
7
11
  class?: string;
@@ -1,4 +1,8 @@
1
1
  import type { Snippet } from 'svelte';
2
+ /**
3
+ * @example
4
+ * <Blockquote>the signal arrives before the message.</Blockquote>
5
+ */
2
6
  interface Props {
3
7
  /** Additional CSS classes. */
4
8
  class?: string;
@@ -2,6 +2,11 @@
2
2
  import { cn } from '../../utils/cn.js';
3
3
  import Button from '../inputs/Button.svelte';
4
4
 
5
+ /**
6
+ * @example
7
+ * <CodeBlock code="npm install @hyvnt/hyvui" language="bash" />
8
+ * <CodeBlock code={snippetString} language="typescript" copyable={false} />
9
+ */
5
10
  interface Props {
6
11
  /** Code string to display. */
7
12
  code?: string;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @example
3
+ * <CodeBlock code="npm install @hyvnt/hyvui" language="bash" />
4
+ * <CodeBlock code={snippetString} language="typescript" copyable={false} />
5
+ */
1
6
  interface Props {
2
7
  /** Code string to display. */
3
8
  code?: string;
@@ -2,6 +2,12 @@
2
2
  import { cn } from '../../utils/cn.js';
3
3
  import Surface from '../primitives/Surface.svelte';
4
4
 
5
+ /**
6
+ * @see surface — add `use:surface` on MetricCard for an entrance animation on mount.
7
+ * @example
8
+ * <MetricCard label="active sessions" value="1,284" trend="up" trendValue="+8%" />
9
+ * <MetricCard label="error rate" value="0.02%" trend="down" trendValue="-0.01%" />
10
+ */
5
11
  interface Props {
6
12
  /** Metric label. */
7
13
  label?: string;
@@ -46,6 +52,23 @@
46
52
  display: flex;
47
53
  flex-direction: column;
48
54
  gap: var(--space-sm);
55
+ transition:
56
+ transform var(--transition-smooth),
57
+ border-color var(--transition-fast);
58
+ }
59
+
60
+ :global(.hyvui-metric:hover) {
61
+ transform: translateY(-1px);
62
+ }
63
+
64
+ @media (prefers-reduced-motion: reduce) {
65
+ :global(.hyvui-metric) {
66
+ transition: none;
67
+ }
68
+
69
+ :global(.hyvui-metric:hover) {
70
+ transform: none;
71
+ }
49
72
  }
50
73
 
51
74
  .hyvui-metric-label {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @see surface — add `use:surface` on MetricCard for an entrance animation on mount.
3
+ * @example
4
+ * <MetricCard label="active sessions" value="1,284" trend="up" trendValue="+8%" />
5
+ * <MetricCard label="error rate" value="0.02%" trend="down" trendValue="-0.01%" />
6
+ */
1
7
  interface Props {
2
8
  /** Metric label. */
3
9
  label?: string;
@@ -9,6 +9,13 @@
9
9
  align?: 'left' | 'center' | 'right';
10
10
  }
11
11
 
12
+ /**
13
+ * @example
14
+ * <Table
15
+ * columns={[{ key: 'name', label: 'name' }, { key: 'status', label: 'status' }]}
16
+ * rows={[{ name: 'alpha', status: 'active' }, { name: 'beta', status: 'pending' }]}
17
+ * />
18
+ */
12
19
  interface Props {
13
20
  /** Column definitions. */
14
21
  columns?: TableColumn[];
@@ -4,6 +4,13 @@ interface TableColumn {
4
4
  label: string;
5
5
  align?: 'left' | 'center' | 'right';
6
6
  }
7
+ /**
8
+ * @example
9
+ * <Table
10
+ * columns={[{ key: 'name', label: 'name' }, { key: 'status', label: 'status' }]}
11
+ * rows={[{ name: 'alpha', status: 'active' }, { name: 'beta', status: 'pending' }]}
12
+ * />
13
+ */
7
14
  interface Props {
8
15
  /** Column definitions. */
9
16
  columns?: TableColumn[];
@@ -2,6 +2,12 @@
2
2
  import { cn } from '../../utils/cn.js';
3
3
  import type { Snippet } from 'svelte';
4
4
 
5
+ /**
6
+ * @example
7
+ * <Alert variant="warn" title="rate limited">requests paused for 60 seconds</Alert>
8
+ * <Alert variant="error">connection refused</Alert>
9
+ * <Alert variant="ok" title="deployment complete">all services nominal</Alert>
10
+ */
5
11
  interface Props {
6
12
  /** Alert variant determining accent color. */
7
13
  variant?: 'info' | 'warn' | 'error' | 'ok';
@@ -50,6 +56,24 @@
50
56
  .hyvui-alert {
51
57
  border-left: 2px solid;
52
58
  padding: 0.75rem 1rem;
59
+ animation: alert-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
60
+ }
61
+
62
+ @keyframes alert-in {
63
+ from {
64
+ opacity: 0;
65
+ transform: translateX(-6px);
66
+ }
67
+ to {
68
+ opacity: 1;
69
+ transform: translateX(0);
70
+ }
71
+ }
72
+
73
+ @media (prefers-reduced-motion: reduce) {
74
+ .hyvui-alert {
75
+ animation: none;
76
+ }
53
77
  }
54
78
 
55
79
  .hyvui-alert-title {
@@ -1,4 +1,10 @@
1
1
  import type { Snippet } from 'svelte';
2
+ /**
3
+ * @example
4
+ * <Alert variant="warn" title="rate limited">requests paused for 60 seconds</Alert>
5
+ * <Alert variant="error">connection refused</Alert>
6
+ * <Alert variant="ok" title="deployment complete">all services nominal</Alert>
7
+ */
2
8
  interface Props {
3
9
  /** Alert variant determining accent color. */
4
10
  variant?: 'info' | 'warn' | 'error' | 'ok';
@@ -2,6 +2,13 @@
2
2
  import { cn } from '../../utils/cn.js';
3
3
  import type { Snippet } from 'svelte';
4
4
 
5
+ /**
6
+ * @example
7
+ * <EmptyState title="no records found" description="adjust your filters to see results" />
8
+ * <EmptyState title="nothing here yet">
9
+ * <Button variant="primary" onclick={create}>create one</Button>
10
+ * </EmptyState>
11
+ */
5
12
  interface Props {
6
13
  /** Primary message. */
7
14
  title?: string;
@@ -1,4 +1,11 @@
1
1
  import type { Snippet } from 'svelte';
2
+ /**
3
+ * @example
4
+ * <EmptyState title="no records found" description="adjust your filters to see results" />
5
+ * <EmptyState title="nothing here yet">
6
+ * <Button variant="primary" onclick={create}>create one</Button>
7
+ * </EmptyState>
8
+ */
2
9
  interface Props {
3
10
  /** Primary message. */
4
11
  title?: string;
@@ -3,6 +3,11 @@
3
3
  import StatusDot from './StatusDot.svelte';
4
4
  import Button from '../inputs/Button.svelte';
5
5
 
6
+ /**
7
+ * @example
8
+ * <ErrorState title="signal lost" description="the connection dropped unexpectedly" retry onretry={reload} />
9
+ * <ErrorState title="the signal needs rest" />
10
+ */
6
11
  interface Props {
7
12
  /** Error condition title. Describes the condition, not the cause. */
8
13
  title?: string;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @example
3
+ * <ErrorState title="signal lost" description="the connection dropped unexpectedly" retry onretry={reload} />
4
+ * <ErrorState title="the signal needs rest" />
5
+ */
1
6
  interface Props {
2
7
  /** Error condition title. Describes the condition, not the cause. */
3
8
  title?: string;
@@ -1,6 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { cn } from '../../utils/cn.js';
3
3
 
4
+ /**
5
+ * @example
6
+ * <Skeleton height="1.2rem" width="60%" />
7
+ * <Skeleton variant="circle" width="32px" height="32px" />
8
+ * <Skeleton variant="card" height="120px" />
9
+ */
4
10
  interface Props {
5
11
  /** Width of the skeleton element. */
6
12
  width?: string;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @example
3
+ * <Skeleton height="1.2rem" width="60%" />
4
+ * <Skeleton variant="circle" width="32px" height="32px" />
5
+ * <Skeleton variant="card" height="120px" />
6
+ */
1
7
  interface Props {
2
8
  /** Width of the skeleton element. */
3
9
  width?: string;