dssoca 0.11.0 → 0.13.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 (49) hide show
  1. package/dist/components/Accordion.svelte +35 -15
  2. package/dist/components/Accordion.svelte.d.ts +7 -0
  3. package/dist/components/Avatar.svelte +5 -9
  4. package/dist/components/Badge.svelte +27 -53
  5. package/dist/components/Badge.svelte.d.ts +2 -5
  6. package/dist/components/BottomNav.svelte +2 -2
  7. package/dist/components/BoxPlot.svelte +2 -8
  8. package/dist/components/BumpChart.svelte +2 -8
  9. package/dist/components/Button.svelte +50 -34
  10. package/dist/components/Button.svelte.d.ts +8 -2
  11. package/dist/components/Chart.svelte +2 -8
  12. package/dist/components/DateField.svelte +1 -1
  13. package/dist/components/FileDrop.svelte +1 -1
  14. package/dist/components/Icon.svelte +29 -7
  15. package/dist/components/Icon.svelte.d.ts +14 -2
  16. package/dist/components/Input.svelte +1 -1
  17. package/dist/components/Kbd.svelte +120 -0
  18. package/dist/components/Kbd.svelte.d.ts +30 -0
  19. package/dist/components/LogStream.svelte +3 -3
  20. package/dist/components/Menu.svelte +1 -1
  21. package/dist/components/NumberField.svelte +1 -1
  22. package/dist/components/ScatterPlot.svelte +2 -8
  23. package/dist/components/SearchPalette.svelte +526 -0
  24. package/dist/components/SearchPalette.svelte.d.ts +82 -0
  25. package/dist/components/Select.svelte +1 -1
  26. package/dist/components/ServiceCard.svelte +13 -2
  27. package/dist/components/ShortcutsHelp.svelte +365 -0
  28. package/dist/components/ShortcutsHelp.svelte.d.ts +34 -0
  29. package/dist/components/Sidebar.svelte +1 -1
  30. package/dist/components/Spinner.svelte +26 -19
  31. package/dist/components/Spinner.svelte.d.ts +14 -4
  32. package/dist/components/Switch.svelte +32 -2
  33. package/dist/components/Switch.svelte.d.ts +5 -0
  34. package/dist/components/Textarea.svelte +1 -1
  35. package/dist/components/Topbar.svelte +41 -26
  36. package/dist/components/Topbar.svelte.d.ts +5 -2
  37. package/dist/config.d.ts +44 -3
  38. package/dist/config.js +52 -3
  39. package/dist/dssoca.config.d.ts +39 -2
  40. package/dist/dssoca.config.js +49 -0
  41. package/dist/index.d.ts +10 -5
  42. package/dist/index.js +11 -4
  43. package/dist/palette.d.ts +10 -0
  44. package/dist/palette.js +17 -0
  45. package/dist/shortcuts.svelte.d.ts +192 -0
  46. package/dist/shortcuts.svelte.js +633 -0
  47. package/dist/theme.css +158 -158
  48. package/dist/tokens.css +158 -158
  49. package/package.json +4 -3
@@ -22,6 +22,13 @@
22
22
  <script lang="ts">
23
23
  import type { Snippet } from 'svelte'
24
24
  import { resolveComponentSize, type Size } from '../config.js'
25
+ import {
26
+ ariaKeyshortcuts,
27
+ detectPlatform,
28
+ shortcuts,
29
+ type ShortcutPlatform,
30
+ } from '../shortcuts.svelte.js'
31
+ import Kbd from './Kbd.svelte'
25
32
 
26
33
  interface Stat {
27
34
  key: string
@@ -36,8 +43,11 @@
36
43
  tabs?: Array<string | TopbarTab>
37
44
  /** Fired with the tab id when a tab is activated (also for `href` tabs). */
38
45
  onTab?: (tab: string) => void
39
- /** Fired when the command menu is opened (chip click or Cmd/Ctrl+K).
40
- * The ⌘K chip and the shortcut only exist when this handler is provided. */
46
+ /** Fired when the command menu is opened (chip click or mod+K — Cmd+K on
47
+ * Apple platforms, Ctrl+K elsewhere). Registered through the shortcut
48
+ * registry as `ss:topbar-command` (DS-0139), so it lists in ShortcutsHelp
49
+ * and obeys `setEnabled`/`remap`. The ⌘K chip and the shortcut only
50
+ * exist when this handler is provided. */
41
51
  onCommand?: () => void
42
52
  /** Fired when the user chip is activated (when no `userMenu` snippet given). */
43
53
  onUser?: () => void
@@ -88,10 +98,14 @@
88
98
  size,
89
99
  }: Props = $props()
90
100
 
