@krizaka/ui 2.2.0 → 2.4.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 +33 -8
- package/dist/audio-player.d.ts +113 -0
- package/dist/audio-player.js +207 -0
- package/dist/audio-player.js.map +1 -0
- package/dist/{button-Cgfkg_3y.d.ts → button-BMAO7dKF.d.ts} +29 -2
- package/dist/button.d.ts +32 -5
- package/dist/button.js +62 -9
- package/dist/button.js.map +1 -1
- package/dist/chip-link.d.ts +53 -0
- package/dist/chip-link.js +32 -0
- package/dist/chip-link.js.map +1 -0
- package/dist/chunk-2USC2YT6.js +17 -0
- package/dist/chunk-2USC2YT6.js.map +1 -0
- package/dist/chunk-43PTCDTL.js +31 -0
- package/dist/chunk-43PTCDTL.js.map +1 -0
- package/dist/chunk-6ISW63JI.js +11 -0
- package/dist/chunk-6ISW63JI.js.map +1 -0
- package/dist/chunk-EUPTXKH7.js +95 -0
- package/dist/chunk-EUPTXKH7.js.map +1 -0
- package/dist/chunk-HAQWKORZ.js +117 -0
- package/dist/chunk-HAQWKORZ.js.map +1 -0
- package/dist/{chunk-FHYZSO2S.js → chunk-R6SDS7JM.js} +5 -3
- package/dist/chunk-R6SDS7JM.js.map +1 -0
- package/dist/chunk-RUPNPMP3.js +103 -0
- package/dist/chunk-RUPNPMP3.js.map +1 -0
- package/dist/chunk-RUPRYJ45.js +82 -0
- package/dist/chunk-RUPRYJ45.js.map +1 -0
- package/dist/chunk-VDR2EP6K.js +49 -0
- package/dist/chunk-VDR2EP6K.js.map +1 -0
- package/dist/chunk-WEVYKZIF.js +33 -0
- package/dist/chunk-WEVYKZIF.js.map +1 -0
- package/dist/chunk-XUMJA5ZI.js +283 -0
- package/dist/chunk-XUMJA5ZI.js.map +1 -0
- package/dist/chunk-YH4LMWRU.js +92 -0
- package/dist/chunk-YH4LMWRU.js.map +1 -0
- package/dist/chunk-YX6CNVJA.js +94 -0
- package/dist/chunk-YX6CNVJA.js.map +1 -0
- package/dist/chunk-ZIXB33X7.js +95 -0
- package/dist/chunk-ZIXB33X7.js.map +1 -0
- package/dist/combobox.d.ts +188 -0
- package/dist/combobox.js +16 -0
- package/dist/combobox.js.map +1 -0
- package/dist/command.d.ts +7 -7
- package/dist/command.js +3 -2
- package/dist/command.js.map +1 -1
- package/dist/confirm-button.d.ts +1 -1
- package/dist/confirm-button.js +2 -1
- package/dist/confirm-button.js.map +1 -1
- package/dist/data-table.d.ts +246 -0
- package/dist/data-table.js +290 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-picker.d.ts +288 -0
- package/dist/date-picker.js +364 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/{dialog-GQ4Nvuyf.d.ts → dialog-D42QwYb_.d.ts} +11 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +3 -2
- package/dist/dialog.js.map +1 -1
- package/dist/file-upload.d.ts +238 -0
- package/dist/file-upload.js +437 -0
- package/dist/file-upload.js.map +1 -0
- package/dist/filter-bar.d.ts +139 -0
- package/dist/filter-bar.js +155 -0
- package/dist/filter-bar.js.map +1 -0
- package/dist/glow-card.d.ts +20 -0
- package/dist/glow-card.js +30 -0
- package/dist/glow-card.js.map +1 -0
- package/dist/image-cropper.d.ts +115 -0
- package/dist/image-cropper.js +166 -0
- package/dist/image-cropper.js.map +1 -0
- package/dist/index.d.ts +2 -20
- package/dist/index.js +7 -64
- package/dist/index.js.map +1 -1
- package/dist/iso.d.ts +400 -0
- package/dist/iso.js +363 -0
- package/dist/iso.js.map +1 -0
- package/dist/loader.d.ts +206 -0
- package/dist/loader.js +138 -0
- package/dist/loader.js.map +1 -0
- package/dist/marquee.d.ts +33 -0
- package/dist/marquee.js +52 -0
- package/dist/marquee.js.map +1 -0
- package/dist/media-capture.d.ts +155 -0
- package/dist/media-capture.js +242 -0
- package/dist/media-capture.js.map +1 -0
- package/dist/meter.d.ts +146 -0
- package/dist/meter.js +107 -0
- package/dist/meter.js.map +1 -0
- package/dist/motion.css +394 -3
- package/dist/motion.d.ts +46 -0
- package/dist/motion.js +10 -0
- package/dist/motion.js.map +1 -0
- package/dist/native/media-capture.d.ts +49 -0
- package/dist/native/media-capture.js +113 -0
- package/dist/native/media-capture.js.map +1 -0
- package/dist/native/video-player.d.ts +50 -0
- package/dist/native/video-player.js +69 -0
- package/dist/native/video-player.js.map +1 -0
- package/dist/native.d.ts +66 -2
- package/dist/native.js +166 -68
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +178 -0
- package/dist/nav-bar.js +157 -0
- package/dist/nav-bar.js.map +1 -0
- package/dist/number-ticker.d.ts +32 -0
- package/dist/number-ticker.js +61 -0
- package/dist/number-ticker.js.map +1 -0
- package/dist/pagination.d.ts +141 -0
- package/dist/pagination.js +165 -0
- package/dist/pagination.js.map +1 -0
- package/dist/progress.d.ts +56 -1
- package/dist/progress.js +72 -25
- package/dist/progress.js.map +1 -1
- package/dist/search-field.d.ts +100 -0
- package/dist/search-field.js +167 -0
- package/dist/search-field.js.map +1 -0
- package/dist/skeleton.d.ts +18 -3
- package/dist/skeleton.js +9 -1
- package/dist/skeleton.js.map +1 -1
- package/dist/spinner.d.ts +21 -5
- package/dist/spinner.js +13 -12
- package/dist/spinner.js.map +1 -1
- package/dist/stepper.d.ts +112 -0
- package/dist/stepper.js +67 -0
- package/dist/stepper.js.map +1 -0
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +14 -8
- package/dist/tabs.js.map +1 -1
- package/dist/tag-input.d.ts +44 -0
- package/dist/tag-input.js +67 -0
- package/dist/tag-input.js.map +1 -0
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +2 -1
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts +39 -4
- package/dist/toast.js +81 -7
- package/dist/toast.js.map +1 -1
- package/dist/video-player.d.ts +204 -0
- package/dist/video-player.js +371 -0
- package/dist/video-player.js.map +1 -0
- package/dist/video-trimmer.d.ts +142 -0
- package/dist/video-trimmer.js +193 -0
- package/dist/video-trimmer.js.map +1 -0
- package/package.json +375 -7
- package/registry/alert.json +1 -1
- package/registry/audio-player.json +282 -0
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +232 -26
- package/registry/card.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +158 -0
- package/registry/chip.json +1 -1
- package/registry/combobox.json +475 -0
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +91 -7
- package/registry/countdown.json +1 -1
- package/registry/data-table.json +500 -0
- package/registry/date-picker.json +978 -0
- package/registry/dialog.json +15 -7
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/examples/audio-player/podcast.js +22 -0
- package/registry/examples/audio-player/podcast.tsx +19 -0
- package/registry/examples/audio-player/voice-note.d.ts +4 -0
- package/registry/examples/audio-player/voice-note.js +12 -0
- package/registry/examples/audio-player/voice-note.tsx +12 -0
- package/registry/examples/button/error.d.ts +4 -0
- package/registry/examples/button/error.js +11 -0
- package/registry/examples/button/error.tsx +10 -0
- package/registry/examples/button/loading.tsx +1 -1
- package/registry/examples/button/save-flow.d.ts +4 -0
- package/registry/examples/button/save-flow.js +28 -0
- package/registry/examples/button/save-flow.tsx +24 -0
- package/registry/examples/button/signature.d.ts +4 -0
- package/registry/examples/button/signature.js +17 -0
- package/registry/examples/button/signature.tsx +19 -0
- package/registry/examples/button/upload-progress.d.ts +4 -0
- package/registry/examples/button/upload-progress.js +23 -0
- package/registry/examples/button/upload-progress.tsx +26 -0
- package/registry/examples/chip-link/filters.d.ts +4 -0
- package/registry/examples/chip-link/filters.js +12 -0
- package/registry/examples/chip-link/filters.tsx +17 -0
- package/registry/examples/combobox/async.d.ts +4 -0
- package/registry/examples/combobox/async.js +23 -0
- package/registry/examples/combobox/async.tsx +22 -0
- package/registry/examples/combobox/creatable.d.ts +4 -0
- package/registry/examples/combobox/creatable.js +32 -0
- package/registry/examples/combobox/creatable.tsx +28 -0
- package/registry/examples/combobox/invalid.d.ts +4 -0
- package/registry/examples/combobox/invalid.js +23 -0
- package/registry/examples/combobox/invalid.tsx +17 -0
- package/registry/examples/combobox/multiple.d.ts +4 -0
- package/registry/examples/combobox/multiple.js +29 -0
- package/registry/examples/combobox/multiple.tsx +26 -0
- package/registry/examples/data-table/cards.d.ts +4 -0
- package/registry/examples/data-table/cards.js +21 -0
- package/registry/examples/data-table/cards.tsx +20 -0
- package/registry/examples/data-table/empty.d.ts +4 -0
- package/registry/examples/data-table/empty.js +26 -0
- package/registry/examples/data-table/empty.tsx +21 -0
- package/registry/examples/data-table/error.d.ts +4 -0
- package/registry/examples/data-table/error.js +28 -0
- package/registry/examples/data-table/error.tsx +29 -0
- package/registry/examples/data-table/jobs.d.ts +4 -0
- package/registry/examples/data-table/jobs.js +37 -0
- package/registry/examples/data-table/jobs.tsx +36 -0
- package/registry/examples/data-table/loading.d.ts +4 -0
- package/registry/examples/data-table/loading.js +16 -0
- package/registry/examples/data-table/loading.tsx +12 -0
- package/registry/examples/data-table/virtualized.d.ts +4 -0
- package/registry/examples/data-table/virtualized.js +21 -0
- package/registry/examples/data-table/virtualized.tsx +20 -0
- package/registry/examples/date-picker/calendar.d.ts +4 -0
- package/registry/examples/date-picker/calendar.js +14 -0
- package/registry/examples/date-picker/calendar.tsx +16 -0
- package/registry/examples/date-picker/french.d.ts +4 -0
- package/registry/examples/date-picker/french.js +20 -0
- package/registry/examples/date-picker/french.tsx +14 -0
- package/registry/examples/date-picker/open.d.ts +4 -0
- package/registry/examples/date-picker/open.js +11 -0
- package/registry/examples/date-picker/open.tsx +8 -0
- package/registry/examples/date-picker/range.d.ts +4 -0
- package/registry/examples/date-picker/range.js +29 -0
- package/registry/examples/date-picker/range.tsx +25 -0
- package/registry/examples/date-picker/schedule.d.ts +4 -0
- package/registry/examples/date-picker/schedule.js +26 -0
- package/registry/examples/date-picker/schedule.tsx +22 -0
- package/registry/examples/dialog/left.d.ts +4 -0
- package/registry/examples/dialog/left.js +22 -0
- package/registry/examples/dialog/left.tsx +32 -0
- package/registry/examples/file-upload/images.d.ts +4 -0
- package/registry/examples/file-upload/images.js +32 -0
- package/registry/examples/file-upload/images.tsx +25 -0
- package/registry/examples/file-upload/states.d.ts +4 -0
- package/registry/examples/file-upload/states.js +28 -0
- package/registry/examples/file-upload/states.tsx +23 -0
- package/registry/examples/file-upload/tus.d.ts +4 -0
- package/registry/examples/file-upload/tus.js +23 -0
- package/registry/examples/file-upload/tus.tsx +26 -0
- package/registry/examples/file-upload/video.d.ts +4 -0
- package/registry/examples/file-upload/video.js +39 -0
- package/registry/examples/file-upload/video.tsx +36 -0
- package/registry/examples/filter-bar/address.d.ts +4 -0
- package/registry/examples/filter-bar/address.js +29 -0
- package/registry/examples/filter-bar/address.tsx +27 -0
- package/registry/examples/filter-bar/jobs.d.ts +4 -0
- package/registry/examples/filter-bar/jobs.js +37 -0
- package/registry/examples/filter-bar/jobs.tsx +37 -0
- package/registry/examples/filter-bar/menu.d.ts +4 -0
- package/registry/examples/filter-bar/menu.js +27 -0
- package/registry/examples/filter-bar/menu.tsx +23 -0
- package/registry/examples/glow-card/link-card.d.ts +4 -0
- package/registry/examples/glow-card/link-card.js +14 -0
- package/registry/examples/glow-card/link-card.tsx +13 -0
- package/registry/examples/glow-card/plans.d.ts +4 -0
- package/registry/examples/glow-card/plans.js +25 -0
- package/registry/examples/glow-card/plans.tsx +26 -0
- package/registry/examples/glow-card/spotlight.d.ts +4 -0
- package/registry/examples/glow-card/spotlight.js +14 -0
- package/registry/examples/glow-card/spotlight.tsx +15 -0
- package/registry/examples/image-cropper/avatar.d.ts +4 -0
- package/registry/examples/image-cropper/avatar.js +13 -0
- package/registry/examples/image-cropper/avatar.tsx +14 -0
- package/registry/examples/image-cropper/banner.d.ts +4 -0
- package/registry/examples/image-cropper/banner.js +11 -0
- package/registry/examples/image-cropper/banner.tsx +10 -0
- package/registry/examples/image-cropper/vertical-video.d.ts +4 -0
- package/registry/examples/image-cropper/vertical-video.js +12 -0
- package/registry/examples/image-cropper/vertical-video.tsx +16 -0
- package/registry/examples/iso/compose.d.ts +4 -0
- package/registry/examples/iso/compose.js +22 -0
- package/registry/examples/iso/compose.tsx +19 -0
- package/registry/examples/iso/orazaka-hero.d.ts +4 -0
- package/registry/examples/iso/orazaka-hero.js +26 -0
- package/registry/examples/iso/orazaka-hero.tsx +21 -0
- package/registry/examples/iso/orochia-hero.d.ts +4 -0
- package/registry/examples/iso/orochia-hero.js +29 -0
- package/registry/examples/iso/orochia-hero.tsx +23 -0
- package/registry/examples/iso/still.d.ts +4 -0
- package/registry/examples/iso/still.js +21 -0
- package/registry/examples/iso/still.tsx +15 -0
- package/registry/examples/loader/endings.d.ts +4 -0
- package/registry/examples/loader/endings.js +14 -0
- package/registry/examples/loader/endings.tsx +11 -0
- package/registry/examples/loader/fetch-flow.d.ts +4 -0
- package/registry/examples/loader/fetch-flow.js +24 -0
- package/registry/examples/loader/fetch-flow.tsx +24 -0
- package/registry/examples/loader/minimal.d.ts +4 -0
- package/registry/examples/loader/minimal.js +11 -0
- package/registry/examples/loader/minimal.tsx +6 -0
- package/registry/examples/loader/overlay.d.ts +4 -0
- package/registry/examples/loader/overlay.js +16 -0
- package/registry/examples/loader/overlay.tsx +13 -0
- package/registry/examples/loader/region-handover.d.ts +4 -0
- package/registry/examples/loader/region-handover.js +42 -0
- package/registry/examples/loader/region-handover.tsx +29 -0
- package/registry/examples/loader/upload-eta.d.ts +4 -0
- package/registry/examples/loader/upload-eta.js +11 -0
- package/registry/examples/loader/upload-eta.tsx +10 -0
- package/registry/examples/marquee/cards.d.ts +4 -0
- package/registry/examples/marquee/cards.js +23 -0
- package/registry/examples/marquee/cards.tsx +21 -0
- package/registry/examples/marquee/logos.d.ts +4 -0
- package/registry/examples/marquee/logos.js +12 -0
- package/registry/examples/marquee/logos.tsx +17 -0
- package/registry/examples/media-capture/clip.d.ts +4 -0
- package/registry/examples/media-capture/clip.js +20 -0
- package/registry/examples/media-capture/clip.tsx +18 -0
- package/registry/examples/media-capture/native/photo.d.ts +4 -0
- package/registry/examples/media-capture/native/photo.dark.png +0 -0
- package/registry/examples/media-capture/native/photo.js +27 -0
- package/registry/examples/media-capture/native/photo.light.png +0 -0
- package/registry/examples/media-capture/native/photo.tsx +20 -0
- package/registry/examples/media-capture/profile-photo.d.ts +4 -0
- package/registry/examples/media-capture/profile-photo.js +24 -0
- package/registry/examples/media-capture/profile-photo.tsx +20 -0
- package/registry/examples/meter/balance.d.ts +4 -0
- package/registry/examples/meter/balance.js +14 -0
- package/registry/examples/meter/balance.tsx +15 -0
- package/registry/examples/meter/quota.d.ts +4 -0
- package/registry/examples/meter/quota.js +15 -0
- package/registry/examples/meter/quota.tsx +12 -0
- package/registry/examples/meter/split.d.ts +4 -0
- package/registry/examples/meter/split.js +18 -0
- package/registry/examples/meter/split.tsx +18 -0
- package/registry/examples/nav-bar/app-bar.d.ts +4 -0
- package/registry/examples/nav-bar/app-bar.js +22 -0
- package/registry/examples/nav-bar/app-bar.tsx +21 -0
- package/registry/examples/nav-bar/menu-open.d.ts +4 -0
- package/registry/examples/nav-bar/menu-open.js +26 -0
- package/registry/examples/nav-bar/menu-open.tsx +26 -0
- package/registry/examples/nav-bar/site.d.ts +4 -0
- package/registry/examples/nav-bar/site.js +31 -0
- package/registry/examples/nav-bar/site.tsx +36 -0
- package/registry/examples/number-ticker/gradient.d.ts +4 -0
- package/registry/examples/number-ticker/gradient.js +11 -0
- package/registry/examples/number-ticker/gradient.tsx +10 -0
- package/registry/examples/number-ticker/live-total.d.ts +4 -0
- package/registry/examples/number-ticker/live-total.js +17 -0
- package/registry/examples/number-ticker/live-total.tsx +21 -0
- package/registry/examples/number-ticker/stats.d.ts +4 -0
- package/registry/examples/number-ticker/stats.js +19 -0
- package/registry/examples/number-ticker/stats.tsx +23 -0
- package/registry/examples/pagination/cursor.d.ts +4 -0
- package/registry/examples/pagination/cursor.js +24 -0
- package/registry/examples/pagination/cursor.tsx +20 -0
- package/registry/examples/pagination/links.d.ts +4 -0
- package/registry/examples/pagination/links.js +11 -0
- package/registry/examples/pagination/links.tsx +6 -0
- package/registry/examples/pagination/native/cursor.d.ts +4 -0
- package/registry/examples/pagination/native/cursor.dark.png +0 -0
- package/registry/examples/pagination/native/cursor.js +19 -0
- package/registry/examples/pagination/native/cursor.light.png +0 -0
- package/registry/examples/pagination/native/cursor.tsx +13 -0
- package/registry/examples/pagination/native/pages.d.ts +4 -0
- package/registry/examples/pagination/native/pages.dark.png +0 -0
- package/registry/examples/pagination/native/pages.js +21 -0
- package/registry/examples/pagination/native/pages.light.png +0 -0
- package/registry/examples/pagination/native/pages.tsx +14 -0
- package/registry/examples/pagination/results.d.ts +4 -0
- package/registry/examples/pagination/results.js +23 -0
- package/registry/examples/pagination/results.tsx +19 -0
- package/registry/examples/pagination/table-footer.d.ts +4 -0
- package/registry/examples/pagination/table-footer.js +31 -0
- package/registry/examples/pagination/table-footer.tsx +27 -0
- package/registry/examples/progress/buffer.d.ts +4 -0
- package/registry/examples/progress/buffer.js +11 -0
- package/registry/examples/progress/buffer.tsx +10 -0
- package/registry/examples/progress/statuses.d.ts +4 -0
- package/registry/examples/progress/statuses.js +14 -0
- package/registry/examples/progress/statuses.tsx +11 -0
- package/registry/examples/progress/steps.d.ts +4 -0
- package/registry/examples/progress/steps.js +14 -0
- package/registry/examples/progress/steps.tsx +13 -0
- package/registry/examples/progress/upload.d.ts +4 -0
- package/registry/examples/progress/upload.js +11 -0
- package/registry/examples/progress/upload.tsx +10 -0
- package/registry/examples/search-field/global.d.ts +4 -0
- package/registry/examples/search-field/global.js +19 -0
- package/registry/examples/search-field/global.tsx +15 -0
- package/registry/examples/search-field/native/default.d.ts +4 -0
- package/registry/examples/search-field/native/default.dark.png +0 -0
- package/registry/examples/search-field/native/default.js +13 -0
- package/registry/examples/search-field/native/default.light.png +0 -0
- package/registry/examples/search-field/native/default.tsx +7 -0
- package/registry/examples/search-field/suggestions.d.ts +4 -0
- package/registry/examples/search-field/suggestions.js +30 -0
- package/registry/examples/search-field/suggestions.tsx +27 -0
- package/registry/examples/search-field/toolbar.d.ts +4 -0
- package/registry/examples/search-field/toolbar.js +17 -0
- package/registry/examples/search-field/toolbar.tsx +21 -0
- package/registry/examples/skeleton/paragraph.d.ts +4 -0
- package/registry/examples/skeleton/paragraph.js +14 -0
- package/registry/examples/skeleton/paragraph.tsx +12 -0
- package/registry/examples/skeleton/shape-of-content.d.ts +4 -0
- package/registry/examples/skeleton/shape-of-content.js +23 -0
- package/registry/examples/skeleton/shape-of-content.tsx +26 -0
- package/registry/examples/spinner/default.js +5 -2
- package/registry/examples/spinner/default.tsx +7 -1
- package/registry/examples/spinner/sizes.js +2 -1
- package/registry/examples/spinner/sizes.tsx +2 -0
- package/registry/examples/spinner/value.d.ts +4 -0
- package/registry/examples/spinner/value.js +11 -0
- package/registry/examples/spinner/value.tsx +12 -0
- package/registry/examples/stepper/checkout.d.ts +4 -0
- package/registry/examples/stepper/checkout.js +22 -0
- package/registry/examples/stepper/checkout.tsx +17 -0
- package/registry/examples/stepper/failed.d.ts +4 -0
- package/registry/examples/stepper/failed.js +26 -0
- package/registry/examples/stepper/failed.tsx +21 -0
- package/registry/examples/stepper/job.d.ts +4 -0
- package/registry/examples/stepper/job.js +32 -0
- package/registry/examples/stepper/job.tsx +28 -0
- package/registry/examples/tag-input/recipients.d.ts +4 -0
- package/registry/examples/tag-input/recipients.js +23 -0
- package/registry/examples/tag-input/recipients.tsx +20 -0
- package/registry/examples/tag-input/video-tags.d.ts +4 -0
- package/registry/examples/tag-input/video-tags.js +26 -0
- package/registry/examples/tag-input/video-tags.tsx +22 -0
- package/registry/examples/toast/grouped.d.ts +4 -0
- package/registry/examples/toast/grouped.js +21 -0
- package/registry/examples/toast/grouped.tsx +23 -0
- package/registry/examples/toast/undo.d.ts +4 -0
- package/registry/examples/toast/undo.js +29 -0
- package/registry/examples/toast/undo.tsx +30 -0
- package/registry/examples/toast/upload-progress.d.ts +4 -0
- package/registry/examples/toast/upload-progress.js +29 -0
- package/registry/examples/toast/upload-progress.tsx +31 -0
- package/registry/examples/video-player/default.d.ts +4 -0
- package/registry/examples/video-player/default.js +12 -0
- package/registry/examples/video-player/default.tsx +8 -0
- package/registry/examples/video-player/gated.d.ts +4 -0
- package/registry/examples/video-player/gated.js +26 -0
- package/registry/examples/video-player/gated.tsx +23 -0
- package/registry/examples/video-player/native/default.d.ts +4 -0
- package/registry/examples/video-player/native/default.dark.png +0 -0
- package/registry/examples/video-player/native/default.js +18 -0
- package/registry/examples/video-player/native/default.light.png +0 -0
- package/registry/examples/video-player/native/default.tsx +12 -0
- package/registry/examples/video-player/signed-source.d.ts +4 -0
- package/registry/examples/video-player/signed-source.js +16 -0
- package/registry/examples/video-player/signed-source.tsx +15 -0
- package/registry/examples/video-player/vertical.d.ts +4 -0
- package/registry/examples/video-player/vertical.js +12 -0
- package/registry/examples/video-player/vertical.tsx +12 -0
- package/registry/examples/video-trimmer/custom.d.ts +4 -0
- package/registry/examples/video-trimmer/custom.js +24 -0
- package/registry/examples/video-trimmer/custom.tsx +26 -0
- package/registry/examples/video-trimmer/filmstrip.d.ts +4 -0
- package/registry/examples/video-trimmer/filmstrip.js +15 -0
- package/registry/examples/video-trimmer/filmstrip.tsx +13 -0
- package/registry/examples/video-trimmer/playhead.d.ts +4 -0
- package/registry/examples/video-trimmer/playhead.js +15 -0
- package/registry/examples/video-trimmer/playhead.tsx +13 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +471 -0
- package/registry/filter-bar.json +347 -0
- package/registry/glow-card.json +162 -0
- package/registry/image-cropper.json +313 -0
- package/registry/index.json +445 -20
- package/registry/iso.json +1355 -0
- package/registry/kbd.json +1 -1
- package/registry/loader.json +399 -0
- package/registry/marquee.json +225 -0
- package/registry/mascots.json +3 -3
- package/registry/media-capture.json +347 -0
- package/registry/meter.json +324 -0
- package/registry/nav-bar.json +480 -0
- package/registry/number-ticker.json +219 -0
- package/registry/page-header.json +1 -1
- package/registry/pagination.json +475 -0
- package/registry/popover.json +1 -1
- package/registry/progress.json +114 -9
- package/registry/radio-group.json +1 -1
- package/registry/search-field.json +436 -0
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/skeleton.json +69 -13
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +91 -27
- package/registry/stat.json +1 -1
- package/registry/stepper.json +174 -0
- package/registry/switch.json +1 -1
- package/registry/tabs.json +11 -7
- package/registry/tag-input.json +363 -0
- package/registry/theme.json +3 -3
- package/registry/toast.json +41 -13
- package/registry/tooltip.json +1 -1
- package/registry/video-player.json +598 -0
- package/registry/video-trimmer.json +385 -0
- package/dist/chunk-FHYZSO2S.js.map +0 -1
- package/dist/chunk-PESA2R4U.js +0 -51
- package/dist/chunk-PESA2R4U.js.map +0 -1
- package/registry/examples/spinner/muted.js +0 -11
- package/registry/examples/spinner/muted.tsx +0 -6
- /package/registry/examples/{spinner/muted.d.ts → audio-player/podcast.d.ts} +0 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useListbox
|
|
4
|
+
} from "./chunk-ZIXB33X7.js";
|
|
5
|
+
import {
|
|
6
|
+
useControllable,
|
|
7
|
+
useDebouncedCallback
|
|
8
|
+
} from "./chunk-EUPTXKH7.js";
|
|
9
|
+
import {
|
|
10
|
+
CloseGlyph,
|
|
11
|
+
SearchGlyph
|
|
12
|
+
} from "./chunk-YX6CNVJA.js";
|
|
13
|
+
|
|
14
|
+
// src/search-field/search-field.tsx
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
import { tv as tv2 } from "tailwind-variants";
|
|
17
|
+
|
|
18
|
+
// src/kbd/kbd.tsx
|
|
19
|
+
import { tv } from "tailwind-variants";
|
|
20
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
|
+
var kbdVariants = tv({
|
|
22
|
+
base: "inline-flex shrink-0 items-center justify-center rounded-md border border-border-default border-b-2 bg-surface-2 font-mono font-semibold text-fg-secondary",
|
|
23
|
+
variants: { size: { sm: "h-5 min-w-5 px-1 text-[10px]", md: "h-6 min-w-6 px-1.5 text-xs" } },
|
|
24
|
+
defaultVariants: { size: "md" }
|
|
25
|
+
});
|
|
26
|
+
function Kbd({ size, className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx("kbd", { className: kbdVariants({ size, className }), ...props });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/search-field/search-field.tsx
|
|
31
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
32
|
+
var searchField = tv2({
|
|
33
|
+
slots: {
|
|
34
|
+
root: "relative w-full",
|
|
35
|
+
control: "flex h-11 w-full items-center gap-2 rounded-lg border border-border-default bg-surface-2 pl-3 pr-1.5 text-sm text-fg transition-[border-color,box-shadow] focus-within:border-accent focus-within:ring-2 focus-within:ring-ring",
|
|
36
|
+
icon: "h-4 w-4 shrink-0 text-fg-secondary",
|
|
37
|
+
input: "h-full min-w-0 flex-1 bg-transparent text-sm text-fg outline-hidden placeholder:text-fg-muted [&::-webkit-search-cancel-button]:appearance-none",
|
|
38
|
+
clear: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
39
|
+
shortcut: "hidden shrink-0 items-center gap-0.5 pr-1 sm:flex",
|
|
40
|
+
list: "absolute inset-x-0 top-full z-50 mt-1 max-h-72 overflow-y-auto rounded-lg border border-border-default bg-surface-2 p-1 shadow-lg",
|
|
41
|
+
option: "flex cursor-pointer select-none items-center gap-2.5 rounded-md px-2.5 py-2 text-sm text-fg data-[active]:bg-surface-3",
|
|
42
|
+
group: "px-2.5 pb-1 pt-2 text-[11px] font-semibold uppercase text-fg-muted"
|
|
43
|
+
},
|
|
44
|
+
variants: {
|
|
45
|
+
size: { md: {}, sm: { control: "h-9", clear: "h-7 w-7" } }
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: { size: "md" }
|
|
48
|
+
});
|
|
49
|
+
var isApple = () => typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
50
|
+
function SearchField({
|
|
51
|
+
label,
|
|
52
|
+
value: valueProp,
|
|
53
|
+
defaultValue = "",
|
|
54
|
+
onValueChange,
|
|
55
|
+
onSearch,
|
|
56
|
+
debounce = 250,
|
|
57
|
+
onSubmit,
|
|
58
|
+
shortcut = false,
|
|
59
|
+
suggestions,
|
|
60
|
+
suggestionsLabel,
|
|
61
|
+
onSuggestionSelect,
|
|
62
|
+
clearLabel = "Clear search",
|
|
63
|
+
landmark = true,
|
|
64
|
+
size,
|
|
65
|
+
className,
|
|
66
|
+
placeholder,
|
|
67
|
+
...props
|
|
68
|
+
}) {
|
|
69
|
+
const s = searchField({ size });
|
|
70
|
+
const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);
|
|
71
|
+
const [open, setOpen] = React.useState(false);
|
|
72
|
+
const [apple, setApple] = React.useState(false);
|
|
73
|
+
const input = React.useRef(null);
|
|
74
|
+
const search = useDebouncedCallback((query) => onSearch?.(query), debounce);
|
|
75
|
+
const list = suggestions ?? [];
|
|
76
|
+
const pick = (i) => {
|
|
77
|
+
const suggestion = list[i];
|
|
78
|
+
if (!suggestion) return;
|
|
79
|
+
setOpen(false);
|
|
80
|
+
onSuggestionSelect?.(suggestion);
|
|
81
|
+
};
|
|
82
|
+
const listbox = useListbox({ count: list.length, onPick: pick, open: open && list.length > 0, setOpen });
|
|
83
|
+
React.useEffect(() => {
|
|
84
|
+
if (!shortcut) return;
|
|
85
|
+
setApple(isApple());
|
|
86
|
+
const onKey = (event) => {
|
|
87
|
+
if (event.key.toLowerCase() === shortcut.toLowerCase() && (event.metaKey || event.ctrlKey) && !event.altKey) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
input.current?.focus();
|
|
90
|
+
input.current?.select();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
window.addEventListener("keydown", onKey);
|
|
94
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
95
|
+
}, [shortcut]);
|
|
96
|
+
const change = (query) => {
|
|
97
|
+
setValue(query);
|
|
98
|
+
search(query);
|
|
99
|
+
listbox.setActive(-1);
|
|
100
|
+
setOpen(true);
|
|
101
|
+
};
|
|
102
|
+
const field = /* @__PURE__ */ jsxs("div", { className: s.root({ className }), onBlur: (event) => !event.currentTarget.contains(event.relatedTarget) && setOpen(false), children: [
|
|
103
|
+
/* @__PURE__ */ jsxs("div", { className: s.control(), children: [
|
|
104
|
+
/* @__PURE__ */ jsx2(SearchGlyph, { className: s.icon() }),
|
|
105
|
+
/* @__PURE__ */ jsx2(
|
|
106
|
+
"input",
|
|
107
|
+
{
|
|
108
|
+
ref: input,
|
|
109
|
+
type: "search",
|
|
110
|
+
"aria-label": label,
|
|
111
|
+
enterKeyHint: "search",
|
|
112
|
+
autoComplete: "off",
|
|
113
|
+
...list.length > 0 ? listbox.inputProps : {},
|
|
114
|
+
value,
|
|
115
|
+
placeholder,
|
|
116
|
+
className: s.input(),
|
|
117
|
+
onChange: (event) => change(event.target.value),
|
|
118
|
+
onFocus: () => setOpen(true),
|
|
119
|
+
onKeyDown: (event) => {
|
|
120
|
+
if (list.length > 0 && listbox.onKeyDown(event)) return;
|
|
121
|
+
if (event.key === "Enter") {
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
search.cancel();
|
|
124
|
+
onSearch?.(value);
|
|
125
|
+
onSubmit?.(value);
|
|
126
|
+
setOpen(false);
|
|
127
|
+
} else if (event.key === "Escape" && value) {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
change("");
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
...props
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
value ? /* @__PURE__ */ jsx2(
|
|
136
|
+
"button",
|
|
137
|
+
{
|
|
138
|
+
type: "button",
|
|
139
|
+
"aria-label": clearLabel,
|
|
140
|
+
className: s.clear(),
|
|
141
|
+
onClick: () => {
|
|
142
|
+
change("");
|
|
143
|
+
input.current?.focus();
|
|
144
|
+
},
|
|
145
|
+
children: /* @__PURE__ */ jsx2(CloseGlyph, { className: "h-4 w-4" })
|
|
146
|
+
}
|
|
147
|
+
) : shortcut ? /* @__PURE__ */ jsxs("span", { className: s.shortcut(), "aria-hidden": true, children: [
|
|
148
|
+
/* @__PURE__ */ jsx2(Kbd, { size: "sm", children: apple ? "\u2318" : "Ctrl" }),
|
|
149
|
+
/* @__PURE__ */ jsx2(Kbd, { size: "sm", children: shortcut.toUpperCase() })
|
|
150
|
+
] }) : null
|
|
151
|
+
] }),
|
|
152
|
+
list.length > 0 && /* @__PURE__ */ jsxs("div", { hidden: !open, className: s.list(), children: [
|
|
153
|
+
suggestionsLabel ? /* @__PURE__ */ jsx2("div", { "aria-hidden": true, className: s.group(), children: suggestionsLabel }) : null,
|
|
154
|
+
/* @__PURE__ */ jsx2("div", { id: listbox.listId, role: "listbox", "aria-label": suggestionsLabel ?? label, children: list.map((suggestion, i) => /* @__PURE__ */ jsxs("div", { ...listbox.optionProps(i, false), className: s.option(), children: [
|
|
155
|
+
/* @__PURE__ */ jsx2(SearchGlyph, { className: "h-3.5 w-3.5 shrink-0 text-fg-muted" }),
|
|
156
|
+
/* @__PURE__ */ jsx2("span", { className: "min-w-0 flex-1 truncate", children: suggestion.label }),
|
|
157
|
+
suggestion.meta ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 text-xs text-fg-secondary", children: suggestion.meta }) : null
|
|
158
|
+
] }, suggestion.value)) })
|
|
159
|
+
] })
|
|
160
|
+
] });
|
|
161
|
+
return landmark ? /* @__PURE__ */ jsx2("div", { role: "search", children: field }) : field;
|
|
162
|
+
}
|
|
163
|
+
export {
|
|
164
|
+
SearchField,
|
|
165
|
+
searchField
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=search-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/search-field/search-field.tsx","../src/kbd/kbd.tsx"],"sourcesContent":["// Client. A search input (`type=\"search\"` inside a `role=\"search\"` landmark when it stands alone): a leading glyph,\n// a clear button, a global shortcut that focuses it (⌘K on Apple devices, Ctrl+K elsewhere, shown as `Kbd`), and\n// optional suggestions through the shared combobox engine. `onSearch` is debounced; Enter submits.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { CloseGlyph, SearchGlyph } from \"../glyphs\";\nimport { Kbd } from \"../kbd\";\nimport { useListbox } from \"../listbox\";\nimport { useControllable, useDebouncedCallback } from \"../media\";\n\nexport const searchField = tv({\n slots: {\n root: \"relative w-full\",\n control:\n \"flex h-11 w-full items-center gap-2 rounded-lg border border-border-default bg-surface-2 pl-3 pr-1.5 text-sm text-fg \" +\n \"transition-[border-color,box-shadow] focus-within:border-accent focus-within:ring-2 focus-within:ring-ring\",\n icon: \"h-4 w-4 shrink-0 text-fg-secondary\",\n input:\n \"h-full min-w-0 flex-1 bg-transparent text-sm text-fg outline-hidden placeholder:text-fg-muted \" +\n \"[&::-webkit-search-cancel-button]:appearance-none\",\n clear:\n \"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n shortcut: \"hidden shrink-0 items-center gap-0.5 pr-1 sm:flex\",\n list: \"absolute inset-x-0 top-full z-50 mt-1 max-h-72 overflow-y-auto rounded-lg border border-border-default bg-surface-2 p-1 shadow-lg\",\n option: \"flex cursor-pointer select-none items-center gap-2.5 rounded-md px-2.5 py-2 text-sm text-fg data-[active]:bg-surface-3\",\n group: \"px-2.5 pb-1 pt-2 text-[11px] font-semibold uppercase text-fg-muted\",\n },\n variants: {\n size: { md: {}, sm: { control: \"h-9\", clear: \"h-7 w-7\" } },\n },\n defaultVariants: { size: \"md\" },\n});\n\nexport type SearchSuggestion = {\n /** What `onSuggestionSelect` receives. */\n value: string;\n /** What the person reads. */\n label: string;\n /** A small text on the right (\"Creator\", \"12 videos\"). */\n meta?: string;\n};\n\nexport type SearchFieldProps = Omit<React.ComponentProps<\"input\">, \"value\" | \"defaultValue\" | \"onChange\" | \"onSubmit\" | \"size\" | \"type\"> & {\n /** The accessible name of the input (\"Search videos\"), passed translated. */\n label: string;\n /** The query (controlled). */\n value?: string;\n /** The query at first, uncontrolled. */\n defaultValue?: string;\n /** Called on every key with the query. */\n onValueChange?: (query: string) => void;\n /** Called with the query once typing pauses (`debounce` ms): fetch the results here. */\n onSearch?: (query: string) => void;\n /** The pause, in ms, before `onSearch`. Default 250. */\n debounce?: number;\n /** Called on Enter (no suggestion active) with the query: go to the results page. */\n onSubmit?: (query: string) => void;\n /** The global key that focuses the field with ⌘ / Ctrl (`\"k\"`), or `false` for none. Default `false`. */\n shortcut?: string | false;\n /** Suggestions under the field (recent searches, completions). */\n suggestions?: readonly SearchSuggestion[];\n /** A title above the suggestions (\"Recent searches\"). */\n suggestionsLabel?: string;\n /** Called with a suggestion picked (Enter on it, or a click). */\n onSuggestionSelect?: (suggestion: SearchSuggestion) => void;\n /** The clear button's name (\"Clear search\"), passed translated. */\n clearLabel?: string;\n /** Wraps the field in a `role=\"search\"` landmark (default) — `false` inside a form that already is one. */\n landmark?: boolean;\n /** md (default) · sm. */\n size?: \"md\" | \"sm\";\n};\n\nconst isApple = () => typeof navigator !== \"undefined\" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);\n\n/** A search box: clear, shortcut, debounced search, submit on Enter, suggestions with the keyboard. */\nexport function SearchField({\n label,\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onSearch,\n debounce = 250,\n onSubmit,\n shortcut = false,\n suggestions,\n suggestionsLabel,\n onSuggestionSelect,\n clearLabel = \"Clear search\",\n landmark = true,\n size,\n className,\n placeholder,\n ...props\n}: SearchFieldProps) {\n const s = searchField({ size });\n const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);\n const [open, setOpen] = React.useState(false);\n const [apple, setApple] = React.useState(false);\n const input = React.useRef<HTMLInputElement>(null);\n const search = useDebouncedCallback((query: string) => onSearch?.(query), debounce);\n const list = suggestions ?? [];\n\n const pick = (i: number) => {\n const suggestion = list[i];\n if (!suggestion) return;\n setOpen(false);\n onSuggestionSelect?.(suggestion);\n };\n const listbox = useListbox({ count: list.length, onPick: pick, open: open && list.length > 0, setOpen });\n\n React.useEffect(() => {\n if (!shortcut) return;\n // eslint-disable-next-line react-hooks/set-state-in-effect -- the platform is only known in the browser (no hydration mismatch)\n setApple(isApple());\n const onKey = (event: KeyboardEvent) => {\n if (event.key.toLowerCase() === shortcut.toLowerCase() && (event.metaKey || event.ctrlKey) && !event.altKey) {\n event.preventDefault();\n input.current?.focus();\n input.current?.select();\n }\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [shortcut]);\n\n const change = (query: string) => {\n setValue(query);\n search(query);\n listbox.setActive(-1);\n setOpen(true);\n };\n\n const field = (\n <div className={s.root({ className })} onBlur={(event) => !event.currentTarget.contains(event.relatedTarget as Node | null) && setOpen(false)}>\n <div className={s.control()}>\n <SearchGlyph className={s.icon()} />\n <input\n ref={input}\n type=\"search\"\n aria-label={label}\n enterKeyHint=\"search\"\n autoComplete=\"off\"\n {...(list.length > 0 ? listbox.inputProps : {})}\n value={value}\n placeholder={placeholder}\n className={s.input()}\n onChange={(event) => change(event.target.value)}\n onFocus={() => setOpen(true)}\n onKeyDown={(event) => {\n if (list.length > 0 && listbox.onKeyDown(event)) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n search.cancel();\n onSearch?.(value);\n onSubmit?.(value);\n setOpen(false);\n } else if (event.key === \"Escape\" && value) {\n event.preventDefault();\n change(\"\");\n }\n }}\n {...props}\n />\n {value ? (\n <button\n type=\"button\"\n aria-label={clearLabel}\n className={s.clear()}\n onClick={() => {\n change(\"\");\n input.current?.focus();\n }}\n >\n <CloseGlyph className=\"h-4 w-4\" />\n </button>\n ) : shortcut ? (\n <span className={s.shortcut()} aria-hidden>\n <Kbd size=\"sm\">{apple ? \"⌘\" : \"Ctrl\"}</Kbd>\n <Kbd size=\"sm\">{shortcut.toUpperCase()}</Kbd>\n </span>\n ) : null}\n </div>\n {list.length > 0 && (\n <div hidden={!open} className={s.list()}>\n {suggestionsLabel ? (\n <div aria-hidden className={s.group()}>\n {suggestionsLabel}\n </div>\n ) : null}\n <div id={listbox.listId} role=\"listbox\" aria-label={suggestionsLabel ?? label}>\n {list.map((suggestion, i) => (\n <div key={suggestion.value} {...listbox.optionProps(i, false)} className={s.option()}>\n <SearchGlyph className=\"h-3.5 w-3.5 shrink-0 text-fg-muted\" />\n <span className=\"min-w-0 flex-1 truncate\">{suggestion.label}</span>\n {suggestion.meta ? <span className=\"shrink-0 text-xs text-fg-secondary\">{suggestion.meta}</span> : null}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n );\n return landmark ? <div role=\"search\">{field}</div> : field;\n}\n","// Server-safe. A key, or a shortcut of several (`<Kbd>⌘</Kbd><Kbd>K</Kbd>`).\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const kbdVariants = tv({\n base:\n \"inline-flex shrink-0 items-center justify-center rounded-md border border-border-default border-b-2 bg-surface-2 \" +\n \"font-mono font-semibold text-fg-secondary\",\n variants: { size: { sm: \"h-5 min-w-5 px-1 text-[10px]\", md: \"h-6 min-w-6 px-1.5 text-xs\" } },\n defaultVariants: { size: \"md\" },\n});\n\nexport type KbdProps = React.ComponentProps<\"kbd\"> & {\n /**\n * sm · md.\n * @default \"md\"\n */\n size?: VariantProps<typeof kbdVariants>[\"size\"];\n};\n\nexport function Kbd({ size, className, ...props }: KbdProps) {\n return <kbd className={kbdVariants({ size, className })} {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,MAAAA,WAAU;;;ACFnB,SAAS,UAA6B;AAmB7B;AAjBF,IAAM,cAAc,GAAG;AAAA,EAC5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KAAC,SAAI,IAAI,QAAQ,QAAQ,MAAK,WAAU,cAAY,oBAAoB,OACrE,eAAK,IAAI,CAAC,YAAY,MACrB,qBAAC,SAA4B,GAAG,QAAQ,YAAY,GAAG,KAAK,GAAG,WAAW,EAAE,OAAO,GACjF;AAAA,wBAAAA,KAAC,eAAY,WAAU,sCAAqC;AAAA,QAC5D,gBAAAA,KAAC,UAAK,WAAU,2BAA2B,qBAAW,OAAM;AAAA,QAC3D,WAAW,OAAO,gBAAAA,KAAC,UAAK,WAAU,sCAAsC,qBAAW,MAAK,IAAU;AAAA,WAH3F,WAAW,KAIrB,CACD,GACH;AAAA,OACF;AAAA,KAEJ;AAEF,SAAO,WAAW,gBAAAA,KAAC,SAAI,MAAK,UAAU,iBAAM,IAAS;AACvD;","names":["tv","jsx","tv"]}
|
package/dist/skeleton.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const skeletonVariants: tailwind_variants.TVReturnType<{
|
|
|
8
8
|
circle: "aspect-square h-10 rounded-full";
|
|
9
9
|
rect: "h-24 w-full rounded-lg";
|
|
10
10
|
};
|
|
11
|
-
}, undefined, "block bg-surface-3
|
|
11
|
+
}, undefined, "kz-skeleton block bg-surface-3", {
|
|
12
12
|
shape: {
|
|
13
13
|
text: "h-3 w-full rounded-sm";
|
|
14
14
|
circle: "aspect-square h-10 rounded-full";
|
|
@@ -28,7 +28,22 @@ type SkeletonProps = React.ComponentProps<"span"> & {
|
|
|
28
28
|
*/
|
|
29
29
|
shape?: VariantProps<typeof skeletonVariants>["shape"];
|
|
30
30
|
};
|
|
31
|
-
/** A
|
|
31
|
+
/** A shape the size of what is loading. Announce the wait elsewhere (`LoadingRegion` does it, with `aria-busy`). */
|
|
32
32
|
declare function Skeleton({ shape, className, ...props }: SkeletonProps): React.JSX.Element;
|
|
33
|
+
type SkeletonTextProps = React.ComponentProps<"span"> & {
|
|
34
|
+
/**
|
|
35
|
+
* How many lines.
|
|
36
|
+
* @default 3
|
|
37
|
+
*/
|
|
38
|
+
lines?: number;
|
|
39
|
+
};
|
|
40
|
+
/** A paragraph on its way: `lines` lines, the last one shorter — like text that wraps. */
|
|
41
|
+
declare function SkeletonText({ lines, className, ...props }: SkeletonTextProps): React.JSX.Element;
|
|
42
|
+
type SkeletonShapeProps = React.ComponentProps<"div">;
|
|
43
|
+
/**
|
|
44
|
+
* The skeleton of the real thing: render your component with placeholder data inside, and its text, images and icons
|
|
45
|
+
* become skeleton shapes in place — the exact layout, nothing to draw twice. Inert and hidden from assistive technology.
|
|
46
|
+
*/
|
|
47
|
+
declare function SkeletonShape({ className, children, ...props }: SkeletonShapeProps): React.JSX.Element;
|
|
33
48
|
|
|
34
|
-
export { Skeleton, type SkeletonProps, skeletonVariants };
|
|
49
|
+
export { Skeleton, type SkeletonProps, SkeletonShape, type SkeletonShapeProps, SkeletonText, type SkeletonTextProps, skeletonVariants };
|
package/dist/skeleton.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var skeletonVariants = tv({
|
|
5
|
-
base: "block bg-surface-3
|
|
5
|
+
base: "kz-skeleton block bg-surface-3",
|
|
6
6
|
variants: {
|
|
7
7
|
shape: { text: "h-3 w-full rounded-sm", circle: "aspect-square h-10 rounded-full", rect: "h-24 w-full rounded-lg" }
|
|
8
8
|
},
|
|
@@ -11,8 +11,16 @@ var skeletonVariants = tv({
|
|
|
11
11
|
function Skeleton({ shape, className, ...props }) {
|
|
12
12
|
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, "data-shape": shape ?? "text", className: skeletonVariants({ shape, className }), ...props });
|
|
13
13
|
}
|
|
14
|
+
function SkeletonText({ lines = 3, className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: ["flex w-full flex-col gap-2", className].filter(Boolean).join(" "), ...props, children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx(Skeleton, { className: i === lines - 1 && lines > 1 ? "w-3/5" : void 0 }, i)) });
|
|
16
|
+
}
|
|
17
|
+
function SkeletonShape({ className, children, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx("div", { "aria-hidden": true, inert: true, className: ["kz-skeleton-shape", className].filter(Boolean).join(" "), ...props, children });
|
|
19
|
+
}
|
|
14
20
|
export {
|
|
15
21
|
Skeleton,
|
|
22
|
+
SkeletonShape,
|
|
23
|
+
SkeletonText,
|
|
16
24
|
skeletonVariants
|
|
17
25
|
};
|
|
18
26
|
//# sourceMappingURL=skeleton.js.map
|
package/dist/skeleton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/skeleton/skeleton.tsx"],"sourcesContent":["// Server-safe. A placeholder for content on its way: decorative, so hidden from assistive technology.\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const skeletonVariants = tv({\n base: \"block bg-surface-3
|
|
1
|
+
{"version":3,"sources":["../src/skeleton/skeleton.tsx"],"sourcesContent":["// Server-safe. A placeholder for content on its way: decorative, so hidden from assistive technology. One reflection of\n// the brand light crosses every skeleton of the page together (`background-attachment: fixed`), instead of each one\n// pulsing on its own; under reduced motion they rest, tinted.\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const skeletonVariants = tv({\n base: \"kz-skeleton block bg-surface-3\",\n variants: {\n shape: { text: \"h-3 w-full rounded-sm\", circle: \"aspect-square h-10 rounded-full\", rect: \"h-24 w-full rounded-lg\" },\n },\n defaultVariants: { shape: \"text\" },\n});\n\nexport type SkeletonProps = React.ComponentProps<\"span\"> & {\n /**\n * text (a line) · circle (an avatar; give it a height) · rect (a media; give it a height).\n * @default \"text\"\n */\n shape?: VariantProps<typeof skeletonVariants>[\"shape\"];\n};\n\n/** A shape the size of what is loading. Announce the wait elsewhere (`LoadingRegion` does it, with `aria-busy`). */\nexport function Skeleton({ shape, className, ...props }: SkeletonProps) {\n return <span aria-hidden data-shape={shape ?? \"text\"} className={skeletonVariants({ shape, className })} {...props} />;\n}\n\nexport type SkeletonTextProps = React.ComponentProps<\"span\"> & {\n /**\n * How many lines.\n * @default 3\n */\n lines?: number;\n};\n\n/** A paragraph on its way: `lines` lines, the last one shorter — like text that wraps. */\nexport function SkeletonText({ lines = 3, className, ...props }: SkeletonTextProps) {\n return (\n <span aria-hidden className={[\"flex w-full flex-col gap-2\", className].filter(Boolean).join(\" \")} {...props}>\n {Array.from({ length: lines }, (_, i) => (\n <Skeleton key={i} className={i === lines - 1 && lines > 1 ? \"w-3/5\" : undefined} />\n ))}\n </span>\n );\n}\n\nexport type SkeletonShapeProps = React.ComponentProps<\"div\">;\n\n/**\n * The skeleton of the real thing: render your component with placeholder data inside, and its text, images and icons\n * become skeleton shapes in place — the exact layout, nothing to draw twice. Inert and hidden from assistive technology.\n */\nexport function SkeletonShape({ className, children, ...props }: SkeletonShapeProps) {\n return (\n <div aria-hidden inert className={[\"kz-skeleton-shape\", className].filter(Boolean).join(\" \")} {...props}>\n {children}\n </div>\n );\n}\n"],"mappings":";AAIA,SAAS,UAA6B;AAoB7B;AAlBF,IAAM,mBAAmB,GAAG;AAAA,EACjC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,OAAO,EAAE,MAAM,yBAAyB,QAAQ,mCAAmC,MAAM,yBAAyB;AAAA,EACpH;AAAA,EACA,iBAAiB,EAAE,OAAO,OAAO;AACnC,CAAC;AAWM,SAAS,SAAS,EAAE,OAAO,WAAW,GAAG,MAAM,GAAkB;AACtE,SAAO,oBAAC,UAAK,eAAW,MAAC,cAAY,SAAS,QAAQ,WAAW,iBAAiB,EAAE,OAAO,UAAU,CAAC,GAAI,GAAG,OAAO;AACtH;AAWO,SAAS,aAAa,EAAE,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAsB;AAClF,SACE,oBAAC,UAAK,eAAW,MAAC,WAAW,CAAC,8BAA8B,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAAI,GAAG,OACnG,gBAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MACjC,oBAAC,YAAiB,WAAW,MAAM,QAAQ,KAAK,QAAQ,IAAI,UAAU,UAAvD,CAAkE,CAClF,GACH;AAEJ;AAQO,SAAS,cAAc,EAAE,WAAW,UAAU,GAAG,MAAM,GAAuB;AACnF,SACE,oBAAC,SAAI,eAAW,MAAC,OAAK,MAAC,WAAW,CAAC,qBAAqB,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAAI,GAAG,OAC/F,UACH;AAEJ;","names":[]}
|
package/dist/spinner.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
3
|
import { VariantProps } from 'tailwind-variants';
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
/** What the glyph shows: a wait (with an optional value), or how it ended. */
|
|
6
|
+
type LoaderGlyphState = "loading" | "success" | "error";
|
|
7
|
+
interface LoaderGlyphProps extends Omit<React.ComponentProps<"svg">, "children"> {
|
|
8
|
+
/** loading · success · error. */
|
|
9
|
+
state?: LoaderGlyphState;
|
|
10
|
+
/** Between 0 and 1: a determinate wait, the trace grows to it. Absent: indeterminate. */
|
|
11
|
+
value?: number | null;
|
|
12
|
+
}
|
|
13
|
+
/** The glyph alone (decorative): the Spinner, the Loader and the Button's `loading` draw it. */
|
|
14
|
+
declare function LoaderGlyph({ state, value, ...props }: LoaderGlyphProps): React.JSX.Element;
|
|
4
15
|
|
|
5
16
|
declare const spinnerVariants: tailwind_variants.TVReturnType<{
|
|
6
17
|
size: {
|
|
@@ -8,7 +19,7 @@ declare const spinnerVariants: tailwind_variants.TVReturnType<{
|
|
|
8
19
|
md: "h-6 w-6";
|
|
9
20
|
lg: "h-10 w-10";
|
|
10
21
|
};
|
|
11
|
-
}, undefined, "shrink-0 text-accent
|
|
22
|
+
}, undefined, "shrink-0 text-accent", {
|
|
12
23
|
size: {
|
|
13
24
|
sm: "h-4 w-4";
|
|
14
25
|
md: "h-6 w-6";
|
|
@@ -29,8 +40,13 @@ type SpinnerProps = Omit<React.ComponentProps<"svg">, "children"> & VariantProps
|
|
|
29
40
|
size?: VariantProps<typeof spinnerVariants>["size"];
|
|
30
41
|
/** The accessible name of the wait, e.g. "Loading" — passed translated. */
|
|
31
42
|
label: string;
|
|
43
|
+
/** Between 0 and 1: the trace grows to the value (a determinate wait). Absent: it travels around. */
|
|
44
|
+
value?: number | null;
|
|
32
45
|
};
|
|
33
|
-
/**
|
|
34
|
-
|
|
46
|
+
/**
|
|
47
|
+
* The Krizaka spinner: a hexagon traced by a segment of light around a breathing node, in `currentColor` (the accent by
|
|
48
|
+
* default). `role="status"`, named by `label`. Under prefers-reduced-motion it rests — a segment and the node lit.
|
|
49
|
+
*/
|
|
50
|
+
declare function Spinner({ label, size, value, className, ...props }: SpinnerProps): React.JSX.Element;
|
|
35
51
|
|
|
36
|
-
export { Spinner, type SpinnerProps, spinnerVariants };
|
|
52
|
+
export { LoaderGlyph, type LoaderGlyphProps, type LoaderGlyphState, Spinner, type SpinnerProps, spinnerVariants };
|
package/dist/spinner.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LoaderGlyph
|
|
3
|
+
} from "./chunk-43PTCDTL.js";
|
|
4
|
+
|
|
1
5
|
// src/spinner/spinner.tsx
|
|
2
6
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import { jsx
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
8
|
var spinnerVariants = tv({
|
|
5
|
-
base: "shrink-0 text-accent
|
|
9
|
+
base: "shrink-0 text-accent",
|
|
6
10
|
variants: { size: { sm: "h-4 w-4", md: "h-6 w-6", lg: "h-10 w-10" } },
|
|
7
11
|
defaultVariants: { size: "md" }
|
|
8
12
|
});
|
|
9
|
-
function Spinner({ label, size, className, ...props }) {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
13
|
+
function Spinner({ label, size, value, className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
LoaderGlyph,
|
|
12
16
|
{
|
|
13
17
|
role: "status",
|
|
14
18
|
"aria-label": label,
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
"aria-hidden": void 0,
|
|
20
|
+
value,
|
|
17
21
|
"data-size": size ?? "md",
|
|
18
22
|
className: spinnerVariants({ size, className }),
|
|
19
|
-
...props
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "3" }),
|
|
22
|
-
/* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })
|
|
23
|
-
]
|
|
23
|
+
...props
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
+
LoaderGlyph,
|
|
28
29
|
Spinner,
|
|
29
30
|
spinnerVariants
|
|
30
31
|
};
|
package/dist/spinner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/spinner/spinner.tsx"],"sourcesContent":["// Server-safe. An indeterminate wait:
|
|
1
|
+
{"version":3,"sources":["../src/spinner/spinner.tsx"],"sourcesContent":["// Server-safe. An indeterminate wait: the Krizaka loader glyph (a hexagon traced by light around a node), announced as\n// a status with its `label`. For a wait with a delay, a value, an ETA or an ending, see `@krizaka/ui/loader`.\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { LoaderGlyph } from \"./glyph\";\n\nexport const spinnerVariants = tv({\n base: \"shrink-0 text-accent\",\n variants: { size: { sm: \"h-4 w-4\", md: \"h-6 w-6\", lg: \"h-10 w-10\" } },\n defaultVariants: { size: \"md\" },\n});\n\nexport type SpinnerProps = Omit<React.ComponentProps<\"svg\">, \"children\"> &\n VariantProps<typeof spinnerVariants> & {\n /**\n * sm · md · lg.\n * @default \"md\"\n */\n size?: VariantProps<typeof spinnerVariants>[\"size\"];\n /** The accessible name of the wait, e.g. \"Loading\" — passed translated. */\n label: string;\n /** Between 0 and 1: the trace grows to the value (a determinate wait). Absent: it travels around. */\n value?: number | null;\n };\n\n/**\n * The Krizaka spinner: a hexagon traced by a segment of light around a breathing node, in `currentColor` (the accent by\n * default). `role=\"status\"`, named by `label`. Under prefers-reduced-motion it rests — a segment and the node lit.\n */\nexport function Spinner({ label, size, value, className, ...props }: SpinnerProps) {\n return (\n <LoaderGlyph\n role=\"status\"\n aria-label={label}\n aria-hidden={undefined}\n value={value}\n data-size={size ?? \"md\"}\n className={spinnerVariants({ size, className })}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;AAGA,SAAS,UAA6B;AA6BlC;AAzBG,IAAM,kBAAkB,GAAG;AAAA,EAChC,MAAM;AAAA,EACN,UAAU,EAAE,MAAM,EAAE,IAAI,WAAW,IAAI,WAAW,IAAI,YAAY,EAAE;AAAA,EACpE,iBAAiB,EAAE,MAAM,KAAK;AAChC,CAAC;AAmBM,SAAS,QAAQ,EAAE,OAAO,MAAM,OAAO,WAAW,GAAG,MAAM,GAAiB;AACjF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,eAAa;AAAA,MACb;AAAA,MACA,aAAW,QAAQ;AAAA,MACnB,WAAW,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAAA,MAC7C,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type StepStatus = "done" | "current" | "upcoming" | "error";
|
|
5
|
+
interface Step {
|
|
6
|
+
/** Its name — passed translated. */
|
|
7
|
+
title: string;
|
|
8
|
+
/** One line under it (what happens, a time) — passed translated. */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Where it stands; by default from `current` (before: done, at: current, after: upcoming). */
|
|
11
|
+
status?: StepStatus;
|
|
12
|
+
/** Between 0 and 1 for the current step: its glyph grows to it. */
|
|
13
|
+
value?: number;
|
|
14
|
+
/** Anything under the step while it is current or failed: a progress bar, an action, a detail. */
|
|
15
|
+
content?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare const stepper: tailwind_variants.TVReturnType<{
|
|
18
|
+
orientation: {
|
|
19
|
+
vertical: {
|
|
20
|
+
root: string;
|
|
21
|
+
step: string;
|
|
22
|
+
connector: string;
|
|
23
|
+
body: string;
|
|
24
|
+
};
|
|
25
|
+
horizontal: {
|
|
26
|
+
root: string;
|
|
27
|
+
step: string;
|
|
28
|
+
connector: string;
|
|
29
|
+
body: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
root: string;
|
|
34
|
+
step: string;
|
|
35
|
+
node: string;
|
|
36
|
+
glyph: string;
|
|
37
|
+
connector: string;
|
|
38
|
+
body: string;
|
|
39
|
+
title: string;
|
|
40
|
+
description: string;
|
|
41
|
+
state: string;
|
|
42
|
+
content: string;
|
|
43
|
+
}, undefined, {
|
|
44
|
+
orientation: {
|
|
45
|
+
vertical: {
|
|
46
|
+
root: string;
|
|
47
|
+
step: string;
|
|
48
|
+
connector: string;
|
|
49
|
+
body: string;
|
|
50
|
+
};
|
|
51
|
+
horizontal: {
|
|
52
|
+
root: string;
|
|
53
|
+
step: string;
|
|
54
|
+
connector: string;
|
|
55
|
+
body: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
root: string;
|
|
60
|
+
step: string;
|
|
61
|
+
node: string;
|
|
62
|
+
glyph: string;
|
|
63
|
+
connector: string;
|
|
64
|
+
body: string;
|
|
65
|
+
title: string;
|
|
66
|
+
description: string;
|
|
67
|
+
state: string;
|
|
68
|
+
content: string;
|
|
69
|
+
}, tailwind_variants.TVReturnTypeLike<{
|
|
70
|
+
orientation: {
|
|
71
|
+
vertical: {
|
|
72
|
+
root: string;
|
|
73
|
+
step: string;
|
|
74
|
+
connector: string;
|
|
75
|
+
body: string;
|
|
76
|
+
};
|
|
77
|
+
horizontal: {
|
|
78
|
+
root: string;
|
|
79
|
+
step: string;
|
|
80
|
+
connector: string;
|
|
81
|
+
body: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}, {
|
|
85
|
+
root: string;
|
|
86
|
+
step: string;
|
|
87
|
+
node: string;
|
|
88
|
+
glyph: string;
|
|
89
|
+
connector: string;
|
|
90
|
+
body: string;
|
|
91
|
+
title: string;
|
|
92
|
+
description: string;
|
|
93
|
+
state: string;
|
|
94
|
+
content: string;
|
|
95
|
+
}>>;
|
|
96
|
+
type StepperProps = Omit<React.ComponentProps<"ol">, "children"> & {
|
|
97
|
+
/** The steps, in order. */
|
|
98
|
+
steps: readonly Step[];
|
|
99
|
+
/** The index of the current step: those before it are done, those after it upcoming (a step's own `status` wins). */
|
|
100
|
+
current?: number;
|
|
101
|
+
/** What each state is called, read with every step (“Done”, “In progress”, “Upcoming”, “Failed”) — passed translated. */
|
|
102
|
+
labels: Readonly<Record<StepStatus, string>>;
|
|
103
|
+
/**
|
|
104
|
+
* vertical (a job, a timeline) · horizontal (a short journey, a checkout).
|
|
105
|
+
* @default "vertical"
|
|
106
|
+
*/
|
|
107
|
+
orientation?: "vertical" | "horizontal";
|
|
108
|
+
};
|
|
109
|
+
/** An ordered list of steps: `aria-current="step"` on the current one, each state said in words. */
|
|
110
|
+
declare function Stepper({ steps, current, labels, orientation, className, ...props }: StepperProps): React.JSX.Element;
|
|
111
|
+
|
|
112
|
+
export { type Step, type StepStatus, Stepper, type StepperProps, stepper };
|
package/dist/stepper.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LoaderGlyph
|
|
3
|
+
} from "./chunk-43PTCDTL.js";
|
|
4
|
+
|
|
5
|
+
// src/stepper/stepper.tsx
|
|
6
|
+
import { tv } from "tailwind-variants";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var stepper = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
root: "flex",
|
|
11
|
+
step: "group/step relative flex min-w-0",
|
|
12
|
+
node: "relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-surface-0",
|
|
13
|
+
glyph: "h-6 w-6",
|
|
14
|
+
connector: "absolute bg-border-default after:absolute after:inset-0 after:origin-top-left after:bg-accent after:transition-transform after:duration-700 motion-reduce:after:transition-none",
|
|
15
|
+
body: "min-w-0",
|
|
16
|
+
title: "text-sm font-semibold text-fg group-data-[status=upcoming]/step:text-fg-secondary",
|
|
17
|
+
description: "mt-0.5 text-xs text-fg-secondary",
|
|
18
|
+
state: "sr-only",
|
|
19
|
+
content: "mt-2"
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
orientation: {
|
|
23
|
+
vertical: {
|
|
24
|
+
root: "flex-col",
|
|
25
|
+
step: "gap-3 pb-6 last:pb-0",
|
|
26
|
+
connector: "left-3.5 top-7 bottom-0 w-0.5 -translate-x-1/2 group-last/step:hidden after:scale-y-0 group-data-[status=done]/step:after:scale-y-100",
|
|
27
|
+
body: "pt-1"
|
|
28
|
+
},
|
|
29
|
+
horizontal: {
|
|
30
|
+
root: "flex-row",
|
|
31
|
+
step: "flex-1 flex-col gap-2 pr-3 last:flex-none last:pr-0",
|
|
32
|
+
connector: "left-8 right-1 top-3.5 h-0.5 -translate-y-1/2 group-last/step:hidden after:scale-x-0 group-data-[status=done]/step:after:scale-x-100",
|
|
33
|
+
body: ""
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: { orientation: "vertical" }
|
|
38
|
+
});
|
|
39
|
+
var GLYPH = { done: "success", current: "loading", error: "error", upcoming: null };
|
|
40
|
+
var TONE = { done: "text-accent", current: "text-accent", error: "text-fg-danger", upcoming: "text-border-strong" };
|
|
41
|
+
function Stepper({ steps, current = 0, labels, orientation = "vertical", className, ...props }) {
|
|
42
|
+
const s = stepper({ orientation });
|
|
43
|
+
return /* @__PURE__ */ jsx("ol", { className: s.root({ className }), "data-orientation": orientation, ...props, children: steps.map((step, i) => {
|
|
44
|
+
const status = step.status ?? (i < current ? "done" : i === current ? "current" : "upcoming");
|
|
45
|
+
const glyph = GLYPH[status];
|
|
46
|
+
return /* @__PURE__ */ jsxs("li", { "data-status": status, "aria-current": status === "current" ? "step" : void 0, className: s.step(), children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: s.connector() }),
|
|
48
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: s.node(), children: glyph ? /* @__PURE__ */ jsx(LoaderGlyph, { state: glyph, value: status === "current" ? step.value : void 0, className: [s.glyph(), TONE[status]].join(" ") }) : /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", className: [s.glyph(), TONE[status]].join(" "), children: /* @__PURE__ */ jsx("path", { d: "M12 3 19.79 7.5 19.79 16.5 12 21 4.21 16.5 4.21 7.5Z", stroke: "currentColor", strokeWidth: "2", strokeLinejoin: "round" }) }) }),
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: s.body(), children: [
|
|
50
|
+
/* @__PURE__ */ jsxs("p", { className: s.title(), children: [
|
|
51
|
+
step.title,
|
|
52
|
+
/* @__PURE__ */ jsxs("span", { className: s.state(), children: [
|
|
53
|
+
" \u2014 ",
|
|
54
|
+
labels[status]
|
|
55
|
+
] })
|
|
56
|
+
] }),
|
|
57
|
+
step.description && /* @__PURE__ */ jsx("p", { className: s.description(), children: step.description }),
|
|
58
|
+
step.content && (status === "current" || status === "error") && /* @__PURE__ */ jsx("div", { className: s.content(), children: step.content })
|
|
59
|
+
] })
|
|
60
|
+
] }, i);
|
|
61
|
+
}) });
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
Stepper,
|
|
65
|
+
stepper
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/stepper/stepper.tsx"],"sourcesContent":["// Server-safe. The steps of a journey or a job: an ordered list whose nodes are the Krizaka loader glyph — the current\n// step traces its hexagon (and grows to its `value` when known), a done step draws its check, a failed one its cross —\n// joined by connectors that fill as the journey advances. The state of every step is said in words, not only colour.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { LoaderGlyph } from \"../spinner/glyph\";\n\nexport type StepStatus = \"done\" | \"current\" | \"upcoming\" | \"error\";\n\nexport interface Step {\n /** Its name — passed translated. */\n title: string;\n /** One line under it (what happens, a time) — passed translated. */\n description?: string;\n /** Where it stands; by default from `current` (before: done, at: current, after: upcoming). */\n status?: StepStatus;\n /** Between 0 and 1 for the current step: its glyph grows to it. */\n value?: number;\n /** Anything under the step while it is current or failed: a progress bar, an action, a detail. */\n content?: React.ReactNode;\n}\n\nexport const stepper = tv({\n slots: {\n root: \"flex\",\n step: \"group/step relative flex min-w-0\",\n node: \"relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-surface-0\",\n glyph: \"h-6 w-6\",\n connector: \"absolute bg-border-default after:absolute after:inset-0 after:origin-top-left after:bg-accent after:transition-transform after:duration-700 motion-reduce:after:transition-none\",\n body: \"min-w-0\",\n title: \"text-sm font-semibold text-fg group-data-[status=upcoming]/step:text-fg-secondary\",\n description: \"mt-0.5 text-xs text-fg-secondary\",\n state: \"sr-only\",\n content: \"mt-2\",\n },\n variants: {\n orientation: {\n vertical: {\n root: \"flex-col\",\n step: \"gap-3 pb-6 last:pb-0\",\n connector: \"left-3.5 top-7 bottom-0 w-0.5 -translate-x-1/2 group-last/step:hidden after:scale-y-0 group-data-[status=done]/step:after:scale-y-100\",\n body: \"pt-1\",\n },\n horizontal: {\n root: \"flex-row\",\n step: \"flex-1 flex-col gap-2 pr-3 last:flex-none last:pr-0\",\n connector: \"left-8 right-1 top-3.5 h-0.5 -translate-y-1/2 group-last/step:hidden after:scale-x-0 group-data-[status=done]/step:after:scale-x-100\",\n body: \"\",\n },\n },\n },\n defaultVariants: { orientation: \"vertical\" },\n});\n\nconst GLYPH: Record<StepStatus, \"loading\" | \"success\" | \"error\" | null> = { done: \"success\", current: \"loading\", error: \"error\", upcoming: null };\nconst TONE: Record<StepStatus, string> = { done: \"text-accent\", current: \"text-accent\", error: \"text-fg-danger\", upcoming: \"text-border-strong\" };\n\nexport type StepperProps = Omit<React.ComponentProps<\"ol\">, \"children\"> & {\n /** The steps, in order. */\n steps: readonly Step[];\n /** The index of the current step: those before it are done, those after it upcoming (a step's own `status` wins). */\n current?: number;\n /** What each state is called, read with every step (“Done”, “In progress”, “Upcoming”, “Failed”) — passed translated. */\n labels: Readonly<Record<StepStatus, string>>;\n /**\n * vertical (a job, a timeline) · horizontal (a short journey, a checkout).\n * @default \"vertical\"\n */\n orientation?: \"vertical\" | \"horizontal\";\n};\n\n/** An ordered list of steps: `aria-current=\"step\"` on the current one, each state said in words. */\nexport function Stepper({ steps, current = 0, labels, orientation = \"vertical\", className, ...props }: StepperProps) {\n const s = stepper({ orientation });\n return (\n <ol className={s.root({ className })} data-orientation={orientation} {...props}>\n {steps.map((step, i) => {\n const status: StepStatus = step.status ?? (i < current ? \"done\" : i === current ? \"current\" : \"upcoming\");\n const glyph = GLYPH[status];\n return (\n <li key={i} data-status={status} aria-current={status === \"current\" ? \"step\" : undefined} className={s.step()}>\n <span aria-hidden className={s.connector()} />\n <span aria-hidden className={s.node()}>\n {glyph ? (\n <LoaderGlyph state={glyph} value={status === \"current\" ? step.value : undefined} className={[s.glyph(), TONE[status]].join(\" \")} />\n ) : (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" className={[s.glyph(), TONE[status]].join(\" \")}>\n <path d=\"M12 3 19.79 7.5 19.79 16.5 12 21 4.21 16.5 4.21 7.5Z\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinejoin=\"round\" />\n </svg>\n )}\n </span>\n <div className={s.body()}>\n <p className={s.title()}>\n {step.title}\n <span className={s.state()}> — {labels[status]}</span>\n </p>\n {step.description && <p className={s.description()}>{step.description}</p>}\n {step.content && (status === \"current\" || status === \"error\") && <div className={s.content()}>{step.content}</div>}\n </div>\n </li>\n );\n })}\n </ol>\n );\n}\n"],"mappings":";;;;;AAIA,SAAS,UAAU;AA8EP,cAaI,YAbJ;AA3DL,IAAM,UAAU,GAAG;AAAA,EACxB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAAA,EACA,UAAU;AAAA,IACR,aAAa;AAAA,MACX,UAAU;AAAA,QACR,MAAM;AAAA,QACN,MAAM;AAAA,QACN,WAAW;AAAA,QACX,MAAM;AAAA,MACR;AAAA,MACA,YAAY;AAAA,QACV,MAAM;AAAA,QACN,MAAM;AAAA,QACN,WAAW;AAAA,QACX,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,aAAa,WAAW;AAC7C,CAAC;AAED,IAAM,QAAoE,EAAE,MAAM,WAAW,SAAS,WAAW,OAAO,SAAS,UAAU,KAAK;AAChJ,IAAM,OAAmC,EAAE,MAAM,eAAe,SAAS,eAAe,OAAO,kBAAkB,UAAU,qBAAqB;AAiBzI,SAAS,QAAQ,EAAE,OAAO,UAAU,GAAG,QAAQ,cAAc,YAAY,WAAW,GAAG,MAAM,GAAiB;AACnH,QAAM,IAAI,QAAQ,EAAE,YAAY,CAAC;AACjC,SACE,oBAAC,QAAG,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,oBAAkB,aAAc,GAAG,OACtE,gBAAM,IAAI,CAAC,MAAM,MAAM;AACtB,UAAM,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Change`, `orientation` (horizontal by default), `variant` for the list. */
|
|
73
73
|
declare function TabsRoot({ variant, className, ...props }: TabsRootProps): React.JSX.Element;
|
|
74
|
-
/** The tabs. Name it (`aria-label`) when no heading says what it switches. */
|
|
74
|
+
/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */
|
|
75
75
|
declare function TabsList({ className, ...props }: React.ComponentProps<typeof Tabs$1.List>): React.JSX.Element;
|
|
76
76
|
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): React.JSX.Element;
|
|
77
77
|
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Content>): React.JSX.Element;
|