@uibot/registry 0.19.0 → 0.20.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.
Files changed (38) hide show
  1. package/dist/component-replacement.d.ts +10 -0
  2. package/dist/index.js +7 -7
  3. package/dist/resources.d.ts +1 -0
  4. package/dist/resources.js +3 -3
  5. package/dist/shadcn/r/admin-shell.json +16 -3
  6. package/dist/shadcn/r/charts.json +44 -17
  7. package/dist/shadcn/r/chat-workspace.json +1 -1
  8. package/dist/shadcn/r/collection-cell-editor.json +1 -1
  9. package/dist/shadcn/r/collection-panel-drawer.json +1 -1
  10. package/dist/shadcn/r/collection-record-menu.json +1 -1
  11. package/dist/shadcn/r/collection-shared.json +1 -1
  12. package/dist/shadcn/r/commerce-workspace.json +1 -1
  13. package/dist/shadcn/r/console-page.json +1 -1
  14. package/dist/shadcn/r/console-shell.json +1 -1
  15. package/dist/shadcn/r/creation-html-generation.json +2 -2
  16. package/dist/shadcn/r/creation-reference-generation.json +2 -2
  17. package/dist/shadcn/r/creation-revision-export.json +2 -2
  18. package/dist/shadcn/r/creation-shared.json +2 -2
  19. package/dist/shadcn/r/creation-variant-compare.json +3 -3
  20. package/dist/shadcn/r/creation-workspace.json +3 -3
  21. package/dist/shadcn/r/crm-workspace.json +1 -1
  22. package/dist/shadcn/r/dashboard-01.json +78 -0
  23. package/dist/shadcn/r/dashboard.json +113 -3
  24. package/dist/shadcn/r/data-table.json +120 -10
  25. package/dist/shadcn/r/data.json +9 -2
  26. package/dist/shadcn/r/document-assistant.json +1 -1
  27. package/dist/shadcn/r/document-workspace.json +1 -1
  28. package/dist/shadcn/r/drilldown-menu.json +1 -1
  29. package/dist/shadcn/r/education-workspace.json +1 -1
  30. package/dist/shadcn/r/feedback.json +15 -2
  31. package/dist/shadcn/r/form.json +1 -1
  32. package/dist/shadcn/r/layout.json +27 -8
  33. package/dist/shadcn/r/nav.json +38 -10
  34. package/dist/shadcn/r/shadcn-admin.json +1 -1
  35. package/dist/shadcn/r/sidebar-primitives.json +1 -1
  36. package/dist/shadcn/r/workspace.json +9 -2
  37. package/dist/shadcn/registry.json +55 -27
  38. package/package.json +2 -2
@@ -60,7 +60,7 @@
60
60
  {
61
61
  "path": "components/uibot/sidebars/ui-dropdown-menu.tsx",
62
62
  "target": "components/uibot/sidebars/ui-dropdown-menu.tsx",
63
- "content": "// Adapted from shadcn/ui (MIT). See THIRD_PARTY_LICENSE and provenance.json.\n\"use client\";\n\nimport type * as React from \"react\";\nimport { cn } from \"./utils\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n",
63
+ "content": "// Adapted from shadcn/ui (MIT). See THIRD_PARTY_LICENSE and provenance.json.\n\"use client\";\n\nimport type * as React from \"react\";\nimport { cn } from \"./utils\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n container,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content> & {\n container?: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>[\"container\"];\n}) {\n return (\n <DropdownMenuPrimitive.Portal {...(container ? { container } : {})}>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n",
64
64
  "type": "registry:component"
65
65
  },
