@behavioral-agentic-design-system/core 0.38.0 → 0.39.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 +2 -2
- package/src/app/preview/components/page.tsx +362 -0
- package/src/components/Foundations/Typography.stories.tsx +82 -21
- package/src/components/ui/accordion.tsx +67 -5
- package/src/components/ui/alert.tsx +20 -7
- package/src/components/ui/avatar.tsx +18 -4
- package/src/components/ui/breadcrumb.tsx +47 -0
- package/src/components/ui/checkbox-card.tsx +48 -8
- package/src/components/ui/checkbox.tsx +17 -8
- package/src/components/ui/format-date.tsx +107 -0
- package/src/components/ui/progress.tsx +6 -5
- package/src/components/ui/sparkline.tsx +198 -0
- package/src/components/ui/tag.tsx +17 -1
- package/src/components/ui/tags-input.tsx +84 -11
- package/src/components/ui/toggle-group.tsx +13 -0
- package/src/components/ui/week-picker.tsx +463 -0
- package/src/data/docs-index.ts +7 -0
- package/src/stories/Accordion.stories.tsx +59 -1
- package/src/stories/ActionBar.stories.tsx +1 -1
- package/src/stories/Affix.stories.tsx +1 -1
- package/src/stories/AiBadge.stories.tsx +1 -1
- package/src/stories/Alert.stories.tsx +36 -1
- package/src/stories/AlertDialog.stories.tsx +1 -1
- package/src/stories/Anchor.stories.tsx +1 -1
- package/src/stories/AngleSlider.stories.tsx +1 -1
- package/src/stories/AspectRatio.stories.tsx +1 -1
- package/src/stories/Autocomplete.stories.tsx +1 -1
- package/src/stories/Avatar.stories.tsx +41 -1
- package/src/stories/Badge.stories.tsx +1 -1
- package/src/stories/Blockquote.stories.tsx +1 -1
- package/src/stories/BottomNavigation.stories.tsx +1 -1
- package/src/stories/Breadcrumb.stories.tsx +38 -5
- package/src/stories/Burger.stories.tsx +1 -1
- package/src/stories/Button.stories.tsx +9 -1
- package/src/stories/ButtonGroup.stories.tsx +1 -1
- package/src/stories/Calendar.stories.tsx +1 -1
- package/src/stories/Card.stories.tsx +1 -1
- package/src/stories/Carousel.stories.tsx +1 -1
- package/src/stories/Cascader.stories.tsx +1 -1
- package/src/stories/Chart.stories.tsx +1 -1
- package/src/stories/ChatBubble.stories.tsx +1 -1
- package/src/stories/ChatMarker.stories.tsx +1 -1
- package/src/stories/Checkbox.stories.tsx +36 -5
- package/src/stories/CheckboxCard.stories.tsx +37 -2
- package/src/stories/CheckboxGroup.stories.tsx +1 -1
- package/src/stories/Chip.stories.tsx +1 -1
- package/src/stories/CircularProgress.stories.tsx +17 -1
- package/src/stories/Clipboard.stories.tsx +1 -1
- package/src/stories/CloseButton.stories.tsx +1 -1
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/Collapsible.stories.tsx +1 -1
- package/src/stories/ColorPicker.stories.tsx +1 -1
- package/src/stories/ColorSwatch.stories.tsx +1 -1
- package/src/stories/Combobox.stories.tsx +1 -1
- package/src/stories/Command.stories.tsx +1 -1
- package/src/stories/Container.stories.tsx +1 -1
- package/src/stories/ContextMenu.stories.tsx +1 -1
- package/src/stories/CopyButton.stories.tsx +9 -1
- package/src/stories/DataList.stories.tsx +1 -1
- package/src/stories/DataTable.stories.tsx +1 -1
- package/src/stories/DateField.stories.tsx +1 -1
- package/src/stories/DatePicker.stories.tsx +1 -1
- package/src/stories/DateRangePicker.stories.tsx +1 -1
- package/src/stories/Dialog.stories.tsx +1 -1
- package/src/stories/Drawer.stories.tsx +1 -1
- package/src/stories/DropdownMenu.stories.tsx +1 -1
- package/src/stories/Editable.stories.tsx +1 -1
- package/src/stories/EmptyState.stories.tsx +1 -1
- package/src/stories/Field.stories.tsx +1 -1
- package/src/stories/Fieldset.stories.tsx +1 -1
- package/src/stories/FileButton.stories.tsx +1 -1
- package/src/stories/FileUpload.stories.tsx +1 -1
- package/src/stories/FloatLabel.stories.tsx +1 -1
- package/src/stories/FloatingActionButton.stories.tsx +1 -1
- package/src/stories/FloatingIndicator.stories.tsx +1 -1
- package/src/stories/FloatingPanel.stories.tsx +9 -1
- package/src/stories/FocusTrap.stories.tsx +1 -1
- package/src/stories/FormatByte.stories.tsx +1 -1
- package/src/stories/FormatDate.stories.tsx +174 -0
- package/src/stories/FormatNumber.stories.tsx +1 -1
- package/src/stories/Highlight.stories.tsx +1 -1
- package/src/stories/HoverCard.stories.tsx +1 -1
- package/src/stories/Image.stories.tsx +1 -1
- package/src/stories/Indicator.stories.tsx +17 -1
- package/src/stories/Input.stories.tsx +1 -1
- package/src/stories/InputClearButton.stories.tsx +1 -1
- package/src/stories/InputGroup.stories.tsx +1 -1
- package/src/stories/Kbd.stories.tsx +1 -1
- package/src/stories/KeyboardShortcut.stories.tsx +1 -1
- package/src/stories/Label.stories.tsx +1 -1
- package/src/stories/Link.stories.tsx +1 -1
- package/src/stories/List.stories.tsx +1 -1
- package/src/stories/Listbox.stories.tsx +1 -1
- package/src/stories/LoadingDots.stories.tsx +1 -1
- package/src/stories/LoadingOverlay.stories.tsx +1 -1
- package/src/stories/Mark.stories.tsx +1 -1
- package/src/stories/Marquee.stories.tsx +1 -1
- package/src/stories/Masonry.stories.tsx +1 -1
- package/src/stories/Menubar.stories.tsx +1 -1
- package/src/stories/Meter.stories.tsx +1 -1
- package/src/stories/MonthPicker.stories.tsx +1 -1
- package/src/stories/MotionToggle.stories.tsx +1 -1
- package/src/stories/MultiSelect.stories.tsx +1 -1
- package/src/stories/NativeSelect.stories.tsx +1 -1
- package/src/stories/NavLink.stories.tsx +1 -1
- package/src/stories/NavigationMenu.stories.tsx +1 -1
- package/src/stories/NavigationRail.stories.tsx +9 -1
- package/src/stories/Notification.stories.tsx +1 -1
- package/src/stories/NumberInput.stories.tsx +1 -1
- package/src/stories/Overlay.stories.tsx +1 -1
- package/src/stories/Pagination.stories.tsx +1 -1
- package/src/stories/PasswordInput.stories.tsx +1 -1
- package/src/stories/PinInput.stories.tsx +1 -1
- package/src/stories/Popover.stories.tsx +1 -1
- package/src/stories/Progress.stories.tsx +11 -1
- package/src/stories/Prose.stories.tsx +1 -1
- package/src/stories/QrCode.stories.tsx +1 -1
- package/src/stories/Questionnaire.stories.tsx +1 -1
- package/src/stories/RadioGroup.stories.tsx +1 -1
- package/src/stories/RatingGroup.stories.tsx +1 -1
- package/src/stories/Resizable.stories.tsx +1 -1
- package/src/stories/Result.stories.tsx +1 -1
- package/src/stories/Reveal.stories.tsx +1 -1
- package/src/stories/RollingNumber.stories.tsx +1 -1
- package/src/stories/ScrollArea.stories.tsx +1 -1
- package/src/stories/SearchInput.stories.tsx +1 -1
- package/src/stories/SegmentedControl.stories.tsx +1 -1
- package/src/stories/Select.stories.tsx +1 -1
- package/src/stories/Separator.stories.tsx +1 -1
- package/src/stories/Sheet.stories.tsx +1 -1
- package/src/stories/Sidebar.stories.tsx +1 -1
- package/src/stories/SignaturePad.stories.tsx +1 -1
- package/src/stories/SimpleGrid.stories.tsx +1 -1
- package/src/stories/Skeleton.stories.tsx +1 -1
- package/src/stories/SkeletonTable.stories.tsx +1 -1
- package/src/stories/SkipLink.stories.tsx +1 -1
- package/src/stories/Slider.stories.tsx +1 -1
- package/src/stories/Sonner.stories.tsx +1 -1
- package/src/stories/Sparkline.stories.tsx +208 -0
- package/src/stories/Spinner.stories.tsx +9 -1
- package/src/stories/Spoiler.stories.tsx +1 -1
- package/src/stories/Squircle.stories.tsx +1 -1
- package/src/stories/Stack.stories.tsx +1 -1
- package/src/stories/StatusBadge.stories.tsx +1 -1
- package/src/stories/Stepper.stories.tsx +1 -1
- package/src/stories/Switch.stories.tsx +1 -1
- package/src/stories/Table.stories.tsx +1 -1
- package/src/stories/Tabs.stories.tsx +1 -1
- package/src/stories/Tag.stories.tsx +23 -1
- package/src/stories/TagsInput.stories.tsx +46 -1
- package/src/stories/Text.stories.tsx +1 -1
- package/src/stories/Textarea.stories.tsx +1 -1
- package/src/stories/ThemeIcon.stories.tsx +1 -1
- package/src/stories/TimePicker.stories.tsx +1 -1
- package/src/stories/Timeline.stories.tsx +9 -1
- package/src/stories/Timer.stories.tsx +1 -1
- package/src/stories/Toggle.stories.tsx +1 -1
- package/src/stories/ToggleGroup.stories.tsx +21 -1
- package/src/stories/ToggleTip.stories.tsx +1 -1
- package/src/stories/Toolbar.stories.tsx +1 -1
- package/src/stories/Tooltip.stories.tsx +1 -1
- package/src/stories/Tour.stories.tsx +1 -1
- package/src/stories/TransferList.stories.tsx +1 -1
- package/src/stories/TreeSelect.stories.tsx +1 -1
- package/src/stories/TreeView.stories.tsx +1 -1
- package/src/stories/TypingIndicator.stories.tsx +1 -1
- package/src/stories/VisuallyHidden.stories.tsx +1 -1
- package/src/stories/Watermark.stories.tsx +1 -1
- package/src/stories/WeekPicker.stories.tsx +90 -0
- package/src/stories/WordRotate.stories.tsx +1 -1
- package/src/stories/YearPicker.stories.tsx +1 -1
- package/src/stories/story-groups.json +199 -0
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils"
|
|
7
|
+
import { Button } from "./button"
|
|
8
|
+
|
|
9
|
+
export interface WeekPickerProps {
|
|
10
|
+
/**
|
|
11
|
+
* Controlled selected week, represented as the ISO Monday of that week
|
|
12
|
+
* (local time). The component normalises any supplied date to its
|
|
13
|
+
* ISO-week Monday.
|
|
14
|
+
*/
|
|
15
|
+
value?: Date
|
|
16
|
+
/** Uncontrolled initial selection. */
|
|
17
|
+
defaultValue?: Date
|
|
18
|
+
/**
|
|
19
|
+
* Fires with the ISO-week Monday (local time) whenever a new week is
|
|
20
|
+
* selected. Re-clicking the current week is a no-op — to implement clear,
|
|
21
|
+
* track state externally.
|
|
22
|
+
*/
|
|
23
|
+
onValueChange?: (weekStart: Date) => void
|
|
24
|
+
/** Disables the entire control. */
|
|
25
|
+
disabled?: boolean
|
|
26
|
+
/** Placeholder shown in the trigger when no week is selected. */
|
|
27
|
+
placeholder?: string
|
|
28
|
+
/**
|
|
29
|
+
* BCP 47 locale tag used to format month/year labels and weekday headers.
|
|
30
|
+
* Defaults to "en-US" (explicit, SSR-safe).
|
|
31
|
+
*/
|
|
32
|
+
locale?: string
|
|
33
|
+
className?: string
|
|
34
|
+
/** Forwarded to the root container — pair with an external Label. */
|
|
35
|
+
id?: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// ISO 8601 week helpers
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns the ISO Monday (start of the ISO week) for any date, in local time.
|
|
44
|
+
* ISO weeks start on Monday; week 1 is the week containing the year's first
|
|
45
|
+
* Thursday.
|
|
46
|
+
*/
|
|
47
|
+
function isoWeekStart(d: Date): Date {
|
|
48
|
+
const day = new Date(d)
|
|
49
|
+
day.setHours(0, 0, 0, 0)
|
|
50
|
+
// getDay(): 0=Sun,1=Mon,...,6=Sat → shift so Mon=0
|
|
51
|
+
const dow = (day.getDay() + 6) % 7 // 0=Mon…6=Sun
|
|
52
|
+
day.setDate(day.getDate() - dow)
|
|
53
|
+
return day
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Returns the ISO week number (1–53) for a date in local time. */
|
|
57
|
+
function isoWeekNumber(d: Date): number {
|
|
58
|
+
// Algorithm: find the Thursday of the ISO week; the week number is the
|
|
59
|
+
// number of days from Jan 4 of that year's Thursday-year to that Thursday,
|
|
60
|
+
// divided by 7 and floored, plus 1.
|
|
61
|
+
const thursday = new Date(d)
|
|
62
|
+
thursday.setDate(thursday.getDate() - ((thursday.getDay() + 6) % 7) + 3)
|
|
63
|
+
const jan4 = new Date(thursday.getFullYear(), 0, 4)
|
|
64
|
+
return (
|
|
65
|
+
1 +
|
|
66
|
+
Math.round(
|
|
67
|
+
(thursday.getTime() - isoWeekStart(jan4).getTime()) / 86_400_000 / 7
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Returns the ISO year (may differ from calendar year at year boundaries). */
|
|
73
|
+
function isoWeekYear(d: Date): number {
|
|
74
|
+
const thursday = new Date(d)
|
|
75
|
+
thursday.setDate(thursday.getDate() - ((thursday.getDay() + 6) % 7) + 3)
|
|
76
|
+
return thursday.getFullYear()
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Returns the number of ISO weeks in a given year (52 or 53). */
|
|
80
|
+
function isoWeeksInYear(year: number): number {
|
|
81
|
+
// A year has 53 ISO weeks if Jan 1 is Thursday, or if it's a leap year
|
|
82
|
+
// whose Jan 1 is Wednesday.
|
|
83
|
+
const jan1 = new Date(year, 0, 1).getDay() // 0=Sun
|
|
84
|
+
return jan1 === 4 || (jan1 === 3 && isLeapYear(year)) ? 53 : 52
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function isLeapYear(year: number): boolean {
|
|
88
|
+
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Number of days in a given month (0-indexed). */
|
|
92
|
+
function daysInMonth(year: number, month: number): number {
|
|
93
|
+
return new Date(year, month + 1, 0).getDate()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
// Calendar grid helpers
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
|
|
100
|
+
/** Returns all Monday-start weeks that overlap the displayed month. */
|
|
101
|
+
function weeksInMonth(year: number, month: number): Date[] {
|
|
102
|
+
const first = new Date(year, month, 1)
|
|
103
|
+
// Start from the Monday on or before the 1st.
|
|
104
|
+
const start = isoWeekStart(first)
|
|
105
|
+
const weeks: Date[] = []
|
|
106
|
+
const cur = new Date(start)
|
|
107
|
+
while (cur.getMonth() === month || weeks.length === 0) {
|
|
108
|
+
weeks.push(new Date(cur))
|
|
109
|
+
cur.setDate(cur.getDate() + 7)
|
|
110
|
+
// Stop once Monday is past the last day of the month.
|
|
111
|
+
if (
|
|
112
|
+
cur.getMonth() !== month &&
|
|
113
|
+
cur.getDate() > daysInMonth(year, month)
|
|
114
|
+
) {
|
|
115
|
+
break
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return weeks
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Explicit locale constants — same SSR-safe convention as FormatNumber.
|
|
122
|
+
const WEEKDAY_HEADERS = Array.from({ length: 7 }, (_, i) => {
|
|
123
|
+
// Start from Monday: use a known Monday (2000-01-03).
|
|
124
|
+
const d = new Date(2000, 0, 3 + i)
|
|
125
|
+
return d.toLocaleString("en-US", { weekday: "narrow" })
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* ISO-week picker — a calendar-month grid where clicking any row selects
|
|
130
|
+
* that ISO week and fires `onValueChange` with the week's Monday.
|
|
131
|
+
*
|
|
132
|
+
* The trigger button displays "Week N, YYYY" format. Internal navigation
|
|
133
|
+
* moves one month at a time (PageUp/PageDown) and one year at a time
|
|
134
|
+
* (Shift+PageUp/PageDown). Row-level keyboard navigation: ArrowUp / ArrowDown
|
|
135
|
+
* move between week rows; Enter / Space select the focused week.
|
|
136
|
+
*
|
|
137
|
+
* ARIA: the grid uses role="grid" with row-level aria-selected and a roving
|
|
138
|
+
* tabindex so the selected week row is the natural tab stop.
|
|
139
|
+
*/
|
|
140
|
+
function WeekPicker({
|
|
141
|
+
value,
|
|
142
|
+
defaultValue,
|
|
143
|
+
onValueChange,
|
|
144
|
+
disabled = false,
|
|
145
|
+
placeholder = "Select week",
|
|
146
|
+
locale = "en-US",
|
|
147
|
+
className,
|
|
148
|
+
id,
|
|
149
|
+
}: WeekPickerProps) {
|
|
150
|
+
const isControlled = value !== undefined
|
|
151
|
+
const [internalValue, setInternalValue] = React.useState<Date | undefined>(
|
|
152
|
+
defaultValue ? isoWeekStart(defaultValue) : undefined
|
|
153
|
+
)
|
|
154
|
+
const selected = isControlled
|
|
155
|
+
? value
|
|
156
|
+
? isoWeekStart(value)
|
|
157
|
+
: undefined
|
|
158
|
+
: internalValue
|
|
159
|
+
|
|
160
|
+
const today = React.useMemo(() => new Date(), [])
|
|
161
|
+
const [viewYear, setViewYear] = React.useState<number>(
|
|
162
|
+
() => (selected ?? today).getFullYear()
|
|
163
|
+
)
|
|
164
|
+
const [viewMonth, setViewMonth] = React.useState<number>(
|
|
165
|
+
() => (selected ?? today).getMonth()
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
// Roving tabindex: index of the focused week row.
|
|
169
|
+
const [focusedRow, setFocusedRow] = React.useState<number | null>(null)
|
|
170
|
+
const rowRefs = React.useRef<Array<HTMLButtonElement | null>>([])
|
|
171
|
+
|
|
172
|
+
// Follow a controlled value into its month.
|
|
173
|
+
const valueTime = selected?.getTime()
|
|
174
|
+
React.useEffect(() => {
|
|
175
|
+
if (valueTime !== undefined) {
|
|
176
|
+
const d = new Date(valueTime)
|
|
177
|
+
setViewYear(d.getFullYear())
|
|
178
|
+
setViewMonth(d.getMonth())
|
|
179
|
+
}
|
|
180
|
+
}, [valueTime])
|
|
181
|
+
|
|
182
|
+
const weeks = React.useMemo(
|
|
183
|
+
() => weeksInMonth(viewYear, viewMonth),
|
|
184
|
+
[viewYear, viewMonth]
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
// Reset focused row when the month changes.
|
|
188
|
+
React.useEffect(() => {
|
|
189
|
+
setFocusedRow(null)
|
|
190
|
+
}, [viewYear, viewMonth])
|
|
191
|
+
|
|
192
|
+
function selectWeek(weekStart: Date) {
|
|
193
|
+
if (disabled) return
|
|
194
|
+
if (!isControlled) setInternalValue(weekStart)
|
|
195
|
+
onValueChange?.(weekStart)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function prevMonth() {
|
|
199
|
+
if (disabled) return
|
|
200
|
+
setViewMonth((m) => {
|
|
201
|
+
if (m === 0) {
|
|
202
|
+
setViewYear((y) => y - 1)
|
|
203
|
+
return 11
|
|
204
|
+
}
|
|
205
|
+
return m - 1
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function nextMonth() {
|
|
210
|
+
if (disabled) return
|
|
211
|
+
setViewMonth((m) => {
|
|
212
|
+
if (m === 11) {
|
|
213
|
+
setViewYear((y) => y + 1)
|
|
214
|
+
return 0
|
|
215
|
+
}
|
|
216
|
+
return m + 1
|
|
217
|
+
})
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function handleGridKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {
|
|
221
|
+
const from = focusedRow ?? selectedRowIdx ?? 0
|
|
222
|
+
switch (event.key) {
|
|
223
|
+
case "ArrowUp": {
|
|
224
|
+
event.preventDefault()
|
|
225
|
+
const prev = from - 1
|
|
226
|
+
if (prev >= 0) rowRefs.current[prev]?.focus()
|
|
227
|
+
break
|
|
228
|
+
}
|
|
229
|
+
case "ArrowDown": {
|
|
230
|
+
event.preventDefault()
|
|
231
|
+
const next = from + 1
|
|
232
|
+
if (next < weeks.length) rowRefs.current[next]?.focus()
|
|
233
|
+
break
|
|
234
|
+
}
|
|
235
|
+
case "PageUp":
|
|
236
|
+
event.preventDefault()
|
|
237
|
+
if (event.shiftKey) {
|
|
238
|
+
setViewYear((y) => y - 1)
|
|
239
|
+
} else {
|
|
240
|
+
prevMonth()
|
|
241
|
+
}
|
|
242
|
+
break
|
|
243
|
+
case "PageDown":
|
|
244
|
+
event.preventDefault()
|
|
245
|
+
if (event.shiftKey) {
|
|
246
|
+
setViewYear((y) => y + 1)
|
|
247
|
+
} else {
|
|
248
|
+
nextMonth()
|
|
249
|
+
}
|
|
250
|
+
break
|
|
251
|
+
case "Home":
|
|
252
|
+
event.preventDefault()
|
|
253
|
+
rowRefs.current[0]?.focus()
|
|
254
|
+
break
|
|
255
|
+
case "End":
|
|
256
|
+
event.preventDefault()
|
|
257
|
+
rowRefs.current[weeks.length - 1]?.focus()
|
|
258
|
+
break
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// The index of the selected week in the current month view (or null).
|
|
263
|
+
const selectedRowIdx = React.useMemo(() => {
|
|
264
|
+
if (!selected) return null
|
|
265
|
+
const selTime = selected.getTime()
|
|
266
|
+
return weeks.findIndex((w) => w.getTime() === selTime)
|
|
267
|
+
}, [selected, weeks])
|
|
268
|
+
|
|
269
|
+
const tabbableRow =
|
|
270
|
+
focusedRow !== null ? focusedRow : selectedRowIdx ?? 0
|
|
271
|
+
|
|
272
|
+
// Month/year header label.
|
|
273
|
+
const monthLabel = new Date(viewYear, viewMonth, 1).toLocaleString(locale, {
|
|
274
|
+
month: "long",
|
|
275
|
+
year: "numeric",
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
// Trigger label.
|
|
279
|
+
const triggerLabel = selected
|
|
280
|
+
? `Week ${isoWeekNumber(selected)}, ${isoWeekYear(selected)}`
|
|
281
|
+
: placeholder
|
|
282
|
+
|
|
283
|
+
return (
|
|
284
|
+
<div
|
|
285
|
+
id={id}
|
|
286
|
+
data-slot="week-picker"
|
|
287
|
+
data-disabled={disabled || undefined}
|
|
288
|
+
className={cn("w-fit bg-background p-3", className)}
|
|
289
|
+
>
|
|
290
|
+
{/* Trigger / selection display */}
|
|
291
|
+
<div
|
|
292
|
+
data-slot="week-picker-trigger"
|
|
293
|
+
className={cn(
|
|
294
|
+
"mb-3 rounded-md border border-input px-3 py-2 text-sm",
|
|
295
|
+
disabled ? "cursor-not-allowed text-muted-foreground" : "text-foreground"
|
|
296
|
+
)}
|
|
297
|
+
aria-live="polite"
|
|
298
|
+
>
|
|
299
|
+
{triggerLabel}
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
{/* Month navigation header */}
|
|
303
|
+
<div
|
|
304
|
+
data-slot="week-picker-header"
|
|
305
|
+
className="mb-2 flex items-center justify-between gap-1"
|
|
306
|
+
>
|
|
307
|
+
<Button
|
|
308
|
+
type="button"
|
|
309
|
+
variant="ghost"
|
|
310
|
+
size="icon-xl"
|
|
311
|
+
aria-label="Previous month"
|
|
312
|
+
disabled={disabled}
|
|
313
|
+
onClick={prevMonth}
|
|
314
|
+
>
|
|
315
|
+
<ChevronLeftIcon strokeWidth={1.5} aria-hidden="true" />
|
|
316
|
+
</Button>
|
|
317
|
+
<span
|
|
318
|
+
aria-live="polite"
|
|
319
|
+
className={cn(
|
|
320
|
+
"text-sm font-medium select-none",
|
|
321
|
+
disabled ? "text-muted-foreground" : "text-foreground"
|
|
322
|
+
)}
|
|
323
|
+
>
|
|
324
|
+
{monthLabel}
|
|
325
|
+
</span>
|
|
326
|
+
<Button
|
|
327
|
+
type="button"
|
|
328
|
+
variant="ghost"
|
|
329
|
+
size="icon-xl"
|
|
330
|
+
aria-label="Next month"
|
|
331
|
+
disabled={disabled}
|
|
332
|
+
onClick={nextMonth}
|
|
333
|
+
>
|
|
334
|
+
<ChevronRightIcon strokeWidth={1.5} aria-hidden="true" />
|
|
335
|
+
</Button>
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
{/* Weekday header row */}
|
|
339
|
+
<div
|
|
340
|
+
data-slot="week-picker-weekdays"
|
|
341
|
+
className="mb-1 grid grid-cols-8 gap-0.5"
|
|
342
|
+
aria-hidden="true"
|
|
343
|
+
>
|
|
344
|
+
{/* Wk label column */}
|
|
345
|
+
<span className="flex h-7 items-center justify-center text-xs font-medium text-muted-foreground select-none">
|
|
346
|
+
Wk
|
|
347
|
+
</span>
|
|
348
|
+
{WEEKDAY_HEADERS.map((h) => (
|
|
349
|
+
<span
|
|
350
|
+
key={h}
|
|
351
|
+
className="flex h-7 items-center justify-center text-xs font-medium text-muted-foreground select-none"
|
|
352
|
+
>
|
|
353
|
+
{h}
|
|
354
|
+
</span>
|
|
355
|
+
))}
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
{/* Week grid */}
|
|
359
|
+
<div
|
|
360
|
+
role="grid"
|
|
361
|
+
aria-label="Week picker"
|
|
362
|
+
aria-disabled={disabled || undefined}
|
|
363
|
+
data-slot="week-picker-grid"
|
|
364
|
+
tabIndex={disabled ? 0 : -1}
|
|
365
|
+
onKeyDown={handleGridKeyDown}
|
|
366
|
+
className="space-y-0.5"
|
|
367
|
+
>
|
|
368
|
+
{weeks.map((weekStart, rowIdx) => {
|
|
369
|
+
const weekNum = isoWeekNumber(weekStart)
|
|
370
|
+
const weekYear = isoWeekYear(weekStart)
|
|
371
|
+
const isSelected =
|
|
372
|
+
selected !== undefined && weekStart.getTime() === selected.getTime()
|
|
373
|
+
const isThisWeek =
|
|
374
|
+
weekStart.getTime() === isoWeekStart(today).getTime()
|
|
375
|
+
|
|
376
|
+
// Generate the 7 days of this week.
|
|
377
|
+
const days = Array.from({ length: 7 }, (_, i) => {
|
|
378
|
+
const d = new Date(weekStart)
|
|
379
|
+
d.setDate(d.getDate() + i)
|
|
380
|
+
return d
|
|
381
|
+
})
|
|
382
|
+
|
|
383
|
+
return (
|
|
384
|
+
<div key={weekStart.getTime()} role="row" className="flex gap-0.5">
|
|
385
|
+
{/* Row = one week button spanning the whole row */}
|
|
386
|
+
<button
|
|
387
|
+
ref={(el) => {
|
|
388
|
+
rowRefs.current[rowIdx] = el
|
|
389
|
+
}}
|
|
390
|
+
type="button"
|
|
391
|
+
role="gridcell"
|
|
392
|
+
data-slot="week-picker-row"
|
|
393
|
+
data-selected={isSelected || undefined}
|
|
394
|
+
data-this-week={isThisWeek || undefined}
|
|
395
|
+
aria-label={`Week ${weekNum}, ${weekYear}`}
|
|
396
|
+
aria-selected={isSelected}
|
|
397
|
+
disabled={disabled}
|
|
398
|
+
tabIndex={!disabled && rowIdx === tabbableRow ? 0 : -1}
|
|
399
|
+
onClick={() => selectWeek(weekStart)}
|
|
400
|
+
onFocus={() => setFocusedRow(rowIdx)}
|
|
401
|
+
// Motion pattern (c): token-driven one-off transition.
|
|
402
|
+
style={{
|
|
403
|
+
transitionDuration: "var(--duration-fast)",
|
|
404
|
+
transitionTimingFunction: "var(--ease-out)",
|
|
405
|
+
}}
|
|
406
|
+
className={cn(
|
|
407
|
+
"flex min-h-9 w-full items-center rounded-md px-1 transition-colors outline-none",
|
|
408
|
+
"focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
409
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
410
|
+
isSelected
|
|
411
|
+
? "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
412
|
+
: "text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
413
|
+
isThisWeek && !isSelected && "font-medium ring-1 ring-border"
|
|
414
|
+
)}
|
|
415
|
+
>
|
|
416
|
+
{/* Week number column */}
|
|
417
|
+
<span
|
|
418
|
+
className={cn(
|
|
419
|
+
"mr-1 flex h-7 w-7 shrink-0 items-center justify-center rounded text-xs tabular-nums select-none",
|
|
420
|
+
isSelected
|
|
421
|
+
? "bg-primary-foreground/20 text-primary-foreground"
|
|
422
|
+
: "text-muted-foreground"
|
|
423
|
+
)}
|
|
424
|
+
>
|
|
425
|
+
{weekNum}
|
|
426
|
+
</span>
|
|
427
|
+
|
|
428
|
+
{/* Day cells */}
|
|
429
|
+
<span className="flex flex-1 justify-between">
|
|
430
|
+
{days.map((day) => {
|
|
431
|
+
const isCurrentMonth = day.getMonth() === viewMonth
|
|
432
|
+
const isToday =
|
|
433
|
+
day.getDate() === today.getDate() &&
|
|
434
|
+
day.getMonth() === today.getMonth() &&
|
|
435
|
+
day.getFullYear() === today.getFullYear()
|
|
436
|
+
return (
|
|
437
|
+
<span
|
|
438
|
+
key={day.getTime()}
|
|
439
|
+
aria-hidden="true"
|
|
440
|
+
data-today={isToday || undefined}
|
|
441
|
+
className={cn(
|
|
442
|
+
"flex h-7 w-7 items-center justify-center rounded-sm text-xs tabular-nums select-none",
|
|
443
|
+
!isCurrentMonth && "opacity-40",
|
|
444
|
+
isToday &&
|
|
445
|
+
!isSelected &&
|
|
446
|
+
"font-semibold underline underline-offset-2"
|
|
447
|
+
)}
|
|
448
|
+
>
|
|
449
|
+
{day.getDate()}
|
|
450
|
+
</span>
|
|
451
|
+
)
|
|
452
|
+
})}
|
|
453
|
+
</span>
|
|
454
|
+
</button>
|
|
455
|
+
</div>
|
|
456
|
+
)
|
|
457
|
+
})}
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
)
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export { WeekPicker }
|
package/src/data/docs-index.ts
CHANGED
|
@@ -132,6 +132,9 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
132
132
|
{ title: "lieflat-charts evaluation", path: "docs/lieflat-charts-evaluation.md", summary: "Scouting note (not adopted): an editorial data-viz agent skill. Blocker — PolyForm Noncommercial license; its code must never be vendored into a commercial fork. BADS already holds the philosophy (chart-design.md). One license-clean idea borrowed: a data-shape → chart-type selector added to chart-design.md." },
|
|
133
133
|
{ title: "PRAXIST evaluation", path: "docs/praxist-evaluation.md", summary: "Scouting note (not vendored): sapientinc/PRAXIST, an autonomous measurable-research engine. Blocker — Fair Source License, and it optimizes a single number where most BADS research is qualitative. The loop shape (iterate-search-evaluate) is borrowed via the existing auto-research skill for the Night Shift weekly deep-dive (step 3a); the measurable-metric optimization lab is designed here but deferred." },
|
|
134
134
|
{ title: "Deep-dive research questions", path: "docs/research-questions.md", summary: "Sir-curated queue for the Night Shift's weekly deep-dive (step 3a, Monday). The agent takes the top open question, runs the auto-research skill against it, and lands a report in ledgers/reports/. Empty queue is fine — the agent derives a question from recurring open ledger themes." },
|
|
135
|
+
{ title: "HumanLayer skills evaluation", path: "docs/humanlayer-skills-evaluation.md", summary: "Scouting note (MIT — no adoption blocker): humanlayer/skills. design-control-loop's sensor/controller/actuator vocabulary maps 1:1 onto the Night Shift crew (borrowed as docs/control-loop.md); improve-claude-md's <important if> technique complements the de-blobbing (proposal filed); narrow-react-prop-types wired into Carl. build-iterated-agentic-loop + show-me skipped as redundant." },
|
|
136
|
+
{ title: "jakubkrehel/skills evaluation", path: "docs/jakubkrehel-skills-evaluation.md", summary: "Scouting note (MIT, nothing adopted): a design-engineering skill collection on BADS's home turf — every dimension (UI, type, color, a11y, layout, writing) is already covered by BADS with enforcement (lints/tokens/contracts), not just review prompts. The one real borrow is the source, not a skill: Jakub Krehel's Interfaces magazine added to the Friday research rotation." },
|
|
137
|
+
{ title: "HIGAgentSkills evaluation", path: "docs/hig-agent-skills-evaluation.md", summary: "Scouting note (content not vendored): justinwetch/HIGAgentSkills, a distilled Apple HIG corpus. Blockers — no license + Apple IP, web-vs-native mismatch, and BADS deliberately diverges from Apple. But its tiered routing-index architecture validates BADS's manifest approach and surfaces one real gap (a unified keyword→file lookup), filed as a proposal." },
|
|
135
138
|
{ title: "Token migration", path: "docs/token-migration.md", summary: "The pattern for renaming/restructuring tokens in a fork without a heroic all-at-once PR: a token-migration.json old→new mapping enforced diff-aware (changed files held to new names, legacy tolerated in untouched files) via pnpm check:token-migration, plus a copy-pasteable mapping table. Adapted from web-common." },
|
|
136
139
|
{ 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." },
|
|
137
140
|
{ 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." },
|
|
@@ -189,6 +192,9 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
189
192
|
{ title: "Ledgers README", path: "ledgers/README.md" },
|
|
190
193
|
{ title: "Aggregator README", path: "aggregator/README.md" },
|
|
191
194
|
{ title: "CTO Builder dry-run", path: "docs/cto-builder-dry-run-2026-06-12.md" },
|
|
195
|
+
{ title: "Control loops", path: "docs/control-loop.md", summary: "The shape every Night Shift crew member shares, named with HumanLayer's set point / sensor / controller / actuator vocabulary (MIT). A completeness table showing which loops are closed (auto-merge) and which are open by design (the trust audit + gate-coverage auditor stop at a recommendation — the loops that govern other loops shouldn't close on themselves), and the four questions any new crew member must answer." },
|
|
196
|
+
{ title: "Proposal — <important if> for CLAUDE.md", path: "scripts/proposals/important-if-claude-md.md", summary: "Proposal (gated on Sir's go): apply HumanLayer's <important if> relevance blocks to the CLAUDE.md always-loaded floor, complementary to the manifest de-blobbing — externalize what you can, flag-when-relevant what must stay inline. Includes a worked before/after trial on the Charts section and an incremental, measure-first rollout." },
|
|
197
|
+
{ title: "Proposal — unified routing index", path: "scripts/proposals/unified-routing-index.md", summary: "Proposal (gated on Sir's go): one generated keyword→file routing index over the three layer manifests, so an agent turns 'I'm about to do X' into the exact load set without hunting across manifests + CLAUDE.md prose. Derived from the manifests (never hand-maintained) with a drift check, mirroring build:tokens. Idea borrowed from HIGAgentSkills' routing-index; folds into the same de-blobbing as the <important if> proposal." },
|
|
192
198
|
],
|
|
193
199
|
},
|
|
194
200
|
{
|
|
@@ -216,6 +222,7 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
216
222
|
{ title: "Spec — self-healing layer", path: "docs/specs/2026-08-21-self-healing-layer.md", summary: "Phase A contract: informational-only health score (Goodhart guard), no runtime telemetry, deterministic visible-copy intent rules, drift-ledger status convention, and the calibration record (6→0 false positives; two scoring bugs caught by face-checking)." },
|
|
217
223
|
{ title: "Plan — drift elimination", path: "docs/plans/2026-08-31-drift-elimination.md", summary: "Closing the loop between upstream, client forks, and prototype repos. Built on the one artifact every working template-sync tool shares: a committed record of which upstream version a downstream copy is layered on. Three phases ordered by risk — additive checks, then PR-gated fork sync, then the deferred structural calls." },
|
|
218
224
|
{ title: "Spec — drift elimination", path: "docs/specs/2026-08-31-drift-elimination.md", summary: "Phase A contract: precision over recall (unverifiable is never reported as drift), advisory-by-default with one blocking generated-artifact gate, additive-only sync manifest, and declared expected-drift allowlists. Calibration: 51→0 false positives on the registry checker, and real drift caught including llms.txt advertising 79 components when there were 173." },
|
|
225
|
+
{ title: "Roadmap — ClosedLoop import candidates", path: "docs/roadmap-closedloop-import.md", summary: "Fourteen production patterns surfaced by auditing the closedloop-ai GitHub org (40 repos, 17 cloned, 2026-09-03). Three shipped immediately; the rest carry activation signals matching the standard roadmap format." },
|
|
219
226
|
],
|
|
220
227
|
},
|
|
221
228
|
];
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
// from comments and compiles them into invalid CSS that breaks the build.
|
|
15
15
|
|
|
16
16
|
const meta: Meta<typeof Accordion> = {
|
|
17
|
-
title: "Components/Accordion",
|
|
17
|
+
title: "Components/Layout/Accordion",
|
|
18
18
|
component: Accordion,
|
|
19
19
|
parameters: { layout: "centered" },
|
|
20
20
|
tags: ["autodocs"],
|
|
@@ -86,6 +86,64 @@ export const Variant_Multiple: Story = {
|
|
|
86
86
|
),
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
export const Variant_Contained: Story = {
|
|
90
|
+
render: () => (
|
|
91
|
+
<Accordion type="single" collapsible variant="contained" className="w-[400px]">
|
|
92
|
+
<AccordionItem value="item-1">
|
|
93
|
+
<AccordionTrigger>Workspace settings</AccordionTrigger>
|
|
94
|
+
<AccordionContent className="text-muted-foreground">
|
|
95
|
+
Configure your workspace name, slug, and time zone. Changes take
|
|
96
|
+
effect immediately for all members.
|
|
97
|
+
</AccordionContent>
|
|
98
|
+
</AccordionItem>
|
|
99
|
+
<AccordionItem value="item-2">
|
|
100
|
+
<AccordionTrigger>Billing and plan</AccordionTrigger>
|
|
101
|
+
<AccordionContent className="text-muted-foreground">
|
|
102
|
+
View your current plan, payment method, and invoices. Upgrade or
|
|
103
|
+
downgrade at any time — changes apply at the next billing cycle.
|
|
104
|
+
</AccordionContent>
|
|
105
|
+
</AccordionItem>
|
|
106
|
+
<AccordionItem value="item-3">
|
|
107
|
+
<AccordionTrigger>Notifications</AccordionTrigger>
|
|
108
|
+
<AccordionContent className="text-muted-foreground">
|
|
109
|
+
Control which events send an email or in-app notification to your
|
|
110
|
+
team. Per-member overrides are available in each member's profile.
|
|
111
|
+
</AccordionContent>
|
|
112
|
+
</AccordionItem>
|
|
113
|
+
</Accordion>
|
|
114
|
+
),
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const Variant_Separated: Story = {
|
|
118
|
+
render: () => (
|
|
119
|
+
<Accordion type="single" collapsible variant="separated" className="w-[400px]">
|
|
120
|
+
<AccordionItem value="item-1">
|
|
121
|
+
<AccordionTrigger>What is BADS?</AccordionTrigger>
|
|
122
|
+
<AccordionContent className="text-muted-foreground">
|
|
123
|
+
BADS (Behavioral Agentic Design System) is a portable, distributable
|
|
124
|
+
design system built as the starting point for client engagements. It
|
|
125
|
+
ships tokens, components, ethics layers, and agent interfaces.
|
|
126
|
+
</AccordionContent>
|
|
127
|
+
</AccordionItem>
|
|
128
|
+
<AccordionItem value="item-2">
|
|
129
|
+
<AccordionTrigger>How do I customize tokens?</AccordionTrigger>
|
|
130
|
+
<AccordionContent className="text-muted-foreground">
|
|
131
|
+
Edit <code>tokens.json</code> and run{" "}
|
|
132
|
+
<code>pnpm build:tokens</code>. Both the published CSS and the local
|
|
133
|
+
preview regenerate automatically.
|
|
134
|
+
</AccordionContent>
|
|
135
|
+
</AccordionItem>
|
|
136
|
+
<AccordionItem value="item-3">
|
|
137
|
+
<AccordionTrigger>What accessibility standard does BADS target?</AccordionTrigger>
|
|
138
|
+
<AccordionContent className="text-muted-foreground">
|
|
139
|
+
BADS targets WCAG 2.2 AAA out of the box — 7:1 contrast for normal
|
|
140
|
+
text, 44 × 44 px touch targets, and reduced-motion respected.
|
|
141
|
+
</AccordionContent>
|
|
142
|
+
</AccordionItem>
|
|
143
|
+
</Accordion>
|
|
144
|
+
),
|
|
145
|
+
};
|
|
146
|
+
|
|
89
147
|
export const Disabled: Story = {
|
|
90
148
|
render: () => (
|
|
91
149
|
<Accordion type="single" collapsible className="w-[400px]">
|
|
@@ -7,7 +7,7 @@ import { Checkbox } from "@behavioral-agentic-design-system/core/components/ui/c
|
|
|
7
7
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof ActionBar> = {
|
|
10
|
-
title: "Components/ActionBar",
|
|
10
|
+
title: "Components/Navigation/ActionBar",
|
|
11
11
|
component: ActionBar,
|
|
12
12
|
parameters: { layout: "fullscreen" },
|
|
13
13
|
tags: ["autodocs"],
|
|
@@ -6,7 +6,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
6
6
|
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof Affix> = {
|
|
9
|
-
title: "Components/Affix",
|
|
9
|
+
title: "Components/Layout/Affix",
|
|
10
10
|
component: Affix,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: "centered",
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { AiBadge } from "@behavioral-agentic-design-system/core/components/ui/ai-badge";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof AiBadge> = {
|
|
5
|
-
title: "Components/AiBadge",
|
|
5
|
+
title: "Components/Badges and avatars/AiBadge",
|
|
6
6
|
component: AiBadge,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -15,7 +15,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
15
15
|
import { Card, CardContent, CardHeader, CardTitle } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
16
16
|
|
|
17
17
|
const meta: Meta<typeof Alert> = {
|
|
18
|
-
title: "Components/Alert",
|
|
18
|
+
title: "Components/Feedback/Alert",
|
|
19
19
|
component: Alert,
|
|
20
20
|
parameters: { layout: "centered" },
|
|
21
21
|
tags: ["autodocs"],
|
|
@@ -118,6 +118,41 @@ export const NestedInCard: Story = {
|
|
|
118
118
|
),
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
+
export const Size_Sm: Story = {
|
|
122
|
+
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
123
|
+
<Alert size="sm">
|
|
124
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
125
|
+
<AlertTitle>Heads up</AlertTitle>
|
|
126
|
+
<AlertDescription>Check your notification settings.</AlertDescription>
|
|
127
|
+
</Alert>
|
|
128
|
+
<Alert size="sm" variant="destructive">
|
|
129
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
130
|
+
<AlertTitle>Connection lost</AlertTitle>
|
|
131
|
+
<AlertDescription>Changes may not have been saved.</AlertDescription>
|
|
132
|
+
</Alert>
|
|
133
|
+
<Alert size="sm" variant="success">
|
|
134
|
+
<CheckCircle2Icon className="h-5 w-5" />
|
|
135
|
+
<AlertTitle>Saved</AlertTitle>
|
|
136
|
+
<AlertDescription>Your changes were applied.</AlertDescription>
|
|
137
|
+
</Alert>
|
|
138
|
+
</div>),
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const Sizes: Story = {
|
|
142
|
+
render: () => (<div className="w-[420px] flex flex-col gap-4">
|
|
143
|
+
<Alert>
|
|
144
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
145
|
+
<AlertTitle>Default size</AlertTitle>
|
|
146
|
+
<AlertDescription>Standard padding for standalone notices.</AlertDescription>
|
|
147
|
+
</Alert>
|
|
148
|
+
<Alert size="sm">
|
|
149
|
+
<AlertCircleIcon className="h-5 w-5" />
|
|
150
|
+
<AlertTitle>Small (sm)</AlertTitle>
|
|
151
|
+
<AlertDescription>Compact padding for dense layouts or inline notices.</AlertDescription>
|
|
152
|
+
</Alert>
|
|
153
|
+
</div>),
|
|
154
|
+
};
|
|
155
|
+
|
|
121
156
|
export const RealisticUse: Story = {
|
|
122
157
|
render: () => (<div className="w-[420px] flex flex-col gap-3">
|
|
123
158
|
<Alert>
|
|
@@ -14,7 +14,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
14
14
|
import { buttonVariants } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
15
15
|
|
|
16
16
|
const meta: Meta<typeof AlertDialog> = {
|
|
17
|
-
title: "Components/AlertDialog",
|
|
17
|
+
title: "Components/Feedback/AlertDialog",
|
|
18
18
|
component: AlertDialog,
|
|
19
19
|
parameters: {
|
|
20
20
|
layout: "centered",
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { Anchor } from "@behavioral-agentic-design-system/core/components/ui/anchor";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Anchor> = {
|
|
6
|
-
title: "Components/Anchor",
|
|
6
|
+
title: "Components/Navigation/Anchor",
|
|
7
7
|
component: Anchor,
|
|
8
8
|
parameters: { layout: "padded" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof AngleSlider> = {
|
|
13
|
-
title: "Components/AngleSlider",
|
|
13
|
+
title: "Components/Selection/AngleSlider",
|
|
14
14
|
component: AngleSlider,
|
|
15
15
|
parameters: {
|
|
16
16
|
layout: "centered",
|