@behavioral-agentic-design-system/core 0.28.0 → 0.29.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 (95) hide show
  1. package/package.json +2 -2
  2. package/scripts/a11y-lint.cjs +78 -9
  3. package/scripts/build-tokens.cjs +273 -15
  4. package/scripts/wcag-audit.cjs +37 -7
  5. package/src/api/layers/file.ts +1 -0
  6. package/src/app/font-ready.tsx +6 -5
  7. package/src/app/layout.tsx +54 -3
  8. package/src/app/preview/components/page.tsx +5532 -3044
  9. package/src/app/preview/layout.tsx +4 -1
  10. package/src/app/preview/showcase-filter.tsx +66 -0
  11. package/src/app/preview/tab-replay.tsx +63 -0
  12. package/src/app/shell.tsx +74 -18
  13. package/src/components/customize/save-bar.tsx +19 -6
  14. package/src/components/docs-tab.tsx +36 -24
  15. package/src/components/layers-tab.tsx +37 -5
  16. package/src/components/ui/alert.tsx +12 -0
  17. package/src/components/ui/badge.tsx +19 -0
  18. package/src/components/ui/chat-marker.tsx +120 -0
  19. package/src/components/ui/checkbox.tsx +9 -1
  20. package/src/components/ui/close-button.tsx +71 -0
  21. package/src/components/ui/combobox.tsx +62 -3
  22. package/src/components/ui/container.tsx +65 -0
  23. package/src/components/ui/date-field.tsx +368 -0
  24. package/src/components/ui/drawer.tsx +334 -0
  25. package/src/components/ui/file-button.tsx +145 -0
  26. package/src/components/ui/floating-indicator.tsx +217 -0
  27. package/src/components/ui/format-byte.tsx +113 -0
  28. package/src/components/ui/index.ts +21 -0
  29. package/src/components/ui/input.tsx +38 -3
  30. package/src/components/ui/keyboard-shortcut.tsx +146 -0
  31. package/src/components/ui/loading-dots.tsx +99 -0
  32. package/src/components/ui/month-picker.tsx +296 -0
  33. package/src/components/ui/multi-select.tsx +15 -13
  34. package/src/components/ui/nav-link.tsx +200 -0
  35. package/src/components/ui/navigation-rail.tsx +256 -0
  36. package/src/components/ui/notification.tsx +20 -0
  37. package/src/components/ui/password-input.tsx +34 -1
  38. package/src/components/ui/progress.tsx +15 -1
  39. package/src/components/ui/prose.tsx +62 -0
  40. package/src/components/ui/result.tsx +151 -0
  41. package/src/components/ui/rolling-number.tsx +1 -0
  42. package/src/components/ui/simple-grid.tsx +110 -0
  43. package/src/components/ui/skeleton.tsx +52 -3
  44. package/src/components/ui/squircle.tsx +274 -0
  45. package/src/components/ui/stack.tsx +105 -0
  46. package/src/components/ui/status-badge.tsx +93 -0
  47. package/src/components/ui/tabs.tsx +34 -7
  48. package/src/components/ui/tag.tsx +46 -5
  49. package/src/components/ui/theme-icon.tsx +138 -0
  50. package/src/components/ui/timeline.tsx +27 -10
  51. package/src/components/ui/tooltip.tsx +12 -1
  52. package/src/components/ui/tree-select.tsx +386 -0
  53. package/src/components/ui/year-picker.tsx +307 -0
  54. package/src/data/docs-index.ts +10 -0
  55. package/src/hooks/use-global-primary-color.ts +57 -6
  56. package/src/stories/Alert.stories.tsx +31 -1
  57. package/src/stories/Badge.stories.tsx +63 -6
  58. package/src/stories/ChatMarker.stories.tsx +59 -0
  59. package/src/stories/Checkbox.stories.tsx +5 -0
  60. package/src/stories/CloseButton.stories.tsx +65 -0
  61. package/src/stories/Combobox.stories.tsx +74 -3
  62. package/src/stories/Container.stories.tsx +134 -0
  63. package/src/stories/DateField.stories.tsx +114 -0
  64. package/src/stories/Drawer.stories.tsx +211 -0
  65. package/src/stories/FileButton.stories.tsx +117 -0
  66. package/src/stories/FloatingIndicator.stories.tsx +343 -0
  67. package/src/stories/FormatByte.stories.tsx +142 -0
  68. package/src/stories/Input.stories.tsx +91 -0
  69. package/src/stories/KeyboardShortcut.stories.tsx +87 -0
  70. package/src/stories/LoadingDots.stories.tsx +73 -0
  71. package/src/stories/MonthPicker.stories.tsx +99 -0
  72. package/src/stories/MultiSelect.stories.tsx +3 -1
  73. package/src/stories/NavLink.stories.tsx +213 -0
  74. package/src/stories/NavigationRail.stories.tsx +413 -0
  75. package/src/stories/Notification.stories.tsx +53 -0
  76. package/src/stories/PasswordInput.stories.tsx +21 -0
  77. package/src/stories/Progress.stories.tsx +38 -0
  78. package/src/stories/Prose.stories.tsx +232 -0
  79. package/src/stories/Result.stories.tsx +145 -0
  80. package/src/stories/RollingNumber.stories.tsx +1 -1
  81. package/src/stories/SimpleGrid.stories.tsx +130 -0
  82. package/src/stories/Skeleton.stories.tsx +62 -1
  83. package/src/stories/Squircle.stories.tsx +127 -0
  84. package/src/stories/Stack.stories.tsx +139 -0
  85. package/src/stories/StatusBadge.stories.tsx +125 -0
  86. package/src/stories/Tabs.stories.tsx +56 -1
  87. package/src/stories/Tag.stories.tsx +31 -0
  88. package/src/stories/ThemeIcon.stories.tsx +97 -0
  89. package/src/stories/Timeline.stories.tsx +69 -0
  90. package/src/stories/Tooltip.stories.tsx +18 -0
  91. package/src/stories/TreeSelect.stories.tsx +222 -0
  92. package/src/stories/YearPicker.stories.tsx +100 -0
  93. package/src/styles.css +289 -15
  94. package/src/tokens.json +96 -1
  95. package/LICENSE +0 -21