66
66
  {
@@ -4,7 +4,8 @@
4
4
  "type": "registry:ui",
5
5
  "description": "Searchable integrations with explicit capability availability",
6
6
  "dependencies": [
7
- "react@19.3.0"
7
+ "react@19.3.0",
8
+ "radix-ui@1.4.3"
8
9
  ],
9
10
  "registryDependencies": [
10
11
  "@uibot/uibot-base"
@@ -13,7 +14,7 @@
13
14
  {
14
15
  "path": "components/uibot/workspace.tsx",
15
16
  "target": "components/uibot/workspace.tsx",
16
- "content": "import { useEffect, useRef, useState } from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { Icon } from \"./icons\";\nimport { BrandIcon } from \"./brand-icons\";\nimport { emit, records, submissionKey, text, type BlockContext } from \"./interaction\";\nfunction Integrations({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const [search, filter] = useState(\"\"),\n [status, setStatus] = useState(\"all\"),\n [sort, setSort] = useState(\"asc\");\n const items = records(props.items)\n .filter(\n (i) =>\n text(i.name).toLowerCase().includes(search.toLowerCase()) &&\n (status === \"all\" || (status === \"connected\") === (i.connected === true)),\n )\n .sort((a, b) => text(a.name).localeCompare(text(b.name)) * (sort === \"asc\" ? 1 : -1));\n return (\n <section data-uibot-type=\"IntegrationGrid\">\n <div className=\"mb-6 flex flex-wrap gap-2\">\n <input\n className=\"h-9 rounded-md border bg-background px-3 text-sm\"\n aria-label=\"Search apps\"\n placeholder=\"Filter apps...\"\n value={search}\n onChange={(e) => filter(e.target.value)}\n />\n <select\n aria-label=\"Connection status\"\n className=\"rounded-md border bg-background px-3 text-sm\"\n value={status}\n onChange={(e) => setStatus(e.target.value)}\n >\n <option value=\"all\">All apps</option>\n <option value=\"connected\">Connected</option>\n <option value=\"available\">Not connected</option>\n </select>\n <select\n className=\"ms-auto rounded-md border bg-background px-3 text-sm\"\n aria-label=\"Sort apps\"\n value={sort}\n onChange={(e) => setSort(e.target.value)}\n >\n <option value=\"asc\">Ascending</option>\n <option value=\"desc\">Descending</option>\n </select>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 xl:grid-cols-3\">\n {items.map((item) => (\n <article key={text(item.id)} className=\"rounded-xl border p-6\">\n <div className=\"mb-5 flex items-center justify-between\">\n <span className=\"grid size-11 place-items-center rounded-lg border bg-muted\">\n {typeof item.brand === \"string\" ? (\n <BrandIcon name={item.brand} />\n ) : (\n <Icon name={text(item.icon, \"boxes\")} size={24} />\n )}\n </span>\n <button\n type=\"button\"\n disabled={item.available !== true || props.pending === true}\n className=\"rounded-md border px-3 py-1.5 text-sm disabled:opacity-50\"\n onClick={() =>\n emit(ctx, \"onAction\", {\n id: text(item.id),\n action: item.connected === true ? \"disconnect\" : \"connect\",\n })\n }\n >\n {item.connected === true\n ? \"Connected\"\n : item.available === true\n ? \"Connect\"\n : \"Unavailable\"}\n </button>\n </div>\n <h3 className=\"font-semibold\">{text(item.name)}</h3>\n <p className=\"mt-2 text-sm text-muted-foreground\">{text(item.description)}</p>\n {props.configurable === true && (\n <button\n type=\"button\"\n className=\"mt-4 rounded-md border px-3 py-1.5 text-sm\"\n disabled={props.pending === true}\n aria-label={`Configure ${text(item.name)}`}\n onClick={() => {\n const config = records(props.configurations).find(\n (row) => row.provider === item.id,\n );\n const values =\n config?.config && typeof config.config === \"object\"\n ? (config.config as Record<string, unknown>)\n : {};\n emit(ctx, \"onConfigure\", {\n provider: text(item.id),\n id: text(config?.id),\n version: typeof config?.version === \"number\" ? config.version : null,\n enabled: config?.enabled === true,\n label: text(values.label, text(item.name)),\n channel: text(values.channel),\n });\n }}\n >\n Configure\n </button>\n )}\n </article>\n ))}\n </div>\n {!items.length && (\n <p className=\"py-16 text-center text-sm text-muted-foreground\">No apps found.</p>\n )}\n {Boolean(props.error) && (\n <p role=\"alert\" className=\"mt-4 text-sm text-destructive\">\n {text(props.error)}\n </p>\n )}\n </section>\n );\n}\nexport const IntegrationGrid: RendererComponent = (props, ctx) => (\n <Integrations props={props} ctx={ctx} />\n);\nfunction Chat({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const [search, setSearch] = useState(\"\"),\n [localId, setId] = useState(\"\"),\n [localDraft, setDraft] = useState(\"\");\n const draft = typeof props.draft === \"string\" ? props.draft : localDraft;\n const intent = useRef<object>({});\n useEffect(() => {\n if (!draft) intent.current = {};\n }, [draft]);\n const conversations = records(props.conversations),\n id = text(props.selectedId, localId),\n selected = conversations.find((c) => c.id === id),\n messages = records(props.messages)\n .filter((m) => m.conversationId === id)\n .sort((a, b) => {\n const first = Date.parse(text(a.createdAt)),\n second = Date.parse(text(b.createdAt));\n return Number.isFinite(first) && Number.isFinite(second) ? first - second : 0;\n });\n const matches = conversations.filter((c) =>\n text(c.name).toLowerCase().includes(search.trim().toLowerCase()),\n );\n const backButton = useRef<HTMLButtonElement>(null);\n const searchInput = useRef<HTMLInputElement>(null);\n const returnButton = useRef<HTMLButtonElement | null>(null);\n const navigationFocus = useRef<{\n id: string;\n fromId: string;\n origin: HTMLButtonElement;\n } | null>(null);\n const hasSelection = Boolean(selected);\n useEffect(() => {\n const request = navigationFocus.current;\n if (!request) return;\n if (request.id !== id) {\n if (request.fromId !== id) navigationFocus.current = null;\n return;\n }\n if (id && !hasSelection) return;\n navigationFocus.current = null;\n const document = request.origin.ownerDocument;\n if (document.activeElement !== request.origin && document.activeElement !== document.body)\n return;\n const target = id\n ? backButton.current\n : returnButton.current?.isConnected\n ? returnButton.current\n : searchInput.current;\n if (target?.getClientRects().length) target.focus({ preventScroll: true });\n }, [id, hasSelection]);\n const log = useRef<HTMLDivElement>(null);\n const content = useRef<HTMLDivElement>(null);\n const followLatest = useRef(true);\n const layout = useRef({ width: 0, height: 0, content: 0 });\n const previousId = useRef(id);\n const lastMessage = messages.at(-1);\n // biome-ignore lint/correctness/useExhaustiveDependencies: Scroll follows the latest message only while the reader is at the bottom.\n useEffect(() => {\n const element = log.current;\n if (previousId.current !== id) followLatest.current = true;\n previousId.current = id;\n if (!element) return;\n const scroll = () => {\n if (followLatest.current) element.scrollTop = element.scrollHeight;\n layout.current = {\n width: element.clientWidth,\n height: element.clientHeight,\n content: element.scrollHeight,\n };\n };\n scroll();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(scroll);\n observer.observe(element);\n if (content.current) observer.observe(content.current);\n return () => observer.disconnect();\n }, [id, messages.length, lastMessage?.id, lastMessage?.text]);\n return (\n <>\n {Boolean(props.error) && (\n <p role=\"alert\" className=\"mb-3 text-sm text-destructive\">\n {text(props.error)}\n </p>\n )}\n <section\n data-uibot-type=\"ChatPanel\"\n className=\"flex min-h-[560px] overflow-hidden rounded-xl border\"\n >\n <aside\n className={`${selected ? \"hidden md:block\" : \"block\"} w-full shrink-0 border-e p-4 md:w-72`}\n >\n <div className=\"mb-4 flex items-center justify-between\">\n <h2 className=\"text-2xl font-bold\">Inbox</h2>\n <Icon name=\"message-circle\" />\n </div>\n <input\n ref={searchInput}\n aria-label=\"Search conversations\"\n placeholder=\"Search chat...\"\n className=\"mb-4 w-full rounded-md border bg-background px-3 py-2 text-sm\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n {!matches.length && (\n <p role=\"status\" className=\"p-3 text-sm text-muted-foreground\">\n {search.trim() ? \"No conversations found.\" : \"No conversations yet.\"}\n </p>\n )}\n {matches.map((c) => (\n <button\n key={text(c.id)}\n type=\"button\"\n className={`mb-1 flex w-full gap-3 rounded-md p-3 text-start ${c.id === id ? \"bg-muted\" : \"hover:bg-muted/50\"}`}\n onClick={(event) => {\n returnButton.current = event.currentTarget;\n navigationFocus.current = {\n id: text(c.id),\n fromId: id,\n origin: event.currentTarget,\n };\n setId(text(c.id));\n emit(ctx, \"onSelect\", { id: text(c.id) }, text(c.id));\n }}\n >\n <span className=\"grid size-10 shrink-0 place-items-center rounded-full bg-muted text-xs font-medium\">\n {text(c.initials)}\n </span>\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-semibold\">{text(c.name)}</span>\n <span className=\"block truncate text-xs text-muted-foreground\">\n {text(c.preview)}\n </span>\n </span>\n </button>\n ))}\n </aside>\n <div className={`${selected ? \"flex\" : \"hidden md:flex\"} min-w-0 flex-1 flex-col`}>\n {selected ? (\n <>\n <header className=\"flex items-center gap-3 border-b px-6 py-4\">\n <button\n ref={backButton}\n type=\"button\"\n className=\"text-sm md:hidden\"\n onClick={(event) => {\n navigationFocus.current = { id: \"\", fromId: id, origin: event.currentTarget };\n setId(\"\");\n emit(ctx, \"onSelect\", { id: \"\" }, \"\");\n }}\n >\n Back\n </button>\n <div>\n <h3 className=\"font-semibold\">{text(selected.name)}</h3>\n <p className=\"text-xs text-muted-foreground\">\n {text(selected.description, \"Conversation\")}\n </p>\n </div>\n </header>\n <div\n ref={log}\n onScroll={(event) => {\n const element = event.currentTarget;\n // Layout anchoring can emit scroll before ResizeObserver delivers.\n if (\n element.clientWidth === layout.current.width &&\n element.clientHeight === layout.current.height &&\n element.scrollHeight === layout.current.content\n ) {\n followLatest.current =\n element.scrollHeight - element.scrollTop - element.clientHeight < 48;\n }\n }}\n className=\"max-h-[480px] flex-1 overflow-auto p-6\"\n role=\"log\"\n aria-label=\"Messages\"\n >\n <div ref={content} className=\"flex flex-col gap-4\">\n {messages.map((m) => (\n <div\n key={text(m.id)}\n className={`max-w-[80%] shrink-0 rounded-xl px-4 py-2.5 text-sm ${m.own === true || (props.currentUserId && m.senderId === props.currentUserId) ? \"ms-auto bg-primary text-primary-foreground\" : \"me-auto bg-muted\"}`}\n >\n <p className=\"whitespace-pre-wrap [overflow-wrap:anywhere]\">{text(m.text)}</p>\n <time className=\"mt-1 block text-[11px] opacity-60\">\n {m.time\n ? text(m.time)\n : Number.isFinite(Date.parse(text(m.createdAt)))\n ? new Date(text(m.createdAt)).toLocaleTimeString(undefined, {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })\n : \"\"}\n </time>\n </div>\n ))}\n </div>\n </div>\n <form\n className=\"m-4 flex gap-2\"\n onSubmit={(e) => {\n e.preventDefault();\n if (props.canSend === true && props.pending !== true && draft.trim())\n emit(ctx, \"onSend\", {\n conversationId: id,\n text: draft.trim(),\n requestId: submissionKey(intent.current, { id, text: draft.trim() }),\n });\n }}\n >\n <input\n aria-label=\"Message\"\n required\n maxLength={8000}\n className=\"min-w-0 flex-1 rounded-md border bg-background px-3 py-2 text-sm\"\n placeholder=\"Type your message...\"\n value={draft}\n onChange={(e) => {\n setDraft(e.target.value);\n emit(ctx, \"onDraftChange\", { text: e.target.value }, e.target.value);\n }}\n disabled={props.pending === true}\n />\n <button\n type=\"submit\"\n aria-label=\"Send message\"\n disabled={props.canSend !== true || props.pending === true || !draft.trim()}\n className=\"rounded-md bg-primary px-3 text-primary-foreground disabled:opacity-40\"\n >\n <Icon name=\"send\" />\n </button>\n </form>\n {props.canSend !== true && (\n <p className=\"px-4 pb-4 text-xs text-muted-foreground\">\n Messaging service is not configured.\n </p>\n )}\n </>\n ) : (\n <div className=\"m-auto flex flex-col items-center gap-3 p-6\">\n <Icon name=\"message-circle\" size={40} />\n <h2 className=\"text-xl font-semibold\">Your messages</h2>\n <p className=\"text-sm text-muted-foreground\">\n Select a conversation to start chatting.\n </p>\n </div>\n )}\n </div>\n </section>\n </>\n );\n}\nexport const ChatPanel: RendererComponent = (props, ctx) => <Chat props={props} ctx={ctx} />;\n",
17
+ "content": "import { useEffect, useRef, useState } from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { Icon } from \"./icons\";\nimport { BrandIcon } from \"./brand-icons\";\nimport { emit, records, submissionKey, text, type BlockContext } from \"./interaction\";\nimport { ScrollArea } from \"./scroll-area\";\nfunction Integrations({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const [search, filter] = useState(\"\"),\n [status, setStatus] = useState(\"all\"),\n [sort, setSort] = useState(\"asc\");\n const items = records(props.items)\n .filter(\n (i) =>\n text(i.name).toLowerCase().includes(search.toLowerCase()) &&\n (status === \"all\" || (status === \"connected\") === (i.connected === true)),\n )\n .sort((a, b) => text(a.name).localeCompare(text(b.name)) * (sort === \"asc\" ? 1 : -1));\n return (\n <section data-uibot-type=\"IntegrationGrid\">\n <div className=\"mb-6 flex flex-wrap gap-2\">\n <input\n className=\"h-9 rounded-md border bg-background px-3 text-sm\"\n aria-label=\"Search apps\"\n placeholder=\"Filter apps...\"\n value={search}\n onChange={(e) => filter(e.target.value)}\n />\n <select\n aria-label=\"Connection status\"\n className=\"rounded-md border bg-background px-3 text-sm\"\n value={status}\n onChange={(e) => setStatus(e.target.value)}\n >\n <option value=\"all\">All apps</option>\n <option value=\"connected\">Connected</option>\n <option value=\"available\">Not connected</option>\n </select>\n <select\n className=\"ms-auto rounded-md border bg-background px-3 text-sm\"\n aria-label=\"Sort apps\"\n value={sort}\n onChange={(e) => setSort(e.target.value)}\n >\n <option value=\"asc\">Ascending</option>\n <option value=\"desc\">Descending</option>\n </select>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 xl:grid-cols-3\">\n {items.map((item) => (\n <article key={text(item.id)} className=\"rounded-xl border p-6\">\n <div className=\"mb-5 flex items-center justify-between\">\n <span className=\"grid size-11 place-items-center rounded-lg border bg-muted\">\n {typeof item.brand === \"string\" ? (\n <BrandIcon name={item.brand} />\n ) : (\n <Icon name={text(item.icon, \"boxes\")} size={24} />\n )}\n </span>\n <button\n type=\"button\"\n disabled={item.available !== true || props.pending === true}\n className=\"rounded-md border px-3 py-1.5 text-sm disabled:opacity-50\"\n onClick={() =>\n emit(ctx, \"onAction\", {\n id: text(item.id),\n action: item.connected === true ? \"disconnect\" : \"connect\",\n })\n }\n >\n {item.connected === true\n ? \"Connected\"\n : item.available === true\n ? \"Connect\"\n : \"Unavailable\"}\n </button>\n </div>\n <h3 className=\"font-semibold\">{text(item.name)}</h3>\n <p className=\"mt-2 text-sm text-muted-foreground\">{text(item.description)}</p>\n {props.configurable === true && (\n <button\n type=\"button\"\n className=\"mt-4 rounded-md border px-3 py-1.5 text-sm\"\n disabled={props.pending === true}\n aria-label={`Configure ${text(item.name)}`}\n onClick={() => {\n const config = records(props.configurations).find(\n (row) => row.provider === item.id,\n );\n const values =\n config?.config && typeof config.config === \"object\"\n ? (config.config as Record<string, unknown>)\n : {};\n emit(ctx, \"onConfigure\", {\n provider: text(item.id),\n id: text(config?.id),\n version: typeof config?.version === \"number\" ? config.version : null,\n enabled: config?.enabled === true,\n label: text(values.label, text(item.name)),\n channel: text(values.channel),\n });\n }}\n >\n Configure\n </button>\n )}\n </article>\n ))}\n </div>\n {!items.length && (\n <p className=\"py-16 text-center text-sm text-muted-foreground\">No apps found.</p>\n )}\n {Boolean(props.error) && (\n <p role=\"alert\" className=\"mt-4 text-sm text-destructive\">\n {text(props.error)}\n </p>\n )}\n </section>\n );\n}\nexport const IntegrationGrid: RendererComponent = (props, ctx) => (\n <Integrations props={props} ctx={ctx} />\n);\nfunction Chat({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const [search, setSearch] = useState(\"\"),\n [localId, setId] = useState(\"\"),\n [localDraft, setDraft] = useState(\"\");\n const draft = typeof props.draft === \"string\" ? props.draft : localDraft;\n const intent = useRef<object>({});\n useEffect(() => {\n if (!draft) intent.current = {};\n }, [draft]);\n const conversations = records(props.conversations),\n id = text(props.selectedId, localId),\n selected = conversations.find((c) => c.id === id),\n messages = records(props.messages)\n .filter((m) => m.conversationId === id)\n .sort((a, b) => {\n const first = Date.parse(text(a.createdAt)),\n second = Date.parse(text(b.createdAt));\n return Number.isFinite(first) && Number.isFinite(second) ? first - second : 0;\n });\n const matches = conversations.filter((c) =>\n text(c.name).toLowerCase().includes(search.trim().toLowerCase()),\n );\n const backButton = useRef<HTMLButtonElement>(null);\n const searchInput = useRef<HTMLInputElement>(null);\n const returnButton = useRef<HTMLButtonElement | null>(null);\n const navigationFocus = useRef<{\n id: string;\n fromId: string;\n origin: HTMLButtonElement;\n } | null>(null);\n const hasSelection = Boolean(selected);\n useEffect(() => {\n const request = navigationFocus.current;\n if (!request) return;\n if (request.id !== id) {\n if (request.fromId !== id) navigationFocus.current = null;\n return;\n }\n if (id && !hasSelection) return;\n navigationFocus.current = null;\n const document = request.origin.ownerDocument;\n if (document.activeElement !== request.origin && document.activeElement !== document.body)\n return;\n const target = id\n ? backButton.current\n : returnButton.current?.isConnected\n ? returnButton.current\n : searchInput.current;\n if (target?.getClientRects().length) target.focus({ preventScroll: true });\n }, [id, hasSelection]);\n const log = useRef<HTMLDivElement>(null);\n const content = useRef<HTMLDivElement>(null);\n const followLatest = useRef(true);\n const layout = useRef({ width: 0, height: 0, content: 0 });\n const previousId = useRef(id);\n const lastMessage = messages.at(-1);\n // biome-ignore lint/correctness/useExhaustiveDependencies: Scroll follows the latest message only while the reader is at the bottom.\n useEffect(() => {\n const element = log.current;\n if (previousId.current !== id) followLatest.current = true;\n previousId.current = id;\n if (!element) return;\n const scroll = () => {\n if (followLatest.current) element.scrollTop = element.scrollHeight;\n layout.current = {\n width: element.clientWidth,\n height: element.clientHeight,\n content: element.scrollHeight,\n };\n };\n scroll();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(scroll);\n observer.observe(element);\n if (content.current) observer.observe(content.current);\n return () => observer.disconnect();\n }, [id, messages.length, lastMessage?.id, lastMessage?.text]);\n return (\n <>\n {Boolean(props.error) && (\n <p role=\"alert\" className=\"mb-3 text-sm text-destructive\">\n {text(props.error)}\n </p>\n )}\n <section\n data-uibot-type=\"ChatPanel\"\n className=\"flex min-h-[560px] overflow-hidden rounded-xl border\"\n >\n <aside\n className={`${selected ? \"hidden md:block\" : \"block\"} w-full shrink-0 border-e p-4 md:w-72`}\n >\n <div className=\"mb-4 flex items-center justify-between\">\n <h2 className=\"text-2xl font-bold\">Inbox</h2>\n <Icon name=\"message-circle\" />\n </div>\n <input\n ref={searchInput}\n aria-label=\"Search conversations\"\n placeholder=\"Search chat...\"\n className=\"mb-4 w-full rounded-md border bg-background px-3 py-2 text-sm\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n {!matches.length && (\n <p role=\"status\" className=\"p-3 text-sm text-muted-foreground\">\n {search.trim() ? \"No conversations found.\" : \"No conversations yet.\"}\n </p>\n )}\n {matches.map((c) => (\n <button\n key={text(c.id)}\n type=\"button\"\n className={`mb-1 flex w-full gap-3 rounded-md p-3 text-start ${c.id === id ? \"bg-muted\" : \"hover:bg-muted/50\"}`}\n onClick={(event) => {\n returnButton.current = event.currentTarget;\n navigationFocus.current = {\n id: text(c.id),\n fromId: id,\n origin: event.currentTarget,\n };\n setId(text(c.id));\n emit(ctx, \"onSelect\", { id: text(c.id) }, text(c.id));\n }}\n >\n <span className=\"grid size-10 shrink-0 place-items-center rounded-full bg-muted text-xs font-medium\">\n {text(c.initials)}\n </span>\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-semibold\">{text(c.name)}</span>\n <span className=\"block truncate text-xs text-muted-foreground\">\n {text(c.preview)}\n </span>\n </span>\n </button>\n ))}\n </aside>\n <div className={`${selected ? \"flex\" : \"hidden md:flex\"} min-w-0 flex-1 flex-col`}>\n {selected ? (\n <>\n <header className=\"flex items-center gap-3 border-b px-6 py-4\">\n <button\n ref={backButton}\n type=\"button\"\n className=\"text-sm md:hidden\"\n onClick={(event) => {\n navigationFocus.current = { id: \"\", fromId: id, origin: event.currentTarget };\n setId(\"\");\n emit(ctx, \"onSelect\", { id: \"\" }, \"\");\n }}\n >\n Back\n </button>\n <div>\n <h3 className=\"font-semibold\">{text(selected.name)}</h3>\n <p className=\"text-xs text-muted-foreground\">\n {text(selected.description, \"Conversation\")}\n </p>\n </div>\n </header>\n <ScrollArea\n className=\"flex-1\"\n style={{ maxHeight: 480 }}\n viewportProps={{\n ref: log,\n onScroll: (event) => {\n const element = event.currentTarget;\n // Layout anchoring can emit scroll before ResizeObserver delivers.\n if (\n element.clientWidth === layout.current.width &&\n element.clientHeight === layout.current.height &&\n element.scrollHeight === layout.current.content\n ) {\n followLatest.current =\n element.scrollHeight - element.scrollTop - element.clientHeight < 48;\n }\n },\n className: \"p-6\",\n role: \"log\",\n \"aria-label\": \"Messages\",\n }}\n >\n <div ref={content} className=\"flex flex-col gap-4\">\n {messages.map((m) => (\n <div\n key={text(m.id)}\n className={`max-w-[80%] shrink-0 rounded-xl px-4 py-2.5 text-sm ${m.own === true || (props.currentUserId && m.senderId === props.currentUserId) ? \"ms-auto bg-primary text-primary-foreground\" : \"me-auto bg-muted\"}`}\n >\n <p className=\"whitespace-pre-wrap [overflow-wrap:anywhere]\">{text(m.text)}</p>\n <time className=\"mt-1 block text-[11px] opacity-60\">\n {m.time\n ? text(m.time)\n : Number.isFinite(Date.parse(text(m.createdAt)))\n ? new Date(text(m.createdAt)).toLocaleTimeString(undefined, {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })\n : \"\"}\n </time>\n </div>\n ))}\n </div>\n </ScrollArea>\n <form\n className=\"m-4 flex gap-2\"\n onSubmit={(e) => {\n e.preventDefault();\n if (props.canSend === true && props.pending !== true && draft.trim())\n emit(ctx, \"onSend\", {\n conversationId: id,\n text: draft.trim(),\n requestId: submissionKey(intent.current, { id, text: draft.trim() }),\n });\n }}\n >\n <input\n aria-label=\"Message\"\n required\n maxLength={8000}\n className=\"min-w-0 flex-1 rounded-md border bg-background px-3 py-2 text-sm\"\n placeholder=\"Type your message...\"\n value={draft}\n onChange={(e) => {\n setDraft(e.target.value);\n emit(ctx, \"onDraftChange\", { text: e.target.value }, e.target.value);\n }}\n disabled={props.pending === true}\n />\n <button\n type=\"submit\"\n aria-label=\"Send message\"\n disabled={props.canSend !== true || props.pending === true || !draft.trim()}\n className=\"rounded-md bg-primary px-3 text-primary-foreground disabled:opacity-40\"\n >\n <Icon name=\"send\" />\n </button>\n </form>\n {props.canSend !== true && (\n <p className=\"px-4 pb-4 text-xs text-muted-foreground\">\n Messaging service is not configured.\n </p>\n )}\n </>\n ) : (\n <div className=\"m-auto flex flex-col items-center gap-3 p-6\">\n <Icon name=\"message-circle\" size={40} />\n <h2 className=\"text-xl font-semibold\">Your messages</h2>\n <p className=\"text-sm text-muted-foreground\">\n Select a conversation to start chatting.\n </p>\n </div>\n )}\n </div>\n </section>\n </>\n );\n}\nexport const ChatPanel: RendererComponent = (props, ctx) => <Chat props={props} ctx={ctx} />;\n",
17
18
  "type": "registry:ui"
18
19
  },
19
20
  {
@@ -34,6 +35,12 @@
34
35
  "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",
35
36
  "type": "registry:ui"
36
37
  },
38
+ {
39
+ "path": "components/uibot/scroll-area.tsx",
40
+ "target": "components/uibot/scroll-area.tsx",
41
+ "content": "// Adapted from shadcn/ui Scroll Area (MIT).\nimport type { ComponentProps } from \"react\";\nimport { ScrollArea as Primitive } from \"radix-ui\";\n\nconst styles = `\n.uibot-scroll-area{position:relative;min-width:0;min-height:0;overflow:hidden}\n.uibot-scroll-viewport{width:100%;height:100%;max-height:inherit;border-radius:inherit;outline:none}\n.uibot-scroll-viewport:focus-visible{outline:2px solid var(--ring,#94a3b8);outline-offset:-2px}\n.uibot-scroll-viewport>div{display:block!important;min-width:100%}\n.uibot-scroll-area[data-fill-content=true]>.uibot-scroll-viewport>div{display:flex!important;flex-direction:column;min-height:100%}\n.uibot-scroll-area[data-scrollbars=horizontal]>.uibot-scroll-viewport{height:auto}\n.uibot-scrollbar{display:flex;touch-action:none;user-select:none;padding:1px;z-index:20}\n.uibot-scrollbar[data-orientation=vertical]{width:10px;border-inline-start:1px solid transparent}\n.uibot-scrollbar[data-orientation=horizontal]{height:10px;flex-direction:column;border-top:1px solid transparent}\n.uibot-scroll-thumb{position:relative;flex:1;border-radius:9999px;background:var(--nui-border,var(--border,#d4d4d8))}\n.uibot-scroll-thumb:hover,.uibot-scrollbar[data-state=visible]:active .uibot-scroll-thumb{background:var(--muted-foreground,#71717a)}\n`;\n\n/** Shared presentation primitive; refs and scroll events belong to the actual viewport. */\nexport function ScrollArea({\n children,\n className,\n scrollbars = \"vertical\",\n viewportProps,\n fillContent = false,\n ...props\n}: ComponentProps<typeof Primitive.Root> & {\n scrollbars?: \"vertical\" | \"horizontal\" | \"both\";\n viewportProps?: ComponentProps<typeof Primitive.Viewport>;\n fillContent?: boolean;\n}) {\n const { className: viewportClassName, ...viewportRest } = viewportProps ?? {};\n return (\n <Primitive.Root\n data-slot=\"scroll-area\"\n data-scrollbars={scrollbars}\n data-fill-content={fillContent}\n className={`uibot-scroll-area ${className ?? \"\"}`}\n type=\"auto\"\n {...props}\n >\n <style>{styles}</style>\n <Primitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className={`uibot-scroll-viewport ${viewportClassName ?? \"\"}`}\n tabIndex={0}\n {...viewportRest}\n >\n {children}\n </Primitive.Viewport>\n {scrollbars !== \"horizontal\" && <ScrollBar />}\n {scrollbars !== \"vertical\" && <ScrollBar orientation=\"horizontal\" />}\n <Primitive.Corner />\n </Primitive.Root>\n );\n}\n\nexport function ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: ComponentProps<typeof Primitive.Scrollbar>) {\n return (\n <Primitive.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={`uibot-scrollbar ${className ?? \"\"}`}\n {...props}\n >\n <Primitive.Thumb data-slot=\"scroll-area-thumb\" className=\"uibot-scroll-thumb\" />\n </Primitive.Scrollbar>\n );\n}\n",
42
+ "type": "registry:ui"
43
+ },
37
44
  {
38
45
  "path": "components/uibot/workspace.uibot.json",
39
46
  "target": "components/uibot/workspace.uibot.json",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": [
28
28
  "react@19.3.0",
29
- "@uibot/ai-chat@0.19.0"
29
+ "@uibot/ai-chat@0.20.0"
30
30
  ]
31
31
  },
32
32
  {
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": [
40
40
  "react@19.3.0",
41
- "@uibot/document-editor@0.19.0"
41
+ "@uibot/document-editor@0.20.0"
42
42
  ]
43
43
  },
