@behavioral-agentic-design-system/core 0.23.0 → 0.26.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.
Files changed (139) hide show
  1. package/package.json +8 -4
  2. package/scripts/build-tokens.cjs +79 -5
  3. package/src/app/preview/components/page.tsx +4760 -213
  4. package/src/app/shell.tsx +18 -6
  5. package/src/components/customize/brand-mark-section.tsx +1 -1
  6. package/src/components/customize-tab.tsx +2 -2
  7. package/src/components/home-tab.tsx +2 -2
  8. package/src/components/ui/action-bar.tsx +142 -0
  9. package/src/components/ui/affix.tsx +109 -0
  10. package/src/components/ui/alert.tsx +37 -3
  11. package/src/components/ui/anchor.tsx +136 -0
  12. package/src/components/ui/angle-slider.tsx +265 -0
  13. package/src/components/ui/autocomplete.tsx +223 -0
  14. package/src/components/ui/avatar.tsx +8 -2
  15. package/src/components/ui/blockquote.tsx +112 -0
  16. package/src/components/ui/bottom-navigation.tsx +144 -0
  17. package/src/components/ui/burger.tsx +117 -0
  18. package/src/components/ui/button.tsx +101 -3
  19. package/src/components/ui/calendar.tsx +1 -1
  20. package/src/components/ui/card.tsx +43 -5
  21. package/src/components/ui/carousel.tsx +10 -5
  22. package/src/components/ui/cascader.tsx +253 -0
  23. package/src/components/ui/checkbox-card.tsx +176 -0
  24. package/src/components/ui/checkbox-group.tsx +231 -0
  25. package/src/components/ui/checkbox.tsx +14 -3
  26. package/src/components/ui/chip.tsx +143 -0
  27. package/src/components/ui/circular-progress.tsx +2 -2
  28. package/src/components/ui/color-swatch.tsx +73 -0
  29. package/src/components/ui/copy-button.tsx +21 -4
  30. package/src/components/ui/data-list.tsx +169 -0
  31. package/src/components/ui/date-picker.tsx +6 -3
  32. package/src/components/ui/date-range-picker.tsx +6 -3
  33. package/src/components/ui/fieldset.tsx +8 -2
  34. package/src/components/ui/float-label.tsx +114 -0
  35. package/src/components/ui/floating-panel.tsx +129 -0
  36. package/src/components/ui/format-number.tsx +122 -0
  37. package/src/components/ui/highlight.tsx +85 -0
  38. package/src/components/ui/image.tsx +195 -0
  39. package/src/components/ui/index.ts +52 -0
  40. package/src/components/ui/indicator.tsx +2 -2
  41. package/src/components/ui/input-group.tsx +11 -1
  42. package/src/components/ui/input.tsx +48 -4
  43. package/src/components/ui/kbd.tsx +1 -1
  44. package/src/components/ui/link.tsx +158 -0
  45. package/src/components/ui/listbox.tsx +426 -0
  46. package/src/components/ui/loading-overlay.tsx +80 -0
  47. package/src/components/ui/marquee.tsx +193 -0
  48. package/src/components/ui/masonry.tsx +164 -0
  49. package/src/components/ui/meter.tsx +186 -0
  50. package/src/components/ui/motion-toggle.tsx +170 -0
  51. package/src/components/ui/notification.tsx +175 -0
  52. package/src/components/ui/overlay.tsx +63 -0
  53. package/src/components/ui/progress.tsx +95 -4
  54. package/src/components/ui/qr-code.tsx +107 -0
  55. package/src/components/ui/rating-group.tsx +1 -0
  56. package/src/components/ui/separator.tsx +57 -1
  57. package/src/components/ui/sidebar.tsx +1 -1
  58. package/src/components/ui/signature-pad.tsx +381 -0
  59. package/src/components/ui/skeleton.tsx +59 -2
  60. package/src/components/ui/skip-link.tsx +117 -0
  61. package/src/components/ui/slider.tsx +86 -1
  62. package/src/components/ui/spoiler.tsx +131 -0
  63. package/src/components/ui/tabs.tsx +1 -1
  64. package/src/components/ui/text.tsx +135 -0
  65. package/src/components/ui/textarea.tsx +66 -2
  66. package/src/components/ui/timeline.tsx +71 -14
  67. package/src/components/ui/timer.tsx +183 -0
  68. package/src/components/ui/tour.tsx +332 -0
  69. package/src/components/ui/transfer-list.tsx +308 -0
  70. package/src/components/ui/visually-hidden.tsx +42 -0
  71. package/src/components/ui/watermark.tsx +0 -0
  72. package/src/data/docs-index.ts +10 -2
  73. package/src/stories/ActionBar.stories.tsx +201 -0
  74. package/src/stories/Affix.stories.tsx +165 -0
  75. package/src/stories/Alert.stories.tsx +58 -0
  76. package/src/stories/Anchor.stories.tsx +236 -0
  77. package/src/stories/AngleSlider.stories.tsx +128 -0
  78. package/src/stories/Autocomplete.stories.tsx +216 -0
  79. package/src/stories/Avatar.stories.tsx +73 -1
  80. package/src/stories/Blockquote.stories.tsx +148 -0
  81. package/src/stories/BottomNavigation.stories.tsx +195 -0
  82. package/src/stories/Burger.stories.tsx +79 -0
  83. package/src/stories/Button.stories.tsx +103 -2
  84. package/src/stories/Calendar.stories.tsx +4 -0
  85. package/src/stories/Card.stories.tsx +30 -0
  86. package/src/stories/Carousel.stories.tsx +2 -1
  87. package/src/stories/Cascader.stories.tsx +285 -0
  88. package/src/stories/Checkbox.stories.tsx +13 -0
  89. package/src/stories/CheckboxCard.stories.tsx +210 -0
  90. package/src/stories/CheckboxGroup.stories.tsx +186 -0
  91. package/src/stories/Chip.stories.tsx +173 -0
  92. package/src/stories/CircularProgress.stories.tsx +3 -0
  93. package/src/stories/ColorSwatch.stories.tsx +81 -0
  94. package/src/stories/CopyButton.stories.tsx +3 -3
  95. package/src/stories/DataList.stories.tsx +160 -0
  96. package/src/stories/DatePicker.stories.tsx +3 -0
  97. package/src/stories/DateRangePicker.stories.tsx +3 -0
  98. package/src/stories/Editable.stories.tsx +14 -0
  99. package/src/stories/Fieldset.stories.tsx +4 -0
  100. package/src/stories/FloatLabel.stories.tsx +148 -0
  101. package/src/stories/FloatingPanel.stories.tsx +176 -0
  102. package/src/stories/FormatNumber.stories.tsx +308 -0
  103. package/src/stories/Highlight.stories.tsx +140 -0
  104. package/src/stories/Image.stories.tsx +141 -0
  105. package/src/stories/Indicator.stories.tsx +3 -0
  106. package/src/stories/Input.stories.tsx +33 -0
  107. package/src/stories/InputGroup.stories.tsx +39 -41
  108. package/src/stories/Kbd.stories.tsx +3 -0
  109. package/src/stories/Link.stories.tsx +198 -0
  110. package/src/stories/Listbox.stories.tsx +240 -0
  111. package/src/stories/LoadingOverlay.stories.tsx +148 -0
  112. package/src/stories/Marquee.stories.tsx +170 -0
  113. package/src/stories/Masonry.stories.tsx +227 -0
  114. package/src/stories/Meter.stories.tsx +143 -0
  115. package/src/stories/MotionToggle.stories.tsx +85 -0
  116. package/src/stories/Notification.stories.tsx +264 -0
  117. package/src/stories/Overlay.stories.tsx +169 -0
  118. package/src/stories/PasswordInput.stories.tsx +4 -0
  119. package/src/stories/Progress.stories.tsx +70 -27
  120. package/src/stories/QrCode.stories.tsx +146 -0
  121. package/src/stories/RatingGroup.stories.tsx +5 -0
  122. package/src/stories/Separator.stories.tsx +41 -5
  123. package/src/stories/Sidebar.stories.tsx +2 -1
  124. package/src/stories/SignaturePad.stories.tsx +112 -0
  125. package/src/stories/Skeleton.stories.tsx +23 -4
  126. package/src/stories/SkipLink.stories.tsx +137 -0
  127. package/src/stories/Slider.stories.tsx +28 -0
  128. package/src/stories/Spoiler.stories.tsx +122 -0
  129. package/src/stories/Tabs.stories.tsx +2 -1
  130. package/src/stories/Text.stories.tsx +191 -0
  131. package/src/stories/Textarea.stories.tsx +58 -6
  132. package/src/stories/Timeline.stories.tsx +82 -0
  133. package/src/stories/Timer.stories.tsx +160 -0
  134. package/src/stories/Tour.stories.tsx +191 -0
  135. package/src/stories/TransferList.stories.tsx +169 -0
  136. package/src/stories/VisuallyHidden.stories.tsx +105 -0
  137. package/src/stories/Watermark.stories.tsx +212 -0
  138. package/src/styles.css +80 -6
  139. package/src/tokens.json +2 -2
