@behavioral-agentic-design-system/core 0.47.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/package.json +1 -1
  2. package/scripts/build-tokens.cjs +24 -3
  3. package/scripts/ux-smoke.mjs +5 -1
  4. package/src/api/save-tokens.ts +170 -24
  5. package/src/app/layout.tsx +12 -1
  6. package/src/app/preview/components/page.tsx +114 -18
  7. package/src/app/preview/global-font-client.tsx +2 -0
  8. package/src/app/providers.tsx +2 -0
  9. package/src/app/shell.tsx +50 -156
  10. package/src/components/customize/brand-mark-section.tsx +65 -95
  11. package/src/components/customize/font-pickers.tsx +25 -2
  12. package/src/components/customize/save-bar.tsx +120 -7
  13. package/src/components/customize/theme-io.tsx +62 -21
  14. package/src/components/customize-tab.tsx +3 -1
  15. package/src/components/home-recent.tsx +58 -25
  16. package/src/components/motion/reveal.tsx +168 -12
  17. package/src/components/studio/control-panel.tsx +98 -19
  18. package/src/components/studio/import-theme-dialog.tsx +167 -0
  19. package/src/components/studio/tokens-panel.tsx +215 -0
  20. package/src/components/studio/types.ts +5 -2
  21. package/src/components/studio/use-studio-tweaks.ts +36 -4
  22. package/src/components/studio/use-token-edits.ts +160 -0
  23. package/src/components/ui/number-field.tsx +390 -0
  24. package/src/components/ui/toggle-tip.tsx +38 -29
  25. package/src/data/component-added.json +4 -0
  26. package/src/data/component-stories.json +1214 -0
  27. package/src/data/docs-index.ts +7 -2
  28. package/src/data/hidden-views.ts +22 -0
  29. package/src/data/history.json +51 -51
  30. package/src/data/sticker-sheet.json +1918 -1808
  31. package/src/fonts/Figtree-OFL.txt +93 -0
  32. package/src/fonts/figtree-latin-ext-wght-normal.woff2 +0 -0
  33. package/src/fonts/figtree-latin-wght-italic.woff2 +0 -0
  34. package/src/fonts/figtree-latin-wght-normal.woff2 +0 -0
  35. package/src/fonts-cdn.css +3 -1
  36. package/src/fonts.css +44 -0
  37. package/src/hooks/use-global-heading-font.ts +104 -0
  38. package/src/hooks/use-global-sans-font.ts +8 -3
  39. package/src/hooks/use-global-theme.ts +2 -2
  40. package/src/hooks/use-token-overrides.ts +62 -14
  41. package/src/lib/css-color.ts +42 -0
  42. package/src/lib/storybook-url.ts +28 -0
  43. package/src/lib/theme-editor.ts +7 -1
  44. package/src/lib/theme-import.ts +99 -0
  45. package/src/lib/theme-transition.ts +93 -0
  46. package/src/lib/token-list.ts +133 -0
  47. package/src/lib/token-value.ts +31 -0
  48. package/src/stories/Accordion.stories.tsx +1 -1
  49. package/src/stories/Affix.stories.tsx +1 -1
  50. package/src/stories/AiBadge.stories.tsx +1 -1
  51. package/src/stories/Alert.stories.tsx +1 -1
  52. package/src/stories/AlertDialog.stories.tsx +1 -1
  53. package/src/stories/AngleSlider.stories.tsx +1 -1
  54. package/src/stories/AnnouncementBar.stories.tsx +2 -2
  55. package/src/stories/AspectRatio.stories.tsx +1 -1
  56. package/src/stories/Attachment.stories.tsx +1 -1
  57. package/src/stories/Autocomplete.stories.tsx +1 -1
  58. package/src/stories/Avatar.stories.tsx +1 -1
  59. package/src/stories/Badge.stories.tsx +1 -1
  60. package/src/stories/Blockquote.stories.tsx +1 -1
  61. package/src/stories/Burger.stories.tsx +1 -1
  62. package/src/stories/Button.stories.tsx +1 -1
  63. package/src/stories/ButtonGroup.stories.tsx +1 -1
  64. package/src/stories/Calendar.stories.tsx +1 -1
  65. package/src/stories/Callout.stories.tsx +1 -1
  66. package/src/stories/Canvas.stories.tsx +1 -1
  67. package/src/stories/Card.stories.tsx +1 -1
  68. package/src/stories/Carousel.stories.tsx +1 -1
  69. package/src/stories/Cascader.stories.tsx +1 -1
  70. package/src/stories/Chart.stories.tsx +1 -1
  71. package/src/stories/ChatBubble.stories.tsx +1 -1
  72. package/src/stories/ChatMarker.stories.tsx +1 -1
  73. package/src/stories/Checkbox.stories.tsx +1 -1
  74. package/src/stories/CheckboxCard.stories.tsx +1 -1
  75. package/src/stories/CheckboxGroup.stories.tsx +2 -1
  76. package/src/stories/Chip.stories.tsx +1 -1
  77. package/src/stories/CircularProgress.stories.tsx +1 -1
  78. package/src/stories/Clipboard.stories.tsx +1 -1
  79. package/src/stories/CloseButton.stories.tsx +1 -1
  80. package/src/stories/Code.stories.tsx +1 -1
  81. package/src/stories/Collapsible.stories.tsx +1 -1
  82. package/src/stories/ColorPicker.stories.tsx +1 -1
  83. package/src/stories/ColorSwatch.stories.tsx +1 -1
  84. package/src/stories/Combobox.stories.tsx +1 -1
  85. package/src/stories/Container.stories.tsx +1 -1
  86. package/src/stories/ContextMenu.stories.tsx +1 -1
  87. package/src/stories/CopyButton.stories.tsx +1 -1
  88. package/src/stories/DataList.stories.tsx +1 -1
  89. package/src/stories/DataTable.stories.tsx +1 -1
  90. package/src/stories/DateField.stories.tsx +1 -1
  91. package/src/stories/DatePicker.stories.tsx +1 -1
  92. package/src/stories/DateRangePicker.stories.tsx +1 -1
  93. package/src/stories/Dialog.stories.tsx +1 -1
  94. package/src/stories/Drawer.stories.tsx +1 -1
  95. package/src/stories/DropdownMenu.stories.tsx +1 -1
  96. package/src/stories/Editable.stories.tsx +1 -1
  97. package/src/stories/EmptyState.stories.tsx +1 -1
  98. package/src/stories/FacetedFilter.stories.tsx +1 -1
  99. package/src/stories/Field.stories.tsx +1 -1
  100. package/src/stories/Fieldset.stories.tsx +1 -1
  101. package/src/stories/FileButton.stories.tsx +1 -1
  102. package/src/stories/FileUpload.stories.tsx +1 -1
  103. package/src/stories/FloatLabel.stories.tsx +1 -1
  104. package/src/stories/FloatingActionButton.stories.tsx +1 -1
  105. package/src/stories/FloatingIndicator.stories.tsx +1 -1
  106. package/src/stories/FloatingPanel.stories.tsx +1 -1
  107. package/src/stories/FocusTrap.stories.tsx +1 -1
  108. package/src/stories/FormatByte.stories.tsx +1 -1
  109. package/src/stories/FormatDate.stories.tsx +1 -1
  110. package/src/stories/FormatNumber.stories.tsx +1 -1
  111. package/src/stories/FormatRelativeTime.stories.tsx +1 -1
  112. package/src/stories/GaugeChart.stories.tsx +1 -1
  113. package/src/stories/Grid.stories.tsx +1 -1
  114. package/src/stories/Heatmap.stories.tsx +1 -1
  115. package/src/stories/Highlight.stories.tsx +1 -1
  116. package/src/stories/HoverCard.stories.tsx +1 -1
  117. package/src/stories/Icon.stories.tsx +1 -1
  118. package/src/stories/Image.stories.tsx +1 -1
  119. package/src/stories/Indicator.stories.tsx +1 -1
  120. package/src/stories/InfiniteScroll.stories.tsx +1 -1
  121. package/src/stories/InlineEdit.stories.tsx +1 -1
  122. package/src/stories/Input.stories.tsx +1 -1
  123. package/src/stories/InputClearButton.stories.tsx +1 -1
  124. package/src/stories/InputGroup.stories.tsx +1 -1
  125. package/src/stories/JsonInput.stories.tsx +1 -1
  126. package/src/stories/Kbd.stories.tsx +1 -1
  127. package/src/stories/KeyboardShortcut.stories.tsx +1 -1
  128. package/src/stories/Label.stories.tsx +1 -1
  129. package/src/stories/List.stories.tsx +1 -1
  130. package/src/stories/Listbox.stories.tsx +1 -1
  131. package/src/stories/LoadingDots.stories.tsx +1 -1
  132. package/src/stories/LoadingOverlay.stories.tsx +1 -1
  133. package/src/stories/Mark.stories.tsx +1 -1
  134. package/src/stories/MarkdownPreview.stories.tsx +1 -1
  135. package/src/stories/Marquee.stories.tsx +1 -1
  136. package/src/stories/Masonry.stories.tsx +1 -1
  137. package/src/stories/Meter.stories.tsx +1 -1
  138. package/src/stories/MonthPicker.stories.tsx +1 -1
  139. package/src/stories/MotionToggle.stories.tsx +1 -1
  140. package/src/stories/MultiSelect.stories.tsx +1 -1
  141. package/src/stories/NativeSelect.stories.tsx +1 -1
  142. package/src/stories/NavigationProgress.stories.tsx +1 -1
  143. package/src/stories/Notification.stories.tsx +1 -1
  144. package/src/stories/NumberField.stories.tsx +214 -0
  145. package/src/stories/NumberInput.stories.tsx +1 -1
  146. package/src/stories/OtpInput.stories.tsx +1 -1
  147. package/src/stories/Overlay.stories.tsx +1 -1
  148. package/src/stories/PageHeader.stories.tsx +1 -1
  149. package/src/stories/PasswordInput.stories.tsx +1 -1
  150. package/src/stories/PasswordStrengthInput.stories.tsx +1 -1
  151. package/src/stories/PhoneInput.stories.tsx +1 -1
  152. package/src/stories/Pill.stories.tsx +1 -1
  153. package/src/stories/PinInput.stories.tsx +1 -1
  154. package/src/stories/Popover.stories.tsx +1 -1
  155. package/src/stories/Portal.stories.tsx +1 -1
  156. package/src/stories/Presence.stories.tsx +1 -1
  157. package/src/stories/Progress.stories.tsx +1 -1
  158. package/src/stories/ProgressStack.stories.tsx +1 -1
  159. package/src/stories/Prose.stories.tsx +1 -1
  160. package/src/stories/QrCode.stories.tsx +1 -1
  161. package/src/stories/Questionnaire.stories.tsx +1 -1
  162. package/src/stories/RadioGroup.stories.tsx +1 -1
  163. package/src/stories/RatingGroup.stories.tsx +1 -1
  164. package/src/stories/Resizable.stories.tsx +1 -1
  165. package/src/stories/Result.stories.tsx +1 -1
  166. package/src/stories/Reveal.stories.tsx +1 -1
  167. package/src/stories/RollingNumber.stories.tsx +1 -1
  168. package/src/stories/ScrollArea.stories.tsx +1 -1
  169. package/src/stories/ScrollProgress.stories.tsx +1 -1
  170. package/src/stories/SearchInput.stories.tsx +1 -1
  171. package/src/stories/SegmentedControl.stories.tsx +1 -1
  172. package/src/stories/Select.stories.tsx +1 -1
  173. package/src/stories/Separator.stories.tsx +1 -1
  174. package/src/stories/Sheet.stories.tsx +1 -1
  175. package/src/stories/SignaturePad.stories.tsx +1 -1
  176. package/src/stories/SimpleGrid.stories.tsx +1 -1
  177. package/src/stories/Skeleton.stories.tsx +1 -1
  178. package/src/stories/SkeletonTable.stories.tsx +1 -1
  179. package/src/stories/Slider.stories.tsx +1 -1
  180. package/src/stories/Snackbar.stories.tsx +1 -1
  181. package/src/stories/Sonner.stories.tsx +1 -1
  182. package/src/stories/SortableList.stories.tsx +1 -1
  183. package/src/stories/Sparkline.stories.tsx +1 -1
  184. package/src/stories/Spinner.stories.tsx +1 -1
  185. package/src/stories/Spoiler.stories.tsx +1 -1
  186. package/src/stories/Squircle.stories.tsx +1 -1
  187. package/src/stories/Stack.stories.tsx +1 -1
  188. package/src/stories/StatusBadge.stories.tsx +1 -1
  189. package/src/stories/Switch.stories.tsx +1 -1
  190. package/src/stories/Table.stories.tsx +1 -1
  191. package/src/stories/Tag.stories.tsx +1 -1
  192. package/src/stories/TagsInput.stories.tsx +1 -1
  193. package/src/stories/Text.stories.tsx +1 -1
  194. package/src/stories/Textarea.stories.tsx +1 -1
  195. package/src/stories/ThemeIcon.stories.tsx +1 -1
  196. package/src/stories/TimePicker.stories.tsx +1 -1
  197. package/src/stories/Timeline.stories.tsx +1 -1
  198. package/src/stories/Timer.stories.tsx +1 -1
  199. package/src/stories/Toggle.stories.tsx +1 -1
  200. package/src/stories/ToggleGroup.stories.tsx +1 -1
  201. package/src/stories/ToggleTip.stories.tsx +106 -1
  202. package/src/stories/Tooltip.stories.tsx +56 -1
  203. package/src/stories/TransferList.stories.tsx +1 -1
  204. package/src/stories/TreeSelect.stories.tsx +1 -1
  205. package/src/stories/TypingIndicator.stories.tsx +1 -1
  206. package/src/stories/VisuallyHidden.stories.tsx +1 -1
  207. package/src/stories/Watermark.stories.tsx +1 -1
  208. package/src/stories/WeekPicker.stories.tsx +1 -1
  209. package/src/stories/WordRotate.stories.tsx +1 -1
  210. package/src/stories/YearPicker.stories.tsx +1 -1
  211. package/src/stories/story-groups.json +216 -223
  212. package/src/styles.css +20 -3
  213. package/src/tokens.default.json +6 -1
  214. package/src/tokens.json +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behavioral-agentic-design-system/core",