44
44
  {
@@ -80,7 +80,8 @@
80
80
  "@uibot/uibot-base"
81
81
  ],
82
82
  "dependencies": [
83
- "react@19.3.0"
83
+ "react@19.3.0",
84
+ "radix-ui@1.4.3"
84
85
  ]
85
86
  },
86
87
  {
@@ -113,7 +114,8 @@
113
114
  "@uibot/uibot-base"
114
115
  ],
115
116
  "dependencies": [
116
- "react@19.3.0"
117
+ "react@19.3.0",
118
+ "radix-ui@1.4.3"
117
119
  ]
118
120
  },
119
121
  {
@@ -124,7 +126,15 @@
124
126
  "@uibot/uibot-base"
125
127
  ],
126
128
  "dependencies": [
127
- "react@19.3.0"
129
+ "react@19.3.0",
130
+ "@dnd-kit/core@6.3.1",
131
+ "@dnd-kit/sortable@10.0.0",
132
+ "@dnd-kit/utilities@3.2.2",
133
+ "clsx@2.1.1",
134
+ "lucide-react@1.56.0",
135
+ "radix-ui@1.4.3",
136
+ "react-day-picker@9.14.0",
137
+ "tailwind-merge@3.7.0"
128
138
  ]
129
139
  },
130
140
  {
@@ -166,7 +176,8 @@
166
176
  "@uibot/uibot-base"
167
177
  ],
