@behavioral-agentic-design-system/core 0.14.0 → 0.15.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.
@@ -80,6 +80,7 @@ import {
80
80
  StepperSeparator,
81
81
  } from "@behavioral-agentic-design-system/core/components/ui/stepper";
82
82
  import { PinInput } from "@behavioral-agentic-design-system/core/components/ui/pin-input";
83
+ import { PasswordInput } from "@behavioral-agentic-design-system/core/components/ui/password-input";
83
84
  import { NumberInput } from "@behavioral-agentic-design-system/core/components/ui/number-input";
84
85
  import { FileUpload } from "@behavioral-agentic-design-system/core/components/ui/file-upload";
85
86
  import { Spinner } from "@behavioral-agentic-design-system/core/components/ui/spinner";
@@ -151,13 +152,111 @@ import {
151
152
  } from "@behavioral-agentic-design-system/core/components/ui/hover-card";
152
153
  import { Sparkles, Info, CircleAlert, CalendarIcon, BuildingIcon, CheckIcon, CreditCardIcon, ClipboardCheckIcon, TrophyIcon, UserCheckIcon } from "lucide-react";
153
154
  import { DatePicker } from "@behavioral-agentic-design-system/core/components/ui/date-picker";
155
+ import { DateRangePicker } from "@behavioral-agentic-design-system/core/components/ui/date-range-picker";
154
156
  import { RatingGroup } from "@behavioral-agentic-design-system/core/components/ui/rating-group";
155
157
  import { SegmentedControl, SegmentedControlItem } from "@behavioral-agentic-design-system/core/components/ui/segmented-control";
156
158
  import { Timeline, TimelineItem } from "@behavioral-agentic-design-system/core/components/ui/timeline";
157
159
  import { TagsInput } from "@behavioral-agentic-design-system/core/components/ui/tags-input";
160
+ import { TimePicker } from "@behavioral-agentic-design-system/core/components/ui/time-picker";
158
161
 
159
162
  import { Toaster } from "@behavioral-agentic-design-system/core/components/ui/sonner";
160
163
  import { toast } from "sonner";
164
+ import {
165
+ ChartConfig,
166
+ ChartContainer,
167
+ ChartTooltip,
168
+ ChartTooltipContent,
169
+ } from "@behavioral-agentic-design-system/core/components/ui/chart";
170
+ import {
171
+ Area,
172
+ AreaChart,
173
+ Bar,
174
+ BarChart,
175
+ CartesianGrid,
176
+ Line,
177
+ LineChart,
178
+ Pie,
179
+ PieChart,
180
+ XAxis,
181
+ Label as RLabel,
182
+ } from "recharts";
183
+ import {
184
+ Table,
185
+ TableBody,
186
+ TableCaption,
187
+ TableCell,
188
+ TableFooter,
189
+ TableHead,
190
+ TableHeader,
191
+ TableRow,
192
+ } from "@behavioral-agentic-design-system/core/components/ui/table";
193
+ import {
194
+ Select,
195
+ SelectContent,
196
+ SelectGroup,
197
+ SelectItem,
198
+ SelectLabel,
199
+ SelectTrigger,
200
+ SelectValue,
201
+ } from "@behavioral-agentic-design-system/core/components/ui/select";
202
+ import { Textarea } from "@behavioral-agentic-design-system/core/components/ui/textarea";
203
+ import { Calendar } from "@behavioral-agentic-design-system/core/components/ui/calendar";
204
+ import { Toggle } from "@behavioral-agentic-design-system/core/components/ui/toggle";
205
+ import {
206
+ ToggleGroup,
207
+ ToggleGroupItem,
208
+ } from "@behavioral-agentic-design-system/core/components/ui/toggle-group";
209
+ import {
210
+ Popover,
211
+ PopoverContent,
212
+ PopoverTrigger,
213
+ } from "@behavioral-agentic-design-system/core/components/ui/popover";
214
+ import {
215
+ Tooltip,
216
+ TooltipContent,
217
+ TooltipProvider,
218
+ TooltipTrigger,
219
+ } from "@behavioral-agentic-design-system/core/components/ui/tooltip";
220
+ import {
221
+ DropdownMenu,
222
+ DropdownMenuCheckboxItem,
223
+ DropdownMenuContent,
224
+ DropdownMenuItem,
225
+ DropdownMenuLabel,
226
+ DropdownMenuRadioGroup,
227
+ DropdownMenuRadioItem,
228
+ DropdownMenuSeparator,
229
+ DropdownMenuShortcut,
230
+ DropdownMenuTrigger,
231
+ } from "@behavioral-agentic-design-system/core/components/ui/dropdown-menu";
232
+ import {
233
+ Command,
234
+ CommandEmpty,
235
+ CommandGroup,
236
+ CommandInput,
237
+ CommandItem,
238
+ CommandList,
239
+ CommandSeparator,
240
+ CommandShortcut,
241
+ } from "@behavioral-agentic-design-system/core/components/ui/command";
242
+ import {
243
+ Sheet,
244
+ SheetClose,
245
+ SheetContent,
246
+ SheetDescription,
247
+ SheetFooter,
248
+ SheetHeader,
249
+ SheetTitle,
250
+ SheetTrigger,
251
+ } from "@behavioral-agentic-design-system/core/components/ui/sheet";
252
+ import { TrendingUp, MoreHorizontal, Folder, File, FileText, Settings as SettingsIcon, Users as UsersIcon } from "lucide-react";
253
+ import {
254
+ Tree,
255
+ TreeItem,
256
+ TreeItemTrigger,
257
+ TreeItemContent,
258
+ } from "@behavioral-agentic-design-system/core/components/ui/tree-view";
259
+ import { ColorPicker } from "@behavioral-agentic-design-system/core/components/ui/color-picker";
161
260
 
