@webjsdev/ui 0.3.17 → 0.5.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 +67 -8
- 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 +644 -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/dom.ts +3 -4
- 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 +52 -8
- 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 +266 -14
- package/src/commands/diff.js +34 -20
- package/src/commands/info.js +7 -0
- package/src/commands/init.js +127 -10
- package/src/commands/list.js +43 -11
- package/src/commands/view.js +33 -5
- package/src/lint/rules/no-restyle.js +1 -1
- package/src/registry/extract.js +194 -5
- 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
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context menu: the menu a right-click (or the keyboard's menu key, or
|
|
3
|
+
* Shift+F10) opens at the pointer, over a region of the page. Tier-2. It is
|
|
4
|
+
* the dropdown menu opened a different way, as in shadcn, so every part is a
|
|
5
|
+
* dropdown element under the `ui-context-menu-*` tags: the same items,
|
|
6
|
+
* checkbox and radio items, labels, separators, shortcuts, groups and
|
|
7
|
+
* sub-menus, the same keyboard model (arrows, Home / End, typeahead, Enter /
|
|
8
|
+
* Space, Escape, Tab) and the same focus care on every close path.
|
|
9
|
+
*
|
|
10
|
+
* shadcn parity:
|
|
11
|
+
* ContextMenu → <ui-context-menu>
|
|
12
|
+
* ContextMenuTrigger → <ui-context-menu-trigger> around the region; a class
|
|
13
|
+
* written on it lands on the region box it renders
|
|
14
|
+
* ContextMenuContent → <ui-context-menu-content>
|
|
15
|
+
* ContextMenuItem → <ui-context-menu-item> (variant, type="checkbox" | "radio", checked, value)
|
|
16
|
+
* ContextMenuLabel / Separator / Shortcut / Group
|
|
17
|
+
* → <ui-context-menu-label> / -separator / -shortcut / -group
|
|
18
|
+
* ContextMenuSub / SubTrigger / SubContent
|
|
19
|
+
* → <ui-context-menu-sub> / -sub-trigger / -sub-content
|
|
20
|
+
*
|
|
21
|
+
* The menu opens at the pointer for a right-click, and below the focused
|
|
22
|
+
* element when the keyboard opened it. A left click never opens it, and a
|
|
23
|
+
* click outside the panel (in the region or anywhere else) or Escape closes it.
|
|
24
|
+
*
|
|
25
|
+
* A11y (handled by the element, plus one obligation): the panel is a
|
|
26
|
+
* `role="menu"` named "Context menu" unless you name it (`aria-label` on
|
|
27
|
+
* `<ui-context-menu-content>`), items are menuitems with roving focus, and
|
|
28
|
+
* closing returns focus to whatever had it before the menu opened. A context
|
|
29
|
+
* menu is a shortcut, never the only way to reach an action: put each of its
|
|
30
|
+
* commands somewhere a keyboard or touch user finds without a right-click
|
|
31
|
+
* (a toolbar, a dropdown, a button), and make the region itself focusable
|
|
32
|
+
* (`tabindex="0"` or a focusable child) so the keyboard can open the menu.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```html
|
|
36
|
+
* <ui-context-menu>
|
|
37
|
+
* <ui-context-menu-trigger>
|
|
38
|
+
* <div tabindex="0" class="flex h-36 items-center justify-center rounded-md border border-dashed">Right-click here</div>
|
|
39
|
+
* </ui-context-menu-trigger>
|
|
40
|
+
* <ui-context-menu-content aria-label="File actions">
|
|
41
|
+
* <ui-context-menu-item>Rename</ui-context-menu-item>
|
|
42
|
+
* <ui-context-menu-item variant="destructive">Delete</ui-context-menu-item>
|
|
43
|
+
* </ui-context-menu-content>
|
|
44
|
+
* </ui-context-menu>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
import {
|
|
48
|
+
UiDropdownMenu,
|
|
49
|
+
UiDropdownMenuTrigger,
|
|
50
|
+
UiDropdownMenuContent,
|
|
51
|
+
UiDropdownMenuItem,
|
|
52
|
+
UiDropdownMenuLabel,
|
|
53
|
+
UiDropdownMenuSeparator,
|
|
54
|
+
UiDropdownMenuShortcut,
|
|
55
|
+
UiDropdownMenuGroup,
|
|
56
|
+
UiDropdownMenuSub,
|
|
57
|
+
UiDropdownMenuSubTrigger,
|
|
58
|
+
UiDropdownMenuSubContent,
|
|
59
|
+
type MenuClasses,
|
|
60
|
+
} from './dropdown-menu.ts';
|
|
61
|
+
import { html } from '@webjsdev/core';
|
|
62
|
+
import { cn, takeAuthoredClass } from '../lib/utils.ts';
|
|
63
|
+
import { positionFloating } from './floating.ts';
|
|
64
|
+
|
|
65
|
+
/** The trigger region's classes (the element applies them). */
|
|
66
|
+
export const contextMenuTriggerClass = (): string => 'cn-context-menu-trigger select-none';
|
|
67
|
+
|
|
68
|
+
/** The menu panel's classes (the element applies them). */
|
|
69
|
+
export const contextMenuContentClass = (): string =>
|
|
70
|
+
'cn-context-menu-content z-50 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto not-open:hidden';
|
|
71
|
+
/** A menu item's classes (the element applies them). */
|
|
72
|
+
export const contextMenuItemClass = (): string =>
|
|
73
|
+
'cn-context-menu-item group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0';
|
|
74
|
+
/** A checkbox item's classes (the element applies them). */
|
|
75
|
+
export const contextMenuCheckboxItemClass = (): string =>
|
|
76
|
+
'cn-context-menu-checkbox-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0';
|
|
77
|
+
/** A radio item's classes (the element applies them). */
|
|
78
|
+
export const contextMenuRadioItemClass = (): string =>
|
|
79
|
+
'cn-context-menu-radio-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0';
|
|
80
|
+
/** A group label's classes. */
|
|
81
|
+
export const contextMenuLabelClass = (): string =>
|
|
82
|
+
'cn-context-menu-label';
|
|
83
|
+
/** A separator's classes. */
|
|
84
|
+
export const contextMenuSeparatorClass = (): string => 'cn-context-menu-separator';
|
|
85
|
+
/** A keyboard shortcut hint's classes. */
|
|
86
|
+
export const contextMenuShortcutClass = (): string =>
|
|
87
|
+
'cn-context-menu-shortcut';
|
|
88
|
+
/** A sub-menu trigger's classes (the element applies them). */
|
|
89
|
+
export const contextMenuSubTriggerClass = (): string =>
|
|
90
|
+
'cn-context-menu-sub-trigger flex cursor-default items-center select-none outline-hidden [&_svg]:pointer-events-none [&_svg]:shrink-0';
|
|
91
|
+
/** A sub-menu panel's classes (the element applies them). */
|
|
92
|
+
export const contextMenuSubContentClass = (): string =>
|
|
93
|
+
'cn-context-menu-sub-content z-50 origin-(--radix-context-menu-content-transform-origin) overflow-hidden not-open:hidden';
|
|
94
|
+
|
|
95
|
+
const contextMenuItemIndicatorClass = (): string =>
|
|
96
|
+
'cn-context-menu-item-indicator pointer-events-none';
|
|
97
|
+
|
|
98
|
+
// The dropdown elements paint each part through this table, so every part
|
|
99
|
+
// carries a cn-context-menu-* name, the one shadcn's styles give it.
|
|
100
|
+
const CONTEXT_MENU_CLASSES: MenuClasses = {
|
|
101
|
+
content: contextMenuContentClass,
|
|
102
|
+
item: contextMenuItemClass,
|
|
103
|
+
checkboxItem: contextMenuCheckboxItemClass,
|
|
104
|
+
radioItem: contextMenuRadioItemClass,
|
|
105
|
+
itemIndicator: contextMenuItemIndicatorClass,
|
|
106
|
+
label: contextMenuLabelClass,
|
|
107
|
+
separator: contextMenuSeparatorClass,
|
|
108
|
+
shortcut: contextMenuShortcutClass,
|
|
109
|
+
subTrigger: contextMenuSubTriggerClass,
|
|
110
|
+
subContent: contextMenuSubContentClass,
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const FAMILY = 'ui-context-menu';
|
|
114
|
+
|
|
115
|
+
export class UiContextMenu extends UiDropdownMenu {
|
|
116
|
+
static family = FAMILY;
|
|
117
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
118
|
+
|
|
119
|
+
// Where the menu opens, and who gets focus back when it closes.
|
|
120
|
+
_point: { x: number; y: number } | null = null;
|
|
121
|
+
_returnFocus: HTMLElement | null = null;
|
|
122
|
+
|
|
123
|
+
/** Open the menu with its corner at (x, y), returning focus to `returnTo` on close. */
|
|
124
|
+
openAt(x: number, y: number, returnTo: HTMLElement | null): void {
|
|
125
|
+
this._point = { x, y };
|
|
126
|
+
this._returnFocus = returnTo;
|
|
127
|
+
if (this.open) this._reposition();
|
|
128
|
+
else this.show();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// A context menu has no trigger button to sit against, so it is placed at
|
|
132
|
+
// the pointer through a zero-size virtual anchor.
|
|
133
|
+
_reposition(): void {
|
|
134
|
+
const content = this._content();
|
|
135
|
+
if (!content) return;
|
|
136
|
+
const p = this._point ?? { x: 0, y: 0 };
|
|
137
|
+
const anchor = { getBoundingClientRect: () => new DOMRect(p.x, p.y, 0, 0) } as unknown as HTMLElement;
|
|
138
|
+
positionFloating(anchor, content, { side: 'bottom', align: 'start', sideOffset: 0, alignOffset: 0, radix: this.localName.slice(3) });
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Every close path returns focus through this: to the element that had focus
|
|
142
|
+
// when the menu opened, else the region.
|
|
143
|
+
_triggerControl(): HTMLElement | null {
|
|
144
|
+
if (this._returnFocus?.isConnected) return this._returnFocus;
|
|
145
|
+
return this.querySelector<HTMLElement>(`${FAMILY}-trigger`);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// The region is not a button, so it gets no aria-haspopup / aria-expanded.
|
|
149
|
+
// The menu still needs a name, and a sub-menu is named by its sub-trigger.
|
|
150
|
+
_wireAria(): void {
|
|
151
|
+
const menu = this._menuEl();
|
|
152
|
+
if (menu && !menu.hasAttribute('aria-label') && !menu.hasAttribute('aria-labelledby')) {
|
|
153
|
+
const authored = this.querySelector(`${FAMILY}-content`)?.getAttribute('aria-label');
|
|
154
|
+
menu.setAttribute('aria-label', authored || 'Context menu');
|
|
155
|
+
}
|
|
156
|
+
this._wireSubmenuAria();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Close, returning focus only when it was in the panel (a click in the region keeps its own focus). */
|
|
160
|
+
_dismiss(): void {
|
|
161
|
+
const panel = this.querySelector(`${FAMILY}-content`);
|
|
162
|
+
const active = typeof document !== 'undefined' ? document.activeElement : null;
|
|
163
|
+
if (active && panel?.contains(active)) this._triggerControl()?.focus();
|
|
164
|
+
this.hide();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// A right-click elsewhere fires no click, so the outside dismiss has to
|
|
168
|
+
// happen on its pointerdown, or the menu would stay open beside the native
|
|
169
|
+
// one the browser then shows.
|
|
170
|
+
_onDocPointerDown(e: Event): void {
|
|
171
|
+
super._onDocPointerDown(e);
|
|
172
|
+
if (!this.open || (e as PointerEvent).button !== 2) return;
|
|
173
|
+
if (e.composedPath().some((n) => n === this)) return;
|
|
174
|
+
this._dismiss();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
UiContextMenu.register('ui-context-menu');
|
|
178
|
+
|
|
179
|
+
export class UiContextMenuTrigger extends UiDropdownMenuTrigger {
|
|
180
|
+
static family = FAMILY;
|
|
181
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
182
|
+
_authored: string | null = null;
|
|
183
|
+
|
|
184
|
+
// shadcn's className on ContextMenuTrigger styles the region itself (its
|
|
185
|
+
// size, the dashed border), so the class written on this host moves to the
|
|
186
|
+
// box it renders and the host becomes `display: contents`. The host's box is
|
|
187
|
+
// turned off through its style, which the server serves, so the first paint
|
|
188
|
+
// has one region, not a host and a region both carrying the class.
|
|
189
|
+
render() {
|
|
190
|
+
this._authored = takeAuthoredClass(this, null);
|
|
191
|
+
if (!this.getAttribute?.('style')) this.setAttribute?.('style', 'display: contents');
|
|
192
|
+
return html`<div
|
|
193
|
+
data-slot="context-menu-trigger"
|
|
194
|
+
class=${cn(contextMenuTriggerClass(), this._authored)}
|
|
195
|
+
@click=${this._onClick}
|
|
196
|
+
><slot></slot></div>`;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// A left click on the region never opens the menu. It closes an open one,
|
|
200
|
+
// as a click anywhere outside the panel does.
|
|
201
|
+
_onClick = (): void => {
|
|
202
|
+
const root = this._root();
|
|
203
|
+
if (root?.open) root._dismiss();
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
connectedCallback(): void {
|
|
207
|
+
super.connectedCallback?.();
|
|
208
|
+
this.addEventListener('contextmenu', this._onContextMenu);
|
|
209
|
+
this.addEventListener('keydown', this._onKeyDown);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
disconnectedCallback(): void {
|
|
213
|
+
this.removeEventListener('contextmenu', this._onContextMenu);
|
|
214
|
+
this.removeEventListener('keydown', this._onKeyDown);
|
|
215
|
+
super.disconnectedCallback?.();
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
_root(): UiContextMenu | null {
|
|
219
|
+
return this.closest(FAMILY) as UiContextMenu | null;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// The element focus returns to: what had it, when that is in the region,
|
|
223
|
+
// else the region's first focusable.
|
|
224
|
+
_returnTarget(): HTMLElement | null {
|
|
225
|
+
const active = typeof document !== 'undefined' ? (document.activeElement as HTMLElement | null) : null;
|
|
226
|
+
if (active && this.contains(active)) return active;
|
|
227
|
+
return this.querySelector<HTMLElement>('[tabindex], button, a[href], input, select, textarea');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Below the focused element's start corner, where a keyboard-opened menu goes.
|
|
231
|
+
_openFromFocus(): void {
|
|
232
|
+
const returnTo = this._returnTarget();
|
|
233
|
+
// The host is display: contents and has no box of its own.
|
|
234
|
+
const r = (returnTo ?? this.querySelector<HTMLElement>('[data-slot="context-menu-trigger"]') ?? this).getBoundingClientRect();
|
|
235
|
+
this._root()?.openAt(r.left, r.bottom, returnTo);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
_onContextMenu = (e: MouseEvent): void => {
|
|
239
|
+
const root = this._root();
|
|
240
|
+
if (!root) return;
|
|
241
|
+
e.preventDefault();
|
|
242
|
+
// A keyboard-fired contextmenu can report (0, 0) instead of a pointer.
|
|
243
|
+
if (e.clientX === 0 && e.clientY === 0) this._openFromFocus();
|
|
244
|
+
else root.openAt(e.clientX, e.clientY, this._returnTarget());
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
// The menu key and Shift+F10 are handled here rather than left to the
|
|
248
|
+
// contextmenu they fire, which some engines place at (0, 0) and none fire
|
|
249
|
+
// for a synthetic key event.
|
|
250
|
+
_onKeyDown = (e: KeyboardEvent): void => {
|
|
251
|
+
if (!(e.key === 'ContextMenu' || (e.key === 'F10' && e.shiftKey))) return;
|
|
252
|
+
e.preventDefault();
|
|
253
|
+
this._openFromFocus();
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
UiContextMenuTrigger.register('ui-context-menu-trigger');
|
|
257
|
+
|
|
258
|
+
export class UiContextMenuContent extends UiDropdownMenuContent {
|
|
259
|
+
static family = FAMILY;
|
|
260
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
261
|
+
}
|
|
262
|
+
UiContextMenuContent.register('ui-context-menu-content');
|
|
263
|
+
export class UiContextMenuItem extends UiDropdownMenuItem {
|
|
264
|
+
static family = FAMILY;
|
|
265
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
266
|
+
}
|
|
267
|
+
UiContextMenuItem.register('ui-context-menu-item');
|
|
268
|
+
export class UiContextMenuLabel extends UiDropdownMenuLabel {
|
|
269
|
+
static family = FAMILY;
|
|
270
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
271
|
+
}
|
|
272
|
+
UiContextMenuLabel.register('ui-context-menu-label');
|
|
273
|
+
export class UiContextMenuSeparator extends UiDropdownMenuSeparator {
|
|
274
|
+
static family = FAMILY;
|
|
275
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
276
|
+
}
|
|
277
|
+
UiContextMenuSeparator.register('ui-context-menu-separator');
|
|
278
|
+
export class UiContextMenuShortcut extends UiDropdownMenuShortcut {
|
|
279
|
+
static family = FAMILY;
|
|
280
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
281
|
+
}
|
|
282
|
+
UiContextMenuShortcut.register('ui-context-menu-shortcut');
|
|
283
|
+
export class UiContextMenuGroup extends UiDropdownMenuGroup {
|
|
284
|
+
static family = FAMILY;
|
|
285
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
286
|
+
}
|
|
287
|
+
UiContextMenuGroup.register('ui-context-menu-group');
|
|
288
|
+
export class UiContextMenuSub extends UiDropdownMenuSub {
|
|
289
|
+
static family = FAMILY;
|
|
290
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
291
|
+
}
|
|
292
|
+
UiContextMenuSub.register('ui-context-menu-sub');
|
|
293
|
+
export class UiContextMenuSubTrigger extends UiDropdownMenuSubTrigger {
|
|
294
|
+
static family = FAMILY;
|
|
295
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
296
|
+
}
|
|
297
|
+
UiContextMenuSubTrigger.register('ui-context-menu-sub-trigger');
|
|
298
|
+
export class UiContextMenuSubContent extends UiDropdownMenuSubContent {
|
|
299
|
+
static family = FAMILY;
|
|
300
|
+
static classes = CONTEXT_MENU_CLASSES;
|
|
301
|
+
}
|
|
302
|
+
UiContextMenuSubContent.register('ui-context-menu-sub-content');
|