168
178
  "dependencies": [
169
- "react@19.3.0"
179
+ "react@19.3.0",
180
+ "radix-ui@1.4.3"
170
181
  ]
171
182
  },
172
183
  {
@@ -177,7 +188,8 @@
177
188
  "@uibot/uibot-base"
178
189
  ],
179
190
  "dependencies": [
180
- "react@19.3.0"
191
+ "react@19.3.0",
192
+ "radix-ui@1.4.3"
181
193
  ]
182
194
  },
183
195
  {
@@ -201,7 +213,8 @@
201
213
  "@uibot/uibot-base"
202
214
  ],
203
215
  "dependencies": [
204
- "react@19.3.0"
216
+ "react@19.3.0",
217
+ "radix-ui@1.4.3"
205
218
  ]
206
219
  },
207
220
  {
@@ -240,7 +253,7 @@
240
253
  {
241
254
  "name": "charts",
242
255
  "type": "registry:ui",
243
- "description": "Pure-SVG line / area chart with no third-party dependency. Draws one polyline per series on a shared vertical scale. Alias: LineChart.",
256
+ "description": "SVG line/area chart: shared axes, pointer/keyboard values and crosshair. Alias: LineChart.",
244
257
  "registryDependencies": [
245
258
  "@uibot/uibot-base"
246
259
  ],
@@ -733,6 +746,21 @@
733
746
  "@uibot/nav"
734
747
  ]
735
748
  },
