@unpunnyfuns/swatchbook-blocks 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.
package/dist/index.mjs CHANGED
@@ -1,8 +1,10 @@
1
+ import './style.css';
1
2
  import Color from "colorjs.io";
2
3
  import { createContext, useCallback, useContext, useEffect, useMemo, useState, useSyncExternalStore } from "react";
3
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
5
  import { addons } from "storybook/preview-api";
5
6
  import { axes, css, cssVarPrefix, defaultTheme, diagnostics, themes, themesResolved } from "virtual:swatchbook/tokens";
7
+ import cx from "clsx";
6
8
  //#region src/format-color.ts
7
9
  const COLOR_FORMATS = [
8
10
  "hex",
@@ -179,130 +181,23 @@ function stringifyFallback(value, fallback) {
179
181
  }
180
182
  //#endregion
181
183
  //#region src/internal/styles.tsx
182
- /**
183
- * Chrome-style primitives shared across every block. The `var(--sb-*)`
184
- * references resolve to the active `cssVarPrefix` via the wrapper's
185
- * `chromeAliases()` spread, so blocks stay theme-aware without each one
186
- * reimplementing the fallback chain.
187
- *
188
- * Add a new constant here when a second block needs it — not when the
189
- * first one does. Keep ad-hoc inline values out of blocks so restyling
190
- * the chrome is a one-file change.
191
- */
192
- const MONO_STACK = "ui-monospace, SFMono-Regular, Menlo, monospace";
193
- const TEXT_DEFAULT = "var(--sb-color-sys-text-default, CanvasText)";
194
- const TEXT_MUTED = "var(--sb-color-sys-text-muted, CanvasText)";
195
- const SURFACE_DEFAULT = "var(--sb-color-sys-surface-default, Canvas)";
196
- const SURFACE_RAISED = "var(--sb-color-sys-surface-raised, Canvas)";
197
- const SURFACE_MUTED = "var(--sb-color-sys-surface-muted, rgba(128,128,128,0.15))";
198
- const BORDER_DEFAULT = `1px solid var(--sb-color-sys-border-default, rgba(128,128,128,0.2))`;
199
- const BORDER_FAINT = `1px solid var(--sb-color-sys-border-default, rgba(128,128,128,0.15))`;
200
- const BORDER_STRONG = `1px solid var(--sb-color-sys-border-default, rgba(128,128,128,0.3))`;
201
- const surfaceStyle = {
202
- fontFamily: "var(--sb-typography-sys-body-font-family, system-ui)",
203
- fontSize: "var(--sb-typography-sys-body-font-size, 14px)",
204
- color: TEXT_DEFAULT,
205
- background: SURFACE_DEFAULT,
206
- padding: 12,
207
- borderRadius: 6
208
- };
209
- const captionStyle = {
210
- padding: "4px 0 12px",
211
- color: TEXT_MUTED,
212
- fontSize: 12
213
- };
214
- const typePillStyle = {
215
- display: "inline-block",
216
- padding: "2px 6px",
217
- borderRadius: 4,
218
- fontSize: 10,
219
- letterSpacing: .5,
220
- textTransform: "uppercase",
221
- background: SURFACE_MUTED
222
- };
223
- const emptyStyle = {
224
- padding: "24px 12px",
225
- textAlign: "center",
226
- color: TEXT_MUTED
227
- };
184
+ const TEXT_MUTED = "var(--swatchbook-text-muted, CanvasText)";
185
+ const SURFACE_RAISED = "var(--swatchbook-surface-raised, Canvas)";
186
+ const SURFACE_MUTED = "var(--swatchbook-surface-muted, rgba(128,128,128,0.15))";
187
+ const BORDER_FAINT = `1px solid var(--swatchbook-border-default, rgba(128,128,128,0.15))`;
188
+ const BORDER_STRONG = `1px solid var(--swatchbook-border-default, rgba(128,128,128,0.3))`;
228
189
  /**
229
190
  * Inner content for a block's "nothing to render" state. Call sites wrap
230
- * it in their own block wrapper (which already carries `themeAttrs` +
231
- * `chromeAliases`), so the message itself just needs the muted type.
191
+ * it in their own block wrapper (which already carries `themeAttrs`), so
192
+ * the message itself just needs the muted type.
232
193
  */
233
194
  function EmptyState({ children }) {
234
195
  return /* @__PURE__ */ jsx("div", {
235
- style: emptyStyle,
196
+ className: "sb-block__empty",
236
197
  children
237
198
  });
238
199
  }
239
200
  //#endregion
240
- //#region src/internal/data-attr.ts
241
- /**
242
- * Produce a prefixed `data-*` attribute name when `prefix` is set, bare
243
- * `data-<key>` otherwise. Mirrors `dataAttr` in `@unpunnyfuns/swatchbook-core`
244
- * so block wrappers and emitted-CSS selectors stay in lockstep without
245
- * blocks taking a runtime dep on core.
246
- */
247
- function dataAttr(prefix, key) {
248
- return prefix ? `data-${prefix}-${key}` : `data-${key}`;
249
- }
250
- /**
251
- * Marker attribute set on every block wrapper. Used as the scope selector
252
- * for the defensive element-reset stylesheet in `block-reset.ts` so
253
- * Storybook MDX docs CSS (`.sbdocs table`, `.sbdocs ul`, …) can't bleed
254
- * into our chrome.
255
- */
256
- const BLOCK_ATTR = "data-swatchbook-block";
257
- /**
258
- * Spread helper for the common `<div data-<prefix>-theme="…" data-swatchbook-block>`
259
- * block wrapper. Returns an object keyed on the prefixed theme attribute
260
- * plus the scoping marker so the call site stays readable:
261
- * `<div {...themeAttrs(prefix, theme)} />`.
262
- */
263
- function themeAttrs(prefix, themeName) {
264
- return {
265
- [dataAttr(prefix, "theme")]: themeName,
266
- [BLOCK_ATTR]: ""
267
- };
268
- }
269
- /**
270
- * Vars block chrome reads by literal `var(--sb-*)` regardless of what the
271
- * project's actual `cssVarPrefix` is. Keeping the literal spelling means we
272
- * only need to alias these few names on each block wrapper; the bulk of
273
- * block styling stays untouched.
274
- */
275
- const CHROME_VARS = [
276
- "color-sys-border-default",
277
- "color-sys-surface-default",
278
- "color-sys-surface-muted",
279
- "color-sys-surface-raised",
280
- "color-sys-text-default",
281
- "color-sys-text-muted",
282
- "color-sys-accent-bg",
283
- "color-sys-accent-fg",
284
- "typography-sys-body-font-family",
285
- "typography-sys-body-font-size"
286
- ];
287
- /**
288
- * CSS custom-property aliases that redirect the block chrome's `var(--sb-*)`
289
- * reads to the project's actual `cssVarPrefix`. Block components spread the
290
- * return into their wrapper's inline `style`, so the aliases cascade down
291
- * into every nested block / sample / token-detail piece without each one
292
- * re-reading the prefix.
293
- *
294
- * When `prefix === 'sb'` the aliases are self-references — we skip emission
295
- * to keep the inline style shorter. When `prefix === ''` (opt-out) the
296
- * aliases point at the bare `var(--color-sys-…)` names core emitted.
297
- */
298
- function chromeAliases(prefix) {
299
- if (prefix === "sb") return {};
300
- const out = {};
301
- const head = prefix ? `${prefix}-` : "";
302
- for (const name of CHROME_VARS) out[`--sb-${name}`] = `var(--${head}${name})`;
303
- return out;
304
- }
305
- //#endregion
306
201
  //#region src/internal/channel-globals.ts
307
202
  const AXES_GLOBAL_KEY = "swatchbookAxes";
308
203
  const THEME_GLOBAL_KEY = "swatchbookTheme";
@@ -431,62 +326,6 @@ function useColorFormat() {
431
326
  return contextValue ?? channelGlobals.format ?? "hex";
432
327
  }
433
328
  //#endregion
434
- //#region src/internal/block-reset.ts
435
- /**
436
- * Defensive element reset scoped to every block wrapper.
437
- *
438
- * Storybook 10's MDX docs applies house-style CSS to semantic elements
439
- * (`.sbdocs table`, `.sbdocs th/td`, `.sbdocs ul/li`, `.sbdocs details/summary`)
440
- * that bleeds into any block rendered inside a docs page. Our blocks set
441
- * inline styles on those elements for the properties they care about, but
442
- * anything they don't touch (background, border, margin, etc.) inherits
443
- * the docs look. That's why the Dashboard tree/table looked different
444
- * inside MDX vs a regular story.
445
- *
446
- * The fix mounts one stylesheet once per browsing session that scopes
447
- * `all: revert` on the semantic elements used by blocks, under the
448
- * `[data-swatchbook-block]` attribute carried by every block's outer
449
- * wrapper (via `themeAttrs`). `all: revert` restores browser defaults —
450
- * the block's inline styles still win on top of that, and MDX house
451
- * styles stop leaking in.
452
- *
453
- * The reset excludes the wrapper itself (direct `[data-swatchbook-block]`
454
- * selector) because the wrapper's `surfaceStyle` is what we want to keep.
455
- */
456
- const STYLE_ID = "swatchbook-block-reset";
457
- const RESET_CSS = `[data-swatchbook-block] table,
458
- [data-swatchbook-block] thead,
459
- [data-swatchbook-block] tbody,
460
- [data-swatchbook-block] tr,
461
- [data-swatchbook-block] th,
462
- [data-swatchbook-block] td,
463
- [data-swatchbook-block] caption,
464
- [data-swatchbook-block] ul,
465
- [data-swatchbook-block] ol,
466
- [data-swatchbook-block] li,
467
- [data-swatchbook-block] details,
468
- [data-swatchbook-block] summary,
469
- [data-swatchbook-block] code,
470
- [data-swatchbook-block] pre,
471
- [data-swatchbook-block] p,
472
- [data-swatchbook-block] h1,
473
- [data-swatchbook-block] h2,
474
- [data-swatchbook-block] h3,
475
- [data-swatchbook-block] h4,
476
- [data-swatchbook-block] h5,
477
- [data-swatchbook-block] h6 {
478
- all: revert-layer;
479
- }
480
- `;
481
- function ensureBlockResetStylesheet() {
482
- if (typeof document === "undefined") return;
483
- if (document.getElementById(STYLE_ID)) return;
484
- const style = document.createElement("style");
485
- style.id = STYLE_ID;
486
- style.textContent = RESET_CSS;
487
- document.head.appendChild(style);
488
- }
489
- //#endregion
490
329
  //#region src/internal/use-project.ts
491
330
  const STYLE_ELEMENT_ID = "swatchbook-tokens";
492
331
  function ensureStylesheet(css) {
@@ -542,9 +381,6 @@ function snapshotToData(snapshot) {
542
381
  function useProject() {
543
382
  const snapshot = useOptionalSwatchbookData();
544
383
  const fallback = useVirtualModuleFallback(snapshot === null);
545
- useEffect(() => {
546
- ensureBlockResetStylesheet();
547
- }, []);
548
384
  return snapshot !== null ? snapshotToData(snapshot) : fallback;
549
385
  }
550
386
  function useVirtualModuleFallback(enabled) {
@@ -613,7 +449,6 @@ function BorderSample({ path }) {
613
449
  const cssVar = makeCssVar(path, cssVarPrefix);
614
450
  return /* @__PURE__ */ jsx("div", {
615
451
  style: {
616
- ...chromeAliases(cssVarPrefix),
617
452
  ...sampleStyle$1,
618
453
  border: cssVar
619
454
  },
@@ -621,6 +456,50 @@ function BorderSample({ path }) {
621
456
  });
622
457
  }
623
458
  //#endregion
459
+ //#region src/internal/data-attr.ts
460
+ /**
461
+ * Produce a prefixed `data-*` attribute name when `prefix` is set, bare
462
+ * `data-<key>` otherwise. Mirrors `dataAttr` in `@unpunnyfuns/swatchbook-core`
463
+ * so block wrappers and emitted-CSS selectors stay in lockstep without
464
+ * blocks taking a runtime dep on core.
465
+ */
466
+ function dataAttr(prefix, key) {
467
+ return prefix ? `data-${prefix}-${key}` : `data-${key}`;
468
+ }
469
+ /**
470
+ * Marker attribute set on every block wrapper. Retained as a stable hook
471
+ * for consumer-side selectors (e.g. when a host app wants to target or
472
+ * override block chrome without relying on hashed class names).
473
+ */
474
+ const BLOCK_ATTR = "data-swatchbook-block";
475
+ /**
476
+ * Opt-out class that Storybook's `.sbdocs` stylesheet uses to self-exclude
477
+ * on MDX docs pages — every `.sbdocs` house rule is wrapped in
478
+ * `:not(.sb-unstyled, .sb-unstyled *)`, so any descendant of a `.sb-unstyled`
479
+ * container is left alone. Stamped onto every block wrapper so blocks
480
+ * render identically in MDX docs and regular stories without fighting
481
+ * cascade specificity.
482
+ */
483
+ const WRAPPER_CLASSES = "sb-unstyled sb-block";
484
+ /**
485
+ * Spread helper for the common block wrapper. Returns:
486
+ * - `data-<prefix>-theme="<composed theme name>"` — so theme-keyed CSS
487
+ * emitted by `@unpunnyfuns/swatchbook-core` resolves against this
488
+ * subtree.
489
+ * - `data-swatchbook-block` — stable consumer hook for targeting block
490
+ * chrome from outside.
491
+ * - `className="sb-unstyled sb-block"` — Storybook's opt-out class so
492
+ * MDX docs house styles self-exclude the subtree, plus `sb-block`
493
+ * which carries the shared chrome from `internal/styles.css`.
494
+ */
495
+ function themeAttrs(prefix, themeName) {
496
+ return {
497
+ [dataAttr(prefix, "theme")]: themeName,
498
+ [BLOCK_ATTR]: "",
499
+ className: WRAPPER_CLASSES
500
+ };
501
+ }
502
+ //#endregion
624
503
  //#region src/internal/sort-tokens.ts
625
504
  /**
626
505
  * Stable sort for a filtered `[path, token][]` list.
@@ -726,51 +605,6 @@ function toDisplayable(v) {
726
605
  }
727
606
  //#endregion
728
607
  //#region src/BorderPreview.tsx
729
- const styles$16 = {
730
- wrapper: surfaceStyle,
731
- caption: captionStyle,
732
- empty: emptyStyle,
733
- row: {
734
- display: "grid",
735
- gridTemplateColumns: "minmax(160px, 220px) 140px 1fr",
736
- gap: 16,
737
- alignItems: "center",
738
- padding: "14px 0",
739
- borderBottom: BORDER_DEFAULT
740
- },
741
- meta: {
742
- display: "flex",
743
- flexDirection: "column",
744
- gap: 2,
745
- minWidth: 0
746
- },
747
- path: {
748
- fontFamily: MONO_STACK,
749
- fontSize: 12,
750
- overflow: "hidden",
751
- textOverflow: "ellipsis",
752
- whiteSpace: "nowrap"
753
- },
754
- cssVar: {
755
- fontFamily: MONO_STACK,
756
- fontSize: 11,
757
- opacity: .7
758
- },
759
- sampleCell: {
760
- display: "flex",
761
- alignItems: "center",
762
- justifyContent: "center"
763
- },
764
- breakdown: {
765
- fontFamily: MONO_STACK,
766
- fontSize: 11,
767
- display: "grid",
768
- gridTemplateColumns: "auto 1fr",
769
- columnGap: 12,
770
- rowGap: 2
771
- },
772
- breakdownKey: { color: TEXT_MUTED }
773
- };
774
608
  function formatDimension$2(raw) {
775
609
  if (raw == null) return "—";
776
610
  if (typeof raw === "number") return String(raw);
@@ -818,56 +652,48 @@ function BorderPreview({ filter, caption, sortBy = "path", sortDir = "asc" }) {
818
652
  const captionText = caption ?? `${rows.length} border${rows.length === 1 ? "" : "s"}${filter ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
819
653
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
820
654
  ...themeAttrs(cssVarPrefix, activeTheme),
821
- style: {
822
- ...chromeAliases(cssVarPrefix),
823
- ...styles$16.wrapper
824
- },
825
655
  children: /* @__PURE__ */ jsx("div", {
826
- style: styles$16.empty,
656
+ className: "sb-block__empty",
827
657
  children: "No border tokens match this filter."
828
658
  })
829
659
  });
830
660
  return /* @__PURE__ */ jsxs("div", {
831
661
  ...themeAttrs(cssVarPrefix, activeTheme),
832
- style: {
833
- ...chromeAliases(cssVarPrefix),
834
- ...styles$16.wrapper
835
- },
836
662
  children: [/* @__PURE__ */ jsx("div", {
837
- style: styles$16.caption,
663
+ className: "sb-block__caption",
838
664
  children: captionText
839
665
  }), rows.map((row) => /* @__PURE__ */ jsxs("div", {
840
- style: styles$16.row,
666
+ className: "sb-border-preview__row",
841
667
  children: [
842
668
  /* @__PURE__ */ jsxs("div", {
843
- style: styles$16.meta,
669
+ className: "sb-border-preview__meta",
844
670
  children: [/* @__PURE__ */ jsx("span", {
845
- style: styles$16.path,
671
+ className: "sb-border-preview__path",
846
672
  children: row.path
847
673
  }), /* @__PURE__ */ jsx("span", {
848
- style: styles$16.cssVar,
674
+ className: "sb-border-preview__css-var",
849
675
  children: row.cssVar
850
676
  })]
851
677
  }),
852
678
  /* @__PURE__ */ jsx("div", {
853
- style: styles$16.sampleCell,
679
+ className: "sb-border-preview__sample-cell",
854
680
  children: /* @__PURE__ */ jsx(BorderSample, { path: row.path })
855
681
  }),
856
682
  /* @__PURE__ */ jsxs("div", {
857
- style: styles$16.breakdown,
683
+ className: "sb-border-preview__breakdown",
858
684
  children: [
859
685
  /* @__PURE__ */ jsx("span", {
860
- style: styles$16.breakdownKey,
686
+ className: "sb-border-preview__breakdown-key",
861
687
  children: "width"
862
688
  }),
863
689
  /* @__PURE__ */ jsx("span", { children: formatDimension$2(row.value.width) }),
864
690
  /* @__PURE__ */ jsx("span", {
865
- style: styles$16.breakdownKey,
691
+ className: "sb-border-preview__breakdown-key",
866
692
  children: "style"
867
693
  }),
868
694
  /* @__PURE__ */ jsx("span", { children: row.value.style != null ? String(row.value.style) : "—" }),
869
695
  /* @__PURE__ */ jsx("span", {
870
- style: styles$16.breakdownKey,
696
+ className: "sb-border-preview__breakdown-key",
871
697
  children: "color"
872
698
  }),
873
699
  /* @__PURE__ */ jsx("span", { children: formatColor$2(row.value.color) })
@@ -879,52 +705,6 @@ function BorderPreview({ filter, caption, sortBy = "path", sortDir = "asc" }) {
879
705
  }
880
706
  //#endregion
881
707
  //#region src/ColorPalette.tsx
882
- const styles$15 = {
883
- wrapper: surfaceStyle,
884
- caption: captionStyle,
885
- empty: emptyStyle,
886
- group: { marginBottom: 20 },
887
- groupHeader: {
888
- fontFamily: MONO_STACK,
889
- fontSize: 11,
890
- textTransform: "uppercase",
891
- letterSpacing: .5,
892
- opacity: .6,
893
- marginBottom: 8
894
- },
895
- grid: {
896
- display: "grid",
897
- gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))",
898
- gap: 8
899
- },
900
- card: {
901
- border: BORDER_DEFAULT,
902
- borderRadius: 6,
903
- overflow: "hidden",
904
- display: "flex",
905
- flexDirection: "column"
906
- },
907
- swatch: {
908
- height: 56,
909
- width: "100%",
910
- borderBottom: BORDER_FAINT
911
- },
912
- meta: {
913
- padding: "8px 10px",
914
- display: "flex",
915
- flexDirection: "column",
916
- gap: 2
917
- },
918
- leaf: {
919
- fontFamily: MONO_STACK,
920
- fontSize: 12
921
- },
922
- value: {
923
- fontFamily: MONO_STACK,
924
- fontSize: 11,
925
- opacity: .7
926
- }
927
- };
928
708
  /**
929
709
  * Count segments in the filter before the first glob (`*` / `**`).
930
710
  * `color.ref.*` → 2; `color.sys.surface.*` → 3; `color` → 1; undefined → 0.
@@ -951,13 +731,6 @@ function ColorPalette({ filter, groupBy, caption, sortBy = "path", sortDir = "as
951
731
  dir: sortDir
952
732
  });
953
733
  const maxDepth = entries.reduce((m, [p]) => Math.max(m, p.split(".").length), 0);
954
- /**
955
- * Auto-derive: group one level below the filter's fixed prefix, but
956
- * clamp so each swatch retains at least one leaf segment. A filter
957
- * like `color.ref.blue.*` (fixed length 3) with only 4-segment tokens
958
- * would try groupBy=4 → one-per-group; clamp to `maxDepth - 1` so the
959
- * whole ramp lands in one group with each shade as a leaf.
960
- */
961
734
  const effectiveGroupBy = groupBy ?? Math.min(fixedPrefixLength(filter) + 1, Math.max(maxDepth - 1, 1));
962
735
  const bucket = /* @__PURE__ */ new Map();
963
736
  for (const [path, token] of entries) {
@@ -989,50 +762,40 @@ function ColorPalette({ filter, groupBy, caption, sortBy = "path", sortDir = "as
989
762
  const captionText = caption ?? `${totalCount} color${totalCount === 1 ? "" : "s"}${filter ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
990
763
  if (totalCount === 0) return /* @__PURE__ */ jsx("div", {
991
764
  ...themeAttrs(cssVarPrefix, activeTheme),
992
- style: {
993
- ...chromeAliases(cssVarPrefix),
994
- ...styles$15.wrapper
995
- },
996
765
  children: /* @__PURE__ */ jsx("div", {
997
- style: styles$15.empty,
766
+ className: "sb-block__empty",
998
767
  children: "No color tokens match this filter."
999
768
  })
1000
769
  });
1001
770
  return /* @__PURE__ */ jsxs("div", {
1002
771
  ...themeAttrs(cssVarPrefix, activeTheme),
1003
- style: {
1004
- ...chromeAliases(cssVarPrefix),
1005
- ...styles$15.wrapper
1006
- },
1007
772
  children: [/* @__PURE__ */ jsx("div", {
1008
- style: styles$15.caption,
773
+ className: "sb-block__caption",
1009
774
  children: captionText
1010
775
  }), groups.map(([group, swatches]) => /* @__PURE__ */ jsxs("section", {
1011
- style: styles$15.group,
776
+ className: "sb-color-palette__group",
1012
777
  children: [/* @__PURE__ */ jsx("div", {
1013
- style: styles$15.groupHeader,
778
+ className: "sb-color-palette__group-header",
1014
779
  children: group
1015
780
  }), /* @__PURE__ */ jsx("div", {
1016
- style: styles$15.grid,
781
+ className: "sb-color-palette__grid",
1017
782
  children: swatches.map((swatch) => /* @__PURE__ */ jsxs("div", {
1018
- style: styles$15.card,
783
+ className: "sb-color-palette__card",
1019
784
  children: [/* @__PURE__ */ jsx("div", {
1020
- style: {
1021
- ...styles$15.swatch,
1022
- background: swatch.cssVar
1023
- },
785
+ className: "sb-color-palette__swatch",
786
+ style: { background: swatch.cssVar },
1024
787
  "aria-hidden": true
1025
788
  }), /* @__PURE__ */ jsxs("div", {
1026
- style: styles$15.meta,
789
+ className: "sb-color-palette__meta",
1027
790
  children: [/* @__PURE__ */ jsx("span", {
1028
- style: styles$15.leaf,
791
+ className: "sb-color-palette__leaf",
1029
792
  children: swatch.leaf
1030
793
  }), /* @__PURE__ */ jsxs("span", {
1031
- style: styles$15.value,
794
+ className: "sb-color-palette__value",
1032
795
  children: [swatch.value, swatch.outOfGamut && /* @__PURE__ */ jsxs("span", {
1033
796
  title: "Out of sRGB gamut for this format",
1034
797
  "aria-label": "out of gamut",
1035
- style: { marginLeft: 4 },
798
+ className: "sb-color-palette__gamut-warn",
1036
799
  children: [" ", "⚠"]
1037
800
  })]
1038
801
  })]
@@ -1044,55 +807,11 @@ function ColorPalette({ filter, groupBy, caption, sortBy = "path", sortDir = "as
1044
807
  }
1045
808
  //#endregion
1046
809
  //#region src/Diagnostics.tsx
1047
- const severityColor = {
1048
- error: "#d64545",
1049
- warn: "#b08900",
1050
- info: "inherit"
1051
- };
1052
810
  const severityLabel = {
1053
811
  error: "ERROR",
1054
812
  warn: "WARN",
1055
813
  info: "INFO"
1056
814
  };
1057
- const styles$14 = {
1058
- wrapper: surfaceStyle,
1059
- summary: {
1060
- display: "flex",
1061
- alignItems: "center",
1062
- gap: 8,
1063
- padding: "4px 0",
1064
- fontSize: 13,
1065
- cursor: "pointer",
1066
- listStyle: "none",
1067
- fontWeight: 600
1068
- },
1069
- list: {
1070
- listStyle: "none",
1071
- margin: "8px 0 0",
1072
- padding: 0,
1073
- display: "flex",
1074
- flexDirection: "column"
1075
- },
1076
- row: {
1077
- display: "grid",
1078
- gridTemplateColumns: "60px 1fr",
1079
- gap: 12,
1080
- padding: "8px 4px",
1081
- borderTop: BORDER_FAINT,
1082
- fontSize: 12
1083
- },
1084
- label: {
1085
- fontWeight: 600,
1086
- fontSize: 10,
1087
- letterSpacing: .5
1088
- },
1089
- meta: {
1090
- color: TEXT_MUTED,
1091
- fontSize: 11,
1092
- marginTop: 4,
1093
- opacity: .7
1094
- }
1095
- };
1096
815
  function summaryText(diagnostics) {
1097
816
  if (diagnostics.length === 0) return "✔ OK · no diagnostics";
1098
817
  const counts = {
@@ -1110,11 +829,11 @@ function summaryText(diagnostics) {
1110
829
  function diagnosticKey(d, i) {
1111
830
  return `${d.severity}:${d.group}:${d.filename ?? ""}:${d.line ?? ""}:${d.message}:${i}`;
1112
831
  }
1113
- function summaryColor(diagnostics) {
1114
- if (diagnostics.length === 0) return "#30a46c";
1115
- if (diagnostics.some((d) => d.severity === "error")) return severityColor.error;
1116
- if (diagnostics.some((d) => d.severity === "warn")) return severityColor.warn;
1117
- return "inherit";
832
+ function summaryVariant(diagnostics) {
833
+ if (diagnostics.length === 0) return "ok";
834
+ if (diagnostics.some((d) => d.severity === "error")) return "error";
835
+ if (diagnostics.some((d) => d.severity === "warn")) return "warn";
836
+ return null;
1118
837
  }
1119
838
  /**
1120
839
  * Render the project's load diagnostics — parser errors, resolver warnings,
@@ -1130,33 +849,24 @@ function Diagnostics({ caption } = {}) {
1130
849
  const { activeTheme, cssVarPrefix, diagnostics } = useProject();
1131
850
  const hasErrorsOrWarnings = diagnostics.some((d) => d.severity === "error" || d.severity === "warn");
1132
851
  const headingText = caption ?? `Diagnostics · ${summaryText(diagnostics)}`;
852
+ const variant = summaryVariant(diagnostics);
1133
853
  return /* @__PURE__ */ jsx("div", {
1134
854
  ...themeAttrs(cssVarPrefix, activeTheme),
1135
- style: {
1136
- ...chromeAliases(cssVarPrefix),
1137
- ...styles$14.wrapper
1138
- },
1139
855
  "data-testid": "diagnostics",
1140
856
  children: /* @__PURE__ */ jsxs("details", {
1141
857
  open: hasErrorsOrWarnings,
1142
858
  children: [/* @__PURE__ */ jsx("summary", {
1143
- style: {
1144
- ...styles$14.summary,
1145
- color: summaryColor(diagnostics)
1146
- },
859
+ className: cx("sb-diagnostics__summary", variant && `sb-diagnostics__summary--${variant}`),
1147
860
  children: headingText
1148
861
  }), diagnostics.length > 0 && /* @__PURE__ */ jsx("ul", {
1149
- style: styles$14.list,
862
+ className: "sb-diagnostics__list",
1150
863
  children: diagnostics.map((d, i) => /* @__PURE__ */ jsxs("li", {
1151
- style: styles$14.row,
864
+ className: "sb-diagnostics__row",
1152
865
  children: [/* @__PURE__ */ jsx("span", {
1153
- style: {
1154
- ...styles$14.label,
1155
- color: severityColor[d.severity]
1156
- },
866
+ className: cx("sb-diagnostics__label", { [`sb-diagnostics__label--${d.severity}`]: d.severity !== "info" }),
1157
867
  children: severityLabel[d.severity]
1158
868
  }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", { children: d.message }), (d.group || d.filename) && /* @__PURE__ */ jsx("div", {
1159
- style: styles$14.meta,
869
+ className: "sb-diagnostics__meta",
1160
870
  children: [
1161
871
  d.group,
1162
872
  d.filename,
@@ -1171,21 +881,21 @@ function Diagnostics({ caption } = {}) {
1171
881
  //#endregion
1172
882
  //#region src/dimension-scale/DimensionBar.tsx
1173
883
  const MAX_RENDER_PX$1 = 480;
1174
- const styles$13 = {
884
+ const styles$1 = {
1175
885
  bar: {
1176
886
  height: 14,
1177
- background: "var(--sb-color-sys-accent-bg, #3b82f6)",
887
+ background: "var(--swatchbook-accent-bg, #3b82f6)",
1178
888
  borderRadius: 2,
1179
889
  minWidth: 1
1180
890
  },
1181
891
  radiusSample: {
1182
892
  width: 56,
1183
893
  height: 56,
1184
- background: "var(--sb-color-sys-accent-bg, #3b82f6)",
894
+ background: "var(--swatchbook-accent-bg, #3b82f6)",
1185
895
  border: BORDER_STRONG
1186
896
  },
1187
897
  sizeSample: {
1188
- background: "var(--sb-color-sys-accent-bg, #3b82f6)",
898
+ background: "var(--swatchbook-accent-bg, #3b82f6)",
1189
899
  border: BORDER_STRONG,
1190
900
  minWidth: 1,
1191
901
  minHeight: 1
@@ -1214,20 +924,17 @@ function DimensionBar({ path, kind = "length" }) {
1214
924
  const token = resolved[path];
1215
925
  const pxValue = toPixels$1(token?.$value);
1216
926
  const cappedValue = Number.isFinite(pxValue) && pxValue > MAX_RENDER_PX$1 ? `${MAX_RENDER_PX$1}px` : cssVar;
1217
- const aliases = chromeAliases(cssVarPrefix);
1218
927
  switch (kind) {
1219
928
  case "radius": return /* @__PURE__ */ jsx("div", {
1220
929
  style: {
1221
- ...aliases,
1222
- ...styles$13.radiusSample,
930
+ ...styles$1.radiusSample,
1223
931
  borderRadius: cssVar
1224
932
  },
1225
933
  "aria-hidden": true
1226
934
  });
1227
935
  case "size": return /* @__PURE__ */ jsx("div", {
1228
936
  style: {
1229
- ...aliases,
1230
- ...styles$13.sizeSample,
937
+ ...styles$1.sizeSample,
1231
938
  width: cappedValue,
1232
939
  height: cappedValue
1233
940
  },
@@ -1235,8 +942,7 @@ function DimensionBar({ path, kind = "length" }) {
1235
942
  });
1236
943
  default: return /* @__PURE__ */ jsx("div", {
1237
944
  style: {
1238
- ...aliases,
1239
- ...styles$13.bar,
945
+ ...styles$1.bar,
1240
946
  width: cappedValue
1241
947
  },
1242
948
  "aria-hidden": true
@@ -1388,58 +1094,6 @@ function formatUnknown(v) {
1388
1094
  //#endregion
1389
1095
  //#region src/DimensionScale.tsx
1390
1096
  const MAX_RENDER_PX = 480;
1391
- const styles$12 = {
1392
- wrapper: surfaceStyle,
1393
- caption: captionStyle,
1394
- empty: emptyStyle,
1395
- row: {
1396
- display: "grid",
1397
- gridTemplateColumns: "minmax(160px, 220px) 1fr auto",
1398
- gap: 16,
1399
- alignItems: "center",
1400
- padding: "10px 0",
1401
- borderBottom: BORDER_DEFAULT
1402
- },
1403
- meta: {
1404
- display: "flex",
1405
- flexDirection: "column",
1406
- gap: 2,
1407
- minWidth: 0
1408
- },
1409
- path: {
1410
- fontFamily: MONO_STACK,
1411
- fontSize: 12,
1412
- overflow: "hidden",
1413
- textOverflow: "ellipsis",
1414
- whiteSpace: "nowrap"
1415
- },
1416
- specs: {
1417
- fontFamily: MONO_STACK,
1418
- fontSize: 11,
1419
- opacity: .7
1420
- },
1421
- visualCell: {
1422
- display: "flex",
1423
- alignItems: "center",
1424
- minWidth: 0
1425
- },
1426
- cssVar: {
1427
- fontFamily: MONO_STACK,
1428
- fontSize: 11,
1429
- opacity: .7,
1430
- whiteSpace: "nowrap"
1431
- },
1432
- cap: {
1433
- fontFamily: MONO_STACK,
1434
- fontSize: 10,
1435
- opacity: .6,
1436
- marginLeft: 6
1437
- }
1438
- };
1439
- /**
1440
- * Convert a DTCG dimension `$value` (`{ value, unit }`) to pixels for the
1441
- * purpose of ordering and deciding whether to show a cap indicator.
1442
- */
1443
1097
  function toPixels(raw) {
1444
1098
  if (raw == null || typeof raw !== "object") return NaN;
1445
1099
  const v = raw;
@@ -1480,44 +1134,36 @@ function DimensionScale({ filter, kind = "length", caption, sortBy = "value", so
1480
1134
  const captionText = caption ?? `${rows.length} dimension${rows.length === 1 ? "" : "s"}${filter ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
1481
1135
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
1482
1136
  ...themeAttrs(cssVarPrefix, activeTheme),
1483
- style: {
1484
- ...chromeAliases(cssVarPrefix),
1485
- ...styles$12.wrapper
1486
- },
1487
1137
  children: /* @__PURE__ */ jsx("div", {
1488
- style: styles$12.empty,
1138
+ className: "sb-block__empty",
1489
1139
  children: "No dimension tokens match this filter."
1490
1140
  })
1491
1141
  });
1492
1142
  return /* @__PURE__ */ jsxs("div", {
1493
1143
  ...themeAttrs(cssVarPrefix, activeTheme),
1494
- style: {
1495
- ...chromeAliases(cssVarPrefix),
1496
- ...styles$12.wrapper
1497
- },
1498
1144
  children: [/* @__PURE__ */ jsx("div", {
1499
- style: styles$12.caption,
1145
+ className: "sb-block__caption",
1500
1146
  children: captionText
1501
1147
  }), rows.map((row) => /* @__PURE__ */ jsxs("div", {
1502
- style: styles$12.row,
1148
+ className: "sb-dimension-scale__row",
1503
1149
  children: [
1504
1150
  /* @__PURE__ */ jsxs("div", {
1505
- style: styles$12.meta,
1151
+ className: "sb-dimension-scale__meta",
1506
1152
  children: [/* @__PURE__ */ jsx("span", {
1507
- style: styles$12.path,
1153
+ className: "sb-dimension-scale__path",
1508
1154
  children: row.path
1509
1155
  }), /* @__PURE__ */ jsx("span", {
1510
- style: styles$12.specs,
1156
+ className: "sb-dimension-scale__specs",
1511
1157
  children: row.displayValue
1512
1158
  })]
1513
1159
  }),
1514
1160
  /* @__PURE__ */ jsxs("div", {
1515
- style: styles$12.visualCell,
1161
+ className: "sb-dimension-scale__visual-cell",
1516
1162
  children: [/* @__PURE__ */ jsx(DimensionBar, {
1517
1163
  path: row.path,
1518
1164
  kind
1519
1165
  }), row.capped && /* @__PURE__ */ jsxs("span", {
1520
- style: styles$12.cap,
1166
+ className: "sb-dimension-scale__cap",
1521
1167
  children: [
1522
1168
  "capped at ",
1523
1169
  MAX_RENDER_PX,
@@ -1526,7 +1172,7 @@ function DimensionScale({ filter, kind = "length", caption, sortBy = "value", so
1526
1172
  })]
1527
1173
  }),
1528
1174
  /* @__PURE__ */ jsx("span", {
1529
- style: styles$12.cssVar,
1175
+ className: "sb-dimension-scale__css-var",
1530
1176
  children: row.cssVar
1531
1177
  })
1532
1178
  ]
@@ -1535,46 +1181,6 @@ function DimensionScale({ filter, kind = "length", caption, sortBy = "value", so
1535
1181
  }
1536
1182
  //#endregion
1537
1183
  //#region src/FontFamilySample.tsx
1538
- const styles$11 = {
1539
- wrapper: surfaceStyle,
1540
- caption: captionStyle,
1541
- row: {
1542
- display: "grid",
1543
- gridTemplateColumns: "minmax(160px, 220px) 1fr auto",
1544
- gap: 16,
1545
- alignItems: "baseline",
1546
- padding: "14px 0",
1547
- borderBottom: BORDER_DEFAULT
1548
- },
1549
- meta: {
1550
- display: "flex",
1551
- flexDirection: "column",
1552
- gap: 2,
1553
- minWidth: 0
1554
- },
1555
- path: {
1556
- fontFamily: MONO_STACK,
1557
- fontSize: 12,
1558
- overflow: "hidden",
1559
- textOverflow: "ellipsis",
1560
- whiteSpace: "nowrap"
1561
- },
1562
- stack: {
1563
- fontFamily: MONO_STACK,
1564
- fontSize: 11,
1565
- color: TEXT_MUTED
1566
- },
1567
- sample: {
1568
- fontSize: 22,
1569
- lineHeight: 1.2
1570
- },
1571
- cssVar: {
1572
- fontFamily: MONO_STACK,
1573
- fontSize: 11,
1574
- color: TEXT_MUTED
1575
- },
1576
- empty: emptyStyle
1577
- };
1578
1184
  function stackString(raw) {
1579
1185
  if (typeof raw === "string") return raw;
1580
1186
  if (Array.isArray(raw)) return raw.map(String).join(", ");
@@ -1604,46 +1210,36 @@ function FontFamilySample({ filter, sample = "The quick brown fox jumps over the
1604
1210
  const captionText = caption ?? `${rows.length} fontFamily token${rows.length === 1 ? "" : "s"}${filter && filter !== "fontFamily" ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
1605
1211
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
1606
1212
  ...themeAttrs(cssVarPrefix, activeTheme),
1607
- style: {
1608
- ...chromeAliases(cssVarPrefix),
1609
- ...styles$11.wrapper
1610
- },
1611
1213
  children: /* @__PURE__ */ jsx("div", {
1612
- style: styles$11.empty,
1214
+ className: "sb-block__empty",
1613
1215
  children: "No fontFamily tokens match this filter."
1614
1216
  })
1615
1217
  });
1616
1218
  return /* @__PURE__ */ jsxs("div", {
1617
1219
  ...themeAttrs(cssVarPrefix, activeTheme),
1618
- style: {
1619
- ...chromeAliases(cssVarPrefix),
1620
- ...styles$11.wrapper
1621
- },
1622
1220
  children: [/* @__PURE__ */ jsx("div", {
1623
- style: styles$11.caption,
1221
+ className: "sb-block__caption",
1624
1222
  children: captionText
1625
1223
  }), rows.map((row) => /* @__PURE__ */ jsxs("div", {
1626
- style: styles$11.row,
1224
+ className: "sb-font-family-sample__row",
1627
1225
  children: [
1628
1226
  /* @__PURE__ */ jsxs("div", {
1629
- style: styles$11.meta,
1227
+ className: "sb-font-family-sample__meta",
1630
1228
  children: [/* @__PURE__ */ jsx("span", {
1631
- style: styles$11.path,
1229
+ className: "sb-font-family-sample__path",
1632
1230
  children: row.path
1633
1231
  }), /* @__PURE__ */ jsx("span", {
1634
- style: styles$11.stack,
1232
+ className: "sb-font-family-sample__stack",
1635
1233
  children: row.stack
1636
1234
  })]
1637
1235
  }),
1638
1236
  /* @__PURE__ */ jsx("div", {
1639
- style: {
1640
- ...styles$11.sample,
1641
- fontFamily: row.cssVar
1642
- },
1237
+ className: "sb-font-family-sample__sample",
1238
+ style: { fontFamily: row.cssVar },
1643
1239
  children: sample
1644
1240
  }),
1645
1241
  /* @__PURE__ */ jsx("span", {
1646
- style: styles$11.cssVar,
1242
+ className: "sb-font-family-sample__css-var",
1647
1243
  children: row.cssVar
1648
1244
  })
1649
1245
  ]
@@ -1652,46 +1248,6 @@ function FontFamilySample({ filter, sample = "The quick brown fox jumps over the
1652
1248
  }
1653
1249
  //#endregion
1654
1250
  //#region src/FontWeightScale.tsx
1655
- const styles$10 = {
1656
- wrapper: surfaceStyle,
1657
- caption: captionStyle,
1658
- empty: emptyStyle,
1659
- row: {
1660
- display: "grid",
1661
- gridTemplateColumns: "minmax(160px, 220px) 1fr auto",
1662
- gap: 16,
1663
- alignItems: "baseline",
1664
- padding: "12px 0",
1665
- borderBottom: BORDER_DEFAULT
1666
- },
1667
- meta: {
1668
- display: "flex",
1669
- flexDirection: "column",
1670
- gap: 2,
1671
- minWidth: 0
1672
- },
1673
- path: {
1674
- fontFamily: MONO_STACK,
1675
- fontSize: 12,
1676
- overflow: "hidden",
1677
- textOverflow: "ellipsis",
1678
- whiteSpace: "nowrap"
1679
- },
1680
- value: {
1681
- fontFamily: MONO_STACK,
1682
- fontSize: 11,
1683
- color: TEXT_MUTED
1684
- },
1685
- sample: {
1686
- fontSize: 28,
1687
- lineHeight: 1
1688
- },
1689
- cssVar: {
1690
- fontFamily: MONO_STACK,
1691
- fontSize: 11,
1692
- color: TEXT_MUTED
1693
- }
1694
- };
1695
1251
  function toWeight(raw) {
1696
1252
  if (typeof raw === "number") return raw;
1697
1253
  if (typeof raw === "string") {
@@ -1725,46 +1281,36 @@ function FontWeightScale({ filter, sample = "Aa", caption, sortBy = "value", sor
1725
1281
  const captionText = caption ?? `${rows.length} fontWeight token${rows.length === 1 ? "" : "s"}${filter && filter !== "fontWeight" ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
1726
1282
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
1727
1283
  ...themeAttrs(cssVarPrefix, activeTheme),
1728
- style: {
1729
- ...chromeAliases(cssVarPrefix),
1730
- ...styles$10.wrapper
1731
- },
1732
1284
  children: /* @__PURE__ */ jsx("div", {
1733
- style: styles$10.empty,
1285
+ className: "sb-block__empty",
1734
1286
  children: "No fontWeight tokens match this filter."
1735
1287
  })
1736
1288
  });
1737
1289
  return /* @__PURE__ */ jsxs("div", {
1738
1290
  ...themeAttrs(cssVarPrefix, activeTheme),
1739
- style: {
1740
- ...chromeAliases(cssVarPrefix),
1741
- ...styles$10.wrapper
1742
- },
1743
1291
  children: [/* @__PURE__ */ jsx("div", {
1744
- style: styles$10.caption,
1292
+ className: "sb-block__caption",
1745
1293
  children: captionText
1746
1294
  }), rows.map((row) => /* @__PURE__ */ jsxs("div", {
1747
- style: styles$10.row,
1295
+ className: "sb-font-weight-scale__row",
1748
1296
  children: [
1749
1297
  /* @__PURE__ */ jsxs("div", {
1750
- style: styles$10.meta,
1298
+ className: "sb-font-weight-scale__meta",
1751
1299
  children: [/* @__PURE__ */ jsx("span", {
1752
- style: styles$10.path,
1300
+ className: "sb-font-weight-scale__path",
1753
1301
  children: row.path
1754
1302
  }), /* @__PURE__ */ jsx("span", {
1755
- style: styles$10.value,
1303
+ className: "sb-font-weight-scale__value",
1756
1304
  children: row.display
1757
1305
  })]
1758
1306
  }),
1759
1307
  /* @__PURE__ */ jsx("div", {
1760
- style: {
1761
- ...styles$10.sample,
1762
- fontWeight: row.cssVar
1763
- },
1308
+ className: "sb-font-weight-scale__sample",
1309
+ style: { fontWeight: row.cssVar },
1764
1310
  children: sample
1765
1311
  }),
1766
1312
  /* @__PURE__ */ jsx("span", {
1767
- style: styles$10.cssVar,
1313
+ className: "sb-font-weight-scale__css-var",
1768
1314
  children: row.cssVar
1769
1315
  })
1770
1316
  ]
@@ -1773,62 +1319,6 @@ function FontWeightScale({ filter, sample = "Aa", caption, sortBy = "value", sor
1773
1319
  }
1774
1320
  //#endregion
1775
1321
  //#region src/GradientPalette.tsx
1776
- const styles$9 = {
1777
- wrapper: surfaceStyle,
1778
- caption: captionStyle,
1779
- empty: emptyStyle,
1780
- row: {
1781
- display: "grid",
1782
- gridTemplateColumns: "minmax(180px, 240px) 1fr minmax(140px, 220px)",
1783
- gap: 16,
1784
- alignItems: "center",
1785
- padding: "16px 0",
1786
- borderBottom: BORDER_DEFAULT
1787
- },
1788
- meta: {
1789
- display: "flex",
1790
- flexDirection: "column",
1791
- gap: 2,
1792
- minWidth: 0
1793
- },
1794
- path: {
1795
- fontFamily: MONO_STACK,
1796
- fontSize: 12,
1797
- overflow: "hidden",
1798
- textOverflow: "ellipsis",
1799
- whiteSpace: "nowrap"
1800
- },
1801
- cssVar: {
1802
- fontFamily: MONO_STACK,
1803
- fontSize: 11,
1804
- opacity: .7
1805
- },
1806
- sample: {
1807
- height: 56,
1808
- borderRadius: 6,
1809
- border: BORDER_FAINT
1810
- },
1811
- stops: {
1812
- fontFamily: MONO_STACK,
1813
- fontSize: 11,
1814
- display: "flex",
1815
- flexDirection: "column",
1816
- gap: 2
1817
- },
1818
- stopRow: {
1819
- display: "flex",
1820
- alignItems: "center",
1821
- gap: 8
1822
- },
1823
- stopSwatch: {
1824
- width: 10,
1825
- height: 10,
1826
- borderRadius: 2,
1827
- border: BORDER_DEFAULT,
1828
- flex: "0 0 auto"
1829
- },
1830
- stopPosition: { opacity: .6 }
1831
- };
1832
1322
  function asStops(raw) {
1833
1323
  if (!Array.isArray(raw)) return [];
1834
1324
  return raw;
@@ -1869,59 +1359,47 @@ function GradientPalette({ filter, caption, sortBy = "path", sortDir = "asc" })
1869
1359
  const captionText = caption ?? `${rows.length} gradient${rows.length === 1 ? "" : "s"}${filter ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
1870
1360
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
1871
1361
  ...themeAttrs(cssVarPrefix, activeTheme),
1872
- style: {
1873
- ...chromeAliases(cssVarPrefix),
1874
- ...styles$9.wrapper
1875
- },
1876
1362
  children: /* @__PURE__ */ jsx("div", {
1877
- style: styles$9.empty,
1363
+ className: "sb-block__empty",
1878
1364
  children: "No gradient tokens match this filter."
1879
1365
  })
1880
1366
  });
1881
1367
  return /* @__PURE__ */ jsxs("div", {
1882
1368
  ...themeAttrs(cssVarPrefix, activeTheme),
1883
- style: {
1884
- ...chromeAliases(cssVarPrefix),
1885
- ...styles$9.wrapper
1886
- },
1887
1369
  children: [/* @__PURE__ */ jsx("div", {
1888
- style: styles$9.caption,
1370
+ className: "sb-block__caption",
1889
1371
  children: captionText
1890
1372
  }), rows.map((row) => /* @__PURE__ */ jsxs("div", {
1891
- style: styles$9.row,
1373
+ className: "sb-gradient-palette__row",
1892
1374
  children: [
1893
1375
  /* @__PURE__ */ jsxs("div", {
1894
- style: styles$9.meta,
1376
+ className: "sb-gradient-palette__meta",
1895
1377
  children: [/* @__PURE__ */ jsx("span", {
1896
- style: styles$9.path,
1378
+ className: "sb-gradient-palette__path",
1897
1379
  children: row.path
1898
1380
  }), /* @__PURE__ */ jsx("span", {
1899
- style: styles$9.cssVar,
1381
+ className: "sb-gradient-palette__css-var",
1900
1382
  children: row.cssVar
1901
1383
  })]
1902
1384
  }),
1903
1385
  /* @__PURE__ */ jsx("div", {
1904
- style: {
1905
- ...styles$9.sample,
1906
- background: `linear-gradient(to right, ${row.cssVar})`
1907
- },
1386
+ className: "sb-gradient-palette__sample",
1387
+ style: { background: `linear-gradient(to right, ${row.cssVar})` },
1908
1388
  "aria-hidden": true
1909
1389
  }),
1910
1390
  /* @__PURE__ */ jsx("div", {
1911
- style: styles$9.stops,
1391
+ className: "sb-gradient-palette__stops",
1912
1392
  children: row.stops.map((stop, i) => /* @__PURE__ */ jsxs("div", {
1913
- style: styles$9.stopRow,
1393
+ className: "sb-gradient-palette__stop-row",
1914
1394
  children: [
1915
1395
  /* @__PURE__ */ jsx("span", {
1916
- style: {
1917
- ...styles$9.stopSwatch,
1918
- background: stopCssColor(stop)
1919
- },
1396
+ className: "sb-gradient-palette__stop-swatch",
1397
+ style: { background: stopCssColor(stop) },
1920
1398
  "aria-hidden": true
1921
1399
  }),
1922
1400
  /* @__PURE__ */ jsx("span", { children: stopCssColor(stop) }),
1923
1401
  /* @__PURE__ */ jsxs("span", {
1924
- style: styles$9.stopPosition,
1402
+ className: "sb-gradient-palette__stop-position",
1925
1403
  children: [
1926
1404
  "@ ",
1927
1405
  ((stop.position ?? 0) * 100).toFixed(0),
@@ -1957,7 +1435,7 @@ function usePrefersReducedMotion() {
1957
1435
  //#region src/motion-preview/MotionSample.tsx
1958
1436
  const DEFAULT_DURATION_MS = 300;
1959
1437
  const DEFAULT_EASING = "cubic-bezier(0.2, 0, 0, 1)";
1960
- const styles$8 = {
1438
+ const styles = {
1961
1439
  track: {
1962
1440
  position: "relative",
1963
1441
  height: 36,
@@ -1972,7 +1450,7 @@ const styles$8 = {
1972
1450
  height: 28,
1973
1451
  marginTop: -14,
1974
1452
  borderRadius: "50%",
1975
- background: "var(--sb-color-sys-accent-bg, #3b82f6)"
1453
+ background: "var(--swatchbook-accent-bg, #3b82f6)"
1976
1454
  },
1977
1455
  reducedMotion: {
1978
1456
  fontSize: 11,
@@ -2050,7 +1528,7 @@ function resolveMotionSpec(token, themeTokens) {
2050
1528
  return null;
2051
1529
  }
2052
1530
  function MotionSample({ path, speed = 1, runKey = 0 }) {
2053
- const { resolved, cssVarPrefix } = useProject();
1531
+ const { resolved } = useProject();
2054
1532
  const reducedMotion = usePrefersReducedMotion();
2055
1533
  const spec = useMemo(() => resolveMotionSpec(resolved[path], resolved), [resolved, path]);
2056
1534
  const durationMs = spec?.durationMs ?? DEFAULT_DURATION_MS;
@@ -2074,20 +1552,14 @@ function MotionSample({ path, speed = 1, runKey = 0 }) {
2074
1552
  reducedMotion
2075
1553
  ]);
2076
1554
  if (reducedMotion) return /* @__PURE__ */ jsx("div", {
2077
- style: {
2078
- ...chromeAliases(cssVarPrefix),
2079
- ...styles$8.reducedMotion
2080
- },
1555
+ style: styles.reducedMotion,
2081
1556
  children: "Animation suppressed by `prefers-reduced-motion: reduce`."
2082
1557
  });
2083
1558
  return /* @__PURE__ */ jsx("div", {
2084
- style: {
2085
- ...chromeAliases(cssVarPrefix),
2086
- ...styles$8.track
2087
- },
1559
+ style: styles.track,
2088
1560
  children: /* @__PURE__ */ jsx("div", {
2089
1561
  style: {
2090
- ...styles$8.ball,
1562
+ ...styles.ball,
2091
1563
  left: phase === 1 ? "calc(100% - 32px)" : "4px",
2092
1564
  transition: `left ${scaledDuration}ms ${easing}`
2093
1565
  },
@@ -2103,88 +1575,6 @@ const SPEEDS = [
2103
1575
  1,
2104
1576
  2
2105
1577
  ];
2106
- const styles$7 = {
2107
- wrapper: surfaceStyle,
2108
- caption: {
2109
- padding: "4px 0 4px",
2110
- color: TEXT_MUTED,
2111
- fontSize: 12
2112
- },
2113
- controls: {
2114
- display: "flex",
2115
- alignItems: "center",
2116
- gap: 8,
2117
- padding: "8px 0 12px"
2118
- },
2119
- controlLabel: {
2120
- fontSize: 11,
2121
- color: TEXT_MUTED,
2122
- textTransform: "uppercase",
2123
- letterSpacing: .5
2124
- },
2125
- speedBtn: {
2126
- fontFamily: MONO_STACK,
2127
- fontSize: 11,
2128
- padding: "4px 8px",
2129
- background: "transparent",
2130
- color: "inherit",
2131
- border: BORDER_STRONG,
2132
- borderRadius: 4,
2133
- cursor: "pointer"
2134
- },
2135
- speedBtnActive: {
2136
- background: "var(--sb-color-sys-accent-bg, #3b82f6)",
2137
- color: "var(--sb-color-sys-accent-fg, #fff)",
2138
- borderColor: "transparent"
2139
- },
2140
- replayBtn: {
2141
- fontSize: 11,
2142
- padding: "4px 10px",
2143
- marginLeft: "auto",
2144
- background: "transparent",
2145
- color: "inherit",
2146
- border: BORDER_STRONG,
2147
- borderRadius: 4,
2148
- cursor: "pointer"
2149
- },
2150
- row: {
2151
- display: "grid",
2152
- gridTemplateColumns: "minmax(180px, 240px) 1fr auto",
2153
- gap: 16,
2154
- alignItems: "center",
2155
- padding: "14px 0",
2156
- borderBottom: BORDER_DEFAULT
2157
- },
2158
- meta: {
2159
- display: "flex",
2160
- flexDirection: "column",
2161
- gap: 2,
2162
- minWidth: 0
2163
- },
2164
- path: {
2165
- fontFamily: MONO_STACK,
2166
- fontSize: 12,
2167
- overflow: "hidden",
2168
- textOverflow: "ellipsis",
2169
- whiteSpace: "nowrap"
2170
- },
2171
- specs: {
2172
- fontFamily: MONO_STACK,
2173
- fontSize: 11,
2174
- color: TEXT_MUTED
2175
- },
2176
- cssVar: {
2177
- fontFamily: MONO_STACK,
2178
- fontSize: 11,
2179
- color: TEXT_MUTED,
2180
- whiteSpace: "nowrap"
2181
- },
2182
- empty: {
2183
- padding: "24px 12px",
2184
- textAlign: "center",
2185
- color: TEXT_MUTED
2186
- }
2187
- };
2188
1578
  function formatSpec(row) {
2189
1579
  switch (row.kind) {
2190
1580
  case "transition": return `transition · ${Math.round(row.durationMs)}ms · ${row.easing}`;
@@ -2231,45 +1621,34 @@ function MotionPreview({ filter, caption }) {
2231
1621
  const captionText = caption ?? `${rows.length} motion token${rows.length === 1 ? "" : "s"}${filter ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
2232
1622
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
2233
1623
  ...themeAttrs(cssVarPrefix, activeTheme),
2234
- style: {
2235
- ...chromeAliases(cssVarPrefix),
2236
- ...styles$7.wrapper
2237
- },
2238
1624
  children: /* @__PURE__ */ jsx("div", {
2239
- style: styles$7.empty,
1625
+ className: "sb-block__empty",
2240
1626
  children: "No motion tokens match this filter."
2241
1627
  })
2242
1628
  });
2243
1629
  return /* @__PURE__ */ jsxs("div", {
2244
1630
  ...themeAttrs(cssVarPrefix, activeTheme),
2245
- style: {
2246
- ...chromeAliases(cssVarPrefix),
2247
- ...styles$7.wrapper
2248
- },
2249
1631
  children: [
2250
1632
  /* @__PURE__ */ jsx("div", {
2251
- style: styles$7.caption,
1633
+ className: "sb-block__caption",
2252
1634
  children: captionText
2253
1635
  }),
2254
1636
  /* @__PURE__ */ jsxs("div", {
2255
- style: styles$7.controls,
1637
+ className: "sb-motion-preview__controls",
2256
1638
  children: [
2257
1639
  /* @__PURE__ */ jsx("span", {
2258
- style: styles$7.controlLabel,
1640
+ className: "sb-motion-preview__control-label",
2259
1641
  children: "Speed"
2260
1642
  }),
2261
1643
  SPEEDS.map((s) => /* @__PURE__ */ jsxs("button", {
2262
1644
  type: "button",
2263
- style: {
2264
- ...styles$7.speedBtn,
2265
- ...s === speed ? styles$7.speedBtnActive : {}
2266
- },
1645
+ className: cx("sb-motion-preview__speed-btn", { "sb-motion-preview__speed-btn--active": s === speed }),
2267
1646
  onClick: () => setSpeed(s),
2268
1647
  children: [s, "×"]
2269
1648
  }, s)),
2270
1649
  /* @__PURE__ */ jsx("button", {
2271
1650
  type: "button",
2272
- style: styles$7.replayBtn,
1651
+ className: "sb-motion-preview__replay-btn",
2273
1652
  onClick: () => setRun((n) => n + 1),
2274
1653
  disabled: reducedMotion,
2275
1654
  title: reducedMotion ? "Disabled by prefers-reduced-motion" : "Replay all",
@@ -2278,15 +1657,15 @@ function MotionPreview({ filter, caption }) {
2278
1657
  ]
2279
1658
  }),
2280
1659
  rows.map((row) => /* @__PURE__ */ jsxs("div", {
2281
- style: styles$7.row,
1660
+ className: "sb-motion-preview__row",
2282
1661
  children: [
2283
1662
  /* @__PURE__ */ jsxs("div", {
2284
- style: styles$7.meta,
1663
+ className: "sb-motion-preview__meta",
2285
1664
  children: [/* @__PURE__ */ jsx("span", {
2286
- style: styles$7.path,
1665
+ className: "sb-motion-preview__path",
2287
1666
  children: row.path
2288
1667
  }), /* @__PURE__ */ jsx("span", {
2289
- style: styles$7.specs,
1668
+ className: "sb-motion-preview__specs",
2290
1669
  children: formatSpec(row)
2291
1670
  })]
2292
1671
  }),
@@ -2296,7 +1675,7 @@ function MotionPreview({ filter, caption }) {
2296
1675
  runKey: run
2297
1676
  }),
2298
1677
  /* @__PURE__ */ jsx("span", {
2299
- style: styles$7.cssVar,
1678
+ className: "sb-motion-preview__css-var",
2300
1679
  children: row.cssVar
2301
1680
  })
2302
1681
  ]
@@ -2345,7 +1724,6 @@ function ShadowSample({ path }) {
2345
1724
  const cssVar = makeCssVar(path, cssVarPrefix);
2346
1725
  return /* @__PURE__ */ jsx("div", {
2347
1726
  style: {
2348
- ...chromeAliases(cssVarPrefix),
2349
1727
  ...sampleStyle,
2350
1728
  boxShadow: cssVar
2351
1729
  },
@@ -2354,59 +1732,6 @@ function ShadowSample({ path }) {
2354
1732
  }
2355
1733
  //#endregion
2356
1734
  //#region src/ShadowPreview.tsx
2357
- const styles$6 = {
2358
- wrapper: surfaceStyle,
2359
- caption: captionStyle,
2360
- empty: emptyStyle,
2361
- row: {
2362
- display: "grid",
2363
- gridTemplateColumns: "minmax(160px, 220px) 140px 1fr",
2364
- gap: 16,
2365
- alignItems: "center",
2366
- padding: "16px 0",
2367
- borderBottom: BORDER_DEFAULT
2368
- },
2369
- meta: {
2370
- display: "flex",
2371
- flexDirection: "column",
2372
- gap: 2,
2373
- minWidth: 0
2374
- },
2375
- path: {
2376
- fontFamily: MONO_STACK,
2377
- fontSize: 12,
2378
- overflow: "hidden",
2379
- textOverflow: "ellipsis",
2380
- whiteSpace: "nowrap"
2381
- },
2382
- cssVar: {
2383
- fontFamily: MONO_STACK,
2384
- fontSize: 11,
2385
- opacity: .7
2386
- },
2387
- sampleCell: {
2388
- display: "flex",
2389
- alignItems: "center",
2390
- justifyContent: "center",
2391
- height: 96
2392
- },
2393
- breakdown: {
2394
- fontFamily: MONO_STACK,
2395
- fontSize: 11,
2396
- display: "grid",
2397
- gridTemplateColumns: "auto 1fr",
2398
- columnGap: 12,
2399
- rowGap: 2
2400
- },
2401
- breakdownKey: { color: TEXT_MUTED },
2402
- layerHeader: {
2403
- fontSize: 10,
2404
- textTransform: "uppercase",
2405
- letterSpacing: .5,
2406
- color: TEXT_MUTED,
2407
- marginTop: 6
2408
- }
2409
- };
2410
1735
  function formatDimension(raw) {
2411
1736
  if (raw == null) return "—";
2412
1737
  if (typeof raw === "number") return String(raw);
@@ -2462,43 +1787,35 @@ function ShadowPreview({ filter, caption, sortBy = "path", sortDir = "asc" }) {
2462
1787
  const captionText = caption ?? `${rows.length} shadow${rows.length === 1 ? "" : "s"}${filter ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
2463
1788
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
2464
1789
  ...themeAttrs(cssVarPrefix, activeTheme),
2465
- style: {
2466
- ...chromeAliases(cssVarPrefix),
2467
- ...styles$6.wrapper
2468
- },
2469
1790
  children: /* @__PURE__ */ jsx("div", {
2470
- style: styles$6.empty,
1791
+ className: "sb-block__empty",
2471
1792
  children: "No shadow tokens match this filter."
2472
1793
  })
2473
1794
  });
2474
1795
  return /* @__PURE__ */ jsxs("div", {
2475
1796
  ...themeAttrs(cssVarPrefix, activeTheme),
2476
- style: {
2477
- ...chromeAliases(cssVarPrefix),
2478
- ...styles$6.wrapper
2479
- },
2480
1797
  children: [/* @__PURE__ */ jsx("div", {
2481
- style: styles$6.caption,
1798
+ className: "sb-block__caption",
2482
1799
  children: captionText
2483
1800
  }), rows.map((row) => /* @__PURE__ */ jsxs("div", {
2484
- style: styles$6.row,
1801
+ className: "sb-shadow-preview__row",
2485
1802
  children: [
2486
1803
  /* @__PURE__ */ jsxs("div", {
2487
- style: styles$6.meta,
1804
+ className: "sb-shadow-preview__meta",
2488
1805
  children: [/* @__PURE__ */ jsx("span", {
2489
- style: styles$6.path,
1806
+ className: "sb-shadow-preview__path",
2490
1807
  children: row.path
2491
1808
  }), /* @__PURE__ */ jsx("span", {
2492
- style: styles$6.cssVar,
1809
+ className: "sb-shadow-preview__css-var",
2493
1810
  children: row.cssVar
2494
1811
  })]
2495
1812
  }),
2496
1813
  /* @__PURE__ */ jsx("div", {
2497
- style: styles$6.sampleCell,
1814
+ className: "sb-shadow-preview__sample-cell",
2498
1815
  children: /* @__PURE__ */ jsx(ShadowSample, { path: row.path })
2499
1816
  }),
2500
1817
  /* @__PURE__ */ jsx("div", {
2501
- style: styles$6.breakdown,
1818
+ className: "sb-shadow-preview__breakdown",
2502
1819
  children: row.layers.length === 1 ? renderLayer(row.layers[0]) : row.layers.map((layer, i) => /* @__PURE__ */ jsx(Layer, {
2503
1820
  layer,
2504
1821
  index: i,
@@ -2519,15 +1836,15 @@ function renderLayer(layer) {
2519
1836
  ];
2520
1837
  if (layer.inset) entries.push(["inset", String(layer.inset)]);
2521
1838
  return entries.flatMap(([k, v]) => [/* @__PURE__ */ jsx("span", {
2522
- style: styles$6.breakdownKey,
1839
+ className: "sb-shadow-preview__breakdown-key",
2523
1840
  children: k
2524
1841
  }, `k-${k}`), /* @__PURE__ */ jsx("span", { children: v }, `v-${k}`)]);
2525
1842
  }
2526
1843
  function Layer({ layer, index, total }) {
2527
1844
  return /* @__PURE__ */ jsxs("div", {
2528
- style: { gridColumn: "1 / -1" },
1845
+ className: "sb-shadow-preview__layer",
2529
1846
  children: [/* @__PURE__ */ jsxs("div", {
2530
- style: styles$6.layerHeader,
1847
+ className: "sb-shadow-preview__layer-header",
2531
1848
  children: [
2532
1849
  "layer ",
2533
1850
  index + 1,
@@ -2535,10 +1852,7 @@ function Layer({ layer, index, total }) {
2535
1852
  total
2536
1853
  ]
2537
1854
  }), /* @__PURE__ */ jsx("div", {
2538
- style: {
2539
- ...styles$6.breakdown,
2540
- marginTop: 2
2541
- },
1855
+ className: cx("sb-shadow-preview__breakdown", "sb-shadow-preview__layer-breakdown"),
2542
1856
  children: renderLayer(layer)
2543
1857
  })]
2544
1858
  });
@@ -2555,53 +1869,6 @@ const STRING_STYLES = new Set([
2555
1869
  "outset",
2556
1870
  "inset"
2557
1871
  ]);
2558
- const styles$5 = {
2559
- wrapper: surfaceStyle,
2560
- caption: captionStyle,
2561
- empty: emptyStyle,
2562
- row: {
2563
- display: "grid",
2564
- gridTemplateColumns: "minmax(160px, 220px) 1fr auto",
2565
- gap: 16,
2566
- alignItems: "center",
2567
- padding: "14px 0",
2568
- borderBottom: BORDER_DEFAULT
2569
- },
2570
- meta: {
2571
- display: "flex",
2572
- flexDirection: "column",
2573
- gap: 2,
2574
- minWidth: 0
2575
- },
2576
- path: {
2577
- fontFamily: MONO_STACK,
2578
- fontSize: 12,
2579
- overflow: "hidden",
2580
- textOverflow: "ellipsis",
2581
- whiteSpace: "nowrap"
2582
- },
2583
- value: {
2584
- fontFamily: MONO_STACK,
2585
- fontSize: 11,
2586
- color: TEXT_MUTED
2587
- },
2588
- line: {
2589
- height: 0,
2590
- borderTopWidth: 4,
2591
- borderTopColor: TEXT_DEFAULT,
2592
- width: "100%"
2593
- },
2594
- objectFallback: {
2595
- fontFamily: MONO_STACK,
2596
- fontSize: 11,
2597
- color: TEXT_MUTED
2598
- },
2599
- cssVar: {
2600
- fontFamily: MONO_STACK,
2601
- fontSize: 11,
2602
- color: TEXT_MUTED
2603
- }
2604
- };
2605
1872
  function extractCssStyle(value) {
2606
1873
  if (typeof value === "string" && STRING_STYLES.has(value)) return value;
2607
1874
  return null;
@@ -2631,49 +1898,39 @@ function StrokeStyleSample({ filter, caption, sortBy = "path", sortDir = "asc" }
2631
1898
  const captionText = caption ?? `${rows.length} strokeStyle token${rows.length === 1 ? "" : "s"}${filter && filter !== "strokeStyle" ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
2632
1899
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
2633
1900
  ...themeAttrs(cssVarPrefix, activeTheme),
2634
- style: {
2635
- ...chromeAliases(cssVarPrefix),
2636
- ...styles$5.wrapper
2637
- },
2638
1901
  children: /* @__PURE__ */ jsx("div", {
2639
- style: styles$5.empty,
1902
+ className: "sb-block__empty",
2640
1903
  children: "No strokeStyle tokens match this filter."
2641
1904
  })
2642
1905
  });
2643
1906
  return /* @__PURE__ */ jsxs("div", {
2644
1907
  ...themeAttrs(cssVarPrefix, activeTheme),
2645
- style: {
2646
- ...chromeAliases(cssVarPrefix),
2647
- ...styles$5.wrapper
2648
- },
2649
1908
  children: [/* @__PURE__ */ jsx("div", {
2650
- style: styles$5.caption,
1909
+ className: "sb-block__caption",
2651
1910
  children: captionText
2652
1911
  }), rows.map((row) => /* @__PURE__ */ jsxs("div", {
2653
- style: styles$5.row,
1912
+ className: "sb-stroke-style-sample__row",
2654
1913
  children: [
2655
1914
  /* @__PURE__ */ jsxs("div", {
2656
- style: styles$5.meta,
1915
+ className: "sb-stroke-style-sample__meta",
2657
1916
  children: [/* @__PURE__ */ jsx("span", {
2658
- style: styles$5.path,
1917
+ className: "sb-stroke-style-sample__path",
2659
1918
  children: row.path
2660
1919
  }), /* @__PURE__ */ jsx("span", {
2661
- style: styles$5.value,
1920
+ className: "sb-stroke-style-sample__value",
2662
1921
  children: row.displayValue
2663
1922
  })]
2664
1923
  }),
2665
1924
  row.cssStyle ? /* @__PURE__ */ jsx("div", {
2666
- style: {
2667
- ...styles$5.line,
2668
- borderTopStyle: row.cssStyle
2669
- },
1925
+ className: "sb-stroke-style-sample__line",
1926
+ style: { borderTopStyle: row.cssStyle },
2670
1927
  "aria-hidden": true
2671
1928
  }) : /* @__PURE__ */ jsx("span", {
2672
- style: styles$5.objectFallback,
1929
+ className: "sb-stroke-style-sample__object-fallback",
2673
1930
  children: "Object-form (dashArray + lineCap) — no pure CSS `border-style` equivalent."
2674
1931
  }),
2675
1932
  /* @__PURE__ */ jsx("span", {
2676
- style: styles$5.cssVar,
1933
+ className: "sb-stroke-style-sample__css-var",
2677
1934
  children: row.cssVar
2678
1935
  })
2679
1936
  ]
@@ -2681,275 +1938,6 @@ function StrokeStyleSample({ filter, caption, sortBy = "path", sortDir = "asc" }
2681
1938
  });
2682
1939
  }
2683
1940
  //#endregion
2684
- //#region src/token-detail/styles.ts
2685
- const styles$4 = {
2686
- wrapper: {
2687
- ...surfaceStyle,
2688
- padding: 16,
2689
- border: BORDER_DEFAULT
2690
- },
2691
- heading: {
2692
- margin: 0,
2693
- fontFamily: MONO_STACK,
2694
- fontSize: 16
2695
- },
2696
- subline: {
2697
- display: "flex",
2698
- alignItems: "center",
2699
- gap: 8,
2700
- margin: "4px 0 12px",
2701
- fontSize: 12,
2702
- opacity: .8
2703
- },
2704
- typePill: {
2705
- display: "inline-block",
2706
- padding: "2px 6px",
2707
- borderRadius: 4,
2708
- fontSize: 10,
2709
- letterSpacing: .5,
2710
- textTransform: "uppercase",
2711
- background: SURFACE_MUTED
2712
- },
2713
- description: {
2714
- margin: "0 0 12px",
2715
- opacity: .85
2716
- },
2717
- sectionHeader: {
2718
- fontFamily: MONO_STACK,
2719
- fontSize: 11,
2720
- textTransform: "uppercase",
2721
- letterSpacing: .5,
2722
- opacity: .6,
2723
- margin: "12px 0 6px"
2724
- },
2725
- chain: {
2726
- display: "flex",
2727
- flexWrap: "wrap",
2728
- gap: 6,
2729
- alignItems: "center",
2730
- fontFamily: MONO_STACK,
2731
- fontSize: 12
2732
- },
2733
- chainNode: {
2734
- padding: "2px 6px",
2735
- borderRadius: 4,
2736
- border: BORDER_DEFAULT
2737
- },
2738
- arrow: { opacity: .5 },
2739
- themeTable: {
2740
- width: "100%",
2741
- borderCollapse: "collapse",
2742
- tableLayout: "fixed",
2743
- fontSize: 12
2744
- },
2745
- themeRow: { borderBottom: BORDER_FAINT },
2746
- themeCell: {
2747
- padding: "6px 8px",
2748
- verticalAlign: "middle"
2749
- },
2750
- swatch: {
2751
- display: "inline-block",
2752
- width: 14,
2753
- height: 14,
2754
- verticalAlign: "middle",
2755
- marginRight: 6,
2756
- borderRadius: 3,
2757
- border: BORDER_DEFAULT
2758
- },
2759
- snippet: {
2760
- display: "block",
2761
- padding: "8px 10px",
2762
- borderRadius: 4,
2763
- background: SURFACE_MUTED,
2764
- fontFamily: MONO_STACK,
2765
- fontSize: 12,
2766
- whiteSpace: "pre",
2767
- overflow: "auto"
2768
- },
2769
- missing: {
2770
- padding: 12,
2771
- opacity: .7
2772
- },
2773
- typographySample: { padding: "8px 0" },
2774
- shadowSample: {
2775
- width: 140,
2776
- height: 56,
2777
- background: SURFACE_RAISED,
2778
- border: BORDER_FAINT,
2779
- borderRadius: 6
2780
- },
2781
- borderSample: {
2782
- width: 140,
2783
- height: 56,
2784
- background: SURFACE_RAISED,
2785
- borderRadius: 6
2786
- },
2787
- gradientSample: {
2788
- width: 220,
2789
- height: 56,
2790
- borderRadius: 6,
2791
- border: BORDER_FAINT
2792
- },
2793
- strokeStyleLine: {
2794
- height: 0,
2795
- borderTopWidth: 4,
2796
- borderTopColor: TEXT_DEFAULT,
2797
- width: 220
2798
- },
2799
- strokeStyleSvg: {
2800
- width: 220,
2801
- height: 24,
2802
- color: TEXT_DEFAULT
2803
- },
2804
- strokeStyleFallback: {
2805
- fontFamily: MONO_STACK,
2806
- fontSize: 12,
2807
- color: TEXT_MUTED
2808
- },
2809
- colorSwatchRow: {
2810
- display: "flex",
2811
- gap: 1,
2812
- borderRadius: 6,
2813
- overflow: "hidden",
2814
- border: BORDER_DEFAULT,
2815
- width: 220,
2816
- height: 56
2817
- },
2818
- colorSwatchLight: {
2819
- flex: 1,
2820
- boxShadow: "inset 0 0 0 8px rgba(255, 255, 255, 0.9)"
2821
- },
2822
- colorSwatchDark: {
2823
- flex: 1,
2824
- boxShadow: "inset 0 0 0 8px rgba(17, 17, 17, 0.9)"
2825
- },
2826
- breakdownSection: {
2827
- fontFamily: MONO_STACK,
2828
- fontSize: 12,
2829
- display: "grid",
2830
- gridTemplateColumns: "auto 1fr",
2831
- columnGap: 12,
2832
- rowGap: 3,
2833
- marginTop: 6
2834
- },
2835
- breakdownKey: { color: TEXT_MUTED },
2836
- breakdownLayerHeader: {
2837
- gridColumn: "1 / -1",
2838
- fontSize: 10,
2839
- textTransform: "uppercase",
2840
- letterSpacing: .5,
2841
- color: TEXT_MUTED,
2842
- marginTop: 4
2843
- },
2844
- fontFamilySample: {
2845
- padding: "4px 0",
2846
- fontSize: 22,
2847
- lineHeight: 1.2
2848
- },
2849
- fontWeightSample: {
2850
- padding: "4px 0",
2851
- fontSize: 32,
2852
- lineHeight: 1
2853
- },
2854
- dimensionTrack: {
2855
- display: "flex",
2856
- alignItems: "center",
2857
- height: 32,
2858
- maxWidth: "100%",
2859
- overflow: "hidden"
2860
- },
2861
- dimensionBar: {
2862
- height: 16,
2863
- background: "var(--sb-color-sys-accent-bg, #3b82f6)",
2864
- borderRadius: 3,
2865
- maxWidth: "100%"
2866
- },
2867
- motionTrack: {
2868
- position: "relative",
2869
- height: 32,
2870
- width: "100%",
2871
- maxWidth: 320,
2872
- background: SURFACE_MUTED,
2873
- borderRadius: 16,
2874
- overflow: "hidden"
2875
- },
2876
- motionBall: {
2877
- position: "absolute",
2878
- top: "50%",
2879
- width: 24,
2880
- height: 24,
2881
- marginTop: -12,
2882
- borderRadius: "50%",
2883
- background: "var(--sb-color-sys-accent-bg, #3b82f6)"
2884
- },
2885
- aliasedByList: {
2886
- listStyle: "none",
2887
- margin: 0,
2888
- padding: 0,
2889
- fontFamily: MONO_STACK,
2890
- fontSize: 12
2891
- },
2892
- aliasedByRow: {
2893
- padding: "2px 0",
2894
- display: "flex",
2895
- alignItems: "center",
2896
- gap: 6
2897
- },
2898
- aliasedByTruncated: {
2899
- fontSize: 11,
2900
- opacity: .6,
2901
- fontStyle: "italic",
2902
- marginTop: 4
2903
- },
2904
- reducedMotion: {
2905
- fontSize: 11,
2906
- color: TEXT_MUTED,
2907
- fontStyle: "italic"
2908
- },
2909
- tupleIndicator: {
2910
- fontSize: 11,
2911
- opacity: .7,
2912
- margin: "0 0 6px",
2913
- fontFamily: MONO_STACK
2914
- },
2915
- consumerRow: {
2916
- display: "flex",
2917
- alignItems: "center",
2918
- gap: 8,
2919
- padding: "6px 10px",
2920
- marginBottom: 4,
2921
- borderRadius: 4,
2922
- background: SURFACE_MUTED
2923
- },
2924
- consumerRowLabel: {
2925
- fontFamily: MONO_STACK,
2926
- fontSize: 10,
2927
- textTransform: "uppercase",
2928
- letterSpacing: .5,
2929
- opacity: .6,
2930
- minWidth: 32,
2931
- flexShrink: 0
2932
- },
2933
- consumerRowValue: {
2934
- flex: 1,
2935
- fontFamily: MONO_STACK,
2936
- fontSize: 12,
2937
- whiteSpace: "nowrap",
2938
- overflow: "auto"
2939
- },
2940
- consumerRowCopy: {
2941
- padding: "3px 8px",
2942
- fontSize: 11,
2943
- fontFamily: MONO_STACK,
2944
- background: SURFACE_RAISED,
2945
- color: TEXT_DEFAULT,
2946
- border: BORDER_STRONG,
2947
- borderRadius: 4,
2948
- cursor: "pointer",
2949
- flexShrink: 0
2950
- }
2951
- };
2952
- //#endregion
2953
1941
  //#region src/token-detail/internal.ts
2954
1942
  function useTokenDetailData(path) {
2955
1943
  const { activeTheme, activeAxes, axes, themes, themesResolved, resolved, cssVarPrefix } = useProject();
@@ -2978,17 +1966,17 @@ function AliasChain({ path }) {
2978
1966
  }, [token, path]);
2979
1967
  if (chain.length <= 1) return null;
2980
1968
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
2981
- style: styles$4.sectionHeader,
1969
+ className: "sb-token-detail__section-header",
2982
1970
  children: "Alias chain"
2983
1971
  }), /* @__PURE__ */ jsx("div", {
2984
- style: styles$4.chain,
1972
+ className: "sb-token-detail__chain",
2985
1973
  children: chain.map((step, i) => /* @__PURE__ */ jsxs("span", {
2986
- style: styles$4.chain,
1974
+ className: "sb-token-detail__chain",
2987
1975
  children: [/* @__PURE__ */ jsx("span", {
2988
- style: styles$4.chainNode,
1976
+ className: "sb-token-detail__chain-node",
2989
1977
  children: step
2990
1978
  }), i < chain.length - 1 && /* @__PURE__ */ jsx("span", {
2991
- style: styles$4.arrow,
1979
+ className: "sb-token-detail__arrow",
2992
1980
  children: "→"
2993
1981
  })]
2994
1982
  }, step))
@@ -3008,18 +1996,18 @@ function AliasedBy({ path }) {
3008
1996
  if (tree.length === 0) return null;
3009
1997
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3010
1998
  /* @__PURE__ */ jsx("div", {
3011
- style: styles$4.sectionHeader,
1999
+ className: "sb-token-detail__section-header",
3012
2000
  children: "Aliased by"
3013
2001
  }),
3014
2002
  /* @__PURE__ */ jsx("ul", {
3015
- style: styles$4.aliasedByList,
2003
+ className: "sb-token-detail__aliased-by-list",
3016
2004
  children: tree.map((node) => /* @__PURE__ */ jsx(AliasedByRow, {
3017
2005
  node,
3018
2006
  depth: 0
3019
2007
  }, node.path))
3020
2008
  }),
3021
2009
  truncated && /* @__PURE__ */ jsxs("div", {
3022
- style: styles$4.aliasedByTruncated,
2010
+ className: "sb-token-detail__aliased-by-truncated",
3023
2011
  children: [
3024
2012
  "Further descendants truncated at depth ",
3025
2013
  ALIASED_BY_DEPTH_CAP,
@@ -3030,16 +2018,14 @@ function AliasedBy({ path }) {
3030
2018
  }
3031
2019
  function AliasedByRow({ node, depth }) {
3032
2020
  return /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx("div", {
3033
- style: {
3034
- ...styles$4.aliasedByRow,
3035
- paddingLeft: depth * 16
3036
- },
2021
+ className: "sb-token-detail__aliased-by-row",
2022
+ style: { paddingLeft: depth * 16 },
3037
2023
  children: /* @__PURE__ */ jsx("span", {
3038
- style: styles$4.chainNode,
2024
+ className: "sb-token-detail__chain-node",
3039
2025
  children: node.path
3040
2026
  })
3041
2027
  }), node.children.length > 0 && /* @__PURE__ */ jsx("ul", {
3042
- style: styles$4.aliasedByList,
2028
+ className: "sb-token-detail__aliased-by-list",
3043
2029
  children: node.children.map((child) => /* @__PURE__ */ jsx(AliasedByRow, {
3044
2030
  node: child,
3045
2031
  depth: depth + 1
@@ -3106,22 +2092,20 @@ function AxisVariance({ path }) {
3106
2092
  const anyTheme = themes[0];
3107
2093
  const value = anyTheme ? formatFn(themesResolved[anyTheme.name]?.[path]) : "—";
3108
2094
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
3109
- style: styles$4.sectionHeader,
2095
+ className: "sb-token-detail__section-header",
3110
2096
  children: "Values across axes"
3111
2097
  }), /* @__PURE__ */ jsx("table", {
3112
- style: styles$4.themeTable,
2098
+ className: "sb-token-detail__theme-table",
3113
2099
  "data-testid": "token-detail-values",
3114
2100
  children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx("tr", {
3115
- style: styles$4.themeRow,
2101
+ className: "sb-token-detail__theme-row",
3116
2102
  children: /* @__PURE__ */ jsxs("td", {
3117
- style: styles$4.themeCell,
2103
+ className: "sb-token-detail__theme-cell",
3118
2104
  "data-testid": "token-detail-constant",
3119
2105
  children: [
3120
2106
  isColor && /* @__PURE__ */ jsx("span", {
3121
- style: {
3122
- ...styles$4.swatch,
3123
- background: cssVar
3124
- },
2107
+ className: "sb-token-detail__swatch",
2108
+ style: { background: cssVar },
3125
2109
  "aria-hidden": true
3126
2110
  }),
3127
2111
  value,
@@ -3162,28 +2146,24 @@ function AxisVariance({ path }) {
3162
2146
  };
3163
2147
  });
3164
2148
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
3165
- style: styles$4.sectionHeader,
2149
+ className: "sb-token-detail__section-header",
3166
2150
  children: ["Varies with ", axisName]
3167
2151
  }), /* @__PURE__ */ jsx("table", {
3168
- style: styles$4.themeTable,
2152
+ className: "sb-token-detail__theme-table",
3169
2153
  "data-testid": "token-detail-values",
3170
2154
  children: /* @__PURE__ */ jsx("tbody", { children: contextValues.map((row) => /* @__PURE__ */ jsxs("tr", {
3171
- style: styles$4.themeRow,
2155
+ className: "sb-token-detail__theme-row",
3172
2156
  "data-axis": axisName,
3173
2157
  "data-context": row.ctx,
3174
2158
  children: [/* @__PURE__ */ jsx("td", {
3175
- style: {
3176
- ...styles$4.themeCell,
3177
- width: "30%"
3178
- },
2159
+ className: "sb-token-detail__theme-cell",
2160
+ style: { width: "30%" },
3179
2161
  children: row.ctx
3180
2162
  }), /* @__PURE__ */ jsxs("td", {
3181
- style: styles$4.themeCell,
2163
+ className: "sb-token-detail__theme-cell",
3182
2164
  children: [isColor && row.themeName && /* @__PURE__ */ jsx("span", {
3183
- style: {
3184
- ...styles$4.swatch,
3185
- background: cssVar
3186
- },
2165
+ className: "sb-token-detail__swatch",
2166
+ style: { background: cssVar },
3187
2167
  [dataAttr(cssVarPrefix, "theme")]: row.themeName,
3188
2168
  "aria-hidden": true
3189
2169
  }), row.value]
@@ -3195,17 +2175,17 @@ function AxisVariance({ path }) {
3195
2175
  if (!rowAxis || !colAxis) return /* @__PURE__ */ jsx(Fragment, {});
3196
2176
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3197
2177
  /* @__PURE__ */ jsxs("div", {
3198
- style: styles$4.sectionHeader,
2178
+ className: "sb-token-detail__section-header",
3199
2179
  children: ["Varies with ", variance.varyingAxes.join(" × ")]
3200
2180
  }),
3201
2181
  /* @__PURE__ */ jsxs("table", {
3202
- style: styles$4.themeTable,
2182
+ className: "sb-token-detail__theme-table",
3203
2183
  "data-testid": "token-detail-values",
3204
2184
  children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", {
3205
- style: styles$4.themeRow,
2185
+ className: "sb-token-detail__theme-row",
3206
2186
  children: [/* @__PURE__ */ jsxs("th", {
2187
+ className: "sb-token-detail__theme-cell",
3207
2188
  style: {
3208
- ...styles$4.themeCell,
3209
2189
  textAlign: "left",
3210
2190
  opacity: .7
3211
2191
  },
@@ -3215,17 +2195,17 @@ function AxisVariance({ path }) {
3215
2195
  colAxis.name
3216
2196
  ]
3217
2197
  }), colAxis.contexts.map((col) => /* @__PURE__ */ jsx("th", {
2198
+ className: "sb-token-detail__theme-cell",
3218
2199
  style: {
3219
- ...styles$4.themeCell,
3220
2200
  textAlign: "left",
3221
2201
  opacity: .7
3222
2202
  },
3223
2203
  children: col
3224
2204
  }, col))]
3225
2205
  }) }), /* @__PURE__ */ jsx("tbody", { children: rowAxis.contexts.map((row) => /* @__PURE__ */ jsxs("tr", {
3226
- style: styles$4.themeRow,
2206
+ className: "sb-token-detail__theme-row",
3227
2207
  children: [/* @__PURE__ */ jsx("td", {
3228
- style: styles$4.themeCell,
2208
+ className: "sb-token-detail__theme-cell",
3229
2209
  children: row
3230
2210
  }), colAxis.contexts.map((col) => {
3231
2211
  const name = tupleName(themes, {
@@ -3235,14 +2215,12 @@ function AxisVariance({ path }) {
3235
2215
  });
3236
2216
  const value = name ? formatFn(themesResolved[name]?.[path]) : "—";
3237
2217
  return /* @__PURE__ */ jsxs("td", {
3238
- style: styles$4.themeCell,
2218
+ className: "sb-token-detail__theme-cell",
3239
2219
  "data-row": row,
3240
2220
  "data-col": col,
3241
2221
  children: [isColor && name && /* @__PURE__ */ jsx("span", {
3242
- style: {
3243
- ...styles$4.swatch,
3244
- background: cssVar
3245
- },
2222
+ className: "sb-token-detail__swatch",
2223
+ style: { background: cssVar },
3246
2224
  [dataAttr(cssVarPrefix, "theme")]: name,
3247
2225
  "aria-hidden": true
3248
2226
  }), value]
@@ -3251,10 +2229,8 @@ function AxisVariance({ path }) {
3251
2229
  }, row)) })]
3252
2230
  }),
3253
2231
  extra.length > 0 && /* @__PURE__ */ jsxs("div", {
3254
- style: {
3255
- ...styles$4.aliasedByTruncated,
3256
- marginTop: 6
3257
- },
2232
+ className: "sb-token-detail__aliased-by-truncated",
2233
+ style: { marginTop: 6 },
3258
2234
  children: [
3259
2235
  "Values also vary with ",
3260
2236
  extra.map((a) => a.name).join(", "),
@@ -3359,14 +2335,14 @@ function CompositeBreakdownContent({ type, rawValue, colorFormat }) {
3359
2335
  const layers = Array.isArray(rawValue) ? rawValue : [rawValue];
3360
2336
  const multi = layers.length > 1;
3361
2337
  return /* @__PURE__ */ jsx("div", {
3362
- style: styles$4.breakdownSection,
2338
+ className: "sb-token-detail__breakdown-section",
3363
2339
  children: layers.map((layer, i) => {
3364
2340
  const v = layer;
3365
2341
  return /* @__PURE__ */ jsxs("div", {
3366
2342
  style: { display: "contents" },
3367
2343
  children: [
3368
2344
  multi && /* @__PURE__ */ jsxs("div", {
3369
- style: styles$4.breakdownLayerHeader,
2345
+ className: "sb-token-detail__breakdown-layer-header",
3370
2346
  children: ["Layer ", i + 1]
3371
2347
  }),
3372
2348
  /* @__PURE__ */ jsx(KeyValueRow, {
@@ -3402,7 +2378,7 @@ function CompositeBreakdownContent({ type, rawValue, colorFormat }) {
3402
2378
  const stops = Array.isArray(rawValue) ? rawValue : [];
3403
2379
  if (stops.length === 0) return null;
3404
2380
  return /* @__PURE__ */ jsx("div", {
3405
- style: styles$4.breakdownSection,
2381
+ className: "sb-token-detail__breakdown-section",
3406
2382
  children: stops.map((stop, i) => {
3407
2383
  const v = stop;
3408
2384
  return /* @__PURE__ */ jsx(KeyValueRow, {
@@ -3416,7 +2392,7 @@ function CompositeBreakdownContent({ type, rawValue, colorFormat }) {
3416
2392
  }
3417
2393
  function renderKeyValueList(rows) {
3418
2394
  return /* @__PURE__ */ jsx("div", {
3419
- style: styles$4.breakdownSection,
2395
+ className: "sb-token-detail__breakdown-section",
3420
2396
  children: rows.filter(([, v]) => v !== null).map(([k, v]) => /* @__PURE__ */ jsx(KeyValueRow, {
3421
2397
  label: k,
3422
2398
  value: v ?? ""
@@ -3425,7 +2401,7 @@ function renderKeyValueList(rows) {
3425
2401
  }
3426
2402
  function KeyValueRow({ label, value }) {
3427
2403
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
3428
- style: styles$4.breakdownKey,
2404
+ className: "sb-token-detail__breakdown-key",
3429
2405
  children: label
3430
2406
  }), /* @__PURE__ */ jsx("span", { children: value ?? "—" })] });
3431
2407
  }
@@ -3498,8 +2474,8 @@ function CompositePreviewContent({ type, cssVar, rawValue }) {
3498
2474
  if (type === "typography") {
3499
2475
  const base = cssVar.replace(/^var\(/, "").replace(/\)$/, "");
3500
2476
  return /* @__PURE__ */ jsx("div", {
2477
+ className: "sb-token-detail__typography-sample",
3501
2478
  style: {
3502
- ...styles$4.typographySample,
3503
2479
  fontFamily: `var(${base}-font-family)`,
3504
2480
  fontSize: `var(${base}-font-size)`,
3505
2481
  fontWeight: `var(${base}-font-weight)`,
@@ -3510,85 +2486,71 @@ function CompositePreviewContent({ type, cssVar, rawValue }) {
3510
2486
  });
3511
2487
  }
3512
2488
  if (type === "shadow") return /* @__PURE__ */ jsx("div", {
3513
- style: {
3514
- ...styles$4.shadowSample,
3515
- boxShadow: cssVar
3516
- },
2489
+ className: "sb-token-detail__shadow-sample",
2490
+ style: { boxShadow: cssVar },
3517
2491
  "aria-hidden": true
3518
2492
  });
3519
2493
  if (type === "border") return /* @__PURE__ */ jsx("div", {
3520
- style: {
3521
- ...styles$4.borderSample,
3522
- border: cssVar
3523
- },
2494
+ className: "sb-token-detail__border-sample",
2495
+ style: { border: cssVar },
3524
2496
  "aria-hidden": true
3525
2497
  });
3526
2498
  if (type === "transition") return /* @__PURE__ */ jsx(TransitionSample, { transition: cssVar });
3527
2499
  if (type === "dimension") return /* @__PURE__ */ jsx("div", {
3528
- style: styles$4.dimensionTrack,
2500
+ className: "sb-token-detail__dimension-track",
3529
2501
  children: /* @__PURE__ */ jsx("div", {
3530
- style: {
3531
- ...styles$4.dimensionBar,
3532
- width: cssVar
3533
- },
2502
+ className: "sb-token-detail__dimension-bar",
2503
+ style: { width: cssVar },
3534
2504
  "aria-hidden": true
3535
2505
  })
3536
2506
  });
3537
2507
  if (type === "duration") return /* @__PURE__ */ jsx(TransitionSample, { transition: `left ${cssVar} ease` });
3538
2508
  if (type === "fontFamily") return /* @__PURE__ */ jsx("div", {
3539
- style: {
3540
- ...styles$4.fontFamilySample,
3541
- fontFamily: cssVar
3542
- },
2509
+ className: "sb-token-detail__font-family-sample",
2510
+ style: { fontFamily: cssVar },
3543
2511
  children: PANGRAM
3544
2512
  });
3545
2513
  if (type === "fontWeight") return /* @__PURE__ */ jsx("div", {
3546
- style: {
3547
- ...styles$4.fontWeightSample,
3548
- fontWeight: cssVar
3549
- },
2514
+ className: "sb-token-detail__font-weight-sample",
2515
+ style: { fontWeight: cssVar },
3550
2516
  children: "Aa"
3551
2517
  });
3552
2518
  if (type === "cubicBezier") return /* @__PURE__ */ jsx(TransitionSample, { transition: `left 800ms ${cssVar}` });
3553
2519
  if (type === "gradient") return /* @__PURE__ */ jsx("div", {
3554
- style: {
3555
- ...styles$4.gradientSample,
3556
- background: `linear-gradient(to right, ${cssVar})`
3557
- },
2520
+ className: "sb-token-detail__gradient-sample",
2521
+ style: { background: `linear-gradient(to right, ${cssVar})` },
3558
2522
  "aria-hidden": true
3559
2523
  });
3560
2524
  if (type === "strokeStyle") return /* @__PURE__ */ jsx(StrokeStylePreview, { value: rawValue });
3561
2525
  if (type === "color") return /* @__PURE__ */ jsxs("div", {
3562
- style: styles$4.colorSwatchRow,
2526
+ className: "sb-token-detail__color-swatch-row",
3563
2527
  "aria-hidden": true,
3564
- children: [/* @__PURE__ */ jsx("div", { style: {
3565
- ...styles$4.colorSwatchLight,
3566
- background: cssVar
3567
- } }), /* @__PURE__ */ jsx("div", { style: {
3568
- ...styles$4.colorSwatchDark,
3569
- background: cssVar
3570
- } })]
2528
+ children: [/* @__PURE__ */ jsx("div", {
2529
+ className: "sb-token-detail__color-swatch-light",
2530
+ style: { background: cssVar }
2531
+ }), /* @__PURE__ */ jsx("div", {
2532
+ className: "sb-token-detail__color-swatch-dark",
2533
+ style: { background: cssVar }
2534
+ })]
3571
2535
  });
3572
2536
  return null;
3573
2537
  }
3574
2538
  function StrokeStylePreview({ value }) {
3575
2539
  if (typeof value === "string" && STROKE_STYLE_STRINGS.has(value)) return /* @__PURE__ */ jsx("div", {
3576
- style: {
3577
- ...styles$4.strokeStyleLine,
3578
- borderTopStyle: value
3579
- },
2540
+ className: "sb-token-detail__stroke-style-line",
2541
+ style: { borderTopStyle: value },
3580
2542
  "aria-hidden": true
3581
2543
  });
3582
2544
  if (value && typeof value === "object" && "dashArray" in value) {
3583
2545
  const v = value;
3584
2546
  const lengths = asDashLengths(v.dashArray);
3585
2547
  if (lengths.length === 0) return /* @__PURE__ */ jsx("div", {
3586
- style: styles$4.strokeStyleFallback,
2548
+ className: "sb-token-detail__stroke-style-fallback",
3587
2549
  children: "Object-form strokeStyle with no resolvable dashArray."
3588
2550
  });
3589
2551
  const cap = typeof v.lineCap === "string" ? v.lineCap : "butt";
3590
2552
  return /* @__PURE__ */ jsx("svg", {
3591
- style: styles$4.strokeStyleSvg,
2553
+ className: "sb-token-detail__stroke-style-svg",
3592
2554
  viewBox: "0 0 220 24",
3593
2555
  preserveAspectRatio: "none",
3594
2556
  "aria-hidden": true,
@@ -3605,7 +2567,7 @@ function StrokeStylePreview({ value }) {
3605
2567
  });
3606
2568
  }
3607
2569
  return /* @__PURE__ */ jsx("div", {
3608
- style: styles$4.strokeStyleFallback,
2570
+ className: "sb-token-detail__stroke-style-fallback",
3609
2571
  children: "strokeStyle value could not be previewed."
3610
2572
  });
3611
2573
  }
@@ -3639,14 +2601,14 @@ function TransitionSample({ transition }) {
3639
2601
  };
3640
2602
  }, [reduced]);
3641
2603
  if (reduced) return /* @__PURE__ */ jsx("div", {
3642
- style: styles$4.reducedMotion,
2604
+ className: "sb-token-detail__reduced-motion",
3643
2605
  children: "Animation suppressed by `prefers-reduced-motion: reduce`."
3644
2606
  });
3645
2607
  return /* @__PURE__ */ jsx("div", {
3646
- style: styles$4.motionTrack,
2608
+ className: "sb-token-detail__motion-track",
3647
2609
  children: /* @__PURE__ */ jsx("div", {
2610
+ className: "sb-token-detail__motion-ball",
3648
2611
  style: {
3649
- ...styles$4.motionBall,
3650
2612
  left: phase === 1 ? "calc(100% - 28px)" : "4px",
3651
2613
  transition
3652
2614
  },
@@ -3662,11 +2624,11 @@ function ConsumerOutput({ path }) {
3662
2624
  const tupleLabel = Object.entries(activeAxes).map(([k, v]) => `${k}=${v}`).join(", ");
3663
2625
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3664
2626
  /* @__PURE__ */ jsx("div", {
3665
- style: styles$4.sectionHeader,
2627
+ className: "sb-token-detail__section-header",
3666
2628
  children: "Consumer output"
3667
2629
  }),
3668
2630
  tupleLabel && /* @__PURE__ */ jsxs("div", {
3669
- style: styles$4.tupleIndicator,
2631
+ className: "sb-token-detail__tuple-indicator",
3670
2632
  children: ["Active tuple: ", /* @__PURE__ */ jsx("strong", { children: tupleLabel })]
3671
2633
  }),
3672
2634
  /* @__PURE__ */ jsx(OutputRow, {
@@ -3683,14 +2645,14 @@ function ConsumerOutput({ path }) {
3683
2645
  }
3684
2646
  function OutputRow({ label, value, testId }) {
3685
2647
  return /* @__PURE__ */ jsxs("div", {
3686
- style: styles$4.consumerRow,
2648
+ className: "sb-token-detail__consumer-row",
3687
2649
  children: [
3688
2650
  /* @__PURE__ */ jsx("span", {
3689
- style: styles$4.consumerRowLabel,
2651
+ className: "sb-token-detail__consumer-row-label",
3690
2652
  children: label
3691
2653
  }),
3692
2654
  /* @__PURE__ */ jsx("code", {
3693
- style: styles$4.consumerRowValue,
2655
+ className: "sb-token-detail__consumer-row-value",
3694
2656
  "data-testid": testId,
3695
2657
  children: value
3696
2658
  }),
@@ -3705,7 +2667,7 @@ function CopyButton({ text, testId }) {
3705
2667
  const [copied, setCopied] = useState(false);
3706
2668
  return /* @__PURE__ */ jsx("button", {
3707
2669
  type: "button",
3708
- style: styles$4.consumerRowCopy,
2670
+ className: "sb-token-detail__consumer-row-copy",
3709
2671
  "data-testid": testId,
3710
2672
  onClick: () => {
3711
2673
  copyToClipboard(text).then((ok) => {
@@ -3731,7 +2693,7 @@ async function copyToClipboard(text) {
3731
2693
  function TokenHeader({ path, heading }) {
3732
2694
  const { token, cssVar, activeTheme } = useTokenDetailData(path);
3733
2695
  if (!token) return /* @__PURE__ */ jsxs("div", {
3734
- style: styles$4.missing,
2696
+ className: "sb-token-detail__missing",
3735
2697
  children: [
3736
2698
  "Token ",
3737
2699
  /* @__PURE__ */ jsx("code", { children: path }),
@@ -3742,18 +2704,18 @@ function TokenHeader({ path, heading }) {
3742
2704
  });
3743
2705
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3744
2706
  /* @__PURE__ */ jsx("h3", {
3745
- style: styles$4.heading,
2707
+ className: "sb-token-detail__heading",
3746
2708
  children: heading ?? path
3747
2709
  }),
3748
2710
  /* @__PURE__ */ jsxs("div", {
3749
- style: styles$4.subline,
2711
+ className: "sb-token-detail__subline",
3750
2712
  children: [token.$type && /* @__PURE__ */ jsx("span", {
3751
- style: styles$4.typePill,
2713
+ className: "sb-token-detail__type-pill",
3752
2714
  children: token.$type
3753
2715
  }), /* @__PURE__ */ jsx("span", { children: cssVar })]
3754
2716
  }),
3755
2717
  token.$description && /* @__PURE__ */ jsx("p", {
3756
- style: styles$4.description,
2718
+ className: "sb-token-detail__description",
3757
2719
  children: token.$description
3758
2720
  })
3759
2721
  ] });
@@ -3764,10 +2726,10 @@ function TokenUsageSnippet({ path }) {
3764
2726
  const { token, cssVar } = useTokenDetailData(path);
3765
2727
  if (!token) return null;
3766
2728
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
3767
- style: styles$4.sectionHeader,
2729
+ className: "sb-token-detail__section-header",
3768
2730
  children: "Usage"
3769
2731
  }), /* @__PURE__ */ jsx("code", {
3770
- style: styles$4.snippet,
2732
+ className: "sb-token-detail__snippet",
3771
2733
  children: `color: ${cssVar};`
3772
2734
  })] });
3773
2735
  }
@@ -3776,14 +2738,12 @@ function TokenUsageSnippet({ path }) {
3776
2738
  function TokenDetail({ path, heading }) {
3777
2739
  const { token, cssVar, activeTheme, cssVarPrefix } = useTokenDetailData(path);
3778
2740
  const colorFormat = useColorFormat();
2741
+ const theme = themeAttrs(cssVarPrefix, activeTheme);
3779
2742
  if (!token) return /* @__PURE__ */ jsx("div", {
3780
- ...themeAttrs(cssVarPrefix, activeTheme),
3781
- style: {
3782
- ...chromeAliases(cssVarPrefix),
3783
- ...styles$4.wrapper
3784
- },
2743
+ ...theme,
2744
+ className: cx(theme["className"], "sb-token-detail"),
3785
2745
  children: /* @__PURE__ */ jsxs("div", {
3786
- style: styles$4.missing,
2746
+ className: "sb-token-detail__missing",
3787
2747
  children: [
3788
2748
  "Token ",
3789
2749
  /* @__PURE__ */ jsx("code", { children: path }),
@@ -3798,30 +2758,25 @@ function TokenDetail({ path, heading }) {
3798
2758
  const value = formatTokenValue(token.$value, token.$type, colorFormat);
3799
2759
  const outOfGamut = gamut?.outOfGamut ?? false;
3800
2760
  return /* @__PURE__ */ jsxs("div", {
3801
- ...themeAttrs(cssVarPrefix, activeTheme),
3802
- style: {
3803
- ...chromeAliases(cssVarPrefix),
3804
- ...styles$4.wrapper
3805
- },
2761
+ ...theme,
2762
+ className: cx(theme["className"], "sb-token-detail"),
3806
2763
  children: [
3807
2764
  /* @__PURE__ */ jsx(TokenHeader, {
3808
2765
  path,
3809
2766
  ...heading !== void 0 && { heading }
3810
2767
  }),
3811
2768
  /* @__PURE__ */ jsxs("div", {
3812
- style: styles$4.sectionHeader,
2769
+ className: "sb-token-detail__section-header",
3813
2770
  children: ["Resolved value · ", activeTheme]
3814
2771
  }),
3815
2772
  /* @__PURE__ */ jsx(CompositePreview, { path }),
3816
2773
  /* @__PURE__ */ jsx(CompositeBreakdown, { path }),
3817
2774
  /* @__PURE__ */ jsxs("div", {
3818
- style: styles$4.chain,
2775
+ className: "sb-token-detail__chain",
3819
2776
  children: [
3820
2777
  isColor && /* @__PURE__ */ jsx("span", {
3821
- style: {
3822
- ...styles$4.swatch,
3823
- background: cssVar
3824
- },
2778
+ className: "sb-token-detail__swatch",
2779
+ style: { background: cssVar },
3825
2780
  "aria-hidden": true
3826
2781
  }),
3827
2782
  /* @__PURE__ */ jsx("span", { children: value }),
@@ -3843,49 +2798,6 @@ function TokenDetail({ path, heading }) {
3843
2798
  }
3844
2799
  //#endregion
3845
2800
  //#region src/internal/DetailOverlay.tsx
3846
- /**
3847
- * Slide-over that wraps `<TokenDetail>`. Shared between `<TokenNavigator />`
3848
- * and `<TokenTable />` so both land on the same opener and the same styling.
3849
- *
3850
- * Dismisses on backdrop click, Escape, and the close button. `role="dialog"`
3851
- * + `aria-modal="true"` hints to AT that focus is trapped here; actual focus
3852
- * management is tracked in the open-issue #253.
3853
- */
3854
- const styles$3 = {
3855
- backdrop: {
3856
- position: "fixed",
3857
- inset: 0,
3858
- background: "rgba(0,0,0,0.4)",
3859
- zIndex: 1e4,
3860
- display: "flex",
3861
- alignItems: "stretch",
3862
- justifyContent: "flex-end"
3863
- },
3864
- panel: {
3865
- width: "min(560px, 100%)",
3866
- height: "100%",
3867
- overflowY: "auto",
3868
- background: SURFACE_DEFAULT,
3869
- color: TEXT_DEFAULT,
3870
- boxShadow: "-8px 0 24px rgba(0,0,0,0.2)",
3871
- padding: 16,
3872
- position: "relative"
3873
- },
3874
- closeButton: {
3875
- position: "absolute",
3876
- top: 8,
3877
- right: 8,
3878
- width: 32,
3879
- height: 32,
3880
- borderRadius: 4,
3881
- border: BORDER_STRONG,
3882
- background: "transparent",
3883
- color: "inherit",
3884
- cursor: "pointer",
3885
- fontSize: 16,
3886
- lineHeight: 1
3887
- }
3888
- };
3889
2801
  function DetailOverlay({ path, onClose, testId = "swatchbook-overlay" }) {
3890
2802
  useEffect(() => {
3891
2803
  const onKey = (e) => {
@@ -3895,19 +2807,19 @@ function DetailOverlay({ path, onClose, testId = "swatchbook-overlay" }) {
3895
2807
  return () => window.removeEventListener("keydown", onKey);
3896
2808
  }, [onClose]);
3897
2809
  return /* @__PURE__ */ jsx("div", {
3898
- style: styles$3.backdrop,
2810
+ className: "sb-detail-overlay__backdrop",
3899
2811
  onClick: onClose,
3900
2812
  role: "presentation",
3901
2813
  "data-testid": testId,
3902
2814
  children: /* @__PURE__ */ jsxs("div", {
3903
- style: styles$3.panel,
2815
+ className: "sb-detail-overlay__panel",
3904
2816
  onClick: (e) => e.stopPropagation(),
3905
2817
  role: "dialog",
3906
2818
  "aria-modal": "true",
3907
2819
  "aria-label": `Token detail for ${path}`,
3908
2820
  children: [/* @__PURE__ */ jsx("button", {
3909
2821
  type: "button",
3910
- style: styles$3.closeButton,
2822
+ className: "sb-detail-overlay__close",
3911
2823
  onClick: onClose,
3912
2824
  "aria-label": "Close",
3913
2825
  "data-testid": `${testId}-close`,
@@ -3918,89 +2830,6 @@ function DetailOverlay({ path, onClose, testId = "swatchbook-overlay" }) {
3918
2830
  }
3919
2831
  //#endregion
3920
2832
  //#region src/TokenNavigator.tsx
3921
- const styles$2 = {
3922
- wrapper: surfaceStyle,
3923
- caption: {
3924
- padding: "4px 0 12px",
3925
- color: TEXT_MUTED,
3926
- fontSize: 12
3927
- },
3928
- tree: {
3929
- listStyle: "none",
3930
- margin: 0,
3931
- padding: 0
3932
- },
3933
- nested: {
3934
- listStyle: "none",
3935
- margin: 0,
3936
- paddingLeft: 18,
3937
- borderLeft: BORDER_DEFAULT
3938
- },
3939
- groupRow: {
3940
- display: "flex",
3941
- alignItems: "center",
3942
- gap: 6,
3943
- padding: "4px 6px",
3944
- borderRadius: 4,
3945
- cursor: "pointer",
3946
- userSelect: "none",
3947
- fontFamily: MONO_STACK,
3948
- fontSize: 12
3949
- },
3950
- leafRow: {
3951
- display: "flex",
3952
- alignItems: "center",
3953
- gap: 8,
3954
- padding: "4px 6px",
3955
- borderRadius: 4,
3956
- cursor: "pointer",
3957
- fontFamily: MONO_STACK,
3958
- fontSize: 12
3959
- },
3960
- caret: {
3961
- display: "inline-block",
3962
- width: 12,
3963
- textAlign: "center",
3964
- color: TEXT_MUTED
3965
- },
3966
- tail: {
3967
- fontFamily: MONO_STACK,
3968
- fontSize: 12
3969
- },
3970
- typePill: {
3971
- ...typePillStyle,
3972
- padding: "1px 6px",
3973
- fontSize: 10
3974
- },
3975
- value: {
3976
- fontSize: 11,
3977
- color: TEXT_MUTED,
3978
- marginLeft: "auto",
3979
- minWidth: 0,
3980
- textAlign: "right",
3981
- overflow: "hidden",
3982
- textOverflow: "ellipsis",
3983
- whiteSpace: "nowrap"
3984
- },
3985
- count: {
3986
- marginLeft: "auto",
3987
- fontSize: 11,
3988
- color: TEXT_DEFAULT
3989
- },
3990
- colorSwatch: {
3991
- display: "inline-block",
3992
- width: 14,
3993
- height: 14,
3994
- borderRadius: 3,
3995
- border: BORDER_DEFAULT
3996
- },
3997
- previewBox: {
3998
- display: "inline-flex",
3999
- alignItems: "center",
4000
- justifyContent: "flex-end",
4001
- marginLeft: "auto"
4002
- }
4003
- };
4004
2833
  function buildTree(resolved, root) {
4005
2834
  const rootPrefix = root && root.length > 0 ? `${root}.` : "";
4006
2835
  const rootSegments = root ? root.split(".") : [];
@@ -4098,21 +2927,13 @@ function TokenNavigator({ root, initiallyExpanded = 1, onSelect }) {
4098
2927
  }, [onSelect]);
4099
2928
  if (tree.length === 0) return /* @__PURE__ */ jsx("div", {
4100
2929
  ...themeAttrs(cssVarPrefix, activeTheme),
4101
- style: {
4102
- ...chromeAliases(cssVarPrefix),
4103
- ...styles$2.wrapper
4104
- },
4105
2930
  children: /* @__PURE__ */ jsx(EmptyState, { children: root ? `No tokens under "${root}".` : "No tokens in the active theme." })
4106
2931
  });
4107
2932
  return /* @__PURE__ */ jsxs("div", {
4108
2933
  ...themeAttrs(cssVarPrefix, activeTheme),
4109
- style: {
4110
- ...chromeAliases(cssVarPrefix),
4111
- ...styles$2.wrapper
4112
- },
4113
2934
  children: [
4114
2935
  /* @__PURE__ */ jsxs("div", {
4115
- style: styles$2.caption,
2936
+ className: "sb-token-navigator__caption",
4116
2937
  children: [
4117
2938
  root ? `Tokens under ${root}` : "Token graph",
4118
2939
  " · ",
@@ -4120,7 +2941,7 @@ function TokenNavigator({ root, initiallyExpanded = 1, onSelect }) {
4120
2941
  ]
4121
2942
  }),
4122
2943
  /* @__PURE__ */ jsx("ul", {
4123
- style: styles$2.tree,
2944
+ className: "sb-token-navigator__tree",
4124
2945
  role: "tree",
4125
2946
  children: tree.map((node) => /* @__PURE__ */ jsx(TreeNodeRow, {
4126
2947
  node,
@@ -4155,25 +2976,25 @@ function TreeNodeRow({ node, expanded, onToggle, onLeafClick }) {
4155
2976
  children: [/* @__PURE__ */ jsxs("div", {
4156
2977
  role: "button",
4157
2978
  tabIndex: 0,
4158
- style: styles$2.groupRow,
2979
+ className: "sb-token-navigator__group-row",
4159
2980
  onClick: () => onToggle(node.path),
4160
2981
  onKeyDown: onKey,
4161
2982
  "data-path": node.path,
4162
2983
  "data-testid": "token-navigator-group",
4163
2984
  children: [
4164
2985
  /* @__PURE__ */ jsx("span", {
4165
- style: styles$2.caret,
2986
+ className: "sb-token-navigator__caret",
4166
2987
  "aria-hidden": true,
4167
2988
  children: isOpen ? "▾" : "▸"
4168
2989
  }),
4169
2990
  /* @__PURE__ */ jsx("span", { children: node.segment }),
4170
2991
  /* @__PURE__ */ jsx("span", {
4171
- style: styles$2.count,
2992
+ className: "sb-token-navigator__count",
4172
2993
  children: countLeaves(node)
4173
2994
  })
4174
2995
  ]
4175
2996
  }), isOpen && /* @__PURE__ */ jsx("ul", {
4176
- style: styles$2.nested,
2997
+ className: "sb-token-navigator__nested",
4177
2998
  role: "group",
4178
2999
  children: node.children.map((c) => /* @__PURE__ */ jsx(TreeNodeRow, {
4179
3000
  node: c,
@@ -4197,23 +3018,23 @@ function LeafRow({ node, onLeafClick }) {
4197
3018
  children: /* @__PURE__ */ jsxs("div", {
4198
3019
  role: "button",
4199
3020
  tabIndex: 0,
4200
- style: styles$2.leafRow,
3021
+ className: "sb-token-navigator__leaf-row",
4201
3022
  onClick: () => onLeafClick(node.path),
4202
3023
  onKeyDown: onKey,
4203
3024
  "data-path": node.path,
4204
3025
  "data-testid": "token-navigator-leaf",
4205
3026
  children: [
4206
3027
  /* @__PURE__ */ jsx("span", {
4207
- style: styles$2.caret,
3028
+ className: "sb-token-navigator__caret",
4208
3029
  "aria-hidden": true,
4209
3030
  children: "•"
4210
3031
  }),
4211
3032
  /* @__PURE__ */ jsx("span", {
4212
- style: styles$2.tail,
3033
+ className: "sb-token-navigator__tail",
4213
3034
  children: node.segment
4214
3035
  }),
4215
3036
  type && /* @__PURE__ */ jsx("span", {
4216
- style: styles$2.typePill,
3037
+ className: "sb-token-navigator__type-pill",
4217
3038
  children: type
4218
3039
  }),
4219
3040
  /* @__PURE__ */ jsx(LeafPreview, {
@@ -4231,32 +3052,24 @@ function LeafPreview({ path, token }) {
4231
3052
  if (type === "color") {
4232
3053
  const cssVar = makeCssVar(path, cssVarPrefix);
4233
3054
  return /* @__PURE__ */ jsxs("span", {
4234
- style: styles$2.previewBox,
3055
+ className: "sb-token-navigator__preview-box",
4235
3056
  children: [/* @__PURE__ */ jsx("span", {
4236
- style: styles$2.value,
3057
+ className: "sb-token-navigator__value",
4237
3058
  children: formatTokenValue(token.$value, type, colorFormat)
4238
3059
  }), /* @__PURE__ */ jsx("span", {
4239
- style: {
4240
- ...styles$2.colorSwatch,
4241
- background: cssVar,
4242
- marginLeft: 8
4243
- },
3060
+ className: "sb-token-navigator__color-swatch",
3061
+ style: { background: cssVar },
4244
3062
  "aria-hidden": true
4245
3063
  })]
4246
3064
  });
4247
3065
  }
4248
3066
  if (type === "dimension") return /* @__PURE__ */ jsxs("span", {
4249
- style: styles$2.previewBox,
3067
+ className: "sb-token-navigator__preview-box",
4250
3068
  children: [/* @__PURE__ */ jsx("span", {
4251
- style: styles$2.value,
3069
+ className: "sb-token-navigator__value",
4252
3070
  children: formatTokenValue(token.$value, type, colorFormat)
4253
3071
  }), /* @__PURE__ */ jsx("span", {
4254
- style: {
4255
- marginLeft: 8,
4256
- display: "inline-block",
4257
- minWidth: 40,
4258
- maxWidth: 120
4259
- },
3072
+ className: "sb-token-navigator__preview-dimension",
4260
3073
  children: /* @__PURE__ */ jsx(DimensionBar, {
4261
3074
  path,
4262
3075
  kind: "length"
@@ -4264,120 +3077,36 @@ function LeafPreview({ path, token }) {
4264
3077
  })]
4265
3078
  });
4266
3079
  if (type === "shadow") return /* @__PURE__ */ jsx("span", {
4267
- style: styles$2.previewBox,
3080
+ className: "sb-token-navigator__preview-box",
4268
3081
  children: /* @__PURE__ */ jsx("span", {
4269
- style: {
4270
- marginLeft: 8,
4271
- display: "inline-block",
4272
- transform: "scale(0.5)",
4273
- transformOrigin: "right center"
4274
- },
3082
+ className: "sb-token-navigator__preview-scaled",
4275
3083
  children: /* @__PURE__ */ jsx(ShadowSample, { path })
4276
3084
  })
4277
3085
  });
4278
3086
  if (type === "border") return /* @__PURE__ */ jsx("span", {
4279
- style: styles$2.previewBox,
3087
+ className: "sb-token-navigator__preview-box",
4280
3088
  children: /* @__PURE__ */ jsx("span", {
4281
- style: {
4282
- marginLeft: 8,
4283
- display: "inline-block",
4284
- transform: "scale(0.5)",
4285
- transformOrigin: "right center"
4286
- },
3089
+ className: "sb-token-navigator__preview-scaled",
4287
3090
  children: /* @__PURE__ */ jsx(BorderSample, { path })
4288
3091
  })
4289
3092
  });
4290
3093
  if (type === "transition" || type === "duration" || type === "cubicBezier") return /* @__PURE__ */ jsx("span", {
4291
- style: styles$2.previewBox,
3094
+ className: "sb-token-navigator__preview-box",
4292
3095
  children: /* @__PURE__ */ jsx("span", {
4293
- style: {
4294
- marginLeft: 8,
4295
- display: "inline-block",
4296
- width: 80
4297
- },
3096
+ className: "sb-token-navigator__preview-motion",
4298
3097
  children: /* @__PURE__ */ jsx(MotionSample, { path })
4299
3098
  })
4300
3099
  });
4301
3100
  return /* @__PURE__ */ jsx("span", {
4302
- style: styles$2.previewBox,
3101
+ className: "sb-token-navigator__preview-box",
4303
3102
  children: /* @__PURE__ */ jsx("span", {
4304
- style: styles$2.value,
3103
+ className: "sb-token-navigator__value",
4305
3104
  children: formatTokenValue(token.$value, type, colorFormat)
4306
3105
  })
4307
3106
  });
4308
3107
  }
4309
3108
  //#endregion
4310
3109
  //#region src/TokenTable.tsx
4311
- const styles$1 = {
4312
- wrapper: surfaceStyle,
4313
- empty: emptyStyle,
4314
- caption: {
4315
- captionSide: "top",
4316
- textAlign: "left",
4317
- padding: "8px 0",
4318
- color: TEXT_MUTED,
4319
- fontSize: 12
4320
- },
4321
- table: {
4322
- width: "100%",
4323
- borderCollapse: "collapse"
4324
- },
4325
- th: {
4326
- textAlign: "left",
4327
- padding: "8px 12px",
4328
- fontSize: 11,
4329
- textTransform: "uppercase",
4330
- letterSpacing: .5,
4331
- color: TEXT_MUTED,
4332
- borderBottom: BORDER_STRONG
4333
- },
4334
- thPath: { minWidth: 180 },
4335
- thValue: { minWidth: 160 },
4336
- row: { cursor: "pointer" },
4337
- td: {
4338
- padding: "8px 12px",
4339
- borderBottom: BORDER_FAINT,
4340
- verticalAlign: "top"
4341
- },
4342
- path: {
4343
- fontFamily: MONO_STACK,
4344
- fontSize: 12
4345
- },
4346
- valueCell: {
4347
- display: "flex",
4348
- alignItems: "center",
4349
- gap: 8,
4350
- minWidth: 0,
4351
- fontFamily: MONO_STACK,
4352
- fontSize: 12
4353
- },
4354
- typePill: {
4355
- display: "inline-block",
4356
- padding: "1px 6px",
4357
- borderRadius: 4,
4358
- fontSize: 10,
4359
- letterSpacing: .5,
4360
- textTransform: "uppercase",
4361
- background: SURFACE_MUTED,
4362
- color: TEXT_MUTED,
4363
- fontFamily: MONO_STACK,
4364
- flexShrink: 0
4365
- },
4366
- swatch: {
4367
- display: "inline-block",
4368
- width: 16,
4369
- height: 16,
4370
- borderRadius: 3,
4371
- border: BORDER_STRONG,
4372
- flexShrink: 0
4373
- },
4374
- valueText: {
4375
- minWidth: 0,
4376
- overflow: "hidden",
4377
- textOverflow: "ellipsis",
4378
- whiteSpace: "nowrap"
4379
- }
4380
- };
4381
3110
  function TokenTable({ filter, type, caption, sortBy = "path", sortDir = "asc", onSelect }) {
4382
3111
  const { resolved, activeTheme, cssVarPrefix } = useProject();
4383
3112
  const colorFormat = useColorFormat();
@@ -4418,43 +3147,29 @@ function TokenTable({ filter, type, caption, sortBy = "path", sortDir = "asc", o
4418
3147
  const captionText = caption ?? `${rows.length} token${rows.length === 1 ? "" : "s"}${filter ? ` matching \`${filter}\`` : ""}${type ? ` · $type=${type}` : ""} · ${activeTheme}`;
4419
3148
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
4420
3149
  ...themeAttrs(cssVarPrefix, activeTheme),
4421
- style: {
4422
- ...chromeAliases(cssVarPrefix),
4423
- ...styles$1.wrapper
4424
- },
4425
3150
  children: /* @__PURE__ */ jsx("div", {
4426
- style: styles$1.empty,
3151
+ className: "sb-block__empty",
4427
3152
  children: "No tokens match this filter."
4428
3153
  })
4429
3154
  });
4430
3155
  return /* @__PURE__ */ jsxs("div", {
4431
3156
  ...themeAttrs(cssVarPrefix, activeTheme),
4432
- style: {
4433
- ...chromeAliases(cssVarPrefix),
4434
- ...styles$1.wrapper
4435
- },
4436
3157
  children: [/* @__PURE__ */ jsxs("table", {
4437
- style: styles$1.table,
3158
+ className: "sb-token-table__table",
4438
3159
  children: [
4439
3160
  /* @__PURE__ */ jsx("caption", {
4440
- style: styles$1.caption,
3161
+ className: "sb-token-table__caption",
4441
3162
  children: captionText
4442
3163
  }),
4443
3164
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
4444
- style: {
4445
- ...styles$1.th,
4446
- ...styles$1.thPath
4447
- },
3165
+ className: cx("sb-token-table__th", "sb-token-table__th--path"),
4448
3166
  children: "Path"
4449
3167
  }), /* @__PURE__ */ jsx("th", {
4450
- style: {
4451
- ...styles$1.th,
4452
- ...styles$1.thValue
4453
- },
3168
+ className: cx("sb-token-table__th", "sb-token-table__th--value"),
4454
3169
  children: "Value"
4455
3170
  })] }) }),
4456
3171
  /* @__PURE__ */ jsx("tbody", { children: rows.map((row) => /* @__PURE__ */ jsxs("tr", {
4457
- style: styles$1.row,
3172
+ className: "sb-token-table__row",
4458
3173
  onClick: () => handleRowClick(row.path),
4459
3174
  onKeyDown: (e) => {
4460
3175
  if (e.key === "Enter" || e.key === " ") {
@@ -4467,29 +3182,24 @@ function TokenTable({ filter, type, caption, sortBy = "path", sortDir = "asc", o
4467
3182
  "data-testid": "token-table-row",
4468
3183
  "data-path": row.path,
4469
3184
  children: [/* @__PURE__ */ jsx("td", {
4470
- style: {
4471
- ...styles$1.td,
4472
- ...styles$1.path
4473
- },
3185
+ className: cx("sb-token-table__td", "sb-token-table__path"),
4474
3186
  children: row.path
4475
3187
  }), /* @__PURE__ */ jsx("td", {
4476
- style: styles$1.td,
3188
+ className: "sb-token-table__td",
4477
3189
  children: /* @__PURE__ */ jsxs("span", {
4478
- style: styles$1.valueCell,
3190
+ className: "sb-token-table__value-cell",
4479
3191
  children: [
4480
3192
  row.type && /* @__PURE__ */ jsx("span", {
4481
- style: styles$1.typePill,
3193
+ className: "sb-token-table__type-pill",
4482
3194
  children: row.type
4483
3195
  }),
4484
3196
  row.isColor && /* @__PURE__ */ jsx("span", {
4485
- style: {
4486
- ...styles$1.swatch,
4487
- background: row.cssVar
4488
- },
3197
+ className: "sb-token-table__swatch",
3198
+ style: { background: row.cssVar },
4489
3199
  "aria-hidden": true
4490
3200
  }),
4491
3201
  /* @__PURE__ */ jsx("span", {
4492
- style: styles$1.valueText,
3202
+ className: "sb-token-table__value-text",
4493
3203
  title: row.value,
4494
3204
  "data-testid": "token-table-value",
4495
3205
  children: row.value
@@ -4497,7 +3207,7 @@ function TokenTable({ filter, type, caption, sortBy = "path", sortDir = "asc", o
4497
3207
  row.outOfGamut && /* @__PURE__ */ jsx("span", {
4498
3208
  title: "Out of sRGB gamut for this format",
4499
3209
  "aria-label": "out of gamut",
4500
- style: { flexShrink: 0 },
3210
+ className: "sb-token-table__gamut-warn",
4501
3211
  children: "⚠"
4502
3212
  })
4503
3213
  ]
@@ -4514,33 +3224,6 @@ function TokenTable({ filter, type, caption, sortBy = "path", sortDir = "asc", o
4514
3224
  }
4515
3225
  //#endregion
4516
3226
  //#region src/TypographyScale.tsx
4517
- const styles = {
4518
- wrapper: surfaceStyle,
4519
- caption: captionStyle,
4520
- empty: emptyStyle,
4521
- row: {
4522
- display: "grid",
4523
- gridTemplateColumns: "minmax(160px, 220px) 1fr",
4524
- gap: 16,
4525
- alignItems: "baseline",
4526
- padding: "14px 0",
4527
- borderBottom: BORDER_DEFAULT
4528
- },
4529
- meta: {
4530
- display: "flex",
4531
- flexDirection: "column",
4532
- gap: 2
4533
- },
4534
- path: {
4535
- fontFamily: MONO_STACK,
4536
- fontSize: 12
4537
- },
4538
- specs: {
4539
- fontFamily: MONO_STACK,
4540
- fontSize: 11,
4541
- opacity: .7
4542
- }
4543
- };
4544
3227
  function asDimension(raw) {
4545
3228
  if (raw == null) return void 0;
4546
3229
  if (typeof raw === "string" || typeof raw === "number") return String(raw);
@@ -4602,33 +3285,25 @@ function TypographyScale({ filter, sample = "The quick brown fox jumps over the
4602
3285
  const captionText = caption ?? `${rows.length} typography token${rows.length === 1 ? "" : "s"}${filter && filter !== "typography" ? ` matching \`${filter}\`` : ""} · ${activeTheme}`;
4603
3286
  if (rows.length === 0) return /* @__PURE__ */ jsx("div", {
4604
3287
  ...themeAttrs(cssVarPrefix, activeTheme),
4605
- style: {
4606
- ...chromeAliases(cssVarPrefix),
4607
- ...styles.wrapper
4608
- },
4609
3288
  children: /* @__PURE__ */ jsx("div", {
4610
- style: styles.empty,
3289
+ className: "sb-block__empty",
4611
3290
  children: "No typography tokens match this filter."
4612
3291
  })
4613
3292
  });
4614
3293
  return /* @__PURE__ */ jsxs("div", {
4615
3294
  ...themeAttrs(cssVarPrefix, activeTheme),
4616
- style: {
4617
- ...chromeAliases(cssVarPrefix),
4618
- ...styles.wrapper
4619
- },
4620
3295
  children: [/* @__PURE__ */ jsx("div", {
4621
- style: styles.caption,
3296
+ className: "sb-block__caption",
4622
3297
  children: captionText
4623
3298
  }), rows.map((row) => /* @__PURE__ */ jsxs("div", {
4624
- style: styles.row,
3299
+ className: "sb-typography-scale__row",
4625
3300
  children: [/* @__PURE__ */ jsxs("div", {
4626
- style: styles.meta,
3301
+ className: "sb-typography-scale__meta",
4627
3302
  children: [/* @__PURE__ */ jsx("span", {
4628
- style: styles.path,
3303
+ className: "sb-typography-scale__path",
4629
3304
  children: row.path
4630
3305
  }), row.specs && /* @__PURE__ */ jsx("span", {
4631
- style: styles.specs,
3306
+ className: "sb-typography-scale__specs",
4632
3307
  children: row.specs
4633
3308
  })]
4634
3309
  }), /* @__PURE__ */ jsx("div", {