@behavioral-agentic-design-system/core 0.27.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.
- package/package.json +5 -5
- package/scripts/a11y-lint.cjs +78 -9
- package/scripts/build-tokens.cjs +273 -15
- package/scripts/wcag-audit.cjs +37 -7
- package/src/api/layers/file.ts +1 -0
- package/src/app/font-ready.tsx +6 -5
- package/src/app/layout.tsx +54 -3
- package/src/app/preview/components/page.tsx +5735 -2500
- package/src/app/preview/layout.tsx +4 -1
- package/src/app/preview/showcase-filter.tsx +66 -0
- package/src/app/preview/tab-replay.tsx +63 -0
- package/src/app/shell.tsx +91 -18
- package/src/components/customize/save-bar.tsx +19 -6
- package/src/components/docs-tab.tsx +36 -24
- package/src/components/layers-tab.tsx +37 -5
- package/src/components/ui/ai-badge.tsx +74 -0
- package/src/components/ui/alert.tsx +12 -0
- package/src/components/ui/badge.tsx +19 -0
- package/src/components/ui/chat-bubble.tsx +298 -0
- package/src/components/ui/chat-marker.tsx +120 -0
- package/src/components/ui/checkbox.tsx +9 -1
- package/src/components/ui/clipboard.tsx +291 -0
- package/src/components/ui/close-button.tsx +71 -0
- package/src/components/ui/combobox.tsx +62 -3
- package/src/components/ui/container.tsx +65 -0
- package/src/components/ui/copy-button.tsx +5 -1
- package/src/components/ui/data-table.tsx +388 -0
- package/src/components/ui/date-field.tsx +368 -0
- package/src/components/ui/drawer.tsx +334 -0
- package/src/components/ui/file-button.tsx +145 -0
- package/src/components/ui/floating-indicator.tsx +217 -0
- package/src/components/ui/focus-trap.tsx +184 -0
- package/src/components/ui/format-byte.tsx +113 -0
- package/src/components/ui/index.ts +28 -0
- package/src/components/ui/input.tsx +38 -3
- package/src/components/ui/keyboard-shortcut.tsx +146 -0
- package/src/components/ui/loading-dots.tsx +99 -0
- package/src/components/ui/mark.tsx +69 -0
- package/src/components/ui/month-picker.tsx +296 -0
- package/src/components/ui/multi-select.tsx +15 -13
- package/src/components/ui/nav-link.tsx +200 -0
- package/src/components/ui/navigation-rail.tsx +256 -0
- package/src/components/ui/notification.tsx +20 -0
- package/src/components/ui/password-input.tsx +34 -1
- package/src/components/ui/progress.tsx +15 -1
- package/src/components/ui/prose.tsx +62 -0
- package/src/components/ui/result.tsx +151 -0
- package/src/components/ui/rolling-number.tsx +201 -0
- package/src/components/ui/simple-grid.tsx +110 -0
- package/src/components/ui/skeleton.tsx +52 -3
- package/src/components/ui/squircle.tsx +274 -0
- package/src/components/ui/stack.tsx +105 -0
- package/src/components/ui/status-badge.tsx +93 -0
- package/src/components/ui/tabs.tsx +34 -7
- package/src/components/ui/tag.tsx +46 -5
- package/src/components/ui/theme-icon.tsx +138 -0
- package/src/components/ui/timeline.tsx +27 -10
- package/src/components/ui/tooltip.tsx +12 -1
- package/src/components/ui/tree-select.tsx +386 -0
- package/src/components/ui/typing-indicator.tsx +2 -2
- package/src/components/ui/word-rotate.tsx +6 -1
- package/src/components/ui/year-picker.tsx +307 -0
- package/src/data/docs-index.ts +10 -0
- package/src/hooks/use-global-primary-color.ts +57 -6
- package/src/stories/AiBadge.stories.tsx +67 -0
- package/src/stories/Alert.stories.tsx +31 -1
- package/src/stories/Badge.stories.tsx +63 -6
- package/src/stories/ChatBubble.stories.tsx +222 -0
- package/src/stories/ChatMarker.stories.tsx +59 -0
- package/src/stories/Checkbox.stories.tsx +5 -0
- package/src/stories/Clipboard.stories.tsx +136 -0
- package/src/stories/CloseButton.stories.tsx +65 -0
- package/src/stories/Combobox.stories.tsx +74 -3
- package/src/stories/Container.stories.tsx +134 -0
- package/src/stories/CopyButton.stories.tsx +2 -0
- package/src/stories/DataTable.stories.tsx +271 -0
- package/src/stories/DateField.stories.tsx +114 -0
- package/src/stories/Drawer.stories.tsx +211 -0
- package/src/stories/FileButton.stories.tsx +117 -0
- package/src/stories/FloatingIndicator.stories.tsx +343 -0
- package/src/stories/FocusTrap.stories.tsx +218 -0
- package/src/stories/FormatByte.stories.tsx +142 -0
- package/src/stories/Input.stories.tsx +91 -0
- package/src/stories/KeyboardShortcut.stories.tsx +87 -0
- package/src/stories/LoadingDots.stories.tsx +73 -0
- package/src/stories/Mark.stories.tsx +84 -0
- package/src/stories/MonthPicker.stories.tsx +99 -0
- package/src/stories/MultiSelect.stories.tsx +3 -1
- package/src/stories/NavLink.stories.tsx +213 -0
- package/src/stories/NavigationRail.stories.tsx +413 -0
- package/src/stories/Notification.stories.tsx +53 -0
- package/src/stories/PasswordInput.stories.tsx +21 -0
- package/src/stories/Progress.stories.tsx +38 -0
- package/src/stories/Prose.stories.tsx +232 -0
- package/src/stories/Result.stories.tsx +145 -0
- package/src/stories/RollingNumber.stories.tsx +226 -0
- package/src/stories/SimpleGrid.stories.tsx +130 -0
- package/src/stories/Skeleton.stories.tsx +62 -1
- package/src/stories/Squircle.stories.tsx +127 -0
- package/src/stories/Stack.stories.tsx +139 -0
- package/src/stories/StatusBadge.stories.tsx +125 -0
- package/src/stories/Tabs.stories.tsx +56 -1
- package/src/stories/Tag.stories.tsx +31 -0
- package/src/stories/ThemeIcon.stories.tsx +97 -0
- package/src/stories/Timeline.stories.tsx +69 -0
- package/src/stories/Tooltip.stories.tsx +18 -0
- package/src/stories/TreeSelect.stories.tsx +222 -0
- package/src/stories/TypingIndicator.stories.tsx +1 -0
- package/src/stories/WordRotate.stories.tsx +1 -0
- package/src/stories/YearPicker.stories.tsx +100 -0
- package/src/styles.css +289 -15
- package/src/tokens.json +96 -1
- package/LICENSE +0 -21
package/src/app/layout.tsx
CHANGED
|
@@ -111,9 +111,10 @@ export default function RootLayout({
|
|
|
111
111
|
<html
|
|
112
112
|
lang="en"
|
|
113
113
|
suppressHydrationWarning
|
|
114
|
-
// `fonts-loading`
|
|
115
|
-
//
|
|
116
|
-
//
|
|
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: `
|