@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,100 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type BlockLabels } from "../labels.js";
|
|
3
|
+
import type { BlockAdapters, ImageData } from "../types.js";
|
|
4
|
+
import type { CtaStyle } from "../schema/types.js";
|
|
5
|
+
export declare const site1Labels: {
|
|
6
|
+
announcement: string;
|
|
7
|
+
notice: string;
|
|
8
|
+
dismiss: string;
|
|
9
|
+
mainNavigation: string;
|
|
10
|
+
openMenu: string;
|
|
11
|
+
closeMenu: string;
|
|
12
|
+
menuDialog: string;
|
|
13
|
+
languages: string;
|
|
14
|
+
callUs: string;
|
|
15
|
+
phoneLabel: string;
|
|
16
|
+
breadcrumb: string;
|
|
17
|
+
playVideo: string;
|
|
18
|
+
pauseVideo: string;
|
|
19
|
+
resumeVideo: string;
|
|
20
|
+
video: string;
|
|
21
|
+
openCalendar: string;
|
|
22
|
+
loadsCalendar: string;
|
|
23
|
+
faqMore: string;
|
|
24
|
+
stepLabel: string;
|
|
25
|
+
emailLabel: string;
|
|
26
|
+
emailPlaceholder: string;
|
|
27
|
+
subscribe: string;
|
|
28
|
+
subscribed: string;
|
|
29
|
+
subscribeError: string;
|
|
30
|
+
date: string;
|
|
31
|
+
time: string;
|
|
32
|
+
guests: string;
|
|
33
|
+
service: string;
|
|
34
|
+
guestsCount: string;
|
|
35
|
+
askAvailability: string;
|
|
36
|
+
opensWhatsApp: string;
|
|
37
|
+
closedOn: string;
|
|
38
|
+
bookingMessage: string;
|
|
39
|
+
bookingMessageService: string;
|
|
40
|
+
bookingFallback: string;
|
|
41
|
+
percent: string;
|
|
42
|
+
logos: string;
|
|
43
|
+
source: string;
|
|
44
|
+
};
|
|
45
|
+
export type Site1Labels = typeof site1Labels;
|
|
46
|
+
export declare const site1LabelsTr: Site1Labels;
|
|
47
|
+
export type SiteBlockLabels = Partial<BlockLabels & Site1Labels>;
|
|
48
|
+
/** Label lookup for registry-1 blocks: `labels` prop → English. */
|
|
49
|
+
export declare function siteText(labels: SiteBlockLabels | undefined, locale?: string): (key: keyof (BlockLabels & Site1Labels), vars?: Record<string, unknown>) => string;
|
|
50
|
+
/** The raw template of a label (for islands that format it later with their own values). */
|
|
51
|
+
export declare function siteTemplate(labels: SiteBlockLabels | undefined, key: keyof Site1Labels): string;
|
|
52
|
+
/** A call to action: `{ link: { href, label }, style }` — the `f.cta()` shape. */
|
|
53
|
+
export interface SiteCta {
|
|
54
|
+
link: {
|
|
55
|
+
href: string;
|
|
56
|
+
label: React.ReactNode;
|
|
57
|
+
newTab?: boolean;
|
|
58
|
+
kind?: string;
|
|
59
|
+
};
|
|
60
|
+
style?: CtaStyle;
|
|
61
|
+
}
|
|
62
|
+
/** A short label/value fact ("Founded" · "2014"). */
|
|
63
|
+
export interface SiteMeta {
|
|
64
|
+
label: React.ReactNode;
|
|
65
|
+
value: React.ReactNode;
|
|
66
|
+
}
|
|
67
|
+
/** An image with intrinsic size; `alt` required unless decorative. */
|
|
68
|
+
export type SiteImage = ImageData;
|
|
69
|
+
/** Stable ids for a block: `base` (anchor-safe) and the heading id. Server-safe. */
|
|
70
|
+
export declare function useBlockIds(id: string | undefined, prefix: string): {
|
|
71
|
+
base: string;
|
|
72
|
+
headingId: string;
|
|
73
|
+
};
|
|
74
|
+
/** `data-field` attribute for edit mode. */
|
|
75
|
+
export declare const field: (editMode: boolean | undefined, path: string) => {
|
|
76
|
+
"data-field": string;
|
|
77
|
+
} | undefined;
|
|
78
|
+
export interface CtaListProps {
|
|
79
|
+
actions?: readonly SiteCta[];
|
|
80
|
+
components?: BlockAdapters;
|
|
81
|
+
labels?: SiteBlockLabels;
|
|
82
|
+
locale?: string;
|
|
83
|
+
size?: "md" | "lg" | "xl";
|
|
84
|
+
/** Override every action's style (e.g. "link" in a split navbar). */
|
|
85
|
+
forceStyle?: CtaStyle;
|
|
86
|
+
/** Only the first n actions. */
|
|
87
|
+
max?: number;
|
|
88
|
+
editMode?: boolean;
|
|
89
|
+
className?: string;
|
|
90
|
+
/** Add an arrow after `link`-style actions. Default true. */
|
|
91
|
+
arrow?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** Renders a block's actions; enforces "one primary" by demoting later primaries to secondary. */
|
|
94
|
+
export declare function CtaList({ actions, components, labels, locale, size, forceStyle, max, editMode, className, arrow }: CtaListProps): React.JSX.Element | null;
|
|
95
|
+
/** Logical "→" that mirrors in RTL. Decorative. */
|
|
96
|
+
export declare function ArrowEnd({ className }: {
|
|
97
|
+
className?: string;
|
|
98
|
+
}): React.JSX.Element;
|
|
99
|
+
/** Two-digit mono index ("01"). */
|
|
100
|
+
export declare const indexLabel: (i: number) => string;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Shared parts for the site blocks of registry-1 (navbar, hero, feature grid, …).
|
|
3
|
+
// Server-safe: no hooks except useId, no context, no zod.
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { ArrowRight } from "lucide-react";
|
|
6
|
+
import { cn } from "../../lib/cn.js";
|
|
7
|
+
import { formatMessage } from "../../lib/message-format.js";
|
|
8
|
+
import { BlockLink } from "../block-link.js";
|
|
9
|
+
import { blockLabels } from "../labels.js";
|
|
10
|
+
/* ------------------------------------------------------------------ */
|
|
11
|
+
/* Built-in strings (D2b). English defaults; `site1LabelsTr` for tr. */
|
|
12
|
+
/* ------------------------------------------------------------------ */
|
|
13
|
+
export const site1Labels = {
|
|
14
|
+
announcement: "Announcement",
|
|
15
|
+
notice: "Notice",
|
|
16
|
+
dismiss: "Dismiss announcement",
|
|
17
|
+
mainNavigation: "Main",
|
|
18
|
+
openMenu: "Menu",
|
|
19
|
+
closeMenu: "Close menu",
|
|
20
|
+
menuDialog: "Site menu",
|
|
21
|
+
languages: "Language",
|
|
22
|
+
callUs: "Call {phone}",
|
|
23
|
+
phoneLabel: "Phone",
|
|
24
|
+
breadcrumb: "Breadcrumb",
|
|
25
|
+
playVideo: "Play video: {title}",
|
|
26
|
+
pauseVideo: "Pause background video",
|
|
27
|
+
resumeVideo: "Play background video",
|
|
28
|
+
video: "Video",
|
|
29
|
+
openCalendar: "Open calendar",
|
|
30
|
+
loadsCalendar: "Loads the booking calendar from {provider}",
|
|
31
|
+
faqMore: "Can’t find your question?",
|
|
32
|
+
stepLabel: "Step {n}",
|
|
33
|
+
emailLabel: "Email address",
|
|
34
|
+
emailPlaceholder: "you@company.com",
|
|
35
|
+
subscribe: "Subscribe",
|
|
36
|
+
subscribed: "Thanks — check your inbox to confirm.",
|
|
37
|
+
subscribeError: "That didn’t go through. Try again in a moment.",
|
|
38
|
+
date: "Date",
|
|
39
|
+
time: "Time",
|
|
40
|
+
guests: "Guests",
|
|
41
|
+
service: "Service",
|
|
42
|
+
guestsCount: "{count, plural, one {# guest} other {# guests}}",
|
|
43
|
+
askAvailability: "Ask for availability",
|
|
44
|
+
opensWhatsApp: "(opens WhatsApp)",
|
|
45
|
+
closedOn: "We’re closed on {day}. Pick another date.",
|
|
46
|
+
bookingMessage: "Hi, I’d like to book for {guests} on {date} at {time}.",
|
|
47
|
+
bookingMessageService: "Hi, I’d like to book {service} on {date} at {time}.",
|
|
48
|
+
bookingFallback: "Hi, I’d like to make a booking.",
|
|
49
|
+
percent: "percent",
|
|
50
|
+
logos: "Clients",
|
|
51
|
+
source: "Source: {source}",
|
|
52
|
+
};
|
|
53
|
+
export const site1LabelsTr = {
|
|
54
|
+
announcement: "Duyuru",
|
|
55
|
+
notice: "Duyuru",
|
|
56
|
+
dismiss: "Duyuruyu kapat",
|
|
57
|
+
mainNavigation: "Ana menü",
|
|
58
|
+
openMenu: "Menü",
|
|
59
|
+
closeMenu: "Menüyü kapat",
|
|
60
|
+
menuDialog: "Site menüsü",
|
|
61
|
+
languages: "Dil",
|
|
62
|
+
callUs: "Ara: {phone}",
|
|
63
|
+
phoneLabel: "Telefon",
|
|
64
|
+
breadcrumb: "Sayfa yolu",
|
|
65
|
+
playVideo: "Videoyu oynat: {title}",
|
|
66
|
+
pauseVideo: "Arka plan videosunu duraklat",
|
|
67
|
+
resumeVideo: "Arka plan videosunu oynat",
|
|
68
|
+
video: "Video",
|
|
69
|
+
openCalendar: "Takvimi aç",
|
|
70
|
+
loadsCalendar: "Rezervasyon takvimi {provider} üzerinden yüklenir",
|
|
71
|
+
faqMore: "Sorunuzu bulamadınız mı?",
|
|
72
|
+
stepLabel: "Adım {n}",
|
|
73
|
+
emailLabel: "E-posta adresi",
|
|
74
|
+
emailPlaceholder: "siz@sirket.com",
|
|
75
|
+
subscribe: "Abone ol",
|
|
76
|
+
subscribed: "Teşekkürler — onay için gelen kutunuza bakın.",
|
|
77
|
+
subscribeError: "Gönderilemedi. Birazdan tekrar deneyin.",
|
|
78
|
+
date: "Tarih",
|
|
79
|
+
time: "Saat",
|
|
80
|
+
guests: "Kişi",
|
|
81
|
+
service: "Hizmet",
|
|
82
|
+
guestsCount: "{count} kişi",
|
|
83
|
+
askAvailability: "Uygunluk sor",
|
|
84
|
+
opensWhatsApp: "(WhatsApp’ı açar)",
|
|
85
|
+
closedOn: "{day} günleri kapalıyız. Başka bir tarih seçin.",
|
|
86
|
+
bookingMessage: "Merhaba, {date} {time} için {guests} rezervasyon yapmak istiyorum.",
|
|
87
|
+
bookingMessageService: "Merhaba, {date} {time} için {service} randevusu almak istiyorum.",
|
|
88
|
+
bookingFallback: "Merhaba, rezervasyon yapmak istiyorum.",
|
|
89
|
+
percent: "yüzde",
|
|
90
|
+
logos: "Müşteriler",
|
|
91
|
+
source: "Kaynak: {source}",
|
|
92
|
+
};
|
|
93
|
+
/** Label lookup for registry-1 blocks: `labels` prop → English. */
|
|
94
|
+
export function siteText(labels, locale = "en-US") {
|
|
95
|
+
const merged = { ...blockLabels, ...site1Labels };
|
|
96
|
+
if (labels)
|
|
97
|
+
for (const [k, v] of Object.entries(labels))
|
|
98
|
+
if (typeof v === "string")
|
|
99
|
+
merged[k] = v;
|
|
100
|
+
return (key, vars) => formatMessage(merged[key] ?? String(key), vars, locale);
|
|
101
|
+
}
|
|
102
|
+
/** The raw template of a label (for islands that format it later with their own values). */
|
|
103
|
+
export function siteTemplate(labels, key) {
|
|
104
|
+
const v = labels?.[key];
|
|
105
|
+
return typeof v === "string" ? v : site1Labels[key];
|
|
106
|
+
}
|
|
107
|
+
/** Stable ids for a block: `base` (anchor-safe) and the heading id. Server-safe. */
|
|
108
|
+
export function useBlockIds(id, prefix) {
|
|
109
|
+
const auto = React.useId();
|
|
110
|
+
const base = id ?? `${prefix}-${auto.replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
111
|
+
return { base, headingId: `${base}-title` };
|
|
112
|
+
}
|
|
113
|
+
/** `data-field` attribute for edit mode. */
|
|
114
|
+
export const field = (editMode, path) => (editMode ? { "data-field": `props.${path}` } : undefined);
|
|
115
|
+
/** Renders a block's actions; enforces "one primary" by demoting later primaries to secondary. */
|
|
116
|
+
export function CtaList({ actions, components, labels, locale, size = "lg", forceStyle, max = 2, editMode, className, arrow = true }) {
|
|
117
|
+
if (!actions?.length)
|
|
118
|
+
return null;
|
|
119
|
+
let primarySeen = false;
|
|
120
|
+
return (_jsx("div", { "data-dock-avoid": "items", className: cn("flex flex-wrap items-center gap-x-6 gap-y-3", className), children: actions.slice(0, max).map((a, i) => {
|
|
121
|
+
let style = forceStyle ?? a.style ?? "secondary";
|
|
122
|
+
if (style === "primary") {
|
|
123
|
+
if (primarySeen)
|
|
124
|
+
style = "secondary";
|
|
125
|
+
primarySeen = true;
|
|
126
|
+
}
|
|
127
|
+
return (_jsxs(BlockLink, { href: a.link.href, newTab: a.link.newTab, appearance: style, size: size, components: components, labels: labels, locale: locale, editMode: editMode, field: `props.actions.${i}`, "data-track": a.link.kind, children: [a.link.label, style === "link" && arrow ? _jsx(ArrowEnd, {}) : null] }, `${a.link.href}-${i}`));
|
|
128
|
+
}) }));
|
|
129
|
+
}
|
|
130
|
+
/** Logical "→" that mirrors in RTL. Decorative. */
|
|
131
|
+
export function ArrowEnd({ className }) {
|
|
132
|
+
return _jsx(ArrowRight, { "aria-hidden": true, strokeWidth: 1.5, className: cn("vb-arrow size-[1em] shrink-0 transition-transform duration-200", className) });
|
|
133
|
+
}
|
|
134
|
+
/** Two-digit mono index ("01"). */
|
|
135
|
+
export const indexLabel = (i) => String(i + 1).padStart(2, "0");
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** A lucide icon from its kebab-case name, or the node itself. 20px, stroke 1.5, never boxed (D6-3). */
|
|
3
|
+
export declare function SiteIcon({ icon, className }: {
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as Lucide from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
const pascal = (s) => s.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());
|
|
5
|
+
/** A lucide icon from its kebab-case name, or the node itself. 20px, stroke 1.5, never boxed (D6-3). */
|
|
6
|
+
export function SiteIcon({ icon, className }) {
|
|
7
|
+
if (!icon)
|
|
8
|
+
return null;
|
|
9
|
+
if (typeof icon !== "string")
|
|
10
|
+
return _jsx("span", { "aria-hidden": true, className: cn("inline-flex size-5 shrink-0 text-fg-muted [&_svg]:size-5", className), children: icon });
|
|
11
|
+
const Comp = Lucide[pascal(icon)] ?? Lucide[`${pascal(icon)}Icon`];
|
|
12
|
+
if (!Comp)
|
|
13
|
+
return null;
|
|
14
|
+
return _jsx(Comp, { "aria-hidden": true, strokeWidth: 1.5, className: cn("size-5 shrink-0 text-fg-muted", className) });
|
|
15
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { BlockBaseProps } from "../types.js";
|
|
3
|
+
import { type SiteBlockLabels } from "./_kit-1.js";
|
|
4
|
+
export type AnnouncementVariant = "inline" | "centered";
|
|
5
|
+
export type AnnouncementTone = "neutral" | "accent" | "warning";
|
|
6
|
+
export interface AnnouncementBarProps extends Omit<BlockBaseProps, "variant" | "labels"> {
|
|
7
|
+
/** inline: text at the start, link after it, dismiss at the end. centered: a mono "Notice" label, text + link centred. */
|
|
8
|
+
variant?: AnnouncementVariant;
|
|
9
|
+
/** One line, ≤ 120 characters. */
|
|
10
|
+
text: React.ReactNode;
|
|
11
|
+
link?: {
|
|
12
|
+
href: string;
|
|
13
|
+
label: React.ReactNode;
|
|
14
|
+
newTab?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** neutral = ink strip, accent = accent strip, warning = 14% warning tint. Always solid. Default `"neutral"`. */
|
|
17
|
+
tone?: AnnouncementTone;
|
|
18
|
+
/** Show a dismiss button (tiny client island + cookie). */
|
|
19
|
+
dismissible?: boolean;
|
|
20
|
+
/** The app read the cookie server-side and the visitor dismissed it: render nothing. */
|
|
21
|
+
dismissed?: boolean;
|
|
22
|
+
/** Cookie name. Default `vb_ann_<hash of the text>` — new copy shows again. */
|
|
23
|
+
storageKey?: string;
|
|
24
|
+
/** ISO datetime: hidden before. */
|
|
25
|
+
from?: string;
|
|
26
|
+
/** ISO datetime (exclusive): hidden from. */
|
|
27
|
+
until?: string;
|
|
28
|
+
/** "Now" for the schedule check (tests, previews). Default the render time. */
|
|
29
|
+
now?: Date | string;
|
|
30
|
+
/** Small label before the text in `centered`. Default "Notice". */
|
|
31
|
+
label?: React.ReactNode;
|
|
32
|
+
labels?: SiteBlockLabels;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A one-line, time-boxed notice at the very top of a site ("Closed 1–3 April for the holiday").
|
|
36
|
+
* Server component; the dismiss button is a ~0.5 KB island.
|
|
37
|
+
*
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <AnnouncementBar text="Closed 1–3 April for Eid — open again Thursday from noon." link={{ href: "/hours", label: "Holiday hours" }} />
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function AnnouncementBar({ variant, text, link, tone, dismissible, dismissed, storageKey, from, until, now, label, id, anchor, className, labels, locale, components, editMode, }: AnnouncementBarProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { BlockLink } from "../block-link.js";
|
|
4
|
+
import { AnnouncementDismiss } from "./announcement-dismiss.js";
|
|
5
|
+
import { ArrowEnd, field, siteText } from "./_kit-1.js";
|
|
6
|
+
function hash(s) {
|
|
7
|
+
let h = 5381;
|
|
8
|
+
for (let i = 0; i < s.length; i++)
|
|
9
|
+
h = ((h << 5) + h + s.charCodeAt(i)) | 0;
|
|
10
|
+
return (h >>> 0).toString(36);
|
|
11
|
+
}
|
|
12
|
+
const textOf = (n) => (typeof n === "string" || typeof n === "number" ? String(n) : "");
|
|
13
|
+
const toneClass = {
|
|
14
|
+
neutral: "bg-fg text-scene",
|
|
15
|
+
accent: "bg-accent text-accent-fg",
|
|
16
|
+
warning: "vb-announcement-warning text-fg",
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A one-line, time-boxed notice at the very top of a site ("Closed 1–3 April for the holiday").
|
|
20
|
+
* Server component; the dismiss button is a ~0.5 KB island.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <AnnouncementBar text="Closed 1–3 April for Eid — open again Thursday from noon." link={{ href: "/hours", label: "Holiday hours" }} />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function AnnouncementBar({ variant = "inline", text, link, tone = "neutral", dismissible, dismissed, storageKey, from, until, now, label, id, anchor, className, labels, locale, components, editMode, }) {
|
|
27
|
+
const t = siteText(labels, locale);
|
|
28
|
+
if (dismissed && !editMode)
|
|
29
|
+
return null;
|
|
30
|
+
const at = now ? new Date(now).getTime() : Date.now();
|
|
31
|
+
const outside = (from && at < Date.parse(from)) || (until && at >= Date.parse(until));
|
|
32
|
+
if (outside && !editMode)
|
|
33
|
+
return null;
|
|
34
|
+
const cookie = storageKey ?? `vb_ann_${hash(textOf(text) + textOf(link?.label))}`;
|
|
35
|
+
const centered = variant === "centered";
|
|
36
|
+
const linkEl = link ? (_jsxs(BlockLink, { href: link.href, newTab: link.newTab, components: components, labels: labels, locale: locale, editMode: editMode, field: "props.link", className: "group/ann inline-flex shrink-0 items-center gap-1.5 font-medium underline decoration-current/40 underline-offset-[0.28em] transition-[text-decoration-color] hover:decoration-current focus-ring rounded-[2px]", children: [link.label, _jsx(ArrowEnd, { className: "group-hover/ann:translate-x-0.5 rtl:group-hover/ann:-translate-x-0.5" })] })) : null;
|
|
37
|
+
return (_jsx("div", { role: "region", "aria-label": t("announcement"), id: anchor, "data-announcement": "", "data-variant": variant, "data-tone": tone, "data-block-id": editMode ? id : undefined, "data-hidden": editMode && outside ? "" : undefined, className: cn("vb-announcement relative text-small", toneClass[tone], className), children: _jsxs("div", { className: cn("vb-container flex min-h-9 items-center gap-3 py-1.5", centered && "justify-center text-center"), children: [_jsxs("p", { className: cn("flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-0.5", centered ? "justify-center" : "flex-1"), children: [centered ? (_jsx("span", { className: "font-mono text-eyebrow uppercase tracking-[0.08em] after:ms-3 after:inline-block after:h-[0.7em] after:w-px after:bg-current after:align-[-0.05em] after:opacity-40 after:content-['']", ...field(editMode, "label"), children: label ?? t("notice") })) : null, _jsx("span", { className: "text-pretty", ...field(editMode, "text"), children: text }), linkEl] }), dismissible ? (_jsx(AnnouncementDismiss, { cookie: cookie, label: t("dismiss"), className: centered ? "absolute end-[max(var(--gutter),0.5rem)] top-1/2 -translate-y-1/2" : undefined })) : null] }) }));
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AnnouncementDismissProps {
|
|
3
|
+
/** Cookie name that remembers the dismissal (`vb_ann_<hash>`). */
|
|
4
|
+
cookie: string;
|
|
5
|
+
/** Days the cookie lives. Default 30. */
|
|
6
|
+
days?: number;
|
|
7
|
+
/** Accessible name ("Dismiss announcement"). */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Element to focus after dismissing. Default `"content"`. */
|
|
10
|
+
focusTarget?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Dismiss island of the Announcement bar (~0.5 KB). Hides the closest
|
|
15
|
+
* `[data-announcement]`, writes a cookie the server can read, and moves focus to `#content`.
|
|
16
|
+
* On statically cached pages it also hides an already-dismissed bar on mount.
|
|
17
|
+
*/
|
|
18
|
+
export declare function AnnouncementDismiss({ cookie, days, label, focusTarget, className }: AnnouncementDismissProps): React.JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
const readCookie = (name) => typeof document !== "undefined" && document.cookie.split("; ").some((c) => c.startsWith(`${name}=`));
|
|
7
|
+
/**
|
|
8
|
+
* Dismiss island of the Announcement bar (~0.5 KB). Hides the closest
|
|
9
|
+
* `[data-announcement]`, writes a cookie the server can read, and moves focus to `#content`.
|
|
10
|
+
* On statically cached pages it also hides an already-dismissed bar on mount.
|
|
11
|
+
*/
|
|
12
|
+
export function AnnouncementDismiss({ cookie, days = 30, label, focusTarget = "content", className }) {
|
|
13
|
+
const ref = React.useRef(null);
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (readCookie(cookie))
|
|
16
|
+
ref.current?.closest("[data-announcement]")?.setAttribute("hidden", "");
|
|
17
|
+
}, [cookie]);
|
|
18
|
+
return (_jsx("button", { ref: ref, type: "button", "aria-label": label, className: cn("-me-2 inline-flex size-8 shrink-0 items-center justify-center rounded-ui-sm text-current opacity-70 transition-opacity hover:opacity-100 focus-ring", className), onClick: () => {
|
|
19
|
+
document.cookie = `${cookie}=1; max-age=${days * 86400}; path=/; samesite=lax`;
|
|
20
|
+
ref.current?.closest("[data-announcement]")?.setAttribute("hidden", "");
|
|
21
|
+
const target = document.getElementById(focusTarget);
|
|
22
|
+
if (target) {
|
|
23
|
+
if (!target.hasAttribute("tabindex"))
|
|
24
|
+
target.setAttribute("tabindex", "-1");
|
|
25
|
+
target.focus();
|
|
26
|
+
}
|
|
27
|
+
}, children: _jsx(X, { "aria-hidden": true, strokeWidth: 1.5, className: "size-4" }) }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { BlockBaseProps } from "../types.js";
|
|
3
|
+
import type { RichDoc } from "../schema/rich-doc.js";
|
|
4
|
+
import { type Site2BlockLabels } from "./shared/labels-2.js";
|
|
5
|
+
import { type SiteImage2, type SiteLink2 } from "./shared/kit-2.js";
|
|
6
|
+
import { type PostSummary } from "./blog-list.js";
|
|
7
|
+
export type ArticleVariant = "classic" | "wide-cover" | "minimal";
|
|
8
|
+
export type ShareTarget = "copy" | "whatsapp" | "x" | "linkedin" | "email";
|
|
9
|
+
export interface ArticleAuthor {
|
|
10
|
+
name: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
bio?: React.ReactNode;
|
|
13
|
+
avatar?: SiteImage2;
|
|
14
|
+
href?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ArticlePost {
|
|
17
|
+
title: string;
|
|
18
|
+
/** Standfirst under the title. */
|
|
19
|
+
dek?: React.ReactNode;
|
|
20
|
+
body: RichDoc;
|
|
21
|
+
cover?: SiteImage2;
|
|
22
|
+
coverCaption?: React.ReactNode;
|
|
23
|
+
author?: ArticleAuthor;
|
|
24
|
+
/** ISO datetime or `YYYY-MM-DD`. */
|
|
25
|
+
publishedAt: string;
|
|
26
|
+
updatedAt?: string;
|
|
27
|
+
category?: SiteLink2;
|
|
28
|
+
tags?: SiteLink2[];
|
|
29
|
+
/** Breadcrumb trail above the title (Home › Journal). The post itself is appended. */
|
|
30
|
+
breadcrumb?: SiteLink2[];
|
|
31
|
+
/** Default: computed from the body (220 wpm). */
|
|
32
|
+
readingMinutes?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ArticleLayoutProps extends Omit<BlockBaseProps, "variant" | "labels"> {
|
|
35
|
+
/**
|
|
36
|
+
* classic: 42rem text column with a sticky mono table of contents at the end; cover wider than
|
|
37
|
+
* the text. wide-cover: full-width 21:9 cover, title below, TOC as a row of links.
|
|
38
|
+
* minimal: no cover, mono date above a large title — notes and announcements.
|
|
39
|
+
*/
|
|
40
|
+
variant?: ArticleVariant;
|
|
41
|
+
post: ArticlePost;
|
|
42
|
+
/** Table of contents from the body's h2s (hidden under 3). Default true. */
|
|
43
|
+
toc?: boolean;
|
|
44
|
+
/** Share targets — plain URLs, no SDKs. Default copy · whatsapp · linkedin · email. */
|
|
45
|
+
share?: ShareTarget[];
|
|
46
|
+
/** Absolute URL used for sharing. Default: the page URL (copy) / omitted. */
|
|
47
|
+
url?: string;
|
|
48
|
+
related?: PostSummary[];
|
|
49
|
+
/** Any block after the article (newsletter, booking CTA). */
|
|
50
|
+
cta?: React.ReactNode;
|
|
51
|
+
/** Draft preview: a "Preview" strip on top. Add `noindex` in the app's metadata. */
|
|
52
|
+
draft?: boolean;
|
|
53
|
+
labels?: Site2BlockLabels;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The single-post template: header (breadcrumb, category, title, dek, byline, dates, reading
|
|
57
|
+
* time), cover, table of contents, body (`RichText`), share links, author box and related posts.
|
|
58
|
+
* Server component; only "Copy link" is a tiny island.
|
|
59
|
+
*
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <ArticleLayout post={post} related={related} share={["copy", "whatsapp", "linkedin"]} />
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function ArticleLayout({ variant, post, toc: showToc, share, url, related, cta, draft, id, anchor, theme, headingLevel, className, labels, locale, components, editMode, }: ArticleLayoutProps): React.JSX.Element;
|
|
65
|
+
export declare function shareUrl(target: Exclude<ShareTarget, "copy">, url: string, title: string): string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cn2 as cn } from "./shared/kit-2.js";
|
|
3
|
+
import { slugify } from "../../lib/text.js";
|
|
4
|
+
import { readingMinutes } from "../../format/core.js";
|
|
5
|
+
import { Section, Container } from "../section.js";
|
|
6
|
+
import { BlockHeading } from "../block-heading.js";
|
|
7
|
+
import { BlockImage } from "../block-image.js";
|
|
8
|
+
import { BlockLink } from "../block-link.js";
|
|
9
|
+
import { RichText } from "../rich-text.js";
|
|
10
|
+
import { inlineToText, richToText, countWords } from "../schema/rich-doc.js";
|
|
11
|
+
import { labelTemplates, site2Text } from "./shared/labels-2.js";
|
|
12
|
+
import { formatDate2, isoDay, useBlockIds2 } from "./shared/kit-2.js";
|
|
13
|
+
import { BrandIcon } from "./shared/brand-icons.js";
|
|
14
|
+
import { CopyLinkButton } from "./shared/copy-link.js";
|
|
15
|
+
import { shareLabelKeys } from "./shared/island-keys.js";
|
|
16
|
+
import { BlogList } from "./blog-list.js";
|
|
17
|
+
/** Gives every h2/h3 a unique, locale-aware anchor and collects the h2s for the TOC. */
|
|
18
|
+
function withAnchors(doc, locale) {
|
|
19
|
+
const used = new Set();
|
|
20
|
+
const toc = [];
|
|
21
|
+
const content = doc.content.map((b) => {
|
|
22
|
+
if (b.type !== "heading")
|
|
23
|
+
return b;
|
|
24
|
+
const text = inlineToText(b.content);
|
|
25
|
+
let id = b.anchor || slugify(text, { locale }) || "section";
|
|
26
|
+
let n = 2;
|
|
27
|
+
while (used.has(id))
|
|
28
|
+
id = `${b.anchor || slugify(text, { locale })}-${n++}`;
|
|
29
|
+
used.add(id);
|
|
30
|
+
if (b.level === 2)
|
|
31
|
+
toc.push({ id, text });
|
|
32
|
+
return { ...b, anchor: id };
|
|
33
|
+
});
|
|
34
|
+
return { doc: { ...doc, content }, toc };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The single-post template: header (breadcrumb, category, title, dek, byline, dates, reading
|
|
38
|
+
* time), cover, table of contents, body (`RichText`), share links, author box and related posts.
|
|
39
|
+
* Server component; only "Copy link" is a tiny island.
|
|
40
|
+
*
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <ArticleLayout post={post} related={related} share={["copy", "whatsapp", "linkedin"]} />
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export function ArticleLayout({ variant = "classic", post, toc: showToc = true, share = ["copy", "whatsapp", "linkedin", "email"], url, related, cta, draft, id, anchor, theme, headingLevel = 1, className, labels, locale = "en-US", components, editMode, }) {
|
|
46
|
+
const t = site2Text(labels, locale);
|
|
47
|
+
const { headingId } = useBlockIds2(id, "article");
|
|
48
|
+
const { doc, toc } = withAnchors(post.body, locale);
|
|
49
|
+
const tocVisible = showToc && toc.length >= 3;
|
|
50
|
+
const minutes = post.readingMinutes ?? readingMinutes(countWords(richToText(post.body)));
|
|
51
|
+
const ctx = { t, locale, components, labels };
|
|
52
|
+
const cover = variant !== "minimal" && post.cover?.src ? post.cover : undefined;
|
|
53
|
+
const header = (_jsxs("header", { className: cn("flex flex-col gap-6", variant === "wide-cover" && "pt-4"), children: [post.breadcrumb?.length ? _jsx(Breadcrumb, { trail: post.breadcrumb, current: post.title, ctx: ctx }) : null, variant === "minimal" ? (_jsx("p", { className: "font-mono text-eyebrow tabular uppercase tracking-[0.08em] text-fg-muted", children: _jsx("time", { dateTime: isoDay(post.publishedAt), children: formatDate2(isoDay(post.publishedAt), locale) }) })) : post.category ? (_jsx("p", { className: "font-mono text-eyebrow uppercase tracking-[0.08em]", children: _jsx(BlockLink, { href: post.category.href, components: components, labels: labels, locale: locale, className: "text-accent-ink hover:underline underline-offset-[0.25em] focus-ring rounded-[2px]", children: post.category.label }) })) : null, _jsx(BlockHeading, { id: headingId, level: headingLevel, size: variant === "minimal" ? "display-xl" : "display-l", text: post.title, editMode: editMode, field: "props.post.title", labels: labels, locale: locale, className: "max-w-[22ch]" }), post.dek ? _jsx("p", { className: "max-w-[58ch] text-lead text-fg-muted text-pretty", children: post.dek }) : null, _jsx(Byline, { post: post, minutes: minutes, ctx: ctx, showDate: variant !== "minimal" })] }));
|
|
54
|
+
const tocNav = tocVisible ? (_jsxs("nav", { "aria-label": t("onThisPage"), className: cn("vb-toc", variant === "wide-cover" ? "border-y border-line py-4" : "flex flex-col gap-3"), children: [_jsx("p", { className: cn("font-mono text-eyebrow uppercase tracking-[0.08em] text-fg-muted", variant === "wide-cover" && "sr-only"), children: t("onThisPage") }), _jsx("ol", { className: cn("text-small", variant === "wide-cover" ? "flex flex-wrap gap-x-6 gap-y-2" : "flex flex-col gap-2 border-s border-line"), children: toc.map((e) => (_jsx("li", { children: _jsx("a", { href: `#${e.id}`, className: cn("vb-toc-link block text-fg-muted transition-colors hover:text-fg focus-ring rounded-[2px]", variant !== "wide-cover" && "-ms-px border-s border-transparent ps-4 hover:border-fg"), children: e.text }) }, e.id))) })] })) : null;
|
|
55
|
+
const body = _jsx(RichText, { doc: doc, size: "lg", components: components, labels: labels, locale: locale, className: "vb-article-body", editMode: editMode, field: "props.post.body" });
|
|
56
|
+
return (_jsxs(_Fragment, { children: [draft ? (_jsxs("p", { role: "note", className: "vb-draft-strip sticky top-0 z-20 px-4 py-2 text-center text-small text-fg", children: [_jsx("span", { className: "me-2 font-mono text-eyebrow uppercase tracking-[0.08em]", children: t("preview") }), t("previewNotice")] })) : null, _jsxs(Section, { as: "article", theme: theme, anchor: anchor, headingId: headingId, blockId: id, blockType: "article", editMode: editMode, className: cn("vb-article", className), "data-variant": variant, children: [variant === "wide-cover" && cover ? (_jsx("div", { className: "vb-article-cover -mt-[calc(var(--section-y)*var(--vb-rhythm))] mb-12 @4xl:mb-16", children: _jsx(BlockImage, { ...cover, alt: cover.alt ?? "", decorative: !cover.alt, aspect: "21:9", priority: true, sizes: "100vw", components: components, caption: post.coverCaption ? _jsx("span", { className: "vb-container block", children: post.coverCaption }) : undefined }) })) : null, _jsxs(Container, { className: "flex flex-col gap-12 @4xl:gap-16", children: [_jsx("div", { className: cn(variant === "classic" ? "@4xl:grid @4xl:grid-cols-12 @4xl:gap-x-(--gutter)" : "mx-auto w-full max-w-(--prose)", variant === "wide-cover" && "max-w-[58rem]"), children: _jsx("div", { className: cn(variant === "classic" && "@4xl:col-span-9"), children: header }) }), variant === "classic" && cover ? (_jsx(BlockImage, { ...cover, alt: cover.alt ?? "", decorative: !cover.alt, aspect: "3:2", priority: true, sizes: "(min-width: 76rem) 76rem, 100vw", className: "vb-article-cover rounded-ui", components: components, caption: post.coverCaption })) : null, variant === "wide-cover" && tocNav ? _jsx("div", { className: "mx-auto w-full max-w-[58rem]", children: tocNav }) : null, _jsxs("div", { className: cn(variant === "classic" ? "grid gap-x-(--gutter) gap-y-10 @4xl:grid-cols-12" : "mx-auto w-full max-w-(--prose)"), children: [variant === "classic" && tocNav ? (_jsx("aside", { className: "@4xl:col-span-3 @4xl:col-start-10 @4xl:row-start-1", children: _jsx("div", { className: "@4xl:sticky @4xl:top-[calc(var(--topbar-h,0px)+2rem)]", children: tocNav }) })) : null, _jsxs("div", { className: cn("flex min-w-0 flex-col gap-12", variant === "classic" && "@4xl:col-span-8 @4xl:row-start-1 @6xl:col-span-7"), children: [body, _jsx(ArticleFooter, { post: post, share: share, url: url, ctx: ctx })] })] })] })] }), related?.length ? _jsx(BlogList, { variant: "compact", title: t("relatedPosts"), posts: related, postHeadingLevel: 3, theme: { rhythm: "tight" }, components: components, labels: labels, locale: locale }) : null, cta] }));
|
|
57
|
+
}
|
|
58
|
+
function Breadcrumb({ trail, current, ctx }) {
|
|
59
|
+
return (_jsx("nav", { "aria-label": ctx.t("breadcrumb"), children: _jsxs("ol", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-small text-fg-muted", children: [trail.map((l, i) => (_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(BlockLink, { href: l.href, components: ctx.components, labels: ctx.labels, locale: ctx.locale, className: "hover:text-fg underline-offset-[0.25em] hover:underline focus-ring rounded-[2px]", children: l.label }), _jsx("span", { "aria-hidden": true, className: "text-fg-subtle rtl:-scale-x-100", children: "/" })] }, i))), _jsx("li", { children: _jsx("span", { "aria-current": "page", className: "line-clamp-1 text-fg", children: current }) })] }) }));
|
|
60
|
+
}
|
|
61
|
+
function Byline({ post, minutes, ctx, showDate }) {
|
|
62
|
+
const updated = post.updatedAt && isoDay(post.updatedAt) !== isoDay(post.publishedAt) ? post.updatedAt : undefined;
|
|
63
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-3 border-t border-line pt-5 text-small text-fg-muted", children: [post.author ? (_jsxs("span", { className: "flex items-center gap-3", children: [post.author.avatar?.src ? _jsx(BlockImage, { ...post.author.avatar, decorative: true, aspect: "1:1", sizes: "36px", className: "size-9 shrink-0 rounded-full", components: ctx.components }) : null, _jsx("span", { className: "font-medium text-fg", children: post.author.name })] })) : null, _jsxs("span", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-eyebrow tabular uppercase tracking-[0.06em]", children: [showDate ? _jsx("time", { dateTime: isoDay(post.publishedAt), children: formatDate2(isoDay(post.publishedAt), ctx.locale) }) : null, updated ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsx("time", { dateTime: isoDay(updated), children: ctx.t("updated", { date: formatDate2(isoDay(updated), ctx.locale, "medium") }) })] })) : null, showDate || updated ? _jsx("span", { "aria-hidden": true, children: "\u00B7" }) : null, _jsx("span", { children: ctx.t("minRead", { count: minutes }) })] })] }));
|
|
64
|
+
}
|
|
65
|
+
const SHARE_NETWORK = {
|
|
66
|
+
whatsapp: { brand: "whatsapp", name: "WhatsApp" },
|
|
67
|
+
x: { brand: "x", name: "X" },
|
|
68
|
+
linkedin: { brand: "linkedin", name: "LinkedIn" },
|
|
69
|
+
email: { brand: "email", name: "Email" },
|
|
70
|
+
};
|
|
71
|
+
export function shareUrl(target, url, title) {
|
|
72
|
+
const u = encodeURIComponent(url);
|
|
73
|
+
const tt = encodeURIComponent(title);
|
|
74
|
+
switch (target) {
|
|
75
|
+
case "whatsapp":
|
|
76
|
+
return `https://wa.me/?text=${encodeURIComponent(`${title} ${url}`)}`;
|
|
77
|
+
case "x":
|
|
78
|
+
return `https://x.com/intent/post?url=${u}&text=${tt}`;
|
|
79
|
+
case "linkedin":
|
|
80
|
+
return `https://www.linkedin.com/sharing/share-offsite/?url=${u}`;
|
|
81
|
+
case "email":
|
|
82
|
+
return `mailto:?subject=${tt}&body=${u}`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function ArticleFooter({ post, share, url, ctx }) {
|
|
86
|
+
const targets = share.filter((s) => s === "copy" || url);
|
|
87
|
+
return (_jsxs("footer", { className: "flex flex-col gap-10 border-t border-line pt-8", children: [post.tags?.length ? (_jsx("ul", { className: "flex flex-wrap gap-2", "aria-label": ctx.t("tags"), children: post.tags.map((tag, i) => (_jsx("li", { children: _jsx(BlockLink, { href: tag.href, components: ctx.components, labels: ctx.labels, locale: ctx.locale, className: "inline-flex h-8 items-center rounded-full border border-line px-3 text-small text-fg-muted transition-colors hover:border-fg hover:text-fg focus-ring", children: tag.label }) }, i))) })) : null, targets.length ? (_jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-3", children: [_jsx("p", { className: "me-3 font-mono text-eyebrow uppercase tracking-[0.08em] text-fg-muted", children: ctx.t("share") }), targets.map((s) => s === "copy" ? (_jsx(CopyLinkButton, { url: url, labels: labelTemplates(ctx.labels, shareLabelKeys) }, s)) : (_jsxs(BlockLink, { href: shareUrl(s, url, post.title), newTab: s !== "email", components: ctx.components, labels: ctx.labels, locale: ctx.locale, "aria-label": s === "email" ? ctx.t("shareByEmail") : ctx.t("shareOn", { network: SHARE_NETWORK[s].name }), className: "vb-share-btn", "data-track": `share:${s}`, children: [_jsx(BrandIcon, { name: SHARE_NETWORK[s].brand, className: "size-4" }), _jsx("span", { "aria-hidden": true, children: SHARE_NETWORK[s].name })] }, s)))] })) : null, post.author?.bio ? (_jsxs("div", { className: "flex gap-5 rounded-ui bg-surface-2 p-6", children: [post.author.avatar?.src ? _jsx(BlockImage, { ...post.author.avatar, decorative: true, aspect: "1:1", sizes: "64px", className: "size-16 shrink-0 rounded-full", components: ctx.components }) : null, _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("p", { className: "font-mono text-eyebrow uppercase tracking-[0.08em] text-fg-muted", children: ctx.t("writtenBy") }), _jsxs("p", { className: "text-h3 font-semibold tracking-[-0.012em] text-fg", children: [post.author.href ? (_jsx(BlockLink, { href: post.author.href, components: ctx.components, labels: ctx.labels, locale: ctx.locale, className: "hover:underline underline-offset-[0.2em] focus-ring rounded-[2px]", children: post.author.name })) : (post.author.name), post.author.role ? _jsx("span", { className: "ms-2 text-small font-normal text-fg-muted", children: post.author.role }) : null] }), _jsx("div", { className: "text-small text-fg-muted text-pretty", children: post.author.bio })] })] })) : null] }));
|
|
88
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { BlockBaseProps } from "../types.js";
|
|
3
|
+
import { type Site2BlockLabels } from "./shared/labels-2.js";
|
|
4
|
+
import { type SiteImage2, type SiteLink2 } from "./shared/kit-2.js";
|
|
5
|
+
export type BlogListVariant = "editorial" | "list" | "grid" | "compact";
|
|
6
|
+
/** The contract every CMS maps into. Plain data. */
|
|
7
|
+
export interface PostSummary {
|
|
8
|
+
href: string;
|
|
9
|
+
title: string;
|
|
10
|
+
excerpt?: string;
|
|
11
|
+
cover?: SiteImage2;
|
|
12
|
+
category?: {
|
|
13
|
+
label: string;
|
|
14
|
+
href?: string;
|
|
15
|
+
};
|
|
16
|
+
/** ISO datetime or `YYYY-MM-DD`. */
|
|
17
|
+
publishedAt: string;
|
|
18
|
+
readingMinutes?: number;
|
|
19
|
+
author?: {
|
|
20
|
+
name: string;
|
|
21
|
+
avatar?: SiteImage2;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface BlogPagination {
|
|
25
|
+
page: number;
|
|
26
|
+
total: number;
|
|
27
|
+
/** Builds a page URL (server usage). */
|
|
28
|
+
href?: (page: number) => string;
|
|
29
|
+
/** JSON-friendly alternative: `"/blog?page={page}"`. Page 1 drops the query when it ends in `?page={page}`. */
|
|
30
|
+
hrefTemplate?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface BlogListProps extends Omit<BlockBaseProps, "variant" | "labels"> {
|
|
33
|
+
/**
|
|
34
|
+
* editorial: the first post large beside its cover, the rest as a two-column title list.
|
|
35
|
+
* list: date · title + excerpt · reading time rows. grid: three columns of 3:2 covers.
|
|
36
|
+
* compact: titles and dates only — sidebars, footers, "related posts".
|
|
37
|
+
*/
|
|
38
|
+
variant?: BlogListVariant;
|
|
39
|
+
eyebrow?: React.ReactNode;
|
|
40
|
+
title?: React.ReactNode;
|
|
41
|
+
lead?: React.ReactNode;
|
|
42
|
+
/** "All posts" link beside the header. */
|
|
43
|
+
allLink?: SiteLink2;
|
|
44
|
+
posts: PostSummary[];
|
|
45
|
+
/** Category filter (links; mark one `active`). */
|
|
46
|
+
categories?: {
|
|
47
|
+
label: string;
|
|
48
|
+
href: string;
|
|
49
|
+
active?: boolean;
|
|
50
|
+
}[];
|
|
51
|
+
pagination?: BlogPagination;
|
|
52
|
+
/** Default true (compact never shows covers). */
|
|
53
|
+
showCovers?: boolean;
|
|
54
|
+
/** Empty state copy and an optional action (newsletter CTA). */
|
|
55
|
+
empty?: {
|
|
56
|
+
title?: React.ReactNode;
|
|
57
|
+
text?: React.ReactNode;
|
|
58
|
+
action?: React.ReactNode;
|
|
59
|
+
};
|
|
60
|
+
/** Post title level. Default: 3 under a section title, else 2. */
|
|
61
|
+
postHeadingLevel?: 2 | 3 | 4;
|
|
62
|
+
labels?: Site2BlockLabels;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Latest posts and category archives. Receives posts as data (`PostSummary`); fetching is the
|
|
66
|
+
* app's job (or the renderer's `resolvers.posts`). Each post is an `article` with one link on the
|
|
67
|
+
* title that covers the card. Server component.
|
|
68
|
+
*
|
|
69
|
+
* ```tsx
|
|
70
|
+
* <BlogList variant="editorial" title="From the *studio*" posts={posts} pagination={{ page: 1, total: 4, hrefTemplate: "/blog?page={page}" }} />
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function BlogList({ variant, eyebrow, title, lead, allLink, posts, categories, pagination, showCovers, empty, postHeadingLevel, id, anchor, theme, headingLevel, className, labels, locale, components, editMode, }: BlogListProps): React.JSX.Element;
|
|
74
|
+
/** Streaming fallback for `<Suspense fallback={<BlogListSkeleton />}>`. */
|
|
75
|
+
export declare function BlogListSkeleton({ variant, count, className }: {
|
|
76
|
+
variant?: BlogListVariant;
|
|
77
|
+
count?: number;
|
|
78
|
+
className?: string;
|
|
79
|
+
}): React.JSX.Element;
|