@heyramzi/ui 7.0.0 → 8.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.
Files changed (259) hide show
  1. package/COMPONENTS.md +28 -17
  2. package/README.md +6 -2
  3. package/package.json +25 -15
  4. package/scripts/sync-shadcn.mjs +17 -13
  5. package/scripts/sync-transitions.mjs +11 -11
  6. package/src/agents/agent-avatar.svelte +67 -114
  7. package/src/agents/agent-cast.svelte +31 -7
  8. package/src/agents/demo.svelte +55 -8
  9. package/src/agents/helpers.ts +58 -0
  10. package/src/agents/page-state.ts +70 -0
  11. package/src/agents/types.ts +3 -1
  12. package/src/ai/ai-button/AiButton.svelte +86 -0
  13. package/src/ai/ai-button/index.ts +4 -0
  14. package/src/ai/confirmation/Confirmation.svelte +8 -8
  15. package/src/ai/confirmation/confirmation-context.svelte.ts +2 -2
  16. package/src/ai/generation-progress/GenerationProgress.svelte +354 -0
  17. package/src/ai/generation-progress/index.ts +7 -0
  18. package/src/ai/index.ts +16 -6
  19. package/src/ai/prompt-input/PromptInput.svelte +19 -1
  20. package/src/ai/prompt-input/PromptInputSubmit.svelte +9 -3
  21. package/src/ai/reasoning/Reasoning.svelte +11 -8
  22. package/src/ambient.d.ts +4 -0
  23. package/src/animations/README.md +14 -14
  24. package/src/animations/index.css +3 -14
  25. package/src/animations/upstream-coverage.test.ts +1 -1
  26. package/src/components/copy/clipboard.test.ts +206 -0
  27. package/src/components/copy/clipboard.ts +49 -0
  28. package/src/components/copy/copied.svelte.ts +39 -0
  29. package/src/components/copy/copy-button.svelte +175 -0
  30. package/src/components/copy/copy-button.test.ts +110 -0
  31. package/src/components/copy/index.ts +3 -0
  32. package/src/components/data-table/data-table.test.ts +134 -0
  33. package/src/components/data-table/data-table.ts +77 -0
  34. package/src/components/data-table/index.ts +20 -0
  35. package/src/components/data-table/infinite-scroll.svelte +69 -0
  36. package/src/components/data-table/pagination.svelte +62 -0
  37. package/src/components/data-table/row-arrow.svelte +28 -0
  38. package/src/components/data-table/row-context-menu.svelte +106 -0
  39. package/src/components/data-table/row-context-menu.test.ts +18 -0
  40. package/src/components/data-table/sortable-head.svelte +56 -0
  41. package/src/components/data-table/table-skeleton.svelte +83 -0
  42. package/src/components/hold-to-confirm/hold-to-confirm.svelte +232 -0
  43. package/src/components/hold-to-confirm/index.ts +1 -0
  44. package/src/components/icon/icon.svelte +23 -0
  45. package/src/components/icon/index.ts +1 -0
  46. package/src/components/language-flag/index.ts +1 -0
  47. package/src/components/language-flag/language-flag.svelte +60 -0
  48. package/src/components/list-page/detail-empty.svelte +50 -0
  49. package/src/components/list-page/detail-header.svelte +107 -0
  50. package/src/components/list-page/detail-panel.svelte +90 -0
  51. package/src/components/list-page/detail-row.svelte +36 -0
  52. package/src/components/list-page/detail-stack.svelte +33 -0
  53. package/src/components/list-page/empty-state.svelte +91 -0
  54. package/src/components/list-page/filter-item.svelte +49 -0
  55. package/src/components/list-page/filter-popover.svelte +88 -0
  56. package/src/components/list-page/filter-section.ts +12 -0
  57. package/src/components/list-page/grouped-list.svelte +116 -0
  58. package/src/components/list-page/index.ts +28 -0
  59. package/src/components/list-page/list-page-shell.svelte +195 -0
  60. package/src/components/list-page/list-table.ts +19 -0
  61. package/src/components/list-page/master-detail.svelte +206 -0
  62. package/src/components/list-page/master-detail.test.ts +37 -0
  63. package/src/components/list-page/notice-bar.svelte +68 -0
  64. package/src/components/list-page/prev-next.svelte +104 -0
  65. package/src/components/list-page/queue-rail.ts +25 -0
  66. package/src/components/list-page/rail-body.svelte +29 -0
  67. package/src/components/list-page/rail-empty.svelte +51 -0
  68. package/src/components/list-page/rail-head.svelte +49 -0
  69. package/src/components/list-page/rail-row.svelte +163 -0
  70. package/src/components/list-page/section-host.ts +24 -0
  71. package/src/components/list-page/section-label.svelte +39 -0
  72. package/src/components/list-page/step.test.ts +21 -0
  73. package/src/components/list-page/step.ts +10 -0
  74. package/src/components/list-page/toolbar-search.svelte +63 -0
  75. package/src/components/list-page/toolbar-trigger.ts +23 -0
  76. package/src/components/list-page/types.ts +1 -0
  77. package/src/components/locale-switch/index.ts +1 -0
  78. package/src/components/locale-switch/locale-switch.svelte +59 -0
  79. package/src/components/mark/index.ts +1 -0
  80. package/src/components/mark/mark.svelte +70 -0
  81. package/src/components/open-in/index.ts +6 -0
  82. package/src/components/open-in/open-in.svelte +106 -0
  83. package/src/components/picker/index.ts +4 -0
  84. package/src/components/picker/mark-picker.svelte +84 -0
  85. package/src/components/picker/picker.svelte +143 -0
  86. package/src/components/picker/trigger.ts +42 -0
  87. package/src/components/picker/types.ts +26 -0
  88. package/src/components/segmented/animated-tabs.svelte +175 -0
  89. package/src/components/segmented/collapse.test.ts +49 -0
  90. package/src/components/segmented/collapse.ts +39 -0
  91. package/src/components/segmented/index.ts +41 -0
  92. package/src/components/segmented/section-runs.svelte +79 -0
  93. package/src/components/segmented/segment.svelte +106 -0
  94. package/src/components/segmented/segmented-filter.svelte +125 -0
  95. package/src/components/segmented/segmented-nav.svelte +82 -0
  96. package/src/components/segmented/segmented-overflow.svelte +85 -0
  97. package/src/components/segmented/segmented-track.svelte +181 -0
  98. package/src/components/segmented/segmented.test.ts +20 -0
  99. package/src/components/segmented/segmented.ts +80 -0
  100. package/src/components/star-rating-input/index.ts +9 -0
  101. package/src/components/star-rating-input/star-rating-input.svelte +256 -0
  102. package/src/components/svg/index.ts +1 -0
  103. package/src/components/svg/svg.svelte +9 -0
  104. package/src/effects/border-beam/BorderBeam.svelte +1 -1
  105. package/src/effects/image-comparison/ImageComparison.css +42 -8
  106. package/src/effects/image-comparison/ImageComparison.svelte +138 -21
  107. package/src/effects/image-comparison/compare.test.ts +17 -0
  108. package/src/effects/image-comparison/compare.ts +5 -0
  109. package/src/effects/interactive-hover-button/InteractiveHoverButton.svelte +338 -0
  110. package/src/effects/magic-card/MagicCard.css +47 -0
  111. package/src/effects/magic-card/MagicCard.svelte +57 -0
  112. package/src/effects/marquee/Marquee.css +27 -1
  113. package/src/effects/marquee/Marquee.svelte +67 -3
  114. package/src/effects/reveal/index.ts +2 -1
  115. package/src/effects/reveal/observe.test.ts +60 -0
  116. package/src/effects/reveal/observe.ts +33 -1
  117. package/src/effects/reveal/types.ts +7 -0
  118. package/src/effects/theme-toggle/ThemeToggle.css +199 -6
  119. package/src/effects/theme-toggle/ThemeToggle.svelte +51 -26
  120. package/src/gallery.test.ts +52 -0
  121. package/src/index.ts +5 -1
  122. package/src/lib/panel.ts +7 -1
  123. package/src/lib/theme-transition.ts +37 -11
  124. package/src/lib/tone.ts +48 -0
  125. package/src/shadcn/accordion/accordion-trigger.svelte +15 -6
  126. package/src/shadcn/alert/alert.svelte +3 -1
  127. package/src/shadcn/badge/badge.svelte +8 -7
  128. package/src/shadcn/breadcrumb/breadcrumb-ellipsis.svelte +2 -2
  129. package/src/shadcn/breadcrumb/breadcrumb-separator.svelte +2 -2
  130. package/src/shadcn/calendar/calendar-month-select.svelte +2 -2
  131. package/src/shadcn/calendar/calendar-next-button.svelte +2 -2
  132. package/src/shadcn/calendar/calendar-prev-button.svelte +2 -2
  133. package/src/shadcn/calendar/calendar-year-select.svelte +2 -2
  134. package/src/shadcn/calendar/calendar.svelte +6 -0
  135. package/src/shadcn/code-block/code-block-copy-button.svelte +6 -55
  136. package/src/shadcn/command/index.ts +3 -0
  137. package/src/shadcn/field/index.ts +3 -0
  138. package/src/shadcn/field/simple-field.svelte +71 -0
  139. package/src/shadcn/field/simple-field.test.ts +47 -0
  140. package/src/shadcn/message-scroller/message-scroller-button.svelte +2 -2
  141. package/src/shadcn/radio-group/radio-group-item.svelte +3 -2
  142. package/src/shadcn/sheet/sheet-content.svelte +1 -0
  143. package/src/shadcn/sheet/sheet.css +48 -0
  144. package/src/shadcn/sonner/sonner.svelte +7 -10
  145. package/src/shadcn/toggle-group/toggle-group.svelte +10 -3
  146. package/src/shadcn/trace/trace-collapsible-trigger.svelte +2 -2
  147. package/src/ai/composer/Composer.css +0 -108
  148. package/src/ai/composer/Composer.svelte +0 -111
  149. package/src/ai/composer/index.ts +0 -10
  150. package/src/animations/accordion.css +0 -58
  151. package/src/animations/icon-swap.css +0 -43
  152. package/src/animations/notification-badge.css +0 -81
  153. package/src/animations/panel.css +0 -86
  154. package/src/animations/reasoning-stream.css +0 -49
  155. package/src/animations/skeleton-reveal.css +0 -97
  156. package/src/animations/streaming-text.css +0 -31
  157. package/src/animations/tabs-sliding.css +0 -83
  158. package/src/animations/texts-reveal.css +0 -70
  159. package/src/animations/tooltip.css +0 -72
  160. package/src/animations/view-transition-reveal.ts +0 -74
  161. package/src/lib/utils.ts +0 -45
  162. package/src/showcase/AiSection.svelte +0 -150
  163. package/src/showcase/AnimationsSection.svelte +0 -1658
  164. package/src/showcase/EffectsSection.svelte +0 -152
  165. package/src/showcase/ShadcnSection.svelte +0 -27
  166. package/src/showcase/ShowcaseImport.svelte +0 -126
  167. package/src/showcase/ShowcaseList.svelte +0 -132
  168. package/src/showcase/ShowcaseNav.svelte +0 -247
  169. package/src/showcase/ShowcaseSection.svelte +0 -112
  170. package/src/showcase/ShowcaseShell.svelte +0 -55
  171. package/src/showcase/ShowcaseStage.svelte +0 -342
  172. package/src/showcase/ShowcaseVariant.svelte +0 -109
  173. package/src/showcase/assets/image-reveal/art-1.jpg +0 -0
  174. package/src/showcase/assets/image-reveal/art-2.jpg +0 -0
  175. package/src/showcase/assets/image-reveal/art-3.jpg +0 -0
  176. package/src/showcase/check.svg +0 -1
  177. package/src/showcase/chevron-arms.svg +0 -2
  178. package/src/showcase/chevron-down.svg +0 -1
  179. package/src/showcase/copy.svg +0 -2
  180. package/src/showcase/demos/ai/confirmation.svelte +0 -59
  181. package/src/showcase/demos/ai/loading-state.svelte +0 -19
  182. package/src/showcase/demos/ai/prompt-input.svelte +0 -57
  183. package/src/showcase/demos/ai/reasoning.svelte +0 -19
  184. package/src/showcase/demos/ai/thinking-dots.svelte +0 -15
  185. package/src/showcase/demos/ai/voice-waveform.svelte +0 -24
  186. package/src/showcase/demos/effects/animated-beam.svelte +0 -50
  187. package/src/showcase/demos/effects/animated-group.svelte +0 -47
  188. package/src/showcase/demos/effects/border-beam-default.svelte +0 -20
  189. package/src/showcase/demos/effects/border-beam-line.svelte +0 -20
  190. package/src/showcase/demos/effects/border-beam-mono.svelte +0 -20
  191. package/src/showcase/demos/effects/border-beam-sunset.svelte +0 -20
  192. package/src/showcase/demos/effects/image-comparison.svelte +0 -25
  193. package/src/showcase/demos/effects/image-reveal.svelte +0 -49
  194. package/src/showcase/demos/effects/in-view.svelte +0 -41
  195. package/src/showcase/demos/effects/integrations-hub.svelte +0 -82
  196. package/src/showcase/demos/effects/magnetic.svelte +0 -31
  197. package/src/showcase/demos/effects/marquee.svelte +0 -33
  198. package/src/showcase/demos/effects/progressive-blur.svelte +0 -47
  199. package/src/showcase/demos/effects/spotlight.svelte +0 -40
  200. package/src/showcase/demos/effects/text-effect.svelte +0 -55
  201. package/src/showcase/demos/shadcn/accordion.svelte +0 -45
  202. package/src/showcase/demos/shadcn/alert-dialog.svelte +0 -23
  203. package/src/showcase/demos/shadcn/alert.svelte +0 -30
  204. package/src/showcase/demos/shadcn/attachment.svelte +0 -71
  205. package/src/showcase/demos/shadcn/avatar.svelte +0 -30
  206. package/src/showcase/demos/shadcn/badge.svelte +0 -26
  207. package/src/showcase/demos/shadcn/breadcrumb.svelte +0 -34
  208. package/src/showcase/demos/shadcn/bubble.svelte +0 -36
  209. package/src/showcase/demos/shadcn/button.svelte +0 -11
  210. package/src/showcase/demos/shadcn/calendar.svelte +0 -8
  211. package/src/showcase/demos/shadcn/card.svelte +0 -39
  212. package/src/showcase/demos/shadcn/checkbox.svelte +0 -39
  213. package/src/showcase/demos/shadcn/code-block.svelte +0 -80
  214. package/src/showcase/demos/shadcn/collapsible.svelte +0 -20
  215. package/src/showcase/demos/shadcn/command.svelte +0 -48
  216. package/src/showcase/demos/shadcn/context-menu.svelte +0 -54
  217. package/src/showcase/demos/shadcn/demo-harness.svelte +0 -12
  218. package/src/showcase/demos/shadcn/demos.test.ts +0 -20
  219. package/src/showcase/demos/shadcn/dialog.svelte +0 -38
  220. package/src/showcase/demos/shadcn/dropdown-menu.svelte +0 -59
  221. package/src/showcase/demos/shadcn/empty.svelte +0 -29
  222. package/src/showcase/demos/shadcn/field.svelte +0 -115
  223. package/src/showcase/demos/shadcn/hover-card.svelte +0 -32
  224. package/src/showcase/demos/shadcn/index.ts +0 -382
  225. package/src/showcase/demos/shadcn/input-otp.svelte +0 -19
  226. package/src/showcase/demos/shadcn/input.svelte +0 -5
  227. package/src/showcase/demos/shadcn/label.svelte +0 -11
  228. package/src/showcase/demos/shadcn/marker.svelte +0 -30
  229. package/src/showcase/demos/shadcn/message-scroller.svelte +0 -44
  230. package/src/showcase/demos/shadcn/message.svelte +0 -75
  231. package/src/showcase/demos/shadcn/popover.svelte +0 -36
  232. package/src/showcase/demos/shadcn/progress.svelte +0 -13
  233. package/src/showcase/demos/shadcn/radio-group.svelte +0 -19
  234. package/src/showcase/demos/shadcn/scroll-area.svelte +0 -18
  235. package/src/showcase/demos/shadcn/select.svelte +0 -29
  236. package/src/showcase/demos/shadcn/separator.svelte +0 -12
  237. package/src/showcase/demos/shadcn/sheet.svelte +0 -48
  238. package/src/showcase/demos/shadcn/skeleton.svelte +0 -11
  239. package/src/showcase/demos/shadcn/slider.svelte +0 -7
  240. package/src/showcase/demos/shadcn/sonner.svelte +0 -18
  241. package/src/showcase/demos/shadcn/spinner.svelte +0 -11
  242. package/src/showcase/demos/shadcn/switch.svelte +0 -9
  243. package/src/showcase/demos/shadcn/table.svelte +0 -76
  244. package/src/showcase/demos/shadcn/tabs.svelte +0 -62
  245. package/src/showcase/demos/shadcn/textarea.svelte +0 -5
  246. package/src/showcase/demos/shadcn/toggle-group.svelte +0 -18
  247. package/src/showcase/demos/shadcn/toggle.svelte +0 -14
  248. package/src/showcase/demos/shadcn/tooltip.svelte +0 -13
  249. package/src/showcase/demos/shadcn/trace.svelte +0 -51
  250. package/src/showcase/heart.svg +0 -1
  251. package/src/showcase/index.ts +0 -38
  252. package/src/showcase/kit.test.ts +0 -72
  253. package/src/showcase/kit.ts +0 -16
  254. package/src/showcase/plus.svg +0 -1
  255. package/src/showcase/showcase-shell.css +0 -91
  256. package/src/showcase/stacked-section.css +0 -15
  257. package/src/showcase/success-check.svg +0 -1
  258. package/src/showcase/types.ts +0 -29
  259. package/src/svg-raw.d.ts +0 -7
