@webjsdev/ui 0.3.17 → 0.4.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 +66 -7
- package/THIRD_PARTY_NOTICES.md +349 -0
- package/package.json +4 -2
- package/packages/registry/blocks/_shared/placeholder.svg +1 -0
- package/packages/registry/blocks/charts/chart-area-axes.ts +72 -0
- package/packages/registry/blocks/charts/chart-area-default.ts +64 -0
- package/packages/registry/blocks/charts/chart-area-gradient.ts +82 -0
- package/packages/registry/blocks/charts/chart-area-icons.ts +77 -0
- package/packages/registry/blocks/charts/chart-area-interactive.ts +204 -0
- package/packages/registry/blocks/charts/chart-area-legend.ts +72 -0
- package/packages/registry/blocks/charts/chart-area-linear.ts +64 -0
- package/packages/registry/blocks/charts/chart-area-stacked-expand.ts +77 -0
- package/packages/registry/blocks/charts/chart-area-stacked.ts +71 -0
- package/packages/registry/blocks/charts/chart-area-step.ts +68 -0
- package/packages/registry/blocks/charts/chart-bar-active.ts +93 -0
- package/packages/registry/blocks/charts/chart-bar-default.ts +60 -0
- package/packages/registry/blocks/charts/chart-bar-horizontal.ts +62 -0
- package/packages/registry/blocks/charts/chart-bar-interactive.ts +185 -0
- package/packages/registry/blocks/charts/chart-bar-label-custom.ts +78 -0
- package/packages/registry/blocks/charts/chart-bar-label.ts +66 -0
- package/packages/registry/blocks/charts/chart-bar-mixed.ts +87 -0
- package/packages/registry/blocks/charts/chart-bar-multiple.ts +67 -0
- package/packages/registry/blocks/charts/chart-bar-negative.ts +61 -0
- package/packages/registry/blocks/charts/chart-bar-stacked.ts +68 -0
- package/packages/registry/blocks/charts/chart-line-default.ts +61 -0
- package/packages/registry/blocks/charts/chart-line-dots-colors.ts +86 -0
- package/packages/registry/blocks/charts/chart-line-dots-custom.ts +75 -0
- package/packages/registry/blocks/charts/chart-line-dots.ts +65 -0
- package/packages/registry/blocks/charts/chart-line-interactive.ts +185 -0
- package/packages/registry/blocks/charts/chart-line-label-custom.ts +94 -0
- package/packages/registry/blocks/charts/chart-line-label.ts +73 -0
- package/packages/registry/blocks/charts/chart-line-linear.ts +61 -0
- package/packages/registry/blocks/charts/chart-line-multiple.ts +71 -0
- package/packages/registry/blocks/charts/chart-line-step.ts +61 -0
- package/packages/registry/blocks/charts/chart-pie-donut-active.ts +86 -0
- package/packages/registry/blocks/charts/chart-pie-donut-text.ts +89 -0
- package/packages/registry/blocks/charts/chart-pie-donut.ts +77 -0
- package/packages/registry/blocks/charts/chart-pie-interactive.ts +120 -0
- package/packages/registry/blocks/charts/chart-pie-label-custom.ts +82 -0
- package/packages/registry/blocks/charts/chart-pie-label-list.ts +86 -0
- package/packages/registry/blocks/charts/chart-pie-label.ts +77 -0
- package/packages/registry/blocks/charts/chart-pie-legend.ts +79 -0
- package/packages/registry/blocks/charts/chart-pie-separator-none.ts +77 -0
- package/packages/registry/blocks/charts/chart-pie-simple.ts +77 -0
- package/packages/registry/blocks/charts/chart-pie-stacked.ts +99 -0
- package/packages/registry/blocks/charts/chart-radar-default.ts +61 -0
- package/packages/registry/blocks/charts/chart-radar-dots.ts +61 -0
- package/packages/registry/blocks/charts/chart-radar-grid-circle-fill.ts +61 -0
- package/packages/registry/blocks/charts/chart-radar-grid-circle-no-lines.ts +61 -0
- package/packages/registry/blocks/charts/chart-radar-grid-circle.ts +61 -0
- package/packages/registry/blocks/charts/chart-radar-grid-custom.ts +61 -0
- package/packages/registry/blocks/charts/chart-radar-grid-fill.ts +61 -0
- package/packages/registry/blocks/charts/chart-radar-grid-none.ts +60 -0
- package/packages/registry/blocks/charts/chart-radar-icons.ts +76 -0
- package/packages/registry/blocks/charts/chart-radar-label-custom.ts +77 -0
- package/packages/registry/blocks/charts/chart-radar-legend.ts +70 -0
- package/packages/registry/blocks/charts/chart-radar-lines-only.ts +68 -0
- package/packages/registry/blocks/charts/chart-radar-multiple.ts +68 -0
- package/packages/registry/blocks/charts/chart-radar-radius.ts +68 -0
- package/packages/registry/blocks/charts/chart-radial-grid.ts +80 -0
- package/packages/registry/blocks/charts/chart-radial-label.ts +85 -0
- package/packages/registry/blocks/charts/chart-radial-shape.ts +81 -0
- package/packages/registry/blocks/charts/chart-radial-simple.ts +79 -0
- package/packages/registry/blocks/charts/chart-radial-stacked.ts +69 -0
- package/packages/registry/blocks/charts/chart-radial-text.ts +82 -0
- package/packages/registry/blocks/charts/chart-tooltip-advanced.ts +84 -0
- package/packages/registry/blocks/charts/chart-tooltip-default.ts +62 -0
- package/packages/registry/blocks/charts/chart-tooltip-formatter.ts +75 -0
- package/packages/registry/blocks/charts/chart-tooltip-icons.ts +68 -0
- package/packages/registry/blocks/charts/chart-tooltip-indicator-line.ts +62 -0
- package/packages/registry/blocks/charts/chart-tooltip-indicator-none.ts +62 -0
- package/packages/registry/blocks/charts/chart-tooltip-label-custom.ts +65 -0
- package/packages/registry/blocks/charts/chart-tooltip-label-formatter.ts +66 -0
- package/packages/registry/blocks/charts/chart-tooltip-label-none.ts +62 -0
- package/packages/registry/blocks/dashboard-01/components/app-sidebar.ts +108 -0
- package/packages/registry/blocks/dashboard-01/components/chart-area-interactive.ts +276 -0
- package/packages/registry/blocks/dashboard-01/components/dashboard-data.ts +89 -0
- package/packages/registry/blocks/dashboard-01/components/data-table.ts +637 -0
- package/packages/registry/blocks/dashboard-01/components/nav-documents.ts +65 -0
- package/packages/registry/blocks/dashboard-01/components/nav-main.ts +61 -0
- package/packages/registry/blocks/dashboard-01/components/nav-secondary.ts +40 -0
- package/packages/registry/blocks/dashboard-01/components/nav-user.ts +66 -0
- package/packages/registry/blocks/dashboard-01/components/section-cards.ts +59 -0
- package/packages/registry/blocks/dashboard-01/components/site-header.ts +52 -0
- package/packages/registry/blocks/dashboard-01/page.ts +39 -0
- package/packages/registry/blocks/login-01/components/login-form.ts +70 -0
- package/packages/registry/blocks/login-01/page.ts +19 -0
- package/packages/registry/blocks/login-02/components/login-form.ts +68 -0
- package/packages/registry/blocks/login-02/page.ts +36 -0
- package/packages/registry/blocks/login-03/components/login-form.ts +89 -0
- package/packages/registry/blocks/login-03/page.ts +28 -0
- package/packages/registry/blocks/login-04/components/login-form.ts +91 -0
- package/packages/registry/blocks/login-04/page.ts +20 -0
- package/packages/registry/blocks/login-05/components/login-form.ts +75 -0
- package/packages/registry/blocks/login-05/page.ts +19 -0
- package/packages/registry/blocks/preview/cards/activate-agent-dialog.ts +77 -0
- package/packages/registry/blocks/preview/cards/analytics-card.ts +64 -0
- package/packages/registry/blocks/preview/cards/anomaly-alert.ts +35 -0
- package/packages/registry/blocks/preview/cards/bar-chart-card.ts +91 -0
- package/packages/registry/blocks/preview/cards/book-appointment.ts +51 -0
- package/packages/registry/blocks/preview/cards/codespaces-card.ts +172 -0
- package/packages/registry/blocks/preview/cards/contributions-activity.ts +63 -0
- package/packages/registry/blocks/preview/cards/contributors.ts +51 -0
- package/packages/registry/blocks/preview/cards/environment-variables.ts +47 -0
- package/packages/registry/blocks/preview/cards/feedback-form.ts +61 -0
- package/packages/registry/blocks/preview/cards/file-upload.ts +51 -0
- package/packages/registry/blocks/preview/cards/github-profile.ts +66 -0
- package/packages/registry/blocks/preview/cards/icon-preview-grid.ts +47 -0
- package/packages/registry/blocks/preview/cards/invite-team.ts +78 -0
- package/packages/registry/blocks/preview/cards/invoice.ts +91 -0
- package/packages/registry/blocks/preview/cards/live-waveform.ts +330 -0
- package/packages/registry/blocks/preview/cards/no-team-members.ts +61 -0
- package/packages/registry/blocks/preview/cards/not-found.ts +46 -0
- package/packages/registry/blocks/preview/cards/observability-card.ts +44 -0
- package/packages/registry/blocks/preview/cards/pie-chart-card.ts +84 -0
- package/packages/registry/blocks/preview/cards/report-bug.ts +71 -0
- package/packages/registry/blocks/preview/cards/shipping-address.ts +79 -0
- package/packages/registry/blocks/preview/cards/shortcuts.ts +57 -0
- package/packages/registry/blocks/preview/cards/skeleton-loading.ts +37 -0
- package/packages/registry/blocks/preview/cards/sleep-report.ts +85 -0
- package/packages/registry/blocks/preview/cards/style-overview.ts +64 -0
- package/packages/registry/blocks/preview/cards/typography-specimen.ts +107 -0
- package/packages/registry/blocks/preview/cards/ui-elements.ts +164 -0
- package/packages/registry/blocks/preview/cards/usage-card.ts +63 -0
- package/packages/registry/blocks/preview/cards/visitors.ts +71 -0
- package/packages/registry/blocks/preview/cards/weekly-fitness-summary.ts +54 -0
- package/packages/registry/blocks/preview/page.ts +103 -0
- package/packages/registry/blocks/preview-02/cards/account-access.ts +70 -0
- package/packages/registry/blocks/preview-02/cards/card-overview.ts +75 -0
- package/packages/registry/blocks/preview-02/cards/claimable-balance.ts +54 -0
- package/packages/registry/blocks/preview-02/cards/contribution-history.ts +80 -0
- package/packages/registry/blocks/preview-02/cards/cover-art.ts +41 -0
- package/packages/registry/blocks/preview-02/cards/dividend-income.ts +76 -0
- package/packages/registry/blocks/preview-02/cards/empty-connect-bank.ts +38 -0
- package/packages/registry/blocks/preview-02/cards/empty-distribute-track.ts +38 -0
- package/packages/registry/blocks/preview-02/cards/empty-explore-catalog.ts +39 -0
- package/packages/registry/blocks/preview-02/cards/faq.ts +79 -0
- package/packages/registry/blocks/preview-02/cards/front-door.ts +40 -0
- package/packages/registry/blocks/preview-02/cards/index-investing.ts +31 -0
- package/packages/registry/blocks/preview-02/cards/kitchen-island.ts +90 -0
- package/packages/registry/blocks/preview-02/cards/loading-card.ts +34 -0
- package/packages/registry/blocks/preview-02/cards/new-milestone.ts +53 -0
- package/packages/registry/blocks/preview-02/cards/notification-settings.ts +126 -0
- package/packages/registry/blocks/preview-02/cards/payments.ts +88 -0
- package/packages/registry/blocks/preview-02/cards/payout-threshold.ts +92 -0
- package/packages/registry/blocks/preview-02/cards/power-usage.ts +84 -0
- package/packages/registry/blocks/preview-02/cards/preferences.ts +89 -0
- package/packages/registry/blocks/preview-02/cards/qr-connect.ts +54 -0
- package/packages/registry/blocks/preview-02/cards/receiving-method.ts +89 -0
- package/packages/registry/blocks/preview-02/cards/recent-transactions.ts +101 -0
- package/packages/registry/blocks/preview-02/cards/release-catalog.ts +73 -0
- package/packages/registry/blocks/preview-02/cards/roller-shades.ts +110 -0
- package/packages/registry/blocks/preview-02/cards/savings-progress.ts +68 -0
- package/packages/registry/blocks/preview-02/cards/savings-targets.ts +132 -0
- package/packages/registry/blocks/preview-02/cards/sidebar-nav.ts +88 -0
- package/packages/registry/blocks/preview-02/cards/social-links.ts +57 -0
- package/packages/registry/blocks/preview-02/cards/stock-performance.ts +106 -0
- package/packages/registry/blocks/preview-02/cards/syncing-state.ts +37 -0
- package/packages/registry/blocks/preview-02/cards/transfer-funds.ts +111 -0
- package/packages/registry/blocks/preview-02/cards/upcoming-payments.ts +69 -0
- package/packages/registry/blocks/preview-02/page.ts +111 -0
- package/packages/registry/blocks/preview-03/cards/files-chat.ts +75 -0
- package/packages/registry/blocks/preview-03/cards/group-chat.ts +114 -0
- package/packages/registry/blocks/preview-03/cards/reasoning-chat.ts +88 -0
- package/packages/registry/blocks/preview-03/cards/simple-chat.ts +53 -0
- package/packages/registry/blocks/preview-03/components/chat-card.ts +126 -0
- package/packages/registry/blocks/preview-03/components/chat-player.ts +174 -0
- package/packages/registry/blocks/preview-03/components/part-file.ts +77 -0
- package/packages/registry/blocks/preview-03/components/part-reasoning.ts +25 -0
- package/packages/registry/blocks/preview-03/components/part-source.ts +48 -0
- package/packages/registry/blocks/preview-03/components/part-text.ts +69 -0
- package/packages/registry/blocks/preview-03/components/part-tool.ts +71 -0
- package/packages/registry/blocks/preview-03/components/prompt-input.ts +86 -0
- package/packages/registry/blocks/preview-03/page.ts +39 -0
- package/packages/registry/blocks/sidebar-01/components/app-sidebar.ts +113 -0
- package/packages/registry/blocks/sidebar-01/components/search-form.ts +33 -0
- package/packages/registry/blocks/sidebar-01/components/version-switcher.ts +50 -0
- package/packages/registry/blocks/sidebar-01/page.ts +58 -0
- package/packages/registry/blocks/sidebar-02/components/app-sidebar.ts +131 -0
- package/packages/registry/blocks/sidebar-02/components/search-form.ts +33 -0
- package/packages/registry/blocks/sidebar-02/components/version-switcher.ts +50 -0
- package/packages/registry/blocks/sidebar-02/page.ts +53 -0
- package/packages/registry/blocks/sidebar-03/components/app-sidebar.ts +134 -0
- package/packages/registry/blocks/sidebar-03/page.ts +60 -0
- package/packages/registry/blocks/sidebar-04/components/app-sidebar.ts +136 -0
- package/packages/registry/blocks/sidebar-04/page.ts +58 -0
- package/packages/registry/blocks/sidebar-05/components/app-sidebar.ts +147 -0
- package/packages/registry/blocks/sidebar-05/components/search-form.ts +33 -0
- package/packages/registry/blocks/sidebar-05/page.ts +58 -0
- package/packages/registry/blocks/sidebar-06/components/app-sidebar.ts +105 -0
- package/packages/registry/blocks/sidebar-06/components/nav-main.ts +56 -0
- package/packages/registry/blocks/sidebar-06/components/sidebar-opt-in-form.ts +44 -0
- package/packages/registry/blocks/sidebar-06/page.ts +57 -0
- package/packages/registry/blocks/sidebar-07/components/app-sidebar.ts +108 -0
- package/packages/registry/blocks/sidebar-07/components/nav-main.ts +61 -0
- package/packages/registry/blocks/sidebar-07/components/nav-projects.ts +65 -0
- package/packages/registry/blocks/sidebar-07/components/nav-user.ts +70 -0
- package/packages/registry/blocks/sidebar-07/components/team-switcher.ts +66 -0
- package/packages/registry/blocks/sidebar-07/page.ts +59 -0
- package/packages/registry/blocks/sidebar-08/components/app-sidebar.ts +122 -0
- package/packages/registry/blocks/sidebar-08/components/nav-main.ts +68 -0
- package/packages/registry/blocks/sidebar-08/components/nav-projects.ts +65 -0
- package/packages/registry/blocks/sidebar-08/components/nav-secondary.ts +40 -0
- package/packages/registry/blocks/sidebar-08/components/nav-user.ts +70 -0
- package/packages/registry/blocks/sidebar-08/page.ts +59 -0
- package/packages/registry/blocks/sidebar-09/components/app-sidebar.ts +213 -0
- package/packages/registry/blocks/sidebar-09/components/nav-user.ts +70 -0
- package/packages/registry/blocks/sidebar-09/page.ts +52 -0
- package/packages/registry/blocks/sidebar-10/components/app-sidebar.ts +125 -0
- package/packages/registry/blocks/sidebar-10/components/nav-actions.ts +84 -0
- package/packages/registry/blocks/sidebar-10/components/nav-favorites.ts +66 -0
- package/packages/registry/blocks/sidebar-10/components/nav-main.ts +37 -0
- package/packages/registry/blocks/sidebar-10/components/nav-secondary.ts +43 -0
- package/packages/registry/blocks/sidebar-10/components/nav-workspaces.ts +78 -0
- package/packages/registry/blocks/sidebar-10/components/team-switcher.ts +63 -0
- package/packages/registry/blocks/sidebar-10/page.ts +46 -0
- package/packages/registry/blocks/sidebar-11/components/app-sidebar.ts +114 -0
- package/packages/registry/blocks/sidebar-11/page.ts +63 -0
- package/packages/registry/blocks/sidebar-12/components/app-sidebar.ts +63 -0
- package/packages/registry/blocks/sidebar-12/components/calendars.ts +53 -0
- package/packages/registry/blocks/sidebar-12/components/date-picker.ts +26 -0
- package/packages/registry/blocks/sidebar-12/components/nav-user.ts +70 -0
- package/packages/registry/blocks/sidebar-12/page.ts +43 -0
- package/packages/registry/blocks/sidebar-13/components/settings-dialog.ts +114 -0
- package/packages/registry/blocks/sidebar-13/page.ts +21 -0
- package/packages/registry/blocks/sidebar-14/components/app-sidebar.ts +120 -0
- package/packages/registry/blocks/sidebar-14/page.ts +55 -0
- package/packages/registry/blocks/sidebar-15/components/calendars.ts +53 -0
- package/packages/registry/blocks/sidebar-15/components/date-picker.ts +26 -0
- package/packages/registry/blocks/sidebar-15/components/nav-favorites.ts +66 -0
- package/packages/registry/blocks/sidebar-15/components/nav-main.ts +35 -0
- package/packages/registry/blocks/sidebar-15/components/nav-secondary.ts +43 -0
- package/packages/registry/blocks/sidebar-15/components/nav-user.ts +70 -0
- package/packages/registry/blocks/sidebar-15/components/nav-workspaces.ts +75 -0
- package/packages/registry/blocks/sidebar-15/components/sidebar-left.ts +126 -0
- package/packages/registry/blocks/sidebar-15/components/sidebar-right.ts +62 -0
- package/packages/registry/blocks/sidebar-15/components/team-switcher.ts +63 -0
- package/packages/registry/blocks/sidebar-15/page.ts +47 -0
- package/packages/registry/blocks/sidebar-16/components/app-sidebar.ts +124 -0
- package/packages/registry/blocks/sidebar-16/components/nav-main.ts +67 -0
- package/packages/registry/blocks/sidebar-16/components/nav-projects.ts +65 -0
- package/packages/registry/blocks/sidebar-16/components/nav-secondary.ts +40 -0
- package/packages/registry/blocks/sidebar-16/components/nav-user.ts +70 -0
- package/packages/registry/blocks/sidebar-16/components/search-form.ts +27 -0
- package/packages/registry/blocks/sidebar-16/components/site-header.ts +42 -0
- package/packages/registry/blocks/sidebar-16/page.ts +38 -0
- package/packages/registry/blocks/signup-01/components/signup-form.ts +78 -0
- package/packages/registry/blocks/signup-01/page.ts +19 -0
- package/packages/registry/blocks/signup-02/components/signup-form.ts +78 -0
- package/packages/registry/blocks/signup-02/page.ts +36 -0
- package/packages/registry/blocks/signup-03/components/signup-form.ts +79 -0
- package/packages/registry/blocks/signup-03/page.ts +28 -0
- package/packages/registry/blocks/signup-04/components/signup-form.ts +100 -0
- package/packages/registry/blocks/signup-04/page.ts +20 -0
- package/packages/registry/blocks/signup-05/components/signup-form.ts +75 -0
- package/packages/registry/blocks/signup-05/page.ts +20 -0
- package/packages/registry/components/accordion.ts +20 -7
- package/packages/registry/components/alert-dialog.ts +58 -13
- package/packages/registry/components/alert.ts +11 -6
- package/packages/registry/components/attachment.ts +119 -0
- package/packages/registry/components/avatar.ts +17 -8
- package/packages/registry/components/badge.ts +16 -9
- package/packages/registry/components/breadcrumb.ts +6 -6
- package/packages/registry/components/bubble.ts +95 -0
- package/packages/registry/components/button-group.ts +73 -0
- package/packages/registry/components/button.ts +35 -25
- package/packages/registry/components/calendar.ts +566 -0
- package/packages/registry/components/card.ts +8 -8
- package/packages/registry/components/carousel.ts +352 -0
- package/packages/registry/components/chart-element.ts +547 -0
- package/packages/registry/components/chart-geometry.ts +457 -0
- package/packages/registry/components/chart.ts +932 -0
- package/packages/registry/components/checkbox.ts +22 -84
- package/packages/registry/components/code-block.ts +191 -0
- package/packages/registry/components/collapsible.ts +5 -2
- package/packages/registry/components/combobox.ts +802 -0
- package/packages/registry/components/command.ts +618 -0
- package/packages/registry/components/context-menu.ts +302 -0
- package/packages/registry/components/dialog.ts +156 -45
- package/packages/registry/components/direction.ts +43 -0
- package/packages/registry/components/drawer.ts +226 -0
- package/packages/registry/components/dropdown-menu.ts +262 -83
- package/packages/registry/components/empty.ts +8 -8
- package/packages/registry/components/field.ts +20 -18
- package/packages/registry/components/floating.ts +124 -0
- package/packages/registry/components/hover-card.ts +19 -8
- package/packages/registry/components/input-group.ts +118 -0
- package/packages/registry/components/input-otp.ts +365 -0
- package/packages/registry/components/input.ts +3 -3
- package/packages/registry/components/item.ts +134 -0
- package/packages/registry/components/kbd.ts +2 -2
- package/packages/registry/components/label.ts +1 -1
- package/packages/registry/components/marker.ts +63 -0
- package/packages/registry/components/menubar.ts +388 -0
- package/packages/registry/components/message-scroller.ts +470 -0
- package/packages/registry/components/message.ts +69 -0
- package/packages/registry/components/native-select.ts +5 -5
- package/packages/registry/components/navigation-menu.ts +564 -0
- package/packages/registry/components/pagination.ts +5 -5
- package/packages/registry/components/popover.ts +30 -84
- package/packages/registry/components/progress.ts +7 -3
- package/packages/registry/components/questionnaire.ts +840 -0
- package/packages/registry/components/radio-group.ts +18 -73
- package/packages/registry/components/resizable.ts +330 -0
- package/packages/registry/components/scroll-area.ts +46 -0
- package/packages/registry/components/select.ts +650 -0
- package/packages/registry/components/separator.ts +1 -1
- package/packages/registry/components/sheet.ts +128 -0
- package/packages/registry/components/sidebar.ts +457 -0
- package/packages/registry/components/skeleton.ts +1 -1
- package/packages/registry/components/slider.ts +333 -0
- package/packages/registry/components/sonner.ts +74 -7
- package/packages/registry/components/spinner.ts +7 -4
- package/packages/registry/components/switch.ts +117 -9
- package/packages/registry/components/table.ts +11 -9
- package/packages/registry/components/tabs.ts +76 -25
- package/packages/registry/components/textarea.ts +1 -1
- package/packages/registry/components/toggle-group.ts +30 -11
- package/packages/registry/components/toggle.ts +20 -13
- package/packages/registry/components/tooltip.ts +68 -7
- package/packages/registry/components/trace.ts +75 -0
- package/packages/registry/lib/icons-hugeicons.ts +955 -0
- package/packages/registry/lib/icons-phosphor.ts +955 -0
- package/packages/registry/lib/icons-remixicon.ts +955 -0
- package/packages/registry/lib/icons-tabler.ts +955 -0
- package/packages/registry/lib/icons.ts +768 -0
- package/packages/registry/lib/utils.ts +49 -4
- package/packages/registry/registry.json +4056 -72
- package/packages/registry/styles/shadcn-tailwind.css +654 -0
- package/packages/registry/styles/style-luma.css +1987 -0
- package/packages/registry/styles/style-lyra.css +1965 -0
- package/packages/registry/styles/style-maia.css +1987 -0
- package/packages/registry/styles/style-mira.css +1992 -0
- package/packages/registry/styles/style-new-york.css +1597 -0
- package/packages/registry/styles/style-nova.css +1990 -0
- package/packages/registry/styles/style-rhea.css +1987 -0
- package/packages/registry/styles/style-sera.css +1977 -0
- package/packages/registry/styles/style-vega.css +1990 -0
- package/packages/registry/styles/supplement.json +54 -0
- package/packages/registry/styles/tw-animate.css +6 -0
- package/packages/registry/themes/base-colors.js +8 -2
- package/packages/registry/themes/fonts.js +120 -0
- package/packages/registry/themes/index.css +2 -0
- package/packages/registry/themes/items.js +61 -0
- package/packages/registry/themes/preset.js +302 -0
- package/packages/registry/themes/themes.js +1193 -0
- package/src/commands/add.js +236 -12
- package/src/commands/diff.js +34 -20
- package/src/commands/info.js +7 -0
- package/src/commands/init.js +125 -8
- package/src/commands/list.js +43 -11
- package/src/commands/view.js +33 -5
- package/src/registry/extract.js +192 -2
- package/src/registry/icons.js +31 -0
- package/src/registry/local.js +15 -1
- package/src/registry/schema.js +13 -0
- package/src/registry/style-bake.js +506 -0
- package/src/utils/theme.js +110 -21
package/src/commands/list.js
CHANGED
|
@@ -1,25 +1,57 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { getRegistryIndex, DEFAULT_REGISTRY_URL } from '../registry/fetcher.js';
|
|
3
|
+
import { uiBlocks, BLOCK_DEFINITION } from '../registry/extract.js';
|
|
3
4
|
import { logger } from '../utils/logger.js';
|
|
4
5
|
|
|
6
|
+
const TYPES = ['ui', 'block', 'chart', 'all'];
|
|
7
|
+
|
|
8
|
+
/** The three labelled groups `list` prints, in order. */
|
|
9
|
+
const GROUPS = [
|
|
10
|
+
['ui', 'Components'],
|
|
11
|
+
['block', `Blocks (${BLOCK_DEFINITION})`],
|
|
12
|
+
['chart', 'Charts'],
|
|
13
|
+
];
|
|
14
|
+
|
|
5
15
|
export const list = new Command()
|
|
6
16
|
.name('list')
|
|
7
17
|
.alias('search')
|
|
8
|
-
.description('List components
|
|
9
|
-
.argument('[filter]', 'filter by substring')
|
|
18
|
+
.description('List the components, blocks and charts in the registry')
|
|
19
|
+
.argument('[filter]', 'filter by substring of the name')
|
|
20
|
+
.option('--type <type>', `ui, block, chart or all (${TYPES.join(' | ')})`, 'all')
|
|
21
|
+
.option('--category <name>', 'only blocks and charts in this category (e.g. login, sidebar, area)')
|
|
22
|
+
.option('--json', 'print one compact JSON array of { name, type, categories, description }')
|
|
10
23
|
.option('--registry <url>', 'registry base URL', DEFAULT_REGISTRY_URL)
|
|
11
24
|
.action(async (filter, opts) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
if (!TYPES.includes(opts.type)) {
|
|
26
|
+
logger.error(`Unknown --type "${opts.type}". Use one of: ${TYPES.join(', ')}.`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
const index = await getRegistryIndex(opts.registry);
|
|
30
|
+
const items = uiBlocks({ type: opts.type, category: opts.category }, index)
|
|
31
|
+
.filter((i) => !filter || i.name.includes(filter));
|
|
32
|
+
|
|
33
|
+
// The JSON form is the whole of stdout, so nothing else is printed.
|
|
34
|
+
if (opts.json) {
|
|
35
|
+
console.log(JSON.stringify(items));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!items.length) {
|
|
16
39
|
logger.info('No matches.');
|
|
17
40
|
return;
|
|
18
41
|
}
|
|
19
|
-
for (const
|
|
20
|
-
const
|
|
21
|
-
|
|
42
|
+
for (const [type, label] of GROUPS) {
|
|
43
|
+
const group = items.filter((i) => i.type === type);
|
|
44
|
+
if (!group.length) continue;
|
|
45
|
+
logger.info(logger.bold(`${label}:`));
|
|
46
|
+
for (const i of group) {
|
|
47
|
+
const desc = i.description ? logger.dim(': ' + i.description) : '';
|
|
48
|
+
logger.info(` ${logger.cyan(i.name)}${desc}`);
|
|
49
|
+
}
|
|
50
|
+
logger.info('');
|
|
22
51
|
}
|
|
23
|
-
|
|
24
|
-
|
|
52
|
+
const count = (type, word) => {
|
|
53
|
+
const n = items.filter((i) => i.type === type).length;
|
|
54
|
+
return n ? `${n} ${word}${n === 1 ? '' : 's'}` : null;
|
|
55
|
+
};
|
|
56
|
+
logger.info([count('ui', 'component'), count('block', 'block'), count('chart', 'chart')].filter(Boolean).join(', ') + '.');
|
|
25
57
|
});
|
package/src/commands/view.js
CHANGED
|
@@ -1,34 +1,62 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { getRegistryItem, DEFAULT_REGISTRY_URL, isDefaultRegistry } from '../registry/fetcher.js';
|
|
3
|
-
import { uiComponent, renderComponentText } from '../registry/extract.js';
|
|
3
|
+
import { uiComponent, renderComponentText, itemKind, projectBlock, renderBlockText } from '../registry/extract.js';
|
|
4
4
|
import { logger } from '../utils/logger.js';
|
|
5
|
+
import { getConfig } from '../utils/get-config.js';
|
|
6
|
+
import { bakeForStyle } from '../registry/style-bake.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The style to bake with: `--style`, else the project's components.json, else
|
|
10
|
+
* the default. Outside a project (no components.json) there is no config to
|
|
11
|
+
* read, which is not an error for `view`.
|
|
12
|
+
*/
|
|
13
|
+
function styleFor(opts) {
|
|
14
|
+
if (opts.style) return opts.style;
|
|
15
|
+
try { return getConfig(process.cwd())?.style; } catch { return undefined; }
|
|
16
|
+
}
|
|
5
17
|
|
|
6
18
|
export const view = new Command()
|
|
7
19
|
.name('view')
|
|
8
20
|
.description("Print a registry item's source (and the paste-ready example) to stdout")
|
|
9
|
-
.argument('<name>', 'component name')
|
|
21
|
+
.argument('<name>', 'component, block or chart name')
|
|
10
22
|
.option('--registry <url>', 'registry base URL', DEFAULT_REGISTRY_URL)
|
|
11
23
|
.option('--source', 'print only the raw source, not the projected view')
|
|
24
|
+
.option('--style <name>', 'the style to bake the source with (default: components.json, else new-york)')
|
|
25
|
+
.option('--json', 'a block or chart: print the projection as one JSON document')
|
|
26
|
+
.option('--files-only', 'a block or chart: print the file list and stop before the sources')
|
|
12
27
|
.action(async (name, opts) => {
|
|
28
|
+
const style = styleFor(opts);
|
|
29
|
+
|
|
30
|
+
// A block or chart (D18) prints what it is, how to install it and where
|
|
31
|
+
// its files land, then the sources, all from the projector the MCP `ui`
|
|
32
|
+
// tool shares. Resolved first, since a block has no component projection.
|
|
33
|
+
const item = await getRegistryItem(name, opts.registry);
|
|
34
|
+
const kind = itemKind(item);
|
|
35
|
+
if (kind === 'block' || kind === 'chart') {
|
|
36
|
+
const block = projectBlock(item, { style, source: !opts.filesOnly });
|
|
37
|
+
console.log(opts.json ? JSON.stringify(block, null, 2) : renderBlockText(block));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
13
40
|
// For a local registry:ui component, lead with the projected view (helper
|
|
14
41
|
// signatures + the paste-ready @example + deps). This is the human /
|
|
15
42
|
// offline path to the example that `add` strips from the copied file, and
|
|
16
43
|
// it shares ONE projector with the MCP `ui` tool (`registry/extract.js`).
|
|
17
44
|
// The projection reads the LOCAL packaged registry, so it only applies to
|
|
18
45
|
// the default registry (a custom --registry gets the raw fetched source).
|
|
19
|
-
const projected = opts.source || !isDefaultRegistry(opts.registry) ? null : uiComponent(name);
|
|
46
|
+
const projected = opts.source || !isDefaultRegistry(opts.registry) ? null : uiComponent(name, { style });
|
|
20
47
|
if (projected) {
|
|
21
48
|
console.log(renderComponentText(projected));
|
|
22
49
|
console.log('');
|
|
23
50
|
logger.info(logger.dim('# --- full source ---'));
|
|
24
51
|
}
|
|
25
52
|
|
|
26
|
-
const item = await getRegistryItem(name, opts.registry);
|
|
27
53
|
logger.info(logger.dim(`# ${item.name}: ${item.type}`));
|
|
28
54
|
if (item.description) logger.info(logger.dim(`# ${item.description}`));
|
|
29
55
|
for (const f of item.files || []) {
|
|
30
56
|
logger.info('');
|
|
31
57
|
logger.info(logger.dim(`# ${f.path}`));
|
|
32
|
-
|
|
58
|
+
// Baked, so the printed source is the plain Tailwind `add` would write
|
|
59
|
+
// (#1666). A custom registry's file with no cn-* name passes unchanged.
|
|
60
|
+
console.log(bakeForStyle(f.content || '', style));
|
|
33
61
|
}
|
|
34
62
|
});
|
package/src/registry/extract.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import { loadRegistryItem, loadRegistryIndex, isCustomElementSource } from './local.js';
|
|
22
|
+
import { bakeForStyle } from './style-bake.js';
|
|
22
23
|
import { extractExample } from './example.js';
|
|
23
24
|
|
|
24
25
|
/**
|
|
@@ -243,17 +244,23 @@ export function extractDocHeader(src) {
|
|
|
243
244
|
* Project one registry component into the agent-facing shape. Returns null when
|
|
244
245
|
* the name is not a `registry:ui` component.
|
|
245
246
|
*
|
|
247
|
+
* The source is BAKED first (#1666): the registry is in base form, and what an
|
|
248
|
+
* agent copies from this projection must be the plain Tailwind an app gets,
|
|
249
|
+
* never a `cn-*` name. `style` is the app's `components.json` style, and an
|
|
250
|
+
* absent one means `new-york`, the kit's default look.
|
|
251
|
+
*
|
|
246
252
|
* @param {string} name
|
|
253
|
+
* @param {{ style?: string }} [opts]
|
|
247
254
|
* @returns {{
|
|
248
255
|
* name: string, tier: 1|2, type: string,
|
|
249
256
|
* description: string, helpers: string[], example: string,
|
|
250
257
|
* dependencies: string[], registryDependencies: string[],
|
|
251
258
|
* } | null}
|
|
252
259
|
*/
|
|
253
|
-
export function uiComponent(name) {
|
|
260
|
+
export function uiComponent(name, opts = {}) {
|
|
254
261
|
const item = loadRegistryItem(name);
|
|
255
262
|
if (!item || item.type !== 'registry:ui') return null;
|
|
256
|
-
const src = (item.files || []).map((f) => f.content || '').join('\n');
|
|
263
|
+
const src = (item.files || []).map((f) => bakeForStyle(f.content || '', opts.style)).join('\n');
|
|
257
264
|
const tier = isCustomElementSource(src) ? 2 : 1;
|
|
258
265
|
return {
|
|
259
266
|
name: item.name,
|
|
@@ -267,6 +274,21 @@ export function uiComponent(name) {
|
|
|
267
274
|
};
|
|
268
275
|
}
|
|
269
276
|
|
|
277
|
+
/**
|
|
278
|
+
* A component's files baked for a style, as `webjs ui view` prints them and
|
|
279
|
+
* `add` writes them (paths are the registry's). The /ui docs' Manual tab
|
|
280
|
+
* shows these, so the page and the CLI cannot disagree about the source.
|
|
281
|
+
*
|
|
282
|
+
* @param {string} name
|
|
283
|
+
* @param {{ style?: string }} [opts]
|
|
284
|
+
* @returns {Array<{ path: string, content: string }> | null}
|
|
285
|
+
*/
|
|
286
|
+
export function uiComponentFiles(name, opts = {}) {
|
|
287
|
+
const item = loadRegistryItem(name);
|
|
288
|
+
if (!item) return null;
|
|
289
|
+
return (item.files || []).map((f) => ({ path: f.path, content: bakeForStyle(f.content || '', opts.style) }));
|
|
290
|
+
}
|
|
291
|
+
|
|
270
292
|
/**
|
|
271
293
|
* The kit inventory: one compact entry per `registry:ui` component (name, tier,
|
|
272
294
|
* helper signatures, npm deps). The no-args payload for the MCP `ui` tool and
|
|
@@ -290,6 +312,174 @@ export function uiInventory() {
|
|
|
290
312
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
291
313
|
}
|
|
292
314
|
|
|
315
|
+
/* -------------------- blocks and charts (#1666, D18) -------------------- */
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* What a block is, in the one phrasing every agent-facing surface uses. A
|
|
319
|
+
* block and a chart are both `registry:block` items on the wire (shadcn
|
|
320
|
+
* parity), told apart by a chart's `chart` category.
|
|
321
|
+
*/
|
|
322
|
+
export const BLOCK_DEFINITION = 'a ready-made view you install and then edit';
|
|
323
|
+
|
|
324
|
+
/** The category that marks a `registry:block` as a chart. */
|
|
325
|
+
export const CHART_CATEGORY = 'chart';
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* The agent-facing kind of a registry item: `ui` for a component, `chart` for
|
|
329
|
+
* a block carrying the `chart` category, `block` for any other block, and
|
|
330
|
+
* null for everything else (a lib, a theme).
|
|
331
|
+
*
|
|
332
|
+
* @param {{ type?: string, categories?: string[] }} item
|
|
333
|
+
* @returns {'ui' | 'block' | 'chart' | null}
|
|
334
|
+
*/
|
|
335
|
+
export function itemKind(item) {
|
|
336
|
+
if (!item) return null;
|
|
337
|
+
if (item.type === 'registry:ui') return 'ui';
|
|
338
|
+
if (item.type !== 'registry:block') return null;
|
|
339
|
+
return (item.categories || []).includes(CHART_CATEGORY) ? 'chart' : 'block';
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* The category a block is grouped under in a compact listing: its LAST, most
|
|
344
|
+
* specific category (`login` for `['authentication', 'login']`, `area` for
|
|
345
|
+
* `['chart', 'area']`), so each name appears once. A block with none is
|
|
346
|
+
* grouped under `other`. Filtering by category still matches every one.
|
|
347
|
+
*
|
|
348
|
+
* @param {{ categories?: string[] }} item
|
|
349
|
+
* @returns {string}
|
|
350
|
+
*/
|
|
351
|
+
export function primaryCategory(item) {
|
|
352
|
+
const cats = (item.categories || []).filter((c) => c !== CHART_CATEGORY);
|
|
353
|
+
return cats.length ? cats[cats.length - 1] : 'other';
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* One compact entry per block or chart (and per component when `type` asks
|
|
358
|
+
* for them): `{ name, type, categories, description }`, sorted by name. The
|
|
359
|
+
* shape `webjsui list --json` prints and the MCP `ui` tool's filtered
|
|
360
|
+
* listing returns.
|
|
361
|
+
*
|
|
362
|
+
* @param {{ type?: 'ui' | 'block' | 'chart' | 'all', category?: string }} [opts]
|
|
363
|
+
* `type` defaults to `block` plus `chart`; `all` adds the components.
|
|
364
|
+
* @param {any[]} [index] the registry index, the packaged one by default
|
|
365
|
+
* @returns {Array<{ name: string, type: 'ui' | 'block' | 'chart', categories: string[], description: string }>}
|
|
366
|
+
*/
|
|
367
|
+
export function uiBlocks(opts = {}, index = loadRegistryIndex()) {
|
|
368
|
+
const want = opts.type || 'blocks';
|
|
369
|
+
const keep = (/** @type {string|null} */ kind) =>
|
|
370
|
+
kind !== null && (
|
|
371
|
+
want === 'all' ? true
|
|
372
|
+
: want === 'blocks' ? kind === 'block' || kind === 'chart'
|
|
373
|
+
: kind === want
|
|
374
|
+
);
|
|
375
|
+
return index
|
|
376
|
+
.map((i) => ({ i, kind: itemKind(i) }))
|
|
377
|
+
.filter(({ i, kind }) => keep(kind) && (!opts.category || (i.categories || []).includes(opts.category)))
|
|
378
|
+
.map(({ i, kind }) => ({
|
|
379
|
+
name: i.name,
|
|
380
|
+
type: /** @type {'ui' | 'block' | 'chart'} */ (kind),
|
|
381
|
+
categories: i.categories || [],
|
|
382
|
+
description: i.description || '',
|
|
383
|
+
}))
|
|
384
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* The blocks and charts as NAME LISTS grouped by {@link primaryCategory}, with
|
|
389
|
+
* no descriptions: `{ blocks: { login: [...] }, charts: { area: [...] } }`.
|
|
390
|
+
* The no-argument MCP `ui` payload carries this, so it stays cheap however
|
|
391
|
+
* many blocks the kit ships.
|
|
392
|
+
*
|
|
393
|
+
* @param {any[]} [index]
|
|
394
|
+
* @returns {{ blocks: Record<string, string[]>, charts: Record<string, string[]> }}
|
|
395
|
+
*/
|
|
396
|
+
export function uiBlockIndex(index = loadRegistryIndex()) {
|
|
397
|
+
/** @type {{ blocks: Record<string, string[]>, charts: Record<string, string[]> }} */
|
|
398
|
+
const out = { blocks: {}, charts: {} };
|
|
399
|
+
for (const b of uiBlocks({}, index)) {
|
|
400
|
+
const group = b.type === 'chart' ? out.charts : out.blocks;
|
|
401
|
+
(group[primaryCategory(b)] ??= []).push(b.name);
|
|
402
|
+
}
|
|
403
|
+
return out;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/** The command that installs a registry item, as every printed hint spells it (invariant 8). */
|
|
407
|
+
export function installCommand(name) {
|
|
408
|
+
return `npx @webjsdev/ui add ${name}`;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Project one block (or chart) item into the agent-facing shape: what it is,
|
|
413
|
+
* how to install it, and the files it writes with their targets. Pure over
|
|
414
|
+
* the item, so `view` can project an item fetched from a custom registry.
|
|
415
|
+
* Returns null when the item is not a block.
|
|
416
|
+
*
|
|
417
|
+
* The sources are left out unless `source` is true, since the cheap path is
|
|
418
|
+
* to install the block and read the files on disk. When included they are
|
|
419
|
+
* BAKED (#1666), so no `cn-*` name reaches an agent, but their imports stay
|
|
420
|
+
* registry-relative: `add` is what rewrites them to the app's aliases.
|
|
421
|
+
*
|
|
422
|
+
* @param {any} item a registry item with its files
|
|
423
|
+
* @param {{ style?: string, source?: boolean }} [opts]
|
|
424
|
+
*/
|
|
425
|
+
export function projectBlock(item, opts = {}) {
|
|
426
|
+
const kind = itemKind(item);
|
|
427
|
+
if (kind !== 'block' && kind !== 'chart') return null;
|
|
428
|
+
return {
|
|
429
|
+
name: item.name,
|
|
430
|
+
type: kind,
|
|
431
|
+
title: item.title || item.name,
|
|
432
|
+
description: item.description || '',
|
|
433
|
+
categories: item.categories || [],
|
|
434
|
+
install: installCommand(item.name),
|
|
435
|
+
dependencies: item.dependencies || [],
|
|
436
|
+
registryDependencies: item.registryDependencies || [],
|
|
437
|
+
...(item.cssVars ? { cssVars: item.cssVars } : {}),
|
|
438
|
+
files: (item.files || []).map((f) => ({
|
|
439
|
+
path: f.path,
|
|
440
|
+
type: f.type,
|
|
441
|
+
target: f.target || f.path,
|
|
442
|
+
...(opts.source ? { content: bakeForStyle(f.content || '', opts.style) } : {}),
|
|
443
|
+
})),
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* {@link projectBlock} for a block in the packaged registry, by name. Null
|
|
449
|
+
* when the name is not a block.
|
|
450
|
+
*
|
|
451
|
+
* @param {string} name
|
|
452
|
+
* @param {{ style?: string, source?: boolean }} [opts]
|
|
453
|
+
*/
|
|
454
|
+
export function uiBlock(name, opts = {}) {
|
|
455
|
+
const item = loadRegistryItem(name);
|
|
456
|
+
return item ? projectBlock(item, opts) : null;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Render a block projection as human-readable text for `webjsui view`: the
|
|
461
|
+
* description, categories, dependencies, the install command and the file
|
|
462
|
+
* list with targets. The sources, when the projection carries them, follow.
|
|
463
|
+
*
|
|
464
|
+
* @param {ReturnType<typeof projectBlock>} b
|
|
465
|
+
* @returns {string}
|
|
466
|
+
*/
|
|
467
|
+
export function renderBlockText(b) {
|
|
468
|
+
if (!b) return '';
|
|
469
|
+
const lines = [`# ${b.name} (${b.type})`];
|
|
470
|
+
if (b.description) lines.push('', b.description);
|
|
471
|
+
if (b.categories.length) lines.push('', `categories: ${b.categories.join(', ')}`);
|
|
472
|
+
if (b.registryDependencies.length) lines.push(`registry deps: ${b.registryDependencies.join(', ')}`);
|
|
473
|
+
if (b.dependencies.length) lines.push(`npm: ${b.dependencies.join(', ')}`);
|
|
474
|
+
lines.push('', `Install: ${b.install}`, '', 'Files:');
|
|
475
|
+
for (const f of b.files) lines.push(` ${f.target}`);
|
|
476
|
+
for (const f of b.files) {
|
|
477
|
+
if (f.content === undefined) continue;
|
|
478
|
+
lines.push('', `# --- ${f.target} ---`, f.content.replace(/\n$/, ''));
|
|
479
|
+
}
|
|
480
|
+
return lines.join('\n');
|
|
481
|
+
}
|
|
482
|
+
|
|
293
483
|
/**
|
|
294
484
|
* Render a component projection as human-readable text for `webjsui view`.
|
|
295
485
|
* Shares the SAME {@link uiComponent} data the MCP `ui` tool returns, so the
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app's icon library in a resolved install tree (#1666).
|
|
3
|
+
*
|
|
4
|
+
* Registry items depend on `lib-icons` (the Lucide file). The other four
|
|
5
|
+
* libraries export the same function names and land at the same path, so an
|
|
6
|
+
* app whose `components.json` names one of them gets that library's file in
|
|
7
|
+
* place of Lucide's, and a block's icons draw in the library the app chose.
|
|
8
|
+
*
|
|
9
|
+
* @module registry/icons
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { getRegistryItem } from './fetcher.js';
|
|
13
|
+
import { getIconLibrary } from '../../packages/registry/themes/preset.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Replace `lib-icons` in a resolved tree with the item for `iconLibrary`.
|
|
17
|
+
* A tree without `lib-icons`, Lucide, or an unknown library name is
|
|
18
|
+
* returned as it is.
|
|
19
|
+
*
|
|
20
|
+
* @param {any[]} tree the items `resolveTree` returned
|
|
21
|
+
* @param {string | undefined} iconLibrary `components.json` `iconLibrary`
|
|
22
|
+
* @param {string} [registryUrl]
|
|
23
|
+
* @returns {Promise<any[]>}
|
|
24
|
+
*/
|
|
25
|
+
export async function withIconLibrary(tree, iconLibrary, registryUrl) {
|
|
26
|
+
const lib = getIconLibrary(iconLibrary || 'lucide');
|
|
27
|
+
if (!lib || lib.item === 'lib-icons') return tree;
|
|
28
|
+
if (!tree.some((it) => it.name === 'lib-icons')) return tree;
|
|
29
|
+
const chosen = await getRegistryItem(lib.item, registryUrl);
|
|
30
|
+
return tree.map((it) => (it.name === 'lib-icons' ? chosen : it));
|
|
31
|
+
}
|
package/src/registry/local.js
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
BASE_OVERRIDES,
|
|
33
33
|
mergeThemeCss,
|
|
34
34
|
} from '../../packages/registry/themes/base-colors.js';
|
|
35
|
+
import { designSystemItem, designSystemItems } from '../../packages/registry/themes/items.js';
|
|
35
36
|
|
|
36
37
|
/** Absolute path to the packaged registry root (`packages/ui/packages/registry`). */
|
|
37
38
|
export const REGISTRY_ROOT = resolve(
|
|
@@ -136,6 +137,14 @@ export function loadRegistryItem(name) {
|
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
|
|
140
|
+
// The accent themes and the font items, built from data (#1666).
|
|
141
|
+
const data = designSystemItem(name);
|
|
142
|
+
if (data) {
|
|
143
|
+
const composed = { $schema: SCHEMA, ...data };
|
|
144
|
+
itemCache.set(name, composed);
|
|
145
|
+
return composed;
|
|
146
|
+
}
|
|
147
|
+
|
|
139
148
|
return null;
|
|
140
149
|
}
|
|
141
150
|
|
|
@@ -147,10 +156,14 @@ export function loadRegistryItem(name) {
|
|
|
147
156
|
*/
|
|
148
157
|
export function loadRegistryIndex() {
|
|
149
158
|
if (indexCache) return indexCache;
|
|
159
|
+
// `title` and `categories` ride along so a block or chart can be listed and
|
|
160
|
+
// grouped without loading its files (D18).
|
|
150
161
|
const fromManifest = readManifest().items.map((item) => ({
|
|
151
162
|
name: item.name,
|
|
152
163
|
type: item.type,
|
|
164
|
+
title: item.title,
|
|
153
165
|
description: item.description,
|
|
166
|
+
categories: item.categories,
|
|
154
167
|
dependencies: item.dependencies,
|
|
155
168
|
registryDependencies: item.registryDependencies,
|
|
156
169
|
}));
|
|
@@ -162,7 +175,8 @@ export function loadRegistryIndex() {
|
|
|
162
175
|
type: 'registry:theme',
|
|
163
176
|
description: BASE_DESCRIPTIONS[color],
|
|
164
177
|
}));
|
|
165
|
-
|
|
178
|
+
const data = designSystemItems().map(({ name, type, title, description }) => ({ name, type, title, description }));
|
|
179
|
+
indexCache = [...fromManifest, ...synthesized, ...data];
|
|
166
180
|
return indexCache;
|
|
167
181
|
}
|
|
168
182
|
|
package/src/registry/schema.js
CHANGED
|
@@ -62,6 +62,18 @@ const cssValueSchema = z.lazy(() =>
|
|
|
62
62
|
export const registryItemCssSchema = z.record(z.string(), cssValueSchema);
|
|
63
63
|
export const registryItemEnvVarsSchema = z.record(z.string(), z.string());
|
|
64
64
|
|
|
65
|
+
/** A `registry:font` item's face (shadcn's `registryItemFontSchema`, #1666). */
|
|
66
|
+
export const registryItemFontSchema = z.object({
|
|
67
|
+
family: z.string(),
|
|
68
|
+
provider: z.literal('google'),
|
|
69
|
+
import: z.string(),
|
|
70
|
+
variable: z.string(),
|
|
71
|
+
weight: z.array(z.string()).optional(),
|
|
72
|
+
subsets: z.array(z.string()).optional(),
|
|
73
|
+
selector: z.string().optional(),
|
|
74
|
+
dependency: z.string().optional(),
|
|
75
|
+
});
|
|
76
|
+
|
|
65
77
|
export const registryItemCommonSchema = z.object({
|
|
66
78
|
$schema: z.string().optional(),
|
|
67
79
|
extends: z.string().optional(),
|
|
@@ -80,6 +92,7 @@ export const registryItemCommonSchema = z.object({
|
|
|
80
92
|
meta: z.record(z.string(), z.any()).optional(),
|
|
81
93
|
docs: z.string().optional(),
|
|
82
94
|
categories: z.array(z.string()).optional(),
|
|
95
|
+
font: registryItemFontSchema.optional(),
|
|
83
96
|
});
|
|
84
97
|
|
|
85
98
|
/** A rule's severity. Absent from `lint.rules` means `off`. */
|