= {
// button, avatar, toggle-switch → component-docs/*.tsx
// ── Forms (fallback when component-docs/*.tsx has no sections) ──────────
// Form + Input live specs are in forms-family.tsx (takes precedence).
form: [
section("field", "Field layouts", , "Vertical and horizontal Field compositions."),
section("field-basic", "Basic field", ),
section("field-invalid", "Invalid field", ),
section("field-disabled", "Disabled field", ),
section("field-set", "FieldSet (checkboxes)", ),
section("rhf", "react-hook-form", ),
],
input: [
section("default", "Input", ),
section("textarea", "Textarea", ),
section("input-group", "Input group", , "Leading and trailing addons."),
section("input-button", "Input with primary action", ),
section("password", "Password with validation", ),
section("otp", "One time password", ),
section("input-mask", "Input mask", , "Phone, ZIP, date, custom."),
section("label", "Label", , "Prefer FieldLabel in product forms."),
section("slider", "Slider", ),
section("payment-card-fields", "Payment card fields", ),
],
select: [
section("default", "Item-aligned", ),
section("popper", "Popper", ),
section("groups", "Groups and separators", ),
section("scrollable", "Scrollable list", ),
section("states", "Invalid, disabled, and size", ),
],
// checkbox → component-docs/checkbox.tsx
"radio-group": [
section("default", "Default", ),
section("fieldset", "Fieldset", ),
section("description", "With description", ),
section("choice-card", "Choice card", ),
section("invalid", "Invalid", ),
section("selection-tile-grid", "Selection tiles", , "Radio/checkbox tile grid."),
],
"date-picker": [
section("calendar", "Calendar (label caption)", , "Low-level date grid primitive."),
section("calendar-dropdown", "Calendar (dropdown caption)", ),
section("calendar-range", "Calendar range (one month)", ),
section("calendar-two-month", "Calendar range (two months)", ),
section("date-picker", "Date picker field", ),
section("date-range", "Date range field", , "One- and two-month popovers."),
section("date-text", "Masked date text field", , "DateTextInputField for filters."),
],
wizard: [
section("all-variants", "All variants", , "Full matrix for QA — numbered, icons, compact, vertical, error, 8-step scroll."),
section("horizontal-numbered", "Horizontal numbered", , "Brand completed · tint active · muted upcoming. Min 12px type."),
section("horizontal-icons", "Horizontal icons", , "Icon markers; check replaces icon when done."),
section("horizontal-compact", "Horizontal compact", , "Dot rail + Step N of M for dense flows."),
section("vertical-numbered", "Vertical numbered", , "Sidebar rail — PatternFly wizard."),
section("vertical-icons", "Vertical icons", , "Vertical icon rail with descriptions."),
section("error", "Error state", , "Current-step validation failure."),
section("many-steps", "Edge case: overflow", , "8-step stress test for scroll + guidance — not a product pattern."),
],
// ── Overlays ────────────────────────────────────────────────────────────
dialog: [
section("default", "Default", ),
section("alert-dialog", "Alert dialog", , "Destructive / ack with actions."),
],
popover: [
section("default", "Default", ),
section("hover-card", "Hover card", , "Row identity preview on hover."),
],
"dropdown-menu": [
section("default", "Dropdown menu", ),
section("rich", "Checkboxes, radios, and submenu", ),
section("icon", "Icon trigger", ),
section("context-menu", "Context menu", , "Right-click the surface."),
section(
"selection-toolbar",
"Text selection toolbar",
,
"Select text to show the floating toolbar.",
),
],
tip: [
section("default", "Default", , "Product tooltip wrapper; prefer in app code."),
section("tooltip", "Tooltip primitive", , "Low-level primitive; Tip is the default."),
],
command: [section("default", "Default", )],
// ── Navigation ──────────────────────────────────────────────────────────
breadcrumb: [section("default", "Default", )],
tabs: [
section(
"default-variant",
"Default variant",
,
"Pill tablist (`variant` default). Label only, with icon, or with TabsCountBadge.",
),
section(
"line-variant",
"Line variant",
,
"Underline tablist (`variant=\"line\"`). Same three trigger shapes.",
),
section(
"responsive-collapse",
"Responsive collapse",
,
"`TabsListScrollRegion` + `TabsTriggerIcon` / `TabsTriggerLabel`, on both variants. Inactive tabs drop to icon only when the labels stop fitting, then whole tabs move into an overflow menu.",
),
],
// badge, card, coach-mark, kbd, skeleton → component-docs/*.tsx
// ── Layout ──────────────────────────────────────────────────────────────
accordion: [
section("default", "Default", ),
section("collapsible", "Collapsible", ),
],
separator: [
section("default", "Default", ),
section("scroll-area", "Scroll area", ),
],
// ── Data display ────────────────────────────────────────────────────────
// avatar → component-docs/avatar.tsx
// table → component-docs/table.tsx
"chart-card": [
section("normal", "Normal", , "Title, description, chart body, Ask Leo on card hover."),
section(
"tabs",
"Tabs",
,
"Chart and Trend panels. Uses the same line tab chrome as metrics tabs.",
),
section("selector", "Selector", , "Header filter select."),
section(
"metrics-tabs",
"Metrics tabs",
,
"Metric cells are tab triggers.",
),
section("kpi-chart", "KPI + chart", , "Hero metric above the chart."),
],
// ── Patterns · Data views ───────────────────────────────────────────────
"data-table": [
section("grid", "Core grid", , "Sort, filters, resize."),
section("hub-table", "HubTable", , "useTableState + toolbar + Properties."),
section(
"bulk-actions",
"Bulk action bar",
,
"Floating bar when rows are selected; Esc clears.",
),
],
"key-metrics": [section("variants", "Flat, card strip, and metric cards", )],
"page-header": [section("default", "Hub header", )],
// ── Table cells ─────────────────────────────────────────────────────────
"table-cells": [
section("progress-cell", "Progress", ),
section("currency-cell", "Currency", ),
section("numeric-cell", "Numeric", ),
section("rating-cell", "Rating", ),
section("signal-bars-cell", "Signal bars", ),
section("status-cell", "Status", ),
section("table-new-row-dot", "New row", ),
section("favorite-name-cell", "Name + favorite", ),
section("empty-cell", "Empty value", ),
section("boolean-toggle-cell", "Boolean toggle", ),
section("pill-cell", "Pill", ),
section("tag-list-cell", "Tag list", ),
section("people-avatar-rail-cell", "People rail", ),
section("external-link-cell", "External link", ),
section("relative-time-cell", "Relative time", ),
section("attachment-count-cell", "Attachment count", ),
section("row-actions-cell", "Row actions", ),
],
}
export function getDesignSystemPreviewSections(slug: string): DesignSystemPreviewSection[] | null {
const sections = PREVIEW_SECTIONS[slug]
return sections && sections.length > 0 ? sections : null
}
export function DesignSystemPreviewSections({ slug }: { slug: string }) {
const sections = getDesignSystemPreviewSections(slug)
if (!sections) return null
const wideCanvas = designSystemPreviewIsWide(slug)
return (
{sections.map((block) => (
{block.bare ? null : (
{block.title}
)}
{block.children}
))}
)
}
export { designSystemHasLivePreview } from "@/components/design-system/design-system-preview-meta"