@uibot/registry 0.18.0 → 0.19.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/README.md +59 -0
- package/dist/distribution-snapshot.d.ts +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -11
- package/dist/resource-query.d.ts +4 -0
- package/dist/resources.d.ts +3 -0
- package/dist/resources.js +3 -3
- package/dist/shadcn/r/admin-apps.json +61 -0
- package/dist/shadcn/r/admin-chats.json +54 -0
- package/dist/shadcn/r/admin-error-401.json +54 -0
- package/dist/shadcn/r/admin-error-403.json +54 -0
- package/dist/shadcn/r/admin-error-404.json +54 -0
- package/dist/shadcn/r/admin-error-500.json +54 -0
- package/dist/shadcn/r/admin-error-503.json +54 -0
- package/dist/shadcn/r/admin-forgot-password.json +59 -0
- package/dist/shadcn/r/admin-help.json +53 -0
- package/dist/shadcn/r/admin-otp.json +59 -0
- package/dist/shadcn/r/admin-overview.json +62 -0
- package/dist/shadcn/r/admin-settings-account.json +61 -0
- package/dist/shadcn/r/admin-settings-appearance.json +61 -0
- package/dist/shadcn/r/admin-settings-display.json +61 -0
- package/dist/shadcn/r/admin-settings-notifications.json +61 -0
- package/dist/shadcn/r/admin-settings-profile.json +61 -0
- package/dist/shadcn/r/admin-settings.json +65 -0
- package/dist/shadcn/r/admin-shell.json +11 -5
- package/dist/shadcn/r/admin-sign-in-2.json +67 -0
- package/dist/shadcn/r/admin-sign-in.json +59 -0
- package/dist/shadcn/r/admin-sign-up.json +59 -0
- package/dist/shadcn/r/admin-tasks.json +66 -0
- package/dist/shadcn/r/admin-users.json +66 -0
- package/dist/shadcn/r/auth-01.json +24 -0
- package/dist/shadcn/r/auth-02.json +24 -0
- package/dist/shadcn/r/auth-03.json +24 -0
- package/dist/shadcn/r/auth-04.json +24 -0
- package/dist/shadcn/r/auth-05.json +24 -0
- package/dist/shadcn/r/auth-centered.json +61 -0
- package/dist/shadcn/r/auth-enterprise.json +61 -0
- package/dist/shadcn/r/auth-primitives.json +58 -0
- package/dist/shadcn/r/auth-recovery.json +64 -0
- package/dist/shadcn/r/auth-registration.json +63 -0
- package/dist/shadcn/r/auth-split.json +67 -0
- package/dist/shadcn/r/auth.json +13 -13
- package/dist/shadcn/r/charts.json +1 -1
- package/dist/shadcn/r/chat-artifact.json +49 -0
- package/dist/shadcn/r/chat-focused.json +49 -0
- package/dist/shadcn/r/chat-history.json +49 -0
- package/dist/shadcn/r/chat-knowledge.json +49 -0
- package/dist/shadcn/r/chat-support.json +49 -0
- package/dist/shadcn/r/chat-workspace.json +136 -0
- package/dist/shadcn/r/collection-cell-editor.json +6 -6
- package/dist/shadcn/r/collection-panel-drawer.json +2 -2
- package/dist/shadcn/r/collection-record-menu.json +2 -2
- package/dist/shadcn/r/collection-shared.json +2 -2
- package/dist/shadcn/r/commerce-workspace.json +69 -0
- package/dist/shadcn/r/console-billing.json +68 -0
- package/dist/shadcn/r/console-page.json +289 -0
- package/dist/shadcn/r/console-shell.json +29 -0
- package/dist/shadcn/r/content.json +1 -1
- package/dist/shadcn/r/creation-html-generation.json +3 -3
- package/dist/shadcn/r/creation-reference-generation.json +3 -3
- package/dist/shadcn/r/creation-revision-export.json +3 -3
- package/dist/shadcn/r/creation-shared.json +3 -3
- package/dist/shadcn/r/creation-variant-compare.json +4 -4
- package/dist/shadcn/r/creation-workspace.json +4 -4
- package/dist/shadcn/r/crm-workspace.json +73 -0
- package/dist/shadcn/r/dashboard.json +1 -1
- package/dist/shadcn/r/data-studio.json +1 -1
- package/dist/shadcn/r/data-table.json +25 -7
- package/dist/shadcn/r/data.json +81 -11
- package/dist/shadcn/r/document-assistant.json +54 -0
- package/dist/shadcn/r/document-library.json +49 -0
- package/dist/shadcn/r/document-reading.json +49 -0
- package/dist/shadcn/r/document-workspace.json +164 -0
- package/dist/shadcn/r/document-writing.json +49 -0
- package/dist/shadcn/r/drilldown-menu.json +233 -0
- package/dist/shadcn/r/education-workspace.json +82 -0
- package/dist/shadcn/r/feedback.json +6 -6
- package/dist/shadcn/r/field.json +1 -1
- package/dist/shadcn/r/form.json +11 -11
- package/dist/shadcn/r/grid.json +1 -1
- package/dist/shadcn/r/interactive.json +1 -1
- package/dist/shadcn/r/item-grid.json +219 -0
- package/dist/shadcn/r/kanban.json +1 -1
- package/dist/shadcn/r/layout.json +196 -16
- package/dist/shadcn/r/marketing.json +1 -1
- package/dist/shadcn/r/nav.json +3 -3
- package/dist/shadcn/r/presentation.json +1 -1
- package/dist/shadcn/r/preview-device-frame.json +2 -2
- package/dist/shadcn/r/primitives.json +2 -2
- package/dist/shadcn/r/sections.json +1 -1
- package/dist/shadcn/r/shadcn-admin-shell.json +1 -1
- package/dist/shadcn/r/shadcn-admin.json +23 -22
- package/dist/shadcn/r/sidebar-01.json +42 -0
- package/dist/shadcn/r/sidebar-02.json +42 -0
- package/dist/shadcn/r/sidebar-03.json +30 -0
- package/dist/shadcn/r/sidebar-04.json +30 -0
- package/dist/shadcn/r/sidebar-05.json +36 -0
- package/dist/shadcn/r/sidebar-06.json +42 -0
- package/dist/shadcn/r/sidebar-07.json +54 -0
- package/dist/shadcn/r/sidebar-08.json +54 -0
- package/dist/shadcn/r/sidebar-09.json +36 -0
- package/dist/shadcn/r/sidebar-10.json +66 -0
- package/dist/shadcn/r/sidebar-11.json +30 -0
- package/dist/shadcn/r/sidebar-12.json +48 -0
- package/dist/shadcn/r/sidebar-13.json +30 -0
- package/dist/shadcn/r/sidebar-14.json +30 -0
- package/dist/shadcn/r/sidebar-15.json +84 -0
- package/dist/shadcn/r/sidebar-16.json +66 -0
- package/dist/shadcn/r/sidebar-drilldown.json +29 -0
- package/dist/shadcn/r/sidebar-primitives.json +155 -0
- package/dist/shadcn/r/uibot-base.json +3 -3
- package/dist/shadcn/r/workspace.json +3 -3
- package/dist/shadcn/registry.json +987 -175
- package/dist/shadcn.d.ts +0 -39
- package/dist/solution-composition.d.ts +45 -0
- package/dist/solution-regions.d.ts +3 -0
- package/dist/solution-spec.d.ts +7 -0
- package/dist/template-source.d.ts +2 -0
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "registry:ui",
|
|
5
5
|
"description": "Standalone action button. Six visual variants and five sizes. Does not submit forms — use Form.Submit for that.",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"react"
|
|
7
|
+
"react@19.3.0"
|
|
8
8
|
],
|
|
9
9
|
"registryDependencies": [
|
|
10
10
|
"@uibot/uibot-base"
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
{
|
|
26
26
|
"path": "components/uibot/overlay.tsx",
|
|
27
27
|
"target": "components/uibot/overlay.tsx",
|
|
28
|
-
"content": "import { useEffect, useId, useRef, type ReactNode } from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { emit, text, type BlockContext } from \"./interaction\";\n\nfunction useNativeDialogLifecycle(\n ref: { current: HTMLDialogElement | null },\n open: boolean,\n triggerRef?: { current: HTMLElement | null },\n) {\n useEffect(() => {\n const dialog = ref.current;\n if (!dialog || !open) return;\n const trigger = triggerRef\n ? triggerRef.current\n : document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n dialog.showModal();\n return () => {\n if (dialog.open) dialog.close();\n if (trigger?.isConnected) trigger.focus();\n };\n }, [open, ref, triggerRef]);\n}\n\nfunction Overlay({\n props,\n ctx,\n drawer,\n blockType,\n}: {\n props: Record<string, unknown>;\n ctx: BlockContext;\n drawer: boolean;\n blockType?: \"Dialog\";\n}) {\n const ref = useRef<HTMLDialogElement>(null);\n const titleId = useId(),\n descriptionId = useId();\n const open = props.open === true;\n const close = () => emit(ctx, \"onClose\", { open: false }, false);\n useNativeDialogLifecycle(ref, open);\n if (!open) return null;\n return (\n <dialog\n ref={ref}\n aria-labelledby={titleId}\n aria-describedby={props.description ? descriptionId : undefined}\n aria-busy={props.pending === true || undefined}\n data-uibot-type={blockType ?? (drawer ? \"Drawer\" : \"Modal\")}\n className={`uibot-overlay bg-background text-foreground p-0 shadow-xl backdrop:bg-black/50 ${drawer ? \"fixed inset-y-0 start-auto end-0 m-0 h-dvh max-h-dvh w-full max-w-md border-s\" : \"m-auto w-[calc(100%-2rem)] max-w-lg rounded-xl border\"}`}\n onCancel={(e) => {\n e.preventDefault();\n if (props.pending !== true) close();\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget && props.pending !== true) {\n const r = e.currentTarget.getBoundingClientRect();\n if (\n e.clientX < r.left ||\n e.clientX > r.right ||\n e.clientY < r.top ||\n e.clientY > r.bottom\n )\n close();\n }\n }}\n >\n <div className=\"flex h-full max-h-dvh flex-col\">\n <header className=\"flex items-start justify-between gap-4 border-b p-6\">\n <div>\n <h2 id={titleId} className=\"text-lg font-semibold\">\n {text(props.title, drawer ? \"Edit record\" : \"Confirm\")}\n </h2>\n {Boolean(props.description) && (\n <p id={descriptionId} className=\"mt-1 text-sm text-muted-foreground\">\n {text(props.description)}\n </p>\n )}\n </div>\n <button\n type=\"button\"\n disabled={props.pending === true}\n className=\"rounded px-2 py-1 text-sm hover:bg-muted focus-visible:ring-2\"\n aria-label=\"Close dialog\"\n onClick={close}\n >\n Close\n </button>\n </header>\n <div className=\"min-h-0 flex-1 overflow-auto p-6\">{ctx.children as ReactNode[]}</div>\n {ctx.slots.footer && (\n <footer className=\"flex justify-end gap-2 border-t p-6\">\n {ctx.slots.footer as ReactNode[]}\n </footer>\n )}\n </div>\n </dialog>\n );\n}\nexport const LiveDrawer: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer />\n);\nexport const LiveModal: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer={false} />\n);\nexport const LiveConfirmationDialog: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer={false} blockType=\"Dialog\" />\n);\n\n/** Internal mobile navigation drawer shared by renderer blocks, not a Spec component. */\nexport function SidebarDrawer({\n id,\n open,\n onClose,\n triggerRef,\n children,\n}: {\n id: string;\n open: boolean;\n onClose: () => void;\n triggerRef: { current: HTMLButtonElement | null };\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDialogElement>(null);\n useNativeDialogLifecycle(ref, open, triggerRef);\n\n if (!open) return null;\n return (\n <dialog\n id={id}\n ref={ref}\n aria-label=\"Navigation\"\n className=\"fixed inset-y-0 start-0 z-50 m-0 h-dvh max-h-dvh w-72 max-w-[85vw] border-r bg-background p-0 text-foreground shadow-xl backdrop:bg-black/50\"\n onCancel={(event) => {\n event.preventDefault();\n onClose();\n }}\n onClick={(event) => {\n if (event.target === event.currentTarget) {\n const bounds = event.currentTarget.getBoundingClientRect();\n if (\n event.clientX < bounds.left ||\n event.clientX > bounds.right ||\n event.clientY < bounds.top ||\n event.clientY > bounds.bottom\n )\n onClose();\n }\n if (event.target instanceof Element
|
|
28
|
+
"content": "import { useEffect, useId, useRef, type ReactNode } from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { emit, text, type BlockContext } from \"./interaction\";\n\nfunction useNativeDialogLifecycle(\n ref: { current: HTMLDialogElement | null },\n open: boolean,\n triggerRef?: { current: HTMLElement | null },\n) {\n useEffect(() => {\n const dialog = ref.current;\n if (!dialog || !open) return;\n const trigger = triggerRef\n ? triggerRef.current\n : document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n dialog.showModal();\n return () => {\n if (dialog.open) dialog.close();\n if (trigger?.isConnected) trigger.focus();\n };\n }, [open, ref, triggerRef]);\n}\n\nfunction Overlay({\n props,\n ctx,\n drawer,\n blockType,\n}: {\n props: Record<string, unknown>;\n ctx: BlockContext;\n drawer: boolean;\n blockType?: \"Dialog\";\n}) {\n const ref = useRef<HTMLDialogElement>(null);\n const titleId = useId(),\n descriptionId = useId();\n const open = props.open === true;\n const close = () => emit(ctx, \"onClose\", { open: false }, false);\n useNativeDialogLifecycle(ref, open);\n if (!open) return null;\n return (\n <dialog\n ref={ref}\n aria-labelledby={titleId}\n aria-describedby={props.description ? descriptionId : undefined}\n aria-busy={props.pending === true || undefined}\n data-uibot-type={blockType ?? (drawer ? \"Drawer\" : \"Modal\")}\n className={`uibot-overlay bg-background text-foreground p-0 shadow-xl backdrop:bg-black/50 ${drawer ? \"fixed inset-y-0 start-auto end-0 m-0 h-dvh max-h-dvh w-full max-w-md border-s\" : \"m-auto w-[calc(100%-2rem)] max-w-lg rounded-xl border\"}`}\n onCancel={(e) => {\n e.preventDefault();\n if (props.pending !== true) close();\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget && props.pending !== true) {\n const r = e.currentTarget.getBoundingClientRect();\n if (\n e.clientX < r.left ||\n e.clientX > r.right ||\n e.clientY < r.top ||\n e.clientY > r.bottom\n )\n close();\n }\n }}\n >\n <div className=\"flex h-full max-h-dvh flex-col\">\n <header className=\"flex items-start justify-between gap-4 border-b p-6\">\n <div>\n <h2 id={titleId} className=\"text-lg font-semibold\">\n {text(props.title, drawer ? \"Edit record\" : \"Confirm\")}\n </h2>\n {Boolean(props.description) && (\n <p id={descriptionId} className=\"mt-1 text-sm text-muted-foreground\">\n {text(props.description)}\n </p>\n )}\n </div>\n <button\n type=\"button\"\n disabled={props.pending === true}\n className=\"rounded px-2 py-1 text-sm hover:bg-muted focus-visible:ring-2\"\n aria-label=\"Close dialog\"\n onClick={close}\n >\n Close\n </button>\n </header>\n <div className=\"min-h-0 flex-1 overflow-auto p-6\">{ctx.children as ReactNode[]}</div>\n {ctx.slots.footer && (\n <footer className=\"flex justify-end gap-2 border-t p-6\">\n {ctx.slots.footer as ReactNode[]}\n </footer>\n )}\n </div>\n </dialog>\n );\n}\nexport const LiveDrawer: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer />\n);\nexport const LiveModal: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer={false} />\n);\nexport const LiveConfirmationDialog: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer={false} blockType=\"Dialog\" />\n);\n\n/** Internal mobile navigation drawer shared by renderer blocks, not a Spec component. */\nexport function SidebarDrawer({\n id,\n open,\n onClose,\n triggerRef,\n children,\n}: {\n id: string;\n open: boolean;\n onClose: () => void;\n triggerRef: { current: HTMLButtonElement | null };\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDialogElement>(null);\n useNativeDialogLifecycle(ref, open, triggerRef);\n\n if (!open) return null;\n return (\n <dialog\n id={id}\n ref={ref}\n aria-label=\"Navigation\"\n className=\"fixed inset-y-0 start-0 z-50 m-0 h-dvh max-h-dvh w-72 max-w-[85vw] border-r bg-background p-0 text-foreground shadow-xl backdrop:bg-black/50\"\n onCancel={(event) => {\n event.preventDefault();\n onClose();\n }}\n onClick={(event) => {\n if (event.target === event.currentTarget) {\n const bounds = event.currentTarget.getBoundingClientRect();\n if (\n event.clientX < bounds.left ||\n event.clientX > bounds.right ||\n event.clientY < bounds.top ||\n event.clientY > bounds.bottom\n )\n onClose();\n }\n if (\n event.target instanceof Element &&\n event.target.closest(\"a\") &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey &&\n !event.altKey &&\n event.button === 0\n )\n onClose();\n }}\n >\n <button\n type=\"button\"\n className=\"m-3 rounded border px-3 py-2 text-sm focus-visible:ring-2\"\n aria-label=\"Close navigation\"\n onClick={onClose}\n >\n Close\n </button>\n <div className=\"max-h-[calc(100dvh-4rem)] overflow-y-auto\">{children}</div>\n </dialog>\n );\n}\n",
|
|
29
29
|
"type": "registry:ui"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "components/uibot/feedback.uibot.json",
|
|
33
33
|
"target": "components/uibot/feedback.uibot.json",
|
|
34
|
-
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"feedback\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"Button\",\n \"export\": \"Button\",\n \"module\": \"feedback.tsx\",\n \"catalog\": {\n \"name\": \"Button\",\n \"description\": \"Standalone action button. Six visual variants and five sizes. Does not submit forms — use Form.Submit for that.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"button\",\n \"action\"\n ],\n \"props\": {\n \"label\": {\n \"type\": \"string\"\n },\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"default\",\n \"destructive\",\n \"outline\",\n \"secondary\",\n \"ghost\",\n \"link\"\n ],\n \"default\": \"default\"\n },\n \"size\": {\n \"type\": \"string\",\n \"enum\": [\n \"xs\",\n \"sm\",\n \"default\",\n \"lg\",\n \"icon\"\n ],\n \"default\": \"default\"\n },\n \"full\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"disabled\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n },\n \"events\": {\n \"onClick\": {\n \"description\": \"Runs with a plain click payload.\"\n }\n },\n \"usageScenarios\": [\n \"Primary CTA on a hero section\",\n \"Row of outline action buttons in a Card actions slot\",\n \"Ghost icon button in a toolbar\"\n ],\n \"constraints\": [\n \"Use Form.Submit, not Button[type=submit], inside a Form\",\n \"Do not place more than 3 primary (default) buttons on the same view\"\n ]\n }\n },\n {\n \"name\": \"Dialog\",\n \"export\": \"Dialog\",\n \"module\": \"feedback.tsx\",\n \"catalog\": {\n \"name\": \"Dialog\",\n \"description\": \"Confirmation with explicit action intents. Boolean open uses a native modal; omitted open keeps an inline composition.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"dialog\",\n \"modal\",\n \"confirm\"\n ],\n \"props\": {\n \"open\": {\n \"type\": \"boolean\",\n \"description\": \"Omit for inline.\"\n },\n \"pending\": {\n \"type\": \"boolean\",\n \"description\": \"Lock actions/dismissal.\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"cancelLabel\": {\n \"type\": \"string\"\n },\n \"confirmLabel\": {\n \"type\": \"string\"\n },\n \"confirmVariant\": {\n \"type\": \"string\",\n \"enum\": [\n \"default\",\n \"destructive\",\n \"outline\"\n ],\n \"default\": \"default\"\n }\n },\n \"events\": {\n \"onConfirm\": {\n \"description\": \"value=values.action=confirm.\"\n },\n \"onCancel\": {\n \"description\": \"value=values.action=cancel.\"\n },\n \"onClose\": {\n \"description\": \"Dismiss: value=values.open=false.\"\n }\n },\n \"usageScenarios\": [\n \"Delete confirmation prompt\",\n \"Unsaved changes warning before navigation\"\n ],\n \"constraints\": [\n \"Host owns open/pending and persistence; no automatic close/write/retry.\"\n ]\n }\n },\n {\n \"name\": \"Skeleton\",\n \"export\": \"Skeleton\",\n \"module\": \"feedback.tsx\",\n \"catalog\": {\n \"name\": \"Skeleton\",\n \"description\": \"Animated loading placeholder. Three presets: lines (text), card (avatar + lines), table (header + rows).\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"skeleton\",\n \"loading\",\n \"placeholder\"\n ],\n \"props\": {\n \"lines\": {\n \"type\": \"integer\",\n \"default\": 3,\n \"description\": \"Number of skeleton rows (for lines and table types)\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"lines\",\n \"card\",\n \"table\"\n ],\n \"default\": \"lines\"\n }\n },\n \"usageScenarios\": [\n \"Loading state while fetching table data\",\n \"Card placeholder during profile load\"\n ],\n \"constraints\": [\n \"Replace with real content once data loads; do not keep Skeleton visible indefinitely\"\n ]\n }\n },\n {\n \"name\": \"Toast\",\n \"export\": \"Toast\",\n \"module\": \"feedback.tsx\",\n \"catalog\": {\n \"name\": \"Toast\",\n \"description\": \"Alert banner (info, success, warning, error); placement top-right floats it as a dismissible corner notice.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"toast\",\n \"alert\",\n \"notification\"\n ],\n \"props\": {\n \"message\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"level\": {\n \"type\": \"string\",\n \"enum\": [\n \"info\",\n \"success\",\n \"warning\",\n \"error\"\n ],\n \"default\": \"info\"\n },\n \"closeable\": {\n \"type\": \"boolean\",\n \"default\": true\n },\n \"placement\": {\n \"type\": \"string\",\n \"enum\": [\n \"inline\",\n \"top-right\"\n ],\n \"default\": \"inline\"\n },\n \"duration\": {\n \"type\": \"number\",\n \"description\": \"Auto-dismiss after ms\"\n }\n },\n \"usageScenarios\": [\n \"
|
|
34
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"feedback\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"Button\",\n \"export\": \"Button\",\n \"module\": \"feedback.tsx\",\n \"catalog\": {\n \"name\": \"Button\",\n \"description\": \"Standalone action button. Six visual variants and five sizes. Does not submit forms — use Form.Submit for that.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"button\",\n \"action\"\n ],\n \"props\": {\n \"label\": {\n \"type\": \"string\"\n },\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"default\",\n \"destructive\",\n \"outline\",\n \"secondary\",\n \"ghost\",\n \"link\"\n ],\n \"default\": \"default\"\n },\n \"size\": {\n \"type\": \"string\",\n \"enum\": [\n \"xs\",\n \"sm\",\n \"default\",\n \"lg\",\n \"icon\"\n ],\n \"default\": \"default\"\n },\n \"full\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"disabled\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n },\n \"events\": {\n \"onClick\": {\n \"description\": \"Runs with a plain click payload.\"\n }\n },\n \"usageScenarios\": [\n \"Primary CTA on a hero section\",\n \"Row of outline action buttons in a Card actions slot\",\n \"Ghost icon button in a toolbar\"\n ],\n \"constraints\": [\n \"Use Form.Submit, not Button[type=submit], inside a Form\",\n \"Do not place more than 3 primary (default) buttons on the same view\"\n ]\n }\n },\n {\n \"name\": \"Dialog\",\n \"export\": \"Dialog\",\n \"module\": \"feedback.tsx\",\n \"catalog\": {\n \"name\": \"Dialog\",\n \"description\": \"Confirmation with explicit action intents. Boolean open uses a native modal; omitted open keeps an inline composition.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"dialog\",\n \"modal\",\n \"confirm\"\n ],\n \"props\": {\n \"open\": {\n \"type\": \"boolean\",\n \"description\": \"Omit for inline.\"\n },\n \"pending\": {\n \"type\": \"boolean\",\n \"description\": \"Lock actions/dismissal.\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"cancelLabel\": {\n \"type\": \"string\"\n },\n \"confirmLabel\": {\n \"type\": \"string\"\n },\n \"confirmVariant\": {\n \"type\": \"string\",\n \"enum\": [\n \"default\",\n \"destructive\",\n \"outline\"\n ],\n \"default\": \"default\"\n }\n },\n \"events\": {\n \"onConfirm\": {\n \"description\": \"value=values.action=confirm.\"\n },\n \"onCancel\": {\n \"description\": \"value=values.action=cancel.\"\n },\n \"onClose\": {\n \"description\": \"Dismiss: value=values.open=false.\"\n }\n },\n \"usageScenarios\": [\n \"Delete confirmation prompt\",\n \"Unsaved changes warning before navigation\"\n ],\n \"constraints\": [\n \"Host owns open/pending and persistence; no automatic close/write/retry.\"\n ]\n }\n },\n {\n \"name\": \"Skeleton\",\n \"export\": \"Skeleton\",\n \"module\": \"feedback.tsx\",\n \"catalog\": {\n \"name\": \"Skeleton\",\n \"description\": \"Animated loading placeholder. Three presets: lines (text), card (avatar + lines), table (header + rows).\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"skeleton\",\n \"loading\",\n \"placeholder\"\n ],\n \"props\": {\n \"lines\": {\n \"type\": \"integer\",\n \"default\": 3,\n \"description\": \"Number of skeleton rows (for lines and table types)\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"lines\",\n \"card\",\n \"table\"\n ],\n \"default\": \"lines\"\n }\n },\n \"usageScenarios\": [\n \"Loading state while fetching table data\",\n \"Card placeholder during profile load\"\n ],\n \"constraints\": [\n \"Replace with real content once data loads; do not keep Skeleton visible indefinitely\"\n ]\n }\n },\n {\n \"name\": \"Toast\",\n \"export\": \"Toast\",\n \"module\": \"feedback.tsx\",\n \"catalog\": {\n \"name\": \"Toast\",\n \"description\": \"Alert banner (info, success, warning, error); placement top-right floats it as a dismissible corner notice.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"toast\",\n \"alert\",\n \"notification\"\n ],\n \"props\": {\n \"message\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"level\": {\n \"type\": \"string\",\n \"enum\": [\n \"info\",\n \"success\",\n \"warning\",\n \"error\"\n ],\n \"default\": \"info\"\n },\n \"closeable\": {\n \"type\": \"boolean\",\n \"default\": true\n },\n \"placement\": {\n \"type\": \"string\",\n \"enum\": [\n \"inline\",\n \"top-right\"\n ],\n \"default\": \"inline\"\n },\n \"duration\": {\n \"type\": \"number\",\n \"description\": \"Auto-dismiss after ms\"\n }\n },\n \"usageScenarios\": [\n \"Transient success message after form submit\",\n \"Contextual inline data notice\"\n ],\n \"constraints\": [\n \"Floating notices must auto-dismiss; keep persistent disclosure inline, clear of navigation and controls\"\n ]\n }\n }\n ]\n}\n",
|
|
35
35
|
"type": "registry:ui"
|
|
36
36
|
}
|
|
37
37
|
],
|
|
@@ -317,11 +317,11 @@
|
|
|
317
317
|
}
|
|
318
318
|
},
|
|
319
319
|
"usageScenarios": [
|
|
320
|
-
"
|
|
321
|
-
"
|
|
320
|
+
"Transient success message after form submit",
|
|
321
|
+
"Contextual inline data notice"
|
|
322
322
|
],
|
|
323
323
|
"constraints": [
|
|
324
|
-
"
|
|
324
|
+
"Floating notices must auto-dismiss; keep persistent disclosure inline, clear of navigation and controls"
|
|
325
325
|
]
|
|
326
326
|
}
|
|
327
327
|
}
|
package/dist/shadcn/r/field.json
CHANGED
package/dist/shadcn/r/form.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"type": "registry:ui",
|
|
5
5
|
"description": "Form wrapper that prevents default submission. Place Form.Input, Form.Select, etc. as children and end with Form.Submit.",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"react",
|
|
8
|
-
"radix-ui",
|
|
9
|
-
"react-day-picker"
|
|
7
|
+
"react@19.3.0",
|
|
8
|
+
"radix-ui@1.4.3",
|
|
9
|
+
"react-day-picker@9.14.0"
|
|
10
10
|
],
|
|
11
11
|
"registryDependencies": [
|
|
12
12
|
"@uibot/uibot-base"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
{
|
|
34
34
|
"path": "components/uibot/form.uibot.json",
|
|
35
35
|
"target": "components/uibot/form.uibot.json",
|
|
36
|
-
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"form\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"Form\",\n \"export\": \"Form\",\n \"module\": \"form.tsx\",\n \"catalog\": {\n \"name\": \"Form\",\n \"description\": \"Form wrapper that prevents default submission. Place Form.Input, Form.Select, etc. as children and end with Form.Submit.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"form\",\n \"input\"\n ],\n \"props\": {\n \"idempotent\": {\n \"type\": \"boolean\",\n \"description\": \"
|
|
36
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"form\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"Form\",\n \"export\": \"Form\",\n \"module\": \"form.tsx\",\n \"catalog\": {\n \"name\": \"Form\",\n \"description\": \"Form wrapper that prevents default submission. Place Form.Input, Form.Select, etc. as children and end with Form.Submit.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"form\",\n \"input\"\n ],\n \"props\": {\n \"idempotent\": {\n \"type\": \"boolean\",\n \"description\": \"Stable event.value idempotency key for unchanged-value retries\"\n },\n \"pending\": {\n \"type\": \"boolean\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"layout\": {\n \"type\": \"string\",\n \"enum\": [\n \"vertical\",\n \"horizontal\"\n ],\n \"default\": \"vertical\"\n }\n },\n \"events\": {\n \"onChange\": {\n \"description\": \"Bubbled native field changes with { type, name, value, checked }.\"\n },\n \"onSubmit\": {\n \"description\": \"Runs after native submission is prevented.\",\n \"payload\": {\n \"type\": \"object\",\n \"description\": \"{ type: 'submit', values: Record<string, value> }\"\n }\n }\n },\n \"usageScenarios\": [\n \"Create / edit entity form\",\n \"Login form\",\n \"Search filter form\"\n ],\n \"constraints\": [\n \"Always include exactly one Form.Submit as the last child\",\n \"Do not nest forms inside forms\"\n ]\n }\n },\n {\n \"name\": \"Form.Checkbox\",\n \"export\": \"FormCheckbox\",\n \"module\": \"form.tsx\",\n \"catalog\": {\n \"name\": \"Form.Checkbox\",\n \"description\": \"Single boolean checkbox with optional description beneath the label.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"form\",\n \"checkbox\"\n ],\n \"props\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"checked\": {\n \"type\": \"boolean\",\n \"description\": \"Two-way {_bindState:'path'}.\"\n }\n },\n \"events\": {\n \"onChange\": {\n \"description\": \"Runs with { type, name, value, checked }.\"\n }\n },\n \"usageScenarios\": [\n \"Terms & conditions consent\",\n \"Opt-in notification preference\"\n ],\n \"constraints\": []\n }\n },\n {\n \"name\": \"Form.Input\",\n \"export\": \"FormInput\",\n \"module\": \"form.tsx\",\n \"catalog\": {\n \"name\": \"Form.Input\",\n \"description\": \"Single-line text field. Supports text, email, password, number, tel, url, date types.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"form\",\n \"input\"\n ],\n \"props\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"Unique form field name\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"email\",\n \"password\",\n \"number\",\n \"tel\",\n \"url\",\n \"date\",\n \"search\"\n ],\n \"default\": \"text\"\n },\n \"placeholder\": {\n \"type\": \"string\"\n },\n \"helpText\": {\n \"type\": \"string\"\n },\n \"error\": {\n \"type\": \"string\"\n },\n \"required\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"disabled\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Two-way {_bindState:'path'}.\"\n }\n },\n \"events\": {\n \"onChange\": {\n \"description\": \"Runs with { type, name, value }.\"\n }\n },\n \"usageScenarios\": [\n \"Email address field in a login form\",\n \"Search bar with type=search\",\n \"Price input with type=number\"\n ],\n \"constraints\": [\n \"name prop is required and must be unique within the parent Form\"\n ]\n }\n },\n {\n \"name\": \"Form.Select\",\n \"export\": \"FormSelect\",\n \"module\": \"form.tsx\",\n \"catalog\": {\n \"name\": \"Form.Select\",\n \"description\": \"Dropdown select field with an options array [{value, label}].\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"form\",\n \"select\"\n ],\n \"props\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"options\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\"\n },\n \"label\": {\n \"type\": \"string\"\n }\n }\n },\n \"description\": \"[{value, label}]\"\n },\n \"placeholder\": {\n \"type\": \"string\"\n },\n \"required\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Two-way {_bindState:'path'}.\"\n }\n },\n \"events\": {\n \"onChange\": {\n \"description\": \"Runs with { type, name, value }.\"\n }\n },\n \"usageScenarios\": [\n \"Role selector (Admin/Editor/Viewer)\",\n \"Status filter dropdown\"\n ],\n \"constraints\": []\n }\n },\n {\n \"name\": \"Form.Submit\",\n \"export\": \"FormSubmit\",\n \"module\": \"form.tsx\",\n \"catalog\": {\n \"name\": \"Form.Submit\",\n \"description\": \"Form submit button. Use variant=destructive for irreversible actions.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"form\",\n \"button\"\n ],\n \"props\": {\n \"disabled\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"label\": {\n \"type\": \"string\",\n \"default\": \"Submit\"\n },\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"default\",\n \"destructive\",\n \"outline\",\n \"ghost\"\n ],\n \"default\": \"default\"\n },\n \"full\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n },\n \"events\": {\n \"onClick\": {\n \"description\": \"Runs with a plain click payload before the parent form submits.\"\n }\n },\n \"usageScenarios\": [\n \"Save button at the bottom of a form\",\n \"Delete action with variant=destructive\"\n ],\n \"constraints\": [\n \"Must be inside a Form block\"\n ]\n }\n },\n {\n \"name\": \"Form.TextArea\",\n \"export\": \"FormTextArea\",\n \"module\": \"form.tsx\",\n \"catalog\": {\n \"name\": \"Form.TextArea\",\n \"description\": \"Multi-line text input. Use for descriptions, messages, or any free-form long text.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"form\",\n \"textarea\"\n ],\n \"props\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"placeholder\": {\n \"type\": \"string\"\n },\n \"rows\": {\n \"type\": \"integer\",\n \"default\": 4\n },\n \"helpText\": {\n \"type\": \"string\"\n },\n \"required\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Two-way {_bindState:'path'}.\"\n }\n },\n \"events\": {\n \"onChange\": {\n \"description\": \"Runs with { type, name, value }.\"\n }\n },\n \"usageScenarios\": [\n \"Bio / description field on a profile form\",\n \"Message body in a contact form\"\n ],\n \"constraints\": []\n }\n }\n ]\n}\n",
|
|
37
37
|
"type": "registry:ui"
|
|
38
38
|
}
|
|
39
39
|
],
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"props": {
|
|
44
44
|
"idempotent": {
|
|
45
45
|
"type": "boolean",
|
|
46
|
-
"description": "
|
|
46
|
+
"description": "Stable event.value idempotency key for unchanged-value retries"
|
|
47
47
|
},
|
|
48
48
|
"pending": {
|
|
49
49
|
"type": "boolean"
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"props": {
|
|
111
111
|
"idempotent": {
|
|
112
112
|
"type": "boolean",
|
|
113
|
-
"description": "
|
|
113
|
+
"description": "Stable event.value idempotency key for unchanged-value retries"
|
|
114
114
|
},
|
|
115
115
|
"pending": {
|
|
116
116
|
"type": "boolean"
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
},
|
|
176
176
|
"checked": {
|
|
177
177
|
"type": "boolean",
|
|
178
|
-
"description": "
|
|
178
|
+
"description": "Two-way {_bindState:'path'}."
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
"events": {
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
"props": {
|
|
207
207
|
"name": {
|
|
208
208
|
"type": "string",
|
|
209
|
-
"description": "
|
|
209
|
+
"description": "Unique form field name"
|
|
210
210
|
},
|
|
211
211
|
"label": {
|
|
212
212
|
"type": "string"
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
},
|
|
245
245
|
"value": {
|
|
246
246
|
"type": "string",
|
|
247
|
-
"description": "
|
|
247
|
+
"description": "Two-way {_bindState:'path'}."
|
|
248
248
|
}
|
|
249
249
|
},
|
|
250
250
|
"events": {
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
},
|
|
307
307
|
"value": {
|
|
308
308
|
"type": "string",
|
|
309
|
-
"description": "
|
|
309
|
+
"description": "Two-way {_bindState:'path'}."
|
|
310
310
|
}
|
|
311
311
|
},
|
|
312
312
|
"events": {
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
},
|
|
409
409
|
"value": {
|
|
410
410
|
"type": "string",
|
|
411
|
-
"description": "
|
|
411
|
+
"description": "Two-way {_bindState:'path'}."
|
|
412
412
|
}
|
|
413
413
|
},
|
|
414
414
|
"events": {
|
package/dist/shadcn/r/grid.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "registry:ui",
|
|
5
5
|
"description": "Table with a built-in search box. Typing dispatches SetState onto searchKey and filters the resolved rows (case-insensitive substring across all columns).",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"react"
|
|
7
|
+
"react@19.3.0"
|
|
8
8
|
],
|
|
9
9
|
"registryDependencies": [
|
|
10
10
|
"@uibot/uibot-base"
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "item-grid",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"description": "Public-facing collection of whole-card buttons with optional images, local search and category filters. Use for browsable pets, products or projects instead of duplicating cards and a management table. No data writes.",
|
|
6
|
+
"dependencies": [
|
|
7
|
+
"react@19.3.0"
|
|
8
|
+
],
|
|
9
|
+
"registryDependencies": [
|
|
10
|
+
"@uibot/uibot-base"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"path": "components/uibot/item-grid.tsx",
|
|
15
|
+
"target": "components/uibot/item-grid.tsx",
|
|
16
|
+
"content": "import { useId, useState } from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { emit, records, text } from \"./interaction\";\n\nexport interface GridItem {\n id: string;\n title: string;\n description: string;\n category: string;\n meta: string;\n image: string;\n imageAlt: string;\n}\n\nexport function readGridItems(value: unknown): GridItem[] {\n const seen = new Set<string>();\n return records(value).flatMap((row) => {\n if (typeof row.id !== \"string\" || !row.id || seen.has(row.id)) return [];\n seen.add(row.id);\n return [\n {\n id: row.id,\n title: text(row.title),\n description: text(row.description),\n category: text(row.category),\n meta: text(row.meta),\n image:\n typeof row.image === \"string\" && /^(https?:\\/\\/|data:image\\/|\\/)/i.test(row.image)\n ? row.image\n : \"\",\n imageAlt: text(row.imageAlt),\n },\n ];\n });\n}\n\nexport function filterGridItems(items: GridItem[], query: string, category: string): GridItem[] {\n const needle = query.trim().toLocaleLowerCase();\n return items.filter(\n (item) =>\n (!category || item.category === category) &&\n (!needle ||\n [item.title, item.description, item.meta].some((value) =>\n value.toLocaleLowerCase().includes(needle),\n )),\n );\n}\n\nconst CSS = `\n.uibot-item-grid{container-type:inline-size;min-width:0}\n.uibot-item-grid-controls{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:24px}\n.uibot-item-grid input{flex:1 1 220px;min-width:0;min-height:44px;border:1px solid var(--border);border-radius:999px;padding:10px 18px;background:var(--card);font:inherit}\n.uibot-item-grid-filters{display:flex;flex-wrap:wrap;gap:8px}\n.uibot-item-grid-filters button{min-height:44px;padding:8px 20px;border:1px solid var(--border);border-radius:999px;background:transparent;font:inherit}\n.uibot-item-grid-filters button[aria-pressed=true]{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}\n.uibot-item-grid-list{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;list-style:none;margin:0;padding:0}\n@container (min-width:560px){.uibot-item-grid-list{grid-template-columns:repeat(2,minmax(0,1fr))}}\n@container (min-width:960px){.uibot-item-grid-list[data-columns=\"3\"]{grid-template-columns:repeat(3,minmax(0,1fr))}}\n.uibot-item-grid li{min-width:0}\n.uibot-item-grid-card{display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden;border:1px solid var(--border);border-radius:18px;background:var(--card);color:var(--card-foreground);text-align:start;font:inherit;padding:0}\nbutton.uibot-item-grid-card{cursor:pointer}\n.uibot-item-grid button:focus-visible,.uibot-item-grid input:focus-visible{outline:3px solid var(--ring,var(--primary));outline-offset:4px}\nbutton.uibot-item-grid-card:hover{border-color:var(--primary)}\n.uibot-item-grid-card img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;background:var(--muted)}\n.uibot-item-grid-copy{display:flex;flex:1;flex-direction:column;gap:10px;padding:24px}\n.uibot-item-grid-meta{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;font-size:13px;color:var(--muted-foreground)}\n.uibot-item-grid-title{font-size:24px;font-weight:600;line-height:1.25}\n.uibot-item-grid-description{font-size:15px;line-height:1.7;color:var(--muted-foreground)}\n.uibot-item-grid-action{padding-top:12px;margin-top:auto;font-size:14px;font-weight:600;color:var(--primary)}\n.uibot-item-grid-empty{padding:32px 0;color:var(--muted-foreground)}\n`;\n\n/** A single searchable collection; all card content activates the declared item event. */\nexport const ItemGrid: RendererComponent = (props, ctx) => {\n const searchId = useId();\n const [query, setQuery] = useState(\"\");\n const [category, setCategory] = useState(\"\");\n const items = readGridItems(props.items);\n const categories = [...new Set(items.map((item) => item.category).filter(Boolean))];\n const activeCategory = categories.includes(category) ? category : \"\";\n const visible = filterGridItems(\n items,\n props.searchable === true ? query : \"\",\n props.filterable === true ? activeCategory : \"\",\n );\n const selectable = Boolean(\n (ctx.element as { events?: Record<string, unknown> }).events?.onSelect,\n );\n return (\n <section\n className=\"uibot-item-grid\"\n data-uibot-type=\"ItemGrid\"\n aria-label={text(props.label, \"Items\")}\n >\n <style>{CSS}</style>\n {(props.searchable === true || props.filterable === true) && (\n <div className=\"uibot-item-grid-controls\">\n {props.searchable === true && (\n <input\n id={searchId}\n type=\"search\"\n aria-label={text(props.searchPlaceholder, \"Search items\")}\n placeholder={text(props.searchPlaceholder, \"Search items\")}\n value={query}\n onChange={(event) => setQuery(event.currentTarget.value)}\n />\n )}\n {props.filterable === true && categories.length > 0 && (\n <div\n className=\"uibot-item-grid-filters\"\n role=\"group\"\n aria-label={text(props.filterLabel, \"Category\")}\n >\n {[\"\", ...categories].map((value) => (\n <button\n key={value}\n type=\"button\"\n aria-pressed={activeCategory === value}\n onClick={() => setCategory(value)}\n >\n {value || text(props.allLabel, \"All\")}\n </button>\n ))}\n </div>\n )}\n </div>\n )}\n <ul className=\"uibot-item-grid-list\" data-columns={props.columns === \"2\" ? \"2\" : \"3\"}>\n {visible.map((item) => {\n const content = (\n <>\n {item.image && <img src={item.image} alt={item.imageAlt} loading=\"lazy\" />}\n <span className=\"uibot-item-grid-copy\">\n {(item.category || item.meta) && (\n <span className=\"uibot-item-grid-meta\">\n <span>{item.category}</span>\n <span>{item.meta}</span>\n </span>\n )}\n <span className=\"uibot-item-grid-title\">{item.title}</span>\n {item.description && (\n <span className=\"uibot-item-grid-description\">{item.description}</span>\n )}\n {selectable && (\n <span className=\"uibot-item-grid-action\">\n {text(props.actionLabel, \"View details\")}\n </span>\n )}\n </span>\n </>\n );\n return (\n <li key={item.id}>\n {selectable ? (\n <button\n type=\"button\"\n className=\"uibot-item-grid-card\"\n aria-label={`${text(props.actionLabel, \"View details\")}: ${item.title}`}\n onClick={() => emit(ctx, \"onSelect\", { id: item.id })}\n >\n {content}\n </button>\n ) : (\n <article className=\"uibot-item-grid-card\">{content}</article>\n )}\n </li>\n );\n })}\n </ul>\n {visible.length === 0 && (\n <p role=\"status\" className=\"uibot-item-grid-empty\">\n {text(props.emptyText, \"No matching items\")}\n </p>\n )}\n </section>\n );\n};\n",
|
|
17
|
+
"type": "registry:ui"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "components/uibot/interaction.ts",
|
|
21
|
+
"target": "components/uibot/interaction.ts",
|
|
22
|
+
"content": "import type { RendererComponent } from \"@/lib/uibot-renderer\";\nexport type BlockContext = Parameters<RendererComponent>[1];\nexport type Chain = Parameters<NonNullable<BlockContext[\"dispatch\"]>>[0];\nexport type EventValue = string | number | boolean | null;\nexport function emit(\n ctx: BlockContext,\n name: string,\n values: Record<string, EventValue | EventValue[]> = {},\n value?: EventValue,\n): void {\n const element = ctx.element as { events?: Record<string, Chain> };\n const chain = element.events?.[name];\n if (chain?.length)\n void ctx.dispatch?.(chain, {\n event: { type: name, values, ...(value !== undefined ? { value } : {}) },\n });\n}\nexport function text(value: unknown, fallback = \"\"): string {\n return value == null ? fallback : String(value);\n}\nexport function records(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value)\n ? value.filter(\n (v): v is Record<string, unknown> => !!v && typeof v === \"object\" && !Array.isArray(v),\n )\n : [];\n}\n\nconst submissions = new WeakMap<object, { payload: string; key: string }>();\n/** A new owner represents a new user intent; an unchanged failed submission keeps its key. */\nexport function submissionKey(owner: object, values: unknown): string {\n const payload = JSON.stringify(values);\n const previous = submissions.get(owner);\n if (previous?.payload === payload) return previous.key;\n const key = crypto.randomUUID();\n submissions.set(owner, { payload, key });\n return key;\n}\n",
|
|
23
|
+
"type": "registry:ui"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "components/uibot/item-grid.uibot.json",
|
|
27
|
+
"target": "components/uibot/item-grid.uibot.json",
|
|
28
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"item-grid\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"ItemGrid\",\n \"export\": \"ItemGrid\",\n \"module\": \"item-grid.tsx\",\n \"catalog\": {\n \"name\": \"ItemGrid\",\n \"description\": \"Public-facing collection of whole-card buttons with optional images, local search and category filters. Use for browsable pets, products or projects instead of duplicating cards and a management table. No data writes.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"cards\",\n \"search\",\n \"collection\",\n \"gallery\"\n ],\n \"props\": {\n \"label\": {\n \"type\": \"string\"\n },\n \"items\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"id\",\n \"title\"\n ],\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"category\": {\n \"type\": \"string\"\n },\n \"meta\": {\n \"type\": \"string\"\n },\n \"image\": {\n \"type\": \"string\",\n \"description\": \"Supplied image URL or inline data:image illustration; never invent an asset URL\"\n },\n \"imageAlt\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"columns\": {\n \"type\": \"string\",\n \"enum\": [\n \"2\",\n \"3\"\n ],\n \"default\": \"3\"\n },\n \"searchable\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"filterable\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"searchPlaceholder\": {\n \"type\": \"string\"\n },\n \"filterLabel\": {\n \"type\": \"string\"\n },\n \"allLabel\": {\n \"type\": \"string\"\n },\n \"emptyText\": {\n \"type\": \"string\"\n },\n \"actionLabel\": {\n \"type\": \"string\"\n }\n },\n \"events\": {\n \"onSelect\": {\n \"description\": \"Whole-card click or keyboard activation emits the selected string id in {\\\"_event\\\":\\\"values.id\\\"}.\"\n }\n },\n \"constraints\": [\n \"Use unique non-empty string item IDs. Category filters derive from items; search and category combine on these same cards. Set all control labels in the product language. Image is optional; omit it when unavailable.\"\n ]\n }\n }\n ]\n}\n",
|
|
29
|
+
"type": "registry:ui"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"meta": {
|
|
33
|
+
"category": "composite",
|
|
34
|
+
"level": "L2",
|
|
35
|
+
"props": {
|
|
36
|
+
"label": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"required": [
|
|
44
|
+
"id",
|
|
45
|
+
"title"
|
|
46
|
+
],
|
|
47
|
+
"properties": {
|
|
48
|
+
"id": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"title": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"description": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"category": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"meta": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"image": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "Supplied image URL or inline data:image illustration; never invent an asset URL"
|
|
66
|
+
},
|
|
67
|
+
"imageAlt": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"columns": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"enum": [
|
|
76
|
+
"2",
|
|
77
|
+
"3"
|
|
78
|
+
],
|
|
79
|
+
"default": "3"
|
|
80
|
+
},
|
|
81
|
+
"searchable": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"default": false
|
|
84
|
+
},
|
|
85
|
+
"filterable": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"default": false
|
|
88
|
+
},
|
|
89
|
+
"searchPlaceholder": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"filterLabel": {
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"allLabel": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"emptyText": {
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
"actionLabel": {
|
|
102
|
+
"type": "string"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"events": {
|
|
106
|
+
"onSelect": {
|
|
107
|
+
"description": "Whole-card click or keyboard activation emits the selected string id in {\"_event\":\"values.id\"}."
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"constraints": [
|
|
111
|
+
"Use unique non-empty string item IDs. Category filters derive from items; search and category combine on these same cards. Set all control labels in the product language. Image is optional; omit it when unavailable."
|
|
112
|
+
],
|
|
113
|
+
"provides": [
|
|
114
|
+
"ItemGrid"
|
|
115
|
+
],
|
|
116
|
+
"uibot": {
|
|
117
|
+
"schema": "uibot.registry.item.v1",
|
|
118
|
+
"item": "item-grid",
|
|
119
|
+
"channel": "public",
|
|
120
|
+
"components": [
|
|
121
|
+
{
|
|
122
|
+
"name": "ItemGrid",
|
|
123
|
+
"export": "ItemGrid",
|
|
124
|
+
"module": "item-grid.tsx",
|
|
125
|
+
"catalog": {
|
|
126
|
+
"name": "ItemGrid",
|
|
127
|
+
"description": "Public-facing collection of whole-card buttons with optional images, local search and category filters. Use for browsable pets, products or projects instead of duplicating cards and a management table. No data writes.",
|
|
128
|
+
"category": "composite",
|
|
129
|
+
"level": "L2",
|
|
130
|
+
"tags": [
|
|
131
|
+
"cards",
|
|
132
|
+
"search",
|
|
133
|
+
"collection",
|
|
134
|
+
"gallery"
|
|
135
|
+
],
|
|
136
|
+
"props": {
|
|
137
|
+
"label": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"items": {
|
|
141
|
+
"type": "array",
|
|
142
|
+
"items": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"required": [
|
|
145
|
+
"id",
|
|
146
|
+
"title"
|
|
147
|
+
],
|
|
148
|
+
"properties": {
|
|
149
|
+
"id": {
|
|
150
|
+
"type": "string"
|
|
151
|
+
},
|
|
152
|
+
"title": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"description": {
|
|
156
|
+
"type": "string"
|
|
157
|
+
},
|
|
158
|
+
"category": {
|
|
159
|
+
"type": "string"
|
|
160
|
+
},
|
|
161
|
+
"meta": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"image": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"description": "Supplied image URL or inline data:image illustration; never invent an asset URL"
|
|
167
|
+
},
|
|
168
|
+
"imageAlt": {
|
|
169
|
+
"type": "string"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"columns": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"enum": [
|
|
177
|
+
"2",
|
|
178
|
+
"3"
|
|
179
|
+
],
|
|
180
|
+
"default": "3"
|
|
181
|
+
},
|
|
182
|
+
"searchable": {
|
|
183
|
+
"type": "boolean",
|
|
184
|
+
"default": false
|
|
185
|
+
},
|
|
186
|
+
"filterable": {
|
|
187
|
+
"type": "boolean",
|
|
188
|
+
"default": false
|
|
189
|
+
},
|
|
190
|
+
"searchPlaceholder": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
},
|
|
193
|
+
"filterLabel": {
|
|
194
|
+
"type": "string"
|
|
195
|
+
},
|
|
196
|
+
"allLabel": {
|
|
197
|
+
"type": "string"
|
|
198
|
+
},
|
|
199
|
+
"emptyText": {
|
|
200
|
+
"type": "string"
|
|
201
|
+
},
|
|
202
|
+
"actionLabel": {
|
|
203
|
+
"type": "string"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"events": {
|
|
207
|
+
"onSelect": {
|
|
208
|
+
"description": "Whole-card click or keyboard activation emits the selected string id in {\"_event\":\"values.id\"}."
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"constraints": [
|
|
212
|
+
"Use unique non-empty string item IDs. Category filters derive from items; search and category combine on these same cards. Set all control labels in the product language. Image is optional; omit it when unavailable."
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|