749
+ {
750
+ "name": "dashboard-01",
751
+ "type": "registry:block",
752
+ "description": "An inset dashboard with four metrics, date-range visitor trends and an editable document outline, adapted from shadcn/ui dashboard-01.",
753
+ "registryDependencies": [
754
+ "@uibot/charts",
755
+ "@uibot/data",
756
+ "@uibot/data-table",
757
+ "@uibot/feedback",
758
+ "@uibot/form",
759
+ "@uibot/layout",
760
+ "@uibot/nav",
761
+ "@uibot/primitives"
762
+ ]
763
+ },
736
764
  {
737
765
  "name": "shadcn-admin",
738
766
  "type": "registry:block",
@@ -1353,8 +1381,8 @@
1353
1381
  "registryDependencies": [],
1354
1382
  "dependencies": [
1355
1383
  "react@19.3.0",
1356
- "@uibot/contracts@0.19.0",
1357
- "@uibot/creation-kit@0.19.0"
1384
+ "@uibot/contracts@0.20.0",
1385
+ "@uibot/creation-kit@0.20.0"
1358
1386
  ]
1359
1387
  },
1360
1388
  {
@@ -1369,8 +1397,8 @@
1369
1397
  ],
1370
1398
  "dependencies": [
1371
1399
  "react@19.3.0",
1372
- "@uibot/contracts@0.19.0",
1373
- "@uibot/creation-kit@0.19.0"
1400
+ "@uibot/contracts@0.20.0",
1401
+ "@uibot/creation-kit@0.20.0"
1374
1402
  ]
