@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checkbox: styled native `<input type="checkbox">`. Tier-1 class
|
|
3
|
-
* helper. Uses `appearance: none` +
|
|
4
|
-
*
|
|
3
|
+
* helper. Uses `appearance: none` + a masked `::before` for the checkmark
|
|
4
|
+
* when `:checked`, so it remains a real form control
|
|
5
5
|
* (participates in `<form>` submission, no ElementInternals required).
|
|
6
6
|
*
|
|
7
7
|
* shadcn parity:
|
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
* --ring, --destructive.
|
|
14
14
|
*
|
|
15
15
|
* A11y (required for accessible output):
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* carries it; keep it when you copy one.
|
|
16
|
+
* The tick is drawn by the class itself, so the checked state never reads as
|
|
17
|
+
* colour alone (WCAG 1.4.1), with or without JavaScript. Keep
|
|
18
|
+
* `data-slot="checkbox"` on the input, as every example here does, since the
|
|
19
|
+
* styles' field rules select on it.
|
|
21
20
|
* Associate a label with the input, either `<label for>` pointing at the
|
|
22
21
|
* input's `id` (as below) or by nesting the input inside the `<label>`. A
|
|
23
22
|
* checkbox with no label has no accessible name.
|
|
@@ -55,86 +54,25 @@
|
|
|
55
54
|
*/
|
|
56
55
|
import { cn } from '../lib/utils.ts';
|
|
57
56
|
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
const CHECKMARK_LIGHT =
|
|
70
|
-
'url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\' fill=\'white\'><path d=\'M16.704 5.293a1 1 0 010 1.414l-7.001 7a1 1 0 01-1.414 0l-3-3a1 1 0 011.414-1.414L9 11.586l6.29-6.293a1 1 0 011.414 0z\'/></svg>")';
|
|
71
|
-
const CHECKMARK_DARK =
|
|
72
|
-
'url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\' fill=\'black\'><path d=\'M16.704 5.293a1 1 0 010 1.414l-7.001 7a1 1 0 01-1.414 0l-3-3a1 1 0 011.414-1.414L9 11.586l6.29-6.293a1 1 0 011.414 0z\'/></svg>")';
|
|
73
|
-
|
|
57
|
+
// The checked and indeterminate paint rides the helper's own classes, so it is
|
|
58
|
+
// in the first paint, renders with JavaScript off, and holds in every style.
|
|
59
|
+
// The tick is shadcn's (Lucide's CheckIcon, stroke 2, round caps and joins),
|
|
60
|
+
// drawn by a `::before` that fills the box's padding box (14px of the 16px
|
|
61
|
+
// box, shadcn's size-3.5) in `currentColor` through a mask of the icon. So the
|
|
62
|
+
// tick takes the box's text colour, which every style sets on a checked box
|
|
63
|
+
// (`text-primary-foreground` on the `bg-primary` fill), and it flips with the
|
|
64
|
+
// theme with no per-theme rule. The indeterminate dash is the same fill
|
|
65
|
+
// masked to a centred bar, 60% across and 2px tall. The data URI is fully
|
|
66
|
+
// percent-encoded so it sits in a class with no space or quote.
|
|
67
|
+
// One literal, since Tailwind finds a class only where it is written out whole.
|
|
74
68
|
const CHECKBOX_CLASS =
|
|
75
|
-
'peer
|
|
76
|
-
|
|
77
|
-
// Inject style once for the checkmark background-image when :checked.
|
|
78
|
-
//
|
|
79
|
-
// Theme selectors are kept in sync with what shadcn's components.json
|
|
80
|
-
// scaffolds for theme switching: explicit `[data-theme='dark']` /
|
|
81
|
-
// `.dark` on `<html>` (set by toggle scripts), AND `prefers-color-
|
|
82
|
-
// scheme: dark` gated by `:not([data-theme='light']):not(.light)` so
|
|
83
|
-
// an explicit-light toggle still wins over the OS preference. Matches
|
|
84
|
-
// the same pattern used elsewhere in the registry.
|
|
85
|
-
const STYLES = `
|
|
86
|
-
input[type="checkbox"][data-slot="checkbox"]:checked {
|
|
87
|
-
background-image: ${CHECKMARK_LIGHT};
|
|
88
|
-
background-size: 80%;
|
|
89
|
-
}
|
|
90
|
-
input[type="checkbox"][data-slot="checkbox"]:indeterminate {
|
|
91
|
-
background-color: var(--primary);
|
|
92
|
-
background-image: linear-gradient(to right, white, white);
|
|
93
|
-
background-size: 60% 2px;
|
|
94
|
-
background-repeat: no-repeat;
|
|
95
|
-
background-position: center;
|
|
96
|
-
}
|
|
97
|
-
@media (prefers-color-scheme: dark) {
|
|
98
|
-
:root:not([data-theme='light']):not(.light) input[type="checkbox"][data-slot="checkbox"]:checked {
|
|
99
|
-
background-image: ${CHECKMARK_DARK};
|
|
100
|
-
}
|
|
101
|
-
:root:not([data-theme='light']):not(.light) input[type="checkbox"][data-slot="checkbox"]:indeterminate {
|
|
102
|
-
background-image: linear-gradient(to right, black, black);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
:root[data-theme='dark'] input[type="checkbox"][data-slot="checkbox"]:checked,
|
|
106
|
-
:root.dark input[type="checkbox"][data-slot="checkbox"]:checked {
|
|
107
|
-
background-image: ${CHECKMARK_DARK};
|
|
108
|
-
}
|
|
109
|
-
:root[data-theme='dark'] input[type="checkbox"][data-slot="checkbox"]:indeterminate,
|
|
110
|
-
:root.dark input[type="checkbox"][data-slot="checkbox"]:indeterminate {
|
|
111
|
-
background-image: linear-gradient(to right, black, black);
|
|
112
|
-
}
|
|
113
|
-
`;
|
|
114
|
-
|
|
115
|
-
let installed = false;
|
|
116
|
-
export function installCheckboxStyles(): void {
|
|
117
|
-
if (installed || typeof document === 'undefined') return;
|
|
118
|
-
if (document.getElementById('ui-checkbox-styles')) {
|
|
119
|
-
installed = true;
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const style = document.createElement('style');
|
|
123
|
-
style.id = 'ui-checkbox-styles';
|
|
124
|
-
style.textContent = STYLES;
|
|
125
|
-
document.head.appendChild(style);
|
|
126
|
-
installed = true;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (typeof document !== 'undefined') installCheckboxStyles();
|
|
69
|
+
'cn-checkbox peer relative shrink-0 appearance-none outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50 checked:before:absolute checked:before:inset-0 checked:before:bg-current checked:before:[mask:url(data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22%23000%22%20stroke-width=%222%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M20%206%209%2017l-5-5%22/%3E%3C/svg%3E)_center/contain_no-repeat] indeterminate:border-primary indeterminate:bg-primary indeterminate:text-primary-foreground indeterminate:before:absolute indeterminate:before:inset-0 indeterminate:before:bg-current indeterminate:before:[mask:linear-gradient(#000,#000)_center/60%_2px_no-repeat]';
|
|
130
70
|
|
|
131
71
|
/**
|
|
132
|
-
* Tailwind classes for a styled native `<input type="checkbox">`.
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* so the class alone gives you a box that fills with colour when checked but
|
|
137
|
-
* never draws a tick, leaving the two states distinguishable by colour only.
|
|
72
|
+
* Tailwind classes for a styled native `<input type="checkbox">`. The classes
|
|
73
|
+
* draw the tick and the indeterminate dash themselves, so a checked box paints
|
|
74
|
+
* with JavaScript off. Keep `data-slot="checkbox"` on the input as shadcn
|
|
75
|
+
* does: the styles' field rules select on it.
|
|
138
76
|
*/
|
|
139
77
|
export function checkboxClass(): string {
|
|
140
78
|
return cn(CHECKBOX_CLASS);
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code block: a framed block of code with an optional header, title,
|
|
3
|
+
* actions, footer, line numbers and per-line highlights. Tier 1, with one
|
|
4
|
+
* Tier-2 part, the copy button.
|
|
5
|
+
*
|
|
6
|
+
* shadcn parity:
|
|
7
|
+
* CodeBlock (variant, size) → <div data-slot="code-block" data-variant data-size class=${codeBlockClass({ variant })}>
|
|
8
|
+
* (codeBlockVariants is the same helper under shadcn's name)
|
|
9
|
+
* CodeBlockHeader / Title / Actions / Footer
|
|
10
|
+
* → <div class=${codeBlockHeaderClass()} data-slot="code-block-header"> and so on
|
|
11
|
+
* CodeBlockContent (wrap, lineNumbers, startLine)
|
|
12
|
+
* → <pre data-slot="code-block-content" tabindex="0" dir="ltr" class=${codeBlockContentClass()}
|
|
13
|
+
* ?data-wrap ?data-numbered style="counter-reset: line N">
|
|
14
|
+
* <code data-slot="code-block-code" class=${codeBlockCodeClass()}>
|
|
15
|
+
* CodeBlockLine variant → codeBlockLines(text, { variants }) for numbered lines, or a
|
|
16
|
+
* <span data-slot="code-block-line" class=${codeBlockLineClass({ variant })}> of your own
|
|
17
|
+
* CodeBlockCopyButton value → <ui-code-block-copy-button value>, which copies its block's code
|
|
18
|
+
* when it has no value
|
|
19
|
+
*
|
|
20
|
+
* `codeBlockLines` splits text on newlines into the line spans numbering and
|
|
21
|
+
* highlights need, keeping an empty line as a newline so a copied selection
|
|
22
|
+
* keeps its blank lines. Pass `{ 3: 'added', 4: 'removed' }` as `variants`
|
|
23
|
+
* (one-based line numbers) to mark lines.
|
|
24
|
+
*
|
|
25
|
+
* A11y (required for accessible output): keep `tabindex="0"` on the `<pre>`,
|
|
26
|
+
* so a keyboard can reach and scroll a block wider than its frame, and
|
|
27
|
+
* `dir="ltr"`, since code reads left to right on any page. A title names the
|
|
28
|
+
* file or language. The copy button is named "Copy", becomes "Copied" for two
|
|
29
|
+
* seconds, and announces it through a polite live region. Added and removed
|
|
30
|
+
* lines are marked by colour and by a "+" / "−" gutter sign, which a screen
|
|
31
|
+
* reader skips, so say what changed in prose when it matters.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```html
|
|
35
|
+
* <div data-slot="code-block" data-variant="default" data-size="default" class=${codeBlockClass()}>
|
|
36
|
+
* <div data-slot="code-block-header" class=${codeBlockHeaderClass()}>
|
|
37
|
+
* <div data-slot="code-block-title" class=${codeBlockTitleClass()}>app/page.ts</div>
|
|
38
|
+
* <div data-slot="code-block-actions" class=${codeBlockActionsClass()}>
|
|
39
|
+
* <ui-code-block-copy-button></ui-code-block-copy-button>
|
|
40
|
+
* </div>
|
|
41
|
+
* </div>
|
|
42
|
+
* <pre data-slot="code-block-content" data-numbered tabindex="0" dir="ltr" style="counter-reset: line 0" class=${codeBlockContentClass()}><code
|
|
43
|
+
* data-slot="code-block-code" class=${codeBlockCodeClass()}>${codeBlockLines(source, { variants: { 2: 'added' } })}</code></pre>
|
|
44
|
+
* </div>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
import { WebComponent, html, signal } from '@webjsdev/core';
|
|
48
|
+
import { cn } from '../lib/utils.ts';
|
|
49
|
+
import { buttonClass, type ButtonVariant, type ButtonSize } from './button.ts';
|
|
50
|
+
|
|
51
|
+
const CODE_BLOCK_VARIANTS = {
|
|
52
|
+
default: 'cn-code-block-variant-default',
|
|
53
|
+
destructive: 'cn-code-block-variant-destructive',
|
|
54
|
+
} as const;
|
|
55
|
+
|
|
56
|
+
export type CodeBlockVariant = keyof typeof CODE_BLOCK_VARIANTS;
|
|
57
|
+
|
|
58
|
+
/** The frame's classes. */
|
|
59
|
+
export function codeBlockClass(opts: { variant?: CodeBlockVariant } = {}): string {
|
|
60
|
+
return cn('cn-code-block group/code-block relative flex w-full min-w-0 flex-col overflow-hidden', CODE_BLOCK_VARIANTS[opts.variant ?? 'default']);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** shadcn's name for {@link codeBlockClass}. Like cva, it merges a `className`. */
|
|
64
|
+
export function codeBlockVariants(opts: { variant?: CodeBlockVariant; className?: string } = {}): string {
|
|
65
|
+
return cn(codeBlockClass(opts), opts.className);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** The header row. */
|
|
69
|
+
export function codeBlockHeaderClass(): string {
|
|
70
|
+
return 'cn-code-block-header flex min-w-0 shrink-0 items-center *:has-[>[data-slot=code-block-title]]:min-w-0';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** The title in the header. */
|
|
74
|
+
export function codeBlockTitleClass(): string {
|
|
75
|
+
return 'cn-code-block-title min-w-0 truncate [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The actions (in the header, or floating over the code when a direct child of the frame). */
|
|
79
|
+
export function codeBlockActionsClass(): string {
|
|
80
|
+
return 'cn-code-block-actions ms-auto flex shrink-0 items-center [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 [[data-slot=code-block]>&]:pointer-coarse:opacity-100';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The scrolling `<pre>`. */
|
|
84
|
+
export function codeBlockContentClass(): string {
|
|
85
|
+
return 'cn-code-block-content min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto text-start font-mono outline-none data-[wrap]:scroll-fade-y data-[wrap]:wrap-break-word data-[wrap]:whitespace-pre-wrap';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The `<code>` inside it. */
|
|
89
|
+
export function codeBlockCodeClass(): string {
|
|
90
|
+
return 'cn-code-block-code grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const CODE_BLOCK_LINE_VARIANTS = {
|
|
94
|
+
default: 'cn-code-block-line-variant-default',
|
|
95
|
+
added: 'cn-code-block-line-variant-added',
|
|
96
|
+
removed: 'cn-code-block-line-variant-removed',
|
|
97
|
+
highlighted: 'cn-code-block-line-variant-highlighted',
|
|
98
|
+
} as const;
|
|
99
|
+
|
|
100
|
+
export type CodeBlockLineVariant = keyof typeof CODE_BLOCK_LINE_VARIANTS;
|
|
101
|
+
|
|
102
|
+
/** One line's classes. */
|
|
103
|
+
export function codeBlockLineClass(opts: { variant?: CodeBlockLineVariant } = {}): string {
|
|
104
|
+
return cn(
|
|
105
|
+
"cn-code-block-line relative block min-h-lh after:absolute after:top-0 after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']",
|
|
106
|
+
CODE_BLOCK_LINE_VARIANTS[opts.variant ?? 'default'],
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** shadcn's name for {@link codeBlockLineClass}. Like cva, it merges a `className`. */
|
|
111
|
+
export function codeBlockLineVariants(opts: { variant?: CodeBlockLineVariant; className?: string } = {}): string {
|
|
112
|
+
return cn(codeBlockLineClass(opts), opts.className);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** The footer row. */
|
|
116
|
+
export function codeBlockFooterClass(): string {
|
|
117
|
+
return 'cn-code-block-footer flex min-w-0 shrink-0 items-center';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The line spans for `text`, one per line, for line numbers and highlights.
|
|
122
|
+
* `variants` maps a one-based line number to its variant.
|
|
123
|
+
*/
|
|
124
|
+
export function codeBlockLines(text: string, opts: { variants?: Record<number, CodeBlockLineVariant> } = {}) {
|
|
125
|
+
const lines = text.replace(/\n$/, '').split(/\n/);
|
|
126
|
+
return lines.map((line, i) => {
|
|
127
|
+
const variant = opts.variants?.[i + 1] ?? 'default';
|
|
128
|
+
// An empty line holds a newline, so copying a selection keeps blank lines.
|
|
129
|
+
// (Spelled as a char code: a string literal holding a newline reads, to the
|
|
130
|
+
// style bake's lexer, like a string that ran into code.)
|
|
131
|
+
return html`<span data-slot="code-block-line" data-variant=${variant} class=${codeBlockLineClass({ variant })}><span data-slot="code-block-line-content" class="min-w-0">${line === '' ? String.fromCharCode(10) : line}</span></span>`;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// --------------------------------------------------------------------------
|
|
136
|
+
// <ui-code-block-copy-button>
|
|
137
|
+
// --------------------------------------------------------------------------
|
|
138
|
+
|
|
139
|
+
export class UiCodeBlockCopyButton extends WebComponent({
|
|
140
|
+
value: String,
|
|
141
|
+
variant: String,
|
|
142
|
+
size: String,
|
|
143
|
+
}) {
|
|
144
|
+
readonly #copied = signal(false);
|
|
145
|
+
_timer = 0;
|
|
146
|
+
|
|
147
|
+
constructor() {
|
|
148
|
+
super();
|
|
149
|
+
this.value = '';
|
|
150
|
+
this.variant = 'ghost';
|
|
151
|
+
this.size = 'icon-xs';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
disconnectedCallback(): void {
|
|
155
|
+
clearTimeout(this._timer);
|
|
156
|
+
super.disconnectedCallback?.();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** What a click copies: the `value`, else the code in this block. */
|
|
160
|
+
text(): string {
|
|
161
|
+
if (this.value) return this.value;
|
|
162
|
+
const block = this.closest?.('[data-slot="code-block"]');
|
|
163
|
+
const code = block?.querySelector('[data-slot="code-block-code"]') ?? block?.querySelector('code');
|
|
164
|
+
return (code?.textContent ?? '').replace(/\n$/, '');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
render() {
|
|
168
|
+
return html`<button
|
|
169
|
+
type="button"
|
|
170
|
+
data-slot="code-block-copy-button"
|
|
171
|
+
?data-copied=${this.#copied.get()}
|
|
172
|
+
aria-label=${this.#copied.get() ? 'Copied' : 'Copy'}
|
|
173
|
+
class=${cn(buttonClass({ variant: this.variant as ButtonVariant, size: this.size as ButtonSize }), 'cn-code-block-copy-button')}
|
|
174
|
+
@click=${this._onClick}
|
|
175
|
+
>${this.#copied.get()
|
|
176
|
+
? html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>`
|
|
177
|
+
: html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg>`}</button><span aria-live="polite" class="sr-only">${this.#copied.get() ? 'Copied' : ''}</span>`;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
_onClick = (): void => {
|
|
181
|
+
const write = navigator.clipboard?.writeText?.(this.text());
|
|
182
|
+
if (!write) return;
|
|
183
|
+
write.then(() => {
|
|
184
|
+
this.#copied.set(true);
|
|
185
|
+
clearTimeout(this._timer);
|
|
186
|
+
this._timer = window.setTimeout(() => { this.#copied.set(false); }, 2000);
|
|
187
|
+
this.dispatchEvent(new CustomEvent('ui-copy', { bubbles: true, detail: { text: this.text() } }));
|
|
188
|
+
}).catch(() => {});
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
UiCodeBlockCopyButton.register('ui-code-block-copy-button');
|
|
@@ -65,7 +65,10 @@ export const collapsibleClass = (): string => 'group';
|
|
|
65
65
|
* `disabled` prop combines both visual and behavior; we split them.
|
|
66
66
|
*/
|
|
67
67
|
export const collapsibleTriggerClass = (opts: { disabled?: boolean } = {}): string => {
|
|
68
|
-
|
|
68
|
+
// shadcn's CollapsibleTrigger carries no classes of its own, so a button's
|
|
69
|
+
// classes merged onto it keep their size and type. Only the <summary>
|
|
70
|
+
// resets stay inline; new-york's row look rides the cn- name.
|
|
71
|
+
const base = 'cn-collapsible-trigger cursor-pointer list-none marker:hidden [&::-webkit-details-marker]:hidden';
|
|
69
72
|
if (opts.disabled) return `${base} pointer-events-none cursor-not-allowed opacity-50`;
|
|
70
73
|
return base;
|
|
71
74
|
};
|
|
@@ -74,4 +77,4 @@ export const collapsibleTriggerClass = (opts: { disabled?: boolean } = {}): stri
|
|
|
74
77
|
* Content: <details> already hides children other than <summary> when
|
|
75
78
|
* not [open], so this is purely typographic spacing. No display rules.
|
|
76
79
|
*/
|
|
77
|
-
export const collapsibleContentClass = (): string => '
|
|
80
|
+
export const collapsibleContentClass = (): string => 'cn-collapsible-content';
|