@behavioral-agentic-design-system/core 0.15.0 → 0.17.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 +8 -2
- package/scripts/a11y-lint.cjs +229 -0
- package/scripts/build-tokens.cjs +3 -3
- package/scripts/check-stories.mjs +109 -0
- package/scripts/fix-stories.mjs +785 -0
- package/scripts/generate-stories.cjs +101 -0
- package/scripts/oklch-to-hex.cjs +156 -0
- package/scripts/wcag-audit.cjs +444 -0
- package/src/app/preview/components/page.tsx +538 -51
- package/src/components/dev-identity-badge.tsx +1 -1
- package/src/components/ui/button-group.tsx +57 -0
- package/src/components/ui/calendar.tsx +4 -0
- package/src/components/ui/circular-progress.tsx +120 -0
- package/src/components/ui/code.tsx +55 -0
- package/src/components/ui/copy-button.tsx +114 -0
- package/src/components/ui/empty-state.tsx +115 -0
- package/src/components/ui/index.ts +0 -1
- package/src/components/ui/indicator.tsx +146 -0
- package/src/components/ui/list.tsx +70 -0
- package/src/components/ui/multi-select.tsx +196 -0
- package/src/components/ui/native-select.tsx +68 -0
- package/src/components/ui/navigation-menu.tsx +23 -0
- package/src/components/ui/sheet.tsx +23 -6
- package/src/components/ui/spinner.tsx +14 -3
- package/src/components/ui/tags-input.tsx +210 -69
- package/src/hooks/use-global-primary-color.ts +1 -1
- package/src/styles.css +2 -2
- package/src/components/ui/bottom-sheet.tsx +0 -133
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
AccordionContent,
|
|
18
18
|
} from "@behavioral-agentic-design-system/core/components/ui/accordion";
|
|
19
19
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
20
|
+
import { ButtonGroup } from "@behavioral-agentic-design-system/core/components/ui/button-group";
|
|
20
21
|
import { Input } from "@behavioral-agentic-design-system/core/components/ui/input";
|
|
21
22
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
22
23
|
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
@@ -53,16 +54,6 @@ import {
|
|
|
53
54
|
AlertDialogTrigger,
|
|
54
55
|
} from "@behavioral-agentic-design-system/core/components/ui/alert-dialog";
|
|
55
56
|
import { buttonVariants } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
56
|
-
import {
|
|
57
|
-
BottomSheet,
|
|
58
|
-
BottomSheetClose,
|
|
59
|
-
BottomSheetContent,
|
|
60
|
-
BottomSheetDescription,
|
|
61
|
-
BottomSheetFooter,
|
|
62
|
-
BottomSheetHeader,
|
|
63
|
-
BottomSheetTitle,
|
|
64
|
-
BottomSheetTrigger,
|
|
65
|
-
} from "@behavioral-agentic-design-system/core/components/ui/bottom-sheet";
|
|
66
57
|
import {
|
|
67
58
|
Carousel,
|
|
68
59
|
CarouselContent,
|
|
@@ -84,6 +75,17 @@ import { PasswordInput } from "@behavioral-agentic-design-system/core/components
|
|
|
84
75
|
import { NumberInput } from "@behavioral-agentic-design-system/core/components/ui/number-input";
|
|
85
76
|
import { FileUpload } from "@behavioral-agentic-design-system/core/components/ui/file-upload";
|
|
86
77
|
import { Spinner } from "@behavioral-agentic-design-system/core/components/ui/spinner";
|
|
78
|
+
import { CircularProgress } from "@behavioral-agentic-design-system/core/components/ui/circular-progress";
|
|
79
|
+
import { Indicator } from "@behavioral-agentic-design-system/core/components/ui/indicator";
|
|
80
|
+
import { CopyButton } from "@behavioral-agentic-design-system/core/components/ui/copy-button";
|
|
81
|
+
import { List, ListItem } from "@behavioral-agentic-design-system/core/components/ui/list";
|
|
82
|
+
import {
|
|
83
|
+
EmptyState,
|
|
84
|
+
EmptyStateIcon,
|
|
85
|
+
EmptyStateTitle,
|
|
86
|
+
EmptyStateDescription,
|
|
87
|
+
EmptyStateAction,
|
|
88
|
+
} from "@behavioral-agentic-design-system/core/components/ui/empty-state";
|
|
87
89
|
import { AspectRatio } from "@behavioral-agentic-design-system/core/components/ui/aspect-ratio";
|
|
88
90
|
import {
|
|
89
91
|
ContextMenu,
|
|
@@ -109,7 +111,9 @@ import {
|
|
|
109
111
|
NavigationMenuTrigger,
|
|
110
112
|
} from "@behavioral-agentic-design-system/core/components/ui/navigation-menu";
|
|
111
113
|
import { Combobox } from "@behavioral-agentic-design-system/core/components/ui/combobox";
|
|
114
|
+
import { MultiSelect } from "@behavioral-agentic-design-system/core/components/ui/multi-select";
|
|
112
115
|
import { Kbd } from "@behavioral-agentic-design-system/core/components/ui/kbd";
|
|
116
|
+
import { Code } from "@behavioral-agentic-design-system/core/components/ui/code";
|
|
113
117
|
import {
|
|
114
118
|
Toolbar,
|
|
115
119
|
ToolbarButton,
|
|
@@ -125,6 +129,8 @@ import {
|
|
|
125
129
|
LinkIcon as ToolbarLinkIcon,
|
|
126
130
|
UndoIcon,
|
|
127
131
|
RedoIcon,
|
|
132
|
+
ChevronLeftIcon,
|
|
133
|
+
ChevronRightIcon,
|
|
128
134
|
} from "lucide-react";
|
|
129
135
|
import {
|
|
130
136
|
Menubar,
|
|
@@ -150,7 +156,7 @@ import {
|
|
|
150
156
|
HoverCardDescription,
|
|
151
157
|
HoverCardTrigger,
|
|
152
158
|
} from "@behavioral-agentic-design-system/core/components/ui/hover-card";
|
|
153
|
-
import { Sparkles, Info, CircleAlert, CalendarIcon, BuildingIcon, CheckIcon, CreditCardIcon, ClipboardCheckIcon, TrophyIcon, UserCheckIcon } from "lucide-react";
|
|
159
|
+
import { Sparkles, Info, CircleAlert, CalendarIcon, BuildingIcon, CheckIcon, CreditCardIcon, ClipboardCheckIcon, TrophyIcon, UserCheckIcon, XIcon, ZapIcon, StarIcon, ShieldCheckIcon, InboxIcon, WifiOffIcon, ClipboardListIcon, PlusIcon } from "lucide-react";
|
|
154
160
|
import { DatePicker } from "@behavioral-agentic-design-system/core/components/ui/date-picker";
|
|
155
161
|
import { DateRangePicker } from "@behavioral-agentic-design-system/core/components/ui/date-range-picker";
|
|
156
162
|
import { RatingGroup } from "@behavioral-agentic-design-system/core/components/ui/rating-group";
|
|
@@ -257,6 +263,7 @@ import {
|
|
|
257
263
|
TreeItemContent,
|
|
258
264
|
} from "@behavioral-agentic-design-system/core/components/ui/tree-view";
|
|
259
265
|
import { ColorPicker } from "@behavioral-agentic-design-system/core/components/ui/color-picker";
|
|
266
|
+
import { NativeSelect } from "@behavioral-agentic-design-system/core/components/ui/native-select";
|
|
260
267
|
|
|
261
268
|
// Stable, deterministic data for ScrollArea — never use Math.random in
|
|
262
269
|
// SSR-rendered output, it causes hydration mismatches.
|
|
@@ -508,6 +515,55 @@ export default function ComponentsPreview() {
|
|
|
508
515
|
</div>
|
|
509
516
|
</Section>
|
|
510
517
|
|
|
518
|
+
<Section title="ButtonGroup">
|
|
519
|
+
<div className="flex flex-wrap gap-6 items-start">
|
|
520
|
+
<div className="space-y-1.5">
|
|
521
|
+
<p className="text-xs font-medium text-muted-foreground">Horizontal (default)</p>
|
|
522
|
+
<ButtonGroup aria-label="Lane view controls">
|
|
523
|
+
<Button variant="outline">All lanes</Button>
|
|
524
|
+
<Button variant="outline">My lanes</Button>
|
|
525
|
+
<Button variant="outline">Open only</Button>
|
|
526
|
+
</ButtonGroup>
|
|
527
|
+
</div>
|
|
528
|
+
<div className="space-y-1.5">
|
|
529
|
+
<p className="text-xs font-medium text-muted-foreground">Icon-only</p>
|
|
530
|
+
<ButtonGroup aria-label="Text alignment">
|
|
531
|
+
<Button variant="outline" size="icon" aria-label="Align left">
|
|
532
|
+
<AlignLeftIcon strokeWidth={1.5} />
|
|
533
|
+
</Button>
|
|
534
|
+
<Button variant="outline" size="icon" aria-label="Align center">
|
|
535
|
+
<AlignCenterIcon strokeWidth={1.5} />
|
|
536
|
+
</Button>
|
|
537
|
+
<Button variant="outline" size="icon" aria-label="Align right">
|
|
538
|
+
<AlignRightIcon strokeWidth={1.5} />
|
|
539
|
+
</Button>
|
|
540
|
+
</ButtonGroup>
|
|
541
|
+
</div>
|
|
542
|
+
<div className="space-y-1.5">
|
|
543
|
+
<p className="text-xs font-medium text-muted-foreground">Vertical</p>
|
|
544
|
+
<ButtonGroup orientation="vertical" aria-label="Stroke options">
|
|
545
|
+
<Button variant="outline">Freestyle</Button>
|
|
546
|
+
<Button variant="outline">Backstroke</Button>
|
|
547
|
+
<Button variant="outline">Breaststroke</Button>
|
|
548
|
+
</ButtonGroup>
|
|
549
|
+
</div>
|
|
550
|
+
<div className="space-y-1.5">
|
|
551
|
+
<p className="text-xs font-medium text-muted-foreground">Realistic use — pagination</p>
|
|
552
|
+
<ButtonGroup aria-label="Pagination">
|
|
553
|
+
<Button variant="outline" size="icon" aria-label="Previous page">
|
|
554
|
+
<ChevronLeftIcon strokeWidth={1.5} />
|
|
555
|
+
</Button>
|
|
556
|
+
<Button variant="outline" size="icon" aria-label="Page 1">1</Button>
|
|
557
|
+
<Button variant="default" size="icon" aria-label="Page 2, current">2</Button>
|
|
558
|
+
<Button variant="outline" size="icon" aria-label="Page 3">3</Button>
|
|
559
|
+
<Button variant="outline" size="icon" aria-label="Next page">
|
|
560
|
+
<ChevronRightIcon strokeWidth={1.5} />
|
|
561
|
+
</Button>
|
|
562
|
+
</ButtonGroup>
|
|
563
|
+
</div>
|
|
564
|
+
</div>
|
|
565
|
+
</Section>
|
|
566
|
+
|
|
511
567
|
<Section title="Inputs">
|
|
512
568
|
<div className="grid gap-4 sm:grid-cols-2">
|
|
513
569
|
<div className="space-y-2">
|
|
@@ -786,50 +842,53 @@ export default function ComponentsPreview() {
|
|
|
786
842
|
<SegmentedControlShowcase />
|
|
787
843
|
</Section>
|
|
788
844
|
|
|
789
|
-
<Section title="
|
|
845
|
+
<Section title="Bottom Sheet">
|
|
846
|
+
{/* Bottom sheets are just <Sheet> with side="bottom" — they pick up
|
|
847
|
+
the rounded top, grab handle, capped height + scroll, and safe-area
|
|
848
|
+
padding automatically. Pass showHandle={false} to hide the handle. */}
|
|
790
849
|
<div className="flex flex-wrap gap-3">
|
|
791
850
|
{/* Default — grab handle + close button */}
|
|
792
|
-
<
|
|
793
|
-
<
|
|
851
|
+
<Sheet>
|
|
852
|
+
<SheetTrigger asChild>
|
|
794
853
|
<Button variant="outline">Open</Button>
|
|
795
|
-
</
|
|
796
|
-
<
|
|
797
|
-
<
|
|
798
|
-
<
|
|
799
|
-
<
|
|
854
|
+
</SheetTrigger>
|
|
855
|
+
<SheetContent side="bottom">
|
|
856
|
+
<SheetHeader>
|
|
857
|
+
<SheetTitle>Display density</SheetTitle>
|
|
858
|
+
<SheetDescription>
|
|
800
859
|
Choose how much information shows on each row.
|
|
801
|
-
</
|
|
802
|
-
</
|
|
803
|
-
</
|
|
804
|
-
</
|
|
860
|
+
</SheetDescription>
|
|
861
|
+
</SheetHeader>
|
|
862
|
+
</SheetContent>
|
|
863
|
+
</Sheet>
|
|
805
864
|
|
|
806
865
|
{/* No handle variant */}
|
|
807
|
-
<
|
|
808
|
-
<
|
|
866
|
+
<Sheet>
|
|
867
|
+
<SheetTrigger asChild>
|
|
809
868
|
<Button variant="outline">No handle</Button>
|
|
810
|
-
</
|
|
811
|
-
<
|
|
812
|
-
<
|
|
813
|
-
<
|
|
814
|
-
<
|
|
869
|
+
</SheetTrigger>
|
|
870
|
+
<SheetContent side="bottom" showHandle={false}>
|
|
871
|
+
<SheetHeader>
|
|
872
|
+
<SheetTitle>No grab handle</SheetTitle>
|
|
873
|
+
<SheetDescription>
|
|
815
874
|
Handle hidden via showHandle={"{false}"}.
|
|
816
|
-
</
|
|
817
|
-
</
|
|
818
|
-
</
|
|
819
|
-
</
|
|
875
|
+
</SheetDescription>
|
|
876
|
+
</SheetHeader>
|
|
877
|
+
</SheetContent>
|
|
878
|
+
</Sheet>
|
|
820
879
|
|
|
821
880
|
{/* Realistic action sheet with a footer */}
|
|
822
|
-
<
|
|
823
|
-
<
|
|
881
|
+
<Sheet>
|
|
882
|
+
<SheetTrigger asChild>
|
|
824
883
|
<Button>View settings</Button>
|
|
825
|
-
</
|
|
826
|
-
<
|
|
827
|
-
<
|
|
828
|
-
<
|
|
829
|
-
<
|
|
884
|
+
</SheetTrigger>
|
|
885
|
+
<SheetContent side="bottom">
|
|
886
|
+
<SheetHeader>
|
|
887
|
+
<SheetTitle>View settings</SheetTitle>
|
|
888
|
+
<SheetDescription>
|
|
830
889
|
These apply to the Components board only.
|
|
831
|
-
</
|
|
832
|
-
</
|
|
890
|
+
</SheetDescription>
|
|
891
|
+
</SheetHeader>
|
|
833
892
|
<div className="flex flex-col gap-5 px-4 py-2">
|
|
834
893
|
<div className="flex items-center justify-between">
|
|
835
894
|
<Label htmlFor="density-group">Group by status</Label>
|
|
@@ -840,16 +899,16 @@ export default function ComponentsPreview() {
|
|
|
840
899
|
<Switch id="density-sub" />
|
|
841
900
|
</div>
|
|
842
901
|
</div>
|
|
843
|
-
<
|
|
844
|
-
<
|
|
902
|
+
<SheetFooter className="flex-row justify-end gap-2">
|
|
903
|
+
<SheetClose asChild>
|
|
845
904
|
<Button variant="ghost">Cancel</Button>
|
|
846
|
-
</
|
|
847
|
-
<
|
|
905
|
+
</SheetClose>
|
|
906
|
+
<SheetClose asChild>
|
|
848
907
|
<Button>Apply</Button>
|
|
849
|
-
</
|
|
850
|
-
</
|
|
851
|
-
</
|
|
852
|
-
</
|
|
908
|
+
</SheetClose>
|
|
909
|
+
</SheetFooter>
|
|
910
|
+
</SheetContent>
|
|
911
|
+
</Sheet>
|
|
853
912
|
</div>
|
|
854
913
|
</Section>
|
|
855
914
|
|
|
@@ -1372,6 +1431,148 @@ export default function ComponentsPreview() {
|
|
|
1372
1431
|
</div>
|
|
1373
1432
|
</Section>
|
|
1374
1433
|
|
|
1434
|
+
{/* ── Circular Progress ────────────────────────────────────── */}
|
|
1435
|
+
<Section title="Circular Progress">
|
|
1436
|
+
<div className="space-y-6">
|
|
1437
|
+
<div className="space-y-2">
|
|
1438
|
+
<p className="text-sm font-medium text-muted-foreground">Sizes</p>
|
|
1439
|
+
<div className="flex items-center gap-6">
|
|
1440
|
+
<CircularProgress value={65} size="sm" label="Small: 65%" />
|
|
1441
|
+
<CircularProgress value={65} size="default" label="Default: 65%" />
|
|
1442
|
+
<CircularProgress value={65} size="lg" label="Large: 65%" />
|
|
1443
|
+
</div>
|
|
1444
|
+
</div>
|
|
1445
|
+
<div className="space-y-2">
|
|
1446
|
+
<p className="text-sm font-medium text-muted-foreground">Variants</p>
|
|
1447
|
+
<div className="flex items-center gap-6">
|
|
1448
|
+
<CircularProgress value={65} variant="default" label="default: 65%" />
|
|
1449
|
+
<CircularProgress value={65} variant="muted" label="muted: 65%" />
|
|
1450
|
+
<CircularProgress value={100} variant="success" label="success: 100%" />
|
|
1451
|
+
<CircularProgress value={55} variant="warning" label="warning: 55%" />
|
|
1452
|
+
<CircularProgress value={20} variant="destructive" label="destructive: 20%" />
|
|
1453
|
+
</div>
|
|
1454
|
+
</div>
|
|
1455
|
+
<div className="space-y-2">
|
|
1456
|
+
<p className="text-sm font-medium text-muted-foreground">With center label</p>
|
|
1457
|
+
<div className="flex items-center gap-6">
|
|
1458
|
+
<CircularProgress value={72} size="lg" label="Storage: 72%">
|
|
1459
|
+
<span className="text-xs font-semibold">72%</span>
|
|
1460
|
+
</CircularProgress>
|
|
1461
|
+
<CircularProgress value={100} size="lg" variant="success" label="Complete">
|
|
1462
|
+
<span className="text-xs font-semibold">✓</span>
|
|
1463
|
+
</CircularProgress>
|
|
1464
|
+
</div>
|
|
1465
|
+
</div>
|
|
1466
|
+
<div className="space-y-2">
|
|
1467
|
+
<p className="text-sm font-medium text-muted-foreground">Indeterminate</p>
|
|
1468
|
+
<CircularProgress label="Loading…" />
|
|
1469
|
+
</div>
|
|
1470
|
+
</div>
|
|
1471
|
+
</Section>
|
|
1472
|
+
|
|
1473
|
+
{/* ── Indicator ────────────────────────────────────────────── */}
|
|
1474
|
+
<Section title="Indicator"> <div className="space-y-6">
|
|
1475
|
+
{/* Variants */}
|
|
1476
|
+
<div className="space-y-3">
|
|
1477
|
+
<p className="text-sm font-medium text-muted-foreground">Variants</p>
|
|
1478
|
+
<div className="flex flex-wrap items-center gap-6">
|
|
1479
|
+
{(["default", "secondary", "destructive", "success", "warning"] as const).map((v) => (
|
|
1480
|
+
<div key={v} className="flex flex-col items-center gap-2">
|
|
1481
|
+
<Indicator variant={v} label={v === "destructive" ? 3 : undefined}>
|
|
1482
|
+
<div className="size-10 rounded-md border bg-muted" />
|
|
1483
|
+
</Indicator>
|
|
1484
|
+
<span className="text-xs text-muted-foreground">{v}</span>
|
|
1485
|
+
</div>
|
|
1486
|
+
))} </div>
|
|
1487
|
+
</div>
|
|
1488
|
+
{/* Sizes */}
|
|
1489
|
+
<div className="space-y-3">
|
|
1490
|
+
<p className="text-sm font-medium text-muted-foreground">Sizes</p>
|
|
1491
|
+
<div className="flex items-center gap-6">
|
|
1492
|
+
<div className="flex flex-col items-center gap-2">
|
|
1493
|
+
<Indicator size="sm"><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1494
|
+
<span className="text-xs text-muted-foreground">sm</span>
|
|
1495
|
+
</div>
|
|
1496
|
+
<div className="flex flex-col items-center gap-2">
|
|
1497
|
+
<Indicator size="default" label={4}><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1498
|
+
<span className="text-xs text-muted-foreground">default</span>
|
|
1499
|
+
</div>
|
|
1500
|
+
<div className="flex flex-col items-center gap-2">
|
|
1501
|
+
<Indicator size="lg" label={12}><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1502
|
+
<span className="text-xs text-muted-foreground">lg</span>
|
|
1503
|
+
</div>
|
|
1504
|
+
</div>
|
|
1505
|
+
</div>
|
|
1506
|
+
{/* Processing */}
|
|
1507
|
+
<div className="space-y-3">
|
|
1508
|
+
<p className="text-sm font-medium text-muted-foreground">Processing (ping)</p>
|
|
1509
|
+
<div className="flex items-center gap-6">
|
|
1510
|
+
<Indicator processing variant="success"><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1511
|
+
<Indicator processing variant="destructive"><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1512
|
+
</div>
|
|
1513
|
+
</div>
|
|
1514
|
+
{/* Realistic use */}
|
|
1515
|
+
<div className="space-y-3">
|
|
1516
|
+
<p className="text-sm font-medium text-muted-foreground">Online status + notification count</p>
|
|
1517
|
+
<div className="flex items-center gap-6">
|
|
1518
|
+
<Indicator position="bottom-right" variant="success" withBorder>
|
|
1519
|
+
<div className="size-10 rounded-full border bg-muted flex items-center justify-center text-sm font-medium">JL</div>
|
|
1520
|
+
</Indicator>
|
|
1521
|
+
<Indicator label={9} variant="destructive">
|
|
1522
|
+
<div className="size-10 rounded-md border bg-muted flex items-center justify-center">
|
|
1523
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>
|
|
1524
|
+
</div>
|
|
1525
|
+
</Indicator> </div>
|
|
1526
|
+
</div>
|
|
1527
|
+
</div>
|
|
1528
|
+
</Section>
|
|
1529
|
+
|
|
1530
|
+
{/* ── CopyButton ───────────────────────────────────────────── */}
|
|
1531
|
+
<Section title="CopyButton"> <div className="space-y-6">
|
|
1532
|
+
{/* Variants */}
|
|
1533
|
+
<div className="space-y-3">
|
|
1534
|
+
<p className="text-sm font-medium text-muted-foreground">Variants</p>
|
|
1535
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
1536
|
+
<CopyButton value="default" variant="default">Copy</CopyButton>
|
|
1537
|
+
<CopyButton value="outline" variant="outline">Copy</CopyButton>
|
|
1538
|
+
<CopyButton value="secondary" variant="secondary">Copy</CopyButton>
|
|
1539
|
+
<CopyButton value="ghost" variant="ghost">Copy</CopyButton> </div>
|
|
1540
|
+
</div>
|
|
1541
|
+
{/* Sizes */}
|
|
1542
|
+
<div className="space-y-3">
|
|
1543
|
+
<p className="text-sm font-medium text-muted-foreground">Sizes</p>
|
|
1544
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
1545
|
+
<CopyButton value="sm" size="sm" variant="outline">Copy</CopyButton>
|
|
1546
|
+
<CopyButton value="default" size="default" variant="outline">Copy</CopyButton>
|
|
1547
|
+
<CopyButton value="lg" size="lg" variant="outline">Copy</CopyButton>
|
|
1548
|
+
</div>
|
|
1549
|
+
</div>
|
|
1550
|
+
{/* Icon-only */}
|
|
1551
|
+
<div className="space-y-3">
|
|
1552
|
+
<p className="text-sm font-medium text-muted-foreground">Icon-only</p>
|
|
1553
|
+
<div className="flex items-center gap-3">
|
|
1554
|
+
<CopyButton value="abc" size="icon-sm" variant="ghost" aria-label="Copy token" />
|
|
1555
|
+
<CopyButton value="abc" size="icon" variant="outline" aria-label="Copy value" />
|
|
1556
|
+
<CopyButton value="abc" size="icon-lg" variant="secondary" aria-label="Copy large" />
|
|
1557
|
+
</div>
|
|
1558
|
+
</div>
|
|
1559
|
+
{/* Realistic use — API key row */}
|
|
1560
|
+
<div className="space-y-3">
|
|
1561
|
+
<p className="text-sm font-medium text-muted-foreground">API key row</p>
|
|
1562
|
+
<div className="flex w-full max-w-sm items-center gap-2 rounded-md border bg-muted px-3 py-2">
|
|
1563
|
+
<code className="min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground">
|
|
1564
|
+
sk-proj-Xk9mNpQ2vR7tLwYjAb4cDeFgHiJkLmNo
|
|
1565
|
+
</code>
|
|
1566
|
+
<CopyButton
|
|
1567
|
+
value="sk-proj-Xk9mNpQ2vR7tLwYjAb4cDeFgHiJkLmNo"
|
|
1568
|
+
size="icon-sm"
|
|
1569
|
+
variant="ghost"
|
|
1570
|
+
aria-label="Copy API key"
|
|
1571
|
+
/> </div>
|
|
1572
|
+
</div>
|
|
1573
|
+
</div>
|
|
1574
|
+
</Section>
|
|
1575
|
+
|
|
1375
1576
|
{/* ── Aspect Ratio ─────────────────────────────────────────── */}
|
|
1376
1577
|
<Section title="Aspect Ratio">
|
|
1377
1578
|
<div className="space-y-6">
|
|
@@ -1702,6 +1903,58 @@ export default function ComponentsPreview() {
|
|
|
1702
1903
|
</div>
|
|
1703
1904
|
</div>
|
|
1704
1905
|
</Section>
|
|
1906
|
+
<Section title="Code">
|
|
1907
|
+
<div className="space-y-6">
|
|
1908
|
+
<div className="space-y-2">
|
|
1909
|
+
<p className="text-sm font-medium text-muted-foreground">Inline (default)</p>
|
|
1910
|
+
<p className="text-sm text-foreground leading-relaxed max-w-sm">
|
|
1911
|
+
Set the primary brand color via{" "}
|
|
1912
|
+
<Code>--primary</Code> in{" "}
|
|
1913
|
+
<Code>tokens.json</Code> and run{" "}
|
|
1914
|
+
<Code>pnpm build:tokens</Code> to regenerate.
|
|
1915
|
+
</p>
|
|
1916
|
+
</div>
|
|
1917
|
+
<div className="space-y-2">
|
|
1918
|
+
<p className="text-sm font-medium text-muted-foreground">Block variant</p>
|
|
1919
|
+
<div className="w-[480px]">
|
|
1920
|
+
<Code variant="block">
|
|
1921
|
+
{`// tokens.json — semantic layer\n{\n "theme": {\n "light": {\n "primary": "#1a1a1a",\n "primary-foreground": "#ffffff"\n }\n }\n}`}
|
|
1922
|
+
</Code>
|
|
1923
|
+
</div>
|
|
1924
|
+
</div>
|
|
1925
|
+
<div className="space-y-2">
|
|
1926
|
+
<p className="text-sm font-medium text-muted-foreground">Sizes — sm / default / lg</p>
|
|
1927
|
+
<div className="flex flex-col gap-3">
|
|
1928
|
+
<div className="flex items-center gap-3">
|
|
1929
|
+
<Code size="sm">pnpm a11y</Code>
|
|
1930
|
+
<Code size="default">pnpm wcag:audit</Code>
|
|
1931
|
+
<Code size="lg">design-tokens</Code>
|
|
1932
|
+
</div>
|
|
1933
|
+
<div className="w-[440px] space-y-1.5">
|
|
1934
|
+
<Code variant="block" size="sm">{`78 pass · 0 fail · 0 warn`}</Code>
|
|
1935
|
+
<Code variant="block" size="default">{`✓ primary on background 12.6:1 AAA`}</Code>
|
|
1936
|
+
<Code variant="block" size="lg">{`@behavioral-agentic-design-system/core@0.16.0`}</Code>
|
|
1937
|
+
</div>
|
|
1938
|
+
</div>
|
|
1939
|
+
</div>
|
|
1940
|
+
<div className="space-y-2">
|
|
1941
|
+
<p className="text-sm font-medium text-muted-foreground">Realistic use</p>
|
|
1942
|
+
<div className="max-w-md space-y-4 text-sm text-foreground leading-relaxed">
|
|
1943
|
+
<div className="space-y-1">
|
|
1944
|
+
<p className="font-medium text-foreground">Install the package</p>
|
|
1945
|
+
<Code variant="block">{`pnpm add @behavioral-agentic-design-system/core`}</Code>
|
|
1946
|
+
</div>
|
|
1947
|
+
<p>
|
|
1948
|
+
Import tokens via <Code>import "@behavioral-agentic-design-system/core/styles.css"</Code>{" "}
|
|
1949
|
+
in your root layout, then use any component:
|
|
1950
|
+
</p>
|
|
1951
|
+
<Code variant="block">
|
|
1952
|
+
{`import { Button } from "@behavioral-agentic-design-system/core/components/ui/button"\n\nexport function Example() {\n return <Button variant="default">Get started</Button>\n}`}
|
|
1953
|
+
</Code>
|
|
1954
|
+
</div>
|
|
1955
|
+
</div>
|
|
1956
|
+
</div>
|
|
1957
|
+
</Section>
|
|
1705
1958
|
<Section title="Combobox">
|
|
1706
1959
|
<div className="space-y-6">
|
|
1707
1960
|
<div className="grid grid-cols-1 gap-6 sm:grid-cols-2">
|
|
@@ -1734,6 +1987,55 @@ export default function ComponentsPreview() {
|
|
|
1734
1987
|
</div>
|
|
1735
1988
|
</div>
|
|
1736
1989
|
</Section>
|
|
1990
|
+
<Section title="MultiSelect">
|
|
1991
|
+
<div className="space-y-6">
|
|
1992
|
+
<div className="space-y-3">
|
|
1993
|
+
<p className="text-sm font-medium text-muted-foreground">Default</p>
|
|
1994
|
+
<div className="max-w-xs">
|
|
1995
|
+
<MultiSelect
|
|
1996
|
+
options={[
|
|
1997
|
+
{ value: "next", label: "Next.js" },
|
|
1998
|
+
{ value: "remix", label: "Remix" },
|
|
1999
|
+
{ value: "astro", label: "Astro" },
|
|
2000
|
+
{ value: "sveltekit", label: "SvelteKit" },
|
|
2001
|
+
]}
|
|
2002
|
+
value={["next", "remix"]}
|
|
2003
|
+
onValueChange={() => {}}
|
|
2004
|
+
/>
|
|
2005
|
+
</div>
|
|
2006
|
+
</div>
|
|
2007
|
+
<div className="space-y-3">
|
|
2008
|
+
<p className="text-sm font-medium text-muted-foreground">With maxCount=2</p>
|
|
2009
|
+
<div className="max-w-xs">
|
|
2010
|
+
<MultiSelect
|
|
2011
|
+
options={[
|
|
2012
|
+
{ value: "next", label: "Next.js" },
|
|
2013
|
+
{ value: "remix", label: "Remix" },
|
|
2014
|
+
{ value: "astro", label: "Astro" },
|
|
2015
|
+
{ value: "sveltekit", label: "SvelteKit" },
|
|
2016
|
+
]}
|
|
2017
|
+
value={["next", "remix", "astro"]}
|
|
2018
|
+
onValueChange={() => {}}
|
|
2019
|
+
maxCount={2}
|
|
2020
|
+
/>
|
|
2021
|
+
</div>
|
|
2022
|
+
</div>
|
|
2023
|
+
<div className="space-y-3">
|
|
2024
|
+
<p className="text-sm font-medium text-muted-foreground">Disabled</p>
|
|
2025
|
+
<div className="max-w-xs">
|
|
2026
|
+
<MultiSelect
|
|
2027
|
+
options={[
|
|
2028
|
+
{ value: "next", label: "Next.js" },
|
|
2029
|
+
{ value: "remix", label: "Remix" },
|
|
2030
|
+
]}
|
|
2031
|
+
value={["next"]}
|
|
2032
|
+
onValueChange={() => {}}
|
|
2033
|
+
disabled
|
|
2034
|
+
/>
|
|
2035
|
+
</div>
|
|
2036
|
+
</div>
|
|
2037
|
+
</div>
|
|
2038
|
+
</Section>
|
|
1737
2039
|
<Section title="Context Menu">
|
|
1738
2040
|
<div className="space-y-6">
|
|
1739
2041
|
<div className="space-y-3">
|
|
@@ -1943,6 +2245,24 @@ export default function ComponentsPreview() {
|
|
|
1943
2245
|
placeholder="Add stroke…"
|
|
1944
2246
|
/>
|
|
1945
2247
|
</div>
|
|
2248
|
+
<div className="space-y-3">
|
|
2249
|
+
<p className="text-sm font-medium text-muted-foreground">With suggestions (autocomplete) — type "fly" or "back"</p>
|
|
2250
|
+
<TagsInputShowcase
|
|
2251
|
+
placeholder="Add a stroke or event…"
|
|
2252
|
+
suggestions={[
|
|
2253
|
+
"Butterfly",
|
|
2254
|
+
"Backstroke",
|
|
2255
|
+
"Breaststroke",
|
|
2256
|
+
"Freestyle",
|
|
2257
|
+
"Individual Medley",
|
|
2258
|
+
"50m Freestyle",
|
|
2259
|
+
"100m Butterfly",
|
|
2260
|
+
"200m Backstroke",
|
|
2261
|
+
"400m IM",
|
|
2262
|
+
"Medley Relay",
|
|
2263
|
+
]}
|
|
2264
|
+
/>
|
|
2265
|
+
</div>
|
|
1946
2266
|
<div className="space-y-3">
|
|
1947
2267
|
<p className="text-sm font-medium text-muted-foreground">Max tags (4)</p>
|
|
1948
2268
|
<TagsInputShowcase
|
|
@@ -2171,6 +2491,52 @@ export default function ComponentsPreview() {
|
|
|
2171
2491
|
</div>
|
|
2172
2492
|
</Section>
|
|
2173
2493
|
|
|
2494
|
+
<Section title="Native Select">
|
|
2495
|
+
<div className="grid gap-6 sm:grid-cols-2">
|
|
2496
|
+
<div className="space-y-2">
|
|
2497
|
+
<Label htmlFor="ns-focus">Design Focus Area</Label>
|
|
2498
|
+
<NativeSelect id="ns-focus" defaultValue="components">
|
|
2499
|
+
<option value="">Choose a focus area</option>
|
|
2500
|
+
<option value="tokens">Design Tokens</option>
|
|
2501
|
+
<option value="components">Components</option>
|
|
2502
|
+
<option value="patterns">Patterns</option>
|
|
2503
|
+
<option value="a11y">Accessibility</option>
|
|
2504
|
+
<option value="motion">Motion & Animation</option>
|
|
2505
|
+
</NativeSelect>
|
|
2506
|
+
</div>
|
|
2507
|
+
<div className="space-y-2">
|
|
2508
|
+
<Label htmlFor="ns-disabled">Disabled</Label>
|
|
2509
|
+
<NativeSelect id="ns-disabled" disabled defaultValue="components">
|
|
2510
|
+
<option value="components">Components (locked)</option>
|
|
2511
|
+
</NativeSelect>
|
|
2512
|
+
</div>
|
|
2513
|
+
<div className="space-y-2">
|
|
2514
|
+
<Label htmlFor="ns-invalid">Invalid</Label>
|
|
2515
|
+
<NativeSelect id="ns-invalid" aria-invalid defaultValue="">
|
|
2516
|
+
<option value="">Select a valid option</option>
|
|
2517
|
+
<option value="tokens">Design Tokens</option>
|
|
2518
|
+
</NativeSelect>
|
|
2519
|
+
</div>
|
|
2520
|
+
<div className="space-y-2">
|
|
2521
|
+
<p className="text-sm font-medium text-foreground">Sizes</p>
|
|
2522
|
+
<div className="flex flex-col gap-2">
|
|
2523
|
+
<NativeSelect size="sm" defaultValue="sm">
|
|
2524
|
+
<option value="sm">Small (sm)</option>
|
|
2525
|
+
</NativeSelect>
|
|
2526
|
+
<NativeSelect size="default" defaultValue="default">
|
|
2527
|
+
<option value="default">Default</option>
|
|
2528
|
+
</NativeSelect>
|
|
2529
|
+
<NativeSelect size="lg" defaultValue="lg">
|
|
2530
|
+
<option value="lg">Large (lg)</option>
|
|
2531
|
+
</NativeSelect>
|
|
2532
|
+
<NativeSelect size="xl" defaultValue="xl">
|
|
2533
|
+
<option value="xl">Extra Large (xl)</option>
|
|
2534
|
+
</NativeSelect>
|
|
2535
|
+
</div>
|
|
2536
|
+
</div>
|
|
2537
|
+
</div>
|
|
2538
|
+
</Section>
|
|
2539
|
+
|
|
2174
2540
|
<Section title="Textarea">
|
|
2175
2541
|
<div className="grid gap-6 sm:grid-cols-2">
|
|
2176
2542
|
<div className="space-y-2">
|
|
@@ -2271,6 +2637,9 @@ export default function ComponentsPreview() {
|
|
|
2271
2637
|
</Section>
|
|
2272
2638
|
|
|
2273
2639
|
<Section title="Dropdown Menu">
|
|
2640
|
+
{/* flex wrapper keeps the trigger button content-width — Section's
|
|
2641
|
+
Card is a flex column, so a bare trigger stretches to full width. */}
|
|
2642
|
+
<div className="flex">
|
|
2274
2643
|
<DropdownMenu>
|
|
2275
2644
|
<DropdownMenuTrigger asChild>
|
|
2276
2645
|
<Button variant="outline" className="gap-2">
|
|
@@ -2297,6 +2666,7 @@ export default function ComponentsPreview() {
|
|
|
2297
2666
|
<DropdownMenuItem variant="destructive">Scratch swimmer</DropdownMenuItem>
|
|
2298
2667
|
</DropdownMenuContent>
|
|
2299
2668
|
</DropdownMenu>
|
|
2669
|
+
</div>
|
|
2300
2670
|
</Section>
|
|
2301
2671
|
|
|
2302
2672
|
<Section title="Command">
|
|
@@ -2444,6 +2814,123 @@ export default function ComponentsPreview() {
|
|
|
2444
2814
|
</div>
|
|
2445
2815
|
</Section>
|
|
2446
2816
|
|
|
2817
|
+
<Section title="List">
|
|
2818
|
+
<div className="flex flex-wrap gap-8 items-start">
|
|
2819
|
+
<div className="space-y-1.5">
|
|
2820
|
+
<p className="text-xs font-medium text-muted-foreground">Default (unordered)</p>
|
|
2821
|
+
<List className="w-64">
|
|
2822
|
+
<ListItem>Practice every Monday at 6 AM</ListItem>
|
|
2823
|
+
<ListItem>Check the coach board for lane assignments</ListItem>
|
|
2824
|
+
<ListItem>Bring your own cap and goggles</ListItem>
|
|
2825
|
+
<ListItem>Sign in at the front desk before entering the pool</ListItem>
|
|
2826
|
+
</List>
|
|
2827
|
+
</div>
|
|
2828
|
+
<div className="space-y-1.5">
|
|
2829
|
+
<p className="text-xs font-medium text-muted-foreground">With icons</p>
|
|
2830
|
+
<List className="w-64">
|
|
2831
|
+
<ListItem icon={<CheckIcon />}>Pool access included</ListItem>
|
|
2832
|
+
<ListItem icon={<CheckIcon />}>Video stroke analysis</ListItem>
|
|
2833
|
+
<ListItem icon={<CheckIcon />}>Monthly progress report</ListItem>
|
|
2834
|
+
<ListItem icon={<XIcon className="text-destructive" />}>Open swim excluded</ListItem>
|
|
2835
|
+
</List>
|
|
2836
|
+
</div>
|
|
2837
|
+
<div className="space-y-1.5">
|
|
2838
|
+
<p className="text-xs font-medium text-muted-foreground">Spacing variants</p>
|
|
2839
|
+
<div className="space-y-4">
|
|
2840
|
+
<List spacing="sm" className="w-48">
|
|
2841
|
+
<ListItem icon={<ZapIcon />}>sm — gap-1</ListItem>
|
|
2842
|
+
<ListItem icon={<ZapIcon />}>Fast warm-up</ListItem>
|
|
2843
|
+
<ListItem icon={<ZapIcon />}>Main set</ListItem>
|
|
2844
|
+
</List>
|
|
2845
|
+
<List spacing="lg" className="w-48">
|
|
2846
|
+
<ListItem icon={<StarIcon />}>lg — gap-3</ListItem>
|
|
2847
|
+
<ListItem icon={<StarIcon />}>Content-heavy</ListItem>
|
|
2848
|
+
<ListItem icon={<StarIcon />}>More breathing room</ListItem>
|
|
2849
|
+
</List>
|
|
2850
|
+
</div>
|
|
2851
|
+
</div>
|
|
2852
|
+
<div className="space-y-1.5">
|
|
2853
|
+
<p className="text-xs font-medium text-muted-foreground">Realistic use — membership card</p>
|
|
2854
|
+
<Card className="w-72">
|
|
2855
|
+
<CardContent className="p-5 space-y-4">
|
|
2856
|
+
<div>
|
|
2857
|
+
<h3 className="text-sm font-semibold">Premier Membership includes</h3>
|
|
2858
|
+
<p className="text-xs text-muted-foreground mt-0.5">Everything in Standard, plus:</p>
|
|
2859
|
+
</div>
|
|
2860
|
+
<List spacing="sm">
|
|
2861
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>Unlimited pool access, all sessions</ListItem>
|
|
2862
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>Personal stroke video review (monthly)</ListItem>
|
|
2863
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>Priority meet registration</ListItem>
|
|
2864
|
+
<ListItem icon={<XIcon className="text-muted-foreground" />}>
|
|
2865
|
+
<span className="text-muted-foreground">Guest passes not included</span>
|
|
2866
|
+
</ListItem>
|
|
2867
|
+
</List>
|
|
2868
|
+
</CardContent>
|
|
2869
|
+
</Card>
|
|
2870
|
+
</div>
|
|
2871
|
+
</div>
|
|
2872
|
+
</Section>
|
|
2873
|
+
|
|
2874
|
+
<Section title="EmptyState">
|
|
2875
|
+
<div className="flex flex-wrap gap-8 items-start">
|
|
2876
|
+
<div className="space-y-1.5">
|
|
2877
|
+
<p className="text-xs font-medium text-muted-foreground">Default</p>
|
|
2878
|
+
<EmptyState className="w-72 border border-border rounded-lg">
|
|
2879
|
+
<EmptyStateIcon>
|
|
2880
|
+
<InboxIcon strokeWidth={1.5} />
|
|
2881
|
+
</EmptyStateIcon>
|
|
2882
|
+
<EmptyStateTitle>No messages yet</EmptyStateTitle>
|
|
2883
|
+
<EmptyStateDescription>
|
|
2884
|
+
Messages from your coach will appear here after your first session.
|
|
2885
|
+
</EmptyStateDescription>
|
|
2886
|
+
</EmptyState>
|
|
2887
|
+
</div>
|
|
2888
|
+
<div className="space-y-1.5">
|
|
2889
|
+
<p className="text-xs font-medium text-muted-foreground">With action</p>
|
|
2890
|
+
<EmptyState className="w-72 border border-border rounded-lg">
|
|
2891
|
+
<EmptyStateIcon>
|
|
2892
|
+
<CalendarIcon strokeWidth={1.5} />
|
|
2893
|
+
</EmptyStateIcon>
|
|
2894
|
+
<EmptyStateTitle>No practices scheduled</EmptyStateTitle>
|
|
2895
|
+
<EmptyStateDescription>
|
|
2896
|
+
Add a practice block to start tracking attendance and yardage.
|
|
2897
|
+
</EmptyStateDescription>
|
|
2898
|
+
<EmptyStateAction>
|
|
2899
|
+
<Button size="sm">
|
|
2900
|
+
<PlusIcon strokeWidth={1.5} />
|
|
2901
|
+
Schedule practice
|
|
2902
|
+
</Button>
|
|
2903
|
+
</EmptyStateAction>
|
|
2904
|
+
</EmptyState>
|
|
2905
|
+
</div>
|
|
2906
|
+
<div className="space-y-1.5">
|
|
2907
|
+
<p className="text-xs font-medium text-muted-foreground">Error / destructive</p>
|
|
2908
|
+
<EmptyState className="w-72 border border-border rounded-lg">
|
|
2909
|
+
<EmptyStateIcon className="bg-destructive/10 text-destructive">
|
|
2910
|
+
<WifiOffIcon strokeWidth={1.5} />
|
|
2911
|
+
</EmptyStateIcon>
|
|
2912
|
+
<EmptyStateTitle>Couldn't load roster</EmptyStateTitle>
|
|
2913
|
+
<EmptyStateDescription>
|
|
2914
|
+
Check your connection and try again. Your data is safe.
|
|
2915
|
+
</EmptyStateDescription>
|
|
2916
|
+
<EmptyStateAction>
|
|
2917
|
+
<Button variant="outline" size="sm">Retry</Button>
|
|
2918
|
+
</EmptyStateAction>
|
|
2919
|
+
</EmptyState>
|
|
2920
|
+
</div>
|
|
2921
|
+
<div className="space-y-1.5">
|
|
2922
|
+
<p className="text-xs font-medium text-muted-foreground">sm — inline card</p>
|
|
2923
|
+
<EmptyState size="sm" className="w-56 border border-border rounded-lg">
|
|
2924
|
+
<EmptyStateIcon className="size-9 [&>svg]:size-5">
|
|
2925
|
+
<ClipboardListIcon strokeWidth={1.5} />
|
|
2926
|
+
</EmptyStateIcon>
|
|
2927
|
+
<EmptyStateTitle>No notes yet</EmptyStateTitle>
|
|
2928
|
+
<EmptyStateDescription>Add a note to this set.</EmptyStateDescription>
|
|
2929
|
+
</EmptyState>
|
|
2930
|
+
</div>
|
|
2931
|
+
</div>
|
|
2932
|
+
</Section>
|
|
2933
|
+
|
|
2447
2934
|
<Section title="Color Picker">
|
|
2448
2935
|
<div className="flex flex-wrap gap-8 items-start">
|
|
2449
2936
|
<div className="space-y-1.5">
|