3
- "version": "0.47.0",
3
+ "version": "0.49.0",
4
4
  "description": "BADS core — tokens, shadcn/ui components, and the BADS template shell (app routes, customize tab, theme hooks). Forks consume this and re-export, keeping client repos to ~30 lines of glue.",
5
5
  "license": "MIT",
6
6
  "author": "Matthew Stephens <work@matthewstephens.com> (https://github.com/matthewlarn)",
@@ -120,6 +120,7 @@ const darkVars = emitVars(tokens.theme.dark);
120
120
  const fontSans = tokens.fontFamily.sans.$value;
121
121
  const fontMono = tokens.fontFamily.mono.$value;
122
122
  const fontSerif = tokens.fontFamily.serif.$value;
123
+ const fontHeading = tokens.fontFamily.heading?.$value ?? fontSans;
123
124
 
124
125
  // One font stack from several pieces, each family once, in the order it first
125
126
  // appears. The token value is joined to a fixed fallback tail below, so a fork
@@ -727,6 +728,13 @@ const baseLayer = `@layer base {
727
728
  h1, h2, h3, h4, h5, h6 {
728
729
  text-wrap: balance;
729
730
  }
731
+ /* Headings read --font-heading (Figtree by default), independent of the
732
+ body font. Components that set a font utility on a heading still win:
733
+ this is base layer. The Studio and Customize tab change --font-heading
734
+ live; a fork changes it in tokens.json fontFamily.heading. */
735
+ h1, h2, h3, h4, h5, h6 {
736
+ font-family: var(--font-heading, var(--font-sans));
737
+ }
730
738
  /* text-wrap: pretty prevents orphaned last words on paragraphs by
731
739
  considering the last four lines when breaking. Supported Chrome 117+,
732
740
  Firefox 130+ (Baseline 2025). Falls back to normal wrap — no adverse
@@ -812,6 +820,15 @@ html, body {
812
820
  ::view-transition {
813
821
  background-color: var(--background);
814
822
  }
823
+ /* While a theme switch runs (lib/theme-transition.ts sets the attribute on <html>, and on same-origin iframe
824
+ documents), nothing may fade its own colours. The new-theme snapshot is taken a frame after the class flips,
825
+ and a transition-colors element is still mid-fade then, so the reveal showed some parts new and some old.
826
+ Pseudo-elements of the view transition itself are not matched by *, so the iris still animates. */
827
+ html[data-theme-switching] *,
828
+ html[data-theme-switching] *::before,
829
+ html[data-theme-switching] *::after {
830
+ transition: none !important;
831
+ }
815
832
  @keyframes theme-old-out {
816
833
  0%, 92% { opacity: 1; }
817
834
  98%, 100% { opacity: 0; }
@@ -1218,12 +1235,12 @@ html, body {
1218
1235
  }
1219
1236
 
1220
1237
  ::view-transition-new(root) {
1221
- animation: theme-reveal 0.4s ease-in-out forwards;
1238
+ animation: theme-reveal 0.4s ${easeInOut} forwards;
1222
1239
  }
1223
1240
  /* Same duration/easing as theme-reveal so the 92%/98% offsets line up with
1224
1241
  the reveal's coverage math. */
1225
1242
  ::view-transition-old(root) {
1226
- animation: theme-old-out 0.4s ease-in-out forwards;
1243
+ animation: theme-old-out 0.4s ${easeInOut} forwards;
1227
1244
  }
1228
1245
 
1229
1246
  /* Honor the app-level MotionToggle for the iris wipe too (same three-state
@@ -1391,6 +1408,7 @@ const pkgCss = `${banner}
1391
1408
  Google Fonts @import above) is the canonical fallback so unbranded
