@uibot/registry 0.19.0 → 0.22.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 (70) hide show
  1. package/dist/component-replacement.d.ts +10 -0
  2. package/dist/index.d.ts +5 -0
  3. package/dist/index.js +2117 -12
  4. package/dist/materialize-templates.d.ts +28 -0
  5. package/dist/materialize.d.ts +63 -0
  6. package/dist/resources.d.ts +5 -0
  7. package/dist/resources.js +2108 -3
  8. package/dist/shadcn/r/admin-apps.json +1 -1
  9. package/dist/shadcn/r/admin-chats.json +1 -1
  10. package/dist/shadcn/r/admin-settings-account.json +1 -1
  11. package/dist/shadcn/r/admin-settings-appearance.json +1 -1
  12. package/dist/shadcn/r/admin-settings-display.json +1 -1
  13. package/dist/shadcn/r/admin-settings-notifications.json +1 -1
  14. package/dist/shadcn/r/admin-settings-profile.json +1 -1
  15. package/dist/shadcn/r/admin-settings.json +1 -1
  16. package/dist/shadcn/r/admin-shell.json +16 -3
  17. package/dist/shadcn/r/admin-tasks.json +1 -1
  18. package/dist/shadcn/r/admin-users.json +1 -1
  19. package/dist/shadcn/r/agent-run-console.json +64 -0
  20. package/dist/shadcn/r/auth-minimal.json +59 -0
  21. package/dist/shadcn/r/billing-overview.json +66 -0
  22. package/dist/shadcn/r/billing-usage-ledger.json +66 -0
  23. package/dist/shadcn/r/charts.json +44 -17
  24. package/dist/shadcn/r/chat-workspace.json +1 -1
  25. package/dist/shadcn/r/collection-cell-editor.json +1 -1
  26. package/dist/shadcn/r/collection-kanban.json +134 -0
  27. package/dist/shadcn/r/collection-panel-drawer.json +1 -1
  28. package/dist/shadcn/r/collection-record-menu.json +1 -1
  29. package/dist/shadcn/r/collection-shared.json +1 -1
  30. package/dist/shadcn/r/commerce-workspace.json +1 -1
  31. package/dist/shadcn/r/console-billing.json +1 -1
  32. package/dist/shadcn/r/console-page.json +14 -14
  33. package/dist/shadcn/r/console-shell.json +2 -2
  34. package/dist/shadcn/r/creation-html-generation.json +2 -2
  35. package/dist/shadcn/r/creation-reference-generation.json +2 -2
  36. package/dist/shadcn/r/creation-revision-export.json +2 -2
  37. package/dist/shadcn/r/creation-shared.json +2 -2
  38. package/dist/shadcn/r/creation-variant-compare.json +3 -3
  39. package/dist/shadcn/r/creation-workspace.json +3 -3
  40. package/dist/shadcn/r/crm-workspace.json +1 -1
  41. package/dist/shadcn/r/dashboard-01.json +78 -0
  42. package/dist/shadcn/r/dashboard.json +113 -3
  43. package/dist/shadcn/r/data-crud-gallery.json +66 -0
  44. package/dist/shadcn/r/data-crud-kanban.json +66 -0
  45. package/dist/shadcn/r/data-crud-master-detail.json +66 -0
  46. package/dist/shadcn/r/data-crud-table.json +66 -0
  47. package/dist/shadcn/r/data-table.json +120 -10
  48. package/dist/shadcn/r/data.json +9 -2
  49. package/dist/shadcn/r/document-assistant.json +1 -1
  50. package/dist/shadcn/r/document-workspace.json +1 -1
  51. package/dist/shadcn/r/drilldown-menu.json +1 -1
  52. package/dist/shadcn/r/education-workspace.json +1 -1
  53. package/dist/shadcn/r/feedback.json +15 -2
  54. package/dist/shadcn/r/form.json +1 -1
  55. package/dist/shadcn/r/launch-site.json +72 -0
  56. package/dist/shadcn/r/layout.json +57 -22
  57. package/dist/shadcn/r/nav.json +38 -10
  58. package/dist/shadcn/r/onboarding-checklist.json +63 -0
  59. package/dist/shadcn/r/onboarding-wizard.json +66 -0
  60. package/dist/shadcn/r/prompt-eval-workbench.json +65 -0
  61. package/dist/shadcn/r/record-master-detail.json +132 -0
  62. package/dist/shadcn/r/shadcn-admin.json +1 -1
  63. package/dist/shadcn/r/sidebar-primitives.json +1 -1
  64. package/dist/shadcn/r/workspace.json +9 -2
  65. package/dist/shadcn/registry.json +229 -27
  66. package/dist/solution-regions.d.ts +12 -2
  67. package/dist/spec-blueprint.d.ts +11 -0
  68. package/dist/spec-patch.d.ts +10 -0
  69. package/dist/variant-swap.d.ts +22 -0
  70. package/package.json +2 -2
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "auth-minimal",
4
+ "type": "registry:block",
5
+ "description": "Minimal card sign in: shared Admin forms, native validation and host-owned authentication.",
6
+ "registryDependencies": [
7
+ "@uibot/data",
8
+ "@uibot/feedback",
9
+ "@uibot/field",
10
+ "@uibot/form",
11
+ "@uibot/layout"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "lib/uibot/templates/auth-minimal.uibot.yaml",
16
+ "target": "lib/uibot/templates/auth-minimal.uibot.yaml",
17
+ "content": "version: \"2.0\"\npages:\n - id: auth-minimal-login\n path: /auth-minimal-login\n title: Login\n state:\n saving: false\n currentPath: /auth-minimal-login\n notice: \"\"\n showSso: false\n blocks:\n - type: Box\n props:\n className: min-h-dvh items-center justify-center bg-muted/40 px-6 py-12\n gap: md\n align: center\n justify: center\n children:\n - type: Card\n props:\n className: w-full max-w-sm\n title: Login\n description: Enter your email and password below to log into your account.\n children:\n - type: Form\n props:\n label: Login\n pending:\n _state: saving\n idempotent: true\n children:\n - type: Field\n props:\n name: email\n label: Email\n kind: email\n required: true\n - type: Field\n props:\n name: password\n label: Password\n kind: password\n required: true\n - type: Form.Submit\n props:\n label: Login\n full: true\n disabled: false\n events:\n onSubmit:\n - action: SetState\n params:\n path: notice\n value: 本地校验完成,未执行认证、发信或密码变更。Local validation only; no authentication, email or\n credential change occurred.\n - type: Paragraph\n props:\n text:\n _state: notice\n - type: Button\n visible:\n _state: showSso\n props:\n label: 企业登录 / Enterprise sign in\n variant: outline\n events:\n onClick:\n - action: SetState\n params:\n path: notice\n value: 企业身份服务需由宿主接入。Connect your host identity provider.\n",
18
+ "type": "registry:lib"
19
+ },
20
+ {
21
+ "path": "lib/uibot/templates/auth-minimal.uibot.json",
22
+ "target": "lib/uibot/templates/auth-minimal.uibot.json",
23
+ "content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"auth-minimal\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"auth-minimal.uibot.yaml\",\n \"contract\": {\n \"name\": \"auth-minimal\",\n \"description\": \"Minimal card sign in: shared Admin forms, native validation and host-owned authentication.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"auth-minimal\",\n \"极简卡片登录\",\n \"Minimal card sign in\",\n \"auth\",\n \"login\"\n ],\n \"composedFrom\": [\n \"Box\",\n \"Card\",\n \"Form\",\n \"Field\",\n \"Form.Submit\",\n \"Paragraph\",\n \"Button\"\n ]\n }\n }\n}\n",
24
+ "type": "registry:lib"
25
+ }
26
+ ],
27
+ "meta": {
28
+ "uibot": {
29
+ "schema": "uibot.registry.item.v1",
30
+ "item": "auth-minimal",
31
+ "channel": "public",
32
+ "template": {
33
+ "file": "auth-minimal.uibot.yaml",
34
+ "contract": {
35
+ "name": "auth-minimal",
36
+ "description": "Minimal card sign in: shared Admin forms, native validation and host-owned authentication.",
37
+ "level": "L4",
38
+ "category": "page",
39
+ "keywords": [
40
+ "auth-minimal",
41
+ "极简卡片登录",
42
+ "Minimal card sign in",
43
+ "auth",
44
+ "login"
45
+ ],
46
+ "composedFrom": [
47
+ "Box",
48
+ "Card",
49
+ "Form",
50
+ "Field",
51
+ "Form.Submit",
52
+ "Paragraph",
53
+ "Button"
54
+ ]
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "billing-overview",
4
+ "type": "registry:block",
5
+ "description": "Brand-neutral SaaS billing page with annual/monthly toggle, seat & API quota KPIs, and Collection-backed invoice table.",
6
+ "registryDependencies": [
7
+ "@uibot/data",
8
+ "@uibot/data-table",
9
+ "@uibot/feedback",
10
+ "@uibot/form",
11
+ "@uibot/layout",
12
+ "@uibot/primitives"
13
+ ],
14
+ "files": [
15
+ {
16
+ "path": "lib/uibot/templates/billing-overview.uibot.yaml",
17
+ "target": "lib/uibot/templates/billing-overview.uibot.yaml",
18
+ "content": "version: \"2.0\"\ndata:\n entities:\n invoices:\n key: id\n version: version\n fields:\n id:\n type: string\n readOnly: true\n version:\n type: number\n readOnly: true\n period:\n type: string\n plan:\n type: string\n status:\n type: string\n amount:\n type: string\n seats:\n type: string\nconnections:\n - id: billing-db\n type: Collection\n entity: invoices\n mock:\n seed:\n - id: INV-2026-11\n period: Nov 2026\n plan: Team Pro\n status: paid\n amount: $149.00\n seats: 12 seats\n version: 1\n - id: INV-2026-10\n period: Oct 2026\n plan: Team Pro\n status: paid\n amount: $149.00\n seats: 12 seats\n version: 1\n - id: INV-2026-09\n period: Sep 2026\n plan: Growth\n status: pending\n amount: $79.00\n seats: 6 seats\n version: 1\npages:\n - id: billing\n path: /billing\n title: Subscription & Billing\n lifecycle:\n onMount:\n - action: Request\n params:\n connectionId: billing-db\n request:\n id: find-billing-invoices\n connectionId: billing-db\n payload:\n operation: Find\n responsePath: rows\n loadingPath: loading\n errorPath: uiError\n state:\n rows:\n - id: INV-2026-11\n period: Nov 2026\n plan: Team Pro\n status: paid\n amount: $149.00\n seats: 12 seats\n version: 1\n - id: INV-2026-10\n period: Oct 2026\n plan: Team Pro\n status: paid\n amount: $149.00\n seats: 12 seats\n version: 1\n - id: INV-2026-09\n period: Sep 2026\n plan: Growth\n status: pending\n amount: $79.00\n seats: 6 seats\n version: 1\n loading: false\n uiError: \"\"\n annualBilling: true\n statusFilter: all\n selectedInvoiceId: INV-2026-11\n notice: \"\"\n newPeriod: Dec 2026\n newPlan: Team Pro\n newAmount: $149.00\n computed:\n filteredInvoices:\n _filter:\n - _state: rows\n - _or:\n - _eq:\n - _state: statusFilter\n - all\n - _eq:\n - _item: status\n - _state: statusFilter\n activePlanPrice:\n _if:\n - _state: annualBilling\n - $119 / mo (billed annually)\n - $149 / mo (billed monthly)\n blocks:\n - id: billing-shell\n type: PageLayout\n props:\n title: Subscription & Billing\n appearance: admin\n routes:\n - label: Subscription & Billing\n href: /billing\n children:\n - id: billing-root\n type: Box\n props:\n className: mx-auto flex max-w-5xl flex-col gap-6 p-6\n children:\n - id: billing-header\n type: Box\n props:\n className: flex flex-wrap items-center justify-between gap-4\n children:\n - id: billing-title-group\n type: Box\n props:\n className: flex flex-col gap-1\n children:\n - id: billing-title\n type: Heading\n props:\n level: 1\n text: Subscription & billing\n - id: billing-subtitle\n type: Paragraph\n props:\n muted: true\n size: sm\n text: Manage your active plan, monitor monthly quotas, and review workspace\n invoices.\n - id: billing-cycle-switch\n type: Switch\n props:\n label: Annual billing (save 20%)\n checked:\n _bindState: annualBilling\n - id: billing-kpi-row\n type: Box\n props:\n className: grid gap-4 sm:grid-cols-3\n children:\n - id: billing-stat-plan\n type: Stat\n props:\n label: Current plan\n value: Team Pro\n description:\n _computed: activePlanPrice\n - id: billing-stat-seats\n type: Stat\n props:\n label: Active seats\n value: 12 / 20\n change: +2 this month\n trend: up\n - id: billing-stat-usage\n type: Stat\n props:\n label: API calls\n value: 84.2k / 100k\n change: 84% quota\n trend: up\n - id: billing-notice\n type: Alert\n visible:\n _not:\n _eq:\n - _state: notice\n - \"\"\n props:\n variant: default\n title: Billing notice\n description:\n _state: notice\n - id: billing-toolbar\n type: Box\n props:\n className: flex flex-wrap items-end justify-between gap-3\n children:\n - id: billing-status-filter\n type: Form.Select\n props:\n name: statusFilter\n label: Invoice status\n value:\n _bindState: statusFilter\n options:\n - value: all\n label: All invoices\n - value: paid\n label: Paid\n - value: pending\n label: Pending\n - value: overdue\n label: Overdue\n - id: billing-record-btn\n type: Button\n props:\n label: Issue demo invoice\n size: sm\n events:\n onClick:\n - action: Request\n params:\n connectionId: billing-db\n request:\n id: insert-billing-invoice\n connectionId: billing-db\n payload:\n operation: InsertOne\n data:\n period:\n _state: newPeriod\n plan:\n _state: newPlan\n status: pending\n amount:\n _state: newAmount\n seats: 12 seats\n loadingPath: loading\n errorPath: uiError\n onSuccess:\n - action: Request\n params:\n connectionId: billing-db\n request:\n id: find-billing-invoices\n connectionId: billing-db\n payload:\n operation: Find\n responsePath: rows\n loadingPath: loading\n errorPath: uiError\n - action: SetState\n params:\n path: notice\n value: Recorded demo invoice in local Collection. Real payment actions require\n host billing integration.\n - id: billing-invoices-table\n type: DataTable\n props:\n label: Invoices\n rowKey: id\n searchable: true\n searchPlaceholder: Search invoices…\n searchKeys:\n - id\n - period\n - plan\n - status\n columns:\n - key: id\n label: Invoice ID\n - key: period\n label: Billing period\n - key: plan\n label: Plan\n - key: seats\n label: Seats\n - key: status\n label: Status\n - key: amount\n label: Amount\n rows:\n _computed: filteredInvoices\n",
19
+ "type": "registry:lib"
20
+ },
21
+ {
22
+ "path": "lib/uibot/templates/billing-overview.uibot.json",
23
+ "target": "lib/uibot/templates/billing-overview.uibot.json",
24
+ "content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"billing-overview\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"billing-overview.uibot.yaml\",\n \"contract\": {\n \"name\": \"billing-overview\",\n \"description\": \"Brand-neutral SaaS billing page with annual/monthly toggle, seat & API quota KPIs, and Collection-backed invoice table.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"billing-overview\",\n \"SaaS 订阅与账单总览\",\n \"SaaS billing overview\",\n \"billing\",\n \"plans\",\n \"subscriptions\",\n \"usage\",\n \"invoices\"\n ],\n \"composedFrom\": [\n \"PageLayout\",\n \"Box\",\n \"Heading\",\n \"Paragraph\",\n \"Switch\",\n \"Stat\",\n \"Alert\",\n \"Form.Select\",\n \"Button\",\n \"DataTable\"\n ]\n }\n }\n}\n",
25
+ "type": "registry:lib"
26
+ }
27
+ ],
28
+ "meta": {
29
+ "uibot": {
30
+ "schema": "uibot.registry.item.v1",
31
+ "item": "billing-overview",
32
+ "channel": "public",
33
+ "template": {
34
+ "file": "billing-overview.uibot.yaml",
35
+ "contract": {
36
+ "name": "billing-overview",
37
+ "description": "Brand-neutral SaaS billing page with annual/monthly toggle, seat & API quota KPIs, and Collection-backed invoice table.",
38
+ "level": "L4",
39
+ "category": "page",
40
+ "keywords": [
41
+ "billing-overview",
42
+ "SaaS 订阅与账单总览",
43
+ "SaaS billing overview",
44
+ "billing",
45
+ "plans",
46
+ "subscriptions",
47
+ "usage",
48
+ "invoices"
49
+ ],
50
+ "composedFrom": [
51
+ "PageLayout",
52
+ "Box",
53
+ "Heading",
54
+ "Paragraph",
55
+ "Switch",
56
+ "Stat",
57
+ "Alert",
58
+ "Form.Select",
59
+ "Button",
60
+ "DataTable"
61
+ ]
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "billing-usage-ledger",
4
+ "type": "registry:block",
5
+ "description": "Metered spend chart paired with a master-detail invoice ledger, hot-swappable with billing-overview over the same invoices entity.",
6
+ "registryDependencies": [
7
+ "@uibot/dashboard",
8
+ "@uibot/data",
9
+ "@uibot/feedback",
10
+ "@uibot/form",
11
+ "@uibot/layout",
12
+ "@uibot/primitives",
13
+ "@uibot/record-master-detail"
14
+ ],
15
+ "files": [
16
+ {
17
+ "path": "lib/uibot/templates/billing-usage-ledger.uibot.yaml",
18
+ "target": "lib/uibot/templates/billing-usage-ledger.uibot.yaml",
19
+ "content": "version: \"2.0\"\ndata:\n entities:\n invoices:\n key: id\n version: version\n fields:\n id:\n type: string\n readOnly: true\n version:\n type: number\n readOnly: true\n period:\n type: string\n plan:\n type: string\n status:\n type: string\n amount:\n type: string\n seats:\n type: string\nconnections:\n - id: billing-db\n type: Collection\n entity: invoices\n mock:\n seed:\n - id: INV-2026-11\n period: Nov 2026\n plan: Team Pro\n status: paid\n amount: $149.00\n seats: 12 seats\n version: 1\n - id: INV-2026-10\n period: Oct 2026\n plan: Team Pro\n status: paid\n amount: $149.00\n seats: 12 seats\n version: 1\n - id: INV-2026-09\n period: Sep 2026\n plan: Growth\n status: pending\n amount: $79.00\n seats: 6 seats\n version: 1\npages:\n - id: billing\n path: /billing\n title: Usage Metering & Invoice Ledger\n lifecycle:\n onMount:\n - action: Request\n params:\n connectionId: billing-db\n request:\n id: find-billing-invoices\n connectionId: billing-db\n payload:\n operation: Find\n responsePath: rows\n loadingPath: loading\n errorPath: uiError\n state:\n rows:\n - id: INV-2026-11\n period: Nov 2026\n plan: Team Pro\n status: paid\n amount: $149.00\n seats: 12 seats\n version: 1\n - id: INV-2026-10\n period: Oct 2026\n plan: Team Pro\n status: paid\n amount: $149.00\n seats: 12 seats\n version: 1\n - id: INV-2026-09\n period: Sep 2026\n plan: Growth\n status: pending\n amount: $79.00\n seats: 6 seats\n version: 1\n loading: false\n uiError: \"\"\n annualBilling: true\n statusFilter: all\n selectedInvoiceId: INV-2026-11\n notice: \"\"\n newPeriod: Dec 2026\n newPlan: Team Pro\n newAmount: $149.00\n computed:\n filteredInvoices:\n _filter:\n - _state: rows\n - _or:\n - _eq:\n - _state: statusFilter\n - all\n - _eq:\n - _item: status\n - _state: statusFilter\n activePlanPrice:\n _if:\n - _state: annualBilling\n - $119 / mo (billed annually)\n - $149 / mo (billed monthly)\n blocks:\n - id: billing-shell\n type: PageLayout\n props:\n title: Usage Metering & Invoice Ledger\n appearance: admin\n routes:\n - label: Usage Metering & Invoice Ledger\n href: /billing\n children:\n - id: billing-root\n type: Box\n props:\n className: mx-auto flex max-w-5xl flex-col gap-6 p-6\n children:\n - id: billing-header\n type: Box\n props:\n className: flex flex-wrap items-center justify-between gap-4\n children:\n - id: billing-title-group\n type: Box\n props:\n className: flex flex-col gap-1\n children:\n - id: billing-title\n type: Heading\n props:\n level: 1\n text: Usage metering & invoice ledger\n - id: billing-subtitle\n type: Paragraph\n props:\n muted: true\n size: sm\n text: Track metered consumption by month and inspect individual invoice records.\n - id: billing-cycle-switch\n type: Switch\n props:\n label: Annual billing\n checked:\n _bindState: annualBilling\n - id: billing-usage-chart\n type: BarChart\n props:\n label: Monthly metered spend\n prefix: $\n height: 180\n data:\n - label: Jul\n value: 79\n - label: Aug\n value: 96\n - label: Sep\n value: 112\n - label: Oct\n value: 149\n - label: Nov\n value: 149\n - id: billing-toolbar\n type: Box\n props:\n className: flex flex-wrap items-end justify-between gap-3\n children:\n - id: billing-status-filter\n type: Form.Select\n props:\n name: statusFilter\n label: Filter by status\n value:\n _bindState: statusFilter\n options:\n - value: all\n label: All invoices\n - value: paid\n label: Paid\n - value: pending\n label: Pending\n - value: overdue\n label: Overdue\n - id: billing-record-btn\n type: Button\n props:\n label: Issue demo invoice\n size: sm\n events:\n onClick:\n - action: Request\n params:\n connectionId: billing-db\n request:\n id: insert-billing-invoice\n connectionId: billing-db\n payload:\n operation: InsertOne\n data:\n period:\n _state: newPeriod\n plan:\n _state: newPlan\n status: pending\n amount:\n _state: newAmount\n seats: 12 seats\n loadingPath: loading\n errorPath: uiError\n onSuccess:\n - action: Request\n params:\n connectionId: billing-db\n request:\n id: find-billing-invoices\n connectionId: billing-db\n payload:\n operation: Find\n responsePath: rows\n loadingPath: loading\n errorPath: uiError\n - id: billing-ledger-master-detail\n type: RecordMasterDetail\n props:\n label: Invoice ledger\n rows:\n _computed: filteredInvoices\n selectedId:\n _state: selectedInvoiceId\n titleField: id\n subtitleField: period\n badgeField: status\n fields:\n - key: plan\n label: Plan\n - key: amount\n label: Amount\n - key: seats\n label: Seats\n - key: status\n label: Status\n events:\n onSelect:\n - action: SetState\n params:\n path: selectedInvoiceId\n value:\n _event: id\n",
20
+ "type": "registry:lib"
21
+ },
22
+ {
23
+ "path": "lib/uibot/templates/billing-usage-ledger.uibot.json",
24
+ "target": "lib/uibot/templates/billing-usage-ledger.uibot.json",
25
+ "content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"billing-usage-ledger\",\n \"channel\": \"public\",\n \"template\": {\n \"file\": \"billing-usage-ledger.uibot.yaml\",\n \"contract\": {\n \"name\": \"billing-usage-ledger\",\n \"description\": \"Metered spend chart paired with a master-detail invoice ledger, hot-swappable with billing-overview over the same invoices entity.\",\n \"level\": \"L4\",\n \"category\": \"page\",\n \"keywords\": [\n \"billing-usage-ledger\",\n \"用量计量与明细账单\",\n \"Usage metering & invoice ledger\",\n \"billing\",\n \"analytics\",\n \"usage\",\n \"invoices\",\n \"metrics\"\n ],\n \"composedFrom\": [\n \"PageLayout\",\n \"Box\",\n \"Heading\",\n \"Paragraph\",\n \"Switch\",\n \"BarChart\",\n \"Form.Select\",\n \"Button\",\n \"RecordMasterDetail\"\n ]\n }\n }\n}\n",
26
+ "type": "registry:lib"
27
+ }
28
+ ],
29
+ "meta": {
30
+ "uibot": {
31
+ "schema": "uibot.registry.item.v1",
32
+ "item": "billing-usage-ledger",
33
+ "channel": "public",
34
+ "template": {
35
+ "file": "billing-usage-ledger.uibot.yaml",
36
+ "contract": {
37
+ "name": "billing-usage-ledger",
38
+ "description": "Metered spend chart paired with a master-detail invoice ledger, hot-swappable with billing-overview over the same invoices entity.",
39
+ "level": "L4",
40
+ "category": "page",
41
+ "keywords": [
42
+ "billing-usage-ledger",
43
+ "用量计量与明细账单",
44
+ "Usage metering & invoice ledger",
45
+ "billing",
46
+ "analytics",
47
+ "usage",
48
+ "invoices",
49
+ "metrics"
50
+ ],
51
+ "composedFrom": [
52
+ "PageLayout",
53
+ "Box",
54
+ "Heading",
55
+ "Paragraph",
56
+ "Switch",
57
+ "BarChart",
58
+ "Form.Select",
59
+ "Button",
60
+ "RecordMasterDetail"
61
+ ]
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
3
  "name": "charts",
4
4
  "type": "registry:ui",
5
- "description": "Pure-SVG line / area chart with no third-party dependency. Draws one polyline per series on a shared vertical scale. Alias: LineChart.",
5
+ "description": "SVG line/area chart: shared axes, pointer/keyboard values and crosshair. Alias: LineChart.",
6
6
  "dependencies": [
7
7
  "react@19.3.0"
8
8
  ],
@@ -13,13 +13,13 @@
13
13
  {
14
14
  "path": "components/uibot/charts.tsx",
15
15
  "target": "components/uibot/charts.tsx",
16
- "content": "import type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Series {\n name?: string;\n points: number[];\n area?: boolean;\n}\n\nfunction parseSeries(raw: unknown): Series[] {\n if (!Array.isArray(raw)) return [];\n return raw\n .map((s) => {\n if (!s || typeof s !== \"object\") return null;\n const rec = s as Record<string, unknown>;\n const points = Array.isArray(rec[\"points\"])\n ? rec[\"points\"].map((p) => (typeof p === \"number\" ? p : Number(p) || 0))\n : [];\n return {\n name: typeof rec[\"name\"] === \"string\" ? rec[\"name\"] : undefined,\n points,\n area: rec[\"area\"] === true,\n } as Series;\n })\n .filter((s): s is Series => s !== null && s.points.length > 0);\n}\n\n// Padding reserved around the plot so strokes are not clipped at the edges.\nconst PAD = 8;\n\n// Map a series' points into an SVG polyline `points` string. min/max are taken\n// across every series so all lines share one vertical scale.\nfunction toPolyline(points: number[], w: number, h: number, min: number, max: number): string {\n const range = max - min || 1;\n const innerW = w - PAD * 2;\n const innerH = h - PAD * 2;\n const step = points.length > 1 ? innerW / (points.length - 1) : 0;\n return points\n .map((value, i) => {\n const x = PAD + step * i;\n const y = PAD + innerH - ((value - min) / range) * innerH;\n return `${x.toFixed(1)},${y.toFixed(1)}`;\n })\n .join(\" \");\n}\n\n// A small palette of theme-token colours, cycled per series.\nconst STROKE = [\"text-primary\", \"text-sky-500\", \"text-emerald-500\", \"text-amber-500\"];\n\n/**\n * Pure-SVG line / area chart. No third-party charting dependency (keeps the\n * package peerDeps-only). Intended for small dogfood datasets (≤ ~200 points\n * per series); larger inputs produce heavy DOM.\n */\nexport const TrendChart: RendererComponent = (props) => {\n const series = parseSeries(props[\"series\"]);\n const title = typeof props[\"title\"] === \"string\" ? props[\"title\"] : \"\";\n const w = typeof props[\"width\"] === \"number\" ? props[\"width\"] : 480;\n const h = typeof props[\"height\"] === \"number\" ? props[\"height\"] : 160;\n\n const all = series.flatMap((s) => s.points);\n const min = all.length ? Math.min(...all) : 0;\n const max = all.length ? Math.max(...all) : 1;\n\n return (\n <div\n className=\"uibot-trendchart bg-card text-card-foreground rounded-xl border p-4 shadow-sm\"\n data-uibot-type=\"TrendChart\"\n >\n {title && <h3 className=\"mb-2 text-sm font-medium\">{title}</h3>}\n {series.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-muted-foreground\">No data</p>\n ) : (\n <svg\n viewBox={`0 0 ${w} ${h}`}\n className=\"h-auto w-full\"\n role=\"img\"\n aria-label={title || \"Trend chart\"}\n preserveAspectRatio=\"none\"\n >\n {/* baseline grid lines */}\n {[0, 0.25, 0.5, 0.75, 1].map((t) => {\n const y = PAD + (h - PAD * 2) * t;\n return (\n <line\n key={t}\n x1={PAD}\n x2={w - PAD}\n y1={y}\n y2={y}\n className=\"text-border\"\n stroke=\"currentColor\"\n strokeWidth={0.5}\n />\n );\n })}\n {series.map((s, i) => {\n const pts = toPolyline(s.points, w, h, min, max);\n const colour = STROKE[i % STROKE.length];\n return (\n <g key={i} className={colour}>\n {s.area && (\n <polygon\n fill=\"currentColor\"\n fillOpacity={0.12}\n points={`${PAD},${h - PAD} ${pts} ${w - PAD},${h - PAD}`}\n />\n )}\n <polyline\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n points={pts}\n />\n </g>\n );\n })}\n </svg>\n )}\n {series.some((s) => s.name) && (\n <ul className=\"mt-3 flex flex-wrap gap-4\">\n {series.map((s, i) => (\n <li key={i} className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n <span className={cn(\"h-2 w-2 rounded-full bg-current\", STROKE[i % STROKE.length])} />\n {s.name ?? `Series ${i + 1}`}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n};\n\n/** Alias of {@link TrendChart} for specs that prefer the LineChart name. */\nexport const LineChart = TrendChart;\n",
16
+ "content": "import { useId, useState, type KeyboardEvent, type PointerEvent } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\n\ninterface Series {\n name?: string;\n points: number[];\n area?: boolean;\n}\nfunction parseSeries(raw: unknown): Series[] {\n if (!Array.isArray(raw)) return [];\n return raw\n .map((s) => {\n if (!s || typeof s !== \"object\") return null;\n const rec = s as Record<string, unknown>;\n const points = Array.isArray(rec.points)\n ? rec.points.map((p) => {\n const value = Number(p);\n return Number.isFinite(value) ? value : 0;\n })\n : [];\n return {\n name: typeof rec.name === \"string\" ? rec.name : undefined,\n points,\n area: rec.area === true,\n } as Series;\n })\n .filter((s): s is Series => s !== null && s.points.length > 0);\n}\nconst PAD = 8;\nconst STROKE = [\"text-primary\", \"text-sky-500\", \"text-emerald-500\", \"text-amber-500\"];\n\n/** Small SVG charts share one time axis and vertical scale. Inspection is local. */\nfunction TrendChartView({ props }: { props: Record<string, unknown> }) {\n const [inspection, setInspection] = useState<{ index: number; keyboard: boolean } | null>(null);\n const tooltipId = useId();\n const instructionsId = useId();\n const series = parseSeries(props.series);\n const title = typeof props.title === \"string\" ? props.title : \"\";\n const w = typeof props.width === \"number\" ? Math.max(32, props.width) : 480;\n const h = typeof props.height === \"number\" ? Math.max(32, props.height) : 160;\n const labels = Array.isArray(props.labels) ? props.labels.map(String) : [];\n const plain = props.variant === \"plain\";\n const count = Math.max(0, ...series.map((s) => s.points.length));\n const all = series.flatMap((s) => s.points);\n const min = all.length ? Math.min(...all) : 0;\n const max = all.length ? Math.max(...all) : 1;\n const pointX = (i: number) => PAD + (count > 1 ? i / (count - 1) : 0) * (w - PAD * 2);\n const pointY = (value: number) => PAD + (h - PAD * 2) * (1 - (value - min) / (max - min || 1));\n const index = inspection?.index ?? null;\n const inspectPointer = (event: PointerEvent<SVGSVGElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n if (!rect.width) return;\n const position = (((event.clientX - rect.left) / rect.width) * w - PAD) / (w - PAD * 2);\n setInspection({\n index: Math.max(0, Math.min(count - 1, Math.round(position * (count - 1)))),\n keyboard: false,\n });\n };\n const inspectKey = (event: KeyboardEvent<SVGSVGElement>) => {\n if (event.key === \"Escape\") {\n setInspection(null);\n return;\n }\n let next: number;\n if (event.key === \"Home\") next = 0;\n else if (event.key === \"End\") next = count - 1;\n else if (event.key === \"ArrowLeft\") next = (index ?? 1) - 1;\n else if (event.key === \"ArrowRight\") next = (index ?? -1) + 1;\n else return;\n event.preventDefault();\n setInspection({ index: Math.max(0, Math.min(count - 1, next)), keyboard: true });\n };\n return (\n <div\n className={cn(\n \"uibot-trendchart min-w-0\",\n !plain && \"bg-card text-card-foreground rounded-xl border p-4 shadow-sm\",\n )}\n data-uibot-type=\"TrendChart\"\n >\n {title && <h3 className={plain ? \"sr-only\" : \"mb-2 text-sm font-medium\"}>{title}</h3>}\n {series.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-muted-foreground\">No data</p>\n ) : (\n <div className=\"relative\">\n <span id={instructionsId} className=\"sr-only\">\n Use Left and Right arrows to inspect values, Home and End to jump, and Escape to\n dismiss.\n </span>\n <svg\n viewBox={`0 0 ${w} ${h}`}\n className=\"h-auto w-full rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n style={plain ? { height: h } : undefined}\n role=\"img\"\n aria-label={title || \"Trend chart\"}\n preserveAspectRatio=\"none\"\n tabIndex={0}\n onPointerMove={inspectPointer}\n onPointerDown={inspectPointer}\n onPointerLeave={() => {\n if (!inspection?.keyboard) setInspection(null);\n }}\n onPointerCancel={() => setInspection(null)}\n onFocus={() => setInspection((current) => current ?? { index: 0, keyboard: true })}\n onBlur={() => setInspection(null)}\n onKeyDown={inspectKey}\n aria-describedby={`${instructionsId}${index === null ? \"\" : ` ${tooltipId}`}`}\n >\n {[0, 0.25, 0.5, 0.75, 1].map((t) => (\n <line\n key={t}\n x1={PAD}\n x2={w - PAD}\n y1={PAD + (h - PAD * 2) * t}\n y2={PAD + (h - PAD * 2) * t}\n className=\"text-border\"\n stroke=\"currentColor\"\n strokeWidth={0.5}\n />\n ))}\n {series.map((s, i) => {\n const pts = s.points\n .map((value, j) => `${pointX(j).toFixed(1)},${pointY(value).toFixed(1)}`)\n .join(\" \");\n return (\n <g key={i} className={STROKE[i % STROKE.length]}>\n {s.area && (\n <polygon\n fill=\"currentColor\"\n fillOpacity={0.12}\n points={`${PAD},${h - PAD} ${pts} ${pointX(s.points.length - 1)},${h - PAD}`}\n />\n )}\n <polyline\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n points={pts}\n />\n </g>\n );\n })}\n {index !== null && (\n <g aria-hidden=\"true\" pointerEvents=\"none\">\n <line\n x1={pointX(index)}\n x2={pointX(index)}\n y1={PAD}\n y2={h - PAD}\n className=\"text-muted-foreground\"\n stroke=\"currentColor\"\n strokeWidth={1}\n strokeDasharray=\"4 4\"\n vectorEffect=\"non-scaling-stroke\"\n />\n {series.map((s, i) =>\n s.points[index] === undefined ? null : (\n <circle\n key={i}\n data-chart-point=\"active\"\n cx={pointX(index)}\n cy={pointY(s.points[index] ?? 0)}\n r={4}\n className={STROKE[i % STROKE.length]}\n fill=\"currentColor\"\n stroke=\"var(--background)\"\n strokeWidth={2}\n vectorEffect=\"non-scaling-stroke\"\n />\n ),\n )}\n </g>\n )}\n </svg>\n {index !== null && (\n <div\n id={tooltipId}\n role=\"tooltip\"\n aria-live={inspection?.keyboard ? \"polite\" : \"off\"}\n className=\"pointer-events-none absolute top-3 z-10 min-w-36 rounded-lg border bg-popover px-3 py-2.5 text-xs text-popover-foreground shadow-md\"\n style={{\n ...(index < count / 2 ? { right: 12 } : { left: 12 }),\n maxWidth: \"calc(100% - 24px)\",\n }}\n >\n <div className=\"mb-2 font-medium\">{labels[index] ?? `Point ${index + 1}`}</div>\n <div className=\"space-y-1.5\">\n {series.map((s, i) =>\n s.points[index] === undefined ? null : (\n <div key={i} className=\"flex items-center gap-2\">\n <span\n className={cn(\n \"h-2 w-2 shrink-0 rounded-sm bg-current\",\n STROKE[i % STROKE.length],\n )}\n aria-hidden=\"true\"\n />\n <span className=\"text-muted-foreground\">{s.name ?? `Series ${i + 1}`}</span>\n <span className=\"ms-auto ps-3 font-medium tabular-nums\">\n {s.points[index]?.toLocaleString(\"en-US\")}\n </span>\n </div>\n ),\n )}\n </div>\n </div>\n )}\n </div>\n )}\n {labels.length > 0 && series.length > 0 && (\n <div\n className=\"mt-2 flex justify-between gap-2 text-xs text-muted-foreground\"\n aria-hidden=\"true\"\n >\n {labels\n .filter(\n (_, i) =>\n i < count &&\n (i === 0 || i === count - 1 || i % Math.max(1, Math.ceil(count / 5)) === 0),\n )\n .map((label, i) => (\n <span key={i}>{label}</span>\n ))}\n </div>\n )}\n {series.some((s) => s.name) && (\n <ul className=\"mt-3 flex flex-wrap gap-4\">\n {series.map((s, i) => (\n <li key={i} className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n <span className={cn(\"h-2 w-2 rounded-full bg-current\", STROKE[i % STROKE.length])} />\n {s.name ?? `Series ${i + 1}`}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\nexport const TrendChart: RendererComponent = (props) => (\n <TrendChartView key={JSON.stringify([props.series, props.labels])} props={props} />\n);\n/** Alias for specs that prefer the LineChart name. */\nexport const LineChart = TrendChart;\n",
17
17
  "type": "registry:ui"
18
18
  },
19
19
  {
20
20
  "path": "components/uibot/charts.uibot.json",
21
21
  "target": "components/uibot/charts.uibot.json",
22
- "content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"charts\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"LineChart\",\n \"export\": \"LineChart\",\n \"module\": \"charts.tsx\",\n \"catalog\": {\n \"name\": \"LineChart\",\n \"description\": \"Alias of TrendChart — pure-SVG multi-series line / area chart.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"chart\",\n \"line\",\n \"svg\"\n ],\n \"props\": {\n \"title\": {\n \"type\": \"string\"\n },\n \"series\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"points\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n },\n \"area\": {\n \"type\": \"boolean\"\n }\n }\n }\n },\n \"width\": {\n \"type\": \"integer\",\n \"default\": 480\n },\n \"height\": {\n \"type\": \"integer\",\n \"default\": 160\n }\n },\n \"usageScenarios\": [\n \"Same as TrendChart; use whichever name reads better in the spec\"\n ],\n \"constraints\": [\n \"Identical implementation to TrendChart\"\n ]\n }\n },\n {\n \"name\": \"TrendChart\",\n \"export\": \"TrendChart\",\n \"module\": \"charts.tsx\",\n \"catalog\": {\n \"name\": \"TrendChart\",\n \"description\": \"Pure-SVG line / area chart with no third-party dependency. Draws one polyline per series on a shared vertical scale. Alias: LineChart.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"chart\",\n \"trend\",\n \"line\",\n \"svg\"\n ],\n \"props\": {\n \"title\": {\n \"type\": \"string\"\n },\n \"series\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"points\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n },\n \"area\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n }\n },\n \"description\": \"[{name, points:number[], area?}]\"\n },\n \"labels\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Optional x-axis labels\"\n },\n \"width\": {\n \"type\": \"integer\",\n \"default\": 480\n },\n \"height\": {\n \"type\": \"integer\",\n \"default\": 160\n }\n },\n \"usageScenarios\": [\n \"Evolution score trend over versions\",\n \"Daily active users line chart\"\n ],\n \"constraints\": [\n \"Keep each series under ~200 points; larger inputs produce heavy SVG DOM\"\n ]\n }\n }\n ]\n}\n",
22
+ "content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"charts\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"LineChart\",\n \"export\": \"LineChart\",\n \"module\": \"charts.tsx\",\n \"catalog\": {\n \"name\": \"LineChart\",\n \"description\": \"Alias of TrendChart, including pointer/keyboard inspection.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"chart\",\n \"line\",\n \"svg\"\n ],\n \"props\": {\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"card\",\n \"plain\"\n ],\n \"default\": \"card\"\n },\n \"labels\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"series\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"points\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n },\n \"area\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n }\n }\n },\n \"width\": {\n \"type\": \"integer\",\n \"default\": 480\n },\n \"height\": {\n \"type\": \"integer\",\n \"default\": 160\n }\n },\n \"usageScenarios\": [\n \"Same as TrendChart; use whichever name reads better in the spec\"\n ],\n \"constraints\": [\n \"Same as TrendChart\"\n ]\n }\n },\n {\n \"name\": \"TrendChart\",\n \"export\": \"TrendChart\",\n \"module\": \"charts.tsx\",\n \"catalog\": {\n \"name\": \"TrendChart\",\n \"description\": \"SVG line/area chart: shared axes, pointer/keyboard values and crosshair. Alias: LineChart.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"chart\",\n \"trend\",\n \"line\",\n \"svg\"\n ],\n \"props\": {\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"card\",\n \"plain\"\n ],\n \"default\": \"card\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"series\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"points\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\"\n }\n },\n \"area\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n }\n }\n },\n \"labels\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"width\": {\n \"type\": \"integer\",\n \"default\": 480\n },\n \"height\": {\n \"type\": \"integer\",\n \"default\": 160\n }\n },\n \"usageScenarios\": [\n \"Evolution score trend over versions\",\n \"Daily active users line chart\"\n ],\n \"constraints\": [\n \"Max ~200 points/series\"\n ]\n }\n }\n ]\n}\n",
23
23
  "type": "registry:ui"
24
24
  }
25
25
  ],
@@ -27,6 +27,14 @@
27
27
  "category": "composite",
28
28
  "level": "L2",
29
29
  "props": {
30
+ "variant": {
31
+ "type": "string",
32
+ "enum": [
33
+ "card",
34
+ "plain"
35
+ ],
36
+ "default": "card"
37
+ },
30
38
  "title": {
31
39
  "type": "string"
32
40
  },
@@ -49,15 +57,13 @@
49
57
  "default": false
50
58
  }
51
59
  }
52
- },
53
- "description": "[{name, points:number[], area?}]"
60
+ }
54
61
  },
55
62
  "labels": {
56
63
  "type": "array",
57
64
  "items": {
58
65
  "type": "string"
59
- },
60
- "description": "Optional x-axis labels"
66
+ }
61
67
  },
62
68
  "width": {
63
69
  "type": "integer",
@@ -73,7 +79,7 @@
73
79
  "Daily active users line chart"
74
80
  ],
75
81
  "constraints": [
76
- "Keep each series under ~200 points; larger inputs produce heavy SVG DOM"
82
+ "Max ~200 points/series"
77
83
  ],
78
84
  "provides": [
79
85
  "TrendChart",
@@ -90,7 +96,7 @@
90
96
  "module": "charts.tsx",
91
97
  "catalog": {
92
98
  "name": "LineChart",
93
- "description": "Alias of TrendChart — pure-SVG multi-series line / area chart.",
99
+ "description": "Alias of TrendChart, including pointer/keyboard inspection.",
94
100
  "category": "composite",
95
101
  "level": "L2",
96
102
  "tags": [
@@ -99,6 +105,20 @@
99
105
  "svg"
100
106
  ],
101
107
  "props": {
108
+ "variant": {
109
+ "type": "string",
110
+ "enum": [
111
+ "card",
112
+ "plain"
113
+ ],
114
+ "default": "card"
115
+ },
116
+ "labels": {
117
+ "type": "array",
118
+ "items": {
119
+ "type": "string"
120
+ }
121
+ },
102
122
  "title": {
103
123
  "type": "string"
104
124
  },
@@ -117,7 +137,8 @@
117
137
  }
118
138
  },
119
139
  "area": {
120
- "type": "boolean"
140
+ "type": "boolean",
141
+ "default": false
121
142
  }
122
143
  }
123
144
  }
@@ -135,7 +156,7 @@
135
156
  "Same as TrendChart; use whichever name reads better in the spec"
136
157
  ],
137
158
  "constraints": [
138
- "Identical implementation to TrendChart"
159
+ "Same as TrendChart"
139
160
  ]
140
161
  }
141
162
  },
