@krizaka/ui 3.55.0 → 3.59.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/dist/{RotatingWord-D9s7FXFD.d.ts → RotatingWord-COSabR2c.d.ts} +2 -1
- package/dist/account-menu.d.ts +2 -1
- package/dist/account-settings.d.ts +153 -61
- package/dist/account-settings.js +240 -97
- package/dist/account-settings.js.map +1 -1
- package/dist/achievement.d.ts +2 -1
- package/dist/action-bar.d.ts +3 -2
- package/dist/activity-feed.d.ts +2 -1
- package/dist/agenda.d.ts +2 -1
- package/dist/alert.d.ts +2 -1
- package/dist/anatomy-plate.d.ts +2 -1
- package/dist/app-header/search.d.ts +8 -7
- package/dist/app-header.d.ts +2 -1
- package/dist/app-shell.d.ts +26 -25
- package/dist/argument-card.d.ts +3 -2
- package/dist/audio-player.d.ts +2 -1
- package/dist/auth-layout.d.ts +11 -10
- package/dist/avatar/defaults.d.ts +2 -1
- package/dist/avatar.d.ts +2 -1
- package/dist/badge.d.ts +2 -1
- package/dist/bird-plate.d.ts +4 -2
- package/dist/blocks.css +77 -4
- package/dist/button.d.ts +2 -1
- package/dist/captcha.d.ts +2 -1
- package/dist/captcha.js +1 -0
- package/dist/captcha.js.map +1 -1
- package/dist/card-grid.d.ts +2 -1
- package/dist/card.d.ts +2 -1
- package/dist/catalogue-page.d.ts +82 -2
- package/dist/catalogue-page.js +156 -13
- package/dist/catalogue-page.js.map +1 -1
- package/dist/changelog-page.d.ts +2 -1
- package/dist/chapter.d.ts +2 -1
- package/dist/chat.d.ts +14 -13
- package/dist/checkbox.d.ts +2 -1
- package/dist/chip-link.d.ts +2 -1
- package/dist/chip-row.d.ts +8 -7
- package/dist/chip.d.ts +55 -1
- package/dist/chip.js +10 -1
- package/dist/choice-grid.d.ts +3 -2
- package/dist/chunk-27AWSJTK.js +46 -0
- package/dist/chunk-27AWSJTK.js.map +1 -0
- package/dist/{chunk-AEP3K4YD.js → chunk-4GQH27IT.js} +2 -2
- package/dist/{chunk-QWKCNSPF.js → chunk-5LANVCK7.js} +125 -73
- package/dist/chunk-5LANVCK7.js.map +1 -0
- package/dist/{chunk-KDXRYUD3.js → chunk-5QEXOGO2.js} +3 -1
- package/dist/{chunk-KDXRYUD3.js.map → chunk-5QEXOGO2.js.map} +1 -1
- package/dist/chunk-7J2L4HOD.js +340 -0
- package/dist/chunk-7J2L4HOD.js.map +1 -0
- package/dist/{chunk-7U5TXA5Q.js → chunk-BQ4EOR2O.js} +74 -2
- package/dist/chunk-BQ4EOR2O.js.map +1 -0
- package/dist/chunk-F6JTHPHE.js +399 -0
- package/dist/chunk-F6JTHPHE.js.map +1 -0
- package/dist/chunk-OGWB76BR.js +90 -0
- package/dist/chunk-OGWB76BR.js.map +1 -0
- package/dist/{chunk-VIPSZXO4.js → chunk-UYGUSYIC.js} +72 -2
- package/dist/chunk-UYGUSYIC.js.map +1 -0
- package/dist/chunk-WOZP3JLW.js +51 -0
- package/dist/chunk-WOZP3JLW.js.map +1 -0
- package/dist/chunk-XVXFMVG3.js +27 -0
- package/dist/chunk-XVXFMVG3.js.map +1 -0
- package/dist/code-block.d.ts +2 -1
- package/dist/combobox.d.ts +20 -19
- package/dist/combobox.js +3 -2
- package/dist/command.d.ts +21 -20
- package/dist/comparison-table.d.ts +2 -1
- package/dist/component-page.d.ts +2 -1
- package/dist/confirm-button.d.ts +2 -1
- package/dist/contact-page.d.ts +2 -1
- package/dist/continue-prompt.d.ts +2 -1
- package/dist/countdown.d.ts +2 -1
- package/dist/cover-hero.d.ts +20 -19
- package/dist/cover-hero.js +25 -42
- package/dist/cover-hero.js.map +1 -1
- package/dist/cta-panel.d.ts +2 -1
- package/dist/dashboard-layout.d.ts +50 -2
- package/dist/dashboard-layout.js +66 -11
- package/dist/dashboard-layout.js.map +1 -1
- package/dist/data-table.d.ts +45 -2
- package/dist/data-table.js +7 -3
- package/dist/date-picker.d.ts +29 -28
- package/dist/decision-list.d.ts +2 -1
- package/dist/description-list.d.ts +2 -1
- package/dist/detail-layout.d.ts +153 -20
- package/dist/detail-layout.js +73 -4
- package/dist/detail-layout.js.map +1 -1
- package/dist/{dialog-D42QwYb_.d.ts → dialog-DpUwec2g.d.ts} +2 -1
- package/dist/dialog.d.ts +3 -2
- package/dist/docs-article-page.d.ts +2 -1
- package/dist/docs-hub-page.d.ts +2 -1
- package/dist/docs-layout.d.ts +2 -1
- package/dist/docs-nav.d.ts +3 -10
- package/dist/document-viewer.d.ts +5 -4
- package/dist/doodle.d.ts +17 -6
- package/dist/doodle.js +40 -9
- package/dist/doodle.js.map +1 -1
- package/dist/drop-overlay.d.ts +2 -1
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +13 -74
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/elephant.d.ts +2 -1
- package/dist/empty-state.d.ts +2 -1
- package/dist/engine-flow.d.ts +2 -1
- package/dist/error-page.d.ts +2 -1
- package/dist/file-upload.d.ts +14 -13
- package/dist/filter-bar.d.ts +84 -11
- package/dist/filter-bar.js +6 -2
- package/dist/flock.d.ts +3 -2
- package/dist/footnote.d.ts +2 -1
- package/dist/force-update-screen.d.ts +8 -7
- package/dist/form/server.d.ts +2 -1
- package/dist/form.d.ts +2 -1
- package/dist/gallery-page.d.ts +2 -1
- package/dist/genui.d.ts +2 -1
- package/dist/genui.js +3 -3
- package/dist/{geometry-DX-W-Yyf.d.ts → geometry-DZ4Q3hDQ.d.ts} +2 -1
- package/dist/glossary-term.d.ts +2 -1
- package/dist/glossary.d.ts +2 -1
- package/dist/glow-card.d.ts +2 -1
- package/dist/goal-gauge.d.ts +2 -1
- package/dist/grade-stamp.d.ts +23 -0
- package/dist/grade-stamp.js +42 -0
- package/dist/grade-stamp.js.map +1 -0
- package/dist/how-it-works-page.d.ts +2 -1
- package/dist/image-cropper.d.ts +5 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -4
- package/dist/iso.d.ts +2 -1
- package/dist/kanban.d.ts +2 -1
- package/dist/kbd.d.ts +2 -1
- package/dist/kind-config-editor.d.ts +152 -0
- package/dist/kind-config-editor.js +574 -0
- package/dist/kind-config-editor.js.map +1 -0
- package/dist/kpi-explained.d.ts +2 -1
- package/dist/landing-page.d.ts +2 -1
- package/dist/landscape.d.ts +2 -1
- package/dist/language-switch/server.d.ts +2 -1
- package/dist/language-switch.d.ts +11 -10
- package/dist/legal-page.d.ts +2 -1
- package/dist/link-card.d.ts +2 -1
- package/dist/list.d.ts +2 -1
- package/dist/loader.d.ts +2 -1
- package/dist/longform-page.d.ts +2 -1
- package/dist/maintenance-screen.d.ts +5 -4
- package/dist/map.d.ts +8 -7
- package/dist/map.js +24 -0
- package/dist/map.js.map +1 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/marketing-layout.d.ts +5 -4
- package/dist/marquee.d.ts +2 -1
- package/dist/mascot-quote.d.ts +2 -1
- package/dist/mascot-state.d.ts +3 -2
- package/dist/mascots.d.ts +4 -3
- package/dist/match-dialog.d.ts +2 -1
- package/dist/media-capture.d.ts +5 -4
- package/dist/media-gallery.d.ts +2 -1
- package/dist/media-grid.d.ts +3 -10
- package/dist/meta-row.d.ts +2 -1
- package/dist/meter.d.ts +2 -1
- package/dist/motion.d.ts +3 -2
- package/dist/native/form.d.ts +2 -1
- package/dist/native/list.d.ts +2 -1
- package/dist/native/map.d.ts +2 -1
- package/dist/native/map.js +24 -0
- package/dist/native/map.js.map +1 -1
- package/dist/native/markdown.d.ts +2 -1
- package/dist/native/media-capture.d.ts +2 -1
- package/dist/native/media-picker.d.ts +2 -1
- package/dist/native/vertical-video.d.ts +2 -1
- package/dist/native/video-player.d.ts +2 -1
- package/dist/native.d.ts +230 -1
- package/dist/native.js +1465 -965
- package/dist/native.js.map +1 -1
- package/dist/nav-bar/me.d.ts +2 -1
- package/dist/nav-bar.d.ts +2 -1
- package/dist/next-actions.d.ts +2 -1
- package/dist/notification-preferences.d.ts +23 -22
- package/dist/notification-preferences.js +4 -3
- package/dist/notification-preferences.js.map +1 -1
- package/dist/number-ticker.d.ts +2 -1
- package/dist/opening-hours.d.ts +2 -1
- package/dist/page-header.d.ts +2 -1
- package/dist/page-hero.d.ts +2 -1
- package/dist/page-index.d.ts +2 -1
- package/dist/page.d.ts +2 -1
- package/dist/pagination.d.ts +2 -1
- package/dist/photo-grid.d.ts +2 -1
- package/dist/pointer-light.d.ts +2 -1
- package/dist/popover.d.ts +2 -1
- package/dist/pricing-page.d.ts +2 -1
- package/dist/product-page.d.ts +2 -1
- package/dist/profile-card.d.ts +2 -1
- package/dist/progress.d.ts +2 -1
- package/dist/promise-card.d.ts +2 -1
- package/dist/quota-meter.d.ts +2 -1
- package/dist/radio-group.d.ts +2 -1
- package/dist/radio-group.js +3 -3
- package/dist/rail-nav.d.ts +17 -16
- package/dist/rail-nav.js +22 -56
- package/dist/rail-nav.js.map +1 -1
- package/dist/recipes.d.ts +2 -1
- package/dist/retro-tv.d.ts +2 -1
- package/dist/router.d.ts +2 -1
- package/dist/scroll-stage.d.ts +2 -1
- package/dist/search-field.d.ts +2 -1
- package/dist/section-backdrop.d.ts +2 -1
- package/dist/separator.d.ts +2 -1
- package/dist/service-card.d.ts +9 -8
- package/dist/settings-layout.d.ts +2 -1
- package/dist/settings-layout.js +10 -324
- package/dist/settings-layout.js.map +1 -1
- package/dist/showcase.d.ts +2 -1
- package/dist/signature.d.ts +2 -1
- package/dist/site-cahier.d.ts +187 -0
- package/dist/site-cahier.js +844 -0
- package/dist/site-cahier.js.map +1 -0
- package/dist/site-footer.d.ts +2 -1
- package/dist/sites.d.ts +2 -1
- package/dist/skeleton.d.ts +2 -1
- package/dist/skip-link.d.ts +2 -1
- package/dist/slider.d.ts +2 -1
- package/dist/slot-picker.d.ts +86 -13
- package/dist/slot-picker.js +98 -16
- package/dist/slot-picker.js.map +1 -1
- package/dist/specimen-tag.d.ts +2 -1
- package/dist/speed-lines.d.ts +19 -0
- package/dist/speed-lines.js +45 -0
- package/dist/speed-lines.js.map +1 -0
- package/dist/spinner.d.ts +2 -1
- package/dist/split-view.d.ts +2 -1
- package/dist/stage-banner.d.ts +2 -1
- package/dist/stat.d.ts +2 -1
- package/dist/status-chip.d.ts +44 -0
- package/dist/status-chip.js +137 -0
- package/dist/status-chip.js.map +1 -0
- package/dist/status-page.d.ts +2 -1
- package/dist/step-progress.d.ts +2 -1
- package/dist/step-showcase.d.ts +2 -1
- package/dist/stepper.d.ts +2 -1
- package/dist/sticky-action.d.ts +28 -5
- package/dist/sticky-action.js +10 -4
- package/dist/sticky-action.js.map +1 -1
- package/dist/stuck.d.ts +2 -1
- package/dist/swipe-deck.d.ts +2 -1
- package/dist/switch.d.ts +2 -1
- package/dist/tabs.d.ts +2 -1
- package/dist/tag-input.d.ts +2 -1
- package/dist/tag-input.js +3 -2
- package/dist/tag-input.js.map +1 -1
- package/dist/tag-selector.d.ts +30 -4
- package/dist/tag-selector.js +90 -8
- package/dist/tag-selector.js.map +1 -1
- package/dist/taped-photo.d.ts +2 -1
- package/dist/taped-photo.js +3 -20
- package/dist/taped-photo.js.map +1 -1
- package/dist/terminal-replay.d.ts +2 -1
- package/dist/terminal-replay.js +1 -1
- package/dist/text-style/server.d.ts +2 -1
- package/dist/text-style.d.ts +2 -1
- package/dist/theme.d.ts +21 -1
- package/dist/theme.js +37 -1
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts +2 -1
- package/dist/toc.d.ts +2 -1
- package/dist/tooltip.d.ts +2 -1
- package/dist/tree-view.d.ts +2 -1
- package/dist/update-prompt.d.ts +11 -10
- package/dist/upload-queue.d.ts +2 -1
- package/dist/verified-badge.d.ts +2 -1
- package/dist/versus-card.d.ts +40 -0
- package/dist/versus-card.js +40 -0
- package/dist/versus-card.js.map +1 -0
- package/dist/vertical-video.d.ts +2 -1
- package/dist/video-player.d.ts +20 -19
- package/dist/video-trimmer.d.ts +2 -1
- package/dist/virtual.d.ts +8 -7
- package/dist/waveform.d.ts +2 -1
- package/package.json +124 -39
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +257 -5
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +116 -6
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +386 -11
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +91 -5
- package/registry/data-table.json +156 -5
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +199 -5
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +115 -22
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/account-settings/appearance.d.ts +4 -0
- package/registry/examples/account-settings/appearance.js +40 -0
- package/registry/examples/account-settings/appearance.tsx +30 -0
- package/registry/examples/catalogue-page/clients.d.ts +4 -0
- package/registry/examples/catalogue-page/clients.js +49 -0
- package/registry/examples/catalogue-page/clients.tsx +61 -0
- package/registry/examples/chip/marker-picker.d.ts +4 -0
- package/registry/examples/chip/marker-picker.js +17 -0
- package/registry/examples/chip/marker-picker.tsx +17 -0
- package/registry/examples/chip/native/marker-picker.d.ts +4 -0
- package/registry/examples/chip/native/marker-picker.dark.png +0 -0
- package/registry/examples/chip/native/marker-picker.js +18 -0
- package/registry/examples/chip/native/marker-picker.light.png +0 -0
- package/registry/examples/chip/native/marker-picker.tsx +16 -0
- package/registry/examples/chip/native/tags.d.ts +4 -0
- package/registry/examples/chip/native/tags.dark.png +0 -0
- package/registry/examples/chip/native/tags.js +22 -0
- package/registry/examples/chip/native/tags.light.png +0 -0
- package/registry/examples/chip/native/tags.tsx +20 -0
- package/registry/examples/chip/tags.d.ts +4 -0
- package/registry/examples/chip/tags.js +26 -0
- package/registry/examples/chip/tags.tsx +23 -0
- package/registry/examples/dashboard-layout/today.d.ts +4 -0
- package/registry/examples/dashboard-layout/today.js +54 -0
- package/registry/examples/dashboard-layout/today.tsx +63 -0
- package/registry/examples/data-table/bulk.d.ts +4 -0
- package/registry/examples/data-table/bulk.js +45 -0
- package/registry/examples/data-table/bulk.tsx +34 -0
- package/registry/examples/detail-layout/client.d.ts +4 -0
- package/registry/examples/detail-layout/client.js +40 -0
- package/registry/examples/detail-layout/client.tsx +39 -0
- package/registry/examples/detail-layout/new-invoice.d.ts +4 -0
- package/registry/examples/detail-layout/new-invoice.js +44 -0
- package/registry/examples/detail-layout/new-invoice.tsx +34 -0
- package/registry/examples/doodle/bird-sketch.d.ts +4 -0
- package/registry/examples/doodle/bird-sketch.js +11 -0
- package/registry/examples/doodle/bird-sketch.tsx +12 -0
- package/registry/examples/doodle/margin-marks.d.ts +4 -0
- package/registry/examples/doodle/margin-marks.js +27 -0
- package/registry/examples/doodle/margin-marks.tsx +19 -0
- package/registry/examples/filter-bar/views.d.ts +4 -0
- package/registry/examples/filter-bar/views.js +39 -0
- package/registry/examples/filter-bar/views.tsx +30 -0
- package/registry/examples/grade-stamp/coverage.d.ts +4 -0
- package/registry/examples/grade-stamp/coverage.js +12 -0
- package/registry/examples/grade-stamp/coverage.tsx +8 -0
- package/registry/examples/grade-stamp/lighthouse.d.ts +4 -0
- package/registry/examples/grade-stamp/lighthouse.js +12 -0
- package/registry/examples/grade-stamp/lighthouse.tsx +14 -0
- package/registry/examples/kind-config-editor/derived.d.ts +4 -0
- package/registry/examples/kind-config-editor/derived.js +26 -0
- package/registry/examples/kind-config-editor/derived.tsx +16 -0
- package/registry/examples/kind-config-editor/native/status-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/native/status-set.dark.png +0 -0
- package/registry/examples/kind-config-editor/native/status-set.js +22 -0
- package/registry/examples/kind-config-editor/native/status-set.light.png +0 -0
- package/registry/examples/kind-config-editor/native/status-set.tsx +19 -0
- package/registry/examples/kind-config-editor/native/tag-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/native/tag-set.dark.png +0 -0
- package/registry/examples/kind-config-editor/native/tag-set.js +20 -0
- package/registry/examples/kind-config-editor/native/tag-set.light.png +0 -0
- package/registry/examples/kind-config-editor/native/tag-set.tsx +18 -0
- package/registry/examples/kind-config-editor/status-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/status-set.js +29 -0
- package/registry/examples/kind-config-editor/status-set.tsx +25 -0
- package/registry/examples/kind-config-editor/tag-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/tag-set.js +20 -0
- package/registry/examples/kind-config-editor/tag-set.tsx +18 -0
- package/registry/examples/site-cahier/java-releases.d.ts +4 -0
- package/registry/examples/site-cahier/java-releases.js +33 -0
- package/registry/examples/site-cahier/java-releases.tsx +32 -0
- package/registry/examples/site-cahier/motion-lab.d.ts +4 -0
- package/registry/examples/site-cahier/motion-lab.js +32 -0
- package/registry/examples/site-cahier/motion-lab.tsx +29 -0
- package/registry/examples/site-cahier/ts-changelog.d.ts +4 -0
- package/registry/examples/site-cahier/ts-changelog.js +24 -0
- package/registry/examples/site-cahier/ts-changelog.tsx +20 -0
- package/registry/examples/site-cahier/ts-doc.d.ts +4 -0
- package/registry/examples/site-cahier/ts-doc.js +38 -0
- package/registry/examples/site-cahier/ts-doc.tsx +27 -0
- package/registry/examples/site-cahier/ui-home.d.ts +4 -0
- package/registry/examples/site-cahier/ui-home.js +46 -0
- package/registry/examples/site-cahier/ui-home.tsx +40 -0
- package/registry/examples/slot-picker/weeks.d.ts +4 -0
- package/registry/examples/slot-picker/weeks.js +45 -0
- package/registry/examples/slot-picker/weeks.tsx +28 -0
- package/registry/examples/speed-lines/hero.d.ts +4 -0
- package/registry/examples/speed-lines/hero.js +11 -0
- package/registry/examples/speed-lines/hero.tsx +12 -0
- package/registry/examples/speed-lines/streaks.d.ts +4 -0
- package/registry/examples/speed-lines/streaks.js +11 -0
- package/registry/examples/speed-lines/streaks.tsx +12 -0
- package/registry/examples/status-chip/default.d.ts +4 -0
- package/registry/examples/status-chip/default.js +35 -0
- package/registry/examples/status-chip/default.tsx +32 -0
- package/registry/examples/status-chip/native/default.d.ts +4 -0
- package/registry/examples/status-chip/native/default.dark.png +0 -0
- package/registry/examples/status-chip/native/default.js +26 -0
- package/registry/examples/status-chip/native/default.light.png +0 -0
- package/registry/examples/status-chip/native/default.tsx +20 -0
- package/registry/examples/tag-selector/creatable.d.ts +4 -0
- package/registry/examples/tag-selector/creatable.js +41 -0
- package/registry/examples/tag-selector/creatable.tsx +29 -0
- package/registry/examples/tag-selector/native/tags.d.ts +4 -0
- package/registry/examples/tag-selector/native/tags.dark.png +0 -0
- package/registry/examples/tag-selector/native/tags.js +19 -0
- package/registry/examples/tag-selector/native/tags.light.png +0 -0
- package/registry/examples/tag-selector/native/tags.tsx +19 -0
- package/registry/examples/versus-card/alternatives.d.ts +4 -0
- package/registry/examples/versus-card/alternatives.js +20 -0
- package/registry/examples/versus-card/alternatives.tsx +14 -0
- package/registry/examples/versus-card/releases.d.ts +4 -0
- package/registry/examples/versus-card/releases.js +35 -0
- package/registry/examples/versus-card/releases.tsx +29 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +208 -8
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +227 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +323 -30
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +565 -0
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/router.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +548 -0
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +156 -10
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +174 -0
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +350 -0
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +38 -8
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +189 -12
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +3 -3
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +194 -0
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +2 -2
- package/registry/waveform.json +1 -1
- package/dist/chunk-7U5TXA5Q.js.map +0 -1
- package/dist/chunk-OIMXKRXF.js +0 -179
- package/dist/chunk-OIMXKRXF.js.map +0 -1
- package/dist/chunk-QWKCNSPF.js.map +0 -1
- package/dist/chunk-VIPSZXO4.js.map +0 -1
- /package/dist/{chunk-AEP3K4YD.js.map → chunk-4GQH27IT.js.map} +0 -0
package/dist/cover-hero.js
CHANGED
|
@@ -1,36 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
Page
|
|
4
|
+
} from "./chunk-WOZP3JLW.js";
|
|
5
5
|
import {
|
|
6
6
|
ArrowGlyph
|
|
7
7
|
} from "./chunk-P7GZR5CU.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
BlockLink
|
|
10
|
+
} from "./chunk-ENOS6ETI.js";
|
|
11
|
+
import "./chunk-WU4VLSEA.js";
|
|
11
12
|
|
|
12
13
|
// src/cover-hero/cover-hero.tsx
|
|
13
|
-
import * as React2 from "react";
|
|
14
|
-
import { tv } from "tailwind-variants";
|
|
15
|
-
|
|
16
|
-
// src/page/page.tsx
|
|
17
14
|
import * as React from "react";
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
Tag,
|
|
22
|
-
{
|
|
23
|
-
"data-size": size === "default" ? void 0 : size,
|
|
24
|
-
"data-paper": paper,
|
|
25
|
-
"data-margin": margin ? "" : void 0,
|
|
26
|
-
className: cn("kz-frame", className),
|
|
27
|
-
...props
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// src/cover-hero/cover-hero.tsx
|
|
33
|
-
import { Fragment as Fragment3, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
15
|
+
import { tv } from "tailwind-variants";
|
|
16
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
34
17
|
var coverHero = tv({
|
|
35
18
|
slots: {
|
|
36
19
|
root: "relative isolate flex min-h-[26rem] items-end overflow-hidden bg-surface-1 text-fg data-[cover]:text-fg-on-media sm:min-h-[30rem] lg:min-h-[34rem]",
|
|
@@ -48,8 +31,8 @@ var coverHero = tv({
|
|
|
48
31
|
});
|
|
49
32
|
var s = coverHero();
|
|
50
33
|
function usePlayLoop(enabled) {
|
|
51
|
-
const [play, setPlay] =
|
|
52
|
-
|
|
34
|
+
const [play, setPlay] = React.useState(false);
|
|
35
|
+
React.useEffect(() => {
|
|
53
36
|
if (!enabled) return;
|
|
54
37
|
const q = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
55
38
|
const sync = () => setPlay(!q.matches);
|
|
@@ -61,26 +44,26 @@ function usePlayLoop(enabled) {
|
|
|
61
44
|
}
|
|
62
45
|
function CoverHero({ cover, eyebrow, title, lead, facts, actions, back, linkAs, className, ...props }) {
|
|
63
46
|
const play = usePlayLoop(Boolean(cover?.video));
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
cover ? /* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
play && cover.video && /* @__PURE__ */
|
|
68
|
-
cover.video.webm && /* @__PURE__ */
|
|
69
|
-
cover.video.mp4 && /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ jsxs("header", { "data-cover": cover ? "" : void 0, className: s.root({ className }), ...props, children: [
|
|
48
|
+
cover ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
+
/* @__PURE__ */ jsx("img", { src: cover.src, alt: cover.alt ?? "", className: s.media(), fetchPriority: "high", decoding: "async" }),
|
|
50
|
+
play && cover.video && /* @__PURE__ */ jsxs("video", { className: s.media(), poster: cover.src, autoPlay: true, muted: true, loop: true, playsInline: true, preload: "metadata", "aria-hidden": true, tabIndex: -1, children: [
|
|
51
|
+
cover.video.webm && /* @__PURE__ */ jsx("source", { src: cover.video.webm, type: "video/webm" }),
|
|
52
|
+
cover.video.mp4 && /* @__PURE__ */ jsx("source", { src: cover.video.mp4, type: "video/mp4" })
|
|
70
53
|
] }),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
] }) : /* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
back && /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": true, className: s.veil() })
|
|
55
|
+
] }) : /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: s.plain() }),
|
|
56
|
+
/* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsxs("div", { className: s.body(), children: [
|
|
57
|
+
back && /* @__PURE__ */ jsxs(BlockLink, { href: back.href, linkAs, className: s.back(), children: [
|
|
58
|
+
/* @__PURE__ */ jsx(ArrowGlyph, { direction: "left", className: "h-3.5 w-3.5" }),
|
|
76
59
|
" ",
|
|
77
60
|
back.label
|
|
78
61
|
] }),
|
|
79
|
-
eyebrow && /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
lead && /* @__PURE__ */
|
|
82
|
-
facts && /* @__PURE__ */
|
|
83
|
-
actions && /* @__PURE__ */
|
|
62
|
+
eyebrow && /* @__PURE__ */ jsx("p", { className: s.eyebrow(), children: eyebrow }),
|
|
63
|
+
/* @__PURE__ */ jsx("h1", { className: s.title(), children: title }),
|
|
64
|
+
lead && /* @__PURE__ */ jsx("p", { className: s.lead(), children: lead }),
|
|
65
|
+
facts && /* @__PURE__ */ jsx("div", { className: s.facts(), children: facts }),
|
|
66
|
+
actions && /* @__PURE__ */ jsx("div", { className: s.actions(), children: actions })
|
|
84
67
|
] }) })
|
|
85
68
|
] });
|
|
86
69
|
}
|
package/dist/cover-hero.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cover-hero/cover-hero.tsx","../src/page/page.tsx"],"sourcesContent":["// Client (the reader's motion preference). The first screen of a shop or a place: its cover — a photo, or a muted loop that\n// stays a still under reduced motion — behind the name, a one-line promise, a few facts and the main action. The words sit\n// on a veil that reads in both themes; without a cover the brand's colours take its place.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { ArrowGlyph } from \"../glyphs\";\nimport { Page } from \"../page/page\";\n\nexport const coverHero = tv({\n slots: {\n root: \"relative isolate flex min-h-[26rem] items-end overflow-hidden bg-surface-1 text-fg data-[cover]:text-fg-on-media sm:min-h-[30rem] lg:min-h-[34rem]\",\n media: \"absolute inset-0 -z-20 h-full w-full object-cover\",\n veil: \"absolute inset-0 -z-10 bg-linear-to-t from-scrim-strong via-scrim/55 to-scrim/10\",\n plain: \"absolute inset-0 -z-10 bg-linear-to-br from-accent/25 via-surface-1 to-accent-2/20\",\n body: \"flex flex-col gap-4 pb-8 pt-24 sm:pb-12\",\n back: \"inline-flex w-fit items-center gap-1.5 text-sm font-semibold text-current no-underline opacity-90 hover:opacity-100\",\n eyebrow: \"m-0 font-mono text-xs font-semibold opacity-90\",\n title: \"m-0 max-w-3xl font-display text-4xl font-black leading-[1.05] tracking-tight sm:text-5xl lg:text-6xl\",\n lead: \"m-0 max-w-2xl text-base leading-relaxed opacity-95 sm:text-lg\",\n facts: \"flex flex-wrap items-center gap-2\",\n actions: \"flex flex-wrap items-center gap-3 pt-1\",\n },\n});\nconst s = coverHero();\n\nexport type CoverMedia = {\n /** The still: the photo, or the poster of the loop (shown first, and alone under reduced motion). */\n src: string;\n /** What it shows, in words; empty when it only decorates. */\n alt?: string;\n /** A muted loop over the still: WebM first, MP4 for Safari. */\n video?: { webm?: string; mp4?: string };\n};\n\nexport type CoverHeroProps = Omit<React.ComponentProps<\"header\">, \"title\"> & {\n /** The cover. Without it the hero wears the brand's colours. */\n cover?: CoverMedia;\n /** A short mono line above the name (where the shop is: `Saint-Henri · Montréal`). */\n eyebrow?: React.ReactNode;\n /** The name: the page's `h1`. */\n title: React.ReactNode;\n /** One line: what it promises. */\n lead?: React.ReactNode;\n /** Chips under the lead: open now, the neighbourhood, a rating — only what is true. */\n facts?: React.ReactNode;\n /** The main action (`ButtonLink`). */\n actions?: React.ReactNode;\n /** The way back, above the eyebrow. */\n back?: { href: string; label: string };\n /** The app's link component for the back link. */\n linkAs?: LinkComponent;\n};\n\nfunction usePlayLoop(enabled: boolean) {\n const [play, setPlay] = React.useState(false);\n React.useEffect(() => {\n if (!enabled) return;\n const q = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const sync = () => setPlay(!q.matches);\n sync();\n q.addEventListener(\"change\", sync);\n return () => q.removeEventListener(\"change\", sync);\n }, [enabled]);\n return play;\n}\n\n/** A shop's first screen: the cover, the name, the promise, the facts and the main action. */\nexport function CoverHero({ cover, eyebrow, title, lead, facts, actions, back, linkAs, className, ...props }: CoverHeroProps) {\n const play = usePlayLoop(Boolean(cover?.video));\n return (\n <header data-cover={cover ? \"\" : undefined} className={s.root({ className })} {...props}>\n {cover ? (\n <>\n <img src={cover.src} alt={cover.alt ?? \"\"} className={s.media()} fetchPriority=\"high\" decoding=\"async\" />\n {play && cover.video && (\n <video className={s.media()} poster={cover.src} autoPlay muted loop playsInline preload=\"metadata\" aria-hidden tabIndex={-1}>\n {cover.video.webm && <source src={cover.video.webm} type=\"video/webm\" />}\n {cover.video.mp4 && <source src={cover.video.mp4} type=\"video/mp4\" />}\n </video>\n )}\n <div aria-hidden className={s.veil()} />\n </>\n ) : (\n <div aria-hidden className={s.plain()} />\n )}\n <Page>\n <div className={s.body()}>\n {back && (\n <BlockLink href={back.href} linkAs={linkAs} className={s.back()}>\n <ArrowGlyph direction=\"left\" className=\"h-3.5 w-3.5\" /> {back.label}\n </BlockLink>\n )}\n {eyebrow && <p className={s.eyebrow()}>{eyebrow}</p>}\n <h1 className={s.title()}>{title}</h1>\n {lead && <p className={s.lead()}>{lead}</p>}\n {facts && <div className={s.facts()}>{facts}</div>}\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n </Page>\n </header>\n );\n}\n","// Server-safe. The frame of every page (blocks.css): one width, one pair of gutters, one vertical rhythm — so the\n// navigation, the hero and every section line up on the same edges, at any width.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { SectionBackdrop, type SectionBackdropProps } from \"../section-backdrop/section-backdrop\";\n\nexport type PageSize = \"narrow\" | \"default\" | \"wide\" | \"full\";\n\n/** The paper under a page or a section (Cahier, ADR-004): `ruled` (Seyès squares), `lines` (lines only), or plain. */\nexport type PagePaper = \"ruled\" | \"lines\";\n\ntype PaperProps = {\n /** The notebook's ruling under the content: `ruled` (Seyès: 32 px squares, three fine lines), `lines` (lines only, a page to read). */\n paper?: PagePaper;\n /** The red margin line on the left, where section numbers and notes hang (`§ 2`, `fig. 1`). */\n margin?: boolean;\n};\n\nexport type PageProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The width of the content: `default` (72rem, `--kz-page-max`), `narrow` (48rem, a reading column), `wide`\n * (88rem, documentation with a sidebar), `full` (the gutters only).\n * @default \"default\"\n */\n size?: PageSize;\n /** The element: `div` (default), `main`, `header`, `footer`, `section` or `article`. */\n as?: \"div\" | \"main\" | \"header\" | \"footer\" | \"section\" | \"article\";\n} & PaperProps;\n\n/** The page frame: centred, at most `--kz-page-max` wide, with the gutters of `--kz-page-gutter` (16 → 32 px). */\nexport function Page({ size = \"default\", as: Tag = \"div\", paper, margin, className, ...props }: PageProps) {\n return (\n <Tag\n data-size={size === \"default\" ? undefined : size}\n data-paper={paper}\n data-margin={margin ? \"\" : undefined}\n className={cn(\"kz-frame\", className)}\n {...props}\n />\n );\n}\n\nexport type SectionHeadingProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> & {\n /** The id of the title: the section's anchor and its accessible name. */\n id?: string;\n /** A short note above the title (the section's subject), in the note face, lower case — never an uppercase overline. */\n eyebrow?: React.ReactNode;\n /** The section's number, hung in the margin as a notebook numbers its pages (`§ 2`). */\n number?: React.ReactNode;\n /** The title. */\n title: React.ReactNode;\n /** One or two sentences under the title. */\n lead?: React.ReactNode;\n /** Actions on the right of the heading (a link to everything, a filter). */\n actions?: React.ReactNode;\n /**\n * The level of the title.\n * @default 2\n */\n level?: 2 | 3;\n /**\n * `md` for a section that argues, `sm` for a section of a reading page.\n * @default \"md\"\n */\n size?: \"sm\" | \"md\";\n /**\n * `center` for a heading that stands alone above a grid.\n * @default \"start\"\n */\n align?: \"start\" | \"center\";\n /** Rises into place once, as it enters the viewport (`[data-reveal]`, MotionObserver). Never on the first screen. */\n reveal?: boolean;\n};\n\n/** The head of a section: eyebrow (mono, the accent), title, lead — and its actions on the right. */\nexport function SectionHeading({ id, eyebrow, number, title, lead, actions, level = 2, size = \"md\", align = \"start\", reveal, className, ...props }: SectionHeadingProps) {\n const H = level === 2 ? \"h2\" : \"h3\";\n return (\n <div\n className={cn(\"kz-heading\", className)}\n data-size={size === \"md\" ? undefined : size}\n data-align={align === \"start\" ? undefined : align}\n data-actions={actions ? \"\" : undefined}\n data-reveal={reveal ? \"\" : undefined}\n {...props}\n >\n {number && <span className=\"kz-heading-number\">{number}</span>}\n {eyebrow && <p className=\"kz-eyebrow\">{eyebrow}</p>}\n <H id={id} className=\"kz-heading-title\">\n {title}\n </H>\n {lead && <p className=\"kz-heading-lead\">{lead}</p>}\n {actions && <div className=\"kz-heading-actions\">{actions}</div>}\n </div>\n );\n}\n\nexport type SectionProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The id of the title (and the anchor of the section). Required with a `title`. */\n id?: string;\n /** The heading's eyebrow. */\n eyebrow?: React.ReactNode;\n /** The section's number in the margin (`§ 2`). */\n number?: React.ReactNode;\n /** The section's title: an `h2` (a `SectionHeading`), which names the section for assistive technology. */\n title?: React.ReactNode;\n /** The heading's lead. */\n lead?: React.ReactNode;\n /** The heading's actions. */\n actions?: React.ReactNode;\n /**\n * The heading's size: `md` for a page that argues, `sm` for a reading page.\n * @default \"md\"\n */\n headingSize?: \"sm\" | \"md\";\n /**\n * The heading's alignment.\n * @default \"start\"\n */\n headingAlign?: \"start\" | \"center\";\n /** The heading rises into place once (never on the first screen). */\n reveal?: boolean;\n /** A hairline above the section, inside the gutters: the transition between two sections of the same surface. */\n divider?: boolean;\n /**\n * The vertical space above and below: `sm` (a reading page), `md`, `lg` (a page's main moments).\n * @default \"md\"\n */\n spacing?: \"sm\" | \"md\" | \"lg\";\n /**\n * The width of the content.\n * @default \"default\"\n */\n size?: PageSize;\n /** The brand's colour transition behind the section (SectionBackdrop): `true`, or its props (`direction`, `grid`…). */\n backdrop?: boolean | Omit<SectionBackdropProps, \"as\" | \"children\">;\n} & PaperProps;\n\n/**\n * A section of a page: full-bleed (its backdrop reaches the edges), its content in the page frame, its heading on top.\n * Sections follow each other on one rhythm; a `divider` or a `backdrop` marks the transition.\n */\nexport function Section({\n id,\n eyebrow,\n number,\n title,\n lead,\n actions,\n headingSize,\n headingAlign,\n reveal,\n divider,\n spacing = \"md\",\n size,\n backdrop,\n paper,\n margin,\n className,\n children,\n ...props\n}: SectionProps) {\n const body = (\n <Page size={size} data-margin={margin ? \"\" : undefined}>\n {title && <SectionHeading id={id} eyebrow={eyebrow} number={number} title={title} lead={lead} actions={actions} size={headingSize} align={headingAlign} reveal={reveal} />}\n {children}\n </Page>\n );\n const shared = {\n \"aria-labelledby\": title && id ? id : undefined,\n \"data-divider\": divider ? \"\" : undefined,\n \"data-spacing\": spacing === \"md\" ? undefined : spacing,\n \"data-paper\": paper,\n ...props,\n };\n if (backdrop) {\n const backdropProps = backdrop === true ? {} : backdrop;\n return (\n <SectionBackdrop {...backdropProps} {...shared} className={cn(\"kz-section\", className)}>\n {body}\n </SectionBackdrop>\n );\n }\n return (\n <section {...shared} className={cn(\"kz-section\", className)}>\n {body}\n </section>\n );\n}\n\nexport type TicksProps = {\n /** A sentence where words between backticks are code: \"Every request carries a `requestId`.\" */\n children: string;\n};\n\n/** A sentence of a message catalogue where words between backticks read as code — no markup in the translations. */\nexport function Ticks({ children }: TicksProps) {\n const parts = children.split(\"`\");\n return (\n <>\n {parts.map((part, i) =>\n i % 2 ? (\n <code key={i} className=\"kz-ic\">\n {part}\n </code>\n ) : (\n <React.Fragment key={i}>{part}</React.Fragment>\n ),\n )}\n </>\n );\n}\n\nexport interface Fact {\n /** A few words: `npm 2.5.0`, `Maven Central`, `in progress`. */\n label: string;\n /**\n * `ok` — published, usable today; `wip` — in progress, said honestly; `neutral` — a fact.\n * @default \"neutral\"\n */\n tone?: \"ok\" | \"wip\" | \"neutral\";\n /** Where the fact is proven (a registry page): the fact becomes a link. */\n href?: string;\n}\n\nexport type FactsProps = React.HTMLAttributes<HTMLUListElement> & {\n /** The facts, in reading order. */\n items: readonly Fact[];\n};\n\n/** Compact facts on one line — a dot that says the state, a few mono words. Links open in a new tab. */\nexport function Facts({ items, className, ...props }: FactsProps) {\n return (\n <ul className={cn(\"kz-facts\", className)} {...props}>\n {items.map((fact) => {\n const body = (\n <>\n <span className=\"kz-fact-dot\" aria-hidden /> {fact.label}\n </>\n );\n const tone = fact.tone && fact.tone !== \"neutral\" ? fact.tone : undefined;\n return (\n <li key={fact.label}>\n {fact.href ? (\n <a href={fact.href} target=\"_blank\" rel=\"noopener noreferrer\" className=\"kz-fact\" data-tone={tone}>\n {body}\n </a>\n ) : (\n <span className=\"kz-fact\" data-tone={tone}>\n {body}\n </span>\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAGA,YAAYA,YAAW;AACvB,SAAS,UAAU;;;ACFnB,YAAY,WAA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A,MAC3C,WAAW,gBAAAA,KAAC,SAAI,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,OACpD,GACF;AAAA,KACF;AAEJ;","names":["React","Fragment","Fragment","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../src/cover-hero/cover-hero.tsx"],"sourcesContent":["// Client (the reader's motion preference). The first screen of a shop or a place: its cover — a photo, or a muted loop that\n// stays a still under reduced motion — behind the name, a one-line promise, a few facts and the main action. The words sit\n// on a veil that reads in both themes; without a cover the brand's colours take its place.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { ArrowGlyph } from \"../glyphs\";\nimport { Page } from \"../page/page\";\n\nexport const coverHero = tv({\n slots: {\n root: \"relative isolate flex min-h-[26rem] items-end overflow-hidden bg-surface-1 text-fg data-[cover]:text-fg-on-media sm:min-h-[30rem] lg:min-h-[34rem]\",\n media: \"absolute inset-0 -z-20 h-full w-full object-cover\",\n veil: \"absolute inset-0 -z-10 bg-linear-to-t from-scrim-strong via-scrim/55 to-scrim/10\",\n plain: \"absolute inset-0 -z-10 bg-linear-to-br from-accent/25 via-surface-1 to-accent-2/20\",\n body: \"flex flex-col gap-4 pb-8 pt-24 sm:pb-12\",\n back: \"inline-flex w-fit items-center gap-1.5 text-sm font-semibold text-current no-underline opacity-90 hover:opacity-100\",\n eyebrow: \"m-0 font-mono text-xs font-semibold opacity-90\",\n title: \"m-0 max-w-3xl font-display text-4xl font-black leading-[1.05] tracking-tight sm:text-5xl lg:text-6xl\",\n lead: \"m-0 max-w-2xl text-base leading-relaxed opacity-95 sm:text-lg\",\n facts: \"flex flex-wrap items-center gap-2\",\n actions: \"flex flex-wrap items-center gap-3 pt-1\",\n },\n});\nconst s = coverHero();\n\nexport type CoverMedia = {\n /** The still: the photo, or the poster of the loop (shown first, and alone under reduced motion). */\n src: string;\n /** What it shows, in words; empty when it only decorates. */\n alt?: string;\n /** A muted loop over the still: WebM first, MP4 for Safari. */\n video?: { webm?: string; mp4?: string };\n};\n\nexport type CoverHeroProps = Omit<React.ComponentProps<\"header\">, \"title\"> & {\n /** The cover. Without it the hero wears the brand's colours. */\n cover?: CoverMedia;\n /** A short mono line above the name (where the shop is: `Saint-Henri · Montréal`). */\n eyebrow?: React.ReactNode;\n /** The name: the page's `h1`. */\n title: React.ReactNode;\n /** One line: what it promises. */\n lead?: React.ReactNode;\n /** Chips under the lead: open now, the neighbourhood, a rating — only what is true. */\n facts?: React.ReactNode;\n /** The main action (`ButtonLink`). */\n actions?: React.ReactNode;\n /** The way back, above the eyebrow. */\n back?: { href: string; label: string };\n /** The app's link component for the back link. */\n linkAs?: LinkComponent;\n};\n\nfunction usePlayLoop(enabled: boolean) {\n const [play, setPlay] = React.useState(false);\n React.useEffect(() => {\n if (!enabled) return;\n const q = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const sync = () => setPlay(!q.matches);\n sync();\n q.addEventListener(\"change\", sync);\n return () => q.removeEventListener(\"change\", sync);\n }, [enabled]);\n return play;\n}\n\n/** A shop's first screen: the cover, the name, the promise, the facts and the main action. */\nexport function CoverHero({ cover, eyebrow, title, lead, facts, actions, back, linkAs, className, ...props }: CoverHeroProps) {\n const play = usePlayLoop(Boolean(cover?.video));\n return (\n <header data-cover={cover ? \"\" : undefined} className={s.root({ className })} {...props}>\n {cover ? (\n <>\n <img src={cover.src} alt={cover.alt ?? \"\"} className={s.media()} fetchPriority=\"high\" decoding=\"async\" />\n {play && cover.video && (\n <video className={s.media()} poster={cover.src} autoPlay muted loop playsInline preload=\"metadata\" aria-hidden tabIndex={-1}>\n {cover.video.webm && <source src={cover.video.webm} type=\"video/webm\" />}\n {cover.video.mp4 && <source src={cover.video.mp4} type=\"video/mp4\" />}\n </video>\n )}\n <div aria-hidden className={s.veil()} />\n </>\n ) : (\n <div aria-hidden className={s.plain()} />\n )}\n <Page>\n <div className={s.body()}>\n {back && (\n <BlockLink href={back.href} linkAs={linkAs} className={s.back()}>\n <ArrowGlyph direction=\"left\" className=\"h-3.5 w-3.5\" /> {back.label}\n </BlockLink>\n )}\n {eyebrow && <p className={s.eyebrow()}>{eyebrow}</p>}\n <h1 className={s.title()}>{title}</h1>\n {lead && <p className={s.lead()}>{lead}</p>}\n {facts && <div className={s.facts()}>{facts}</div>}\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n </Page>\n </header>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAsEX,mBACE,KAEE,YAHJ;AAhED,IAAM,YAAY,GAAG;AAAA,EAC1B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AACF,CAAC;AACD,IAAM,IAAI,UAAU;AA8BpB,SAAS,YAAY,SAAkB;AACrC,QAAM,CAAC,MAAM,OAAO,IAAU,eAAS,KAAK;AAC5C,EAAM,gBAAU,MAAM;AACpB,QAAI,CAAC,QAAS;AACd,UAAM,IAAI,OAAO,WAAW,kCAAkC;AAC9D,UAAM,OAAO,MAAM,QAAQ,CAAC,EAAE,OAAO;AACrC,SAAK;AACL,MAAE,iBAAiB,UAAU,IAAI;AACjC,WAAO,MAAM,EAAE,oBAAoB,UAAU,IAAI;AAAA,EACnD,GAAG,CAAC,OAAO,CAAC;AACZ,SAAO;AACT;AAGO,SAAS,UAAU,EAAE,OAAO,SAAS,OAAO,MAAM,OAAO,SAAS,MAAM,QAAQ,WAAW,GAAG,MAAM,GAAmB;AAC5H,QAAM,OAAO,YAAY,QAAQ,OAAO,KAAK,CAAC;AAC9C,SACE,qBAAC,YAAO,cAAY,QAAQ,KAAK,QAAW,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAC/E;AAAA,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omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
|
20
20
|
/** A call to act: title, why, the actions — the closing panel of a section or a page. */
|
|
21
21
|
declare function CtaPanel({ id, title, body, children, level, reveal, className, ...props }: CtaPanelProps): React.JSX.Element;
|
|
22
22
|
|
|
23
|
-
export { CtaPanel
|
|
23
|
+
export { CtaPanel };
|
|
24
|
+
export type { CtaPanelProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { L as LinkComponent } from './block-link-BAg4eoZk.js';
|
|
3
4
|
|
|
4
5
|
declare const dashboardLayout: tailwind_variants.TVReturnType<{
|
|
5
6
|
span: {
|
|
@@ -23,6 +24,15 @@ declare const dashboardLayout: tailwind_variants.TVReturnType<{
|
|
|
23
24
|
eyebrow: string;
|
|
24
25
|
title: string;
|
|
25
26
|
description: string;
|
|
27
|
+
side: string;
|
|
28
|
+
right: string;
|
|
29
|
+
date: string;
|
|
30
|
+
quick: string;
|
|
31
|
+
tile: string;
|
|
32
|
+
tileIcon: string;
|
|
33
|
+
tileText: string;
|
|
34
|
+
tileLabel: string;
|
|
35
|
+
tileHint: string;
|
|
26
36
|
actions: string;
|
|
27
37
|
toolbar: string;
|
|
28
38
|
grid: string;
|
|
@@ -53,6 +63,15 @@ declare const dashboardLayout: tailwind_variants.TVReturnType<{
|
|
|
53
63
|
eyebrow: string;
|
|
54
64
|
title: string;
|
|
55
65
|
description: string;
|
|
66
|
+
side: string;
|
|
67
|
+
right: string;
|
|
68
|
+
date: string;
|
|
69
|
+
quick: string;
|
|
70
|
+
tile: string;
|
|
71
|
+
tileIcon: string;
|
|
72
|
+
tileText: string;
|
|
73
|
+
tileLabel: string;
|
|
74
|
+
tileHint: string;
|
|
56
75
|
actions: string;
|
|
57
76
|
toolbar: string;
|
|
58
77
|
grid: string;
|
|
@@ -83,6 +102,15 @@ declare const dashboardLayout: tailwind_variants.TVReturnType<{
|
|
|
83
102
|
eyebrow: string;
|
|
84
103
|
title: string;
|
|
85
104
|
description: string;
|
|
105
|
+
side: string;
|
|
106
|
+
right: string;
|
|
107
|
+
date: string;
|
|
108
|
+
quick: string;
|
|
109
|
+
tile: string;
|
|
110
|
+
tileIcon: string;
|
|
111
|
+
tileText: string;
|
|
112
|
+
tileLabel: string;
|
|
113
|
+
tileHint: string;
|
|
86
114
|
actions: string;
|
|
87
115
|
toolbar: string;
|
|
88
116
|
grid: string;
|
|
@@ -108,11 +136,30 @@ type DashboardLayoutProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
|
108
136
|
* @default "h1"
|
|
109
137
|
*/
|
|
110
138
|
headingAs?: "h1" | "h2";
|
|
139
|
+
/** Today's date, in words, formatted by the app with `@krizaka/intl`: on the right of the heading; under the title on a phone. */
|
|
140
|
+
date?: React.ReactNode;
|
|
141
|
+
/** Two to four tiles under the heading: where the person goes most (new invoice, new client…). */
|
|
142
|
+
quickActions?: readonly QuickAction[];
|
|
143
|
+
/** Names the quick actions' navigation (`Quick access`). Required with `quickActions`. */
|
|
144
|
+
quickActionsLabel?: string;
|
|
145
|
+
/** The app's link component for the quick actions. */
|
|
146
|
+
linkAs?: LinkComponent;
|
|
147
|
+
/** A side column (the period panel, `NextActions`, a notes list) beside the widgets from `lg`; under them on a phone. */
|
|
148
|
+
side?: React.ReactNode;
|
|
111
149
|
/** The widgets (`Widget`), in reading order. */
|
|
112
150
|
children: React.ReactNode;
|
|
113
151
|
};
|
|
152
|
+
/** A tile of the quick-access row: an icon, a name, one line, a way in. */
|
|
153
|
+
type QuickAction = {
|
|
154
|
+
id: string;
|
|
155
|
+
label: string;
|
|
156
|
+
/** One line under the name. */
|
|
157
|
+
hint?: string;
|
|
158
|
+
icon?: React.ReactNode;
|
|
159
|
+
href: string;
|
|
160
|
+
};
|
|
114
161
|
/** A dashboard screen: heading, actions, filters, then the grid of widgets. */
|
|
115
|
-
declare function DashboardLayout({ title, eyebrow, description, actions, toolbar, headingAs: H, className, children, ...props }: DashboardLayoutProps): React.JSX.Element;
|
|
162
|
+
declare function DashboardLayout({ title, eyebrow, description, actions, toolbar, date, quickActions, quickActionsLabel, linkAs, side, headingAs: H, className, children, ...props }: DashboardLayoutProps): React.JSX.Element;
|
|
116
163
|
type WidgetProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
117
164
|
/** The widget's title: it names the region. */
|
|
118
165
|
title: React.ReactNode;
|
|
@@ -136,4 +183,5 @@ type WidgetProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
|
136
183
|
/** A widget of the dashboard: a titled region on a card. */
|
|
137
184
|
declare function Widget({ title, description, action, span, level, className, children, id, ...props }: WidgetProps): React.JSX.Element;
|
|
138
185
|
|
|
139
|
-
export { DashboardLayout,
|
|
186
|
+
export { DashboardLayout, Widget, dashboardLayout };
|
|
187
|
+
export type { DashboardLayoutProps, QuickAction, WidgetProps };
|
package/dist/dashboard-layout.js
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
// src/dashboard-layout/dashboard-layout.tsx
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { tv } from "tailwind-variants";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
// src/block-link.tsx
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var isExternal = (href) => /^[a-z][a-z0-9+.-]*:/i.test(href);
|
|
8
|
+
function BlockLink({
|
|
9
|
+
href,
|
|
10
|
+
linkAs: Link = "a",
|
|
11
|
+
external = isExternal(href),
|
|
12
|
+
rel,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
if (external) return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: rel ?? "noopener noreferrer", ...props });
|
|
16
|
+
const Comp = Link;
|
|
17
|
+
return /* @__PURE__ */ jsx(Comp, { href, rel, ...props });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/dashboard-layout/dashboard-layout.tsx
|
|
21
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
5
22
|
var dashboardLayout = tv({
|
|
6
23
|
slots: {
|
|
7
24
|
root: "flex w-full flex-col gap-6",
|
|
@@ -10,6 +27,15 @@ var dashboardLayout = tv({
|
|
|
10
27
|
eyebrow: "font-mono text-[11px] font-semibold text-fg-accent",
|
|
11
28
|
title: "font-display text-2xl font-extrabold tracking-tight text-fg sm:text-[1.75rem]",
|
|
12
29
|
description: "max-w-2xl text-sm text-fg-secondary",
|
|
30
|
+
side: "flex min-w-0 flex-col gap-4",
|
|
31
|
+
right: "flex shrink-0 flex-col gap-2 sm:items-end",
|
|
32
|
+
date: "m-0 text-sm font-medium tabular-nums text-fg-secondary sm:text-right",
|
|
33
|
+
quick: "m-0 grid list-none grid-cols-2 gap-2 p-0 lg:grid-cols-4",
|
|
34
|
+
tile: "flex h-full min-h-14 min-w-0 items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3 text-fg no-underline transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
35
|
+
tileIcon: "grid size-9 shrink-0 place-items-center rounded-lg bg-accent-soft text-fg-accent [&>svg]:size-5",
|
|
36
|
+
tileText: "flex min-w-0 flex-col leading-tight",
|
|
37
|
+
tileLabel: "text-sm font-semibold",
|
|
38
|
+
tileHint: "text-xs text-fg-secondary",
|
|
13
39
|
actions: "flex shrink-0 flex-wrap items-center gap-2",
|
|
14
40
|
toolbar: "flex flex-wrap items-center gap-2",
|
|
15
41
|
grid: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
@@ -30,18 +56,47 @@ var dashboardLayout = tv({
|
|
|
30
56
|
defaultVariants: { span: 1 }
|
|
31
57
|
});
|
|
32
58
|
var s = dashboardLayout();
|
|
33
|
-
function DashboardLayout({
|
|
59
|
+
function DashboardLayout({
|
|
60
|
+
title,
|
|
61
|
+
eyebrow,
|
|
62
|
+
description,
|
|
63
|
+
actions,
|
|
64
|
+
toolbar,
|
|
65
|
+
date,
|
|
66
|
+
quickActions,
|
|
67
|
+
quickActionsLabel,
|
|
68
|
+
linkAs,
|
|
69
|
+
side,
|
|
70
|
+
headingAs: H = "h1",
|
|
71
|
+
className,
|
|
72
|
+
children,
|
|
73
|
+
...props
|
|
74
|
+
}) {
|
|
75
|
+
const grid = /* @__PURE__ */ jsx2("div", { className: s.grid(), children });
|
|
34
76
|
return /* @__PURE__ */ jsxs("div", { className: s.root({ className }), ...props, children: [
|
|
35
77
|
/* @__PURE__ */ jsxs("div", { className: s.head(), children: [
|
|
36
78
|
/* @__PURE__ */ jsxs("div", { className: s.text(), children: [
|
|
37
|
-
eyebrow && /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
description && /* @__PURE__ */
|
|
79
|
+
eyebrow && /* @__PURE__ */ jsx2("p", { className: s.eyebrow(), children: eyebrow }),
|
|
80
|
+
/* @__PURE__ */ jsx2(H, { className: s.title(), children: title }),
|
|
81
|
+
description && /* @__PURE__ */ jsx2("p", { className: s.description(), children: description })
|
|
40
82
|
] }),
|
|
41
|
-
actions && /* @__PURE__ */
|
|
83
|
+
(date || actions) && /* @__PURE__ */ jsxs("div", { className: s.right(), children: [
|
|
84
|
+
date && /* @__PURE__ */ jsx2("p", { className: s.date(), children: date }),
|
|
85
|
+
actions && /* @__PURE__ */ jsx2("div", { className: s.actions(), children: actions })
|
|
86
|
+
] })
|
|
42
87
|
] }),
|
|
43
|
-
toolbar && /* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
88
|
+
toolbar && /* @__PURE__ */ jsx2("div", { className: s.toolbar(), children: toolbar }),
|
|
89
|
+
quickActions && quickActions.length > 0 && /* @__PURE__ */ jsx2("nav", { "aria-label": quickActionsLabel, children: /* @__PURE__ */ jsx2("ul", { className: s.quick(), children: quickActions.slice(0, 4).map((q) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs(BlockLink, { href: q.href, linkAs, className: s.tile(), children: [
|
|
90
|
+
q.icon && /* @__PURE__ */ jsx2("span", { className: s.tileIcon(), "aria-hidden": "true", children: q.icon }),
|
|
91
|
+
/* @__PURE__ */ jsxs("span", { className: s.tileText(), children: [
|
|
92
|
+
/* @__PURE__ */ jsx2("span", { className: s.tileLabel(), children: q.label }),
|
|
93
|
+
q.hint && /* @__PURE__ */ jsx2("span", { className: s.tileHint(), children: q.hint })
|
|
94
|
+
] })
|
|
95
|
+
] }) }, q.id)) }) }),
|
|
96
|
+
side ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]", children: [
|
|
97
|
+
grid,
|
|
98
|
+
/* @__PURE__ */ jsx2("aside", { className: s.side(), children: side })
|
|
99
|
+
] }) : grid
|
|
45
100
|
] });
|
|
46
101
|
}
|
|
47
102
|
function Widget({ title, description, action, span = 1, level = 2, className, children, id, ...props }) {
|
|
@@ -52,12 +107,12 @@ function Widget({ title, description, action, span = 1, level = 2, className, ch
|
|
|
52
107
|
return /* @__PURE__ */ jsxs("section", { className: sv.widget({ className }), "aria-labelledby": titleId, id, ...props, children: [
|
|
53
108
|
/* @__PURE__ */ jsxs("div", { className: s.widgetHead(), children: [
|
|
54
109
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
description && /* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ jsx2(H, { id: titleId, className: s.widgetTitle(), children: title }),
|
|
111
|
+
description && /* @__PURE__ */ jsx2("p", { className: s.widgetDescription(), children: description })
|
|
57
112
|
] }),
|
|
58
113
|
action
|
|
59
114
|
] }),
|
|
60
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ jsx2("div", { className: s.widgetBody(), children })
|
|
61
116
|
] });
|
|
62
117
|
}
|
|
63
118
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dashboard-layout/dashboard-layout.tsx"],"sourcesContent":["// Server-safe. A dashboard, read from the products' home screens (Orochia's creator studio, Orazaka's console for\n// Eric): the screen's heading with its actions and filters, then a responsive grid of widgets — one column on a phone,\n// two from `sm`, four from `xl`; a widget spans 1, 2, 3 columns or the full row, and keeps its order everywhere.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const dashboardLayout = tv({\n slots: {\n root: \"flex w-full flex-col gap-6\",\n head: \"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\",\n text: \"flex min-w-0 flex-col gap-1\",\n eyebrow: \"font-mono text-[11px] font-semibold text-fg-accent\",\n title: \"font-display text-2xl font-extrabold tracking-tight text-fg sm:text-[1.75rem]\",\n description: \"max-w-2xl text-sm text-fg-secondary\",\n actions: \"flex shrink-0 flex-wrap items-center gap-2\",\n toolbar: \"flex flex-wrap items-center gap-2\",\n grid: \"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\",\n widget: \"flex min-w-0 flex-col gap-3 rounded-xl border border-border-default bg-surface-1 p-4 sm:p-5\",\n widgetHead: \"flex items-start justify-between gap-3\",\n widgetTitle: \"text-sm font-semibold text-fg\",\n widgetDescription: \"mt-0.5 text-xs text-fg-secondary\",\n widgetBody: \"min-w-0 flex-1\",\n },\n variants: {\n span: {\n 1: { widget: \"\" },\n 2: { widget: \"sm:col-span-2\" },\n 3: { widget: \"sm:col-span-2 xl:col-span-3\" },\n full: { widget: \"sm:col-span-2 xl:col-span-4\" },\n },\n },\n defaultVariants: { span: 1 },\n});\nconst s = dashboardLayout();\n\nexport type DashboardLayoutProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The screen's title: `Good morning, Eric`. */\n title: React.ReactNode;\n /** A mono line above it (the workspace, the date). */\n eyebrow?: React.ReactNode;\n /** One sentence under it. */\n description?: React.ReactNode;\n /** The screen's actions (a primary Button, a DropdownMenu). */\n actions?: React.ReactNode;\n /** Under the heading: the period, the filters (Segmented tabs, a DateRangePicker, a FilterBar). */\n toolbar?: React.ReactNode;\n /**\n * The heading's level: `h1` when the dashboard is the screen, `h2` inside an AppShell whose header holds the h1.\n * @default \"h1\"\n */\n headingAs?: \"h1\" | \"h2\";\n /** The widgets (`Widget`), in reading order. */\n children: React.ReactNode;\n};\n\n/** A dashboard screen: heading, actions, filters, then the grid of widgets. */\nexport function DashboardLayout({ title, eyebrow, description, actions, toolbar, headingAs: H = \"h1\", className, children, ...props }: DashboardLayoutProps) {\n return (\n <div className={s.root({ className })} {...props}>\n <div className={s.head()}>\n <div className={s.text()}>\n {eyebrow && <p className={s.eyebrow()}>{eyebrow}</p>}\n <H className={s.title()}>{title}</H>\n {description && <p className={s.description()}>{description}</p>}\n </div>\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n {toolbar && <div className={s.toolbar()}>{toolbar}</div>}\n <div className={s.grid()}>{children}</div>\n </div>\n );\n}\n\nexport type WidgetProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** The widget's title: it names the region. */\n title: React.ReactNode;\n /** One line under the title (the period, the source). */\n description?: React.ReactNode;\n /** An action on the right of the title (`See all`). */\n action?: React.ReactNode;\n /**\n * The columns it takes: 1, 2, 3 or the full row (from `sm`; one column on a phone).\n * @default 1\n */\n span?: 1 | 2 | 3 | \"full\";\n /**\n * The title's level: one under the dashboard's heading — `2` under an `h1`, `3` inside an AppShell (`headingAs=\"h2\"`).\n * @default 2\n */\n level?: 2 | 3;\n /** The content: a Stat, a chart of @krizaka/charts, a DataTable, a list. */\n children: React.ReactNode;\n};\n\n/** A widget of the dashboard: a titled region on a card. */\nexport function Widget({ title, description, action, span = 1, level = 2, className, children, id, ...props }: WidgetProps) {\n const H = level === 2 ? \"h2\" : \"h3\";\n const sv = dashboardLayout({ span });\n const auto = React.useId();\n const titleId = `${id ?? auto}-title`;\n return (\n <section className={sv.widget({ className })} aria-labelledby={titleId} id={id} {...props}>\n <div className={s.widgetHead()}>\n <div className=\"min-w-0\">\n <H id={titleId} className={s.widgetTitle()}>\n {title}\n </H>\n {description && <p className={s.widgetDescription()}>{description}</p>}\n </div>\n {action}\n </div>\n <div className={s.widgetBody()}>{children}</div>\n </section>\n );\n}\n"],"mappings":";AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAwDX,SACc,KADd;AAtDD,IAAM,kBAAkB,GAAG;AAAA,EAChC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,IACP,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,YAAY;AAAA,EACd;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,GAAG,EAAE,QAAQ,GAAG;AAAA,MAChB,GAAG,EAAE,QAAQ,gBAAgB;AAAA,MAC7B,GAAG,EAAE,QAAQ,8BAA8B;AAAA,MAC3C,MAAM,EAAE,QAAQ,8BAA8B;AAAA,IAChD;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,MAAM,EAAE;AAC7B,CAAC;AACD,IAAM,IAAI,gBAAgB;AAuBnB,SAAS,gBAAgB,EAAE,OAAO,SAAS,aAAa,SAAS,SAAS,WAAW,IAAI,MAAM,WAAW,UAAU,GAAG,MAAM,GAAyB;AAC3J,SACE,qBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACzC;AAAA,yBAAC,SAAI,WAAW,EAAE,KAAK,GACrB;AAAA,2BAAC,SAAI,WAAW,EAAE,KAAK,GACpB;AAAA,mBAAW,oBAAC,OAAE,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,QAChD,oBAAC,KAAE,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,QAC/B,eAAe,oBAAC,OAAE,WAAW,EAAE,YAAY,GAAI,uBAAY;AAAA,SAC9D;AAAA,MACC,WAAW,oBAAC,SAAI,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,OACpD;AAAA,IACC,WAAW,oBAAC,SAAI,WAAW,EAAE,QAAQ,GAAI,mBAAQ;AAAA,IAClD,oBAAC,SAAI,WAAW,EAAE,KAAK,GAAI,UAAS;AAAA,KACtC;AAEJ;AAwBO,SAAS,OAAO,EAAE,OAAO,aAAa,QAAQ,OAAO,GAAG,QAAQ,GAAG,WAAW,UAAU,IAAI,GAAG,MAAM,GAAgB;AAC1H,QAAM,IAAI,UAAU,IAAI,OAAO;AAC/B,QAAM,KAAK,gBAAgB,EAAE,KAAK,CAAC;AACnC,QAAM,OAAa,YAAM;AACzB,QAAM,UAAU,GAAG,MAAM,IAAI;AAC7B,SACE,qBAAC,aAAQ,WAAW,GAAG,OAAO,EAAE,UAAU,CAAC,GAAG,mBAAiB,SAAS,IAAS,GAAG,OAClF;AAAA,yBAAC,SAAI,WAAW,EAAE,WAAW,GAC3B;AAAA,2BAAC,SAAI,WAAU,WACb;AAAA,4BAAC,KAAE,IAAI,SAAS,WAAW,EAAE,YAAY,GACtC,iBACH;AAAA,QACC,eAAe,oBAAC,OAAE,WAAW,EAAE,kBAAkB,GAAI,uBAAY;AAAA,SACpE;AAAA,MACC;AAAA,OACH;AAAA,IACA,oBAAC,SAAI,WAAW,EAAE,WAAW,GAAI,UAAS;AAAA,KAC5C;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/dashboard-layout/dashboard-layout.tsx","../src/block-link.tsx"],"sourcesContent":["// Server-safe. A dashboard, read from the products' home screens (Orochia's creator studio, Orazaka's console for\n// Eric): the screen's heading with its actions and filters, then a responsive grid of widgets — one column on a phone,\n// two from `sm`, four from `xl`; a widget spans 1, 2, 3 columns or the full row, and keeps its order everywhere.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\n\nexport const dashboardLayout = tv({\n slots: {\n root: \"flex w-full flex-col gap-6\",\n head: \"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\",\n text: \"flex min-w-0 flex-col gap-1\",\n eyebrow: \"font-mono text-[11px] font-semibold text-fg-accent\",\n title: \"font-display text-2xl font-extrabold tracking-tight text-fg sm:text-[1.75rem]\",\n description: \"max-w-2xl text-sm text-fg-secondary\",\n side: \"flex min-w-0 flex-col gap-4\",\n right: \"flex shrink-0 flex-col gap-2 sm:items-end\",\n date: \"m-0 text-sm font-medium tabular-nums text-fg-secondary sm:text-right\",\n quick: \"m-0 grid list-none grid-cols-2 gap-2 p-0 lg:grid-cols-4\",\n tile:\n \"flex h-full min-h-14 min-w-0 items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3 text-fg no-underline transition-colors \" +\n \"hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n tileIcon: \"grid size-9 shrink-0 place-items-center rounded-lg bg-accent-soft text-fg-accent [&>svg]:size-5\",\n tileText: \"flex min-w-0 flex-col leading-tight\",\n tileLabel: \"text-sm font-semibold\",\n tileHint: \"text-xs text-fg-secondary\",\n actions: \"flex shrink-0 flex-wrap items-center gap-2\",\n toolbar: \"flex flex-wrap items-center gap-2\",\n grid: \"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\",\n widget: \"flex min-w-0 flex-col gap-3 rounded-xl border border-border-default bg-surface-1 p-4 sm:p-5\",\n widgetHead: \"flex items-start justify-between gap-3\",\n widgetTitle: \"text-sm font-semibold text-fg\",\n widgetDescription: \"mt-0.5 text-xs text-fg-secondary\",\n widgetBody: \"min-w-0 flex-1\",\n },\n variants: {\n span: {\n 1: { widget: \"\" },\n 2: { widget: \"sm:col-span-2\" },\n 3: { widget: \"sm:col-span-2 xl:col-span-3\" },\n full: { widget: \"sm:col-span-2 xl:col-span-4\" },\n },\n },\n defaultVariants: { span: 1 },\n});\nconst s = dashboardLayout();\n\nexport type DashboardLayoutProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The screen's title: `Good morning, Eric`. */\n title: React.ReactNode;\n /** A mono line above it (the workspace, the date). */\n eyebrow?: React.ReactNode;\n /** One sentence under it. */\n description?: React.ReactNode;\n /** The screen's actions (a primary Button, a DropdownMenu). */\n actions?: React.ReactNode;\n /** Under the heading: the period, the filters (Segmented tabs, a DateRangePicker, a FilterBar). */\n toolbar?: React.ReactNode;\n /**\n * The heading's level: `h1` when the dashboard is the screen, `h2` inside an AppShell whose header holds the h1.\n * @default \"h1\"\n */\n headingAs?: \"h1\" | \"h2\";\n /** Today's date, in words, formatted by the app with `@krizaka/intl`: on the right of the heading; under the title on a phone. */\n date?: React.ReactNode;\n /** Two to four tiles under the heading: where the person goes most (new invoice, new client…). */\n quickActions?: readonly QuickAction[];\n /** Names the quick actions' navigation (`Quick access`). Required with `quickActions`. */\n quickActionsLabel?: string;\n /** The app's link component for the quick actions. */\n linkAs?: LinkComponent;\n /** A side column (the period panel, `NextActions`, a notes list) beside the widgets from `lg`; under them on a phone. */\n side?: React.ReactNode;\n /** The widgets (`Widget`), in reading order. */\n children: React.ReactNode;\n};\n\n/** A tile of the quick-access row: an icon, a name, one line, a way in. */\nexport type QuickAction = {\n id: string;\n label: string;\n /** One line under the name. */\n hint?: string;\n icon?: React.ReactNode;\n href: string;\n};\n\n/** A dashboard screen: heading, actions, filters, then the grid of widgets. */\nexport function DashboardLayout({\n title,\n eyebrow,\n description,\n actions,\n toolbar,\n date,\n quickActions,\n quickActionsLabel,\n linkAs,\n side,\n headingAs: H = \"h1\",\n className,\n children,\n ...props\n}: DashboardLayoutProps) {\n const grid = <div className={s.grid()}>{children}</div>;\n return (\n <div className={s.root({ className })} {...props}>\n <div className={s.head()}>\n <div className={s.text()}>\n {eyebrow && <p className={s.eyebrow()}>{eyebrow}</p>}\n <H className={s.title()}>{title}</H>\n {description && <p className={s.description()}>{description}</p>}\n </div>\n {(date || actions) && (\n <div className={s.right()}>\n {date && <p className={s.date()}>{date}</p>}\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n )}\n </div>\n {toolbar && <div className={s.toolbar()}>{toolbar}</div>}\n {quickActions && quickActions.length > 0 && (\n <nav aria-label={quickActionsLabel}>\n <ul className={s.quick()}>\n {quickActions.slice(0, 4).map((q) => (\n <li key={q.id}>\n <BlockLink href={q.href} linkAs={linkAs} className={s.tile()}>\n {q.icon && (\n <span className={s.tileIcon()} aria-hidden=\"true\">\n {q.icon}\n </span>\n )}\n <span className={s.tileText()}>\n <span className={s.tileLabel()}>{q.label}</span>\n {q.hint && <span className={s.tileHint()}>{q.hint}</span>}\n </span>\n </BlockLink>\n </li>\n ))}\n </ul>\n </nav>\n )}\n {side ? (\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]\">\n {grid}\n <aside className={s.side()}>{side}</aside>\n </div>\n ) : (\n grid\n )}\n </div>\n );\n}\n\nexport type WidgetProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** The widget's title: it names the region. */\n title: React.ReactNode;\n /** One line under the title (the period, the source). */\n description?: React.ReactNode;\n /** An action on the right of the title (`See all`). */\n action?: React.ReactNode;\n /**\n * The columns it takes: 1, 2, 3 or the full row (from `sm`; one column on a phone).\n * @default 1\n */\n span?: 1 | 2 | 3 | \"full\";\n /**\n * The title's level: one under the dashboard's heading — `2` under an `h1`, `3` inside an AppShell (`headingAs=\"h2\"`).\n * @default 2\n */\n level?: 2 | 3;\n /** The content: a Stat, a chart of @krizaka/charts, a DataTable, a list. */\n children: React.ReactNode;\n};\n\n/** A widget of the dashboard: a titled region on a card. */\nexport function Widget({ title, description, action, span = 1, level = 2, className, children, id, ...props }: WidgetProps) {\n const H = level === 2 ? \"h2\" : \"h3\";\n const sv = dashboardLayout({ span });\n const auto = React.useId();\n const titleId = `${id ?? auto}-title`;\n return (\n <section className={sv.widget({ className })} aria-labelledby={titleId} id={id} {...props}>\n <div className={s.widgetHead()}>\n <div className=\"min-w-0\">\n <H id={titleId} className={s.widgetTitle()}>\n {title}\n </H>\n {description && <p className={s.widgetDescription()}>{description}</p>}\n </div>\n {action}\n </div>\n <div className={s.widgetBody()}>{children}</div>\n </section>\n );\n}\n","// The links of the page blocks (PageHero's back link, LinkCard, ArgumentCard, ActionBar): an internal path renders\n// through the app's router link (`linkAs`, e.g. Next's `Link`), anything else is an `<a>` that opens in a new tab.\n// Shared by the block entries; never exported on its own.\nimport type * as React from \"react\";\n\n/** The app's link component (Next's `Link`, React Router's `Link`…): receives `href`, `className` and the children. */\nexport type LinkComponent = React.ElementType<{ href: string; className?: string; children?: React.ReactNode; \"aria-label\"?: string; \"aria-describedby\"?: string }>;\n\n/** An address that leaves the app: an absolute URL or a protocol (`mailto:`). */\nexport const isExternal = (href: string) => /^[a-z][a-z0-9+.-]*:/i.test(href);\n\nexport function BlockLink({\n href,\n linkAs: Link = \"a\",\n external = isExternal(href),\n rel,\n ...props\n}: Omit<React.ComponentProps<\"a\">, \"href\"> & { href: string; linkAs?: LinkComponent; external?: boolean }) {\n if (external) return <a href={href} target=\"_blank\" rel={rel ?? \"noopener noreferrer\"} {...props} />;\n const Comp = Link as React.ElementType;\n return <Comp href={href} rel={rel} {...props} />;\n}\n"],"mappings":";AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;;;ACcI;AAThB,IAAM,aAAa,CAAC,SAAiB,uBAAuB,KAAK,IAAI;AAErE,SAAS,UAAU;AAAA,EACxB;AAAA,EACA,QAAQ,OAAO;AAAA,EACf,WAAW,WAAW,IAAI;AAAA,EAC1B;AAAA,EACA,GAAG;AACL,GAA2G;AACzG,MAAI,SAAU,QAAO,oBAAC,OAAE,MAAY,QAAO,UAAS,KAAK,OAAO,uBAAwB,GAAG,OAAO;AAClG,QAAM,OAAO;AACb,SAAO,oBAAC,QAAK,MAAY,KAAW,GAAG,OAAO;AAChD;;;ADoFe,gBAAAA,MAIP,YAJO;AAjGR,IAAM,kBAAkB,GAAG;AAAA,EAChC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AA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AI,UAAU,IAAI,OAAO;AAC/B,QAAM,KAAK,gBAAgB,EAAE,KAAK,CAAC;AACnC,QAAM,OAAa,YAAM;AACzB,QAAM,UAAU,GAAG,MAAM,IAAI;AAC7B,SACE,qBAAC,aAAQ,WAAW,GAAG,OAAO,EAAE,UAAU,CAAC,GAAG,mBAAiB,SAAS,IAAS,GAAG,OAClF;AAAA,yBAAC,SAAI,WAAW,EAAE,WAAW,GAC3B;AAAA,2BAAC,SAAI,WAAU,WACb;AAAA,wBAAAA,KAAC,KAAE,IAAI,SAAS,WAAW,EAAE,YAAY,GACtC,iBACH;AAAA,QACC,eAAe,gBAAAA,KAAC,OAAE,WAAW,EAAE,kBAAkB,GAAI,uBAAY;AAAA,SACpE;AAAA,MACC;AAAA,OACH;AAAA,IACA,gBAAAA,KAAC,SAAI,WAAW,EAAE,WAAW,GAAI,UAAS;AAAA,KAC5C;AAEJ;","names":["jsx"]}
|
package/dist/data-table.d.ts
CHANGED
|
@@ -59,6 +59,34 @@ type PaginationLabels = {
|
|
|
59
59
|
pageSize: string;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
type SelectionBarLabels = {
|
|
63
|
+
/** The bar's accessible name ("Actions on the selection"). */
|
|
64
|
+
bar: string;
|
|
65
|
+
/** The count: `(n) => n + " selected"`. */
|
|
66
|
+
selected: (count: number) => string;
|
|
67
|
+
/** "Clear selection". */
|
|
68
|
+
clear: string;
|
|
69
|
+
/** Said when the selection is bigger than the service takes: `(max) => "At most " + max + " at a time"`. */
|
|
70
|
+
tooMany: (max: number) => string;
|
|
71
|
+
};
|
|
72
|
+
declare const selectionBarLabels: SelectionBarLabels;
|
|
73
|
+
type SelectionBarProps = Omit<React.ComponentProps<"div">, "children"> & {
|
|
74
|
+
/** How many rows are chosen. The bar is not drawn at 0. */
|
|
75
|
+
count: number;
|
|
76
|
+
/** The actions the product gives (`Button`s). They rest when the selection is over `max`. */
|
|
77
|
+
children?: React.ReactNode;
|
|
78
|
+
/** Clears the selection. */
|
|
79
|
+
onClear: () => void;
|
|
80
|
+
/** The most the service takes at a time (200 for `@krizaka/organize`): the bar says so past it. */
|
|
81
|
+
max?: number;
|
|
82
|
+
/** What the last bulk change did ("3 moved, 1 skipped — 1 has no right to this move"), announced politely. */
|
|
83
|
+
result?: string;
|
|
84
|
+
/** The words, passed translated (English by default). */
|
|
85
|
+
labels?: Partial<SelectionBarLabels>;
|
|
86
|
+
};
|
|
87
|
+
/** The count, the product's bulk actions, « Clear selection » and the result of the last change — sticky, docked on a phone. */
|
|
88
|
+
declare function SelectionBar({ count, children, onClear, max, result, labels: given, className, ...props }: SelectionBarProps): React.JSX.Element;
|
|
89
|
+
|
|
62
90
|
declare const dataTable: tailwind_variants.TVReturnType<{
|
|
63
91
|
layout: {
|
|
64
92
|
table: {
|
|
@@ -406,6 +434,8 @@ type DataTableLabels = {
|
|
|
406
434
|
export: string;
|
|
407
435
|
/** The words of the pagination under the table. */
|
|
408
436
|
pagination?: Partial<PaginationLabels>;
|
|
437
|
+
/** The words of the bar of a selection (`bulkActions`). */
|
|
438
|
+
selection?: Partial<SelectionBarLabels>;
|
|
409
439
|
};
|
|
410
440
|
declare const dataTableLabels: DataTableLabels;
|
|
411
441
|
type DataTableProps<T> = {
|
|
@@ -447,6 +477,18 @@ type DataTableProps<T> = {
|
|
|
447
477
|
onSelectedChange?: (selected: string[]) => void;
|
|
448
478
|
/** The name of a row in its labels (checkbox, expand button). Default: its id. */
|
|
449
479
|
rowLabel?: (row: T) => string;
|
|
480
|
+
/**
|
|
481
|
+
* The actions on the selection, given by the product: the bar (`SelectionBar`) appears under the table while rows are
|
|
482
|
+
* chosen — the count, these actions, « Clear selection » — sticky, docked above the tab bar on a phone. Needs `selectable`.
|
|
483
|
+
*/
|
|
484
|
+
bulkActions?: (selection: {
|
|
485
|
+
selected: string[];
|
|
486
|
+
clear: () => void;
|
|
487
|
+
}) => React.ReactNode;
|
|
488
|
+
/** The most rows a bulk call takes (200 for `@krizaka/organize`): the bar says so past it and its actions rest. */
|
|
489
|
+
bulkMax?: number;
|
|
490
|
+
/** What the last bulk change did ("3 moved, 1 skipped"), announced politely by the bar. */
|
|
491
|
+
bulkResult?: string;
|
|
450
492
|
/** The columns the rows are grouped by, in order (controlled) — each `groupable`. */
|
|
451
493
|
groupBy?: readonly string[];
|
|
452
494
|
/** The grouping at first, uncontrolled. */
|
|
@@ -567,7 +609,7 @@ declare function useDataTable<T extends RowData = object>(): Omit<Context, "tabl
|
|
|
567
609
|
exportRows: () => readonly T[];
|
|
568
610
|
};
|
|
569
611
|
/** A table of records — sort, filters and facets, groups, details, pages, selection, visibility, pinning, resizing — on the client or the server, cards on a phone, windowing for long lists. */
|
|
570
|
-
declare function DataTable<T extends RowData>({ rows, columns, getRowId, caption, showCaption, sort: sortProp, routeKey, defaultSort, onSortChange, filters: filtersProp, defaultFilters, onFiltersChange, selectable, selected: selectedProp, defaultSelected, onSelectedChange, rowLabel, groupBy: groupByProp, defaultGroupBy, onGroupByChange, columnVisibility: visibilityProp, defaultColumnVisibility, onColumnVisibilityChange, pinning, resizing, getSubRows, renderDetail, expanded: expandedProp, defaultExpanded, onExpandedChange, pageSize: pageSizeProp, defaultPageSize, onPageSizeChange, pageSizeOptions, page: pageProp, defaultPage, onPageChange, manual, rowCount, onStateChange, loading, loadingRows, error, empty, layout, phone, density, stickyHeader, striped, scroll, stickyFirstColumn, virtualized, toolbar, footer, labels: given, className, }: DataTableProps<T>): React.JSX.Element;
|
|
612
|
+
declare function DataTable<T extends RowData>({ rows, columns, getRowId, caption, showCaption, sort: sortProp, routeKey, defaultSort, onSortChange, filters: filtersProp, defaultFilters, onFiltersChange, selectable, selected: selectedProp, defaultSelected, onSelectedChange, rowLabel, bulkActions, bulkMax, bulkResult, groupBy: groupByProp, defaultGroupBy, onGroupByChange, columnVisibility: visibilityProp, defaultColumnVisibility, onColumnVisibilityChange, pinning, resizing, getSubRows, renderDetail, expanded: expandedProp, defaultExpanded, onExpandedChange, pageSize: pageSizeProp, defaultPageSize, onPageSizeChange, pageSizeOptions, page: pageProp, defaultPage, onPageChange, manual, rowCount, onStateChange, loading, loadingRows, error, empty, layout, phone, density, stickyHeader, striped, scroll, stickyFirstColumn, virtualized, toolbar, footer, labels: given, className, }: DataTableProps<T>): React.JSX.Element;
|
|
571
613
|
|
|
572
614
|
type RouteSort = {
|
|
573
615
|
column: string;
|
|
@@ -632,4 +674,5 @@ type DataTableExportProps = {
|
|
|
632
674
|
/** Downloads what the table shows — the filtered and sorted rows of every page, the visible columns — as CSV. */
|
|
633
675
|
declare function DataTableExport({ filename, onExport, className }: DataTableExportProps): React.JSX.Element;
|
|
634
676
|
|
|
635
|
-
export {
|
|
677
|
+
export { DataTable, DataTableColumnsMenu, DataTableExport, DataTableFilters, SelectionBar, compareValues, dataTable, dataTableCsv, dataTableLabels, decodeFilter, decodeSort, encodeFilter, encodeSort, readTable, selectionBarLabels, useDataTable, writeTable };
|
|
678
|
+
export type { CellValue, DataTableColumn, DataTableColumnsMenuProps, DataTableExportProps, DataTableFilterState, DataTableFiltersProps, DataTableInstance, DataTableLabels, DataTableProps, DataTableQuery, DataTableSort, FilterValue, RouteSort, SelectionBarLabels, SelectionBarProps, SortDirection };
|
package/dist/data-table.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
DataTableColumnsMenu,
|
|
5
5
|
DataTableExport,
|
|
6
6
|
DataTableFilters,
|
|
7
|
+
SelectionBar,
|
|
7
8
|
compareValues,
|
|
8
9
|
dataTable,
|
|
9
10
|
dataTableCsv,
|
|
@@ -13,15 +14,16 @@ import {
|
|
|
13
14
|
encodeFilter,
|
|
14
15
|
encodeSort,
|
|
15
16
|
readTable,
|
|
17
|
+
selectionBarLabels,
|
|
16
18
|
useDataTable,
|
|
17
19
|
writeTable
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5LANVCK7.js";
|
|
19
21
|
import "./chunk-3X3OF4TI.js";
|
|
20
22
|
import "./chunk-JXLDUDTD.js";
|
|
21
23
|
import "./chunk-3DHNN5V7.js";
|
|
22
24
|
import "./chunk-KVDB4GXV.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-F6JTHPHE.js";
|
|
26
|
+
import "./chunk-UYGUSYIC.js";
|
|
25
27
|
import "./chunk-D3T54RSL.js";
|
|
26
28
|
import "./chunk-J3NC6ER4.js";
|
|
27
29
|
import "./chunk-NSLXEDIS.js";
|
|
@@ -34,6 +36,7 @@ export {
|
|
|
34
36
|
DataTableColumnsMenu,
|
|
35
37
|
DataTableExport,
|
|
36
38
|
DataTableFilters,
|
|
39
|
+
SelectionBar,
|
|
37
40
|
compareValues,
|
|
38
41
|
dataTable,
|
|
39
42
|
dataTableCsv,
|
|
@@ -43,6 +46,7 @@ export {
|
|
|
43
46
|
encodeFilter,
|
|
44
47
|
encodeSort,
|
|
45
48
|
readTable,
|
|
49
|
+
selectionBarLabels,
|
|
46
50
|
useDataTable,
|
|
47
51
|
writeTable
|
|
48
52
|
};
|