1392
1409
  consumers still get a high-legibility face out of the box. */
1393
1410
  --font-sans: ${fontStack(fontSans, "'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui")};
1411
+ --font-heading: ${fontStack(fontHeading, "'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui")};
1394
1412
  --font-mono: ${fontStack(fontMono)};
1395
1413
  --font-serif: ${fontStack(fontSerif)};
1396
1414
  --font-variation-settings: ${fontVariationSettings};
@@ -1449,12 +1467,14 @@ const pkgFontsCdnCss = `${banner}
1449
1467
  * the local @font-face rules in fonts.css win over it either way.
1450
1468
  *
1451
1469
  * Inter Variable leads as the default sans; Atkinson Hyperlegible stays as
1452
- * the accessibility-preserving secondary.
1470
+ * the accessibility-preserving secondary. Figtree is the heading face
1471
+ * (--font-heading), so this path keeps headings off the system UI font.
1453
1472
  *
1454
1473
  * This file must contain NO rules of its own — a single rule here would make
1455
1474
  * the @import statements below invalid for anyone importing it. */
1456
1475
  @import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
1457
1476
  @import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');
1477
+ @import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');
1458
1478
  `;
1459
1479
 
1460
1480
  fs.writeFileSync(PKG_FONTS_CDN_CSS, pkgFontsCdnCss);
