@krizaka/ui 3.87.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -14
- package/dist/account-menu.d.ts +1 -1
- package/dist/account-menu.js +1 -1
- package/dist/account-settings.d.ts +1 -1
- package/dist/account-settings.js +1 -1
- package/dist/achievement.d.ts +2 -2
- package/dist/achievement.js +1 -1
- package/dist/achievement.js.map +1 -1
- package/dist/activity-feed.d.ts +4 -4
- package/dist/activity-feed.js +11 -5
- package/dist/activity-feed.js.map +1 -1
- package/dist/app-frame.d.ts +4 -4
- package/dist/app-frame.js.map +1 -1
- package/dist/app-header.d.ts +2 -2
- package/dist/app-header.js.map +1 -1
- package/dist/app-shell.d.ts +1 -1
- package/dist/app-shell.js +1 -1
- package/dist/app-shell.js.map +1 -1
- package/dist/auth-layout.d.ts +1 -1
- package/dist/auth-layout.js.map +1 -1
- package/dist/avatar/defaults.d.ts +2 -2
- package/dist/avatar/defaults.js +4 -4
- package/dist/avatar/defaults.js.map +1 -1
- package/dist/{avatar-CNV6ld8l.d.ts → avatar-Cd2uJgRh.d.ts} +2 -2
- package/dist/avatar.d.ts +3 -3
- package/dist/avatar.js +4 -4
- package/dist/avatar.js.map +1 -1
- package/dist/bird-plate.d.ts +1 -1
- package/dist/bird-plate.js +1 -1
- package/dist/blocks.css +5 -5
- package/dist/card-grid.d.ts +1 -1
- package/dist/card-grid.js.map +1 -1
- package/dist/changelog-page.d.ts +1 -1
- package/dist/changelog-page.js +18 -6
- package/dist/changelog-page.js.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/chip.js +1 -1
- package/dist/choice-grid.d.ts +2 -2
- package/dist/choice-grid.js +1 -1
- package/dist/choice-grid.js.map +1 -1
- package/dist/{chunk-RCHKIOVV.js → chunk-2DHL7NJW.js} +2 -2
- package/dist/chunk-2DHL7NJW.js.map +1 -0
- package/dist/{chunk-TN5JJ6JI.js → chunk-2YBG4ZCY.js} +23 -2
- package/dist/{chunk-TN5JJ6JI.js.map → chunk-2YBG4ZCY.js.map} +1 -1
- package/dist/{chunk-6KZDARNX.js → chunk-54WTUZWE.js} +16 -12
- package/dist/chunk-54WTUZWE.js.map +1 -0
- package/dist/{chunk-DSDFXPL6.js → chunk-757ZTGU5.js} +2 -2
- package/dist/chunk-CDNOT2KR.js +310 -0
- package/dist/chunk-CDNOT2KR.js.map +1 -0
- package/dist/{chunk-IOTY5HYG.js → chunk-EOWV6BNQ.js} +4 -4
- package/dist/chunk-EOWV6BNQ.js.map +1 -0
- package/dist/{chunk-DRTIE44Z.js → chunk-FM42KOAU.js} +2 -2
- package/dist/chunk-FM42KOAU.js.map +1 -0
- package/dist/{chunk-CEW3LQOZ.js → chunk-IEGTRCDI.js} +5 -5
- package/dist/{chunk-KVDB4GXV.js → chunk-KR2W4ONJ.js} +2 -2
- package/dist/{chunk-TPITVAUW.js → chunk-LH5J3VLZ.js} +1 -1
- package/dist/{chunk-TPITVAUW.js.map → chunk-LH5J3VLZ.js.map} +1 -1
- package/dist/{chunk-E46AEUPH.js → chunk-PK3L6WQT.js} +4 -4
- package/dist/chunk-PK3L6WQT.js.map +1 -0
- package/dist/{chunk-GOGEYAYK.js → chunk-PRD7JRQX.js} +3 -3
- package/dist/{chunk-VYZFQE3P.js → chunk-QD6SNXF5.js} +2 -2
- package/dist/{chunk-M3T5RQYV.js → chunk-SB5WSVPI.js} +1 -1
- package/dist/chunk-SB5WSVPI.js.map +1 -0
- package/dist/{chunk-UYGUSYIC.js → chunk-SNSQLGGS.js} +1 -1
- package/dist/{chunk-BQ4EOR2O.js.map → chunk-SNSQLGGS.js.map} +1 -1
- package/dist/{chunk-YQWYGQTV.js → chunk-UIP3WX5O.js} +2 -2
- package/dist/{chunk-EHTXLZSM.js → chunk-VS3MWRBX.js} +1 -1
- package/dist/{chunk-EHTXLZSM.js.map → chunk-VS3MWRBX.js.map} +1 -1
- package/dist/{chunk-BQ4EOR2O.js → chunk-XWJDBQU7.js} +1 -1
- package/dist/{chunk-UYGUSYIC.js.map → chunk-XWJDBQU7.js.map} +1 -1
- package/dist/{chunk-ZKKMYIDN.js → chunk-Y3P5B4XS.js} +2 -2
- package/dist/{chunk-GW5EI7MI.js → chunk-YXETEQQJ.js} +3 -3
- package/dist/{chunk-FZBWEDQI.js → chunk-ZSCNMFE6.js} +1 -1
- package/dist/{chunk-FZBWEDQI.js.map → chunk-ZSCNMFE6.js.map} +1 -1
- package/dist/collection-switcher.d.ts +1 -1
- package/dist/combobox.js +3 -3
- package/dist/continue-prompt.js +1 -1
- package/dist/dashboard-layout.js +1 -1
- package/dist/dashboard-layout.js.map +1 -1
- package/dist/data-table.js +6 -6
- package/dist/date-picker.js +1 -1
- package/dist/{default-avatar-Bh4atFDo.d.ts → default-avatar-DHv7g-K1.d.ts} +1 -1
- package/dist/detail-layout.js.map +1 -1
- package/dist/docs-hub-page.d.ts +1 -1
- package/dist/docs-hub-page.js.map +1 -1
- package/dist/document-viewer.js +1 -1
- package/dist/engine-flow.d.ts +6 -6
- package/dist/engine-flow.js.map +1 -1
- package/dist/entity-header.d.ts +1 -1
- package/dist/file-upload.js +1 -1
- package/dist/filter-bar.d.ts +3 -3
- package/dist/filter-bar.js +2 -2
- package/dist/flock.js +1 -1
- package/dist/{frame-CNZ5VgDD.d.ts → frame-CmDztC_y.d.ts} +1 -1
- package/dist/genui.js +6 -6
- package/dist/genui.js.map +1 -1
- package/dist/{geometry-DDlFDtiQ.d.ts → geometry-8O5Nq-yA.d.ts} +2 -2
- package/dist/{geometry-DuUQyHZ1.d.ts → geometry-haB2EgO4.d.ts} +2 -2
- package/dist/goal-gauge.d.ts +1 -1
- package/dist/goal-gauge.js +1 -1
- package/dist/goal-gauge.js.map +1 -1
- package/dist/image-cropper.js +1 -1
- package/dist/index.d.ts +27 -38
- package/dist/index.js +10 -18
- package/dist/index.js.map +1 -1
- package/dist/kind-config-editor.js +1 -1
- package/dist/list.js +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +2 -2
- package/dist/loader.js.map +1 -1
- package/dist/map.js +3 -3
- package/dist/map.js.map +1 -1
- package/dist/mascot-quote.d.ts +1 -1
- package/dist/mascot-quote.js +1 -1
- package/dist/mascot-state.js +1 -1
- package/dist/mascots.d.ts +2 -2
- package/dist/mascots.js +1 -1
- package/dist/match-dialog.js +1 -1
- package/dist/media-capture.js +1 -1
- package/dist/media-carousel.d.ts +115 -45
- package/dist/media-carousel.js +378 -56
- package/dist/media-carousel.js.map +1 -1
- package/dist/media-gallery.d.ts +3 -3
- package/dist/media-guard-bin.js +171 -0
- package/dist/media-guard-bin.js.map +1 -0
- package/dist/media-guard.d.ts +88 -0
- package/dist/media-guard.js +153 -0
- package/dist/media-guard.js.map +1 -0
- package/dist/media-player.d.ts +3 -3
- package/dist/media-player.js +3 -3
- package/dist/native/map.js +3 -3
- package/dist/native/map.js.map +1 -1
- package/dist/native.d.ts +43 -43
- package/dist/native.js +1233 -1210
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +1 -1
- package/dist/nav-bar.js +2 -2
- package/dist/notification-preferences.js +1 -1
- package/dist/pausable-loop.js +3 -13
- package/dist/pausable-loop.js.map +1 -1
- package/dist/{player-lightbox-ASFOSUSD.js → player-lightbox-BYQ57OXT.js} +3 -3
- package/dist/product-page.d.ts +1 -1
- package/dist/product-page.js.map +1 -1
- package/dist/profile-card.d.ts +2 -2
- package/dist/profile-card.js +1 -1
- package/dist/profile-card.js.map +1 -1
- package/dist/promise-card.d.ts +1 -1
- package/dist/promise-card.js +1 -1
- package/dist/promise-card.js.map +1 -1
- package/dist/rail-nav.d.ts +6 -6
- package/dist/rail-nav.js.map +1 -1
- package/dist/retro-tv-playlist.js.map +1 -1
- package/dist/retro-tv.js +2 -2
- package/dist/schema-form.d.ts +13 -1
- package/dist/schema-form.js +24 -13
- package/dist/schema-form.js.map +1 -1
- package/dist/scroll-stage.d.ts +1 -1
- package/dist/scroll-stage.js +1 -1
- package/dist/scroll-stage.js.map +1 -1
- package/dist/search-field.js +2 -2
- package/dist/shop/booking.js +1 -1
- package/dist/shop/bulletin.js +1 -1
- package/dist/shop/faq.js +1 -1
- package/dist/shop/gallery.js +1 -1
- package/dist/shop/look.js.map +1 -1
- package/dist/shop/policies.js +1 -1
- package/dist/shop/reviews.js +1 -1
- package/dist/shop/services.js +1 -1
- package/dist/shop/social.js +1 -1
- package/dist/shop/story.js +1 -1
- package/dist/shop/team.js +1 -1
- package/dist/shop/video.js +1 -1
- package/dist/shop/visit.js +1 -1
- package/dist/shop-composer.d.ts +1 -1
- package/dist/shop-composer.js +2 -2
- package/dist/shop-composer.js.map +1 -1
- package/dist/shop.d.ts +1 -1
- package/dist/shop.js +2 -2
- package/dist/shop.js.map +1 -1
- package/dist/site-cahier.d.ts +1 -1
- package/dist/site-cahier.js +188 -181
- package/dist/site-cahier.js.map +1 -1
- package/dist/site-footer.d.ts +1 -1
- package/dist/site-footer.js +2 -2
- package/dist/{sites-CSBwUnbJ.d.ts → sites-A5cNWG2Z.d.ts} +1 -1
- package/dist/sites.d.ts +2 -2
- package/dist/sites.js +15 -11
- package/dist/sites.js.map +1 -1
- package/dist/stage-banner.d.ts +1 -1
- package/dist/stage-banner.js +1 -1
- package/dist/stage-banner.js.map +1 -1
- package/dist/status-page.d.ts +1 -1
- package/dist/status-page.js.map +1 -1
- package/dist/step-showcase.d.ts +2 -2
- package/dist/step-showcase.js.map +1 -1
- package/dist/swipe-deck.js +1 -1
- package/dist/tag-input.js +3 -3
- package/dist/tag-selector.js +1 -1
- package/dist/terminal-replay.d.ts +1 -1
- package/dist/terminal-replay.js.map +1 -1
- package/dist/tree-view.js +1 -1
- package/dist/update-prompt.d.ts +1 -1
- package/dist/update-prompt.js.map +1 -1
- package/dist/versus-card.js +1 -1
- package/dist/vertical-video.js +1 -1
- package/dist/video-player.js +2 -2
- package/dist/video-trimmer.js +1 -1
- package/dist/virtual.js +2 -2
- package/dist/waveform.js.map +1 -1
- package/package.json +24 -11
- package/registry/account-menu.json +3 -3
- package/registry/account-settings.json +6 -6
- package/registry/achievement.json +8 -8
- package/registry/action-bar.json +4 -4
- package/registry/activity-feed.json +24 -24
- package/registry/agenda.json +3 -3
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +3 -3
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +33 -29
- package/registry/app-header.json +16 -16
- package/registry/app-shell.json +13 -13
- package/registry/argument-card.json +3 -3
- package/registry/auth-layout.json +9 -9
- package/registry/avatar.json +8 -8
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +2 -2
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +9 -9
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +2 -2
- package/registry/changelog-page.json +2 -2
- package/registry/chapter.json +5 -5
- 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 +2 -2
- package/registry/choice-grid.json +6 -6
- package/registry/code-block.json +1 -1
- package/registry/collection-switcher.json +2 -2
- package/registry/combobox.json +2 -2
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +5 -5
- 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 +2 -2
- package/registry/copy-button.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +3 -3
- package/registry/dashboard-layout.json +11 -11
- package/registry/data-table.json +2 -2
- package/registry/date-picker.json +2 -2
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +5 -5
- package/registry/detail-layout.json +7 -7
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +6 -6
- package/registry/docs-hub-page.json +4 -4
- package/registry/docs-layout.json +3 -3
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +4 -4
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +3 -3
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +1 -1
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +2 -2
- package/registry/engine-flow.json +8 -8
- package/registry/entity-header.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/account-menu/default.js +2 -2
- package/registry/examples/account-menu/default.tsx +2 -2
- package/registry/examples/account-settings/appearance.js +2 -2
- package/registry/examples/account-settings/appearance.tsx +2 -2
- package/registry/examples/account-settings/avatar-picker-folder.js +1 -1
- package/registry/examples/account-settings/avatar-picker-folder.tsx +1 -1
- package/registry/examples/account-settings/avatar-picker.js +1 -1
- package/registry/examples/account-settings/avatar-picker.tsx +1 -1
- package/registry/examples/account-settings/profile.js +2 -2
- package/registry/examples/account-settings/profile.tsx +3 -3
- package/registry/examples/achievement/arcade.js +1 -1
- package/registry/examples/achievement/arcade.tsx +1 -1
- package/registry/examples/action-bar/buttons.js +1 -1
- package/registry/examples/action-bar/buttons.tsx +1 -1
- package/registry/examples/action-bar/icons.js +1 -1
- package/registry/examples/action-bar/icons.tsx +1 -1
- package/registry/examples/activity-feed/job-activity.tsx +1 -1
- package/registry/examples/app-frame/admin.js +3 -3
- package/registry/examples/app-frame/admin.tsx +3 -3
- package/registry/examples/app-frame/app.js +5 -5
- package/registry/examples/app-frame/app.tsx +6 -6
- package/registry/examples/app-frame/touch.js +3 -3
- package/registry/examples/app-frame/touch.tsx +3 -3
- package/registry/examples/app-header/basic.js +2 -2
- package/registry/examples/app-header/basic.tsx +2 -2
- package/registry/examples/app-header/family.js +3 -3
- package/registry/examples/app-header/family.tsx +3 -3
- package/registry/examples/app-header/native/family.dark.png +0 -0
- package/registry/examples/app-header/native/family.js +2 -2
- package/registry/examples/app-header/native/family.light.png +0 -0
- package/registry/examples/app-header/native/family.tsx +2 -2
- package/registry/examples/app-shell/admin-console.js +1 -1
- package/registry/examples/app-shell/admin-console.tsx +1 -1
- package/registry/examples/app-shell/basic.js +1 -1
- package/registry/examples/app-shell/basic.tsx +1 -1
- package/registry/examples/app-shell/collapse-overflow.js +4 -4
- package/registry/examples/app-shell/collapse-overflow.tsx +4 -4
- package/registry/examples/app-shell/creator-studio.js +2 -2
- package/registry/examples/app-shell/creator-studio.tsx +2 -2
- package/registry/examples/app-shell/desktop.js +3 -3
- package/registry/examples/app-shell/desktop.tsx +1 -1
- package/registry/examples/argument-card/building-block.js +1 -1
- package/registry/examples/argument-card/building-block.tsx +1 -1
- package/registry/examples/auth-layout/onboarding.js +2 -2
- package/registry/examples/auth-layout/onboarding.tsx +2 -2
- package/registry/examples/auth-layout/sign-in.js +2 -2
- package/registry/examples/auth-layout/sign-in.tsx +2 -2
- package/registry/examples/avatar/default.js +1 -1
- package/registry/examples/avatar/default.tsx +1 -1
- package/registry/examples/bird-plate/single.tsx +1 -1
- package/registry/examples/card-grid/aligned.js +3 -3
- package/registry/examples/card-grid/aligned.tsx +3 -3
- package/registry/examples/card-grid/foundation.js +6 -6
- package/registry/examples/card-grid/foundation.tsx +6 -6
- package/registry/examples/card-grid/hover-quiet.js +3 -3
- package/registry/examples/card-grid/hover-quiet.tsx +3 -3
- package/registry/examples/card-grid/products.js +2 -2
- package/registry/examples/card-grid/products.tsx +2 -2
- package/registry/examples/catalogue-page/clients.js +1 -1
- package/registry/examples/catalogue-page/clients.tsx +1 -1
- package/registry/examples/chapter/detail.js +1 -1
- package/registry/examples/chapter/detail.tsx +1 -1
- package/registry/examples/chapter/foot.js +1 -1
- package/registry/examples/chapter/foot.tsx +1 -1
- package/registry/examples/chapter/index.js +1 -1
- package/registry/examples/chapter/index.tsx +1 -1
- package/registry/examples/choice-grid/line-up.js +2 -2
- package/registry/examples/choice-grid/line-up.tsx +2 -2
- package/registry/examples/collection-switcher/entity.js +2 -2
- package/registry/examples/collection-switcher/entity.tsx +2 -2
- package/registry/examples/comparison-table/versus.js +5 -5
- package/registry/examples/comparison-table/versus.tsx +5 -5
- package/registry/examples/cta-panel/discuss.js +1 -1
- package/registry/examples/cta-panel/discuss.tsx +1 -1
- package/registry/examples/dashboard-layout/{orazaka-eric.js → sovkora-eric.js} +4 -4
- package/registry/examples/dashboard-layout/{orazaka-eric.tsx → sovkora-eric.tsx} +3 -3
- package/registry/examples/dashboard-layout/today.js +1 -1
- package/registry/examples/dashboard-layout/today.tsx +1 -1
- package/registry/examples/desktop-window/library.js +2 -2
- package/registry/examples/desktop-window/library.tsx +1 -1
- package/registry/examples/detail-layout/checkout.js +1 -1
- package/registry/examples/detail-layout/checkout.tsx +1 -1
- package/registry/examples/detail-layout/client.js +1 -1
- package/registry/examples/detail-layout/client.tsx +1 -1
- package/registry/examples/detail-layout/new-invoice.js +1 -1
- package/registry/examples/detail-layout/new-invoice.tsx +1 -1
- package/registry/examples/detail-layout/profile.js +1 -1
- package/registry/examples/detail-layout/profile.tsx +1 -1
- package/registry/examples/detail-layout/video.js +1 -1
- package/registry/examples/detail-layout/video.tsx +1 -1
- package/registry/examples/docs-article-page/cli.js +5 -5
- package/registry/examples/docs-article-page/cli.tsx +6 -6
- package/registry/examples/docs-article-page/faq.js +4 -4
- package/registry/examples/docs-article-page/faq.tsx +4 -4
- package/registry/examples/docs-hub-page/krizaka.js +5 -5
- package/registry/examples/docs-hub-page/krizaka.tsx +5 -5
- package/registry/examples/docs-layout/page.js +1 -1
- package/registry/examples/docs-layout/page.tsx +1 -1
- package/registry/examples/empty-state/library.js +1 -1
- package/registry/examples/empty-state/library.tsx +1 -1
- package/registry/examples/engine-flow/calm.js +4 -4
- package/registry/examples/engine-flow/calm.tsx +4 -4
- package/registry/examples/engine-flow/compact.js +5 -5
- package/registry/examples/engine-flow/compact.tsx +5 -5
- package/registry/examples/engine-flow/radial.js +6 -6
- package/registry/examples/engine-flow/radial.tsx +6 -6
- package/registry/examples/force-update-screen/default.js +1 -1
- package/registry/examples/force-update-screen/default.tsx +1 -1
- package/registry/examples/force-update-screen/native/default.js +1 -1
- package/registry/examples/force-update-screen/native/default.tsx +1 -1
- package/registry/examples/form/native/sign-up.js +1 -1
- package/registry/examples/form/native/sign-up.tsx +1 -1
- package/registry/examples/gallery-page/made-here.js +2 -2
- package/registry/examples/gallery-page/made-here.tsx +3 -3
- package/registry/examples/goal-gauge/arcade.js +1 -1
- package/registry/examples/goal-gauge/arcade.tsx +1 -1
- package/registry/examples/landing-page/krizaka.js +5 -5
- package/registry/examples/landing-page/krizaka.tsx +5 -5
- package/registry/examples/landscape/brand.js +1 -1
- package/registry/examples/landscape/brand.tsx +1 -1
- package/registry/examples/link-card/docs-hub.js +3 -3
- package/registry/examples/link-card/docs-hub.tsx +3 -3
- package/registry/examples/link-card/hover-quiet.js +3 -3
- package/registry/examples/link-card/hover-quiet.tsx +3 -3
- package/registry/examples/link-card/stack.js +3 -3
- package/registry/examples/link-card/stack.tsx +3 -3
- package/registry/examples/list/jobs.tsx +1 -1
- package/registry/examples/loader/branded.js +2 -2
- package/registry/examples/loader/branded.tsx +3 -3
- package/registry/examples/loader/native/branded.js +1 -1
- package/registry/examples/loader/native/branded.tsx +2 -2
- package/registry/examples/loader/native/job-wait.tsx +1 -1
- package/registry/examples/longform-page/case-study.js +2 -2
- package/registry/examples/longform-page/case-study.tsx +3 -3
- package/registry/examples/longform-page/story.js +2 -2
- package/registry/examples/longform-page/story.tsx +2 -2
- package/registry/examples/maintenance-screen/default.js +1 -1
- package/registry/examples/maintenance-screen/default.tsx +1 -1
- package/registry/examples/maintenance-screen/native/default.js +1 -1
- package/registry/examples/maintenance-screen/native/default.tsx +1 -1
- package/registry/examples/marketing-layout/docs-hub.js +3 -3
- package/registry/examples/marketing-layout/docs-hub.tsx +3 -3
- package/registry/examples/marketing-layout/product-page.js +3 -3
- package/registry/examples/marketing-layout/product-page.tsx +3 -3
- package/registry/examples/mascots/flock.tsx +2 -2
- package/registry/examples/media-gallery/carousel-autoplay.js +23 -0
- package/registry/examples/media-gallery/carousel-autoplay.tsx +21 -0
- package/registry/examples/media-gallery/carousel-cahier.d.ts +4 -0
- package/registry/examples/media-gallery/carousel-cahier.js +27 -0
- package/registry/examples/media-gallery/carousel-cahier.tsx +26 -0
- package/registry/examples/media-gallery/carousel-demo.d.ts +4 -0
- package/registry/examples/media-gallery/carousel-demo.js +36 -0
- package/registry/examples/media-gallery/carousel-demo.tsx +34 -0
- package/registry/examples/nav-bar/family-admin.js +5 -5
- package/registry/examples/nav-bar/family-admin.tsx +4 -4
- package/registry/examples/nav-bar/family-java.js +1 -1
- package/registry/examples/nav-bar/family-java.tsx +1 -1
- package/registry/examples/nav-bar/family-product.js +4 -4
- package/registry/examples/nav-bar/family-product.tsx +3 -3
- package/registry/examples/nav-bar/site.js +2 -2
- package/registry/examples/nav-bar/site.tsx +2 -2
- package/registry/examples/pricing-page/credits.js +1 -1
- package/registry/examples/pricing-page/credits.tsx +2 -2
- package/registry/examples/product-page/sovkora.d.ts +4 -0
- package/registry/examples/product-page/{orazaka.js → sovkora.js} +7 -7
- package/registry/examples/product-page/{orazaka.tsx → sovkora.tsx} +5 -5
- package/registry/examples/profile-card/arcade.js +2 -2
- package/registry/examples/profile-card/arcade.tsx +2 -2
- package/registry/examples/profile-card/banner.js +2 -2
- package/registry/examples/profile-card/banner.tsx +2 -2
- package/registry/examples/profile-card/match.js +1 -1
- package/registry/examples/profile-card/match.tsx +1 -1
- package/registry/examples/profile-card/native/banner.js +1 -1
- package/registry/examples/profile-card/native/banner.tsx +1 -1
- package/registry/examples/promise-card/arcade.js +1 -1
- package/registry/examples/promise-card/arcade.tsx +1 -1
- package/registry/examples/pull-to-refresh/native/branded.js +1 -1
- package/registry/examples/pull-to-refresh/native/branded.tsx +1 -1
- package/registry/examples/rail-nav/expandable.js +3 -3
- package/registry/examples/rail-nav/expandable.tsx +3 -3
- package/registry/examples/rail-nav/shortcuts.js +6 -6
- package/registry/examples/rail-nav/shortcuts.tsx +6 -6
- package/registry/examples/rail-nav/studio.js +5 -5
- package/registry/examples/rail-nav/studio.tsx +5 -5
- package/registry/examples/scroll-stage/arcade.js +1 -1
- package/registry/examples/scroll-stage/arcade.tsx +1 -1
- package/registry/examples/shop/booking-closing-mark.js +2 -2
- package/registry/examples/shop/booking-closing-mark.tsx +2 -2
- package/registry/examples/site-footer/app.js +1 -1
- package/registry/examples/site-footer/app.tsx +2 -2
- package/registry/examples/site-footer/configured.js +1 -1
- package/registry/examples/site-footer/configured.tsx +1 -1
- package/registry/examples/site-footer/product.js +3 -3
- package/registry/examples/site-footer/product.tsx +4 -4
- package/registry/examples/sites/french.js +1 -1
- package/registry/examples/sites/french.tsx +1 -1
- package/registry/examples/specimen-tag/product.js +4 -4
- package/registry/examples/specimen-tag/product.tsx +4 -4
- package/registry/examples/specimen-tag/wire.js +3 -3
- package/registry/examples/specimen-tag/wire.tsx +3 -3
- package/registry/examples/splash-handoff/native/default.js +1 -1
- package/registry/examples/splash-handoff/native/default.tsx +1 -1
- package/registry/examples/split-view/notifications.js +1 -1
- package/registry/examples/split-view/notifications.tsx +1 -1
- package/registry/examples/stage-banner/steps.js +1 -1
- package/registry/examples/stage-banner/steps.tsx +1 -1
- package/registry/examples/status-page/building.js +1 -1
- package/registry/examples/status-page/building.tsx +1 -1
- package/registry/examples/status-page/operational.js +1 -1
- package/registry/examples/status-page/operational.tsx +1 -1
- package/registry/examples/step-showcase/desktop.js +2 -2
- package/registry/examples/step-showcase/desktop.tsx +2 -2
- package/registry/examples/step-showcase/phone.js +1 -1
- package/registry/examples/step-showcase/phone.tsx +1 -1
- package/registry/examples/stepper/native/run.tsx +1 -1
- package/registry/examples/stuck/card.js +1 -1
- package/registry/examples/stuck/card.tsx +1 -1
- package/registry/examples/stuck/tag.js +1 -1
- package/registry/examples/stuck/tag.tsx +2 -2
- package/registry/examples/tree-view/docs.js +4 -4
- package/registry/examples/tree-view/docs.tsx +4 -4
- package/registry/examples/update-prompt/default.js +1 -1
- package/registry/examples/update-prompt/default.tsx +1 -1
- package/registry/examples/update-prompt/native/default.js +1 -1
- package/registry/examples/update-prompt/native/default.tsx +1 -1
- package/registry/examples/video-player/signed-source.js +1 -1
- package/registry/examples/video-player/signed-source.tsx +1 -1
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +4 -4
- package/registry/form-flow.json +1 -1
- package/registry/form.json +2 -2
- package/registry/gallery-page.json +5 -5
- package/registry/genui.json +4 -4
- 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 +6 -6
- package/registry/grade-stamp.json +1 -1
- package/registry/identity-card.json +1 -1
- package/registry/image-cropper.json +2 -2
- package/registry/index.json +33 -33
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +3 -3
- package/registry/landscape.json +2 -2
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +5 -5
- package/registry/list.json +7 -7
- package/registry/loader.json +12 -12
- package/registry/longform-page.json +4 -4
- package/registry/maintenance-screen.json +4 -4
- package/registry/map.json +3 -3
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +6 -6
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +5 -5
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +2 -2
- package/registry/media-gallery.json +62 -10
- package/registry/meter.json +1 -1
- package/registry/money-input.json +1 -1
- package/registry/nav-bar.json +27 -23
- 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/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/price-catalogue-editor.json +3 -3
- package/registry/pricing-page.json +5 -5
- package/registry/product-page.json +13 -13
- package/registry/profile-card.json +12 -12
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +6 -6
- package/registry/promo-code-field.json +3 -3
- package/registry/proposal.json +4 -4
- package/registry/pull-to-refresh.json +2 -2
- package/registry/qr-code.json +1 -1
- package/registry/quota-meter.json +3 -3
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +38 -34
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +2 -2
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/schema-form.json +4 -4
- package/registry/scroll-stage.json +6 -6
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +3 -3
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +8 -8
- package/registry/shop-gallery.json +3 -3
- package/registry/shop.json +12 -12
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +29 -25
- package/registry/sites.json +3 -3
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +4 -4
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/splash-handoff.json +4 -4
- package/registry/split-view.json +2 -2
- package/registry/stage-banner.json +7 -7
- package/registry/stat.json +3 -3
- package/registry/state-screen.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +9 -9
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +10 -10
- package/registry/stepper.json +2 -2
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +4 -4
- package/registry/swipe-deck.json +2 -2
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +2 -2
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +2 -2
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +4 -4
- package/registry/update-prompt.json +8 -8
- package/registry/upload-queue.json +3 -3
- package/registry/usage.json +3 -3
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +3 -3
- package/registry/video-trimmer.json +2 -2
- package/registry/virtual.json +2 -2
- package/registry/wall.json +1 -1
- package/registry/waveform.json +2 -2
- package/skills/form/SKILL.md +1 -1
- package/skills/map/SKILL.md +2 -2
- package/dist/chunk-6KZDARNX.js.map +0 -1
- package/dist/chunk-DRTIE44Z.js.map +0 -1
- package/dist/chunk-E46AEUPH.js.map +0 -1
- package/dist/chunk-IOTY5HYG.js.map +0 -1
- package/dist/chunk-LZK4IRVW.js +0 -307
- package/dist/chunk-LZK4IRVW.js.map +0 -1
- package/dist/chunk-M3T5RQYV.js.map +0 -1
- package/dist/chunk-RCHKIOVV.js.map +0 -1
- /package/dist/{chunk-DSDFXPL6.js.map → chunk-757ZTGU5.js.map} +0 -0
- /package/dist/{chunk-CEW3LQOZ.js.map → chunk-IEGTRCDI.js.map} +0 -0
- /package/dist/{chunk-KVDB4GXV.js.map → chunk-KR2W4ONJ.js.map} +0 -0
- /package/dist/{chunk-GOGEYAYK.js.map → chunk-PRD7JRQX.js.map} +0 -0
- /package/dist/{chunk-VYZFQE3P.js.map → chunk-QD6SNXF5.js.map} +0 -0
- /package/dist/{chunk-YQWYGQTV.js.map → chunk-UIP3WX5O.js.map} +0 -0
- /package/dist/{chunk-ZKKMYIDN.js.map → chunk-Y3P5B4XS.js.map} +0 -0
- /package/dist/{chunk-GW5EI7MI.js.map → chunk-YXETEQQJ.js.map} +0 -0
- /package/dist/{player-lightbox-ASFOSUSD.js.map → player-lightbox-BYQ57OXT.js.map} +0 -0
- /package/registry/examples/dashboard-layout/{orazaka-eric.d.ts → sovkora-eric.d.ts} +0 -0
- /package/registry/examples/{product-page/orazaka.d.ts → media-gallery/carousel-autoplay.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
**The Krizaka front-end platform's components, shared by every product.**
|
|
11
11
|
The primitives (button, badge, avatar, field, theme, countdown…) on the semantic `--kz-*` tokens, the animated marks
|
|
12
|
-
of Krizaka,
|
|
12
|
+
of Krizaka, Sovkora, Verikora and Folioviv, and the Krizaka motion signature — one easing, one way to enter, reveal, roll, shine
|
|
13
13
|
and open.
|
|
14
14
|
|
|
15
15
|
[](https://www.npmjs.com/package/@krizaka/ui)
|
|
@@ -323,13 +323,13 @@ boundary stays where it is: a template is a Server Component.
|
|
|
323
323
|
|
|
324
324
|
> Category **layouts** of ui.krizaka.com, and **templates**: whole screens composed from the platform.
|
|
325
325
|
|
|
326
|
-
The shells of the products' screens, read from their real screens (
|
|
326
|
+
The shells of the products' screens, read from their real screens (Sovkora web-client,
|
|
327
327
|
web-admin and mobile; krizaka.com): `AppShell` (sidebar that collapses, header, drawer on a phone), `DashboardLayout`
|
|
328
328
|
(a grid of widgets), `SettingsLayout`, `AuthLayout`, `DetailLayout`, `SplitView`, and for a site `MarketingLayout` and
|
|
329
329
|
`DocsLayout`. Every layout is responsive by construction — one column, a drawer, chips or a disclosure on a phone.
|
|
330
330
|
|
|
331
331
|
A **template** is an example flagged `template: true` in its layout's `meta.ts` (≤ 160 lines): a complete screen with
|
|
332
|
-
real words — a creator studio,
|
|
332
|
+
real words — a creator studio, Sovkora's console for Eric, an administration console, sign-in, onboarding,
|
|
333
333
|
settings, a video's page, messages, a product page, pricing and credits, a documentation hub. Each has a phone story
|
|
334
334
|
(`parameters.phone`: captured at 390 × 844). Copy one into the product, keep its structure, change the words. The
|
|
335
335
|
React Native shells are `@krizaka/ui/native`'s (DS4): same names where the concept is the same.
|
|
@@ -425,7 +425,7 @@ const { theme, scheme, mode, setMode, radius } = useTheme(); // theme.surface1,
|
|
|
425
425
|
| `Segmented` | `options` (`value`, `label`, `disabled`), `value`, `onValueChange`, `size` | The web `Tabs variant="segmented"` (a tab list). To filter, `Chip.Group`. |
|
|
426
426
|
| `Progress` | `variant` bar·ring, `size`, `value`/`max`, `label`, `valueText`, a ring's centre as children | The fill is the `accent` → `accent2` gradient (react-native-svg); it animates to each new value. |
|
|
427
427
|
| `Toaster`, `toast` | `toast(title, { description, tone, icon, action, onPress, id, duration, onDismiss })`, `toast.success/warning/error/info`, `toast.dismiss(id?)`; `Toaster closeLabel position offset duration max` | No sonner: a light queue of its own. `offset` takes the safe-area inset (no safe-area dependency). |
|
|
428
|
-
| `KrizakaMark`, `
|
|
428
|
+
| `KrizakaMark`, `SovkoraMark`, `VerikoraMark`, `FoliovivMark`, `ProductMark` (`id`) | `size`, `animated`, `title`, `neutral` (default `theme.textMuted`) | The brand marks, drawn with react-native-svg from the web marks' geometry. |
|
|
429
429
|
|
|
430
430
|
Every animation (skeleton, badge dot, urgent countdown, progress, toast entrance, the marks) stops when the system
|
|
431
431
|
asks to reduce motion (`useReducedMotion()`). Accessibility goes through `role` and `aria-*` (RN ≥ 0.71): headings,
|
|
@@ -433,7 +433,7 @@ asks to reduce motion (`useReducedMotion()`). Accessibility goes through `role`
|
|
|
433
433
|
region for the toasts.
|
|
434
434
|
|
|
435
435
|
```tsx
|
|
436
|
-
import { Button, Card, Countdown,
|
|
436
|
+
import { Button, Card, Countdown, SovkoraMark } from "@krizaka/ui/native";
|
|
437
437
|
|
|
438
438
|
<Card.Root onPress={open}>
|
|
439
439
|
<Card.Body>
|
|
@@ -443,7 +443,7 @@ import { Button, Card, Countdown, OrazakaMark } from "@krizaka/ui/native";
|
|
|
443
443
|
</Card.Body>
|
|
444
444
|
</Card.Root>
|
|
445
445
|
|
|
446
|
-
<
|
|
446
|
+
<SovkoraMark size={72} title="Sovkora" neutral={theme.borderDefault} />
|
|
447
447
|
```
|
|
448
448
|
|
|
449
449
|
The native stories (`Native/*`, rendering the `registry/examples/<name>/native` examples) render through
|
|
@@ -455,13 +455,13 @@ Testing Library (`src/native/*.test.tsx`); `scripts/native-dist.mjs` checks that
|
|
|
455
455
|
## The marks
|
|
456
456
|
|
|
457
457
|
```tsx
|
|
458
|
-
import {
|
|
458
|
+
import { FoliovivLogo, KrizakaLogo, SovkoraLogo, ProductLogo, WuSamaMark, VerikoraLogo } from "@krizaka/ui";
|
|
459
459
|
|
|
460
|
-
<
|
|
460
|
+
<SovkoraLogo size={36} /> // decorative (aria-hidden)
|
|
461
461
|
<KrizakaLogo size={48} title="Krizaka" /> // an image with an accessible name
|
|
462
|
-
<ProductLogo id="
|
|
463
|
-
<
|
|
464
|
-
<
|
|
462
|
+
<ProductLogo id="sovkora" animated={false} /> // by id, still
|
|
463
|
+
<VerikoraLogo size={32} /> // Verikora: ink → indigo, the reading
|
|
464
|
+
<FoliovivLogo size={32} /> // Folioviv: forest → copper, the open shop
|
|
465
465
|
<WuSamaMark size={32} title="Wu-sama" /> // the founder's byline mark (a person, not a product): a gold W in the Krizaka hexagon
|
|
466
466
|
```
|
|
467
467
|
|
|
@@ -534,9 +534,9 @@ Releases go through [Changesets](https://github.com/changesets/changesets): a pu
|
|
|
534
534
|
## Used by
|
|
535
535
|
|
|
536
536
|
[krizaka.com](https://github.com/krizaka/krizaka-com) ·
|
|
537
|
-
[
|
|
538
|
-
[
|
|
539
|
-
[
|
|
537
|
+
[Verikora](https://github.com/krizaka/verikora) ·
|
|
538
|
+
[Folioviv](https://github.com/krizaka/folioviv) ·
|
|
539
|
+
[Sovkora](https://github.com/krizaka/sovkora)
|
|
540
540
|
|
|
541
541
|
---
|
|
542
542
|
|
package/dist/account-menu.d.ts
CHANGED
package/dist/account-menu.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { A as AvatarProps, D as DefaultAvatar, a as DefaultAvatarEntityKind, b as DefaultAvatarBrand } from './avatar-
|
|
2
|
+
import { A as AvatarProps, D as DefaultAvatar, a as DefaultAvatarEntityKind, b as DefaultAvatarBrand } from './avatar-Cd2uJgRh.js';
|
|
3
3
|
import { RadioGroup as RadioGroup$1 } from 'radix-ui';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
|
package/dist/account-settings.js
CHANGED
package/dist/achievement.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ type AchievementProps = Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
|
19
19
|
* @default "default"
|
|
20
20
|
*/
|
|
21
21
|
variant?: StoryVariant;
|
|
22
|
-
/** A brand scope (`
|
|
22
|
+
/** A brand scope (`sovkora` → `.brand-sovkora`). */
|
|
23
23
|
brand?: string;
|
|
24
24
|
};
|
|
25
25
|
/** Something done: an eyebrow, a badge, what it replaced (struck through) and the outcome. */
|
|
@@ -34,7 +34,7 @@ type AchievementListProps = React.OlHTMLAttributes<HTMLOListElement> & {
|
|
|
34
34
|
minWidth?: string;
|
|
35
35
|
/** The look of every card: `default` or `arcade`. */
|
|
36
36
|
variant?: StoryVariant;
|
|
37
|
-
/** A brand scope (`
|
|
37
|
+
/** A brand scope (`sovkora` → `.brand-sovkora`). */
|
|
38
38
|
brand?: string;
|
|
39
39
|
};
|
|
40
40
|
/** An ordered list of `Achievement`s on one grid of hairlines. */
|
package/dist/achievement.js
CHANGED
package/dist/achievement.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/achievement/achievement.tsx"],"sourcesContent":["// Server-safe. Something done, and what it replaced (story.css): a milestone reached, a dare completed, a problem out of\n// the way. A list of them shares one grid of hairlines; in a `Scene` of a `ScrollStage` their badges arrive one by one.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\n\nexport type AchievementProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> & {\n /** What was achieved: the outcome, in a few words. */\n title: React.ReactNode;\n /** A small line above: its number, its kind (“Milestone 03”). */\n eyebrow?: React.ReactNode;\n /** A glyph before the eyebrow (an `Emblem`, an icon). Decorative. */\n icon?: React.ReactNode;\n /** The badge in the corner (“Done”, “Unlocked”, arcade “Sealed”). */\n badge?: React.ReactNode;\n /** What it replaced or overcame, struck through above the title (“Paying 30 % to a platform”). */\n replaced?: React.ReactNode;\n /** Not reached yet: muted, its badge neutral. Say it in the badge too (“Locked”). */\n locked?: boolean;\n /**\n * `default`: a calm badge. `arcade`: a mono stamp that slams onto the card.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /** A brand scope (`
|
|
1
|
+
{"version":3,"sources":["../src/achievement/achievement.tsx"],"sourcesContent":["// Server-safe. Something done, and what it replaced (story.css): a milestone reached, a dare completed, a problem out of\n// the way. A list of them shares one grid of hairlines; in a `Scene` of a `ScrollStage` their badges arrive one by one.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\n\nexport type AchievementProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> & {\n /** What was achieved: the outcome, in a few words. */\n title: React.ReactNode;\n /** A small line above: its number, its kind (“Milestone 03”). */\n eyebrow?: React.ReactNode;\n /** A glyph before the eyebrow (an `Emblem`, an icon). Decorative. */\n icon?: React.ReactNode;\n /** The badge in the corner (“Done”, “Unlocked”, arcade “Sealed”). */\n badge?: React.ReactNode;\n /** What it replaced or overcame, struck through above the title (“Paying 30 % to a platform”). */\n replaced?: React.ReactNode;\n /** Not reached yet: muted, its badge neutral. Say it in the badge too (“Locked”). */\n locked?: boolean;\n /**\n * `default`: a calm badge. `arcade`: a mono stamp that slams onto the card.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /** A brand scope (`sovkora` → `.brand-sovkora`). */\n brand?: string;\n};\n\n/** Something done: an eyebrow, a badge, what it replaced (struck through) and the outcome. */\nexport function Achievement({ title, eyebrow, icon, badge, replaced, locked, variant, brand, className, ...props }: AchievementProps) {\n return (\n <div data-locked={locked ? \"\" : undefined} className={cn(\"kzs-achievement\", storyVariantClass(variant), brandClass(brand), className)} {...props}>\n {(eyebrow || badge || icon) && (\n <div className=\"kzs-achievement-head\">\n <span className=\"kzs-achievement-eyebrow\">\n {icon && <span aria-hidden>{icon}</span>}\n {eyebrow}\n </span>\n {badge && <span className=\"kzs-achievement-badge\">{badge}</span>}\n </div>\n )}\n {replaced && (\n <del className=\"kzs-achievement-replaced\" style={{ textDecorationLine: \"line-through\" }}>\n {replaced}\n </del>\n )}\n <p className=\"kzs-achievement-title\">{title}</p>\n </div>\n );\n}\n\nexport type AchievementListProps = React.OlHTMLAttributes<HTMLOListElement> & {\n /** The `Achievement`s, in order: each one becomes an item of the list (its badge arrives after the previous one's). */\n children: React.ReactNode;\n /**\n * The narrowest a card gets before the grid drops a column.\n * @default \"220px\"\n */\n minWidth?: string;\n /** The look of every card: `default` or `arcade`. */\n variant?: StoryVariant;\n /** A brand scope (`sovkora` → `.brand-sovkora`). */\n brand?: string;\n};\n\n/** An ordered list of `Achievement`s on one grid of hairlines. */\nexport function AchievementList({ children, minWidth, variant, brand, className, style, ...props }: AchievementListProps) {\n const items = React.Children.toArray(children);\n return (\n <ol\n className={cn(\"kzs-achievements\", storyVariantClass(variant), brandClass(brand), className)}\n style={minWidth ? ({ \"--kzs-min\": minWidth, ...style } as React.CSSProperties) : style}\n {...props}\n >\n {items.map((child, i) => (\n <li key={React.isValidElement(child) && child.key != null ? child.key : i} style={{ \"--i\": i } as React.CSSProperties}>\n {child}\n </li>\n ))}\n </ol>\n );\n}\n\nexport type EmblemProps = Omit<React.SVGProps<SVGSVGElement>, \"children\"> & {\n /** The emblem: `sword` (courage, the first step), `mirror` (clarity, honesty), `jewel` (care, what is kept). */\n kind: \"sword\" | \"mirror\" | \"jewel\";\n /**\n * Width and height in pixels.\n * @default 20\n */\n size?: number;\n};\n\n/** Three line emblems for achievements and choices (`currentColor`, decorative). */\nexport function Emblem({ kind, size = 20, ...props }: EmblemProps) {\n return (\n <svg\n viewBox=\"0 0 48 48\"\n width={size}\n height={size}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n {...props}\n >\n {kind === \"sword\" && (\n <>\n <path d=\"M24 3 L27 28 L24 36 L21 28 Z\" />\n <path d=\"M15 30 H33 M24 36 V45\" />\n </>\n )}\n {kind === \"mirror\" && (\n <>\n <circle cx=\"24\" cy=\"24\" r=\"17\" />\n <circle cx=\"24\" cy=\"24\" r=\"9\" />\n <path d=\"M24 2 V6 M24 42 V46 M2 24 H6 M42 24 H46\" />\n </>\n )}\n {kind === \"jewel\" && (\n <>\n <path d=\"M31 10 a13 13 0 1 1 -15 19 a8 8 0 0 0 8 -9 a8 8 0 0 1 7 -10 Z\" />\n <circle cx=\"29\" cy=\"17\" r=\"2.6\" fill=\"currentColor\" stroke=\"none\" />\n </>\n )}\n </svg>\n );\n}\n"],"mappings":";;;;;;;AAEA,YAAY,WAAW;AAiCb,SA4EF,UA3Ea,KADX;AALH,SAAS,YAAY,EAAE,OAAO,SAAS,MAAM,OAAO,UAAU,QAAQ,SAAS,OAAO,WAAW,GAAG,MAAM,GAAqB;AACpI,SACE,qBAAC,SAAI,eAAa,SAAS,KAAK,QAAW,WAAW,GAAG,mBAAmB,kBAAkB,OAAO,GAAG,WAAW,KAAK,GAAG,SAAS,GAAI,GAAG,OACvI;AAAA,gBAAW,SAAS,SACpB,qBAAC,SAAI,WAAU,wBACb;AAAA,2BAAC,UAAK,WAAU,2BACb;AAAA,gBAAQ,oBAAC,UAAK,eAAW,MAAE,gBAAK;AAAA,QAChC;AAAA,SACH;AAAA,MACC,SAAS,oBAAC,UAAK,WAAU,yBAAyB,iBAAM;AAAA,OAC3D;AAAA,IAED,YACC,oBAAC,SAAI,WAAU,4BAA2B,OAAO,EAAE,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,iEAAgE;AAAA,UACxE,oBAAC,YAAO,IAAG,MAAK,IAAG,MAAK,GAAE,OAAM,MAAK,gBAAe,QAAO,QAAO;AAAA,WACpE;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
package/dist/activity-feed.d.ts
CHANGED
|
@@ -157,9 +157,9 @@ type ActivityFeedProps<T extends ActivityEvent> = {
|
|
|
157
157
|
"aria-label": string;
|
|
158
158
|
/** The locale of the dates and the “… ago”. Default `en-US`. */
|
|
159
159
|
locale?: string;
|
|
160
|
-
/** Now, for the “… ago” and the day headings
|
|
161
|
-
now
|
|
162
|
-
/**
|
|
160
|
+
/** Now, for the “… ago” and the day headings: the host gives the time (from the server, the same text on both sides); the feed never reads the clock. */
|
|
161
|
+
now: Date;
|
|
162
|
+
/** Keep the “… ago” fresh: the feed's time moves a minute every minute from `now`. Default true. */
|
|
163
163
|
ticking?: boolean;
|
|
164
164
|
/** Fold the runs of the same actor and kind. Default true. */
|
|
165
165
|
fold?: boolean;
|
|
@@ -178,7 +178,7 @@ type ActivityFeedProps<T extends ActivityEvent> = {
|
|
|
178
178
|
};
|
|
179
179
|
/**
|
|
180
180
|
* What happened, newest first: grouped by day, runs folded (“Mina tipped ×3”), “2 min ago” kept fresh, new events
|
|
181
|
-
* announced when `live`.
|
|
181
|
+
* announced when `live`. Sovkora's job activity, a creator's notifications, the console's audit log.
|
|
182
182
|
*/
|
|
183
183
|
declare function ActivityFeed<T extends ActivityEvent>({ events, "aria-label": label, locale, now: given, ticking, fold, live, leading, action, labels: words, empty, className }: ActivityFeedProps<T>): React.JSX.Element;
|
|
184
184
|
type TimelineProps<T extends ActivityEvent> = {
|
package/dist/activity-feed.js
CHANGED
|
@@ -81,19 +81,25 @@ var activityFeedLabels = {
|
|
|
81
81
|
times: (count) => `\xD7${count}`,
|
|
82
82
|
newEvents: (count) => count === 1 ? "1 new event" : `${count} new events`
|
|
83
83
|
};
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
var MINUTE_MS = 6e4;
|
|
85
|
+
var minutesAfter = (start, minutes) => {
|
|
86
|
+
const at = new Date(start);
|
|
87
|
+
at.setMinutes(at.getMinutes() + minutes);
|
|
88
|
+
return at;
|
|
89
|
+
};
|
|
90
|
+
function useNow(start, ticking) {
|
|
91
|
+
const [minutes, setMinutes] = React.useState(0);
|
|
86
92
|
React.useEffect(() => {
|
|
87
93
|
if (!ticking) return;
|
|
88
|
-
const timer = setInterval(() =>
|
|
94
|
+
const timer = setInterval(() => setMinutes((m) => m + 1), MINUTE_MS);
|
|
89
95
|
return () => clearInterval(timer);
|
|
90
96
|
}, [ticking]);
|
|
91
|
-
return
|
|
97
|
+
return minutes === 0 ? start : minutesAfter(start, minutes);
|
|
92
98
|
}
|
|
93
99
|
function ActivityFeed({ events, "aria-label": label, locale = "en-US", now: given, ticking = true, fold = true, live, leading, action, labels: words, empty, className }) {
|
|
94
100
|
const labels = { ...activityFeedLabels, ...words };
|
|
95
101
|
const s = activityFeed();
|
|
96
|
-
const now = useNow(given, ticking
|
|
102
|
+
const now = useNow(given, ticking);
|
|
97
103
|
const groups = groupActivity(events, { now, locale, today: labels.today, yesterday: labels.yesterday, fold });
|
|
98
104
|
const seen = React.useRef(events.length);
|
|
99
105
|
const [announcement, setAnnouncement] = React.useState("");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/activity-feed/activity-feed.tsx","../src/activity-feed/group.ts"],"sourcesContent":["// Client (the clock of “… ago”, the announcement of new events). What happened, newest first: an activity feed\n// grouped by day with folded runs and relative times, announced politely when it is live; and a `Timeline` — one\n// thing's history on a rail, oldest first. Words are props.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { type ActivityEvent, type ActivityTone, groupActivity, timeAgo } from \"./group\";\n\nexport const activityFeed = tv({\n slots: {\n root: \"flex flex-col gap-5\",\n group: \"flex flex-col gap-1\",\n heading: \"sticky top-0 z-10 bg-surface-0 py-1 text-xs font-semibold text-fg-secondary\",\n ol: \"m-0 flex list-none flex-col p-0\",\n item: \"relative flex gap-3 py-2.5\",\n marker: \"relative mt-1 flex h-2.5 w-2.5 shrink-0 rounded-full bg-[var(--kz-af-tone)] ring-4 ring-surface-0\",\n rail: \"absolute left-[4.5px] top-5 -bottom-1 w-px bg-border-default\",\n body: \"flex min-w-0 flex-1 flex-col\",\n title: \"text-sm text-fg\",\n count: \"ml-1.5 inline-flex rounded-sm bg-surface-3 px-1.5 text-xs font-semibold tabular-nums text-fg-secondary\",\n description: \"text-xs text-fg-secondary\",\n time: \"shrink-0 pt-0.5 text-xs tabular-nums text-fg-secondary\",\n leading: \"shrink-0\",\n },\n});\n\nconst TONE: Record<ActivityTone, string> = {\n neutral: \"var(--kz-border-strong)\",\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success)\",\n warning: \"var(--kz-warning)\",\n danger: \"var(--kz-danger)\",\n info: \"var(--kz-info)\",\n};\n\nexport type ActivityFeedLabels = {\n /** The heading of today's events. */\n today: string;\n /** The heading of yesterday's. */\n yesterday: string;\n /** A folded run: `(n) => \"×\" + n` (“3 times”). */\n times: (count: number) => string;\n /** Announced when new events arrive in a live feed: `(n) => n + \" new events\"`. */\n newEvents: (count: number) => string;\n};\n\nexport const activityFeedLabels: ActivityFeedLabels = {\n today: \"Today\",\n yesterday: \"Yesterday\",\n times: (count) => `×${count}`,\n newEvents: (count) => (count === 1 ? \"1 new event\" : `${count} new events`),\n};\n\nexport type ActivityFeedProps<T extends ActivityEvent> = {\n /** The events, in any order. */\n events: readonly T[];\n /** The feed's accessible name (“Activity”). */\n \"aria-label\": string;\n /** The locale of the dates and the “… ago”. Default `en-US`. */\n locale?: string;\n /** Now, for the “… ago” and the day headings (pass it from the server for the same text on both sides). */\n now?: Date;\n /** Refresh the “… ago” every minute. Default true. */\n ticking?: boolean;\n /** Fold the runs of the same actor and kind. Default true. */\n fold?: boolean;\n /** Announce new events politely (a stream). */\n live?: boolean;\n /** Before an event's text: its actor's `Avatar`, an icon. */\n leading?: (event: T) => React.ReactNode;\n /** After an event's text: an action (Reply, View). */\n action?: (event: T) => React.ReactNode;\n /** The words, passed translated; English by default. */\n labels?: Partial<ActivityFeedLabels>;\n /** Shown when there is no event (an `EmptyState`). */\n empty?: React.ReactNode;\n /** Classes merged on the root. */\n className?: string;\n};\n\nfunction useNow(initial: Date | undefined, ticking: boolean) {\n const [now, setNow] = React.useState(() => initial ?? new Date());\n React.useEffect(() => {\n if (!ticking) return;\n const timer = setInterval(() => setNow(new Date()), 60_000);\n return () => clearInterval(timer);\n }, [ticking]);\n return now;\n}\n\n/**\n * What happened, newest first: grouped by day, runs folded (“Mina tipped ×3”), “2 min ago” kept fresh, new events\n * announced when `live`. Orazaka's job activity, a creator's notifications, the console's audit log.\n */\nexport function ActivityFeed<T extends ActivityEvent>({ events, \"aria-label\": label, locale = \"en-US\", now: given, ticking = true, fold = true, live, leading, action, labels: words, empty, className }: ActivityFeedProps<T>) {\n const labels = { ...activityFeedLabels, ...words };\n const s = activityFeed();\n const now = useNow(given, ticking && !given);\n const groups = groupActivity(events, { now, locale, today: labels.today, yesterday: labels.yesterday, fold });\n const seen = React.useRef(events.length);\n const [announcement, setAnnouncement] = React.useState(\"\");\n React.useEffect(() => {\n const added = events.length - seen.current;\n seen.current = events.length;\n if (!live || added <= 0) return;\n const timer = setTimeout(() => setAnnouncement(labels.newEvents(added)), 0);\n return () => clearTimeout(timer);\n }, [events.length, live]); // eslint-disable-line react-hooks/exhaustive-deps -- announce on a new count only\n return (\n <section aria-label={label} className={s.root({ className })}>\n {live ? (\n <p className=\"sr-only\" aria-live=\"polite\">\n {announcement}\n </p>\n ) : null}\n {groups.length === 0 && empty ? empty : null}\n {groups.map((group) => (\n <div key={group.label} className={s.group()}>\n <h3 className={s.heading()}>{group.label}</h3>\n <ol className={s.ol()}>\n {group.events.map(({ event, count }) => {\n const date = new Date(event.at);\n return (\n <li key={event.id} className={s.item()} style={{ [\"--kz-af-tone\" as string]: TONE[event.tone ?? \"neutral\"] }}>\n {leading ? <span className={s.leading()}>{leading(event)}</span> : <span aria-hidden className={s.marker()} />}\n <span className={s.body()}>\n <span className={s.title()}>\n {event.title}\n {count > 1 ? <span className={s.count()}>{labels.times(count)}</span> : null}\n </span>\n {event.description ? <span className={s.description()}>{event.description}</span> : null}\n </span>\n <time dateTime={date.toISOString()} title={date.toLocaleString(locale)} className={s.time()}>\n {timeAgo(date, { now, locale })}\n </time>\n {action ? <span className=\"shrink-0\">{action(event)}</span> : null}\n </li>\n );\n })}\n </ol>\n </div>\n ))}\n </section>\n );\n}\n\nexport type TimelineProps<T extends ActivityEvent> = {\n /** One thing's events, oldest first (a job's run, a payout's life). */\n events: readonly T[];\n /** The timeline's accessible name (“History of the payout”). */\n \"aria-label\": string;\n /** The locale of the times. Default `en-US`. */\n locale?: string;\n /** How a time is written: `time` (14:02, default), `datetime`, `date`. */\n timeStyle?: \"time\" | \"datetime\" | \"date\";\n /** Classes merged on the list. */\n className?: string;\n};\n\n/** One thing's history on a rail, oldest first: each event a marker in its tone, its time and its words. */\nexport function Timeline<T extends ActivityEvent>({ events, \"aria-label\": label, locale = \"en-US\", timeStyle = \"time\", className }: TimelineProps<T>) {\n const s = activityFeed();\n const options: Intl.DateTimeFormatOptions =\n timeStyle === \"time\" ? { hour: \"2-digit\", minute: \"2-digit\" } : timeStyle === \"date\" ? { dateStyle: \"medium\" } : { dateStyle: \"medium\", timeStyle: \"short\" };\n const write = new Intl.DateTimeFormat(locale, options);\n return (\n <ol aria-label={label} className={s.ol({ className })}>\n {events.map((event, i) => {\n const date = new Date(event.at);\n return (\n <li key={event.id} className={s.item()} style={{ [\"--kz-af-tone\" as string]: TONE[event.tone ?? \"neutral\"] }}>\n <span aria-hidden className={s.marker()} />\n {i < events.length - 1 ? <span aria-hidden className={s.rail()} /> : null}\n <span className={s.body()}>\n <span className={s.title()}>{event.title}</span>\n {event.description ? <span className={s.description()}>{event.description}</span> : null}\n </span>\n <time dateTime={date.toISOString()} className={s.time()}>\n {write.format(date)}\n </time>\n </li>\n );\n })}\n </ol>\n );\n}\n","// Shared by the web and React Native ActivityFeed: the events grouped by day (“Today”, “Yesterday”, a date), the same\n// events of one actor in a row folded into one (“Mina tipped 3 times”), and how long ago each happened — Intl only.\n\nexport type ActivityTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\nexport type ActivityEvent = {\n /** A stable id. */\n id: string;\n /** When it happened: an ISO date-time, an epoch in ms or a `Date`. */\n at: string | number | Date;\n /** What happened, in a sentence — passed translated (“Mina tipped your video $5”). */\n title: string;\n /** A detail under it. */\n description?: string;\n /** Who did it (folds a run of the same `kind` by the same actor). */\n actor?: string;\n /** The kind of event (`tip`, `bid`, `job.done`): with `actor`, what folds. */\n kind?: string;\n /** The tone of its marker: success for a payout, danger for a failure. */\n tone?: ActivityTone;\n};\n\nexport type ActivityGroup<T extends ActivityEvent> = {\n /** The day's heading (“Today”, “Yesterday”, “Monday, Oct 6”). */\n label: string;\n /** Its events, newest first; a folded run is its newest event with `count` > 1. */\n events: { event: T; count: number }[];\n};\n\nconst dayKey = (date: Date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;\n\n/** Groups events (any order) by day, newest first, folding runs of the same actor and kind when `fold` is set. */\nexport function groupActivity<T extends ActivityEvent>(\n events: readonly T[],\n { now = new Date(), locale = \"en-US\", today = \"Today\", yesterday = \"Yesterday\", fold = true }: { now?: Date; locale?: string; today?: string; yesterday?: string; fold?: boolean } = {},\n): ActivityGroup<T>[] {\n const sorted = [...events].sort((a, b) => new Date(b.at).getTime() - new Date(a.at).getTime());\n const day = new Intl.DateTimeFormat(locale, { weekday: \"long\", month: \"short\", day: \"numeric\" });\n const todayKey = dayKey(now);\n const yesterdayKey = dayKey(new Date(now.getTime() - 86_400_000));\n const groups: ActivityGroup<T>[] = [];\n let current: ActivityGroup<T> | null = null;\n let currentKey = \"\";\n for (const event of sorted) {\n const date = new Date(event.at);\n const key = dayKey(date);\n if (!current || key !== currentKey) {\n currentKey = key;\n current = { label: key === todayKey ? today : key === yesterdayKey ? yesterday : day.format(date), events: [] };\n groups.push(current);\n }\n const last = current.events[current.events.length - 1];\n if (fold && last && event.actor && event.kind && last.event.actor === event.actor && last.event.kind === event.kind) last.count += 1;\n else current.events.push({ event, count: 1 });\n }\n return groups;\n}\n\nconst UNITS: [Intl.RelativeTimeFormatUnit, number][] = [\n [\"second\", 60],\n [\"minute\", 60],\n [\"hour\", 24],\n [\"day\", 7],\n [\"week\", 4.35],\n [\"month\", 12],\n [\"year\", Number.POSITIVE_INFINITY],\n];\n\n/** “2 minutes ago”, “yesterday”: how long ago, in the largest unit that reads well (`style` short: “2 min. ago”). */\nexport function timeAgo(at: string | number | Date, { now = new Date(), locale = \"en-US\", style = \"short\" }: { now?: Date; locale?: string; style?: \"long\" | \"short\" | \"narrow\" } = {}): string {\n let value = (new Date(at).getTime() - now.getTime()) / 1000;\n let unit: Intl.RelativeTimeFormatUnit = \"second\";\n for (const [name, size] of UNITS) {\n unit = name;\n if (Math.abs(value) < size - 0.5) break;\n value /= size;\n }\n return new Intl.RelativeTimeFormat(locale, { numeric: \"auto\", style }).format(Math.round(value) + 0, unit);\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;;;ACyBnB,IAAM,SAAS,CAAC,SAAe,GAAG,KAAK,YAAY,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC;AAGlF,SAAS,cACd,QACA,EAAE,MAAM,oBAAI,KAAK,GAAG,SAAS,SAAS,QAAQ,SAAS,YAAY,aAAa,OAAO,KAAK,IAAyF,CAAC,GAClK;AACpB,QAAM,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,EAAE,EAAE,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC;AAC7F,QAAM,MAAM,IAAI,KAAK,eAAe,QAAQ,EAAE,SAAS,QAAQ,OAAO,SAA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wB,GAAG,KAAK,MAAM,QAAQ,SAAS,EAAE,GACzG;AAAA,0BAAC,UAAK,eAAW,MAAC,WAAW,EAAE,OAAO,GAAG;AAAA,MACxC,IAAI,OAAO,SAAS,IAAI,oBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,KAAK,GAAG,IAAK;AAAA,MACrE,qBAAC,UAAK,WAAW,EAAE,KAAK,GACtB;AAAA,4BAAC,UAAK,WAAW,EAAE,MAAM,GAAI,gBAAM,OAAM;AAAA,QACxC,MAAM,cAAc,oBAAC,UAAK,WAAW,EAAE,YAAY,GAAI,gBAAM,aAAY,IAAU;AAAA,SACtF;AAAA,MACA,oBAAC,UAAK,UAAU,KAAK,YAAY,GAAG,WAAW,EAAE,KAAK,GACnD,gBAAM,OAAO,IAAI,GACpB;AAAA,SATO,MAAM,EAUf;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/activity-feed/activity-feed.tsx","../src/activity-feed/group.ts"],"sourcesContent":["// Client (the clock of “… ago”, the announcement of new events). What happened, newest first: an activity feed\n// grouped by day with folded runs and relative times, announced politely when it is live; and a `Timeline` — one\n// thing's history on a rail, oldest first. Words are props.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { type ActivityEvent, type ActivityTone, groupActivity, timeAgo } from \"./group\";\n\nexport const activityFeed = tv({\n slots: {\n root: \"flex flex-col gap-5\",\n group: \"flex flex-col gap-1\",\n heading: \"sticky top-0 z-10 bg-surface-0 py-1 text-xs font-semibold text-fg-secondary\",\n ol: \"m-0 flex list-none flex-col p-0\",\n item: \"relative flex gap-3 py-2.5\",\n marker: \"relative mt-1 flex h-2.5 w-2.5 shrink-0 rounded-full bg-[var(--kz-af-tone)] ring-4 ring-surface-0\",\n rail: \"absolute left-[4.5px] top-5 -bottom-1 w-px bg-border-default\",\n body: \"flex min-w-0 flex-1 flex-col\",\n title: \"text-sm text-fg\",\n count: \"ml-1.5 inline-flex rounded-sm bg-surface-3 px-1.5 text-xs font-semibold tabular-nums text-fg-secondary\",\n description: \"text-xs text-fg-secondary\",\n time: \"shrink-0 pt-0.5 text-xs tabular-nums text-fg-secondary\",\n leading: \"shrink-0\",\n },\n});\n\nconst TONE: Record<ActivityTone, string> = {\n neutral: \"var(--kz-border-strong)\",\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success)\",\n warning: \"var(--kz-warning)\",\n danger: \"var(--kz-danger)\",\n info: \"var(--kz-info)\",\n};\n\nexport type ActivityFeedLabels = {\n /** The heading of today's events. */\n today: string;\n /** The heading of yesterday's. */\n yesterday: string;\n /** A folded run: `(n) => \"×\" + n` (“3 times”). */\n times: (count: number) => string;\n /** Announced when new events arrive in a live feed: `(n) => n + \" new events\"`. */\n newEvents: (count: number) => string;\n};\n\nexport const activityFeedLabels: ActivityFeedLabels = {\n today: \"Today\",\n yesterday: \"Yesterday\",\n times: (count) => `×${count}`,\n newEvents: (count) => (count === 1 ? \"1 new event\" : `${count} new events`),\n};\n\nexport type ActivityFeedProps<T extends ActivityEvent> = {\n /** The events, in any order. */\n events: readonly T[];\n /** The feed's accessible name (“Activity”). */\n \"aria-label\": string;\n /** The locale of the dates and the “… ago”. Default `en-US`. */\n locale?: string;\n /** Now, for the “… ago” and the day headings: the host gives the time (from the server, the same text on both sides); the feed never reads the clock. */\n now: Date;\n /** Keep the “… ago” fresh: the feed's time moves a minute every minute from `now`. Default true. */\n ticking?: boolean;\n /** Fold the runs of the same actor and kind. Default true. */\n fold?: boolean;\n /** Announce new events politely (a stream). */\n live?: boolean;\n /** Before an event's text: its actor's `Avatar`, an icon. */\n leading?: (event: T) => React.ReactNode;\n /** After an event's text: an action (Reply, View). */\n action?: (event: T) => React.ReactNode;\n /** The words, passed translated; English by default. */\n labels?: Partial<ActivityFeedLabels>;\n /** Shown when there is no event (an `EmptyState`). */\n empty?: React.ReactNode;\n /** Classes merged on the root. */\n className?: string;\n};\n\n// @fixed: the « … ago » is worded to the minute, so the feed's time moves by one minute, every minute\nconst MINUTE_MS = 60_000;\n\n/** `start`, `minutes` later (calendar arithmetic, no millisecond sums). */\nconst minutesAfter = (start: Date, minutes: number): Date => {\n const at = new Date(start);\n at.setMinutes(at.getMinutes() + minutes);\n return at;\n};\n\n/** The feed's time: `start`, then one minute later every minute while it ticks. Never the wall clock: the host gives it. */\nfunction useNow(start: Date, ticking: boolean) {\n const [minutes, setMinutes] = React.useState(0);\n React.useEffect(() => {\n if (!ticking) return;\n const timer = setInterval(() => setMinutes((m) => m + 1), MINUTE_MS);\n return () => clearInterval(timer);\n }, [ticking]);\n return minutes === 0 ? start : minutesAfter(start, minutes);\n}\n\n/**\n * What happened, newest first: grouped by day, runs folded (“Mina tipped ×3”), “2 min ago” kept fresh, new events\n * announced when `live`. Sovkora's job activity, a creator's notifications, the console's audit log.\n */\nexport function ActivityFeed<T extends ActivityEvent>({ events, \"aria-label\": label, locale = \"en-US\", now: given, ticking = true, fold = true, live, leading, action, labels: words, empty, className }: ActivityFeedProps<T>) {\n const labels = { ...activityFeedLabels, ...words };\n const s = activityFeed();\n const now = useNow(given, ticking);\n const groups = groupActivity(events, { now, locale, today: labels.today, yesterday: labels.yesterday, fold });\n const seen = React.useRef(events.length);\n const [announcement, setAnnouncement] = React.useState(\"\");\n React.useEffect(() => {\n const added = events.length - seen.current;\n seen.current = events.length;\n if (!live || added <= 0) return;\n const timer = setTimeout(() => setAnnouncement(labels.newEvents(added)), 0);\n return () => clearTimeout(timer);\n }, [events.length, live]); // eslint-disable-line react-hooks/exhaustive-deps -- announce on a new count only\n return (\n <section aria-label={label} className={s.root({ className })}>\n {live ? (\n <p className=\"sr-only\" aria-live=\"polite\">\n {announcement}\n </p>\n ) : null}\n {groups.length === 0 && empty ? empty : null}\n {groups.map((group) => (\n <div key={group.label} className={s.group()}>\n <h3 className={s.heading()}>{group.label}</h3>\n <ol className={s.ol()}>\n {group.events.map(({ event, count }) => {\n const date = new Date(event.at);\n return (\n <li key={event.id} className={s.item()} style={{ [\"--kz-af-tone\" as string]: TONE[event.tone ?? \"neutral\"] }}>\n {leading ? <span className={s.leading()}>{leading(event)}</span> : <span aria-hidden className={s.marker()} />}\n <span className={s.body()}>\n <span className={s.title()}>\n {event.title}\n {count > 1 ? <span className={s.count()}>{labels.times(count)}</span> : null}\n </span>\n {event.description ? <span className={s.description()}>{event.description}</span> : null}\n </span>\n <time dateTime={date.toISOString()} title={date.toLocaleString(locale)} className={s.time()}>\n {timeAgo(date, { now, locale })}\n </time>\n {action ? <span className=\"shrink-0\">{action(event)}</span> : null}\n </li>\n );\n })}\n </ol>\n </div>\n ))}\n </section>\n );\n}\n\nexport type TimelineProps<T extends ActivityEvent> = {\n /** One thing's events, oldest first (a job's run, a payout's life). */\n events: readonly T[];\n /** The timeline's accessible name (“History of the payout”). */\n \"aria-label\": string;\n /** The locale of the times. Default `en-US`. */\n locale?: string;\n /** How a time is written: `time` (14:02, default), `datetime`, `date`. */\n timeStyle?: \"time\" | \"datetime\" | \"date\";\n /** Classes merged on the list. */\n className?: string;\n};\n\n/** One thing's history on a rail, oldest first: each event a marker in its tone, its time and its words. */\nexport function Timeline<T extends ActivityEvent>({ events, \"aria-label\": label, locale = \"en-US\", timeStyle = \"time\", className }: TimelineProps<T>) {\n const s = activityFeed();\n const options: Intl.DateTimeFormatOptions =\n timeStyle === \"time\" ? { hour: \"2-digit\", minute: \"2-digit\" } : timeStyle === \"date\" ? { dateStyle: \"medium\" } : { dateStyle: \"medium\", timeStyle: \"short\" };\n const write = new Intl.DateTimeFormat(locale, options);\n return (\n <ol aria-label={label} className={s.ol({ className })}>\n {events.map((event, i) => {\n const date = new Date(event.at);\n return (\n <li key={event.id} className={s.item()} style={{ [\"--kz-af-tone\" as string]: TONE[event.tone ?? \"neutral\"] }}>\n <span aria-hidden className={s.marker()} />\n {i < events.length - 1 ? <span aria-hidden className={s.rail()} /> : null}\n <span className={s.body()}>\n <span className={s.title()}>{event.title}</span>\n {event.description ? <span className={s.description()}>{event.description}</span> : null}\n </span>\n <time dateTime={date.toISOString()} className={s.time()}>\n {write.format(date)}\n </time>\n </li>\n );\n })}\n </ol>\n );\n}\n","// Shared by the web and React Native ActivityFeed: the events grouped by day (“Today”, “Yesterday”, a date), the same\n// events of one actor in a row folded into one (“Mina tipped 3 times”), and how long ago each happened — Intl only.\n\nexport type ActivityTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\nexport type ActivityEvent = {\n /** A stable id. */\n id: string;\n /** When it happened: an ISO date-time, an epoch in ms or a `Date`. */\n at: string | number | Date;\n /** What happened, in a sentence — passed translated (“Mina tipped your video $5”). */\n title: string;\n /** A detail under it. */\n description?: string;\n /** Who did it (folds a run of the same `kind` by the same actor). */\n actor?: string;\n /** The kind of event (`tip`, `bid`, `job.done`): with `actor`, what folds. */\n kind?: string;\n /** The tone of its marker: success for a payout, danger for a failure. */\n tone?: ActivityTone;\n};\n\nexport type ActivityGroup<T extends ActivityEvent> = {\n /** The day's heading (“Today”, “Yesterday”, “Monday, Oct 6”). */\n label: string;\n /** Its events, newest first; a folded run is its newest event with `count` > 1. */\n events: { event: T; count: number }[];\n};\n\nconst dayKey = (date: Date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;\n\n/** Groups events (any order) by day, newest first, folding runs of the same actor and kind when `fold` is set. */\nexport function groupActivity<T extends ActivityEvent>(\n events: readonly T[],\n { now = new Date(), locale = \"en-US\", today = \"Today\", yesterday = \"Yesterday\", fold = true }: { now?: Date; locale?: string; today?: string; yesterday?: string; fold?: boolean } = {},\n): ActivityGroup<T>[] {\n const sorted = [...events].sort((a, b) => new Date(b.at).getTime() - new Date(a.at).getTime());\n const day = new Intl.DateTimeFormat(locale, { weekday: \"long\", month: \"short\", day: \"numeric\" });\n const todayKey = dayKey(now);\n const yesterdayKey = dayKey(new Date(now.getTime() - 86_400_000));\n const groups: ActivityGroup<T>[] = [];\n let current: ActivityGroup<T> | null = null;\n let currentKey = \"\";\n for (const event of sorted) {\n const date = new Date(event.at);\n const key = dayKey(date);\n if (!current || key !== currentKey) {\n currentKey = key;\n current = { label: key === todayKey ? today : key === yesterdayKey ? yesterday : day.format(date), events: [] };\n groups.push(current);\n }\n const last = current.events[current.events.length - 1];\n if (fold && last && event.actor && event.kind && last.event.actor === event.actor && last.event.kind === event.kind) last.count += 1;\n else current.events.push({ event, count: 1 });\n }\n return groups;\n}\n\nconst UNITS: [Intl.RelativeTimeFormatUnit, number][] = [\n [\"second\", 60],\n [\"minute\", 60],\n [\"hour\", 24],\n [\"day\", 7],\n [\"week\", 4.35],\n [\"month\", 12],\n [\"year\", Number.POSITIVE_INFINITY],\n];\n\n/** “2 minutes ago”, “yesterday”: how long ago, in the largest unit that reads well (`style` short: “2 min. ago”). */\nexport function timeAgo(at: string | number | Date, { now = new Date(), locale = \"en-US\", style = \"short\" }: { now?: Date; locale?: string; style?: \"long\" | \"short\" | \"narrow\" } = {}): string {\n let value = (new Date(at).getTime() - now.getTime()) / 1000;\n let unit: Intl.RelativeTimeFormatUnit = \"second\";\n for (const [name, size] of UNITS) {\n unit = name;\n if (Math.abs(value) < size - 0.5) break;\n value /= size;\n }\n return new Intl.RelativeTimeFormat(locale, { numeric: \"auto\", style }).format(Math.round(value) + 0, unit);\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;;;ACyBnB,IAAM,SAAS,CAAC,SAAe,GAAG,KAAK,YAAY,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC;AAGlF,SAAS,cACd,QACA,EAAE,MAAM,oBAAI,KAAK,GAAG,SAAS,SAAS,QAAQ,SAAS,YAAY,aAAa,OAAO,KAAK,IAAyF,CAAC,GAClK;AACpB,QAAM,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,EAAE,EAAE,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC;AAC7F,QAAM,MAAM,IAAI,KAAK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,cAAY,OAAO,WAAW,EAAE,GAAG,EAAE,UAAU,CAAC,GACjD,iBAAO,IAAI,CAAC,OAAO,MAAM;AACxB,UAAM,OAAO,IAAI,KAAK,MAAM,EAAE;AAC9B,WACE,qBAAC,QAAkB,WAAW,EAAE,KAAK,GAAG,OAAO,EAAE,CAAC,cAAwB,GAAG,KAAK,MAAM,QAAQ,SAAS,EAAE,GACzG;AAAA,0BAAC,UAAK,eAAW,MAAC,WAAW,EAAE,OAAO,GAAG;AAAA,MACxC,IAAI,OAAO,SAAS,IAAI,oBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,KAAK,GAAG,IAAK;AAAA,MACrE,qBAAC,UAAK,WAAW,EAAE,KAAK,GACtB;AAAA,4BAAC,UAAK,WAAW,EAAE,MAAM,GAAI,gBAAM,OAAM;AAAA,QACxC,MAAM,cAAc,oBAAC,UAAK,WAAW,EAAE,YAAY,GAAI,gBAAM,aAAY,IAAU;AAAA,SACtF;AAAA,MACA,oBAAC,UAAK,UAAU,KAAK,YAAY,GAAG,WAAW,EAAE,KAAK,GACnD,gBAAM,OAAO,IAAI,GACpB;AAAA,SATO,MAAM,EAUf;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
|
package/dist/app-frame.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { Mode } from '@krizaka/ui/theme';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* A Krizaka brand by its
|
|
7
|
-
* (`
|
|
6
|
+
* A Krizaka brand by its id: the company and its three products — Verikora (`verikora`), Folioviv
|
|
7
|
+
* (`folioviv`) and Sovkora (`sovkora`). It also keys the brand palettes (maps, forms, loaders).
|
|
8
8
|
*/
|
|
9
|
-
type BrandId = "krizaka" | "
|
|
9
|
+
type BrandId = "krizaka" | "sovkora" | "verikora" | "folioviv";
|
|
10
10
|
|
|
11
11
|
/** The places the account menu can hold, in the order the frame draws them. */
|
|
12
12
|
declare const ACCOUNT_LINK_IDS: readonly ["profile", "settings", "billing", "administration"];
|
|
@@ -161,7 +161,7 @@ interface AppFrameTheme {
|
|
|
161
161
|
interface AppFrameProps {
|
|
162
162
|
/** The product's name, as text in the top bar. */
|
|
163
163
|
name: string;
|
|
164
|
-
/** The product's mark (`<ProductLogo id="
|
|
164
|
+
/** The product's mark (`<ProductLogo id="verikora" size={26} />`): on the rail on a desktop, in the top bar on a phone. */
|
|
165
165
|
mark: React.ReactNode;
|
|
166
166
|
/** The mark in the top bar below `md` (smaller). Defaults to `mark`. */
|
|
167
167
|
headerMark?: React.ReactNode;
|
package/dist/app-frame.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/app-frame/app-frame.tsx","../src/app-frame/contract.ts","../src/app-frame/vocabulary.ts"],"sourcesContent":["// Client (the rail's state, the account menu, the theme). THE signed-in frame of every Krizaka web product (audit F1, F2,\n// F6): the rail (a bottom tab bar on a phone) and the family's top bar, composed once from data. The product keeps its\n// list of sections; the frame owns the rest — the account menu's content and order, where the preferences live (always in\n// the menu: a header has no room for them on a phone), which place is on the rail and which is under the avatar.\nimport { AccountMenu, type AccountMenuLink } from \"@krizaka/ui/account-menu\";\nimport { AppHeader } from \"@krizaka/ui/app-header\";\nimport { AppHeaderSearch } from \"@krizaka/ui/app-header/search\";\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { RailNav } from \"@krizaka/ui/rail-nav\";\nimport { type Mode, useOptionalTheme } from \"@krizaka/ui/theme\";\nimport * as React from \"react\";\n\nimport type { BrandId } from \"../marks/ProductLogo\";\nimport { type AccountLinkId, framePlaces, type FrameSection, orderAccountLinks } from \"./contract\";\nimport { navVocabulary, type NavWords } from \"./vocabulary\";\n\nexport interface AppFrameAccountLink {\n href: string;\n /** Overrides the shared word (`Credits and usage` for billing where credits exist). */\n label?: string;\n icon?: React.ReactNode;\n}\n\nexport interface AppFrameAccount {\n name?: string;\n email?: string;\n /** `src`, or `defaultAvatar` (`{ brand, seed }`). */\n avatar?: React.ComponentProps<typeof AccountMenu>[\"avatar\"];\n /**\n * The places under the avatar. Pass the ones the product has: Billing only when it sells, Administration only for an\n * admin. The frame draws them in its order (Profile, Settings, Billing, Administration), Settings landing on the settings home.\n */\n links?: Partial<Record<AccountLinkId, AppFrameAccountLink>>;\n /** Called by Sign out. */\n onSignOut: () => void;\n}\n\nexport interface AppFrameLanguage {\n value: string;\n options: readonly { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\nexport interface AppFrameTheme {\n value: Mode;\n onChange: (mode: Mode) => void;\n}\n\nexport interface AppFrameProps {\n /** The product's name, as text in the top bar. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"yomizaka\" size={26} />`): on the rail on a desktop, in the top bar on a phone. */\n mark: React.ReactNode;\n /** The mark in the top bar below `md` (smaller). Defaults to `mark`. */\n headerMark?: React.ReactNode;\n /** Where the mark and the name lead (`/app`). */\n homeHref: string;\n /** The product's brand: scopes its colours over the rail. */\n accent?: BrandId;\n /** The destinations. `place: \"foot\"` puts one at the rail's foot; `gated` leaves one out for this person. */\n sections: readonly FrameSection[];\n /** The id of the section the person is in. */\n currentId?: string;\n /** Who is signed in, the places under their avatar and Sign out. */\n account: AppFrameAccount;\n /** The one primary action of the app (« Check a document »). */\n primary?: React.ReactNode;\n /** The search (⌘K): opens the app's command palette. */\n search?: { label: string; onOpen: () => void };\n /** Notifications: an `AppHeaderCount`, or the trigger of the host's popover. */\n notifications?: React.ReactNode;\n /** Chips beside the name (`Dev`, `Local · Sovereign`). */\n chips?: React.ReactNode;\n /** `admin`: the administration's frame — a chip says so, and the way into it is not offered again. */\n variant?: \"app\" | \"admin\";\n /** The language row of the account menu; absent for a product with one language. */\n language?: AppFrameLanguage;\n /** The theme row. By default the `ThemeProvider`'s; pass `false` for a product that has none. */\n theme?: AppFrameTheme | false;\n /** `en` or `fr`: the words of the shared vocabulary. @default \"en\" */\n locale?: string;\n /** Overrides of the shared words, for a product that needs one different (use sparingly). */\n words?: Partial<NavWords>;\n /** The router's link component (Next's `Link`) for the rail and the menu. */\n linkAs?: React.ElementType;\n /** The page, inside `RailNav.Body` under the top bar. */\n children: React.ReactNode;\n /** The rail's accessible name. Defaults to the product's name. */\n label?: string;\n /**\n * `true`: every control of the frame (the rail's places and mark, the home link, the search, the account) is at least\n * 44 x 44 px, the touch-target floor of WCAG 2.5.5 and of the page audit's `smallTargets`. Off by default so a product\n * adopts it with its own visual baselines; the rail's places grow from 40 to 44 px on a desktop.\n * @default false\n */\n touchTargets?: boolean;\n}\n\n// The classes the frame adds to its own controls when `touchTargets` is on (tailwind-variants merges them over the defaults).\nconst TOUCH = {\n item: \"md:h-11\",\n mark: \"flex min-h-11 min-w-11 items-center justify-center\",\n home: \"min-h-11\",\n search: \"h-11 w-11\",\n account: \"min-h-11 min-w-11\",\n} as const;\n\nconst MODES: readonly Mode[] = [\"light\", \"dark\", \"system\"];\n\nfunction useFrameTheme(theme: AppFrameProps[\"theme\"]): AppFrameTheme | null {\n const provided = useOptionalTheme();\n if (theme === false) return null;\n if (theme) return theme;\n return provided ? { value: provided.mode, onChange: provided.setMode } : null;\n}\n\n/** The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out. */\nexport function AppFrame({\n name, mark, headerMark, homeHref, accent, sections, currentId, account, primary, search, notifications, chips, variant = \"app\", language, theme, locale = \"en\", words, linkAs: Link, children, label, touchTargets = false,\n}: AppFrameProps) {\n const w = { ...navVocabulary(locale), ...words };\n const admin = variant === \"admin\";\n const links = orderAccountLinks(account.links, admin);\n const places = framePlaces(sections, links.map((l) => l.id));\n const frameTheme = useFrameTheme(theme);\n const touch = (key: keyof typeof TOUCH) => (touchTargets ? TOUCH[key] : undefined);\n const item = (section: FrameSection) => (\n <RailNav.Item\n key={section.id}\n asChild={Boolean(Link)}\n href={Link ? undefined : section.href}\n icon={section.icon}\n label={section.label}\n current={section.id === currentId}\n badge={section.badge}\n badgeLabel={section.badgeLabel}\n className={touch(\"item\")}\n >\n {Link ? <Link href={section.href} /> : undefined}\n </RailNav.Item>\n );\n const menuLinks: AccountMenuLink[] = links.map(({ id, link }) => ({ id, label: link.label ?? w[id], href: link.href, icon: link.icon }));\n const modeLabels: Record<Mode, string> = { light: w.themeLight, dark: w.themeDark, system: w.themeSystem };\n return (\n <RailNav.Shell data-variant={variant}>\n <RailNav.Root\n label={label ?? name}\n accent={accent}\n mark={Link ? <Link href={homeHref} aria-label={name} className={touch(\"mark\")}>{mark}</Link> : <a href={homeHref} aria-label={name} className={touch(\"mark\")}>{mark}</a>}\n footer={places.foot.length > 0 ? places.foot.map(item) : undefined}\n >\n {places.main.map(item)}\n </RailNav.Root>\n <RailNav.Body>\n <AppHeader\n name={name}\n mark={headerMark ?? mark}\n href={Link ? undefined : homeHref}\n homeLink={Link && <Link href={homeHref} />}\n homeClassName={touch(\"home\")}\n chips={\n <>\n {admin && <Badge tone=\"accent\">{w.administration}</Badge>}\n {chips}\n </>\n }\n search={search && <AppHeaderSearch label={search.label} onOpen={search.onOpen} className={touch(\"search\")} />}\n notifications={notifications}\n primary={primary}\n account={\n <AccountMenu\n label={w.account}\n name={account.name}\n email={account.email}\n avatar={account.avatar}\n showName=\"lg\"\n links={menuLinks}\n linkAs={Link}\n className={touch(\"account\")}\n language={language && { label: w.language, value: language.value, options: language.options, onChange: language.onChange }}\n theme={frameTheme ? { label: w.theme, value: frameTheme.value, options: MODES.map((value) => ({ value, label: modeLabels[value] })), onChange: (value) => frameTheme.onChange(value as Mode) } : undefined}\n signOut={{ label: w.signOut, onSelect: account.onSignOut }}\n />\n }\n />\n {children}\n </RailNav.Body>\n </RailNav.Shell>\n );\n}\n","// Server-safe, pure. The rules of the signed-in frame, written once and tested (the audit's F1 and F2): what the account\n// menu holds and in which order, where a place lives (the rail or the avatar, never both), what a phone's tab bar can carry.\nimport type * as React from \"react\";\n\n/** The places the account menu can hold, in the order the frame draws them. */\nexport const ACCOUNT_LINK_IDS = [\"profile\", \"settings\", \"billing\", \"administration\"] as const;\nexport type AccountLinkId = (typeof ACCOUNT_LINK_IDS)[number];\n\n/** The account menu from top to bottom: who you are, the places, the preferences, Sign out. Fixed by the frame, not by the product. */\nexport const ACCOUNT_MENU_ORDER = [\"identity\", \"profile\", \"settings\", \"billing\", \"administration\", \"language\", \"theme\", \"signOut\"] as const;\n\n/** The most destinations a phone's tab bar carries (the rail's main items; the foot follows them in the same bar). */\nexport const MAIN_SECTIONS_MAX = 5;\n\nexport interface FrameSection {\n /** Stable id; `settings`, `billing`, `profile`, `administration` are the account menu's places. */\n id: string;\n label: string;\n href: string;\n icon: React.ReactNode;\n /** Not offered to this person (a permission, a feature not open): left out of the rail and the tab bar. */\n gated?: boolean;\n /** A count on the icon. */\n badge?: string | number;\n /** The count in words (« 3 to decide »). */\n badgeLabel?: string;\n /** `main`: what the person works in (the tab bar on a phone). `foot`: the rail's foot. @default \"main\" */\n place?: \"main\" | \"foot\";\n}\n\nexport interface FramePlaces {\n main: FrameSection[];\n foot: FrameSection[];\n /** Sections left out of the rail because the account menu already holds that place (or because they are gated). */\n dropped: { id: string; reason: \"account\" | \"gated\" }[];\n}\n\n/**\n * Splits the sections into the rail's main and foot, in the order given. A place is on the rail or under the avatar,\n * never both: a section whose id is one of the account links the frame was given leaves the rail (the avatar owns it).\n * A gated section leaves too.\n */\nexport function framePlaces(sections: readonly FrameSection[], accountLinks: readonly string[] = []): FramePlaces {\n const result: FramePlaces = { main: [], foot: [], dropped: [] };\n for (const section of sections) {\n if (section.gated) result.dropped.push({ id: section.id, reason: \"gated\" });\n else if (accountLinks.includes(section.id)) result.dropped.push({ id: section.id, reason: \"account\" });\n else result[section.place === \"foot\" ? \"foot\" : \"main\"].push(section);\n }\n return result;\n}\n\n/** The account links the frame draws, in the frame's order, whatever the order they were written in. Only what was passed. */\nexport function orderAccountLinks<T>(links: Partial<Record<AccountLinkId, T>> | undefined, admin = false): { id: AccountLinkId; link: T }[] {\n if (!links) return [];\n return ACCOUNT_LINK_IDS.flatMap((id) => {\n const link = links[id];\n // Inside the administration, the way into it is not offered again.\n return link && !(admin && id === \"administration\") ? [{ id, link }] : [];\n });\n}\n\n/** What is wrong with a frame's data, in words for the developer (empty: it is right). Used by the tests and by the dev warning. */\nexport function frameIssues(sections: readonly FrameSection[], accountLinks: readonly string[] = []): string[] {\n const issues: string[] = [];\n const ids = sections.map((s) => s.id);\n for (const id of new Set(ids)) if (ids.filter((x) => x === id).length > 1) issues.push(`The section \"${id}\" is declared twice.`);\n const places = framePlaces(sections, accountLinks);\n for (const { id, reason } of places.dropped) if (reason === \"account\") issues.push(`\"${id}\" is on the rail and under the avatar: a place is in one of them, so the rail drops it.`);\n if (places.main.length > MAIN_SECTIONS_MAX) issues.push(`${places.main.length} main sections: a phone's tab bar carries ${MAIN_SECTIONS_MAX} at most.`);\n return issues;\n}\n","// Server-safe: data and pure functions, no React. The words every Krizaka product says the same way (the audit's F4): the\n// frame's menus, the public bar's links and the footers read them, so « Docs », « Terms » and « Settings » never differ\n// between two products. English is the reference; a French key is required by the type.\nexport const navWords = {\n en: {\n docs: \"Docs\",\n terms: \"Terms\",\n privacy: \"Privacy\",\n settings: \"Settings\",\n billing: \"Billing\",\n profile: \"Profile\",\n administration: \"Administration\",\n account: \"Account\",\n language: \"Language\",\n theme: \"Theme\",\n themeLight: \"Light\",\n themeDark: \"Dark\",\n themeSystem: \"System\",\n signOut: \"Sign out\",\n howItWorks: \"How it works\",\n pricing: \"Pricing\",\n download: \"Download\",\n contact: \"Contact\",\n search: \"Search\",\n notifications: \"Notifications\",\n expand: \"Show the words\",\n collapse: \"Hide the words\",\n },\n fr: {\n docs: \"Docs\",\n terms: \"Conditions d'utilisation\",\n privacy: \"Confidentialité\",\n settings: \"Réglages\",\n billing: \"Facturation\",\n profile: \"Profil\",\n administration: \"Administration\",\n account: \"Compte\",\n language: \"Langue\",\n theme: \"Thème\",\n themeLight: \"Clair\",\n themeDark: \"Sombre\",\n themeSystem: \"Système\",\n signOut: \"Se déconnecter\",\n howItWorks: \"Comment ça marche\",\n pricing: \"Tarifs\",\n download: \"Télécharger\",\n contact: \"Contact\",\n search: \"Rechercher\",\n notifications: \"Notifications\",\n expand: \"Afficher les mots\",\n collapse: \"Masquer les mots\",\n },\n} as const satisfies Record<\"en\" | \"fr\", Record<string, string>>;\n\nexport type NavLocale = keyof typeof navWords;\nexport type NavWords = { [K in keyof (typeof navWords)[\"en\"]]: string };\nexport type NavWordKey = keyof NavWords;\n\n/** The words of a locale (`fr`, `fr-CA`…); any other falls back to English. */\nexport function navVocabulary(locale: string = \"en\"): NavWords {\n return navWords[locale.toLowerCase().startsWith(\"fr\") ? \"fr\" : \"en\"];\n}\n\n/** One word of the shared vocabulary. */\nexport function navWord(locale: string | undefined, key: NavWordKey): string {\n return navVocabulary(locale)[key];\n}\n\n/** The most links a product's public bar holds: past four, the bar is a menu in disguise (audit F3). */\nexport const PUBLIC_BAR_MAX = 4;\n\nexport type PublicBarSlot = \"howItWorks\" | \"pricing\" | \"docs\" | \"download\";\nexport interface PublicBarLink {\n id: PublicBarSlot;\n label: string;\n href: string;\n}\n\n/**\n * The one shape of a product's public bar: flat links, in this order, four at most — How it works · Pricing (when the\n * product has a price) · Docs · Download (when an app exists). Privacy and Terms are the footer's, « Overview » is the mark.\n * Pass the address of each slot the product has; the words come from the shared vocabulary.\n */\nexport function publicBarLinks(hrefs: Partial<Record<PublicBarSlot, string>>, locale?: string): PublicBarLink[] {\n const order: PublicBarSlot[] = [\"howItWorks\", \"pricing\", \"docs\", \"download\"];\n return order.flatMap((id) => {\n const href = hrefs[id];\n return href ? [{ id, label: navWord(locale, id), href }] : [];\n });\n}\n"],"mappings":";;;AAIA,SAAS,mBAAyC;AAClD,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAoB,wBAAwB;;;ACJrC,IAAM,mBAAmB,CAAC,WAAW,YAAY,WAAW,gBAAgB;AAI5E,IAAM,qBAAqB,CAAC,YAAY,WAAW,YAAY,WAAW,kBAAkB,Y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U,oBAAC,mBAAgB,OAAO,OAAO,OAAO,QAAQ,OAAO,QAAQ,WAAW,MAAM,QAAQ,GAAG;AAAA,UAC3G;AAAA,UACA;AAAA,UACA,SACE;AAAA,YAAC;AAAA;AAAA,cACC,OAAO,EAAE;AAAA,cACT,MAAM,QAAQ;AAAA,cACd,OAAO,QAAQ;AAAA,cACf,QAAQ,QAAQ;AAAA,cAChB,UAAS;AAAA,cACT,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,WAAW,MAAM,SAAS;AAAA,cAC1B,UAAU,YAAY,EAAE,OAAO,EAAE,UAAU,OAAO,SAAS,OAAO,SAAS,SAAS,SAAS,UAAU,SAAS,SAAS;AAAA,cACzH,OAAO,aAAa,EAAE,OAAO,EAAE,OAAO,OAAO,WAAW,OAAO,SAAS,MAAM,IAAI,CAAC,WAAW,EAAE,OAAO,OAAO,WAAW,KAAK,EAAE,EAAE,GAAG,UAAU,CAAC,UAAU,WAAW,SAAS,KAAa,EAAE,IAAI;AAAA,cACjM,SAAS,EAAE,OAAO,EAAE,SAAS,UAAU,QAAQ,UAAU;AAAA;AAAA,UAC3D;AAAA;AAAA,MAEJ;AAAA,MACC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/app-frame/app-frame.tsx","../src/app-frame/contract.ts","../src/app-frame/vocabulary.ts"],"sourcesContent":["// Client (the rail's state, the account menu, the theme). THE signed-in frame of every Krizaka web product (audit F1, F2,\n// F6): the rail (a bottom tab bar on a phone) and the family's top bar, composed once from data. The product keeps its\n// list of sections; the frame owns the rest — the account menu's content and order, where the preferences live (always in\n// the menu: a header has no room for them on a phone), which place is on the rail and which is under the avatar.\nimport { AccountMenu, type AccountMenuLink } from \"@krizaka/ui/account-menu\";\nimport { AppHeader } from \"@krizaka/ui/app-header\";\nimport { AppHeaderSearch } from \"@krizaka/ui/app-header/search\";\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { RailNav } from \"@krizaka/ui/rail-nav\";\nimport { type Mode, useOptionalTheme } from \"@krizaka/ui/theme\";\nimport * as React from \"react\";\n\nimport type { BrandId } from \"../marks/ProductLogo\";\nimport { type AccountLinkId, framePlaces, type FrameSection, orderAccountLinks } from \"./contract\";\nimport { navVocabulary, type NavWords } from \"./vocabulary\";\n\nexport interface AppFrameAccountLink {\n href: string;\n /** Overrides the shared word (`Credits and usage` for billing where credits exist). */\n label?: string;\n icon?: React.ReactNode;\n}\n\nexport interface AppFrameAccount {\n name?: string;\n email?: string;\n /** `src`, or `defaultAvatar` (`{ brand, seed }`). */\n avatar?: React.ComponentProps<typeof AccountMenu>[\"avatar\"];\n /**\n * The places under the avatar. Pass the ones the product has: Billing only when it sells, Administration only for an\n * admin. The frame draws them in its order (Profile, Settings, Billing, Administration), Settings landing on the settings home.\n */\n links?: Partial<Record<AccountLinkId, AppFrameAccountLink>>;\n /** Called by Sign out. */\n onSignOut: () => void;\n}\n\nexport interface AppFrameLanguage {\n value: string;\n options: readonly { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\nexport interface AppFrameTheme {\n value: Mode;\n onChange: (mode: Mode) => void;\n}\n\nexport interface AppFrameProps {\n /** The product's name, as text in the top bar. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"verikora\" size={26} />`): on the rail on a desktop, in the top bar on a phone. */\n mark: React.ReactNode;\n /** The mark in the top bar below `md` (smaller). Defaults to `mark`. */\n headerMark?: React.ReactNode;\n /** Where the mark and the name lead (`/app`). */\n homeHref: string;\n /** The product's brand: scopes its colours over the rail. */\n accent?: BrandId;\n /** The destinations. `place: \"foot\"` puts one at the rail's foot; `gated` leaves one out for this person. */\n sections: readonly FrameSection[];\n /** The id of the section the person is in. */\n currentId?: string;\n /** Who is signed in, the places under their avatar and Sign out. */\n account: AppFrameAccount;\n /** The one primary action of the app (« Check a document »). */\n primary?: React.ReactNode;\n /** The search (⌘K): opens the app's command palette. */\n search?: { label: string; onOpen: () => void };\n /** Notifications: an `AppHeaderCount`, or the trigger of the host's popover. */\n notifications?: React.ReactNode;\n /** Chips beside the name (`Dev`, `Local · Sovereign`). */\n chips?: React.ReactNode;\n /** `admin`: the administration's frame — a chip says so, and the way into it is not offered again. */\n variant?: \"app\" | \"admin\";\n /** The language row of the account menu; absent for a product with one language. */\n language?: AppFrameLanguage;\n /** The theme row. By default the `ThemeProvider`'s; pass `false` for a product that has none. */\n theme?: AppFrameTheme | false;\n /** `en` or `fr`: the words of the shared vocabulary. @default \"en\" */\n locale?: string;\n /** Overrides of the shared words, for a product that needs one different (use sparingly). */\n words?: Partial<NavWords>;\n /** The router's link component (Next's `Link`) for the rail and the menu. */\n linkAs?: React.ElementType;\n /** The page, inside `RailNav.Body` under the top bar. */\n children: React.ReactNode;\n /** The rail's accessible name. Defaults to the product's name. */\n label?: string;\n /**\n * `true`: every control of the frame (the rail's places and mark, the home link, the search, the account) is at least\n * 44 x 44 px, the touch-target floor of WCAG 2.5.5 and of the page audit's `smallTargets`. Off by default so a product\n * adopts it with its own visual baselines; the rail's places grow from 40 to 44 px on a desktop.\n * @default false\n */\n touchTargets?: boolean;\n}\n\n// The classes the frame adds to its own controls when `touchTargets` is on (tailwind-variants merges them over the defaults).\nconst TOUCH = {\n item: \"md:h-11\",\n mark: \"flex min-h-11 min-w-11 items-center justify-center\",\n home: \"min-h-11\",\n search: \"h-11 w-11\",\n account: \"min-h-11 min-w-11\",\n} as const;\n\nconst MODES: readonly Mode[] = [\"light\", \"dark\", \"system\"];\n\nfunction useFrameTheme(theme: AppFrameProps[\"theme\"]): AppFrameTheme | null {\n const provided = useOptionalTheme();\n if (theme === false) return null;\n if (theme) return theme;\n return provided ? { value: provided.mode, onChange: provided.setMode } : null;\n}\n\n/** The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out. */\nexport function AppFrame({\n name, mark, headerMark, homeHref, accent, sections, currentId, account, primary, search, notifications, chips, variant = \"app\", language, theme, locale = \"en\", words, linkAs: Link, children, label, touchTargets = false,\n}: AppFrameProps) {\n const w = { ...navVocabulary(locale), ...words };\n const admin = variant === \"admin\";\n const links = orderAccountLinks(account.links, admin);\n const places = framePlaces(sections, links.map((l) => l.id));\n const frameTheme = useFrameTheme(theme);\n const touch = (key: keyof typeof TOUCH) => (touchTargets ? TOUCH[key] : undefined);\n const item = (section: FrameSection) => (\n <RailNav.Item\n key={section.id}\n asChild={Boolean(Link)}\n href={Link ? undefined : section.href}\n icon={section.icon}\n label={section.label}\n current={section.id === currentId}\n badge={section.badge}\n badgeLabel={section.badgeLabel}\n className={touch(\"item\")}\n >\n {Link ? <Link href={section.href} /> : undefined}\n </RailNav.Item>\n );\n const menuLinks: AccountMenuLink[] = links.map(({ id, link }) => ({ id, label: link.label ?? w[id], href: link.href, icon: link.icon }));\n const modeLabels: Record<Mode, string> = { light: w.themeLight, dark: w.themeDark, system: w.themeSystem };\n return (\n <RailNav.Shell data-variant={variant}>\n <RailNav.Root\n label={label ?? name}\n accent={accent}\n mark={Link ? <Link href={homeHref} aria-label={name} className={touch(\"mark\")}>{mark}</Link> : <a href={homeHref} aria-label={name} className={touch(\"mark\")}>{mark}</a>}\n footer={places.foot.length > 0 ? places.foot.map(item) : undefined}\n >\n {places.main.map(item)}\n </RailNav.Root>\n <RailNav.Body>\n <AppHeader\n name={name}\n mark={headerMark ?? mark}\n href={Link ? undefined : homeHref}\n homeLink={Link && <Link href={homeHref} />}\n homeClassName={touch(\"home\")}\n chips={\n <>\n {admin && <Badge tone=\"accent\">{w.administration}</Badge>}\n {chips}\n </>\n }\n search={search && <AppHeaderSearch label={search.label} onOpen={search.onOpen} className={touch(\"search\")} />}\n notifications={notifications}\n primary={primary}\n account={\n <AccountMenu\n label={w.account}\n name={account.name}\n email={account.email}\n avatar={account.avatar}\n showName=\"lg\"\n links={menuLinks}\n linkAs={Link}\n className={touch(\"account\")}\n language={language && { label: w.language, value: language.value, options: language.options, onChange: language.onChange }}\n theme={frameTheme ? { label: w.theme, value: frameTheme.value, options: MODES.map((value) => ({ value, label: modeLabels[value] })), onChange: (value) => frameTheme.onChange(value as Mode) } : undefined}\n signOut={{ label: w.signOut, onSelect: account.onSignOut }}\n />\n }\n />\n {children}\n </RailNav.Body>\n </RailNav.Shell>\n );\n}\n","// Server-safe, pure. The rules of the signed-in frame, written once and tested (the audit's F1 and F2): what the account\n// menu holds and in which order, where a place lives (the rail or the avatar, never both), what a phone's tab bar can carry.\nimport type * as React from \"react\";\n\n/** The places the account menu can hold, in the order the frame draws them. */\nexport const ACCOUNT_LINK_IDS = [\"profile\", \"settings\", \"billing\", \"administration\"] as const;\nexport type AccountLinkId = (typeof ACCOUNT_LINK_IDS)[number];\n\n/** The account menu from top to bottom: who you are, the places, the preferences, Sign out. Fixed by the frame, not by the product. */\nexport const ACCOUNT_MENU_ORDER = [\"identity\", \"profile\", \"settings\", \"billing\", \"administration\", \"language\", \"theme\", \"signOut\"] as const;\n\n/** The most destinations a phone's tab bar carries (the rail's main items; the foot follows them in the same bar). */\nexport const MAIN_SECTIONS_MAX = 5;\n\nexport interface FrameSection {\n /** Stable id; `settings`, `billing`, `profile`, `administration` are the account menu's places. */\n id: string;\n label: string;\n href: string;\n icon: React.ReactNode;\n /** Not offered to this person (a permission, a feature not open): left out of the rail and the tab bar. */\n gated?: boolean;\n /** A count on the icon. */\n badge?: string | number;\n /** The count in words (« 3 to decide »). */\n badgeLabel?: string;\n /** `main`: what the person works in (the tab bar on a phone). `foot`: the rail's foot. @default \"main\" */\n place?: \"main\" | \"foot\";\n}\n\nexport interface FramePlaces {\n main: FrameSection[];\n foot: FrameSection[];\n /** Sections left out of the rail because the account menu already holds that place (or because they are gated). */\n dropped: { id: string; reason: \"account\" | \"gated\" }[];\n}\n\n/**\n * Splits the sections into the rail's main and foot, in the order given. A place is on the rail or under the avatar,\n * never both: a section whose id is one of the account links the frame was given leaves the rail (the avatar owns it).\n * A gated section leaves too.\n */\nexport function framePlaces(sections: readonly FrameSection[], accountLinks: readonly string[] = []): FramePlaces {\n const result: FramePlaces = { main: [], foot: [], dropped: [] };\n for (const section of sections) {\n if (section.gated) result.dropped.push({ id: section.id, reason: \"gated\" });\n else if (accountLinks.includes(section.id)) result.dropped.push({ id: section.id, reason: \"account\" });\n else result[section.place === \"foot\" ? \"foot\" : \"main\"].push(section);\n }\n return result;\n}\n\n/** The account links the frame draws, in the frame's order, whatever the order they were written in. Only what was passed. */\nexport function orderAccountLinks<T>(links: Partial<Record<AccountLinkId, T>> | undefined, admin = false): { id: AccountLinkId; link: T }[] {\n if (!links) return [];\n return ACCOUNT_LINK_IDS.flatMap((id) => {\n const link = links[id];\n // Inside the administration, the way into it is not offered again.\n return link && !(admin && id === \"administration\") ? [{ id, link }] : [];\n });\n}\n\n/** What is wrong with a frame's data, in words for the developer (empty: it is right). Used by the tests and by the dev warning. */\nexport function frameIssues(sections: readonly FrameSection[], accountLinks: readonly string[] = []): string[] {\n const issues: string[] = [];\n const ids = sections.map((s) => s.id);\n for (const id of new Set(ids)) if (ids.filter((x) => x === id).length > 1) issues.push(`The section \"${id}\" is declared twice.`);\n const places = framePlaces(sections, accountLinks);\n for (const { id, reason } of places.dropped) if (reason === \"account\") issues.push(`\"${id}\" is on the rail and under the avatar: a place is in one of them, so the rail drops it.`);\n if (places.main.length > MAIN_SECTIONS_MAX) issues.push(`${places.main.length} main sections: a phone's tab bar carries ${MAIN_SECTIONS_MAX} at most.`);\n return issues;\n}\n","// Server-safe: data and pure functions, no React. The words every Krizaka product says the same way (the audit's F4): the\n// frame's menus, the public bar's links and the footers read them, so « Docs », « Terms » and « Settings » never differ\n// between two products. English is the reference; a French key is required by the type.\nexport const navWords = {\n en: {\n docs: \"Docs\",\n terms: \"Terms\",\n privacy: \"Privacy\",\n settings: \"Settings\",\n billing: \"Billing\",\n profile: \"Profile\",\n administration: \"Administration\",\n account: \"Account\",\n language: \"Language\",\n theme: \"Theme\",\n themeLight: \"Light\",\n themeDark: \"Dark\",\n themeSystem: \"System\",\n signOut: \"Sign out\",\n howItWorks: \"How it works\",\n pricing: \"Pricing\",\n download: \"Download\",\n contact: \"Contact\",\n search: \"Search\",\n notifications: \"Notifications\",\n expand: \"Show the words\",\n collapse: \"Hide the words\",\n },\n fr: {\n docs: \"Docs\",\n terms: \"Conditions d'utilisation\",\n privacy: \"Confidentialité\",\n settings: \"Réglages\",\n billing: \"Facturation\",\n profile: \"Profil\",\n administration: \"Administration\",\n account: \"Compte\",\n language: \"Langue\",\n theme: \"Thème\",\n themeLight: \"Clair\",\n themeDark: \"Sombre\",\n themeSystem: \"Système\",\n signOut: \"Se déconnecter\",\n howItWorks: \"Comment ça marche\",\n pricing: \"Tarifs\",\n download: \"Télécharger\",\n contact: \"Contact\",\n search: \"Rechercher\",\n notifications: \"Notifications\",\n expand: \"Afficher les mots\",\n collapse: \"Masquer les mots\",\n },\n} as const satisfies Record<\"en\" | \"fr\", Record<string, string>>;\n\nexport type NavLocale = keyof typeof navWords;\nexport type NavWords = { [K in keyof (typeof navWords)[\"en\"]]: string };\nexport type NavWordKey = keyof NavWords;\n\n/** The words of a locale (`fr`, `fr-CA`…); any other falls back to English. */\nexport function navVocabulary(locale: string = \"en\"): NavWords {\n return navWords[locale.toLowerCase().startsWith(\"fr\") ? \"fr\" : \"en\"];\n}\n\n/** One word of the shared vocabulary. */\nexport function navWord(locale: string | undefined, key: NavWordKey): string {\n return navVocabulary(locale)[key];\n}\n\n/** The most links a product's public bar holds: past four, the bar is a menu in disguise (audit F3). */\nexport const PUBLIC_BAR_MAX = 4;\n\nexport type PublicBarSlot = \"howItWorks\" | \"pricing\" | \"docs\" | \"download\";\nexport interface PublicBarLink {\n id: PublicBarSlot;\n label: string;\n href: string;\n}\n\n/**\n * The one shape of a product's public bar: flat links, in this order, four at most — How it works · Pricing (when the\n * product has a price) · Docs · Download (when an app exists). Privacy and Terms are the footer's, « Overview » is the mark.\n * Pass the address of each slot the product has; the words come from the shared vocabulary.\n */\nexport function publicBarLinks(hrefs: Partial<Record<PublicBarSlot, string>>, locale?: string): PublicBarLink[] {\n const order: PublicBarSlot[] = [\"howItWorks\", \"pricing\", \"docs\", \"download\"];\n return order.flatMap((id) => {\n const href = hrefs[id];\n return href ? [{ id, label: navWord(locale, id), href }] : [];\n });\n}\n"],"mappings":";;;AAIA,SAAS,mBAAyC;AAClD,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAoB,wBAAwB;;;ACJrC,IAAM,mBAAmB,CAAC,WAAW,YAAY,WAAW,gBAAgB;AAI5E,IAAM,qBAAqB,CAAC,YAAY,WAAW,YAAY,WAAW,kBAAkB,YAAY,SAAS,SAAS;AAG1H,IAAM,oBAAoB;AA8B1B,SAAS,YAAY,UAAmC,eAAkC,CAAC,GAAgB;AAChH,QAAM,SAAsB,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE;AAC9D,aAAW,WAAW,UAAU;AAC9B,QAAI,QAAQ,MAAO,QAAO,QAAQ,KAAK,EAAE,IAAI,QAAQ,IAAI,QAAQ,QAAQ,CAAC;AAAA,aACjE,aAAa,SAAS,QAAQ,EAAE,EAAG,QAAO,QAAQ,KAAK,EAAE,IAAI,QAAQ,IAAI,QAAQ,UAAU,CAAC;AAAA,QAChG,QAAO,QAAQ,UAAU,SAAS,SAAS,MAAM,EAAE,KAAK,OAAO;AAAA,EACtE;AACA,SAAO;AACT;AAGO,SAAS,kBAAqB,OAAsD,QAAQ,OAAyC;AAC1I,MAAI,CAAC,MAAO,QAAO,CAAC;AACpB,SAAO,iBAAiB,QAAQ,CAAC,OAAO;AACtC,UAAM,OAAO,MAAM,EAAE;AAErB,WAAO,QAAQ,EAAE,SAAS,OAAO,oBAAoB,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC;AAAA,EACzE,CAAC;AACH;AAGO,SAAS,YAAY,UAAmC,eAAkC,CAAC,GAAa;AAC7G,QAAM,SAAmB,CAAC;AAC1B,QAAM,MAAM,SAAS,IAAI,CAAC,MAAM,EAAE,EAAE;AACpC,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
|
|
65
65
|
type AppHeaderProps = Omit<React.ComponentProps<"header">, "children"> & {
|
|
66
|
-
/** The product's name, as text (`
|
|
66
|
+
/** The product's name, as text (`Sovkora`): the only brand element on a desktop. */
|
|
67
67
|
name: string;
|
|
68
|
-
/** The product's mark (`<ProductLogo id="
|
|
68
|
+
/** The product's mark (`<ProductLogo id="sovkora" size={22} />`): shown below `md` only, where the rail (which carries it) is a bottom bar. */
|
|
69
69
|
mark?: React.ReactNode;
|
|
70
70
|
/** Makes the name (and the mark) a link home: pass your router's link as `homeLink` or give a `href`. */
|
|
71
71
|
href?: string;
|
package/dist/app-header.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/app-header/app-header.tsx","../src/app-header/count.tsx","../src/app-header/count-text.ts"],"sourcesContent":["// Server-safe: no hook, no context. The family's top bar (#640): the product's NAME as text (the mark is the rail's), optional\n// chips, then the session's controls in a fixed order — search, language, the host's actions (a theme toggle), messages,\n// notifications, the primary action, the account. Every slot is the host's; a slot left empty draws nothing. Where the\n// rail is a bottom tab bar (a phone) it has no room for the mark, so the header shows it there and only there: exactly\n// one brand mark is visible at every width. At 360 px the name truncates first; the controls never clip.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const appHeader = tv({\n slots: {\n root: \"sticky top-0 z-30 flex h-14 w-full min-w-0 shrink-0 items-center gap-3 border-b border-border-subtle bg-surface-1 px-4 md:bg-surface-1 md:pl-3 md:pr-5\",\n // The rail's mark is 56 px tall and so is this bar: the word shares the mark's line, right after the rail.\n brand: \"flex min-w-0 items-center gap-2 font-display text-sm font-bold tracking-tight text-fg no-underline\",\n mark: \"inline-flex shrink-0 md:hidden\",\n name: \"truncate\",\n chips: \"flex shrink-0 items-center gap-2\",\n // The controls: one row at the right, in the order of the slots. They keep their size; the name gives way.\n actions: \"ml-auto flex shrink-0 items-center gap-1 sm:gap-2\",\n search: \"flex min-w-0 shrink-0\",\n },\n});\nconst s = appHeader();\n\nexport type AppHeaderProps = Omit<React.ComponentProps<\"header\">, \"children\"> & {\n /** The product's name, as text (`Orazaka`): the only brand element on a desktop. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"orazaka\" size={22} />`): shown below `md` only, where the rail (which carries it) is a bottom bar. */\n mark?: React.ReactNode;\n /** Makes the name (and the mark) a link home: pass your router's link as `homeLink` or give a `href`. */\n href?: string;\n /** Your router's link element for the home link; it receives the name and the mark as children. */\n homeLink?: React.ReactElement<{ className?: string; children?: React.ReactNode }>;\n /** Classes added to the home link (from `href` or `homeLink`), e.g. a 44 px floor; the header fills the link itself. */\n homeClassName?: string;\n /** Status chips beside the name (`Badge`): « Local · Sovereign », « Dev », a version. */\n chips?: React.ReactNode;\n /** The search trigger, first of the controls: `AppHeaderSearch` (`@krizaka/ui/app-header/search`) — a field from `md`, an icon below, ⌘K. */\n search?: React.ReactNode;\n /** The language: `LanguageSwitch` (`@krizaka/ui/language-switch`) — a globe and « FR », labelled. */\n language?: React.ReactNode;\n /** The host's own controls, after the language (a theme toggle). Alone, it is the whole right side, as before. */\n actions?: React.ReactNode;\n /** Messages: an `AppHeaderCount` (an icon button or link with its unread count). Empty: hidden. */\n messages?: React.ReactNode;\n /** Notifications: an `AppHeaderCount` (or the trigger of the host's popover). Empty: hidden. */\n notifications?: React.ReactNode;\n /** The one primary action of the app (« New check », #588), before the account. */\n primary?: React.ReactNode;\n /** The account, last: `AccountMenu` with `showName` (the name from `sm`), or the visitor's Sign in. */\n account?: React.ReactNode;\n};\n\n/** The app's top bar: the name next to the rail, the mark on a phone, chips, then search · language · actions · messages · notifications · primary · account. */\nexport function AppHeader({ name, mark, href, homeLink, homeClassName, chips, search, language, actions, messages, notifications, primary, account, className, ...props }: AppHeaderProps) {\n const brand = (\n <>\n {mark && <span data-brand-mark className={s.mark()}>{mark}</span>}\n <span className={s.name()}>{name}</span>\n </>\n );\n const hasControls = [search, language, actions, messages, notifications, primary, account].some(Boolean);\n return (\n <header className={s.root({ className })} {...props}>\n {homeLink ? (\n React.cloneElement(homeLink, { className: s.brand({ className: [homeLink.props.className, homeClassName] }) }, brand)\n ) : href ? (\n <a href={href} className={s.brand({ className: homeClassName })}>{brand}</a>\n ) : (\n <div className={s.brand()}>{brand}</div>\n )}\n {chips && <div className={s.chips()}>{chips}</div>}\n {/* The order is the family's, not the host's: the same bar in every product. */}\n {hasControls && (\n <div className={s.actions()}>\n {search && <div data-slot=\"search\" className={s.search()}>{search}</div>}\n {language}\n {actions}\n {messages}\n {notifications}\n {primary}\n {account}\n </div>\n )}\n </header>\n );\n}\n","// Server-safe: no hook. An icon control of the top bar with an unread count — messages, notifications. A link (`href`, your\n// router's `linkAs`) or a button (the trigger of the host's popover, through `asChild` of Radix: its props and ref are\n// spread here). The count is drawn as a small badge and said in the name: « Notifications, 3 new ».\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { countName, countText } from \"./count-text\";\n\nexport const appHeaderCount = tv({\n slots: {\n root:\n \"relative inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-fg-secondary no-underline transition-colors \" +\n \"hover:bg-surface-2 hover:text-fg aria-expanded:bg-surface-2 aria-expanded:text-fg aria-[current=page]:bg-surface-2 aria-[current=page]:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none\",\n icon: \"inline-flex h-5 w-5 items-center justify-center [&>svg]:h-5 [&>svg]:w-5\",\n count:\n \"pointer-events-none absolute -right-0.5 -top-0.5 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-accent px-1 \" +\n \"font-mono text-[10px] font-bold leading-none tabular-nums text-on-accent ring-2 ring-surface-1\",\n },\n});\nconst s = appHeaderCount();\n\nexport type AppHeaderCountProps = Omit<React.ComponentProps<\"button\">, \"children\"> & {\n /** What it is (« Notifications », « Messages ») — passed translated; its accessible name, with the count. */\n label: string;\n /** The icon (`<NotificationIcon />` of @krizaka/icons): decorative, the name is `label`. */\n icon: React.ReactNode;\n /** The unread count; 0 or absent draws no badge. */\n count?: number;\n /** The count in words, said after the label (« 3 new », « 3 nouvelles ») — passed translated, with its plural. Default: the number. */\n countLabel?: string;\n /**\n * Above it the badge shows `max+`.\n * @default 99\n */\n max?: number;\n /** A link to the page (`/notifications`) instead of a button. */\n href?: string;\n /** Your router's link (Next's `Link`) for `href`; an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /** The page is the one it leads to (`aria-current=\"page\"`). */\n current?: boolean;\n};\n\n/** An icon button or link of the top bar with an unread count, the count announced in its name. */\nexport function AppHeaderCount({ label, icon, count, countLabel, max = 99, href, linkAs, current, className, type, ...props }: AppHeaderCountProps) {\n const text = countText(count, max);\n const shared = {\n ...props,\n \"aria-label\": countName(label, count, countLabel),\n \"aria-current\": current ? (\"page\" as const) : undefined,\n \"data-unread\": text ? \"\" : undefined,\n className: s.root({ className }),\n };\n const children = (\n <>\n <span aria-hidden className={s.icon()}>{icon}</span>\n {text && <span aria-hidden data-count className={s.count()}>{text}</span>}\n </>\n );\n if (href) {\n const Link = linkAs ?? \"a\";\n return <Link href={href} {...shared}>{children}</Link>;\n }\n return <button type={type ?? \"button\"} {...shared}>{children}</button>;\n}\n","// Pure, no import: shared by the web's AppHeaderCount and the native one (src/native/app-header.tsx).\n\n/** What the badge shows: the count, or `max+` above `max`; nothing at 0. */\nexport function countText(count: number | undefined, max = 99): string | null {\n if (!count || count <= 0 || !Number.isFinite(count)) return null;\n return count > max ? `${max}+` : String(Math.floor(count));\n}\n\n/** The control's accessible name: the label alone, or the label and the count's words (« Notifications, 3 new »). */\nexport function countName(label: string, count: number | undefined, countLabel?: string): string {\n if (!countText(count, Number.POSITIVE_INFINITY)) return label;\n return `${label}, ${countLabel ?? String(Math.floor(count!))}`;\n}\n"],"mappings":";AAKA,YAAY,WAAW;AACvB,SAAS,UAAU;AAiDf,mBACW,KADX;AA/CG,IAAM,YAAY,GAAG;AAAA,EAC1B,OAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,OAAO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AQ,UAAW,GAAG,QAAS,UAAS;AAC/D;","names":["tv","Fragment","jsx","jsxs","tv","s"]}
|
|
1
|
+
{"version":3,"sources":["../src/app-header/app-header.tsx","../src/app-header/count.tsx","../src/app-header/count-text.ts"],"sourcesContent":["// Server-safe: no hook, no context. The family's top bar (#640): the product's NAME as text (the mark is the rail's), optional\n// chips, then the session's controls in a fixed order — search, language, the host's actions (a theme toggle), messages,\n// notifications, the primary action, the account. Every slot is the host's; a slot left empty draws nothing. Where the\n// rail is a bottom tab bar (a phone) it has no room for the mark, so the header shows it there and only there: exactly\n// one brand mark is visible at every width. At 360 px the name truncates first; the controls never clip.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const appHeader = tv({\n slots: {\n root: \"sticky top-0 z-30 flex h-14 w-full min-w-0 shrink-0 items-center gap-3 border-b border-border-subtle bg-surface-1 px-4 md:bg-surface-1 md:pl-3 md:pr-5\",\n // The rail's mark is 56 px tall and so is this bar: the word shares the mark's line, right after the rail.\n brand: \"flex min-w-0 items-center gap-2 font-display text-sm font-bold tracking-tight text-fg no-underline\",\n mark: \"inline-flex shrink-0 md:hidden\",\n name: \"truncate\",\n chips: \"flex shrink-0 items-center gap-2\",\n // The controls: one row at the right, in the order of the slots. They keep their size; the name gives way.\n actions: \"ml-auto flex shrink-0 items-center gap-1 sm:gap-2\",\n search: \"flex min-w-0 shrink-0\",\n },\n});\nconst s = appHeader();\n\nexport type AppHeaderProps = Omit<React.ComponentProps<\"header\">, \"children\"> & {\n /** The product's name, as text (`Sovkora`): the only brand element on a desktop. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"sovkora\" size={22} />`): shown below `md` only, where the rail (which carries it) is a bottom bar. */\n mark?: React.ReactNode;\n /** Makes the name (and the mark) a link home: pass your router's link as `homeLink` or give a `href`. */\n href?: string;\n /** Your router's link element for the home link; it receives the name and the mark as children. */\n homeLink?: React.ReactElement<{ className?: string; children?: React.ReactNode }>;\n /** Classes added to the home link (from `href` or `homeLink`), e.g. a 44 px floor; the header fills the link itself. */\n homeClassName?: string;\n /** Status chips beside the name (`Badge`): « Local · Sovereign », « Dev », a version. */\n chips?: React.ReactNode;\n /** The search trigger, first of the controls: `AppHeaderSearch` (`@krizaka/ui/app-header/search`) — a field from `md`, an icon below, ⌘K. */\n search?: React.ReactNode;\n /** The language: `LanguageSwitch` (`@krizaka/ui/language-switch`) — a globe and « FR », labelled. */\n language?: React.ReactNode;\n /** The host's own controls, after the language (a theme toggle). Alone, it is the whole right side, as before. */\n actions?: React.ReactNode;\n /** Messages: an `AppHeaderCount` (an icon button or link with its unread count). Empty: hidden. */\n messages?: React.ReactNode;\n /** Notifications: an `AppHeaderCount` (or the trigger of the host's popover). Empty: hidden. */\n notifications?: React.ReactNode;\n /** The one primary action of the app (« New check », #588), before the account. */\n primary?: React.ReactNode;\n /** The account, last: `AccountMenu` with `showName` (the name from `sm`), or the visitor's Sign in. */\n account?: React.ReactNode;\n};\n\n/** The app's top bar: the name next to the rail, the mark on a phone, chips, then search · language · actions · messages · notifications · primary · account. */\nexport function AppHeader({ name, mark, href, homeLink, homeClassName, chips, search, language, actions, messages, notifications, primary, account, className, ...props }: AppHeaderProps) {\n const brand = (\n <>\n {mark && <span data-brand-mark className={s.mark()}>{mark}</span>}\n <span className={s.name()}>{name}</span>\n </>\n );\n const hasControls = [search, language, actions, messages, notifications, primary, account].some(Boolean);\n return (\n <header className={s.root({ className })} {...props}>\n {homeLink ? (\n React.cloneElement(homeLink, { className: s.brand({ className: [homeLink.props.className, homeClassName] }) }, brand)\n ) : href ? (\n <a href={href} className={s.brand({ className: homeClassName })}>{brand}</a>\n ) : (\n <div className={s.brand()}>{brand}</div>\n )}\n {chips && <div className={s.chips()}>{chips}</div>}\n {/* The order is the family's, not the host's: the same bar in every product. */}\n {hasControls && (\n <div className={s.actions()}>\n {search && <div data-slot=\"search\" className={s.search()}>{search}</div>}\n {language}\n {actions}\n {messages}\n {notifications}\n {primary}\n {account}\n </div>\n )}\n </header>\n );\n}\n","// Server-safe: no hook. An icon control of the top bar with an unread count — messages, notifications. A link (`href`, your\n// router's `linkAs`) or a button (the trigger of the host's popover, through `asChild` of Radix: its props and ref are\n// spread here). The count is drawn as a small badge and said in the name: « Notifications, 3 new ».\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { countName, countText } from \"./count-text\";\n\nexport const appHeaderCount = tv({\n slots: {\n root:\n \"relative inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-fg-secondary no-underline transition-colors \" +\n \"hover:bg-surface-2 hover:text-fg aria-expanded:bg-surface-2 aria-expanded:text-fg aria-[current=page]:bg-surface-2 aria-[current=page]:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none\",\n icon: \"inline-flex h-5 w-5 items-center justify-center [&>svg]:h-5 [&>svg]:w-5\",\n count:\n \"pointer-events-none absolute -right-0.5 -top-0.5 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-accent px-1 \" +\n \"font-mono text-[10px] font-bold leading-none tabular-nums text-on-accent ring-2 ring-surface-1\",\n },\n});\nconst s = appHeaderCount();\n\nexport type AppHeaderCountProps = Omit<React.ComponentProps<\"button\">, \"children\"> & {\n /** What it is (« Notifications », « Messages ») — passed translated; its accessible name, with the count. */\n label: string;\n /** The icon (`<NotificationIcon />` of @krizaka/icons): decorative, the name is `label`. */\n icon: React.ReactNode;\n /** The unread count; 0 or absent draws no badge. */\n count?: number;\n /** The count in words, said after the label (« 3 new », « 3 nouvelles ») — passed translated, with its plural. Default: the number. */\n countLabel?: string;\n /**\n * Above it the badge shows `max+`.\n * @default 99\n */\n max?: number;\n /** A link to the page (`/notifications`) instead of a button. */\n href?: string;\n /** Your router's link (Next's `Link`) for `href`; an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /** The page is the one it leads to (`aria-current=\"page\"`). */\n current?: boolean;\n};\n\n/** An icon button or link of the top bar with an unread count, the count announced in its name. */\nexport function AppHeaderCount({ label, icon, count, countLabel, max = 99, href, linkAs, current, className, type, ...props }: AppHeaderCountProps) {\n const text = countText(count, max);\n const shared = {\n ...props,\n \"aria-label\": countName(label, count, countLabel),\n \"aria-current\": current ? (\"page\" as const) : undefined,\n \"data-unread\": text ? \"\" : undefined,\n className: s.root({ className }),\n };\n const children = (\n <>\n <span aria-hidden className={s.icon()}>{icon}</span>\n {text && <span aria-hidden data-count className={s.count()}>{text}</span>}\n </>\n );\n if (href) {\n const Link = linkAs ?? \"a\";\n return <Link href={href} {...shared}>{children}</Link>;\n }\n return <button type={type ?? \"button\"} {...shared}>{children}</button>;\n}\n","// Pure, no import: shared by the web's AppHeaderCount and the native one (src/native/app-header.tsx).\n\n/** What the badge shows: the count, or `max+` above `max`; nothing at 0. */\nexport function countText(count: number | undefined, max = 99): string | null {\n if (!count || count <= 0 || !Number.isFinite(count)) return null;\n return count > max ? `${max}+` : String(Math.floor(count));\n}\n\n/** The control's accessible name: the label alone, or the label and the count's words (« Notifications, 3 new »). */\nexport function countName(label: string, count: number | undefined, countLabel?: string): string {\n if (!countText(count, Number.POSITIVE_INFINITY)) return label;\n return `${label}, ${countLabel ?? String(Math.floor(count!))}`;\n}\n"],"mappings":";AAKA,YAAY,WAAW;AACvB,SAAS,UAAU;AAiDf,mBACW,KADX;AA/CG,IAAM,YAAY,GAAG;AAAA,EAC1B,OAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA;AAAA,IAEP,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AACF,CAAC;AACD,IAAM,IAAI,UAAU;AAgCb,SAAS,UAAU,EAAE,MAAM,MAAM,MAAM,UAAU,eAAe,OAAO,QAAQ,UAAU,SAAS,UAAU,eAAe,SAAS,SAAS,WAAW,GAAG,MAAM,GAAmB;AACzL,QAAM,QACJ,iCACG;AAAA,YAAQ,oBAAC,UAAK,mBAAe,MAAC,WAAW,EAAE,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F,QAAAC,aAAA;AA/CG,IAAM,iBAAiBC,IAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MACE;AAAA,IAGF,MAAM;AAAA,IACN,OACE;AAAA,EAEJ;AACF,CAAC;AACD,IAAMC,KAAI,eAAe;AAyBlB,SAAS,eAAe,EAAE,OAAO,MAAM,OAAO,YAAY,MAAM,IAAI,MAAM,QAAQ,SAAS,WAAW,MAAM,GAAG,MAAM,GAAwB;AAClJ,QAAM,OAAO,UAAU,OAAO,GAAG;AACjC,QAAM,SAAS;AAAA,IACb,GAAG;AAAA,IACH,cAAc,UAAU,OAAO,OAAO,UAAU;AAAA,IAChD,gBAAgB,UAAW,SAAmB;AAAA,IAC9C,eAAe,OAAO,KAAK;AAAA,IAC3B,WAAWA,GAAE,KAAK,EAAE,UAAU,CAAC;AAAA,EACjC;AACA,QAAM,WACJ,gBAAAF,MAAAF,WAAA,EACE;AAAA,oBAAAC,KAAC,UAAK,eAAW,MAAC,WAAWG,GAAE,KAAK,GAAI,gBAAK;AAAA,IAC5C,QAAQ,gBAAAH,KAAC,UAAK,eAAW,MAAC,cAAU,MAAC,WAAWG,GAAE,MAAM,GAAI,gBAAK;AAAA,KACpE;AAEF,MAAI,MAAM;AACR,UAAM,OAAO,UAAU;AACvB,WAAO,gBAAAH,KAAC,QAAK,MAAa,GAAG,QAAS,UAAS;AAAA,EACjD;AACA,SAAO,gBAAAA,KAAC,YAAO,MAAM,QAAQ,UAAW,GAAG,QAAS,UAAS;AAC/D;","names":["tv","Fragment","jsx","jsxs","tv","s"]}
|
package/dist/app-shell.d.ts
CHANGED
|
@@ -180,7 +180,7 @@ type AppShellRootProps = React.ComponentProps<"div"> & {
|
|
|
180
180
|
*/
|
|
181
181
|
collapseShortcut?: string | false;
|
|
182
182
|
/**
|
|
183
|
-
* The shell is a desktop app's window (the
|
|
183
|
+
* The shell is a desktop app's window (the Sovkora Mac app, Tauri 2 — ADR-002): no drawer, the sidebar's top clears the
|
|
184
184
|
* window's traffic lights (`--kz-titlebar-inset`, 28 px; the window's height is `--kz-window-height`, the viewport by default), the header and that top move the window
|
|
185
185
|
* (`data-tauri-drag-region`), a denser layout, the chrome not selectable. In a browser it is a fixed-height shell.
|
|
186
186
|
*/
|