@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
package/dist/slot-picker.d.ts
CHANGED
|
@@ -5,29 +5,43 @@ import { L as LinkComponent } from './block-link-BAg4eoZk.js';
|
|
|
5
5
|
declare const slotPicker: tailwind_variants.TVReturnType<{
|
|
6
6
|
[key: string]: {
|
|
7
7
|
[key: string]: tailwind_variants.ClassValue | {
|
|
8
|
-
time?: tailwind_variants.ClassValue;
|
|
9
|
-
note?: tailwind_variants.ClassValue;
|
|
10
8
|
root?: tailwind_variants.ClassValue;
|
|
11
9
|
days?: tailwind_variants.ClassValue;
|
|
12
10
|
dayName?: tailwind_variants.ClassValue;
|
|
13
11
|
daySub?: tailwind_variants.ClassValue;
|
|
14
12
|
times?: tailwind_variants.ClassValue;
|
|
13
|
+
note?: tailwind_variants.ClassValue;
|
|
14
|
+
weekBar?: tailwind_variants.ClassValue;
|
|
15
|
+
weekLabel?: tailwind_variants.ClassValue;
|
|
16
|
+
weekNav?: tailwind_variants.ClassValue;
|
|
17
|
+
groups?: tailwind_variants.ClassValue;
|
|
18
|
+
groupLabel?: tailwind_variants.ClassValue;
|
|
19
|
+
footer?: tailwind_variants.ClassValue;
|
|
15
20
|
empty?: tailwind_variants.ClassValue;
|
|
16
21
|
day?: tailwind_variants.ClassValue;
|
|
22
|
+
time?: tailwind_variants.ClassValue;
|
|
23
|
+
weekBtn?: tailwind_variants.ClassValue;
|
|
17
24
|
};
|
|
18
25
|
};
|
|
19
26
|
} | {
|
|
20
27
|
[x: string]: {
|
|
21
28
|
[x: string]: tailwind_variants.ClassValue | {
|
|
22
|
-
time?: tailwind_variants.ClassValue;
|
|
23
|
-
note?: tailwind_variants.ClassValue;
|
|
24
29
|
root?: tailwind_variants.ClassValue;
|
|
25
30
|
days?: tailwind_variants.ClassValue;
|
|
26
31
|
dayName?: tailwind_variants.ClassValue;
|
|
27
32
|
daySub?: tailwind_variants.ClassValue;
|
|
28
33
|
times?: tailwind_variants.ClassValue;
|
|
34
|
+
note?: tailwind_variants.ClassValue;
|
|
35
|
+
weekBar?: tailwind_variants.ClassValue;
|
|
36
|
+
weekLabel?: tailwind_variants.ClassValue;
|
|
37
|
+
weekNav?: tailwind_variants.ClassValue;
|
|
38
|
+
groups?: tailwind_variants.ClassValue;
|
|
39
|
+
groupLabel?: tailwind_variants.ClassValue;
|
|
40
|
+
footer?: tailwind_variants.ClassValue;
|
|
29
41
|
empty?: tailwind_variants.ClassValue;
|
|
30
42
|
day?: tailwind_variants.ClassValue;
|
|
43
|
+
time?: tailwind_variants.ClassValue;
|
|
44
|
+
weekBtn?: tailwind_variants.ClassValue;
|
|
31
45
|
};
|
|
32
46
|
};
|
|
33
47
|
} | {}, {
|
|
@@ -39,19 +53,33 @@ declare const slotPicker: tailwind_variants.TVReturnType<{
|
|
|
39
53
|
times: string;
|
|
40
54
|
time: string;
|
|
41
55
|
note: string;
|
|
56
|
+
weekBar: string;
|
|
57
|
+
weekLabel: string;
|
|
58
|
+
weekNav: string;
|
|
59
|
+
weekBtn: string;
|
|
60
|
+
groups: string;
|
|
61
|
+
groupLabel: string;
|
|
62
|
+
footer: string;
|
|
42
63
|
empty: string;
|
|
43
64
|
}, undefined, {
|
|
44
65
|
[key: string]: {
|
|
45
66
|
[key: string]: tailwind_variants.ClassValue | {
|
|
46
|
-
time?: tailwind_variants.ClassValue;
|
|
47
|
-
note?: tailwind_variants.ClassValue;
|
|
48
67
|
root?: tailwind_variants.ClassValue;
|
|
49
68
|
days?: tailwind_variants.ClassValue;
|
|
50
69
|
dayName?: tailwind_variants.ClassValue;
|
|
51
70
|
daySub?: tailwind_variants.ClassValue;
|
|
52
71
|
times?: tailwind_variants.ClassValue;
|
|
72
|
+
note?: tailwind_variants.ClassValue;
|
|
73
|
+
weekBar?: tailwind_variants.ClassValue;
|
|
74
|
+
weekLabel?: tailwind_variants.ClassValue;
|
|
75
|
+
weekNav?: tailwind_variants.ClassValue;
|
|
76
|
+
groups?: tailwind_variants.ClassValue;
|
|
77
|
+
groupLabel?: tailwind_variants.ClassValue;
|
|
78
|
+
footer?: tailwind_variants.ClassValue;
|
|
53
79
|
empty?: tailwind_variants.ClassValue;
|
|
54
80
|
day?: tailwind_variants.ClassValue;
|
|
81
|
+
time?: tailwind_variants.ClassValue;
|
|
82
|
+
weekBtn?: tailwind_variants.ClassValue;
|
|
55
83
|
};
|
|
56
84
|
};
|
|
57
85
|
} | {}, {
|
|
@@ -63,6 +91,13 @@ declare const slotPicker: tailwind_variants.TVReturnType<{
|
|
|
63
91
|
times: string;
|
|
64
92
|
time: string;
|
|
65
93
|
note: string;
|
|
94
|
+
weekBar: string;
|
|
95
|
+
weekLabel: string;
|
|
96
|
+
weekNav: string;
|
|
97
|
+
weekBtn: string;
|
|
98
|
+
groups: string;
|
|
99
|
+
groupLabel: string;
|
|
100
|
+
footer: string;
|
|
66
101
|
empty: string;
|
|
67
102
|
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
68
103
|
root: string;
|
|
@@ -73,6 +108,13 @@ declare const slotPicker: tailwind_variants.TVReturnType<{
|
|
|
73
108
|
times: string;
|
|
74
109
|
time: string;
|
|
75
110
|
note: string;
|
|
111
|
+
weekBar: string;
|
|
112
|
+
weekLabel: string;
|
|
113
|
+
weekNav: string;
|
|
114
|
+
weekBtn: string;
|
|
115
|
+
groups: string;
|
|
116
|
+
groupLabel: string;
|
|
117
|
+
footer: string;
|
|
76
118
|
empty: string;
|
|
77
119
|
}>>;
|
|
78
120
|
type PickerSlot = {
|
|
@@ -82,11 +124,17 @@ type PickerSlot = {
|
|
|
82
124
|
label: string;
|
|
83
125
|
/** What to know about it (`2 places left`), shown beside the time and read with it. */
|
|
84
126
|
note?: string;
|
|
85
|
-
/** Not offered any more: shown,
|
|
127
|
+
/** Not offered any more (full): shown struck out and disabled, its `note` (`Full`) read with the time — never colour alone. */
|
|
86
128
|
disabled?: boolean;
|
|
87
129
|
/** Makes the time a link to this address (the booking page with the slot chosen). */
|
|
88
130
|
href?: string;
|
|
89
131
|
};
|
|
132
|
+
/** A part of a day (`Morning`, `Afternoon`): the label comes from the host's messages. */
|
|
133
|
+
type PickerGroup = {
|
|
134
|
+
id: string;
|
|
135
|
+
label: string;
|
|
136
|
+
slots: readonly PickerSlot[];
|
|
137
|
+
};
|
|
90
138
|
type PickerDay = {
|
|
91
139
|
/** A stable id (`2026-10-19`). */
|
|
92
140
|
id: string;
|
|
@@ -94,8 +142,10 @@ type PickerDay = {
|
|
|
94
142
|
label: string;
|
|
95
143
|
/** Under it (`19 Oct`). */
|
|
96
144
|
sub?: string;
|
|
97
|
-
/** Its
|
|
98
|
-
slots
|
|
145
|
+
/** Its times, in order — flat… */
|
|
146
|
+
slots?: readonly PickerSlot[];
|
|
147
|
+
/** …or in parts of the day (`Morning`, `Afternoon`), each under its own label. Wins over `slots`. */
|
|
148
|
+
groups?: readonly PickerGroup[];
|
|
99
149
|
};
|
|
100
150
|
type SlotPickerProps = Omit<React.ComponentProps<"div">, "onChange" | "defaultValue"> & {
|
|
101
151
|
/** The days that have free times, in order. */
|
|
@@ -110,10 +160,33 @@ type SlotPickerProps = Omit<React.ComponentProps<"div">, "onChange" | "defaultVa
|
|
|
110
160
|
onValueChange?: (id: string) => void;
|
|
111
161
|
/** The first day shown. Default: the first of `days`. */
|
|
112
162
|
defaultDay?: string;
|
|
113
|
-
/** The app's link component for the times that have an `href
|
|
163
|
+
/** The app's link component for the times that have an `href`, and for the week buttons when `weekHref` is set. */
|
|
114
164
|
linkAs?: LinkComponent;
|
|
165
|
+
/** The week shown, the ISO date of its first day (`2026-10-19`; controlled). Setting it turns on ← Today →. */
|
|
166
|
+
week?: string;
|
|
167
|
+
/** Called with the ISO date of the week asked for (± 7 days, or `todayWeek`). The host loads that week's days. */
|
|
168
|
+
onWeekChange?: (week: string) => void;
|
|
169
|
+
/** The earliest week the host offers (ISO date): ← is disabled there. */
|
|
170
|
+
minWeek?: string;
|
|
171
|
+
/** The latest week the host offers (ISO date): → is disabled there. */
|
|
172
|
+
maxWeek?: string;
|
|
173
|
+
/** The current week, where « Today » goes back to. Default: `minWeek`. */
|
|
174
|
+
todayWeek?: string;
|
|
175
|
+
/** The week in words, formatted by the host with `@krizaka/intl` (`19 – 25 Oct`); announced politely at every change. */
|
|
176
|
+
weekLabel?: string;
|
|
177
|
+
/** Names of the three week buttons, translated: `{ previous: "Previous week", today: "Today", next: "Next week" }`. */
|
|
178
|
+
weekButtons?: {
|
|
179
|
+
previous: string;
|
|
180
|
+
today: string;
|
|
181
|
+
next: string;
|
|
182
|
+
};
|
|
183
|
+
/** Makes the week buttons links (the address holds the state: `?week=`), given the week they go to. */
|
|
184
|
+
weekHref?: (week: string) => string;
|
|
185
|
+
/** The context line under the times: time zone and duration (`Montréal (UTC−4) · 45 min`), formatted by the host. */
|
|
186
|
+
footer?: React.ReactNode;
|
|
115
187
|
};
|
|
116
|
-
/** Tappable free times by day: the day strip, then the day's chips — links or toggles
|
|
117
|
-
declare function SlotPicker({ days, label, emptyLabel, value, onValueChange, defaultDay, linkAs, className, ...props }: SlotPickerProps): React.JSX.Element;
|
|
188
|
+
/** Tappable free times by day: the day strip, then the day's chips (in parts of the day if asked) — links or toggles — and, with `week`, ← Today →. */
|
|
189
|
+
declare function SlotPicker({ days, label, emptyLabel, value, onValueChange, defaultDay, linkAs, week, onWeekChange, minWeek, maxWeek, todayWeek, weekLabel, weekButtons, weekHref, footer, className, ...props }: SlotPickerProps): React.JSX.Element;
|
|
118
190
|
|
|
119
|
-
export {
|
|
191
|
+
export { SlotPicker, slotPicker };
|
|
192
|
+
export type { PickerDay, PickerGroup, PickerSlot, SlotPickerProps };
|
package/dist/slot-picker.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
// src/slot-picker/slot-picker.tsx
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { tv } from "tailwind-variants";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
var slotPicker = tv({
|
|
11
11
|
slots: {
|
|
12
12
|
root: "flex min-w-0 flex-col gap-3",
|
|
@@ -15,28 +15,110 @@ var slotPicker = tv({
|
|
|
15
15
|
dayName: "text-xs font-bold",
|
|
16
16
|
daySub: "text-[11px] tabular-nums text-fg-muted",
|
|
17
17
|
times: "m-0 flex list-none flex-wrap gap-2 p-0",
|
|
18
|
-
time: "inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:
|
|
18
|
+
time: "inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:text-fg-muted disabled:line-through disabled:hover:border-border-default disabled:hover:bg-transparent",
|
|
19
19
|
note: "text-[11px] font-medium text-fg-secondary group-aria-pressed:text-on-accent",
|
|
20
|
+
weekBar: "flex flex-wrap items-center justify-between gap-2",
|
|
21
|
+
weekLabel: "m-0 min-w-0 text-sm font-semibold tabular-nums text-fg",
|
|
22
|
+
weekNav: "flex items-center gap-1.5",
|
|
23
|
+
weekBtn: "inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-sm border border-border-default bg-surface-1 px-3 text-sm font-semibold text-fg no-underline transition-colors hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-disabled:cursor-not-allowed aria-disabled:opacity-50",
|
|
24
|
+
groups: "m-0 flex list-none flex-col gap-3 p-0",
|
|
25
|
+
groupLabel: "m-0 mb-1.5 text-xs font-bold text-fg-secondary",
|
|
26
|
+
footer: "m-0 text-xs text-fg-secondary",
|
|
20
27
|
empty: "m-0 rounded-xl border border-dashed border-border-default px-4 py-6 text-center text-sm text-fg-secondary"
|
|
21
28
|
}
|
|
22
29
|
});
|
|
23
30
|
var s = slotPicker();
|
|
24
|
-
|
|
31
|
+
var addDays = (iso, days) => {
|
|
32
|
+
const d = /* @__PURE__ */ new Date(`${iso}T00:00:00Z`);
|
|
33
|
+
d.setUTCDate(d.getUTCDate() + days);
|
|
34
|
+
return d.toISOString().slice(0, 10);
|
|
35
|
+
};
|
|
36
|
+
var focusables = (root) => [...root?.querySelectorAll("button:not(:disabled), a[href]") ?? []];
|
|
37
|
+
function moveFocus(e, keys) {
|
|
38
|
+
const dir = keys.prev.includes(e.key) ? -1 : keys.next.includes(e.key) ? 1 : 0;
|
|
39
|
+
if (!dir) return;
|
|
40
|
+
const items = focusables(e.currentTarget);
|
|
41
|
+
const at = items.indexOf(document.activeElement);
|
|
42
|
+
if (at < 0) return;
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
items[(at + dir + items.length) % items.length]?.focus();
|
|
45
|
+
}
|
|
46
|
+
function SlotPicker({
|
|
47
|
+
days,
|
|
48
|
+
label,
|
|
49
|
+
emptyLabel,
|
|
50
|
+
value,
|
|
51
|
+
onValueChange,
|
|
52
|
+
defaultDay,
|
|
53
|
+
linkAs,
|
|
54
|
+
week,
|
|
55
|
+
onWeekChange,
|
|
56
|
+
minWeek,
|
|
57
|
+
maxWeek,
|
|
58
|
+
todayWeek,
|
|
59
|
+
weekLabel,
|
|
60
|
+
weekButtons,
|
|
61
|
+
weekHref,
|
|
62
|
+
footer,
|
|
63
|
+
className,
|
|
64
|
+
...props
|
|
65
|
+
}) {
|
|
25
66
|
const [dayId, setDayId] = React.useState(defaultDay ?? days[0]?.id);
|
|
67
|
+
const rootRef = React.useRef(null);
|
|
68
|
+
const refocusDays = React.useRef(false);
|
|
26
69
|
const active = days.find((d) => d.id === dayId) ?? days[0];
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
70
|
+
React.useEffect(() => {
|
|
71
|
+
if (!refocusDays.current) return;
|
|
72
|
+
refocusDays.current = false;
|
|
73
|
+
rootRef.current?.querySelector("[data-day][aria-pressed=true]")?.focus();
|
|
74
|
+
}, [week]);
|
|
75
|
+
const weeks = week !== void 0;
|
|
76
|
+
const prev = weeks ? addDays(week, -7) : void 0;
|
|
77
|
+
const next = weeks ? addDays(week, 7) : void 0;
|
|
78
|
+
const current = todayWeek ?? minWeek;
|
|
79
|
+
const prevOff = !!prev && !!minWeek && prev < minWeek;
|
|
80
|
+
const nextOff = !!next && !!maxWeek && next > maxWeek;
|
|
81
|
+
const todayOff = !current || current === week;
|
|
82
|
+
const go = (to, off) => {
|
|
83
|
+
if (to && !off) onWeekChange?.(to);
|
|
84
|
+
};
|
|
85
|
+
const weekButton = (kind, to, off, text, shown) => weekHref && to && !off ? /* @__PURE__ */ jsx(BlockLink, { href: weekHref(to), linkAs, "aria-label": text, className: s.weekBtn(), children: shown }, kind) : /* @__PURE__ */ jsx("button", { type: "button", "aria-label": text, "aria-disabled": off || void 0, onClick: () => go(to, off), className: s.weekBtn(), children: shown }, kind);
|
|
86
|
+
const onKeyDown = (e) => {
|
|
87
|
+
if (!weeks || e.key !== "PageUp" && e.key !== "PageDown") return;
|
|
88
|
+
const to = e.key === "PageUp" ? prev : next;
|
|
89
|
+
if (!to || (e.key === "PageUp" ? prevOff : nextOff)) return;
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
refocusDays.current = true;
|
|
92
|
+
onWeekChange?.(to);
|
|
93
|
+
};
|
|
94
|
+
const timeList = (slots, name) => /* @__PURE__ */ jsx("ul", { className: s.times(), "aria-label": name, onKeyDown: (e) => moveFocus(e, { prev: ["ArrowLeft", "ArrowUp"], next: ["ArrowRight", "ArrowDown"] }), children: slots.map((slot) => /* @__PURE__ */ jsx("li", { children: slot.href && !slot.disabled ? /* @__PURE__ */ jsxs(BlockLink, { href: slot.href, linkAs, className: s.time(), children: [
|
|
95
|
+
slot.label,
|
|
96
|
+
slot.note && /* @__PURE__ */ jsx("span", { className: s.note(), children: slot.note })
|
|
97
|
+
] }) : /* @__PURE__ */ jsxs("button", { type: "button", "aria-pressed": value === slot.id, disabled: slot.disabled, onClick: () => onValueChange?.(slot.id), className: s.time({ className: "group" }), children: [
|
|
98
|
+
slot.label,
|
|
99
|
+
slot.note && /* @__PURE__ */ jsx("span", { className: s.note(), children: slot.note })
|
|
100
|
+
] }) }, slot.id)) });
|
|
101
|
+
const dayName = active ? `${active.label}${active.sub ? ` ${active.sub}` : ""}` : "";
|
|
102
|
+
return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: s.root({ className }), onKeyDown, ...props, children: [
|
|
103
|
+
weeks && weekButtons && /* @__PURE__ */ jsxs("div", { className: s.weekBar(), children: [
|
|
104
|
+
weekLabel && /* @__PURE__ */ jsx("p", { className: s.weekLabel(), role: "status", "aria-live": "polite", children: weekLabel }),
|
|
105
|
+
/* @__PURE__ */ jsxs("div", { className: s.weekNav(), children: [
|
|
106
|
+
weekButton("previous", prev, prevOff, weekButtons.previous, /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2190" })),
|
|
107
|
+
weekButton("today", current, todayOff, weekButtons.today, weekButtons.today),
|
|
108
|
+
weekButton("next", next, nextOff, weekButtons.next, /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2192" }))
|
|
109
|
+
] })
|
|
110
|
+
] }),
|
|
111
|
+
!active ? /* @__PURE__ */ jsx("p", { className: s.empty(), children: emptyLabel }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
112
|
+
/* @__PURE__ */ jsx("div", { className: s.days(), role: "group", "aria-label": label, onKeyDown: (e) => moveFocus(e, { prev: ["ArrowLeft"], next: ["ArrowRight"] }), children: days.map((day) => /* @__PURE__ */ jsxs("button", { type: "button", "data-day": "", "aria-pressed": day.id === active.id, onClick: () => setDayId(day.id), className: s.day(), children: [
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: s.dayName(), children: day.label }),
|
|
114
|
+
day.sub && /* @__PURE__ */ jsx("span", { className: s.daySub(), children: day.sub })
|
|
115
|
+
] }, day.id)) }),
|
|
116
|
+
active.groups ? /* @__PURE__ */ jsx("ul", { className: s.groups(), "aria-label": dayName, children: active.groups.map((group) => /* @__PURE__ */ jsxs("li", { children: [
|
|
117
|
+
/* @__PURE__ */ jsx("p", { className: s.groupLabel(), children: group.label }),
|
|
118
|
+
timeList(group.slots, `${dayName} \xB7 ${group.label}`)
|
|
119
|
+
] }, group.id)) }) : timeList(active.slots ?? [], dayName)
|
|
120
|
+
] }),
|
|
121
|
+
footer && /* @__PURE__ */ jsx("p", { className: s.footer(), children: footer })
|
|
40
122
|
] });
|
|
41
123
|
}
|
|
42
124
|
export {
|
package/dist/slot-picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/slot-picker/slot-picker.tsx"],"sourcesContent":["// Client (the chosen day). The next free times of a service as tappable chips: a strip of days, then the day's times.\n// A time is a link (`href`: the booking page with the time chosen) or a toggle the reader presses (`value`,\n// `onValueChange`). The app computes the slots (its availability is the truth) and formats the labels.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\n\nexport const slotPicker = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-3\",\n days: \"flex gap-2 overflow-x-auto p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n day:\n \"flex min-h-12 min-w-[4.5rem] shrink-0 cursor-pointer flex-col items-center justify-center rounded-xl border border-border-default bg-surface-1 px-3 py-1.5 text-center leading-tight text-fg-secondary \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n dayName: \"text-xs font-bold\",\n daySub: \"text-[11px] tabular-nums text-fg-muted\",\n times: \"m-0 flex list-none flex-wrap gap-2 p-0\",\n time:\n \"inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline \" +\n \"transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:opacity-50\",\n note: \"text-[11px] font-medium text-fg-secondary group-aria-pressed:text-on-accent\",\n empty: \"m-0 rounded-xl border border-dashed border-border-default px-4 py-6 text-center text-sm text-fg-secondary\",\n },\n});\nconst s = slotPicker();\n\nexport type PickerSlot = {\n /** A stable id (the slot's start as an ISO string). */\n id: string;\n /** The time in words, formatted by the app (`9 h 30`). */\n label: string;\n /** What to know about it (`2 places left`), shown beside the time and read with it. */\n note?: string;\n /** Not offered any more: shown, disabled. */\n disabled?: boolean;\n /** Makes the time a link to this address (the booking page with the slot chosen). */\n href?: string;\n};\n\nexport type PickerDay = {\n /** A stable id (`2026-10-19`). */\n id: string;\n /** The day's name, translated (`Today`, `Mon`). */\n label: string;\n /** Under it (`19 Oct`). */\n sub?: string;\n /** Its free times, in order. */\n slots: readonly PickerSlot[];\n};\n\nexport type SlotPickerProps = Omit<React.ComponentProps<\"div\">, \"onChange\" | \"defaultValue\"> & {\n /** The days that have free times, in order. */\n days: readonly PickerDay[];\n /** The name of the group (`Available times`), passed translated. */\n label: string;\n /** Said when no day has a free time. */\n emptyLabel: string;\n /** The chosen slot's id (controlled). */\n value?: string | null;\n /** Called with the chosen slot's id. */\n onValueChange?: (id: string) => void;\n /** The first day shown. Default: the first of `days`. */\n defaultDay?: string;\n /** The app's link component for the times that have an `href`. */\n linkAs?: LinkComponent;\n};\n\n/** Tappable free times by day: the day strip, then the day's chips — links or toggles. */\nexport function SlotPicker({ days, label, emptyLabel, value, onValueChange, defaultDay, linkAs, className, ...props }: SlotPickerProps) {\n const [dayId, setDayId] = React.useState(defaultDay ?? days[0]?.id);\n const active = days.find((d) => d.id === dayId) ?? days[0];\n if (!active) return <p className={s.empty({ className })}>{emptyLabel}</p>;\n return (\n <div className={s.root({ className })} {...props}>\n <div className={s.days()} role=\"group\" aria-label={label}>\n {days.map((day) => (\n <button key={day.id} type=\"button\" aria-pressed={day.id === active.id} onClick={() => setDayId(day.id)} className={s.day()}>\n <span className={s.dayName()}>{day.label}</span>\n {day.sub && <span className={s.daySub()}>{day.sub}</span>}\n </button>\n ))}\n </div>\n <ul className={s.times()} aria-label={`${active.label}${active.sub ? ` ${active.sub}` : \"\"}`}>\n {active.slots.map((slot) => (\n <li key={slot.id}>\n {slot.href ? (\n <BlockLink href={slot.href} linkAs={linkAs} className={s.time()}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </BlockLink>\n ) : (\n <button type=\"button\" aria-pressed={value === slot.id} disabled={slot.disabled} onClick={() => onValueChange?.(slot.id)} className={s.time({ className: \"group\" })}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </button>\n )}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAsEG,cAKZ,YALY;AAlEf,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KACE;AAAA,IAGF,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MACE;AAAA,IAGF,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF,CAAC;AACD,IAAM,IAAI,WAAW;AA4Cd,SAAS,WAAW,EAAE,MAAM,OAAO,YAAY,OAAO,eAAe,YAAY,QAAQ,WAAW,GAAG,MAAM,GAAoB;AACtI,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAS,cAAc,KAAK,CAAC,GAAG,EAAE;AAClE,QAAM,SAAS,KAAK,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK,KAAK,KAAK,CAAC;AACzD,MAAI,CAAC,OAAQ,QAAO,oBAAC,OAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,GAAI,sBAAW;AACtE,SACE,qBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACzC;AAAA,wBAAC,SAAI,WAAW,EAAE,KAAK,GAAG,MAAK,SAAQ,cAAY,OAChD,eAAK,IAAI,CAAC,QACT,qBAAC,YAAoB,MAAK,UAAS,gBAAc,IAAI,OAAO,OAAO,IAAI,SAAS,MAAM,SAAS,IAAI,EAAE,GAAG,WAAW,EAAE,IAAI,GACvH;AAAA,0BAAC,UAAK,WAAW,EAAE,QAAQ,GAAI,cAAI,OAAM;AAAA,MACxC,IAAI,OAAO,oBAAC,UAAK,WAAW,EAAE,OAAO,GAAI,cAAI,KAAI;AAAA,SAFvC,IAAI,EAGjB,CACD,GACH;AAAA,IACA,oBAAC,QAAG,WAAW,EAAE,MAAM,GAAG,cAAY,GAAG,OAAO,KAAK,GAAG,OAAO,MAAM,IAAI,OAAO,GAAG,KAAK,EAAE,IACvF,iBAAO,MAAM,IAAI,CAAC,SACjB,oBAAC,QACE,eAAK,OACJ,qBAAC,aAAU,MAAM,KAAK,MAAM,QAAgB,WAAW,EAAE,KAAK,GAC3D;AAAA,WAAK;AAAA,MACL,KAAK,QAAQ,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,eAAK,MAAK;AAAA,OACtD,IAEA,qBAAC,YAAO,MAAK,UAAS,gBAAc,UAAU,KAAK,IAAI,UAAU,KAAK,UAAU,SAAS,MAAM,gBAAgB,KAAK,EAAE,GAAG,WAAW,EAAE,KAAK,EAAE,WAAW,QAAQ,CAAC,GAC9J;AAAA,WAAK;AAAA,MACL,KAAK,QAAQ,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,eAAK,MAAK;AAAA,OACtD,KAVK,KAAK,EAYd,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/slot-picker/slot-picker.tsx"],"sourcesContent":["// Client (the chosen day). The next free times of a service as tappable chips: a strip of days, then the day's times.\n// A time is a link (`href`: the booking page with the time chosen) or a toggle the reader presses (`value`,\n// `onValueChange`). The app computes the slots (its availability is the truth) and formats the labels. With `week` the\n// picker moves through the weeks (← Today →): the host loads the days of the week it is asked for, the picker never computes.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\n\nexport const slotPicker = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-3\",\n days: \"flex gap-2 overflow-x-auto p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n day:\n \"flex min-h-12 min-w-[4.5rem] shrink-0 cursor-pointer flex-col items-center justify-center rounded-xl border border-border-default bg-surface-1 px-3 py-1.5 text-center leading-tight text-fg-secondary \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n dayName: \"text-xs font-bold\",\n daySub: \"text-[11px] tabular-nums text-fg-muted\",\n times: \"m-0 flex list-none flex-wrap gap-2 p-0\",\n time:\n \"inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline \" +\n \"transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:text-fg-muted disabled:line-through disabled:hover:border-border-default disabled:hover:bg-transparent\",\n note: \"text-[11px] font-medium text-fg-secondary group-aria-pressed:text-on-accent\",\n weekBar: \"flex flex-wrap items-center justify-between gap-2\",\n weekLabel: \"m-0 min-w-0 text-sm font-semibold tabular-nums text-fg\",\n weekNav: \"flex items-center gap-1.5\",\n weekBtn:\n \"inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-sm border border-border-default bg-surface-1 px-3 text-sm font-semibold text-fg no-underline \" +\n \"transition-colors hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-disabled:cursor-not-allowed aria-disabled:opacity-50\",\n groups: \"m-0 flex list-none flex-col gap-3 p-0\",\n groupLabel: \"m-0 mb-1.5 text-xs font-bold text-fg-secondary\",\n footer: \"m-0 text-xs text-fg-secondary\",\n empty: \"m-0 rounded-xl border border-dashed border-border-default px-4 py-6 text-center text-sm text-fg-secondary\",\n },\n});\nconst s = slotPicker();\n\nexport type PickerSlot = {\n /** A stable id (the slot's start as an ISO string). */\n id: string;\n /** The time in words, formatted by the app (`9 h 30`). */\n label: string;\n /** What to know about it (`2 places left`), shown beside the time and read with it. */\n note?: string;\n /** Not offered any more (full): shown struck out and disabled, its `note` (`Full`) read with the time — never colour alone. */\n disabled?: boolean;\n /** Makes the time a link to this address (the booking page with the slot chosen). */\n href?: string;\n};\n\n/** A part of a day (`Morning`, `Afternoon`): the label comes from the host's messages. */\nexport type PickerGroup = {\n id: string;\n label: string;\n slots: readonly PickerSlot[];\n};\n\nexport type PickerDay = {\n /** A stable id (`2026-10-19`). */\n id: string;\n /** The day's name, translated (`Today`, `Mon`). */\n label: string;\n /** Under it (`19 Oct`). */\n sub?: string;\n /** Its times, in order — flat… */\n slots?: readonly PickerSlot[];\n /** …or in parts of the day (`Morning`, `Afternoon`), each under its own label. Wins over `slots`. */\n groups?: readonly PickerGroup[];\n};\n\nexport type SlotPickerProps = Omit<React.ComponentProps<\"div\">, \"onChange\" | \"defaultValue\"> & {\n /** The days that have free times, in order. */\n days: readonly PickerDay[];\n /** The name of the group (`Available times`), passed translated. */\n label: string;\n /** Said when no day has a free time. */\n emptyLabel: string;\n /** The chosen slot's id (controlled). */\n value?: string | null;\n /** Called with the chosen slot's id. */\n onValueChange?: (id: string) => void;\n /** The first day shown. Default: the first of `days`. */\n defaultDay?: string;\n /** The app's link component for the times that have an `href`, and for the week buttons when `weekHref` is set. */\n linkAs?: LinkComponent;\n /** The week shown, the ISO date of its first day (`2026-10-19`; controlled). Setting it turns on ← Today →. */\n week?: string;\n /** Called with the ISO date of the week asked for (± 7 days, or `todayWeek`). The host loads that week's days. */\n onWeekChange?: (week: string) => void;\n /** The earliest week the host offers (ISO date): ← is disabled there. */\n minWeek?: string;\n /** The latest week the host offers (ISO date): → is disabled there. */\n maxWeek?: string;\n /** The current week, where « Today » goes back to. Default: `minWeek`. */\n todayWeek?: string;\n /** The week in words, formatted by the host with `@krizaka/intl` (`19 – 25 Oct`); announced politely at every change. */\n weekLabel?: string;\n /** Names of the three week buttons, translated: `{ previous: \"Previous week\", today: \"Today\", next: \"Next week\" }`. */\n weekButtons?: { previous: string; today: string; next: string };\n /** Makes the week buttons links (the address holds the state: `?week=`), given the week they go to. */\n weekHref?: (week: string) => string;\n /** The context line under the times: time zone and duration (`Montréal (UTC−4) · 45 min`), formatted by the host. */\n footer?: React.ReactNode;\n};\n\n/** The ISO date `days` days after `iso` (UTC, so a time zone never moves it). */\nconst addDays = (iso: string, days: number) => {\n const d = new Date(`${iso}T00:00:00Z`);\n d.setUTCDate(d.getUTCDate() + days);\n return d.toISOString().slice(0, 10);\n};\n\nconst focusables = (root: Element | null) => [...(root?.querySelectorAll<HTMLElement>(\"button:not(:disabled), a[href]\") ?? [])];\n/** Arrows move focus inside one list of controls (`dir` -1/+1 on the arrows that follow the reading order). */\nfunction moveFocus(e: React.KeyboardEvent<HTMLElement>, keys: { prev: string[]; next: string[] }) {\n const dir = keys.prev.includes(e.key) ? -1 : keys.next.includes(e.key) ? 1 : 0;\n if (!dir) return;\n const items = focusables(e.currentTarget);\n const at = items.indexOf(document.activeElement as HTMLElement);\n if (at < 0) return;\n e.preventDefault();\n items[(at + dir + items.length) % items.length]?.focus();\n}\n\n/** Tappable free times by day: the day strip, then the day's chips (in parts of the day if asked) — links or toggles — and, with `week`, ← Today →. */\nexport function SlotPicker({\n days,\n label,\n emptyLabel,\n value,\n onValueChange,\n defaultDay,\n linkAs,\n week,\n onWeekChange,\n minWeek,\n maxWeek,\n todayWeek,\n weekLabel,\n weekButtons,\n weekHref,\n footer,\n className,\n ...props\n}: SlotPickerProps) {\n const [dayId, setDayId] = React.useState(defaultDay ?? days[0]?.id);\n const rootRef = React.useRef<HTMLDivElement>(null);\n const refocusDays = React.useRef(false);\n const active = days.find((d) => d.id === dayId) ?? days[0];\n // After a week change from the keyboard (Page Up / Down inside the times), focus goes to the day strip, which stays.\n React.useEffect(() => {\n if (!refocusDays.current) return;\n refocusDays.current = false;\n rootRef.current?.querySelector<HTMLElement>(\"[data-day][aria-pressed=true]\")?.focus();\n }, [week]);\n\n const weeks = week !== undefined;\n const prev = weeks ? addDays(week, -7) : undefined;\n const next = weeks ? addDays(week, 7) : undefined;\n const current = todayWeek ?? minWeek;\n const prevOff = !!prev && !!minWeek && prev < minWeek;\n const nextOff = !!next && !!maxWeek && next > maxWeek;\n const todayOff = !current || current === week;\n const go = (to: string | undefined, off: boolean) => {\n if (to && !off) onWeekChange?.(to);\n };\n\n const weekButton = (kind: \"previous\" | \"today\" | \"next\", to: string | undefined, off: boolean, text: string, shown: React.ReactNode) =>\n weekHref && to && !off ? (\n <BlockLink key={kind} href={weekHref(to)} linkAs={linkAs} aria-label={text} className={s.weekBtn()}>\n {shown}\n </BlockLink>\n ) : (\n <button key={kind} type=\"button\" aria-label={text} aria-disabled={off || undefined} onClick={() => go(to, off)} className={s.weekBtn()}>\n {shown}\n </button>\n );\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!weeks || (e.key !== \"PageUp\" && e.key !== \"PageDown\")) return;\n const to = e.key === \"PageUp\" ? prev : next;\n if (!to || (e.key === \"PageUp\" ? prevOff : nextOff)) return;\n e.preventDefault();\n refocusDays.current = true;\n onWeekChange?.(to);\n };\n\n const timeList = (slots: readonly PickerSlot[], name: string) => (\n <ul className={s.times()} aria-label={name} onKeyDown={(e) => moveFocus(e, { prev: [\"ArrowLeft\", \"ArrowUp\"], next: [\"ArrowRight\", \"ArrowDown\"] })}>\n {slots.map((slot) => (\n <li key={slot.id}>\n {slot.href && !slot.disabled ? (\n <BlockLink href={slot.href} linkAs={linkAs} className={s.time()}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </BlockLink>\n ) : (\n <button type=\"button\" aria-pressed={value === slot.id} disabled={slot.disabled} onClick={() => onValueChange?.(slot.id)} className={s.time({ className: \"group\" })}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </button>\n )}\n </li>\n ))}\n </ul>\n );\n\n const dayName = active ? `${active.label}${active.sub ? ` ${active.sub}` : \"\"}` : \"\";\n return (\n <div ref={rootRef} className={s.root({ className })} onKeyDown={onKeyDown} {...props}>\n {weeks && weekButtons && (\n <div className={s.weekBar()}>\n {weekLabel && (\n <p className={s.weekLabel()} role=\"status\" aria-live=\"polite\">\n {weekLabel}\n </p>\n )}\n <div className={s.weekNav()}>\n {weekButton(\"previous\", prev, prevOff, weekButtons.previous, <span aria-hidden=\"true\">←</span>)}\n {weekButton(\"today\", current, todayOff, weekButtons.today, weekButtons.today)}\n {weekButton(\"next\", next, nextOff, weekButtons.next, <span aria-hidden=\"true\">→</span>)}\n </div>\n </div>\n )}\n {!active ? (\n <p className={s.empty()}>{emptyLabel}</p>\n ) : (\n <>\n <div className={s.days()} role=\"group\" aria-label={label} onKeyDown={(e) => moveFocus(e, { prev: [\"ArrowLeft\"], next: [\"ArrowRight\"] })}>\n {days.map((day) => (\n <button key={day.id} type=\"button\" data-day=\"\" aria-pressed={day.id === active.id} onClick={() => setDayId(day.id)} className={s.day()}>\n <span className={s.dayName()}>{day.label}</span>\n {day.sub && <span className={s.daySub()}>{day.sub}</span>}\n </button>\n ))}\n </div>\n {active.groups ? (\n <ul className={s.groups()} aria-label={dayName}>\n {active.groups.map((group) => (\n <li key={group.id}>\n <p className={s.groupLabel()}>{group.label}</p>\n {timeList(group.slots, `${dayName} · ${group.label}`)}\n </li>\n ))}\n </ul>\n ) : (\n timeList(active.slots ?? [], dayName)\n )}\n </>\n )}\n {footer && <p className={s.footer()}>{footer}</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;AAIA,YAAY,WAAW;AACvB,SAAS,UAAU;AAsKb,SA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":[]}
|
package/dist/slot.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { VisuallyHidden as VisuallyHidden$1 } from 'radix-ui';
|
|
|
3
3
|
|
|
4
4
|
/** Merges its props, `className` and `ref` into its only child: the engine of every `asChild`. */
|
|
5
5
|
declare const Slot: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLElement> & {
|
|
6
|
-
children?: React.ReactNode;
|
|
6
|
+
children?: React.ReactNode | undefined;
|
|
7
7
|
} & React$1.RefAttributes<HTMLElement>>;
|
|
8
8
|
/** Hidden on screen, read by assistive technology. */
|
|
9
9
|
declare const VisuallyHidden: React$1.ForwardRefExoticComponent<VisuallyHidden$1.VisuallyHiddenProps & React$1.RefAttributes<HTMLSpanElement>>;
|
package/dist/specimen-tag.d.ts
CHANGED
|
@@ -49,4 +49,5 @@ type SpecimenTagProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
|
49
49
|
*/
|
|
50
50
|
declare function SpecimenTag({ code, title, titleAs: Title, mark, status, fields, children, footer, mount, className, ...props }: SpecimenTagProps): React.JSX.Element;
|
|
51
51
|
|
|
52
|
-
export {
|
|
52
|
+
export { SpecimenTag, Stamp };
|
|
53
|
+
export type { SpecimenField, SpecimenTagProps, StampProps, StampTone };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type SpeedLinesProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
/** `radial` bursts from the centre; `horizontal` streaks across. @default "radial" */
|
|
5
|
+
kind?: "radial" | "horizontal";
|
|
6
|
+
/** How many lines (4 to 120). @default 36 */
|
|
7
|
+
count?: number;
|
|
8
|
+
/** For `radial`: the share of the height left clear around the centre, 0 to 80. @default 34 */
|
|
9
|
+
clear?: number;
|
|
10
|
+
/** A slow pulse of the lines; off under reduced motion. @default false */
|
|
11
|
+
animated?: boolean;
|
|
12
|
+
/** The element the lines sit behind. */
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/** Manga action lines behind a hero element: a burst or streaks in SVG, still under reduced motion. */
|
|
16
|
+
declare function SpeedLines({ kind, count, clear, animated, className, children, ...props }: SpeedLinesProps): React.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { SpeedLines };
|
|
19
|
+
export type { SpeedLinesProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-W675RFOA.js";
|
|
4
|
+
|
|
5
|
+
// src/speed-lines/speed-lines.tsx
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var unit = (i, salt) => {
|
|
8
|
+
let h = Math.imul(i + 1, 2654435761) ^ Math.imul(salt + 7, 40503);
|
|
9
|
+
h = Math.imul(h ^ h >>> 15, 2246822519);
|
|
10
|
+
h = Math.imul(h ^ h >>> 13, 3266489917);
|
|
11
|
+
return ((h ^ h >>> 16) >>> 0) % 1e3 / 1e3;
|
|
12
|
+
};
|
|
13
|
+
var r2 = (n) => Math.round(n * 100) / 100;
|
|
14
|
+
function radial(count, clear) {
|
|
15
|
+
const cx = 100;
|
|
16
|
+
const cy = 50;
|
|
17
|
+
const inner = clear / 100 * 50;
|
|
18
|
+
return Array.from({ length: count }, (_, i) => {
|
|
19
|
+
const a = (i + (unit(i, 1) - 0.5) * 0.6) / count * Math.PI * 2;
|
|
20
|
+
const w = 0.012 + unit(i, 2) * 0.05;
|
|
21
|
+
const r0 = inner * (0.8 + unit(i, 3) * 0.5);
|
|
22
|
+
const r1 = 150;
|
|
23
|
+
const p = (r, da) => `${r2(cx + r * Math.cos(a + da))},${r2(cy + r * Math.sin(a + da))}`;
|
|
24
|
+
return { key: i, points: `${p(r0, 0)} ${p(r1, -w)} ${p(r1, w)}`, opacity: r2(0.35 + unit(i, 4) * 0.5) };
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function horizontal(count) {
|
|
28
|
+
return Array.from({ length: count }, (_, i) => {
|
|
29
|
+
const y = (i + unit(i, 5) * 0.8) / count * 100;
|
|
30
|
+
const x = unit(i, 6) * 120;
|
|
31
|
+
return { key: i, x: r2(x), y: r2(y), width: r2(40 + unit(i, 7) * 100), height: r2(0.25 + unit(i, 8) * 0.9), opacity: r2(0.3 + unit(i, 9) * 0.5) };
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function SpeedLines({ kind = "radial", count = 36, clear = 34, animated = false, className, children, ...props }) {
|
|
35
|
+
const n = Math.min(120, Math.max(4, Math.round(count)));
|
|
36
|
+
const gap = Math.min(80, Math.max(0, clear));
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("kz-speed", className), "data-kind": kind, "data-speed-animated": animated ? "" : void 0, ...props, children: [
|
|
38
|
+
/* @__PURE__ */ jsx("svg", { className: "kz-speed-lines", viewBox: "0 0 200 100", preserveAspectRatio: "xMidYMid slice", "aria-hidden": "true", focusable: "false", children: kind === "radial" ? radial(n, gap).map((l) => /* @__PURE__ */ jsx("polygon", { points: l.points, fill: "currentColor", opacity: l.opacity }, l.key)) : horizontal(n).map((l) => /* @__PURE__ */ jsx("rect", { x: l.x, y: l.y, width: l.width, height: l.height, fill: "currentColor", opacity: l.opacity }, l.key)) }),
|
|
39
|
+
/* @__PURE__ */ jsx("div", { className: "kz-speed-content", children })
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
SpeedLines
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=speed-lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/speed-lines/speed-lines.tsx"],"sourcesContent":["// Server-safe. The manga action lines of the Krizaka style (blocks.css): thin wedges that burst from behind a hero element\n// (`radial`) or streak across it (`horizontal`), in SVG. Deterministic (an integer hash of the index, never Math.random), static\n// by default, and still under `prefers-reduced-motion`: `animated` only pulses them, and the stylesheet stops that.\n// Decoration: the lines are hidden from assistive technology, the content in front is the real thing.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type SpeedLinesProps = React.HTMLAttributes<HTMLDivElement> & {\n /** `radial` bursts from the centre; `horizontal` streaks across. @default \"radial\" */\n kind?: \"radial\" | \"horizontal\";\n /** How many lines (4 to 120). @default 36 */\n count?: number;\n /** For `radial`: the share of the height left clear around the centre, 0 to 80. @default 34 */\n clear?: number;\n /** A slow pulse of the lines; off under reduced motion. @default false */\n animated?: boolean;\n /** The element the lines sit behind. */\n children?: React.ReactNode;\n};\n\n/** A stable 0–1 value of `i` and a `salt`: integer arithmetic only, so the server and the client draw the same lines. */\nconst unit = (i: number, salt: number) => {\n let h = Math.imul(i + 1, 2654435761) ^ Math.imul(salt + 7, 40503);\n h = Math.imul(h ^ (h >>> 15), 2246822519);\n h = Math.imul(h ^ (h >>> 13), 3266489917);\n return ((h ^ (h >>> 16)) >>> 0) % 1000 / 1000;\n};\nconst r2 = (n: number) => Math.round(n * 100) / 100;\n\nfunction radial(count: number, clear: number) {\n const cx = 100;\n const cy = 50;\n const inner = (clear / 100) * 50;\n return Array.from({ length: count }, (_, i) => {\n const a = ((i + (unit(i, 1) - 0.5) * 0.6) / count) * Math.PI * 2;\n const w = 0.012 + unit(i, 2) * 0.05;\n const r0 = inner * (0.8 + unit(i, 3) * 0.5);\n const r1 = 150;\n const p = (r: number, da: number) => `${r2(cx + r * Math.cos(a + da))},${r2(cy + r * Math.sin(a + da))}`;\n return { key: i, points: `${p(r0, 0)} ${p(r1, -w)} ${p(r1, w)}`, opacity: r2(0.35 + unit(i, 4) * 0.5) };\n });\n}\n\nfunction horizontal(count: number) {\n return Array.from({ length: count }, (_, i) => {\n const y = ((i + unit(i, 5) * 0.8) / count) * 100;\n const x = unit(i, 6) * 120;\n return { key: i, x: r2(x), y: r2(y), width: r2(40 + unit(i, 7) * 100), height: r2(0.25 + unit(i, 8) * 0.9), opacity: r2(0.3 + unit(i, 9) * 0.5) };\n });\n}\n\n/** Manga action lines behind a hero element: a burst or streaks in SVG, still under reduced motion. */\nexport function SpeedLines({ kind = \"radial\", count = 36, clear = 34, animated = false, className, children, ...props }: SpeedLinesProps) {\n const n = Math.min(120, Math.max(4, Math.round(count)));\n const gap = Math.min(80, Math.max(0, clear));\n return (\n <div className={cn(\"kz-speed\", className)} data-kind={kind} data-speed-animated={animated ? \"\" : undefined} {...props}>\n <svg className=\"kz-speed-lines\" viewBox=\"0 0 200 100\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\" focusable=\"false\">\n {kind === \"radial\"\n ? radial(n, gap).map((l) => <polygon key={l.key} points={l.points} fill=\"currentColor\" opacity={l.opacity} />)\n : horizontal(n).map((l) => <rect key={l.key} x={l.x} y={l.y} width={l.width} height={l.height} fill=\"currentColor\" opacity={l.opacity} />)}\n </svg>\n <div className=\"kz-speed-content\">{children}</div>\n </div>\n );\n}\n"],"mappings":";;;;;AAyDI,SAGkC,KAHlC;AAnCJ,IAAM,OAAO,CAAC,GAAW,SAAiB;AACxC,MAAI,IAAI,KAAK,KAAK,IAAI,GAAG,UAAU,IAAI,KAAK,KAAK,OAAO,GAAG,KAAK;AAChE,MAAI,KAAK,KAAK,IAAK,MAAM,IAAK,UAAU;AACxC,MAAI,KAAK,KAAK,IAAK,MAAM,IAAK,UAAU;AACxC,WAAS,IAAK,MAAM,QAAS,KAAK,MAAO;AAC3C;AACA,IAAM,KAAK,CAAC,MAAc,KAAK,MAAM,IAAI,GAAG,IAAI;AAEhD,SAAS,OAAO,OAAe,OAAe;AAC5C,QAAM,KAAK;AACX,QAAM,KAAK;AACX,QAAM,QAAS,QAAQ,MAAO;AAC9B,SAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MAAM;AAC7C,UAAM,KAAM,KAAK,KAAK,GAAG,CAAC,IAAI,OAAO,OAAO,QAAS,KAAK,KAAK;AAC/D,UAAM,IAAI,QAAQ,KAAK,GAAG,CAAC,IAAI;AAC/B,UAAM,KAAK,SAAS,MAAM,KAA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9G;AAAA,wBAAC,SAAI,WAAU,kBAAiB,SAAQ,eAAc,qBAAoB,kBAAiB,eAAY,QAAO,WAAU,SACrH,mBAAS,WACN,OAAO,GAAG,GAAG,EAAE,IAAI,CAAC,MAAM,oBAAC,aAAoB,QAAQ,EAAE,QAAQ,MAAK,gBAAe,SAAS,EAAE,WAAxD,EAAE,GAA+D,CAAE,IAC3G,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,oBAAC,UAAiB,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,EAAE,OAAO,QAAQ,EAAE,QAAQ,MAAK,gBAAe,SAAS,EAAE,WAAxF,EAAE,GAA+F,CAAE,GAC7I;AAAA,IACA,oBAAC,SAAI,WAAU,oBAAoB,UAAS;AAAA,KAC9C;AAEJ;","names":[]}
|
package/dist/spinner.d.ts
CHANGED
|
@@ -49,4 +49,5 @@ type SpinnerProps = Omit<React.ComponentProps<"svg">, "children"> & VariantProps
|
|
|
49
49
|
*/
|
|
50
50
|
declare function Spinner({ label, size, value, className, ...props }: SpinnerProps): React.JSX.Element;
|
|
51
51
|
|
|
52
|
-
export { LoaderGlyph,
|
|
52
|
+
export { LoaderGlyph, Spinner, spinnerVariants };
|
|
53
|
+
export type { LoaderGlyphProps, LoaderGlyphState, SpinnerProps };
|
package/dist/split-view.d.ts
CHANGED
|
@@ -103,4 +103,5 @@ type SplitViewProps = React.ComponentProps<"div"> & {
|
|
|
103
103
|
/** A list and its open item: two panes on a desktop, one at a time on a phone. */
|
|
104
104
|
declare function SplitView({ listTitle, listActions, list, detailHead, detail, empty, showDetail, back, listLabel, className, ...props }: SplitViewProps): React.JSX.Element;
|
|
105
105
|
|
|
106
|
-
export { SplitView,
|
|
106
|
+
export { SplitView, splitView };
|
|
107
|
+
export type { SplitViewProps };
|
package/dist/stage-banner.d.ts
CHANGED
|
@@ -31,4 +31,5 @@ type StageBannerProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
|
31
31
|
/** Announces a chapter: a stage and its name on one line, or (`size="lg"`) a stage, a title and a line, centred. */
|
|
32
32
|
declare function StageBanner({ stage, name, title, subtitle, size, titleAs: Title, variant, brand, className, ...props }: StageBannerProps): React.JSX.Element;
|
|
33
33
|
|
|
34
|
-
export { StageBanner
|
|
34
|
+
export { StageBanner };
|
|
35
|
+
export type { StageBannerProps };
|
package/dist/stat.d.ts
CHANGED
|
@@ -103,4 +103,5 @@ type StatGridProps = React.ComponentProps<"div"> & {
|
|
|
103
103
|
/** A row of key figures that wraps with the width: a dashboard's head. The stats are its children. */
|
|
104
104
|
declare function StatGrid({ divided, minWidth, className, style, ...props }: StatGridProps): React.JSX.Element;
|
|
105
105
|
|
|
106
|
-
export { Stat, StatGrid,
|
|
106
|
+
export { Stat, StatGrid, stat, statGrid };
|
|
107
|
+
export type { StatGridProps, StatProps, StatTrend };
|
package/dist/stat.js
CHANGED
|
@@ -5,7 +5,7 @@ var stat = tv({
|
|
|
5
5
|
slots: {
|
|
6
6
|
root: "flex min-w-0 flex-col gap-1",
|
|
7
7
|
label: "text-xs font-semibold text-fg-secondary",
|
|
8
|
-
value: "font-display text-2xl font-black tabular-nums text-fg",
|
|
8
|
+
value: "kz-stat-value font-display text-2xl font-black tabular-nums text-fg",
|
|
9
9
|
meta: "flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",
|
|
10
10
|
// The status tokens are too light for small text on a light surface: the words stay a text role, the arrow carries
|
|
11
11
|
// the direction's colour.
|
package/dist/stat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/stat/stat.tsx"],"sourcesContent":["// Server-safe. A key figure: a label, the value in tabular digits, a hint, a trend. Every word is a prop.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const stat = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-1\",\n label: \"text-xs font-semibold text-fg-secondary\",\n value: \"font-display text-2xl font-black tabular-nums text-fg\",\n meta: \"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs\",\n // The status tokens are too light for small text on a light surface: the words stay a text role, the arrow carries\n // the direction's colour.\n trend: \"inline-flex items-center gap-1 font-semibold text-fg [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0\",\n hint: \"text-fg-secondary\",\n chart: \"mt-2 h-10 w-full min-w-0\",\n },\n variants: {\n trend: {\n up: { trend: \"[&>svg]:text-success\" },\n down: { trend: \"[&>svg]:text-danger\" },\n flat: { trend: \"[&>svg]:text-fg-secondary\" },\n },\n },\n});\n\nexport type StatTrend = \"up\" | \"down\" | \"flat\";\n\nconst ARROW: Record<StatTrend, string> = { up: \"M7 17 17 7M8 7h9v9\", down: \"M7 7l10 10M17 8v9H8\", flat: \"M5 12h14M13 6l6 6-6 6\" };\n\nexport type StatProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** What the figure is (\"Revenue\"), above it. */\n label: React.ReactNode;\n /** The figure, formatted by the app, in tabular digits. */\n value: React.ReactNode;\n /** A line under the value: the period, the comparison. */\n hint?: React.ReactNode;\n /** The direction of the change; its arrow is decorative. */\n trend?: StatTrend;\n /** The change, in words, as read and shown (e.g. \"+12 % vs last week\") — the arrow alone says nothing. */\n trendLabel?: React.ReactNode;\n /** Under the figure: a `Sparkline` of @krizaka/charts (its own accessible summary), a `Meter`. */\n chart?: React.ReactNode;\n};\n\nexport function Stat({ label, value, hint, trend, trendLabel, chart, className, ...props }: StatProps) {\n const s = stat({ trend });\n return (\n <div data-trend={trend} className={s.root({ className })} {...props}>\n <p className={s.label()}>{label}</p>\n <p className={s.value()}>{value}</p>\n {(trendLabel || hint) && (\n <p className={s.meta()}>\n {trend && trendLabel && (\n <span className={s.trend()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={ARROW[trend]} />\n </svg>\n {trendLabel}\n </span>\n )}\n {hint && <span className={s.hint()}>{hint}</span>}\n </p>\n )}\n {chart ? <div className={s.chart()}>{chart}</div> : null}\n </div>\n );\n}\n\nexport const statGrid = tv({\n base: \"grid w-full grid-cols-[repeat(auto-fit,minmax(var(--kz-stat-min,11rem),1fr))] overflow-hidden rounded-xl border border-border-default bg-surface-1\",\n variants: {\n divided: {\n true: \"gap-px bg-border-subtle [&>*]:bg-surface-1 [&>*]:p-5\",\n false: \"gap-6 p-5\",\n },\n },\n defaultVariants: { divided: true },\n});\n\nexport type StatGridProps = React.ComponentProps<\"div\"> & {\n /** Hairlines between the stats (default) or space only. */\n divided?: boolean;\n /** The narrowest a stat may be before the row wraps, in rem. Default 11. */\n minWidth?: number;\n};\n\n/** A row of key figures that wraps with the width: a dashboard's head. The stats are its children. */\nexport function StatGrid({ divided, minWidth = 11, className, style, ...props }: StatGridProps) {\n return <div className={statGrid({ divided, className })} style={{ ...style, [\"--kz-stat-min\" as string]: `${minWidth}rem` }} {...props} />;\n}\n"],"mappings":";AAEA,SAAS,UAAU;AA8Cb,cAKM,YALN;AA5CC,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA;AAAA;AAAA,IAGN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,MACL,IAAI,EAAE,OAAO,uBAAuB;AAAA,MACpC,MAAM,EAAE,OAAO,sBAAsB;AAAA,MACrC,MAAM,EAAE,OAAO,4BAA4B;AAAA,IAC7C;AAAA,EACF;AACF,CAAC;AAID,IAAM,QAAmC,EAAE,IAAI,sBAAsB,MAAM,uBAAuB,MAAM,wBAAwB;AAiBzH,SAAS,KAAK,EAAE,OAAO,OAAO,MAAM,OAAO,YAAY,OAAO,WAAW,GAAG,MAAM,GAAc;AACrG,QAAM,IAAI,KAAK,EAAE,MAAM,CAAC;AACxB,SACE,qBAAC,SAAI,cAAY,OAAO,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAC5D;AAAA,wBAAC,OAAE,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,IAChC,oBAAC,OAAE,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,KAC9B,cAAc,SACd,qBAAC,OAAE,WAAW,EAAE,KAAK,GAClB;AAAA,eAAS,cACR,qBAAC,UAAK,WAAW,EAAE,MAAM,GACvB;AAAA,4BAAC,SAAI,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,OAAM,eAAc,SAAQ,gBAAe,SAAQ,eAAW,MACnI,8BAAC,UAAK,GAAG,MAAM,KAAK,GAAG,GACzB;AAAA,QACC;AAAA,SACH;AAAA,MAED,QAAQ,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,gBAAK;AAAA,OAC5C;AAAA,IAED,QAAQ,oBAAC,SAAI,WAAW,EAAE,MAAM,GAAI,iBAAM,IAAS;AAAA,KACtD;AAEJ;AAEO,IAAM,WAAW,GAAG;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,KAAK;AACnC,CAAC;AAUM,SAAS,SAAS,EAAE,SAAS,WAAW,IAAI,WAAW,OAAO,GAAG,MAAM,GAAkB;AAC9F,SAAO,oBAAC,SAAI,WAAW,SAAS,EAAE,SAAS,UAAU,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,CAAC,eAAyB,GAAG,GAAG,QAAQ,MAAM,GAAI,GAAG,OAAO;AAC1I;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/stat/stat.tsx"],"sourcesContent":["// Server-safe. A key figure: a label, the value in tabular digits, a hint, a trend. Every word is a prop.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const stat = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-1\",\n label: \"text-xs font-semibold text-fg-secondary\",\n value: \"kz-stat-value font-display text-2xl font-black tabular-nums text-fg\",\n meta: \"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs\",\n // The status tokens are too light for small text on a light surface: the words stay a text role, the arrow carries\n // the direction's colour.\n trend: \"inline-flex items-center gap-1 font-semibold text-fg [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0\",\n hint: \"text-fg-secondary\",\n chart: \"mt-2 h-10 w-full min-w-0\",\n },\n variants: {\n trend: {\n up: { trend: \"[&>svg]:text-success\" },\n down: { trend: \"[&>svg]:text-danger\" },\n flat: { trend: \"[&>svg]:text-fg-secondary\" },\n },\n },\n});\n\nexport type StatTrend = \"up\" | \"down\" | \"flat\";\n\nconst ARROW: Record<StatTrend, string> = { up: \"M7 17 17 7M8 7h9v9\", down: \"M7 7l10 10M17 8v9H8\", flat: \"M5 12h14M13 6l6 6-6 6\" };\n\nexport type StatProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** What the figure is (\"Revenue\"), above it. */\n label: React.ReactNode;\n /** The figure, formatted by the app, in tabular digits. */\n value: React.ReactNode;\n /** A line under the value: the period, the comparison. */\n hint?: React.ReactNode;\n /** The direction of the change; its arrow is decorative. */\n trend?: StatTrend;\n /** The change, in words, as read and shown (e.g. \"+12 % vs last week\") — the arrow alone says nothing. */\n trendLabel?: React.ReactNode;\n /** Under the figure: a `Sparkline` of @krizaka/charts (its own accessible summary), a `Meter`. */\n chart?: React.ReactNode;\n};\n\nexport function Stat({ label, value, hint, trend, trendLabel, chart, className, ...props }: StatProps) {\n const s = stat({ trend });\n return (\n <div data-trend={trend} className={s.root({ className })} {...props}>\n <p className={s.label()}>{label}</p>\n <p className={s.value()}>{value}</p>\n {(trendLabel || hint) && (\n <p className={s.meta()}>\n {trend && trendLabel && (\n <span className={s.trend()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={ARROW[trend]} />\n </svg>\n {trendLabel}\n </span>\n )}\n {hint && <span className={s.hint()}>{hint}</span>}\n </p>\n )}\n {chart ? <div className={s.chart()}>{chart}</div> : null}\n </div>\n );\n}\n\nexport const statGrid = tv({\n base: \"grid w-full grid-cols-[repeat(auto-fit,minmax(var(--kz-stat-min,11rem),1fr))] overflow-hidden rounded-xl border border-border-default bg-surface-1\",\n variants: {\n divided: {\n true: \"gap-px bg-border-subtle [&>*]:bg-surface-1 [&>*]:p-5\",\n false: \"gap-6 p-5\",\n },\n },\n defaultVariants: { divided: true },\n});\n\nexport type StatGridProps = React.ComponentProps<\"div\"> & {\n /** Hairlines between the stats (default) or space only. */\n divided?: boolean;\n /** The narrowest a stat may be before the row wraps, in rem. Default 11. */\n minWidth?: number;\n};\n\n/** A row of key figures that wraps with the width: a dashboard's head. The stats are its children. */\nexport function StatGrid({ divided, minWidth = 11, className, style, ...props }: StatGridProps) {\n return <div className={statGrid({ divided, className })} style={{ ...style, [\"--kz-stat-min\" as string]: `${minWidth}rem` }} {...props} />;\n}\n"],"mappings":";AAEA,SAAS,UAAU;AA8Cb,cAKM,YALN;AA5CC,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA;AAAA;AAAA,IAGN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,MACL,IAAI,EAAE,OAAO,uBAAuB;AAAA,MACpC,MAAM,EAAE,OAAO,sBAAsB;AAAA,MACrC,MAAM,EAAE,OAAO,4BAA4B;AAAA,IAC7C;AAAA,EACF;AACF,CAAC;AAID,IAAM,QAAmC,EAAE,IAAI,sBAAsB,MAAM,uBAAuB,MAAM,wBAAwB;AAiBzH,SAAS,KAAK,EAAE,OAAO,OAAO,MAAM,OAAO,YAAY,OAAO,WAAW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Tone, StatusTransition } from '@krizaka/organize/contract';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
type StatusMove = {
|
|
6
|
+
/** The transition the person chose. */
|
|
7
|
+
transition: StatusTransition;
|
|
8
|
+
/** The key of the reason picked from the transition's list, or null when it has none. */
|
|
9
|
+
reason: string | null;
|
|
10
|
+
};
|
|
11
|
+
type StatusChipLabels = {
|
|
12
|
+
/** The menu's accessible name: `(state) => "Change the status, now " + state`. */
|
|
13
|
+
menu: (state: string) => string;
|
|
14
|
+
/** The item that waits for a second press: `(target) => "Confirm: " + target`. */
|
|
15
|
+
confirm: (target: string) => string;
|
|
16
|
+
/** The submenu that asks for a reason: `(target) => target + " — pick a reason"`. */
|
|
17
|
+
reason: (target: string) => string;
|
|
18
|
+
};
|
|
19
|
+
type StatusChipProps = {
|
|
20
|
+
/** The kind's status set (`KindConfig.status`). */
|
|
21
|
+
set: StatusSet;
|
|
22
|
+
/** The key of the entity's state. */
|
|
23
|
+
state: string;
|
|
24
|
+
/** The role of the person: the moves are the ones this role may make. */
|
|
25
|
+
role: string;
|
|
26
|
+
/** The language the labels are read in. */
|
|
27
|
+
locale: "fr" | "en";
|
|
28
|
+
/** Called when a move is chosen (confirmed, with its reason when it asks for one). Without it the chip is read-only. */
|
|
29
|
+
onMove?: (move: StatusMove) => void;
|
|
30
|
+
/** The words of the menu, passed translated. */
|
|
31
|
+
labels?: Partial<StatusChipLabels>;
|
|
32
|
+
/**
|
|
33
|
+
* sm · md.
|
|
34
|
+
* @default "sm"
|
|
35
|
+
*/
|
|
36
|
+
size?: "sm" | "md";
|
|
37
|
+
/** Classes merged on the badge. */
|
|
38
|
+
className?: string;
|
|
39
|
+
};
|
|
40
|
+
/** The state of a status set as a badge; a menu of the allowed moves when the set, the role and `onMove` allow it. */
|
|
41
|
+
declare function StatusChip({ set, state, role, locale, onMove, labels: given, size, className }: StatusChipProps): React.JSX.Element;
|
|
42
|
+
|
|
43
|
+
export { StatusChip };
|
|
44
|
+
export type { StatusChipLabels, StatusChipProps, StatusMove };
|