162
261
  // Stable, deterministic data for ScrollArea — never use Math.random in
163
262
  // SSR-rendered output, it causes hydration mismatches.
@@ -167,6 +266,61 @@ const SCROLL_ITEMS = Array.from({ length: 40 }, (_, i) => ({
167
266
  meta: `entry-${i + 1}`,
168
267
  }));
169
268
 
269
+ // Chart showcase data. Reuses the canonical sample datasets shipped in the
270
+ // cards + dashboard chart examples so the Components tab matches them 1:1.
271
+ const CHART_TREND_DATA = [
272
+ { day: "Mon", today: 240, average: 400 },
273
+ { day: "Tue", today: 139, average: 300 },
274
+ { day: "Wed", today: 480, average: 200 },
275
+ { day: "Thu", today: 390, average: 278 },
276
+ { day: "Fri", today: 480, average: 189 },
277
+ { day: "Sat", today: 380, average: 239 },
278
+ { day: "Sun", today: 430, average: 349 },
279
+ ];
280
+
281
+ const CHART_TREND_CONFIG = {
282
+ today: { label: "Today", color: "var(--chart-1)" },
283
+ average: { label: "Average", color: "var(--chart-2)" },
284
+ } satisfies ChartConfig;
285
+
286
+ const CHART_BROWSER_DATA = [
287
+ { browser: "chrome", visitors: 275, fill: "var(--color-chrome)" },
288
+ { browser: "safari", visitors: 200, fill: "var(--color-safari)" },
289
+ { browser: "firefox", visitors: 187, fill: "var(--color-firefox)" },
290
+ { browser: "edge", visitors: 173, fill: "var(--color-edge)" },
291
+ { browser: "other", visitors: 90, fill: "var(--color-other)" },
292
+ ];
293
+
294
+ const CHART_BROWSER_CONFIG = {
295
+ visitors: { label: "Visitors" },
296
+ chrome: { label: "Chrome", color: "var(--chart-1)" },
297
+ safari: { label: "Safari", color: "var(--chart-2)" },
298
+ firefox: { label: "Firefox", color: "var(--chart-3)" },
299
+ edge: { label: "Edge", color: "var(--chart-4)" },
300
+ other: { label: "Other", color: "var(--chart-5)" },
301
+ } satisfies ChartConfig;
302
+
303
+ const CHART_BROWSER_TOTAL = CHART_BROWSER_DATA.reduce(
304
+ (sum, d) => sum + d.visitors,
305
+ 0
306
+ );
307
+
308
+ function CalendarShowcase() {
309
+ // Deterministic default — never new Date()/Math.random in SSR output.
310
+ const [date, setDate] = React.useState<Date | undefined>(
311
+ new Date("2026-06-25")
312
+ );
313
+ return (
314
+ <Calendar
315
+ mode="single"
316
+ selected={date}
317
+ onSelect={setDate}
318
+ defaultMonth={new Date("2026-06-01")}
319
+ className="rounded-md border"
320
+ />
321
+ );
322
+ }
323
+
170
324
  function Section({ title, children }: { title: string; children: React.ReactNode }) {
171
325
  const id = title
172
326
  .toLowerCase()
@@ -375,6 +529,47 @@ export default function ComponentsPreview() {
375
529
  </div>
376
530
  </Section>
377
531
 
532
+ <Section title="Password Input">
533
+ <div className="grid gap-4 sm:grid-cols-2">
534
+ <div className="space-y-2">
535
+ <Label htmlFor="pw-sm">sm</Label>
536
+ <PasswordInput id="pw-sm" size="sm" placeholder="Small" />
537
+ </div>
538
+ <div className="space-y-2">
539
+ <Label htmlFor="pw-default">default</Label>
540
+ <PasswordInput id="pw-default" placeholder="Default" />
541
+ </div>
542
+ <div className="space-y-2">
543
+ <Label htmlFor="pw-lg">lg</Label>
544
+ <PasswordInput id="pw-lg" size="lg" placeholder="Large" />
545
+ </div>
546
+ <div className="space-y-2">
547
+ <Label htmlFor="pw-xl">xl</Label>
548
+ <PasswordInput id="pw-xl" size="xl" placeholder="Extra large" />
549
+ </div>
550
+ <div className="space-y-2">
551
+ <Label htmlFor="pw-disabled">Disabled</Label>
552
+ <PasswordInput id="pw-disabled" size="xl" disabled placeholder="Disabled" />
553
+ </div>
554
+ <div className="space-y-2">
555
+ <Label htmlFor="pw-invalid">Invalid</Label>
556
+ <PasswordInput id="pw-invalid" size="xl" aria-invalid placeholder="Invalid" />
557
+ </div>
558
+ </div>
559
+ <div className="w-80 space-y-1.5">
560
+ <Label htmlFor="pw-realistic">Current password</Label>
561
+ <PasswordInput
562
+ id="pw-realistic"
563
+ autoComplete="current-password"
564
+ size="xl"
565
+ placeholder="Enter your password"
566
+ />
567
+ <p className="text-xs text-muted-foreground">
568
+ Click the eye icon to reveal.
569
+ </p>
570
+ </div>
571
+ </Section>
572
+
378
573
  <Section title="Form controls">
379
574
  <div className="flex flex-wrap items-center gap-6">
380
575
  <div className="flex items-center gap-2">
@@ -1487,7 +1682,7 @@ export default function ComponentsPreview() {
1487
1682
  </div>
1488
1683
  <div className="space-y-2">
1489
1684
  <p className="text-sm font-medium text-muted-foreground">Keyboard shortcuts list</p>
1490
- <div className="w-[320px] space-y-2 rounded-lg border bg-card p-4">
1685
+ <Card className="w-[320px]"><CardContent className="p-4 space-y-2">
1491
1686
  {[
1492
1687
  { keys: ["⌘", "K"], label: "Open command palette" },
1493
1688
  { keys: ["⌘", "Shift", "F"], label: "Search across files" },
@@ -1503,7 +1698,7 @@ export default function ComponentsPreview() {
1503
1698
  </div>
1504
1699
  </div>
1505
1700
  ))}
1506
- </div>
1701
+ </CardContent></Card>
1507
1702
  </div>
1508
1703
  </div>
1509
1704
  </Section>
@@ -1633,6 +1828,79 @@ export default function ComponentsPreview() {
1633
1828
  </div>
1634
1829
  </Section>
1635
1830
 
1831
+ <Section title="TimePicker">
1832
+ <div className="space-y-6">
1833
+ <div className="space-y-3">
1834
+ <p className="text-sm text-muted-foreground font-medium">Sizes</p>
1835
+ <div className="flex flex-col gap-3 max-w-xs">
1836
+ <TimePicker value="08:00" size="sm" />
1837
+ <TimePicker value="08:00" size="default" />
1838
+ <TimePicker value="08:00" size="lg" />
1839
+ </div>
1840
+ </div>
1841
+ <div className="space-y-3">
1842
+ <p className="text-sm text-muted-foreground font-medium">12-hour mode with clear</p>
1843
+ <div className="max-w-xs">
1844
+ <TimePicker value="14:30" hours12 clearable />
1845
+ </div>
1846
+ </div>
1847
+ <div className="space-y-3">
1848
+ <p className="text-sm text-muted-foreground font-medium">With seconds</p>
1849
+ <div className="max-w-xs">
1850
+ <TimePicker value="09:30:00" showSeconds clearable />
1851
+ </div>
1852
+ </div>
1853
+ <div className="space-y-3">
1854
+ <p className="text-sm text-muted-foreground font-medium">Disabled</p>
1855
+ <div className="max-w-xs">
1856
+ <TimePicker value="09:30" disabled />
1857
+ </div>
1858
+ </div>
1859
+ </div>
1860
+ </Section>
1861
+
1862
+ <Section title="DateRangePicker">
1863
+ <div className="space-y-6">
1864
+ <div className="space-y-3">
1865
+ <p className="text-sm font-medium text-muted-foreground">With range selected</p>
1866
+ <div className="max-w-md">
1867
+ <DateRangePicker
1868
+ value={{ from: new Date(2026, 5, 1), to: new Date(2026, 5, 15) }}
1869
+ onValueChange={() => {}}
1870
+ clearable
1871
+ />
1872
+ </div>
1873
+ </div>
1874
+ <div className="space-y-3">
1875
+ <p className="text-sm font-medium text-muted-foreground">Sizes</p>
1876
+ <div className="flex flex-col gap-3 max-w-md">
1877
+ <DateRangePicker
1878
+ value={{ from: new Date(2026, 5, 1), to: new Date(2026, 5, 15) }}
1879
+ size="sm"
1880
+ />
1881
+ <DateRangePicker
1882
+ value={{ from: new Date(2026, 5, 1), to: new Date(2026, 5, 15) }}
1883
+ size="default"
1884
+ />
1885
+ <DateRangePicker
1886
+ value={{ from: new Date(2026, 5, 1), to: new Date(2026, 5, 15) }}
1887
+ size="lg"
1888
+ />
1889
+ </div>
1890
+ </div>
1891
+ <div className="space-y-3">
1892
+ <p className="text-sm font-medium text-muted-foreground">Empty / Disabled</p>
1893
+ <div className="flex flex-col gap-3 max-w-md">
1894
+ <DateRangePicker />
1895
+ <DateRangePicker
1896
+ value={{ from: new Date(2026, 5, 1), to: new Date(2026, 5, 15) }}
1897
+ disabled
1898
+ />
1899
+ </div>
1900
+ </div>
1901
+ </div>
1902
+ </Section>
1903
+
1636
1904
  <Section title="Rating Group">
1637
1905
  <div className="space-y-6">
1638
1906
  <div className="space-y-3">
@@ -1744,6 +2012,477 @@ export default function ComponentsPreview() {
1744
2012
  </div>
1745
2013
  </div>
1746
2014
  </Section>
2015
+
2016
+ <Section title="Chart">
2017
+ <p className="text-sm text-muted-foreground">
2018
+ Recharts wrapped in{" "}
2019
+ <code className="font-mono text-xs">ChartContainer</code> — series
2020
+ colors come from the{" "}
2021
+ <code className="font-mono text-xs">--chart-1…5</code> tokens,
2022
+ tooltips are token-styled, and the entrance animation auto-disables
2023
+ under <code className="font-mono text-xs">prefers-reduced-motion</code>.
2024
+ </p>
2025
+ <div className="grid gap-6 sm:grid-cols-2">
2026
+ <div className="space-y-3">
2027
+ <p className="text-sm font-medium text-muted-foreground">Line</p>
2028
+ <ChartContainer config={CHART_TREND_CONFIG} className="h-[200px] w-full">
2029
+ <LineChart accessibilityLayer data={CHART_TREND_DATA} margin={{ top: 5, right: 10, left: 12, bottom: 0 }}>
2030
+ <CartesianGrid vertical={false} />
2031
+ <XAxis dataKey="day" tickLine={false} axisLine={false} tickMargin={8} />
2032
+ <ChartTooltip content={<ChartTooltipContent />} />
2033
+ <Line type="monotone" dataKey="today" stroke="var(--color-today)" strokeWidth={2} dot={{ fill: "var(--color-today)" }} activeDot={{ r: 5 }} />
2034
+ <Line type="monotone" dataKey="average" stroke="var(--color-average)" strokeWidth={2} strokeOpacity={0.5} dot={{ fill: "var(--color-average)", opacity: 0.5 }} activeDot={{ r: 5 }} />
2035
+ </LineChart>
2036
+ </ChartContainer>
2037
+ </div>
2038
+ <div className="space-y-3">
2039
+ <p className="text-sm font-medium text-muted-foreground">Area</p>
2040
+ <ChartContainer config={CHART_TREND_CONFIG} className="h-[200px] w-full">
2041
+ <AreaChart accessibilityLayer data={CHART_TREND_DATA} margin={{ top: 5, right: 10, left: 12, bottom: 0 }}>
2042
+ <CartesianGrid vertical={false} />
2043
+ <XAxis dataKey="day" tickLine={false} axisLine={false} tickMargin={8} />
2044
+ <ChartTooltip content={<ChartTooltipContent />} />
2045
+ <Area type="monotone" dataKey="average" stroke="var(--color-average)" fill="var(--color-average)" fillOpacity={0.1} strokeWidth={2} />
2046
+ <Area type="monotone" dataKey="today" stroke="var(--color-today)" fill="var(--color-today)" fillOpacity={0.12} strokeWidth={2} />
2047
+ </AreaChart>
2048
+ </ChartContainer>
2049
+ </div>
2050
+ <div className="space-y-3">
2051
+ <p className="text-sm font-medium text-muted-foreground">Bar</p>
2052
+ <ChartContainer config={CHART_BROWSER_CONFIG} className="h-[200px] w-full">
2053
+ <BarChart accessibilityLayer data={CHART_BROWSER_DATA} margin={{ top: 5, right: 10, left: 0, bottom: 0 }}>
2054
+ <CartesianGrid vertical={false} />
2055
+ <XAxis
2056
+ dataKey="browser"
2057
+ tickLine={false}
2058
+ axisLine={false}
2059
+ tickMargin={8}
2060
+ tickFormatter={(v) => CHART_BROWSER_CONFIG[v as keyof typeof CHART_BROWSER_CONFIG]?.label as string}
2061
+ />
2062
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
2063
+ <Bar dataKey="visitors" radius={6} />
2064
+ </BarChart>
2065
+ </ChartContainer>
2066
+ </div>
2067
+ <div className="space-y-3">
2068
+ <p className="text-sm font-medium text-muted-foreground">Pie (donut)</p>
2069
+ <ChartContainer config={CHART_BROWSER_CONFIG} className="mx-auto aspect-square h-[200px]">
2070
+ <PieChart>
2071
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
2072
+ <Pie data={CHART_BROWSER_DATA} dataKey="visitors" nameKey="browser" innerRadius={50} strokeWidth={5}>
2073
+ <RLabel
2074
+ content={({ viewBox }) => {
2075
+ if (viewBox && "cx" in viewBox && "cy" in viewBox) {
2076
+ return (
2077
+ <text x={viewBox.cx} y={viewBox.cy} textAnchor="middle" dominantBaseline="middle">
2078
+ <tspan x={viewBox.cx} y={viewBox.cy} className="fill-foreground text-2xl font-bold">
2079
+ {CHART_BROWSER_TOTAL.toLocaleString()}
2080
+ </tspan>
2081
+ <tspan x={viewBox.cx} y={(viewBox.cy || 0) + 20} className="fill-muted-foreground">
2082
+ Visitors
2083
+ </tspan>
2084
+ </text>
2085
+ );
2086
+ }
2087
+ }}
2088
+ />
2089
+ </Pie>
2090
+ </PieChart>
2091
+ </ChartContainer>
2092
+ </div>
2093
+ </div>
2094
+ </Section>
2095
+
2096
+ <Section title="Table">
2097
+ <Table>
2098
+ <TableCaption>Breezy Hills Aquatic Club — 100m Freestyle finals</TableCaption>
2099
+ <TableHeader>
2100
+ <TableRow>
2101
+ <TableHead className="w-12">Place</TableHead>
2102
+ <TableHead>Swimmer</TableHead>
2103
+ <TableHead>Squad</TableHead>
2104
+ <TableHead className="text-right">Time</TableHead>
2105
+ </TableRow>
2106
+ </TableHeader>
2107
+ <TableBody>
2108
+ {[
2109
+ { place: 1, name: "Avery Castillo", squad: "Senior A", time: "52.18" },
2110
+ { place: 2, name: "Noah Kim", squad: "Senior A", time: "52.94" },
2111
+ { place: 3, name: "Priya Raman", squad: "Senior B", time: "53.40" },
2112
+ { place: 4, name: "Liam O'Connor", squad: "Senior B", time: "54.07" },
2113
+ ].map((r) => (
2114
+ <TableRow key={r.place}>
2115
+ <TableCell className="font-medium tabular-nums">{r.place}</TableCell>
2116
+ <TableCell>{r.name}</TableCell>
2117
+ <TableCell className="text-muted-foreground">{r.squad}</TableCell>
2118
+ <TableCell className="text-right font-mono tabular-nums">{r.time}</TableCell>
2119
+ </TableRow>
2120
+ ))}
2121
+ </TableBody>
2122
+ <TableFooter>
2123
+ <TableRow>
2124
+ <TableCell colSpan={3}>Heat average</TableCell>
2125
+ <TableCell className="text-right font-mono tabular-nums">53.15</TableCell>
2126
+ </TableRow>
2127
+ </TableFooter>
2128
+ </Table>
2129
+ </Section>
2130
+
2131
+ <Section title="Calendar">
2132
+ <div className="flex flex-wrap gap-6">
2133
+ <CalendarShowcase />
2134
+ </div>
2135
+ </Section>
2136
+
2137
+ <Section title="Select">
2138
+ <div className="grid gap-6 sm:grid-cols-2">
2139
+ <div className="space-y-2">
2140
+ <Label htmlFor="select-squad">Squad</Label>
2141
+ <Select defaultValue="senior-a">
2142
+ <SelectTrigger id="select-squad" className="w-full">
2143
+ <SelectValue placeholder="Choose a squad" />
2144
+ </SelectTrigger>
2145
+ <SelectContent>
2146
+ <SelectGroup>
2147
+ <SelectLabel>Senior</SelectLabel>
2148
+ <SelectItem value="senior-a">Senior A</SelectItem>
2149
+ <SelectItem value="senior-b">Senior B</SelectItem>
2150
+ </SelectGroup>
2151
+ <SelectGroup>
2152
+ <SelectLabel>Age group</SelectLabel>
2153
+ <SelectItem value="junior-a">Junior A</SelectItem>
2154
+ <SelectItem value="junior-b">Junior B</SelectItem>
2155
+ <SelectItem value="dev" disabled>Development (full)</SelectItem>
2156
+ </SelectGroup>
2157
+ </SelectContent>
2158
+ </Select>
2159
+ </div>
2160
+ <div className="space-y-2">
2161
+ <Label htmlFor="select-stroke">Stroke (disabled)</Label>
2162
+ <Select disabled>
2163
+ <SelectTrigger id="select-stroke" className="w-full">
2164
+ <SelectValue placeholder="Locked for this event" />
2165
+ </SelectTrigger>
2166
+ <SelectContent>
2167
+ <SelectItem value="free">Freestyle</SelectItem>
2168
+ </SelectContent>
2169
+ </Select>
2170
+ </div>
2171
+ </div>
2172
+ </Section>
2173
+
2174
+ <Section title="Textarea">
2175
+ <div className="grid gap-6 sm:grid-cols-2">
2176
+ <div className="space-y-2">
2177
+ <Label htmlFor="ta-notes">Coach notes</Label>
2178
+ <Textarea id="ta-notes" placeholder="Add notes for this swimmer…" />
2179
+ </div>
2180
+ <div className="space-y-2">
2181
+ <Label htmlFor="ta-filled">With value</Label>
2182
+ <Textarea
2183
+ id="ta-filled"
2184
+ defaultValue={"Strong back half. Work on streamline off the wall and breakout timing."}
2185
+ />
2186
+ </div>
2187
+ <div className="space-y-2">
2188
+ <Label htmlFor="ta-disabled">Disabled</Label>
2189
+ <Textarea id="ta-disabled" disabled placeholder="Locked during the meet" />
2190
+ </div>
2191
+ <div className="space-y-2">
2192
+ <Label htmlFor="ta-invalid">Invalid</Label>
2193
+ <Textarea id="ta-invalid" aria-invalid defaultValue="Too short" />
2194
+ </div>
2195
+ </div>
2196
+ </Section>
2197
+
2198
+ <Section title="Toggle &amp; Toggle Group">
2199
+ <div className="space-y-6">
2200
+ <div className="space-y-3">
2201
+ <p className="text-sm font-medium text-muted-foreground">Toggle — standalone</p>
2202
+ <div className="flex items-center gap-3">
2203
+ <Toggle aria-label="Bold" defaultPressed><BoldIcon className="size-4" strokeWidth={1.5} /></Toggle>
2204
+ <Toggle aria-label="Italic"><ItalicIcon className="size-4" strokeWidth={1.5} /></Toggle>
2205
+ <Toggle aria-label="Underline" variant="outline"><UnderlineIcon className="size-4" strokeWidth={1.5} /></Toggle>
2206
+ <Toggle aria-label="Bold disabled" disabled><BoldIcon className="size-4" strokeWidth={1.5} /></Toggle>
2207
+ </div>
2208
+ </div>
2209
+ <div className="space-y-3">
2210
+ <p className="text-sm font-medium text-muted-foreground">Toggle group — single select (alignment)</p>
2211
+ <ToggleGroup type="single" defaultValue="left" variant="outline" aria-label="Text alignment">
2212
+ <ToggleGroupItem value="left" aria-label="Align left"><AlignLeftIcon className="size-4" strokeWidth={1.5} /></ToggleGroupItem>
2213
+ <ToggleGroupItem value="center" aria-label="Align center"><AlignCenterIcon className="size-4" strokeWidth={1.5} /></ToggleGroupItem>
2214
+ <ToggleGroupItem value="right" aria-label="Align right"><AlignRightIcon className="size-4" strokeWidth={1.5} /></ToggleGroupItem>
2215
+ </ToggleGroup>
2216
+ </div>
2217
+ <div className="space-y-3">
2218
+ <p className="text-sm font-medium text-muted-foreground">Toggle group — multiple select (formatting)</p>
2219
+ <ToggleGroup type="multiple" defaultValue={["bold"]} variant="outline" aria-label="Text formatting">
2220
+ <ToggleGroupItem value="bold" aria-label="Bold"><BoldIcon className="size-4" strokeWidth={1.5} /></ToggleGroupItem>
2221
+ <ToggleGroupItem value="italic" aria-label="Italic"><ItalicIcon className="size-4" strokeWidth={1.5} /></ToggleGroupItem>
2222
+ <ToggleGroupItem value="underline" aria-label="Underline"><UnderlineIcon className="size-4" strokeWidth={1.5} /></ToggleGroupItem>
2223
+ </ToggleGroup>
2224
+ </div>
2225
+ </div>
2226
+ </Section>
2227
+
2228
+ <Section title="Popover">
2229
+ <div className="flex flex-wrap gap-3">
2230
+ <Popover>
2231
+ <PopoverTrigger asChild>
2232
+ <Button variant="outline">Lane settings</Button>
2233
+ </PopoverTrigger>
2234
+ <PopoverContent className="w-72">
2235
+ <div className="space-y-3">
2236
+ <div className="space-y-1">
2237
+ <p className="text-sm font-semibold">Lane settings</p>
2238
+ <p className="text-xs text-muted-foreground">Applies to this heat only.</p>
2239
+ </div>
2240
+ <div className="flex items-center justify-between">
2241
+ <Label htmlFor="pop-pace">Pace clock</Label>
2242
+ <Switch id="pop-pace" defaultChecked />
2243
+ </div>
2244
+ <div className="space-y-1.5">
2245
+ <Label htmlFor="pop-lanes">Lanes</Label>
2246
+ <Input id="pop-lanes" defaultValue="8" />
2247
+ </div>
2248
+ </div>
2249
+ </PopoverContent>
2250
+ </Popover>
2251
+ </div>
2252
+ </Section>
2253
+
2254
+ <Section title="Tooltip">
2255
+ <TooltipProvider>
2256
+ <div className="flex flex-wrap items-center gap-3">
2257
+ <Tooltip>
2258
+ <TooltipTrigger asChild>
2259
+ <Button variant="outline">Seed time</Button>
2260
+ </TooltipTrigger>
2261
+ <TooltipContent>52.18 — submitted Jun 20</TooltipContent>
2262
+ </Tooltip>
2263
+ <Tooltip>
2264
+ <TooltipTrigger asChild>
2265
+ <Button variant="outline">Status</Button>
2266
+ </TooltipTrigger>
2267
+ <TooltipContent side="right">Unofficial until ratified</TooltipContent>
2268
+ </Tooltip>
2269
+ </div>
2270
+ </TooltipProvider>
2271
+ </Section>
2272
+
2273
+ <Section title="Dropdown Menu">
2274
+ <DropdownMenu>
2275
+ <DropdownMenuTrigger asChild>
2276
+ <Button variant="outline" className="gap-2">
2277
+ Actions <MoreHorizontal className="size-4" strokeWidth={1.5} />
2278
+ </Button>
2279
+ </DropdownMenuTrigger>
2280
+ <DropdownMenuContent align="start" className="w-56">
2281
+ <DropdownMenuLabel>Heat 4 · Lane 4</DropdownMenuLabel>
2282
+ <DropdownMenuSeparator />
2283
+ <DropdownMenuItem>
2284
+ Edit seed time <DropdownMenuShortcut>⌘E</DropdownMenuShortcut>
2285
+ </DropdownMenuItem>
2286
+ <DropdownMenuItem>Move to heat…</DropdownMenuItem>
2287
+ <DropdownMenuSeparator />
2288
+ <DropdownMenuLabel>Display</DropdownMenuLabel>
2289
+ <DropdownMenuCheckboxItem checked>Show splits</DropdownMenuCheckboxItem>
2290
+ <DropdownMenuCheckboxItem>Show reaction time</DropdownMenuCheckboxItem>
2291
+ <DropdownMenuSeparator />
2292
+ <DropdownMenuRadioGroup value="time">
2293
+ <DropdownMenuRadioItem value="time">Sort by time</DropdownMenuRadioItem>
2294
+ <DropdownMenuRadioItem value="name">Sort by name</DropdownMenuRadioItem>
2295
+ </DropdownMenuRadioGroup>
2296
+ <DropdownMenuSeparator />
2297
+ <DropdownMenuItem variant="destructive">Scratch swimmer</DropdownMenuItem>
2298
+ </DropdownMenuContent>
2299
+ </DropdownMenu>
2300
+ </Section>
2301
+
2302
+ <Section title="Command">
2303
+ <p className="text-sm text-muted-foreground">
2304
+ The command primitive (cmdk) as an inline menu. BADS treats it as a
2305
+ power-user accelerator on top of a designed search surface, not the
2306
+ default search affordance.
2307
+ </p>
2308
+ <Command className="max-w-md rounded-lg border shadow-sm">
2309
+ <CommandInput placeholder="Type a command or search…" />
2310
+ <CommandList>
2311
+ <CommandEmpty>No results found.</CommandEmpty>
2312
+ <CommandGroup heading="Sessions">
2313
+ <CommandItem>
2314
+ Practice today <CommandShortcut>⌘1</CommandShortcut>
2315
+ </CommandItem>
2316
+ <CommandItem>Upcoming meets</CommandItem>
2317
+ <CommandItem>Attendance</CommandItem>
2318
+ </CommandGroup>
2319
+ <CommandSeparator />
2320
+ <CommandGroup heading="Swimmers">
2321
+ <CommandItem>Avery Castillo</CommandItem>
2322
+ <CommandItem>Noah Kim</CommandItem>
2323
+ <CommandItem>Priya Raman</CommandItem>
2324
+ </CommandGroup>
2325
+ </CommandList>
2326
+ </Command>
2327
+ </Section>
2328
+
2329
+ <Section title="Sheet">
2330
+ <div className="flex flex-wrap gap-3">
2331
+ {(["right", "left", "top", "bottom"] as const).map((side) => (
2332
+ <Sheet key={side}>
2333
+ <SheetTrigger asChild>
2334
+ <Button variant="outline">From {side}</Button>
2335
+ </SheetTrigger>
2336
+ <SheetContent side={side}>
2337
+ <SheetHeader>
2338
+ <SheetTitle>Heat details</SheetTitle>
2339
+ <SheetDescription>
2340
+ Edit lane assignments and seed times for Heat 4.
2341
+ </SheetDescription>
2342
+ </SheetHeader>
2343
+ <div className="flex flex-col gap-4 px-4">
2344
+ <div className="space-y-1.5">
2345
+ <Label htmlFor={`sheet-seed-${side}`}>Seed time</Label>
2346
+ <Input id={`sheet-seed-${side}`} defaultValue="52.18" />
2347
+ </div>
2348
+ <div className="space-y-1.5">
2349
+ <Label htmlFor={`sheet-lane-${side}`}>Lane</Label>
2350
+ <Input id={`sheet-lane-${side}`} defaultValue="4" />
2351
+ </div>
2352
+ </div>
2353
+ <SheetFooter className="flex-row justify-end gap-2">
2354
+ <SheetClose asChild><Button variant="ghost">Cancel</Button></SheetClose>
2355
+ <SheetClose asChild><Button>Save</Button></SheetClose>
2356
+ </SheetFooter>
2357
+ </SheetContent>
2358
+ </Sheet>
2359
+ ))}
2360
+ </div>
2361
+ </Section>
2362
+
2363
+ <Section title="Tree View">
2364
+ <div className="flex flex-wrap gap-6 items-start">
2365
+ <div className="w-60">
2366
+ <p className="mb-2 text-xs font-medium text-muted-foreground">Default</p>
2367
+ <Tree defaultExpanded={["docs"]}>
2368
+ <TreeItem id="src">
2369
+ <TreeItemTrigger>src</TreeItemTrigger>
2370
+ <TreeItemContent>
2371
+ <TreeItem id="components">
2372
+ <TreeItemTrigger>components</TreeItemTrigger>
2373
+ <TreeItemContent>
2374
+ <TreeItem id="button"><TreeItemTrigger>Button.tsx</TreeItemTrigger></TreeItem>
2375
+ <TreeItem id="input"><TreeItemTrigger>Input.tsx</TreeItemTrigger></TreeItem>
2376
+ </TreeItemContent>
2377
+ </TreeItem>
2378
+ <TreeItem id="pages">
2379
+ <TreeItemTrigger>pages</TreeItemTrigger>
2380
+ <TreeItemContent>
2381
+ <TreeItem id="index"><TreeItemTrigger>index.tsx</TreeItemTrigger></TreeItem>
2382
+ </TreeItemContent>
2383
+ </TreeItem>
2384
+ </TreeItemContent>
2385
+ </TreeItem>
2386
+ <TreeItem id="docs">
2387
+ <TreeItemTrigger>docs</TreeItemTrigger>
2388
+ <TreeItemContent>
2389
+ <TreeItem id="readme"><TreeItemTrigger>README.md</TreeItemTrigger></TreeItem>
2390
+ </TreeItemContent>
2391
+ </TreeItem>
2392
+ <TreeItem id="pkg"><TreeItemTrigger>package.json</TreeItemTrigger></TreeItem>
2393
+ </Tree>
2394
+ </div>
2395
+ <div className="w-64">
2396
+ <p className="mb-2 text-xs font-medium text-muted-foreground">With icons</p>
2397
+ <Tree defaultExpanded={["project", "assets"]}>
2398
+ <TreeItem id="project">
2399
+ <TreeItemTrigger icon={<Folder strokeWidth={1.5} />}>Project</TreeItemTrigger>
2400
+ <TreeItemContent>
2401
+ <TreeItem id="assets">
2402
+ <TreeItemTrigger icon={<Folder strokeWidth={1.5} />}>Assets</TreeItemTrigger>
2403
+ <TreeItemContent>
2404
+ <TreeItem id="logo"><TreeItemTrigger icon={<File strokeWidth={1.5} />}>logo.svg</TreeItemTrigger></TreeItem>
2405
+ <TreeItem id="notes"><TreeItemTrigger icon={<FileText strokeWidth={1.5} />}>notes.md</TreeItemTrigger></TreeItem>
2406
+ </TreeItemContent>
2407
+ </TreeItem>
2408
+ <TreeItem id="cfg"><TreeItemTrigger icon={<SettingsIcon strokeWidth={1.5} />}>config.json</TreeItemTrigger></TreeItem>
2409
+ </TreeItemContent>
2410
+ </TreeItem>
2411
+ </Tree>
2412
+ </div>
2413
+ <Card className="w-72 p-3">
2414
+ <p className="mb-2 px-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground">BADS Design System</p>
2415
+ <Tree defaultExpanded={["layer-1"]} aria-label="BADS file browser">
2416
+ <TreeItem id="layer-1">
2417
+ <TreeItemTrigger icon={<Folder strokeWidth={1.5} />}>layer-1-foundation</TreeItemTrigger>
2418
+ <TreeItemContent>
2419
+ <TreeItem id="manifest"><TreeItemTrigger icon={<File strokeWidth={1.5} />}>manifest.json</TreeItemTrigger></TreeItem>
2420
+ <TreeItem id="voice"><TreeItemTrigger icon={<FileText strokeWidth={1.5} />}>voice-and-tone.md</TreeItemTrigger></TreeItem>
2421
+ <TreeItem id="personas"><TreeItemTrigger icon={<FileText strokeWidth={1.5} />}>personas.md</TreeItemTrigger></TreeItem>
2422
+ </TreeItemContent>
2423
+ </TreeItem>
2424
+ <TreeItem id="layer-5">
2425
+ <TreeItemTrigger icon={<Folder strokeWidth={1.5} />}>layer-5-component-registry</TreeItemTrigger>
2426
+ <TreeItemContent>
2427
+ <TreeItem id="registry"><TreeItemTrigger icon={<File strokeWidth={1.5} />}>component-registry.json</TreeItemTrigger></TreeItem>
2428
+ </TreeItemContent>
2429
+ </TreeItem>
2430
+ <TreeItem id="packages">
2431
+ <TreeItemTrigger icon={<Folder strokeWidth={1.5} />}>packages</TreeItemTrigger>
2432
+ <TreeItemContent>
2433
+ <TreeItem id="core-dir">
2434
+ <TreeItemTrigger icon={<Folder strokeWidth={1.5} />}>core</TreeItemTrigger>
2435
+ <TreeItemContent>
2436
+ <TreeItem id="tokens"><TreeItemTrigger icon={<File strokeWidth={1.5} />}>tokens.json</TreeItemTrigger></TreeItem>
2437
+ </TreeItemContent>
2438
+ </TreeItem>
2439
+ </TreeItemContent>
2440
+ </TreeItem>
2441
+ <TreeItem id="claude-md"><TreeItemTrigger icon={<FileText strokeWidth={1.5} />}>CLAUDE.md</TreeItemTrigger></TreeItem>
2442
+ </Tree>
2443
+ </Card>
2444
+ </div>
2445
+ </Section>
2446
+
2447
+ <Section title="Color Picker">
2448
+ <div className="flex flex-wrap gap-8 items-start">
2449
+ <div className="space-y-1.5">
2450
+ <p className="text-xs font-medium text-muted-foreground">Swatches</p>
2451
+ <ColorPicker
2452
+ swatches={[
2453
+ "#ef4444", "#f97316", "#eab308", "#22c55e",
2454
+ "#06b6d4", "#3b82f6", "#8b5cf6", "#ec4899",
2455
+ "#64748b", "#1e293b",
2456
+ ]}
2457
+ aria-label="Select a color"
2458
+ />
2459
+ </div>
2460
+ <div className="space-y-1.5">
2461
+ <p className="text-xs font-medium text-muted-foreground">With custom hex input</p>
2462
+ <ColorPicker
2463
+ swatches={[
2464
+ "#ef4444", "#f97316", "#eab308", "#22c55e",
2465
+ "#06b6d4", "#3b82f6", "#8b5cf6", "#ec4899",
2466
+ ]}
2467
+ allowCustom
2468
+ defaultValue="#3b82f6"
2469
+ aria-label="Select or enter a color"
2470
+ />
2471
+ </div>
2472
+ <div className="space-y-1.5">
2473
+ <p className="text-xs font-medium text-muted-foreground">Disabled</p>
2474
+ <ColorPicker
2475
+ swatches={[
2476
+ "#ef4444", "#f97316", "#eab308", "#22c55e",
2477
+ "#06b6d4", "#3b82f6", "#8b5cf6", "#ec4899",
2478
+ ]}
2479
+ defaultValue="#3b82f6"
2480
+ disabled
2481
+ aria-label="Color (disabled)"
2482
+ />
2483
+ </div>
2484
+ </div>
2485
+ </Section>
1747
2486
  </div>
1748
2487
  </div>
1749
2488
  );
@@ -1776,7 +2515,7 @@ function DatePickerScheduleForm() {
1776
2515
  const [startDate, setStartDate] = React.useState<Date | undefined>(undefined);
1777
2516
  const [endDate, setEndDate] = React.useState<Date | undefined>(undefined);
1778
2517
  return (
1779
- <div className="w-80 space-y-4 rounded-lg border border-border bg-card p-4">
2518
+ <Card className="w-80"><CardContent className="p-4 space-y-4">
1780
2519
  <div className="space-y-1">
1781
2520
  <p className="text-sm font-semibold">Schedule practice block</p>
1782
2521
  <p className="text-xs text-muted-foreground">
@@ -1809,7 +2548,7 @@ function DatePickerScheduleForm() {
1809
2548
  <Button variant="outline" size="sm" className="min-h-11">Cancel</Button>
1810
2549
  <Button size="sm" className="min-h-11">Schedule</Button>
1811
2550
  </div>
1812
- </div>
2551
+ </CardContent></Card>
1813
2552
  );
1814
2553
  }
1815
2554
 
@@ -1936,7 +2675,7 @@ function RatingGroupFeedbackDemo() {
1936
2675
  const [submitted, setSubmitted] = React.useState(false);
1937
2676
  const labels = ["", "Needs work", "Below average", "Average", "Good", "Excellent"];
1938
2677
  return (
1939
- <div className="w-72 rounded-lg border border-border bg-card p-4 space-y-4">
2678
+ <Card className="w-72"><CardContent className="p-4 space-y-4">
1940
2679
  <div className="space-y-1">
1941
2680
  <p className="text-sm font-semibold">Rate your practice session</p>
1942
2681
  <p className="text-xs text-muted-foreground">Breezy Hills Aquatic Club · Tuesday AM</p>
@@ -1964,7 +2703,7 @@ function RatingGroupFeedbackDemo() {
1964
2703
  </Button>
1965
2704
  </div>
1966
2705
  )}
1967
- </div>
2706
+ </CardContent></Card>
1968
2707
  );
1969
2708
  }
1970
2709