@behavioral-agentic-design-system/core 0.24.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.
- package/package.json +5 -2
- package/scripts/build-tokens.cjs +79 -5
- package/src/app/preview/components/page.tsx +4474 -208
- package/src/app/shell.tsx +18 -6
- package/src/components/customize/brand-mark-section.tsx +1 -1
- package/src/components/customize-tab.tsx +2 -2
- package/src/components/home-tab.tsx +2 -2
- package/src/components/ui/action-bar.tsx +142 -0
- package/src/components/ui/affix.tsx +109 -0
- package/src/components/ui/alert.tsx +37 -3
- package/src/components/ui/anchor.tsx +136 -0
- package/src/components/ui/angle-slider.tsx +265 -0
- package/src/components/ui/autocomplete.tsx +223 -0
- package/src/components/ui/avatar.tsx +8 -2
- package/src/components/ui/blockquote.tsx +112 -0
- package/src/components/ui/bottom-navigation.tsx +144 -0
- package/src/components/ui/burger.tsx +117 -0
- package/src/components/ui/button.tsx +101 -3
- package/src/components/ui/calendar.tsx +1 -1
- package/src/components/ui/card.tsx +43 -5
- package/src/components/ui/carousel.tsx +10 -5
- package/src/components/ui/cascader.tsx +253 -0
- package/src/components/ui/checkbox-card.tsx +176 -0
- package/src/components/ui/checkbox-group.tsx +231 -0
- package/src/components/ui/checkbox.tsx +14 -3
- package/src/components/ui/chip.tsx +143 -0
- package/src/components/ui/circular-progress.tsx +2 -2
- package/src/components/ui/color-swatch.tsx +73 -0
- package/src/components/ui/copy-button.tsx +21 -4
- package/src/components/ui/date-picker.tsx +6 -3
- package/src/components/ui/date-range-picker.tsx +6 -3
- package/src/components/ui/float-label.tsx +114 -0
- package/src/components/ui/floating-panel.tsx +129 -0
- package/src/components/ui/format-number.tsx +122 -0
- package/src/components/ui/highlight.tsx +85 -0
- package/src/components/ui/image.tsx +195 -0
- package/src/components/ui/index.ts +50 -0
- package/src/components/ui/indicator.tsx +2 -2
- package/src/components/ui/input.tsx +48 -4
- package/src/components/ui/kbd.tsx +1 -1
- package/src/components/ui/link.tsx +158 -0
- package/src/components/ui/listbox.tsx +426 -0
- package/src/components/ui/loading-overlay.tsx +80 -0
- package/src/components/ui/marquee.tsx +193 -0
- package/src/components/ui/masonry.tsx +164 -0
- package/src/components/ui/meter.tsx +186 -0
- package/src/components/ui/motion-toggle.tsx +170 -0
- package/src/components/ui/notification.tsx +175 -0
- package/src/components/ui/overlay.tsx +63 -0
- package/src/components/ui/progress.tsx +95 -4
- package/src/components/ui/rating-group.tsx +1 -0
- package/src/components/ui/separator.tsx +57 -1
- package/src/components/ui/sidebar.tsx +1 -1
- package/src/components/ui/signature-pad.tsx +381 -0
- package/src/components/ui/skeleton.tsx +59 -2
- package/src/components/ui/skip-link.tsx +117 -0
- package/src/components/ui/slider.tsx +86 -1
- package/src/components/ui/spoiler.tsx +131 -0
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/text.tsx +135 -0
- package/src/components/ui/textarea.tsx +66 -2
- package/src/components/ui/timeline.tsx +71 -14
- package/src/components/ui/timer.tsx +183 -0
- package/src/components/ui/tour.tsx +332 -0
- package/src/components/ui/transfer-list.tsx +308 -0
- package/src/components/ui/visually-hidden.tsx +42 -0
- package/src/components/ui/watermark.tsx +0 -0
- package/src/data/docs-index.ts +9 -2
- package/src/stories/ActionBar.stories.tsx +201 -0
- package/src/stories/Affix.stories.tsx +165 -0
- package/src/stories/Alert.stories.tsx +58 -0
- package/src/stories/Anchor.stories.tsx +236 -0
- package/src/stories/AngleSlider.stories.tsx +128 -0
- package/src/stories/Autocomplete.stories.tsx +216 -0
- package/src/stories/Avatar.stories.tsx +73 -1
- package/src/stories/Blockquote.stories.tsx +148 -0
- package/src/stories/BottomNavigation.stories.tsx +195 -0
- package/src/stories/Burger.stories.tsx +79 -0
- package/src/stories/Button.stories.tsx +103 -2
- package/src/stories/Calendar.stories.tsx +4 -0
- package/src/stories/Card.stories.tsx +30 -0
- package/src/stories/Carousel.stories.tsx +2 -1
- package/src/stories/Cascader.stories.tsx +285 -0
- package/src/stories/Checkbox.stories.tsx +13 -0
- package/src/stories/CheckboxCard.stories.tsx +210 -0
- package/src/stories/CheckboxGroup.stories.tsx +186 -0
- package/src/stories/Chip.stories.tsx +173 -0
- package/src/stories/CircularProgress.stories.tsx +3 -0
- package/src/stories/ColorSwatch.stories.tsx +81 -0
- package/src/stories/CopyButton.stories.tsx +3 -3
- package/src/stories/DatePicker.stories.tsx +3 -0
- package/src/stories/DateRangePicker.stories.tsx +3 -0
- package/src/stories/Editable.stories.tsx +14 -0
- package/src/stories/FloatLabel.stories.tsx +148 -0
- package/src/stories/FloatingPanel.stories.tsx +176 -0
- package/src/stories/FormatNumber.stories.tsx +308 -0
- package/src/stories/Highlight.stories.tsx +140 -0
- package/src/stories/Image.stories.tsx +141 -0
- package/src/stories/Indicator.stories.tsx +3 -0
- package/src/stories/Input.stories.tsx +33 -0
- package/src/stories/Kbd.stories.tsx +3 -0
- package/src/stories/Link.stories.tsx +198 -0
- package/src/stories/Listbox.stories.tsx +240 -0
- package/src/stories/LoadingOverlay.stories.tsx +148 -0
- package/src/stories/Marquee.stories.tsx +170 -0
- package/src/stories/Masonry.stories.tsx +227 -0
- package/src/stories/Meter.stories.tsx +143 -0
- package/src/stories/MotionToggle.stories.tsx +85 -0
- package/src/stories/Notification.stories.tsx +264 -0
- package/src/stories/Overlay.stories.tsx +169 -0
- package/src/stories/PasswordInput.stories.tsx +4 -0
- package/src/stories/Progress.stories.tsx +70 -27
- package/src/stories/RatingGroup.stories.tsx +5 -0
- package/src/stories/Separator.stories.tsx +41 -5
- package/src/stories/Sidebar.stories.tsx +2 -1
- package/src/stories/SignaturePad.stories.tsx +112 -0
- package/src/stories/Skeleton.stories.tsx +23 -4
- package/src/stories/SkipLink.stories.tsx +137 -0
- package/src/stories/Slider.stories.tsx +28 -0
- package/src/stories/Spoiler.stories.tsx +122 -0
- package/src/stories/Tabs.stories.tsx +2 -1
- package/src/stories/Text.stories.tsx +191 -0
- package/src/stories/Textarea.stories.tsx +58 -6
- package/src/stories/Timeline.stories.tsx +82 -0
- package/src/stories/Timer.stories.tsx +160 -0
- package/src/stories/Tour.stories.tsx +191 -0
- package/src/stories/TransferList.stories.tsx +169 -0
- package/src/stories/VisuallyHidden.stories.tsx +105 -0
- package/src/stories/Watermark.stories.tsx +212 -0
- package/src/styles.css +80 -6
- package/src/tokens.json +2 -2
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import {
|
|
5
|
+
ChevronRight,
|
|
6
|
+
ChevronLeft,
|
|
7
|
+
ChevronsRight,
|
|
8
|
+
ChevronsLeft,
|
|
9
|
+
} from "lucide-react"
|
|
10
|
+
|
|
11
|
+
import { cn } from "../../lib/utils"
|
|
12
|
+
import { Button } from "../ui/button"
|
|
13
|
+
import { Badge } from "../ui/badge"
|
|
14
|
+
import { Input } from "../ui/input"
|
|
15
|
+
|
|
16
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
// Types
|
|
18
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
export interface TransferListProps {
|
|
21
|
+
/** Items in the left (available) panel */
|
|
22
|
+
available: string[]
|
|
23
|
+
/** Items in the right (selected) panel */
|
|
24
|
+
selected: string[]
|
|
25
|
+
/** Callback when the left panel changes */
|
|
26
|
+
onAvailableChange: (items: string[]) => void
|
|
27
|
+
/** Callback when the right panel changes */
|
|
28
|
+
onSelectedChange: (items: string[]) => void
|
|
29
|
+
/** Label for the left panel (default: "Available") */
|
|
30
|
+
availableLabel?: string
|
|
31
|
+
/** Label for the right panel (default: "Selected") */
|
|
32
|
+
selectedLabel?: string
|
|
33
|
+
/** Show a filter input in each panel (default: true) */
|
|
34
|
+
searchable?: boolean
|
|
35
|
+
/** Additional class name for the root element */
|
|
36
|
+
className?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
40
|
+
// Panel sub-component
|
|
41
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
interface PanelProps {
|
|
44
|
+
label: string
|
|
45
|
+
items: string[]
|
|
46
|
+
checked: Set<string>
|
|
47
|
+
onToggle: (item: string) => void
|
|
48
|
+
searchable: boolean
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function Panel({ label, items, checked, onToggle, searchable }: PanelProps) {
|
|
52
|
+
const [filter, setFilter] = React.useState("")
|
|
53
|
+
const listboxId = React.useId()
|
|
54
|
+
|
|
55
|
+
const visible = filter
|
|
56
|
+
? items.filter((it) => it.toLowerCase().includes(filter.toLowerCase()))
|
|
57
|
+
: items
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div className="w-56 min-h-48 max-h-72 rounded-md border border-border bg-background overflow-hidden flex flex-col">
|
|
61
|
+
{/* Panel header */}
|
|
62
|
+
<div className="flex items-center justify-between px-3 py-2 border-b border-border shrink-0">
|
|
63
|
+
<span className="text-sm font-medium text-foreground">{label}</span>
|
|
64
|
+
<Badge variant="secondary">{items.length}</Badge>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
{/* Search filter */}
|
|
68
|
+
{searchable && (
|
|
69
|
+
<div className="px-2 py-1.5 border-b border-border shrink-0">
|
|
70
|
+
<Input
|
|
71
|
+
size="sm"
|
|
72
|
+
type="search"
|
|
73
|
+
placeholder="Filter…"
|
|
74
|
+
value={filter}
|
|
75
|
+
onChange={(e) => setFilter(e.target.value)}
|
|
76
|
+
aria-label={`Filter ${label} items`}
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
)}
|
|
80
|
+
|
|
81
|
+
{/* Item list */}
|
|
82
|
+
<ul
|
|
83
|
+
id={listboxId}
|
|
84
|
+
role="listbox"
|
|
85
|
+
aria-multiselectable="true"
|
|
86
|
+
aria-label={label}
|
|
87
|
+
className="overflow-y-auto flex-1 py-1"
|
|
88
|
+
>
|
|
89
|
+
{visible.length === 0 ? (
|
|
90
|
+
<li className="px-3 py-2 text-sm text-muted-foreground select-none">
|
|
91
|
+
No items
|
|
92
|
+
</li>
|
|
93
|
+
) : (
|
|
94
|
+
visible.map((item) => {
|
|
95
|
+
const isChecked = checked.has(item)
|
|
96
|
+
return (
|
|
97
|
+
<li
|
|
98
|
+
key={item}
|
|
99
|
+
role="option"
|
|
100
|
+
aria-selected={isChecked}
|
|
101
|
+
onClick={() => onToggle(item)}
|
|
102
|
+
onKeyDown={(e) => {
|
|
103
|
+
if (e.key === " ") {
|
|
104
|
+
e.preventDefault()
|
|
105
|
+
onToggle(item)
|
|
106
|
+
}
|
|
107
|
+
}}
|
|
108
|
+
tabIndex={0}
|
|
109
|
+
className={cn(
|
|
110
|
+
"flex items-center gap-2 px-2 py-1.5 cursor-pointer select-none text-sm",
|
|
111
|
+
"transition-colors",
|
|
112
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
113
|
+
isChecked
|
|
114
|
+
? "bg-accent text-accent-foreground"
|
|
115
|
+
: "hover:bg-muted"
|
|
116
|
+
)}
|
|
117
|
+
style={{
|
|
118
|
+
transitionDuration: "var(--duration-fast)",
|
|
119
|
+
transitionTimingFunction: "var(--ease-out)",
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
{/* Visual checkbox indicator */}
|
|
123
|
+
<span
|
|
124
|
+
aria-hidden="true"
|
|
125
|
+
className={cn(
|
|
126
|
+
"inline-flex shrink-0 size-4 items-center justify-center rounded-sm border",
|
|
127
|
+
isChecked
|
|
128
|
+
? "border-primary bg-primary text-primary-foreground"
|
|
129
|
+
: "border-muted-foreground/60 bg-background"
|
|
130
|
+
)}
|
|
131
|
+
>
|
|
132
|
+
{isChecked && (
|
|
133
|
+
<svg
|
|
134
|
+
width="10"
|
|
135
|
+
height="8"
|
|
136
|
+
viewBox="0 0 10 8"
|
|
137
|
+
fill="none"
|
|
138
|
+
stroke="currentColor"
|
|
139
|
+
strokeWidth="1.5"
|
|
140
|
+
strokeLinecap="round"
|
|
141
|
+
strokeLinejoin="round"
|
|
142
|
+
aria-hidden="true"
|
|
143
|
+
>
|
|
144
|
+
<polyline points="1 4 3.5 6.5 9 1" />
|
|
145
|
+
</svg>
|
|
146
|
+
)}
|
|
147
|
+
</span>
|
|
148
|
+
<span className="min-w-0 truncate" title={item}>
|
|
149
|
+
{item}
|
|
150
|
+
</span>
|
|
151
|
+
</li>
|
|
152
|
+
)
|
|
153
|
+
})
|
|
154
|
+
)}
|
|
155
|
+
</ul>
|
|
156
|
+
</div>
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
161
|
+
// TransferList
|
|
162
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
163
|
+
|
|
164
|
+
function TransferList({
|
|
165
|
+
available,
|
|
166
|
+
selected,
|
|
167
|
+
onAvailableChange,
|
|
168
|
+
onSelectedChange,
|
|
169
|
+
availableLabel = "Available",
|
|
170
|
+
selectedLabel = "Selected",
|
|
171
|
+
searchable = true,
|
|
172
|
+
className,
|
|
173
|
+
}: TransferListProps) {
|
|
174
|
+
// Independently track which items are checked in each panel
|
|
175
|
+
const [leftChecked, setLeftChecked] = React.useState<Set<string>>(new Set())
|
|
176
|
+
const [rightChecked, setRightChecked] = React.useState<Set<string>>(new Set())
|
|
177
|
+
|
|
178
|
+
// Toggle an item's checked state in the given panel
|
|
179
|
+
function toggleLeft(item: string) {
|
|
180
|
+
setLeftChecked((prev) => {
|
|
181
|
+
const next = new Set(prev)
|
|
182
|
+
if (next.has(item)) next.delete(item)
|
|
183
|
+
else next.add(item)
|
|
184
|
+
return next
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function toggleRight(item: string) {
|
|
189
|
+
setRightChecked((prev) => {
|
|
190
|
+
const next = new Set(prev)
|
|
191
|
+
if (next.has(item)) next.delete(item)
|
|
192
|
+
else next.add(item)
|
|
193
|
+
return next
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Move checked items from available → selected
|
|
198
|
+
function moveCheckedRight() {
|
|
199
|
+
const toMove = available.filter((it) => leftChecked.has(it))
|
|
200
|
+
if (toMove.length === 0) return
|
|
201
|
+
onAvailableChange(available.filter((it) => !leftChecked.has(it)))
|
|
202
|
+
onSelectedChange([...selected, ...toMove])
|
|
203
|
+
setLeftChecked(new Set())
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Move ALL items from available → selected
|
|
207
|
+
function moveAllRight() {
|
|
208
|
+
if (available.length === 0) return
|
|
209
|
+
onSelectedChange([...selected, ...available])
|
|
210
|
+
onAvailableChange([])
|
|
211
|
+
setLeftChecked(new Set())
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Move checked items from selected → available
|
|
215
|
+
function moveCheckedLeft() {
|
|
216
|
+
const toMove = selected.filter((it) => rightChecked.has(it))
|
|
217
|
+
if (toMove.length === 0) return
|
|
218
|
+
onSelectedChange(selected.filter((it) => !rightChecked.has(it)))
|
|
219
|
+
onAvailableChange([...available, ...toMove])
|
|
220
|
+
setRightChecked(new Set())
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Move ALL items from selected → available
|
|
224
|
+
function moveAllLeft() {
|
|
225
|
+
if (selected.length === 0) return
|
|
226
|
+
onAvailableChange([...available, ...selected])
|
|
227
|
+
onSelectedChange([])
|
|
228
|
+
setRightChecked(new Set())
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const hasLeftChecked = leftChecked.size > 0
|
|
232
|
+
const hasRightChecked = rightChecked.size > 0
|
|
233
|
+
|
|
234
|
+
return (
|
|
235
|
+
<div
|
|
236
|
+
role="group"
|
|
237
|
+
aria-label="Transfer list"
|
|
238
|
+
className={cn("flex items-center gap-3", className)}
|
|
239
|
+
>
|
|
240
|
+
{/* Left panel — Available */}
|
|
241
|
+
<Panel
|
|
242
|
+
label={availableLabel}
|
|
243
|
+
items={available}
|
|
244
|
+
checked={leftChecked}
|
|
245
|
+
onToggle={toggleLeft}
|
|
246
|
+
searchable={searchable}
|
|
247
|
+
/>
|
|
248
|
+
|
|
249
|
+
{/* Transfer controls */}
|
|
250
|
+
<div className="flex flex-col items-center gap-2" aria-label="Transfer controls">
|
|
251
|
+
<Button
|
|
252
|
+
variant="outline"
|
|
253
|
+
size="icon-sm"
|
|
254
|
+
onClick={moveCheckedRight}
|
|
255
|
+
disabled={!hasLeftChecked}
|
|
256
|
+
aria-label={`Move selected to ${selectedLabel}`}
|
|
257
|
+
title={`Move selected to ${selectedLabel}`}
|
|
258
|
+
>
|
|
259
|
+
<ChevronRight strokeWidth={1.5} />
|
|
260
|
+
</Button>
|
|
261
|
+
|
|
262
|
+
<Button
|
|
263
|
+
variant="outline"
|
|
264
|
+
size="icon-sm"
|
|
265
|
+
onClick={moveAllRight}
|
|
266
|
+
disabled={available.length === 0}
|
|
267
|
+
aria-label={`Move all to ${selectedLabel}`}
|
|
268
|
+
title={`Move all to ${selectedLabel}`}
|
|
269
|
+
>
|
|
270
|
+
<ChevronsRight strokeWidth={1.5} />
|
|
271
|
+
</Button>
|
|
272
|
+
|
|
273
|
+
<Button
|
|
274
|
+
variant="outline"
|
|
275
|
+
size="icon-sm"
|
|
276
|
+
onClick={moveCheckedLeft}
|
|
277
|
+
disabled={!hasRightChecked}
|
|
278
|
+
aria-label={`Move selected to ${availableLabel}`}
|
|
279
|
+
title={`Move selected to ${availableLabel}`}
|
|
280
|
+
>
|
|
281
|
+
<ChevronLeft strokeWidth={1.5} />
|
|
282
|
+
</Button>
|
|
283
|
+
|
|
284
|
+
<Button
|
|
285
|
+
variant="outline"
|
|
286
|
+
size="icon-sm"
|
|
287
|
+
onClick={moveAllLeft}
|
|
288
|
+
disabled={selected.length === 0}
|
|
289
|
+
aria-label={`Move all to ${availableLabel}`}
|
|
290
|
+
title={`Move all to ${availableLabel}`}
|
|
291
|
+
>
|
|
292
|
+
<ChevronsLeft strokeWidth={1.5} />
|
|
293
|
+
</Button>
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
{/* Right panel — Selected */}
|
|
297
|
+
<Panel
|
|
298
|
+
label={selectedLabel}
|
|
299
|
+
items={selected}
|
|
300
|
+
checked={rightChecked}
|
|
301
|
+
onToggle={toggleRight}
|
|
302
|
+
searchable={searchable}
|
|
303
|
+
/>
|
|
304
|
+
</div>
|
|
305
|
+
)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export { TransferList }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* VisuallyHidden — renders content invisible on screen but fully present in
|
|
8
|
+
* the accessibility tree, so screen readers announce it normally. The
|
|
9
|
+
* canonical use is giving icon-only controls an accessible name, or adding
|
|
10
|
+
* screen-reader-only context (table captions, live-region text) without
|
|
11
|
+
* disturbing the visual layout.
|
|
12
|
+
*
|
|
13
|
+
* Implementation note: CSS-only via Tailwind's `sr-only` utility (the same
|
|
14
|
+
* absolute-position + 1px clip technique Radix's react-visually-hidden ships).
|
|
15
|
+
* That package is intentionally NOT imported — it isn't a declared dependency
|
|
16
|
+
* of @behavioral-agentic-design-system/core, and the CSS pattern is identical.
|
|
17
|
+
*
|
|
18
|
+
* Zero-motion exception (documented, not omitted): this primitive has no
|
|
19
|
+
* interactive states — it is invisible and never a focus target — so the
|
|
20
|
+
* system-wide microanimation rule is vacuously satisfied. Never wrap
|
|
21
|
+
* focusable elements in it (an invisible focus stop strands keyboard users);
|
|
22
|
+
* to hide content FROM assistive tech instead, use `aria-hidden`.
|
|
23
|
+
*/
|
|
24
|
+
function VisuallyHidden({
|
|
25
|
+
asChild = false,
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<"span"> & {
|
|
29
|
+
/** Merge the sr-only behavior onto the child element instead of rendering a wrapping span (Radix Slot pattern). */
|
|
30
|
+
asChild?: boolean
|
|
31
|
+
}) {
|
|
32
|
+
const Comp = asChild ? Slot : "span"
|
|
33
|
+
return (
|
|
34
|
+
<Comp
|
|
35
|
+
data-slot="visually-hidden"
|
|
36
|
+
className={cn("sr-only", className)}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { VisuallyHidden }
|
|
Binary file
|
package/src/data/docs-index.ts
CHANGED
|
@@ -61,17 +61,18 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
61
61
|
{ title: "Storybook rule", path: "STORYBOOK_RULE.md" },
|
|
62
62
|
{ title: "CTA size contract", path: "prompts/cta-size-contract.md" },
|
|
63
63
|
{ title: "Motion spec", path: "prompts/motion-spec.md" },
|
|
64
|
+
{ title: "Motion choreography", path: "prompts/motion-choreography.md", summary: "Page-scale motion for expressive/motion-led surfaces (hero, landing) — timing budget, stagger-by-hierarchy, coverage sweep, signature-techniques menu, linear() springs. Opt-in, gated on the brand's motion dial; reconciled with BADS' anti-defaults. Adapted from VibeCurb's awwwards-motion." },
|
|
64
65
|
],
|
|
65
66
|
},
|
|
66
67
|
{
|
|
67
68
|
id: "agent-system",
|
|
68
69
|
label: "Agent system",
|
|
69
|
-
description: "How autonomous agents read BADS — instructions,
|
|
70
|
+
description: "How autonomous agents read BADS — instructions, the Night Shift spec, the nightly loops.",
|
|
70
71
|
entries: [
|
|
71
72
|
{ title: "CLAUDE.md", path: "CLAUDE.md", summary: "The agent contract — every workflow rule lives here." },
|
|
72
73
|
{ title: "AGENTS.md", path: "AGENTS.md", summary: "Loading precedence + escalation rules." },
|
|
73
74
|
{ title: "V0 system prompt", path: "V0_SYSTEM.md" },
|
|
74
|
-
{ title: "
|
|
75
|
+
{ title: "Night Shift spec", path: "CIRCADIAN.md", summary: "The overnight agent: what it audits, researches, builds, tests, merges, and reports each night." },
|
|
75
76
|
{ title: "Night Shift prompt", path: "scripts/prompts/night-shift.md", summary: "The full nightly research + auto-PR pass." },
|
|
76
77
|
{ title: "Agent roadmap", path: "docs/agent-roadmap.md" },
|
|
77
78
|
{ title: "Intent-driven context", path: "docs/intent-driven-context.md", summary: "Constraint vs guideline vs framing vs workflow — and what delivery each demands." },
|
|
@@ -89,6 +90,7 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
89
90
|
{ title: "Skill — persona-pressure-test", path: ".claude/skills/persona-pressure-test/SKILL.md" },
|
|
90
91
|
{ title: "Skill — promote-prototype", path: ".claude/skills/promote-prototype/SKILL.md" },
|
|
91
92
|
{ title: "Skill — visual-verify", path: ".claude/skills/visual-verify/SKILL.md" },
|
|
93
|
+
{ title: "Prompt — conceptual model", path: "prompts/conceptual-model.md", summary: "Before sketching a product surface, name its domain objects, states, relationships, and vocabulary — Jamie Mill's 'most neglected layer,' wired into Path B as design-exploration step 3.5. Feeds the real-content pool, state patterns, and primitive selection." },
|
|
92
94
|
{ title: "Prompt — design directions", path: "prompts/design-directions.md" },
|
|
93
95
|
{ title: "Prompt — design critique", path: "prompts/design-critique.md" },
|
|
94
96
|
{ title: "Prompt — independent critique", path: "prompts/independent-critique.md" },
|
|
@@ -103,7 +105,9 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
103
105
|
entries: [
|
|
104
106
|
{ title: "Design rules", path: "DESIGN.md", summary: "Visual system + accessibility baseline." },
|
|
105
107
|
{ title: "Chart color palette", path: "docs/chart-color-palette.md", summary: "Accessible 5-color categorical palette for data viz — Okabe-Ito-derived, reviewed against WCAG 1.4.11 non-text contrast." },
|
|
108
|
+
{ title: "Chart design", path: "docs/chart-design.md", summary: "Chart composition rules — grid, axes, labels, legend, tooltip, number formatting, states, motion. The 'data is the only saturated thing' register; companion to the color palette." },
|
|
106
109
|
{ title: "Privacy-first design (8 principles)", path: "layer-2-ethics-responsibility/privacy-first-design.md", summary: "Matthew Stephens' 8-principle privacy framework: minimize collection, transparency, expiration, no dark patterns, user control, ethical monetization, sustainable practices, accountability — mapped to BADS enforcement." },
|
|
110
|
+
{ title: "Distress & reduced capacity", path: "layer-2-ethics-responsibility/distress-and-capacity.md", summary: "Designing critical flows for users in reduced-capacity states (stress, anxiety, grief, overwhelm) — a STATE, not a persona. The Low-Capacity Test release gate for high-stakes flows, plus the situational-distress persona and shame-free / no-silent-inference rules. Adapted from Matthew Stephens' 2026 mental-health-UX framework." },
|
|
107
111
|
{ title: "Gamification — responsible vs. manipulative", path: "layer-2-ethics-responsibility/gamification.md", summary: "Sir's 10 Core Drives (Octalysis 8 + Exploration & Discovery + Challenge & Competition) + the test gates that decide when Black Hat ships and when it refuses." },
|
|
108
112
|
{ title: "Corrections log", path: "corrections.md", summary: "Per-fork anti-pattern log. Read before every Path B build." },
|
|
109
113
|
{ title: "Anti-defaults refresh", path: "prompts/anti-defaults-refresh.md", summary: "Quarterly pressure-test of the current anti-defaults." },
|
|
@@ -177,3 +181,6 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
177
181
|
];
|
|
178
182
|
|
|
179
183
|
export const DOCS_TOTAL = DOCS_INDEX.reduce((sum, g) => sum + g.entries.length, 0);
|
|
184
|
+
|
|
185
|
+
// linters, checks, audits, reports, and CI workflows — automation scripts in pnpm + .github
|
|
186
|
+
export const AUTOMATION_COUNT = 48;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { ArchiveIcon, DownloadIcon, Trash2Icon } from "lucide-react";
|
|
4
|
+
import { ActionBar } from "@behavioral-agentic-design-system/core/components/ui/action-bar";
|
|
5
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
6
|
+
import { Checkbox } from "@behavioral-agentic-design-system/core/components/ui/checkbox";
|
|
7
|
+
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof ActionBar> = {
|
|
10
|
+
title: "Components/ActionBar",
|
|
11
|
+
component: ActionBar,
|
|
12
|
+
parameters: { layout: "fullscreen" },
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
|
|
19
|
+
function Frame({ children }: { children: React.ReactNode }) {
|
|
20
|
+
return (
|
|
21
|
+
<div className="relative min-h-[280px] w-full overflow-hidden bg-background p-6">
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function DemoActions({ disabled = false }: { disabled?: boolean }) {
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<Button variant="ghost" size="xl" className="px-4" disabled={disabled}>
|
|
31
|
+
<ArchiveIcon strokeWidth={1.5} aria-hidden="true" />
|
|
32
|
+
Archive
|
|
33
|
+
</Button>
|
|
34
|
+
<Button variant="ghost" size="xl" className="px-4" disabled={disabled}>
|
|
35
|
+
<DownloadIcon strokeWidth={1.5} aria-hidden="true" />
|
|
36
|
+
Export
|
|
37
|
+
</Button>
|
|
38
|
+
<Button
|
|
39
|
+
variant="ghost"
|
|
40
|
+
size="xl"
|
|
41
|
+
className="px-4 text-destructive hover:text-destructive"
|
|
42
|
+
disabled={disabled}
|
|
43
|
+
>
|
|
44
|
+
<Trash2Icon strokeWidth={1.5} aria-hidden="true" />
|
|
45
|
+
Delete
|
|
46
|
+
</Button>
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const Default: Story = {
|
|
52
|
+
render: () => (
|
|
53
|
+
<Frame>
|
|
54
|
+
<p className="text-sm text-muted-foreground">
|
|
55
|
+
3 tokens selected in the audit table below the fold — the bar floats
|
|
56
|
+
over the content, anchored to the bottom edge.
|
|
57
|
+
</p>
|
|
58
|
+
<ActionBar
|
|
59
|
+
selectedCount={3}
|
|
60
|
+
onClearSelection={() => {}}
|
|
61
|
+
className="absolute bottom-6"
|
|
62
|
+
>
|
|
63
|
+
<DemoActions />
|
|
64
|
+
</ActionBar>
|
|
65
|
+
</Frame>
|
|
66
|
+
),
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const ManySelected: Story = {
|
|
70
|
+
render: () => (
|
|
71
|
+
<Frame>
|
|
72
|
+
<p className="text-sm text-muted-foreground">
|
|
73
|
+
Select-all across a long registry list — the count stays a single
|
|
74
|
+
tabular-nums line at any magnitude.
|
|
75
|
+
</p>
|
|
76
|
+
<ActionBar
|
|
77
|
+
selectedCount={47}
|
|
78
|
+
onClearSelection={() => {}}
|
|
79
|
+
className="absolute bottom-6"
|
|
80
|
+
>
|
|
81
|
+
<DemoActions />
|
|
82
|
+
</ActionBar>
|
|
83
|
+
</Frame>
|
|
84
|
+
),
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const ZeroSelected: Story = {
|
|
88
|
+
render: () => (
|
|
89
|
+
<Frame>
|
|
90
|
+
<p className="text-sm text-muted-foreground">
|
|
91
|
+
Nothing selected: the bar is dismissed but kept in the DOM
|
|
92
|
+
(opacity 0, translated down, inert) so the exit transition can play
|
|
93
|
+
and re-entry animates from the same node.
|
|
94
|
+
</p>
|
|
95
|
+
<ActionBar
|
|
96
|
+
selectedCount={0}
|
|
97
|
+
onClearSelection={() => {}}
|
|
98
|
+
className="absolute bottom-6"
|
|
99
|
+
>
|
|
100
|
+
<DemoActions />
|
|
101
|
+
</ActionBar>
|
|
102
|
+
</Frame>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const Disabled: Story = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<Frame>
|
|
109
|
+
<p className="text-sm text-muted-foreground">
|
|
110
|
+
Bulk export is running — actions disable while the job is in flight,
|
|
111
|
+
but the count and clear control stay live.
|
|
112
|
+
</p>
|
|
113
|
+
<ActionBar
|
|
114
|
+
selectedCount={12}
|
|
115
|
+
onClearSelection={() => {}}
|
|
116
|
+
className="absolute bottom-6"
|
|
117
|
+
>
|
|
118
|
+
<DemoActions disabled />
|
|
119
|
+
</ActionBar>
|
|
120
|
+
</Frame>
|
|
121
|
+
),
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const REVIEWERS = [
|
|
125
|
+
{ id: "jordan", name: "Jordan Reeves", email: "jordan@reeves.design" },
|
|
126
|
+
{ id: "seoyun", name: "Seo-yun Park", email: "seoyun.park@figma.com" },
|
|
127
|
+
{ id: "marcus", name: "Marcus Lindqvist", email: "marcus@lindqvist.dev" },
|
|
128
|
+
{ id: "anika", name: "Anika Patel", email: "anika.patel@stripe.com" },
|
|
129
|
+
{ id: "tomas", name: "Tomás Herrera", email: "tomas.herrera@vercel.com" },
|
|
130
|
+
{ id: "yuki", name: "Yuki Tanaka", email: "yuki.tanaka@linear.app" },
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
export const RealisticUse: Story = {
|
|
134
|
+
render: () => {
|
|
135
|
+
const [selected, setSelected] = React.useState<Set<string>>(
|
|
136
|
+
() => new Set(["seoyun", "anika"])
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
const toggle = (id: string, next: boolean) =>
|
|
140
|
+
setSelected((prev) => {
|
|
141
|
+
const copy = new Set(prev);
|
|
142
|
+
if (next) copy.add(id);
|
|
143
|
+
else copy.delete(id);
|
|
144
|
+
return copy;
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<div className="relative min-h-[420px] w-full overflow-hidden bg-background p-6">
|
|
149
|
+
<div className="mx-auto max-w-md">
|
|
150
|
+
<h2 className="text-2xl font-semibold text-foreground">
|
|
151
|
+
Workspace reviewers
|
|
152
|
+
</h2>
|
|
153
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
154
|
+
Check reviewers to invite, export, or remove them in bulk.
|
|
155
|
+
</p>
|
|
156
|
+
<ul className="mt-4 divide-y divide-border rounded-lg border">
|
|
157
|
+
{REVIEWERS.map((person) => (
|
|
158
|
+
<li key={person.id} className="flex items-center gap-3 px-4 py-2">
|
|
159
|
+
<Checkbox
|
|
160
|
+
id={`reviewer-${person.id}`}
|
|
161
|
+
checked={selected.has(person.id)}
|
|
162
|
+
onCheckedChange={(next) => toggle(person.id, next === true)}
|
|
163
|
+
/>
|
|
164
|
+
<Label
|
|
165
|
+
htmlFor={`reviewer-${person.id}`}
|
|
166
|
+
className="flex min-w-0 flex-1 cursor-pointer flex-col gap-0.5 py-1.5"
|
|
167
|
+
>
|
|
168
|
+
<span className="truncate text-sm font-medium text-foreground">
|
|
169
|
+
{person.name}
|
|
170
|
+
</span>
|
|
171
|
+
<span className="truncate text-sm text-muted-foreground">
|
|
172
|
+
{person.email}
|
|
173
|
+
</span>
|
|
174
|
+
</Label>
|
|
175
|
+
</li>
|
|
176
|
+
))}
|
|
177
|
+
</ul>
|
|
178
|
+
</div>
|
|
179
|
+
<ActionBar
|
|
180
|
+
selectedCount={selected.size}
|
|
181
|
+
onClearSelection={() => setSelected(new Set())}
|
|
182
|
+
className="absolute bottom-6"
|
|
183
|
+
>
|
|
184
|
+
<Button variant="ghost" size="xl" className="px-4">
|
|
185
|
+
<DownloadIcon strokeWidth={1.5} aria-hidden="true" />
|
|
186
|
+
Export
|
|
187
|
+
</Button>
|
|
188
|
+
<Button
|
|
189
|
+
variant="ghost"
|
|
190
|
+
size="xl"
|
|
191
|
+
className="px-4 text-destructive hover:text-destructive"
|
|
192
|
+
onClick={() => setSelected(new Set())}
|
|
193
|
+
>
|
|
194
|
+
<Trash2Icon strokeWidth={1.5} aria-hidden="true" />
|
|
195
|
+
Remove
|
|
196
|
+
</Button>
|
|
197
|
+
</ActionBar>
|
|
198
|
+
</div>
|
|
199
|
+
);
|
|
200
|
+
},
|
|
201
|
+
};
|