@@ -0,0 +1,160 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import * as React from "react";
3
+ import {
4
+ DataList,
5
+ DataListItem,
6
+ DataListLabel,
7
+ DataListValue,
8
+ } from "@behavioral-agentic-design-system/core/components/ui/data-list";
9
+ import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
10
+ import { Separator } from "@behavioral-agentic-design-system/core/components/ui/separator";
11
+
12
+ const meta: Meta<typeof DataList> = {
13
+ title: "Components/DataList",
14
+ component: DataList,
15
+ parameters: {
16
+ layout: "centered",
17
+ docs: {
18
+ description: {
19
+ component:
20
+ "Semantic key–value list. Renders a native <dl> with <dt>/<dd> pairs, so screen readers announce a description list and associate each term with its description — semantics a div grid cannot produce. Orientation vertical (default) stacks label over value; horizontal lays each pair on a grid row with the label column aligned across all rows via CSS subgrid. Sizes sm / default / lg scale rhythm and type. Display-only: no interaction, no motion. Use for profile panels, invoice summaries, settings recaps, metadata blocks.",
21
+ },
22
+ },
23
+ },
24
+ argTypes: {
25
+ orientation: { control: "select", options: ["vertical", "horizontal"] },
26
+ size: { control: "select", options: ["sm", "default", "lg"] },
27
+ },
28
+ };
29
+
30
+ export default meta;
31
+ type Story = StoryObj<typeof meta>;
32
+
33
+ const pair = (label: string, value: React.ReactNode) => (
34
+ <DataListItem>
35
+ <DataListLabel>{label}</DataListLabel>
36
+ <DataListValue>{value}</DataListValue>
37
+ </DataListItem>
38
+ );
39
+
40
+ export const Default: Story = {
41
+ render: () => (
42
+ <DataList className="w-80">
43
+ {pair("Name", "Jordan Reeves")}
44
+ {pair("Role", "Design Systems Lead")}
45
+ {pair("Email", "jordan@reeves.design")}
46
+ {pair("Workspace", "design.bads.com")}
47
+ {pair("Member since", "Jan 15, 2026")}
48
+ </DataList>
49
+ ),
50
+ };
51
+
52
+ export const Orientation_Vertical: Story = {
53
+ render: () => (
54
+ <DataList orientation="vertical" className="w-80">
55
+ {pair("Component", "Button · v2.4.0")}
56
+ {pair("Reviewed by", "Seo-yun Park")}
57
+ {pair("Last token change", "May 26, 2026")}
58
+ {pair("Contrast floor", "7:1 contrast")}
59
+ </DataList>
60
+ ),
61
+ };
62
+
63
+ export const Orientation_Horizontal: Story = {
64
+ render: () => (
65
+ <DataList orientation="horizontal" className="w-96">
66
+ {pair("Invoice", "INV-2026-0187")}
67
+ {pair("Billed to", "Anika Patel")}
68
+ {pair("Billing email", "anika.patel@stripe.com")}
69
+ {pair("Amount", "$249.00")}
70
+ {pair("Issued", "May 26, 2026")}
71
+ {pair(
72
+ "Status",
73
+ <Badge variant="secondary" className="align-middle">
74
+ Paid
75
+ </Badge>,
76
+ )}
77
+ </DataList>
78
+ ),
79
+ };
80
+
81
+ export const Size_Sm: Story = {
82
+ render: () => (
83
+ <DataList size="sm" orientation="horizontal" className="w-80">
84
+ {pair("Owner", "Marcus Lindqvist")}
85
+ {pair("Email", "marcus@lindqvist.dev")}
86
+ {pair("Plan", "Team · $249.00/yr")}
87
+ </DataList>
88
+ ),
89
+ };
90
+
91
+ export const Size_Default: Story = {
92
+ render: () => (
93
+ <DataList size="default" orientation="horizontal" className="w-80">
94
+ {pair("Owner", "Marcus Lindqvist")}
95
+ {pair("Email", "marcus@lindqvist.dev")}
96
+ {pair("Plan", "Team · $249.00/yr")}
97
+ </DataList>
98
+ ),
99
+ };
100
+
101
+ export const Size_Lg: Story = {
102
+ render: () => (
103
+ <DataList size="lg" orientation="horizontal" className="w-96">
104
+ {pair("Owner", "Marcus Lindqvist")}
105
+ {pair("Email", "marcus@lindqvist.dev")}
106
+ {pair("Plan", "Team · $249.00/yr")}
107
+ </DataList>
108
+ ),
109
+ };
110
+
111
+ export const LongValues: Story = {
112
+ render: () => (
113
+ <DataList orientation="horizontal" className="w-80">
114
+ {pair("Full name", "Wilhelmina-Constance Featherstonehaugh-Vance")}
115
+ {pair(
116
+ "Email",
117
+ "wilhelmina.featherstonehaugh-vance@subdomain.consulting.example.org",
118
+ )}
119
+ {pair("Share link", "https://design.bads.com/share/tokens-v2-proposal")}
120
+ </DataList>
121
+ ),
122
+ };
123
+
124
+ export const RealisticUse: Story = {
125
+ render: () => (
126
+ <div className="w-[26rem] rounded-lg border bg-card p-5 shadow-sm">
127
+ <div className="space-y-1">
128
+ <h3 className="text-sm font-semibold text-foreground">
129
+ Invoice INV-2026-0187
130
+ </h3>
131
+ <p className="text-sm text-muted-foreground">
132
+ Design system license · annual renewal
133
+ </p>
134
+ </div>
135
+ <Separator className="my-4" />
136
+ <DataList orientation="horizontal">
137
+ {pair("Billed to", "Jordan Reeves")}
138
+ {pair("Email", "jordan@reeves.design")}
139
+ {pair("Address", "1401 South Congress Ave, Suite 200, Austin, TX 78704")}
140
+ {pair("Issued", "May 26, 2026")}
141
+ {pair("Due", "Nov 20, 2026")}
142
+ {pair(
143
+ "Amount due",
144
+ <span className="font-semibold">$12,500.00</span>,
145
+ )}
146
+ {pair(
147
+ "Status",
148
+ <Badge variant="secondary" className="align-middle">
149
+ Awaiting payment
150
+ </Badge>,
151
+ )}
152
+ </DataList>
153
+ <Separator className="my-4" />
154
+ <DataList size="sm">
155
+ {pair("Includes", "36 components, all passing AAA contrast")}
156
+ {pair("Support contact", "seoyun.park@figma.com")}
157
+ </DataList>
158
+ </div>
159
+ ),
160
+ };
@@ -2,6 +2,9 @@ import * as React from "react";
2
2
  import type { Meta, StoryObj } from "@storybook/react";
