@uibot/registry 0.5.0 → 0.7.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/dist/index.js +9 -9
- package/dist/shadcn/r/admin-dashboard.json +70 -0
- package/dist/shadcn/r/admin-shell.json +148 -0
- package/dist/shadcn/r/ai-chat.json +74 -0
- package/dist/shadcn/r/analytics-dashboard.json +65 -0
- package/dist/shadcn/r/app-shell-floating.json +54 -0
- package/dist/shadcn/r/app-shell-icon-rail.json +54 -0
- package/dist/shadcn/r/app-shell-inset.json +54 -0
- package/dist/shadcn/r/app-shell-settings.json +54 -0
- package/dist/shadcn/r/app-shell-sidebar.json +54 -0
- package/dist/shadcn/r/app-shell-workspace.json +54 -0
- package/dist/shadcn/r/auth.json +61 -0
- package/dist/shadcn/r/blog.json +64 -0
- package/dist/shadcn/r/charts.json +211 -0
- package/dist/shadcn/r/content.json +444 -0
- package/dist/shadcn/r/creation-html-generation.json +29 -0
- package/dist/shadcn/r/creation-reference-generation.json +29 -0
- package/dist/shadcn/r/creation-revision-export.json +27 -0
- package/dist/shadcn/r/creation-shared.json +24 -0
- package/dist/shadcn/r/creation-workspace.json +33 -0
- package/dist/shadcn/r/crm.json +67 -0
- package/dist/shadcn/r/dashboard.json +147 -0
- package/dist/shadcn/r/data-studio.json +368 -0
- package/dist/shadcn/r/data-table.json +224 -0
- package/dist/shadcn/r/data.json +320 -0
- package/dist/shadcn/r/ecommerce.json +65 -0
- package/dist/shadcn/r/feedback.json +300 -0
- package/dist/shadcn/r/field.json +164 -0
- package/dist/shadcn/r/form.json +425 -0
- package/dist/shadcn/r/grid.json +188 -0
- package/dist/shadcn/r/interactive.json +355 -0
- package/dist/shadcn/r/kanban.json +154 -0
- package/dist/shadcn/r/layout.json +529 -0
- package/dist/shadcn/r/lms.json +74 -0
- package/dist/shadcn/r/marketing.json +402 -0
- package/dist/shadcn/r/nav.json +257 -0
- package/dist/shadcn/r/portfolio.json +62 -0
- package/dist/shadcn/r/presentation.json +454 -0
- package/dist/shadcn/r/pricing.json +63 -0
- package/dist/shadcn/r/primitives.json +360 -0
- package/dist/shadcn/r/saas-landing.json +60 -0
- package/dist/shadcn/r/sections.json +734 -0
- package/dist/shadcn/r/settings.json +72 -0
- package/dist/shadcn/r/shadcn-admin-shell.json +49 -0
- package/dist/shadcn/r/shadcn-admin.json +76 -0
- package/dist/shadcn/r/store.json +75 -0
- package/dist/shadcn/r/support-inbox.json +63 -0
- package/dist/shadcn/r/team-directory.json +59 -0
- package/dist/shadcn/r/uibot-base.json +30 -0
- package/dist/shadcn/r/uibot-theme.json +86 -0
- package/dist/shadcn/r/workspace.json +174 -0
- package/dist/shadcn/registry.json +615 -0
- package/dist/shadcn.d.ts +10 -5
- package/package.json +2 -2
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "content",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"description": "Editorial accordion FAQ built on native <details>/<summary> — fully functional with zero JS / state wiring. Optional eyebrow/title/lead header; rows carry a mono index numeral, a hairline plus-mark that rotates 45° into a close-mark on open, and a grid-rows expand transition.",
|
|
6
|
+
"dependencies": [
|
|
7
|
+
"react"
|
|
8
|
+
],
|
|
9
|
+
"registryDependencies": [
|
|
10
|
+
"@uibot/uibot-base"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"path": "components/uibot/content.tsx",
|
|
15
|
+
"target": "components/uibot/content.tsx",
|
|
16
|
+
"content": "import type { ReactElement, ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\n\n/**\n * \"Schematic Editorial\" content / layout blocks.\n *\n * A second tranche of marketing/layout primitives (Faq, TeamGrid, Steps,\n * BentoGrid + BentoCell, Callout) that broaden UIBot's catalog toward the block\n * breadth of design-system kits while staying **original** implementations.\n *\n * Design rules these follow:\n * ① Work in any context off the core theme tokens (foreground / muted /\n * border / primary / card); under a `.marketing` scope they pick up the\n * brand serif/mono fonts, hairline `.mkt-card` material and accent washes\n * defined in `apps/studio/src/styles.css`.\n * ② Light + dark via tokens / `color-mix` (no hard-coded colours).\n * ③ Pure SVG / CSS — zero new npm dependencies (icons map to a small inline\n * SVG set, identical to presentation.tsx so specs share icon names).\n * ④ Each ships a full CatalogEntry (see ./catalog.ts).\n *\n * Bento span classes use a static lookup table (BENTO_COL_SPAN / BENTO_ROW_SPAN)\n * so Tailwind's JIT never purges a dynamically-built `col-span-${n}` class —\n * mirroring the COLS map in ./grid.tsx.\n */\n\nfunction str(v: unknown): string | undefined {\n return typeof v === \"string\" && v.length > 0 ? v : undefined;\n}\n\nfunction records(raw: unknown): Record<string, unknown>[] {\n if (!Array.isArray(raw)) return [];\n return raw.filter((it): it is Record<string, unknown> => Boolean(it) && typeof it === \"object\");\n}\n\n/** Clamp a 0-based accent index into the four-hue tint palette (0..3). */\nfunction tintIndex(raw: unknown, fallback = 0): number {\n const n = Number(raw);\n return Number.isFinite(n) ? ((Math.trunc(n) % 4) + 4) % 4 : fallback;\n}\n\n// ── Inline icon set (lucide-compatible names, no runtime dep) ──────────────────\n// Mirrors presentation.tsx so specs can reuse the same icon vocabulary; unknown\n// names fall back to a dot so a block never throws on an unmapped icon.\n\nconst ICON_PATHS: Record<string, ReactNode> = {\n sparkles: <path d=\"M12 3l1.9 4.6L18.5 9.5l-4.6 1.9L12 16l-1.9-4.6L5.5 9.5l4.6-1.9z\" />,\n zap: <path d=\"M13 2 4 14h7l-1 8 9-12h-7z\" />,\n layers: (\n <>\n <path d=\"m12 3 9 5-9 5-9-5 9-5z\" />\n <path d=\"m3 12 9 5 9-5\" />\n </>\n ),\n boxes: (\n <>\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\" />\n <rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\" />\n <rect x=\"8.5\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\" />\n </>\n ),\n code: <path d=\"m8 6-6 6 6 6M16 6l6 6-6 6\" />,\n cpu: (\n <>\n <rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" />\n <path d=\"M9 1v3M15 1v3M9 20v3M15 20v3M1 9h3M1 15h3M20 9h3M20 15h3\" />\n </>\n ),\n workflow: (\n <>\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\" />\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\" />\n <path d=\"M10 6.5h6a2 2 0 0 1 2 2V14\" />\n </>\n ),\n gauge: (\n <>\n <path d=\"M3 14a9 9 0 1 1 18 0\" />\n <path d=\"m13 12-3 3\" />\n </>\n ),\n shield: <path d=\"M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z\" />,\n wand: <path d=\"m15 4 5 5M4 20 14 10M9 4l1 2 2 1-2 1-1 2-1-2-2-1 2-1z\" />,\n info: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 11v5M12 7.5h.01\" />\n </>\n ),\n check: <path d=\"m20 6-11 11-5-5\" />,\n alert: (\n <>\n <path d=\"M12 3 2 20h20L12 3z\" />\n <path d=\"M12 10v4M12 17.5h.01\" />\n </>\n ),\n};\n\nfunction Icon({\n name,\n className = \"size-5\",\n}: {\n name?: string | undefined;\n className?: string;\n}): ReactElement {\n const path = (name && ICON_PATHS[name.toLowerCase()]) || <circle cx=\"12\" cy=\"12\" r=\"3\" />;\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.6}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n aria-hidden=\"true\"\n >\n {path}\n </svg>\n );\n}\n\n// ── Faq ────────────────────────────────────────────────────────────────────────\n\ninterface FaqItem {\n q: string;\n a: string;\n}\n\nfunction parseFaqItems(raw: unknown): FaqItem[] {\n return records(raw)\n .map((it) => ({ q: str(it[\"q\"]) ?? \"\", a: str(it[\"a\"]) ?? \"\" }))\n .filter((it) => it.q.length > 0);\n}\n\nconst FAQ_MONO = { fontFamily: \"var(--font-marketing-mono)\" } as const;\n\n/**\n * Accordion FAQ list, editorial style. Uses native <details>/<summary> so it is\n * fully functional with zero JS / zero state wiring (works in any host,\n * including static render). Each row carries a mono index numeral; a hairline\n * plus-mark rotates 45° into a close-mark on open, and the answer expands via\n * a grid-rows transition. `defaultOpenFirst` opens the first row on mount.\n */\nexport const Faq: RendererComponent = (props) => {\n const eyebrow = str(props[\"eyebrow\"]);\n const title = str(props[\"title\"]);\n const lead = str(props[\"lead\"]);\n const defaultOpenFirst = props[\"defaultOpenFirst\"] === true;\n const items = parseFaqItems(props[\"items\"]);\n\n return (\n <section className=\"marketing mx-auto max-w-3xl px-6 md:px-0\" data-uibot-type=\"Faq\">\n {(eyebrow || title || lead) && (\n <header className=\"mb-8 md:mb-10\">\n {eyebrow && (\n <p\n className=\"text-[0.65rem] uppercase tracking-[0.28em] text-[var(--marketing-accent)]\"\n style={FAQ_MONO}\n >\n {eyebrow}\n </p>\n )}\n {title && <h2 className=\"mt-3 text-3xl md:text-4xl\">{title}</h2>}\n {lead && (\n <p className=\"mt-3 max-w-xl text-sm leading-relaxed text-muted-foreground\">{lead}</p>\n )}\n </header>\n )}\n <div className=\"border-t border-border/70\">\n {items.map((it, i) => (\n <details\n key={i}\n className=\"group border-b border-border/70 [&_summary::-webkit-details-marker]:hidden\"\n open={defaultOpenFirst && i === 0 ? true : undefined}\n >\n <summary className=\"flex cursor-pointer list-none items-baseline gap-4 py-5 md:gap-6\">\n <span\n aria-hidden=\"true\"\n className=\"w-7 shrink-0 text-[0.65rem] tracking-[0.18em] text-muted-foreground/60 transition-colors duration-200 group-open:text-[var(--marketing-accent)]\"\n style={FAQ_MONO}\n >\n {String(i + 1).padStart(2, \"0\")}\n </span>\n <span className=\"flex-1 text-base font-medium text-foreground/90 transition-colors duration-200 group-hover:text-foreground group-open:text-foreground md:text-lg\">\n {it.q}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"relative mt-1 size-3.5 shrink-0 self-center text-muted-foreground/70 transition-transform duration-300 ease-out group-hover:text-foreground group-open:rotate-45 group-open:text-[var(--marketing-accent)]\"\n >\n <span className=\"absolute left-0 top-1/2 h-px w-full -translate-y-1/2 bg-current\" />\n <span className=\"absolute left-1/2 top-0 h-full w-px -translate-x-1/2 bg-current\" />\n </span>\n </summary>\n {it.a && (\n <div className=\"grid grid-rows-[0fr] transition-[grid-template-rows] duration-300 ease-out group-open:grid-rows-[1fr]\">\n <div className=\"overflow-hidden\">\n <p className=\"pb-6 pl-11 pr-2 text-sm leading-relaxed text-muted-foreground md:pl-[3.25rem]\">\n {it.a}\n </p>\n </div>\n </div>\n )}\n </details>\n ))}\n </div>\n </section>\n );\n};\n\n// ── TeamGrid ────────────────────────────────────────────────────────────────────\n\ninterface TeamMember {\n name: string;\n role?: string | undefined;\n bio?: string | undefined;\n avatar?: string | undefined;\n}\n\nfunction parseMembers(raw: unknown): TeamMember[] {\n return records(raw)\n .map((it) => ({\n name: str(it[\"name\"]) ?? \"\",\n role: str(it[\"role\"]),\n bio: str(it[\"bio\"]),\n avatar: str(it[\"avatar\"]),\n }))\n .filter((it) => it.name.length > 0);\n}\n\nconst TEAM_COLS: Record<string, string> = {\n \"2\": \"sm:grid-cols-2\",\n \"3\": \"sm:grid-cols-2 lg:grid-cols-3\",\n \"4\": \"sm:grid-cols-2 lg:grid-cols-4\",\n};\n\n/** Derive up-to-two-letter initials from a member name for the avatar fallback. */\nfunction initials(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"?\";\n if (parts.length === 1) return parts[0]!.slice(0, 2).toUpperCase();\n return (parts[0]![0]! + parts[parts.length - 1]![0]!).toUpperCase();\n}\n\n/**\n * Grid of team member cards. Each card shows an avatar (an image when `avatar`\n * is a URL, otherwise tinted initials), name, role and optional bio. Hairline\n * `.mkt-card` material with hover lift under `.marketing`.\n */\nexport const TeamGrid: RendererComponent = (props) => {\n const members = parseMembers(props[\"members\"]);\n const cols = String(props[\"columns\"] ?? \"3\");\n const colsCls = TEAM_COLS[cols] ?? TEAM_COLS[\"3\"];\n\n return (\n <div\n className={cn(\"marketing mx-auto grid max-w-6xl grid-cols-1 gap-5 px-6 md:px-0\", colsCls)}\n data-uibot-type=\"TeamGrid\"\n >\n {members.map((m, i) => {\n const isUrl = m.avatar && /^(https?:|data:|\\/)/.test(m.avatar);\n return (\n <article\n key={i}\n className={cn(\n \"mkt-card mkt-reveal flex flex-col items-center p-6 text-center\",\n `mkt-reveal-${Math.min(i + 1, 6)}`,\n )}\n >\n {isUrl ? (\n // eslint-disable-next-line @next/next/no-img-element\n <img src={m.avatar} alt={m.name} className=\"size-16 rounded-full object-cover\" />\n ) : (\n <span\n className={cn(\n \"inline-flex size-16 items-center justify-center rounded-full border text-lg font-semibold mkt-tint\",\n `mkt-tint-${i % 4}`,\n )}\n >\n {str(m.avatar) ?? initials(m.name)}\n </span>\n )}\n <h3 className=\"mt-4 text-lg\">{m.name}</h3>\n {m.role && (\n <p className=\"mt-1 font-[family-name:var(--font-marketing-mono)] text-xs uppercase tracking-[0.14em] text-[var(--marketing-accent)]\">\n {m.role}\n </p>\n )}\n {m.bio && <p className=\"mt-3 text-sm leading-relaxed text-muted-foreground\">{m.bio}</p>}\n </article>\n );\n })}\n </div>\n );\n};\n\n// ── Steps ────────────────────────────────────────────────────────────────────\n\ninterface StepItem {\n title: string;\n desc?: string | undefined;\n icon?: string | undefined;\n}\n\nfunction parseSteps(raw: unknown): StepItem[] {\n return records(raw)\n .map((it) => ({\n title: str(it[\"title\"]) ?? \"\",\n desc: str(it[\"desc\"]),\n icon: str(it[\"icon\"]),\n }))\n .filter((it) => it.title.length > 0);\n}\n\n// Big step numeral colours cycle through the four accent hues (amber / teal /\n// rose / indigo) so a sequence reads as distinct stages.\nconst STEP_TONE: string[] = [\n \"var(--marketing-accent)\",\n \"var(--mk-accent-2)\",\n \"var(--mk-accent-3)\",\n \"var(--mk-accent-4)\",\n];\n\n// Column count derives from the step count (clamped 2–4) so a 4-stage pipeline\n// fills one row instead of leaving an orphaned card (mirrors StatBand).\nconst STEP_COLS: Record<number, string> = {\n 2: \"lg:grid-cols-2\",\n 3: \"lg:grid-cols-3\",\n 4: \"lg:grid-cols-2 xl:grid-cols-4\",\n};\n\n/**\n * \"How it works\" steps. Oversized mono numerals lead each step.\n * - variant `numbered` (default): a responsive card row, each with a big number.\n * - variant `connected`: a vertical rail with a connecting line between dots,\n * reading top-to-bottom like a sequence.\n */\nexport const Steps: RendererComponent = (props) => {\n const steps = parseSteps(props[\"steps\"]);\n const variant = str(props[\"variant\"]) === \"connected\" ? \"connected\" : \"numbered\";\n const num = (i: number) => String(i + 1).padStart(2, \"0\");\n\n if (variant === \"connected\") {\n return (\n <ol className=\"marketing mx-auto max-w-3xl px-6 md:px-0\" data-uibot-type=\"Steps\">\n {steps.map((s, i) => (\n <li key={i} className=\"relative flex gap-5 pb-8 last:pb-0\">\n {i < steps.length - 1 && (\n <span\n aria-hidden=\"true\"\n className=\"absolute left-[1.375rem] top-12 bottom-0 w-px bg-border\"\n />\n )}\n <span\n className={cn(\n \"relative z-10 inline-flex size-11 shrink-0 items-center justify-center rounded-full border font-[family-name:var(--font-marketing-mono)] text-sm font-semibold tabular-nums mkt-tint\",\n `mkt-tint-${i % 4}`,\n )}\n >\n {s.icon ? <Icon name={s.icon} /> : num(i)}\n </span>\n <div className=\"pt-1.5\">\n <h3 className=\"text-xl\">{s.title}</h3>\n {s.desc && (\n <p className=\"mt-2 text-sm leading-relaxed text-muted-foreground\">{s.desc}</p>\n )}\n </div>\n </li>\n ))}\n </ol>\n );\n }\n\n return (\n <ol\n className={cn(\n \"marketing mx-auto grid max-w-6xl grid-cols-1 gap-6 px-6 sm:grid-cols-2 md:px-0\",\n STEP_COLS[Math.min(Math.max(steps.length, 2), 4)] ?? \"lg:grid-cols-3\",\n )}\n data-uibot-type=\"Steps\"\n >\n {steps.map((s, i) => (\n <li key={i} className={cn(\"mkt-card mkt-reveal p-6\", `mkt-reveal-${Math.min(i + 1, 6)}`)}>\n <span\n className=\"mkt-sectno block text-5xl md:text-6xl\"\n style={{ color: STEP_TONE[i % 4] }}\n >\n {num(i)}\n </span>\n <h3 className=\"mt-4 text-xl\">{s.title}</h3>\n {s.desc && <p className=\"mt-2 text-sm leading-relaxed text-muted-foreground\">{s.desc}</p>}\n </li>\n ))}\n </ol>\n );\n};\n\n// ── BentoGrid + BentoCell ───────────────────────────────────────────────────────\n\n// Static span lookup tables. Tailwind's JIT cannot see a runtime-built\n// `col-span-${n}` token, so we map clamped 1–4 spans to literal class strings —\n// the same defensive pattern as the COLS map in ./grid.tsx.\nconst BENTO_GRID_COLS: Record<string, string> = {\n \"2\": \"sm:grid-cols-2\",\n \"3\": \"sm:grid-cols-2 lg:grid-cols-3\",\n \"4\": \"sm:grid-cols-2 lg:grid-cols-4\",\n \"6\": \"sm:grid-cols-3 lg:grid-cols-6\",\n};\n\nconst BENTO_GAP: Record<string, string> = {\n none: \"gap-0\",\n sm: \"gap-3\",\n md: \"gap-4\",\n lg: \"gap-6\",\n};\n\nconst BENTO_COL_SPAN: Record<string, string> = {\n \"1\": \"col-span-1\",\n \"2\": \"sm:col-span-2\",\n \"3\": \"sm:col-span-2 lg:col-span-3\",\n \"4\": \"sm:col-span-2 lg:col-span-4\",\n};\n\nconst BENTO_ROW_SPAN: Record<string, string> = {\n \"1\": \"row-span-1\",\n \"2\": \"row-span-2\",\n \"3\": \"row-span-3\",\n};\n\nfunction spanClass(raw: unknown, table: Record<string, string>, max: number): string {\n const n = Number(raw);\n if (!Number.isFinite(n)) return \"\";\n const clamped = Math.min(Math.max(Math.trunc(n), 1), max);\n return table[String(clamped)] ?? \"\";\n}\n\ninterface BentoItem {\n title?: string | undefined;\n desc?: string | undefined;\n icon?: string | undefined;\n tone?: unknown;\n span?: { col?: unknown; row?: unknown } | undefined;\n}\n\nfunction parseBentoItems(raw: unknown): BentoItem[] {\n return records(raw).map((it) => {\n const span = it[\"span\"];\n return {\n title: str(it[\"title\"]),\n desc: str(it[\"desc\"]),\n icon: str(it[\"icon\"]),\n tone: it[\"tone\"],\n span:\n span && typeof span === \"object\"\n ? {\n col: (span as Record<string, unknown>)[\"col\"],\n row: (span as Record<string, unknown>)[\"row\"],\n }\n : undefined,\n };\n });\n}\n\n/** Render the inner content of one bento cell (shared by `items` and children). */\nfunction BentoCellBody({\n title,\n desc,\n icon,\n tone,\n children,\n}: {\n title?: string | undefined;\n desc?: string | undefined;\n icon?: string | undefined;\n tone: number;\n children?: ReactNode;\n}): ReactElement {\n return (\n <>\n {icon && (\n <span\n className={cn(\n \"mb-4 inline-flex size-11 items-center justify-center rounded-lg border mkt-tint\",\n `mkt-tint-${tone}`,\n )}\n >\n <Icon name={icon} />\n </span>\n )}\n {title && <h3 className=\"text-xl\">{title}</h3>}\n {desc && <p className=\"mt-2 text-sm leading-relaxed text-muted-foreground\">{desc}</p>}\n {children}\n </>\n );\n}\n\n/**\n * Asymmetric bento layout. Lays children (BentoCell) or an `items` array onto a\n * CSS grid whose base column count is `cols`; cells opt into `col`/`row` spans\n * to break the rhythm. `gridAutoRows` keeps row spans visually even.\n */\nexport const BentoGrid: RendererComponent = (props, ctx) => {\n const cols = String(props[\"cols\"] ?? \"3\");\n const colsCls = BENTO_GRID_COLS[cols] ?? BENTO_GRID_COLS[\"3\"];\n const gapCls = BENTO_GAP[str(props[\"gap\"]) ?? \"md\"] ?? BENTO_GAP[\"md\"];\n const items = parseBentoItems(props[\"items\"]);\n const children = ctx.children as ReactNode[];\n\n return (\n <div\n className={cn(\n \"marketing mx-auto grid max-w-6xl grid-cols-1 px-6 md:px-0 [grid-auto-rows:minmax(11rem,auto)]\",\n colsCls,\n gapCls,\n )}\n data-uibot-type=\"BentoGrid\"\n >\n {children.length > 0\n ? children\n : items.map((it, i) => {\n const tone = tintIndex(it.tone, i % 4);\n const colCls = spanClass(it.span?.col, BENTO_COL_SPAN, 4);\n const rowCls = spanClass(it.span?.row, BENTO_ROW_SPAN, 3);\n return (\n <article\n key={i}\n className={cn(\n \"mkt-card mkt-reveal flex flex-col p-6\",\n colCls,\n rowCls,\n `mkt-reveal-${Math.min(i + 1, 6)}`,\n )}\n >\n <BentoCellBody title={it.title} desc={it.desc} icon={it.icon} tone={tone} />\n </article>\n );\n })}\n </div>\n );\n};\n\n/**\n * A single bento tile, usable standalone inside a BentoGrid. Reads `span.col` /\n * `span.row` and maps them to static span classes so an authored cell can be\n * as wide/tall as the layout needs.\n */\nexport const BentoCell: RendererComponent = (props, ctx) => {\n const span = (props[\"span\"] as { col?: unknown; row?: unknown } | undefined) ?? undefined;\n const tone = tintIndex(props[\"tone\"], 0);\n const colCls = spanClass(span?.col, BENTO_COL_SPAN, 4);\n const rowCls = spanClass(span?.row, BENTO_ROW_SPAN, 3);\n const children = ctx.children as ReactNode[];\n\n return (\n <article\n className={cn(\"mkt-card marketing flex flex-col p-6\", colCls, rowCls)}\n data-uibot-type=\"BentoCell\"\n >\n <BentoCellBody\n title={str(props[\"title\"])}\n desc={str(props[\"desc\"])}\n icon={str(props[\"icon\"])}\n tone={tone}\n >\n {children.length > 0 ? <div className=\"mt-4\">{children}</div> : null}\n </BentoCellBody>\n </article>\n );\n};\n\n// ── Callout ────────────────────────────────────────────────────────────────────\n\ntype CalloutVariant = \"info\" | \"success\" | \"warn\" | \"accent\";\n\nconst CALLOUT_VARIANTS: Record<CalloutVariant, { color: string; icon: string }> = {\n // `color` is a CSS custom-property reference; tint is applied via color-mix so\n // both light + dark stay legible off the same token.\n info: { color: \"var(--mk-accent-4)\", icon: \"info\" },\n success: { color: \"var(--success)\", icon: \"check\" },\n warn: { color: \"var(--warning)\", icon: \"alert\" },\n accent: { color: \"var(--marketing-accent)\", icon: \"sparkles\" },\n};\n\n/**\n * Emphasis callout block. A tinted panel (semantic/brand colour) with an accent\n * left bar, icon, optional title and body. `color-mix` against the chosen token\n * keeps the wash subtle and theme-correct in light and dark.\n */\nexport const Callout: RendererComponent = (props, ctx) => {\n const variantRaw = str(props[\"variant\"]) as CalloutVariant | undefined;\n const variant: CalloutVariant =\n variantRaw && variantRaw in CALLOUT_VARIANTS ? variantRaw : \"info\";\n const { color, icon: defaultIcon } = CALLOUT_VARIANTS[variant];\n const icon = str(props[\"icon\"]) ?? defaultIcon;\n const title = str(props[\"title\"]);\n const body = str(props[\"body\"]);\n const children = ctx.children as ReactNode[];\n\n return (\n <aside\n className=\"marketing mx-auto flex max-w-3xl gap-4 rounded-lg border p-5\"\n data-uibot-type=\"Callout\"\n style={{\n borderColor: `color-mix(in oklch, ${color} 35%, var(--border))`,\n background: `color-mix(in oklch, ${color} 8%, var(--card))`,\n }}\n >\n <span\n aria-hidden=\"true\"\n className=\"mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-md\"\n style={{\n color,\n background: `color-mix(in oklch, ${color} 16%, transparent)`,\n }}\n >\n <Icon name={icon} className=\"size-5\" />\n </span>\n <div className=\"min-w-0\">\n {title && (\n <p className=\"font-medium text-foreground\" style={{ color }}>\n {title}\n </p>\n )}\n {body && (\n <p className={cn(\"text-sm leading-relaxed text-muted-foreground\", title && \"mt-1\")}>\n {body}\n </p>\n )}\n {children.length > 0 && <div className=\"mt-2\">{children}</div>}\n </div>\n </aside>\n );\n};\n",
|
|
17
|
+
"type": "registry:ui"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "components/uibot/content.uibot.json",
|
|
21
|
+
"target": "components/uibot/content.uibot.json",
|
|
22
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"content\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"BentoCell\",\n \"export\": \"BentoCell\",\n \"module\": \"content.tsx\",\n \"catalog\": {\n \"name\": \"BentoCell\",\n \"description\": \"A single bento tile, usable standalone inside a BentoGrid. Reads span.col / span.row and maps them to static span classes so the cell can be as wide/tall as the mosaic needs. Optional icon/title/desc plus composed children.\",\n \"category\": \"presentation\",\n \"level\": \"L1\",\n \"tags\": [\n \"bento\",\n \"cell\",\n \"card\",\n \"marketing\"\n ],\n \"props\": {\n \"title\": {\n \"type\": \"string\"\n },\n \"desc\": {\n \"type\": \"string\"\n },\n \"icon\": {\n \"type\": \"string\",\n \"description\": \"lucide icon name\"\n },\n \"tone\": {\n \"type\": \"integer\",\n \"description\": \"Accent-hue index 0–3 (amber/teal/rose/indigo)\"\n },\n \"span\": {\n \"type\": \"object\",\n \"properties\": {\n \"col\": {\n \"type\": \"integer\"\n },\n \"row\": {\n \"type\": \"integer\"\n }\n },\n \"description\": \"{col?, row?} — col clamped 1–4, row clamped 1–3\"\n }\n },\n \"usageScenarios\": [\n \"A hero tile (span col 2, row 2) holding a rendered preview inside a BentoGrid\",\n \"Custom-bodied bento tile composed from child blocks\"\n ],\n \"constraints\": [\n \"Spans are clamped 1–4 (col) / 1–3 (row) and emitted as static classes\",\n \"Designed to sit inside a BentoGrid; standalone it renders as a lone card\"\n ]\n }\n },\n {\n \"name\": \"BentoGrid\",\n \"export\": \"BentoGrid\",\n \"module\": \"content.tsx\",\n \"catalog\": {\n \"name\": \"BentoGrid\",\n \"description\": \"Asymmetric bento layout. Lays BentoCell children, or an `items` array, onto a CSS grid whose base column count is `cols`; cells opt into col/row spans to break the rhythm into a mixed-size mosaic. Hairline cards, per-cell accent tone.\",\n \"category\": \"presentation\",\n \"level\": \"L3\",\n \"tags\": [\n \"bento\",\n \"grid\",\n \"layout\",\n \"marketing\"\n ],\n \"props\": {\n \"cols\": {\n \"type\": \"string\",\n \"enum\": [\n \"2\",\n \"3\",\n \"4\",\n \"6\"\n ],\n \"default\": \"3\",\n \"description\": \"Base column count of the grid (cells may span fewer/more)\"\n },\n \"gap\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"sm\",\n \"md\",\n \"lg\"\n ],\n \"default\": \"md\"\n },\n \"items\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"title\": {\n \"type\": \"string\"\n },\n \"desc\": {\n \"type\": \"string\"\n },\n \"icon\": {\n \"type\": \"string\",\n \"description\": \"lucide icon name\"\n },\n \"tone\": {\n \"type\": \"integer\",\n \"description\": \"Accent-hue index 0–3 (amber/teal/rose/indigo)\"\n },\n \"span\": {\n \"type\": \"object\",\n \"properties\": {\n \"col\": {\n \"type\": \"integer\"\n },\n \"row\": {\n \"type\": \"integer\"\n }\n },\n \"description\": \"Cell span; col 1–4, row 1–3\"\n }\n }\n },\n \"description\": \"Inline cells used when no BentoCell children are provided\"\n }\n },\n \"usageScenarios\": [\n \"Feature mosaic where one tile is hero-sized (span col 2) and the rest are small\",\n \"Capability bento mixing tall and wide tiles\"\n ],\n \"constraints\": [\n \"Provide either BentoCell children or items — children win when present\",\n \"span.col is clamped to 1–4 and span.row to 1–3 via static class maps (no purge risk)\"\n ]\n }\n },\n {\n \"name\": \"Callout\",\n \"export\": \"Callout\",\n \"module\": \"content.tsx\",\n \"catalog\": {\n \"name\": \"Callout\",\n \"description\": \"Emphasis callout panel: a tinted box (semantic or brand colour) with an icon, optional title and body. color-mix against the chosen token keeps the wash subtle and legible in light and dark.\",\n \"category\": \"presentation\",\n \"level\": \"L1\",\n \"tags\": [\n \"callout\",\n \"note\",\n \"alert\",\n \"marketing\"\n ],\n \"props\": {\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"info\",\n \"success\",\n \"warn\",\n \"accent\"\n ],\n \"default\": \"info\",\n \"description\": \"Colour/role: info (indigo) · success (green) · warn (amber) · accent (brand amber)\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Emphasised lead line, coloured to the variant\"\n },\n \"body\": {\n \"type\": \"string\",\n \"description\": \"Supporting paragraph\"\n },\n \"icon\": {\n \"type\": \"string\",\n \"description\": \"Optional lucide icon name; defaults to a sensible glyph per variant\"\n }\n },\n \"usageScenarios\": [\n \"Inline 'Note' / 'Tip' block inside docs or a landing section\",\n \"Success confirmation or warning banner above content\"\n ],\n \"constraints\": [\n \"variant falls back to 'info' when omitted or unrecognised\",\n \"icon defaults per variant (info→info, success→check, warn→alert, accent→sparkles)\"\n ]\n }\n },\n {\n \"name\": \"Faq\",\n \"export\": \"Faq\",\n \"module\": \"content.tsx\",\n \"catalog\": {\n \"name\": \"Faq\",\n \"description\": \"Editorial accordion FAQ built on native <details>/<summary> — fully functional with zero JS / state wiring. Optional eyebrow/title/lead header; rows carry a mono index numeral, a hairline plus-mark that rotates 45° into a close-mark on open, and a grid-rows expand transition.\",\n \"category\": \"presentation\",\n \"level\": \"L2\",\n \"tags\": [\n \"faq\",\n \"accordion\",\n \"marketing\",\n \"content\"\n ],\n \"props\": {\n \"eyebrow\": {\n \"type\": \"string\",\n \"description\": \"Optional mono overline above the title (accent colored)\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Optional serif heading above the list\"\n },\n \"lead\": {\n \"type\": \"string\",\n \"description\": \"Optional muted intro line under the title\"\n },\n \"defaultOpenFirst\": {\n \"type\": \"boolean\",\n \"description\": \"When true, the first row renders open on mount\"\n },\n \"items\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"q\": {\n \"type\": \"string\"\n },\n \"a\": {\n \"type\": \"string\"\n }\n }\n },\n \"description\": \"[{q, a}] question/answer pairs; rows with an empty q are dropped\"\n }\n },\n \"usageScenarios\": [\n \"Pricing / product FAQ section on a landing page\",\n \"Docs 'common questions' block\"\n ],\n \"constraints\": [\n \"Uses native <details> so multiple rows can be open at once; no single-open behaviour\",\n \"Answers render as plain text; pass pre-formatted strings\"\n ]\n }\n },\n {\n \"name\": \"Steps\",\n \"export\": \"Steps\",\n \"module\": \"content.tsx\",\n \"catalog\": {\n \"name\": \"Steps\",\n \"description\": \"'How it works' steps with oversized mono numerals. variant 'numbered' (default) is a responsive card row; variant 'connected' is a vertical rail with a connecting line between numbered dots.\",\n \"category\": \"presentation\",\n \"level\": \"L2\",\n \"tags\": [\n \"steps\",\n \"how-it-works\",\n \"process\",\n \"marketing\"\n ],\n \"props\": {\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"numbered\",\n \"connected\"\n ],\n \"default\": \"numbered\",\n \"description\": \"'numbered' = card row with big numerals; 'connected' = vertical rail with a line\"\n },\n \"steps\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"title\": {\n \"type\": \"string\"\n },\n \"desc\": {\n \"type\": \"string\"\n },\n \"icon\": {\n \"type\": \"string\",\n \"description\": \"Optional lucide icon name; replaces the numeral in the 'connected' dot\"\n }\n }\n },\n \"description\": \"[{title, desc?, icon?}] in sequence order; steps with an empty title are dropped\"\n }\n },\n \"usageScenarios\": [\n \"Three-step onboarding ('Describe → Generate → Render')\",\n \"Connected setup sequence in docs\"\n ],\n \"constraints\": [\n \"Numbering is automatic (01, 02, …) from array order\",\n \"icon only affects the 'connected' variant's dot; the numbered variant always shows the numeral\",\n \"Numbered variant derives its column count from the step count (clamped 2–4), so 4 steps fill one row\"\n ]\n }\n },\n {\n \"name\": \"TeamGrid\",\n \"export\": \"TeamGrid\",\n \"module\": \"content.tsx\",\n \"catalog\": {\n \"name\": \"TeamGrid\",\n \"description\": \"Grid of team-member cards. Each shows an avatar (image when `avatar` is a URL, otherwise tinted initials), name, mono role and optional bio. Hairline cards with hover lift.\",\n \"category\": \"presentation\",\n \"level\": \"L2\",\n \"tags\": [\n \"team\",\n \"people\",\n \"grid\",\n \"marketing\"\n ],\n \"props\": {\n \"columns\": {\n \"type\": \"string\",\n \"enum\": [\n \"2\",\n \"3\",\n \"4\"\n ],\n \"default\": \"3\"\n },\n \"members\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"role\": {\n \"type\": \"string\"\n },\n \"bio\": {\n \"type\": \"string\"\n },\n \"avatar\": {\n \"type\": \"string\",\n \"description\": \"Image URL, or short text/emoji shown as the avatar; falls back to initials\"\n }\n }\n },\n \"description\": \"[{name, role?, bio?, avatar?}] — members with an empty name are dropped\"\n }\n },\n \"usageScenarios\": [\n \"About page 'meet the team' grid\",\n \"Advisors / contributors showcase\"\n ],\n \"constraints\": [\n \"avatar is treated as an image when it looks like a URL (http(s):/data:/leading slash); otherwise rendered as text\",\n \"Initials are derived from the name when no avatar is given\"\n ]\n }\n }\n ]\n}\n",
|
|
23
|
+
"type": "registry:ui"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"meta": {
|
|
27
|
+
"category": "presentation",
|
|
28
|
+
"level": "L2",
|
|
29
|
+
"props": {
|
|
30
|
+
"eyebrow": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Optional mono overline above the title (accent colored)"
|
|
33
|
+
},
|
|
34
|
+
"title": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Optional serif heading above the list"
|
|
37
|
+
},
|
|
38
|
+
"lead": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "Optional muted intro line under the title"
|
|
41
|
+
},
|
|
42
|
+
"defaultOpenFirst": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"description": "When true, the first row renders open on mount"
|
|
45
|
+
},
|
|
46
|
+
"items": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"q": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"a": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"description": "[{q, a}] question/answer pairs; rows with an empty q are dropped"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"scenarios": [
|
|
63
|
+
"Pricing / product FAQ section on a landing page",
|
|
64
|
+
"Docs 'common questions' block"
|
|
65
|
+
],
|
|
66
|
+
"constraints": [
|
|
67
|
+
"Uses native <details> so multiple rows can be open at once; no single-open behaviour",
|
|
68
|
+
"Answers render as plain text; pass pre-formatted strings"
|
|
69
|
+
],
|
|
70
|
+
"provides": [
|
|
71
|
+
"Faq",
|
|
72
|
+
"TeamGrid",
|
|
73
|
+
"Steps",
|
|
74
|
+
"BentoGrid",
|
|
75
|
+
"BentoCell",
|
|
76
|
+
"Callout"
|
|
77
|
+
],
|
|
78
|
+
"uibot": {
|
|
79
|
+
"schema": "uibot.registry.item.v1",
|
|
80
|
+
"item": "content",
|
|
81
|
+
"channel": "public",
|
|
82
|
+
"components": [
|
|
83
|
+
{
|
|
84
|
+
"name": "BentoCell",
|
|
85
|
+
"export": "BentoCell",
|
|
86
|
+
"module": "content.tsx",
|
|
87
|
+
"catalog": {
|
|
88
|
+
"name": "BentoCell",
|
|
89
|
+
"description": "A single bento tile, usable standalone inside a BentoGrid. Reads span.col / span.row and maps them to static span classes so the cell can be as wide/tall as the mosaic needs. Optional icon/title/desc plus composed children.",
|
|
90
|
+
"category": "presentation",
|
|
91
|
+
"level": "L1",
|
|
92
|
+
"tags": [
|
|
93
|
+
"bento",
|
|
94
|
+
"cell",
|
|
95
|
+
"card",
|
|
96
|
+
"marketing"
|
|
97
|
+
],
|
|
98
|
+
"props": {
|
|
99
|
+
"title": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"desc": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"icon": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "lucide icon name"
|
|
108
|
+
},
|
|
109
|
+
"tone": {
|
|
110
|
+
"type": "integer",
|
|
111
|
+
"description": "Accent-hue index 0–3 (amber/teal/rose/indigo)"
|
|
112
|
+
},
|
|
113
|
+
"span": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"properties": {
|
|
116
|
+
"col": {
|
|
117
|
+
"type": "integer"
|
|
118
|
+
},
|
|
119
|
+
"row": {
|
|
120
|
+
"type": "integer"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"description": "{col?, row?} — col clamped 1–4, row clamped 1–3"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"usageScenarios": [
|
|
127
|
+
"A hero tile (span col 2, row 2) holding a rendered preview inside a BentoGrid",
|
|
128
|
+
"Custom-bodied bento tile composed from child blocks"
|
|
129
|
+
],
|
|
130
|
+
"constraints": [
|
|
131
|
+
"Spans are clamped 1–4 (col) / 1–3 (row) and emitted as static classes",
|
|
132
|
+
"Designed to sit inside a BentoGrid; standalone it renders as a lone card"
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "BentoGrid",
|
|
138
|
+
"export": "BentoGrid",
|
|
139
|
+
"module": "content.tsx",
|
|
140
|
+
"catalog": {
|
|
141
|
+
"name": "BentoGrid",
|
|
142
|
+
"description": "Asymmetric bento layout. Lays BentoCell children, or an `items` array, onto a CSS grid whose base column count is `cols`; cells opt into col/row spans to break the rhythm into a mixed-size mosaic. Hairline cards, per-cell accent tone.",
|
|
143
|
+
"category": "presentation",
|
|
144
|
+
"level": "L3",
|
|
145
|
+
"tags": [
|
|
146
|
+
"bento",
|
|
147
|
+
"grid",
|
|
148
|
+
"layout",
|
|
149
|
+
"marketing"
|
|
150
|
+
],
|
|
151
|
+
"props": {
|
|
152
|
+
"cols": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"enum": [
|
|
155
|
+
"2",
|
|
156
|
+
"3",
|
|
157
|
+
"4",
|
|
158
|
+
"6"
|
|
159
|
+
],
|
|
160
|
+
"default": "3",
|
|
161
|
+
"description": "Base column count of the grid (cells may span fewer/more)"
|
|
162
|
+
},
|
|
163
|
+
"gap": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"enum": [
|
|
166
|
+
"none",
|
|
167
|
+
"sm",
|
|
168
|
+
"md",
|
|
169
|
+
"lg"
|
|
170
|
+
],
|
|
171
|
+
"default": "md"
|
|
172
|
+
},
|
|
173
|
+
"items": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"items": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"properties": {
|
|
178
|
+
"title": {
|
|
179
|
+
"type": "string"
|
|
180
|
+
},
|
|
181
|
+
"desc": {
|
|
182
|
+
"type": "string"
|
|
183
|
+
},
|
|
184
|
+
"icon": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"description": "lucide icon name"
|
|
187
|
+
},
|
|
188
|
+
"tone": {
|
|
189
|
+
"type": "integer",
|
|
190
|
+
"description": "Accent-hue index 0–3 (amber/teal/rose/indigo)"
|
|
191
|
+
},
|
|
192
|
+
"span": {
|
|
193
|
+
"type": "object",
|
|
194
|
+
"properties": {
|
|
195
|
+
"col": {
|
|
196
|
+
"type": "integer"
|
|
197
|
+
},
|
|
198
|
+
"row": {
|
|
199
|
+
"type": "integer"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"description": "Cell span; col 1–4, row 1–3"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"description": "Inline cells used when no BentoCell children are provided"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"usageScenarios": [
|
|
210
|
+
"Feature mosaic where one tile is hero-sized (span col 2) and the rest are small",
|
|
211
|
+
"Capability bento mixing tall and wide tiles"
|
|
212
|
+
],
|
|
213
|
+
"constraints": [
|
|
214
|
+
"Provide either BentoCell children or items — children win when present",
|
|
215
|
+
"span.col is clamped to 1–4 and span.row to 1–3 via static class maps (no purge risk)"
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "Callout",
|
|
221
|
+
"export": "Callout",
|
|
222
|
+
"module": "content.tsx",
|
|
223
|
+
"catalog": {
|
|
224
|
+
"name": "Callout",
|
|
225
|
+
"description": "Emphasis callout panel: a tinted box (semantic or brand colour) with an icon, optional title and body. color-mix against the chosen token keeps the wash subtle and legible in light and dark.",
|
|
226
|
+
"category": "presentation",
|
|
227
|
+
"level": "L1",
|
|
228
|
+
"tags": [
|
|
229
|
+
"callout",
|
|
230
|
+
"note",
|
|
231
|
+
"alert",
|
|
232
|
+
"marketing"
|
|
233
|
+
],
|
|
234
|
+
"props": {
|
|
235
|
+
"variant": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"enum": [
|
|
238
|
+
"info",
|
|
239
|
+
"success",
|
|
240
|
+
"warn",
|
|
241
|
+
"accent"
|
|
242
|
+
],
|
|
243
|
+
"default": "info",
|
|
244
|
+
"description": "Colour/role: info (indigo) · success (green) · warn (amber) · accent (brand amber)"
|
|
245
|
+
},
|
|
246
|
+
"title": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"description": "Emphasised lead line, coloured to the variant"
|
|
249
|
+
},
|
|
250
|
+
"body": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"description": "Supporting paragraph"
|
|
253
|
+
},
|
|
254
|
+
"icon": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"description": "Optional lucide icon name; defaults to a sensible glyph per variant"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"usageScenarios": [
|
|
260
|
+
"Inline 'Note' / 'Tip' block inside docs or a landing section",
|
|
261
|
+
"Success confirmation or warning banner above content"
|
|
262
|
+
],
|
|
263
|
+
"constraints": [
|
|
264
|
+
"variant falls back to 'info' when omitted or unrecognised",
|
|
265
|
+
"icon defaults per variant (info→info, success→check, warn→alert, accent→sparkles)"
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"name": "Faq",
|
|
271
|
+
"export": "Faq",
|
|
272
|
+
"module": "content.tsx",
|
|
273
|
+
"catalog": {
|
|
274
|
+
"name": "Faq",
|
|
275
|
+
"description": "Editorial accordion FAQ built on native <details>/<summary> — fully functional with zero JS / state wiring. Optional eyebrow/title/lead header; rows carry a mono index numeral, a hairline plus-mark that rotates 45° into a close-mark on open, and a grid-rows expand transition.",
|
|
276
|
+
"category": "presentation",
|
|
277
|
+
"level": "L2",
|
|
278
|
+
"tags": [
|
|
279
|
+
"faq",
|
|
280
|
+
"accordion",
|
|
281
|
+
"marketing",
|
|
282
|
+
"content"
|
|
283
|
+
],
|
|
284
|
+
"props": {
|
|
285
|
+
"eyebrow": {
|
|
286
|
+
"type": "string",
|
|
287
|
+
"description": "Optional mono overline above the title (accent colored)"
|
|
288
|
+
},
|
|
289
|
+
"title": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"description": "Optional serif heading above the list"
|
|
292
|
+
},
|
|
293
|
+
"lead": {
|
|
294
|
+
"type": "string",
|
|
295
|
+
"description": "Optional muted intro line under the title"
|
|
296
|
+
},
|
|
297
|
+
"defaultOpenFirst": {
|
|
298
|
+
"type": "boolean",
|
|
299
|
+
"description": "When true, the first row renders open on mount"
|
|
300
|
+
},
|
|
301
|
+
"items": {
|
|
302
|
+
"type": "array",
|
|
303
|
+
"items": {
|
|
304
|
+
"type": "object",
|
|
305
|
+
"properties": {
|
|
306
|
+
"q": {
|
|
307
|
+
"type": "string"
|
|
308
|
+
},
|
|
309
|
+
"a": {
|
|
310
|
+
"type": "string"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"description": "[{q, a}] question/answer pairs; rows with an empty q are dropped"
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"usageScenarios": [
|
|
318
|
+
"Pricing / product FAQ section on a landing page",
|
|
319
|
+
"Docs 'common questions' block"
|
|
320
|
+
],
|
|
321
|
+
"constraints": [
|
|
322
|
+
"Uses native <details> so multiple rows can be open at once; no single-open behaviour",
|
|
323
|
+
"Answers render as plain text; pass pre-formatted strings"
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "Steps",
|
|
329
|
+
"export": "Steps",
|
|
330
|
+
"module": "content.tsx",
|
|
331
|
+
"catalog": {
|
|
332
|
+
"name": "Steps",
|
|
333
|
+
"description": "'How it works' steps with oversized mono numerals. variant 'numbered' (default) is a responsive card row; variant 'connected' is a vertical rail with a connecting line between numbered dots.",
|
|
334
|
+
"category": "presentation",
|
|
335
|
+
"level": "L2",
|
|
336
|
+
"tags": [
|
|
337
|
+
"steps",
|
|
338
|
+
"how-it-works",
|
|
339
|
+
"process",
|
|
340
|
+
"marketing"
|
|
341
|
+
],
|
|
342
|
+
"props": {
|
|
343
|
+
"variant": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"enum": [
|
|
346
|
+
"numbered",
|
|
347
|
+
"connected"
|
|
348
|
+
],
|
|
349
|
+
"default": "numbered",
|
|
350
|
+
"description": "'numbered' = card row with big numerals; 'connected' = vertical rail with a line"
|
|
351
|
+
},
|
|
352
|
+
"steps": {
|
|
353
|
+
"type": "array",
|
|
354
|
+
"items": {
|
|
355
|
+
"type": "object",
|
|
356
|
+
"properties": {
|
|
357
|
+
"title": {
|
|
358
|
+
"type": "string"
|
|
359
|
+
},
|
|
360
|
+
"desc": {
|
|
361
|
+
"type": "string"
|
|
362
|
+
},
|
|
363
|
+
"icon": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"description": "Optional lucide icon name; replaces the numeral in the 'connected' dot"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"description": "[{title, desc?, icon?}] in sequence order; steps with an empty title are dropped"
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"usageScenarios": [
|
|
373
|
+
"Three-step onboarding ('Describe → Generate → Render')",
|
|
374
|
+
"Connected setup sequence in docs"
|
|
375
|
+
],
|
|
376
|
+
"constraints": [
|
|
377
|
+
"Numbering is automatic (01, 02, …) from array order",
|
|
378
|
+
"icon only affects the 'connected' variant's dot; the numbered variant always shows the numeral",
|
|
379
|
+
"Numbered variant derives its column count from the step count (clamped 2–4), so 4 steps fill one row"
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"name": "TeamGrid",
|
|
385
|
+
"export": "TeamGrid",
|
|
386
|
+
"module": "content.tsx",
|
|
387
|
+
"catalog": {
|
|
388
|
+
"name": "TeamGrid",
|
|
389
|
+
"description": "Grid of team-member cards. Each shows an avatar (image when `avatar` is a URL, otherwise tinted initials), name, mono role and optional bio. Hairline cards with hover lift.",
|
|
390
|
+
"category": "presentation",
|
|
391
|
+
"level": "L2",
|
|
392
|
+
"tags": [
|
|
393
|
+
"team",
|
|
394
|
+
"people",
|
|
395
|
+
"grid",
|
|
396
|
+
"marketing"
|
|
397
|
+
],
|
|
398
|
+
"props": {
|
|
399
|
+
"columns": {
|
|
400
|
+
"type": "string",
|
|
401
|
+
"enum": [
|
|
402
|
+
"2",
|
|
403
|
+
"3",
|
|
404
|
+
"4"
|
|
405
|
+
],
|
|
406
|
+
"default": "3"
|
|
407
|
+
},
|
|
408
|
+
"members": {
|
|
409
|
+
"type": "array",
|
|
410
|
+
"items": {
|
|
411
|
+
"type": "object",
|
|
412
|
+
"properties": {
|
|
413
|
+
"name": {
|
|
414
|
+
"type": "string"
|
|
415
|
+
},
|
|
416
|
+
"role": {
|
|
417
|
+
"type": "string"
|
|
418
|
+
},
|
|
419
|
+
"bio": {
|
|
420
|
+
"type": "string"
|
|
421
|
+
},
|
|
422
|
+
"avatar": {
|
|
423
|
+
"type": "string",
|
|
424
|
+
"description": "Image URL, or short text/emoji shown as the avatar; falls back to initials"
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
"description": "[{name, role?, bio?, avatar?}] — members with an empty name are dropped"
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"usageScenarios": [
|
|
432
|
+
"About page 'meet the team' grid",
|
|
433
|
+
"Advisors / contributors showcase"
|
|
434
|
+
],
|
|
435
|
+
"constraints": [
|
|
436
|
+
"avatar is treated as an image when it looks like a URL (http(s):/data:/leading slash); otherwise rendered as text",
|
|
437
|
+
"Initials are derived from the name when no avatar is given"
|
|
438
|
+
]
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "creation-html-generation",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Generate a new HTML artifact or rewrite the current revision, with at-most-once dispatch and reconcile from @uibot/creation-kit.",
|
|
6
|
+
"dependencies": [
|
|
7
|
+
"react",
|
|
8
|
+
"@uibot/contracts@^0.7.0",
|
|
9
|
+
"@uibot/creation-kit@^0.7.0"
|
|
10
|
+
],
|
|
11
|
+
"registryDependencies": [
|
|
12
|
+
"button",
|
|
13
|
+
"label",
|
|
14
|
+
"textarea",
|
|
15
|
+
"@uibot/creation-shared"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
{
|
|
19
|
+
"path": "components/uibot/creation/creation-html-generation.tsx",
|
|
20
|
+
"target": "components/uibot/creation/creation-html-generation.tsx",
|
|
21
|
+
"content": "import { Button } from \"@/components/ui/button\";\nimport { Label } from \"@/components/ui/label\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport type { CreationArtifact, CreationProject } from \"@uibot/contracts\";\nimport { type CreationClient, type CreationLocale, useCreationRun } from \"@uibot/creation-kit\";\nimport { useId, useState } from \"react\";\n\nimport {\n type CreationGenerationCapabilities,\n creationBlockMessages,\n FIELD_CLASS,\n htmlGenerationDomains,\n} from \"./creation-shared\";\n\nexport interface CreationHtmlGenerationProps {\n client: Pick<CreationClient, \"getProject\" | \"startRun\">;\n project: CreationProject;\n capabilities: CreationGenerationCapabilities;\n /** The selected artifact; enables rewriting its current HTML revision. */\n artifact?: CreationArtifact;\n /** Unsaved draft edits: generation waits until they are saved or discarded. */\n dirty: boolean;\n busy: boolean;\n /** Reservation key; include the signed-in identity and the project id. */\n storageKey: string;\n /**\n * Changes when the session, token or tenant changes; responses that arrive after a change are\n * dropped. Hosts with sign-in must pass it.\n */\n authority?: () => string;\n locale?: CreationLocale;\n onPending?: (blocked: boolean) => void;\n onProject: (project: CreationProject, artifactId?: string) => void;\n}\n\n/** Generate a new HTML artifact or rewrite the current HTML revision. */\nexport function CreationHtmlGeneration({\n client,\n project,\n capabilities,\n artifact,\n dirty,\n busy,\n storageKey,\n authority,\n locale,\n onPending,\n onProject,\n}: CreationHtmlGenerationProps) {\n const t = creationBlockMessages(locale);\n const id = useId();\n const domains = htmlGenerationDomains(capabilities.domains);\n const [kind, setKind] = useState(domains[0]?.artifactKind ?? \"\");\n const [intent, setIntent] = useState(\"\");\n const run = useCreationRun({\n client,\n project,\n storageKey,\n onProject,\n ...(onPending ? { onPending } : {}),\n ...(authority ? { authority } : {}),\n ...(locale ? { locale } : {}),\n });\n const selectedDomain = domains.find((domain) => domain.artifactKind === kind);\n const tip = artifact?.revisions.find((revision) => revision.id === artifact.currentRevisionId);\n const rewriteDomain = domains.find((domain) => domain.artifactKind === artifact?.kind);\n const ready = !!capabilities.generation?.ready;\n const disabled = busy || dirty || run.pending || !ready || !intent.trim();\n\n function generate(rewrite: boolean) {\n const domain = rewrite ? rewriteDomain : selectedDomain;\n if (disabled || !domain || (rewrite && tip?.source.format !== \"html\")) return;\n void run.start({\n kind: domain.artifactKind,\n intent: intent.trim(),\n outputFormat: \"html\",\n sourceIds: (project.sources ?? []).map((source) => source.id),\n ...(rewrite && artifact && tip\n ? { artifactId: artifact.id, expectedRevisionId: tip.id }\n : {}),\n });\n }\n\n return (\n <section aria-label={t.htmlTitle} className=\"flex flex-col gap-3 rounded-lg border p-4\">\n <h2 className=\"text-sm font-medium\">{t.htmlTitle}</h2>\n {!ready && <p className=\"text-sm text-muted-foreground\">{t.generationUnavailable}</p>}\n {dirty && <p className=\"text-sm text-muted-foreground\">{t.saveBeforeGenerate}</p>}\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor={`${id}-kind`}>{t.kindLabel}</Label>\n <select\n id={`${id}-kind`}\n aria-label={t.kindLabel}\n className={FIELD_CLASS}\n value={kind}\n onChange={(event) => setKind(event.target.value)}\n disabled={busy || run.pending}\n >\n {!selectedDomain && <option value=\"\">{t.kindPlaceholder}</option>}\n {domains.map((domain) => (\n <option key={domain.artifactKind} value={domain.artifactKind}>\n {domain.title}\n </option>\n ))}\n </select>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor={`${id}-intent`}>{t.intentLabel}</Label>\n <Textarea\n id={`${id}-intent`}\n aria-label={t.intentLabel}\n value={intent}\n onChange={(event) => setIntent(event.target.value)}\n disabled={busy || run.pending}\n />\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <Button\n type=\"button\"\n disabled={disabled || !selectedDomain}\n onClick={() => generate(false)}\n >\n {t.generateNew}\n </Button>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled || !rewriteDomain || tip?.source.format !== \"html\"}\n onClick={() => generate(true)}\n >\n {t.rewriteCurrent}\n </Button>\n </div>\n {run.message && (\n <p role=\"status\" className=\"text-sm\">\n {run.message}\n </p>\n )}\n {run.canReconcile && (\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={run.sending || run.checking}\n onClick={() => void run.reconcile()}\n >\n {t.reconcile}\n </Button>\n )}\n </section>\n );\n}\n",
|
|
22
|
+
"type": "registry:component"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"meta": {
|
|
26
|
+
"composite": true,
|
|
27
|
+
"channel": "public"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "creation-reference-generation",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Generate a presentation from an explicitly chosen saved HTML revision.",
|
|
6
|
+
"dependencies": [
|
|
7
|
+
"react",
|
|
8
|
+
"@uibot/contracts@^0.7.0",
|
|
9
|
+
"@uibot/creation-kit@^0.7.0"
|
|
10
|
+
],
|
|
11
|
+
"registryDependencies": [
|
|
12
|
+
"button",
|
|
13
|
+
"label",
|
|
14
|
+
"textarea",
|
|
15
|
+
"@uibot/creation-shared"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
{
|
|
19
|
+
"path": "components/uibot/creation/creation-reference-generation.tsx",
|
|
20
|
+
"target": "components/uibot/creation/creation-reference-generation.tsx",
|
|
21
|
+
"content": "import { Button } from \"@/components/ui/button\";\nimport { Label } from \"@/components/ui/label\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport type { CreationProject } from \"@uibot/contracts\";\nimport { type CreationClient, type CreationLocale, useCreationRun } from \"@uibot/creation-kit\";\nimport { useId, useState } from \"react\";\n\nimport {\n type CreationGenerationCapabilities,\n creationBlockMessages,\n FIELD_CLASS,\n generatesHtml,\n HTML_DOCUMENT_KINDS,\n} from \"./creation-shared\";\n\nexport interface CreationReferenceGenerationProps {\n client: Pick<CreationClient, \"getProject\" | \"startRun\">;\n project: CreationProject;\n capabilities: CreationGenerationCapabilities;\n dirty: boolean;\n busy: boolean;\n /** Reservation key; share it with the other generation blocks of the project. */\n storageKey: string;\n /**\n * Changes when the session, token or tenant changes; responses that arrive after a change are\n * dropped. Hosts with sign-in must pass it.\n */\n authority?: () => string;\n locale?: CreationLocale;\n onPending?: (blocked: boolean) => void;\n onProject: (project: CreationProject, artifactId?: string) => void;\n}\n\n/**\n * Generate a presentation from a saved HTML revision. The reference always names saved content;\n * draft HTML is never sent in its place.\n */\nexport function CreationReferenceGeneration({\n client,\n project,\n capabilities,\n dirty,\n busy,\n storageKey,\n authority,\n locale,\n onPending,\n onProject,\n}: CreationReferenceGenerationProps) {\n const t = creationBlockMessages(locale);\n const id = useId();\n const [artifactId, setArtifactId] = useState(\"\");\n const [revisionId, setRevisionId] = useState(\"\");\n const [intent, setIntent] = useState(\"\");\n const run = useCreationRun({\n client,\n project,\n storageKey,\n onProject,\n ...(onPending ? { onPending } : {}),\n ...(authority ? { authority } : {}),\n ...(locale ? { locale } : {}),\n });\n const references = project.artifacts.filter(\n (artifact) =>\n HTML_DOCUMENT_KINDS.includes(artifact.kind) &&\n artifact.revisions.some((revision) => revision.source.format === \"html\"),\n );\n const artifact = references.find((candidate) => candidate.id === artifactId);\n const revision = artifact?.revisions.find(\n (candidate) => candidate.id === revisionId && candidate.source.format === \"html\",\n );\n const domain = capabilities.domains.find(\n (candidate) => candidate.artifactKind === \"presentation\" && generatesHtml(candidate),\n );\n const ready = !!capabilities.generation?.ready;\n const disabled = busy || dirty || run.pending || !ready || !domain || !revision || !intent.trim();\n\n function generate() {\n if (disabled || !artifact || !revision || !domain) return;\n void run.start({\n kind: domain.artifactKind,\n intent: intent.trim(),\n outputFormat: \"html\",\n sourceIds: (project.sources ?? []).map((source) => source.id),\n reference: { artifactId: artifact.id, revisionId: revision.id },\n });\n }\n\n return (\n <section aria-label={t.referenceTitle} className=\"flex flex-col gap-3 rounded-lg border p-4\">\n <h2 className=\"text-sm font-medium\">{t.referenceTitle}</h2>\n {(!ready || !domain) && (\n <p className=\"text-sm text-muted-foreground\">{t.presentationUnavailable}</p>\n )}\n {dirty && <p className=\"text-sm text-muted-foreground\">{t.saveBeforeReference}</p>}\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor={`${id}-artifact`}>{t.referenceArtifactLabel}</Label>\n <select\n id={`${id}-artifact`}\n aria-label={t.referenceArtifactLabel}\n className={FIELD_CLASS}\n value={artifactId}\n onChange={(event) => {\n setArtifactId(event.target.value);\n setRevisionId(\"\");\n }}\n disabled={busy || run.pending}\n >\n <option value=\"\">{t.referenceArtifactPlaceholder}</option>\n {references.map((item) => (\n <option key={item.id} value={item.id}>\n {item.title}\n </option>\n ))}\n </select>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor={`${id}-revision`}>{t.referenceRevisionLabel}</Label>\n <select\n id={`${id}-revision`}\n aria-label={t.referenceRevisionLabel}\n className={FIELD_CLASS}\n value={revisionId}\n onChange={(event) => setRevisionId(event.target.value)}\n disabled={busy || run.pending || !artifact}\n >\n <option value=\"\">{t.referenceRevisionPlaceholder}</option>\n {artifact?.revisions\n .filter((item) => item.source.format === \"html\")\n .map((item) => (\n <option key={item.id} value={item.id}>\n {t.revisionOption(item.number)}\n </option>\n ))}\n </select>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor={`${id}-intent`}>{t.presentationIntentLabel}</Label>\n <Textarea\n id={`${id}-intent`}\n aria-label={t.presentationIntentLabel}\n value={intent}\n onChange={(event) => setIntent(event.target.value)}\n disabled={busy || run.pending}\n />\n </div>\n <Button type=\"button\" disabled={disabled} onClick={generate}>\n {t.generatePresentation}\n </Button>\n {run.message && (\n <p role=\"status\" className=\"text-sm\">\n {run.message}\n </p>\n )}\n {run.canReconcile && (\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={run.sending || run.checking}\n onClick={() => void run.reconcile()}\n >\n {t.reconcile}\n </Button>\n )}\n </section>\n );\n}\n",
|
|
22
|
+
"type": "registry:component"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"meta": {
|
|
26
|
+
"composite": true,
|
|
27
|
+
"channel": "public"
|
|
28
|
+
}
|
|
29
|
+
}
|