@@ -1537,6 +1557,7 @@ const appCss = `${banner}
1537
1557
  custom-property value at computed-value time, leaving --font-sans
1538
1558
  empty and text falling through to browser default ("Times"). */
1539
1559
  --font-sans: ${fontStack(fontSans, "var(--font-inter, 'Inter'), var(--font-atkinson, 'Atkinson Hyperlegible'), 'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui")};
1560
+ --font-heading: ${fontStack(fontHeading, "var(--font-inter, 'Inter'), var(--font-atkinson, 'Atkinson Hyperlegible'), 'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui")};
1540
1561
  --font-serif: ${fontStack(fontSerif, "var(--font-source-serif, 'Source Serif 4'), 'Source Serif 4', Georgia, ui-serif, serif")};
1541
1562
  --font-mono: ${fontStack(fontMono, "var(--font-jetbrains, 'JetBrains Mono'), 'JetBrains Mono', ui-monospace, monospace")};
1542
1563
  --font-variation-settings: ${fontVariationSettings};
@@ -79,7 +79,11 @@ mkdirSync(SCREENS_DIR, { recursive: true });
79
79
  function chromiumExecutable() {
80
80
  if (process.env.PW_CHROMIUM && existsSync(process.env.PW_CHROMIUM)) return process.env.PW_CHROMIUM;
81
81
  for (const c of [
82
+ "/opt/pw-browsers/chromium_headless_shell-1243/chrome-headless-shell-linux64/chrome-headless-shell.real",
83
+ "/opt/pw-browsers/chromium_headless_shell-1243/chrome-headless-shell-linux64/chrome-headless-shell",
84
+ "/opt/pw-browsers/chromium-1243/chrome-linux64/chrome",
82
85
  "/opt/pw-browsers/chromium-1194/chrome-linux/chrome",
86
+ "/opt/pw-browsers/chromium/chrome-linux64/chrome",
83
87
  "/opt/pw-browsers/chromium/chrome-linux/chrome",
84
88
  ]) if (existsSync(c)) return c;
85
89
  return undefined;
@@ -102,7 +106,7 @@ const exe = chromiumExecutable();
102
106
  const browser = await chromium.launch(exe ? { executablePath: exe } : {});
103
107
 
104
108
  async function openPage(theme, opts = {}) {
105
- const ctx = await browser.newContext({ viewport: { width: 1280, height: 1400 }, deviceScaleFactor: 2, ...opts });
109
+ const ctx = await browser.newContext({ viewport: { width: 1280, height: 1400 }, deviceScaleFactor: 2, reducedMotion: "reduce", ...opts });
106
110
  const page = await ctx.newPage();
107
111
  // Track subresources that never arrived. A missing image does not throw; it
108
112
  // degrades into whatever is painted underneath, and no contrast gate can
@@ -33,10 +33,13 @@ type SavePayload = {
33
33
  } | null;
34
34
  fonts?: {
35
35
  sans?: string;
36
+ heading?: string;
36
37
  serif?: string;
37
38
  mono?: string;
38
39
  } | null;
39
40
  fontSizes?: Record<string, number> | null;
41
+ /** Token-list edits keyed by tokens.json path, e.g. "theme.dark.background" or "color.primitive.blue.600". */
42
+ tokenValues?: Record<string, string> | null;
40
43
  radius?: number | null;
41
44
  reset?: boolean;
42
45
  };
@@ -62,25 +65,121 @@ function isValidHex(hex: string) {
62
65
  return /^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(hex.trim());
63
66
  }
64
67
 
68
+ const UNSAFE_SEGMENTS = new Set(["__proto__", "constructor", "prototype"]);
69
+
65
70
  function setLeaf(
66
71
  node: Record<string, unknown>,
67
72
  dotPath: string,
68
73
  mutator: (leaf: Record<string, unknown>) => void,
69
- ) {
74
+ ): boolean {
70
75
  const parts = dotPath.split(".");
76
+ // A path segment that names an Object.prototype slot would reach the shared prototype, not a token.
77
+ if (parts.some((p) => UNSAFE_SEGMENTS.has(p))) return false;
71
78
  let current: Record<string, unknown> = node;
72
79
  for (let i = 0; i < parts.length; i++) {
73
80
  const key = parts[i];
81
+ if (!Object.prototype.hasOwnProperty.call(current, key)) return false;
74
82
  const next = current[key];
75
83
  if (i === parts.length - 1) {
76
- if (next && typeof next === "object") {
84
+ // Only a token leaf (an object that already has its own $value) is written. A group such as color.primitive.blue
85
+ // is not: giving it a $value would make the whole scale read as one token.
86
+ if (next && typeof next === "object" && Object.prototype.hasOwnProperty.call(next, "$value")) {
77
87
  mutator(next as Record<string, unknown>);
88
+ return true;
78
89
  }
79
- return;
90
+ return false;
80
91
  }
81
- if (!next || typeof next !== "object") return;
92
+ if (!next || typeof next !== "object") return false;
82
93
  current = next as Record<string, unknown>;
83
94
  }
95
+ return false;
96
+ }
97
+
98
+ /**
99
+ * A token value ends up in tokens.json and then in the published styles.css, so one that could close a declaration
100
+ * or a rule is refused. Same text rules as lib/token-value.ts on the client (this copy is inlined because the
101
+ * route cannot import it, and the three regexes below are held identical to the client's by
102
+ * scripts/token-value-safety.test.mjs): a {color.primitive.<family>.<step>} alias, or plain text with none of
103
+ * ; { } < > @ \ or a control, format or line separator character, no url( / image-set( / src( / element( /
104
+ * cross-fade( / expression( / @import / comment markers / !important, at most 200 characters. A raw
105
+ * var(--primitive-x) is not accepted: styles.css does not declare those variables, so the alias has to be the
106
+ * {color.primitive.x.y} form that build-tokens resolves.
107
+ */
108
+ const SAFE_TEXT = /^[^;{}<>@\\\p{Cc}\p{Cf}\u2028\u2029]+$/u;
109
+ const BANNED = /(url|expression)\s*\(|\b(image-set|src|element|cross-fade)\s*\(|var\(\s*--primitive-|@import|\/\*|\*\/|!\s*important/i;
110
+ const ALIAS_FORM = /^\{color\.primitive\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\}$/;
111
+
112
+ function isSafeTokenValue(value: unknown): value is string {
113
+ if (typeof value !== "string") return false;
114
+ const v = value.trim();
115
+ if (!v || v.length > 200) return false;
116
+ if (ALIAS_FORM.test(v)) return true;
117
+ return SAFE_TEXT.test(v) && !BANNED.test(v);
118
+ }
119
+
120
+ /** A {color.primitive.x.y} alias has to point at a color leaf that exists in the parsed tokens tree (own keys only). */
121
+ function aliasResolves(tokens: Record<string, unknown>, alias: string): boolean {
122
+ if (!ALIAS_FORM.test(alias)) return false;
123
+ const parts = alias.slice(1, -1).split(".");
124
+ if (parts.some((p) => UNSAFE_SEGMENTS.has(p))) return false;
125
+ let current: unknown = tokens;
126
+ for (const part of parts) {
127
+ if (!current || typeof current !== "object" || !Object.prototype.hasOwnProperty.call(current, part)) return false;
128
+ current = (current as Record<string, unknown>)[part];
129
+ }
130
+ const leaf = current as Record<string, unknown> | null;
131
+ return !!leaf && typeof leaf === "object" && Object.prototype.hasOwnProperty.call(leaf, "$value") && leaf.$type === "color";
132
+ }
133
+
134
+ /** Safe text, and if it is an alias, an alias that resolves. */
135
+ function acceptValue(tokens: Record<string, unknown>, value: unknown): value is string {
136
+ if (!isSafeTokenValue(value)) return false;
137
+ const v = value.trim();
138
+ return !ALIAS_FORM.test(v) || aliasResolves(tokens, v);
139
+ }
140
+
141
+ /** Plain text only (font stacks): safe, and not an alias. */
142
+ function acceptText(value: unknown): value is string {
143
+ return isSafeTokenValue(value) && !ALIAS_FORM.test(value.trim());
144
+ }
145
+
146
+ /**
147
+ * Follows every {alias} in the tree the way build-tokens.cjs does (same depth cap of 8) and reports the ones that do
148
+ * not end at a value: a cycle, a self reference, a chain that is too deep, or a target that is missing. Keys are
149
+ * "<path>: <reason>". The route compares the tree before and after an edit, so aliases that were already broken
150
+ * (component tokens that point at color.semantic.*) do not block a save, but a new one does.
151
+ */
152
+ function aliasFailures(tokens: Record<string, unknown>): Set<string> {
153
+ const out = new Set<string>();
154
+ const chase = (start: string): string | null => {
155
+ let current: unknown = start;
156
+ const seen = new Set<string>();
157
+ for (let depth = 0; depth <= 8; depth++) {
158
+ const m = typeof current === "string" ? current.match(/^\{(.+)\}$/) : null;
159
+ if (!m) return null;
160
+ if (seen.has(current as string)) return "alias cycle";
161
+ seen.add(current as string);
162
+ let node: unknown = tokens;
163
+ for (const key of m[1].split(".")) {
164
+ if (!node || typeof node !== "object" || !Object.prototype.hasOwnProperty.call(node, key)) return "alias target missing";
165
+ node = (node as Record<string, unknown>)[key];
166
+ }
167
+ if (!node || typeof node !== "object" || !("$value" in node)) return "alias target missing";
168
+ current = (node as Record<string, unknown>).$value;
169
+ }
170
+ return "alias chain too deep";
171
+ };
172
+ const walk = (node: unknown, trail: string) => {
173
+ if (!node || typeof node !== "object") return;
174
+ const value = (node as Record<string, unknown>).$value;
175
+ if (typeof value === "string" && /^\{(.+)\}$/.test(value)) {
176
+ const reason = chase(value);
177
+ if (reason) out.add(`${trail}: ${reason}`);
178
+ }
179
+ for (const [key, child] of Object.entries(node)) if (key !== "$value") walk(child, trail ? `${trail}.${key}` : key);
180
+ };
181
+ walk(tokens, "");
182
+ return out;
84
183
  }
85
184
 
86
185
  export async function POST(request: Request) {
@@ -136,6 +235,10 @@ export async function POST(request: Request) {
136
235
  }
137
236
 
138
237
  const updates: string[] = [];
238
+ // Paths the request named that were not written: an unsafe value, an alias that does not resolve, or not a token leaf.
239
+ const rejected: { path: string; reason: string }[] = [];
240
+ const reject = (path: string, reason: string) => { rejected.push({ path, reason }); };
241
+ const aliasFailuresBefore = aliasFailures(tokens);
139
242
 
140
243
  if (payload.brandColor) {
141
244
  // Only write the primary to the LIGHT theme. Writing both to the same hex
@@ -144,22 +247,19 @@ export async function POST(request: Request) {
144
247
  // inverted primary (near-white surface, near-black text). If a designer
145
248
  // wants to override dark too, they can edit tokens.json directly or send
146
249
  // a separate payload (future: { brandColorDark: { ... } }).
250
+ // The client only ever sends a palette hex, so that is all that is accepted here.
147
251
  const { primary, primaryForeground } = payload.brandColor;
148
- setLeaf(tokens, "theme.light.primary", (leaf) => {
149
- leaf.$value = primary;
150
- updates.push("theme.light.primary");
151
- });
152
- setLeaf(tokens, "theme.light.primary-foreground", (leaf) => {
153
- leaf.$value = primaryForeground;
154
- updates.push("theme.light.primary-foreground");
155
- });
252
+ const brand: [string, unknown][] = [["theme.light.primary", primary]];
253
+ if (primaryForeground !== undefined) brand.push(["theme.light.primary-foreground", primaryForeground]);
254
+ for (const [path, value] of brand) {
255
+ if (typeof value !== "string" || !isValidHex(value)) {
256
+ reject(path, "not a hex color");
257
+ continue;
258
+ }
259
+ if (!setLeaf(tokens, path, (leaf) => { leaf.$value = value.trim(); updates.push(path); })) reject(path, "not a token in tokens.json");
260
+ }
156
261
  }
157
262
 
158
- // Promote the active custom color to a built-in entry in brand-colors.json
159
- // alongside the tokens.json write, so a Save fully persists the swatch
160
- // (everyone on the repo sees it as a picker option) and the system primary
161
- // in one round-trip. Validation matches /api/brand-colors so a malformed
162
- // entry is rejected without corrupting the file.
163
263
  let pinnedBuiltinId: string | null = null;
164
264
  if (payload.pinAsBuiltin) {
165
265
  const e = payload.pinAsBuiltin;
@@ -200,22 +300,56 @@ export async function POST(request: Request) {
200
300
  }
201
301
  }
202
302
 
303
+ if (payload.tokenValues) {
304
+ // Only paths into sections the Studio's list edits, and only leaves that already exist (setLeaf skips the rest).
305
+ const allowed = /^(theme\.(light|dark)|color\.primitive|borderRadius|shadow|duration|easing)\.[A-Za-z0-9_.-]+$/;
306
+ for (const [path, value] of Object.entries(payload.tokenValues)) {
307
+ if (!allowed.test(path)) {
308
+ reject(path, "not a path the Studio edits");
309
+ continue;
310
+ }
311
+ if (!acceptValue(tokens, value)) {
312
+ reject(path, ALIAS_FORM.test(String(value).trim()) ? "alias does not point at a palette color" : "value not accepted");
313
+ continue;
314
+ }
315
+ const v = value.trim();
316
+ let typeOk = true;
317
+ const written = setLeaf(tokens, path, (leaf) => {
318
+ // An alias is a color reference, so only a color token takes one.
319
+ if (ALIAS_FORM.test(v) && leaf.$type !== "color") {
320
+ typeOk = false;
321
+ return;
322
+ }
323
+ leaf.$value = v;
324
+ updates.push(path);
325
+ });
326
+ if (!written) reject(path, "not a token in tokens.json");
327
+ else if (!typeOk) reject(path, "only a color token can hold an alias");
328
+ }
329
+ }
330
+
203
331
  if (payload.fonts) {
204
- if (payload.fonts.sans) {
332
+ if (acceptText(payload.fonts.sans)) {
205
333
  setLeaf(tokens, "fontFamily.sans", (leaf) => {
206
- leaf.$value = payload.fonts!.sans;
334
+ leaf.$value = payload.fonts!.sans!.trim();
207
335
  updates.push("fontFamily.sans");
208
336
  });
209
337
  }
210
- if (payload.fonts.serif) {
338
+ if (acceptText(payload.fonts.heading)) {
339
+ setLeaf(tokens, "fontFamily.heading", (leaf) => {
340
+ leaf.$value = payload.fonts!.heading!.trim();
341
+ updates.push("fontFamily.heading");
342
+ });
343
+ }
344
+ if (acceptText(payload.fonts.serif)) {
211
345
  setLeaf(tokens, "fontFamily.serif", (leaf) => {
212
- leaf.$value = payload.fonts!.serif;
346
+ leaf.$value = payload.fonts!.serif!.trim();
213
347
  updates.push("fontFamily.serif");
214
348
  });
215
349
  }
216
- if (payload.fonts.mono) {
350
+ if (acceptText(payload.fonts.mono)) {
217
351
  setLeaf(tokens, "fontFamily.mono", (leaf) => {
218
- leaf.$value = payload.fonts!.mono;
352
+ leaf.$value = payload.fonts!.mono!.trim();
219
353
  updates.push("fontFamily.mono");
220
354
  });
221
355
  }
@@ -248,8 +382,18 @@ export async function POST(request: Request) {
248
382
  });
249
383
  }
250
384
 
385
+ // An alias that loops or runs too deep would make build:tokens throw on every later run, so a tree that gained
386
+ // one is not written.
387
+ const introduced = [...aliasFailures(tokens)].filter((f) => !aliasFailuresBefore.has(f));
388
+ if (introduced.length > 0) {
389
+ return NextResponse.json(
390
+ { ok: false, error: `Not saved, tokens.json was not changed: ${introduced.slice(0, 3).join("; ")}`, rejected },
391
+ { status: 400 },
392
+ );
393
+ }
394
+
251
395
  if (updates.length === 0) {
252
- return NextResponse.json({ ok: true, updates: [], note: "No changes to save." });
396
+ return NextResponse.json({ ok: true, updates: [], ...(rejected.length ? { rejected } : {}), note: "No changes to save." });
253
397
  }
254
398
 
255
399
  try {
@@ -268,6 +412,7 @@ export async function POST(request: Request) {
268
412
  return NextResponse.json({
269
413
  ok: true,
270
414
  updates,
415
+ ...(rejected.length ? { rejected } : {}),
271
416
  warning: `Saved tokens.json but build:tokens failed: ${(err as Error).message}`,
272
417
  pinnedBuiltinId,
273
418
  replaceCustomId: payload.pinAsBuiltin?.replaceCustomId ?? null,
@@ -277,6 +422,7 @@ export async function POST(request: Request) {
277
422
  return NextResponse.json({
278
423
  ok: true,
279
424
  updates,
425
+ ...(rejected.length ? { rejected } : {}),
280
426
  pinnedBuiltinId,
281
427
  replaceCustomId: payload.pinAsBuiltin?.replaceCustomId ?? null,
282
428
  });
@@ -209,11 +209,20 @@ export default function RootLayout({
209
209
  // very first paint. Fall back to system-ui if next/font hasn't
210
210
  // initialized yet.
211
211
  var SANS = Object.assign({
212
- hyperlegible: "'Hyperlegible Sans', ui-sans-serif, sans-serif, system-ui",
212
+ hyperlegible: "'Atkinson Hyperlegible Sans', 'Hyperlegible Sans', ui-sans-serif, sans-serif, system-ui",
213
+ figtree: "'Figtree', 'Atkinson Hyperlegible Sans', ui-sans-serif, sans-serif, system-ui",
213
214
  atkinson: "var(--font-atkinson), 'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui",
214
215
  inter: "var(--font-inter), 'Inter', ui-sans-serif, sans-serif, system-ui",
215
216
  system: "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"
216
217
  }, ${JSON.stringify(brandSansMap)});
218
+ var HEADING = Object.assign({
219
+ figtree: "'Figtree', 'Atkinson Hyperlegible Sans', 'Hyperlegible Sans', ui-sans-serif, sans-serif, system-ui",
220
+ hyperlegible: "'Atkinson Hyperlegible Sans', 'Hyperlegible Sans', ui-sans-serif, sans-serif, system-ui",
221
+ inter: "var(--font-inter, 'Inter'), 'Inter', ui-sans-serif, sans-serif, system-ui",
222
+ lora: "var(--font-lora, 'Lora'), 'Lora', Georgia, ui-serif, serif",
223
+ "source-serif": "var(--font-source-serif, 'Source Serif 4'), 'Source Serif 4', Georgia, ui-serif, serif",
224
+ system: "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
225
+ }, ${JSON.stringify(brandSansMap)});
217
226
  var SERIF = {
218
227
  georgia: "Georgia, ui-serif, serif",
219
228
  lora: "var(--font-lora), 'Lora', Georgia, ui-serif, serif",
@@ -238,6 +247,8 @@ export default function RootLayout({
238
247
  var s = document.documentElement.style;
239
248
  var sans = k("sansFont");
240
249
  if (sans && SANS[sans]) s.setProperty("--font-sans", SANS[sans]);
250
+ var heading = k("headingFont");
251
+ if (heading && HEADING[heading]) s.setProperty("--font-heading", HEADING[heading]);
241
252
  var serif = k("serifFont");
242
253
  if (serif && SERIF[serif]) s.setProperty("--font-serif", SERIF[serif]);
243
254
  var mono = k("monoFont");
@@ -3,6 +3,7 @@
3
3
  // allow-slop:BADS-SLOP-13 Component gallery: the centered blocks are Stepper titles under their step icons, which is the correct centered pattern for that primitive, not a centered page.
4
4
  import { sectionId, useSectionVisible } from "@behavioral-agentic-design-system/core/app/preview/showcase-filter";
5
5
  import * as React from "react";
6
+ import { Reveal } from "@behavioral-agentic-design-system/core/components/motion/reveal";
6
7
  import {
7
8
  Pagination,
8
9
  PaginationContent,
@@ -124,6 +125,7 @@ import { FloatingPanel } from "@behavioral-agentic-design-system/core/components
124
125
  import { NumberInput } from "@behavioral-agentic-design-system/core/components/ui/number-input";
125
126
  import { InlineEdit } from "@behavioral-agentic-design-system/core/components/ui/inline-edit";
126
127
  import { OTPInput } from "@behavioral-agentic-design-system/core/components/ui/otp-input";
128
+ import { NumberField } from "@behavioral-agentic-design-system/core/components/ui/number-field";
127
129
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@behavioral-agentic-design-system/core/components/ui/collapsible";
128
130
  import { ChevronDownIcon } from "lucide-react";
129
131
  import { FileUpload } from "@behavioral-agentic-design-system/core/components/ui/file-upload";
@@ -543,21 +545,27 @@ function Section({ title, children }: { title: string; children: React.ReactNode
543
545
  const visible = useSectionVisible(id);
544
546
  if (!visible) return null;
545
547
  return (
546
- // content-visibility:auto lets the browser skip style/layout/paint for
547
- // sections outside the viewport. With 120+ sections (and growing
548
- // nightly), that skip is what keeps the dark/light retheme cheap enough
549
- // not to stutter the host's iris-wipe view transition when this tab is
550
- // active. contain-intrinsic-size 'auto 600px' holds a placeholder height
551
- // before first render (then remembers the real one) so the scrollbar
552
- // stays sane.
553
- <section
554
- id={id}
555
- data-section-id={id}
556
- className="scroll-mt-6 space-y-4 [content-visibility:auto] [contain-intrinsic-size:auto_600px]"
557
- >
558
- <h2 className="text-2xl font-semibold tracking-tight">{title}</h2>
559
- <Card className="p-6 shadow-none">{children}</Card>
560
- </section>
548
+ // Reveal fades each section up once as it scrolls into view (and does nothing
549
+ // for sections already on screen, under reduced motion, or without
550
+ // IntersectionObserver). It wraps the <section> rather than living inside it so
551
+ // the anchor target, scroll-mt and content-visibility below stay untouched.
552
+ <Reveal>
553
+ {/* content-visibility:auto lets the browser skip style/layout/paint for
554
+ sections outside the viewport. With 120+ sections (and growing
555
+ nightly), that skip is what keeps the dark/light retheme cheap enough
556
+ not to stutter the host's iris-wipe view transition when this tab is
557
+ active. contain-intrinsic-size 'auto 600px' holds a placeholder height
558
+ before first render (then remembers the real one) so the scrollbar
559
+ stays sane. */}
560
+ <section
561
+ id={id}
562
+ data-section-id={id}
563
+ className="scroll-mt-6 space-y-4 [content-visibility:auto] [contain-intrinsic-size:auto_600px]"
564
+ >
565
+ <h2 className="text-2xl font-semibold tracking-tight">{title}</h2>
566
+ <Card className="p-6 shadow-none">{children}</Card>
567
+ </section>
568
+ </Reveal>
561
569
  );
562
570
  }
563
571
 
@@ -6451,6 +6459,9 @@ export default function ComponentsPreview() {
6451
6459
  <Section title="Collapsible">
6452
6460
  <CollapsibleShowcase />
6453
6461
  </Section>
6462
+ <Section title="NumberField">
6463
+ <NumberFieldShowcase />
6464
+ </Section>
6454
6465
  </div>
6455
6466
  </div>
6456
6467
  );
@@ -13304,7 +13315,7 @@ function AnnouncementBarShowcase() {
13304
13315
  <p className="mb-3 text-xs font-medium text-muted-foreground">
13305
13316
  All five variants
13306
13317
  </p>
13307
- <div className="flex flex-col rounded-lg overflow-hidden border border-border">
13318
+ <div className="flex flex-col rounded-lg overflow-hidden border border-border [&>[data-slot=announcement-bar]:last-child]:border-b-0">
13308
13319
  <AnnouncementBar variant="default">
13309
13320
  BADS v2.4 — ProgressStack, Callout &amp; AnnouncementBar now available.
13310
13321
  </AnnouncementBar>
@@ -13326,7 +13337,7 @@ function AnnouncementBarShowcase() {
13326
13337
  <p className="mb-3 text-xs font-medium text-muted-foreground">
13327
13338
  With action link
13328
13339
  </p>
13329
- <div className="rounded-lg overflow-hidden border border-border">
13340
+ <div className="rounded-lg overflow-hidden border border-border [&>[data-slot=announcement-bar]:last-child]:border-b-0">
13330
13341
  <AnnouncementBar
13331
13342
  variant="default"
13332
13343
  action={
@@ -13346,7 +13357,7 @@ function AnnouncementBarShowcase() {
13346
13357
  <p className="mb-3 text-xs font-medium text-muted-foreground">
13347
13358
  Dismissible — with action + dismiss button
13348
13359
  </p>
13349
- <div className="rounded-lg overflow-hidden border border-border">
13360
+ <div className="rounded-lg overflow-hidden border border-border [&>[data-slot=announcement-bar]:last-child]:border-b-0">
13350
13361
  {!dismissed ? (
13351
13362
  <AnnouncementBar
13352
13363
  variant="info"
@@ -15371,3 +15382,88 @@ function CollapsibleShowcase() {
15371
15382
  </div>
15372
15383
  )
15373
15384
  }
15385
+
15386
+ function NumberFieldShowcase() {
15387
+ const [quantity, setQuantity] = React.useState(2);
15388
+ const [price, setPrice] = React.useState(49.0);
15389
+ const [discount, setDiscount] = React.useState(25);
15390
+ const total = quantity * price * (1 - discount / 100);
15391
+
15392
+ return (
15393
+ <div className="space-y-8">
15394
+ <div className="flex flex-wrap gap-6 items-start">
15395
+ <div className="w-56">
15396
+ <NumberField label="Quantity" defaultValue={1} min={1} max={99} size="sm" />
15397
+ </div>
15398
+ <div className="w-56">
15399
+ <NumberField label="Quantity" defaultValue={1} min={1} max={99} />
15400
+ </div>
15401
+ <div className="w-56">
15402
+ <NumberField label="Quantity" defaultValue={1} min={1} max={99} size="lg" />
15403
+ </div>
15404
+ </div>
15405
+ <div className="flex flex-wrap gap-6 items-start">
15406
+ <div className="w-64">
15407
+ <NumberField
15408
+ label="Price"
15409
+ defaultValue={29.99}
15410
+ step={0.01}
15411
+ min={0}
15412
+ formatOptions={{ style: "currency", currency: "USD" }}
15413
+ helperText="Enter price before tax"
15414
+ />
15415
+ </div>
15416
+ <div className="w-64">
15417
+ <NumberField
15418
+ label="Discount"
15419
+ defaultValue={0}
15420
+ min={0}
15421
+ max={100}
15422
+ step={5}
15423
+ formatOptions={{ style: "percent", maximumFractionDigits: 0 }}
15424
+ errorMessage="Value must be between 0 and 100"
15425
+ />
15426
+ </div>
15427
+ <div className="w-64">
15428
+ <NumberField label="Seat count" defaultValue={5} disabled helperText="Set during checkout" />
15429
+ </div>
15430
+ </div>
15431
+ <div className="w-80 flex flex-col gap-5 rounded-lg border p-5">
15432
+ <p className="text-sm font-medium text-foreground">Order summary</p>
15433
+ <NumberField
15434
+ label="Quantity"
15435
+ value={quantity}
15436
+ onChange={setQuantity}
15437
+ min={1}
15438
+ max={99}
15439
+ required
15440
+ helperText="Maximum 99 per order"
15441
+ />
15442
+ <NumberField
15443
+ label="Unit price"
15444
+ value={price}
15445
+ onChange={setPrice}
15446
+ step={0.01}
15447
+ min={0}
15448
+ formatOptions={{ style: "currency", currency: "USD" }}
15449
+ />
15450
+ <NumberField
15451
+ label="Discount"
15452
+ value={discount}
15453
+ onChange={setDiscount}
15454
+ min={0}
15455
+ max={100}
15456
+ step={5}
15457
+ formatOptions={{ style: "percent", maximumFractionDigits: 0 }}
15458
+ helperText="Applied at checkout"
15459
+ />
15460
+ <div className="flex justify-between text-sm pt-2 border-t border-border">
15461
+ <span className="text-muted-foreground">Total</span>
15462
+ <span className="font-medium tabular-nums">
15463
+ {new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(total)}
15464
+ </span>
15465
+ </div>
15466
+ </div>
15467
+ </div>
15468
+ )
15469
+ }
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useGlobalSansFont } from "@behavioral-agentic-design-system/core/hooks/use-global-sans-font";
4
+ import { useGlobalHeadingFont } from "@behavioral-agentic-design-system/core/hooks/use-global-heading-font";
4
5
  import { useGlobalSerifFont } from "@behavioral-agentic-design-system/core/hooks/use-global-serif-font";
5
6
  import { useGlobalMonoFont } from "@behavioral-agentic-design-system/core/hooks/use-global-mono-font";
6
7
  import { useGlobalPrimaryColor } from "@behavioral-agentic-design-system/core/hooks/use-global-primary-color";
@@ -27,6 +28,7 @@ export default function GlobalFontClient() {
27
28
  useTokenOverrides();
28
29
  useSyncTypeScale();
29
30
  useGlobalSansFont();
31
+ useGlobalHeadingFont();
30
32
  useGlobalSerifFont();
31
33
  useGlobalMonoFont();
32
34
  useGlobalPrimaryColor();
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { TooltipProvider } from "@behavioral-agentic-design-system/core/components/ui/tooltip";
4
4
  import { useGlobalSansFont } from "@behavioral-agentic-design-system/core/hooks/use-global-sans-font";
5
+ import { useGlobalHeadingFont } from "@behavioral-agentic-design-system/core/hooks/use-global-heading-font";
5
6
  import { useGlobalSerifFont } from "@behavioral-agentic-design-system/core/hooks/use-global-serif-font";
6
7
  import { useGlobalMonoFont } from "@behavioral-agentic-design-system/core/hooks/use-global-mono-font";
7
8
  import { useGlobalPrimaryColor } from "@behavioral-agentic-design-system/core/hooks/use-global-primary-color";
@@ -31,6 +32,7 @@ function GlobalThemeSync() {
31
32
  useTokenOverrides();
32
33
  useSyncTypeScale();
33
34
  useGlobalSansFont();
35
+ useGlobalHeadingFont();
34
36
  useGlobalSerifFont();
35
37
  useGlobalMonoFont();
36
38
  useGlobalPrimaryColor();