1375
1403
  },
1376
1404
  {
@@ -1385,8 +1413,8 @@
1385
1413
  ],
1386
1414
  "dependencies": [
1387
1415
  "react@19.3.0",
1388
- "@uibot/contracts@0.19.0",
1389
- "@uibot/creation-kit@0.19.0"
1416
+ "@uibot/contracts@0.20.0",
1417
+ "@uibot/creation-kit@0.20.0"
1390
1418
  ]
1391
1419
  },
1392
1420
  {
@@ -1399,8 +1427,8 @@
1399
1427
  ],
1400
1428
  "dependencies": [
1401
1429
  "react@19.3.0",
1402
- "@uibot/contracts@0.19.0",
1403
- "@uibot/creation-kit@0.19.0"
1430
+ "@uibot/contracts@0.20.0",
1431
+ "@uibot/creation-kit@0.20.0"
1404
1432
  ]
1405
1433
  },
1406
1434
  {
@@ -1416,9 +1444,9 @@
1416
1444
  ],
1417
1445
  "dependencies": [
1418
1446
  "react@19.3.0",
1419
- "@uibot/contracts@0.19.0",
1420
- "@uibot/creation-kit@0.19.0",
1421
- "@uibot/web-preview@0.19.0"
1447
+ "@uibot/contracts@0.20.0",
1448
+ "@uibot/creation-kit@0.20.0",
1449
+ "@uibot/web-preview@0.20.0"
1422
1450
  ]
