@behavioral-agentic-design-system/core 0.18.0 → 0.21.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 +1 -1
- package/src/app/preview/components/page.tsx +247 -234
- package/src/app/shell.tsx +57 -4
- package/src/components/onboarding-wizard.tsx +1 -1
- package/src/components/ui/color-picker.tsx +454 -74
- package/src/stories/Accordion.stories.tsx +12 -9
- package/src/stories/ButtonGroup.stories.tsx +16 -16
- package/src/stories/ColorPicker.stories.tsx +53 -1
- package/src/stories/DatePicker.stories.tsx +2 -2
- package/src/stories/EmptyState.stories.tsx +21 -21
- package/src/stories/List.stories.tsx +28 -28
- package/src/stories/RatingGroup.stories.tsx +2 -2
- package/src/stories/SegmentedControl.stories.tsx +3 -3
- package/src/stories/TagsInput.stories.tsx +21 -21
- package/src/stories/Timeline.stories.tsx +50 -50
package/src/app/shell.tsx
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { useState, useEffect, useRef, useCallback, createContext, useContext, useMemo } from "react";
|
|
4
4
|
import { Tabs, TabsContent, TabsList, TabsPanels, TabsTrigger } from "@behavioral-agentic-design-system/core/components/ui/tabs";
|
|
5
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@behavioral-agentic-design-system/core/components/ui/sheet";
|
|
5
6
|
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
6
7
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
7
|
-
import { Sun, Moon, BookOpen, X, ExternalLink } from "lucide-react";
|
|
8
|
+
import { Sun, Moon, BookOpen, X, ExternalLink, Menu } from "lucide-react";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Inline GitHub mark. Lucide dropped brand icons (Github / Twitter / etc.) in
|
|
@@ -188,13 +189,15 @@ export const DEFAULT_TABS: ShellTab[] = [
|
|
|
188
189
|
*
|
|
189
190
|
* Forks that just want the default shell don't need to import this directly —
|
|
190
191
|
* they can re-export `@behavioral-agentic-design-system/core/app/page`. Use
|
|
191
|
-
* Shell directly when you need custom tabs (e.g.
|
|
192
|
-
*
|
|
192
|
+
* Shell directly when you need custom tabs (e.g. Components, Tokens, Changelog
|
|
193
|
+
* for a design-system docs site).
|
|
193
194
|
*/
|
|
194
195
|
export function Shell({ tabs, defaultTab }: ShellProps) {
|
|
195
196
|
const initialTab = defaultTab ?? tabs[0]?.value ?? "home";
|
|
196
197
|
const [activeTab, setActiveTab] = useState(initialTab);
|
|
197
198
|
const [dark, setDark] = useState(false);
|
|
199
|
+
// Mobile nav: below md the tab strip collapses into a hamburger + Sheet.
|
|
200
|
+
const [mobileNavOpen, setMobileNavOpen] = useState(false);
|
|
198
201
|
// Fresh-fork onboarding: only render when brand still says "BADS" (the rename
|
|
199
202
|
// hasn't run yet) AND the user hasn't dismissed the wizard this session.
|
|
200
203
|
// Renamed forks never see this — they've already gone through onboarding.
|
|
@@ -510,7 +513,25 @@ export function Shell({ tabs, defaultTab }: ShellProps) {
|
|
|
510
513
|
style={{ "--tabs-fade-duration": "260ms" } as React.CSSProperties}
|
|
511
514
|
className="flex-1 flex flex-col overflow-hidden"
|
|
512
515
|
>
|
|
513
|
-
<
|
|
516
|
+
{/* Mobile (<md): hamburger + active-tab label. The full tab strip is
|
|
517
|
+
hard to use on a phone, so it collapses into a Sheet drawer. */}
|
|
518
|
+
<div className="mt-2 mb-1 flex w-full items-center gap-2 px-4 md:hidden">
|
|
519
|
+
<Button
|
|
520
|
+
variant="ghost"
|
|
521
|
+
size="icon"
|
|
522
|
+
onClick={() => setMobileNavOpen(true)}
|
|
523
|
+
aria-label="Open navigation menu"
|
|
524
|
+
className="size-8 shrink-0 border border-foreground/30"
|
|
525
|
+
>
|
|
526
|
+
<Menu className="h-4 w-4" strokeWidth={1.5} />
|
|
527
|
+
</Button>
|
|
528
|
+
<span className="truncate text-sm font-medium text-foreground">
|
|
529
|
+
{tabs.find((t) => t.value === activeTab)?.label}
|
|
530
|
+
</span>
|
|
531
|
+
</div>
|
|
532
|
+
|
|
533
|
+
{/* Desktop (md+): the horizontal tab strip. */}
|
|
534
|
+
<div className="mt-2 mb-1 hidden w-full items-center px-4 overflow-x-auto scrollbar-none md:flex">
|
|
514
535
|
<TabsList className="bg-background text-muted-foreground inline-flex w-max shrink-0 items-center justify-center rounded-full px-0">
|
|
515
536
|
{tabs.map((tab) => (
|
|
516
537
|
<TabsTrigger
|
|
@@ -545,6 +566,38 @@ export function Shell({ tabs, defaultTab }: ShellProps) {
|
|
|
545
566
|
</section>
|
|
546
567
|
</Tabs>
|
|
547
568
|
|
|
569
|
+
{/* Mobile navigation drawer — the tab list as a Sheet for small screens.
|
|
570
|
+
Excludes tabs marked hidden:"md" (dense iframe tabs that don't read
|
|
571
|
+
well on mobile), matching the desktop strip's behavior. */}
|
|
572
|
+
<Sheet open={mobileNavOpen} onOpenChange={setMobileNavOpen}>
|
|
573
|
+
<SheetContent side="left" className="w-72">
|
|
574
|
+
<SheetHeader>
|
|
575
|
+
<SheetTitle>{brand.name}</SheetTitle>
|
|
576
|
+
</SheetHeader>
|
|
577
|
+
<nav className="mt-4 flex flex-col gap-1 px-2">
|
|
578
|
+
{tabs
|
|
579
|
+
.filter((tab) => tab.hidden !== "md")
|
|
580
|
+
.map((tab) => (
|
|
581
|
+
<button
|
|
582
|
+
key={tab.value}
|
|
583
|
+
type="button"
|
|
584
|
+
onClick={() => {
|
|
585
|
+
selectTab(tab.value);
|
|
586
|
+
setMobileNavOpen(false);
|
|
587
|
+
}}
|
|
588
|
+
className={`rounded-md px-3 py-2 text-left text-sm font-medium transition-colors ${
|
|
589
|
+
activeTab === tab.value
|
|
590
|
+
? "bg-primary text-primary-foreground"
|
|
591
|
+
: "text-foreground hover:bg-muted"
|
|
592
|
+
}`}
|
|
593
|
+
>
|
|
594
|
+
{tab.label}
|
|
595
|
+
</button>
|
|
596
|
+
))}
|
|
597
|
+
</nav>
|
|
598
|
+
</SheetContent>
|
|
599
|
+
</Sheet>
|
|
600
|
+
|
|
548
601
|
{showOnboarding ? (
|
|
549
602
|
<div
|
|
550
603
|
role="dialog"
|
|
@@ -1092,7 +1092,7 @@ export function OnboardingWizard({
|
|
|
1092
1092
|
label="Industry or category"
|
|
1093
1093
|
value={draft.industry}
|
|
1094
1094
|
onChange={(industry) => updateDraft({ industry })}
|
|
1095
|
-
placeholder="Healthcare, education, devtools,
|
|
1095
|
+
placeholder="Healthcare, education, devtools, fintech..."
|
|
1096
1096
|
/>
|
|
1097
1097
|
<TextField
|
|
1098
1098
|
id="onboarding-audience"
|