@vamos-ui/react 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +27 -2
- package/dist/blocks/block-heading.d.ts +29 -0
- package/dist/blocks/block-heading.js +39 -0
- package/dist/blocks/block-image.d.ts +52 -0
- package/dist/blocks/block-image.js +48 -0
- package/dist/blocks/block-link.d.ts +30 -0
- package/dist/blocks/block-link.js +36 -0
- package/dist/blocks/create-blocks.d.ts +54 -0
- package/dist/blocks/create-blocks.js +52 -0
- package/dist/blocks/index.d.ts +55 -0
- package/dist/blocks/index.js +59 -0
- package/dist/blocks/json-ld.d.ts +18 -0
- package/dist/blocks/json-ld.js +44 -0
- package/dist/blocks/labels.d.ts +20 -0
- package/dist/blocks/labels.js +43 -0
- package/dist/blocks/rich-text.d.ts +36 -0
- package/dist/blocks/rich-text.js +106 -0
- package/dist/blocks/schema/define-block.d.ts +151 -0
- package/dist/blocks/schema/define-block.js +120 -0
- package/dist/blocks/schema/emphasis.d.ts +17 -0
- package/dist/blocks/schema/emphasis.js +69 -0
- package/dist/blocks/schema/fields.d.ts +497 -0
- package/dist/blocks/schema/fields.js +240 -0
- package/dist/blocks/schema/icons.d.ts +2 -0
- package/dist/blocks/schema/icons.js +26 -0
- package/dist/blocks/schema/index.d.ts +18 -0
- package/dist/blocks/schema/index.js +21 -0
- package/dist/blocks/schema/lint-types.d.ts +16 -0
- package/dist/blocks/schema/lint-types.js +2 -0
- package/dist/blocks/schema/lint.d.ts +32 -0
- package/dist/blocks/schema/lint.js +164 -0
- package/dist/blocks/schema/localize.d.ts +20 -0
- package/dist/blocks/schema/localize.js +29 -0
- package/dist/blocks/schema/localized.d.ts +25 -0
- package/dist/blocks/schema/localized.js +53 -0
- package/dist/blocks/schema/migrate.d.ts +24 -0
- package/dist/blocks/schema/migrate.js +75 -0
- package/dist/blocks/schema/nodes.d.ts +196 -0
- package/dist/blocks/schema/nodes.js +78 -0
- package/dist/blocks/schema/rich-doc-schema.d.ts +32 -0
- package/dist/blocks/schema/rich-doc-schema.js +66 -0
- package/dist/blocks/schema/rich-doc.d.ts +90 -0
- package/dist/blocks/schema/rich-doc.js +62 -0
- package/dist/blocks/schema/safety.d.ts +20 -0
- package/dist/blocks/schema/safety.js +49 -0
- package/dist/blocks/schema/types.d.ts +172 -0
- package/dist/blocks/schema/types.js +3 -0
- package/dist/blocks/schema/validate.d.ts +17 -0
- package/dist/blocks/schema/validate.js +32 -0
- package/dist/blocks/schema/walk.d.ts +22 -0
- package/dist/blocks/schema/walk.js +60 -0
- package/dist/blocks/section-header.d.ts +38 -0
- package/dist/blocks/section-header.js +22 -0
- package/dist/blocks/section.d.ts +59 -0
- package/dist/blocks/section.js +66 -0
- package/dist/blocks/site/_kit-1.d.ts +101 -0
- package/dist/blocks/site/_kit-1.js +137 -0
- package/dist/blocks/site/_site-icon-1.d.ts +6 -0
- package/dist/blocks/site/_site-icon-1.js +15 -0
- package/dist/blocks/site/announcement-bar.d.ts +42 -0
- package/dist/blocks/site/announcement-bar.js +38 -0
- package/dist/blocks/site/announcement-dismiss.d.ts +18 -0
- package/dist/blocks/site/announcement-dismiss.js +28 -0
- package/dist/blocks/site/article-layout.d.ts +65 -0
- package/dist/blocks/site/article-layout.js +88 -0
- package/dist/blocks/site/blog-list.d.ts +79 -0
- package/dist/blocks/site/blog-list.js +78 -0
- package/dist/blocks/site/comparison-table.d.ts +54 -0
- package/dist/blocks/site/comparison-table.js +38 -0
- package/dist/blocks/site/consent-banner.d.ts +52 -0
- package/dist/blocks/site/consent-banner.js +33 -0
- package/dist/blocks/site/contact-dock.d.ts +52 -0
- package/dist/blocks/site/contact-dock.js +55 -0
- package/dist/blocks/site/contact-form.d.ts +60 -0
- package/dist/blocks/site/contact-form.js +45 -0
- package/dist/blocks/site/cta-booking.d.ts +43 -0
- package/dist/blocks/site/cta-booking.js +69 -0
- package/dist/blocks/site/cta.d.ts +74 -0
- package/dist/blocks/site/cta.js +113 -0
- package/dist/blocks/site/embed-facade.d.ts +20 -0
- package/dist/blocks/site/embed-facade.js +21 -0
- package/dist/blocks/site/faq.d.ts +48 -0
- package/dist/blocks/site/faq.js +52 -0
- package/dist/blocks/site/feature-grid.d.ts +46 -0
- package/dist/blocks/site/feature-grid.js +50 -0
- package/dist/blocks/site/feature-tabs.d.ts +22 -0
- package/dist/blocks/site/feature-tabs.js +11 -0
- package/dist/blocks/site/footer.d.ts +68 -0
- package/dist/blocks/site/footer.js +61 -0
- package/dist/blocks/site/gallery-section.d.ts +42 -0
- package/dist/blocks/site/gallery-section.js +48 -0
- package/dist/blocks/site/hero-video.d.ts +15 -0
- package/dist/blocks/site/hero-video.js +31 -0
- package/dist/blocks/site/hero.d.ts +64 -0
- package/dist/blocks/site/hero.js +73 -0
- package/dist/blocks/site/logo-strip.d.ts +44 -0
- package/dist/blocks/site/logo-strip.js +27 -0
- package/dist/blocks/site/map-hours.d.ts +83 -0
- package/dist/blocks/site/map-hours.js +125 -0
- package/dist/blocks/site/media-text.d.ts +45 -0
- package/dist/blocks/site/media-text.js +56 -0
- package/dist/blocks/site/menu-list.d.ts +74 -0
- package/dist/blocks/site/menu-list.js +84 -0
- package/dist/blocks/site/navbar-submenu.d.ts +18 -0
- package/dist/blocks/site/navbar-submenu.js +51 -0
- package/dist/blocks/site/navbar.d.ts +67 -0
- package/dist/blocks/site/navbar.js +64 -0
- package/dist/blocks/site/not-found.d.ts +40 -0
- package/dist/blocks/site/not-found.js +38 -0
- package/dist/blocks/site/page-intro.d.ts +46 -0
- package/dist/blocks/site/page-intro.js +44 -0
- package/dist/blocks/site/pricing-table.d.ts +67 -0
- package/dist/blocks/site/pricing-table.js +83 -0
- package/dist/blocks/site/process.d.ts +36 -0
- package/dist/blocks/site/process.js +42 -0
- package/dist/blocks/site/registry-1.d.ts +720 -0
- package/dist/blocks/site/registry-1.js +783 -0
- package/dist/blocks/site/registry-2.d.ts +914 -0
- package/dist/blocks/site/registry-2.js +563 -0
- package/dist/blocks/site/rich-text-section.d.ts +34 -0
- package/dist/blocks/site/rich-text-section.js +32 -0
- package/dist/blocks/site/shared/brand-icons.d.ts +21 -0
- package/dist/blocks/site/shared/brand-icons.js +56 -0
- package/dist/blocks/site/shared/consent-gate.d.ts +41 -0
- package/dist/blocks/site/shared/consent-gate.js +43 -0
- package/dist/blocks/site/shared/consent-island.d.ts +38 -0
- package/dist/blocks/site/shared/consent-island.js +63 -0
- package/dist/blocks/site/shared/consent.d.ts +49 -0
- package/dist/blocks/site/shared/consent.js +130 -0
- package/dist/blocks/site/shared/contact-form-island.d.ts +41 -0
- package/dist/blocks/site/shared/contact-form-island.js +100 -0
- package/dist/blocks/site/shared/copy-link.d.ts +10 -0
- package/dist/blocks/site/shared/copy-link.js +25 -0
- package/dist/blocks/site/shared/dock-avoid.d.ts +15 -0
- package/dist/blocks/site/shared/dock-avoid.js +107 -0
- package/dist/blocks/site/shared/dock-hours.d.ts +13 -0
- package/dist/blocks/site/shared/dock-hours.js +25 -0
- package/dist/blocks/site/shared/gallery-lightbox.d.ts +12 -0
- package/dist/blocks/site/shared/gallery-lightbox.js +10 -0
- package/dist/blocks/site/shared/island-keys.d.ts +10 -0
- package/dist/blocks/site/shared/island-keys.js +44 -0
- package/dist/blocks/site/shared/kit-2.d.ts +55 -0
- package/dist/blocks/site/shared/kit-2.js +84 -0
- package/dist/blocks/site/shared/labels-2.d.ts +209 -0
- package/dist/blocks/site/shared/labels-2.js +427 -0
- package/dist/blocks/site/shared/open-now.d.ts +22 -0
- package/dist/blocks/site/shared/open-now.js +27 -0
- package/dist/blocks/site/shared/opening-hours.d.ts +117 -0
- package/dist/blocks/site/shared/opening-hours.js +245 -0
- package/dist/blocks/site/shared/site-accent.d.ts +48 -0
- package/dist/blocks/site/shared/site-accent.js +249 -0
- package/dist/blocks/site/shared/site-form.d.ts +79 -0
- package/dist/blocks/site/shared/site-form.js +111 -0
- package/dist/blocks/site/shared/site-routing.d.ts +54 -0
- package/dist/blocks/site/shared/site-routing.js +86 -0
- package/dist/blocks/site/shared/testimonials-carousel.d.ts +17 -0
- package/dist/blocks/site/shared/testimonials-carousel.js +64 -0
- package/dist/blocks/site/site-shell.d.ts +108 -0
- package/dist/blocks/site/site-shell.js +254 -0
- package/dist/blocks/site/stats-band.d.ts +42 -0
- package/dist/blocks/site/stats-band.js +45 -0
- package/dist/blocks/site/team.d.ts +44 -0
- package/dist/blocks/site/team.js +48 -0
- package/dist/blocks/site/testimonials.d.ts +68 -0
- package/dist/blocks/site/testimonials.js +66 -0
- package/dist/blocks/types.d.ts +63 -0
- package/dist/blocks/types.js +2 -0
- package/dist/business/approval-flow.d.ts +152 -0
- package/dist/business/approval-flow.js +221 -0
- package/dist/business/export-core.d.ts +55 -0
- package/dist/business/export-core.js +101 -0
- package/dist/business/export.d.ts +148 -0
- package/dist/business/export.js +264 -0
- package/dist/business/import-core.d.ts +104 -0
- package/dist/business/import-core.js +281 -0
- package/dist/business/import-wizard.d.ts +186 -0
- package/dist/business/import-wizard.js +401 -0
- package/dist/business/index.d.ts +12 -0
- package/dist/business/index.js +22 -0
- package/dist/business/line-items-core.d.ts +129 -0
- package/dist/business/line-items-core.js +183 -0
- package/dist/business/line-items.d.ts +119 -0
- package/dist/business/line-items.js +299 -0
- package/dist/business/multi-step-form.d.ts +131 -0
- package/dist/business/multi-step-form.js +337 -0
- package/dist/business/permission-core.d.ts +59 -0
- package/dist/business/permission-core.js +99 -0
- package/dist/business/permission-matrix.d.ts +158 -0
- package/dist/business/permission-matrix.js +341 -0
- package/dist/business/setup-checklist.d.ts +80 -0
- package/dist/business/setup-checklist.js +92 -0
- package/dist/business/signer-status.d.ts +53 -0
- package/dist/business/signer-status.js +76 -0
- package/dist/charts/area-chart.d.ts +35 -0
- package/dist/charts/area-chart.js +33 -0
- package/dist/charts/bar-chart.d.ts +27 -0
- package/dist/charts/bar-chart.js +46 -0
- package/dist/charts/bar-list.d.ts +47 -0
- package/dist/charts/bar-list.js +60 -0
- package/dist/charts/chart-shell.d.ts +173 -0
- package/dist/charts/chart-shell.js +205 -0
- package/dist/charts/chart.d.ts +73 -0
- package/dist/charts/chart.js +106 -0
- package/dist/charts/combo-chart.d.ts +29 -0
- package/dist/charts/combo-chart.js +47 -0
- package/dist/charts/donut-chart.d.ts +33 -0
- package/dist/charts/donut-chart.js +113 -0
- package/dist/charts/funnel.d.ts +51 -0
- package/dist/charts/funnel.js +69 -0
- package/dist/charts/gauge.d.ts +62 -0
- package/dist/charts/gauge.js +104 -0
- package/dist/charts/heatmap.d.ts +81 -0
- package/dist/charts/heatmap.js +338 -0
- package/dist/charts/index.d.ts +12 -0
- package/dist/charts/index.js +14 -0
- package/dist/charts/line-chart.d.ts +21 -0
- package/dist/charts/line-chart.js +36 -0
- package/dist/charts/test-utils.d.ts +2 -0
- package/dist/charts/test-utils.js +38 -0
- package/dist/charts/utils.d.ts +130 -0
- package/dist/charts/utils.js +262 -0
- package/dist/components/_qr-core.d.ts +26 -0
- package/dist/components/_qr-core.js +376 -0
- package/dist/components/accordion.d.ts +47 -0
- package/dist/components/accordion.js +70 -0
- package/dist/components/activity-timeline.d.ts +149 -0
- package/dist/components/activity-timeline.js +122 -0
- package/dist/components/address-field.d.ts +116 -0
- package/dist/components/address-field.js +219 -0
- package/dist/components/alert-dialog.d.ts +99 -0
- package/dist/components/alert-dialog.js +192 -0
- package/dist/components/alert.d.ts +42 -0
- package/dist/components/alert.js +82 -0
- package/dist/components/app-shell.d.ts +159 -0
- package/dist/components/app-shell.js +289 -0
- package/dist/components/attachment-list.d.ts +96 -0
- package/dist/components/attachment-list.js +196 -0
- package/dist/components/audit-log.d.ts +150 -0
- package/dist/components/audit-log.js +205 -0
- package/dist/components/avatar.d.ts +87 -0
- package/dist/components/avatar.js +126 -0
- package/dist/components/backup-codes.d.ts +42 -0
- package/dist/components/backup-codes.js +67 -0
- package/dist/components/badge.d.ts +41 -0
- package/dist/components/badge.js +68 -0
- package/dist/components/breadcrumb.d.ts +78 -0
- package/dist/components/breadcrumb.js +106 -0
- package/dist/components/button-group.d.ts +52 -0
- package/dist/components/button-group.js +77 -0
- package/dist/components/button.d.ts +58 -0
- package/dist/components/button.js +107 -0
- package/dist/components/calendar.d.ts +240 -0
- package/dist/components/calendar.js +483 -0
- package/dist/components/card.d.ts +66 -0
- package/dist/components/card.js +76 -0
- package/dist/components/carousel.d.ts +170 -0
- package/dist/components/carousel.js +348 -0
- package/dist/components/checkbox.d.ts +78 -0
- package/dist/components/checkbox.js +138 -0
- package/dist/components/color-picker.d.ts +112 -0
- package/dist/components/color-picker.js +235 -0
- package/dist/components/combobox.d.ts +136 -0
- package/dist/components/combobox.js +294 -0
- package/dist/components/command.d.ts +281 -0
- package/dist/components/command.js +498 -0
- package/dist/components/comment-thread.d.ts +252 -0
- package/dist/components/comment-thread.js +449 -0
- package/dist/components/context-menu.d.ts +77 -0
- package/dist/components/context-menu.js +82 -0
- package/dist/components/currency-input.d.ts +43 -0
- package/dist/components/currency-input.js +85 -0
- package/dist/components/date-picker.d.ts +141 -0
- package/dist/components/date-picker.js +241 -0
- package/dist/components/date-range-picker.d.ts +91 -0
- package/dist/components/date-range-picker.js +251 -0
- package/dist/components/description-list.d.ts +92 -0
- package/dist/components/description-list.js +42 -0
- package/dist/components/dialog.d.ts +139 -0
- package/dist/components/dialog.js +185 -0
- package/dist/components/dropdown-menu.d.ts +100 -0
- package/dist/components/dropdown-menu.js +102 -0
- package/dist/components/editor-layout.d.ts +166 -0
- package/dist/components/editor-layout.js +237 -0
- package/dist/components/empty-state.d.ts +49 -0
- package/dist/components/empty-state.js +68 -0
- package/dist/components/entity-card.d.ts +83 -0
- package/dist/components/entity-card.js +92 -0
- package/dist/components/file-upload.d.ts +256 -0
- package/dist/components/file-upload.js +490 -0
- package/dist/components/formatted-input.d.ts +177 -0
- package/dist/components/formatted-input.js +399 -0
- package/dist/components/hierarchy-chart.d.ts +190 -0
- package/dist/components/hierarchy-chart.js +890 -0
- package/dist/components/hover-card.d.ts +21 -0
- package/dist/components/hover-card.js +32 -0
- package/dist/components/iban-input.d.ts +38 -0
- package/dist/components/iban-input.js +112 -0
- package/dist/components/id-input.d.ts +65 -0
- package/dist/components/id-input.js +130 -0
- package/dist/components/image.d.ts +130 -0
- package/dist/components/image.js +168 -0
- package/dist/components/input-otp.d.ts +62 -0
- package/dist/components/input-otp.js +73 -0
- package/dist/components/input.d.ts +141 -0
- package/dist/components/input.js +187 -0
- package/dist/components/item.d.ts +96 -0
- package/dist/components/item.js +113 -0
- package/dist/components/kbd.d.ts +64 -0
- package/dist/components/kbd.js +119 -0
- package/dist/components/list-layout.d.ts +144 -0
- package/dist/components/list-layout.js +210 -0
- package/dist/components/native-select.d.ts +33 -0
- package/dist/components/native-select.js +48 -0
- package/dist/components/navigation-menu.d.ts +127 -0
- package/dist/components/navigation-menu.js +129 -0
- package/dist/components/notification-center.d.ts +164 -0
- package/dist/components/notification-center.js +399 -0
- package/dist/components/page-header.d.ts +60 -0
- package/dist/components/page-header.js +60 -0
- package/dist/components/pagination.d.ts +121 -0
- package/dist/components/pagination.js +174 -0
- package/dist/components/phone-input.d.ts +49 -0
- package/dist/components/phone-input.js +266 -0
- package/dist/components/pin-map.d.ts +58 -0
- package/dist/components/pin-map.js +167 -0
- package/dist/components/popover.d.ts +38 -0
- package/dist/components/popover.js +69 -0
- package/dist/components/progress.d.ts +79 -0
- package/dist/components/progress.js +97 -0
- package/dist/components/qr-code.d.ts +36 -0
- package/dist/components/qr-code.js +27 -0
- package/dist/components/radio-group.d.ts +43 -0
- package/dist/components/radio-group.js +81 -0
- package/dist/components/record-detail-layout.d.ts +167 -0
- package/dist/components/record-detail-layout.js +233 -0
- package/dist/components/record-picker.d.ts +199 -0
- package/dist/components/record-picker.js +650 -0
- package/dist/components/resizable.d.ts +50 -0
- package/dist/components/resizable.js +88 -0
- package/dist/components/scroll-area.d.ts +40 -0
- package/dist/components/scroll-area.js +56 -0
- package/dist/components/select.d.ts +126 -0
- package/dist/components/select.js +137 -0
- package/dist/components/separator.d.ts +31 -0
- package/dist/components/separator.js +41 -0
- package/dist/components/settings-layout.d.ts +134 -0
- package/dist/components/settings-layout.js +180 -0
- package/dist/components/sheet.d.ts +103 -0
- package/dist/components/sheet.js +165 -0
- package/dist/components/sidebar.d.ts +171 -0
- package/dist/components/sidebar.js +421 -0
- package/dist/components/signature-pad.d.ts +85 -0
- package/dist/components/signature-pad.js +283 -0
- package/dist/components/skeleton.d.ts +64 -0
- package/dist/components/skeleton.js +53 -0
- package/dist/components/sla-timer.d.ts +75 -0
- package/dist/components/sla-timer.js +142 -0
- package/dist/components/slider.d.ts +57 -0
- package/dist/components/slider.js +133 -0
- package/dist/components/slug-input.d.ts +69 -0
- package/dist/components/slug-input.js +201 -0
- package/dist/components/sparkline.d.ts +54 -0
- package/dist/components/sparkline.js +122 -0
- package/dist/components/spinner.d.ts +34 -0
- package/dist/components/spinner.js +34 -0
- package/dist/components/stat.d.ts +135 -0
- package/dist/components/stat.js +130 -0
- package/dist/components/status-picker.d.ts +107 -0
- package/dist/components/status-picker.js +175 -0
- package/dist/components/stepper.d.ts +86 -0
- package/dist/components/stepper.js +103 -0
- package/dist/components/switch.d.ts +34 -0
- package/dist/components/switch.js +70 -0
- package/dist/components/table.d.ts +101 -0
- package/dist/components/table.js +72 -0
- package/dist/components/tabs.d.ts +103 -0
- package/dist/components/tabs.js +173 -0
- package/dist/components/tag-input.d.ts +77 -0
- package/dist/components/tag-input.js +305 -0
- package/dist/components/task-list.d.ts +89 -0
- package/dist/components/task-list.js +238 -0
- package/dist/components/time-picker.d.ts +119 -0
- package/dist/components/time-picker.js +399 -0
- package/dist/components/toast.d.ts +87 -0
- package/dist/components/toast.js +142 -0
- package/dist/components/toggle.d.ts +77 -0
- package/dist/components/toggle.js +109 -0
- package/dist/components/tooltip.d.ts +69 -0
- package/dist/components/tooltip.js +105 -0
- package/dist/components/top-bar.d.ts +87 -0
- package/dist/components/top-bar.js +99 -0
- package/dist/components/tour.d.ts +60 -0
- package/dist/components/tour.js +139 -0
- package/dist/components/tree-select.d.ts +89 -0
- package/dist/components/tree-select.js +243 -0
- package/dist/components/tree-view.d.ts +109 -0
- package/dist/components/tree-view.js +170 -0
- package/dist/components/typography.d.ts +107 -0
- package/dist/components/typography.js +128 -0
- package/dist/components/user-picker.d.ts +89 -0
- package/dist/components/user-picker.js +162 -0
- package/dist/components/version-history.d.ts +191 -0
- package/dist/components/version-history.js +431 -0
- package/dist/data-table/csv.d.ts +27 -0
- package/dist/data-table/csv.js +68 -0
- package/dist/data-table/data-table.d.ts +423 -0
- package/dist/data-table/data-table.js +1259 -0
- package/dist/data-table/filter-bar.d.ts +146 -0
- package/dist/data-table/filter-bar.js +569 -0
- package/dist/data-table/filter-fns.d.ts +65 -0
- package/dist/data-table/filter-fns.js +382 -0
- package/dist/data-table/index.d.ts +8 -0
- package/dist/data-table/index.js +9 -0
- package/dist/data-table/saved-views.d.ts +100 -0
- package/dist/data-table/saved-views.js +251 -0
- package/dist/data-table/types.d.ts +168 -0
- package/dist/data-table/types.js +87 -0
- package/dist/data-table/url-state.d.ts +94 -0
- package/dist/data-table/url-state.js +303 -0
- package/dist/data-table/view-state.d.ts +16 -0
- package/dist/data-table/view-state.js +81 -0
- package/dist/editor/_test-setup.d.ts +1 -0
- package/dist/editor/_test-setup.js +33 -0
- package/dist/editor/block-editor.d.ts +137 -0
- package/dist/editor/block-editor.js +280 -0
- package/dist/editor/commands.d.ts +31 -0
- package/dist/editor/commands.js +150 -0
- package/dist/editor/context.d.ts +108 -0
- package/dist/editor/context.js +30 -0
- package/dist/editor/convert.d.ts +66 -0
- package/dist/editor/convert.js +567 -0
- package/dist/editor/drag-handle.d.ts +10 -0
- package/dist/editor/drag-handle.js +69 -0
- package/dist/editor/extensions.d.ts +34 -0
- package/dist/editor/extensions.js +239 -0
- package/dist/editor/index.d.ts +14 -0
- package/dist/editor/index.js +17 -0
- package/dist/editor/inserter.d.ts +12 -0
- package/dist/editor/inserter.js +88 -0
- package/dist/editor/inspector.d.ts +17 -0
- package/dist/editor/inspector.js +65 -0
- package/dist/editor/items.d.ts +62 -0
- package/dist/editor/items.js +195 -0
- package/dist/editor/labels.d.ts +119 -0
- package/dist/editor/labels.js +130 -0
- package/dist/editor/markdown.d.ts +14 -0
- package/dist/editor/markdown.js +209 -0
- package/dist/editor/menus.d.ts +20 -0
- package/dist/editor/menus.js +236 -0
- package/dist/editor/nodes.d.ts +14 -0
- package/dist/editor/nodes.js +201 -0
- package/dist/editor/outline.d.ts +11 -0
- package/dist/editor/outline.js +52 -0
- package/dist/editor/schema-form.d.ts +64 -0
- package/dist/editor/schema-form.js +290 -0
- package/dist/editor/slash-menu.d.ts +15 -0
- package/dist/editor/slash-menu.js +119 -0
- package/dist/fonts/catalog.d.ts +53 -0
- package/dist/fonts/catalog.js +121 -0
- package/dist/fonts/font-picker.d.ts +70 -0
- package/dist/fonts/font-picker.js +225 -0
- package/dist/fonts/index.d.ts +6 -0
- package/dist/fonts/index.js +7 -0
- package/dist/fonts/loader.d.ts +66 -0
- package/dist/fonts/loader.js +161 -0
- package/dist/fonts/pairing-picker.d.ts +31 -0
- package/dist/fonts/pairing-picker.js +81 -0
- package/dist/fonts/pairings.d.ts +84 -0
- package/dist/fonts/pairings.js +149 -0
- package/dist/fonts/provider.d.ts +34 -0
- package/dist/fonts/provider.js +51 -0
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.js +1 -0
- package/dist/format/core.d.ts +149 -0
- package/dist/format/core.js +357 -0
- package/dist/format/index.d.ts +4 -0
- package/dist/format/index.js +5 -0
- package/dist/format/use-format.d.ts +1 -0
- package/dist/format/use-format.js +3 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +92 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.js +16 -0
- package/dist/lib/color.d.ts +64 -0
- package/dist/lib/color.js +177 -0
- package/dist/lib/compose-refs.d.ts +24 -0
- package/dist/lib/compose-refs.js +45 -0
- package/dist/lib/data-islands.d.ts +194 -0
- package/dist/lib/data-islands.js +368 -0
- package/dist/lib/date.d.ts +129 -0
- package/dist/lib/date.js +386 -0
- package/dist/lib/field-context.d.ts +64 -0
- package/dist/lib/field-context.js +62 -0
- package/dist/lib/floating-arrow.d.ts +18 -0
- package/dist/lib/floating-arrow.js +15 -0
- package/dist/lib/islands.d.ts +38 -0
- package/dist/lib/islands.js +40 -0
- package/dist/lib/labels.d.ts +51 -0
- package/dist/lib/labels.js +56 -0
- package/dist/lib/layer.d.ts +36 -0
- package/dist/lib/layer.js +42 -0
- package/dist/lib/locale.d.ts +85 -0
- package/dist/lib/locale.js +105 -0
- package/dist/lib/menu.d.ts +58 -0
- package/dist/lib/menu.js +99 -0
- package/dist/lib/message-format.d.ts +20 -0
- package/dist/lib/message-format.js +116 -0
- package/dist/lib/nav.d.ts +132 -0
- package/dist/lib/nav.js +178 -0
- package/dist/lib/provider.d.ts +100 -0
- package/dist/lib/provider.js +105 -0
- package/dist/lib/public.d.ts +23 -0
- package/dist/lib/public.js +34 -0
- package/dist/lib/sr-name.d.ts +18 -0
- package/dist/lib/sr-name.js +17 -0
- package/dist/lib/text.d.ts +100 -0
- package/dist/lib/text.js +233 -0
- package/dist/lib/theme-scope.d.ts +58 -0
- package/dist/lib/theme-scope.js +59 -0
- package/dist/lib/use-async-list.d.ts +60 -0
- package/dist/lib/use-async-list.js +119 -0
- package/dist/lib/use-container-width.d.ts +19 -0
- package/dist/lib/use-container-width.js +39 -0
- package/dist/lib/use-controllable-state.d.ts +33 -0
- package/dist/lib/use-controllable-state.js +56 -0
- package/dist/lib/use-edge-fade.d.ts +13 -0
- package/dist/lib/use-edge-fade.js +43 -0
- package/dist/lib/use-formatted-input.d.ts +69 -0
- package/dist/lib/use-formatted-input.js +152 -0
- package/dist/lib/use-hotkeys.d.ts +80 -0
- package/dist/lib/use-hotkeys.js +221 -0
- package/dist/lib/use-hover-intent.d.ts +44 -0
- package/dist/lib/use-hover-intent.js +119 -0
- package/dist/lib/use-media-query.d.ts +21 -0
- package/dist/lib/use-media-query.js +28 -0
- package/dist/lib/use-reduced-motion.d.ts +8 -0
- package/dist/lib/use-reduced-motion.js +13 -0
- package/dist/lib/use-tree.d.ts +153 -0
- package/dist/lib/use-tree.js +534 -0
- package/dist/lib/value-format.d.ts +25 -0
- package/dist/lib/value-format.js +56 -0
- package/dist/lib/variants.d.ts +131 -0
- package/dist/lib/variants.js +109 -0
- package/dist/locale-data/core/date.d.ts +24 -0
- package/dist/locale-data/core/date.js +68 -0
- package/dist/locale-data/core/decimal.d.ts +19 -0
- package/dist/locale-data/core/decimal.js +79 -0
- package/dist/locale-data/core/holidays.d.ts +30 -0
- package/dist/locale-data/core/holidays.js +79 -0
- package/dist/locale-data/core/iban.d.ts +29 -0
- package/dist/locale-data/core/iban.js +74 -0
- package/dist/locale-data/core/index.d.ts +7 -0
- package/dist/locale-data/core/index.js +6 -0
- package/dist/locale-data/core/types.d.ts +173 -0
- package/dist/locale-data/core/types.js +6 -0
- package/dist/locale-data/core/week-info.d.ts +23 -0
- package/dist/locale-data/core/week-info.js +85 -0
- package/dist/locale-data/core/working-days.d.ts +27 -0
- package/dist/locale-data/core/working-days.js +133 -0
- package/dist/locale-data/index.d.ts +2 -0
- package/dist/locale-data/index.js +4 -0
- package/dist/locale-data/tr/address-tr.json +1 -0
- package/dist/locale-data/tr/address.d.ts +23 -0
- package/dist/locale-data/tr/address.js +52 -0
- package/dist/locale-data/tr/holidays.d.ts +31 -0
- package/dist/locale-data/tr/holidays.js +81 -0
- package/dist/locale-data/tr/iban.d.ts +21 -0
- package/dist/locale-data/tr/iban.js +45 -0
- package/dist/locale-data/tr/id.d.ts +36 -0
- package/dist/locale-data/tr/id.js +120 -0
- package/dist/locale-data/tr/index.d.ts +12 -0
- package/dist/locale-data/tr/index.js +33 -0
- package/dist/locale-data/tr/kdv.d.ts +91 -0
- package/dist/locale-data/tr/kdv.js +222 -0
- package/dist/locales/en.d.ts +2102 -0
- package/dist/locales/en.js +2088 -0
- package/dist/locales/tr.d.ts +2086 -0
- package/dist/locales/tr.js +2087 -0
- package/dist/media/focal-point.d.ts +42 -0
- package/dist/media/focal-point.js +96 -0
- package/dist/media/gallery-layout.d.ts +19 -0
- package/dist/media/gallery-layout.js +61 -0
- package/dist/media/gallery.d.ts +64 -0
- package/dist/media/gallery.js +140 -0
- package/dist/media/image-cropper.d.ts +86 -0
- package/dist/media/image-cropper.js +170 -0
- package/dist/media/image-field.d.ts +115 -0
- package/dist/media/image-field.js +212 -0
- package/dist/media/index.d.ts +19 -0
- package/dist/media/index.js +23 -0
- package/dist/media/lightbox.d.ts +82 -0
- package/dist/media/lightbox.js +171 -0
- package/dist/media/link-preview.d.ts +97 -0
- package/dist/media/link-preview.js +177 -0
- package/dist/media/media-library.d.ts +244 -0
- package/dist/media/media-library.js +776 -0
- package/dist/media/media-picker.d.ts +96 -0
- package/dist/media/media-picker.js +209 -0
- package/dist/media/media-provider.d.ts +23 -0
- package/dist/media/media-provider.js +44 -0
- package/dist/media/media-utils.d.ts +39 -0
- package/dist/media/media-utils.js +145 -0
- package/dist/media/memory-adapter.d.ts +22 -0
- package/dist/media/memory-adapter.js +162 -0
- package/dist/media/rest-adapter.d.ts +90 -0
- package/dist/media/rest-adapter.js +208 -0
- package/dist/media/serp.d.ts +62 -0
- package/dist/media/serp.js +108 -0
- package/dist/media/test-fixtures.d.ts +3 -0
- package/dist/media/test-fixtures.js +37 -0
- package/dist/media/types.d.ts +183 -0
- package/dist/media/types.js +3 -0
- package/dist/media/use-pan-zoom.d.ts +51 -0
- package/dist/media/use-pan-zoom.js +156 -0
- package/dist/media/use-upload-queue.d.ts +64 -0
- package/dist/media/use-upload-queue.js +115 -0
- package/dist/media/video-player.d.ts +135 -0
- package/dist/media/video-player.js +319 -0
- package/dist/motion/core.d.ts +32 -0
- package/dist/motion/core.js +77 -0
- package/dist/motion/count-up.d.ts +29 -0
- package/dist/motion/count-up.js +92 -0
- package/dist/motion/index.d.ts +11 -0
- package/dist/motion/index.js +13 -0
- package/dist/motion/motion-scope.d.ts +17 -0
- package/dist/motion/motion-scope.js +16 -0
- package/dist/motion/page-transition.d.ts +33 -0
- package/dist/motion/page-transition.js +61 -0
- package/dist/motion/parallax.d.ts +37 -0
- package/dist/motion/parallax.js +90 -0
- package/dist/motion/pointer.d.ts +38 -0
- package/dist/motion/pointer.js +117 -0
- package/dist/motion/reveal.d.ts +72 -0
- package/dist/motion/reveal.js +133 -0
- package/dist/motion/scroll-shrink.d.ts +18 -0
- package/dist/motion/scroll-shrink.js +47 -0
- package/dist/motion/skeleton-swap.d.ts +17 -0
- package/dist/motion/skeleton-swap.js +43 -0
- package/dist/motion/text-reveal.d.ts +30 -0
- package/dist/motion/text-reveal.js +29 -0
- package/dist/motion/ticker.d.ts +35 -0
- package/dist/motion/ticker.js +16 -0
- package/dist/next/index.d.ts +42 -0
- package/dist/next/index.js +36 -0
- package/dist/render/block-renderer.d.ts +56 -0
- package/dist/render/block-renderer.js +137 -0
- package/dist/render/index.d.ts +6 -0
- package/dist/render/index.js +7 -0
- package/dist/render/prepare.d.ts +61 -0
- package/dist/render/prepare.js +119 -0
- package/dist/scheduler/core/duration.d.ts +83 -0
- package/dist/scheduler/core/duration.js +174 -0
- package/dist/scheduler/core/gantt.d.ts +63 -0
- package/dist/scheduler/core/gantt.js +226 -0
- package/dist/scheduler/core/index.d.ts +6 -0
- package/dist/scheduler/core/index.js +7 -0
- package/dist/scheduler/core/layout.d.ts +97 -0
- package/dist/scheduler/core/layout.js +249 -0
- package/dist/scheduler/core/time-scale.d.ts +89 -0
- package/dist/scheduler/core/time-scale.js +173 -0
- package/dist/scheduler/gantt.d.ts +125 -0
- package/dist/scheduler/gantt.js +532 -0
- package/dist/scheduler/index.d.ts +6 -0
- package/dist/scheduler/index.js +7 -0
- package/dist/scheduler/resource-calendar.d.ts +218 -0
- package/dist/scheduler/resource-calendar.js +661 -0
- package/dist/scheduler/scheduler.d.ts +168 -0
- package/dist/scheduler/scheduler.js +768 -0
- package/dist/scheduler/shared.d.ts +63 -0
- package/dist/scheduler/shared.js +145 -0
- package/dist/scheduler/time-tracker.d.ts +138 -0
- package/dist/scheduler/time-tracker.js +403 -0
- package/dist/sortable/core.d.ts +67 -0
- package/dist/sortable/core.js +167 -0
- package/dist/sortable/index.d.ts +8 -0
- package/dist/sortable/index.js +10 -0
- package/dist/sortable/kanban-core.d.ts +70 -0
- package/dist/sortable/kanban-core.js +67 -0
- package/dist/sortable/kanban.d.ts +147 -0
- package/dist/sortable/kanban.js +472 -0
- package/dist/sortable/sortable-list.d.ts +71 -0
- package/dist/sortable/sortable-list.js +76 -0
- package/dist/sortable/sortable-tree.d.ts +105 -0
- package/dist/sortable/sortable-tree.js +462 -0
- package/dist/sortable/sortable.d.ts +188 -0
- package/dist/sortable/sortable.js +485 -0
- package/dist/sortable/use-pointer-drag.d.ts +75 -0
- package/dist/sortable/use-pointer-drag.js +173 -0
- package/dist/sortable/use-time-scale.d.ts +11 -0
- package/dist/sortable/use-time-scale.js +19 -0
- package/dist/styles/base.css +51 -0
- package/dist/styles/blocks.css +949 -0
- package/dist/styles/calendar.css +642 -0
- package/dist/styles/charts.css +264 -0
- package/dist/styles/data.css +474 -0
- package/dist/styles/editors.css +1022 -0
- package/dist/styles/forms.css +406 -0
- package/dist/styles/media.css +515 -0
- package/dist/styles/motion.css +389 -0
- package/dist/styles/navigation.css +293 -0
- package/dist/styles/overlays.css +244 -0
- package/dist/styles.css +743 -0
- package/package.json +160 -4
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type TreeCheckValueMode, type TreeItemState, type TreeNode, type UseTreeReturn } from "../lib/use-tree.js";
|
|
3
|
+
export type { TreeNode, TreeItemState, TreeCheckValueMode } from "../lib/use-tree.js";
|
|
4
|
+
export { useTree, type UseTreeOptions, type UseTreeReturn, type TreeCheckedState } from "../lib/use-tree.js";
|
|
5
|
+
declare const treeViewLabels: {
|
|
6
|
+
loading: string;
|
|
7
|
+
loadError: string;
|
|
8
|
+
retry: string;
|
|
9
|
+
empty: string;
|
|
10
|
+
noMatches: string;
|
|
11
|
+
results: string;
|
|
12
|
+
};
|
|
13
|
+
export type TreeViewLabels = typeof treeViewLabels;
|
|
14
|
+
export declare const treeRowVariants: (props?: ({
|
|
15
|
+
size?: "sm" | "md" | null | undefined;
|
|
16
|
+
variant?: "sidebar" | "default" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
/** Check box drawn for a treeitem (state lives on the row's `aria-checked`). */
|
|
19
|
+
export declare function TreeCheckboxMark({ checked, className }: {
|
|
20
|
+
checked: boolean | "mixed";
|
|
21
|
+
className?: string;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
/** Label with matched parts in bold (weight, not colour — readable on glass). */
|
|
24
|
+
export declare function TreeLabelText({ text, query, locale }: {
|
|
25
|
+
text: string;
|
|
26
|
+
query?: string;
|
|
27
|
+
locale?: string;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
export interface TreeViewRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
30
|
+
item: TreeItemState;
|
|
31
|
+
tree: UseTreeReturn;
|
|
32
|
+
/** Indent per level in px. */
|
|
33
|
+
indent?: number;
|
|
34
|
+
guides?: boolean;
|
|
35
|
+
size?: "sm" | "md";
|
|
36
|
+
variant?: "default" | "sidebar";
|
|
37
|
+
/** Show the check mark (checkbox mode). */
|
|
38
|
+
checkbox?: boolean;
|
|
39
|
+
query?: string;
|
|
40
|
+
/** Replace the label. */
|
|
41
|
+
label?: React.ReactNode;
|
|
42
|
+
/** Trailing buttons, revealed on hover / focus. */
|
|
43
|
+
actions?: React.ReactNode;
|
|
44
|
+
labels?: Partial<TreeViewLabels>;
|
|
45
|
+
/** Called on row click after the built-in behaviour. */
|
|
46
|
+
onRowClick?: (item: TreeItemState, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* One treeitem: indent guides, chevron (spinner while children load, retry on error), check mark,
|
|
50
|
+
* icon, label, badge and hover actions. Used by Tree view and Tree select; render it inside an
|
|
51
|
+
* element carrying `tree.getTreeProps()`.
|
|
52
|
+
*/
|
|
53
|
+
export declare const TreeViewRow: React.ForwardRefExoticComponent<TreeViewRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export interface TreeViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onSelect" | "children"> {
|
|
55
|
+
/** The hierarchy. */
|
|
56
|
+
data: TreeNode[];
|
|
57
|
+
expanded?: string[];
|
|
58
|
+
defaultExpanded?: string[];
|
|
59
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
60
|
+
/** `"checkbox"` = tri-state checks with cascade. Default `"single"`. */
|
|
61
|
+
selectionMode?: "none" | "single" | "multiple" | "checkbox";
|
|
62
|
+
/** Selected ids (checked ids in `"checkbox"` mode). */
|
|
63
|
+
selected?: string[];
|
|
64
|
+
defaultSelected?: string[];
|
|
65
|
+
onSelectedChange?: (ids: string[]) => void;
|
|
66
|
+
/** Checkbox mode: checking a parent checks its descendants. Default `true`. */
|
|
67
|
+
cascade?: boolean;
|
|
68
|
+
/** Checkbox mode: what a fully-checked branch yields. Default `"all"`. */
|
|
69
|
+
checkValueMode?: TreeCheckValueMode;
|
|
70
|
+
/** Can this node be selected? Default: any enabled node. */
|
|
71
|
+
isSelectable?: (node: TreeNode, hasChildren: boolean) => boolean;
|
|
72
|
+
/** Loads children of a node with `hasChildren` on first expand. */
|
|
73
|
+
loadChildren?: (node: TreeNode, signal: AbortSignal) => Promise<TreeNode[]>;
|
|
74
|
+
/** Keeps matches + ancestors and highlights the match. */
|
|
75
|
+
filter?: string;
|
|
76
|
+
/** Enter / double click (open a page, a folder). */
|
|
77
|
+
onAction?: (node: TreeNode) => void;
|
|
78
|
+
/** Trailing per-row buttons (revealed on hover / focus). Use `tabIndex={-1}`-free IconButtons; they stay mouse + Tab reachable. */
|
|
79
|
+
renderActions?: (node: TreeNode) => React.ReactNode;
|
|
80
|
+
/** Replace a row's label. */
|
|
81
|
+
renderLabel?: (item: TreeItemState) => React.ReactNode;
|
|
82
|
+
/** Render only the rows in view (thousands of nodes). Needs a fixed `height`. */
|
|
83
|
+
virtual?: boolean;
|
|
84
|
+
/** Scroll height (virtual mode, or any long tree). Default 360 when `virtual`. */
|
|
85
|
+
height?: number | string;
|
|
86
|
+
/** Indent per level in px. Default 16. */
|
|
87
|
+
indent?: number;
|
|
88
|
+
/** Indent guide lines. Default `true`. */
|
|
89
|
+
guides?: boolean;
|
|
90
|
+
variant?: "default" | "sidebar";
|
|
91
|
+
size?: "sm" | "md";
|
|
92
|
+
/** Shown when `data` is empty. */
|
|
93
|
+
emptyState?: React.ReactNode;
|
|
94
|
+
labels?: Partial<TreeViewLabels>;
|
|
95
|
+
/** Accessible name of the tree. */
|
|
96
|
+
"aria-label"?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Display and navigate hierarchies — CMS page tree, category tree, media folders, department
|
|
100
|
+
* tree, file explorer panes. A flat WAI-ARIA tree (level / set size / position on every row) with
|
|
101
|
+
* single, multiple or tri-state checkbox selection, lazy children, filter with ancestors kept and
|
|
102
|
+
* optional virtualisation for 10k+ nodes.
|
|
103
|
+
*
|
|
104
|
+
* ```tsx
|
|
105
|
+
* <TreeView aria-label="Pages" data={pages} defaultExpanded={["company"]} onAction={(n) => open(n.id)} />
|
|
106
|
+
* <TreeView aria-label="Categories" data={categories} selectionMode="checkbox" checkValueMode="leaf" />
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare const TreeView: React.ForwardRefExoticComponent<TreeViewProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
6
|
+
import { ChevronRight, RotateCw, TriangleAlert } from "lucide-react";
|
|
7
|
+
import { cn } from "../lib/cn.js";
|
|
8
|
+
import { useLabels } from "../lib/labels.js";
|
|
9
|
+
import { useLocale } from "../lib/locale.js";
|
|
10
|
+
import { highlightParts } from "../lib/text.js";
|
|
11
|
+
import { useTree } from "../lib/use-tree.js";
|
|
12
|
+
import { Spinner } from "./spinner.js";
|
|
13
|
+
export { useTree } from "../lib/use-tree.js";
|
|
14
|
+
const treeViewLabels = {
|
|
15
|
+
loading: "Loading…",
|
|
16
|
+
loadError: "Couldn't load",
|
|
17
|
+
retry: "Retry",
|
|
18
|
+
empty: "Nothing here yet",
|
|
19
|
+
noMatches: "No matches for “{query}”",
|
|
20
|
+
results: "{count, plural, =0 {No matches} one {# match} other {# matches}}",
|
|
21
|
+
};
|
|
22
|
+
export const treeRowVariants = cva([
|
|
23
|
+
"group/tree-row relative flex w-full min-w-0 cursor-default select-none items-center gap-1.5 rounded-ui-sm pe-1.5 text-start outline-none",
|
|
24
|
+
"transition-colors duration-100",
|
|
25
|
+
"hover:bg-hover focus-visible:bg-hover focus-visible:shadow-[inset_0_0_0_2px_var(--ring)]",
|
|
26
|
+
"aria-selected:bg-selected aria-selected:text-fg aria-selected:font-medium",
|
|
27
|
+
"aria-disabled:pointer-events-none aria-disabled:opacity-45",
|
|
28
|
+
], {
|
|
29
|
+
variants: {
|
|
30
|
+
size: {
|
|
31
|
+
sm: "h-[calc(var(--control-h)*0.7)] text-[13px]",
|
|
32
|
+
md: "h-[calc(var(--control-h)*0.8)] text-sm",
|
|
33
|
+
},
|
|
34
|
+
variant: {
|
|
35
|
+
default: "text-fg",
|
|
36
|
+
/** Navigation-like tree (docs, file explorer pane): accent ink on the current row. */
|
|
37
|
+
sidebar: "text-fg-muted hover:text-fg aria-selected:bg-accent-soft aria-selected:text-accent-ink",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: { size: "md", variant: "default" },
|
|
41
|
+
});
|
|
42
|
+
/* ------------------------------------------------------------------ */
|
|
43
|
+
/* Row parts */
|
|
44
|
+
/* ------------------------------------------------------------------ */
|
|
45
|
+
/** Check box drawn for a treeitem (state lives on the row's `aria-checked`). */
|
|
46
|
+
export function TreeCheckboxMark({ checked, className }) {
|
|
47
|
+
return (_jsx("span", { "aria-hidden": true, "data-slot": "tree-checkbox", "data-state": checked === "mixed" ? "indeterminate" : checked ? "checked" : "unchecked", className: cn("inline-flex size-4 shrink-0 items-center justify-center rounded-[5px] border border-field-border-hover bg-field text-accent-fg transition-colors duration-150", "data-[state=checked]:border-transparent data-[state=checked]:bg-accent data-[state=indeterminate]:border-transparent data-[state=indeterminate]:bg-accent", "group-hover/tree-row:border-fg-subtle", className), children: checked === "mixed" ? (_jsx("svg", { viewBox: "0 0 14 14", fill: "none", className: "size-3", focusable: "false", children: _jsx("path", { d: "M3.5 7h7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })) : checked ? (_jsx("svg", { viewBox: "0 0 14 14", fill: "none", className: "size-3", focusable: "false", children: _jsx("path", { d: "M3 7.4 5.8 10 11 4.2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })) : null }));
|
|
48
|
+
}
|
|
49
|
+
/** Label with matched parts in bold (weight, not colour — readable on glass). */
|
|
50
|
+
export function TreeLabelText({ text, query, locale }) {
|
|
51
|
+
if (!query?.trim())
|
|
52
|
+
return _jsx(_Fragment, { children: text });
|
|
53
|
+
return (_jsx(_Fragment, { children: highlightParts(text, query, locale).map((p, i) => p.match ? (_jsx("mark", { className: "rounded-[3px] bg-accent-soft px-px font-semibold text-fg", children: p.text }, i)) : (_jsx(React.Fragment, { children: p.text }, i))) }));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* One treeitem: indent guides, chevron (spinner while children load, retry on error), check mark,
|
|
57
|
+
* icon, label, badge and hover actions. Used by Tree view and Tree select; render it inside an
|
|
58
|
+
* element carrying `tree.getTreeProps()`.
|
|
59
|
+
*/
|
|
60
|
+
export const TreeViewRow = React.forwardRef(function TreeViewRow({ item, tree, indent = 16, guides = true, size = "md", variant = "default", checkbox, query, label, actions, labels, onRowClick, className, style, onClick, onDoubleClick, ...props }, ref) {
|
|
61
|
+
const t = useLabels("treeView", treeViewLabels, labels);
|
|
62
|
+
const { locale } = useLocale();
|
|
63
|
+
const { node } = item;
|
|
64
|
+
const base = size === "sm" ? 4 : 6;
|
|
65
|
+
const pad = base + (item.level - 1) * indent;
|
|
66
|
+
return (_jsxs("div", { ref: ref, ...tree.getItemProps(item), "data-slot": "tree-row", "data-level": item.level, "data-match": item.match || undefined, className: cn(treeRowVariants({ size, variant }), className), style: { paddingInlineStart: pad, ...style }, onClick: (e) => {
|
|
67
|
+
onClick?.(e);
|
|
68
|
+
if (e.defaultPrevented || item.disabled)
|
|
69
|
+
return;
|
|
70
|
+
const el = e.currentTarget;
|
|
71
|
+
if (document.activeElement !== el)
|
|
72
|
+
el.focus({ preventScroll: true });
|
|
73
|
+
onRowClick?.(item, e);
|
|
74
|
+
}, onDoubleClick: onDoubleClick, ...props, children: [guides && item.level > 1
|
|
75
|
+
? item.guides.map((on, i) => on || i === item.level - 2 ? (_jsx("span", { "aria-hidden": true, "data-slot": "tree-guide", className: cn("pointer-events-none absolute w-px bg-line", i === item.level - 2 && !on && item.last ? "top-0 h-1/2" : "inset-y-0"), style: { insetInlineStart: base + i * indent + 8 } }, i)) : null)
|
|
76
|
+
: null, _jsx("span", { "aria-hidden": true, "data-slot": "tree-toggle", className: cn("relative z-[1] -ms-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-[5px] text-fg-subtle transition-[transform,color,background-color] duration-150", item.hasChildren && "hover:bg-hover hover:text-fg"), onClick: (e) => {
|
|
77
|
+
if (!item.hasChildren || item.disabled)
|
|
78
|
+
return;
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
tree.toggleExpanded(item.id);
|
|
81
|
+
e.currentTarget.closest("[data-tree-id]")?.focus({ preventScroll: true });
|
|
82
|
+
}, children: item.loading ? (_jsx(Spinner, { size: "xs", tone: "muted" })) : item.error ? (_jsx(TriangleAlert, { className: "size-3.5 text-warning" })) : item.hasChildren ? (_jsx(ChevronRight, { className: cn("size-3.5 transition-transform duration-150 rtl:-scale-x-100 motion-reduce:transition-none", item.expanded && "rotate-90 rtl:rotate-90"), strokeWidth: 2.25 })) : null }), checkbox ? _jsx(TreeCheckboxMark, { checked: item.checked }) : null, node.icon ? _jsx("span", { className: "inline-flex shrink-0 text-fg-muted [&_svg]:size-4", "aria-hidden": true, children: node.icon }) : null, _jsxs("span", { className: "min-w-0 flex-1 truncate", "data-slot": "tree-label", children: [label ?? _jsx(TreeLabelText, { text: node.label, query: query, locale: locale }), node.description ? _jsx("span", { className: "ms-2 text-xs font-normal text-fg-subtle", children: node.description }) : null] }), item.loading ? _jsx("span", { className: "sr-only", children: t("loading") }) : null, item.error ? (_jsxs("span", { className: "flex shrink-0 items-center gap-1.5 text-xs text-fg-muted", children: [_jsx("span", { children: t("loadError") }), _jsxs("button", { type: "button", tabIndex: -1, className: "inline-flex items-center gap-1 rounded-ui-sm px-1.5 py-0.5 font-medium text-fg hover:bg-hover focus-ring", onClick: (e) => {
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
tree.reload(item.id);
|
|
85
|
+
}, children: [_jsx(RotateCw, { "aria-hidden": true, className: "size-3" }), " ", t("retry")] })] })) : null, node.badge != null ? _jsx("span", { className: "shrink-0 text-xs tabular text-fg-subtle", children: node.badge }) : null, actions ? (_jsx("span", { "data-slot": "tree-actions", className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover/tree-row:opacity-100 group-focus-visible/tree-row:opacity-100 focus-within:opacity-100 [&_button]:size-6", onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), children: actions })) : null] }));
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* Display and navigate hierarchies — CMS page tree, category tree, media folders, department
|
|
89
|
+
* tree, file explorer panes. A flat WAI-ARIA tree (level / set size / position on every row) with
|
|
90
|
+
* single, multiple or tri-state checkbox selection, lazy children, filter with ancestors kept and
|
|
91
|
+
* optional virtualisation for 10k+ nodes.
|
|
92
|
+
*
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <TreeView aria-label="Pages" data={pages} defaultExpanded={["company"]} onAction={(n) => open(n.id)} />
|
|
95
|
+
* <TreeView aria-label="Categories" data={categories} selectionMode="checkbox" checkValueMode="leaf" />
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export const TreeView = React.forwardRef(function TreeView({ data, expanded, defaultExpanded, onExpandedChange, selectionMode = "single", selected, defaultSelected, onSelectedChange, cascade, checkValueMode, isSelectable, loadChildren, filter, onAction, renderActions, renderLabel, virtual = false, height, indent = 16, guides = true, variant = "default", size = "md", emptyState, labels, className, style, ...props }, ref) {
|
|
99
|
+
const t = useLabels("treeView", treeViewLabels, labels);
|
|
100
|
+
const { locale, dir } = useLocale();
|
|
101
|
+
const checkbox = selectionMode === "checkbox";
|
|
102
|
+
const scrollRef = React.useRef(null);
|
|
103
|
+
const virtualizerRef = React.useRef(null);
|
|
104
|
+
const tree = useTree({
|
|
105
|
+
nodes: data,
|
|
106
|
+
expanded,
|
|
107
|
+
defaultExpanded,
|
|
108
|
+
onExpandedChange,
|
|
109
|
+
loadChildren,
|
|
110
|
+
filter,
|
|
111
|
+
locale,
|
|
112
|
+
dir,
|
|
113
|
+
selectionMode: checkbox ? "none" : selectionMode,
|
|
114
|
+
selected: checkbox ? undefined : selected,
|
|
115
|
+
defaultSelected: checkbox ? undefined : defaultSelected,
|
|
116
|
+
onSelectedChange: checkbox ? undefined : onSelectedChange,
|
|
117
|
+
isSelectable,
|
|
118
|
+
checkable: checkbox,
|
|
119
|
+
checked: checkbox ? selected : undefined,
|
|
120
|
+
defaultChecked: checkbox ? defaultSelected : undefined,
|
|
121
|
+
onCheckedChange: checkbox ? onSelectedChange : undefined,
|
|
122
|
+
cascade,
|
|
123
|
+
checkValueMode,
|
|
124
|
+
onAction,
|
|
125
|
+
scrollToIndex: (i) => virtualizerRef.current?.scrollToIndex(i, { align: "auto" }),
|
|
126
|
+
});
|
|
127
|
+
const rowPx = size === "sm" ? 28 : 32;
|
|
128
|
+
const virtualizer = useVirtualizer({
|
|
129
|
+
count: virtual ? tree.items.length : 0,
|
|
130
|
+
getScrollElement: () => scrollRef.current,
|
|
131
|
+
estimateSize: () => rowPx,
|
|
132
|
+
overscan: 12,
|
|
133
|
+
getItemKey: (i) => tree.items[i]?.id ?? i,
|
|
134
|
+
});
|
|
135
|
+
virtualizerRef.current = virtual ? virtualizer : null;
|
|
136
|
+
const onRowClick = (item) => {
|
|
137
|
+
if (checkbox)
|
|
138
|
+
tree.toggleChecked(item.id);
|
|
139
|
+
else if (selectionMode !== "none" && (!isSelectable || isSelectable(item.node, item.hasChildren)))
|
|
140
|
+
tree.select(item.id);
|
|
141
|
+
else if (item.hasChildren)
|
|
142
|
+
tree.toggleExpanded(item.id);
|
|
143
|
+
};
|
|
144
|
+
const renderRow = (item, extra) => (_jsx(TreeViewRow, { ref: extra?.measure, "data-index": extra?.index, item: item, tree: tree, indent: indent, guides: guides, size: size, variant: variant, checkbox: checkbox, query: filter, label: renderLabel?.(item), actions: renderActions?.(item.node), labels: labels, style: extra?.style, onRowClick: onRowClick, onDoubleClick: () => !item.disabled && onAction?.(item.node) }, item.id));
|
|
145
|
+
const treeProps = tree.getTreeProps();
|
|
146
|
+
const setRefs = (el) => {
|
|
147
|
+
treeProps.ref(el);
|
|
148
|
+
if (typeof ref === "function")
|
|
149
|
+
ref(el);
|
|
150
|
+
else if (ref)
|
|
151
|
+
ref.current = el;
|
|
152
|
+
if (!virtual)
|
|
153
|
+
scrollRef.current = el;
|
|
154
|
+
};
|
|
155
|
+
if (data.length === 0) {
|
|
156
|
+
return (_jsx("div", { "data-slot": "tree-view-empty", className: cn("px-3 py-6 text-center text-sm text-fg-muted", className), style: style, children: emptyState ?? t("empty") }));
|
|
157
|
+
}
|
|
158
|
+
const noMatches = tree.filtering && tree.items.length === 0;
|
|
159
|
+
const scrollHeight = height ?? (virtual ? 360 : undefined);
|
|
160
|
+
return (_jsxs("div", { "data-slot": "tree-view", className: cn("relative", className), style: style, children: [tree.filtering ? (_jsx("span", { className: "sr-only", role: "status", "aria-live": "polite", children: t("results", { count: tree.matchCount }) })) : null, noMatches ? (_jsx("p", { className: "px-3 py-6 text-center text-sm text-fg-muted", children: t("noMatches", { query: filter ?? "" }) })) : virtual ? (_jsx("div", { ref: scrollRef, className: "overflow-auto overscroll-contain", style: { height: scrollHeight }, children: _jsx("div", { ...treeProps, ref: setRefs, "aria-label": props["aria-label"], ...props, className: "relative w-full outline-none", style: { height: virtualizer.getTotalSize() }, children: virtualizer.getVirtualItems().map((v) => {
|
|
161
|
+
const item = tree.items[v.index];
|
|
162
|
+
if (!item)
|
|
163
|
+
return null;
|
|
164
|
+
return renderRow(item, {
|
|
165
|
+
index: v.index,
|
|
166
|
+
measure: virtualizer.measureElement,
|
|
167
|
+
style: { position: "absolute", top: 0, insetInlineStart: 0, transform: `translateY(${v.start}px)` },
|
|
168
|
+
});
|
|
169
|
+
}) }) })) : (_jsx("div", { ...treeProps, ref: setRefs, ...props, className: cn("grid gap-px outline-none", scrollHeight !== undefined && "overflow-auto overscroll-contain"), style: scrollHeight !== undefined ? { maxHeight: scrollHeight } : undefined, children: tree.items.map((item) => renderRow(item)) }))] }));
|
|
170
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
export declare const headingVariants: (props?: ({
|
|
4
|
+
size?: "display" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
|
+
type HeadingSize = NonNullable<VariantProps<typeof headingVariants>["size"]>;
|
|
8
|
+
export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
9
|
+
/** Semantic level (`<h1>`…`<h6>`). Default 2. Never skip levels for looks — change `size`. */
|
|
10
|
+
level?: HeadingLevel;
|
|
11
|
+
/** Visual size, independent of the level. Default: from the level (1 → xl, 2 → lg, 3 → md, 4+ → sm). */
|
|
12
|
+
size?: HeadingSize;
|
|
13
|
+
/** Render the styles on the child (e.g. a `<Link>` or a `<legend>`). */
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A heading whose look (`size`) is decoupled from its level, so the outline never skips a
|
|
18
|
+
* level for visual reasons. `display` and `xl` use the preset's heading face; `<em>` inside
|
|
19
|
+
* follows the preset (italic in serif presets, plain in sans).
|
|
20
|
+
*
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Heading level={1} size="display">Dinner, <em>slowly</em>.</Heading>
|
|
23
|
+
* <Heading level={2} size="md">Billing details</Heading>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
27
|
+
export declare const textVariants: (props?: ({
|
|
28
|
+
size?: "sm" | "md" | "lg" | "xs" | null | undefined;
|
|
29
|
+
tone?: "accent" | "warning" | "danger" | "default" | "inherit" | "success" | "muted" | "subtle" | null | undefined;
|
|
30
|
+
weight?: "medium" | "regular" | "semibold" | null | undefined;
|
|
31
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
32
|
+
export interface TextProps extends Omit<React.HTMLAttributes<HTMLElement>, "color">, VariantProps<typeof textVariants> {
|
|
33
|
+
/** Element to render. Default `"p"`. */
|
|
34
|
+
as?: "p" | "span" | "div" | "label" | "small" | "strong" | "figcaption";
|
|
35
|
+
/** `true`: one line with an ellipsis. A number: clamp to that many lines. The full text goes into `title`. */
|
|
36
|
+
truncate?: boolean | number;
|
|
37
|
+
/** Tabular figures (prices, counts in columns). */
|
|
38
|
+
tabular?: boolean;
|
|
39
|
+
/** Render the styles on the child element. */
|
|
40
|
+
asChild?: boolean;
|
|
41
|
+
/** For `as="label"`. */
|
|
42
|
+
htmlFor?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Body text: 12 / 13 / 14 / 16 px, seven tones, three weights, single-line truncation or
|
|
46
|
+
* multi-line clamp. Paragraphs wrap with `text-wrap: pretty`.
|
|
47
|
+
*
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <Text tone="muted" size="sm">Last edited 3 minutes ago by Elif.</Text>
|
|
50
|
+
* <Text truncate={2}>{post.excerpt}</Text>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
|
|
54
|
+
/** The opening paragraph under a page or article title. */
|
|
55
|
+
export declare const Lead: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
56
|
+
/** Inline code: `slug`, `npm run build`, a field key. */
|
|
57
|
+
export declare const Code: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
58
|
+
export interface BlockquoteProps extends React.BlockquoteHTMLAttributes<HTMLQuoteElement> {
|
|
59
|
+
/** Who said it — rendered under the quote. */
|
|
60
|
+
cite?: string;
|
|
61
|
+
attribution?: React.ReactNode;
|
|
62
|
+
}
|
|
63
|
+
/** A pulled quote or testimonial, set in the heading face. */
|
|
64
|
+
export declare const Blockquote: React.ForwardRefExoticComponent<BlockquoteProps & React.RefAttributes<HTMLQuoteElement>>;
|
|
65
|
+
export interface NumericProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
66
|
+
/** Monospaced (code font) instead of the UI font with tabular figures. Default `false`. */
|
|
67
|
+
mono?: boolean;
|
|
68
|
+
/** Colour by sign: negative → danger, positive → success. Pass the raw number. */
|
|
69
|
+
signOf?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Numbers that line up: tabular figures, no wrapping. Format the value first (`useFormat()` or
|
|
73
|
+
* `createFormatter` from `@vamos-ui/react/format`), then render it here.
|
|
74
|
+
*
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <Numeric>{f.currency("1250.50")}</Numeric>
|
|
77
|
+
* <Numeric signOf={-4.2}>−4.2%</Numeric>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare const Numeric: React.ForwardRefExoticComponent<NumericProps & React.RefAttributes<HTMLSpanElement>>;
|
|
81
|
+
export interface ProseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
82
|
+
/** Base size: 14 / 16 / 18 px. Default `"md"`. */
|
|
83
|
+
size?: "sm" | "md" | "lg";
|
|
84
|
+
/** Raw HTML from your editor or CMS. **Sanitize it on the server first.** */
|
|
85
|
+
html?: string;
|
|
86
|
+
/** Remove the reading-width cap (default `--measure`, 64ch). */
|
|
87
|
+
fullWidth?: boolean;
|
|
88
|
+
asChild?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Styles rich content you don't control element by element: an article body from the editor,
|
|
92
|
+
* a CMS page, release notes. Headings, lists, quotes, code, tables and media follow the
|
|
93
|
+
* `data-font` preset and tokens. Put long prose on a `surface` (not straight on the glass scene).
|
|
94
|
+
*
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <Prose html={post.bodyHtml} />
|
|
97
|
+
* <Prose size="lg" lang="en"><h2>Opening hours</h2><p>…</p></Prose>
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare const Prose: React.ForwardRefExoticComponent<ProseProps & React.RefAttributes<HTMLDivElement>>;
|
|
101
|
+
export interface ProseTableProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
102
|
+
/** Names the scroll region for screen readers ("Opening hours"). */
|
|
103
|
+
label: string;
|
|
104
|
+
}
|
|
105
|
+
/** Wraps a wide table inside Prose in a keyboard-scrollable region. */
|
|
106
|
+
export declare const ProseTable: React.ForwardRefExoticComponent<ProseTableProps & React.RefAttributes<HTMLDivElement>>;
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
/*
|
|
7
|
+
* Typography — server-compatible. Headings read the data-font axis: --font-heading,
|
|
8
|
+
* --display-weight / --display-tracking / --display-em, and scale with --display-scale.
|
|
9
|
+
*/
|
|
10
|
+
export const headingVariants = cva("text-balance text-fg [overflow-wrap:break-word]", {
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
/** 56px × display-scale (fluid down to 38px on phones). Hero / page title on websites. */
|
|
14
|
+
display: "font-display [font-weight:var(--display-weight)] [letter-spacing:var(--display-tracking)] [&_em]:[font-style:var(--display-em)] text-[length:calc(clamp(38px,4.2vw+20px,56px)*var(--display-scale))] leading-[1.02]",
|
|
15
|
+
/** 44px × display-scale. Admin page title. */
|
|
16
|
+
xl: "font-display [font-weight:var(--display-weight)] [letter-spacing:var(--display-tracking)] [&_em]:[font-style:var(--display-em)] text-[length:calc(clamp(32px,2.6vw+22px,44px)*var(--display-scale))] leading-[1.05]",
|
|
17
|
+
/** 32px × display-scale. Section title. */
|
|
18
|
+
lg: "font-sans font-semibold tracking-[-0.022em] text-[length:calc(32px*var(--display-scale))] leading-[1.12]",
|
|
19
|
+
/** 22px. Card / panel title. */
|
|
20
|
+
md: "font-sans font-semibold tracking-[-0.016em] text-[22px] leading-[1.25]",
|
|
21
|
+
/** 17px. Group heading inside a panel. */
|
|
22
|
+
sm: "font-sans font-semibold tracking-[-0.01em] text-[17px] leading-[1.35]",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: { size: "md" },
|
|
26
|
+
});
|
|
27
|
+
const defaultSize = { 1: "xl", 2: "lg", 3: "md", 4: "sm", 5: "sm", 6: "sm" };
|
|
28
|
+
/**
|
|
29
|
+
* A heading whose look (`size`) is decoupled from its level, so the outline never skips a
|
|
30
|
+
* level for visual reasons. `display` and `xl` use the preset's heading face; `<em>` inside
|
|
31
|
+
* follows the preset (italic in serif presets, plain in sans).
|
|
32
|
+
*
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Heading level={1} size="display">Dinner, <em>slowly</em>.</Heading>
|
|
35
|
+
* <Heading level={2} size="md">Billing details</Heading>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export const Heading = React.forwardRef(function Heading({ level = 2, size, asChild, className, ...props }, ref) {
|
|
39
|
+
const Comp = (asChild ? Slot.Root : `h${level}`);
|
|
40
|
+
return _jsx(Comp, { ref: ref, "data-slot": "heading", "data-size": size ?? defaultSize[level], className: cn(headingVariants({ size: size ?? defaultSize[level] }), className), ...props });
|
|
41
|
+
});
|
|
42
|
+
/* ------------------------------------------------------------------ */
|
|
43
|
+
/* Text */
|
|
44
|
+
/* ------------------------------------------------------------------ */
|
|
45
|
+
export const textVariants = cva("", {
|
|
46
|
+
variants: {
|
|
47
|
+
size: {
|
|
48
|
+
xs: "text-xs leading-[1.45]",
|
|
49
|
+
sm: "text-[13px] leading-[1.5]",
|
|
50
|
+
md: "text-sm leading-[1.55]",
|
|
51
|
+
lg: "text-base leading-[1.6]",
|
|
52
|
+
},
|
|
53
|
+
tone: {
|
|
54
|
+
default: "text-fg",
|
|
55
|
+
muted: "text-fg-muted",
|
|
56
|
+
subtle: "text-fg-subtle",
|
|
57
|
+
accent: "text-accent-ink",
|
|
58
|
+
danger: "text-danger",
|
|
59
|
+
success: "text-success",
|
|
60
|
+
warning: "text-warning",
|
|
61
|
+
/** Keep the parent colour. */
|
|
62
|
+
inherit: "",
|
|
63
|
+
},
|
|
64
|
+
weight: {
|
|
65
|
+
regular: "font-normal",
|
|
66
|
+
medium: "font-medium",
|
|
67
|
+
semibold: "font-semibold",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: { size: "md", tone: "default" },
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Body text: 12 / 13 / 14 / 16 px, seven tones, three weights, single-line truncation or
|
|
74
|
+
* multi-line clamp. Paragraphs wrap with `text-wrap: pretty`.
|
|
75
|
+
*
|
|
76
|
+
* ```tsx
|
|
77
|
+
* <Text tone="muted" size="sm">Last edited 3 minutes ago by Elif.</Text>
|
|
78
|
+
* <Text truncate={2}>{post.excerpt}</Text>
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export const Text = React.forwardRef(function Text({ as = "p", size, tone, weight, truncate, tabular, asChild, className, style, title, children, ...props }, ref) {
|
|
82
|
+
const Comp = (asChild ? Slot.Root : as);
|
|
83
|
+
const lines = typeof truncate === "number" && truncate > 1 ? truncate : undefined;
|
|
84
|
+
const autoTitle = truncate && title === undefined && (typeof children === "string" || typeof children === "number") ? String(children) : title;
|
|
85
|
+
return (_jsx(Comp, { ref: ref, "data-slot": "text", title: autoTitle, className: cn(textVariants({ size, tone, weight }), as === "p" && !truncate && "text-pretty", (truncate === true || truncate === 1) && "truncate", lines && "overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]", tabular && "tabular", className), style: lines ? { ...style, WebkitLineClamp: lines } : style, ...props, children: children }));
|
|
86
|
+
});
|
|
87
|
+
/** The opening paragraph under a page or article title. */
|
|
88
|
+
export const Lead = React.forwardRef(function Lead({ className, ...props }, ref) {
|
|
89
|
+
return _jsx("p", { ref: ref, "data-slot": "lead", className: cn("text-pretty text-[length:var(--text-lead)] leading-[1.5] text-fg-muted", className), ...props });
|
|
90
|
+
});
|
|
91
|
+
/** Inline code: `slug`, `npm run build`, a field key. */
|
|
92
|
+
export const Code = React.forwardRef(function Code({ className, ...props }, ref) {
|
|
93
|
+
return (_jsx("code", { ref: ref, "data-slot": "code", className: cn("rounded-[5px] border border-line bg-selected px-[0.36em] py-[0.08em] font-mono text-[0.86em] text-fg [overflow-wrap:anywhere]", className), ...props }));
|
|
94
|
+
});
|
|
95
|
+
/** A pulled quote or testimonial, set in the heading face. */
|
|
96
|
+
export const Blockquote = React.forwardRef(function Blockquote({ attribution, className, children, ...props }, ref) {
|
|
97
|
+
return (_jsxs("figure", { "data-slot": "blockquote", className: cn("grid gap-2.5 border-s-2 border-accent-ink ps-5", className), children: [_jsx("blockquote", { ref: ref, className: "font-display text-[length:calc(22px*var(--display-scale))] leading-[1.4] text-fg [&_em]:[font-style:var(--display-em)]", ...props, children: children }), attribution ? _jsx("figcaption", { className: "text-[13px] text-fg-subtle", children: attribution }) : null] }));
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* Numbers that line up: tabular figures, no wrapping. Format the value first (`useFormat()` or
|
|
101
|
+
* `createFormatter` from `@vamos-ui/react/format`), then render it here.
|
|
102
|
+
*
|
|
103
|
+
* ```tsx
|
|
104
|
+
* <Numeric>{f.currency("1250.50")}</Numeric>
|
|
105
|
+
* <Numeric signOf={-4.2}>−4.2%</Numeric>
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export const Numeric = React.forwardRef(function Numeric({ mono, signOf, className, ...props }, ref) {
|
|
109
|
+
return (_jsx("span", { ref: ref, "data-slot": "numeric", className: cn("tabular whitespace-nowrap", mono && "font-mono text-[0.94em]", signOf !== undefined && (signOf < 0 ? "text-danger" : signOf > 0 ? "text-success" : "text-fg-muted"), className), ...props }));
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* Styles rich content you don't control element by element: an article body from the editor,
|
|
113
|
+
* a CMS page, release notes. Headings, lists, quotes, code, tables and media follow the
|
|
114
|
+
* `data-font` preset and tokens. Put long prose on a `surface` (not straight on the glass scene).
|
|
115
|
+
*
|
|
116
|
+
* ```tsx
|
|
117
|
+
* <Prose html={post.bodyHtml} />
|
|
118
|
+
* <Prose size="lg" lang="en"><h2>Opening hours</h2><p>…</p></Prose>
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export const Prose = React.forwardRef(function Prose({ size = "md", html, fullWidth, asChild, className, children, ...props }, ref) {
|
|
122
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
123
|
+
return (_jsx(Comp, { ref: ref, "data-slot": "prose", className: cn("prose-ui", size === "sm" && "prose-ui-sm", size === "lg" && "prose-ui-lg", fullWidth && "max-w-none", className), ...(html !== undefined ? { dangerouslySetInnerHTML: { __html: html } } : { children }), ...props }));
|
|
124
|
+
});
|
|
125
|
+
/** Wraps a wide table inside Prose in a keyboard-scrollable region. */
|
|
126
|
+
export const ProseTable = React.forwardRef(function ProseTable({ label, className, ...props }, ref) {
|
|
127
|
+
return _jsx("div", { ref: ref, role: "region", "aria-label": label, tabIndex: 0, "data-slot": "prose-table", className: cn(className), ...props });
|
|
128
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type AvatarStatus } from "./avatar.js";
|
|
3
|
+
import { type RecordPickerMultipleProps, type RecordPickerSingleProps, type RecordSource } from "./record-picker.js";
|
|
4
|
+
/** A person you can assign, mention or share with. */
|
|
5
|
+
export interface PickerUser {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
avatarUrl?: string | null;
|
|
10
|
+
status?: AvatarStatus;
|
|
11
|
+
/** Deactivated / left the company: dimmed, not selectable, still shown when already assigned. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Role or department ("Account executive · Sales"). */
|
|
14
|
+
meta?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A team or group; picking it adds its members (or the team itself). */
|
|
17
|
+
export interface PickerTeam {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
memberCount: number;
|
|
21
|
+
}
|
|
22
|
+
declare const userPickerLabels: {
|
|
23
|
+
unassigned: string;
|
|
24
|
+
assignToMe: string;
|
|
25
|
+
you: string;
|
|
26
|
+
teams: string;
|
|
27
|
+
people: string;
|
|
28
|
+
members: string;
|
|
29
|
+
assignees: string;
|
|
30
|
+
assigneesLabel: string;
|
|
31
|
+
andMore: string;
|
|
32
|
+
deactivated: string;
|
|
33
|
+
add: string;
|
|
34
|
+
search: string;
|
|
35
|
+
};
|
|
36
|
+
export type UserPickerLabels = typeof userPickerLabels;
|
|
37
|
+
interface UserPickerBaseProps {
|
|
38
|
+
/** People: an array (searched in memory, locale-folded) or a server `RecordSource`. */
|
|
39
|
+
source: RecordSource<PickerUser> | PickerUser[];
|
|
40
|
+
/** Teams shown in their own group. */
|
|
41
|
+
teams?: RecordSource<PickerTeam> | PickerTeam[];
|
|
42
|
+
/** Resolve a picked team to people. Without it the team's id (`"team:<id>"`) is selected. */
|
|
43
|
+
getTeamMembers?: (team: PickerTeam, signal: AbortSignal) => Promise<PickerUser[]>;
|
|
44
|
+
/** Adds "Assign to me" and the "(you)" suffix. */
|
|
45
|
+
currentUserId?: string;
|
|
46
|
+
/** Field box (default), an avatar stack button (table cells, headers) or an always-open list. */
|
|
47
|
+
trigger?: "field" | "avatars" | "inline";
|
|
48
|
+
/** Avatars shown in the avatar trigger before "+N". Default 3. */
|
|
49
|
+
maxAvatars?: number;
|
|
50
|
+
/** Name of the role being assigned, for the trigger's accessible name ("Reviewers: …"). Default "Assignees". */
|
|
51
|
+
roleLabel?: string;
|
|
52
|
+
size?: "sm" | "md" | "lg";
|
|
53
|
+
placeholder?: string;
|
|
54
|
+
name?: string;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
readOnly?: boolean;
|
|
57
|
+
invalid?: boolean;
|
|
58
|
+
required?: boolean;
|
|
59
|
+
/** Records for the initial value when `source` is a server source. */
|
|
60
|
+
selectedRecords?: PickerUser[];
|
|
61
|
+
open?: boolean;
|
|
62
|
+
defaultOpen?: boolean;
|
|
63
|
+
onOpenChange?: (open: boolean) => void;
|
|
64
|
+
labels?: Partial<UserPickerLabels>;
|
|
65
|
+
id?: string;
|
|
66
|
+
className?: string;
|
|
67
|
+
"aria-label"?: string;
|
|
68
|
+
"aria-labelledby"?: string;
|
|
69
|
+
"aria-describedby"?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface UserPickerSingleProps extends UserPickerBaseProps, Pick<RecordPickerSingleProps<PickerUser>, "value" | "defaultValue" | "onValueChange"> {
|
|
72
|
+
multiple?: false;
|
|
73
|
+
}
|
|
74
|
+
export interface UserPickerMultipleProps extends UserPickerBaseProps, Pick<RecordPickerMultipleProps<PickerUser>, "value" | "defaultValue" | "onValueChange" | "max"> {
|
|
75
|
+
multiple: true;
|
|
76
|
+
}
|
|
77
|
+
export type UserPickerProps = UserPickerSingleProps | UserPickerMultipleProps;
|
|
78
|
+
/**
|
|
79
|
+
* Assign or mention people and teams: task assignee, approvers, deal owner, reviewers, shift staff,
|
|
80
|
+
* share-with. A Record picker specialised for people — avatars with presence, role line,
|
|
81
|
+
* "Assign to me", deactivated users, teams, and an avatar-stack trigger for table cells.
|
|
82
|
+
*
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <Field label="Owner"><UserPicker source={people} currentUserId={me.id} value={ownerId} onValueChange={setOwnerId} /></Field>
|
|
85
|
+
* <UserPicker multiple trigger="avatars" source={people} value={assignees} onValueChange={setAssignees} aria-label="Assignees" />
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare const UserPicker: React.ForwardRefExoticComponent<UserPickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
89
|
+
export {};
|