@@ -145,7 +166,7 @@
145
166
  "module": "charts.tsx",
146
167
  "catalog": {
147
168
  "name": "TrendChart",
148
- "description": "Pure-SVG line / area chart with no third-party dependency. Draws one polyline per series on a shared vertical scale. Alias: LineChart.",
169
+ "description": "SVG line/area chart: shared axes, pointer/keyboard values and crosshair. Alias: LineChart.",
149
170
  "category": "composite",
150
171
  "level": "L2",
151
172
  "tags": [
@@ -155,6 +176,14 @@
155
176
  "svg"
156
177
  ],
157
178
  "props": {
179
+ "variant": {
180
+ "type": "string",
181
+ "enum": [
182
+ "card",
183
+ "plain"
184
+ ],
185
+ "default": "card"
186
+ },
158
187
  "title": {
159
188
  "type": "string"
160
189
  },
@@ -177,15 +206,13 @@
177
206
  "default": false
178
207
  }
179
208
  }
180
- },
181
- "description": "[{name, points:number[], area?}]"
209
+ }
182
210
  },
183
211
  "labels": {
184
212
  "type": "array",
185
213
  "items": {
186
214
  "type": "string"
187
- },
188
- "description": "Optional x-axis labels"
215
+ }
189
216
  },
190
217
  "width": {
191
218
  "type": "integer",
@@ -201,7 +228,7 @@
201
228
  "Daily active users line chart"
202
229
  ],
