@uibot/mcp-server 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.
- package/README.md +38 -0
- package/dist/content.d.ts +5 -1
- package/dist/discovery.d.ts +5 -3
- package/dist/http.d.ts +4 -1
- package/dist/http.js +154 -119
- package/dist/resources/bundle.json +1 -1
- package/dist/resources/templates/shadcn-admin.yaml +1491 -334
- package/dist/server.d.ts +8 -1
- package/dist/server.js +151 -116
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-apps.json +61 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-chats.json +54 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-account.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-appearance.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-display.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-notifications.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-settings-profile.json +1 -1
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-settings.json +65 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-shell.json +173 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-tasks.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/admin-users.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/agent-run-console.json +64 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/auth-minimal.json +59 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/billing-overview.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/billing-usage-ledger.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/charts.json +238 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-workspace.json +1 -1
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/collection-kanban.json +134 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/collection-shared.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/commerce-workspace.json +1 -1
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/console-billing.json +68 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/console-page.json +14 -14
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/console-shell.json +29 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/creation-shared.json +2 -2
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/crm-workspace.json +1 -1
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/dashboard-01.json +78 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/dashboard.json +113 -3
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-crud-gallery.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-crud-kanban.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-crud-master-detail.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-crud-table.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/data-table.json +352 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/data.json +9 -2
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-assistant.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-workspace.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/drilldown-menu.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/education-workspace.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/feedback.json +15 -2
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/form.json +1 -1
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/launch-site.json +72 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/layout.json +806 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/nav.json +285 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/onboarding-checklist.json +63 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/onboarding-wizard.json +66 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/prompt-eval-workbench.json +65 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/record-master-detail.json +132 -0
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/r/shadcn-admin.json +77 -0
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-primitives.json +1 -1
- package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/workspace.json +9 -2
- package/dist/snapshots/d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773/snapshot.json +1 -0
- package/dist/spec-ops.d.ts +31 -0
- package/package.json +12 -9
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-apps.json +0 -61
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-chats.json +0 -54
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-settings.json +0 -65
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-shell.json +0 -160
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-tasks.json +0 -66
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/admin-users.json +0 -66
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/charts.json +0 -211
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/console-billing.json +0 -68
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/console-shell.json +0 -29
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/data-table.json +0 -242
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/layout.json +0 -771
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/nav.json +0 -257
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/r/shadcn-admin.json +0 -77
- package/dist/snapshots/b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545/snapshot.json +0 -1
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/licenses/UIBot-LICENSE +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/licenses/blocks-icons-LICENSE +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/licenses/shadcn-THIRD_PARTY_LICENSE +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-dashboard.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-401.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-403.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-404.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-500.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-error-503.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-forgot-password.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-help.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-otp.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-overview.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-sign-in-2.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-sign-in.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/admin-sign-up.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/ai-chat.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/analytics-dashboard.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-floating.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-icon-rail.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-inset.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-settings.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-sidebar.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/app-shell-workspace.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-centered.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-enterprise.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-recovery.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-registration.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth-split.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/auth.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/blog.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-artifact.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-focused.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-history.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-knowledge.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/chat-support.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/content.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/crm.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/data-studio.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-library.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-reading.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/document-writing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/ecommerce.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/field.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/grid.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/interactive.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/item-grid.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/kanban.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/lms.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/marketing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/portfolio.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/presentation.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/pricing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/primitives.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/saas-landing.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sections.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/settings.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/shadcn-admin-shell.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-01.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-02.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-03.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-04.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-05.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-06.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-07.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-08.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-09.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-10.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-11.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-12.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-13.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-14.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-15.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-16.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/sidebar-drilldown.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/store.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/support-inbox.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/team-directory.json +0 -0
- /package/dist/snapshots/{b21e710e6bf4850f18adb9af1b9d48aa59852516ad54fa63926aed9b07943545 → d7bd93f1056f9b65c17b3146d456b92f6acffa6afe32bc53ee20bcca4a946773}/r/uibot-base.json +0 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "data-table",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"description": "Configurable record table with search, facets, sorting, stable selection and pagination. Server mode emits query intent without filtering current-page rows.",
|
|
6
|
+
"dependencies": [
|
|
7
|
+
"react@19.3.0",
|
|
8
|
+
"@dnd-kit/core@6.3.1",
|
|
9
|
+
"@dnd-kit/sortable@10.0.0",
|
|
10
|
+
"@dnd-kit/utilities@3.2.2",
|
|
11
|
+
"clsx@2.1.1",
|
|
12
|
+
"lucide-react@1.56.0",
|
|
13
|
+
"radix-ui@1.4.3",
|
|
14
|
+
"react-day-picker@9.14.0",
|
|
15
|
+
"tailwind-merge@3.7.0"
|
|
16
|
+
],
|
|
17
|
+
"registryDependencies": [
|
|
18
|
+
"@uibot/uibot-base"
|
|
19
|
+
],
|
|
20
|
+
"files": [
|
|
21
|
+
{
|
|
22
|
+
"path": "components/uibot/data-table.tsx",
|
|
23
|
+
"target": "components/uibot/data-table.tsx",
|
|
24
|
+
"content": "import { ScrollArea } from \"./scroll-area\";\nimport { useCallback, useId, useState, type ReactNode } from \"react\";\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n MouseSensor,\n TouchSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { tableRowOrder, moveTableRow } from \"./data-table-order\";\nimport { SortableTableRow } from \"./data-table-sortable\";\nimport { TableCellEditor, useTableEditing } from \"./data-table-editing\";\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { Icon } from \"./icons\";\nimport { emit, records, text, type BlockContext } from \"./interaction\";\nimport { FormSelectControl } from \"./form-controls\";\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuCheckboxItem,\n DropdownMenuItem,\n DropdownMenuSeparator,\n} from \"./sidebars/ui-dropdown-menu\";\n\nexport interface TableView {\n search: string;\n filters: Record<string, string[]>;\n sort: string;\n descending: boolean;\n page: number;\n pageSize: number;\n hiddenColumns?: string[];\n tab?: string;\n}\nexport function projectTableRows(\n rows: Record<string, unknown>[],\n view: TableView,\n searchKeys: string[],\n) {\n const query = view.search.toLocaleLowerCase();\n const filtered = rows.filter(\n (row) =>\n (!query || searchKeys.some((key) => text(row[key]).toLocaleLowerCase().includes(query))) &&\n Object.entries(view.filters).every(\n ([key, values]) => !values.length || values.includes(text(row[key])),\n ),\n );\n if (view.sort)\n filtered.sort((a, b) => {\n const x = a[view.sort],\n y = b[view.sort];\n const cmp =\n typeof x === \"number\" && typeof y === \"number\"\n ? x - y\n : text(x).localeCompare(text(y), undefined, { numeric: true });\n return view.descending ? -cmp : cmp;\n });\n const pageSize = Math.max(1, Math.min(200, Math.floor(view.pageSize) || 10));\n const pageCount = Math.max(1, Math.ceil(filtered.length / pageSize));\n const page = Math.max(0, Math.min(Math.floor(view.page) || 0, pageCount - 1));\n return {\n rows: filtered.slice(page * pageSize, (page + 1) * pageSize),\n total: filtered.length,\n page,\n pageCount,\n };\n}\nconst control =\n \"h-9 rounded-md border bg-background px-3 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40\";\nconst tableCopy = {\n en: {\n records: \"Records\",\n tableViews: \"Table views\",\n tableView: \"Table view\",\n viewPlaceholder: \"View\",\n search: \"Search records\",\n placeholder: \"Filter records...\",\n reset: \"Reset\",\n columns: \"Columns\",\n customizeColumns: \"Customize columns\",\n emptyView: \"No documents in this view.\",\n reorderRows: \"Reorder rows\",\n selectAll: \"Select all rows on this page\",\n selectRow: (id: string) => `Select row ${id}`,\n actions: \"Actions\",\n rowActions: (id: string) => `Actions for ${id}`,\n loading: \"Loading records...\",\n error: \"Records could not be loaded.\",\n empty: \"No results.\",\n selection: (count: number, total?: number) =>\n `${count}${total === undefined ? \" \" : ` of ${total} `}row(s) selected.`,\n pageSize: \"Rows per page\",\n pageSizePlaceholder: \"Rows\",\n page: (page: number, total?: number) =>\n `Page ${page}${total === undefined ? \"\" : ` of ${total}`}`,\n firstPage: \"First page\",\n previousPage: \"Previous page\",\n nextPage: \"Next page\",\n lastPage: \"Last page\",\n selected: (count: number) => `${count} selected`,\n clear: \"Clear selection\",\n },\n \"zh-CN\": {\n records: \"记录\",\n tableViews: \"表格视图\",\n tableView: \"表格视图\",\n viewPlaceholder: \"视图\",\n search: \"搜索记录\",\n placeholder: \"筛选记录…\",\n reset: \"重置\",\n columns: \"显示列\",\n customizeColumns: \"自定义列\",\n emptyView: \"此视图暂无文档\",\n reorderRows: \"调整行顺序\",\n selectAll: \"选择本页全部记录\",\n selectRow: (id: string) => `选择记录 ${id}`,\n actions: \"操作\",\n rowActions: (id: string) => `记录 ${id} 的操作`,\n loading: \"正在加载记录…\",\n error: \"无法加载记录\",\n empty: \"暂无结果\",\n selection: (count: number, total?: number) =>\n `已选择 ${count} 条${total === undefined ? \"\" : `,共 ${total} 条`}`,\n pageSize: \"每页条数\",\n pageSizePlaceholder: \"条数\",\n page: (page: number, total?: number) =>\n `第 ${page} 页${total === undefined ? \"\" : `,共 ${total} 页`}`,\n firstPage: \"第一页\",\n previousPage: \"上一页\",\n nextPage: \"下一页\",\n lastPage: \"最后一页\",\n selected: (count: number) => `已选择 ${count} 条`,\n clear: \"清除选择\",\n },\n};\nfunction DataTableView({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const copy = tableCopy[props.locale === \"zh-CN\" ? \"zh-CN\" : \"en\"];\n const pageSizeId = useId();\n const sortId = useId();\n const sensors = useSensors(\n useSensor(MouseSensor, { activationConstraint: { distance: 5 } }),\n useSensor(TouchSensor, { activationConstraint: { delay: 180, tolerance: 6 } }),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n const [localOrder, setOrder] = useState<string[]>([]);\n const [menuContainer, setMenuContainer] = useState<HTMLElement>();\n const scopeRef = useCallback((node: HTMLElement | null) => {\n if (node) setMenuContainer(node.closest<HTMLElement>(\"[data-uibot-type='PageLayout']\") ?? node);\n }, []);\n const direction = menuContainer?.closest(\"[dir]\")?.getAttribute(\"dir\") === \"rtl\" ? \"rtl\" : \"ltr\";\n const rows = records(props.rows),\n columns = records(props.columns),\n facets = records(props.filters);\n const rowKey = text(props.rowKey, \"id\");\n const [localView, setView] = useState<TableView>({\n search: \"\",\n filters: {},\n sort: \"\",\n descending: false,\n page: 0,\n pageSize: Number(props.pageSize) || 10,\n hiddenColumns: [],\n });\n let supplied: unknown = props.view;\n if (typeof supplied === \"string\") {\n try {\n supplied = JSON.parse(supplied);\n } catch {\n supplied = {};\n }\n }\n const raw = supplied && typeof supplied === \"object\" ? (supplied as Record<string, unknown>) : {};\n const view: TableView = {\n ...localView,\n tab: typeof raw.tab === \"string\" ? raw.tab : (localView.tab ?? \"\"),\n hiddenColumns: Array.isArray(raw.hiddenColumns)\n ? raw.hiddenColumns.filter((x): x is string => typeof x === \"string\")\n : (localView.hiddenColumns ?? []),\n search: typeof raw.search === \"string\" ? raw.search : localView.search,\n sort: typeof raw.sort === \"string\" ? raw.sort : localView.sort,\n descending: typeof raw.descending === \"boolean\" ? raw.descending : localView.descending,\n page:\n typeof raw.page === \"number\" && Number.isFinite(raw.page)\n ? Math.max(0, Math.floor(raw.page))\n : localView.page,\n pageSize:\n typeof raw.pageSize === \"number\" && Number.isFinite(raw.pageSize)\n ? Math.max(1, Math.min(200, Math.floor(raw.pageSize)))\n : localView.pageSize,\n filters:\n raw.filters && typeof raw.filters === \"object\"\n ? Object.fromEntries(\n Object.entries(raw.filters)\n .filter(([, v]) => Array.isArray(v))\n .map(([k, v]) => [\n k,\n (v as unknown[]).filter((x): x is string => typeof x === \"string\"),\n ]),\n )\n : localView.filters,\n };\n const views = records(props.views);\n const requestedTab = raw.tab ?? localView.tab;\n const tab = views.some((item) => item.value === requestedTab)\n ? text(requestedTab)\n : text(views[0]?.value);\n view.tab = tab;\n const selectedView = views.find((item) => item.value === tab) ?? views[0];\n const editing = useTableEditing(rows, rowKey, props.cellFeedback, ctx);\n const order = tableRowOrder(rows, rowKey, props.rowOrder ?? localOrder);\n const rowMap = new Map(rows.map((row) => [text(row[rowKey]), row]));\n const orderedRows = order\n ? order.flatMap((id) => {\n const row = rowMap.get(id);\n return row ? [row] : [];\n })\n : rows;\n const [selected, select] = useState<string[]>([]);\n const hidden = view.hiddenColumns ?? [];\n const ids = new Set(rows.map((r) => text(r[rowKey])));\n const selectedIds = (\n Array.isArray(props.selectedIds) ? props.selectedIds.map(String) : selected\n ).filter((id) => props.server === true || ids.has(id));\n const update = (patch: Partial<TableView>) => {\n const next = { ...view, page: 0, ...patch };\n setView(next);\n emit(\n ctx,\n \"onViewChange\",\n {\n search: next.search,\n filters: JSON.stringify(next.filters),\n sort: next.sort,\n descending: next.descending,\n page: next.page,\n pageSize: next.pageSize,\n tab: next.tab ?? \"\",\n },\n JSON.stringify(next),\n );\n };\n const selectRows = (next: string[]) => {\n select(next);\n emit(ctx, \"onSelectionChange\", { ids: next });\n };\n const rowAction = (row: Record<string, unknown>, action: string) =>\n emit(ctx, \"onRowAction\", {\n ...Object.fromEntries(\n Object.entries(row).filter(\n ([, v]) => v === null || [\"string\", \"number\", \"boolean\"].includes(typeof v),\n ),\n ),\n id: text(row[rowKey]),\n action,\n });\n const projected = projectTableRows(\n props.reorderable === true && props.server !== true ? orderedRows : rows,\n view,\n Array.isArray(props.searchKeys)\n ? props.searchKeys.map(String)\n : columns.map((c) => text(c.key)),\n );\n const result =\n props.server === true\n ? {\n ...projected,\n rows,\n total:\n typeof props.total === \"number\" && Number.isFinite(props.total) && props.total >= 0\n ? props.total\n : undefined,\n page: view.page,\n }\n : projected;\n const visible = columns.filter((c) => !hidden.includes(text(c.key)));\n const pageSizes = [...new Set([10, 20, 30, 40, 50, 100, view.pageSize])].sort((a, b) => a - b);\n const pageIds = result.rows.map((row) => text(row[rowKey]));\n const allSelected = pageIds.length > 0 && pageIds.every((id) => selectedIds.includes(id));\n const partlySelected = !allSelected && pageIds.some((id) => selectedIds.includes(id));\n const busy = props.loading === true;\n const error = text(props.error);\n const reorderable = props.reorderable === true && props.server !== true && order !== null;\n const reorderDisabled = busy || !!error || !!view.sort;\n const lastPage =\n props.server !== true\n ? result.pageCount - 1\n : typeof result.total === \"number\"\n ? Math.max(0, Math.ceil(result.total / view.pageSize) - 1)\n : undefined;\n const renderRow = (id: string, label: string, selected: boolean, children: ReactNode) =>\n reorderable ? (\n <SortableTableRow\n key={id}\n id={id}\n label={label}\n disabled={reorderDisabled}\n selected={selected}\n >\n {children}\n </SortableTableRow>\n ) : (\n <tr\n key={id}\n data-row-id={id}\n data-state={selected ? \"selected\" : undefined}\n className=\"border-b last:border-b-0 hover:bg-muted/50 data-[state=selected]:bg-muted/60\"\n >\n {children}\n </tr>\n );\n return (\n <section\n ref={scopeRef}\n data-uibot-type=\"DataTable\"\n className=\"uibot-data-table @container/table space-y-4 [color-scheme:light] dark:[color-scheme:dark]\"\n aria-label={text(props.label, copy.records)}\n aria-busy={busy}\n >\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n {!!views.length && (\n <TabsPrimitive.Root\n value={tab}\n onValueChange={(value) => update({ tab: value })}\n className=\"min-w-0\"\n >\n <TabsPrimitive.List\n aria-label={copy.tableViews}\n className=\"hidden @min-[920px]/table:inline-flex h-9 items-center gap-1 rounded-lg bg-muted p-1\"\n >\n {views.map((item) => (\n <TabsPrimitive.Trigger\n key={text(item.value)}\n value={text(item.value)}\n id={`${sortId}-tab-${text(item.value)}`}\n aria-controls={`${sortId}-panel`}\n className=\"inline-flex items-center gap-2 whitespace-nowrap rounded-md px-3 py-1 text-sm text-muted-foreground outline-none data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {text(item.label)}\n {item.badge !== undefined && (\n <span className=\"rounded-full bg-muted-foreground/20 px-1.5 text-xs tabular-nums\">\n {text(item.badge)}\n </span>\n )}\n </TabsPrimitive.Trigger>\n ))}\n </TabsPrimitive.List>\n <div className=\"@min-[920px]/table:hidden\">\n <label htmlFor={`${sortId}-view`} className=\"sr-only\">\n {copy.tableView}\n </label>\n <FormSelectControl\n id={`${sortId}-view`}\n name=\"tableView\"\n placeholder={copy.viewPlaceholder}\n value={tab}\n options={views.map((item) => ({\n value: text(item.value),\n label: text(item.label),\n }))}\n onValueChange={(value) => update({ tab: value })}\n />\n </div>\n </TabsPrimitive.Root>\n )}\n {props.searchable !== false && (\n <input\n className={`${control} w-full sm:w-64`}\n aria-label={copy.search}\n placeholder={text(props.searchPlaceholder, copy.placeholder)}\n value={view.search}\n onChange={(e) => update({ search: e.target.value })}\n />\n )}\n {facets.map((facet) => (\n <DropdownMenu key={text(facet.key)} modal={false} dir={direction}>\n <DropdownMenuTrigger\n className={`${control} flex cursor-pointer items-center gap-2 border-dashed`}\n >\n {text(facet.label)}\n {(view.filters[text(facet.key)]?.length ?? 0) > 0 && (\n <span className=\"rounded bg-muted px-1.5\">\n {view.filters[text(facet.key)]?.length}\n </span>\n )}\n </DropdownMenuTrigger>\n <DropdownMenuContent container={menuContainer} align=\"start\" className=\"min-w-44\">\n {records(facet.options).map((option) => {\n const values = view.filters[text(facet.key)] ?? [],\n value = text(option.value);\n return (\n <DropdownMenuCheckboxItem\n key={value}\n checked={values.includes(value)}\n onSelect={(event) => event.preventDefault()}\n onCheckedChange={(checked) =>\n update({\n filters: {\n ...view.filters,\n [text(facet.key)]: checked\n ? [...values, value]\n : values.filter((v) => v !== value),\n },\n })\n }\n >\n {text(option.label)}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n ))}\n {(view.search || Object.values(view.filters).some((v) => v.length)) && (\n <button\n type=\"button\"\n className={control}\n onClick={() => update({ search: \"\", filters: {} })}\n >\n {copy.reset}\n </button>\n )}\n <div className=\"ms-auto flex items-center gap-2\">\n <DropdownMenu modal={false} dir={direction}>\n <DropdownMenuTrigger\n aria-label={views.length ? copy.customizeColumns : copy.columns}\n className={`${control} flex cursor-pointer items-center gap-2`}\n >\n <Icon name=\"sliders-horizontal\" size={14} />\n <span className=\"hidden sm:inline\">\n {views.length ? copy.customizeColumns : copy.columns}\n </span>\n </DropdownMenuTrigger>\n <DropdownMenuContent container={menuContainer} align=\"end\" className=\"min-w-40\">\n {columns\n .filter((c) => c.hideable !== false)\n .map((c) => (\n <DropdownMenuCheckboxItem\n key={text(c.key)}\n checked={!hidden.includes(text(c.key))}\n onSelect={(event) => event.preventDefault()}\n onCheckedChange={(checked) =>\n update({\n hiddenColumns: checked\n ? hidden.filter((k) => k !== c.key)\n : [...hidden, text(c.key)],\n })\n }\n >\n {text(c.label)}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n {typeof props.addLabel === \"string\" && (\n <button\n type=\"button\"\n className={`${control} inline-flex items-center gap-2`}\n disabled={busy || !!error}\n aria-label={props.addLabel}\n onClick={() => emit(ctx, \"onAdd\")}\n >\n <Icon name=\"plus\" size={14} />\n <span className=\"hidden sm:inline\">{props.addLabel}</span>\n </button>\n )}\n </div>\n </div>\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error}\n </p>\n )}\n <div\n id={`${sortId}-panel`}\n role={views.length ? \"tabpanel\" : undefined}\n aria-labelledby={views.length ? `${sortId}-tab-${tab}` : undefined}\n tabIndex={views.length ? 0 : undefined}\n className=\"outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {selectedView?.placeholder === true ? (\n <div className=\"flex min-h-64 items-center justify-center rounded-lg border border-dashed text-sm text-muted-foreground\">\n {text(selectedView.emptyText, copy.emptyView)}\n </div>\n ) : (\n <>\n <DndContext\n id={sortId}\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={({ active, over }) => {\n if (\n !reorderable ||\n reorderDisabled ||\n !over ||\n !pageIds.includes(String(active.id)) ||\n !pageIds.includes(String(over.id)) ||\n !order\n )\n return;\n const next = moveTableRow(order, String(active.id), String(over.id));\n if (next === order) return;\n setOrder(next);\n emit(ctx, \"onReorder\", {\n ids: next,\n activeId: String(active.id),\n overId: String(over.id),\n });\n }}\n >\n <ScrollArea\n className={\n result.rows.length ? \"rounded-lg border\" : \"rounded-t-lg border border-b-0\"\n }\n scrollbars=\"horizontal\"\n viewportProps={{ role: \"region\", \"aria-label\": copy.records }}\n >\n <table\n aria-describedby={!result.rows.length ? `${sortId}-status` : undefined}\n className=\"w-full text-start text-sm\"\n style={{\n minWidth: typeof props.minWidth === \"number\" ? props.minWidth : undefined,\n }}\n >\n <thead className=\"border-b bg-muted/60 text-muted-foreground\">\n <tr>\n {reorderable && (\n <th scope=\"col\" className=\"w-9\">\n <span className=\"sr-only\">{copy.reorderRows}</span>\n </th>\n )}\n {props.selectable !== false && (\n <th className=\"w-10 px-4 py-3\">\n <input\n ref={(element) => {\n if (element) element.indeterminate = partlySelected;\n }}\n aria-label={copy.selectAll}\n type=\"checkbox\"\n checked={allSelected}\n disabled={busy || !!error || !pageIds.length}\n onChange={() =>\n selectRows(\n allSelected\n ? selectedIds.filter((id) => !pageIds.includes(id))\n : [...new Set([...selectedIds, ...pageIds])],\n )\n }\n />\n </th>\n )}\n {visible.map((c) => (\n <th\n key={text(c.key)}\n scope=\"col\"\n aria-sort={\n view.sort === c.key\n ? view.descending\n ? \"descending\"\n : \"ascending\"\n : \"none\"\n }\n className={`whitespace-nowrap px-3 py-3 font-medium ${c.align === \"end\" ? \"text-end\" : \"text-start\"}`}\n >\n <button\n type=\"button\"\n disabled={c.sortable === false}\n className=\"inline-flex items-center gap-2 hover:text-foreground\"\n onClick={() =>\n update({\n sort: view.sort === c.key && view.descending ? \"\" : text(c.key),\n descending: view.sort === c.key && !view.descending,\n })\n }\n >\n {text(c.label)}\n {view.sort === c.key && (\n <Icon name={view.descending ? \"arrow-down\" : \"arrow-up\"} size={14} />\n )}\n </button>\n </th>\n ))}\n {Array.isArray(props.actions) && (\n <th scope=\"col\" className=\"sticky end-0 z-10 w-14 bg-background px-2\">\n <span className=\"sr-only\">{copy.actions}</span>\n </th>\n )}\n </tr>\n </thead>\n <SortableContext items={pageIds} strategy={verticalListSortingStrategy}>\n <tbody>\n {result.rows.map((row) => {\n const id = text(row[rowKey]);\n return renderRow(\n id,\n text(row.header, id),\n selectedIds.includes(id),\n <>\n {props.selectable !== false && (\n <td className=\"w-10 px-3 py-2.5\">\n <input\n type=\"checkbox\"\n aria-label={copy.selectRow(id)}\n checked={selectedIds.includes(id)}\n disabled={busy || !!error}\n onChange={(e) =>\n selectRows(\n e.target.checked\n ? [...selectedIds, id]\n : selectedIds.filter((s) => s !== id),\n )\n }\n />\n </td>\n )}\n {visible.map((column) => (\n <td\n key={text(column.key)}\n className={`max-w-lg whitespace-nowrap px-3 py-2.5 ${column.align === \"end\" ? \"text-end\" : \"\"}`}\n >\n {typeof column.editor === \"string\" &&\n !(\n column.editor === \"select\" &&\n column.emptyValue !== undefined &&\n text(row[text(column.key)]) !== text(column.emptyValue)\n ) ? (\n <TableCellEditor\n row={row}\n rowKey={rowKey}\n column={column}\n editing={editing}\n disabled={busy || !!error}\n />\n ) : (\n <>\n {typeof column.badgeKey === \"string\" && (\n <span className=\"me-2 inline-flex rounded-md border px-2 py-0.5 text-xs font-medium\">\n {text(row[column.badgeKey])}\n </span>\n )}\n <span\n title={\n Array.isArray(column.displayKeys)\n ? column.displayKeys\n .map((key) => text(row[String(key)]))\n .filter(Boolean)\n .join(\" \") || \"—\"\n : text(row[text(column.key)], \"—\")\n }\n className={\n column.kind === \"badge\"\n ? \"inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border px-1.5 py-0.5 text-xs font-medium text-muted-foreground\"\n : column.kind === \"muted\"\n ? \"inline-block max-w-[16ch] truncate align-middle text-muted-foreground\"\n : \"inline-block max-w-[400px] truncate align-middle font-medium\"\n }\n >\n {column.kind === \"badge\" && column.statusIcons === true && (\n <span\n className={\n text(row[text(column.key)]) === \"Done\"\n ? \"text-emerald-500\"\n : \"text-muted-foreground\"\n }\n aria-hidden=\"true\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n {text(row[text(column.key)]) === \"Done\" ? (\n <>\n <circle cx=\"8\" cy=\"8\" r=\"7\" fill=\"currentColor\" />\n <path\n d=\"m4.5 8 2.2 2.2 4.8-4.8\"\n stroke=\"white\"\n strokeWidth=\"1.5\"\n />\n </>\n ) : (\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeDasharray=\"4 3\"\n />\n )}\n </svg>\n </span>\n )}\n {typeof column.action === \"string\" ? (\n <button\n type=\"button\"\n disabled={busy || !!error}\n className=\"text-start underline-offset-4 hover:underline focus-visible:underline\"\n onClick={() => rowAction(row, text(column.action))}\n >\n {text(row[text(column.key)], \"—\")}\n </button>\n ) : Array.isArray(column.displayKeys) ? (\n column.displayKeys\n .map((key) => text(row[String(key)]))\n .filter(Boolean)\n .join(\" \") || \"—\"\n ) : (\n text(row[text(column.key)], \"—\")\n )}\n </span>\n </>\n )}\n </td>\n ))}\n {Array.isArray(props.actions) && (\n <td className=\"sticky end-0 z-10 w-14 bg-background px-2\">\n <DropdownMenu modal={false} dir={direction}>\n <DropdownMenuTrigger\n disabled={busy || !!error}\n aria-label={copy.rowActions(id)}\n className=\"cursor-pointer rounded px-2 py-1\"\n >\n <Icon name=\"ellipsis\" size={16} />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n container={menuContainer}\n align=\"end\"\n className=\"min-w-36\"\n >\n {records(props.actions).map((action) => (\n <span key={text(action.id)} className=\"contents\">\n {action.destructive === true && <DropdownMenuSeparator />}\n <DropdownMenuItem\n className={\n action.destructive === true\n ? \"text-destructive focus:text-destructive\"\n : undefined\n }\n disabled={busy || action.disabled === true}\n onSelect={() => rowAction(row, text(action.id))}\n >\n {text(action.label)}\n </DropdownMenuItem>\n </span>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </td>\n )}\n </>,\n );\n })}\n </tbody>\n </SortableContext>\n </table>\n </ScrollArea>\n {!result.rows.length && (\n <div\n id={`${sortId}-status`}\n role=\"status\"\n className=\"flex min-h-28 min-w-0 items-center justify-center rounded-b-lg border border-t-0 px-4 py-6 text-center text-sm text-muted-foreground\"\n >\n <p className=\"min-w-0 whitespace-normal break-words\">\n {busy ? copy.loading : error ? copy.error : text(props.emptyText, copy.empty)}\n </p>\n </div>\n )}\n </DndContext>\n <div className=\"mt-4 flex flex-wrap items-center justify-between gap-4 px-1 text-sm\">\n <span className=\"text-muted-foreground\">\n {copy.selection(selectedIds.length, result.total)}\n </span>\n <div className=\"flex flex-wrap items-center gap-4\">\n <div className=\"flex items-center gap-2\">\n <label htmlFor={pageSizeId} className=\"whitespace-nowrap\">\n {copy.pageSize}\n </label>\n <FormSelectControl\n id={pageSizeId}\n name=\"pageSize\"\n placeholder={copy.pageSizePlaceholder}\n value={String(view.pageSize)}\n options={pageSizes.map((n) => ({ value: String(n), label: String(n) }))}\n onValueChange={(value) => update({ pageSize: Number(value) })}\n />\n </div>\n <span>\n {copy.page(result.page + 1, props.server !== true ? result.pageCount : undefined)}\n </span>\n <button\n type=\"button\"\n aria-label={copy.firstPage}\n title={copy.firstPage}\n className={`${control} !px-2`}\n disabled={busy || result.page === 0}\n onClick={() => update({ page: 0 })}\n >\n <span aria-hidden=\"true\">«</span>\n </button>\n <button\n type=\"button\"\n aria-label={copy.previousPage}\n className={control}\n disabled={busy || result.page === 0}\n onClick={() => update({ page: result.page - 1 })}\n >\n <span aria-hidden=\"true\">‹</span>\n </button>\n <button\n type=\"button\"\n aria-label={copy.nextPage}\n className={control}\n disabled={\n busy ||\n (props.server === true\n ? props.hasNextPage !== true\n : result.page + 1 >= result.pageCount)\n }\n onClick={() => update({ page: result.page + 1 })}\n >\n <span aria-hidden=\"true\">›</span>\n </button>\n <button\n type=\"button\"\n aria-label={copy.lastPage}\n title={copy.lastPage}\n className={`${control} !px-2`}\n disabled={busy || lastPage === undefined || result.page >= lastPage}\n onClick={() => {\n if (lastPage !== undefined) update({ page: lastPage });\n }}\n >\n <span aria-hidden=\"true\">»</span>\n </button>\n </div>\n </div>\n {selectedIds.length > 0 && records(props.bulkActions).length > 0 && (\n <div className=\"mt-4 flex items-center gap-2 rounded-md border bg-muted p-2\">\n <span className=\"px-2 text-sm\">{copy.selected(selectedIds.length)}</span>\n {records(props.bulkActions).map((action) => (\n <button\n key={text(action.id)}\n type=\"button\"\n className={control}\n disabled={busy || action.disabled === true}\n onClick={() =>\n emit(ctx, \"onBulkAction\", { ids: selectedIds, action: text(action.id) })\n }\n >\n {text(action.label)}\n </button>\n ))}\n <button type=\"button\" className={control} onClick={() => selectRows([])}>\n {copy.clear}\n </button>\n </div>\n )}\n </>\n )}\n </div>\n </section>\n );\n}\nexport const DataTable: RendererComponent = (props, ctx) => (\n <DataTableView props={props} ctx={ctx} />\n);\n",
|
|
25
|
+
"type": "registry:ui"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": "components/uibot/scroll-area.tsx",
|
|
29
|
+
"target": "components/uibot/scroll-area.tsx",
|
|
30
|
+
"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",
|
|
31
|
+
"type": "registry:ui"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "components/uibot/data-table-order.ts",
|
|
35
|
+
"target": "components/uibot/data-table-order.ts",
|
|
36
|
+
"content": "/** Complete identity order, retaining new rows and rejecting ambiguous identities. */\nexport function tableRowOrder(\n rows: Record<string, unknown>[],\n rowKey: string,\n order: unknown,\n): string[] | null {\n const ids = rows.map((row) => String(row[rowKey] ?? \"\"));\n if (ids.some((id) => !id) || new Set(ids).size !== ids.length) return null;\n const known = new Set(ids);\n const supplied = Array.isArray(order)\n ? [...new Set(order.map(String))].filter((id) => known.has(id))\n : [];\n return [...supplied, ...ids.filter((id) => !supplied.includes(id))];\n}\nexport function moveTableRow(order: string[], active: string, over: string): string[] {\n const from = order.indexOf(active),\n to = order.indexOf(over);\n if (from < 0 || to < 0 || from === to) return order;\n const next = [...order];\n next.splice(from, 1);\n next.splice(to, 0, active);\n return next;\n}\n",
|
|
37
|
+
"type": "registry:ui"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"path": "components/uibot/data-table-sortable.tsx",
|
|
41
|
+
"target": "components/uibot/data-table-sortable.tsx",
|
|
42
|
+
"content": "import type { ReactNode } from \"react\";\nimport { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\n\nexport function SortableTableRow({\n id,\n label,\n disabled,\n selected,\n children,\n}: {\n id: string;\n label: string;\n disabled: boolean;\n selected: boolean;\n children: ReactNode;\n}) {\n const {\n attributes,\n listeners,\n setNodeRef,\n setActivatorNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id, disabled });\n return (\n <tr\n ref={setNodeRef}\n data-row-id={id}\n data-state={selected ? \"selected\" : undefined}\n data-dragging={isDragging || undefined}\n className=\"relative border-b last:border-b-0 hover:bg-muted/50 data-[state=selected]:bg-muted/60 data-[dragging=true]:z-10 data-[dragging=true]:bg-muted data-[dragging=true]:shadow-md\"\n style={{\n transform: CSS.Transform.toString(\n transform ? { ...transform, x: 0, scaleX: 1, scaleY: 1 } : null,\n ),\n transition,\n }}\n >\n <td className=\"w-9 px-1\">\n <button\n type=\"button\"\n ref={setActivatorNodeRef}\n {...attributes}\n {...listeners}\n disabled={disabled}\n aria-label={`Reorder ${label}`}\n title={\n disabled\n ? \"Clear column sorting to reorder rows\"\n : \"Drag to reorder; Space and arrow keys also work\"\n }\n className=\"inline-flex size-7 touch-none items-center justify-center rounded text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-30 motion-reduce:transition-none cursor-grab active:cursor-grabbing\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n {[4, 8, 12].flatMap((y) =>\n [5, 11].map((x) => <circle key={`${x}-${y}`} cx={x} cy={y} r=\"1\" />),\n )}\n </svg>\n </button>\n </td>\n {children}\n </tr>\n );\n}\n",
|
|
43
|
+
"type": "registry:ui"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"path": "components/uibot/data-table-editing.tsx",
|
|
47
|
+
"target": "components/uibot/data-table-editing.tsx",
|
|
48
|
+
"content": "import { useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { FormSelectControl } from \"./form-controls\";\nimport { records, text, type BlockContext } from \"./interaction\";\n\ntype Draft = {\n value: string;\n base: string;\n version: unknown;\n status: \"dirty\" | \"pending\" | \"error\" | \"conflict\";\n operationId?: string;\n attempt?: number;\n submitted?: string;\n message?: string;\n};\nexport type CellDrafts = Record<string, Draft>;\nexport const cellKey = (id: string, column: string) => JSON.stringify([id, column]);\n\n/** Drafts stay with the table across pagination. Only matching host receipts acknowledge writes. */\nexport function useTableEditing(\n rows: Record<string, unknown>[],\n rowKey: string,\n feedback: unknown,\n ctx: BlockContext,\n) {\n const [drafts, setDrafts] = useState<CellDrafts>({});\n const processed = useRef(\"\");\n const receipt = useMemo(\n () => (feedback && typeof feedback === \"object\" ? (feedback as Record<string, unknown>) : {}),\n [feedback],\n );\n const receiptKey = JSON.stringify([\n receipt.operationId,\n receipt.attempt,\n receipt.status,\n receipt.message,\n ]);\n useEffect(() => {\n if (!receipt.operationId || processed.current === receiptKey) return;\n processed.current = receiptKey;\n setDrafts((previous) => {\n const key = cellKey(text(receipt.id), text(receipt.column)),\n current = previous[key];\n if (\n !current ||\n current.operationId !== receipt.operationId ||\n (receipt.attempt !== undefined && current.attempt !== receipt.attempt)\n )\n return previous;\n if (receipt.status === \"error\")\n return {\n ...previous,\n [key]: {\n ...current,\n status: \"error\",\n message: text(receipt.message, \"Save failed. Your draft is retained.\"),\n },\n };\n if (receipt.status !== \"success\") return previous;\n const row = rows.find((item) => text(item[rowKey]) === text(receipt.id));\n const next = { ...previous };\n if (current.value === current.submitted) delete next[key];\n else\n next[key] = {\n value: current.value,\n base: text(row?.[text(receipt.column)]),\n version: row?.version,\n status: \"dirty\",\n };\n return next;\n });\n }, [receiptKey, receipt, rows, rowKey]);\n const change = (row: Record<string, unknown>, column: string, value: string) => {\n const key = cellKey(text(row[rowKey]), column);\n setDrafts((previous) => ({\n ...previous,\n [key]: {\n ...(previous[key] ?? { base: text(row[column]), version: row.version, status: \"dirty\" }),\n value,\n },\n }));\n };\n const reset = (key: string) =>\n setDrafts((previous) => {\n if (previous[key]?.status === \"pending\") return previous;\n const next = { ...previous };\n delete next[key];\n return next;\n });\n const submit = (row: Record<string, unknown>, column: string, value: string) => {\n const id = text(row[rowKey]),\n key = cellKey(id, column),\n current = drafts[key];\n if (\n !ctx.element?.events?.onCellChange?.length ||\n Object.values(drafts).some((draft) => draft.status === \"pending\")\n )\n return;\n if (current && (current.base !== text(row[column]) || current.version !== row.version)) {\n setDrafts((previous) => ({\n ...previous,\n [key]: {\n ...current,\n status: \"conflict\",\n message: \"This record changed. Reset to use its latest value.\",\n },\n }));\n return;\n }\n if (value === text(row[column])) {\n reset(key);\n return;\n }\n const operationId =\n current?.status === \"error\" && current.submitted === value && current.operationId\n ? current.operationId\n : crypto.randomUUID();\n const attempt = (current?.attempt ?? 0) + 1;\n setDrafts((previous) => ({\n ...previous,\n [key]: {\n value,\n base: current?.base ?? text(row[column]),\n version: current?.version ?? row.version,\n status: \"pending\",\n submitted: value,\n operationId,\n attempt,\n },\n }));\n void ctx.dispatch?.(ctx.element.events.onCellChange, {\n event: {\n type: \"onCellChange\",\n value: operationId,\n values: {\n id,\n column,\n value,\n previousValue: text(row[column]),\n version:\n typeof row.version === \"number\" || typeof row.version === \"string\" ? row.version : null,\n operationId,\n attempt,\n },\n },\n });\n };\n return {\n drafts,\n change,\n reset,\n submit,\n pending: Object.values(drafts).some((draft) => draft.status === \"pending\"),\n enabled: !!ctx.element?.events?.onCellChange?.length,\n };\n}\nexport function TableCellEditor({\n row,\n rowKey,\n column,\n editing,\n disabled,\n}: {\n row: Record<string, unknown>;\n rowKey: string;\n column: Record<string, unknown>;\n editing: ReturnType<typeof useTableEditing>;\n disabled: boolean;\n}) {\n const inputId = useId();\n const field = text(column.key),\n id = text(row[rowKey]),\n key = cellKey(id, field),\n draft = editing.drafts[key];\n const label = `${text(column.label, field)} for ${text(row.header, id)}`;\n const value = draft?.value ?? text(row[field]);\n const pending = draft?.status === \"pending\";\n const error = draft?.status === \"error\" || draft?.status === \"conflict\";\n const submit = (next = value) => editing.submit(row, field, next);\n return (\n <form\n className=\"relative min-w-16\"\n aria-label={`Edit ${label}`}\n aria-busy={pending}\n onSubmit={(event) => {\n event.preventDefault();\n submit();\n }}\n >\n <label htmlFor={inputId} className=\"sr-only\">\n {label}\n </label>\n {column.editor === \"select\" ? (\n <FormSelectControl\n id={inputId}\n name={field}\n placeholder={text(column.placeholder, \"Assign reviewer\")}\n value={value === column.emptyValue ? \"\" : value}\n disabled={disabled || !editing.enabled || editing.pending}\n options={records(column.options).map((option) => ({\n value: text(option.value),\n label: text(option.label),\n }))}\n onValueChange={(next) => {\n editing.change(row, field, next);\n submit(next);\n }}\n />\n ) : (\n <>\n <input\n id={inputId}\n name={field}\n type={column.editor === \"number\" ? \"number\" : \"text\"}\n value={value}\n disabled={disabled || !editing.enabled || (editing.pending && !pending)}\n aria-invalid={error || undefined}\n aria-describedby={error ? `${inputId}-feedback` : undefined}\n className=\"h-8 w-20 rounded-md border border-transparent bg-transparent px-2 text-end text-sm tabular-nums shadow-none hover:bg-muted/50 focus-visible:border-input focus-visible:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\"\n onChange={(event) => editing.change(row, field, event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n editing.reset(key);\n }\n }}\n />\n <button\n type=\"submit\"\n className=\"sr-only focus:not-sr-only focus:absolute focus:rounded focus:border focus:bg-background focus:px-2\"\n disabled={disabled || pending || !editing.enabled}\n >\n Save {label}\n </button>\n </>\n )}\n {pending && (\n <span role=\"status\" className=\"block pt-1 text-xs text-muted-foreground\">\n Saving…\n </span>\n )}\n {error && (\n <div\n id={`${inputId}-feedback`}\n role=\"alert\"\n className=\"max-w-48 whitespace-normal pt-1 text-xs text-destructive\"\n >\n {draft?.message}\n {draft?.status === \"error\" && (\n <button\n type=\"button\"\n className=\"ms-2 underline\"\n disabled={disabled}\n onClick={() => submit()}\n >\n Retry\n </button>\n )}\n <button type=\"button\" className=\"ms-2 underline\" onClick={() => editing.reset(key)}>\n Reset\n </button>\n </div>\n )}\n </form>\n );\n}\n",
|
|
49
|
+
"type": "registry:ui"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"path": "components/uibot/form-controls.tsx",
|
|
53
|
+
"target": "components/uibot/form-controls.tsx",
|
|
54
|
+
"content": "import { type ReactNode, useCallback, useRef, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { Popover as PopoverPrimitive, Select as SelectPrimitive } from \"radix-ui\";\nimport { DayPicker } from \"react-day-picker\";\n\n/** Same field surface as the other Form.* controls (shadcn Input). */\nconst triggerBase =\n \"flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-left text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground\";\n\nconst popoverSurface =\n \"z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none\";\n\nfunction Chevron({ className }: { className?: string }) {\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n aria-hidden=\"true\"\n >\n <path d=\"m4 6 4 4 4-4\" />\n </svg>\n );\n}\n\n/** Preserve the native modal's top layer, or the owning frame's theme. */\nfunction useThemeContainer() {\n const [container, setContainer] = useState<HTMLElement | undefined>(undefined);\n const ref = useCallback((node: HTMLElement | null) => {\n setContainer(\n (node?.closest(\"dialog, [data-uibot-type='PageLayout']\") as HTMLElement | null) ?? undefined,\n );\n }, []);\n return [container, ref] as const;\n}\n\nexport interface SelectOption {\n value: string;\n label: string;\n}\n\nexport interface FormSelectControlProps {\n id: string;\n name: string;\n options: SelectOption[];\n placeholder: string;\n /** Present for controlled use (`_bindState`); omit to let the control hold its own value. */\n value?: string;\n defaultValue?: string;\n required?: boolean;\n disabled?: boolean;\n onValueChange?: ((value: string, element: HTMLElement) => void) | undefined;\n}\n\n/**\n * shadcn/ui Select (Radix). Radix renders a hidden native `<select name>` inside forms, so native\n * form values, `required` validation and the bubbling `change` event the Form block listens to keep\n * working.\n */\nexport function FormSelectControl(props: FormSelectControlProps) {\n const [container, triggerRef] = useThemeContainer();\n const [internalValue, setInternalValue] = useState(props.defaultValue ?? \"\");\n const triggerEl = useRef<HTMLButtonElement | null>(null);\n // Radix rejects empty-string items; an empty value means \"no selection\" and is the placeholder.\n const options = props.options.filter((option) => option.value !== \"\");\n return (\n <SelectPrimitive.Root\n name={props.name}\n dir={container?.closest(\"[dir]\")?.getAttribute(\"dir\") === \"rtl\" ? \"rtl\" : \"ltr\"}\n {...(props.value !== undefined\n ? { value: props.value }\n : props.defaultValue\n ? { defaultValue: props.defaultValue }\n : {})}\n {...(props.required ? { required: true } : {})}\n {...(props.disabled ? { disabled: true } : {})}\n onValueChange={(value) => {\n setInternalValue(value);\n props.onValueChange?.(value, triggerEl.current as HTMLElement);\n }}\n >\n <SelectPrimitive.Trigger\n id={props.id}\n ref={(node) => {\n triggerEl.current = node;\n triggerRef(node);\n }}\n className={triggerBase}\n >\n <SelectPrimitive.Value placeholder={props.placeholder}>\n {options.find((option) => option.value === (props.value ?? internalValue))?.label}\n </SelectPrimitive.Value>\n <SelectPrimitive.Icon asChild>\n <Chevron className=\"size-4 shrink-0 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n <SelectPrimitive.Portal {...(container ? { container } : {})}>\n <SelectPrimitive.Content\n position=\"popper\"\n sideOffset={4}\n className={cn(\n popoverSurface,\n \"max-h-80 min-w-[var(--radix-select-trigger-width)] overflow-hidden\",\n )}\n >\n <SelectPrimitive.Viewport className=\"p-1\">\n {options.map((option) => (\n <SelectPrimitive.Item\n key={option.value}\n value={option.value}\n className=\"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n >\n <SelectPrimitive.ItemText>{option.label}</SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m3.5 8.5 3 3 6-7\" />\n </svg>\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n ))}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n );\n}\n\nconst ISO_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n/** Parse `yyyy-MM-dd` as a local calendar date (no time zone shift). */\nfunction parseIsoDate(value: string): Date | undefined {\n const match = ISO_DATE.exec(value);\n if (!match) return undefined;\n const date = new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\nfunction toIsoDate(date: Date): string {\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${String(date.getFullYear()).padStart(4, \"0\")}-${month}-${day}`;\n}\n\nexport interface FormDateControlProps {\n id: string;\n name: string;\n placeholder?: string;\n /** Controlled value (`yyyy-MM-dd`); omit to let the control hold its own. */\n value?: string;\n defaultValue?: string;\n required?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n describedBy?: string;\n onValueChange?: ((value: string, element: HTMLElement) => void) | undefined;\n}\n\n/**\n * shadcn/ui date picker: a Popover with a Calendar (react-day-picker). The value stays an ISO\n * `yyyy-MM-dd` string. A visually hidden text input carries the name and value so the surrounding\n * Form collects it, runs native `required` validation (focus is handed to the trigger) and sees a\n * bubbling `input` event when the date changes.\n */\nexport function FormDateControl(props: FormDateControlProps) {\n const [container, popoverRef] = useThemeContainer();\n const [internal, setInternal] = useState(props.defaultValue ?? \"\");\n const [open, setOpen] = useState(false);\n const proxy = useRef<HTMLInputElement | null>(null);\n const trigger = useRef<HTMLButtonElement | null>(null);\n const value = props.value !== undefined ? props.value : internal;\n const selected = parseIsoDate(value);\n const interactive = !props.disabled && !props.readOnly;\n\n const commit = (next: string) => {\n setInternal(next);\n const input = proxy.current;\n if (input) {\n // Let the Form block see a native bubbling event, as it does for text inputs.\n const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, \"value\")?.set;\n setter?.call(input, next);\n input.dispatchEvent(new Event(\"input\", { bubbles: true }));\n }\n props.onValueChange?.(next, input ?? (trigger.current as HTMLElement));\n };\n\n let label: ReactNode = props.placeholder ?? \"Pick a date\";\n if (selected) {\n label = new Intl.DateTimeFormat(undefined, { dateStyle: \"medium\" }).format(selected);\n }\n return (\n <PopoverPrimitive.Root open={interactive && open} onOpenChange={setOpen}>\n <div className=\"relative\">\n <PopoverPrimitive.Trigger asChild>\n <button\n id={props.id}\n ref={(node) => {\n trigger.current = node;\n popoverRef(node);\n }}\n type=\"button\"\n disabled={props.disabled}\n aria-invalid={props.invalid ? true : undefined}\n aria-describedby={props.describedBy}\n data-placeholder={selected ? undefined : \"\"}\n className={cn(triggerBase, !interactive && \"cursor-default\")}\n >\n <span className=\"flex items-center gap-2\">\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"size-4 shrink-0 opacity-60\"\n aria-hidden=\"true\"\n >\n <rect x=\"2\" y=\"3\" width=\"12\" height=\"11\" rx=\"2\" />\n <path d=\"M2 6.5h12M5.5 1.5v3M10.5 1.5v3\" />\n </svg>\n {label}\n </span>\n </button>\n </PopoverPrimitive.Trigger>\n <input\n ref={proxy}\n type=\"text\"\n name={props.name}\n value={value}\n onChange={() => undefined}\n required={props.required}\n disabled={props.disabled}\n tabIndex={-1}\n aria-hidden=\"true\"\n onFocus={() => trigger.current?.focus()}\n className=\"pointer-events-none absolute inset-0 h-full w-full opacity-0\"\n />\n </div>\n <PopoverPrimitive.Portal {...(container ? { container } : {})}>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={4}\n className={cn(popoverSurface, \"w-auto p-3\")}\n >\n <DayPicker\n mode=\"single\"\n showOutsideDays\n {...(selected ? { selected, defaultMonth: selected } : {})}\n onSelect={(date) => {\n if (!date) return;\n commit(toIsoDate(date));\n setOpen(false);\n trigger.current?.focus();\n }}\n classNames={{\n root: \"relative text-sm\",\n months: \"relative flex flex-col gap-4\",\n month: \"flex flex-col gap-3\",\n month_caption: \"flex h-8 items-center justify-center px-8 font-medium\",\n nav: \"absolute inset-x-0 top-0 flex items-center justify-between\",\n button_previous:\n \"inline-flex size-8 items-center justify-center rounded-md border border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50\",\n button_next:\n \"inline-flex size-8 items-center justify-center rounded-md border border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50\",\n month_grid: \"w-full border-collapse\",\n weekdays: \"flex\",\n weekday: \"w-9 text-[0.8rem] font-normal text-muted-foreground\",\n week: \"mt-1 flex w-full\",\n day: \"relative size-9 p-0 text-center\",\n day_button:\n \"inline-flex size-9 items-center justify-center rounded-md text-sm font-normal hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50\",\n selected:\n \"[&>button]:bg-primary [&>button]:text-primary-foreground [&>button:hover]:bg-primary [&>button:hover]:text-primary-foreground\",\n today: \"[&>button]:bg-accent [&>button]:text-accent-foreground\",\n outside: \"[&>button]:text-muted-foreground [&>button]:opacity-50\",\n disabled: \"[&>button]:opacity-40\",\n hidden: \"invisible\",\n }}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n",
|
|
55
|
+
"type": "registry:ui"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"path": "components/uibot/interaction.ts",
|
|
59
|
+
"target": "components/uibot/interaction.ts",
|
|
60
|
+
"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",
|
|
61
|
+
"type": "registry:ui"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"path": "components/uibot/icons.tsx",
|
|
65
|
+
"target": "components/uibot/icons.tsx",
|
|
66
|
+
"content": "/*\nISC License\n\nCopyright (c) 2026 Lucide Icons and Contributors\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n---\n\nThe following Lucide icons are derived from the Feather project:\n\nairplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out\n\nThe MIT License (MIT) (for the icons listed above)\n\nCopyright (c) 2013-present Cole Bemis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n// Icon paths from lucide-react 1.8.0 (ISC); see docs/shadcn-admin-attribution.md.\nimport { createElement } from \"react\";\nconst paths: Record<string, [string, Record<string, string>][]> = {\n \"panel-left\": [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M9 3v18\", key: \"fh3hqa\" }],\n ],\n \"layout-dashboard\": [\n [\"rect\", { width: \"7\", height: \"9\", x: \"3\", y: \"3\", rx: \"1\", key: \"10lvy0\" }],\n [\"rect\", { width: \"7\", height: \"5\", x: \"14\", y: \"3\", rx: \"1\", key: \"16une8\" }],\n [\"rect\", { width: \"7\", height: \"9\", x: \"14\", y: \"12\", rx: \"1\", key: \"1hutg5\" }],\n [\"rect\", { width: \"7\", height: \"5\", x: \"3\", y: \"16\", rx: \"1\", key: \"ldoo1y\" }],\n ],\n \"list-todo\": [\n [\"path\", { d: \"M13 5h8\", key: \"a7qcls\" }],\n [\"path\", { d: \"M13 12h8\", key: \"h98zly\" }],\n [\"path\", { d: \"M13 19h8\", key: \"c3s6r1\" }],\n [\"path\", { d: \"m3 17 2 2 4-4\", key: \"1jhpwq\" }],\n [\"rect\", { x: \"3\", y: \"4\", width: \"6\", height: \"6\", rx: \"1\", key: \"cif1o7\" }],\n ],\n users: [\n [\"path\", { d: \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\", key: \"1yyitq\" }],\n [\"path\", { d: \"M16 3.128a4 4 0 0 1 0 7.744\", key: \"16gr8j\" }],\n [\"path\", { d: \"M22 21v-2a4 4 0 0 0-3-3.87\", key: \"kshegd\" }],\n [\"circle\", { cx: \"9\", cy: \"7\", r: \"4\", key: \"nufk8\" }],\n ],\n settings: [\n [\n \"path\",\n {\n d: \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\",\n key: \"1i5ecw\",\n },\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }],\n ],\n \"message-circle\": [\n [\n \"path\",\n {\n d: \"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\",\n key: \"1sd12s\",\n },\n ],\n ],\n command: [\n [\n \"path\",\n {\n d: \"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3\",\n key: \"11bfej\",\n },\n ],\n ],\n search: [\n [\"path\", { d: \"m21 21-4.34-4.34\", key: \"14j7rj\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }],\n ],\n sun: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"4\", key: \"4exip2\" }],\n [\"path\", { d: \"M12 2v2\", key: \"tus03m\" }],\n [\"path\", { d: \"M12 20v2\", key: \"1lh1kg\" }],\n [\"path\", { d: \"m4.93 4.93 1.41 1.41\", key: \"149t6j\" }],\n [\"path\", { d: \"m17.66 17.66 1.41 1.41\", key: \"ptbguv\" }],\n [\"path\", { d: \"M2 12h2\", key: \"1t8f8n\" }],\n [\"path\", { d: \"M20 12h2\", key: \"1q8mjw\" }],\n [\"path\", { d: \"m6.34 17.66-1.41 1.41\", key: \"1m8zz5\" }],\n [\"path\", { d: \"m19.07 4.93-1.41 1.41\", key: \"1shlcs\" }],\n ],\n moon: [\n [\n \"path\",\n {\n d: \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\",\n key: \"kfwtm\",\n },\n ],\n ],\n \"chevron-down\": [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]],\n \"chevron-right\": [[\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]],\n \"chevrons-up-down\": [\n [\"path\", { d: \"m7 15 5 5 5-5\", key: \"1hf1tw\" }],\n [\"path\", { d: \"m7 9 5-5 5 5\", key: \"sgt6xg\" }],\n ],\n plus: [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }],\n ],\n download: [\n [\"path\", { d: \"M12 15V3\", key: \"m9g1x1\" }],\n [\"path\", { d: \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\", key: \"ih7n3h\" }],\n [\"path\", { d: \"m7 10 5 5 5-5\", key: \"brsn70\" }],\n ],\n \"sliders-horizontal\": [\n [\"path\", { d: \"M10 5H3\", key: \"1qgfaw\" }],\n [\"path\", { d: \"M12 19H3\", key: \"yhmn1j\" }],\n [\"path\", { d: \"M14 3v4\", key: \"1sua03\" }],\n [\"path\", { d: \"M16 17v4\", key: \"1q0r14\" }],\n [\"path\", { d: \"M21 12h-9\", key: \"1o4lsq\" }],\n [\"path\", { d: \"M21 19h-5\", key: \"1rlt1p\" }],\n [\"path\", { d: \"M21 5h-7\", key: \"1oszz2\" }],\n [\"path\", { d: \"M8 10v4\", key: \"tgpxqk\" }],\n [\"path\", { d: \"M8 12H3\", key: \"a7s4jb\" }],\n ],\n shield: [\n [\n \"path\",\n {\n d: \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\",\n key: \"oel41y\",\n },\n ],\n ],\n \"log-out\": [\n [\"path\", { d: \"m16 17 5-5-5-5\", key: \"1bji2h\" }],\n [\"path\", { d: \"M21 12H9\", key: \"dn1m92\" }],\n [\"path\", { d: \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\", key: \"1uf3rs\" }],\n ],\n boxes: [\n [\n \"path\",\n {\n d: \"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z\",\n key: \"lc1i9w\",\n },\n ],\n [\"path\", { d: \"m7 16.5-4.74-2.85\", key: \"1o9zyk\" }],\n [\"path\", { d: \"m7 16.5 5-3\", key: \"va8pkn\" }],\n [\"path\", { d: \"M7 16.5v5.17\", key: \"jnp8gn\" }],\n [\n \"path\",\n {\n d: \"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z\",\n key: \"8zsnat\",\n },\n ],\n [\"path\", { d: \"m17 16.5-5-3\", key: \"8arw3v\" }],\n [\"path\", { d: \"m17 16.5 4.74-2.85\", key: \"8rfmw\" }],\n [\"path\", { d: \"M17 16.5v5.17\", key: \"k6z78m\" }],\n [\n \"path\",\n {\n d: \"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z\",\n key: \"1xygjf\",\n },\n ],\n [\"path\", { d: \"M12 8 7.26 5.15\", key: \"1vbdud\" }],\n [\"path\", { d: \"m12 8 4.74-2.85\", key: \"3rx089\" }],\n [\"path\", { d: \"M12 13.5V8\", key: \"1io7kd\" }],\n ],\n \"chart-no-axes-column\": [\n [\"path\", { d: \"M5 21v-6\", key: \"1hz6c0\" }],\n [\"path\", { d: \"M12 21V3\", key: \"1lcnhd\" }],\n [\"path\", { d: \"M19 21V9\", key: \"unv183\" }],\n ],\n ellipsis: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"19\", cy: \"12\", r: \"1\", key: \"1wjl8i\" }],\n [\"circle\", { cx: \"5\", cy: \"12\", r: \"1\", key: \"1pcz8c\" }],\n ],\n \"arrow-up\": [\n [\"path\", { d: \"m5 12 7-7 7 7\", key: \"hav0vg\" }],\n [\"path\", { d: \"M12 19V5\", key: \"x0mq9r\" }],\n ],\n \"arrow-down\": [\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }],\n [\"path\", { d: \"m19 12-7 7-7-7\", key: \"1idqje\" }],\n ],\n x: [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }],\n ],\n check: [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]],\n send: [\n [\n \"path\",\n {\n d: \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\",\n key: \"1ffxy3\",\n },\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\", key: \"12cjpa\" }],\n ],\n mail: [\n [\"path\", { d: \"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7\", key: \"132q7q\" }],\n [\"rect\", { x: \"2\", y: \"4\", width: \"20\", height: \"16\", rx: \"2\", key: \"izxlao\" }],\n ],\n calendar: [\n [\"path\", { d: \"M8 2v4\", key: \"1cmpym\" }],\n [\"path\", { d: \"M16 2v4\", key: \"4m81vk\" }],\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"4\", rx: \"2\", key: \"1hopcy\" }],\n [\"path\", { d: \"M3 10h18\", key: \"8toen8\" }],\n ],\n eye: [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\",\n },\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }],\n ],\n \"eye-off\": [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\",\n },\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\",\n },\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }],\n ],\n};\nexport function Icon({ name, size = 18 }: { name: string; size?: number }) {\n const nodes = paths[name] ?? paths.boxes ?? [];\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n style={{ flexShrink: 0 }}\n >\n {nodes.map(([tag, attributes]) => createElement(tag, attributes))}\n </svg>\n );\n}\n",
|
|
67
|
+
"type": "registry:ui"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"path": "components/uibot/sidebars/ui-dropdown-menu.tsx",
|
|
71
|
+
"target": "components/uibot/sidebars/ui-dropdown-menu.tsx",
|
|
72
|
+
"content": "// Adapted from shadcn/ui (MIT). See THIRD_PARTY_LICENSE and provenance.json.\n\"use client\";\n\nimport type * as React from \"react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"./utils\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\n\nfunction DropdownMenu({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: 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}: ComponentProps<typeof DropdownMenuPrimitive.Content> & {\n container?: 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 }: 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}: 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}: 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}: 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}: 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}: 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}: 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 }: 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 }: 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}: 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}: 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",
|
|
73
|
+
"type": "registry:ui"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"path": "components/uibot/sidebars/utils.ts",
|
|
77
|
+
"target": "components/uibot/sidebars/utils.ts",
|
|
78
|
+
"content": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n",
|
|
79
|
+
"type": "registry:ui"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"path": "components/uibot/data-table.uibot.json",
|
|
83
|
+
"target": "components/uibot/data-table.uibot.json",
|
|
84
|
+
"content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"data-table\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"DataTable\",\n \"export\": \"DataTable\",\n \"module\": \"data-table.tsx\",\n \"catalog\": {\n \"name\": \"DataTable\",\n \"description\": \"Configurable record table with search, facets, sorting, stable selection and pagination. Server mode emits query intent without filtering current-page rows.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"table\",\n \"records\",\n \"admin\"\n ],\n \"props\": {\n \"locale\": {\n \"type\": \"string\",\n \"enum\": [\n \"en\",\n \"zh-CN\"\n ],\n \"default\": \"en\",\n \"description\": \"UI language\"\n },\n \"rows\": {\n \"type\": \"array\"\n },\n \"columns\": {\n \"type\": \"array\",\n \"description\": \"action,editor(text|number|select),options\"\n },\n \"reorderable\": {\n \"type\": \"boolean\"\n },\n \"rowOrder\": {\n \"type\": \"array\"\n },\n \"cellFeedback\": {\n \"type\": \"object\",\n \"description\": \"id,column,operationId,attempt,status,message\"\n },\n \"views\": {\n \"type\": \"array\",\n \"description\": \"value,label,badge,placeholder\"\n },\n \"searchable\": {\n \"type\": \"boolean\"\n },\n \"addLabel\": {\n \"type\": \"string\"\n },\n \"filters\": {\n \"type\": \"array\"\n },\n \"actions\": {\n \"type\": \"array\"\n },\n \"bulkActions\": {\n \"type\": \"array\"\n },\n \"rowKey\": {\n \"type\": \"string\",\n \"default\": \"id\"\n },\n \"searchKeys\": {\n \"type\": \"array\"\n },\n \"selectedIds\": {\n \"type\": \"array\"\n },\n \"view\": {\n \"description\": \"TableView or URL view JSON\"\n },\n \"pageSize\": {\n \"type\": \"number\",\n \"default\": 10\n },\n \"server\": {\n \"type\": \"boolean\"\n },\n \"total\": {\n \"type\": \"number\"\n },\n \"hasNextPage\": {\n \"type\": \"boolean\"\n },\n \"loading\": {\n \"type\": \"boolean\"\n },\n \"error\": {\n \"type\": \"string\"\n },\n \"minWidth\": {\n \"type\": \"number\"\n },\n \"searchPlaceholder\": {\n \"type\": \"string\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"selectable\": {\n \"type\": \"boolean\"\n },\n \"emptyText\": {\n \"type\": \"string\"\n }\n },\n \"events\": {\n \"onViewChange\": {\n \"description\": \"event.values: search,filters JSON,sort,descending,page,pageSize,tab\"\n },\n \"onSelectionChange\": {\n \"description\": \"Stable ids in event.values.ids\"\n },\n \"onRowAction\": {\n \"description\": \"event.values.id and action\"\n },\n \"onBulkAction\": {\n \"description\": \"event.values.ids and action\"\n },\n \"onReorder\": {\n \"description\": \"ids,activeId,overId\"\n },\n \"onCellChange\": {\n \"description\": \"id,column,value,version,operationId,attempt; reply cellFeedback\"\n },\n \"onAdd\": {\n \"description\": \"Create intent\"\n }\n }\n }\n }\n ]\n}\n",
|
|
85
|
+
"type": "registry:ui"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"meta": {
|
|
89
|
+
"category": "composite",
|
|
90
|
+
"level": "L2",
|
|
91
|
+
"props": {
|
|
92
|
+
"locale": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"enum": [
|
|
95
|
+
"en",
|
|
96
|
+
"zh-CN"
|
|
97
|
+
],
|
|
98
|
+
"default": "en",
|
|
99
|
+
"description": "UI language"
|
|
100
|
+
},
|
|
101
|
+
"rows": {
|
|
102
|
+
"type": "array"
|
|
103
|
+
},
|
|
104
|
+
"columns": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"description": "action,editor(text|number|select),options"
|
|
107
|
+
},
|
|
108
|
+
"reorderable": {
|
|
109
|
+
"type": "boolean"
|
|
110
|
+
},
|
|
111
|
+
"rowOrder": {
|
|
112
|
+
"type": "array"
|
|
113
|
+
},
|
|
114
|
+
"cellFeedback": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"description": "id,column,operationId,attempt,status,message"
|
|
117
|
+
},
|
|
118
|
+
"views": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"description": "value,label,badge,placeholder"
|
|
121
|
+
},
|
|
122
|
+
"searchable": {
|
|
123
|
+
"type": "boolean"
|
|
124
|
+
},
|
|
125
|
+
"addLabel": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
"filters": {
|
|
129
|
+
"type": "array"
|
|
130
|
+
},
|
|
131
|
+
"actions": {
|
|
132
|
+
"type": "array"
|
|
133
|
+
},
|
|
134
|
+
"bulkActions": {
|
|
135
|
+
"type": "array"
|
|
136
|
+
},
|
|
137
|
+
"rowKey": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"default": "id"
|
|
140
|
+
},
|
|
141
|
+
"searchKeys": {
|
|
142
|
+
"type": "array"
|
|
143
|
+
},
|
|
144
|
+
"selectedIds": {
|
|
145
|
+
"type": "array"
|
|
146
|
+
},
|
|
147
|
+
"view": {
|
|
148
|
+
"description": "TableView or URL view JSON"
|
|
149
|
+
},
|
|
150
|
+
"pageSize": {
|
|
151
|
+
"type": "number",
|
|
152
|
+
"default": 10
|
|
153
|
+
},
|
|
154
|
+
"server": {
|
|
155
|
+
"type": "boolean"
|
|
156
|
+
},
|
|
157
|
+
"total": {
|
|
158
|
+
"type": "number"
|
|
159
|
+
},
|
|
160
|
+
"hasNextPage": {
|
|
161
|
+
"type": "boolean"
|
|
162
|
+
},
|
|
163
|
+
"loading": {
|
|
164
|
+
"type": "boolean"
|
|
165
|
+
},
|
|
166
|
+
"error": {
|
|
167
|
+
"type": "string"
|
|
168
|
+
},
|
|
169
|
+
"minWidth": {
|
|
170
|
+
"type": "number"
|
|
171
|
+
},
|
|
172
|
+
"searchPlaceholder": {
|
|
173
|
+
"type": "string"
|
|
174
|
+
},
|
|
175
|
+
"label": {
|
|
176
|
+
"type": "string"
|
|
177
|
+
},
|
|
178
|
+
"selectable": {
|
|
179
|
+
"type": "boolean"
|
|
180
|
+
},
|
|
181
|
+
"emptyText": {
|
|
182
|
+
"type": "string"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"events": {
|
|
186
|
+
"onViewChange": {
|
|
187
|
+
"description": "event.values: search,filters JSON,sort,descending,page,pageSize,tab"
|
|
188
|
+
},
|
|
189
|
+
"onSelectionChange": {
|
|
190
|
+
"description": "Stable ids in event.values.ids"
|
|
191
|
+
},
|
|
192
|
+
"onRowAction": {
|
|
193
|
+
"description": "event.values.id and action"
|
|
194
|
+
},
|
|
195
|
+
"onBulkAction": {
|
|
196
|
+
"description": "event.values.ids and action"
|
|
197
|
+
},
|
|
198
|
+
"onReorder": {
|
|
199
|
+
"description": "ids,activeId,overId"
|
|
200
|
+
},
|
|
201
|
+
"onCellChange": {
|
|
202
|
+
"description": "id,column,value,version,operationId,attempt; reply cellFeedback"
|
|
203
|
+
},
|
|
204
|
+
"onAdd": {
|
|
205
|
+
"description": "Create intent"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"provides": [
|
|
209
|
+
"DataTable"
|
|
210
|
+
],
|
|
211
|
+
"uibot": {
|
|
212
|
+
"schema": "uibot.registry.item.v1",
|
|
213
|
+
"item": "data-table",
|
|
214
|
+
"channel": "public",
|
|
215
|
+
"components": [
|
|
216
|
+
{
|
|
217
|
+
"name": "DataTable",
|
|
218
|
+
"export": "DataTable",
|
|
219
|
+
"module": "data-table.tsx",
|
|
220
|
+
"catalog": {
|
|
221
|
+
"name": "DataTable",
|
|
222
|
+
"description": "Configurable record table with search, facets, sorting, stable selection and pagination. Server mode emits query intent without filtering current-page rows.",
|
|
223
|
+
"category": "composite",
|
|
224
|
+
"level": "L2",
|
|
225
|
+
"tags": [
|
|
226
|
+
"table",
|
|
227
|
+
"records",
|
|
228
|
+
"admin"
|
|
229
|
+
],
|
|
230
|
+
"props": {
|
|
231
|
+
"locale": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"enum": [
|
|
234
|
+
"en",
|
|
235
|
+
"zh-CN"
|
|
236
|
+
],
|
|
237
|
+
"default": "en",
|
|
238
|
+
"description": "UI language"
|
|
239
|
+
},
|
|
240
|
+
"rows": {
|
|
241
|
+
"type": "array"
|
|
242
|
+
},
|
|
243
|
+
"columns": {
|
|
244
|
+
"type": "array",
|
|
245
|
+
"description": "action,editor(text|number|select),options"
|
|
246
|
+
},
|
|
247
|
+
"reorderable": {
|
|
248
|
+
"type": "boolean"
|
|
249
|
+
},
|
|
250
|
+
"rowOrder": {
|
|
251
|
+
"type": "array"
|
|
252
|
+
},
|
|
253
|
+
"cellFeedback": {
|
|
254
|
+
"type": "object",
|
|
255
|
+
"description": "id,column,operationId,attempt,status,message"
|
|
256
|
+
},
|
|
257
|
+
"views": {
|
|
258
|
+
"type": "array",
|
|
259
|
+
"description": "value,label,badge,placeholder"
|
|
260
|
+
},
|
|
261
|
+
"searchable": {
|
|
262
|
+
"type": "boolean"
|
|
263
|
+
},
|
|
264
|
+
"addLabel": {
|
|
265
|
+
"type": "string"
|
|
266
|
+
},
|
|
267
|
+
"filters": {
|
|
268
|
+
"type": "array"
|
|
269
|
+
},
|
|
270
|
+
"actions": {
|
|
271
|
+
"type": "array"
|
|
272
|
+
},
|
|
273
|
+
"bulkActions": {
|
|
274
|
+
"type": "array"
|
|
275
|
+
},
|
|
276
|
+
"rowKey": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"default": "id"
|
|
279
|
+
},
|
|
280
|
+
"searchKeys": {
|
|
281
|
+
"type": "array"
|
|
282
|
+
},
|
|
283
|
+
"selectedIds": {
|
|
284
|
+
"type": "array"
|
|
285
|
+
},
|
|
286
|
+
"view": {
|
|
287
|
+
"description": "TableView or URL view JSON"
|
|
288
|
+
},
|
|
289
|
+
"pageSize": {
|
|
290
|
+
"type": "number",
|
|
291
|
+
"default": 10
|
|
292
|
+
},
|
|
293
|
+
"server": {
|
|
294
|
+
"type": "boolean"
|
|
295
|
+
},
|
|
296
|
+
"total": {
|
|
297
|
+
"type": "number"
|
|
298
|
+
},
|
|
299
|
+
"hasNextPage": {
|
|
300
|
+
"type": "boolean"
|
|
301
|
+
},
|
|
302
|
+
"loading": {
|
|
303
|
+
"type": "boolean"
|
|
304
|
+
},
|
|
305
|
+
"error": {
|
|
306
|
+
"type": "string"
|
|
307
|
+
},
|
|
308
|
+
"minWidth": {
|
|
309
|
+
"type": "number"
|
|
310
|
+
},
|
|
311
|
+
"searchPlaceholder": {
|
|
312
|
+
"type": "string"
|
|
313
|
+
},
|
|
314
|
+
"label": {
|
|
315
|
+
"type": "string"
|
|
316
|
+
},
|
|
317
|
+
"selectable": {
|
|
318
|
+
"type": "boolean"
|
|
319
|
+
},
|
|
320
|
+
"emptyText": {
|
|
321
|
+
"type": "string"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"events": {
|
|
325
|
+
"onViewChange": {
|
|
326
|
+
"description": "event.values: search,filters JSON,sort,descending,page,pageSize,tab"
|
|
327
|
+
},
|
|
328
|
+
"onSelectionChange": {
|
|
329
|
+
"description": "Stable ids in event.values.ids"
|
|
330
|
+
},
|
|
331
|
+
"onRowAction": {
|
|
332
|
+
"description": "event.values.id and action"
|
|
333
|
+
},
|
|
334
|
+
"onBulkAction": {
|
|
335
|
+
"description": "event.values.ids and action"
|
|
336
|
+
},
|
|
337
|
+
"onReorder": {
|
|
338
|
+
"description": "ids,activeId,overId"
|
|
339
|
+
},
|
|
340
|
+
"onCellChange": {
|
|
341
|
+
"description": "id,column,value,version,operationId,attempt; reply cellFeedback"
|
|
342
|
+
},
|
|
343
|
+
"onAdd": {
|
|
344
|
+
"description": "Create intent"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|