91
- // SSR safety (DS-0067): same guard pattern as toast.svelte.ts — effects
92
- // normally don't run on the server, but the guard is the house convention
93
- // and protects against eager evaluation.
94
- const hasWindow = typeof window !== 'undefined'
101
+ // Platform detection mirrors Kbd's hydration posture (DS-0139): 'other' on
102
+ // the server and the first client render, corrected in an effect so server
103
+ // and client first paints agree.
104
+ let platform = $state<ShortcutPlatform>('other')
105
+ $effect(() => {
106
+ // not a writable $derived: detection must NOT run during hydration render
107
+ if (platform === 'other') platform = detectPlatform()
108
+ })
95
109
 
96
110
  // DS-0080: normalize both tab shapes to one internal form. `string` tabs
97
111
  // keep id === label; object tabs default `label` to `id`.
@@ -122,18 +136,23 @@
122
136
  time = nowStr()
123
137
  }, 1000)
124
138
  : undefined
125
- const onKey = (e: KeyboardEvent) => {
126
- // Only claim the Cmd/Ctrl+K shortcut when a command handler exists
127
- // (DS-0081) — otherwise leave the browser's default alone.
128
- if (onCommand && (e.metaKey || e.ctrlKey) && (e.key === 'k' || e.key === 'K')) {
129
- e.preventDefault()
130
- onCommand()
131
- }
132
- }
133
- if (hasWindow) window.addEventListener('keydown', onKey)
139
+ // DS-0139: the shortcut goes through the registry (id `ss:topbar-command`)
140
+ // instead of a hand-rolled window listener — discoverable in ShortcutsHelp,
141
+ // disable/remap-able (WCAG 2.1.4), deterministic on collision. Only claim
142
+ // mod+k when a command handler exists (DS-0081) — otherwise leave the
143
+ // browser's default alone. `add()` is SSR-safe (no-op without `window`).
144
+ const dispose = onCommand
145
+ ? shortcuts.add({
146
+ id: 'ss:topbar-command',
147
+ label: 'Open command menu',
148
+ keys: 'mod+k',
149
+ allowInInputs: true, // chorded — safe while typing, like Slack/GitHub
150
+ onPress: () => onCommand?.(),
151
+ })
152
+ : undefined
134
153
  return () => {
135
154
  if (t) clearInterval(t)
136
- if (hasWindow) window.removeEventListener('keydown', onKey)
155
+ dispose?.()
137
156
  }
138
157
  })
139
158
 
@@ -248,11 +267,11 @@
248
267
  {#if onCommand}
249
268
  <button
250
269
  class="seg right click cmd"
251
- aria-keyshortcuts="Meta+K Control+K"
270
+ aria-keyshortcuts={ariaKeyshortcuts('mod+k', platform)}
252
271
  aria-label="Open command menu"
253
272
  onclick={() => onCommand?.()}
254
273
  >
255
- <span class="kbd" aria-hidden="true">⌘K</span>
274
+ <span class="kbd" aria-hidden="true"><Kbd keys="mod+k" {platform} {size} /></span>
256
275
  </button>
257
276
  {/if}
258
277
 
@@ -293,7 +312,7 @@
293
312
  left: var(--ss-s-1);
294
313
  top: var(--ss-s-1);
295
314
  z-index: 20;
296
- padding: var(--ss-badge-py) var(--ss-badge-px);
315
+ padding: var(--ss-chip-py) var(--ss-badge-px);
297
316
  background: var(--ss-primary);
298
317
  color: var(--ss-fg-on-primary);
299
318
  font: 500 var(--ss-ui-md) var(--ss-font-mono);
@@ -383,7 +402,7 @@
383
402
  }
384
403
  .ss-topbar .ws .tab.active {
385
404
  color: var(--ss-fg);
386
- background: rgba(102, 239, 115, 0.06);
405
+ background: color-mix(in srgb, var(--ss-accent) 6%, transparent);
387
406
  box-shadow: inset 0 -2px 0 var(--ss-primary);
388
407
  }
389
408
  .ss-topbar .ws .tab.active .n {
@@ -417,12 +436,8 @@
417
436
  margin: 0 2px;
418
437
  }
419
438
  .ss-topbar .kbd {
420
- font-family: var(--ss-font-mono);
421
- font-size: var(--ss-ui-sm);
422
- color: var(--ss-fg-muted);
423
- border: 1px solid var(--ss-line);
424
- padding: 2px 5px;
425
- line-height: 1;
439
+ display: inline-flex;
440
+ align-items: center;
426
441
  }