203
230
  "constraints": [
204
- "Keep each series under ~200 points; larger inputs produce heavy SVG DOM"
231
+ "Max ~200 points/series"
205
232
  ]
206
233
  }
207
234
  }
@@ -5,7 +5,7 @@
5
5
  "description": "Interactive chat over a host-owned transport; optional isolated local demonstration.",
6
6
  "dependencies": [
7
7
  "react@19.3.0",
8
- "@uibot/ai-chat@0.19.0"
8
+ "@uibot/ai-chat@0.22.0"
9
9
  ],
10
10
  "registryDependencies": [
11
11
  "@uibot/uibot-base"
@@ -5,7 +5,7 @@
5
5
  "description": "Design-system cell editors for PagedCollectionGrid's renderCellEditor: text, number, long text, checkbox, single/multiple select, calendar dates (timestamps keep their time) and a searchable relation picker.",
6
6
  "dependencies": [
7
7
  "react@19.3.0",
8
- "@uibot/renderer-react@0.19.0",
8
+ "@uibot/renderer-react@0.22.0",
9
9
  "cmdk@1.1.1",
10
10
  "date-fns@4.4.0",
11
11
  "lucide-react@1.56.0",
@@ -0,0 +1,134 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "collection-kanban",
4
+ "type": "registry:ui",
5
+ "description": "Kanban.",
6
+ "dependencies": [
7
+ "react@19.3.0"
8
+ ],
9
+ "registryDependencies": [
10
+ "@uibot/uibot-base"
11
+ ],
12
+ "files": [
13
+ {
14
+ "path": "components/uibot/collection-kanban.tsx",
15
+ "target": "components/uibot/collection-kanban.tsx",
16
+ "content": "import { useId, useState } from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { emit, records, text } from \"./interaction\";\n\nexport interface KanbanLane {\n value: string;\n label: string;\n}\n\nexport function readKanbanLanes(\n rawLanes: unknown,\n rows: Record<string, unknown>[],\n groupBy: string,\n): KanbanLane[] {\n const seen = new Set<string>();\n const lanes: KanbanLane[] = [];\n for (const lane of records(rawLanes)) {\n const value = text(lane.value, text(lane.id));\n if (!value || seen.has(value)) continue;\n seen.add(value);\n lanes.push({ value, label: text(lane.label, text(lane.title, value)) });\n }\n for (const row of rows) {\n const value = text(row[groupBy]);\n if (!value || seen.has(value)) continue;\n seen.add(value);\n lanes.push({ value, label: value });\n }\n return lanes;\n}\n\nconst KANBAN_CSS = `\n.uibot-collection-kanban{container-type:inline-size;min-width:0;display:flex;flex-direction:column;gap:14px}\n.uibot-ck-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px}\n.uibot-ck-search{flex:1 1 220px;max-width:340px;min-height:38px;border:1px solid var(--border);border-radius:8px;padding:6px 12px;background:var(--card);color:var(--foreground);font:inherit}\n.uibot-ck-board{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;align-items:start}\n.uibot-ck-lane{display:flex;flex-direction:column;gap:10px;border:1px solid var(--border);border-radius:12px;background:var(--muted);padding:12px;min-height:160px}\n.uibot-ck-lane-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px;font-weight:600}\n.uibot-ck-count{font-size:12px;font-weight:500;padding:1px 8px;border-radius:999px;border:1px solid var(--border);background:var(--background);color:var(--muted-foreground)}\n.uibot-ck-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}\n.uibot-ck-card{border:1px solid var(--border);border-radius:10px;background:var(--card);color:var(--card-foreground);padding:12px;display:flex;flex-direction:column;gap:8px;box-shadow:0 1px 2px rgba(0,0,0,0.04)}\n.uibot-ck-card[data-selected=\"true\"]{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary)}\n.uibot-ck-card-btn{border:0;background:transparent;color:inherit;text-align:start;padding:0;cursor:pointer;font:inherit;display:flex;flex-direction:column;gap:4px}\n.uibot-ck-title{font-size:14px;font-weight:600;line-height:1.35}\n.uibot-ck-sub{font-size:12px;color:var(--muted-foreground);line-height:1.45}\n.uibot-ck-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}\n.uibot-ck-badge{font-size:11px;padding:2px 7px;border-radius:999px;background:var(--muted);color:var(--muted-foreground);border:1px solid var(--border)}\n.uibot-ck-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}\n.uibot-ck-move{font-size:11px;padding:3px 7px;border-radius:6px;border:1px solid var(--border);background:var(--background);color:var(--foreground);cursor:pointer}\n.uibot-ck-move:hover{background:var(--muted)}\n.uibot-ck-empty{margin:0;padding:18px 8px;text-align:center;font-size:12px;color:var(--muted-foreground);border:1px dashed var(--border);border-radius:8px}\n`;\n\n/**\n * Interactive Collection Kanban board bound to Spec collection rows.\n * Supports local search, card selection (`onSelect`), accessible lane movement & drag-and-drop (`onMove`),\n * and optional record deletion (`onDelete`).\n */\nexport const CollectionKanban: RendererComponent = (props, ctx) => {\n const searchId = useId();\n const [query, setQuery] = useState(\"\");\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const rows = records(props.rows);\n const groupBy = text(props.groupBy, \"status\");\n const titleField = text(props.titleField, \"title\");\n const subtitleField = text(props.subtitleField, \"description\");\n const badgeField = text(props.badgeField, \"priority\");\n const selectedId = text(props.selectedId);\n const lanes = readKanbanLanes(props.lanes, rows, groupBy);\n\n const needle = props.searchable === true ? query.trim().toLocaleLowerCase() : \"\";\n const visibleRows = needle\n ? rows.filter((row) =>\n [row.id, row[titleField], row[subtitleField], row[badgeField], row[groupBy]].some((val) =>\n text(val).toLocaleLowerCase().includes(needle),\n ),\n )\n : rows;\n\n const events = (ctx.element as { events?: Record<string, unknown> }).events ?? {};\n const canMove = Boolean(events.onMove);\n const canDelete = Boolean(events.onDelete);\n\n const handleMove = (rowId: string, fromLane: string, toLane: string) => {\n if (!rowId || fromLane === toLane) return;\n emit(ctx, \"onMove\", { id: rowId, from: fromLane, to: toLane, field: groupBy }, rowId);\n };\n\n return (\n <section\n className=\"uibot-collection-kanban\"\n data-uibot-type=\"CollectionKanban\"\n aria-label={text(props.label, \"Kanban board\")}\n >\n <style>{KANBAN_CSS}</style>\n {props.searchable === true && (\n <div className=\"uibot-ck-toolbar\">\n <input\n id={searchId}\n type=\"search\"\n className=\"uibot-ck-search\"\n aria-label={text(props.searchPlaceholder, \"Search cards\")}\n placeholder={text(props.searchPlaceholder, \"Search cards\")}\n value={query}\n onChange={(event) => setQuery(event.currentTarget.value)}\n />\n </div>\n )}\n <div className=\"uibot-ck-board\">\n {lanes.map((lane) => {\n const laneRows = visibleRows.filter((row) => text(row[groupBy]) === lane.value);\n return (\n <div\n key={lane.value}\n className=\"uibot-ck-lane\"\n data-kanban-lane={lane.value}\n onDragOver={(event) => {\n if (canMove) event.preventDefault();\n }}\n onDrop={(event) => {\n if (!canMove) return;\n event.preventDefault();\n const droppedId = event.dataTransfer?.getData(\"text/plain\") || draggingId;\n const sourceRow = rows.find((r) => text(r.id) === droppedId);\n if (droppedId && sourceRow) {\n handleMove(droppedId, text(sourceRow[groupBy]), lane.value);\n }\n setDraggingId(null);\n }}\n >\n <div className=\"uibot-ck-lane-head\">\n <span>{lane.label}</span>\n <span className=\"uibot-ck-count\">{laneRows.length}</span>\n </div>\n <ul className=\"uibot-ck-list\" aria-label={lane.label}>\n {laneRows.map((row, index) => {\n const rowId = text(row.id, `${lane.value}-${index}`);\n const title = text(row[titleField], rowId);\n const subtitle = text(row[subtitleField]);\n const badge = text(row[badgeField]);\n const isSelected = selectedId !== \"\" && selectedId === rowId;\n return (\n <li\n key={rowId}\n className=\"uibot-ck-card\"\n data-kanban-card={rowId}\n data-selected={isSelected ? \"true\" : \"false\"}\n draggable={canMove}\n onDragStart={(event) => {\n setDraggingId(rowId);\n event.dataTransfer?.setData(\"text/plain\", rowId);\n }}\n onDragEnd={() => setDraggingId(null)}\n >\n <button\n type=\"button\"\n className=\"uibot-ck-card-btn\"\n aria-pressed={isSelected}\n onClick={() => emit(ctx, \"onSelect\", { id: rowId }, rowId)}\n >\n <span className=\"uibot-ck-title\">{title}</span>\n {subtitle && <span className=\"uibot-ck-sub\">{subtitle}</span>}\n </button>\n <div className=\"uibot-ck-meta\">\n {badge && <span className=\"uibot-ck-badge\">{badge}</span>}\n {(canMove || canDelete) && (\n <div className=\"uibot-ck-actions\">\n {canMove &&\n lanes\n .filter((target) => target.value !== lane.value)\n .slice(0, 2)\n .map((target) => (\n <button\n key={target.value}\n type=\"button\"\n className=\"uibot-ck-move\"\n aria-label={`Move ${title} to ${target.label}`}\n onClick={() => handleMove(rowId, lane.value, target.value)}\n >\n → {target.label}\n </button>\n ))}\n {canDelete && (\n <button\n type=\"button\"\n className=\"uibot-ck-move\"\n aria-label={`Delete ${title}`}\n onClick={() => emit(ctx, \"onDelete\", { id: rowId }, rowId)}\n >\n Delete\n </button>\n )}\n </div>\n )}\n </div>\n </li>\n );\n })}\n {laneRows.length === 0 && (\n <li className=\"uibot-ck-empty\">{text(props.emptyText, \"No items\")}</li>\n )}\n </ul>\n </div>\n );\n })}\n </div>\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/collection-kanban.uibot.json",
27
+ "target": "components/uibot/collection-kanban.uibot.json",
28
+ "content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"collection-kanban\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"CollectionKanban\",\n \"export\": \"CollectionKanban\",\n \"module\": \"collection-kanban.tsx\",\n \"catalog\": {\n \"name\": \"CollectionKanban\",\n \"description\": \"Kanban.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"kanban\"\n ],\n \"props\": {\n \"label\": {\n \"type\": \"string\"\n },\n \"rows\": {\n \"type\": \"array\"\n },\n \"groupBy\": {\n \"type\": \"string\"\n },\n \"lanes\": {\n \"type\": \"array\"\n },\n \"titleField\": {\n \"type\": \"string\"\n },\n \"subtitleField\": {\n \"type\": \"string\"\n },\n \"badgeField\": {\n \"type\": \"string\"\n },\n \"selectedId\": {\n \"type\": \"string\"\n }\n },\n \"events\": {\n \"onSelect\": {\n \"description\": \"\"\n },\n \"onMove\": {\n \"description\": \"\"\n },\n \"onDelete\": {\n \"description\": \"\"\n }\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
+ "rows": {
40
+ "type": "array"
41
+ },
42
+ "groupBy": {
43
+ "type": "string"
44
+ },
45
+ "lanes": {
46
+ "type": "array"
47
+ },
48
+ "titleField": {
49
+ "type": "string"
50
+ },
51
+ "subtitleField": {
52
+ "type": "string"
53
+ },
54
+ "badgeField": {
55
+ "type": "string"
56
+ },
57
+ "selectedId": {
58
+ "type": "string"
59
+ }
60
+ },
61
+ "events": {
62
+ "onSelect": {
63
+ "description": ""
64
+ },
65
+ "onMove": {
66
+ "description": ""
67
+ },
68
+ "onDelete": {
69
+ "description": ""
70
+ }
71
+ },
72
+ "provides": [
73
+ "CollectionKanban"
74
+ ],
75
+ "uibot": {
76
+ "schema": "uibot.registry.item.v1",
77
+ "item": "collection-kanban",
78
+ "channel": "public",
79
+ "components": [
80
+ {
81
+ "name": "CollectionKanban",
82
+ "export": "CollectionKanban",
83
+ "module": "collection-kanban.tsx",
84
+ "catalog": {
85
+ "name": "CollectionKanban",
86
+ "description": "Kanban.",
87
+ "category": "composite",
88
+ "level": "L2",
89
+ "tags": [
90
+ "kanban"
91
+ ],
92
+ "props": {
93
+ "label": {
94
+ "type": "string"
95
+ },
96
+ "rows": {
97
+ "type": "array"
98
+ },
99
+ "groupBy": {
100
+ "type": "string"
101
+ },
102
+ "lanes": {
103
+ "type": "array"
104
+ },
105
+ "titleField": {
106
+ "type": "string"
107
+ },
108
+ "subtitleField": {
109
+ "type": "string"
110
+ },
111
+ "badgeField": {
112
+ "type": "string"
113
+ },
114
+ "selectedId": {
115
+ "type": "string"
116
+ }
117
+ },
118
+ "events": {
119
+ "onSelect": {
120
+ "description": ""
121
+ },
122
+ "onMove": {
123
+ "description": ""
124
+ },
125
+ "onDelete": {
126
+ "description": ""
127
+ }
128
+ }
129
+ }
130
+ }
131
+ ]
132
+ }
133
+ }
134
+ }