@behavioral-agentic-design-system/core 0.15.0 → 0.16.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 +373 -1
- 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/copy-button.tsx +114 -0
- package/src/components/ui/empty-state.tsx +115 -0
- package/src/components/ui/indicator.tsx +144 -0
- package/src/components/ui/list.tsx +70 -0
- package/src/components/ui/multi-select.tsx +196 -0
- package/src/hooks/use-global-primary-color.ts +1 -1
- package/src/styles.css +2 -2
|
@@ -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";
|
|
@@ -84,6 +85,17 @@ import { PasswordInput } from "@behavioral-agentic-design-system/core/components
|
|
|
84
85
|
import { NumberInput } from "@behavioral-agentic-design-system/core/components/ui/number-input";
|
|
85
86
|
import { FileUpload } from "@behavioral-agentic-design-system/core/components/ui/file-upload";
|
|
86
87
|
import { Spinner } from "@behavioral-agentic-design-system/core/components/ui/spinner";
|
|
88
|
+
import { CircularProgress } from "@behavioral-agentic-design-system/core/components/ui/circular-progress";
|
|
89
|
+
import { Indicator } from "@behavioral-agentic-design-system/core/components/ui/indicator";
|
|
90
|
+
import { CopyButton } from "@behavioral-agentic-design-system/core/components/ui/copy-button";
|
|
91
|
+
import { List, ListItem } from "@behavioral-agentic-design-system/core/components/ui/list";
|
|
92
|
+
import {
|
|
93
|
+
EmptyState,
|
|
94
|
+
EmptyStateIcon,
|
|
95
|
+
EmptyStateTitle,
|
|
96
|
+
EmptyStateDescription,
|
|
97
|
+
EmptyStateAction,
|
|
98
|
+
} from "@behavioral-agentic-design-system/core/components/ui/empty-state";
|
|
87
99
|
import { AspectRatio } from "@behavioral-agentic-design-system/core/components/ui/aspect-ratio";
|
|
88
100
|
import {
|
|
89
101
|
ContextMenu,
|
|
@@ -109,6 +121,7 @@ import {
|
|
|
109
121
|
NavigationMenuTrigger,
|
|
110
122
|
} from "@behavioral-agentic-design-system/core/components/ui/navigation-menu";
|
|
111
123
|
import { Combobox } from "@behavioral-agentic-design-system/core/components/ui/combobox";
|
|
124
|
+
import { MultiSelect } from "@behavioral-agentic-design-system/core/components/ui/multi-select";
|
|
112
125
|
import { Kbd } from "@behavioral-agentic-design-system/core/components/ui/kbd";
|
|
113
126
|
import {
|
|
114
127
|
Toolbar,
|
|
@@ -125,6 +138,8 @@ import {
|
|
|
125
138
|
LinkIcon as ToolbarLinkIcon,
|
|
126
139
|
UndoIcon,
|
|
127
140
|
RedoIcon,
|
|
141
|
+
ChevronLeftIcon,
|
|
142
|
+
ChevronRightIcon,
|
|
128
143
|
} from "lucide-react";
|
|
129
144
|
import {
|
|
130
145
|
Menubar,
|
|
@@ -150,7 +165,7 @@ import {
|
|
|
150
165
|
HoverCardDescription,
|
|
151
166
|
HoverCardTrigger,
|
|
152
167
|
} 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";
|
|
168
|
+
import { Sparkles, Info, CircleAlert, CalendarIcon, BuildingIcon, CheckIcon, CreditCardIcon, ClipboardCheckIcon, TrophyIcon, UserCheckIcon, XIcon, ZapIcon, StarIcon, ShieldCheckIcon, InboxIcon, WifiOffIcon, ClipboardListIcon, PlusIcon } from "lucide-react";
|
|
154
169
|
import { DatePicker } from "@behavioral-agentic-design-system/core/components/ui/date-picker";
|
|
155
170
|
import { DateRangePicker } from "@behavioral-agentic-design-system/core/components/ui/date-range-picker";
|
|
156
171
|
import { RatingGroup } from "@behavioral-agentic-design-system/core/components/ui/rating-group";
|
|
@@ -508,6 +523,55 @@ export default function ComponentsPreview() {
|
|
|
508
523
|
</div>
|
|
509
524
|
</Section>
|
|
510
525
|
|
|
526
|
+
<Section title="ButtonGroup">
|
|
527
|
+
<div className="flex flex-wrap gap-6 items-start">
|
|
528
|
+
<div className="space-y-1.5">
|
|
529
|
+
<p className="text-xs font-medium text-muted-foreground">Horizontal (default)</p>
|
|
530
|
+
<ButtonGroup aria-label="Lane view controls">
|
|
531
|
+
<Button variant="outline">All lanes</Button>
|
|
532
|
+
<Button variant="outline">My lanes</Button>
|
|
533
|
+
<Button variant="outline">Open only</Button>
|
|
534
|
+
</ButtonGroup>
|
|
535
|
+
</div>
|
|
536
|
+
<div className="space-y-1.5">
|
|
537
|
+
<p className="text-xs font-medium text-muted-foreground">Icon-only</p>
|
|
538
|
+
<ButtonGroup aria-label="Text alignment">
|
|
539
|
+
<Button variant="outline" size="icon" aria-label="Align left">
|
|
540
|
+
<AlignLeftIcon strokeWidth={1.5} />
|
|
541
|
+
</Button>
|
|
542
|
+
<Button variant="outline" size="icon" aria-label="Align center">
|
|
543
|
+
<AlignCenterIcon strokeWidth={1.5} />
|
|
544
|
+
</Button>
|
|
545
|
+
<Button variant="outline" size="icon" aria-label="Align right">
|
|
546
|
+
<AlignRightIcon strokeWidth={1.5} />
|
|
547
|
+
</Button>
|
|
548
|
+
</ButtonGroup>
|
|
549
|
+
</div>
|
|
550
|
+
<div className="space-y-1.5">
|
|
551
|
+
<p className="text-xs font-medium text-muted-foreground">Vertical</p>
|
|
552
|
+
<ButtonGroup orientation="vertical" aria-label="Stroke options">
|
|
553
|
+
<Button variant="outline">Freestyle</Button>
|
|
554
|
+
<Button variant="outline">Backstroke</Button>
|
|
555
|
+
<Button variant="outline">Breaststroke</Button>
|
|
556
|
+
</ButtonGroup>
|
|
557
|
+
</div>
|
|
558
|
+
<div className="space-y-1.5">
|
|
559
|
+
<p className="text-xs font-medium text-muted-foreground">Realistic use — pagination</p>
|
|
560
|
+
<ButtonGroup aria-label="Pagination">
|
|
561
|
+
<Button variant="outline" size="icon" aria-label="Previous page">
|
|
562
|
+
<ChevronLeftIcon strokeWidth={1.5} />
|
|
563
|
+
</Button>
|
|
564
|
+
<Button variant="outline" size="icon" aria-label="Page 1">1</Button>
|
|
565
|
+
<Button variant="default" size="icon" aria-label="Page 2, current">2</Button>
|
|
566
|
+
<Button variant="outline" size="icon" aria-label="Page 3">3</Button>
|
|
567
|
+
<Button variant="outline" size="icon" aria-label="Next page">
|
|
568
|
+
<ChevronRightIcon strokeWidth={1.5} />
|
|
569
|
+
</Button>
|
|
570
|
+
</ButtonGroup>
|
|
571
|
+
</div>
|
|
572
|
+
</div>
|
|
573
|
+
</Section>
|
|
574
|
+
|
|
511
575
|
<Section title="Inputs">
|
|
512
576
|
<div className="grid gap-4 sm:grid-cols-2">
|
|
513
577
|
<div className="space-y-2">
|
|
@@ -1372,6 +1436,148 @@ export default function ComponentsPreview() {
|
|
|
1372
1436
|
</div>
|
|
1373
1437
|
</Section>
|
|
1374
1438
|
|
|
1439
|
+
{/* ── Circular Progress ────────────────────────────────────── */}
|
|
1440
|
+
<Section title="Circular Progress">
|
|
1441
|
+
<div className="space-y-6">
|
|
1442
|
+
<div className="space-y-2">
|
|
1443
|
+
<p className="text-sm font-medium text-muted-foreground">Sizes</p>
|
|
1444
|
+
<div className="flex items-center gap-6">
|
|
1445
|
+
<CircularProgress value={65} size="sm" label="Small: 65%" />
|
|
1446
|
+
<CircularProgress value={65} size="default" label="Default: 65%" />
|
|
1447
|
+
<CircularProgress value={65} size="lg" label="Large: 65%" />
|
|
1448
|
+
</div>
|
|
1449
|
+
</div>
|
|
1450
|
+
<div className="space-y-2">
|
|
1451
|
+
<p className="text-sm font-medium text-muted-foreground">Variants</p>
|
|
1452
|
+
<div className="flex items-center gap-6">
|
|
1453
|
+
<CircularProgress value={65} variant="default" label="default: 65%" />
|
|
1454
|
+
<CircularProgress value={65} variant="muted" label="muted: 65%" />
|
|
1455
|
+
<CircularProgress value={100} variant="success" label="success: 100%" />
|
|
1456
|
+
<CircularProgress value={55} variant="warning" label="warning: 55%" />
|
|
1457
|
+
<CircularProgress value={20} variant="destructive" label="destructive: 20%" />
|
|
1458
|
+
</div>
|
|
1459
|
+
</div>
|
|
1460
|
+
<div className="space-y-2">
|
|
1461
|
+
<p className="text-sm font-medium text-muted-foreground">With center label</p>
|
|
1462
|
+
<div className="flex items-center gap-6">
|
|
1463
|
+
<CircularProgress value={72} size="lg" label="Storage: 72%">
|
|
1464
|
+
<span className="text-xs font-semibold">72%</span>
|
|
1465
|
+
</CircularProgress>
|
|
1466
|
+
<CircularProgress value={100} size="lg" variant="success" label="Complete">
|
|
1467
|
+
<span className="text-xs font-semibold">✓</span>
|
|
1468
|
+
</CircularProgress>
|
|
1469
|
+
</div>
|
|
1470
|
+
</div>
|
|
1471
|
+
<div className="space-y-2">
|
|
1472
|
+
<p className="text-sm font-medium text-muted-foreground">Indeterminate</p>
|
|
1473
|
+
<CircularProgress label="Loading…" />
|
|
1474
|
+
</div>
|
|
1475
|
+
</div>
|
|
1476
|
+
</Section>
|
|
1477
|
+
|
|
1478
|
+
{/* ── Indicator ────────────────────────────────────────────── */}
|
|
1479
|
+
<Section title="Indicator"> <div className="space-y-6">
|
|
1480
|
+
{/* Variants */}
|
|
1481
|
+
<div className="space-y-3">
|
|
1482
|
+
<p className="text-sm font-medium text-muted-foreground">Variants</p>
|
|
1483
|
+
<div className="flex flex-wrap items-center gap-6">
|
|
1484
|
+
{(["default", "secondary", "destructive", "success", "warning"] as const).map((v) => (
|
|
1485
|
+
<div key={v} className="flex flex-col items-center gap-2">
|
|
1486
|
+
<Indicator variant={v} label={v === "destructive" ? 3 : undefined}>
|
|
1487
|
+
<div className="size-10 rounded-md border bg-muted" />
|
|
1488
|
+
</Indicator>
|
|
1489
|
+
<span className="text-xs text-muted-foreground">{v}</span>
|
|
1490
|
+
</div>
|
|
1491
|
+
))} </div>
|
|
1492
|
+
</div>
|
|
1493
|
+
{/* Sizes */}
|
|
1494
|
+
<div className="space-y-3">
|
|
1495
|
+
<p className="text-sm font-medium text-muted-foreground">Sizes</p>
|
|
1496
|
+
<div className="flex items-center gap-6">
|
|
1497
|
+
<div className="flex flex-col items-center gap-2">
|
|
1498
|
+
<Indicator size="sm"><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1499
|
+
<span className="text-xs text-muted-foreground">sm</span>
|
|
1500
|
+
</div>
|
|
1501
|
+
<div className="flex flex-col items-center gap-2">
|
|
1502
|
+
<Indicator size="default" label={4}><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1503
|
+
<span className="text-xs text-muted-foreground">default</span>
|
|
1504
|
+
</div>
|
|
1505
|
+
<div className="flex flex-col items-center gap-2">
|
|
1506
|
+
<Indicator size="lg" label={12}><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1507
|
+
<span className="text-xs text-muted-foreground">lg</span>
|
|
1508
|
+
</div>
|
|
1509
|
+
</div>
|
|
1510
|
+
</div>
|
|
1511
|
+
{/* Processing */}
|
|
1512
|
+
<div className="space-y-3">
|
|
1513
|
+
<p className="text-sm font-medium text-muted-foreground">Processing (ping)</p>
|
|
1514
|
+
<div className="flex items-center gap-6">
|
|
1515
|
+
<Indicator processing variant="success"><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1516
|
+
<Indicator processing variant="destructive"><div className="size-10 rounded-md border bg-muted" /></Indicator>
|
|
1517
|
+
</div>
|
|
1518
|
+
</div>
|
|
1519
|
+
{/* Realistic use */}
|
|
1520
|
+
<div className="space-y-3">
|
|
1521
|
+
<p className="text-sm font-medium text-muted-foreground">Online status + notification count</p>
|
|
1522
|
+
<div className="flex items-center gap-6">
|
|
1523
|
+
<Indicator position="bottom-right" variant="success" withBorder>
|
|
1524
|
+
<div className="size-10 rounded-full border bg-muted flex items-center justify-center text-sm font-medium">JL</div>
|
|
1525
|
+
</Indicator>
|
|
1526
|
+
<Indicator label={9} variant="destructive">
|
|
1527
|
+
<div className="size-10 rounded-md border bg-muted flex items-center justify-center">
|
|
1528
|
+
<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>
|
|
1529
|
+
</div>
|
|
1530
|
+
</Indicator> </div>
|
|
1531
|
+
</div>
|
|
1532
|
+
</div>
|
|
1533
|
+
</Section>
|
|
1534
|
+
|
|
1535
|
+
{/* ── CopyButton ───────────────────────────────────────────── */}
|
|
1536
|
+
<Section title="CopyButton"> <div className="space-y-6">
|
|
1537
|
+
{/* Variants */}
|
|
1538
|
+
<div className="space-y-3">
|
|
1539
|
+
<p className="text-sm font-medium text-muted-foreground">Variants</p>
|
|
1540
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
1541
|
+
<CopyButton value="default" variant="default">Copy</CopyButton>
|
|
1542
|
+
<CopyButton value="outline" variant="outline">Copy</CopyButton>
|
|
1543
|
+
<CopyButton value="secondary" variant="secondary">Copy</CopyButton>
|
|
1544
|
+
<CopyButton value="ghost" variant="ghost">Copy</CopyButton> </div>
|
|
1545
|
+
</div>
|
|
1546
|
+
{/* Sizes */}
|
|
1547
|
+
<div className="space-y-3">
|
|
1548
|
+
<p className="text-sm font-medium text-muted-foreground">Sizes</p>
|
|
1549
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
1550
|
+
<CopyButton value="sm" size="sm" variant="outline">Copy</CopyButton>
|
|
1551
|
+
<CopyButton value="default" size="default" variant="outline">Copy</CopyButton>
|
|
1552
|
+
<CopyButton value="lg" size="lg" variant="outline">Copy</CopyButton>
|
|
1553
|
+
</div>
|
|
1554
|
+
</div>
|
|
1555
|
+
{/* Icon-only */}
|
|
1556
|
+
<div className="space-y-3">
|
|
1557
|
+
<p className="text-sm font-medium text-muted-foreground">Icon-only</p>
|
|
1558
|
+
<div className="flex items-center gap-3">
|
|
1559
|
+
<CopyButton value="abc" size="icon-sm" variant="ghost" aria-label="Copy token" />
|
|
1560
|
+
<CopyButton value="abc" size="icon" variant="outline" aria-label="Copy value" />
|
|
1561
|
+
<CopyButton value="abc" size="icon-lg" variant="secondary" aria-label="Copy large" />
|
|
1562
|
+
</div>
|
|
1563
|
+
</div>
|
|
1564
|
+
{/* Realistic use — API key row */}
|
|
1565
|
+
<div className="space-y-3">
|
|
1566
|
+
<p className="text-sm font-medium text-muted-foreground">API key row</p>
|
|
1567
|
+
<div className="flex w-full max-w-sm items-center gap-2 rounded-md border bg-muted px-3 py-2">
|
|
1568
|
+
<code className="min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground">
|
|
1569
|
+
sk-proj-Xk9mNpQ2vR7tLwYjAb4cDeFgHiJkLmNo
|
|
1570
|
+
</code>
|
|
1571
|
+
<CopyButton
|
|
1572
|
+
value="sk-proj-Xk9mNpQ2vR7tLwYjAb4cDeFgHiJkLmNo"
|
|
1573
|
+
size="icon-sm"
|
|
1574
|
+
variant="ghost"
|
|
1575
|
+
aria-label="Copy API key"
|
|
1576
|
+
/> </div>
|
|
1577
|
+
</div>
|
|
1578
|
+
</div>
|
|
1579
|
+
</Section>
|
|
1580
|
+
|
|
1375
1581
|
{/* ── Aspect Ratio ─────────────────────────────────────────── */}
|
|
1376
1582
|
<Section title="Aspect Ratio">
|
|
1377
1583
|
<div className="space-y-6">
|
|
@@ -1734,6 +1940,55 @@ export default function ComponentsPreview() {
|
|
|
1734
1940
|
</div>
|
|
1735
1941
|
</div>
|
|
1736
1942
|
</Section>
|
|
1943
|
+
<Section title="MultiSelect">
|
|
1944
|
+
<div className="space-y-6">
|
|
1945
|
+
<div className="space-y-3">
|
|
1946
|
+
<p className="text-sm font-medium text-muted-foreground">Default</p>
|
|
1947
|
+
<div className="max-w-xs">
|
|
1948
|
+
<MultiSelect
|
|
1949
|
+
options={[
|
|
1950
|
+
{ value: "next", label: "Next.js" },
|
|
1951
|
+
{ value: "remix", label: "Remix" },
|
|
1952
|
+
{ value: "astro", label: "Astro" },
|
|
1953
|
+
{ value: "sveltekit", label: "SvelteKit" },
|
|
1954
|
+
]}
|
|
1955
|
+
value={["next", "remix"]}
|
|
1956
|
+
onValueChange={() => {}}
|
|
1957
|
+
/>
|
|
1958
|
+
</div>
|
|
1959
|
+
</div>
|
|
1960
|
+
<div className="space-y-3">
|
|
1961
|
+
<p className="text-sm font-medium text-muted-foreground">With maxCount=2</p>
|
|
1962
|
+
<div className="max-w-xs">
|
|
1963
|
+
<MultiSelect
|
|
1964
|
+
options={[
|
|
1965
|
+
{ value: "next", label: "Next.js" },
|
|
1966
|
+
{ value: "remix", label: "Remix" },
|
|
1967
|
+
{ value: "astro", label: "Astro" },
|
|
1968
|
+
{ value: "sveltekit", label: "SvelteKit" },
|
|
1969
|
+
]}
|
|
1970
|
+
value={["next", "remix", "astro"]}
|
|
1971
|
+
onValueChange={() => {}}
|
|
1972
|
+
maxCount={2}
|
|
1973
|
+
/>
|
|
1974
|
+
</div>
|
|
1975
|
+
</div>
|
|
1976
|
+
<div className="space-y-3">
|
|
1977
|
+
<p className="text-sm font-medium text-muted-foreground">Disabled</p>
|
|
1978
|
+
<div className="max-w-xs">
|
|
1979
|
+
<MultiSelect
|
|
1980
|
+
options={[
|
|
1981
|
+
{ value: "next", label: "Next.js" },
|
|
1982
|
+
{ value: "remix", label: "Remix" },
|
|
1983
|
+
]}
|
|
1984
|
+
value={["next"]}
|
|
1985
|
+
onValueChange={() => {}}
|
|
1986
|
+
disabled
|
|
1987
|
+
/>
|
|
1988
|
+
</div>
|
|
1989
|
+
</div>
|
|
1990
|
+
</div>
|
|
1991
|
+
</Section>
|
|
1737
1992
|
<Section title="Context Menu">
|
|
1738
1993
|
<div className="space-y-6">
|
|
1739
1994
|
<div className="space-y-3">
|
|
@@ -2444,6 +2699,123 @@ export default function ComponentsPreview() {
|
|
|
2444
2699
|
</div>
|
|
2445
2700
|
</Section>
|
|
2446
2701
|
|
|
2702
|
+
<Section title="List">
|
|
2703
|
+
<div className="flex flex-wrap gap-8 items-start">
|
|
2704
|
+
<div className="space-y-1.5">
|
|
2705
|
+
<p className="text-xs font-medium text-muted-foreground">Default (unordered)</p>
|
|
2706
|
+
<List className="w-64">
|
|
2707
|
+
<ListItem>Practice every Monday at 6 AM</ListItem>
|
|
2708
|
+
<ListItem>Check the coach board for lane assignments</ListItem>
|
|
2709
|
+
<ListItem>Bring your own cap and goggles</ListItem>
|
|
2710
|
+
<ListItem>Sign in at the front desk before entering the pool</ListItem>
|
|
2711
|
+
</List>
|
|
2712
|
+
</div>
|
|
2713
|
+
<div className="space-y-1.5">
|
|
2714
|
+
<p className="text-xs font-medium text-muted-foreground">With icons</p>
|
|
2715
|
+
<List className="w-64">
|
|
2716
|
+
<ListItem icon={<CheckIcon />}>Pool access included</ListItem>
|
|
2717
|
+
<ListItem icon={<CheckIcon />}>Video stroke analysis</ListItem>
|
|
2718
|
+
<ListItem icon={<CheckIcon />}>Monthly progress report</ListItem>
|
|
2719
|
+
<ListItem icon={<XIcon className="text-destructive" />}>Open swim excluded</ListItem>
|
|
2720
|
+
</List>
|
|
2721
|
+
</div>
|
|
2722
|
+
<div className="space-y-1.5">
|
|
2723
|
+
<p className="text-xs font-medium text-muted-foreground">Spacing variants</p>
|
|
2724
|
+
<div className="space-y-4">
|
|
2725
|
+
<List spacing="sm" className="w-48">
|
|
2726
|
+
<ListItem icon={<ZapIcon />}>sm — gap-1</ListItem>
|
|
2727
|
+
<ListItem icon={<ZapIcon />}>Fast warm-up</ListItem>
|
|
2728
|
+
<ListItem icon={<ZapIcon />}>Main set</ListItem>
|
|
2729
|
+
</List>
|
|
2730
|
+
<List spacing="lg" className="w-48">
|
|
2731
|
+
<ListItem icon={<StarIcon />}>lg — gap-3</ListItem>
|
|
2732
|
+
<ListItem icon={<StarIcon />}>Content-heavy</ListItem>
|
|
2733
|
+
<ListItem icon={<StarIcon />}>More breathing room</ListItem>
|
|
2734
|
+
</List>
|
|
2735
|
+
</div>
|
|
2736
|
+
</div>
|
|
2737
|
+
<div className="space-y-1.5">
|
|
2738
|
+
<p className="text-xs font-medium text-muted-foreground">Realistic use — membership card</p>
|
|
2739
|
+
<Card className="w-72">
|
|
2740
|
+
<CardContent className="p-5 space-y-4">
|
|
2741
|
+
<div>
|
|
2742
|
+
<h3 className="text-sm font-semibold">Premier Membership includes</h3>
|
|
2743
|
+
<p className="text-xs text-muted-foreground mt-0.5">Everything in Standard, plus:</p>
|
|
2744
|
+
</div>
|
|
2745
|
+
<List spacing="sm">
|
|
2746
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>Unlimited pool access, all sessions</ListItem>
|
|
2747
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>Personal stroke video review (monthly)</ListItem>
|
|
2748
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>Priority meet registration</ListItem>
|
|
2749
|
+
<ListItem icon={<XIcon className="text-muted-foreground" />}>
|
|
2750
|
+
<span className="text-muted-foreground">Guest passes not included</span>
|
|
2751
|
+
</ListItem>
|
|
2752
|
+
</List>
|
|
2753
|
+
</CardContent>
|
|
2754
|
+
</Card>
|
|
2755
|
+
</div>
|
|
2756
|
+
</div>
|
|
2757
|
+
</Section>
|
|
2758
|
+
|
|
2759
|
+
<Section title="EmptyState">
|
|
2760
|
+
<div className="flex flex-wrap gap-8 items-start">
|
|
2761
|
+
<div className="space-y-1.5">
|
|
2762
|
+
<p className="text-xs font-medium text-muted-foreground">Default</p>
|
|
2763
|
+
<EmptyState className="w-72 border border-border rounded-lg">
|
|
2764
|
+
<EmptyStateIcon>
|
|
2765
|
+
<InboxIcon strokeWidth={1.5} />
|
|
2766
|
+
</EmptyStateIcon>
|
|
2767
|
+
<EmptyStateTitle>No messages yet</EmptyStateTitle>
|
|
2768
|
+
<EmptyStateDescription>
|
|
2769
|
+
Messages from your coach will appear here after your first session.
|
|
2770
|
+
</EmptyStateDescription>
|
|
2771
|
+
</EmptyState>
|
|
2772
|
+
</div>
|
|
2773
|
+
<div className="space-y-1.5">
|
|
2774
|
+
<p className="text-xs font-medium text-muted-foreground">With action</p>
|
|
2775
|
+
<EmptyState className="w-72 border border-border rounded-lg">
|
|
2776
|
+
<EmptyStateIcon>
|
|
2777
|
+
<CalendarIcon strokeWidth={1.5} />
|
|
2778
|
+
</EmptyStateIcon>
|
|
2779
|
+
<EmptyStateTitle>No practices scheduled</EmptyStateTitle>
|
|
2780
|
+
<EmptyStateDescription>
|
|
2781
|
+
Add a practice block to start tracking attendance and yardage.
|
|
2782
|
+
</EmptyStateDescription>
|
|
2783
|
+
<EmptyStateAction>
|
|
2784
|
+
<Button size="sm">
|
|
2785
|
+
<PlusIcon strokeWidth={1.5} />
|
|
2786
|
+
Schedule practice
|
|
2787
|
+
</Button>
|
|
2788
|
+
</EmptyStateAction>
|
|
2789
|
+
</EmptyState>
|
|
2790
|
+
</div>
|
|
2791
|
+
<div className="space-y-1.5">
|
|
2792
|
+
<p className="text-xs font-medium text-muted-foreground">Error / destructive</p>
|
|
2793
|
+
<EmptyState className="w-72 border border-border rounded-lg">
|
|
2794
|
+
<EmptyStateIcon className="bg-destructive/10 text-destructive">
|
|
2795
|
+
<WifiOffIcon strokeWidth={1.5} />
|
|
2796
|
+
</EmptyStateIcon>
|
|
2797
|
+
<EmptyStateTitle>Couldn't load roster</EmptyStateTitle>
|
|
2798
|
+
<EmptyStateDescription>
|
|
2799
|
+
Check your connection and try again. Your data is safe.
|
|
2800
|
+
</EmptyStateDescription>
|
|
2801
|
+
<EmptyStateAction>
|
|
2802
|
+
<Button variant="outline" size="sm">Retry</Button>
|
|
2803
|
+
</EmptyStateAction>
|
|
2804
|
+
</EmptyState>
|
|
2805
|
+
</div>
|
|
2806
|
+
<div className="space-y-1.5">
|
|
2807
|
+
<p className="text-xs font-medium text-muted-foreground">sm — inline card</p>
|
|
2808
|
+
<EmptyState size="sm" className="w-56 border border-border rounded-lg">
|
|
2809
|
+
<EmptyStateIcon className="size-9 [&>svg]:size-5">
|
|
2810
|
+
<ClipboardListIcon strokeWidth={1.5} />
|
|
2811
|
+
</EmptyStateIcon>
|
|
2812
|
+
<EmptyStateTitle>No notes yet</EmptyStateTitle>
|
|
2813
|
+
<EmptyStateDescription>Add a note to this set.</EmptyStateDescription>
|
|
2814
|
+
</EmptyState>
|
|
2815
|
+
</div>
|
|
2816
|
+
</div>
|
|
2817
|
+
</Section>
|
|
2818
|
+
|
|
2447
2819
|
<Section title="Color Picker">
|
|
2448
2820
|
<div className="flex flex-wrap gap-8 items-start">
|
|
2449
2821
|
<div className="space-y-1.5">
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../lib/utils"
|
|
4
|
+
|
|
5
|
+
// ─── ButtonGroup ──────────────────────────────────────────────────────────────
|
|
6
|
+
// Groups adjacent Button primitives with shared borders and no interior radii.
|
|
7
|
+
// Targets [data-slot="button"] so it composes with Button's asChild mode too.
|
|
8
|
+
|
|
9
|
+
export interface ButtonGroupProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
10
|
+
/** "horizontal" (default) | "vertical" */
|
|
11
|
+
orientation?: "horizontal" | "vertical"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function ButtonGroup({
|
|
15
|
+
className,
|
|
16
|
+
orientation = "horizontal",
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}: ButtonGroupProps) {
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
role="group"
|
|
23
|
+
data-slot="button-group"
|
|
24
|
+
data-orientation={orientation}
|
|
25
|
+
className={cn(
|
|
26
|
+
"inline-flex",
|
|
27
|
+
orientation === "vertical" ? "flex-col" : "flex-row",
|
|
28
|
+
// Strip radii from every direct Button child
|
|
29
|
+
"[&>[data-slot=button]]:rounded-none",
|
|
30
|
+
orientation === "horizontal"
|
|
31
|
+
? [
|
|
32
|
+
// Restore outer corners
|
|
33
|
+
"[&>[data-slot=button]:first-child]:rounded-l-md",
|
|
34
|
+
"[&>[data-slot=button]:last-child]:rounded-r-md",
|
|
35
|
+
// Collapse shared border between siblings
|
|
36
|
+
"[&>[data-slot=button]:not(:first-child)]:-ml-px",
|
|
37
|
+
// Lift hovered / focused button so its border isn't clipped by sibling
|
|
38
|
+
"[&>[data-slot=button]:hover]:z-10",
|
|
39
|
+
"[&>[data-slot=button]:focus-visible]:z-10",
|
|
40
|
+
]
|
|
41
|
+
: [
|
|
42
|
+
"[&>[data-slot=button]:first-child]:rounded-t-md",
|
|
43
|
+
"[&>[data-slot=button]:last-child]:rounded-b-md",
|
|
44
|
+
"[&>[data-slot=button]:not(:first-child)]:-mt-px",
|
|
45
|
+
"[&>[data-slot=button]:hover]:z-10",
|
|
46
|
+
"[&>[data-slot=button]:focus-visible]:z-10",
|
|
47
|
+
],
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { ButtonGroup }
|
|
@@ -205,6 +205,10 @@ function CalendarDayButton({
|
|
|
205
205
|
data-range-end={modifiers.range_end}
|
|
206
206
|
data-range-middle={modifiers.range_middle}
|
|
207
207
|
className={cn(
|
|
208
|
+
// shadcn calendar day-cell default weight; the nested [&>span] day-number
|
|
209
|
+
// is text-xs. Bumping day numbers to font-medium is a visual change to this
|
|
210
|
+
// shared primitive — deferred to a design decision, not a mechanical fix.
|
|
211
|
+
// allow-font-normal-small
|
|
208
212
|
"flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",
|
|
209
213
|
defaultClassNames.day,
|
|
210
214
|
className
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
|
+
import { cn } from "../../lib/utils"
|
|
6
|
+
|
|
7
|
+
const SIZES = {
|
|
8
|
+
sm: { size: 32, strokeWidth: 3 },
|
|
9
|
+
default: { size: 48, strokeWidth: 4 },
|
|
10
|
+
lg: { size: 64, strokeWidth: 5 },
|
|
11
|
+
} as const
|
|
12
|
+
|
|
13
|
+
type SizeKey = keyof typeof SIZES
|
|
14
|
+
|
|
15
|
+
const circularProgressVariants = cva(
|
|
16
|
+
"inline-flex items-center justify-center relative",
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: "text-primary",
|
|
21
|
+
muted: "text-muted-foreground",
|
|
22
|
+
success: "text-[hsl(var(--success))]",
|
|
23
|
+
warning: "text-[hsl(var(--warning))]",
|
|
24
|
+
destructive: "text-destructive",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default",
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
export interface CircularProgressProps
|
|
34
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
35
|
+
VariantProps<typeof circularProgressVariants> {
|
|
36
|
+
/** 0–100. Omit for indeterminate (spinning) mode. */
|
|
37
|
+
value?: number
|
|
38
|
+
/** Required: describes what is progressing for screen readers */
|
|
39
|
+
label: string
|
|
40
|
+
size?: SizeKey
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function CircularProgress({
|
|
44
|
+
value,
|
|
45
|
+
label,
|
|
46
|
+
variant = "default",
|
|
47
|
+
size = "default",
|
|
48
|
+
className,
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
}: CircularProgressProps) {
|
|
52
|
+
const determinate = value !== undefined
|
|
53
|
+
const clampedValue = determinate ? Math.min(100, Math.max(0, value!)) : 0
|
|
54
|
+
const { size: svgSize, strokeWidth } = SIZES[size ?? "default"]
|
|
55
|
+
const cx = svgSize / 2
|
|
56
|
+
const cy = svgSize / 2
|
|
57
|
+
// Radius keeps entire stroke inside the viewBox
|
|
58
|
+
const radius = svgSize / 2 - strokeWidth
|
|
59
|
+
const circumference = 2 * Math.PI * radius
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
role="progressbar"
|
|
64
|
+
aria-valuenow={determinate ? clampedValue : undefined}
|
|
65
|
+
aria-valuemin={0}
|
|
66
|
+
aria-valuemax={100}
|
|
67
|
+
aria-label={label}
|
|
68
|
+
data-slot="circular-progress"
|
|
69
|
+
data-size={size}
|
|
70
|
+
data-variant={variant}
|
|
71
|
+
className={cn(circularProgressVariants({ variant }), className)}
|
|
72
|
+
{...props}
|
|
73
|
+
>
|
|
74
|
+
<svg
|
|
75
|
+
width={svgSize}
|
|
76
|
+
height={svgSize}
|
|
77
|
+
viewBox={`0 0 ${svgSize} ${svgSize}`}
|
|
78
|
+
fill="none"
|
|
79
|
+
className={cn(
|
|
80
|
+
"-rotate-90",
|
|
81
|
+
!determinate && "animate-spin"
|
|
82
|
+
)}
|
|
83
|
+
aria-hidden="true"
|
|
84
|
+
>
|
|
85
|
+
{/* Track */}
|
|
86
|
+
<circle
|
|
87
|
+
cx={cx}
|
|
88
|
+
cy={cy}
|
|
89
|
+
r={radius}
|
|
90
|
+
strokeWidth={strokeWidth}
|
|
91
|
+
className="stroke-current opacity-20"
|
|
92
|
+
/>
|
|
93
|
+
{/* Fill */}
|
|
94
|
+
<circle
|
|
95
|
+
cx={cx}
|
|
96
|
+
cy={cy}
|
|
97
|
+
r={radius}
|
|
98
|
+
strokeWidth={strokeWidth}
|
|
99
|
+
strokeLinecap="round"
|
|
100
|
+
className="stroke-current transition-[stroke-dashoffset]"
|
|
101
|
+
style={{
|
|
102
|
+
strokeDasharray: determinate ? circumference : circumference * 0.75,
|
|
103
|
+
strokeDashoffset: determinate
|
|
104
|
+
? circumference * (1 - clampedValue / 100)
|
|
105
|
+
: 0,
|
|
106
|
+
transitionDuration: "var(--duration-base)",
|
|
107
|
+
transitionTimingFunction: "var(--ease-out)",
|
|
108
|
+
}}
|
|
109
|
+
/>
|
|
110
|
+
</svg>
|
|
111
|
+
{children !== undefined && (
|
|
112
|
+
<span className="absolute" aria-hidden="true">
|
|
113
|
+
{children}
|
|
114
|
+
</span>
|
|
115
|
+
)}
|
|
116
|
+
</div>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { CircularProgress, circularProgressVariants }
|