@@ -111,9 +111,10 @@ export default function RootLayout({
111
111
  <html
112
112
  lang="en"
113
113
  suppressHydrationWarning
114
- // `fonts-loading` is removed by <FontReady /> on mount once
115
- // document.fonts.ready resolves. CSS keeps body opacity 0 until then,
116
- // killing the FOUT "jump" when web fonts swap in over system-ui.
114
+ // `fonts-loading` keeps body opacity at 0, killing the FOUT "jump" when web fonts swap in
115
+ // over system-ui. It is released by the inline head script below — NOT by <FontReady />,
116
+ // which cannot run until hydration and so cannot bound how long the page stays blank.
117
+ // <FontReady /> remains as an idempotent backstop for the no-inline-script case.
117
118
  className={`fonts-loading ${atkinson.variable} ${inter.variable} ${jetbrainsMono.variable} ${lora.variable} ${sourceSerif.variable}`}
118
119
  >
119
120
  <head>
@@ -131,6 +132,56 @@ export default function RootLayout({
131
132
  type="font/woff2"
132
133
  crossOrigin=""
133
134
  />
135
+ {/*
136
+ Release the font paint gate from the <head>, not from a React effect.
137
+
138
+ `html.fonts-loading body { opacity: 0 }` hides the entire page until the gate is
139
+ released. <FontReady /> used to be the only thing that released it — but it does so in a
140
+ useEffect, so the gate could not lift until the React bundle had downloaded, parsed and
141
+ hydrated. On a heavy route that inverts the intent: the page was fully laid out and
142
+ measurable at ~700ms and still deliberately invisible at 1.4s, and the 1500ms "safety"
143
+ timeout could not help because it was itself set inside the effect it was meant to
144
+ protect. A blank page reads as broken, which is worse than the font swap this prevents.
145
+
146
+ This runs during head parsing, so the cap is real. 400ms is the trade: long enough that a
147
+ warm cache still swaps fonts invisibly, short enough that a slow load shows fallback text
148
+ instead of nothing. document.fonts.ready is armed at DOMContentLoaded rather than
149
+ immediately, because before any layout there are no pending font loads and the promise can
150
+ resolve instantly — which would reveal too early and reintroduce the FOUT.
151
+ */}
152
+ <script
153
+ dangerouslySetInnerHTML={{
154
+ __html: `
155
+ (function() {
156
+ var r = document.documentElement;
157
+ var done = false;
158
+ function reveal() {
159
+ if (done) return;
160
+ done = true;
161
+ r.classList.remove("fonts-loading");
162
+ r.classList.add("fonts-loaded");
163
+ }
164
+ var cap = setTimeout(reveal, 400);
165
+ function arm() {
166
+ try {
167
+ if (document.fonts && document.fonts.ready) {
168
+ document.fonts.ready.then(function() { clearTimeout(cap); reveal(); });
169
+ } else {
170
+ clearTimeout(cap); reveal();
171
+ }
172
+ } catch (e) {
173
+ clearTimeout(cap); reveal();
174
+ }
175
+ }
176
+ if (document.readyState === "loading") {
177
+ document.addEventListener("DOMContentLoaded", arm);
178
+ } else {
179
+ arm();
180
+ }
181
+ })();
182
+ `,
183
+ }}
184
+ />
134
185
  <script
135
186
  dangerouslySetInnerHTML={{
136
187
  __html: `