@spunto/design-system 0.15.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -91,6 +91,35 @@ export {
91
91
  AlertDialogDescription,
92
92
  } from "./components/alert-dialog"
93
93
 
94
+ // Sheet — the same Base UI dialog, entering from an edge. `side` picks the edge,
95
+ // `size` how far it comes in; both resolve to plain utilities so `className`
96
+ // stays the layout escape hatch (no `!important` needed to widen a panel).
97
+ export {
98
+ Sheet,
99
+ SheetTrigger,
100
+ SheetClose,
101
+ SheetContent,
102
+ SheetHeader,
103
+ SheetFooter,
104
+ SheetTitle,
105
+ SheetDescription,
106
+ } from "./components/sheet"
107
+ export type { SheetContentProps, SheetSide, SheetSize } from "./components/sheet"
108
+
109
+ // Table — presentational only (no sorting, no pagination): apps own that logic,
110
+ // what they were duplicating is the markup and the tokens.
111
+ export {
112
+ Table,
113
+ TableHeader,
114
+ TableBody,
115
+ TableFooter,
116
+ TableRow,
117
+ TableHead,
118
+ TableCell,
119
+ TableCaption,
120
+ } from "./components/table"
121
+ export type { TableProps } from "./components/table"
122
+
94
123
  // CommandPalette — the ⌘K palette, domain-free: an input, groups, items, and a
95
124
  // jump. Base UI `Autocomplete` (roles + ↑↓ navigation) rendered inline inside a
96
125
  // Base UI `Dialog` (focus trap + Escape), portalled into the provider's overlay
@@ -121,6 +150,33 @@ export type {
121
150
  CommandPaletteLinkRender,
122
151
  } from "./components/command-palette"
123
152
 
153
+ // CommandMenu — the same parts, inline: a Base UI `Popover` anchored to whatever
154
+ // the caller points at (an element or a caret rect), which **never moves focus**
155
+ // (`initialFocus`/`finalFocus` off, no backdrop, non-modal) and takes ↑ ↓ ↵ esc on
156
+ // `document` in the capture phase. That's what a "/" menu inside an editor needs
157
+ // and what the dialog-based palette can't do without losing the caret.
158
+ export {
159
+ CommandMenu,
160
+ CommandMenuInput,
161
+ CommandMenuList,
162
+ CommandMenuGroup,
163
+ CommandMenuSeparator,
164
+ CommandMenuItem,
165
+ CommandMenuEmpty,
166
+ CommandMenuLoading,
167
+ } from "./components/command-menu"
168
+ export type {
169
+ CommandMenuProps,
170
+ CommandMenuInputProps,
171
+ CommandMenuGroupProps,
172
+ CommandMenuItemProps,
173
+ CommandMenuLoadingProps,
174
+ CommandMenuFilter,
175
+ CommandMenuFilterItem,
176
+ CommandMenuLinkProps,
177
+ CommandMenuLinkRender,
178
+ } from "./components/command-menu"
179
+
124
180
  // Kbd — one keyboard cap, or a whole shortcut (`keys="mod+k"` → ⌘ K). Used by the
125
181
  // palette, exported on its own for anywhere else a shortcut needs drawing.
126
182
  export { Kbd } from "./components/kbd"
package/styles.css CHANGED
@@ -199,6 +199,9 @@
199
199
  --color-ship: var(--ship);
200
200
  --color-run: var(--run);
201
201
  --color-flame: var(--flame);
202
+ /* Marketing surfaces — the two fixed dark values (see `--night` below) */
203
+ --color-night: var(--night);
204
+ --color-code-surface: var(--code-surface);
202
205
  /* Square-leaning radius scale — driven by --radius (4px base) */
203
206
  --radius-sm: calc(var(--radius) * 0.5);
204
207
  --radius-md: calc(var(--radius) * 0.75);
@@ -311,6 +314,26 @@
311
314
  --sidebar-ring: oklch(0.70 0.20 43);
