@krizaka/ui 3.54.0 → 3.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{RotatingWord-D9s7FXFD.d.ts → RotatingWord-COSabR2c.d.ts} +2 -1
- package/dist/account-menu.d.ts +8 -3
- package/dist/account-menu.js +8 -1
- package/dist/account-menu.js.map +1 -1
- package/dist/account-settings.d.ts +153 -61
- package/dist/account-settings.js +243 -160
- package/dist/account-settings.js.map +1 -1
- package/dist/achievement.d.ts +2 -1
- package/dist/action-bar.d.ts +3 -2
- package/dist/activity-feed.d.ts +2 -1
- package/dist/agenda.d.ts +2 -1
- package/dist/alert.d.ts +2 -1
- package/dist/anatomy-plate.d.ts +6 -2
- package/dist/anatomy-plate.js +4 -0
- package/dist/anatomy-plate.js.map +1 -1
- package/dist/app-header/search.d.ts +64 -0
- package/dist/app-header/search.js +70 -0
- package/dist/app-header/search.js.map +1 -0
- package/dist/app-header.d.ts +89 -4
- package/dist/app-header.js +63 -5
- package/dist/app-header.js.map +1 -1
- package/dist/app-shell.d.ts +26 -25
- package/dist/app-shell.js +31 -40
- package/dist/app-shell.js.map +1 -1
- package/dist/argument-card.d.ts +3 -2
- package/dist/argument-card.js +3 -3
- package/dist/audio-player.d.ts +2 -1
- package/dist/auth-layout.d.ts +11 -10
- package/dist/avatar/defaults.d.ts +2 -1
- package/dist/avatar.d.ts +2 -1
- package/dist/badge.d.ts +2 -1
- package/dist/bird-plate.d.ts +7 -3
- package/dist/bird-plate.js +2 -2
- package/dist/bird-plate.js.map +1 -1
- package/dist/blocks.css +235 -27
- package/dist/button.d.ts +2 -1
- package/dist/captcha.d.ts +2 -1
- package/dist/captcha.js +1 -0
- package/dist/captcha.js.map +1 -1
- package/dist/card-grid.d.ts +2 -1
- package/dist/card.d.ts +2 -1
- package/dist/catalogue-page.d.ts +82 -2
- package/dist/catalogue-page.js +156 -13
- package/dist/catalogue-page.js.map +1 -1
- package/dist/changelog-page.d.ts +2 -1
- package/dist/chapter.d.ts +2 -1
- package/dist/chat.d.ts +14 -13
- package/dist/chat.js +2 -2
- package/dist/chat.js.map +1 -1
- package/dist/checkbox.d.ts +2 -1
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/chip-link.d.ts +2 -1
- package/dist/chip-row.d.ts +8 -7
- package/dist/chip.d.ts +55 -1
- package/dist/chip.js +14 -98
- package/dist/chip.js.map +1 -1
- package/dist/choice-grid.d.ts +3 -2
- package/dist/choice-grid.js +28 -88
- package/dist/choice-grid.js.map +1 -1
- package/dist/chunk-27AWSJTK.js +46 -0
- package/dist/chunk-27AWSJTK.js.map +1 -0
- package/dist/{chunk-YGIN2YIY.js → chunk-3X3OF4TI.js} +2 -2
- package/dist/chunk-3X3OF4TI.js.map +1 -0
- package/dist/{chunk-KBQD6HE3.js → chunk-4GQH27IT.js} +3 -3
- package/dist/{chunk-KBQD6HE3.js.map → chunk-4GQH27IT.js.map} +1 -1
- package/dist/{chunk-YHKTYFOQ.js → chunk-5LANVCK7.js} +383 -107
- package/dist/chunk-5LANVCK7.js.map +1 -0
- package/dist/{chunk-KDXRYUD3.js → chunk-5QEXOGO2.js} +3 -1
- package/dist/{chunk-KDXRYUD3.js.map → chunk-5QEXOGO2.js.map} +1 -1
- package/dist/chunk-5VEVYDVC.js +11 -0
- package/dist/chunk-5VEVYDVC.js.map +1 -0
- package/dist/chunk-7J2L4HOD.js +340 -0
- package/dist/chunk-7J2L4HOD.js.map +1 -0
- package/dist/chunk-BDIU5LZB.js +18 -0
- package/dist/chunk-BDIU5LZB.js.map +1 -0
- package/dist/chunk-BQ4EOR2O.js +177 -0
- package/dist/chunk-BQ4EOR2O.js.map +1 -0
- package/dist/chunk-CSRKYZ53.js +39 -0
- package/dist/chunk-CSRKYZ53.js.map +1 -0
- package/dist/chunk-F6JTHPHE.js +399 -0
- package/dist/chunk-F6JTHPHE.js.map +1 -0
- package/dist/chunk-HEKDKM5Y.js +128 -0
- package/dist/chunk-HEKDKM5Y.js.map +1 -0
- package/dist/chunk-KGLRZMCY.js +16 -0
- package/dist/chunk-KGLRZMCY.js.map +1 -0
- package/dist/chunk-KID32IRJ.js +18 -0
- package/dist/chunk-KID32IRJ.js.map +1 -0
- package/dist/chunk-OGWB76BR.js +90 -0
- package/dist/chunk-OGWB76BR.js.map +1 -0
- package/dist/{chunk-4LYKBSOG.js → chunk-USPOIQV5.js} +2 -2
- package/dist/chunk-USPOIQV5.js.map +1 -0
- package/dist/chunk-UYGUSYIC.js +173 -0
- package/dist/chunk-UYGUSYIC.js.map +1 -0
- package/dist/{chunk-7NRSPHAF.js → chunk-VB7MWE2N.js} +2 -2
- package/dist/{chunk-7NRSPHAF.js.map → chunk-VB7MWE2N.js.map} +1 -1
- package/dist/chunk-WOZP3JLW.js +51 -0
- package/dist/chunk-WOZP3JLW.js.map +1 -0
- package/dist/chunk-XVXFMVG3.js +27 -0
- package/dist/chunk-XVXFMVG3.js.map +1 -0
- package/dist/chunk-YCZ7N6Q6.js +385 -0
- package/dist/chunk-YCZ7N6Q6.js.map +1 -0
- package/dist/code-block.d.ts +2 -1
- package/dist/code-block.js +81 -98
- package/dist/code-block.js.map +1 -1
- package/dist/combobox.d.ts +20 -19
- package/dist/combobox.js +3 -2
- package/dist/command.d.ts +21 -20
- package/dist/comparison-table.d.ts +2 -1
- package/dist/component-page.d.ts +6 -2
- package/dist/component-page.js +5 -0
- package/dist/component-page.js.map +1 -1
- package/dist/confirm-button.d.ts +2 -1
- package/dist/contact-page.d.ts +2 -1
- package/dist/continue-prompt.d.ts +6 -2
- package/dist/continue-prompt.js +4 -0
- package/dist/continue-prompt.js.map +1 -1
- package/dist/countdown.d.ts +2 -1
- package/dist/cover-hero.d.ts +20 -19
- package/dist/cover-hero.js +25 -42
- package/dist/cover-hero.js.map +1 -1
- package/dist/cta-panel.d.ts +2 -1
- package/dist/dashboard-layout.d.ts +50 -2
- package/dist/dashboard-layout.js +66 -11
- package/dist/dashboard-layout.js.map +1 -1
- package/dist/data-table.d.ts +103 -4
- package/dist/data-table.js +23 -7
- package/dist/date-picker.d.ts +29 -28
- package/dist/date-picker.js +2 -2
- package/dist/date-picker.js.map +1 -1
- package/dist/decision-list.d.ts +2 -1
- package/dist/description-list.d.ts +2 -1
- package/dist/detail-layout.d.ts +147 -3
- package/dist/detail-layout.js +143 -17
- package/dist/detail-layout.js.map +1 -1
- package/dist/{dialog-D42QwYb_.d.ts → dialog-DpUwec2g.d.ts} +2 -1
- package/dist/dialog.d.ts +3 -2
- package/dist/docs-article-page.d.ts +2 -1
- package/dist/docs-hub-page.d.ts +2 -1
- package/dist/docs-layout.d.ts +2 -1
- package/dist/docs-nav.d.ts +3 -10
- package/dist/document-viewer.d.ts +5 -4
- package/dist/doodle.d.ts +32 -0
- package/dist/doodle.js +70 -0
- package/dist/doodle.js.map +1 -0
- package/dist/drop-overlay.d.ts +14 -5
- package/dist/drop-overlay.js +16 -6
- package/dist/drop-overlay.js.map +1 -1
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +13 -74
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/elephant.d.ts +4 -1
- package/dist/elephant.js +4 -0
- package/dist/elephant.js.map +1 -1
- package/dist/empty-state.d.ts +2 -1
- package/dist/engine-flow.d.ts +2 -1
- package/dist/error-page.d.ts +2 -1
- package/dist/field.js +1 -1
- package/dist/field.js.map +1 -1
- package/dist/file-upload.d.ts +14 -13
- package/dist/filter-bar.d.ts +84 -11
- package/dist/filter-bar.js +6 -2
- package/dist/flock.d.ts +3 -2
- package/dist/footnote.d.ts +2 -1
- package/dist/force-update-screen.d.ts +13 -8
- package/dist/force-update-screen.js +4 -0
- package/dist/force-update-screen.js.map +1 -1
- package/dist/form/server.d.ts +2 -1
- package/dist/form.d.ts +2 -1
- package/dist/gallery-page.d.ts +6 -2
- package/dist/gallery-page.js +4 -0
- package/dist/gallery-page.js.map +1 -1
- package/dist/genui.d.ts +2 -1
- package/dist/genui.js +5 -5
- package/dist/{geometry-DX-W-Yyf.d.ts → geometry-DZ4Q3hDQ.d.ts} +2 -1
- package/dist/glossary-term.d.ts +2 -1
- package/dist/glossary.d.ts +2 -1
- package/dist/glow-card.d.ts +2 -1
- package/dist/goal-gauge.d.ts +2 -1
- package/dist/grade-stamp.d.ts +23 -0
- package/dist/grade-stamp.js +42 -0
- package/dist/grade-stamp.js.map +1 -0
- package/dist/how-it-works-page.d.ts +2 -1
- package/dist/image-cropper.d.ts +15 -6
- package/dist/image-cropper.js +4 -0
- package/dist/image-cropper.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -4
- package/dist/iso.d.ts +2 -1
- package/dist/kanban.d.ts +5 -1
- package/dist/kanban.js +4 -0
- package/dist/kanban.js.map +1 -1
- package/dist/kbd.d.ts +2 -1
- package/dist/kind-config-editor.d.ts +152 -0
- package/dist/kind-config-editor.js +574 -0
- package/dist/kind-config-editor.js.map +1 -0
- package/dist/kpi-explained.d.ts +2 -1
- package/dist/landing-page.d.ts +2 -1
- package/dist/landscape.d.ts +6 -2
- package/dist/landscape.js +4 -0
- package/dist/landscape.js.map +1 -1
- package/dist/language-switch/server.d.ts +2 -1
- package/dist/language-switch.d.ts +11 -10
- package/dist/legal-page.d.ts +2 -1
- package/dist/link-card.d.ts +2 -1
- package/dist/list.d.ts +2 -1
- package/dist/list.js +1 -1
- package/dist/loader.d.ts +2 -1
- package/dist/longform-page.d.ts +2 -1
- package/dist/maintenance-screen.d.ts +10 -5
- package/dist/maintenance-screen.js +4 -0
- package/dist/maintenance-screen.js.map +1 -1
- package/dist/map.d.ts +8 -7
- package/dist/map.js +30 -0
- package/dist/map.js.map +1 -1
- package/dist/markdown.d.ts +7 -2
- package/dist/markdown.js +12 -5
- package/dist/markdown.js.map +1 -1
- package/dist/marketing-layout.d.ts +5 -4
- package/dist/marquee.d.ts +2 -1
- package/dist/mascot-quote.d.ts +2 -1
- package/dist/mascot-state.d.ts +3 -2
- package/dist/mascots.d.ts +4 -3
- package/dist/match-dialog.d.ts +6 -2
- package/dist/match-dialog.js +4 -0
- package/dist/match-dialog.js.map +1 -1
- package/dist/media-capture.d.ts +11 -5
- package/dist/media-capture.js +4 -0
- package/dist/media-capture.js.map +1 -1
- package/dist/media-gallery.d.ts +2 -1
- package/dist/media-grid.d.ts +3 -10
- package/dist/meta-row.d.ts +2 -1
- package/dist/meter.d.ts +2 -1
- package/dist/meter.js +5 -121
- package/dist/meter.js.map +1 -1
- package/dist/motion.d.ts +3 -2
- package/dist/native/form.d.ts +2 -1
- package/dist/native/list.d.ts +2 -1
- package/dist/native/map.d.ts +2 -1
- package/dist/native/map.js +30 -0
- package/dist/native/map.js.map +1 -1
- package/dist/native/markdown.d.ts +11 -3
- package/dist/native/markdown.js +46 -7
- package/dist/native/markdown.js.map +1 -1
- package/dist/native/media-capture.d.ts +3 -1
- package/dist/native/media-capture.js +5 -0
- package/dist/native/media-capture.js.map +1 -1
- package/dist/native/media-picker.d.ts +2 -1
- package/dist/native/vertical-video.d.ts +10 -3
- package/dist/native/vertical-video.js +6 -0
- package/dist/native/vertical-video.js.map +1 -1
- package/dist/native/video-player.d.ts +2 -1
- package/dist/native.d.ts +323 -4
- package/dist/native.js +1974 -1348
- package/dist/native.js.map +1 -1
- package/dist/nav-bar/me.d.ts +33 -0
- package/dist/nav-bar/me.js +23 -0
- package/dist/nav-bar/me.js.map +1 -0
- package/dist/nav-bar.d.ts +61 -2
- package/dist/nav-bar.js +92 -48
- package/dist/nav-bar.js.map +1 -1
- package/dist/next-actions.d.ts +2 -1
- package/dist/notification-preferences.d.ts +152 -0
- package/dist/notification-preferences.js +78 -0
- package/dist/notification-preferences.js.map +1 -0
- package/dist/number-ticker.d.ts +2 -1
- package/dist/opening-hours.d.ts +2 -1
- package/dist/page-header.d.ts +2 -1
- package/dist/page-header.js +1 -1
- package/dist/page-header.js.map +1 -1
- package/dist/page-hero.d.ts +2 -1
- package/dist/page-index.d.ts +2 -1
- package/dist/page.d.ts +2 -1
- package/dist/pagination.d.ts +2 -1
- package/dist/photo-grid.d.ts +2 -1
- package/dist/pointer-light.d.ts +2 -1
- package/dist/pointer-light.js +5 -0
- package/dist/pointer-light.js.map +1 -1
- package/dist/popover.d.ts +2 -1
- package/dist/pricing-page.d.ts +2 -1
- package/dist/product-page.d.ts +6 -2
- package/dist/product-page.js +4 -0
- package/dist/product-page.js.map +1 -1
- package/dist/profile-card.d.ts +120 -1
- package/dist/profile-card.js +68 -21
- package/dist/profile-card.js.map +1 -1
- package/dist/progress.d.ts +2 -1
- package/dist/promise-card.d.ts +6 -2
- package/dist/promise-card.js +4 -0
- package/dist/promise-card.js.map +1 -1
- package/dist/quota-meter.d.ts +114 -0
- package/dist/quota-meter.js +58 -0
- package/dist/quota-meter.js.map +1 -0
- package/dist/radio-group.d.ts +2 -1
- package/dist/radio-group.js +7 -9
- package/dist/radio-group.js.map +1 -1
- package/dist/rail-nav.d.ts +35 -18
- package/dist/rail-nav.js +45 -56
- package/dist/rail-nav.js.map +1 -1
- package/dist/recipes.d.ts +2 -1
- package/dist/retro-tv.d.ts +31 -0
- package/dist/retro-tv.js +124 -0
- package/dist/retro-tv.js.map +1 -0
- package/dist/router.d.ts +13 -1
- package/dist/router.js +85 -8
- package/dist/router.js.map +1 -1
- package/dist/scroll-stage.d.ts +7 -2
- package/dist/scroll-stage.js +5 -0
- package/dist/scroll-stage.js.map +1 -1
- package/dist/search-field.d.ts +2 -1
- package/dist/search-field.js +1 -1
- package/dist/section-backdrop.d.ts +2 -1
- package/dist/separator.d.ts +2 -1
- package/dist/service-card.d.ts +9 -8
- package/dist/settings-layout.d.ts +2 -1
- package/dist/settings-layout.js +10 -324
- package/dist/settings-layout.js.map +1 -1
- package/dist/showcase.d.ts +11 -3
- package/dist/showcase.js +5 -0
- package/dist/showcase.js.map +1 -1
- package/dist/signature.d.ts +20 -0
- package/dist/signature.js +39 -0
- package/dist/signature.js.map +1 -0
- package/dist/site-cahier.d.ts +187 -0
- package/dist/site-cahier.js +844 -0
- package/dist/site-cahier.js.map +1 -0
- package/dist/site-footer.d.ts +2 -1
- package/dist/site-footer.js +1 -1
- package/dist/sites.d.ts +2 -1
- package/dist/sites.js +1 -1
- package/dist/sites.js.map +1 -1
- package/dist/skeleton.d.ts +2 -1
- package/dist/skip-link.d.ts +2 -1
- package/dist/slider.d.ts +2 -1
- package/dist/slot-picker.d.ts +86 -13
- package/dist/slot-picker.js +98 -16
- package/dist/slot-picker.js.map +1 -1
- package/dist/slot.d.ts +1 -1
- package/dist/specimen-tag.d.ts +2 -1
- package/dist/speed-lines.d.ts +19 -0
- package/dist/speed-lines.js +45 -0
- package/dist/speed-lines.js.map +1 -0
- package/dist/spinner.d.ts +2 -1
- package/dist/split-view.d.ts +2 -1
- package/dist/stage-banner.d.ts +2 -1
- package/dist/stat.d.ts +2 -1
- package/dist/stat.js +1 -1
- package/dist/stat.js.map +1 -1
- package/dist/status-chip.d.ts +44 -0
- package/dist/status-chip.js +137 -0
- package/dist/status-chip.js.map +1 -0
- package/dist/status-page.d.ts +6 -2
- package/dist/status-page.js +5 -0
- package/dist/status-page.js.map +1 -1
- package/dist/step-progress.d.ts +2 -1
- package/dist/step-showcase.d.ts +2 -1
- package/dist/stepper.d.ts +2 -1
- package/dist/sticky-action.d.ts +28 -5
- package/dist/sticky-action.js +10 -4
- package/dist/sticky-action.js.map +1 -1
- package/dist/stuck.d.ts +28 -0
- package/dist/stuck.js +26 -0
- package/dist/stuck.js.map +1 -0
- package/dist/swipe-deck.d.ts +11 -3
- package/dist/swipe-deck.js +5 -0
- package/dist/swipe-deck.js.map +1 -1
- package/dist/switch.d.ts +2 -1
- package/dist/switch.js +4 -32
- package/dist/switch.js.map +1 -1
- package/dist/tabs.d.ts +48 -8
- package/dist/tabs.js +62 -12
- package/dist/tabs.js.map +1 -1
- package/dist/tag-input.d.ts +2 -1
- package/dist/tag-input.js +3 -2
- package/dist/tag-input.js.map +1 -1
- package/dist/tag-selector.d.ts +30 -4
- package/dist/tag-selector.js +90 -8
- package/dist/tag-selector.js.map +1 -1
- package/dist/taped-photo.d.ts +2 -1
- package/dist/taped-photo.js +3 -20
- package/dist/taped-photo.js.map +1 -1
- package/dist/terminal-replay.d.ts +6 -2
- package/dist/terminal-replay.js +5 -1
- package/dist/terminal-replay.js.map +1 -1
- package/dist/text-style/server.d.ts +2 -1
- package/dist/text-style.d.ts +2 -1
- package/dist/theme.d.ts +21 -1
- package/dist/theme.js +37 -1
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts +2 -1
- package/dist/toc.d.ts +2 -1
- package/dist/tooltip.d.ts +2 -1
- package/dist/tree-view.d.ts +2 -1
- package/dist/tree-view.js +4 -0
- package/dist/tree-view.js.map +1 -1
- package/dist/update-prompt.d.ts +16 -11
- package/dist/update-prompt.js +4 -0
- package/dist/update-prompt.js.map +1 -1
- package/dist/upload-queue.d.ts +2 -1
- package/dist/verified-badge.d.ts +2 -1
- package/dist/versus-card.d.ts +40 -0
- package/dist/versus-card.js +40 -0
- package/dist/versus-card.js.map +1 -0
- package/dist/vertical-video.d.ts +2 -1
- package/dist/video-player.d.ts +20 -19
- package/dist/video-player.js +7 -376
- package/dist/video-player.js.map +1 -1
- package/dist/video-trimmer.d.ts +8 -2
- package/dist/video-trimmer.js +4 -0
- package/dist/video-trimmer.js.map +1 -1
- package/dist/virtual.d.ts +8 -7
- package/dist/waveform.d.ts +2 -1
- package/package.json +249 -52
- package/registry/account-menu.json +9 -8
- package/registry/account-settings.json +258 -6
- package/registry/achievement.json +3 -4
- package/registry/action-bar.json +3 -3
- package/registry/action-sheet.json +1 -0
- package/registry/activity-feed.json +2 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/anatomy-plate.json +13 -5
- package/registry/app-header.json +470 -23
- package/registry/app-shell.json +2 -2
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +3 -2
- package/registry/badge.json +2 -1
- package/registry/bird-plate.json +16 -2
- package/registry/button.json +7 -6
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +7 -6
- package/registry/catalogue-page.json +117 -8
- package/registry/changelog-page.json +3 -5
- package/registry/chapter.json +1 -1
- package/registry/chat.json +3 -2
- package/registry/checkbox.json +4 -3
- package/registry/chip-link.json +2 -2
- package/registry/chip-row.json +2 -2
- package/registry/chip.json +388 -12
- package/registry/choice-grid.json +3 -4
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +3 -2
- package/registry/command.json +2 -2
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +14 -5
- package/registry/confirm-button.json +4 -4
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +13 -5
- package/registry/countdown.json +4 -3
- package/registry/cover-hero.json +3 -4
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +91 -5
- package/registry/data-table.json +215 -8
- package/registry/date-picker.json +5 -4
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +2 -1
- package/registry/detail-layout.json +226 -8
- package/registry/dialog.json +7 -6
- package/registry/docs-article-page.json +3 -4
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +3 -5
- package/registry/doodle.json +302 -0
- package/registry/drop-overlay.json +30 -16
- package/registry/dropdown-menu.json +2 -2
- package/registry/elephant.json +15 -7
- package/registry/empty-state.json +2 -1
- package/registry/engine-flow.json +1 -1
- package/registry/error-page.json +3 -5
- package/registry/examples/account-settings/appearance.d.ts +4 -0
- package/registry/examples/account-settings/appearance.js +40 -0
- package/registry/examples/account-settings/appearance.tsx +30 -0
- package/registry/examples/app-header/family.d.ts +4 -0
- package/registry/examples/app-header/family.js +41 -0
- package/registry/examples/app-header/family.tsx +37 -0
- package/registry/examples/app-header/native/family.d.ts +4 -0
- package/registry/examples/app-header/native/family.dark.png +0 -0
- package/registry/examples/app-header/native/family.js +25 -0
- package/registry/examples/app-header/native/family.light.png +0 -0
- package/registry/examples/app-header/native/family.tsx +33 -0
- package/registry/examples/catalogue-page/clients.d.ts +4 -0
- package/registry/examples/catalogue-page/clients.js +49 -0
- package/registry/examples/catalogue-page/clients.tsx +61 -0
- package/registry/examples/chip/marker-picker.d.ts +4 -0
- package/registry/examples/chip/marker-picker.js +17 -0
- package/registry/examples/chip/marker-picker.tsx +17 -0
- package/registry/examples/chip/native/marker-picker.d.ts +4 -0
- package/registry/examples/chip/native/marker-picker.dark.png +0 -0
- package/registry/examples/chip/native/marker-picker.js +18 -0
- package/registry/examples/chip/native/marker-picker.light.png +0 -0
- package/registry/examples/chip/native/marker-picker.tsx +16 -0
- package/registry/examples/chip/native/tags.d.ts +4 -0
- package/registry/examples/chip/native/tags.dark.png +0 -0
- package/registry/examples/chip/native/tags.js +22 -0
- package/registry/examples/chip/native/tags.light.png +0 -0
- package/registry/examples/chip/native/tags.tsx +20 -0
- package/registry/examples/chip/tags.d.ts +4 -0
- package/registry/examples/chip/tags.js +26 -0
- package/registry/examples/chip/tags.tsx +23 -0
- package/registry/examples/dashboard-layout/today.d.ts +4 -0
- package/registry/examples/dashboard-layout/today.js +54 -0
- package/registry/examples/dashboard-layout/today.tsx +63 -0
- package/registry/examples/data-table/applicant-files.d.ts +4 -0
- package/registry/examples/data-table/applicant-files.js +24 -0
- package/registry/examples/data-table/applicant-files.tsx +23 -0
- package/registry/examples/data-table/bulk.d.ts +4 -0
- package/registry/examples/data-table/bulk.js +45 -0
- package/registry/examples/data-table/bulk.tsx +34 -0
- package/registry/examples/data-table/checks.d.ts +4 -0
- package/registry/examples/data-table/checks.js +25 -0
- package/registry/examples/data-table/checks.tsx +24 -0
- package/registry/examples/detail-layout/client.d.ts +4 -0
- package/registry/examples/detail-layout/client.js +40 -0
- package/registry/examples/detail-layout/client.tsx +39 -0
- package/registry/examples/detail-layout/new-invoice.d.ts +4 -0
- package/registry/examples/detail-layout/new-invoice.js +44 -0
- package/registry/examples/detail-layout/new-invoice.tsx +34 -0
- package/registry/examples/detail-layout/profile.d.ts +4 -0
- package/registry/examples/detail-layout/profile.js +26 -0
- package/registry/examples/detail-layout/profile.tsx +21 -0
- package/registry/examples/doodle/bird-sketch.d.ts +4 -0
- package/registry/examples/doodle/bird-sketch.js +11 -0
- package/registry/examples/doodle/bird-sketch.tsx +12 -0
- package/registry/examples/doodle/kinds.d.ts +4 -0
- package/registry/examples/doodle/kinds.js +17 -0
- package/registry/examples/doodle/kinds.tsx +14 -0
- package/registry/examples/doodle/margin-marks.d.ts +4 -0
- package/registry/examples/doodle/margin-marks.js +27 -0
- package/registry/examples/doodle/margin-marks.tsx +19 -0
- package/registry/examples/doodle/margin.d.ts +4 -0
- package/registry/examples/doodle/margin.js +17 -0
- package/registry/examples/doodle/margin.tsx +17 -0
- package/registry/examples/filter-bar/views.d.ts +4 -0
- package/registry/examples/filter-bar/views.js +39 -0
- package/registry/examples/filter-bar/views.tsx +30 -0
- package/registry/examples/grade-stamp/coverage.d.ts +4 -0
- package/registry/examples/grade-stamp/coverage.js +12 -0
- package/registry/examples/grade-stamp/coverage.tsx +8 -0
- package/registry/examples/grade-stamp/lighthouse.d.ts +4 -0
- package/registry/examples/grade-stamp/lighthouse.js +12 -0
- package/registry/examples/grade-stamp/lighthouse.tsx +14 -0
- package/registry/examples/kind-config-editor/derived.d.ts +4 -0
- package/registry/examples/kind-config-editor/derived.js +26 -0
- package/registry/examples/kind-config-editor/derived.tsx +16 -0
- package/registry/examples/kind-config-editor/native/status-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/native/status-set.dark.png +0 -0
- package/registry/examples/kind-config-editor/native/status-set.js +22 -0
- package/registry/examples/kind-config-editor/native/status-set.light.png +0 -0
- package/registry/examples/kind-config-editor/native/status-set.tsx +19 -0
- package/registry/examples/kind-config-editor/native/tag-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/native/tag-set.dark.png +0 -0
- package/registry/examples/kind-config-editor/native/tag-set.js +20 -0
- package/registry/examples/kind-config-editor/native/tag-set.light.png +0 -0
- package/registry/examples/kind-config-editor/native/tag-set.tsx +18 -0
- package/registry/examples/kind-config-editor/status-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/status-set.js +29 -0
- package/registry/examples/kind-config-editor/status-set.tsx +25 -0
- package/registry/examples/kind-config-editor/tag-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/tag-set.js +20 -0
- package/registry/examples/kind-config-editor/tag-set.tsx +18 -0
- package/registry/examples/markdown/native/basic.dark.png +0 -0
- package/registry/examples/markdown/native/basic.light.png +0 -0
- package/registry/examples/markdown/native/wide-table.d.ts +4 -0
- package/registry/examples/markdown/native/wide-table.dark.png +0 -0
- package/registry/examples/markdown/native/wide-table.js +23 -0
- package/registry/examples/markdown/native/wide-table.light.png +0 -0
- package/registry/examples/markdown/native/wide-table.tsx +22 -0
- package/registry/examples/markdown/wide-table.d.ts +4 -0
- package/registry/examples/markdown/wide-table.js +28 -0
- package/registry/examples/markdown/wide-table.tsx +23 -0
- package/registry/examples/nav-bar/family-product.js +2 -4
- package/registry/examples/nav-bar/family-product.tsx +3 -5
- package/registry/examples/notification-preferences/default.d.ts +4 -0
- package/registry/examples/notification-preferences/default.js +29 -0
- package/registry/examples/notification-preferences/default.tsx +28 -0
- package/registry/examples/profile-card/banner.d.ts +4 -0
- package/registry/examples/profile-card/banner.js +28 -0
- package/registry/examples/profile-card/banner.tsx +24 -0
- package/registry/examples/profile-card/native/banner.d.ts +4 -0
- package/registry/examples/profile-card/native/banner.dark.png +0 -0
- package/registry/examples/profile-card/native/banner.js +22 -0
- package/registry/examples/profile-card/native/banner.light.png +0 -0
- package/registry/examples/profile-card/native/banner.tsx +18 -0
- package/registry/examples/quota-meter/default.d.ts +4 -0
- package/registry/examples/quota-meter/default.js +26 -0
- package/registry/examples/quota-meter/default.tsx +20 -0
- package/registry/examples/quota-meter/full.d.ts +4 -0
- package/registry/examples/quota-meter/full.js +25 -0
- package/registry/examples/quota-meter/full.tsx +18 -0
- package/registry/examples/rail-nav/shortcuts.d.ts +4 -0
- package/registry/examples/rail-nav/shortcuts.js +49 -0
- package/registry/examples/rail-nav/shortcuts.tsx +40 -0
- package/registry/examples/retro-tv/cabinet.d.ts +4 -0
- package/registry/examples/retro-tv/cabinet.js +12 -0
- package/registry/examples/retro-tv/cabinet.tsx +7 -0
- package/registry/examples/retro-tv/portable.d.ts +4 -0
- package/registry/examples/retro-tv/portable.js +12 -0
- package/registry/examples/retro-tv/portable.tsx +7 -0
- package/registry/examples/signature/both.d.ts +4 -0
- package/registry/examples/signature/both.js +11 -0
- package/registry/examples/signature/both.tsx +6 -0
- package/registry/examples/signature/variants.d.ts +4 -0
- package/registry/examples/signature/variants.js +14 -0
- package/registry/examples/signature/variants.tsx +11 -0
- package/registry/examples/site-cahier/java-releases.d.ts +4 -0
- package/registry/examples/site-cahier/java-releases.js +33 -0
- package/registry/examples/site-cahier/java-releases.tsx +32 -0
- package/registry/examples/site-cahier/motion-lab.d.ts +4 -0
- package/registry/examples/site-cahier/motion-lab.js +32 -0
- package/registry/examples/site-cahier/motion-lab.tsx +29 -0
- package/registry/examples/site-cahier/ts-changelog.d.ts +4 -0
- package/registry/examples/site-cahier/ts-changelog.js +24 -0
- package/registry/examples/site-cahier/ts-changelog.tsx +20 -0
- package/registry/examples/site-cahier/ts-doc.d.ts +4 -0
- package/registry/examples/site-cahier/ts-doc.js +38 -0
- package/registry/examples/site-cahier/ts-doc.tsx +27 -0
- package/registry/examples/site-cahier/ui-home.d.ts +4 -0
- package/registry/examples/site-cahier/ui-home.js +46 -0
- package/registry/examples/site-cahier/ui-home.tsx +40 -0
- package/registry/examples/slot-picker/weeks.d.ts +4 -0
- package/registry/examples/slot-picker/weeks.js +45 -0
- package/registry/examples/slot-picker/weeks.tsx +28 -0
- package/registry/examples/speed-lines/hero.d.ts +4 -0
- package/registry/examples/speed-lines/hero.js +11 -0
- package/registry/examples/speed-lines/hero.tsx +12 -0
- package/registry/examples/speed-lines/streaks.d.ts +4 -0
- package/registry/examples/speed-lines/streaks.js +11 -0
- package/registry/examples/speed-lines/streaks.tsx +12 -0
- package/registry/examples/status-chip/default.d.ts +4 -0
- package/registry/examples/status-chip/default.js +35 -0
- package/registry/examples/status-chip/default.tsx +32 -0
- package/registry/examples/status-chip/native/default.d.ts +4 -0
- package/registry/examples/status-chip/native/default.dark.png +0 -0
- package/registry/examples/status-chip/native/default.js +26 -0
- package/registry/examples/status-chip/native/default.light.png +0 -0
- package/registry/examples/status-chip/native/default.tsx +20 -0
- package/registry/examples/stuck/card.d.ts +4 -0
- package/registry/examples/stuck/card.js +13 -0
- package/registry/examples/stuck/card.tsx +14 -0
- package/registry/examples/stuck/holds.d.ts +4 -0
- package/registry/examples/stuck/holds.js +12 -0
- package/registry/examples/stuck/holds.tsx +16 -0
- package/registry/examples/stuck/tag.d.ts +4 -0
- package/registry/examples/stuck/tag.js +12 -0
- package/registry/examples/stuck/tag.tsx +13 -0
- package/registry/examples/tabs/binder.d.ts +4 -0
- package/registry/examples/tabs/binder.js +22 -0
- package/registry/examples/tabs/binder.tsx +20 -0
- package/registry/examples/tabs/native/binder.d.ts +4 -0
- package/registry/examples/tabs/native/binder.dark.png +0 -0
- package/registry/examples/tabs/native/binder.js +26 -0
- package/registry/examples/tabs/native/binder.light.png +0 -0
- package/registry/examples/tabs/native/binder.tsx +22 -0
- package/registry/examples/tag-selector/creatable.d.ts +4 -0
- package/registry/examples/tag-selector/creatable.js +41 -0
- package/registry/examples/tag-selector/creatable.tsx +29 -0
- package/registry/examples/tag-selector/native/tags.d.ts +4 -0
- package/registry/examples/tag-selector/native/tags.dark.png +0 -0
- package/registry/examples/tag-selector/native/tags.js +19 -0
- package/registry/examples/tag-selector/native/tags.light.png +0 -0
- package/registry/examples/tag-selector/native/tags.tsx +19 -0
- package/registry/examples/versus-card/alternatives.d.ts +4 -0
- package/registry/examples/versus-card/alternatives.js +20 -0
- package/registry/examples/versus-card/alternatives.tsx +14 -0
- package/registry/examples/versus-card/releases.d.ts +4 -0
- package/registry/examples/versus-card/releases.js +35 -0
- package/registry/examples/versus-card/releases.tsx +29 -0
- package/registry/fab.json +1 -0
- package/registry/field.json +3 -2
- package/registry/file-upload.json +6 -11
- package/registry/filter-bar.json +209 -9
- package/registry/flock.json +3 -4
- package/registry/footnote.json +2 -3
- package/registry/force-update-screen.json +14 -5
- package/registry/form.json +5 -4
- package/registry/gallery-page.json +14 -5
- package/registry/genui.json +2 -2
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +2 -2
- package/registry/goal-gauge.json +2 -1
- package/registry/grade-stamp.json +227 -0
- package/registry/header.json +1 -0
- package/registry/how-it-works-page.json +3 -5
- package/registry/image-cropper.json +13 -5
- package/registry/image-viewer.json +3 -4
- package/registry/index.json +612 -105
- package/registry/iso.json +1 -1
- package/registry/kanban.json +13 -5
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +565 -0
- package/registry/kpi-explained.json +2 -2
- package/registry/landing-page.json +3 -5
- package/registry/landscape.json +13 -5
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +2 -1
- package/registry/loader.json +2 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +14 -5
- package/registry/map.json +3 -2
- package/registry/markdown.json +86 -9
- 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 +12 -11
- package/registry/mascots.json +2 -1
- package/registry/match-dialog.json +14 -5
- package/registry/media-capture.json +14 -5
- package/registry/media-gallery.json +3 -5
- package/registry/media-grid.json +1 -1
- package/registry/media-picker.json +2 -3
- package/registry/meta-row.json +2 -1
- package/registry/meter.json +4 -3
- package/registry/nav-bar.json +100 -9
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +250 -0
- package/registry/number-ticker.json +2 -1
- package/registry/onboarding.json +1 -0
- package/registry/opening-hours.json +1 -1
- package/registry/otp-input.json +1 -0
- package/registry/page-header.json +2 -2
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +3 -3
- package/registry/pagination.json +2 -1
- package/registry/permission-prompt.json +2 -2
- package/registry/photo-grid.json +4 -4
- package/registry/pointer-light.json +6 -2
- package/registry/popover.json +2 -2
- package/registry/pricing-page.json +4 -6
- package/registry/product-page.json +14 -5
- package/registry/profile-card.json +232 -8
- package/registry/progress.json +4 -3
- package/registry/promise-card.json +13 -5
- package/registry/pull-to-refresh.json +1 -0
- package/registry/quota-meter.json +308 -0
- package/registry/radio-group.json +4 -3
- package/registry/rail-nav.json +48 -10
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +478 -0
- package/registry/router.json +3 -3
- package/registry/screen.json +1 -0
- package/registry/scroll-stage.json +14 -5
- package/registry/search-field.json +3 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/segmented.json +1 -0
- package/registry/separator.json +2 -2
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +2 -1
- package/registry/showcase.json +14 -5
- package/registry/signature.json +185 -0
- package/registry/site-cahier.json +548 -0
- package/registry/site-footer.json +3 -3
- package/registry/sites.json +2 -2
- package/registry/skeleton.json +2 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +5 -4
- package/registry/slot-picker.json +156 -10
- package/registry/slot.json +2 -2
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +174 -0
- package/registry/spinner.json +4 -3
- package/registry/splash-handoff.json +1 -0
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +2 -3
- package/registry/stat.json +2 -2
- package/registry/status-chip.json +350 -0
- package/registry/status-page.json +13 -5
- package/registry/step-progress.json +2 -1
- package/registry/step-showcase.json +3 -5
- package/registry/stepper.json +2 -1
- package/registry/sticky-action.json +38 -8
- package/registry/stuck.json +219 -0
- package/registry/swipe-deck.json +14 -5
- package/registry/swipeable-row.json +1 -0
- package/registry/switch.json +3 -2
- package/registry/tab-bar.json +1 -0
- package/registry/tabs.json +154 -22
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +190 -12
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +14 -5
- package/registry/text-style.json +5 -5
- package/registry/theme.json +4 -3
- package/registry/toast.json +2 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +2 -2
- package/registry/tree-view.json +6 -2
- package/registry/txt.json +1 -0
- package/registry/update-prompt.json +14 -5
- package/registry/upload-queue.json +1 -1
- package/registry/verified-badge.json +6 -6
- package/registry/versus-card.json +194 -0
- package/registry/vertical-video.json +8 -3
- package/registry/video-player.json +5 -6
- package/registry/video-trimmer.json +13 -5
- package/registry/virtual.json +2 -2
- package/registry/waveform.json +4 -3
- package/dist/chunk-4LYKBSOG.js.map +0 -1
- package/dist/chunk-HHFWK2HH.js +0 -163
- package/dist/chunk-HHFWK2HH.js.map +0 -1
- package/dist/chunk-R3LTSMS5.js +0 -75
- package/dist/chunk-R3LTSMS5.js.map +0 -1
- package/dist/chunk-YGIN2YIY.js.map +0 -1
- package/dist/chunk-YHKTYFOQ.js.map +0 -1
- package/dist/chunk-ZQW7LF4Y.js +0 -179
- package/dist/chunk-ZQW7LF4Y.js.map +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare const quotaMeter: tailwind_variants.TVReturnType<{
|
|
5
|
+
level: {
|
|
6
|
+
ok: {
|
|
7
|
+
status: string;
|
|
8
|
+
};
|
|
9
|
+
warning: {
|
|
10
|
+
status: string;
|
|
11
|
+
};
|
|
12
|
+
critical: {
|
|
13
|
+
status: string;
|
|
14
|
+
};
|
|
15
|
+
full: {
|
|
16
|
+
status: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}, {
|
|
20
|
+
root: string;
|
|
21
|
+
head: string;
|
|
22
|
+
title: string;
|
|
23
|
+
icon: string;
|
|
24
|
+
plan: string;
|
|
25
|
+
used: string;
|
|
26
|
+
status: string;
|
|
27
|
+
details: string;
|
|
28
|
+
}, undefined, {
|
|
29
|
+
level: {
|
|
30
|
+
ok: {
|
|
31
|
+
status: string;
|
|
32
|
+
};
|
|
33
|
+
warning: {
|
|
34
|
+
status: string;
|
|
35
|
+
};
|
|
36
|
+
critical: {
|
|
37
|
+
status: string;
|
|
38
|
+
};
|
|
39
|
+
full: {
|
|
40
|
+
status: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}, {
|
|
44
|
+
root: string;
|
|
45
|
+
head: string;
|
|
46
|
+
title: string;
|
|
47
|
+
icon: string;
|
|
48
|
+
plan: string;
|
|
49
|
+
used: string;
|
|
50
|
+
status: string;
|
|
51
|
+
details: string;
|
|
52
|
+
}, tailwind_variants.TVReturnTypeLike<{
|
|
53
|
+
level: {
|
|
54
|
+
ok: {
|
|
55
|
+
status: string;
|
|
56
|
+
};
|
|
57
|
+
warning: {
|
|
58
|
+
status: string;
|
|
59
|
+
};
|
|
60
|
+
critical: {
|
|
61
|
+
status: string;
|
|
62
|
+
};
|
|
63
|
+
full: {
|
|
64
|
+
status: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}, {
|
|
68
|
+
root: string;
|
|
69
|
+
head: string;
|
|
70
|
+
title: string;
|
|
71
|
+
icon: string;
|
|
72
|
+
plan: string;
|
|
73
|
+
used: string;
|
|
74
|
+
status: string;
|
|
75
|
+
details: string;
|
|
76
|
+
}>>;
|
|
77
|
+
type QuotaLevel = "ok" | "warning" | "critical" | "full";
|
|
78
|
+
/** Where the meter turns amber and red, as shares of the limit. */
|
|
79
|
+
declare const QUOTA_THRESHOLDS: {
|
|
80
|
+
readonly low: 0.8;
|
|
81
|
+
readonly high: 0.95;
|
|
82
|
+
};
|
|
83
|
+
type QuotaMeterProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
84
|
+
/** What is measured (`Storage`), with an optional icon before it. */
|
|
85
|
+
title: React.ReactNode;
|
|
86
|
+
/** A glyph before the title (decorative). */
|
|
87
|
+
icon?: React.ReactNode;
|
|
88
|
+
/** The plan's name, on the right of the title. */
|
|
89
|
+
plan?: React.ReactNode;
|
|
90
|
+
/** Used so far, in the unit of `max`. */
|
|
91
|
+
value: number;
|
|
92
|
+
/** The limit; `null` for no limit (no meter is drawn). */
|
|
93
|
+
max: number | null;
|
|
94
|
+
/** « 3.2 GB of 10 GB », said once for the eye and once for the meter's value. */
|
|
95
|
+
usedText: string;
|
|
96
|
+
/** The meter's accessible name. */
|
|
97
|
+
meterLabel: string;
|
|
98
|
+
/** Where the level stands: tones the sentence and gives an alarming one a status role. */
|
|
99
|
+
level?: QuotaLevel;
|
|
100
|
+
/** The sentence for that level (« You are close to your limit »). */
|
|
101
|
+
statusText?: React.ReactNode;
|
|
102
|
+
/** More sentences that matter (« 2 uploads on hold », « uploads are paused »), each a status. */
|
|
103
|
+
notices?: readonly React.ReactNode[];
|
|
104
|
+
/** Small figures under the meter (minutes, today's uploads). Left out when the card is compact. */
|
|
105
|
+
details?: readonly React.ReactNode[];
|
|
106
|
+
/** The way out, shown under the figures (a link to manage). */
|
|
107
|
+
action?: React.ReactNode;
|
|
108
|
+
/** Leaves out the footer (the small figures and the action): the title, the used line, the meter, the sentence and the notices stay. */
|
|
109
|
+
compact?: boolean;
|
|
110
|
+
};
|
|
111
|
+
declare function QuotaMeter({ title, icon, plan, value, max, usedText, meterLabel, level, statusText, notices, details, action, compact, className, ...props }: QuotaMeterProps): React.JSX.Element;
|
|
112
|
+
|
|
113
|
+
export { QUOTA_THRESHOLDS, QuotaMeter, quotaMeter };
|
|
114
|
+
export type { QuotaLevel, QuotaMeterProps };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Meter
|
|
3
|
+
} from "./chunk-HEKDKM5Y.js";
|
|
4
|
+
|
|
5
|
+
// src/quota-meter/quota-meter.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { tv } from "tailwind-variants";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var quotaMeter = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
root: "flex flex-col gap-2 rounded-2xl border border-border-default bg-surface-1 p-5",
|
|
12
|
+
head: "flex items-center justify-between gap-3",
|
|
13
|
+
title: "flex items-center gap-2 font-mono text-xs text-fg-secondary",
|
|
14
|
+
icon: "inline-flex shrink-0 [&>svg]:h-3.5 [&>svg]:w-3.5",
|
|
15
|
+
plan: "text-xs text-fg-secondary",
|
|
16
|
+
used: "font-mono text-lg font-black text-fg",
|
|
17
|
+
status: "flex items-start gap-1.5 text-xs leading-relaxed",
|
|
18
|
+
details: "flex flex-wrap items-center justify-between gap-2 text-xs text-fg-secondary"
|
|
19
|
+
},
|
|
20
|
+
variants: {
|
|
21
|
+
level: {
|
|
22
|
+
ok: { status: "text-fg-secondary" },
|
|
23
|
+
warning: { status: "text-fg-warning" },
|
|
24
|
+
critical: { status: "text-fg-danger" },
|
|
25
|
+
full: { status: "text-fg-danger" }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: { level: "ok" }
|
|
29
|
+
});
|
|
30
|
+
var QUOTA_THRESHOLDS = { low: 0.8, high: 0.95 };
|
|
31
|
+
function QuotaMeter({ title, icon, plan, value, max, usedText, meterLabel, level = "ok", statusText, notices = [], details = [], action, compact = false, className, ...props }) {
|
|
32
|
+
const s = quotaMeter({ level });
|
|
33
|
+
const alarming = level !== "ok";
|
|
34
|
+
const titleId = React.useId();
|
|
35
|
+
return /* @__PURE__ */ jsxs("section", { "aria-labelledby": titleId, className: s.root({ className }), ...props, children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("div", { className: s.head(), children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("h3", { id: titleId, className: s.title(), children: [
|
|
38
|
+
icon && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: s.icon(), children: icon }),
|
|
39
|
+
title
|
|
40
|
+
] }),
|
|
41
|
+
plan && /* @__PURE__ */ jsx("span", { className: s.plan(), children: plan })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx("p", { className: s.used(), children: usedText }),
|
|
44
|
+
max !== null && /* @__PURE__ */ jsx(Meter, { size: "sm", value: Math.min(value, max), max, label: meterLabel, valueText: usedText, thresholds: QUOTA_THRESHOLDS }),
|
|
45
|
+
statusText && /* @__PURE__ */ jsx("p", { className: s.status(), role: alarming ? "status" : void 0, children: statusText }),
|
|
46
|
+
notices.map((n, i) => /* @__PURE__ */ jsx("p", { className: quotaMeter({ level: "critical" }).status(), role: "status", children: n }, i)),
|
|
47
|
+
!compact && (details.length > 0 || action) && /* @__PURE__ */ jsxs("div", { className: s.details(), children: [
|
|
48
|
+
details.map((d, i) => /* @__PURE__ */ jsx("span", { children: d }, i)),
|
|
49
|
+
action
|
|
50
|
+
] })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
QUOTA_THRESHOLDS,
|
|
55
|
+
QuotaMeter,
|
|
56
|
+
quotaMeter
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=quota-meter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/quota-meter/quota-meter.tsx"],"sourcesContent":["// Server-safe. Space or time used against a plan: what is used in words, a Meter that turns amber then red, the sentence\n// that says what to do before the limit (and a status role once it matters), the small figures and the way out.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Meter } from \"../meter\";\n\nexport const quotaMeter = tv({\n slots: {\n root: \"flex flex-col gap-2 rounded-2xl border border-border-default bg-surface-1 p-5\",\n head: \"flex items-center justify-between gap-3\",\n title: \"flex items-center gap-2 font-mono text-xs text-fg-secondary\",\n icon: \"inline-flex shrink-0 [&>svg]:h-3.5 [&>svg]:w-3.5\",\n plan: \"text-xs text-fg-secondary\",\n used: \"font-mono text-lg font-black text-fg\",\n status: \"flex items-start gap-1.5 text-xs leading-relaxed\",\n details: \"flex flex-wrap items-center justify-between gap-2 text-xs text-fg-secondary\",\n },\n variants: {\n level: {\n ok: { status: \"text-fg-secondary\" },\n warning: { status: \"text-fg-warning\" },\n critical: { status: \"text-fg-danger\" },\n full: { status: \"text-fg-danger\" },\n },\n },\n defaultVariants: { level: \"ok\" },\n});\n\nexport type QuotaLevel = \"ok\" | \"warning\" | \"critical\" | \"full\";\n\n/** Where the meter turns amber and red, as shares of the limit. */\nexport const QUOTA_THRESHOLDS = { low: 0.8, high: 0.95 } as const;\n\nexport type QuotaMeterProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** What is measured (`Storage`), with an optional icon before it. */\n title: React.ReactNode;\n /** A glyph before the title (decorative). */\n icon?: React.ReactNode;\n /** The plan's name, on the right of the title. */\n plan?: React.ReactNode;\n /** Used so far, in the unit of `max`. */\n value: number;\n /** The limit; `null` for no limit (no meter is drawn). */\n max: number | null;\n /** « 3.2 GB of 10 GB », said once for the eye and once for the meter's value. */\n usedText: string;\n /** The meter's accessible name. */\n meterLabel: string;\n /** Where the level stands: tones the sentence and gives an alarming one a status role. */\n level?: QuotaLevel;\n /** The sentence for that level (« You are close to your limit »). */\n statusText?: React.ReactNode;\n /** More sentences that matter (« 2 uploads on hold », « uploads are paused »), each a status. */\n notices?: readonly React.ReactNode[];\n /** Small figures under the meter (minutes, today's uploads). Left out when the card is compact. */\n details?: readonly React.ReactNode[];\n /** The way out, shown under the figures (a link to manage). */\n action?: React.ReactNode;\n /** Leaves out the footer (the small figures and the action): the title, the used line, the meter, the sentence and the notices stay. */\n compact?: boolean;\n};\n\nexport function QuotaMeter({ title, icon, plan, value, max, usedText, meterLabel, level = \"ok\", statusText, notices = [], details = [], action, compact = false, className, ...props }: QuotaMeterProps) {\n const s = quotaMeter({ level });\n const alarming = level !== \"ok\";\n const titleId = React.useId();\n return (\n <section aria-labelledby={titleId} className={s.root({ className })} {...props}>\n <div className={s.head()}>\n <h3 id={titleId} className={s.title()}>\n {icon && (\n <span aria-hidden className={s.icon()}>\n {icon}\n </span>\n )}\n {title}\n </h3>\n {plan && <span className={s.plan()}>{plan}</span>}\n </div>\n <p className={s.used()}>{usedText}</p>\n {max !== null && <Meter size=\"sm\" value={Math.min(value, max)} max={max} label={meterLabel} valueText={usedText} thresholds={QUOTA_THRESHOLDS} />}\n {statusText && (\n <p className={s.status()} role={alarming ? \"status\" : undefined}>\n {statusText}\n </p>\n )}\n {notices.map((n, i) => (\n <p key={i} className={quotaMeter({ level: \"critical\" }).status()} role=\"status\">\n {n}\n </p>\n ))}\n {!compact && (details.length > 0 || action) && (\n <div className={s.details()}>\n {details.map((d, i) => (\n <span key={i}>{d}</span>\n ))}\n {action}\n </div>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU;AAmEX,SAEI,KAFJ;AA/DD,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,MACL,IAAI,EAAE,QAAQ,oBAAoB;AAAA,MAClC,SAAS,EAAE,QAAQ,kBAAkB;AAAA,MACrC,UAAU,EAAE,QAAQ,iBAAiB;AAAA,MACrC,MAAM,EAAE,QAAQ,iBAAiB;AAAA,IACnC;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,OAAO,KAAK;AACjC,CAAC;AAKM,IAAM,mBAAmB,EAAE,KAAK,KAAK,MAAM,KAAK;AA+BhD,SAAS,WAAW,EAAE,OAAO,MAAM,MAAM,OAAO,KAAK,UAAU,YAAY,QAAQ,MAAM,YAAY,UAAU,CAAC,GAAG,UAAU,CAAC,GAAG,QAAQ,UAAU,OAAO,WAAW,GAAG,MAAM,GAAoB;AACvM,QAAM,IAAI,WAAW,EAAE,MAAM,CAAC;AAC9B,QAAM,WAAW,UAAU;AAC3B,QAAM,UAAgB,YAAM;AAC5B,SACE,qBAAC,aAAQ,mBAAiB,SAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACvE;AAAA,yBAAC,SAAI,WAAW,EAAE,KAAK,GACrB;AAAA,2BAAC,QAAG,IAAI,SAAS,WAAW,EAAE,MAAM,GACjC;AAAA,gBACC,oBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,KAAK,GACjC,gBACH;AAAA,QAED;AAAA,SACH;AAAA,MACC,QAAQ,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,gBAAK;AAAA,OAC5C;AAAA,IACA,oBAAC,OAAE,WAAW,EAAE,KAAK,GAAI,oBAAS;AAAA,IACjC,QAAQ,QAAQ,oBAAC,SAAM,MAAK,MAAK,OAAO,KAAK,IAAI,OAAO,GAAG,GAAG,KAAU,OAAO,YAAY,WAAW,UAAU,YAAY,kBAAkB;AAAA,IAC9I,cACC,oBAAC,OAAE,WAAW,EAAE,OAAO,GAAG,MAAM,WAAW,WAAW,QACnD,sBACH;AAAA,IAED,QAAQ,IAAI,CAAC,GAAG,MACf,oBAAC,OAAU,WAAW,WAAW,EAAE,OAAO,WAAW,CAAC,EAAE,OAAO,GAAG,MAAK,UACpE,eADK,CAER,CACD;AAAA,IACA,CAAC,YAAY,QAAQ,SAAS,KAAK,WAClC,qBAAC,SAAI,WAAW,EAAE,QAAQ,GACvB;AAAA,cAAQ,IAAI,CAAC,GAAG,MACf,oBAAC,UAAc,eAAJ,CAAM,CAClB;AAAA,MACA;AAAA,OACH;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -112,4 +112,5 @@ declare const RadioGroup: {
|
|
|
112
112
|
Segment: typeof RadioGroupSegment;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
export { RadioGroup, RadioGroupButton,
|
|
115
|
+
export { RadioGroup, RadioGroupButton, RadioGroupCard, RadioGroupItem, RadioGroupRoot, RadioGroupSegment, radioGroup };
|
|
116
|
+
export type { RadioGroupButtonProps, RadioGroupItemProps, RadioGroupRootProps };
|
package/dist/radio-group.js
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
tv
|
|
4
|
+
} from "./chunk-HJFRHYCI.js";
|
|
5
5
|
import {
|
|
6
6
|
useSlidingIndicator
|
|
7
7
|
} from "./chunk-4QN5YJ3D.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
tv
|
|
13
|
-
} from "./chunk-HJFRHYCI.js";
|
|
9
|
+
CheckGlyph
|
|
10
|
+
} from "./chunk-5QEXOGO2.js";
|
|
14
11
|
import "./chunk-NSLXEDIS.js";
|
|
15
12
|
|
|
16
13
|
// src/radio-group/radio-group.tsx
|
|
17
14
|
import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
|
|
15
|
+
import { useRouteBinding } from "@krizaka/ui/router";
|
|
18
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
17
|
var radioGroup = tv({
|
|
20
18
|
slots: {
|
|
21
19
|
root: "grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap",
|
|
22
|
-
item: "peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-
|
|
20
|
+
item: "peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-control bg-surface-1 inset-shadow-well transition-colors focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger",
|
|
23
21
|
dot: "h-2 w-2 rounded-full bg-on-accent",
|
|
24
22
|
label: "flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70",
|
|
25
23
|
card: "group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow",
|
|
26
24
|
// The card's check: an empty ring at rest, the accent filled with its check once chosen.
|
|
27
|
-
cardCheck: "absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-
|
|
25
|
+
cardCheck: "absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-control bg-surface-1 text-on-accent transition-colors group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent",
|
|
28
26
|
// The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.
|
|
29
27
|
button: "relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none hover:border-border-strong active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]",
|
|
30
28
|
buttonHint: "text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent",
|
package/dist/radio-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/radio-group/radio-group.tsx"],"sourcesContent":["// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Four looks, one behaviour:\n// - `RadioGroup.Item`: a dot and its words (a settings list);\n// - `RadioGroup.Card`: a whole card is the radio — an amount, a pack, a plan — its check lit when chosen;\n// - `RadioGroup.Button`: a tactile key that presses in — raised on a ledge, sunk when chosen (a size, a tip, a level);\n// - `RadioGroup.Segment` in `<RadioGroup.Root variant=\"segmented\">`: a segmented control, one light gliding to the choice.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { CheckGlyph } from \"../glyphs\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { tv } from \"../tv\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-strong bg-surface-1 inset-shadow-well transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger\",\n dot: \"h-2 w-2 rounded-full bg-on-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70\",\n card:\n \"group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge \" +\n \"transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow\",\n // The card's check: an empty ring at rest, the accent filled with its check once chosen.\n cardCheck:\n \"absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-strong bg-surface-1 text-on-accent transition-colors \" +\n \"group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent\",\n // The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.\n button:\n \"relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 \" +\n \"text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] \" +\n \"transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none \" +\n \"hover:border-border-strong \" +\n \"active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade \" +\n \"data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]\",\n buttonHint: \"text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent\",\n segmented:\n \"relative isolate inline-grid auto-cols-fr grid-flow-col gap-1 rounded-xl border border-border-default bg-surface-2 p-1 inset-shadow-well \" +\n \"before:pointer-events-none before:absolute before:left-0 before:top-0 before:-z-10 before:h-(--kz-ind-h) before:w-(--kz-ind-w) \" +\n \"before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:border before:border-border-default before:bg-surface-0 before:bg-sheen \" +\n \"before:opacity-0 before:shadow-raised before:transition-[translate,width,height,opacity] before:duration-300 motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n segment:\n \"inline-flex min-h-9 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 text-sm font-semibold text-fg-secondary transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border data-[state=checked]:border-border-default data-[state=checked]:bg-surface-0 data-[state=checked]:text-fg data-[state=checked]:shadow-raised \" +\n \"group-data-[indicator=on]/seg:data-[state=checked]:border-transparent group-data-[indicator=on]/seg:data-[state=checked]:bg-transparent group-data-[indicator=on]/seg:data-[state=checked]:shadow-none\",\n },\n variants: {\n variant: {\n list: {},\n cards: { root: \"grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3\" },\n buttons: { root: \"flex flex-wrap gap-2.5 pb-1\" },\n segmented: {},\n },\n },\n defaultVariants: { variant: \"list\" },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n /**\n * The layout of the radios: `list` (dots), `cards` (a grid of `Card`s), `buttons` (a row of tactile `Button`s), or\n * `segmented` (a track of `Segment`s, one light gliding to the choice).\n * @default \"list\"\n */\n variant?: \"list\" | \"cards\" | \"buttons\" | \"segmented\";\n /** Binds the choice to this search parameter of the URL (`?kind=…`): the URL is the state — for a view's selection (a segmented switch), not a form field. */\n routeKey?: string;\n /** The values the parameter may hold (the radios' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */\nexport function RadioGroupRoot({ label, invalid, variant = \"list\", className, routeKey, routeValues, ...rest }: RadioGroupRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=radio]\", active: \"[role=radio][data-state=checked]\" });\n const segmented = variant === \"segmented\";\n return (\n <RadioGroupPrimitive.Root\n ref={segmented ? ref : undefined}\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-variant={variant}\n orientation={segmented ? \"horizontal\" : props.orientation}\n className={segmented ? s.segmented({ className: [\"group/seg\", className].filter(Boolean).join(\" \") }) : radioGroup({ variant }).root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: RadioGroupItemProps) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name; its check lights up when chosen. */\nexport function RadioGroupCard({ className, children, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item className={s.card({ className })} {...props}>\n {children}\n <span aria-hidden className={s.cardCheck()}>\n <RadioGroupPrimitive.Indicator forceMount className=\"inline-flex data-[state=unchecked]:hidden\">\n <CheckGlyph className=\"h-3 w-3\" />\n </RadioGroupPrimitive.Indicator>\n </span>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport type RadioGroupButtonProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n /** A second line under the words (\"+15 %\"), part of the radio's name. */\n hint?: React.ReactNode;\n};\n\n/** A tactile key: raised on its ledge, pressed in while held and once chosen — sizes, a tip, a level. */\nexport function RadioGroupButton({ className, children, hint, ...props }: RadioGroupButtonProps) {\n return (\n <RadioGroupPrimitive.Item className={s.button({ className: [\"group\", className].filter(Boolean).join(\" \") })} {...props}>\n <span>{children}</span>\n {hint ? <span className={s.buttonHint()}>{hint}</span> : null}\n </RadioGroupPrimitive.Item>\n );\n}\n\n/** A segment of a `variant=\"segmented\"` group: equal widths, one light gliding to the choice. */\nexport function RadioGroupSegment({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return <RadioGroupPrimitive.Item className={s.segment({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card/Button/Segment`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard, Button: RadioGroupButton, Segment: RadioGroupSegment };\n"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/radio-group/radio-group.tsx"],"sourcesContent":["// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Four looks, one behaviour:\n// - `RadioGroup.Item`: a dot and its words (a settings list);\n// - `RadioGroup.Card`: a whole card is the radio — an amount, a pack, a plan — its check lit when chosen;\n// - `RadioGroup.Button`: a tactile key that presses in — raised on a ledge, sunk when chosen (a size, a tip, a level);\n// - `RadioGroup.Segment` in `<RadioGroup.Root variant=\"segmented\">`: a segmented control, one light gliding to the choice.\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { CheckGlyph } from \"../glyphs\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { tv } from \"../tv\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-control bg-surface-1 inset-shadow-well transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:shadow-glow aria-invalid:border-danger\",\n dot: \"h-2 w-2 rounded-full bg-on-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-70\",\n card:\n \"group relative flex min-w-0 flex-col items-start gap-1 rounded-2xl border border-border-default bg-surface-1 bg-sheen p-4 pr-10 text-left text-sm text-fg inset-shadow-edge \" +\n \"transition-[border-color,background-color,box-shadow,transform] duration-200 hover:border-border-strong active:scale-[0.99] motion-reduce:transition-none motion-reduce:active:scale-100 \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft data-[state=checked]:shadow-glow\",\n // The card's check: an empty ring at rest, the accent filled with its check once chosen.\n cardCheck:\n \"absolute right-3.5 top-3.5 inline-flex h-5 w-5 items-center justify-center rounded-full border border-border-control bg-surface-1 text-on-accent transition-colors \" +\n \"group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent\",\n // The tactile key: on a ledge (its lower edge), its hairline stronger on hover, pressed in while held and once chosen.\n button:\n \"relative inline-flex min-h-12 min-w-12 select-none flex-col items-center justify-center gap-0.5 rounded-xl border border-border-default bg-surface-2 bg-sheen px-4 py-2 \" +\n \"text-sm font-semibold text-fg inset-shadow-edge shadow-[0_4px_0_0_var(--kz-border-strong)] \" +\n \"transition-[transform,box-shadow,background-color,border-color,color] duration-100 ease-out motion-reduce:transition-none \" +\n \"hover:border-border-strong \" +\n \"active:translate-y-[3px] active:shadow-[0_1px_0_0_var(--kz-border-strong)] \" +\n \"focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-danger \" +\n \"data-[state=checked]:translate-y-[3px] data-[state=checked]:border-accent data-[state=checked]:bg-accent data-[state=checked]:bg-fill-shade \" +\n \"data-[state=checked]:text-on-accent data-[state=checked]:inset-shadow-edge-fill data-[state=checked]:shadow-[0_1px_0_0_var(--kz-accent-hover)]\",\n buttonHint: \"text-[11px] font-medium text-fg-secondary group-data-[state=checked]:text-on-accent\",\n segmented:\n \"relative isolate inline-grid auto-cols-fr grid-flow-col gap-1 rounded-xl border border-border-default bg-surface-2 p-1 inset-shadow-well \" +\n \"before:pointer-events-none before:absolute before:left-0 before:top-0 before:-z-10 before:h-(--kz-ind-h) before:w-(--kz-ind-w) \" +\n \"before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:border before:border-border-default before:bg-surface-0 before:bg-sheen \" +\n \"before:opacity-0 before:shadow-raised before:transition-[translate,width,height,opacity] before:duration-300 motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n segment:\n \"inline-flex min-h-9 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3.5 text-sm font-semibold text-fg-secondary transition-colors \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring disabled:cursor-not-allowed disabled:opacity-40 \" +\n \"data-[state=checked]:border data-[state=checked]:border-border-default data-[state=checked]:bg-surface-0 data-[state=checked]:text-fg data-[state=checked]:shadow-raised \" +\n \"group-data-[indicator=on]/seg:data-[state=checked]:border-transparent group-data-[indicator=on]/seg:data-[state=checked]:bg-transparent group-data-[indicator=on]/seg:data-[state=checked]:shadow-none\",\n },\n variants: {\n variant: {\n list: {},\n cards: { root: \"grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3\" },\n buttons: { root: \"flex flex-wrap gap-2.5 pb-1\" },\n segmented: {},\n },\n },\n defaultVariants: { variant: \"list\" },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n /**\n * The layout of the radios: `list` (dots), `cards` (a grid of `Card`s), `buttons` (a row of tactile `Button`s), or\n * `segmented` (a track of `Segment`s, one light gliding to the choice).\n * @default \"list\"\n */\n variant?: \"list\" | \"cards\" | \"buttons\" | \"segmented\";\n /** Binds the choice to this search parameter of the URL (`?kind=…`): the URL is the state — for a view's selection (a segmented switch), not a form field. */\n routeKey?: string;\n /** The values the parameter may hold (the radios' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form, `variant` for the layout. */\nexport function RadioGroupRoot({ label, invalid, variant = \"list\", className, routeKey, routeValues, ...rest }: RadioGroupRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=radio]\", active: \"[role=radio][data-state=checked]\" });\n const segmented = variant === \"segmented\";\n return (\n <RadioGroupPrimitive.Root\n ref={segmented ? ref : undefined}\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-variant={variant}\n orientation={segmented ? \"horizontal\" : props.orientation}\n className={segmented ? s.segmented({ className: [\"group/seg\", className].filter(Boolean).join(\" \") }) : radioGroup({ variant }).root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: RadioGroupItemProps) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name; its check lights up when chosen. */\nexport function RadioGroupCard({ className, children, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item className={s.card({ className })} {...props}>\n {children}\n <span aria-hidden className={s.cardCheck()}>\n <RadioGroupPrimitive.Indicator forceMount className=\"inline-flex data-[state=unchecked]:hidden\">\n <CheckGlyph className=\"h-3 w-3\" />\n </RadioGroupPrimitive.Indicator>\n </span>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport type RadioGroupButtonProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n /** A second line under the words (\"+15 %\"), part of the radio's name. */\n hint?: React.ReactNode;\n};\n\n/** A tactile key: raised on its ledge, pressed in while held and once chosen — sizes, a tip, a level. */\nexport function RadioGroupButton({ className, children, hint, ...props }: RadioGroupButtonProps) {\n return (\n <RadioGroupPrimitive.Item className={s.button({ className: [\"group\", className].filter(Boolean).join(\" \") })} {...props}>\n <span>{children}</span>\n {hint ? <span className={s.buttonHint()}>{hint}</span> : null}\n </RadioGroupPrimitive.Item>\n );\n}\n\n/** A segment of a `variant=\"segmented\"` group: equal widths, one light gliding to the choice. */\nexport function RadioGroupSegment({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return <RadioGroupPrimitive.Item className={s.segment({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card/Button/Segment`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard, Button: RadioGroupButton, Segment: RadioGroupSegment };\n"],"mappings":"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","names":[]}
|
package/dist/rail-nav.d.ts
CHANGED
|
@@ -6,35 +6,39 @@ type BrandId = "krizaka" | "orazaka" | "orochia" | "yasakia" | "yororis" | "yomi
|
|
|
6
6
|
declare const railNav: tailwind_variants.TVReturnType<{
|
|
7
7
|
[key: string]: {
|
|
8
8
|
[key: string]: tailwind_variants.ClassValue | {
|
|
9
|
-
|
|
10
|
-
label?: tailwind_variants.ClassValue;
|
|
11
|
-
main?: tailwind_variants.ClassValue;
|
|
9
|
+
shell?: tailwind_variants.ClassValue;
|
|
12
10
|
mark?: tailwind_variants.ClassValue;
|
|
13
11
|
group?: tailwind_variants.ClassValue;
|
|
14
|
-
|
|
15
|
-
shell?: tailwind_variants.ClassValue;
|
|
12
|
+
main?: tailwind_variants.ClassValue;
|
|
16
13
|
foot?: tailwind_variants.ClassValue;
|
|
14
|
+
shortcuts?: tailwind_variants.ClassValue;
|
|
15
|
+
shortcutsHeading?: tailwind_variants.ClassValue;
|
|
17
16
|
icon?: tailwind_variants.ClassValue;
|
|
17
|
+
label?: tailwind_variants.ClassValue;
|
|
18
18
|
badge?: tailwind_variants.ClassValue;
|
|
19
|
+
body?: tailwind_variants.ClassValue;
|
|
19
20
|
root?: tailwind_variants.ClassValue;
|
|
20
21
|
item?: tailwind_variants.ClassValue;
|
|
22
|
+
toggle?: tailwind_variants.ClassValue;
|
|
21
23
|
};
|
|
22
24
|
};
|
|
23
25
|
} | {
|
|
24
26
|
[x: string]: {
|
|
25
27
|
[x: string]: tailwind_variants.ClassValue | {
|
|
26
|
-
|
|
27
|
-
label?: tailwind_variants.ClassValue;
|
|
28
|
-
main?: tailwind_variants.ClassValue;
|
|
28
|
+
shell?: tailwind_variants.ClassValue;
|
|
29
29
|
mark?: tailwind_variants.ClassValue;
|
|
30
30
|
group?: tailwind_variants.ClassValue;
|
|
31
|
-
|
|
32
|
-
shell?: tailwind_variants.ClassValue;
|
|
31
|
+
main?: tailwind_variants.ClassValue;
|
|
33
32
|
foot?: tailwind_variants.ClassValue;
|
|
33
|
+
shortcuts?: tailwind_variants.ClassValue;
|
|
34
|
+
shortcutsHeading?: tailwind_variants.ClassValue;
|
|
34
35
|
icon?: tailwind_variants.ClassValue;
|
|
36
|
+
label?: tailwind_variants.ClassValue;
|
|
35
37
|
badge?: tailwind_variants.ClassValue;
|
|
38
|
+
body?: tailwind_variants.ClassValue;
|
|
36
39
|
root?: tailwind_variants.ClassValue;
|
|
37
40
|
item?: tailwind_variants.ClassValue;
|
|
41
|
+
toggle?: tailwind_variants.ClassValue;
|
|
38
42
|
};
|
|
39
43
|
};
|
|
40
44
|
} | {}, {
|
|
@@ -44,6 +48,8 @@ declare const railNav: tailwind_variants.TVReturnType<{
|
|
|
44
48
|
group: string;
|
|
45
49
|
main: string;
|
|
46
50
|
foot: string;
|
|
51
|
+
shortcuts: string;
|
|
52
|
+
shortcutsHeading: string;
|
|
47
53
|
item: string;
|
|
48
54
|
icon: string;
|
|
49
55
|
label: string;
|
|
@@ -53,18 +59,20 @@ declare const railNav: tailwind_variants.TVReturnType<{
|
|
|
53
59
|
}, undefined, {
|
|
54
60
|
[key: string]: {
|
|
55
61
|
[key: string]: tailwind_variants.ClassValue | {
|
|
56
|
-
|
|
57
|
-
label?: tailwind_variants.ClassValue;
|
|
58
|
-
main?: tailwind_variants.ClassValue;
|
|
62
|
+
shell?: tailwind_variants.ClassValue;
|
|
59
63
|
mark?: tailwind_variants.ClassValue;
|
|
60
64
|
group?: tailwind_variants.ClassValue;
|
|
61
|
-
|
|
62
|
-
shell?: tailwind_variants.ClassValue;
|
|
65
|
+
main?: tailwind_variants.ClassValue;
|
|
63
66
|
foot?: tailwind_variants.ClassValue;
|
|
67
|
+
shortcuts?: tailwind_variants.ClassValue;
|
|
68
|
+
shortcutsHeading?: tailwind_variants.ClassValue;
|
|
64
69
|
icon?: tailwind_variants.ClassValue;
|
|
70
|
+
label?: tailwind_variants.ClassValue;
|
|
65
71
|
badge?: tailwind_variants.ClassValue;
|
|
72
|
+
body?: tailwind_variants.ClassValue;
|
|
66
73
|
root?: tailwind_variants.ClassValue;
|
|
67
74
|
item?: tailwind_variants.ClassValue;
|
|
75
|
+
toggle?: tailwind_variants.ClassValue;
|
|
68
76
|
};
|
|
69
77
|
};
|
|
70
78
|
} | {}, {
|
|
@@ -74,6 +82,8 @@ declare const railNav: tailwind_variants.TVReturnType<{
|
|
|
74
82
|
group: string;
|
|
75
83
|
main: string;
|
|
76
84
|
foot: string;
|
|
85
|
+
shortcuts: string;
|
|
86
|
+
shortcutsHeading: string;
|
|
77
87
|
item: string;
|
|
78
88
|
icon: string;
|
|
79
89
|
label: string;
|
|
@@ -87,6 +97,8 @@ declare const railNav: tailwind_variants.TVReturnType<{
|
|
|
87
97
|
group: string;
|
|
88
98
|
main: string;
|
|
89
99
|
foot: string;
|
|
100
|
+
shortcuts: string;
|
|
101
|
+
shortcutsHeading: string;
|
|
90
102
|
item: string;
|
|
91
103
|
icon: string;
|
|
92
104
|
label: string;
|
|
@@ -109,11 +121,15 @@ type RailNavRootProps = Omit<React.ComponentProps<"nav">, "children"> & {
|
|
|
109
121
|
children: React.ReactNode;
|
|
110
122
|
/** At the foot of the rail (settings, account), after the main items; on a phone they follow them in the same bar. `RailNav.Item`s or a control with `data-rail-item`. */
|
|
111
123
|
footer?: React.ReactNode;
|
|
124
|
+
/** The product's shortcuts (`RailNav.Item`s: a saved view, a client, « New invoice »), a group above the footer and the expand toggle. Desktop only: a phone's tab bar keeps its destinations. */
|
|
125
|
+
shortcuts?: React.ReactNode;
|
|
126
|
+
/** The shortcuts' heading (« Raccourcis », « Shortcuts ») — passed translated: the group's name, shown once the rail is expanded. */
|
|
127
|
+
shortcutsLabel?: string;
|
|
112
128
|
/** Adds a button that widens the rail to show the words (desktop only). Needs `expandLabels`. */
|
|
113
129
|
expandable?: boolean;
|
|
114
130
|
/** Controlled width (pair with `onExpandedChange` to keep the choice). */
|
|
115
131
|
expanded?: boolean;
|
|
116
|
-
/** The starting width when uncontrolled. */
|
|
132
|
+
/** The starting width when uncontrolled. Unset: expanded from 1280 px (the words fit there), narrow below — until the person toggles it. */
|
|
117
133
|
defaultExpanded?: boolean;
|
|
118
134
|
/** Called when the toggle widens or narrows the rail. */
|
|
119
135
|
onExpandedChange?: (expanded: boolean) => void;
|
|
@@ -121,7 +137,7 @@ type RailNavRootProps = Omit<React.ComponentProps<"nav">, "children"> & {
|
|
|
121
137
|
expandLabels?: readonly [string, string];
|
|
122
138
|
};
|
|
123
139
|
/** The rail: a vertical column of icons on a desktop, a bottom tab bar on a phone. */
|
|
124
|
-
declare function RailNavRoot({ label, mark, accent, children, footer, expandable, expanded: controlled, defaultExpanded, onExpandedChange, expandLabels, className, onKeyDown, ...props }: RailNavRootProps): React.JSX.Element;
|
|
140
|
+
declare function RailNavRoot({ label, mark, accent, children, footer, shortcuts, shortcutsLabel, expandable, expanded: controlled, defaultExpanded, onExpandedChange, expandLabels, className, onKeyDown, ...props }: RailNavRootProps): React.JSX.Element;
|
|
125
141
|
type RailNavItemProps = Omit<React.ComponentProps<"a">, "children"> & {
|
|
126
142
|
/** The item's icon (a signature icon of `@krizaka/icons`): all that shows on a desktop rail. */
|
|
127
143
|
icon: React.ReactNode;
|
|
@@ -146,4 +162,5 @@ declare const RailNav: {
|
|
|
146
162
|
Body: typeof RailNavBody;
|
|
147
163
|
};
|
|
148
164
|
|
|
149
|
-
export { RailNav, RailNavBody, RailNavItem,
|
|
165
|
+
export { RailNav, RailNavBody, RailNavItem, RailNavRoot, RailNavShell, railNav };
|
|
166
|
+
export type { RailNavItemProps, RailNavRootProps };
|
package/dist/rail-nav.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Tooltip
|
|
4
|
+
} from "./chunk-27AWSJTK.js";
|
|
2
5
|
import {
|
|
3
6
|
ChevronGlyph
|
|
4
7
|
} from "./chunk-P7GZR5CU.js";
|
|
@@ -6,48 +9,11 @@ import {
|
|
|
6
9
|
cn
|
|
7
10
|
} from "./chunk-WU4VLSEA.js";
|
|
8
11
|
|
|
9
|
-
// src/tooltip/tooltip.tsx
|
|
10
|
-
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
11
|
-
|
|
12
|
-
// src/floating.ts
|
|
13
|
-
var floating = "kz-pop z-50 rounded-lg border border-border-default bg-surface-2 text-fg shadow-lg outline-hidden";
|
|
14
|
-
|
|
15
|
-
// src/tooltip/tooltip.tsx
|
|
16
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
18
|
-
function Tooltip({
|
|
19
|
-
content,
|
|
20
|
-
children,
|
|
21
|
-
open,
|
|
22
|
-
defaultOpen,
|
|
23
|
-
onOpenChange,
|
|
24
|
-
delayDuration = 300,
|
|
25
|
-
container,
|
|
26
|
-
sideOffset = 6,
|
|
27
|
-
collisionPadding = 8,
|
|
28
|
-
className,
|
|
29
|
-
...props
|
|
30
|
-
}) {
|
|
31
|
-
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { open, defaultOpen, onOpenChange, children: [
|
|
32
|
-
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
33
|
-
/* @__PURE__ */ jsx(TooltipPrimitive.Portal, { container, children: /* @__PURE__ */ jsx(
|
|
34
|
-
TooltipPrimitive.Content,
|
|
35
|
-
{
|
|
36
|
-
sideOffset,
|
|
37
|
-
collisionPadding,
|
|
38
|
-
className: cn(floating, "max-w-xs px-2.5 py-1.5 text-xs font-medium origin-(--radix-tooltip-content-transform-origin)", className),
|
|
39
|
-
...props,
|
|
40
|
-
children: content
|
|
41
|
-
}
|
|
42
|
-
) })
|
|
43
|
-
] }) });
|
|
44
|
-
}
|
|
45
|
-
|
|
46
12
|
// src/rail-nav/rail-nav.tsx
|
|
47
13
|
import { Slot } from "radix-ui";
|
|
48
14
|
import * as React from "react";
|
|
49
15
|
import { tv } from "tailwind-variants";
|
|
50
|
-
import { Fragment, jsx
|
|
16
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
51
17
|
var railNav = tv({
|
|
52
18
|
slots: {
|
|
53
19
|
shell: "flex min-h-dvh w-full bg-surface-0 text-fg",
|
|
@@ -60,6 +26,10 @@ var railNav = tv({
|
|
|
60
26
|
group: "flex min-w-0 flex-row items-stretch md:flex-col md:items-center md:gap-1 md:px-1.5 md:group-data-expanded/rail:items-stretch",
|
|
61
27
|
main: "max-md:grow-(--rail-n) md:flex-1 md:py-2",
|
|
62
28
|
foot: "max-md:grow-(--rail-n) md:border-t md:border-border-subtle md:py-2",
|
|
29
|
+
// The shortcuts: the product's quick ways in (a saved view, a client, « new invoice »), desktop only — a phone's tab bar
|
|
30
|
+
// keeps its five destinations. Their heading shows once the rail is expanded; collapsed, it names the group.
|
|
31
|
+
shortcuts: "hidden md:flex md:border-t md:border-border-subtle md:py-2",
|
|
32
|
+
shortcutsHeading: "sr-only md:group-data-expanded/rail:not-sr-only md:group-data-expanded/rail:px-3.5 md:group-data-expanded/rail:pb-1 md:group-data-expanded/rail:pt-1 text-[11px] font-semibold text-fg-secondary",
|
|
63
33
|
item: "group/item relative flex min-w-0 flex-1 flex-col items-center justify-center gap-0.5 px-1 text-[11px] font-medium text-fg-secondary no-underline transition-colors hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:focus-ring-inset aria-[current=page]:bg-accent-soft aria-[current=page]:text-fg-accent before:absolute before:inset-x-3 before:top-0 before:h-[3px] before:rounded-b-full before:bg-accent before:opacity-0 before:transition-opacity aria-[current=page]:before:opacity-100 md:h-10 md:w-full md:flex-none md:flex-row md:justify-center md:gap-3 md:rounded-none md:px-0 md:text-sm md:before:inset-x-auto md:before:inset-y-2 md:before:left-0 md:before:top-2 md:before:h-auto md:before:w-[3px] md:before:rounded-r-full md:before:rounded-b-none md:group-data-expanded/rail:justify-start md:group-data-expanded/rail:px-3.5 [&>svg]:h-5 [&>svg]:w-5 [&>svg]:shrink-0",
|
|
64
34
|
icon: "relative inline-flex shrink-0 items-center justify-center [&>svg]:h-5 [&>svg]:w-5",
|
|
65
35
|
label: "max-w-full truncate leading-none md:sr-only md:text-sm md:leading-normal md:group-data-expanded/rail:not-sr-only",
|
|
@@ -76,12 +46,23 @@ var useRail = () => {
|
|
|
76
46
|
return ctx;
|
|
77
47
|
};
|
|
78
48
|
function RailNavShell({ className, ...props }) {
|
|
79
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ jsx("div", { className: s.shell({ className }), ...props });
|
|
80
50
|
}
|
|
81
51
|
function RailNavBody({ className, ...props }) {
|
|
82
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ jsx("div", { className: s.body({ className }), ...props });
|
|
83
53
|
}
|
|
84
54
|
var count = (node) => React.Children.toArray(node).length;
|
|
55
|
+
var WIDE = "(min-width: 80rem)";
|
|
56
|
+
var subscribeWide = (onChange) => {
|
|
57
|
+
if (typeof window === "undefined" || !window.matchMedia) return () => void 0;
|
|
58
|
+
const query = window.matchMedia(WIDE);
|
|
59
|
+
query.addEventListener("change", onChange);
|
|
60
|
+
return () => query.removeEventListener("change", onChange);
|
|
61
|
+
};
|
|
62
|
+
var isWide = () => typeof window !== "undefined" && Boolean(window.matchMedia?.(WIDE).matches);
|
|
63
|
+
function useWide() {
|
|
64
|
+
return React.useSyncExternalStore(subscribeWide, isWide, () => false);
|
|
65
|
+
}
|
|
85
66
|
function moveFocus(event) {
|
|
86
67
|
const keys = { ArrowDown: 1, ArrowRight: 1, ArrowUp: -1, ArrowLeft: -1 };
|
|
87
68
|
const step = keys[event.key];
|
|
@@ -103,9 +84,11 @@ function RailNavRoot({
|
|
|
103
84
|
accent,
|
|
104
85
|
children,
|
|
105
86
|
footer,
|
|
87
|
+
shortcuts,
|
|
88
|
+
shortcutsLabel,
|
|
106
89
|
expandable,
|
|
107
90
|
expanded: controlled,
|
|
108
|
-
defaultExpanded
|
|
91
|
+
defaultExpanded,
|
|
109
92
|
onExpandedChange,
|
|
110
93
|
expandLabels,
|
|
111
94
|
className,
|
|
@@ -113,13 +96,15 @@ function RailNavRoot({
|
|
|
113
96
|
...props
|
|
114
97
|
}) {
|
|
115
98
|
const [own, setOwn] = React.useState(defaultExpanded);
|
|
116
|
-
const
|
|
99
|
+
const wide = useWide();
|
|
100
|
+
const headingId = React.useId();
|
|
101
|
+
const expanded = expandable ? controlled ?? own ?? wide : false;
|
|
117
102
|
const toggle = () => {
|
|
118
103
|
if (controlled === void 0) setOwn(!expanded);
|
|
119
104
|
onExpandedChange?.(!expanded);
|
|
120
105
|
};
|
|
121
106
|
const value = React.useMemo(() => ({ expanded }), [expanded]);
|
|
122
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ jsx(RailContext.Provider, { value, children: /* @__PURE__ */ jsxs(
|
|
123
108
|
"nav",
|
|
124
109
|
{
|
|
125
110
|
"aria-label": label,
|
|
@@ -131,13 +116,17 @@ function RailNavRoot({
|
|
|
131
116
|
},
|
|
132
117
|
...props,
|
|
133
118
|
children: [
|
|
134
|
-
mark && /* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
119
|
+
mark && /* @__PURE__ */ jsx("div", { "data-brand-mark": true, className: s.mark(), children: mark }),
|
|
120
|
+
/* @__PURE__ */ jsx("div", { className: s.group({ className: s.main() }), style: { ["--rail-n"]: Math.max(count(children), 1) }, children }),
|
|
121
|
+
shortcuts && /* @__PURE__ */ jsxs("div", { role: "group", "aria-labelledby": shortcutsLabel ? headingId : void 0, "data-rail-shortcuts": "", className: s.group({ className: s.shortcuts() }), children: [
|
|
122
|
+
shortcutsLabel && /* @__PURE__ */ jsx("p", { id: headingId, className: s.shortcutsHeading(), children: shortcutsLabel }),
|
|
123
|
+
shortcuts
|
|
124
|
+
] }),
|
|
125
|
+
(footer || expandable) && /* @__PURE__ */ jsxs("div", { className: s.group({ className: s.foot() }), style: { ["--rail-n"]: Math.max(count(footer), 1) }, children: [
|
|
137
126
|
footer,
|
|
138
|
-
expandable && expandLabels && /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
127
|
+
expandable && expandLabels && /* @__PURE__ */ jsxs("button", { type: "button", "data-rail-item": true, className: s.toggle(), "aria-expanded": expanded, onClick: toggle, children: [
|
|
128
|
+
/* @__PURE__ */ jsx(ChevronGlyph, { direction: expanded ? "left" : "right", className: "h-4 w-4 shrink-0" }),
|
|
129
|
+
/* @__PURE__ */ jsx("span", { className: expanded ? void 0 : "sr-only", children: expanded ? expandLabels[1] : expandLabels[0] })
|
|
141
130
|
] })
|
|
142
131
|
] })
|
|
143
132
|
]
|
|
@@ -147,18 +136,18 @@ function RailNavRoot({
|
|
|
147
136
|
function RailNavItem({ icon, label, current, badge, badgeLabel, asChild, children, className, ...props }) {
|
|
148
137
|
const { expanded } = useRail();
|
|
149
138
|
const Comp = asChild ? Slot.Root : "a";
|
|
150
|
-
const inner = /* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
139
|
+
const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
140
|
+
/* @__PURE__ */ jsxs("span", { className: s.icon(), children: [
|
|
152
141
|
icon,
|
|
153
142
|
badge != null && (typeof badge === "string" || typeof badge === "number") ? (
|
|
154
143
|
// Drawn by CSS, so the count is no text of the link: the visible text stays the label, which the name `Chat, 2 unread` contains.
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
) : badge != null && /* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ jsx("span", { className: s.badge(), "data-count": badge, "aria-hidden": true })
|
|
145
|
+
) : badge != null && /* @__PURE__ */ jsx("span", { className: s.badge(), "aria-hidden": true, children: badge })
|
|
157
146
|
] }),
|
|
158
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ jsx("span", { className: s.label(), children: label })
|
|
159
148
|
] });
|
|
160
|
-
const link = /* @__PURE__ */
|
|
161
|
-
return expanded ? link : /* @__PURE__ */
|
|
149
|
+
const link = /* @__PURE__ */ jsx(Comp, { "data-rail-item": true, "aria-label": badgeLabel ? `${label}, ${badgeLabel}` : label, "aria-current": current ? "page" : void 0, className: s.item({ className }), ...props, children: asChild && children ? React.cloneElement(children, void 0, inner) : inner });
|
|
150
|
+
return expanded ? link : /* @__PURE__ */ jsx(Tooltip, { content: label, side: "right", children: link });
|
|
162
151
|
}
|
|
163
152
|
var RailNav = {
|
|
164
153
|
Shell: RailNavShell,
|