@krizaka/ui 3.64.1 → 3.66.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 +3 -0
- package/dist/account-menu.d.ts +7 -3
- package/dist/account-menu.js +14 -10
- package/dist/account-menu.js.map +1 -1
- package/dist/account-settings.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/app-frame/server.d.ts +123 -0
- package/dist/app-frame/server.js +109 -0
- package/dist/app-frame/server.js.map +1 -0
- package/dist/app-frame.d.ts +210 -0
- package/dist/app-frame.js +220 -0
- package/dist/app-frame.js.map +1 -0
- package/dist/app-header/search.js +1 -1
- package/dist/app-header.d.ts +3 -3
- package/dist/app-shell.js +1 -1
- package/dist/argument-card.js +2 -2
- package/dist/audio-player.js +1 -1
- package/dist/{chunk-5QEXOGO2.js → chunk-6BMKLAZ7.js} +1 -1
- package/dist/{chunk-XCBVFMNV.js.map → chunk-6BMKLAZ7.js.map} +1 -1
- package/dist/{chunk-SHBYNQFS.js → chunk-7DYZTEE3.js} +1 -1
- package/dist/{chunk-SHBYNQFS.js.map → chunk-7DYZTEE3.js.map} +1 -1
- package/dist/{chunk-YCZ7N6Q6.js → chunk-7MQNG35Q.js} +2 -2
- package/dist/{chunk-XCBVFMNV.js → chunk-C57KK5VB.js} +7 -2
- package/dist/chunk-C57KK5VB.js.map +1 -0
- package/dist/{chunk-VB7MWE2N.js → chunk-DSDFXPL6.js} +2 -2
- package/dist/{chunk-P7GZR5CU.js → chunk-GFRUTPGG.js} +1 -1
- package/dist/{chunk-P7GZR5CU.js.map → chunk-GFRUTPGG.js.map} +1 -1
- package/dist/{chunk-4GQH27IT.js → chunk-GW5EI7MI.js} +2 -2
- package/dist/{chunk-F6JTHPHE.js → chunk-I6EOLPSH.js} +2 -2
- package/dist/chunk-NG6G6V5E.js +33 -0
- package/dist/{chunk-5QEXOGO2.js.map → chunk-NG6G6V5E.js.map} +1 -1
- package/dist/{chunk-CPA5CF35.js → chunk-PGBF3UBX.js} +1 -1
- package/dist/{chunk-CPA5CF35.js.map → chunk-PGBF3UBX.js.map} +1 -1
- package/dist/{chunk-BG5APGX6.js → chunk-Q5DYWQ6S.js} +4 -4
- package/dist/{chunk-RCKXJEDQ.js → chunk-ST5P5HNI.js} +2 -2
- package/dist/code-block.js +1 -1
- package/dist/collection-switcher.d.ts +68 -0
- package/dist/collection-switcher.js +131 -0
- package/dist/collection-switcher.js.map +1 -0
- package/dist/combobox.js +2 -2
- package/dist/cover-hero.js +1 -1
- package/dist/data-table.js +4 -4
- package/dist/date-picker.js +1 -1
- package/dist/decision-list.js +1 -1
- package/dist/default-avatar-D9kiSFNB.d.ts +26 -0
- package/dist/desktop-window.d.ts +223 -0
- package/dist/desktop-window.js +261 -0
- package/dist/desktop-window.js.map +1 -0
- package/dist/docs-layout.js +1 -1
- package/dist/entity-header.d.ts +92 -0
- package/dist/entity-header.js +165 -0
- package/dist/entity-header.js.map +1 -0
- package/dist/file-upload.d.ts +2 -2
- package/dist/file-upload.js +1 -1
- package/dist/filter-bar.d.ts +3 -3
- package/dist/filter-bar.js +2 -2
- package/dist/genui.js +4 -4
- package/dist/language-switch.d.ts +9 -9
- package/dist/link-card.js +2 -2
- package/dist/list.js +1 -1
- package/dist/media-capture.js +1 -1
- package/dist/native.d.ts +337 -4
- package/dist/native.js +2841 -2111
- package/dist/native.js.map +1 -1
- package/dist/opening-hours.js +1 -1
- package/dist/page-hero.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/photo-grid.js +1 -1
- package/dist/pricing-page.js.map +1 -1
- package/dist/qr-code.d.ts +42 -0
- package/dist/qr-code.js +350 -0
- package/dist/qr-code.js.map +1 -0
- package/dist/radio-group.js +1 -1
- package/dist/rail-nav.js +1 -1
- package/dist/retro-tv.js +2 -2
- package/dist/search-field.js +2 -2
- package/dist/service-card.js +1 -1
- package/dist/shop-composer.js +1 -1
- package/dist/shop-composer.js.map +1 -1
- package/dist/site-cahier.js +1 -1
- package/dist/status-chip.js +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/terminal-replay.js +1 -1
- package/dist/theme.d.ts +3 -1
- package/dist/theme.js +4 -0
- package/dist/theme.js.map +1 -1
- package/dist/tree-view.js +1 -1
- package/dist/video-player.js +2 -2
- package/dist/virtual.d.ts +3 -3
- package/package.json +91 -6
- package/registry/account-menu.json +22 -8
- package/registry/account-settings.json +2 -2
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +2 -2
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +564 -0
- package/registry/app-header.json +2 -2
- package/registry/app-shell.json +2 -2
- package/registry/argument-card.json +2 -2
- package/registry/audio-player.json +2 -2
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +2 -2
- package/registry/collection-switcher.json +436 -0
- package/registry/combobox.json +2 -2
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +2 -2
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +2 -2
- package/registry/date-picker.json +4 -4
- package/registry/decision-list.json +2 -2
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +407 -0
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +2 -2
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/entity-header.json +502 -0
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/app-frame/admin.d.ts +4 -0
- package/registry/examples/app-frame/admin.js +32 -0
- package/registry/examples/app-frame/admin.tsx +33 -0
- package/registry/examples/app-frame/app.d.ts +4 -0
- package/registry/examples/app-frame/app.js +53 -0
- package/registry/examples/app-frame/app.tsx +56 -0
- package/registry/examples/collection-switcher/entity.d.ts +4 -0
- package/registry/examples/collection-switcher/entity.js +17 -0
- package/registry/examples/collection-switcher/entity.tsx +13 -0
- package/registry/examples/collection-switcher/list.d.ts +4 -0
- package/registry/examples/collection-switcher/list.js +32 -0
- package/registry/examples/collection-switcher/list.tsx +27 -0
- package/registry/examples/collection-switcher/native/list.d.ts +4 -0
- package/registry/examples/collection-switcher/native/list.dark.png +0 -0
- package/registry/examples/collection-switcher/native/list.js +18 -0
- package/registry/examples/collection-switcher/native/list.light.png +0 -0
- package/registry/examples/collection-switcher/native/list.tsx +14 -0
- package/registry/examples/collection-switcher/tree.d.ts +4 -0
- package/registry/examples/collection-switcher/tree.js +19 -0
- package/registry/examples/collection-switcher/tree.tsx +15 -0
- package/registry/examples/desktop-window/library.d.ts +4 -0
- package/registry/examples/desktop-window/library.js +49 -0
- package/registry/examples/desktop-window/library.tsx +58 -0
- package/registry/examples/entity-header/basic.d.ts +4 -0
- package/registry/examples/entity-header/basic.js +31 -0
- package/registry/examples/entity-header/basic.tsx +25 -0
- package/registry/examples/entity-header/native/basic.d.ts +4 -0
- package/registry/examples/entity-header/native/basic.dark.png +0 -0
- package/registry/examples/entity-header/native/basic.js +17 -0
- package/registry/examples/entity-header/native/basic.light.png +0 -0
- package/registry/examples/entity-header/native/basic.tsx +12 -0
- package/registry/examples/form-flow/native/signup.d.ts +4 -0
- package/registry/examples/form-flow/native/signup.dark.png +0 -0
- package/registry/examples/form-flow/native/signup.js +26 -0
- package/registry/examples/form-flow/native/signup.light.png +0 -0
- package/registry/examples/form-flow/native/signup.tsx +23 -0
- package/registry/examples/grid/native/columns.d.ts +4 -0
- package/registry/examples/grid/native/columns.dark.png +0 -0
- package/registry/examples/grid/native/columns.js +23 -0
- package/registry/examples/grid/native/columns.light.png +0 -0
- package/registry/examples/grid/native/columns.tsx +20 -0
- package/registry/examples/grid/native/photos.d.ts +4 -0
- package/registry/examples/grid/native/photos.dark.png +0 -0
- package/registry/examples/grid/native/photos.js +14 -0
- package/registry/examples/grid/native/photos.light.png +0 -0
- package/registry/examples/grid/native/photos.tsx +18 -0
- package/registry/examples/grid/native/stats.d.ts +4 -0
- package/registry/examples/grid/native/stats.dark.png +0 -0
- package/registry/examples/grid/native/stats.js +22 -0
- package/registry/examples/grid/native/stats.light.png +0 -0
- package/registry/examples/grid/native/stats.tsx +24 -0
- package/registry/examples/list-detail/native/inbox.d.ts +4 -0
- package/registry/examples/list-detail/native/inbox.dark.png +0 -0
- package/registry/examples/list-detail/native/inbox.js +35 -0
- package/registry/examples/list-detail/native/inbox.light.png +0 -0
- package/registry/examples/list-detail/native/inbox.tsx +35 -0
- package/registry/examples/qr-code/basic.d.ts +4 -0
- package/registry/examples/qr-code/basic.js +11 -0
- package/registry/examples/qr-code/basic.tsx +6 -0
- package/registry/examples/qr-code/calendar-feed.d.ts +4 -0
- package/registry/examples/qr-code/calendar-feed.js +24 -0
- package/registry/examples/qr-code/calendar-feed.tsx +18 -0
- package/registry/examples/qr-code/native/calendar-feed.d.ts +4 -0
- package/registry/examples/qr-code/native/calendar-feed.dark.png +0 -0
- package/registry/examples/qr-code/native/calendar-feed.js +25 -0
- package/registry/examples/qr-code/native/calendar-feed.light.png +0 -0
- package/registry/examples/qr-code/native/calendar-feed.tsx +19 -0
- package/registry/examples/screen/native/dashboard.d.ts +4 -0
- package/registry/examples/screen/native/dashboard.dark.png +0 -0
- package/registry/examples/screen/native/dashboard.js +48 -0
- package/registry/examples/screen/native/dashboard.light.png +0 -0
- package/registry/examples/screen/native/dashboard.tsx +52 -0
- package/registry/examples/screen/native/settings-home.d.ts +4 -0
- package/registry/examples/screen/native/settings-home.dark.png +0 -0
- package/registry/examples/screen/native/settings-home.js +26 -0
- package/registry/examples/screen/native/settings-home.light.png +0 -0
- package/registry/examples/screen/native/settings-home.tsx +25 -0
- package/registry/examples/shop/hero-tv.js +1 -1
- package/registry/examples/shop/hero-tv.tsx +1 -1
- package/registry/examples/state-screen/native/empty.d.ts +4 -0
- package/registry/examples/state-screen/native/empty.dark.png +0 -0
- package/registry/examples/state-screen/native/empty.js +12 -0
- package/registry/examples/state-screen/native/empty.light.png +0 -0
- package/registry/examples/state-screen/native/empty.tsx +11 -0
- package/registry/examples/state-screen/native/error.d.ts +4 -0
- package/registry/examples/state-screen/native/error.dark.png +0 -0
- package/registry/examples/state-screen/native/error.js +21 -0
- package/registry/examples/state-screen/native/error.light.png +0 -0
- package/registry/examples/state-screen/native/error.tsx +17 -0
- package/registry/examples/state-screen/native/offline.d.ts +4 -0
- package/registry/examples/state-screen/native/offline.dark.png +0 -0
- package/registry/examples/state-screen/native/offline.js +15 -0
- package/registry/examples/state-screen/native/offline.light.png +0 -0
- package/registry/examples/state-screen/native/offline.tsx +12 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +2 -2
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form-flow.json +152 -0
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/grid.json +262 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +408 -12
- package/registry/iso.json +1 -1
- 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 +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +2 -2
- package/registry/list-detail.json +188 -0
- package/registry/list.json +2 -2
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +2 -2
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/onboarding.json +3 -0
- package/registry/opening-hours.json +2 -2
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +2 -2
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +2 -2
- package/registry/photo-grid.json +2 -2
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +2 -2
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/qr-code.json +343 -0
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +2 -2
- package/registry/rail-nav.json +3 -3
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/screen.json +68 -4
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +2 -2
- package/registry/settings-layout.json +5 -2
- package/registry/shop-composer.json +2 -2
- package/registry/shop.json +3 -3
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +4 -4
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/state-screen.json +224 -0
- package/registry/status-chip.json +2 -2
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +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 +3 -3
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +2 -2
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- 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 +2 -2
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +1 -1
- package/registry/waveform.json +1 -1
- /package/dist/{chunk-YCZ7N6Q6.js.map → chunk-7MQNG35Q.js.map} +0 -0
- /package/dist/{chunk-VB7MWE2N.js.map → chunk-DSDFXPL6.js.map} +0 -0
- /package/dist/{chunk-4GQH27IT.js.map → chunk-GW5EI7MI.js.map} +0 -0
- /package/dist/{chunk-F6JTHPHE.js.map → chunk-I6EOLPSH.js.map} +0 -0
- /package/dist/{chunk-BG5APGX6.js.map → chunk-Q5DYWQ6S.js.map} +0 -0
- /package/dist/{chunk-RCKXJEDQ.js.map → chunk-ST5P5HNI.js.map} +0 -0
package/README.md
CHANGED
|
@@ -197,6 +197,9 @@ light or a product's — is a set of tokens.
|
|
|
197
197
|
| `@krizaka/ui/video-trimmer` | `VideoTrimmer` (`duration`, `value` [start, end], `minLength`, `step`/`largeStep`, `frames` or children, `time` + `onSeek`, `classNames` per part, `renderHandle`) | client |
|
|
198
198
|
| `@krizaka/ui/audio-player` | `AudioPlayer` (a seekable waveform: `peaks` or `computePeaks`, `bars`, `playbackRates`, `duration`), `resamplePeaks`, `computeAudioPeaks` | client |
|
|
199
199
|
| `@krizaka/ui/waveform` | `Waveform` (`peaks`, `bars`, `size` sm·md·lg, `tone` accent·neutral, `playing`, `label`): the bars of a sound, decorative by default (`aria-hidden`), breathing gently while it plays, still under reduced motion and off screen; `/native` has the same | client |
|
|
200
|
+
| `@krizaka/ui/qr-code` | `QrCode` (`value`, `label`, `size`, `quietZone`, `level` L·M·Q·H, `copyLabel` / `copiedLabel` / `onCopy`) and the pure `encodeQr` / `qrPath`: a QR code drawn offline, dark modules on a light tile in both themes, an image named by `label`; `/native` has the same (`onCopy` receives the text) | client |
|
|
201
|
+
| `@krizaka/ui/entity-header` | `EntityHeader` (`name` / `onNameChange`, `description` / `onDescriptionChange`, `avatar`, `avatarPicker`, `tags`, `refusal` + `refusals` by `OrganizeCode`, `actions`): the head of a collection, shop or studio, edited in place; `/native` has the same (`onAvatarPress`) | client |
|
|
202
|
+
| `@krizaka/ui/collection-switcher` | `CollectionSwitcher` (`collections` with `parentId` / `isDefault` / `count`, `value` from the URL, `onValueChange` or `href`, `layout` list·tree, `mode` collection·entity, `onRemove` never on the default one, `onCreate`), `collectionTree`; `/native` has the same | client |
|
|
200
203
|
| `@krizaka/ui/image-cropper` | `ImageCropper` (`aspect`, `round`, an image or a `<video>`, a focus point + zoom out, keyboard and zoom slider), `cropRect` | client |
|
|
201
204
|
| `@krizaka/ui/document-viewer` | `DocumentViewer` (a PDF drawn by pdf.js — `loadPdfjs={() => import("pdfjs-dist")}`, an optional peer — with `highlights` lit where their quotes sit, `activeId` / `onActiveChange`, `onLocate`; page + quote when the text layer cannot place one), `locateQuote` | client |
|
|
202
205
|
| `@krizaka/ui/page` | the page frame: `Page` (`size` narrow·default·wide·full, `as`), `Section` (`id`, `eyebrow`, `title`, `lead`, `actions`, `divider`, `spacing` sm·md·lg, `backdrop`, `size`, `reveal`), `SectionHeading`, `Facts` (`items`: `label`, `tone` ok·wip·neutral, `href`), `Ticks` (backticks read as code) — see [Page blocks](#page-blocks) | server |
|
package/dist/account-menu.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ interface AccountMenuLanguage {
|
|
|
20
20
|
}[];
|
|
21
21
|
onChange: (value: string) => void;
|
|
22
22
|
}
|
|
23
|
+
/** The theme row: the same shape as the language's (a submenu that shows the current choice). */
|
|
24
|
+
type AccountMenuTheme = AccountMenuLanguage;
|
|
23
25
|
interface AccountMenuProps {
|
|
24
26
|
/** The trigger's accessible name (`Account`). */
|
|
25
27
|
label: string;
|
|
@@ -41,7 +43,9 @@ interface AccountMenuProps {
|
|
|
41
43
|
linkAs?: React.ElementType;
|
|
42
44
|
/** The language, as a submenu that shows the current one. */
|
|
43
45
|
language?: AccountMenuLanguage;
|
|
44
|
-
/**
|
|
46
|
+
/** The theme (light, dark, system), as a submenu under the language: the family keeps preferences in the account menu. */
|
|
47
|
+
theme?: AccountMenuTheme;
|
|
48
|
+
/** Extra rows between the preferences and Sign out. */
|
|
45
49
|
children?: React.ReactNode;
|
|
46
50
|
/** The last row: its words, what it does, an optional icon. */
|
|
47
51
|
signOut: {
|
|
@@ -53,7 +57,7 @@ interface AccountMenuProps {
|
|
|
53
57
|
className?: string;
|
|
54
58
|
}
|
|
55
59
|
/** The account menu: avatar trigger → identity header, links, language submenu, Sign out. */
|
|
56
|
-
declare function AccountMenu({ label, name, email, avatar, showName, links, linkAs: Link, language, children, signOut, className }: AccountMenuProps): React.JSX.Element;
|
|
60
|
+
declare function AccountMenu({ label, name, email, avatar, showName, links, linkAs: Link, language, theme, children, signOut, className }: AccountMenuProps): React.JSX.Element;
|
|
57
61
|
|
|
58
62
|
export { AccountMenu };
|
|
59
|
-
export type { AccountMenuLanguage, AccountMenuLink, AccountMenuProps };
|
|
63
|
+
export type { AccountMenuLanguage, AccountMenuLink, AccountMenuProps, AccountMenuTheme };
|
package/dist/account-menu.js
CHANGED
|
@@ -81,9 +81,8 @@ var DropdownMenu = {
|
|
|
81
81
|
|
|
82
82
|
// src/account-menu/account-menu.tsx
|
|
83
83
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
84
|
-
function AccountMenu({ label, name, email, avatar, showName = true, links = [], linkAs: Link = "a", language, children, signOut, className }) {
|
|
84
|
+
function AccountMenu({ label, name, email, avatar, showName = true, links = [], linkAs: Link = "a", language, theme, children, signOut, className }) {
|
|
85
85
|
const title = name || email || "";
|
|
86
|
-
const current = language?.options.find((o) => o.value === language.value)?.label;
|
|
87
86
|
return /* @__PURE__ */ jsxs2(DropdownMenu.Root, { children: [
|
|
88
87
|
/* @__PURE__ */ jsxs2(
|
|
89
88
|
DropdownMenu.Trigger,
|
|
@@ -116,14 +115,9 @@ function AccountMenu({ label, name, email, avatar, showName = true, links = [],
|
|
|
116
115
|
link.icon,
|
|
117
116
|
link.label
|
|
118
117
|
] }) }, link.id)),
|
|
119
|
-
(language || children) && /* @__PURE__ */ jsx2(DropdownMenu.Separator, {}),
|
|
120
|
-
language && /* @__PURE__ */
|
|
121
|
-
|
|
122
|
-
language.label,
|
|
123
|
-
current && /* @__PURE__ */ jsx2("span", { className: "ml-auto mr-1 text-xs text-fg-secondary", children: current })
|
|
124
|
-
] }),
|
|
125
|
-
/* @__PURE__ */ jsx2(DropdownMenu.SubContent, { children: /* @__PURE__ */ jsx2(DropdownMenu.RadioGroup, { value: language.value, onValueChange: language.onChange, children: language.options.map((o) => /* @__PURE__ */ jsx2(DropdownMenu.RadioItem, { value: o.value, children: o.label }, o.value)) }) })
|
|
126
|
-
] }),
|
|
118
|
+
(language || theme || children) && /* @__PURE__ */ jsx2(DropdownMenu.Separator, {}),
|
|
119
|
+
language && /* @__PURE__ */ jsx2(Choice, { ...language }),
|
|
120
|
+
theme && /* @__PURE__ */ jsx2(Choice, { ...theme }),
|
|
127
121
|
children,
|
|
128
122
|
/* @__PURE__ */ jsx2(DropdownMenu.Separator, {}),
|
|
129
123
|
/* @__PURE__ */ jsxs2(DropdownMenu.Item, { onSelect: () => signOut.onSelect(), children: [
|
|
@@ -133,6 +127,16 @@ function AccountMenu({ label, name, email, avatar, showName = true, links = [],
|
|
|
133
127
|
] })
|
|
134
128
|
] });
|
|
135
129
|
}
|
|
130
|
+
function Choice({ label, value, options, onChange }) {
|
|
131
|
+
const current = options.find((o) => o.value === value)?.label;
|
|
132
|
+
return /* @__PURE__ */ jsxs2(DropdownMenu.Sub, { children: [
|
|
133
|
+
/* @__PURE__ */ jsxs2(DropdownMenu.SubTrigger, { children: [
|
|
134
|
+
label,
|
|
135
|
+
current && /* @__PURE__ */ jsx2("span", { className: "ml-auto mr-1 text-xs text-fg-secondary", children: current })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ jsx2(DropdownMenu.SubContent, { children: /* @__PURE__ */ jsx2(DropdownMenu.RadioGroup, { value, onValueChange: onChange, children: options.map((o) => /* @__PURE__ */ jsx2(DropdownMenu.RadioItem, { value: o.value, children: o.label }, o.value)) }) })
|
|
138
|
+
] });
|
|
139
|
+
}
|
|
136
140
|
export {
|
|
137
141
|
AccountMenu
|
|
138
142
|
};
|
package/dist/account-menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dropdown-menu/dropdown-menu.tsx","../src/floating.ts","../src/account-menu/account-menu.tsx"],"sourcesContent":["// Client (a portal). Radix does the roving focus, the arrows, Home/End, typeahead, Escape and the focus return.\nimport { DropdownMenu as MenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { floating } from \"../floating\";\n\nexport const menu = tv({\n slots: {\n content: cn(floating, \"min-w-48 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto overflow-x-hidden overscroll-contain p-1 origin-(--radix-dropdown-menu-content-transform-origin)\"),\n item:\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-2 text-sm text-fg outline-hidden transition-colors \" +\n \"data-highlighted:bg-surface-3 data-disabled:pointer-events-none data-disabled:opacity-40 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 \" +\n \"[&>svg]:text-fg-secondary\",\n indicator: \"ml-auto flex h-4 w-4 items-center justify-center text-fg-accent\",\n label: \"px-2.5 pb-1 pt-2 text-[11px] font-semibold text-fg-secondary\",\n separator: \"-mx-1 my-1 h-px bg-border-subtle\",\n },\n variants: {\n // The label reads in the danger text role (≥ 4.5:1 on the menu surface, both themes); the icon and the highlight\n // carry the danger fill.\n tone: { default: {}, danger: { item: \"text-fg-danger data-highlighted:bg-danger/15 [&>svg]:text-danger\" } },\n },\n defaultVariants: { tone: \"default\" },\n});\nconst s = menu();\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof MenuPrimitive.Content> & {\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n};\n\nexport function DropdownMenuContent({ sideOffset = 6, align = \"end\", collisionPadding = 8, container, className, ...props }: DropdownMenuContentProps) {\n return (\n <MenuPrimitive.Portal container={container}>\n <MenuPrimitive.Content sideOffset={sideOffset} align={align} collisionPadding={collisionPadding} className={s.content({ className })} {...props} />\n </MenuPrimitive.Portal>\n );\n}\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof MenuPrimitive.Item> & {\n /** `danger` for a destructive action: the icon and the highlight carry the danger, the label stays legible. */\n tone?: \"default\" | \"danger\";\n};\n\n/** An action. `tone=\"danger\"` for a destructive one; `onSelect` runs it (the menu closes). */\nexport function DropdownMenuItem({ tone, className, ...props }: DropdownMenuItemProps) {\n return <MenuPrimitive.Item data-tone={tone ?? \"default\"} className={menu({ tone }).item({ className })} {...props} />;\n}\n\n/** A toggled option: `checked` + `onCheckedChange`. */\nexport function DropdownMenuCheckboxItem({ className, children, ...props }: React.ComponentProps<typeof MenuPrimitive.CheckboxItem>) {\n return (\n <MenuPrimitive.CheckboxItem className={s.item({ className })} {...props}>\n {children}\n <MenuPrimitive.ItemIndicator className={s.indicator()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenuPrimitive.ItemIndicator>\n </MenuPrimitive.CheckboxItem>\n );\n}\n\n/** A submenu's trigger: an item that opens `DropdownMenu.SubContent`, with a chevron. */\nexport function DropdownMenuSubTrigger({ className, children, ...props }: React.ComponentProps<typeof MenuPrimitive.SubTrigger>) {\n return (\n <MenuPrimitive.SubTrigger className={s.item({ className: cn(\"data-[state=open]:bg-surface-3\", className) })} {...props}>\n {children}\n <svg className=\"ml-auto !h-4 !w-4 text-fg-secondary\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </MenuPrimitive.SubTrigger>\n );\n}\n\n/** The submenu's panel (same material as the menu). */\nexport function DropdownMenuSubContent({ sideOffset = 4, collisionPadding = 8, className, ...props }: React.ComponentProps<typeof MenuPrimitive.SubContent>) {\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.SubContent sideOffset={sideOffset} collisionPadding={collisionPadding} className={s.content({ className: cn(\"max-h-(--radix-dropdown-menu-content-available-height)\", className) })} {...props} />\n </MenuPrimitive.Portal>\n );\n}\n\n/** One choice among several (`DropdownMenu.RadioGroup` holds the value): a language, a sort order. */\nexport function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof MenuPrimitive.RadioItem>) {\n return (\n <MenuPrimitive.RadioItem className={s.item({ className })} {...props}>\n {children}\n <MenuPrimitive.ItemIndicator className={s.indicator()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenuPrimitive.ItemIndicator>\n </MenuPrimitive.RadioItem>\n );\n}\n\nexport function DropdownMenuLabel({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Label>) {\n return <MenuPrimitive.Label className={s.label({ className })} {...props} />;\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Separator>) {\n return <MenuPrimitive.Separator className={s.separator({ className })} {...props} />;\n}\n\n/** `DropdownMenu.Root/Trigger/Content/Item/CheckboxItem/Label/Separator/Group`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const DropdownMenu = {\n Root: MenuPrimitive.Root,\n Trigger: MenuPrimitive.Trigger,\n Content: DropdownMenuContent,\n Item: DropdownMenuItem,\n CheckboxItem: DropdownMenuCheckboxItem,\n Label: DropdownMenuLabel,\n Separator: DropdownMenuSeparator,\n Group: MenuPrimitive.Group,\n Sub: MenuPrimitive.Sub,\n SubTrigger: DropdownMenuSubTrigger,\n SubContent: DropdownMenuSubContent,\n RadioGroup: MenuPrimitive.RadioGroup,\n RadioItem: DropdownMenuRadioItem,\n};\n","// The one surface of everything that floats next to its trigger (popover, menu, tooltip): a raised surface, a border,\n// the large shadow and the `kz-pop` entrance from the side Radix measured (`--radix-*-transform-origin`).\nexport const floating =\n \"kz-pop z-50 rounded-lg border border-border-default bg-surface-2 text-fg shadow-lg outline-hidden\";\n","// Client (a portal). The signed-in person's menu under their avatar — who you are first (picture, name, e-mail), then\n// the places (profile, settings), the language as a compact submenu, the extras, and Sign out (a quiet item, not a\n// red alert). Built on DropdownMenu, so the keyboard, the focus return and the collisions are Radix's.\nimport * as React from \"react\";\n\nimport { Avatar, type AvatarProps } from \"../avatar/avatar\";\nimport { cn } from \"../cn\";\nimport { DropdownMenu } from \"../dropdown-menu/dropdown-menu\";\n\nexport interface AccountMenuLink {\n id: string;\n label: string;\n href: string;\n /** A signature icon. */\n icon?: React.ReactNode;\n}\n\nexport interface AccountMenuLanguage {\n /** The row's words (`Language`). */\n label: string;\n /** The current value (`en`). */\n value: string;\n options: readonly { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\nexport interface AccountMenuProps {\n /** The trigger's accessible name (`Account`). */\n label: string;\n /** Their name; falls back to the e-mail. */\n name?: string;\n /** Their e-mail, shown under the name. */\n email?: string;\n /** The picture: `src`, or `defaultAvatar` (`{ brand, seed }`) for the product's default person. */\n avatar?: Omit<AvatarProps, \"size\">;\n /**\n * Show the name beside the avatar in the trigger: `true` or `\"sm\"` from 640 px, `\"lg\"` from 1024 px (the family's top\n * bar, where search and the counts take the room below it), `false` never.\n * @default true\n */\n showName?: boolean | \"sm\" | \"lg\";\n /** Where to go: profile, settings… */\n links?: readonly AccountMenuLink[];\n /** The app's link component (Next's `Link`); an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /** The language, as a submenu that shows the current one. */\n language?: AccountMenuLanguage;\n /** Extra rows between the language and Sign out (a theme switch…). */\n children?: React.ReactNode;\n /** The last row: its words, what it does, an optional icon. */\n signOut: { label: string; onSelect: () => void; icon?: React.ReactNode };\n /** Classes for the trigger. */\n className?: string;\n}\n\n/** The account menu: avatar trigger → identity header, links, language submenu, Sign out. */\nexport function AccountMenu({ label, name, email, avatar, showName = true, links = [], linkAs: Link = \"a\", language, children, signOut, className }: AccountMenuProps) {\n const title = name || email || \"\";\n const current = language?.options.find((o) => o.value === language.value)?.label;\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger\n aria-label={label}\n className={cn(\"flex items-center gap-2.5 rounded-lg p-1 transition-colors duration-150 hover:bg-surface-2 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\", className)}\n >\n <Avatar size=\"sm\" fallback={title.charAt(0).toUpperCase() || \"?\"} {...avatar} />\n {/* Drawn by CSS: the name is not text of the button, so its accessible name stays `label` with no label-content-name-mismatch. */}\n {showName && title && (\n <span\n aria-hidden\n data-name={title}\n className={cn(\"hidden max-w-40 truncate text-sm font-medium text-fg-secondary after:content-[attr(data-name)]\", showName === \"lg\" ? \"lg:inline-block\" : \"sm:inline-block\")}\n />\n )}\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\" className=\"w-64\">\n <DropdownMenu.Label className=\"flex items-center gap-3 py-2 normal-case tracking-normal\">\n <Avatar size=\"md\" fallback={title.charAt(0).toUpperCase() || \"?\"} {...avatar} />\n <span className=\"min-w-0\">\n <span className=\"block truncate text-sm font-semibold text-fg\">{title}</span>\n {name && email && name !== email && <span className=\"block truncate text-xs font-normal text-fg-secondary\">{email}</span>}\n </span>\n </DropdownMenu.Label>\n {links.length > 0 && <DropdownMenu.Separator />}\n {links.map((link) => (\n <DropdownMenu.Item key={link.id} asChild>\n <Link href={link.href}>\n {link.icon}\n {link.label}\n </Link>\n </DropdownMenu.Item>\n ))}\n {(language || children) && <DropdownMenu.Separator />}\n {language && (\n <DropdownMenu.Sub>\n <DropdownMenu.SubTrigger>\n {language.label}\n {current && <span className=\"ml-auto mr-1 text-xs text-fg-secondary\">{current}</span>}\n </DropdownMenu.SubTrigger>\n <DropdownMenu.SubContent>\n <DropdownMenu.RadioGroup value={language.value} onValueChange={language.onChange}>\n {language.options.map((o) => (\n <DropdownMenu.RadioItem key={o.value} value={o.value}>\n {o.label}\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n </DropdownMenu.SubContent>\n </DropdownMenu.Sub>\n )}\n {children}\n <DropdownMenu.Separator />\n <DropdownMenu.Item onSelect={() => signOut.onSelect()}>\n {signOut.icon}\n {signOut.label}\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}\n"],"mappings":";;;;;;;;AACA,SAAS,gBAAgB,qBAAqB;AAE9C,SAAS,UAAU;;;ACDZ,IAAM,WACX;;;ADiCI,cAkBF,YAlBE;AA5BC,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,SAAS,GAAG,UAAU,kLAAkL;AAAA,IACxM,MACE;AAAA,IAGF,WAAW;AAAA,IACX,OAAO;AAAA,IACP,WAAW;AAAA,EACb;AAAA,EACA,UAAU;AAAA;AAAA;AAAA,IAGR,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAAE,MAAM,mEAAmE,EAAE;AAAA,EAC5G;AAAA,EACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;AACD,IAAM,IAAI,KAAK;AAOR,SAAS,oBAAoB,EAAE,aAAa,GAAG,QAAQ,OAAO,mBAAmB,GAAG,WAAW,WAAW,GAAG,MAAM,GAA6B;AACrJ,SACE,oBAAC,cAAc,QAAd,EAAqB,WACpB,8BAAC,cAAc,SAAd,EAAsB,YAAwB,OAAc,kBAAoC,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO,GACnJ;AAEJ;AAQO,SAA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,mBAAS;AAAA,UACT,WAAW,gBAAAD,KAAC,UAAK,WAAU,0CAA0C,mBAAQ;AAAA,WAChF;AAAA,QACA,gBAAAA,KAAC,aAAa,YAAb,EACC,0BAAAA,KAAC,aAAa,YAAb,EAAwB,OAAO,SAAS,OAAO,eAAe,SAAS,UACrE,mBAAS,QAAQ,IAAI,CAAC,MACrB,gBAAAA,KAAC,aAAa,WAAb,EAAqC,OAAO,EAAE,OAC5C,YAAE,SADwB,EAAE,KAE/B,CACD,GACH,GACF;AAAA,SACF;AAAA,MAED;AAAA,MACD,gBAAAA,KAAC,aAAa,WAAb,EAAuB;AAAA,MACxB,gBAAAC,MAAC,aAAa,MAAb,EAAkB,UAAU,MAAM,QAAQ,SAAS,GACjD;AAAA,gBAAQ;AAAA,QACR,QAAQ;AAAA,SACX;AAAA,OACF;AAAA,KACF;AAEJ;","names":["jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../src/dropdown-menu/dropdown-menu.tsx","../src/floating.ts","../src/account-menu/account-menu.tsx"],"sourcesContent":["// Client (a portal). Radix does the roving focus, the arrows, Home/End, typeahead, Escape and the focus return.\nimport { DropdownMenu as MenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { floating } from \"../floating\";\n\nexport const menu = tv({\n slots: {\n content: cn(floating, \"min-w-48 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto overflow-x-hidden overscroll-contain p-1 origin-(--radix-dropdown-menu-content-transform-origin)\"),\n item:\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-2 text-sm text-fg outline-hidden transition-colors \" +\n \"data-highlighted:bg-surface-3 data-disabled:pointer-events-none data-disabled:opacity-40 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 \" +\n \"[&>svg]:text-fg-secondary\",\n indicator: \"ml-auto flex h-4 w-4 items-center justify-center text-fg-accent\",\n label: \"px-2.5 pb-1 pt-2 text-[11px] font-semibold text-fg-secondary\",\n separator: \"-mx-1 my-1 h-px bg-border-subtle\",\n },\n variants: {\n // The label reads in the danger text role (≥ 4.5:1 on the menu surface, both themes); the icon and the highlight\n // carry the danger fill.\n tone: { default: {}, danger: { item: \"text-fg-danger data-highlighted:bg-danger/15 [&>svg]:text-danger\" } },\n },\n defaultVariants: { tone: \"default\" },\n});\nconst s = menu();\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof MenuPrimitive.Content> & {\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n};\n\nexport function DropdownMenuContent({ sideOffset = 6, align = \"end\", collisionPadding = 8, container, className, ...props }: DropdownMenuContentProps) {\n return (\n <MenuPrimitive.Portal container={container}>\n <MenuPrimitive.Content sideOffset={sideOffset} align={align} collisionPadding={collisionPadding} className={s.content({ className })} {...props} />\n </MenuPrimitive.Portal>\n );\n}\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof MenuPrimitive.Item> & {\n /** `danger` for a destructive action: the icon and the highlight carry the danger, the label stays legible. */\n tone?: \"default\" | \"danger\";\n};\n\n/** An action. `tone=\"danger\"` for a destructive one; `onSelect` runs it (the menu closes). */\nexport function DropdownMenuItem({ tone, className, ...props }: DropdownMenuItemProps) {\n return <MenuPrimitive.Item data-tone={tone ?? \"default\"} className={menu({ tone }).item({ className })} {...props} />;\n}\n\n/** A toggled option: `checked` + `onCheckedChange`. */\nexport function DropdownMenuCheckboxItem({ className, children, ...props }: React.ComponentProps<typeof MenuPrimitive.CheckboxItem>) {\n return (\n <MenuPrimitive.CheckboxItem className={s.item({ className })} {...props}>\n {children}\n <MenuPrimitive.ItemIndicator className={s.indicator()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenuPrimitive.ItemIndicator>\n </MenuPrimitive.CheckboxItem>\n );\n}\n\n/** A submenu's trigger: an item that opens `DropdownMenu.SubContent`, with a chevron. */\nexport function DropdownMenuSubTrigger({ className, children, ...props }: React.ComponentProps<typeof MenuPrimitive.SubTrigger>) {\n return (\n <MenuPrimitive.SubTrigger className={s.item({ className: cn(\"data-[state=open]:bg-surface-3\", className) })} {...props}>\n {children}\n <svg className=\"ml-auto !h-4 !w-4 text-fg-secondary\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </MenuPrimitive.SubTrigger>\n );\n}\n\n/** The submenu's panel (same material as the menu). */\nexport function DropdownMenuSubContent({ sideOffset = 4, collisionPadding = 8, className, ...props }: React.ComponentProps<typeof MenuPrimitive.SubContent>) {\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.SubContent sideOffset={sideOffset} collisionPadding={collisionPadding} className={s.content({ className: cn(\"max-h-(--radix-dropdown-menu-content-available-height)\", className) })} {...props} />\n </MenuPrimitive.Portal>\n );\n}\n\n/** One choice among several (`DropdownMenu.RadioGroup` holds the value): a language, a sort order. */\nexport function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof MenuPrimitive.RadioItem>) {\n return (\n <MenuPrimitive.RadioItem className={s.item({ className })} {...props}>\n {children}\n <MenuPrimitive.ItemIndicator className={s.indicator()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenuPrimitive.ItemIndicator>\n </MenuPrimitive.RadioItem>\n );\n}\n\nexport function DropdownMenuLabel({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Label>) {\n return <MenuPrimitive.Label className={s.label({ className })} {...props} />;\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Separator>) {\n return <MenuPrimitive.Separator className={s.separator({ className })} {...props} />;\n}\n\n/** `DropdownMenu.Root/Trigger/Content/Item/CheckboxItem/Label/Separator/Group`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const DropdownMenu = {\n Root: MenuPrimitive.Root,\n Trigger: MenuPrimitive.Trigger,\n Content: DropdownMenuContent,\n Item: DropdownMenuItem,\n CheckboxItem: DropdownMenuCheckboxItem,\n Label: DropdownMenuLabel,\n Separator: DropdownMenuSeparator,\n Group: MenuPrimitive.Group,\n Sub: MenuPrimitive.Sub,\n SubTrigger: DropdownMenuSubTrigger,\n SubContent: DropdownMenuSubContent,\n RadioGroup: MenuPrimitive.RadioGroup,\n RadioItem: DropdownMenuRadioItem,\n};\n","// The one surface of everything that floats next to its trigger (popover, menu, tooltip): a raised surface, a border,\n// the large shadow and the `kz-pop` entrance from the side Radix measured (`--radix-*-transform-origin`).\nexport const floating =\n \"kz-pop z-50 rounded-lg border border-border-default bg-surface-2 text-fg shadow-lg outline-hidden\";\n","// Client (a portal). The signed-in person's menu under their avatar — who you are first (picture, name, e-mail), then\n// the places (profile, settings), the language as a compact submenu, the extras, and Sign out (a quiet item, not a\n// red alert). Built on DropdownMenu, so the keyboard, the focus return and the collisions are Radix's.\nimport * as React from \"react\";\n\nimport { Avatar, type AvatarProps } from \"../avatar/avatar\";\nimport { cn } from \"../cn\";\nimport { DropdownMenu } from \"../dropdown-menu/dropdown-menu\";\n\nexport interface AccountMenuLink {\n id: string;\n label: string;\n href: string;\n /** A signature icon. */\n icon?: React.ReactNode;\n}\n\nexport interface AccountMenuLanguage {\n /** The row's words (`Language`). */\n label: string;\n /** The current value (`en`). */\n value: string;\n options: readonly { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\n/** The theme row: the same shape as the language's (a submenu that shows the current choice). */\nexport type AccountMenuTheme = AccountMenuLanguage;\n\nexport interface AccountMenuProps {\n /** The trigger's accessible name (`Account`). */\n label: string;\n /** Their name; falls back to the e-mail. */\n name?: string;\n /** Their e-mail, shown under the name. */\n email?: string;\n /** The picture: `src`, or `defaultAvatar` (`{ brand, seed }`) for the product's default person. */\n avatar?: Omit<AvatarProps, \"size\">;\n /**\n * Show the name beside the avatar in the trigger: `true` or `\"sm\"` from 640 px, `\"lg\"` from 1024 px (the family's top\n * bar, where search and the counts take the room below it), `false` never.\n * @default true\n */\n showName?: boolean | \"sm\" | \"lg\";\n /** Where to go: profile, settings… */\n links?: readonly AccountMenuLink[];\n /** The app's link component (Next's `Link`); an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /** The language, as a submenu that shows the current one. */\n language?: AccountMenuLanguage;\n /** The theme (light, dark, system), as a submenu under the language: the family keeps preferences in the account menu. */\n theme?: AccountMenuTheme;\n /** Extra rows between the preferences and Sign out. */\n children?: React.ReactNode;\n /** The last row: its words, what it does, an optional icon. */\n signOut: { label: string; onSelect: () => void; icon?: React.ReactNode };\n /** Classes for the trigger. */\n className?: string;\n}\n\n/** The account menu: avatar trigger → identity header, links, language submenu, Sign out. */\nexport function AccountMenu({ label, name, email, avatar, showName = true, links = [], linkAs: Link = \"a\", language, theme, children, signOut, className }: AccountMenuProps) {\n const title = name || email || \"\";\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger\n aria-label={label}\n className={cn(\"flex items-center gap-2.5 rounded-lg p-1 transition-colors duration-150 hover:bg-surface-2 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\", className)}\n >\n <Avatar size=\"sm\" fallback={title.charAt(0).toUpperCase() || \"?\"} {...avatar} />\n {/* Drawn by CSS: the name is not text of the button, so its accessible name stays `label` with no label-content-name-mismatch. */}\n {showName && title && (\n <span\n aria-hidden\n data-name={title}\n className={cn(\"hidden max-w-40 truncate text-sm font-medium text-fg-secondary after:content-[attr(data-name)]\", showName === \"lg\" ? \"lg:inline-block\" : \"sm:inline-block\")}\n />\n )}\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\" className=\"w-64\">\n <DropdownMenu.Label className=\"flex items-center gap-3 py-2 normal-case tracking-normal\">\n <Avatar size=\"md\" fallback={title.charAt(0).toUpperCase() || \"?\"} {...avatar} />\n <span className=\"min-w-0\">\n <span className=\"block truncate text-sm font-semibold text-fg\">{title}</span>\n {name && email && name !== email && <span className=\"block truncate text-xs font-normal text-fg-secondary\">{email}</span>}\n </span>\n </DropdownMenu.Label>\n {links.length > 0 && <DropdownMenu.Separator />}\n {links.map((link) => (\n <DropdownMenu.Item key={link.id} asChild>\n <Link href={link.href}>\n {link.icon}\n {link.label}\n </Link>\n </DropdownMenu.Item>\n ))}\n {(language || theme || children) && <DropdownMenu.Separator />}\n {language && <Choice {...language} />}\n {theme && <Choice {...theme} />}\n {children}\n <DropdownMenu.Separator />\n <DropdownMenu.Item onSelect={() => signOut.onSelect()}>\n {signOut.icon}\n {signOut.label}\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}\n\n/** A preference as a submenu that names the current choice. */\nfunction Choice({ label, value, options, onChange }: AccountMenuLanguage) {\n const current = options.find((o) => o.value === value)?.label;\n return (\n <DropdownMenu.Sub>\n <DropdownMenu.SubTrigger>\n {label}\n {current && <span className=\"ml-auto mr-1 text-xs text-fg-secondary\">{current}</span>}\n </DropdownMenu.SubTrigger>\n <DropdownMenu.SubContent>\n <DropdownMenu.RadioGroup value={value} onValueChange={onChange}>\n {options.map((o) => (\n <DropdownMenu.RadioItem key={o.value} value={o.value}>\n {o.label}\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n </DropdownMenu.SubContent>\n </DropdownMenu.Sub>\n );\n}\n"],"mappings":";;;;;;;;AACA,SAAS,gBAAgB,qBAAqB;AAE9C,SAAS,UAAU;;;ACDZ,IAAM,WACX;;;ADiCI,cAkBF,YAlBE;AA5BC,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,SAAS,GAAG,UAAU,kLAAkL;AAAA,IACxM,MACE;AAAA,IAGF,WAA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HANGED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/** The places the account menu can hold, in the order the frame draws them. */
|
|
4
|
+
declare const ACCOUNT_LINK_IDS: readonly ["profile", "settings", "billing", "administration"];
|
|
5
|
+
type AccountLinkId = (typeof ACCOUNT_LINK_IDS)[number];
|
|
6
|
+
/** The account menu from top to bottom: who you are, the places, the preferences, Sign out. Fixed by the frame, not by the product. */
|
|
7
|
+
declare const ACCOUNT_MENU_ORDER: readonly ["identity", "profile", "settings", "billing", "administration", "language", "theme", "signOut"];
|
|
8
|
+
/** The most destinations a phone's tab bar carries (the rail's main items; the foot follows them in the same bar). */
|
|
9
|
+
declare const MAIN_SECTIONS_MAX = 5;
|
|
10
|
+
interface FrameSection {
|
|
11
|
+
/** Stable id; `settings`, `billing`, `profile`, `administration` are the account menu's places. */
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
href: string;
|
|
15
|
+
icon: React.ReactNode;
|
|
16
|
+
/** Not offered to this person (a permission, a feature not open): left out of the rail and the tab bar. */
|
|
17
|
+
gated?: boolean;
|
|
18
|
+
/** A count on the icon. */
|
|
19
|
+
badge?: string | number;
|
|
20
|
+
/** The count in words (« 3 to decide »). */
|
|
21
|
+
badgeLabel?: string;
|
|
22
|
+
/** `main`: what the person works in (the tab bar on a phone). `foot`: the rail's foot. @default "main" */
|
|
23
|
+
place?: "main" | "foot";
|
|
24
|
+
}
|
|
25
|
+
interface FramePlaces {
|
|
26
|
+
main: FrameSection[];
|
|
27
|
+
foot: FrameSection[];
|
|
28
|
+
/** Sections left out of the rail because the account menu already holds that place (or because they are gated). */
|
|
29
|
+
dropped: {
|
|
30
|
+
id: string;
|
|
31
|
+
reason: "account" | "gated";
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Splits the sections into the rail's main and foot, in the order given. A place is on the rail or under the avatar,
|
|
36
|
+
* never both: a section whose id is one of the account links the frame was given leaves the rail (the avatar owns it).
|
|
37
|
+
* A gated section leaves too.
|
|
38
|
+
*/
|
|
39
|
+
declare function framePlaces(sections: readonly FrameSection[], accountLinks?: readonly string[]): FramePlaces;
|
|
40
|
+
/** The account links the frame draws, in the frame's order, whatever the order they were written in. Only what was passed. */
|
|
41
|
+
declare function orderAccountLinks<T>(links: Partial<Record<AccountLinkId, T>> | undefined, admin?: boolean): {
|
|
42
|
+
id: AccountLinkId;
|
|
43
|
+
link: T;
|
|
44
|
+
}[];
|
|
45
|
+
/** 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. */
|
|
46
|
+
declare function frameIssues(sections: readonly FrameSection[], accountLinks?: readonly string[]): string[];
|
|
47
|
+
|
|
48
|
+
declare const navWords: {
|
|
49
|
+
readonly en: {
|
|
50
|
+
readonly docs: "Docs";
|
|
51
|
+
readonly terms: "Terms";
|
|
52
|
+
readonly privacy: "Privacy";
|
|
53
|
+
readonly settings: "Settings";
|
|
54
|
+
readonly billing: "Billing";
|
|
55
|
+
readonly profile: "Profile";
|
|
56
|
+
readonly administration: "Administration";
|
|
57
|
+
readonly account: "Account";
|
|
58
|
+
readonly language: "Language";
|
|
59
|
+
readonly theme: "Theme";
|
|
60
|
+
readonly themeLight: "Light";
|
|
61
|
+
readonly themeDark: "Dark";
|
|
62
|
+
readonly themeSystem: "System";
|
|
63
|
+
readonly signOut: "Sign out";
|
|
64
|
+
readonly howItWorks: "How it works";
|
|
65
|
+
readonly pricing: "Pricing";
|
|
66
|
+
readonly download: "Download";
|
|
67
|
+
readonly contact: "Contact";
|
|
68
|
+
readonly search: "Search";
|
|
69
|
+
readonly notifications: "Notifications";
|
|
70
|
+
readonly expand: "Show the words";
|
|
71
|
+
readonly collapse: "Hide the words";
|
|
72
|
+
};
|
|
73
|
+
readonly fr: {
|
|
74
|
+
readonly docs: "Docs";
|
|
75
|
+
readonly terms: "Conditions d'utilisation";
|
|
76
|
+
readonly privacy: "Confidentialité";
|
|
77
|
+
readonly settings: "Réglages";
|
|
78
|
+
readonly billing: "Facturation";
|
|
79
|
+
readonly profile: "Profil";
|
|
80
|
+
readonly administration: "Administration";
|
|
81
|
+
readonly account: "Compte";
|
|
82
|
+
readonly language: "Langue";
|
|
83
|
+
readonly theme: "Thème";
|
|
84
|
+
readonly themeLight: "Clair";
|
|
85
|
+
readonly themeDark: "Sombre";
|
|
86
|
+
readonly themeSystem: "Système";
|
|
87
|
+
readonly signOut: "Se déconnecter";
|
|
88
|
+
readonly howItWorks: "Comment ça marche";
|
|
89
|
+
readonly pricing: "Tarifs";
|
|
90
|
+
readonly download: "Télécharger";
|
|
91
|
+
readonly contact: "Contact";
|
|
92
|
+
readonly search: "Rechercher";
|
|
93
|
+
readonly notifications: "Notifications";
|
|
94
|
+
readonly expand: "Afficher les mots";
|
|
95
|
+
readonly collapse: "Masquer les mots";
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
type NavLocale = keyof typeof navWords;
|
|
99
|
+
type NavWords = {
|
|
100
|
+
[K in keyof (typeof navWords)["en"]]: string;
|
|
101
|
+
};
|
|
102
|
+
type NavWordKey = keyof NavWords;
|
|
103
|
+
/** The words of a locale (`fr`, `fr-CA`…); any other falls back to English. */
|
|
104
|
+
declare function navVocabulary(locale?: string): NavWords;
|
|
105
|
+
/** One word of the shared vocabulary. */
|
|
106
|
+
declare function navWord(locale: string | undefined, key: NavWordKey): string;
|
|
107
|
+
/** The most links a product's public bar holds: past four, the bar is a menu in disguise (audit F3). */
|
|
108
|
+
declare const PUBLIC_BAR_MAX = 4;
|
|
109
|
+
type PublicBarSlot = "howItWorks" | "pricing" | "docs" | "download";
|
|
110
|
+
interface PublicBarLink {
|
|
111
|
+
id: PublicBarSlot;
|
|
112
|
+
label: string;
|
|
113
|
+
href: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The one shape of a product's public bar: flat links, in this order, four at most — How it works · Pricing (when the
|
|
117
|
+
* product has a price) · Docs · Download (when an app exists). Privacy and Terms are the footer's, « Overview » is the mark.
|
|
118
|
+
* Pass the address of each slot the product has; the words come from the shared vocabulary.
|
|
119
|
+
*/
|
|
120
|
+
declare function publicBarLinks(hrefs: Partial<Record<PublicBarSlot, string>>, locale?: string): PublicBarLink[];
|
|
121
|
+
|
|
122
|
+
export { ACCOUNT_LINK_IDS, ACCOUNT_MENU_ORDER, MAIN_SECTIONS_MAX, PUBLIC_BAR_MAX, frameIssues, framePlaces, navVocabulary, navWord, navWords, orderAccountLinks, publicBarLinks };
|
|
123
|
+
export type { AccountLinkId, FramePlaces, FrameSection, NavLocale, NavWordKey, NavWords, PublicBarLink, PublicBarSlot };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// src/app-frame/contract.ts
|
|
2
|
+
var ACCOUNT_LINK_IDS = ["profile", "settings", "billing", "administration"];
|
|
3
|
+
var ACCOUNT_MENU_ORDER = ["identity", "profile", "settings", "billing", "administration", "language", "theme", "signOut"];
|
|
4
|
+
var MAIN_SECTIONS_MAX = 5;
|
|
5
|
+
function framePlaces(sections, accountLinks = []) {
|
|
6
|
+
const result = { main: [], foot: [], dropped: [] };
|
|
7
|
+
for (const section of sections) {
|
|
8
|
+
if (section.gated) result.dropped.push({ id: section.id, reason: "gated" });
|
|
9
|
+
else if (accountLinks.includes(section.id)) result.dropped.push({ id: section.id, reason: "account" });
|
|
10
|
+
else result[section.place === "foot" ? "foot" : "main"].push(section);
|
|
11
|
+
}
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
function orderAccountLinks(links, admin = false) {
|
|
15
|
+
if (!links) return [];
|
|
16
|
+
return ACCOUNT_LINK_IDS.flatMap((id) => {
|
|
17
|
+
const link = links[id];
|
|
18
|
+
return link && !(admin && id === "administration") ? [{ id, link }] : [];
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function frameIssues(sections, accountLinks = []) {
|
|
22
|
+
const issues = [];
|
|
23
|
+
const ids = sections.map((s) => s.id);
|
|
24
|
+
for (const id of new Set(ids)) if (ids.filter((x) => x === id).length > 1) issues.push(`The section "${id}" is declared twice.`);
|
|
25
|
+
const places = framePlaces(sections, accountLinks);
|
|
26
|
+
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.`);
|
|
27
|
+
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.`);
|
|
28
|
+
return issues;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/app-frame/vocabulary.ts
|
|
32
|
+
var navWords = {
|
|
33
|
+
en: {
|
|
34
|
+
docs: "Docs",
|
|
35
|
+
terms: "Terms",
|
|
36
|
+
privacy: "Privacy",
|
|
37
|
+
settings: "Settings",
|
|
38
|
+
billing: "Billing",
|
|
39
|
+
profile: "Profile",
|
|
40
|
+
administration: "Administration",
|
|
41
|
+
account: "Account",
|
|
42
|
+
language: "Language",
|
|
43
|
+
theme: "Theme",
|
|
44
|
+
themeLight: "Light",
|
|
45
|
+
themeDark: "Dark",
|
|
46
|
+
themeSystem: "System",
|
|
47
|
+
signOut: "Sign out",
|
|
48
|
+
howItWorks: "How it works",
|
|
49
|
+
pricing: "Pricing",
|
|
50
|
+
download: "Download",
|
|
51
|
+
contact: "Contact",
|
|
52
|
+
search: "Search",
|
|
53
|
+
notifications: "Notifications",
|
|
54
|
+
expand: "Show the words",
|
|
55
|
+
collapse: "Hide the words"
|
|
56
|
+
},
|
|
57
|
+
fr: {
|
|
58
|
+
docs: "Docs",
|
|
59
|
+
terms: "Conditions d'utilisation",
|
|
60
|
+
privacy: "Confidentialit\xE9",
|
|
61
|
+
settings: "R\xE9glages",
|
|
62
|
+
billing: "Facturation",
|
|
63
|
+
profile: "Profil",
|
|
64
|
+
administration: "Administration",
|
|
65
|
+
account: "Compte",
|
|
66
|
+
language: "Langue",
|
|
67
|
+
theme: "Th\xE8me",
|
|
68
|
+
themeLight: "Clair",
|
|
69
|
+
themeDark: "Sombre",
|
|
70
|
+
themeSystem: "Syst\xE8me",
|
|
71
|
+
signOut: "Se d\xE9connecter",
|
|
72
|
+
howItWorks: "Comment \xE7a marche",
|
|
73
|
+
pricing: "Tarifs",
|
|
74
|
+
download: "T\xE9l\xE9charger",
|
|
75
|
+
contact: "Contact",
|
|
76
|
+
search: "Rechercher",
|
|
77
|
+
notifications: "Notifications",
|
|
78
|
+
expand: "Afficher les mots",
|
|
79
|
+
collapse: "Masquer les mots"
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
function navVocabulary(locale = "en") {
|
|
83
|
+
return navWords[locale.toLowerCase().startsWith("fr") ? "fr" : "en"];
|
|
84
|
+
}
|
|
85
|
+
function navWord(locale, key) {
|
|
86
|
+
return navVocabulary(locale)[key];
|
|
87
|
+
}
|
|
88
|
+
var PUBLIC_BAR_MAX = 4;
|
|
89
|
+
function publicBarLinks(hrefs, locale) {
|
|
90
|
+
const order = ["howItWorks", "pricing", "docs", "download"];
|
|
91
|
+
return order.flatMap((id) => {
|
|
92
|
+
const href = hrefs[id];
|
|
93
|
+
return href ? [{ id, label: navWord(locale, id), href }] : [];
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
ACCOUNT_LINK_IDS,
|
|
98
|
+
ACCOUNT_MENU_ORDER,
|
|
99
|
+
MAIN_SECTIONS_MAX,
|
|
100
|
+
PUBLIC_BAR_MAX,
|
|
101
|
+
frameIssues,
|
|
102
|
+
framePlaces,
|
|
103
|
+
navVocabulary,
|
|
104
|
+
navWord,
|
|
105
|
+
navWords,
|
|
106
|
+
orderAccountLinks,
|
|
107
|
+
publicBarLinks
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/app-frame/contract.ts","../../src/app-frame/vocabulary.ts"],"sourcesContent":["// 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":";AAKO,IAAM,mBAAmB,CAAC,WAAW,YAAY,WAAW,gB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