1423
1451
  },
1424
1452
  {
@@ -1438,9 +1466,9 @@
1438
1466
  ],
1439
1467
  "dependencies": [
1440
1468
  "react@19.3.0",
1441
- "@uibot/contracts@0.19.0",
1442
- "@uibot/creation-kit@0.19.0",
1443
- "@uibot/web-preview@0.19.0"
1469
+ "@uibot/contracts@0.20.0",
1470
+ "@uibot/creation-kit@0.20.0",
1471
+ "@uibot/web-preview@0.20.0"
1444
1472
  ]
1445
1473
  },
1446
1474
  {
@@ -1450,7 +1478,7 @@
1450
1478
  "registryDependencies": [],
1451
1479
  "dependencies": [
1452
1480
  "react@19.3.0",
1453
- "@uibot/renderer-react@0.19.0"
1481
+ "@uibot/renderer-react@0.20.0"
1454
1482
  ]
1455
1483
  },
1456
1484
  {
@@ -1468,7 +1496,7 @@
1468
1496
  ],
1469
1497
  "dependencies": [
1470
1498
  "react@19.3.0",
1471
- "@uibot/renderer-react@0.19.0",
1499
+ "@uibot/renderer-react@0.20.0",
1472
1500
  "cmdk@1.1.1",
1473
1501
  "date-fns@4.4.0",
1474
1502
  "lucide-react@1.56.0",
@@ -1485,7 +1513,7 @@
1485
1513
  ],
1486
1514
  "dependencies": [
1487
1515
  "react@19.3.0",
1488
- "@uibot/renderer-react@0.19.0"
1516
+ "@uibot/renderer-react@0.20.0"
1489
1517
  ]
1490
1518
  },
1491
1519
  {
@@ -1499,7 +1527,7 @@
1499
1527
  ],
1500
1528
  "dependencies": [
1501
1529
  "react@19.3.0",
1502
- "@uibot/renderer-react@0.19.0"
1530
+ "@uibot/renderer-react@0.20.0"
1503
1531
  ]
1504
1532
  },
1505
1533
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uibot/registry",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@uibot/contracts": "^0.19.0"
34
+ "@uibot/contracts": "^0.20.0"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "rm -rf dist tsconfig.tsbuildinfo && bun build --minify ./src/index.ts ./src/resources.ts --outdir ./dist --format esm --target bun && bun x tsc -b",