312
315
  }
313
316
 
317
+ /* ─── Marketing night surfaces — deliberately NOT themed ─────────────────────
318
+ *
319
+ * Two dark values that stay the same in light and dark mode, because they are
320
+ * the *dark moment* of a page rather than a surface that follows the theme:
321
+ *
322
+ * --night the contrast band a marketing page opens on (`NightBand`).
323
+ * Deeper than the dark theme's own background (0.155) so the
324
+ * band still reads as a band when the whole site is dark.
325
+ * --code-surface the warm dark behind a snippet or a copyable command
326
+ * (`CodeBlock`, `CopyCommand`) — the same one every
327
+ * terminal-ish panel of the site uses.
328
+ *
329
+ * They live here, as tokens (`bg-night`, `bg-code-surface`), precisely because
330
+ * they used to be two near-identical `oklch(…)` literals copy-pasted into two
331
+ * component files — which is how a design system ends up with two blacks. */
332
+ :root {
333
+ --night: oklch(0.14 0.013 50);
334
+ --code-surface: oklch(0.16 0.012 52);
335
+ }
336
+
314
337
  /* ─── Base layer ─────────────────────────────────────────────────────────── */
315
338
  @layer base {
316
339
  * {
@@ -367,6 +390,50 @@
367
390
  linear-gradient(to bottom, oklch(0.92 0.04 70 / 0.04) 1px, transparent 1px);
368
391
  }
369
392
 
393
+ /* ─── Night band utilities (@spunto/design-system/marketing) ─────────────────
394
+ * The blueprint grid, the drifting light sources and the scrollbar of a `<pre>`
395
+ * sitting on a dark surface. Never themed — like `--night` itself, these paint
396
+ * on a fixed dark band, so there is no `.dark` variant. */
397
+ .night-grid {
398
+ background-image:
399
+ linear-gradient(to right, oklch(0.92 0.04 70 / 0.05) 1px, transparent 1px),
400
+ linear-gradient(to bottom, oklch(0.92 0.04 70 / 0.05) 1px, transparent 1px);
401
+ background-size: 56px 56px;
402
+ }
403
+
404
+ /* The light source on a night band drifts, slowly enough that you notice it
405
+ only if you stay. Pure CSS on purpose — this is usually the most-viewed
406
+ element of a page and it has no business holding a rAF loop open. */
407
+ @keyframes night-drift-a {
408
+ 0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
409
+ 50% { transform: translate3d(6%, 4%, 0) scale(1.12); }
410
+ }
411
+ @keyframes night-drift-b {
412
+ 0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); }
413
+ 50% { transform: translate3d(-7%, -5%, 0) scale(1); }
414
+ }
415
+ .night-glow-a { animation: night-drift-a 26s ease-in-out infinite; }
416
+ .night-glow-b { animation: night-drift-b 34s ease-in-out infinite; }
417
+
418
+ @media (prefers-reduced-motion: reduce) {
419
+ .night-glow-a,
420
+ .night-glow-b {
421
+ animation: none;
422
+ }
423
+ }
424
+
425
+ /* Scrollable code on a night surface: the global thumb is `--border`, which is
426
+ cream in the light theme and lands as a bright bar under a dark <pre>. */
427
+ .night-scroll::-webkit-scrollbar-thumb {
428
+ background: oklch(1 0 0 / 0.18);
429
+ }
430
+ .night-scroll::-webkit-scrollbar-thumb:hover {
431
+ background: oklch(1 0 0 / 0.3);
432
+ }
433
+ .night-scroll {
434
+ scrollbar-color: oklch(1 0 0 / 0.18) transparent;
435
+ }
436
+
370
437
  /* ─── Toast — stacking + enter/exit motion (mounted by SpuntoProvider) ─────
371
438
  *
372
439
  * The look (colors, spacing, typography) lives on the components as Tailwind