427
442
  @media (max-width: 720px) {
428
443
  .ss-topbar .collapsible {
@@ -29,8 +29,11 @@ interface Props {
29
29
  tabs?: Array<string | TopbarTab>;
30
30
  /** Fired with the tab id when a tab is activated (also for `href` tabs). */
31
31
  onTab?: (tab: string) => void;
32
- /** Fired when the command menu is opened (chip click or Cmd/Ctrl+K).
33
- * The ⌘K chip and the shortcut only exist when this handler is provided. */
32
+ /** Fired when the command menu is opened (chip click or mod+K — Cmd+K on
33
+ * Apple platforms, Ctrl+K elsewhere). Registered through the shortcut
34
+ * registry as `ss:topbar-command` (DS-0139), so it lists in ShortcutsHelp
35
+ * and obeys `setEnabled`/`remap`. The ⌘K chip and the shortcut only
36
+ * exist when this handler is provided. */
34
37
  onCommand?: () => void;
35
38
  /** Fired when the user chip is activated (when no `userMenu` snippet given). */
36
39
  onUser?: () => void;
package/dist/config.d.ts CHANGED
@@ -12,9 +12,10 @@
12
12
  * 2. `componentsSize[Name]` (per-component default)
13
13
  * 3. `sizeVariant` on an ancestor (global default; `md` out of the box)
14
14
  */
15
- import { dssocaConfig, type ColorTheme, type Size, type ComponentName, type ComponentsSize } from './dssoca.config.js';
16
- export { dssocaConfig };
17
- export type { ColorTheme, Size, ComponentName, ComponentsSize };
15
+ import { dssocaConfig, PALETTE_SLOTS, type ColorTheme, type Size, type ComponentName, type ComponentsSize, type SpinnerVariant, type Palette, type ThemePalette, type PaletteSlot } from './dssoca.config.js';
16
+ export { dssocaConfig, PALETTE_SLOTS };
17
+ export type { ColorTheme, Size, ComponentName, ComponentsSize, SpinnerVariant };
18
+ export type { Palette, ThemePalette, PaletteSlot };
18
19
  export type { DssocaConfig, DesignAxis } from './dssoca.config.js';
19
20
  export interface DesignConfig {
20
21
  theme: ColorTheme;
@@ -22,9 +23,28 @@ export interface DesignConfig {
22
23
  sizeVariant: Size;
23
24
  /** Per-component default sizes; components not listed inherit `sizeVariant`. */
24
25
  componentsSize: ComponentsSize;
26
+ /**
27
+ * Global default Spinner glyph (DS-0108). Unlike `theme`/`sizeVariant` this is
28
+ * NOT a CSS axis — it is never painted as a `data-*` attribute (see
29
+ * `designAttributes`, which intentionally omits it). It threads to the Spinner
30
+ * component through `resolveSpinnerVariant`; a per-usage `variant` prop wins.
31
+ */
32
+ spinnerVariant: SpinnerVariant;
33
+ /**
34
+ * Custom root palette (color rework) — both themes' 19 slot values, e.g.
35
+ * generated by the docs Theme Builder. `null` = the built-in palette.
36
+ * Tri-state in `applyDesignConfig` partials: omit to keep the current
37
+ * palette, pass a `Palette` to set one, pass `null` to clear back to the
38
+ * stylesheet values. Applied as inline custom properties for the ACTIVE
39
+ * theme only, and re-written on every call so a theme flip never gets
40
+ * masked by stale inline values.
41
+ */
42
+ palette: Palette | null;
25
43
  }
26
44
  /** Defaults derived from the manifest — change them in `dssoca.config.ts`. */
27
45
  export declare const defaultDesignConfig: DesignConfig;
46
+ /** camelCase slot → its CSS custom property ('brightBlack' → '--ss-bright-black'). */
47
+ export declare const paletteSlotVar: (slot: PaletteSlot) => string;
28
48
  /** Current resolved config (last applied, or defaults). */
29
49
  export declare function getDesignConfig(): DesignConfig;
30
50
  /**
@@ -32,6 +52,10 @@ export declare function getDesignConfig(): DesignConfig;
32
52
  * correct theme + size paint on the first frame with no flash.
33
53
  *
34
54
  * <html {...designAttributes({ sizeVariant: 'sm' })}> … </html>
55
+ *
56
+ * Only the CSS axes (`theme`, `sizeVariant`) appear here. `spinnerVariant` is a
57
+ * default-prop axis, not a CSS one, so it is deliberately omitted (DS-0108) — it
58
+ * is consumed via `resolveSpinnerVariant`, never as a `data-*` attribute.
35
59
  */
36
60
  export declare function designAttributes(config?: Partial<DesignConfig>): {
37
61
  'data-theme': ColorTheme;
@@ -43,6 +67,15 @@ export declare function designAttributes(config?: Partial<DesignConfig>): {
43
67
  * merged key-by-key). SSR-safe: no-op when no document and no explicit target.
44
68
  */
45
69
  export declare function applyDesignConfig(config?: Partial<DesignConfig>, target?: HTMLElement): DesignConfig;
70
+ /**
71
+ * Emit a custom palette as a CSS override block — the zero-JS / SSR path. Ship
72
+ * it AFTER `dssoca/theme.css` in source order (equal specificity, order wins):
73
+ *
74
+ * <style>{paletteToCss(palette)}</style>
75
+ *
76
+ * The docs Theme Builder's "CSS" export is exactly this output.
77
+ */
78
+ export declare function paletteToCss(palette: Palette): string;
46
79
  /**
47
80
  * Resolve the size a component should APPLY on its own root (as
48
81
  * `data-size-variant`), or `undefined` to inherit the global `sizeVariant`
@@ -50,3 +83,11 @@ export declare function applyDesignConfig(config?: Partial<DesignConfig>, target
50
83
  * `componentsSize[name]` → inherit.
51
84
  */
52
85
  export declare function resolveComponentSize(name: ComponentName, size?: Size): Size | undefined;
86
+ /**
87
+ * Resolve the Spinner glyph a component should render: an explicit `variant`
88
+ * wins, else the configured global `spinnerVariant` (DS-0108). Mirrors
89
+ * `resolveComponentSize`, but ALWAYS returns a concrete variant (never
90
+ * `undefined`) — there is no CSS cascade for the glyph, so the component needs a
91
+ * definite value to pick frames.
92
+ */
93
+ export declare function resolveSpinnerVariant(variant?: SpinnerVariant): SpinnerVariant;
package/dist/config.js CHANGED
@@ -12,28 +12,41 @@
12
12
  * 2. `componentsSize[Name]` (per-component default)
13
13
  * 3. `sizeVariant` on an ancestor (global default; `md` out of the box)
14
14
  */
15
- import { dssocaConfig, } from './dssoca.config.js';
15
+ import { dssocaConfig, PALETTE_SLOTS, } from './dssoca.config.js';
16
16
  // Re-exported so the `dssoca` / `./config` import paths expose the config vocab.
17
- export { dssocaConfig };
17
+ export { dssocaConfig, PALETTE_SLOTS };
18
18
  /** Defaults derived from the manifest — change them in `dssoca.config.ts`. */
19
19
  export const defaultDesignConfig = {
20
20
  theme: dssocaConfig.theme.default,
21
21
  sizeVariant: dssocaConfig.size.default,
22
22
  componentsSize: {},
23
+ spinnerVariant: dssocaConfig.spinner.default,
24
+ palette: null,
23
25
  };
24
26
  let current = {
25
27
  ...defaultDesignConfig,
26
28
  componentsSize: { ...defaultDesignConfig.componentsSize },
27
29
  };
30
+ const copyPalette = (p) => p === null ? null : { dark: { ...p.dark }, light: { ...p.light } };
31
+ /** camelCase slot → its CSS custom property ('brightBlack' → '--ss-bright-black'). */
32
+ export const paletteSlotVar = (slot) => '--ss-' + slot.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());
28
33
  /** Current resolved config (last applied, or defaults). */
29
34
  export function getDesignConfig() {
30
- return { ...current, componentsSize: { ...current.componentsSize } };
35
+ return {
36
+ ...current,
37
+ componentsSize: { ...current.componentsSize },
38
+ palette: copyPalette(current.palette),
39
+ };
31
40
  }
32
41
  /**
33
42
  * Build the `data-*` attribute map for a config — handy for SSR / markup so the
34
43
  * correct theme + size paint on the first frame with no flash.
35
44
  *
36
45
  * <html {...designAttributes({ sizeVariant: 'sm' })}> … </html>
46
+ *
47
+ * Only the CSS axes (`theme`, `sizeVariant`) appear here. `spinnerVariant` is a
48
+ * default-prop axis, not a CSS one, so it is deliberately omitted (DS-0108) — it
49
+ * is consumed via `resolveSpinnerVariant`, never as a `data-*` attribute.
37
50
  */
38
51
  export function designAttributes(config = {}) {
39
52
  const merged = { ...defaultDesignConfig, ...config };
@@ -49,14 +62,40 @@ export function applyDesignConfig(config = {}, target) {
49
62
  ...current,
50
63
  ...config,
51
64
  componentsSize: { ...current.componentsSize, ...(config.componentsSize ?? {}) },
65
+ // Tri-state: absent = keep, Palette = set (defensive copy), null = clear.
66
+ palette: config.palette === undefined ? current.palette : copyPalette(config.palette),
52
67
  };
53
68
  const el = target ?? (typeof document !== 'undefined' ? document.documentElement : undefined);
54
69
  if (el) {
55
70
  el.setAttribute('data-theme', current.theme);
56
71
  el.setAttribute('data-size-variant', current.sizeVariant);
72
+ // Palette runs on EVERY call: inline slot values always track the active
73
+ // theme (a later theme flip re-writes the other set), and clearing removes
74
+ // them so the stylesheet palette resumes.
75
+ for (const slot of PALETTE_SLOTS) {
76
+ if (current.palette)
77
+ el.style.setProperty(paletteSlotVar(slot), current.palette[current.theme][slot]);
78
+ else
79
+ el.style.removeProperty(paletteSlotVar(slot));
80
+ }
57
81
  }
58
82
  return getDesignConfig();
59
83
  }
84
+ /**
85
+ * Emit a custom palette as a CSS override block — the zero-JS / SSR path. Ship
86
+ * it AFTER `dssoca/theme.css` in source order (equal specificity, order wins):
87
+ *
88
+ * <style>{paletteToCss(palette)}</style>
89
+ *
90
+ * The docs Theme Builder's "CSS" export is exactly this output.
91
+ */
92
+ export function paletteToCss(palette) {
93
+ const block = (selector, theme) => `${selector} {\n${PALETTE_SLOTS.map((s) => ` ${paletteSlotVar(s)}: ${theme[s]};`).join('\n')}\n}`;
94
+ return [
95
+ block(`:root,\n[data-theme='dark']`, palette.dark),
96
+ block(`[data-theme='light']`, palette.light),
97
+ ].join('\n\n');
98
+ }
60
99
  /**
61
100
  * Resolve the size a component should APPLY on its own root (as
62
101
  * `data-size-variant`), or `undefined` to inherit the global `sizeVariant`
@@ -66,3 +105,13 @@ export function applyDesignConfig(config = {}, target) {
66
105
  export function resolveComponentSize(name, size) {
67
106
  return size ?? current.componentsSize[name];
68
107
  }
108
+ /**
109
+ * Resolve the Spinner glyph a component should render: an explicit `variant`
110
+ * wins, else the configured global `spinnerVariant` (DS-0108). Mirrors
111
+ * `resolveComponentSize`, but ALWAYS returns a concrete variant (never
112
+ * `undefined`) — there is no CSS cascade for the glyph, so the component needs a
113
+ * definite value to pick frames.
114
+ */
115
+ export function resolveSpinnerVariant(variant) {
116
+ return variant ?? current.spinnerVariant;
117
+ }
@@ -20,11 +20,27 @@ export interface DesignAxis<Values extends readonly string[] = readonly string[]
20
20
  /** The value applied when a consumer sets nothing. */
21
21
  readonly default: Values[number];
22
22
  }
23
- /** Shape of the manifest — one entry per axis the design system understands. */
23
+ /**
24
+ * Shape of the manifest — one entry per axis the design system understands.
25
+ *
26
+ * Note the asymmetry: `theme` and `size` are *CSS axes* (painted as
27
+ * `data-theme` / `data-size-variant`); `spinner` is a plain default-prop axis
28
+ * (the chosen Spinner glyph) with no `data-*` attribute — it threads through the
29
+ * config to `resolveSpinnerVariant`, not the cascade (DS-0108).
30
+ */
24
31
  export interface DssocaConfig {
25
32
  readonly theme: DesignAxis;
26
33
  readonly size: DesignAxis;
34
+ readonly spinner: DesignAxis;
27
35
  }
36
+ /**
37
+ * Single source of truth for the Spinner *variant names* (DS-0108). The frame
38
+ * data lives in `Spinner.svelte`'s `SPINNER_VARIANTS`, but its keys are pinned
39
+ * to this list (`satisfies Record<SpinnerVariant, …>`) so the two cannot drift.
40
+ */
41
+ export declare const SPINNER_VARIANT_NAMES: readonly ["boxBounce2", "boxBounce", "squareCorners", "toggle2", "toggle3", "toggle4", "pipe", "line", "growVertical", "growHorizontal"];
42
+ /** Spinner variant names — derived from the manifest's `spinner` axis. */
43
+ export type SpinnerVariant = (typeof dssocaConfig)['spinner']['values'][number];
28
44
  /**
29
45
  * The manifest. `as const` preserves the value/default literals so the unions
30
46
  * below can be derived from it; `satisfies` validates the shape without widening.
@@ -38,13 +54,34 @@ export declare const dssocaConfig: {
38
54
  readonly values: readonly ["sm", "md", "lg"];
39
55
  readonly default: "md";
40
56
  };
57
+ readonly spinner: {
58
+ readonly values: readonly ["boxBounce2", "boxBounce", "squareCorners", "toggle2", "toggle3", "toggle4", "pipe", "line", "growVertical", "growHorizontal"];
59
+ readonly default: "boxBounce2";
60
+ };
41
61
  };
42
62
  /** Color axis values — derived from the manifest (`'dark' | 'light'`). */
43
63
  export type ColorTheme = (typeof dssocaConfig)['theme']['values'][number];
64
+ /**
65
+ * The 19 root palette slots (color rework): the 16 ANSI terminal colors plus
66
+ * `bg`, `fg`, and the one vivid `accent`. Every semantic `--ss-*` token derives
67
+ * from these, so overriding them — via `applyDesignConfig({ palette })` or a
68
+ * CSS block from `paletteToCss` — recolors the whole system. camelCase here;
69
+ * the CSS custom property is the kebab-cased `--ss-` name
70
+ * (`brightBlack` → `--ss-bright-black`).
71
+ */
72
+ export declare const PALETTE_SLOTS: readonly ["bg", "fg", "accent", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "brightBlack", "brightRed", "brightGreen", "brightYellow", "brightBlue", "brightMagenta", "brightCyan", "brightWhite"];
73
+ export type PaletteSlot = (typeof PALETTE_SLOTS)[number];
74
+ /** One theme's palette — any CSS `<color>` string per slot (hex, oklch(), …). */
75
+ export type ThemePalette = Record<PaletteSlot, string>;
76
+ /** A full custom palette: both themes, e.g. generated by the docs Theme Builder. */
77
+ export interface Palette {
78
+ dark: ThemePalette;
79
+ light: ThemePalette;
80
+ }
44
81
  /** Size axis values — derived from the manifest (`'sm' | 'md' | 'lg'`). */
45
82
  export type Size = (typeof dssocaConfig)['size']['values'][number];
46
83
  /** Names of the components that accept a `size` prop / `componentsSize` entry. */
47
- export declare const COMPONENT_NAMES: readonly ["Accordion", "Avatar", "Badge", "BottomNav", "Button", "Card", "Chart", "Container", "DateField", "EmptyState", "FileDrop", "Heading", "Icon", "Image", "Input", "Link", "LogStream", "Menu", "MetricTile", "Modal", "NumberField", "Pagination", "SegmentedControl", "Select", "ServiceCard", "Sidebar", "Sparkline", "Spinner", "Switch", "Table", "Textarea", "Toaster", "Tooltip", "Topbar"];
84
+ export declare const COMPONENT_NAMES: readonly ["Accordion", "Avatar", "Badge", "BottomNav", "Button", "Card", "Chart", "Container", "DateField", "EmptyState", "FileDrop", "Heading", "Icon", "Image", "Input", "Kbd", "Link", "LogStream", "Menu", "MetricTile", "Modal", "NumberField", "Pagination", "SearchPalette", "SegmentedControl", "Select", "ServiceCard", "Sidebar", "Sparkline", "Spinner", "Switch", "Table", "Textarea", "Toaster", "Tooltip", "Topbar"];
48
85
  export type ComponentName = (typeof COMPONENT_NAMES)[number];
49
86
  /** Per-component default sizes; any omitted component inherits `sizeVariant`. */
50
87
  export type ComponentsSize = Partial<Record<ComponentName, Size>>;
@@ -13,6 +13,23 @@
13
13
  * `sizeVariant`; per-component defaults by `componentsSize`; per instance by a
14
14
  * component's `size` prop.
15
15
  */
16
+ /**
17
+ * Single source of truth for the Spinner *variant names* (DS-0108). The frame
18
+ * data lives in `Spinner.svelte`'s `SPINNER_VARIANTS`, but its keys are pinned
19
+ * to this list (`satisfies Record<SpinnerVariant, …>`) so the two cannot drift.
20
+ */
21
+ export const SPINNER_VARIANT_NAMES = [
22
+ 'boxBounce2',
23
+ 'boxBounce',
24
+ 'squareCorners',
25
+ 'toggle2',
26
+ 'toggle3',
27
+ 'toggle4',
28
+ 'pipe',
29
+ 'line',
30
+ 'growVertical',
31
+ 'growHorizontal',
32
+ ];
16
33
  /**
17
34
  * The manifest. `as const` preserves the value/default literals so the unions
18
35
  * below can be derived from it; `satisfies` validates the shape without widening.
@@ -20,7 +37,37 @@
20
37
  export const dssocaConfig = {
21
38
  theme: { values: ['dark', 'light'], default: 'dark' },
22
39
  size: { values: ['sm', 'md', 'lg'], default: 'md' },
40
+ spinner: { values: SPINNER_VARIANT_NAMES, default: 'boxBounce2' },
23
41
  };
42
+ /**
43
+ * The 19 root palette slots (color rework): the 16 ANSI terminal colors plus
44
+ * `bg`, `fg`, and the one vivid `accent`. Every semantic `--ss-*` token derives
45
+ * from these, so overriding them — via `applyDesignConfig({ palette })` or a
46
+ * CSS block from `paletteToCss` — recolors the whole system. camelCase here;
47
+ * the CSS custom property is the kebab-cased `--ss-` name
48
+ * (`brightBlack` → `--ss-bright-black`).
49
+ */
50
+ export const PALETTE_SLOTS = [
51
+ 'bg',
52
+ 'fg',
53
+ 'accent',
54
+ 'black',
55
+ 'red',
56
+ 'green',
57
+ 'yellow',
58
+ 'blue',
59
+ 'magenta',
60
+ 'cyan',
61
+ 'white',
62
+ 'brightBlack',
63
+ 'brightRed',
64
+ 'brightGreen',
65
+ 'brightYellow',
66
+ 'brightBlue',
67
+ 'brightMagenta',
68
+ 'brightCyan',
69
+ 'brightWhite',
70
+ ];
24
71
  /** Names of the components that accept a `size` prop / `componentsSize` entry. */
25
72
  export const COMPONENT_NAMES = [
26
73
  'Accordion',
@@ -38,6 +85,7 @@ export const COMPONENT_NAMES = [
38
85
  'Icon',
39
86
  'Image',
40
87
  'Input',
88
+ 'Kbd',
41
89
  'Link',
42
90
  'LogStream',
43
91
  'Menu',
@@ -45,6 +93,7 @@ export const COMPONENT_NAMES = [
45
93
  'Modal',
46
94
  'NumberField',
47
95
  'Pagination',
96
+ 'SearchPalette',
48
97
  'SegmentedControl',
49
98
  'Select',
50
99
  'ServiceCard',
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export { type ColorTheme, type Size, type DesignConfig, defaultDesignConfig, getDesignConfig, designAttributes, applyDesignConfig, resolveComponentSize, } from './config.js';
2
- export { dssocaConfig, type DssocaConfig, type DesignAxis, type ComponentName, type ComponentsSize, } from './dssoca.config.js';
3
- export { default as Icon, registerIcon, type IconName } from './components/Icon.svelte';
1
+ export { type ColorTheme, type Size, type DesignConfig, defaultDesignConfig, getDesignConfig, designAttributes, applyDesignConfig, paletteToCss, paletteSlotVar, resolveComponentSize, resolveSpinnerVariant, } from './config.js';
2
+ export { dssocaConfig, SPINNER_VARIANT_NAMES, PALETTE_SLOTS, type DssocaConfig, type DesignAxis, type ComponentName, type ComponentsSize, type SpinnerVariant, type Palette, type ThemePalette, type PaletteSlot, } from './dssoca.config.js';
3
+ export { CHART_PALETTE } from './palette.js';
4
+ export { default as Icon, registerIcon, type IconName, type IconSize, } from './components/Icon.svelte';
4
5
  export { default as Badge } from './components/Badge.svelte';
5
6
  export { default as Button } from './components/Button.svelte';
6
7
  export { default as Input } from './components/Input.svelte';
@@ -24,8 +25,8 @@ export { default as Image, type ImageSource } from './components/Image.svelte';
24
25
  export { default as Heading } from './components/Heading.svelte';
25
26
  export { default as Container } from './components/Container.svelte';
26
27
  export { default as Textarea } from './components/Textarea.svelte';
27
- export { default as Spinner, SPINNER_VARIANTS, SPINNER_VARIANT_NAMES, } from './components/Spinner.svelte';
28
- export type { SpinnerVariant, SpinnerFrames } from './components/Spinner.svelte';
28
+ export { default as Spinner, SPINNER_VARIANTS } from './components/Spinner.svelte';
29
+ export type { SpinnerFrames } from './components/Spinner.svelte';
29
30
  export { default as Chart, type ChartSeries, type ChartPoint } from './components/Chart.svelte';
30
31
  export { default as Table, type TableColumn, type TableSort } from './components/Table.svelte';
31
32
  export { default as Select } from './components/Select.svelte';
@@ -38,8 +39,12 @@ export { default as Tooltip } from './components/Tooltip.svelte';
38
39
  export { default as Avatar } from './components/Avatar.svelte';
39
40
  export { default as Pagination } from './components/Pagination.svelte';
40
41
  export { default as Switch } from './components/Switch.svelte';
42
+ export { default as SearchPalette, type SearchPaletteItem } from './components/SearchPalette.svelte';
41
43
  export { default as ScatterPlot, type ScatterPoint } from './components/ScatterPlot.svelte';
42
44
  export { default as BoxPlot, type BoxGroup } from './components/BoxPlot.svelte';
43
45
  export { default as BumpChart, type BumpSeries } from './components/BumpChart.svelte';
44
46
  export { default as Heatmap } from './components/Heatmap.svelte';
47
+ export { default as Kbd } from './components/Kbd.svelte';
48
+ export { default as ShortcutsHelp } from './components/ShortcutsHelp.svelte';
49
+ export { shortcuts, shortcut, formatShortcut, ariaKeyshortcuts, type ShortcutOptions, type ShortcutInfo, type ShortcutOverride, type ShortcutOverrides, type ShortcutScope, type ShortcutPlatform, type ShortcutFormat, type FormatShortcutOptions, } from './shortcuts.svelte.js';
45
50
  export { toast, toasts, type Toast, type ToastKind, type ToastAction, type ToastOptions, type ToastPatch, type PromiseMessages, } from './toast.svelte.js';
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
- export { defaultDesignConfig, getDesignConfig, designAttributes, applyDesignConfig, resolveComponentSize, } from './config.js';
2
- export { dssocaConfig, } from './dssoca.config.js';
3
- export { default as Icon, registerIcon } from './components/Icon.svelte';
1
+ export { defaultDesignConfig, getDesignConfig, designAttributes, applyDesignConfig, paletteToCss, paletteSlotVar, resolveComponentSize, resolveSpinnerVariant, } from './config.js';
2
+ export { dssocaConfig, SPINNER_VARIANT_NAMES, PALETTE_SLOTS, } from './dssoca.config.js';
3
+ // Categorical palette shared by the chart family + Avatar (stable order/length).
4
+ export { CHART_PALETTE } from './palette.js';
5
+ export { default as Icon, registerIcon, } from './components/Icon.svelte';
4
6
  export { default as Badge } from './components/Badge.svelte';
5
7
  export { default as Button } from './components/Button.svelte';
6
8
  export { default as Input } from './components/Input.svelte';
@@ -28,7 +30,7 @@ export { default as Image } from './components/Image.svelte';
28
30
  export { default as Heading } from './components/Heading.svelte';
29
31
  export { default as Container } from './components/Container.svelte';
30
32
  export { default as Textarea } from './components/Textarea.svelte';
31
- export { default as Spinner, SPINNER_VARIANTS, SPINNER_VARIANT_NAMES, } from './components/Spinner.svelte';
33
+ export { default as Spinner, SPINNER_VARIANTS } from './components/Spinner.svelte';
32
34
  // geossoca component gaps (DS-0090).
33
35
  export { default as Chart } from './components/Chart.svelte';
34
36
  export { default as Table } from './components/Table.svelte';
@@ -41,9 +43,14 @@ export { default as Tooltip } from './components/Tooltip.svelte';
41
43
  export { default as Avatar } from './components/Avatar.svelte';
42
44
  export { default as Pagination } from './components/Pagination.svelte';
43
45
  export { default as Switch } from './components/Switch.svelte';
46
+ export { default as SearchPalette } from './components/SearchPalette.svelte';
44
47
  // geossoca stats-dashboard charts (DS-0102).
45
48
  export { default as ScatterPlot } from './components/ScatterPlot.svelte';
46
49
  export { default as BoxPlot } from './components/BoxPlot.svelte';
47
50
  export { default as BumpChart } from './components/BumpChart.svelte';
48
51
  export { default as Heatmap } from './components/Heatmap.svelte';
52
+ // Keyboard-shortcuts feature (DS-0135): registry core + display chip.
53
+ export { default as Kbd } from './components/Kbd.svelte';
54
+ export { default as ShortcutsHelp } from './components/ShortcutsHelp.svelte';
55
+ export { shortcuts, shortcut, formatShortcut, ariaKeyshortcuts, } from './shortcuts.svelte.js';
49
56
  export { toast, toasts, } from './toast.svelte.js';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Categorical palette shared by the chart family (Chart, ScatterPlot, BoxPlot,
3
+ * BumpChart) and Avatar. Built entirely from the terminal root slots so a
4
+ * theme flip — or an imported custom palette — recolors every series.
5
+ *
6
+ * Order and length are stable API: Avatar's name-hash → index mapping depends
7
+ * on them (a given name must keep its colour across releases), and chart
8
+ * series keep their assigned colour by index.
9
+ */
10
+ export declare const CHART_PALETTE: readonly ["var(--ss-accent)", "var(--ss-blue)", "var(--ss-magenta)", "var(--ss-cyan)", "var(--ss-yellow)", "var(--ss-green)"];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Categorical palette shared by the chart family (Chart, ScatterPlot, BoxPlot,
3
+ * BumpChart) and Avatar. Built entirely from the terminal root slots so a
4
+ * theme flip — or an imported custom palette — recolors every series.
5
+ *
6
+ * Order and length are stable API: Avatar's name-hash → index mapping depends
7
+ * on them (a given name must keep its colour across releases), and chart
8
+ * series keep their assigned colour by index.
9
+ */
10
+ export const CHART_PALETTE = [
11
+ 'var(--ss-accent)',
12
+ 'var(--ss-blue)',
13
+ 'var(--ss-magenta)',
14
+ 'var(--ss-cyan)',
15
+ 'var(--ss-yellow)',
16
+ 'var(--ss-green)',
17
+ ];