@vamos-ui/react 0.0.0-stage → 0.2.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 +100 -0
- package/dist/blocks/site/_kit-1.js +135 -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 +112 -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 +51 -0
- package/dist/blocks/site/feature-grid.d.ts +46 -0
- package/dist/blocks/site/feature-grid.js +49 -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 +47 -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 +67 -0
- package/dist/blocks/site/logo-strip.d.ts +42 -0
- package/dist/blocks/site/logo-strip.js +26 -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 +55 -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 +82 -0
- package/dist/blocks/site/process.d.ts +36 -0
- package/dist/blocks/site/process.js +41 -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 +97 -0
- package/dist/blocks/site/site-shell.js +227 -0
- package/dist/blocks/site/stats-band.d.ts +40 -0
- package/dist/blocks/site/stats-band.js +41 -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 +65 -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 +11 -0
- package/dist/business/index.js +20 -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/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 +42 -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/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/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 +275 -0
- package/dist/components/command.js +493 -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/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/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/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/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 +86 -0
- package/dist/index.js +87 -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 +22 -0
- package/dist/lib/public.js +33 -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 +138 -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/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 +101 -0
- package/dist/sortable/sortable-tree.js +450 -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/navigation.css +293 -0
- package/dist/styles/overlays.css +244 -0
- package/dist/styles.css +742 -0
- package/package.json +156 -4
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
3
|
+
import { type ButtonProps } from "./button.js";
|
|
4
|
+
import { type LayerHeaderProps } from "./dialog.js";
|
|
5
|
+
type Tone = "default" | "danger";
|
|
6
|
+
/**
|
|
7
|
+
* Confirms an irreversible or high-stakes action. `role="alertdialog"`; the overlay never closes it.
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <AlertDialog>
|
|
11
|
+
* <AlertDialogTrigger asChild><Button variant="danger-ghost">Delete post</Button></AlertDialogTrigger>
|
|
12
|
+
* <AlertDialogContent tone="danger">
|
|
13
|
+
* <AlertDialogHeader title="Delete this post permanently?" description="It can't be restored from the trash." />
|
|
14
|
+
* <AlertDialogFooter>
|
|
15
|
+
* <AlertDialogCancel />
|
|
16
|
+
* <AlertDialogAction onClick={remove}>Delete post</AlertDialogAction>
|
|
17
|
+
* </AlertDialogFooter>
|
|
18
|
+
* </AlertDialogContent>
|
|
19
|
+
* </AlertDialog>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* For a one-line `await confirm({...})` use `useConfirm()` under a `ConfirmProvider`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
25
|
+
export declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
export interface AlertDialogContentProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> {
|
|
27
|
+
/** `"danger"` → warning icon, danger action, initial focus on Cancel. `"default"` focuses the action. */
|
|
28
|
+
tone?: Tone;
|
|
29
|
+
/** Lock Esc (e.g. while the action runs). */
|
|
30
|
+
dismissible?: boolean;
|
|
31
|
+
/** Portal target. Defaults to the nearest `PortalContainer` / `ThemeScope`. */
|
|
32
|
+
container?: HTMLElement | null;
|
|
33
|
+
}
|
|
34
|
+
/** Fixed 420px panel. Below 640px it anchors to the bottom and stacks the buttons, action on top. */
|
|
35
|
+
export declare const AlertDialogContent: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
/** Icon well in the danger tone. */
|
|
37
|
+
export declare function AlertDialogIcon({ className, children }: {
|
|
38
|
+
className?: string;
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
}): React.JSX.Element;
|
|
41
|
+
export interface AlertDialogHeaderProps extends LayerHeaderProps {
|
|
42
|
+
}
|
|
43
|
+
/** `LayerHeader` that adds the warning icon well when the content is `tone="danger"` (pass `icon={null}` to drop it). */
|
|
44
|
+
export declare const AlertDialogHeader: React.ForwardRefExoticComponent<AlertDialogHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export declare const AlertDialogBody: React.ForwardRefExoticComponent<import("./dialog.js").LayerBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
/** Footer without the hairline; buttons at the end, stacked on mobile. */
|
|
47
|
+
export declare const AlertDialogFooter: React.ForwardRefExoticComponent<Omit<import("./dialog.js").LayerFooterProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
48
|
+
declare const confirmLabels: {
|
|
49
|
+
cancel: string;
|
|
50
|
+
confirm: string;
|
|
51
|
+
typeToConfirm: string;
|
|
52
|
+
error: string;
|
|
53
|
+
};
|
|
54
|
+
export interface AlertDialogCancelProps extends ButtonProps {
|
|
55
|
+
labels?: Partial<typeof confirmLabels>;
|
|
56
|
+
}
|
|
57
|
+
/** Closes without acting. Receives initial focus in a danger dialog. Default label "Cancel". */
|
|
58
|
+
export declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
|
59
|
+
export interface AlertDialogActionProps extends ButtonProps {
|
|
60
|
+
/** Keep the dialog open after click (you close it when async work finishes). */
|
|
61
|
+
keepOpen?: boolean;
|
|
62
|
+
labels?: Partial<typeof confirmLabels>;
|
|
63
|
+
}
|
|
64
|
+
/** Runs the action and closes. `variant` follows the content tone (`danger` or `primary`). */
|
|
65
|
+
export declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
export interface ConfirmOptions {
|
|
67
|
+
title: React.ReactNode;
|
|
68
|
+
description?: React.ReactNode;
|
|
69
|
+
tone?: Tone;
|
|
70
|
+
confirmLabel?: string;
|
|
71
|
+
cancelLabel?: string;
|
|
72
|
+
/** Text the user must type before confirming (e.g. the record name). Compared case-insensitively for the current locale. */
|
|
73
|
+
requireText?: string;
|
|
74
|
+
/** Async work: the button shows loading; if it throws, the dialog stays open and shows the error. */
|
|
75
|
+
onConfirm?: () => Promise<void> | void;
|
|
76
|
+
}
|
|
77
|
+
export interface ConfirmDialogProps extends ConfirmOptions {
|
|
78
|
+
open: boolean;
|
|
79
|
+
/** Called once with the outcome; the dialog closes itself. */
|
|
80
|
+
onResult: (confirmed: boolean) => void;
|
|
81
|
+
labels?: Partial<typeof confirmLabels>;
|
|
82
|
+
}
|
|
83
|
+
/** A ready-made confirmation (controlled). `useConfirm()` renders one of these for you. */
|
|
84
|
+
export declare function ConfirmDialog({ open, onResult, title, description, tone, confirmLabel, cancelLabel, requireText, onConfirm, labels }: ConfirmDialogProps): React.JSX.Element;
|
|
85
|
+
type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
86
|
+
/**
|
|
87
|
+
* Provides `useConfirm()` to its subtree and renders the one shared confirmation dialog.
|
|
88
|
+
* App shell includes it; mount it yourself at the app root otherwise.
|
|
89
|
+
*/
|
|
90
|
+
export declare function ConfirmProvider({ children, labels }: {
|
|
91
|
+
children: React.ReactNode;
|
|
92
|
+
labels?: Partial<typeof confirmLabels>;
|
|
93
|
+
}): React.JSX.Element;
|
|
94
|
+
/**
|
|
95
|
+
* Imperative confirmation: `if (await confirm({ title: "Delete 3 posts?", tone: "danger" })) …`.
|
|
96
|
+
* Resolves `true` on confirm, `false` on cancel / Esc. Needs a `ConfirmProvider` above.
|
|
97
|
+
*/
|
|
98
|
+
export declare function useConfirm(): ConfirmFn;
|
|
99
|
+
export {};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
5
|
+
import { TriangleAlert } from "lucide-react";
|
|
6
|
+
import { cn } from "../lib/cn.js";
|
|
7
|
+
import { useLabels } from "../lib/labels.js";
|
|
8
|
+
import { useLocale } from "../lib/locale.js";
|
|
9
|
+
import { Layer, useLayerDepth } from "../lib/layer.js";
|
|
10
|
+
import { usePortalContainer } from "../lib/theme-scope.js";
|
|
11
|
+
import { Button } from "./button.js";
|
|
12
|
+
import { Field, Input } from "./input.js";
|
|
13
|
+
import { Alert } from "./alert.js";
|
|
14
|
+
import { LayerBody, LayerFooter, LayerHeader, LayerPartsProvider } from "./dialog.js";
|
|
15
|
+
const AlertDialogContentContext = React.createContext({ tone: "default", actionRef: { current: null } });
|
|
16
|
+
/**
|
|
17
|
+
* Confirms an irreversible or high-stakes action. `role="alertdialog"`; the overlay never closes it.
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <AlertDialog>
|
|
21
|
+
* <AlertDialogTrigger asChild><Button variant="danger-ghost">Delete post</Button></AlertDialogTrigger>
|
|
22
|
+
* <AlertDialogContent tone="danger">
|
|
23
|
+
* <AlertDialogHeader title="Delete this post permanently?" description="It can't be restored from the trash." />
|
|
24
|
+
* <AlertDialogFooter>
|
|
25
|
+
* <AlertDialogCancel />
|
|
26
|
+
* <AlertDialogAction onClick={remove}>Delete post</AlertDialogAction>
|
|
27
|
+
* </AlertDialogFooter>
|
|
28
|
+
* </AlertDialogContent>
|
|
29
|
+
* </AlertDialog>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* For a one-line `await confirm({...})` use `useConfirm()` under a `ConfirmProvider`.
|
|
33
|
+
*/
|
|
34
|
+
export const AlertDialog = AlertDialogPrimitive.Root;
|
|
35
|
+
export const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
36
|
+
/** Fixed 420px panel. Below 640px it anchors to the bottom and stacks the buttons, action on top. */
|
|
37
|
+
export const AlertDialogContent = React.forwardRef(function AlertDialogContent({ tone = "default", dismissible = true, container, className, children, onEscapeKeyDown, onOpenAutoFocus, onCloseAutoFocus, ...props }, ref) {
|
|
38
|
+
const scope = usePortalContainer();
|
|
39
|
+
const depth = useLayerDepth() + 1;
|
|
40
|
+
const actionRef = React.useRef(null);
|
|
41
|
+
const returnTo = React.useRef(null);
|
|
42
|
+
const [descriptions, setDescriptions] = React.useState(0);
|
|
43
|
+
const parts = React.useMemo(() => ({
|
|
44
|
+
Title: AlertDialogPrimitive.Title,
|
|
45
|
+
Description: AlertDialogPrimitive.Description,
|
|
46
|
+
registerDescription: () => {
|
|
47
|
+
setDescriptions((n) => n + 1);
|
|
48
|
+
return () => setDescriptions((n) => n - 1);
|
|
49
|
+
},
|
|
50
|
+
}), []);
|
|
51
|
+
const ctx = React.useMemo(() => ({ tone, actionRef }), [tone]);
|
|
52
|
+
const described = descriptions > 0 || "aria-describedby" in props;
|
|
53
|
+
return (_jsxs(AlertDialogPrimitive.Portal, { container: container ?? scope, children: [_jsx(AlertDialogPrimitive.Overlay, { "data-slot": "alert-dialog-overlay", "data-overlay-blurred": depth === 1 ? "" : undefined, className: "vui-overlay ui-fade" }), _jsx(Layer, { asChild: true, children: _jsx(AlertDialogPrimitive.Content, { ref: ref, "data-slot": "alert-dialog-content", "data-mobile": "sheet", "data-tone": tone, ...(described ? {} : { "aria-describedby": undefined }), className: cn("vui-layer-panel vui-dialog ui-dialog surface-popover [--dialog-w:26.25rem]", className), onEscapeKeyDown: (e) => {
|
|
54
|
+
onEscapeKeyDown?.(e);
|
|
55
|
+
if (!dismissible)
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
}, onOpenAutoFocus: (e) => {
|
|
58
|
+
// Fires before focus moves in: remember the opener. Radix returns focus only to an
|
|
59
|
+
// AlertDialog.Trigger, so a controlled confirm (useConfirm, ConfirmDialog) lost focus.
|
|
60
|
+
returnTo.current = document.activeElement;
|
|
61
|
+
onOpenAutoFocus?.(e);
|
|
62
|
+
if (e.defaultPrevented)
|
|
63
|
+
return;
|
|
64
|
+
// Radix focuses Cancel. For a non-destructive confirm the action is the safe default.
|
|
65
|
+
if (tone === "default" && actionRef.current) {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
actionRef.current.focus();
|
|
68
|
+
}
|
|
69
|
+
}, onCloseAutoFocus: (e) => {
|
|
70
|
+
onCloseAutoFocus?.(e);
|
|
71
|
+
if (e.defaultPrevented)
|
|
72
|
+
return;
|
|
73
|
+
const el = returnTo.current;
|
|
74
|
+
if (el && el.isConnected && el !== document.body) {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
el.focus();
|
|
77
|
+
}
|
|
78
|
+
}, ...props, children: _jsx(AlertDialogContentContext.Provider, { value: ctx, children: _jsx(LayerPartsProvider, { value: parts, children: children }) }) }) })] }));
|
|
79
|
+
});
|
|
80
|
+
/** Icon well in the danger tone. */
|
|
81
|
+
export function AlertDialogIcon({ className, children }) {
|
|
82
|
+
return (_jsx("span", { "aria-hidden": true, className: cn("flex size-10 items-center justify-center rounded-ui tone-danger bg-[color-mix(in_srgb,var(--danger)_12%,transparent)] text-danger [&_svg]:size-5", className), children: children ?? _jsx(TriangleAlert, {}) }));
|
|
83
|
+
}
|
|
84
|
+
/** `LayerHeader` that adds the warning icon well when the content is `tone="danger"` (pass `icon={null}` to drop it). */
|
|
85
|
+
export const AlertDialogHeader = React.forwardRef(function AlertDialogHeader({ icon, className, ...props }, ref) {
|
|
86
|
+
const { tone } = React.useContext(AlertDialogContentContext);
|
|
87
|
+
const resolvedIcon = icon === undefined ? (tone === "danger" ? _jsx(AlertDialogIcon, {}) : undefined) : icon;
|
|
88
|
+
return _jsx(LayerHeader, { ref: ref, icon: resolvedIcon, className: cn("pt-6", className), ...props });
|
|
89
|
+
});
|
|
90
|
+
export const AlertDialogBody = LayerBody;
|
|
91
|
+
/** Footer without the hairline; buttons at the end, stacked on mobile. */
|
|
92
|
+
export const AlertDialogFooter = React.forwardRef(function AlertDialogFooter({ className, ...props }, ref) {
|
|
93
|
+
return _jsx(LayerFooter, { ref: ref, className: cn("border-t-0 pt-1 pb-5", className), ...props });
|
|
94
|
+
});
|
|
95
|
+
const confirmLabels = { cancel: "Cancel", confirm: "Confirm", typeToConfirm: "Type {text} to confirm", error: "That didn't work. Try again." };
|
|
96
|
+
/** Closes without acting. Receives initial focus in a danger dialog. Default label "Cancel". */
|
|
97
|
+
export const AlertDialogCancel = React.forwardRef(function AlertDialogCancel({ children, labels, variant = "secondary", ...props }, ref) {
|
|
98
|
+
const t = useLabels("confirm", confirmLabels, labels);
|
|
99
|
+
return (_jsx(AlertDialogPrimitive.Cancel, { asChild: true, children: _jsx(Button, { ref: ref, variant: variant, ...props, children: children ?? t("cancel") }) }));
|
|
100
|
+
});
|
|
101
|
+
/** Runs the action and closes. `variant` follows the content tone (`danger` or `primary`). */
|
|
102
|
+
export const AlertDialogAction = React.forwardRef(function AlertDialogAction({ children, labels, variant, keepOpen, onClick, ...props }, ref) {
|
|
103
|
+
const { tone, actionRef } = React.useContext(AlertDialogContentContext);
|
|
104
|
+
const t = useLabels("confirm", confirmLabels, labels);
|
|
105
|
+
const setRefs = React.useCallback((node) => {
|
|
106
|
+
actionRef.current = node;
|
|
107
|
+
if (typeof ref === "function")
|
|
108
|
+
ref(node);
|
|
109
|
+
else if (ref)
|
|
110
|
+
ref.current = node;
|
|
111
|
+
}, [ref, actionRef]);
|
|
112
|
+
const button = (_jsx(Button, { ref: setRefs, variant: variant ?? (tone === "danger" ? "danger" : "primary"), onClick: onClick, "data-slot": "alert-dialog-action", ...props, children: children ?? t("confirm") }));
|
|
113
|
+
return keepOpen ? button : _jsx(AlertDialogPrimitive.Action, { asChild: true, children: button });
|
|
114
|
+
});
|
|
115
|
+
const SPLIT = "\u2063";
|
|
116
|
+
/** A ready-made confirmation (controlled). `useConfirm()` renders one of these for you. */
|
|
117
|
+
export function ConfirmDialog({ open, onResult, title, description, tone = "default", confirmLabel, cancelLabel, requireText, onConfirm, labels }) {
|
|
118
|
+
const t = useLabels("confirm", confirmLabels, labels);
|
|
119
|
+
const { locale } = useLocale();
|
|
120
|
+
const [typed, setTyped] = React.useState("");
|
|
121
|
+
const [busy, setBusy] = React.useState(false);
|
|
122
|
+
const [error, setError] = React.useState(null);
|
|
123
|
+
const inputId = React.useId();
|
|
124
|
+
React.useEffect(() => {
|
|
125
|
+
if (open) {
|
|
126
|
+
setTyped("");
|
|
127
|
+
setError(null);
|
|
128
|
+
setBusy(false);
|
|
129
|
+
}
|
|
130
|
+
}, [open]);
|
|
131
|
+
// Split the translated prompt around {text} so the required text can be styled as code.
|
|
132
|
+
const promptParts = t("typeToConfirm", { text: SPLIT }).split(SPLIT);
|
|
133
|
+
const matches = !requireText || typed.trim().toLocaleLowerCase(locale) === requireText.trim().toLocaleLowerCase(locale);
|
|
134
|
+
const run = async () => {
|
|
135
|
+
if (!matches || busy)
|
|
136
|
+
return;
|
|
137
|
+
if (!onConfirm)
|
|
138
|
+
return onResult(true);
|
|
139
|
+
setBusy(true);
|
|
140
|
+
setError(null);
|
|
141
|
+
try {
|
|
142
|
+
await onConfirm();
|
|
143
|
+
setBusy(false);
|
|
144
|
+
onResult(true);
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
setBusy(false);
|
|
148
|
+
setError(e instanceof Error && e.message ? e.message : t("error"));
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
return (_jsx(AlertDialog, { open: open, onOpenChange: (next) => !next && !busy && onResult(false), children: _jsxs(AlertDialogContent, { tone: tone, dismissible: !busy, children: [_jsx(AlertDialogHeader, { title: title, description: description }), requireText || error ? (_jsxs(AlertDialogBody, { className: "grid gap-3 pb-3", children: [error ? (_jsx(Alert, { tone: "danger", size: "sm", live: "assertive", children: error })) : null, requireText ? (_jsx(Field, { id: inputId, label: _jsxs(_Fragment, { children: [promptParts[0], _jsx("code", { className: "rounded-ui-sm bg-selected px-1.5 py-0.5 font-mono text-[12.5px] text-fg", children: requireText }), promptParts[1]] }), children: _jsx(Input, { value: typed, onChange: (e) => setTyped(e.target.value), autoComplete: "off", autoCapitalize: "off", spellCheck: false, disabled: busy, onKeyDown: (e) => {
|
|
152
|
+
if (e.key === "Enter") {
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
void run();
|
|
155
|
+
}
|
|
156
|
+
} }) })) : null] })) : null, _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: busy, children: cancelLabel ?? t("cancel") }), _jsx(AlertDialogAction, { keepOpen: true, disabled: !matches, loading: busy, onClick: () => void run(), children: confirmLabel ?? t("confirm") })] })] }) }));
|
|
157
|
+
}
|
|
158
|
+
const ConfirmContext = React.createContext(null);
|
|
159
|
+
/**
|
|
160
|
+
* Provides `useConfirm()` to its subtree and renders the one shared confirmation dialog.
|
|
161
|
+
* App shell includes it; mount it yourself at the app root otherwise.
|
|
162
|
+
*/
|
|
163
|
+
export function ConfirmProvider({ children, labels }) {
|
|
164
|
+
const [state, setState] = React.useState(null);
|
|
165
|
+
const [open, setOpen] = React.useState(false);
|
|
166
|
+
const stateRef = React.useRef(state);
|
|
167
|
+
stateRef.current = state;
|
|
168
|
+
const confirm = React.useCallback((options) => {
|
|
169
|
+
// A second confirm while one is open resolves the first as cancelled.
|
|
170
|
+
stateRef.current?.resolve(false);
|
|
171
|
+
return new Promise((resolve) => {
|
|
172
|
+
setState({ options, resolve });
|
|
173
|
+
setOpen(true);
|
|
174
|
+
});
|
|
175
|
+
}, []);
|
|
176
|
+
const onResult = React.useCallback((ok) => {
|
|
177
|
+
stateRef.current?.resolve(ok);
|
|
178
|
+
stateRef.current = null;
|
|
179
|
+
setOpen(false);
|
|
180
|
+
}, []);
|
|
181
|
+
return (_jsxs(ConfirmContext.Provider, { value: confirm, children: [children, state ? _jsx(ConfirmDialog, { ...state.options, open: open, onResult: onResult, labels: labels }) : null] }));
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Imperative confirmation: `if (await confirm({ title: "Delete 3 posts?", tone: "danger" })) …`.
|
|
185
|
+
* Resolves `true` on confirm, `false` on cancel / Esc. Needs a `ConfirmProvider` above.
|
|
186
|
+
*/
|
|
187
|
+
export function useConfirm() {
|
|
188
|
+
const ctx = React.useContext(ConfirmContext);
|
|
189
|
+
if (!ctx)
|
|
190
|
+
throw new Error("useConfirm() needs a <ConfirmProvider> above it (AppShell includes one).");
|
|
191
|
+
return ctx;
|
|
192
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
export type AlertTone = "neutral" | "info" | "success" | "warning" | "danger" | "accent";
|
|
4
|
+
export declare const alertVariants: (props?: ({
|
|
5
|
+
tone?: "accent" | "info" | "warning" | "danger" | "neutral" | "success" | null | undefined;
|
|
6
|
+
variant?: "outline" | "banner" | "soft" | null | undefined;
|
|
7
|
+
size?: "sm" | "md" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof alertVariants> {
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/** Custom icon, or `false` for none. Each tone has a default. */
|
|
12
|
+
icon?: React.ReactNode | false;
|
|
13
|
+
/** Buttons or links ("Restore revision", "Renew plan"). Below the text; inline at the end for banners. */
|
|
14
|
+
actions?: React.ReactNode;
|
|
15
|
+
/** Renders a close button. */
|
|
16
|
+
onDismiss?: () => void;
|
|
17
|
+
/** Accessible name of the close button. Default "Dismiss" (dictionary `alert.dismiss`). */
|
|
18
|
+
dismissLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* For alerts inserted at runtime: `"assertive"` → `role="alert"` (errors), `"polite"` →
|
|
21
|
+
* `role="status"`. Leave unset for static messages (no role).
|
|
22
|
+
*/
|
|
23
|
+
live?: "polite" | "assertive";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A persistent inline status message in a page, card or form. Server-compatible.
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Alert tone="warning" title="Payroll filing due in 3 days" actions={<Button size="sm">Review</Button>}>
|
|
30
|
+
* Submit the November declaration before Dec 26 to avoid a late fee.
|
|
31
|
+
* </Alert>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Critical information must not live only in a toast — show it here too.
|
|
35
|
+
*/
|
|
36
|
+
export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
/** Title line, in the tone colour (mixed toward --fg so it keeps 4.5:1 on tinted / glass scenes). */
|
|
38
|
+
export declare function AlertTitle({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): React.JSX.Element;
|
|
39
|
+
/** Body text — stays in `--fg` for contrast. */
|
|
40
|
+
export declare function AlertDescription({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
41
|
+
/** Action row under the text. */
|
|
42
|
+
export declare function AlertActions({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { CircleAlert, CircleCheck, Info, Lightbulb, TriangleAlert, X } from "lucide-react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { useLabels } from "../lib/labels.js";
|
|
7
|
+
import { IconButton } from "./button.js";
|
|
8
|
+
export const alertVariants = cva([
|
|
9
|
+
"vui-alert relative grid grid-cols-[auto_minmax(0,1fr)_auto] items-start text-fg",
|
|
10
|
+
// Tinted surface + hairline in the tone colour; body text stays --fg for contrast.
|
|
11
|
+
"[--alert-tone:var(--tone)]",
|
|
12
|
+
], {
|
|
13
|
+
variants: {
|
|
14
|
+
tone: {
|
|
15
|
+
neutral: "tone-neutral",
|
|
16
|
+
info: "tone-info",
|
|
17
|
+
success: "tone-success",
|
|
18
|
+
warning: "tone-warning",
|
|
19
|
+
danger: "tone-danger",
|
|
20
|
+
accent: "tone-accent",
|
|
21
|
+
},
|
|
22
|
+
variant: {
|
|
23
|
+
soft: "rounded-ui border border-[color-mix(in_srgb,var(--alert-tone)_22%,transparent)] bg-[color-mix(in_srgb,var(--alert-tone)_9%,transparent)]",
|
|
24
|
+
outline: "rounded-ui border border-[color-mix(in_srgb,var(--alert-tone)_38%,transparent)] bg-transparent",
|
|
25
|
+
/** Full width, no radius — under the top bar or above a page. */
|
|
26
|
+
banner: "w-full rounded-none border-b border-[color-mix(in_srgb,var(--alert-tone)_24%,transparent)] bg-[color-mix(in_srgb,var(--alert-tone)_11%,transparent)]",
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
sm: "gap-x-2.5 px-3 py-2.5 text-[13px] [&_[data-slot=alert-icon]_svg]:size-4",
|
|
30
|
+
md: "gap-x-3 px-4 py-3.5 text-sm [&_[data-slot=alert-icon]_svg]:size-[18px]",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
compoundVariants: [
|
|
34
|
+
{ variant: "banner", size: "md", class: "px-5 py-2.5" },
|
|
35
|
+
{ variant: "banner", size: "sm", class: "px-4 py-2" },
|
|
36
|
+
],
|
|
37
|
+
defaultVariants: { tone: "neutral", variant: "soft", size: "md" },
|
|
38
|
+
});
|
|
39
|
+
const defaultIcons = {
|
|
40
|
+
neutral: Info,
|
|
41
|
+
info: Info,
|
|
42
|
+
success: CircleCheck,
|
|
43
|
+
warning: TriangleAlert,
|
|
44
|
+
danger: CircleAlert,
|
|
45
|
+
accent: Lightbulb,
|
|
46
|
+
};
|
|
47
|
+
const alertLabels = { dismiss: "Dismiss" };
|
|
48
|
+
/**
|
|
49
|
+
* A persistent inline status message in a page, card or form. Server-compatible.
|
|
50
|
+
*
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <Alert tone="warning" title="Payroll filing due in 3 days" actions={<Button size="sm">Review</Button>}>
|
|
53
|
+
* Submit the November declaration before Dec 26 to avoid a late fee.
|
|
54
|
+
* </Alert>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* Critical information must not live only in a toast — show it here too.
|
|
58
|
+
*/
|
|
59
|
+
export const Alert = React.forwardRef(function Alert({ tone, variant, size, title, icon, actions, onDismiss, dismissLabel, live, className, children, ...props }, ref) {
|
|
60
|
+
const t = tone ?? "neutral";
|
|
61
|
+
const DefaultIcon = defaultIcons[t];
|
|
62
|
+
const iconNode = icon === false ? null : (icon ?? _jsx(DefaultIcon, { "aria-hidden": true }));
|
|
63
|
+
const banner = variant === "banner";
|
|
64
|
+
return (_jsxs("div", { ref: ref, "data-slot": "alert", "data-tone": t, "data-variant": variant ?? "soft", role: live === "assertive" ? "alert" : live === "polite" ? "status" : undefined, className: cn(alertVariants({ tone, variant, size }), !iconNode && "grid-cols-[minmax(0,1fr)_auto]", className), ...props, children: [iconNode ? (_jsx("span", { "data-slot": "alert-icon", className: "flex h-[1.4em] items-center text-(--alert-tone) [&_svg]:shrink-0", children: iconNode })) : null, _jsxs("div", { className: cn("min-w-0", banner && actions && "flex flex-wrap items-center gap-x-4 gap-y-2"), children: [_jsxs("div", { className: cn("min-w-0", banner && "flex-1"), children: [title ? _jsx(AlertTitle, { children: title }) : null, children ? _jsx(AlertDescription, { className: title ? "mt-0.5" : undefined, children: children }) : null] }), actions ? _jsx(AlertActions, { className: banner ? "mt-0" : undefined, children: actions }) : null] }), onDismiss ? _jsx(AlertDismiss, { onDismiss: onDismiss, label: dismissLabel }) : _jsx("span", { "aria-hidden": true })] }));
|
|
65
|
+
});
|
|
66
|
+
// Only rendered when `onDismiss` exists, i.e. inside a client tree.
|
|
67
|
+
function AlertDismiss({ onDismiss, label }) {
|
|
68
|
+
const t = useLabels("alert", alertLabels);
|
|
69
|
+
return (_jsx(IconButton, { label: label ?? t("dismiss"), size: "xs", variant: "ghost", onClick: onDismiss, className: "-me-1.5 -mt-0.5 text-fg-muted hover:text-fg", children: _jsx(X, {}) }));
|
|
70
|
+
}
|
|
71
|
+
/** Title line, in the tone colour (mixed toward --fg so it keeps 4.5:1 on tinted / glass scenes). */
|
|
72
|
+
export function AlertTitle({ className, ...props }) {
|
|
73
|
+
return _jsx("p", { "data-slot": "alert-title", className: cn("leading-[1.4] font-semibold text-[color-mix(in_srgb,var(--alert-tone)_62%,var(--fg))] [[data-tone=neutral]_&]:text-fg", className), ...props });
|
|
74
|
+
}
|
|
75
|
+
/** Body text — stays in `--fg` for contrast. */
|
|
76
|
+
export function AlertDescription({ className, ...props }) {
|
|
77
|
+
return _jsx("div", { "data-slot": "alert-description", className: cn("leading-[1.4] text-pretty text-fg [&_a]:font-medium [&_a]:underline [&_a]:underline-offset-2", className), ...props });
|
|
78
|
+
}
|
|
79
|
+
/** Action row under the text. */
|
|
80
|
+
export function AlertActions({ className, ...props }) {
|
|
81
|
+
return _jsx("div", { "data-slot": "alert-actions", className: cn("mt-3 flex flex-wrap items-center gap-2", className), ...props });
|
|
82
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VamosLinkComponent, type VamosProviderProps } from "../lib/provider.js";
|
|
3
|
+
import type { MenuEntry } from "../lib/variants.js";
|
|
4
|
+
import { type BadgeSpec, type NavIcon, type NavNode } from "../lib/nav.js";
|
|
5
|
+
import { type CommandAction, type CommandSource } from "./command.js";
|
|
6
|
+
import { type UserMenuProps } from "./top-bar.js";
|
|
7
|
+
declare const appShellLabels: {
|
|
8
|
+
skip: string;
|
|
9
|
+
navigation: string;
|
|
10
|
+
appMenu: string;
|
|
11
|
+
workspace: string;
|
|
12
|
+
goTo: string;
|
|
13
|
+
apps: string;
|
|
14
|
+
switchTo: string;
|
|
15
|
+
newItem: string;
|
|
16
|
+
noApps: string;
|
|
17
|
+
noAppsDescription: string;
|
|
18
|
+
pageChanged: string;
|
|
19
|
+
};
|
|
20
|
+
export type AppShellLabels = typeof appShellLabels;
|
|
21
|
+
export interface AppLink {
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
href: string;
|
|
25
|
+
icon?: NavIcon;
|
|
26
|
+
external?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** One app (CMS, CRM, HR, PRM…) on the shared shell. Define these in a client module (they hold components). */
|
|
29
|
+
export interface AppDefinition {
|
|
30
|
+
/** `"site"` | `"crm"` | `"people"`… */
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
icon?: React.ComponentType<{
|
|
35
|
+
className?: string;
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
}> | React.ReactNode;
|
|
38
|
+
/** App home. An absolute URL (separately deployed app) triggers a full navigation. */
|
|
39
|
+
href: string;
|
|
40
|
+
/** Path prefix that belongs to the app. Default: `href`. */
|
|
41
|
+
base?: string;
|
|
42
|
+
/** `data-accent` override for the whole shell while this app is active (e.g. CRM = `"ocean"`). */
|
|
43
|
+
accent?: string;
|
|
44
|
+
nav: NavNode[];
|
|
45
|
+
/** Commands for ⌘K while this app is active. */
|
|
46
|
+
commands?: CommandAction[];
|
|
47
|
+
/** Record search sources (stay registered when another app is active). */
|
|
48
|
+
sources?: CommandSource[];
|
|
49
|
+
/** Contents of the top bar's "New ▾" button. */
|
|
50
|
+
newMenu?: MenuEntry[];
|
|
51
|
+
/** Top-bar links that only make sense in this app ("View site" in the Site app). */
|
|
52
|
+
links?: AppLink[];
|
|
53
|
+
/** Hide the app entirely unless `can(permission)`. */
|
|
54
|
+
permission?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface AppShellProviderProps extends Partial<Omit<VamosProviderProps, "children" | "Link">> {
|
|
57
|
+
apps: AppDefinition[];
|
|
58
|
+
/** Default: the app whose `base` / `href` is the longest prefix of `currentPath`, else the last one used. */
|
|
59
|
+
activeApp?: string;
|
|
60
|
+
/** A menu shared by every app (users, settings), shown at the bottom of the sidebar. */
|
|
61
|
+
sharedNav?: NavNode[];
|
|
62
|
+
/** Commands available in every app. */
|
|
63
|
+
commands?: CommandAction[];
|
|
64
|
+
/** Feature flags / module toggles for nav items with `feature`. */
|
|
65
|
+
features?: Record<string, boolean | undefined>;
|
|
66
|
+
/** Rail preference — read the `ui-sidebar` cookie on the server (`parseSidebarCookie`) to avoid a flash. `undefined` = no preference. */
|
|
67
|
+
defaultCollapsed?: boolean;
|
|
68
|
+
/** Default: writes the `ui-sidebar` cookie. */
|
|
69
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
70
|
+
workspaces?: {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
logo?: string;
|
|
74
|
+
}[];
|
|
75
|
+
activeWorkspace?: string;
|
|
76
|
+
onWorkspaceChange?: (id: string) => void;
|
|
77
|
+
/** Global shortcuts: `mod+k` (palette) and `mod+\\` (rail). Default `true`; turn off for shells embedded in a page. */
|
|
78
|
+
shortcuts?: boolean;
|
|
79
|
+
/** Router link (Next `Link`). Also accepted as `Link`. Omit when a `VamosProvider` above already sets it. */
|
|
80
|
+
linkComponent?: VamosLinkComponent;
|
|
81
|
+
Link?: VamosLinkComponent;
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The app bridge for the shell: apps, shared nav, permissions, collapse preference, the ⌘K
|
|
86
|
+
* registry (with "Go to" commands derived from every accessible app's nav) and app switching.
|
|
87
|
+
* Router pieces come from the surrounding `VamosProvider`, or pass them here.
|
|
88
|
+
*/
|
|
89
|
+
export declare function AppShellProvider(props: AppShellProviderProps): React.JSX.Element;
|
|
90
|
+
/**
|
|
91
|
+
* The shell state: active app, nav, rail, mobile nav, app switching. Throws outside `AppShellProvider`.
|
|
92
|
+
*/
|
|
93
|
+
export declare function useAppShell(): {
|
|
94
|
+
activeApp: AppDefinition | undefined;
|
|
95
|
+
apps: AppDefinition[];
|
|
96
|
+
nav: NavNode[];
|
|
97
|
+
sharedNav: NavNode[];
|
|
98
|
+
collapsed: boolean;
|
|
99
|
+
setCollapsed: (v: boolean) => void;
|
|
100
|
+
openMobileNav: () => void;
|
|
101
|
+
closeMobileNav: () => void;
|
|
102
|
+
mobileNavOpen: boolean;
|
|
103
|
+
trail: string[];
|
|
104
|
+
can: (permission: string) => boolean;
|
|
105
|
+
switchApp: (id: string) => void;
|
|
106
|
+
};
|
|
107
|
+
/** `true` inside an `AppShellProvider`. */
|
|
108
|
+
export declare function useInAppShell(): boolean;
|
|
109
|
+
/** Breadcrumb built from the shell's active trail (used by `PageHeader breadcrumb="auto"`). */
|
|
110
|
+
export declare function AppShellBreadcrumb({ includeApp, className }: {
|
|
111
|
+
includeApp?: boolean;
|
|
112
|
+
className?: string;
|
|
113
|
+
}): React.JSX.Element | null;
|
|
114
|
+
export interface AppShellProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "dir"> {
|
|
115
|
+
/** Replace the default sidebar (AppSwitcher + SidebarNav + shared nav + collapse). `false` = none. */
|
|
116
|
+
sidebar?: React.ReactNode | false;
|
|
117
|
+
/** Replace the default top bar. `false` = none. */
|
|
118
|
+
topbar?: React.ReactNode | false;
|
|
119
|
+
/** Slot above the top bar (offline, trial, maintenance banner). */
|
|
120
|
+
banner?: React.ReactNode;
|
|
121
|
+
/** Notification center in the default top bar (`<NotificationCenter adapter={…} />`). */
|
|
122
|
+
notifications?: React.ReactNode;
|
|
123
|
+
/** Extra default top-bar actions (theme switch, help). */
|
|
124
|
+
actions?: React.ReactNode;
|
|
125
|
+
/** User menu in the default top bar. */
|
|
126
|
+
user?: UserMenuProps;
|
|
127
|
+
/** Live sidebar badges by nav item id. */
|
|
128
|
+
badges?: Record<string, BadgeSpec | undefined>;
|
|
129
|
+
/** Extra sidebar footer content (above the collapse button). */
|
|
130
|
+
sidebarFooter?: React.ReactNode;
|
|
131
|
+
/** Footer link in the app switcher ("Manage apps & modules…"). */
|
|
132
|
+
appSwitcherFooter?: React.ReactNode;
|
|
133
|
+
/** `sidebar` (default) or `topnav` (portal-style: top-level links in the top bar, no sidebar). */
|
|
134
|
+
layout?: "sidebar" | "topnav";
|
|
135
|
+
/** Permissions still loading: sidebar skeleton. */
|
|
136
|
+
loading?: boolean;
|
|
137
|
+
/** Move focus to `main` and announce the page title after route changes. Default `true`. */
|
|
138
|
+
announceRouteChanges?: boolean;
|
|
139
|
+
/** `screen` fills the viewport (default); `fill` fills the parent (embedded previews). */
|
|
140
|
+
height?: "screen" | "fill";
|
|
141
|
+
/** Mount the ⌘K palette, Toaster and confirm dialog. Default `true`. */
|
|
142
|
+
globals?: boolean;
|
|
143
|
+
labels?: Partial<AppShellLabels>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The one shell every app runs in: sidebar, top bar, content, skip link, mobile sheet nav, ⌘K
|
|
147
|
+
* palette, toasts and confirm. Switching apps swaps the nav, commands, "New" menu, links and
|
|
148
|
+
* accent; everything else stays. Use inside `AppShellProvider`.
|
|
149
|
+
*
|
|
150
|
+
* ```tsx
|
|
151
|
+
* <AppShellProvider apps={[siteApp, crmApp]} sharedNav={shared} currentPath={pathname} linkComponent={Link} navigate={router.push}>
|
|
152
|
+
* <AppShell user={{ name: "Ada Lovelace", email: "ada@northwind.io", items: account }} notifications={<NotificationCenter adapter={inbox} />}>
|
|
153
|
+
* {children}
|
|
154
|
+
* </AppShell>
|
|
155
|
+
* </AppShellProvider>
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
export declare const AppShell: React.ForwardRefExoticComponent<AppShellProps & React.RefAttributes<HTMLDivElement>>;
|
|
159
|
+
export {};
|