@behavioral-agentic-design-system/core 0.8.0 → 0.8.3

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.
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react";
2
2
  import type { CSSProperties } from "react";
3
- import { useState } from "react";
3
+ import { useCallback, useEffect, useState } from "react";
4
4
 
5
5
  const meta: Meta = {
6
6
  title: "Foundations/Motion",
@@ -38,41 +38,82 @@ const EASINGS = [
38
38
  },
39
39
  ];
40
40
 
41
- function DemoBox({
41
+ // Replay primitive for CSS-transition demos.
42
+ //
43
+ // A transition only fires when a property changes on an element that's ALREADY
44
+ // in the DOM at its old value. The previous version of this file remounted the
45
+ // box (key={tick}) on each replay, so it mounted directly at the target value
46
+ // and never animated — remounting replays @keyframes animations, not
47
+ // transitions. Instead we keep the element mounted and toggle an `armed` flag:
48
+ // - armed=false -> transition disabled, box sits at the "from" value
49
+ // - armed=true -> transition enabled, box moves to the "to" value
50
+ // replay() disarms (snap to start, no animation), then arms on the next frame
51
+ // so the browser paints the start before the transition to the end. The double
52
+ // rAF guarantees that paint happens between the two states.
53
+ function useReplay(): [boolean, () => void] {
54
+ const [armed, setArmed] = useState(false);
55
+ const replay = useCallback(() => {
56
+ setArmed(false);
57
+ requestAnimationFrame(() => requestAnimationFrame(() => setArmed(true)));
58
+ }, []);
59
+ // Auto-play once on open so the motion is visible without clicking Replay.
60
+ useEffect(() => {
61
+ replay();
62
+ }, [replay]);
63
+ return [armed, replay];
64
+ }
65
+
66
+ function MotionBox({
67
+ armed,
68
+ prop,
69
+ from,
70
+ to,
42
71
  duration,
43
72
  easing,
44
- trigger,
73
+ origin = "center",
45
74
  }: {
75
+ armed: boolean;
76
+ prop: string;
77
+ from: string;
78
+ to: string;
46
79
  duration: string;
47
80
  easing: string;
48
- trigger: number;
81
+ origin?: string;
49
82
  }) {
50
83
  return (
51
84
  <div
52
- key={trigger}
53
85
  className="h-12 w-12 rounded-md bg-primary"
54
- style={{
55
- transition: `transform ${duration} ${easing}`,
56
- transform: trigger % 2 === 0 ? "translateX(0)" : "translateX(180px)",
57
- }}
86
+ style={
87
+ {
88
+ transition: armed ? `${prop} ${duration} ${easing}` : "none",
89
+ transformOrigin: origin,
90
+ [prop]: armed ? to : from,
91
+ } as CSSProperties
92
+ }
58
93
  />
59
94
  );
60
95
  }
61
96
 
97
+ function ReplayButton({ onClick }: { onClick: () => void }) {
98
+ return (
99
+ <button
100
+ type="button"
101
+ onClick={onClick}
102
+ className="text-sm font-medium underline underline-offset-4 hover:text-primary"
103
+ >
104
+ Replay
105
+ </button>
106
+ );
107
+ }
108
+
62
109
  export const Durations: Story = {
63
110
  render: () => {
64
- const [tick, setTick] = useState(0);
111
+ const [armed, replay] = useReplay();
65
112
  return (
66
113
  <div className="p-8 bg-background">
67
114
  <div className="flex items-baseline justify-between mb-6">
68
115
  <h3 className="text-sm font-semibold text-muted-foreground">Duration scale</h3>
69
- <button
70
- type="button"
71
- onClick={() => setTick((t) => t + 1)}
72
- className="text-sm font-medium underline underline-offset-4 hover:text-primary"
73
- >
74
- Replay
75
- </button>
116
+ <ReplayButton onClick={replay} />
76
117
  </div>
77
118
  <div className="space-y-6">
78
119
  {DURATIONS.map((d) => (
@@ -82,7 +123,14 @@ export const Durations: Story = {
82
123
  <p className="text-xs text-muted-foreground font-mono mt-0.5">{d.value}</p>
83
124
  </div>
84
125
  <div className="relative h-12 flex-1 max-w-[260px]">
85
- <DemoBox duration={d.value} easing="cubic-bezier(0, 0, 0.2, 1)" trigger={tick} />
126
+ <MotionBox
127
+ armed={armed}
128
+ prop="transform"
129
+ from="translateX(0)"
130
+ to="translateX(180px)"
131
+ duration={d.value}
132
+ easing="cubic-bezier(0, 0, 0.2, 1)"
133
+ />
86
134
  </div>
87
135
  <p className="text-sm text-muted-foreground">{d.note}</p>
88
136
  </div>
@@ -95,18 +143,12 @@ export const Durations: Story = {
95
143
 
96
144
  export const Easings: Story = {
97
145
  render: () => {
98
- const [tick, setTick] = useState(0);
146
+ const [armed, replay] = useReplay();
99
147
  return (
100
148
  <div className="p-8 bg-background">
101
149
  <div className="flex items-baseline justify-between mb-6">
102
150
  <h3 className="text-sm font-semibold text-muted-foreground">Easing curves</h3>
103
- <button
104
- type="button"
105
- onClick={() => setTick((t) => t + 1)}
106
- className="text-sm font-medium underline underline-offset-4 hover:text-primary"
107
- >
108
- Replay
109
- </button>
151
+ <ReplayButton onClick={replay} />
110
152
  </div>
111
153
  <div className="space-y-6">
112
154
  {EASINGS.map((e) => (
@@ -118,7 +160,14 @@ export const Easings: Story = {
118
160
  </p>
119
161
  </div>
120
162
  <div className="relative h-12 flex-1 max-w-[260px]">
121
- <DemoBox duration="600ms" easing={e.value} trigger={tick} />
163
+ <MotionBox
164
+ armed={armed}
165
+ prop="transform"
166
+ from="translateX(0)"
167
+ to="translateX(180px)"
168
+ duration="600ms"
169
+ easing={e.value}
170
+ />
122
171
  </div>
123
172
  <p className="text-sm text-muted-foreground">{e.note}</p>
124
173
  </div>
@@ -150,18 +199,12 @@ export const SemanticMotion: Story = {
150
199
  },
151
200
  },
152
201
  render: () => {
153
- const [tick, setTick] = useState(0);
202
+ const [armed, replay] = useReplay();
154
203
  return (
155
204
  <div className="p-8 bg-background">
156
205
  <div className="flex items-baseline justify-between mb-6">
157
206
  <h3 className="text-sm font-semibold text-muted-foreground">Semantic motion (by intent)</h3>
158
- <button
159
- type="button"
160
- onClick={() => setTick((t) => t + 1)}
161
- className="text-sm font-medium underline underline-offset-4 hover:text-primary"
162
- >
163
- Replay
164
- </button>
207
+ <ReplayButton onClick={replay} />
165
208
  </div>
166
209
  <div className="space-y-6">
167
210
  {SEMANTIC_MOTIONS.map((m) => (
@@ -173,16 +216,14 @@ export const SemanticMotion: Story = {
173
216
  </p>
174
217
  </div>
175
218
  <div className="relative h-12 w-12">
176
- <div
177
- key={tick}
178
- className="h-12 w-12 rounded-md bg-primary"
179
- style={{
180
- transition: `${m.prop} var(--motion-${m.name}-duration) var(--motion-${m.name}-ease)`,
181
- transformOrigin: m.name === "expand" ? "top" : "center",
182
- // Flip from "from" to "to" on each replay (key remount) so
183
- // the transition plays. Cast covers the dynamic prop key.
184
- [m.prop]: tick % 2 === 0 ? m.to : m.from,
185
- } as CSSProperties}
219
+ <MotionBox
220
+ armed={armed}
221
+ prop={m.prop}
222
+ from={m.from}
223
+ to={m.to}
224
+ duration={`var(--motion-${m.name}-duration)`}
225
+ easing={`var(--motion-${m.name}-ease)`}
226
+ origin={m.name === "expand" ? "top" : "center"}
186
227
  />
187
228
  </div>
188
229
  <p className="text-sm text-muted-foreground">{m.note}</p>
@@ -204,7 +245,7 @@ export const ReducedMotion: Story = {
204
245
  },
205
246
  },
206
247
  render: () => {
207
- const [tick, setTick] = useState(0);
248
+ const [armed, replay] = useReplay();
208
249
  return (
209
250
  <div className="p-8 bg-background">
210
251
  <h3 className="text-sm font-semibold text-muted-foreground mb-2">Reduced motion</h3>
@@ -212,22 +253,23 @@ export const ReducedMotion: Story = {
212
253
  With <code className="text-xs">prefers-reduced-motion: reduce</code>, this should jump
213
254
  instantly. Otherwise it animates at <code className="text-xs">--duration-base</code>.
214
255
  </p>
215
- <button
216
- type="button"
217
- onClick={() => setTick((t) => t + 1)}
218
- className="text-sm font-medium underline underline-offset-4 hover:text-primary mb-4"
219
- >
220
- Replay
221
- </button>
256
+ <div className="mb-4">
257
+ <ReplayButton onClick={replay} />
258
+ </div>
259
+ {/* The transition only exists under no-preference, so reduced-motion
260
+ users get an instant jump — the point of this story. When disarmed
261
+ we also force transition:none so the snap-to-start never animates. */}
222
262
  <style>{`
223
263
  @media (prefers-reduced-motion: no-preference) {
224
- .reduced-motion-demo { transition: transform 200ms cubic-bezier(0, 0, 0.2, 1); }
264
+ .reduced-motion-demo[data-armed="true"] {
265
+ transition: transform 200ms cubic-bezier(0, 0, 0.2, 1);
266
+ }
225
267
  }
226
268
  `}</style>
227
269
  <div
228
- key={tick}
270
+ data-armed={armed}
229
271
  className="reduced-motion-demo h-12 w-12 rounded-md bg-primary"
230
- style={{ transform: tick % 2 === 0 ? "translateX(0)" : "translateX(220px)" }}
272
+ style={{ transform: armed ? "translateX(220px)" : "translateX(0)" }}
231
273
  />
232
274
  </div>
233
275
  );
@@ -1,9 +1,11 @@
1
1
  "use client";
2
2
 
3
+ import { useMemo } from "react";
3
4
  import { Sparkles } from "lucide-react";
4
5
  import { brand } from "@/brand.config";
5
6
  import { cn } from "@behavioral-agentic-design-system/core/lib/utils";
6
7
  import { useGlobalBrandMarkSvg } from "@behavioral-agentic-design-system/core/hooks/use-global-brand-mark";
8
+ import { classifyMarkTone, markToneFilterClass } from "@behavioral-agentic-design-system/core/lib/brand-mark-tone";
7
9
 
8
10
  /**
9
11
  * Brand mark / logo component. Renders the saved SVG from the live brand-mark
@@ -30,13 +32,17 @@ export function BrandMark({
30
32
  }) {
31
33
  const svg = useGlobalBrandMarkSvg();
32
34
  const label = title ?? `${brand.name} logo`;
35
+ // Auto-invert a fixed-color mark in the theme where it would be too low
36
+ // contrast to see (dark mark in dark mode / light mark in light mode).
37
+ // currentColor and multi-color marks classify as "" and are left untouched.
38
+ const toneClass = useMemo(() => markToneFilterClass(classifyMarkTone(svg)), [svg]);
33
39
 
34
40
  if (svg) {
35
41
  return (
36
42
  <span
37
43
  role="img"
38
44
  aria-label={label}
39
- className={cn("inline-flex items-center justify-center [&>svg]:h-full [&>svg]:w-full", className)}
45
+ className={cn("inline-flex items-center justify-center [&>svg]:h-full [&>svg]:w-full", toneClass, className)}
40
46
  style={{ width: size, height: size }}
41
47
  // SVG is sanitized server-side in /api/brand-mark before it lands in
42
48
  // brand-mark.json — script tags, on* handlers, and dangerous URL
@@ -9,6 +9,10 @@ import {
9
9
  clearGlobalBrandMarkSvg,
10
10
  setGlobalBrandMarkSvg,
11
11
  } from "@behavioral-agentic-design-system/core/hooks/use-global-brand-mark";
12
+ import {
13
+ classifyMarkTone,
14
+ markToneFilterClass,
15
+ } from "@behavioral-agentic-design-system/core/lib/brand-mark-tone";
12
16
 
13
17
  type ApiResponse = {
14
18
  ok: boolean;
@@ -133,7 +137,9 @@ export function BrandMarkSection() {
133
137
  Paste SVG markup or upload an <code className="font-mono text-xs">.svg</code> file.
134
138
  Monotone marks (one color throughout) get rewritten to{" "}
135
139
  <code className="font-mono text-xs">currentColor</code> so the logo adopts the
136
- surrounding text color. Multi-color marks are preserved exactly. Saves to{" "}
140
+ surrounding text color. A fixed-color mark that would be too low-contrast to see
141
+ auto-inverts in the offending theme (a black mark flips to white in dark mode).
142
+ Multi-color marks are preserved exactly. Saves to{" "}
137
143
  <code className="font-mono text-xs">brand-mark.json</code>.
138
144
  </p>
139
145
 
@@ -231,22 +237,25 @@ function PreviewTile({ mode, svg }: { mode: "light" | "dark"; svg: string | null
231
237
  >
232
238
  <div className="flex items-center gap-4">
233
239
  {/* 32px size — matches header rhythm */}
234
- <Mark size={32} svg={svg} />
240
+ <Mark size={32} svg={svg} mode={mode} />
235
241
  {/* 96px size — login/branded surfaces */}
236
- <Mark size={96} svg={svg} />
242
+ <Mark size={96} svg={svg} mode={mode} />
237
243
  </div>
238
244
  <span className="text-xs text-muted-foreground">{isLight ? "Light" : "Dark"}</span>
239
245
  </div>
240
246
  );
241
247
  }
242
248
 
243
- function Mark({ size, svg }: { size: number; svg: string | null }) {
249
+ function Mark({ size, svg, mode }: { size: number; svg: string | null; mode: "light" | "dark" }) {
244
250
  if (svg) {
251
+ // These tiles fake light/dark with explicit backgrounds (not the .dark
252
+ // class), so pass `mode` to invert against the tile's own surface.
253
+ const toneClass = markToneFilterClass(classifyMarkTone(svg), mode);
245
254
  return (
246
255
  <span
247
256
  role="img"
248
257
  aria-label="Brand mark preview"
249
- className="inline-flex items-center justify-center [&>svg]:h-full [&>svg]:w-full"
258
+ className={`inline-flex items-center justify-center [&>svg]:h-full [&>svg]:w-full ${toneClass}`}
250
259
  style={{ width: size, height: size }}
251
260
  dangerouslySetInnerHTML={{ __html: svg }}
252
261
  />
@@ -97,7 +97,7 @@ export function LetterSpacingPanel() {
97
97
  and labels inherit unless overridden.
98
98
  </p>
99
99
  <p className="text-xs text-muted-foreground font-mono">
100
- 0123456789 — sample numerals
100
+ 0123456789 (sample numerals)
101
101
  </p>
102
102
  </Card>
103
103
  </div>
@@ -354,7 +354,7 @@ export function SaveBar() {
354
354
  {count} customization{count === 1 ? "" : "s"}
355
355
  </span>{" "}
356
356
  <span className="text-muted-foreground">
357
- — push them into tokens.json to make them part of the design system
357
+ Push them into tokens.json to make them part of the design system
358
358
  </span>
359
359
  </span>
360
360
  )}
@@ -710,7 +710,7 @@ function ColorPalette() {
710
710
 
711
711
  return (
712
712
  <TokenSwatchPicker.Provider value={swatchCtx}>
713
- <div className="p-8 pb-32 max-w-7xl mx-auto space-y-20">
713
+ <div className="p-4 sm:p-6 lg:p-8 pb-32 max-w-7xl mx-auto space-y-12 sm:space-y-20">
714
714
  <ThemeIO />
715
715
  <PrimaryColorPicker />
716
716
  <BrandMarkSection />
@@ -175,6 +175,8 @@ const SHIPPED_LAYERS = [
175
175
  ".cursorrules for Cursor",
176
176
  "layer-7-agent-interface/system-prompt.md and v0-system.md for v0 sessions",
177
177
  "AGENTS.md with loading precedence + escalation rules",
178
+ "Every rule is classified by intent (constraint / guideline / framing / workflow) so the AI gets each one in the form that makes it actually follow it",
179
+ "Procedural workflows ship as invocable Skills (explore, critique, futures-check, persona-test, visual-verify) the AI runs step by step",
178
180
  ],
179
181
  },
180
182
  {
@@ -972,6 +974,10 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
972
974
  // Fresh fork: not upstream, brand name still "BADS"
973
975
  const isFreshFork = !brand.isUpstreamTemplate && brand.name === "BADS";
974
976
 
977
+ // Temporarily hidden everywhere per Sir (2026-06-04): the "Onboard with AI"
978
+ // hero CTA + the #onboard quickstart section. Flip back to true to restore.
979
+ const SHOW_ONBOARDING_SECTION = false;
980
+
975
981
  // Customized client fork: not upstream, brand name changed
976
982
  const isCustomizedFork = !brand.isUpstreamTemplate && brand.name !== "BADS";
977
983
 
@@ -988,7 +994,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
988
994
  if (isFreshFork) {
989
995
  return (
990
996
  <ScrollArea className="size-full">
991
- <div className="max-w-4xl mx-auto px-8 py-12 space-y-8">
997
+ <div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8 sm:py-12 space-y-8">
992
998
  <section className="space-y-6">
993
999
  <div className="space-y-3">
994
1000
  <h1 className="text-4xl font-semibold tracking-tight">
@@ -1056,7 +1062,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1056
1062
  if (isCustomizedFork) {
1057
1063
  return (
1058
1064
  <ScrollArea className="size-full">
1059
- <div className="max-w-6xl mx-auto px-8 py-12 space-y-12">
1065
+ <div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8 sm:py-12 space-y-12">
1060
1066
  {/* HERO */}
1061
1067
  <section className="space-y-6">
1062
1068
  <div className="flex items-start gap-5">
@@ -1299,7 +1305,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1299
1305
  <a href="https://github.com/matthewlarn/behavioral-agentic-design-system" className="underline hover:text-foreground">
1300
1306
  BADS
1301
1307
  </a>
1302
- . Components, tokens, and brand voice — all in one system.
1308
+ . Components, tokens, and brand voice, all in one system.
1303
1309
  </p>
1304
1310
  </footer>
1305
1311
  </div>
@@ -1334,7 +1340,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1334
1340
  .home-stagger > *:nth-child(n+9) { animation-delay: 480ms; }
1335
1341
  }
1336
1342
  `}</style>
1337
- <div className="home-stagger max-w-7xl mx-auto px-8 py-12 space-y-16">
1343
+ <div className="home-stagger max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 sm:py-12 space-y-12 sm:space-y-16">
1338
1344
  <BadsUpdateBanner />
1339
1345
  {/* HERO */}
1340
1346
  <section className="space-y-6">
@@ -1353,16 +1359,16 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1353
1359
  </Badge>
1354
1360
  </div>
1355
1361
 
1356
- <div className="flex items-start gap-5">
1357
- <div className="h-16 w-16 rounded-2xl bg-primary flex items-center justify-center shrink-0 shadow-sm text-primary-foreground">
1362
+ <div className="flex items-start gap-4 sm:gap-5">
1363
+ <div className="h-12 w-12 sm:h-16 sm:w-16 rounded-2xl bg-primary flex items-center justify-center shrink-0 shadow-sm text-primary-foreground">
1358
1364
  <BrandMark size={32} />
1359
1365
  </div>
1360
- <div className="space-y-3">
1361
- <h1 className="text-5xl font-semibold tracking-tight">
1366
+ <div className="space-y-3 min-w-0">
1367
+ <h1 className="text-3xl sm:text-4xl lg:text-5xl font-semibold tracking-tight text-balance">
1362
1368
  {brand.name}{" "}
1363
1369
  <span className="text-muted-foreground font-normal">{brand.tagline}</span>
1364
1370
  </h1>
1365
- <p className="text-lg text-muted-foreground max-w-3xl leading-relaxed">
1371
+ <p className="text-base sm:text-lg text-muted-foreground max-w-3xl leading-relaxed">
1366
1372
  A complete, production-ready design system. Tokens, components, brand voice,
1367
1373
  ethics, and accessibility — all wired together so humans and AI can build
1368
1374
  on it without breaking the rules.
@@ -1371,11 +1377,13 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1371
1377
  </div>
1372
1378
 
1373
1379
  <div className="flex items-center gap-2 flex-wrap pt-2">
1374
- <Button size="sm" variant="default" className="gap-2" asChild>
1375
- <a href="#onboard">
1376
- <Wand2 className="h-4 w-4" strokeWidth={1.5} /> Onboard with AI
1377
- </a>
1378
- </Button>
1380
+ {SHOW_ONBOARDING_SECTION && (
1381
+ <Button size="sm" variant="default" className="gap-2" asChild>
1382
+ <a href="#onboard">
1383
+ <Wand2 className="h-4 w-4" strokeWidth={1.5} /> Onboard with AI
1384
+ </a>
1385
+ </Button>
1386
+ )}
1379
1387
  <Button size="sm" variant="outline" className="gap-2" onClick={handleBrowseComponents} type="button">
1380
1388
  <Package className="h-4 w-4" strokeWidth={1.5} /> Browse components
1381
1389
  </Button>
@@ -1424,7 +1432,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1424
1432
  <SectionHeading
1425
1433
  eyebrow="The stack"
1426
1434
  title="Ten layers, all shipped"
1427
- description="A layered architecture where lower layers are the ingredients and higher layers are the recipes. v1 ships everything you need to leave the system in a good place. v2 is gated behind real signals — added only when a real problem asks for them."
1435
+ description="A layered architecture where lower layers are the ingredients and higher layers are the recipes. v1 ships everything you need to leave the system in a good place. v2 is gated behind real signals, added only when a real problem asks for them."
1428
1436
  />
1429
1437
  <div className="space-y-2">
1430
1438
  {SHIPPED_LAYERS.map((layer) => {
@@ -1500,7 +1508,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1500
1508
  <SectionHeading
1501
1509
  eyebrow="Capabilities at a glance"
1502
1510
  title="Everything the system ships, in one read"
1503
- description="Every feature BADS includes — design exploration, persona discipline, components, accessibility, automation, self-improvement loops, sync model. The full discoverable index lives in CAPABILITIES.md; the cards below are the orientation."
1511
+ description="Every feature BADS includes: design exploration, persona discipline, components, accessibility, automation, self-improvement loops, sync model. The full discoverable index lives in CAPABILITIES.md; the cards below are the orientation."
1504
1512
  />
1505
1513
  <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-4">
1506
1514
  {CAPABILITY_SECTIONS.map((section) => {
@@ -1624,23 +1632,27 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1624
1632
  </p>
1625
1633
  </section>
1626
1634
 
1627
- <Separator />
1635
+ {SHOW_ONBOARDING_SECTION && (
1636
+ <>
1637
+ <Separator />
1628
1638
 
1629
- {/* ONBOARD */}
1630
- <section className="space-y-10" id="onboard">
1631
- <SectionHeading
1632
- eyebrow="Quickstart"
1633
- title="Get the design system running"
1634
- description="This is an engineer's guide. Fork the repo, then run the setup flow below. Claude Code will guide you through renaming the fork, importing brand + tokens + components from your product, linting accessibility, and syncing everything to git — pausing for input at each step."
1635
- />
1636
- <CopyablePromptCard
1637
- title="Run the full setup with one prompt"
1638
- description="Copy this prompt, paste it into Claude Code at the repo root. Claude walks you through rename, source discovery, token setup, component registry, and accessibility baseline — committing at each step."
1639
- prompt={SETUP_PROMPT}
1640
- icon={Wand2}
1641
- highlighted
1642
- />
1643
- </section>
1639
+ {/* ONBOARD (hidden for now per Sir 2026-06-04) */}
1640
+ <section className="space-y-10" id="onboard">
1641
+ <SectionHeading
1642
+ eyebrow="Quickstart"
1643
+ title="Get the design system running"
1644
+ description="This is an engineer's guide. Fork the repo, then run the setup flow below. Claude Code will guide you through renaming the fork, importing brand + tokens + components from your product, linting accessibility, and syncing everything to git, pausing for input at each step."
1645
+ />
1646
+ <CopyablePromptCard
1647
+ title="Run the full setup with one prompt"
1648
+ description="Copy this prompt, paste it into Claude Code at the repo root. Claude walks you through rename, source discovery, token setup, component registry, and accessibility baseline, committing at each step."
1649
+ prompt={SETUP_PROMPT}
1650
+ icon={Wand2}
1651
+ highlighted
1652
+ />
1653
+ </section>
1654
+ </>
1655
+ )}
1644
1656
 
1645
1657
  <Separator />
1646
1658
 
@@ -1649,7 +1661,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1649
1661
  <SectionHeading
1650
1662
  eyebrow="Brand snapshot"
1651
1663
  title="The visual identity"
1652
- description="Colors, type, and motion are tokenized — change one file and every component follows."
1664
+ description="Colors, type, and motion are tokenized. Change one file and every component follows."
1653
1665
  />
1654
1666
  <div className="grid md:grid-cols-3 gap-4">
1655
1667
  {/* Color */}
@@ -1687,7 +1699,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1687
1699
  <p className="text-2xl font-semibold leading-none">The quick brown fox</p>
1688
1700
  <p className="text-base">Body text reads at 18px by default for comfort.</p>
1689
1701
  <p className="text-sm font-mono text-muted-foreground">
1690
- Sans · Serif · Mono — all swappable
1702
+ Sans · Serif · Mono, all swappable
1691
1703
  </p>
1692
1704
  </CardContent>
1693
1705
  </Card>
@@ -1724,7 +1736,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1724
1736
  <SectionHeading
1725
1737
  eyebrow="Component library"
1726
1738
  title={`${componentCount} components, registered and documented`}
1727
- description="Every component has a purpose, prop signature, anti-patterns, and a structured a11y contract. Agents pick from this list — they never invent new ones."
1739
+ description="Every component has a purpose, prop signature, anti-patterns, and a structured a11y contract. Agents pick from this list. They never invent new ones."
1728
1740
  />
1729
1741
  <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-4">
1730
1742
  {COMPONENT_GROUPS.map((group) => (
@@ -1829,7 +1841,7 @@ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
1829
1841
  <SectionHeading
1830
1842
  eyebrow="Accessibility"
1831
1843
  title="WCAG 2.2 AAA-ready, enforced at the source"
1832
- description="Accessibility is not a checklist that runs at the end. It's wired into the tokens, the registry, and the pre-commit hooks. Apps built from BADS start at the highest accessibility floor in the industry — they still need their own audit before formally claiming compliance."
1844
+ description="Accessibility is not a checklist that runs at the end. It's wired into the tokens, the registry, and the pre-commit hooks. Apps built from BADS start at the highest accessibility floor in the industry, but they still need their own audit before formally claiming compliance."
1833
1845
  />
1834
1846
  <div className="grid md:grid-cols-2 gap-3">
1835
1847
  {A11Y_COMMITMENTS.map((c) => (
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useEffect, useState } from "react";
4
- import { Loader2, FileText, GitCommit, ChevronRight, Check, AlertCircle, Palette } from "lucide-react";
4
+ import { Loader2, FileText, GitCommit, ChevronRight, ChevronLeft, Check, AlertCircle, Palette } from "lucide-react";
5
5
  import ReactMarkdown, { type Components } from "react-markdown";
6
6
  import remarkGfm from "remark-gfm";
7
7
  import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
@@ -332,8 +332,15 @@ export function LayersTab() {
332
332
 
333
333
  return (
334
334
  <div className="size-full flex motion-safe:animate-in motion-safe:fade-in motion-safe:duration-500">
335
- {/* Sidebar */}
336
- <aside className="w-72 shrink-0 border-r bg-card">
335
+ {/* Sidebar. On mobile this is a master-detail flow: the file tree takes
336
+ the full width until a file is picked, then it's swapped out for the
337
+ editor (which gets a Back control). At md+ both panes show side by
338
+ side as a classic two-column editor. */}
339
+ <aside
340
+ className={`w-full md:w-72 shrink-0 border-r bg-card ${
341
+ activePath ? "hidden md:block" : "block"
342
+ }`}
343
+ >
337
344
  <ScrollArea className="size-full">
338
345
  <div className="p-3 space-y-1">
339
346
  <h2 className="text-sm font-semibold px-2 py-1.5 text-muted-foreground">
@@ -426,7 +433,11 @@ export function LayersTab() {
426
433
  </aside>
427
434
 
428
435
  {/* Editor */}
429
- <section className="flex-1 flex flex-col min-w-0">
436
+ <section
437
+ className={`flex-1 flex-col min-w-0 ${
438
+ activePath ? "flex" : "hidden md:flex"
439
+ }`}
440
+ >
430
441
  {!activePath ? (
431
442
  <div className="flex-1 flex items-center justify-center text-muted-foreground">
432
443
  <div className="text-center">
@@ -436,8 +447,16 @@ export function LayersTab() {
436
447
  </div>
437
448
  ) : (
438
449
  <>
439
- <header className="border-b px-6 py-3 flex items-center justify-between gap-4 shrink-0">
440
- <div className="min-w-0">
450
+ <header className="border-b px-4 sm:px-6 py-3 flex items-center gap-3 sm:gap-4 shrink-0">
451
+ <button
452
+ type="button"
453
+ onClick={() => setActivePath(null)}
454
+ className="md:hidden -ml-1 flex size-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
455
+ aria-label="Back to layer list"
456
+ >
457
+ <ChevronLeft className="h-5 w-5" strokeWidth={1.5} />
458
+ </button>
459
+ <div className="min-w-0 mr-auto">
441
460
  <p className="text-xs text-muted-foreground font-mono truncate">
442
461
  {activePath === SEMANTIC_VIEW ? "packages/core/src/tokens.json → theme" : activePath}
443
462
  </p>
@@ -511,7 +530,7 @@ export function LayersTab() {
511
530
 
512
531
  {fileType === "editable" && (dirty || status !== "idle") && (
513
532
  <div className="fixed bottom-0 left-0 right-0 z-50 border-t bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/80 shadow-lg">
514
- <div className="max-w-7xl mx-auto px-8 py-8 flex items-center gap-4">
533
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 sm:py-8 flex items-center gap-3 sm:gap-4">
515
534
  <GitCommit className="h-4 w-4 text-muted-foreground shrink-0" />
516
535
  <Input
517
536
  value={commitMessage}