@@ -1,112 +0,0 @@
1
- <script lang="ts" module>
2
- import type { Snippet } from "svelte";
3
-
4
- export interface ShowcaseSectionProps {
5
- /** Anchor id. Must match the ShowcaseSectionMeta the nav rail was given. */
6
- id: string;
7
- label: string;
8
- /** What the section is for, in the reader's terms, not a list of its members. */
9
- lead?: string;
10
- /** Live demos. Stacked one per row unless `bare` is set. */
11
- children?: Snippet;
12
- /** Skip the stack, for content that brings a layout of its own. */
13
- bare?: boolean;
14
- /** Everything in the section with no demo, drawn as rows under the stack. */
15
- listed?: Snippet;
16
- }
17
- </script>
18
-
19
- <script lang="ts">
20
- let { id, label, lead, children, listed, bare = false }: ShowcaseSectionProps = $props();
21
- </script>
22
-
23
- <section {id}>
24
- <div class="sc-section-head">
25
- <h2>{label}</h2>
26
- {#if lead}
27
- <p>{lead}</p>
28
- {/if}
29
- </div>
30
-
31
- {#if children}
32
- {#if bare}
33
- {@render children()}
34
- {:else}
35
- <div class="sc-stack">
36
- {@render children()}
37
- </div>
38
- {/if}
39
- {/if}
40
-
41
- {#if listed}
42
- <div class="sc-section-listed">
43
- {@render listed()}
44
- </div>
45
- {/if}
46
- </section>
47
-
48
- <style>
49
- section {
50
- display: flex;
51
- flex-direction: column;
52
- /* Clears the sticky controls row, whose height the page declares once. */
53
- scroll-margin-top: calc(var(--showcase-nav-top, 0px) + 4.5rem);
54
- }
55
-
56
- /*
57
- * WHY the heading sits on its own rule rather than on whitespace: the page is
58
- */
59
-
60
- /*
61
- * one long column of stages now, and a gap alone did not read as a boundary once the stages themselves had air inside them.
62
- */
63
- .sc-section-head {
64
- display: flex;
65
- flex-direction: column;
66
- gap: 0.3125rem;
67
- margin-top: 2.25rem;
68
- padding: 2.25rem 0 1.25rem;
69
- border-top: 1px solid var(--color-border, var(--border));
70
- }
71
-
72
- section:first-child .sc-section-head {
73
- margin-top: 0;
74
- padding-top: 1.5rem;
75
- border-top: 0;
76
- }
77
-
78
- h2 {
79
- margin: 0;
80
- font-size: 1.125rem;
81
- font-weight: 600;
82
- line-height: 1.2;
83
- letter-spacing: -0.014em;
84
- color: var(--color-foreground, var(--foreground));
85
- }
86
-
87
- p {
88
- margin: 0;
89
- max-width: 62ch;
90
- font-size: 0.8125rem;
91
- line-height: 1.55;
92
- color: var(--color-muted-foreground, var(--muted-foreground));
93
- text-wrap: pretty;
94
- }
95
-
96
- /*
97
- * One stage per row. A grid of narrow cards made every component the size of the smallest one on the page, which is the opposite of what a showcase is
98
- */
99
-
100
- /*
101
- * for: a table and a button both got 20rem, and only one of them survived it.
102
- */
103
- .sc-stack {
104
- display: flex;
105
- flex-direction: column;
106
- gap: 0;
107
- }
108
-
109
- .sc-section-listed {
110
- padding-top: 1rem;
111
- }
112
- </style>
@@ -1,55 +0,0 @@
1
- <script lang="ts" module>
2
- import type { Snippet } from "svelte";
3
- import type { ShowcaseSectionMeta } from "./types.js";
4
-
5
- export interface ShowcaseShellProps {
6
- /** Every section the rail lists, in the order the page renders them. */
7
- sections: ShowcaseSectionMeta[];
8
- /** Search box, filters, anything that acts on the whole page. Spans both columns. */
9
- controls?: Snippet;
10
- /** Sits at the top of the rail, above the index. A title, a count, a legend. */
11
- railHead?: Snippet;
12
- /** The sections themselves. */
13
- children: Snippet;
14
- /** Rendered instead of the rail and the sections, e.g. a search result list. */
15
- override?: Snippet;
16
- }
17
- </script>
18
-
19
- <script lang="ts">
20
- import ShowcaseNav from "./ShowcaseNav.svelte";
21
- import "./showcase-shell.css";
22
-
23
- let { sections, controls, railHead, children, override }: ShowcaseShellProps = $props();
24
- </script>
25
-
26
- <div class="sc-shell">
27
- {#if controls}
28
- <div class="sc-shell-controls">
29
- {@render controls()}
30
- </div>
31
- {/if}
32
-
33
- {#if override}
34
- <div class="sc-shell-override">
35
- {@render override()}
36
- </div>
37
- {:else}
38
- <div class="sc-shell-body">
39
- <!-- A landmark of its own, because the index is a second way through the
40
- page rather than part of the page's content. -->
41
- <aside class="sc-shell-rail">
42
- {#if railHead}
43
- <div class="sc-shell-rail-head">
44
- {@render railHead()}
45
- </div>
46
- {/if}
47
- <ShowcaseNav {sections} />
48
- </aside>
49
-
50
- <div class="sc-shell-main">
51
- {@render children()}
52
- </div>
53
- </div>
54
- {/if}
55
- </div>
@@ -1,342 +0,0 @@
1
- <script lang="ts" module>
2
- import type { Snippet } from "svelte";
3
-
4
- export interface ShowcaseStageProps {
5
- /** Component name, e.g. "Dialog". */
6
- title: string;
7
- /** One line on what this demo shows. Not a description of the component. */
8
- note?: string;
9
- /** Import line for the copy control. Omitted when the demo covers several. */
10
- importPath?: string;
11
- /** Give a demo that needs room a taller ground, e.g. a table or a chart. */
12
- wide?: boolean;
13
- /** Provenance beside the name, e.g. "shadcn" on a primitive the kit took as is. */
14
- tag?: string;
15
- /** Replay control for a demo that animates once. Without it, no button. */
16
- onaction?: () => void;
17
- actionLabel?: string;
18
- children: Snippet;
19
- }
20
- </script>
21
-
22
- <script lang="ts">
23
- import { cn } from "@heyramzi/utils";
24
- import ShowcaseImport from "./ShowcaseImport.svelte";
25
- import "./showcase-shell.css";
26
-
27
- let {
28
- title,
29
- note,
30
- importPath,
31
- wide = false,
32
- tag,
33
- onaction,
34
- actionLabel = "Replay",
35
- children,
36
- }: ShowcaseStageProps = $props();
37
- </script>
38
-
39
- <article class={cn("sc-stage", wide && "sc-stage-tall")}>
40
- <header>
41
- <div class="sc-stage-name">
42
- <h3>
43
- {title}
44
- {#if tag}
45
- <span class="sc-tag">{tag}</span>
46
- {/if}
47
- </h3>
48
- {#if note}
49
- <p>{note}</p>
50
- {/if}
51
- </div>
52
-
53
- <!-- The controls sit on the header line rather than under the ground: a footer under every stage put a second full-width row between each demo -->
54
- <!-- and the next, and the page reads as demos, not as rows of chrome. In a narrow stage they drop to a line of their own, because a nowrap import -->
55
- <!-- path on the same line left the title nothing to occupy. -->
56
- <div class="sc-stage-tools">
57
- {#if onaction}
58
- <button type="button" class="sc-stage-replay" onclick={onaction}>{actionLabel}</button>
59
- {/if}
60
- {#if importPath}
61
- <ShowcaseImport path={importPath} label={title} />
62
- {/if}
63
- </div>
64
- </header>
65
-
66
- <!-- The ground is a canvas, not a card: it is what makes a white-on-white or
67
- fully transparent component visible on the surface it sits on. -->
68
- <div class="sc-ground">
69
- {@render children()}
70
- </div>
71
- </article>
72
-
73
- <style>
74
- .sc-stage {
75
- display: flex;
76
- flex-direction: column;
77
- min-width: 0;
78
- padding-block: 1.5rem;
79
- counter-increment: sc-stage;
80
- }
81
-
82
- /*
83
- * The stage answers its own width, not the viewport's: the same component serves a full-width stack and a four-column kit grid on one page. The header
84
- */
85
-
86
- /*
87
- * carries the container rather than the stage, because an element with `container-type` cannot also be a subgrid, and the kit grids need the stage
88
- */
89
-
90
- /*
91
- * to be one so every card in a band shares its tracks. The header is exactly as wide as the stage, so it measures the same thing.
92
- */
93
-
94
- /*
95
- * One explicit row, and an implicit second that takes the rest. In a wide stage
96
- */
97
-
98
- /*
99
- * the tools sit in row one, no second track exists and no row gap with it.
100
- */
101
- .sc-stage header {
102
- container-type: inline-size;
103
- display: grid;
104
- grid-template-columns: minmax(0, 1fr) auto;
105
- grid-template-rows: auto;
106
- grid-auto-rows: 1fr;
107
- align-items: start;
108
- gap: 0.5rem 1rem;
109
- padding-bottom: 0.875rem;
110
- }
111
-
112
- .sc-stage-name {
113
- grid-column: 1;
114
- grid-row: 1;
115
- display: flex;
116
- flex-direction: column;
117
- gap: 0.1875rem;
118
- min-width: 0;
119
- }
120
-
121
- /*
122
- * The number is a counter on the stage, so the page never carries an index it has to keep in step with the demos. `decimal-leading-zero` is what makes a
123
- */
124
-
125
- /*
126
- * run of these read as a set rather than as a list.
127
- */
128
- h3 {
129
- display: flex;
130
- align-items: baseline;
131
- gap: 0.5rem;
132
- margin: 0;
133
- font-size: 0.875rem;
134
- font-weight: 600;
135
- line-height: 1.3;
136
- letter-spacing: -0.006em;
137
- color: var(--color-foreground, var(--foreground));
138
- }
139
-
140
- h3::before {
141
- content: counter(sc-stage, decimal-leading-zero);
142
- font-size: 0.6875rem;
143
- font-weight: 500;
144
- font-variant-numeric: tabular-nums;
145
- color: var(--color-muted-foreground, var(--muted-foreground));
146
- opacity: 0.65;
147
- }
148
-
149
- .sc-stage-name p {
150
- margin: 0;
151
- max-width: 64ch;
152
- padding-inline-start: 1.5rem;
153
- font-size: 0.75rem;
154
- line-height: 1.5;
155
- color: var(--color-muted-foreground, var(--muted-foreground));
156
- text-wrap: pretty;
157
- }
158
-
159
- /*
160
- * The import path is the reason most people open this page, so the control is on screen rather than waiting for a pointer that a touch device never sends.
161
- */
162
-
163
- /*
164
- * It shrinks and truncates instead of pushing the title out of the header: a nowrap path at flex-shrink 0 measured 435px inside a 310px column and left
165
- */
166
-
167
- /*
168
- * the title at zero.
169
- */
170
- .sc-stage-tools {
171
- grid-column: 2;
172
- grid-row: 1;
173
- justify-self: end;
174
- display: flex;
175
- align-items: center;
176
- justify-content: flex-end;
177
- gap: 0.25rem;
178
- min-width: 0;
179
- /*
180
- * A length, not a percentage: a percentage max-width resolves to nothing while the auto column is being sized, which collapsed a 900px header's
181
- */
182
-
183
- /*
184
- * path chip to one word. This still leaves the title two thirds of a full-width header.
185
- */
186
- max-width: 24rem;
187
- }
188
-
189
- /*
190
- * Below this the header cannot hold a title and a path side by side, so the
191
- */
192
-
193
- /*
194
- * tools take a line of their own and the path gets the full column. 26rem and not 30rem: two equal columns of a 60rem section measure 29.5rem each, and at
195
- */
196
-
197
- /*
198
- * 30rem every card in the AI and charts grids spent a whole row on a copy control that fits beside the title.
199
- */
200
- @container (max-width: 26rem) {
201
- .sc-stage-name {
202
- grid-column: 1 / -1;
203
- }
204
-
205
- .sc-stage-tools {
206
- grid-column: 1 / -1;
207
- grid-row: 2;
208
- justify-self: stretch;
209
- justify-content: flex-start;
210
- max-width: 100%;
211
- /*
212
- * The kit grids stretch the header to a shared track, so sitting the tools at its foot puts every copy control on one line across the band instead
213
- */
214
-
215
- /*
216
- * of trailing whatever note happens to sit above it.
217
- */
218
- align-self: end;
219
- }
220
- }
221
-
222
- .sc-ground {
223
- flex: 1 1 auto;
224
- display: flex;
225
- flex-wrap: wrap;
226
- align-items: center;
227
- align-content: center;
228
- justify-content: center;
229
- gap: 0.75rem;
230
- /*
231
- * Tall enough that a component is not squeezed, short enough that a row of five buttons does not float in an acre of nothing. A demo that needs more
232
- */
233
-
234
- /*
235
- * asks for it with `wide`.
236
- */
237
- min-height: 10.5rem;
238
- padding: 2rem 1.75rem;
239
- border-radius: var(--radius-xl, 10px);
240
- /* A demo wider than its column scrolls inside the ground rather than bleeding
241
- past the stage edge. Overlays portal to the body, so none is clipped. */
242
- overflow: auto;
243
- /*
244
- * WHY the containment is on one axis: `overscroll-behavior: contain` made the ground refuse to chain a wheel in either direction, and a page of these is
245
- */
246
-
247
- /*
248
- * eighty grounds covering almost every pixel of it. The wheel landed on a ground, the ground had nothing to scroll vertically, and the page did not
249
- */
250
-
251
- /*
252
- * move. Only the sideways scroll of a wide demo needs containing.
253
- */
254
- overscroll-behavior-x: contain;
255
- scrollbar-width: thin;
256
- /*
257
- * A ground is recessed, not raised: it is the hole the component sits in. The dot grid is what gives a transparent component something to be seen
258
- */
259
-
260
- /*
261
- * against, and it is faint enough to disappear under a filled one.
262
- */
263
- background-color: color-mix(
264
- in oklab,
265
- var(--color-muted, var(--muted)) 45%,
266
- var(--color-background, var(--background))
267
- );
268
- background-image: radial-gradient(
269
- circle at 1px 1px,
270
- color-mix(in oklab, var(--color-border, var(--border)) 42%, transparent) 1px,
271
- transparent 0
272
- );
273
- background-size: 18px 18px;
274
- box-shadow: inset 0 0 0 1px
275
- color-mix(in oklab, var(--color-border, var(--border)) 65%, transparent);
276
- }
277
-
278
- /*
279
- * The ground keeps the full width, because it is the canvas the component is seen against. What stops is the demo standing on it: one stage per row let
280
- */
281
-
282
- /*
283
- * a card that says `width: 100%` stretch to 2000px and read as a bar. A variant row is the exception, being a stack of demos rather than one.
284
- */
285
- .sc-ground > :global(*:not(.sc-variant)) {
286
- max-width: 42rem;
287
- }
288
-
289
- .sc-stage-tall .sc-ground > :global(*:not(.sc-variant)) {
290
- max-width: 62rem;
291
- }
292
-
293
- /*
294
- * A tall ground is taller, not differently aligned. `justify-content: stretch` here read as `flex-start`, so any demo narrower than the ground sat against
295
- */
296
-
297
- /*
298
- * its left padding while every other stage on the page centred: the logo row, the list toolbar and the table each left ~380px of empty ground to their
299
- */
300
-
301
- /*
302
- * right. A demo that really wants the full width says so itself with `width: 100%`, which centring does not take away.
303
- */
304
- .sc-stage-tall .sc-ground {
305
- align-items: stretch;
306
- min-height: 19rem;
307
- }
308
-
309
- .sc-stage-replay {
310
- padding: 0.25rem 0.625rem;
311
- border: 1px solid var(--color-border, var(--border));
312
- border-radius: var(--radius-lg, 8px);
313
- font-size: 0.6875rem;
314
- font-weight: 500;
315
- color: var(--color-muted-foreground, var(--muted-foreground));
316
- background: var(--color-background, var(--background));
317
- cursor: pointer;
318
- transition:
319
- color var(--duration-quick, 150ms) var(--ease-smooth-out, ease),
320
- background-color var(--duration-quick, 150ms) var(--ease-smooth-out, ease),
321
- transform var(--duration-micro, 80ms) var(--ease-smooth-out, ease);
322
- }
323
-
324
- .sc-stage-replay:hover {
325
- color: var(--color-foreground, var(--foreground));
326
- background: color-mix(in oklab, var(--color-muted, var(--muted)) 70%, transparent);
327
- }
328
-
329
- .sc-stage-replay:active {
330
- transform: translateY(1px);
331
- }
332
-
333
- @media (prefers-reduced-motion: reduce) {
334
- .sc-stage-replay {
335
- transition: none;
336
- }
337
-
338
- .sc-stage-replay:active {
339
- transform: none;
340
- }
341
- }
342
- </style>
@@ -1,109 +0,0 @@
1
- <script lang="ts" module>
2
- import type { Snippet } from "svelte";
3
-
4
- export interface ShowcaseVariantProps {
5
- /** What this variant changes, e.g. "size=line, ocean". */
6
- label: string;
7
- children: Snippet;
8
- }
9
- </script>
10
-
11
- <script lang="ts">
12
- let { label, children }: ShowcaseVariantProps = $props();
13
- </script>
14
-
15
- <!-- One cell of a family stage. Four BorderBeams are one component, so they share a stage and a copy control instead of taking four numbered slots, and -->
16
- <!-- they sit side by side because that is how presets are compared. -->
17
- <div class="sc-variant">
18
- <span class="sc-variant-label">{label}</span>
19
- <div class="sc-variant-body">
20
- {@render children()}
21
- </div>
22
- </div>
23
-
24
- <style>
25
- /*
26
- * A family stage is not one ground carrying cells: each variant is a ground of its own, and they stand side by side, one column each, the way the four
27
- */
28
-
29
- /*
30
- * BorderBeams read before they shared a stage. Global because the ground belongs to the stage, and the rule only exists where a variant renders.
31
- */
32
- :global(.sc-ground:has(> .sc-variant)) {
33
- display: grid;
34
- /*
35
- * Four across at most, and never a cell under 16rem: five in a row squeezed the gauge card until its caption ran one word per line. Two variants take
36
- */
37
-
38
- /*
39
- * half the row each, four take a quarter.
40
- */
41
- grid-template-columns: repeat(auto-fit, minmax(max(16rem, calc((100% - 3rem) / 4)), 1fr));
42
- gap: 1rem;
43
- padding: 0;
44
- min-height: 0;
45
- overflow: visible;
46
- background: none;
47
- box-shadow: none;
48
- }
49
-
50
- /* Below this a row of cells is narrower than the demos standing on them. */
51
- @media (max-width: 60rem) {
52
- :global(.sc-ground:has(> .sc-variant)) {
53
- grid-template-columns: minmax(0, 1fr);
54
- }
55
- }
56
-
57
- /* The cell is the ground: same recess, same dot grid, same hairline. */
58
- .sc-variant {
59
- display: flex;
60
- flex-direction: column;
61
- gap: 0.625rem;
62
- min-width: 0;
63
- min-height: 10.5rem;
64
- padding: 1.25rem;
65
- border-radius: var(--radius-xl, 10px);
66
- /* A demo wider than its column scrolls in the cell, not past the stage. */
67
- overflow: auto;
68
- overscroll-behavior-x: contain;
69
- scrollbar-width: thin;
70
- background-color: color-mix(
71
- in oklab,
72
- var(--color-muted, var(--muted)) 45%,
73
- var(--color-background, var(--background))
74
- );
75
- background-image: radial-gradient(
76
- circle at 1px 1px,
77
- color-mix(in oklab, var(--color-border, var(--border)) 42%, transparent) 1px,
78
- transparent 0
79
- );
80
- background-size: 18px 18px;
81
- box-shadow: inset 0 0 0 1px
82
- color-mix(in oklab, var(--color-border, var(--border)) 65%, transparent);
83
- }
84
-
85
- .sc-variant-label {
86
- font-size: 0.6875rem;
87
- font-weight: 500;
88
- letter-spacing: 0.04em;
89
- color: var(--color-muted-foreground, var(--muted-foreground));
90
- font-family: ui-monospace, SFMono-Regular, monospace;
91
- overflow-wrap: anywhere;
92
- }
93
-
94
- .sc-variant-body {
95
- display: flex;
96
- flex: 1 1 auto;
97
- flex-wrap: wrap;
98
- align-items: center;
99
- justify-content: center;
100
- gap: 0.75rem;
101
- width: 100%;
102
- min-width: 0;
103
- }
104
-
105
- /* The cell spans its column; the demo on it stops where a card stops. */
106
- .sc-variant-body > :global(*) {
107
- max-width: 42rem;
108
- }
109
- </style>
@@ -1 +0,0 @@
1
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m20 6-11 11-5-5" /></svg>
@@ -1,2 +0,0 @@
1
- <svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path class="t-learn-arm t-learn-arm-top" d="M6 4L10 8" />
2
- <path class="t-learn-arm t-learn-arm-bot" d="M10 8L6 12" /></svg>
@@ -1 +0,0 @@
1
- <svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M4 6.5L8 10.5L12 6.5" /></svg>
@@ -1,2 +0,0 @@
1
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="12" height="12" rx="2" />
2
- <path d="M5 15V5a2 2 0 0 1 2-2h10" /></svg>
@@ -1,59 +0,0 @@
1
- <script lang="ts">
2
- import {
3
- Confirmation,
4
- ConfirmationTitle,
5
- ConfirmationRequest,
6
- ConfirmationAccepted,
7
- ConfirmationRejected,
8
- ConfirmationActions,
9
- ConfirmationAction,
10
- type ConfirmationState,
11
- } from "../../../ai/index.js";
12
-
13
- let kind = $state<ConfirmationState>("requested");
14
- </script>
15
-
16
- <div class="stack">
17
- <Confirmation {kind}>
18
- <ConfirmationTitle>Delete 3 stale views?</ConfirmationTitle>
19
- <ConfirmationRequest>
20
- <p class="body">Removes the views from the workspace. This can't be undone.</p>
21
- <ConfirmationActions>
22
- <ConfirmationAction variant="outline" onclick={() => (kind = "rejected")}>
23
- Cancel
24
- </ConfirmationAction>
25
- <ConfirmationAction onclick={() => (kind = "accepted")}>Delete</ConfirmationAction>
26
- </ConfirmationActions>
27
- </ConfirmationRequest>
28
- <ConfirmationAccepted>Deleted 3 views.</ConfirmationAccepted>
29
- <ConfirmationRejected>Kept the views.</ConfirmationRejected>
30
- </Confirmation>
31
-
32
- {#if kind !== "requested"}
33
- <button type="button" class="reset" onclick={() => (kind = "requested")}>Reset</button>
34
- {/if}
35
- </div>
36
-
37
- <style>
38
- .stack {
39
- display: flex;
40
- flex-direction: column;
41
- gap: 0.625rem;
42
- width: 100%;
43
- }
44
- .body {
45
- margin: 0;
46
- font-size: 0.8125rem;
47
- color: var(--muted-foreground);
48
- }
49
- .reset {
50
- align-self: flex-start;
51
- padding: 0.375rem 0.75rem;
52
- font-size: 0.75rem;
53
- color: var(--foreground);
54
- background: var(--card);
55
- border: 1px solid var(--border);
56
- border-radius: 0.5rem;
57
- cursor: pointer;
58
- }
59
- </style>