@behavioral-agentic-design-system/core 0.8.4 → 0.9.1
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 +17 -1
- package/scripts/build-fonts.cjs +26 -3
- package/scripts/build-tokens.cjs +68 -6
- package/src/api/brand-fonts.ts +20 -10
- package/src/api/layers/file.ts +39 -4
- package/src/app/preview/components/page.tsx +718 -1
- package/src/app/shell.tsx +61 -15
- package/src/components/brand-mark.tsx +1 -1
- package/src/components/docs-tab.tsx +497 -0
- package/src/components/home-tab.tsx +341 -2043
- package/src/components/layers-tab.tsx +3 -91
- package/src/components/markdown-preview.tsx +226 -0
- package/src/components/motion/chart-reveal.tsx +164 -0
- package/src/components/motion/reveal.tsx +156 -0
- package/src/components/ui/accordion.tsx +117 -0
- package/src/components/ui/alert-dialog.tsx +162 -0
- package/src/components/ui/carousel.tsx +357 -0
- package/src/components/ui/context-menu.tsx +258 -0
- package/src/components/ui/file-upload.tsx +278 -0
- package/src/components/ui/index.ts +10 -0
- package/src/components/ui/navigation-menu.tsx +154 -0
- package/src/components/ui/number-input.tsx +229 -0
- package/src/components/ui/pagination.tsx +143 -0
- package/src/components/ui/pin-input.tsx +257 -0
- package/src/components/ui/sheet.tsx +10 -4
- package/src/components/ui/spinner.tsx +70 -0
- package/src/components/ui/stepper.tsx +272 -0
- package/src/data/docs-index.ts +163 -0
- package/src/hooks/use-reduced-motion.ts +13 -0
- package/src/styles.css +56 -6
- package/src/tokens.json +5 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// Curated reading order for the Docs tab. Keep this in sync with what lives
|
|
2
|
+
// on disk — if you add a doc, add a row here. The /api/layers/file allowlist
|
|
3
|
+
// also needs to cover the path (see packages/core/src/api/layers/file.ts).
|
|
4
|
+
//
|
|
5
|
+
// Order matters. Each group reads top-to-bottom; the order across groups
|
|
6
|
+
// matches the audience flow: orient → architecture → build → automate → quality.
|
|
7
|
+
|
|
8
|
+
export type DocEntry = {
|
|
9
|
+
title: string;
|
|
10
|
+
path: string;
|
|
11
|
+
summary?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type DocGroup = {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
description: string;
|
|
18
|
+
entries: DocEntry[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const DOCS_INDEX: DocGroup[] = [
|
|
22
|
+
{
|
|
23
|
+
id: "start-here",
|
|
24
|
+
label: "Start here",
|
|
25
|
+
description: "What this is, why it exists, where to read first.",
|
|
26
|
+
entries: [
|
|
27
|
+
{ title: "README", path: "README.md", summary: "The first thing to read — what BADS is, how to run it, where to look next." },
|
|
28
|
+
{ title: "Brief", path: "BRIEF.md", summary: "The one-pager — what BADS is, who it's for, what it refuses." },
|
|
29
|
+
{ title: "Design system stack", path: "DESIGN_SYSTEM_STACK.md", summary: "The 10-layer architecture in one document." },
|
|
30
|
+
{ title: "Sync model", path: "BADS_SYNC.md", summary: "How forks pull upstream BADS improvements." },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "architecture",
|
|
35
|
+
label: "Architecture (10 layers)",
|
|
36
|
+
description: "Each layer's README — its scope, what ships in it, what comes next.",
|
|
37
|
+
entries: [
|
|
38
|
+
{ title: "Layer 1 — Foundation", path: "layer-1-foundation/README.md" },
|
|
39
|
+
{ title: "Layer 2 — Ethics & responsibility", path: "layer-2-ethics-responsibility/README.md" },
|
|
40
|
+
{ title: "Layer 3 — Primitive tokens", path: "layer-3-primitive-tokens/README.md" },
|
|
41
|
+
{ title: "Layer 4 — Semantic tokens", path: "layer-4-semantic-tokens/README.md" },
|
|
42
|
+
{ title: "Layer 5 — Component registry", path: "layer-5-component-registry/README.md" },
|
|
43
|
+
{ title: "Layer 6 — Patterns & rules", path: "layer-6-patterns-and-rules/README.md" },
|
|
44
|
+
{ title: "Layer 7 — Agent interface", path: "layer-7-agent-interface/README.md" },
|
|
45
|
+
{ title: "Layer 8 — Documentation", path: "layer-8-documentation/README.md" },
|
|
46
|
+
{ title: "Layer 9 — Enforcement", path: "layer-9-enforcement/README.md" },
|
|
47
|
+
{ title: "Layer 10 — Automate", path: "layer-10-automate/README.md" },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "building",
|
|
52
|
+
label: "Building components",
|
|
53
|
+
description: "The exhaustive contract — file placement through PR shape, with the failure-mode catalog.",
|
|
54
|
+
entries: [
|
|
55
|
+
{ title: "Component build spec", path: "docs/component-build-spec.md", summary: "15-section contract every new component satisfies." },
|
|
56
|
+
{ title: "Component readiness audit", path: "prompts/component-readiness-audit.md", summary: "13-question plan-time gate." },
|
|
57
|
+
{ title: "Component backlog", path: "docs/component-backlog.md", summary: "Figma-library primitives queued for Night Shift." },
|
|
58
|
+
{ title: "Component index", path: "COMPONENT_INDEX.md" },
|
|
59
|
+
{ title: "Component design rules", path: "COMPONENT_DESIGN.md" },
|
|
60
|
+
{ title: "Storybook rule", path: "STORYBOOK_RULE.md" },
|
|
61
|
+
{ title: "CTA size contract", path: "prompts/cta-size-contract.md" },
|
|
62
|
+
{ title: "Motion spec", path: "prompts/motion-spec.md" },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "agent-system",
|
|
67
|
+
label: "Agent system",
|
|
68
|
+
description: "How autonomous agents read BADS — instructions, operating modes, the nightly loops.",
|
|
69
|
+
entries: [
|
|
70
|
+
{ title: "CLAUDE.md", path: "CLAUDE.md", summary: "The agent contract — every workflow rule lives here." },
|
|
71
|
+
{ title: "AGENTS.md", path: "AGENTS.md", summary: "Loading precedence + escalation rules." },
|
|
72
|
+
{ title: "V0 system prompt", path: "V0_SYSTEM.md" },
|
|
73
|
+
{ title: "Circadian operating modes", path: "CIRCADIAN.md", summary: "What agents should and shouldn't do at different times of day." },
|
|
74
|
+
{ title: "Night Shift prompt", path: "scripts/prompts/night-shift.md", summary: "The full nightly research + auto-PR pass." },
|
|
75
|
+
{ title: "Agent roadmap", path: "docs/agent-roadmap.md" },
|
|
76
|
+
{ title: "Intent-driven context", path: "docs/intent-driven-context.md", summary: "Constraint vs guideline vs framing vs workflow — and what delivery each demands." },
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "skills-prompts",
|
|
81
|
+
label: "Skills & prompts",
|
|
82
|
+
description: "Invocable workflows agents (and Sir via /<name>) run.",
|
|
83
|
+
entries: [
|
|
84
|
+
{ title: "Skill — component-builder", path: ".claude/skills/component-builder/SKILL.md" },
|
|
85
|
+
{ title: "Skill — design-exploration", path: ".claude/skills/design-exploration/SKILL.md" },
|
|
86
|
+
{ title: "Skill — design-critique", path: ".claude/skills/design-critique/SKILL.md" },
|
|
87
|
+
{ title: "Skill — futures-check", path: ".claude/skills/futures-check/SKILL.md" },
|
|
88
|
+
{ title: "Skill — persona-pressure-test", path: ".claude/skills/persona-pressure-test/SKILL.md" },
|
|
89
|
+
{ title: "Skill — promote-prototype", path: ".claude/skills/promote-prototype/SKILL.md" },
|
|
90
|
+
{ title: "Skill — visual-verify", path: ".claude/skills/visual-verify/SKILL.md" },
|
|
91
|
+
{ title: "Prompt — design directions", path: "prompts/design-directions.md" },
|
|
92
|
+
{ title: "Prompt — design critique", path: "prompts/design-critique.md" },
|
|
93
|
+
{ title: "Prompt — independent critique", path: "prompts/independent-critique.md" },
|
|
94
|
+
{ title: "Prompt — futures check", path: "prompts/futures-check.md" },
|
|
95
|
+
{ title: "Prompt — persona pressure test", path: "prompts/persona-pressure-test.md" },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: "quality-ethics",
|
|
100
|
+
label: "Quality & ethics",
|
|
101
|
+
description: "How the system stays honest — anti-patterns, the corrections log, the ethics floor.",
|
|
102
|
+
entries: [
|
|
103
|
+
{ title: "Design rules", path: "DESIGN.md", summary: "Visual system + accessibility baseline." },
|
|
104
|
+
{ title: "Corrections log", path: "corrections.md", summary: "Per-fork anti-pattern log. Read before every Path B build." },
|
|
105
|
+
{ title: "Anti-defaults refresh", path: "prompts/anti-defaults-refresh.md", summary: "Quarterly pressure-test of the current anti-defaults." },
|
|
106
|
+
{ title: "Promote corrections", path: "prompts/promote-corrections.md", summary: "Monthly: corrections → lint promotion candidates." },
|
|
107
|
+
{ title: "Recipe miner", path: "prompts/recipe-miner.md", summary: "Monthly: ship-first vs bounce-recipe ranking." },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "onboarding",
|
|
112
|
+
label: "Client onboarding",
|
|
113
|
+
description: "The flow that takes BADS from upstream template to a named client engagement.",
|
|
114
|
+
entries: [
|
|
115
|
+
{ title: "Client onboarding", path: "CLIENT_ONBOARDING.md", summary: "Canonical fork-to-client flow." },
|
|
116
|
+
{ title: "0 · Brand context", path: "prompts/0-brand-context.md" },
|
|
117
|
+
{ title: "0 · Personas", path: "prompts/0-personas.md" },
|
|
118
|
+
{ title: "0 · Research", path: "prompts/0-research.md" },
|
|
119
|
+
{ title: "1 · Brand voice", path: "prompts/1-brand-voice.md" },
|
|
120
|
+
{ title: "2 · Microcopy", path: "prompts/2-microcopy.md" },
|
|
121
|
+
{ title: "3 · Ethics", path: "prompts/3-ethics.md" },
|
|
122
|
+
{ title: "4 · Tokens", path: "prompts/4-tokens.md" },
|
|
123
|
+
{ title: "5 · Component needs", path: "prompts/5-component-needs.md" },
|
|
124
|
+
{ title: "6 · Patterns", path: "prompts/6-patterns.md" },
|
|
125
|
+
{ title: "Chromatic setup", path: "docs/chromatic-setup.md" },
|
|
126
|
+
{ title: "Chromatic prompt", path: "prompts/chromatic.md" },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "self-improvement",
|
|
131
|
+
label: "Self-improvement loops",
|
|
132
|
+
description: "The ledgers, the aggregator, the scheduled cadences that compound the system.",
|
|
133
|
+
entries: [
|
|
134
|
+
{ title: "Automation README", path: "automation/README.md" },
|
|
135
|
+
{ title: "Ledgers README", path: "ledgers/README.md" },
|
|
136
|
+
{ title: "Aggregator README", path: "aggregator/README.md" },
|
|
137
|
+
{ title: "CTO Builder dry-run", path: "docs/cto-builder-dry-run-2026-06-12.md" },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "business",
|
|
142
|
+
label: "Business",
|
|
143
|
+
description: "How BADS measures its own value and what it ships.",
|
|
144
|
+
entries: [
|
|
145
|
+
{ title: "ROI methodology", path: "roi/README.md", summary: "Client savings + delivery economics math." },
|
|
146
|
+
{ title: "Capabilities index", path: "CAPABILITIES.md", summary: "Every feature BADS ships, in one table." },
|
|
147
|
+
{ title: "Changelog", path: "CHANGELOG.md" },
|
|
148
|
+
{ title: "Engineering", path: "ENGINEERING.md" },
|
|
149
|
+
{ title: "Security", path: "SECURITY.md" },
|
|
150
|
+
{ title: "Contributing", path: "CONTRIBUTING.md" },
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "roadmap",
|
|
155
|
+
label: "Roadmap",
|
|
156
|
+
description: "Deferred plans — what we'd build if the activation signal fires.",
|
|
157
|
+
entries: [
|
|
158
|
+
{ title: "Roadmap", path: "docs/roadmap.md", summary: "Layer 2/6/8/9/10 deferred work with the signal that should activate each one." },
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
|
|
163
|
+
export const DOCS_TOTAL = DOCS_INDEX.reduce((sum, g) => sum + g.entries.length, 0);
|
|
@@ -4,6 +4,19 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
const QUERY = "(prefers-reduced-motion: reduce)";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* One-shot, non-reactive read of the reduced-motion preference, for callers
|
|
9
|
+
* outside React render (module-singleton controllers, inside effects) that need
|
|
10
|
+
* the current value without subscribing to changes. SSR-safe.
|
|
11
|
+
*/
|
|
12
|
+
export function prefersReducedMotion(): boolean {
|
|
13
|
+
return (
|
|
14
|
+
typeof window !== "undefined" &&
|
|
15
|
+
typeof window.matchMedia === "function" &&
|
|
16
|
+
window.matchMedia(QUERY).matches
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
7
20
|
export function useReducedMotion(): boolean {
|
|
8
21
|
const [reduced, setReduced] = React.useState(false);
|
|
9
22
|
|
package/src/styles.css
CHANGED
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / var(--shadow-opacity)), 0 2px 4px -1px hsl(0 0% 0% / var(--shadow-opacity));
|
|
118
118
|
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / var(--shadow-opacity)), 0 4px 6px -1px hsl(0 0% 0% / var(--shadow-opacity));
|
|
119
119
|
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / var(--shadow-opacity)), 0 8px 10px -1px hsl(0 0% 0% / var(--shadow-opacity));
|
|
120
|
-
--shadow-2xl: 0
|
|
120
|
+
--shadow-2xl: 0 10px 30px -12px hsl(0 0% 0% / 0.18);
|
|
121
121
|
--duration-fast: 150ms;
|
|
122
122
|
--duration-base: 200ms;
|
|
123
123
|
--duration-slow: 300ms;
|
|
@@ -272,6 +272,14 @@
|
|
|
272
272
|
--ease-spring-snappy: var(--spring-snappy);
|
|
273
273
|
--ease-spring-bounce: var(--spring-bounce);
|
|
274
274
|
|
|
275
|
+
/* Animation utilities — declared here for token reference / future
|
|
276
|
+
Tailwind v4 utility generation when reliable. Currently the
|
|
277
|
+
accordion-up/down keyframes are applied via direct CSS selectors
|
|
278
|
+
keyed off Radix's data-slot + data-state attributes (see the
|
|
279
|
+
keyframe block below) — that's the deterministic path while we
|
|
280
|
+
verify which @theme inline patterns Tailwind v4 reliably generates
|
|
281
|
+
utilities for in this setup. */
|
|
282
|
+
|
|
275
283
|
/* Accessibility floor — minimum 14px for text-xs (vs Tailwind's 12px default).
|
|
276
284
|
Font sizes are dynamically computed by useGlobalTypeScale hook and set as
|
|
277
285
|
--text-xs-size, --text-sm-size, etc. These are then scaled by --font-size-scale
|
|
@@ -514,7 +522,26 @@ html, body {
|
|
|
514
522
|
|
|
515
523
|
/* Theme toggle: iris reveal via View Transitions API. The click coords are
|
|
516
524
|
written to --x / --y on <html> before startViewTransition fires (see
|
|
517
|
-
app/page.tsx toggleDark).
|
|
525
|
+
app/page.tsx toggleDark).
|
|
526
|
+
|
|
527
|
+
Two deliberate choices, both learned the hard way (swimtopia, 2026-06):
|
|
528
|
+
1. Radius is a VIEWPORT unit (150vmax), not a percentage. circle(150%)
|
|
529
|
+
resolves against the snapshot box, so on a large/wide desktop the wipe
|
|
530
|
+
can finish before it has covered the viewport — a glitch at the END of
|
|
531
|
+
the animation that only shows on big displays. 150vmax always overshoots
|
|
532
|
+
the farthest corner of any viewport (diagonal <= sqrt(2)*vmax < 1.5vmax),
|
|
533
|
+
AND is box-independent, so if a fork names sticky chrome as its own
|
|
534
|
+
view-transition group the radius matches the root exactly (no seam).
|
|
535
|
+
2. PURE clip-path reveal, no opacity fade. A 0.7->1 opacity blend makes the
|
|
536
|
+
growing edge translucent, showing the old theme through the new — which
|
|
537
|
+
paints a muddy grey smear (worst dark->light). The wipe should be a crisp
|
|
538
|
+
hard edge at full opacity.
|
|
539
|
+
|
|
540
|
+
Forks with sticky chrome (a sidebar / top bar that stays put while the page
|
|
541
|
+
scrolls): see CLAUDE.md -> "Theme transition and sticky chrome" before
|
|
542
|
+
naming any chrome. NEVER give a backdrop-filter element a view-transition-
|
|
543
|
+
name (its snapshot has no backdrop to sample and rasterizes as an opaque
|
|
544
|
+
white flash). */
|
|
518
545
|
::view-transition-old(root),
|
|
519
546
|
::view-transition-new(root) {
|
|
520
547
|
animation: none;
|
|
@@ -525,15 +552,38 @@ html, body {
|
|
|
525
552
|
|
|
526
553
|
@keyframes theme-reveal {
|
|
527
554
|
from {
|
|
528
|
-
clip-path: circle(0
|
|
529
|
-
opacity: 0.7;
|
|
555
|
+
clip-path: circle(0 at var(--x, 50%) var(--y, 50%));
|
|
530
556
|
}
|
|
531
557
|
to {
|
|
532
|
-
clip-path: circle(
|
|
533
|
-
opacity: 1;
|
|
558
|
+
clip-path: circle(150vmax at var(--x, 50%) var(--y, 50%));
|
|
534
559
|
}
|
|
535
560
|
}
|
|
536
561
|
|
|
562
|
+
/* Accordion disclosure keyframes — used by Radix-based AccordionContent.
|
|
563
|
+
Radix injects the actual content height as `--radix-accordion-content-height`
|
|
564
|
+
at runtime, which these keyframes interpolate against. Duration + timing
|
|
565
|
+
come from BADS motion tokens. */
|
|
566
|
+
@keyframes accordion-down {
|
|
567
|
+
from { height: 0; }
|
|
568
|
+
to { height: var(--radix-accordion-content-height); }
|
|
569
|
+
}
|
|
570
|
+
@keyframes accordion-up {
|
|
571
|
+
from { height: var(--radix-accordion-content-height); }
|
|
572
|
+
to { height: 0; }
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/* Apply the keyframes directly via the data-slot + data-state selectors
|
|
576
|
+
that Radix sets on AccordionContent. Plain CSS — no Tailwind utility
|
|
577
|
+
generation in the path. The previous @theme inline `--animate-accordion-*`
|
|
578
|
+
tokens were unreliable; this matches the deterministic pattern used by
|
|
579
|
+
tw-animate-css for its own animate-in / animate-out utilities. */
|
|
580
|
+
[data-slot="accordion-content"][data-state="open"] {
|
|
581
|
+
animation: accordion-down var(--duration-base) var(--ease-out);
|
|
582
|
+
}
|
|
583
|
+
[data-slot="accordion-content"][data-state="closed"] {
|
|
584
|
+
animation: accordion-up var(--duration-base) var(--ease-out);
|
|
585
|
+
}
|
|
586
|
+
|
|
537
587
|
::view-transition-new(root) {
|
|
538
588
|
animation: theme-reveal 0.4s ease-in-out forwards;
|
|
539
589
|
}
|
package/src/tokens.json
CHANGED
|
@@ -362,6 +362,11 @@
|
|
|
362
362
|
"$value": "0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10)",
|
|
363
363
|
"$type": "shadow"
|
|
364
364
|
},
|
|
365
|
+
"2xl": {
|
|
366
|
+
"$value": "0 10px 30px -12px hsl(0 0% 0% / 0.18)",
|
|
367
|
+
"$type": "shadow",
|
|
368
|
+
"$description": "Lifted card surface. Soft 30px blur, -12px spread pulls the shadow in so it doesn't bleed past the card edge. Use for primary content cards (home dashboard, schedule rows, billing rows). Overrides the opacity-multiplier rhythm at the 2xl tier — see build-tokens.cjs shadowExplicit() for the override path."
|
|
369
|
+
},
|
|
365
370
|
"opacity": {
|
|
366
371
|
"$value": "0.10",
|
|
367
372
|
"$type": "number",
|