3
3
  import { DatePicker } from "@behavioral-agentic-design-system/core/components/ui/date-picker";
4
4
 
5
+ // react-day-picker v10 migration (2026-07-07): fromDate/toDate props preserved
6
+ // on DatePicker — they now map to startMonth/endMonth + disabled internally.
7
+ // Story coverage is unchanged; the public API is backward-compatible.
5
8
  const meta: Meta<typeof DatePicker> = {
6
9
  title: "Components/DatePicker",
7
10
  component: DatePicker,
@@ -5,6 +5,9 @@ import {
5
5
  DateRangeValue,
6
6
  } from "@behavioral-agentic-design-system/core/components/ui/date-range-picker"
7
7
 
8
+ // react-day-picker v10 migration (2026-07-07): fromDate/toDate props preserved
9
+ // on DateRangePicker — they now map to startMonth/endMonth + disabled internally.
10
+ // Story coverage is unchanged; the public API is backward-compatible.
8
11
  const meta: Meta<typeof DateRangePicker> = {
9
12
  title: "Components/DateRangePicker",
10
13
  component: DateRangePicker,
@@ -70,6 +70,20 @@ export const SubmitMode_Enter: Story = {
70
70
  ),
71
71
  }
72
72
 
73
+ export const SubmitMode_Both: Story = {
74
+ render: () => (
75
+ <div className="w-64">
76
+ <Editable defaultValue="Blur or press Enter to save" submitMode="both">
77
+ <EditablePreview />
78
+ <EditableControl>
79
+ <EditableSubmit>Save</EditableSubmit>
80
+ <EditableCancel>Cancel</EditableCancel>
81
+ </EditableControl>
82
+ </Editable>
83
+ </div>
84
+ ),
85
+ }
86
+
73
87
  // Disabled renders as a single dimmed (opacity-50) preview label — the overlay
74
88
  // input stays hidden, so the value is not ghosted over itself.
75
89
  export const Disabled: Story = {
@@ -39,6 +39,10 @@ const notificationRow = (id: string, label: string, defaultChecked = false) => (
39
39
  </div>
40
40
  );
41
41
 
42
+ // Regression guard note: the legend must render IN FLOW (float-left opts out
43
+ // of the browser's native in-border "rendered legend" placement). If the
44
+ // border ever strikes through the legend title again, fieldset.tsx's
45
+ // FieldsetLegend float rule regressed — see the 2026-07-06 prod fix.
42
46
  export const Default: Story = {
43
47
  render: () => (
44
48
  <Fieldset className="w-96">
@@ -0,0 +1,148 @@
1
+ import * as React from "react";
2
+ import { Meta, StoryObj } from "@storybook/react";
3
+ import { FloatLabel } from "@behavioral-agentic-design-system/core/components/ui/float-label";
4
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
5
+ import {
6
+ Card,
7
+ CardContent,
8
+ CardDescription,
9
+ CardHeader,
10
+ CardTitle,
11
+ } from "@behavioral-agentic-design-system/core/components/ui/card";
12
+
13
+ const meta: Meta<typeof FloatLabel> = {
14
+ title: "Components/FloatLabel",
15
+ component: FloatLabel,
16
+ parameters: {
17
+ layout: "centered",
18
+ },
19
+ tags: ["autodocs"],
20
+ };
21
+
22
+ export default meta;
23
+ type Story = StoryObj<typeof meta>;
24
+
25
+ export const Default: Story = {
26
+ args: {
27
+ label: "Email",
28
+ type: "email",
29
+ containerClassName: "w-72",
30
+ },
31
+ };
32
+
33
+ export const Focused: Story = {
34
+ name: "Focused (label floated)",
35
+ render: () => (
36
+ <FloatLabel
37
+ label="Display name"
38
+ type="text"
39
+ autoFocus
40
+ containerClassName="w-72"
41
+ />
42
+ ),
43
+ };
44
+
45
+ export const Filled: Story = {
46
+ name: "Filled (label stays floated on blur)",
47
+ args: {
48
+ label: "Email",
49
+ type: "email",
50
+ defaultValue: "jordan@reeves.design",
51
+ containerClassName: "w-72",
52
+ },
53
+ };
54
+
55
+ export const WithError: Story = {
56
+ render: () => (
57
+ <div className="grid w-72 gap-2">
58
+ <FloatLabel
59
+ label="Email"
60
+ type="email"
61
+ defaultValue="not-an-email"
62
+ aria-invalid
63
+ aria-describedby="float-label-email-error"
64
+ />
65
+ <p id="float-label-email-error" className="text-sm text-destructive">
66
+ Enter a valid email address.
67
+ </p>
68
+ </div>
69
+ ),
70
+ };
71
+
72
+ export const Disabled: Story = {
73
+ args: {
74
+ label: "Workspace slug",
75
+ type: "text",
76
+ defaultValue: "bads-core",
77
+ disabled: true,
78
+ containerClassName: "w-72",
79
+ },
80
+ };
81
+
82
+ export const Required: Story = {
83
+ args: {
84
+ label: "Full name",
85
+ type: "text",
86
+ required: true,
87
+ containerClassName: "w-72",
88
+ },
89
+ };
90
+
91
+ export const Size_SM: Story = {
92
+ args: {
93
+ label: "Search handle",
94
+ size: "sm",
95
+ type: "text",
96
+ containerClassName: "w-72",
97
+ },
98
+ };
99
+
100
+ export const Size_LG: Story = {
101
+ args: {
102
+ label: "Phone",
103
+ size: "lg",
104
+ type: "tel",
105
+ autoComplete: "tel",
106
+ containerClassName: "w-72",
107
+ },
108
+ };
109
+
110
+ export const RealisticUse: Story = {
111
+ name: "RealisticUse (sign-in form)",
112
+ render: () => (
113
+ <Card className="w-80">
114
+ <CardHeader>
115
+ <CardTitle className="text-2xl">Sign in</CardTitle>
116
+ <CardDescription>
117
+ Pick up where you left off in the token workspace.
118
+ </CardDescription>
119
+ </CardHeader>
120
+ <CardContent>
121
+ <form
122
+ className="grid gap-5"
123
+ onSubmit={(e) => e.preventDefault()}
124
+ aria-label="Sign in"
125
+ >
126
+ <div className="grid gap-4">
127
+ <FloatLabel
128
+ label="Email"
129
+ type="email"
130
+ autoComplete="email"
131
+ defaultValue="anika.patel@stripe.com"
132
+ required
133
+ />
134
+ <FloatLabel
135
+ label="Password"
136
+ type="password"
137
+ autoComplete="current-password"
138
+ required
139
+ />
140
+ </div>
141
+ <Button type="submit" size="xl">
142
+ Sign in
143
+ </Button>
144
+ </form>
145
+ </CardContent>
146
+ </Card>
147
+ ),
148
+ };
@@ -0,0 +1,176 @@
1
+ import * as React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { FloatingPanel } from "@behavioral-agentic-design-system/core/components/ui/floating-panel";
4
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
5
+
6
+ const meta: Meta<typeof FloatingPanel> = {
7
+ title: "Components/FloatingPanel",
8
+ component: FloatingPanel,
9
+ parameters: {
10
+ layout: "fullscreen",
11
+ docs: {
12
+ description: {
13
+ component:
14
+ "Floating, always-rendered, non-modal companion panel anchored to a viewport corner. A role=complementary landmark that floats over content without blocking it — contextual help, debug overlays, sticky-note panels. Focus is never trapped; when closed the panel carries the hidden attribute so it leaves the tab order. Open/close motion runs on the duration-base / ease-out tokens and collapses under reduced motion via the base layer.",
15
+ },
16
+ },
17
+ },
18
+ tags: ["autodocs"],
19
+ };
20
+
21
+ export default meta;
22
+ type Story = StoryObj<typeof meta>;
23
+
24
+ // Stories render inside a tall canvas so the fixed-position panel has
25
+ // content to float over.
26
+ function CanvasBackdrop() {
27
+ return (
28
+ <div className="min-h-96 p-8">
29
+ <p className="max-w-md text-sm text-muted-foreground">
30
+ Page content keeps working underneath — the panel is a non-modal
31
+ landmark, not an overlay. Tab order flows through it like any other
32
+ page region.
33
+ </p>
34
+ </div>
35
+ );
36
+ }
37
+
38
+ export const Default: Story = {
39
+ render: () => (
40
+ <div className="relative min-h-96">
41
+ <CanvasBackdrop />
42
+ <FloatingPanel>
43
+ <p className="text-sm">Hello from the floating panel</p>
44
+ </FloatingPanel>
45
+ </div>
46
+ ),
47
+ };
48
+
49
+ export const WithTitle: Story = {
50
+ render: () => (
51
+ <div className="relative min-h-96">
52
+ <CanvasBackdrop />
53
+ <FloatingPanel title="Help">
54
+ <p className="text-sm text-muted-foreground">
55
+ Every token pair on this screen is audited at 7:1 contrast. Pick a
56
+ brand color in the Customize tab to see the grade pills update.
57
+ </p>
58
+ </FloatingPanel>
59
+ </div>
60
+ ),
61
+ };
62
+
63
+ function WithCloseButtonDemo() {
64
+ const [open, setOpen] = React.useState(true);
65
+ return (
66
+ <div className="relative min-h-96">
67
+ <div className="min-h-96 p-8">
68
+ <Button size="xl" variant="outline" onClick={() => setOpen(true)}>
69
+ Reopen panel
70
+ </Button>
71
+ </div>
72
+ <FloatingPanel title="Release notes" open={open} onOpenChange={setOpen}>
73
+ <p className="text-sm text-muted-foreground">
74
+ @core 0.18 ships the semantic motion layer — pick motion by intent
75
+ (fade, slide, scale) instead of raw durations.
76
+ </p>
77
+ </FloatingPanel>
78
+ </div>
79
+ );
80
+ }
81
+
82
+ export const WithCloseButton: Story = {
83
+ render: () => <WithCloseButtonDemo />,
84
+ };
85
+
86
+ export const TopLeft: Story = {
87
+ render: () => (
88
+ <div className="relative min-h-96">
89
+ <CanvasBackdrop />
90
+ <FloatingPanel defaultPosition="top-left" title="Debug">
91
+ <p className="font-mono text-sm text-muted-foreground">
92
+ route: /preview/components · theme: dark · tokens: 2026-07-26
93
+ </p>
94
+ </FloatingPanel>
95
+ </div>
96
+ ),
97
+ };
98
+
99
+ // All four corner anchors, rendered static so they stack in one canvas
100
+ // instead of piling onto the same viewport corners.
101
+ export const AllPositions: Story = {
102
+ render: () => (
103
+ <div className="relative flex flex-col items-start gap-4 p-8">
104
+ <FloatingPanel className="static" title="Bottom right (default)">
105
+ <p className="text-sm text-muted-foreground">bottom-4 right-4</p>
106
+ </FloatingPanel>
107
+ <FloatingPanel
108
+ className="static"
109
+ defaultPosition="bottom-left"
110
+ title="Bottom left"
111
+ >
112
+ <p className="text-sm text-muted-foreground">bottom-4 left-4</p>
113
+ </FloatingPanel>
114
+ <FloatingPanel
115
+ className="static"
116
+ defaultPosition="top-right"
117
+ title="Top right"
118
+ >
119
+ <p className="text-sm text-muted-foreground">top-4 right-4</p>
120
+ </FloatingPanel>
121
+ <FloatingPanel
122
+ className="static"
123
+ defaultPosition="top-left"
124
+ title="Top left"
125
+ >
126
+ <p className="text-sm text-muted-foreground">top-4 left-4</p>
127
+ </FloatingPanel>
128
+ </div>
129
+ ),
130
+ };
131
+
132
+ function RealisticUseDemo() {
133
+ const [open, setOpen] = React.useState(true);
134
+ return (
135
+ <div className="relative min-h-96">
136
+ <div className="min-h-96 p-8">
137
+ <h2 className="text-2xl font-semibold">Tokens v2 proposal</h2>
138
+ <p className="mt-2 max-w-md text-sm text-muted-foreground">
139
+ Shared by Anika Patel · design.bads.com. The semantic layer gets
140
+ three new aliases so chart surfaces stop borrowing from the sidebar
141
+ palette.
142
+ </p>
143
+ {!open && (
144
+ <Button
145
+ size="xl"
146
+ variant="outline"
147
+ className="mt-4"
148
+ onClick={() => setOpen(true)}
149
+ >
150
+ Show contextual help
151
+ </Button>
152
+ )}
153
+ </div>
154
+ <FloatingPanel title="Contextual Help" open={open} onOpenChange={setOpen}>
155
+ <div className="space-y-2">
156
+ <p className="text-sm font-medium">Need help with this screen?</p>
157
+ <p className="text-sm text-muted-foreground">
158
+ Review flows walk every proposed token pair through the AAA
159
+ contrast audit before the change lands. You can keep working —
160
+ this panel stays out of the way.
161
+ </p>
162
+ <a
163
+ href="#"
164
+ className="text-sm underline underline-offset-4 hover:no-underline"
165
+ >
166
+ Read the token review guide
167
+ </a>
168
+ </div>
169
+ </FloatingPanel>
170
+ </div>
171
+ );
172
+ }
173
+
174
+ export const RealisticUse: Story = {
175
+ render: () => <RealisticUseDemo />,
176
+ };