@krizaka/ui 3.35.0 → 3.37.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/dist/account-menu.js +1 -1
- package/dist/account-menu.js.map +1 -1
- package/dist/activity-feed.js +2 -2
- package/dist/activity-feed.js.map +1 -1
- package/dist/anatomy-plate.d.ts +26 -0
- package/dist/anatomy-plate.js +32 -0
- package/dist/anatomy-plate.js.map +1 -0
- package/dist/app-header.js +1 -1
- package/dist/app-header.js.map +1 -1
- package/dist/app-shell.js +6 -6
- package/dist/app-shell.js.map +1 -1
- package/dist/argument-card.js +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/badge.js +1 -1
- package/dist/badge.js.map +1 -1
- package/dist/bird-plate.d.ts +38 -0
- package/dist/bird-plate.js +39 -0
- package/dist/bird-plate.js.map +1 -0
- package/dist/blocks.css +243 -46
- package/dist/card.d.ts +6 -6
- package/dist/card.js +2 -2
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/chip-row.js +1 -1
- package/dist/chip-row.js.map +1 -1
- package/dist/chip.js +1 -1
- package/dist/chip.js.map +1 -1
- package/dist/{chunk-QDXV544C.js → chunk-4QH6CP2Y.js} +2 -2
- package/dist/chunk-4QH6CP2Y.js.map +1 -0
- package/dist/{chunk-NJFCSVPT.js → chunk-6EAHUURY.js} +2 -2
- package/dist/chunk-6EAHUURY.js.map +1 -0
- package/dist/{chunk-REPTKUJ6.js → chunk-7NRSPHAF.js} +2 -2
- package/dist/chunk-7NRSPHAF.js.map +1 -0
- package/dist/{chunk-CKSHLSDH.js → chunk-AAP3U66V.js} +2 -2
- package/dist/{chunk-7UCPGXKN.js → chunk-C3NF7V5Y.js} +2 -2
- package/dist/{chunk-7UCPGXKN.js.map → chunk-C3NF7V5Y.js.map} +1 -1
- package/dist/chunk-JFJECOZ2.js +338 -0
- package/dist/chunk-JFJECOZ2.js.map +1 -0
- package/dist/{chunk-KIBICUZK.js → chunk-S5LP7KKW.js} +4 -4
- package/dist/{chunk-3S4GHSPZ.js → chunk-VPO27AFS.js} +5 -5
- package/dist/chunk-VPO27AFS.js.map +1 -0
- package/dist/{chunk-2PNLHZLT.js → chunk-WYQ277F2.js} +3 -3
- package/dist/chunk-WYQ277F2.js.map +1 -0
- package/dist/{chunk-7Z4KHPFC.js → chunk-YGIN2YIY.js} +2 -2
- package/dist/{chunk-7Z4KHPFC.js.map → chunk-YGIN2YIY.js.map} +1 -1
- package/dist/{chunk-LZNZLCOE.js → chunk-YKEIOYJ5.js} +20 -6
- package/dist/chunk-YKEIOYJ5.js.map +1 -0
- package/dist/{chunk-2DGLWTPS.js → chunk-YKOLME7R.js} +3 -3
- package/dist/{chunk-2DGLWTPS.js.map → chunk-YKOLME7R.js.map} +1 -1
- package/dist/code-block.js +4 -4
- package/dist/code-block.js.map +1 -1
- package/dist/combobox.js +2 -2
- package/dist/command.js +3 -3
- package/dist/command.js.map +1 -1
- package/dist/comparison-table.js +2 -2
- package/dist/comparison-table.js.map +1 -1
- package/dist/countdown.js +1 -1
- package/dist/countdown.js.map +1 -1
- package/dist/cover-hero.js +15 -6
- package/dist/cover-hero.js.map +1 -1
- package/dist/dashboard-layout.js +1 -1
- package/dist/dashboard-layout.js.map +1 -1
- package/dist/data-table.js +5 -5
- package/dist/date-picker.js +3 -3
- package/dist/date-picker.js.map +1 -1
- package/dist/description-list.js +1 -1
- package/dist/description-list.js.map +1 -1
- package/dist/detail-layout.js +1 -1
- package/dist/detail-layout.js.map +1 -1
- package/dist/dialog.js +1 -1
- package/dist/docs-nav.js +1 -1
- package/dist/docs-nav.js.map +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/file-upload.js +3 -3
- package/dist/file-upload.js.map +1 -1
- package/dist/filter-bar.js +2 -2
- package/dist/footnote.d.ts +32 -0
- package/dist/footnote.js +29 -0
- package/dist/footnote.js.map +1 -0
- package/dist/genui.js +6 -6
- package/dist/geometry-DncHaYP8.d.ts +22 -0
- package/dist/language-switch.js +1 -1
- package/dist/list.js +1 -1
- package/dist/loader.js +2 -2
- package/dist/loader.js.map +1 -1
- package/dist/map.js +95 -83
- package/dist/map.js.map +1 -1
- package/dist/marketing-layout.js +1 -1
- package/dist/marketing-layout.js.map +1 -1
- package/dist/mascot-quote.d.ts +2 -21
- package/dist/mascot-quote.js +9 -338
- package/dist/mascot-quote.js.map +1 -1
- package/dist/match-dialog.js +1 -1
- package/dist/match-dialog.js.map +1 -1
- package/dist/media-grid.js +1 -1
- package/dist/meter.js +3 -3
- package/dist/meter.js.map +1 -1
- package/dist/motion.css +28 -41
- package/dist/native/map.js +94 -82
- package/dist/native/map.js.map +1 -1
- package/dist/native.d.ts +8 -1
- package/dist/native.js +57 -45
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.js +12 -12
- package/dist/nav-bar.js.map +1 -1
- package/dist/page-hero.js +1 -1
- package/dist/page-index.d.ts +30 -0
- package/dist/page-index.js +23 -0
- package/dist/page-index.js.map +1 -0
- package/dist/page.d.ts +19 -7
- package/dist/page.js +1 -1
- package/dist/photo-grid.js +2 -2
- package/dist/photo-grid.js.map +1 -1
- package/dist/progress.js +3 -3
- package/dist/progress.js.map +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/rail-nav.js +2 -2
- package/dist/rail-nav.js.map +1 -1
- package/dist/search-field.js +1 -1
- package/dist/service-card.js +3 -3
- package/dist/service-card.js.map +1 -1
- package/dist/settings-layout.js +1 -1
- package/dist/settings-layout.js.map +1 -1
- package/dist/site-footer.js +3 -3
- package/dist/site-footer.js.map +1 -1
- package/dist/skip-link.js +1 -1
- package/dist/slot-picker.js +1 -1
- package/dist/slot-picker.js.map +1 -1
- package/dist/specimen-tag.d.ts +52 -0
- package/dist/specimen-tag.js +33 -0
- package/dist/specimen-tag.js.map +1 -0
- package/dist/stat.js +1 -1
- package/dist/stat.js.map +1 -1
- package/dist/step-progress.js +1 -1
- package/dist/step-progress.js.map +1 -1
- package/dist/sticky-action.d.ts +1 -1
- package/dist/sticky-action.js +1 -1
- package/dist/sticky-action.js.map +1 -1
- package/dist/swipe-deck.js +1 -1
- package/dist/swipe-deck.js.map +1 -1
- package/dist/tabs.js +4 -4
- package/dist/tabs.js.map +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/tag-selector.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/toast.js.map +1 -1
- package/package.json +74 -4
- package/registry/account-menu.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +2 -2
- package/registry/alert.json +1 -1
- package/registry/anatomy-plate.json +168 -0
- package/registry/app-header.json +2 -2
- 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 +1 -1
- package/registry/badge.json +2 -2
- package/registry/bird-plate.json +221 -0
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +2 -2
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chat.json +3 -3
- package/registry/checkbox.json +2 -2
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +2 -2
- package/registry/chip.json +2 -2
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +2 -2
- package/registry/comparison-table.json +2 -2
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +2 -2
- package/registry/cover-hero.json +2 -2
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +2 -2
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +4 -4
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +2 -2
- package/registry/detail-layout.json +2 -2
- package/registry/dialog.json +2 -2
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +2 -2
- package/registry/document-viewer.json +1 -1
- package/registry/dropdown-menu.json +2 -2
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/action-sheet/native/video-actions.dark.png +0 -0
- package/registry/examples/action-sheet/native/video-actions.light.png +0 -0
- package/registry/examples/activity-feed/native/notifications.dark.png +0 -0
- package/registry/examples/activity-feed/native/notifications.light.png +0 -0
- package/registry/examples/anatomy-plate/button.d.ts +4 -0
- package/registry/examples/anatomy-plate/button.js +25 -0
- package/registry/examples/anatomy-plate/button.tsx +20 -0
- package/registry/examples/avatar/native/group.dark.png +0 -0
- package/registry/examples/avatar/native/group.light.png +0 -0
- package/registry/examples/avatar/native/presence.dark.png +0 -0
- package/registry/examples/avatar/native/presence.light.png +0 -0
- package/registry/examples/avatar/native/sizes.dark.png +0 -0
- package/registry/examples/avatar/native/sizes.light.png +0 -0
- package/registry/examples/badge/native/dot.dark.png +0 -0
- package/registry/examples/badge/native/dot.light.png +0 -0
- package/registry/examples/badge/native/scrim.dark.png +0 -0
- package/registry/examples/badge/native/scrim.light.png +0 -0
- package/registry/examples/badge/native/tones.dark.png +0 -0
- package/registry/examples/badge/native/tones.light.png +0 -0
- package/registry/examples/bird-plate/flock.d.ts +4 -0
- package/registry/examples/bird-plate/flock.js +24 -0
- package/registry/examples/bird-plate/flock.tsx +18 -0
- package/registry/examples/bird-plate/single.d.ts +4 -0
- package/registry/examples/bird-plate/single.js +19 -0
- package/registry/examples/bird-plate/single.tsx +13 -0
- package/registry/examples/button/native/danger.dark.png +0 -0
- package/registry/examples/button/native/danger.light.png +0 -0
- package/registry/examples/button/native/disabled.dark.png +0 -0
- package/registry/examples/button/native/disabled.light.png +0 -0
- package/registry/examples/button/native/ghost.dark.png +0 -0
- package/registry/examples/button/native/ghost.light.png +0 -0
- package/registry/examples/button/native/gradient.dark.png +0 -0
- package/registry/examples/button/native/gradient.light.png +0 -0
- package/registry/examples/button/native/icon-only.dark.png +0 -0
- package/registry/examples/button/native/icon-only.light.png +0 -0
- package/registry/examples/button/native/icon.dark.png +0 -0
- package/registry/examples/button/native/icon.light.png +0 -0
- package/registry/examples/button/native/loading.dark.png +0 -0
- package/registry/examples/button/native/loading.light.png +0 -0
- package/registry/examples/button/native/outline.dark.png +0 -0
- package/registry/examples/button/native/outline.light.png +0 -0
- package/registry/examples/button/native/primary.dark.png +0 -0
- package/registry/examples/button/native/primary.light.png +0 -0
- package/registry/examples/button/native/secondary.dark.png +0 -0
- package/registry/examples/button/native/secondary.light.png +0 -0
- package/registry/examples/button/native/sizes.dark.png +0 -0
- package/registry/examples/button/native/sizes.light.png +0 -0
- package/registry/examples/card/native/body.dark.png +0 -0
- package/registry/examples/card/native/body.light.png +0 -0
- package/registry/examples/card/native/default.dark.png +0 -0
- package/registry/examples/card/native/default.light.png +0 -0
- package/registry/examples/card/native/elevated.dark.png +0 -0
- package/registry/examples/card/native/elevated.light.png +0 -0
- package/registry/examples/card/native/pressable.dark.png +0 -0
- package/registry/examples/card/native/pressable.light.png +0 -0
- package/registry/examples/chat/native/assistant.dark.png +0 -0
- package/registry/examples/chat/native/assistant.light.png +0 -0
- package/registry/examples/chat/native/conversation.dark.png +0 -0
- package/registry/examples/chat/native/conversation.light.png +0 -0
- package/registry/examples/chat/native/inbox.dark.png +0 -0
- package/registry/examples/chat/native/inbox.light.png +0 -0
- package/registry/examples/checkbox/native/terms.dark.png +0 -0
- package/registry/examples/checkbox/native/terms.light.png +0 -0
- package/registry/examples/chip/native/multiple.dark.png +0 -0
- package/registry/examples/chip/native/multiple.light.png +0 -0
- package/registry/examples/chip/native/removable.dark.png +0 -0
- package/registry/examples/chip/native/removable.light.png +0 -0
- package/registry/examples/chip/native/single.dark.png +0 -0
- package/registry/examples/chip/native/single.light.png +0 -0
- package/registry/examples/chip/native/toggle.dark.png +0 -0
- package/registry/examples/chip/native/toggle.light.png +0 -0
- package/registry/examples/combobox/native/multiple.dark.png +0 -0
- package/registry/examples/combobox/native/multiple.light.png +0 -0
- package/registry/examples/combobox/native/search.dark.png +0 -0
- package/registry/examples/combobox/native/search.light.png +0 -0
- package/registry/examples/countdown/native/days.dark.png +0 -0
- package/registry/examples/countdown/native/days.light.png +0 -0
- package/registry/examples/countdown/native/hours.dark.png +0 -0
- package/registry/examples/countdown/native/hours.light.png +0 -0
- package/registry/examples/countdown/native/sizes.dark.png +0 -0
- package/registry/examples/countdown/native/sizes.light.png +0 -0
- package/registry/examples/countdown/native/urgent.dark.png +0 -0
- package/registry/examples/countdown/native/urgent.light.png +0 -0
- package/registry/examples/countdown/native/with-label.dark.png +0 -0
- package/registry/examples/countdown/native/with-label.light.png +0 -0
- package/registry/examples/date-picker/native/birth-date-wheel.dark.png +0 -0
- package/registry/examples/date-picker/native/birth-date-wheel.light.png +0 -0
- package/registry/examples/date-picker/native/birth-date.dark.png +0 -0
- package/registry/examples/date-picker/native/birth-date.light.png +0 -0
- package/registry/examples/date-picker/native/calendar.dark.png +0 -0
- package/registry/examples/date-picker/native/calendar.light.png +0 -0
- package/registry/examples/date-picker/native/day-strip.dark.png +0 -0
- package/registry/examples/date-picker/native/day-strip.light.png +0 -0
- package/registry/examples/date-picker/native/month-year.dark.png +0 -0
- package/registry/examples/date-picker/native/month-year.light.png +0 -0
- package/registry/examples/date-picker/native/time-slots.dark.png +0 -0
- package/registry/examples/date-picker/native/time-slots.light.png +0 -0
- package/registry/examples/date-picker/native/time-wheel.dark.png +0 -0
- package/registry/examples/date-picker/native/time-wheel.light.png +0 -0
- package/registry/examples/description-list/native/job-details.dark.png +0 -0
- package/registry/examples/description-list/native/job-details.light.png +0 -0
- package/registry/examples/dialog/native/sheet.dark.png +0 -0
- package/registry/examples/dialog/native/sheet.light.png +0 -0
- package/registry/examples/empty-state/native/default.dark.png +0 -0
- package/registry/examples/empty-state/native/default.light.png +0 -0
- package/registry/examples/fab/native/extended.dark.png +0 -0
- package/registry/examples/fab/native/extended.light.png +0 -0
- package/registry/examples/field/native/default.dark.png +0 -0
- package/registry/examples/field/native/default.light.png +0 -0
- package/registry/examples/field/native/select.dark.png +0 -0
- package/registry/examples/field/native/select.light.png +0 -0
- package/registry/examples/footnote/notes.d.ts +4 -0
- package/registry/examples/footnote/notes.js +24 -0
- package/registry/examples/footnote/notes.tsx +19 -0
- package/registry/examples/force-update-screen/native/default.dark.png +0 -0
- package/registry/examples/force-update-screen/native/default.light.png +0 -0
- package/registry/examples/form/native/amount.dark.png +0 -0
- package/registry/examples/form/native/amount.light.png +0 -0
- package/registry/examples/form/native/audience.dark.png +0 -0
- package/registry/examples/form/native/audience.light.png +0 -0
- package/registry/examples/form/native/profile.dark.png +0 -0
- package/registry/examples/form/native/profile.light.png +0 -0
- package/registry/examples/form/native/settings.dark.png +0 -0
- package/registry/examples/form/native/settings.light.png +0 -0
- package/registry/examples/form/native/sign-up.dark.png +0 -0
- package/registry/examples/form/native/sign-up.light.png +0 -0
- package/registry/examples/form/native/upload.dark.png +0 -0
- package/registry/examples/form/native/upload.light.png +0 -0
- package/registry/examples/goal-gauge/native/default.dark.png +0 -0
- package/registry/examples/goal-gauge/native/default.light.png +0 -0
- package/registry/examples/header/native/large-title.dark.png +0 -0
- package/registry/examples/header/native/large-title.light.png +0 -0
- package/registry/examples/image-viewer/native/gallery.dark.png +0 -0
- package/registry/examples/image-viewer/native/gallery.light.png +0 -0
- package/registry/examples/list/native/default.dark.png +0 -0
- package/registry/examples/list/native/default.light.png +0 -0
- package/registry/examples/list/native/infinite.dark.png +0 -0
- package/registry/examples/list/native/infinite.light.png +0 -0
- package/registry/examples/list/native/states.dark.png +0 -0
- package/registry/examples/list/native/states.light.png +0 -0
- package/registry/examples/loader/native/block.dark.png +0 -0
- package/registry/examples/loader/native/block.light.png +0 -0
- package/registry/examples/loader/native/branded.dark.png +0 -0
- package/registry/examples/loader/native/branded.light.png +0 -0
- package/registry/examples/loader/native/job-wait.dark.png +0 -0
- package/registry/examples/loader/native/job-wait.light.png +0 -0
- package/registry/examples/maintenance-screen/native/default.dark.png +0 -0
- package/registry/examples/maintenance-screen/native/default.light.png +0 -0
- package/registry/examples/map/native/location-picker.dark.png +0 -0
- package/registry/examples/map/native/location-picker.light.png +0 -0
- package/registry/examples/map/native/places.dark.png +0 -0
- package/registry/examples/map/native/places.light.png +0 -0
- package/registry/examples/markdown/native/ai-stream.dark.png +0 -0
- package/registry/examples/markdown/native/ai-stream.light.png +0 -0
- package/registry/examples/markdown/native/basic.dark.png +0 -0
- package/registry/examples/markdown/native/basic.light.png +0 -0
- package/registry/examples/mascot-state/native/default.dark.png +0 -0
- package/registry/examples/mascot-state/native/default.light.png +0 -0
- package/registry/examples/mascots/native/crane.dark.png +0 -0
- package/registry/examples/mascots/native/crane.light.png +0 -0
- package/registry/examples/mascots/native/default.dark.png +0 -0
- package/registry/examples/mascots/native/default.light.png +0 -0
- package/registry/examples/mascots/native/lovebird.dark.png +0 -0
- package/registry/examples/mascots/native/lovebird.light.png +0 -0
- package/registry/examples/mascots/native/phoenix.dark.png +0 -0
- package/registry/examples/mascots/native/phoenix.light.png +0 -0
- package/registry/examples/match-dialog/native/its-a-match.dark.png +0 -0
- package/registry/examples/match-dialog/native/its-a-match.light.png +0 -0
- package/registry/examples/media-capture/native/photo.dark.png +0 -0
- package/registry/examples/media-capture/native/photo.light.png +0 -0
- package/registry/examples/media-picker/native/story.dark.png +0 -0
- package/registry/examples/media-picker/native/story.light.png +0 -0
- package/registry/examples/meta-row/native/video.dark.png +0 -0
- package/registry/examples/meta-row/native/video.light.png +0 -0
- package/registry/examples/meter/native/credits.dark.png +0 -0
- package/registry/examples/meter/native/credits.light.png +0 -0
- package/registry/examples/meter/native/split-ring.dark.png +0 -0
- package/registry/examples/meter/native/split-ring.light.png +0 -0
- package/registry/examples/number-ticker/native/balance.dark.png +0 -0
- package/registry/examples/number-ticker/native/balance.light.png +0 -0
- package/registry/examples/onboarding/native/first-launch.dark.png +0 -0
- package/registry/examples/onboarding/native/first-launch.light.png +0 -0
- package/registry/examples/otp-input/native/invalid.dark.png +0 -0
- package/registry/examples/otp-input/native/invalid.light.png +0 -0
- package/registry/examples/otp-input/native/verify.dark.png +0 -0
- package/registry/examples/otp-input/native/verify.light.png +0 -0
- package/registry/examples/page-index/docs.d.ts +4 -0
- package/registry/examples/page-index/docs.js +33 -0
- package/registry/examples/page-index/docs.tsx +27 -0
- package/registry/examples/pagination/native/cursor.dark.png +0 -0
- package/registry/examples/pagination/native/cursor.light.png +0 -0
- package/registry/examples/pagination/native/pages.dark.png +0 -0
- package/registry/examples/pagination/native/pages.light.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.dark.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.light.png +0 -0
- package/registry/examples/permission-prompt/native/camera.dark.png +0 -0
- package/registry/examples/permission-prompt/native/camera.light.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
- package/registry/examples/profile-card/native/default.dark.png +0 -0
- package/registry/examples/profile-card/native/default.light.png +0 -0
- package/registry/examples/progress/native/bar.dark.png +0 -0
- package/registry/examples/progress/native/bar.light.png +0 -0
- package/registry/examples/progress/native/indeterminate.dark.png +0 -0
- package/registry/examples/progress/native/indeterminate.light.png +0 -0
- package/registry/examples/progress/native/ring.dark.png +0 -0
- package/registry/examples/progress/native/ring.light.png +0 -0
- package/registry/examples/pull-to-refresh/native/branded.dark.png +0 -0
- package/registry/examples/pull-to-refresh/native/branded.light.png +0 -0
- package/registry/examples/pull-to-refresh/native/feed.dark.png +0 -0
- package/registry/examples/pull-to-refresh/native/feed.light.png +0 -0
- package/registry/examples/radio-group/native/buttons.dark.png +0 -0
- package/registry/examples/radio-group/native/buttons.light.png +0 -0
- package/registry/examples/radio-group/native/cards.dark.png +0 -0
- package/registry/examples/radio-group/native/cards.light.png +0 -0
- package/registry/examples/radio-group/native/list.dark.png +0 -0
- package/registry/examples/radio-group/native/list.light.png +0 -0
- package/registry/examples/radio-group/native/segmented.dark.png +0 -0
- package/registry/examples/radio-group/native/segmented.light.png +0 -0
- package/registry/examples/screen/native/app-shell.dark.png +0 -0
- package/registry/examples/screen/native/app-shell.light.png +0 -0
- package/registry/examples/screen/native/auth.dark.png +0 -0
- package/registry/examples/screen/native/auth.light.png +0 -0
- package/registry/examples/screen/native/chat.dark.png +0 -0
- package/registry/examples/screen/native/chat.light.png +0 -0
- package/registry/examples/screen/native/feed.dark.png +0 -0
- package/registry/examples/screen/native/feed.light.png +0 -0
- package/registry/examples/screen/native/map.dark.png +0 -0
- package/registry/examples/screen/native/map.light.png +0 -0
- package/registry/examples/screen/native/notifications.dark.png +0 -0
- package/registry/examples/screen/native/notifications.light.png +0 -0
- package/registry/examples/screen/native/profile.dark.png +0 -0
- package/registry/examples/screen/native/profile.light.png +0 -0
- package/registry/examples/screen/native/settings.dark.png +0 -0
- package/registry/examples/screen/native/settings.light.png +0 -0
- package/registry/examples/search-field/native/cancel.dark.png +0 -0
- package/registry/examples/search-field/native/cancel.light.png +0 -0
- package/registry/examples/search-field/native/default.dark.png +0 -0
- package/registry/examples/search-field/native/default.light.png +0 -0
- package/registry/examples/segmented/native/default.dark.png +0 -0
- package/registry/examples/segmented/native/default.light.png +0 -0
- package/registry/examples/segmented/native/small.dark.png +0 -0
- package/registry/examples/segmented/native/small.light.png +0 -0
- package/registry/examples/settings-layout/native/account.dark.png +0 -0
- package/registry/examples/settings-layout/native/account.light.png +0 -0
- package/registry/examples/showcase/native/slides.dark.png +0 -0
- package/registry/examples/showcase/native/slides.light.png +0 -0
- package/registry/examples/skeleton/native/shapes.dark.png +0 -0
- package/registry/examples/skeleton/native/shapes.light.png +0 -0
- package/registry/examples/slider/native/default.dark.png +0 -0
- package/registry/examples/slider/native/default.light.png +0 -0
- package/registry/examples/slider/native/range.dark.png +0 -0
- package/registry/examples/slider/native/range.light.png +0 -0
- package/registry/examples/slider/native/stepped.dark.png +0 -0
- package/registry/examples/slider/native/stepped.light.png +0 -0
- package/registry/examples/slider/native/vertical.dark.png +0 -0
- package/registry/examples/slider/native/vertical.light.png +0 -0
- package/registry/examples/specimen-tag/product.d.ts +4 -0
- package/registry/examples/specimen-tag/product.js +28 -0
- package/registry/examples/specimen-tag/product.tsx +25 -0
- package/registry/examples/specimen-tag/stamps.d.ts +4 -0
- package/registry/examples/specimen-tag/stamps.js +16 -0
- package/registry/examples/specimen-tag/stamps.tsx +13 -0
- package/registry/examples/specimen-tag/wire.d.ts +4 -0
- package/registry/examples/specimen-tag/wire.js +16 -0
- package/registry/examples/specimen-tag/wire.tsx +20 -0
- package/registry/examples/spinner/native/sizes.dark.png +0 -0
- package/registry/examples/spinner/native/sizes.light.png +0 -0
- package/registry/examples/splash-handoff/native/default.dark.png +0 -0
- package/registry/examples/splash-handoff/native/default.light.png +0 -0
- package/registry/examples/step-progress/native/sign-up.dark.png +0 -0
- package/registry/examples/step-progress/native/sign-up.light.png +0 -0
- package/registry/examples/stepper/native/run.dark.png +0 -0
- package/registry/examples/stepper/native/run.light.png +0 -0
- package/registry/examples/swipe-deck/native/discover.dark.png +0 -0
- package/registry/examples/swipe-deck/native/discover.light.png +0 -0
- package/registry/examples/swipeable-row/native/conversation.dark.png +0 -0
- package/registry/examples/swipeable-row/native/conversation.light.png +0 -0
- package/registry/examples/switch/native/default.dark.png +0 -0
- package/registry/examples/switch/native/default.light.png +0 -0
- package/registry/examples/switch/native/settings.dark.png +0 -0
- package/registry/examples/switch/native/settings.light.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.dark.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.light.png +0 -0
- package/registry/examples/tabs/native/sections.dark.png +0 -0
- package/registry/examples/tabs/native/sections.light.png +0 -0
- package/registry/examples/tabs/native/segmented.dark.png +0 -0
- package/registry/examples/tabs/native/segmented.light.png +0 -0
- package/registry/examples/tag-selector/native/interests.dark.png +0 -0
- package/registry/examples/tag-selector/native/interests.light.png +0 -0
- package/registry/examples/toast/native/notification.dark.png +0 -0
- package/registry/examples/toast/native/notification.light.png +0 -0
- package/registry/examples/toast/native/snackbar.dark.png +0 -0
- package/registry/examples/toast/native/snackbar.light.png +0 -0
- package/registry/examples/toast/native/tones.dark.png +0 -0
- package/registry/examples/toast/native/tones.light.png +0 -0
- package/registry/examples/txt/native/tones.dark.png +0 -0
- package/registry/examples/txt/native/tones.light.png +0 -0
- package/registry/examples/txt/native/variants.dark.png +0 -0
- package/registry/examples/txt/native/variants.light.png +0 -0
- package/registry/examples/update-prompt/native/default.dark.png +0 -0
- package/registry/examples/update-prompt/native/default.light.png +0 -0
- package/registry/examples/verified-badge/native/verified.dark.png +0 -0
- package/registry/examples/verified-badge/native/verified.light.png +0 -0
- package/registry/examples/vertical-video/native/rail.dark.png +0 -0
- package/registry/examples/vertical-video/native/rail.light.png +0 -0
- package/registry/examples/video-player/native/default.dark.png +0 -0
- package/registry/examples/video-player/native/default.light.png +0 -0
- package/registry/examples/waveform/native/card.dark.png +0 -0
- package/registry/examples/waveform/native/card.light.png +0 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/footnote.json +220 -0
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +3 -3
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +160 -5
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +2 -2
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +2 -2
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +3 -3
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +2 -2
- package/registry/nav-bar.json +3 -3
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +168 -0
- package/registry/page.json +89 -5
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +2 -2
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +2 -2
- package/registry/promise-card.json +1 -1
- package/registry/radio-group.json +2 -2
- package/registry/rail-nav.json +3 -3
- package/registry/recipes.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +2 -2
- package/registry/settings-layout.json +2 -2
- package/registry/showcase.json +1 -1
- package/registry/site-footer.json +3 -3
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +2 -2
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +2 -2
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +269 -0
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +2 -2
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +2 -2
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +2 -2
- package/registry/swipe-deck.json +2 -2
- package/registry/switch.json +1 -1
- package/registry/tabs.json +2 -2
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +2 -2
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/waveform.json +1 -1
- package/dist/chunk-2PNLHZLT.js.map +0 -1
- package/dist/chunk-3S4GHSPZ.js.map +0 -1
- package/dist/chunk-LZNZLCOE.js.map +0 -1
- package/dist/chunk-NJFCSVPT.js.map +0 -1
- package/dist/chunk-QDXV544C.js.map +0 -1
- package/dist/chunk-REPTKUJ6.js.map +0 -1
- /package/dist/{chunk-CKSHLSDH.js.map → chunk-AAP3U66V.js.map} +0 -0
- /package/dist/{chunk-KIBICUZK.js.map → chunk-S5LP7KKW.js.map} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type StampTone = "ok" | "wip" | "construction" | "neutral";
|
|
4
|
+
type StampProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
5
|
+
/**
|
|
6
|
+
* `ok` — released or usable today (green ink); `wip` — in development (pencil); `construction` — not open yet (the
|
|
7
|
+
* margin's red); `neutral` — a fact.
|
|
8
|
+
* @default "neutral"
|
|
9
|
+
*/
|
|
10
|
+
tone?: StampTone;
|
|
11
|
+
};
|
|
12
|
+
/** A rubber stamp: a short status pressed on a tag or a page, double-ruled, slightly askew. */
|
|
13
|
+
declare function Stamp({ tone, className, ...props }: StampProps): React.JSX.Element;
|
|
14
|
+
interface SpecimenField {
|
|
15
|
+
/** The field's name, typed in lower case: `seen on`, `since`. */
|
|
16
|
+
label: React.ReactNode;
|
|
17
|
+
/** Its value: `web · iOS · Android`, `3.34.0`. */
|
|
18
|
+
value: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
type SpecimenTagProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
21
|
+
/** The catalogue number, typed at the top: `KZ-02`, `No. 042`. */
|
|
22
|
+
code?: React.ReactNode;
|
|
23
|
+
/** What the tag labels: a product's name, a component's. Set in the display face. */
|
|
24
|
+
title?: React.ReactNode;
|
|
25
|
+
/** The element of the title (`h3` in a grid of tags under a section's `h2`). @default "h3" */
|
|
26
|
+
titleAs?: "h2" | "h3" | "h4" | "p" | "span";
|
|
27
|
+
/** Beside the title: a product's mark, a bird (decorative). */
|
|
28
|
+
mark?: React.ReactNode;
|
|
29
|
+
/** The status, stamped: `{ label: "In development", tone: "wip" }`. */
|
|
30
|
+
status?: {
|
|
31
|
+
label: React.ReactNode;
|
|
32
|
+
tone?: StampTone;
|
|
33
|
+
};
|
|
34
|
+
/** The record: a label and a value per line, typed. */
|
|
35
|
+
fields?: readonly SpecimenField[];
|
|
36
|
+
/** What the tag says beyond its fields: one or two sentences. */
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
/** The foot of the tag: links (the site, the source), a note. */
|
|
39
|
+
footer?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* `hang` — the tag hangs from a string (a row of tags on one wire); `pin` — pinned flat, no string.
|
|
42
|
+
* @default "pin"
|
|
43
|
+
*/
|
|
44
|
+
mount?: "hang" | "pin";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* A specimen tag: the eyelet, a typed number, a name, a stamp, the record's fields, a sentence and a foot — the status
|
|
48
|
+
* and meta of a product or a component, labelled the way a field guide labels what it saw.
|
|
49
|
+
*/
|
|
50
|
+
declare function SpecimenTag({ code, title, titleAs: Title, mark, status, fields, children, footer, mount, className, ...props }: SpecimenTagProps): React.JSX.Element;
|
|
51
|
+
|
|
52
|
+
export { type SpecimenField, SpecimenTag, type SpecimenTagProps, Stamp, type StampProps, type StampTone };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-W675RFOA.js";
|
|
4
|
+
|
|
5
|
+
// src/specimen-tag/specimen-tag.tsx
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function Stamp({ tone = "neutral", className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("span", { className: cn("kz-stamp", className), "data-tone": tone, ...props });
|
|
9
|
+
}
|
|
10
|
+
function SpecimenTag({ code, title, titleAs: Title = "h3", mark, status, fields, children, footer, mount = "pin", className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("article", { className: cn("kz-tag", className), "data-mount": mount, ...props, children: [
|
|
12
|
+
/* @__PURE__ */ jsx("span", { className: "kz-tag-eyelet", "aria-hidden": true }),
|
|
13
|
+
(code || status) && /* @__PURE__ */ jsxs("div", { className: "kz-tag-head", children: [
|
|
14
|
+
code && /* @__PURE__ */ jsx("span", { className: "kz-tag-code", children: code }),
|
|
15
|
+
status && /* @__PURE__ */ jsx(Stamp, { tone: status.tone, children: status.label })
|
|
16
|
+
] }),
|
|
17
|
+
title && /* @__PURE__ */ jsxs(Title, { className: "kz-tag-title", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("span", { children: title }),
|
|
19
|
+
mark && /* @__PURE__ */ jsx("span", { className: "kz-tag-mark", "aria-hidden": true, children: mark })
|
|
20
|
+
] }),
|
|
21
|
+
children && /* @__PURE__ */ jsx("div", { className: "kz-tag-body", children }),
|
|
22
|
+
fields && fields.length > 0 && /* @__PURE__ */ jsx("dl", { className: "kz-tag-fields", children: fields.map((f, i) => /* @__PURE__ */ jsxs("div", { children: [
|
|
23
|
+
/* @__PURE__ */ jsx("dt", { children: f.label }),
|
|
24
|
+
/* @__PURE__ */ jsx("dd", { children: f.value })
|
|
25
|
+
] }, i)) }),
|
|
26
|
+
footer && /* @__PURE__ */ jsx("div", { className: "kz-tag-foot", children: footer })
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
SpecimenTag,
|
|
31
|
+
Stamp
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=specimen-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/specimen-tag/specimen-tag.tsx"],"sourcesContent":["// Server-safe. The specimen tag of the Cahier (ADR-004, blocks.css): a manila tag with an eyelet, a typed catalogue\n// number, a name, a stamp for the status and the fields of a record — the way a naturalist labels what was observed.\n// It carries a product's or a component's status and meta; the stamp says the truth (`ok`, `wip`, `construction`).\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type StampTone = \"ok\" | \"wip\" | \"construction\" | \"neutral\";\n\nexport type StampProps = React.HTMLAttributes<HTMLSpanElement> & {\n /**\n * `ok` — released or usable today (green ink); `wip` — in development (pencil); `construction` — not open yet (the\n * margin's red); `neutral` — a fact.\n * @default \"neutral\"\n */\n tone?: StampTone;\n};\n\n/** A rubber stamp: a short status pressed on a tag or a page, double-ruled, slightly askew. */\nexport function Stamp({ tone = \"neutral\", className, ...props }: StampProps) {\n return <span className={cn(\"kz-stamp\", className)} data-tone={tone} {...props} />;\n}\n\nexport interface SpecimenField {\n /** The field's name, typed in lower case: `seen on`, `since`. */\n label: React.ReactNode;\n /** Its value: `web · iOS · Android`, `3.34.0`. */\n value: React.ReactNode;\n}\n\nexport type SpecimenTagProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The catalogue number, typed at the top: `KZ-02`, `No. 042`. */\n code?: React.ReactNode;\n /** What the tag labels: a product's name, a component's. Set in the display face. */\n title?: React.ReactNode;\n /** The element of the title (`h3` in a grid of tags under a section's `h2`). @default \"h3\" */\n titleAs?: \"h2\" | \"h3\" | \"h4\" | \"p\" | \"span\";\n /** Beside the title: a product's mark, a bird (decorative). */\n mark?: React.ReactNode;\n /** The status, stamped: `{ label: \"In development\", tone: \"wip\" }`. */\n status?: { label: React.ReactNode; tone?: StampTone };\n /** The record: a label and a value per line, typed. */\n fields?: readonly SpecimenField[];\n /** What the tag says beyond its fields: one or two sentences. */\n children?: React.ReactNode;\n /** The foot of the tag: links (the site, the source), a note. */\n footer?: React.ReactNode;\n /**\n * `hang` — the tag hangs from a string (a row of tags on one wire); `pin` — pinned flat, no string.\n * @default \"pin\"\n */\n mount?: \"hang\" | \"pin\";\n};\n\n/**\n * A specimen tag: the eyelet, a typed number, a name, a stamp, the record's fields, a sentence and a foot — the status\n * and meta of a product or a component, labelled the way a field guide labels what it saw.\n */\nexport function SpecimenTag({ code, title, titleAs: Title = \"h3\", mark, status, fields, children, footer, mount = \"pin\", className, ...props }: SpecimenTagProps) {\n return (\n <article className={cn(\"kz-tag\", className)} data-mount={mount} {...props}>\n <span className=\"kz-tag-eyelet\" aria-hidden />\n {(code || status) && (\n <div className=\"kz-tag-head\">\n {code && <span className=\"kz-tag-code\">{code}</span>}\n {status && <Stamp tone={status.tone}>{status.label}</Stamp>}\n </div>\n )}\n {title && (\n <Title className=\"kz-tag-title\">\n <span>{title}</span>\n {mark && <span className=\"kz-tag-mark\" aria-hidden>{mark}</span>}\n </Title>\n )}\n {children && <div className=\"kz-tag-body\">{children}</div>}\n {fields && fields.length > 0 && (\n <dl className=\"kz-tag-fields\">\n {fields.map((f, i) => (\n <div key={i}>\n <dt>{f.label}</dt>\n <dd>{f.value}</dd>\n </div>\n ))}\n </dl>\n )}\n {footer && <div className=\"kz-tag-foot\">{footer}</div>}\n </article>\n );\n}\n"],"mappings":";;;;;AAoBS,cA2CD,YA3CC;AADF,SAAS,MAAM,EAAE,OAAO,WAAW,WAAW,GAAG,MAAM,GAAe;AAC3E,SAAO,oBAAC,UAAK,WAAW,GAAG,YAAY,SAAS,GAAG,aAAW,MAAO,GAAG,OAAO;AACjF;AAqCO,SAAS,YAAY,EAAE,MAAM,OAAO,SAAS,QAAQ,MAAM,MAAM,QAAQ,QAAQ,UAAU,QAAQ,QAAQ,OAAO,WAAW,GAAG,MAAM,GAAqB;AAChK,SACE,qBAAC,aAAQ,WAAW,GAAG,UAAU,SAAS,GAAG,cAAY,OAAQ,GAAG,OAClE;AAAA,wBAAC,UAAK,WAAU,iBAAgB,eAAW,MAAC;AAAA,KAC1C,QAAQ,WACR,qBAAC,SAAI,WAAU,eACZ;AAAA,cAAQ,oBAAC,UAAK,WAAU,eAAe,gBAAK;AAAA,MAC5C,UAAU,oBAAC,SAAM,MAAM,OAAO,MAAO,iBAAO,OAAM;AAAA,OACrD;AAAA,IAED,SACC,qBAAC,SAAM,WAAU,gBACf;AAAA,0BAAC,UAAM,iBAAM;AAAA,MACZ,QAAQ,oBAAC,UAAK,WAAU,eAAc,eAAW,MAAE,gBAAK;AAAA,OAC3D;AAAA,IAED,YAAY,oBAAC,SAAI,WAAU,eAAe,UAAS;AAAA,IACnD,UAAU,OAAO,SAAS,KACzB,oBAAC,QAAG,WAAU,iBACX,iBAAO,IAAI,CAAC,GAAG,MACd,qBAAC,SACC;AAAA,0BAAC,QAAI,YAAE,OAAM;AAAA,MACb,oBAAC,QAAI,YAAE,OAAM;AAAA,SAFL,CAGV,CACD,GACH;AAAA,IAED,UAAU,oBAAC,SAAI,WAAU,eAAe,kBAAO;AAAA,KAClD;AAEJ;","names":[]}
|
package/dist/stat.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
var stat = tv({
|
|
5
5
|
slots: {
|
|
6
6
|
root: "flex min-w-0 flex-col gap-1",
|
|
7
|
-
label: "text-xs font-semibold
|
|
7
|
+
label: "text-xs font-semibold text-fg-secondary",
|
|
8
8
|
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
|
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
|
|
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,MAA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A,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":[]}
|
package/dist/step-progress.js
CHANGED
|
@@ -5,7 +5,7 @@ function StepProgress({ step, total, label, back, trailing, className }) {
|
|
|
5
5
|
return /* @__PURE__ */ jsxs("div", { className: ["flex flex-col gap-1.5", className].filter(Boolean).join(" "), children: [
|
|
6
6
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
7
7
|
/* @__PURE__ */ jsx("div", { className: "flex min-w-10 justify-start", children: back }),
|
|
8
|
-
/* @__PURE__ */ jsx("div", { role: "progressbar", "aria-label": words, "aria-valuemin": 1, "aria-valuemax": total, "aria-valuenow": step, "aria-valuetext": words, className: "flex flex-1 gap-1", children: Array.from({ length: total }, (_, i) => /* @__PURE__ */ jsx("span", { className: ["h-1 flex-1 rounded-
|
|
8
|
+
/* @__PURE__ */ jsx("div", { role: "progressbar", "aria-label": words, "aria-valuemin": 1, "aria-valuemax": total, "aria-valuenow": step, "aria-valuetext": words, className: "flex flex-1 gap-1", children: Array.from({ length: total }, (_, i) => /* @__PURE__ */ jsx("span", { className: ["h-1 flex-1 rounded-sm transition-colors motion-reduce:transition-none", i < step ? "bg-accent" : "bg-surface-3"].join(" ") }, i)) }),
|
|
9
9
|
/* @__PURE__ */ jsx("div", { className: "flex min-w-10 justify-end", children: trailing })
|
|
10
10
|
] }),
|
|
11
11
|
/* @__PURE__ */ jsx("p", { className: "m-0 text-center text-xs text-fg-secondary", "aria-hidden": true, children: words })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/step-progress/step-progress.tsx"],"sourcesContent":["// Server-safe. The head of a multi-step flow: back, segments that fill, the position in words — a `progressbar`.\nimport type * as React from \"react\";\n\nexport type StepProgressProps = {\n /** The current step, from 1. */\n step: number;\n /** How many steps. */\n total: number;\n /** The position in words: `(n, total) => \"Step \" + n + \" of \" + total` — passed translated. */\n label: (step: number, total: number) => string;\n /** The back link or button (a `Button`), at the left. */\n back?: React.ReactNode;\n /** At the right: a Skip link. */\n trailing?: React.ReactNode;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The head of a sign-up or a profile to fill: back, segments that fill, the position in words. */\nexport function StepProgress({ step, total, label, back, trailing, className }: StepProgressProps) {\n const words = label(step, total);\n return (\n <div className={[\"flex flex-col gap-1.5\", className].filter(Boolean).join(\" \")}>\n <div className=\"flex items-center gap-3\">\n <div className=\"flex min-w-10 justify-start\">{back}</div>\n <div role=\"progressbar\" aria-label={words} aria-valuemin={1} aria-valuemax={total} aria-valuenow={step} aria-valuetext={words} className=\"flex flex-1 gap-1\">\n {Array.from({ length: total }, (_, i) => (\n <span key={i} className={[\"h-1 flex-1 rounded-
|
|
1
|
+
{"version":3,"sources":["../src/step-progress/step-progress.tsx"],"sourcesContent":["// Server-safe. The head of a multi-step flow: back, segments that fill, the position in words — a `progressbar`.\nimport type * as React from \"react\";\n\nexport type StepProgressProps = {\n /** The current step, from 1. */\n step: number;\n /** How many steps. */\n total: number;\n /** The position in words: `(n, total) => \"Step \" + n + \" of \" + total` — passed translated. */\n label: (step: number, total: number) => string;\n /** The back link or button (a `Button`), at the left. */\n back?: React.ReactNode;\n /** At the right: a Skip link. */\n trailing?: React.ReactNode;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The head of a sign-up or a profile to fill: back, segments that fill, the position in words. */\nexport function StepProgress({ step, total, label, back, trailing, className }: StepProgressProps) {\n const words = label(step, total);\n return (\n <div className={[\"flex flex-col gap-1.5\", className].filter(Boolean).join(\" \")}>\n <div className=\"flex items-center gap-3\">\n <div className=\"flex min-w-10 justify-start\">{back}</div>\n <div role=\"progressbar\" aria-label={words} aria-valuemin={1} aria-valuemax={total} aria-valuenow={step} aria-valuetext={words} className=\"flex flex-1 gap-1\">\n {Array.from({ length: total }, (_, i) => (\n <span key={i} className={[\"h-1 flex-1 rounded-sm transition-colors motion-reduce:transition-none\", i < step ? \"bg-accent\" : \"bg-surface-3\"].join(\" \")} />\n ))}\n </div>\n <div className=\"flex min-w-10 justify-end\">{trailing}</div>\n </div>\n <p className=\"m-0 text-center text-xs text-fg-secondary\" aria-hidden>\n {words}\n </p>\n </div>\n );\n}\n"],"mappings":";AAuBM,SACE,KADF;AAJC,SAAS,aAAa,EAAE,MAAM,OAAO,OAAO,MAAM,UAAU,UAAU,GAAsB;AACjG,QAAM,QAAQ,MAAM,MAAM,KAAK;AAC/B,SACE,qBAAC,SAAI,WAAW,CAAC,yBAAyB,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAC3E;AAAA,yBAAC,SAAI,WAAU,2BACb;AAAA,0BAAC,SAAI,WAAU,+BAA+B,gBAAK;AAAA,MACnD,oBAAC,SAAI,MAAK,eAAc,cAAY,OAAO,iBAAe,GAAG,iBAAe,OAAO,iBAAe,MAAM,kBAAgB,OAAO,WAAU,qBACtI,gBAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MACjC,oBAAC,UAAa,WAAW,CAAC,yEAAyE,IAAI,OAAO,cAAc,cAAc,EAAE,KAAK,GAAG,KAAzI,CAA4I,CACxJ,GACH;AAAA,MACA,oBAAC,SAAI,WAAU,6BAA6B,oBAAS;AAAA,OACvD;AAAA,IACA,oBAAC,OAAE,WAAU,6CAA4C,eAAW,MACjE,iBACH;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/sticky-action.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const stickyAction: tailwind_variants.TVReturnType<{} | {} | {}, undefined, "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1
|
|
4
|
+
declare const stickyAction: tailwind_variants.TVReturnType<{} | {} | {}, undefined, "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 md:hidden", {} | {}, undefined, tailwind_variants.TVReturnTypeLike<unknown, undefined>>;
|
|
5
5
|
type StickyActionProps = React.ComponentProps<"div"> & {
|
|
6
6
|
/** The action: one `ButtonLink` (full width is added). */
|
|
7
7
|
children: React.ReactNode;
|
package/dist/sticky-action.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var stickyAction = tv({
|
|
5
|
-
base: "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1
|
|
5
|
+
base: "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 md:hidden"
|
|
6
6
|
});
|
|
7
7
|
function StickyAction({ className, children, ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx("div", { className: stickyAction({ className }), ...props, children: /* @__PURE__ */ jsx("div", { className: "mx-auto flex max-w-md flex-col [&>*]:w-full", children }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sticky-action/sticky-action.tsx"],"sourcesContent":["// Server-safe: pure CSS. The main action of a page, stuck to the bottom of a phone's screen while the page scrolls: put it\n// as the last child of the page's `main` (a sticky element holds the viewport's edge inside its container). From `md` up it\n// is not drawn — the page's own buttons are within reach.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const stickyAction = tv({\n base: \"sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1
|
|
1
|
+
{"version":3,"sources":["../src/sticky-action/sticky-action.tsx"],"sourcesContent":["// Server-safe: pure CSS. The main action of a page, stuck to the bottom of a phone's screen while the page scrolls: put it\n// as the last child of the page's `main` (a sticky element holds the viewport's edge inside its container). From `md` up it\n// is not drawn — the page's own buttons are within reach.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const stickyAction = tv({\n base: \"sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 md:hidden\",\n});\n\nexport type StickyActionProps = React.ComponentProps<\"div\"> & {\n /** The action: one `ButtonLink` (full width is added). */\n children: React.ReactNode;\n};\n\n/** The one action of a page, held at the bottom edge of a phone. */\nexport function StickyAction({ className, children, ...props }: StickyActionProps) {\n return (\n <div className={stickyAction({ className })} {...props}>\n <div className=\"mx-auto flex max-w-md flex-col [&>*]:w-full\">{children}</div>\n </div>\n );\n}\n"],"mappings":";AAIA,SAAS,UAAU;AAeb;AAbC,IAAM,eAAe,GAAG;AAAA,EAC7B,MAAM;AACR,CAAC;AAQM,SAAS,aAAa,EAAE,WAAW,UAAU,GAAG,MAAM,GAAsB;AACjF,SACE,oBAAC,SAAI,WAAW,aAAa,EAAE,UAAU,CAAC,GAAI,GAAG,OAC/C,8BAAC,SAAI,WAAU,+CAA+C,UAAS,GACzE;AAEJ;","names":[]}
|
package/dist/swipe-deck.js
CHANGED
|
@@ -12,7 +12,7 @@ var swipeDeck = tv({
|
|
|
12
12
|
root: "flex w-full flex-col items-center gap-5",
|
|
13
13
|
stack: "relative aspect-[3/4] w-full max-w-sm outline-hidden focus-visible:rounded-2xl focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-surface-0",
|
|
14
14
|
layer: "absolute inset-0 touch-pan-y select-none",
|
|
15
|
-
stamp: "pointer-events-none absolute top-8 rounded-lg border-[3px] px-2.5 py-0.5 font-display text-2xl font-black
|
|
15
|
+
stamp: "pointer-events-none absolute top-8 rounded-lg border-[3px] px-2.5 py-0.5 font-display text-2xl font-black ",
|
|
16
16
|
buttons: "flex items-center gap-7",
|
|
17
17
|
button: "inline-flex h-16 w-16 items-center justify-center rounded-full border-2 bg-surface-1 shadow-md transition-transform active:scale-90 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 motion-reduce:transition-none [&>svg]:h-7 [&>svg]:w-7",
|
|
18
18
|
card: "relative h-full w-full overflow-hidden rounded-2xl bg-surface-3 shadow-lg",
|
package/dist/swipe-deck.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/swipe-deck/swipe-deck.tsx"],"sourcesContent":["// Client (the drag, the decision). A deck of cards decided one by one — drag right to like, left to pass, or the\n// buttons, or ← → on the focused deck — and `PersonCard`, a person on a card. Reduced motion: the card leaves without\n// flying.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { usePrefersReducedMotion } from \"../media\";\n\nexport const swipeDeck = tv({\n slots: {\n root: \"flex w-full flex-col items-center gap-5\",\n stack: \"relative aspect-[3/4] w-full max-w-sm outline-hidden focus-visible:rounded-2xl focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-surface-0\",\n layer: \"absolute inset-0 touch-pan-y select-none\",\n stamp: \"pointer-events-none absolute top-8 rounded-lg border-[3px] px-2.5 py-0.5 font-display text-2xl font-black uppercase tracking-wide\",\n buttons: \"flex items-center gap-7\",\n button:\n \"inline-flex h-16 w-16 items-center justify-center rounded-full border-2 bg-surface-1 shadow-md transition-transform active:scale-90 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 motion-reduce:transition-none [&>svg]:h-7 [&>svg]:w-7\",\n card: \"relative h-full w-full overflow-hidden rounded-2xl bg-surface-3 shadow-lg\",\n photo: \"absolute inset-0 h-full w-full object-cover\",\n bars: \"absolute inset-x-2 top-2 flex gap-1\",\n bar: \"h-[3px] flex-1 rounded-full bg-fg-on-media opacity-40 data-[on]:opacity-100\",\n half: \"absolute top-0 bottom-2/5 w-2/5 cursor-pointer outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring\",\n info: \"absolute inset-x-0 bottom-0 flex flex-col gap-1.5 bg-gradient-to-t from-scrim-strong via-scrim-strong/80 to-transparent p-4 pt-24 text-fg-on-media\",\n name: \"flex items-center gap-2 font-display text-3xl font-black\",\n age: \"font-sans text-2xl font-normal\",\n bio: \"line-clamp-2 text-sm\",\n footer: \"mt-1 flex flex-wrap gap-1.5\",\n },\n});\n\nexport type PersonCardProps = {\n /** The person's photos (URLs), the first shown first; click a side, or its buttons, to move between them. */\n photos: readonly { src: string; alt?: string }[];\n /** The name. */\n name: string;\n /** The age, written after the name. */\n age?: number;\n /** Beside the name: a `VerifiedBadge`. */\n badge?: React.ReactNode;\n /** A line under the name: a distance, a job. */\n meta?: React.ReactNode;\n /** A sentence about the person. */\n bio?: string;\n /** At the bottom: the interests as chips. */\n footer?: React.ReactNode;\n /** The photo buttons' words: `{ previous: \"Previous photo\", next: \"Next photo\" }` — passed translated. */\n photoLabels?: { previous: string; next: string };\n /** Classes merged on the card. */\n className?: string;\n};\n\n/** A person on a card: photos full bleed (a side to change), name and age over a scrim, a line, a bio, chips. */\nexport function PersonCard({ photos, name, age, badge, meta, bio, footer, photoLabels = { previous: \"Previous photo\", next: \"Next photo\" }, className }: PersonCardProps) {\n const s = swipeDeck();\n const [index, setIndex] = React.useState(0);\n const photo = photos[index];\n return (\n <article aria-label={age !== undefined ? `${name}, ${age}` : name} className={s.card({ className })}>\n {photo ? <img src={photo.src} alt={photo.alt ?? \"\"} className={s.photo()} draggable={false} /> : null}\n {photos.length > 1 ? (\n <>\n <div className={s.bars()} aria-hidden>\n {photos.map((_, i) => (\n <span key={i} className={s.bar()} data-on={i === index || undefined} />\n ))}\n </div>\n <button type=\"button\" aria-label={photoLabels.previous} disabled={index === 0} className={s.half({ className: \"left-0\" })} onClick={() => setIndex((i) => Math.max(0, i - 1))} />\n <button type=\"button\" aria-label={photoLabels.next} disabled={index === photos.length - 1} className={s.half({ className: \"right-0\" })} onClick={() => setIndex((i) => Math.min(photos.length - 1, i + 1))} />\n </>\n ) : null}\n <div className={s.info()}>\n <h3 className={s.name()}>\n <span className=\"truncate\">\n {name}\n {age !== undefined ? <span className={s.age()}>{` ${age}`}</span> : null}\n </span>\n {badge}\n </h3>\n {meta}\n {bio ? <p className={s.bio()}>{bio}</p> : null}\n {footer ? <div className={s.footer()}>{footer}</div> : null}\n </div>\n </article>\n );\n}\n\nexport type SwipeDirection = \"like\" | \"pass\";\n\nexport type SwipeDeckLabels = {\n /** The like button (“Like”). */\n like: string;\n /** The pass button (“Pass”). */\n pass: string;\n /** The deck's name and its keyboard hint (“Profiles. Right arrow to like, left arrow to pass.”). */\n deck: string;\n /** The stamp while dragging right (“LIKE”). */\n likeStamp?: string;\n /** The stamp while dragging left (“NOPE”). */\n passStamp?: string;\n /** Announced after a decision: `(name, direction) => …`. */\n decided?: (name: string, direction: SwipeDirection) => string;\n};\n\nexport type SwipeDeckProps<T> = {\n /** The cards still to decide, the first on top. */\n items: readonly T[];\n /** A card's id. */\n getId: (item: T) => string;\n /** A card's name, for the announcements. */\n getName: (item: T) => string;\n /** A card (usually a `PersonCard`). */\n renderCard: (item: T) => React.ReactNode;\n /** Called with the card decided and the decision; remove it from `items`. */\n onSwipe: (item: T, direction: SwipeDirection) => void;\n /** Shown when there is no card left (an `EmptyState`). */\n empty?: React.ReactNode;\n /** The words, passed translated. */\n labels: SwipeDeckLabels;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A deck of cards decided one by one: drag, the buttons, or ← → — each decision announced. */\nexport function SwipeDeck<T>({ items, getId, getName, renderCard, onSwipe, empty, labels, className }: SwipeDeckProps<T>) {\n const s = swipeDeck();\n const reduce = usePrefersReducedMotion();\n const [dx, setDx] = React.useState(0);\n const [leaving, setLeaving] = React.useState<SwipeDirection | null>(null);\n const [message, setMessage] = React.useState(\"\");\n const start = React.useRef<{ x: number; width: number } | null>(null);\n const [dragging, setDragging] = React.useState(false);\n const top = items[0];\n const decide = (direction: SwipeDirection) => {\n if (!top || leaving) return;\n const finish = () => {\n setLeaving(null);\n setDx(0);\n setMessage(labels.decided ? labels.decided(getName(top), direction) : `${getName(top)}: ${direction === \"like\" ? labels.like : labels.pass}`);\n onSwipe(top, direction);\n };\n if (reduce) return finish();\n setLeaving(direction);\n setTimeout(finish, 220);\n };\n const offset = leaving ? (leaving === \"like\" ? 1 : -1) * 900 : dx;\n const stampOpacity = (dir: 1 | -1) => Math.max(0, Math.min(1, (dir * offset) / 120));\n return (\n <div className={s.root({ className })}>\n <p className=\"sr-only\" aria-live=\"polite\">\n {message}\n </p>\n <div\n role=\"group\"\n aria-label={labels.deck}\n tabIndex={top ? 0 : -1}\n className={s.stack()}\n onKeyDown={(e) => {\n if (e.key === \"ArrowRight\") decide(\"like\");\n if (e.key === \"ArrowLeft\") decide(\"pass\");\n }}\n >\n {!top ? empty : null}\n {items\n .slice(0, 2)\n .reverse()\n .map((item) => {\n const isTop = item === top;\n return (\n <div\n key={getId(item)}\n aria-hidden={!isTop || undefined}\n inert={!isTop || undefined}\n className={s.layer()}\n style={\n isTop\n ? { transform: `translateX(${offset}px) rotate(${offset / 22}deg)`, transition: dragging && !leaving ? \"none\" : reduce ? \"none\" : \"transform 220ms var(--kz-ease, ease-out)\" }\n : { transform: \"scale(0.96)\", opacity: 0.9 }\n }\n onPointerDown={(e) => {\n if (!isTop || (e.target as HTMLElement).closest(\"button\")) return;\n start.current = { x: e.clientX, width: e.currentTarget.offsetWidth };\n e.currentTarget.setPointerCapture(e.pointerId);\n setDragging(true);\n }}\n onPointerMove={(e) => {\n if (start.current) setDx(e.clientX - start.current.x);\n }}\n onPointerUp={() => {\n const width = start.current?.width ?? 300;\n start.current = null;\n setDragging(false);\n if (dx > width / 3) decide(\"like\");\n else if (dx < -width / 3) decide(\"pass\");\n else setDx(0);\n }}\n >\n {renderCard(item)}\n {isTop ? (\n <>\n <span aria-hidden className={s.stamp({ className: \"left-6 -rotate-12 border-success text-fg-success\" })} style={{ opacity: stampOpacity(1) }}>\n {labels.likeStamp ?? labels.like}\n </span>\n <span aria-hidden className={s.stamp({ className: \"right-6 rotate-12 border-danger text-fg-danger\" })} style={{ opacity: stampOpacity(-1) }}>\n {labels.passStamp ?? labels.pass}\n </span>\n </>\n ) : null}\n </div>\n );\n })}\n </div>\n <div className={s.buttons()}>\n <button type=\"button\" aria-label={labels.pass} disabled={!top} onClick={() => decide(\"pass\")} className={s.button({ className: \"border-danger text-fg-danger\" })}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n <button type=\"button\" aria-label={labels.like} disabled={!top} onClick={() => decide(\"like\")} className={s.button({ className: \"border-success text-fg-success\" })}>\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <path d=\"M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z\" />\n </svg>\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAuDJ,SAEP,UAFO,KAEP,YAFO;AAnDR,IAAM,YAAY,GAAG;AAAA,EAC1B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,SAAS;AAAA,IACT,QACE;AAAA,IAEF,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,KAAK;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AACF,CAAC;AAwBM,SAAS,WAAW,EAAE,QAAQ,MAAM,KAAK,OAAO,MAAM,KAAK,QAAQ,cAAc,EAAE,UAAU,kBAAkB,MAAM,aA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AA,gBACd;AAAA,gBAEC;AAAA,6BAAW,IAAI;AAAA,kBACf,QACC,iCACE;AAAA,wCAAC,UAAK,eAAW,MAAC,WAAW,EAAE,MAAM,EAAE,WAAW,mDAAmD,CAAC,GAAG,OAAO,EAAE,SAAS,aAAa,CAAC,EAAE,GACxI,iBAAO,aAAa,OAAO,MAC9B;AAAA,oBACA,oBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,MAAM,EAAE,WAAW,iDAAiD,CAAC,GAAG,OAAO,EAAE,SAAS,aAAa,EAAE,EAAE,GACvI,iBAAO,aAAa,OAAO,MAC9B;AAAA,qBACF,IACE;AAAA;AAAA;AAAA,cArCC,MAAM,IAAI;AAAA,YAsCjB;AAAA,UAEJ,CAAC;AAAA;AAAA;AAAA,IACL;AAAA,IACA,qBAAC,SAAI,WAAW,EAAE,QAAQ,GACxB;AAAA,0BAAC,YAAO,MAAK,UAAS,cAAY,OAAO,MAAM,UAAU,CAAC,KAAK,SAAS,MAAM,OAAO,MAAM,GAAG,WAAW,EAAE,OAAO,EAAE,WAAW,+BAA+B,CAAC,GAC7J,8BAAC,SAAI,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,KAAI,eAAc,SAAQ,eAAW,MAC1G,8BAAC,UAAK,GAAE,wBAAuB,GACjC,GACF;AAAA,MACA,oBAAC,YAAO,MAAK,UAAS,cAAY,OAAO,MAAM,UAAU,CAAC,KAAK,SAAS,MAAM,OAAO,MAAM,GAAG,WAAW,EAAE,OAAO,EAAE,WAAW,iCAAiC,CAAC,GAC/J,8BAAC,SAAI,SAAQ,aAAY,MAAK,gBAAe,eAAW,MACtD,8BAAC,UAAK,GAAE,uEAAsE,GAChF,GACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/swipe-deck/swipe-deck.tsx"],"sourcesContent":["// Client (the drag, the decision). A deck of cards decided one by one — drag right to like, left to pass, or the\n// buttons, or ← → on the focused deck — and `PersonCard`, a person on a card. Reduced motion: the card leaves without\n// flying.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { usePrefersReducedMotion } from \"../media\";\n\nexport const swipeDeck = tv({\n slots: {\n root: \"flex w-full flex-col items-center gap-5\",\n stack: \"relative aspect-[3/4] w-full max-w-sm outline-hidden focus-visible:rounded-2xl focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-surface-0\",\n layer: \"absolute inset-0 touch-pan-y select-none\",\n stamp: \"pointer-events-none absolute top-8 rounded-lg border-[3px] px-2.5 py-0.5 font-display text-2xl font-black \",\n buttons: \"flex items-center gap-7\",\n button:\n \"inline-flex h-16 w-16 items-center justify-center rounded-full border-2 bg-surface-1 shadow-md transition-transform active:scale-90 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 motion-reduce:transition-none [&>svg]:h-7 [&>svg]:w-7\",\n card: \"relative h-full w-full overflow-hidden rounded-2xl bg-surface-3 shadow-lg\",\n photo: \"absolute inset-0 h-full w-full object-cover\",\n bars: \"absolute inset-x-2 top-2 flex gap-1\",\n bar: \"h-[3px] flex-1 rounded-full bg-fg-on-media opacity-40 data-[on]:opacity-100\",\n half: \"absolute top-0 bottom-2/5 w-2/5 cursor-pointer outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring\",\n info: \"absolute inset-x-0 bottom-0 flex flex-col gap-1.5 bg-gradient-to-t from-scrim-strong via-scrim-strong/80 to-transparent p-4 pt-24 text-fg-on-media\",\n name: \"flex items-center gap-2 font-display text-3xl font-black\",\n age: \"font-sans text-2xl font-normal\",\n bio: \"line-clamp-2 text-sm\",\n footer: \"mt-1 flex flex-wrap gap-1.5\",\n },\n});\n\nexport type PersonCardProps = {\n /** The person's photos (URLs), the first shown first; click a side, or its buttons, to move between them. */\n photos: readonly { src: string; alt?: string }[];\n /** The name. */\n name: string;\n /** The age, written after the name. */\n age?: number;\n /** Beside the name: a `VerifiedBadge`. */\n badge?: React.ReactNode;\n /** A line under the name: a distance, a job. */\n meta?: React.ReactNode;\n /** A sentence about the person. */\n bio?: string;\n /** At the bottom: the interests as chips. */\n footer?: React.ReactNode;\n /** The photo buttons' words: `{ previous: \"Previous photo\", next: \"Next photo\" }` — passed translated. */\n photoLabels?: { previous: string; next: string };\n /** Classes merged on the card. */\n className?: string;\n};\n\n/** A person on a card: photos full bleed (a side to change), name and age over a scrim, a line, a bio, chips. */\nexport function PersonCard({ photos, name, age, badge, meta, bio, footer, photoLabels = { previous: \"Previous photo\", next: \"Next photo\" }, className }: PersonCardProps) {\n const s = swipeDeck();\n const [index, setIndex] = React.useState(0);\n const photo = photos[index];\n return (\n <article aria-label={age !== undefined ? `${name}, ${age}` : name} className={s.card({ className })}>\n {photo ? <img src={photo.src} alt={photo.alt ?? \"\"} className={s.photo()} draggable={false} /> : null}\n {photos.length > 1 ? (\n <>\n <div className={s.bars()} aria-hidden>\n {photos.map((_, i) => (\n <span key={i} className={s.bar()} data-on={i === index || undefined} />\n ))}\n </div>\n <button type=\"button\" aria-label={photoLabels.previous} disabled={index === 0} className={s.half({ className: \"left-0\" })} onClick={() => setIndex((i) => Math.max(0, i - 1))} />\n <button type=\"button\" aria-label={photoLabels.next} disabled={index === photos.length - 1} className={s.half({ className: \"right-0\" })} onClick={() => setIndex((i) => Math.min(photos.length - 1, i + 1))} />\n </>\n ) : null}\n <div className={s.info()}>\n <h3 className={s.name()}>\n <span className=\"truncate\">\n {name}\n {age !== undefined ? <span className={s.age()}>{` ${age}`}</span> : null}\n </span>\n {badge}\n </h3>\n {meta}\n {bio ? <p className={s.bio()}>{bio}</p> : null}\n {footer ? <div className={s.footer()}>{footer}</div> : null}\n </div>\n </article>\n );\n}\n\nexport type SwipeDirection = \"like\" | \"pass\";\n\nexport type SwipeDeckLabels = {\n /** The like button (“Like”). */\n like: string;\n /** The pass button (“Pass”). */\n pass: string;\n /** The deck's name and its keyboard hint (“Profiles. Right arrow to like, left arrow to pass.”). */\n deck: string;\n /** The stamp while dragging right (“LIKE”). */\n likeStamp?: string;\n /** The stamp while dragging left (“NOPE”). */\n passStamp?: string;\n /** Announced after a decision: `(name, direction) => …`. */\n decided?: (name: string, direction: SwipeDirection) => string;\n};\n\nexport type SwipeDeckProps<T> = {\n /** The cards still to decide, the first on top. */\n items: readonly T[];\n /** A card's id. */\n getId: (item: T) => string;\n /** A card's name, for the announcements. */\n getName: (item: T) => string;\n /** A card (usually a `PersonCard`). */\n renderCard: (item: T) => React.ReactNode;\n /** Called with the card decided and the decision; remove it from `items`. */\n onSwipe: (item: T, direction: SwipeDirection) => void;\n /** Shown when there is no card left (an `EmptyState`). */\n empty?: React.ReactNode;\n /** The words, passed translated. */\n labels: SwipeDeckLabels;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A deck of cards decided one by one: drag, the buttons, or ← → — each decision announced. */\nexport function SwipeDeck<T>({ items, getId, getName, renderCard, onSwipe, empty, labels, className }: SwipeDeckProps<T>) {\n const s = swipeDeck();\n const reduce = usePrefersReducedMotion();\n const [dx, setDx] = React.useState(0);\n const [leaving, setLeaving] = React.useState<SwipeDirection | null>(null);\n const [message, setMessage] = React.useState(\"\");\n const start = React.useRef<{ x: number; width: number } | null>(null);\n const [dragging, setDragging] = React.useState(false);\n const top = items[0];\n const decide = (direction: SwipeDirection) => {\n if (!top || leaving) return;\n const finish = () => {\n setLeaving(null);\n setDx(0);\n setMessage(labels.decided ? labels.decided(getName(top), direction) : `${getName(top)}: ${direction === \"like\" ? labels.like : labels.pass}`);\n onSwipe(top, direction);\n };\n if (reduce) return finish();\n setLeaving(direction);\n setTimeout(finish, 220);\n };\n const offset = leaving ? (leaving === \"like\" ? 1 : -1) * 900 : dx;\n const stampOpacity = (dir: 1 | -1) => Math.max(0, Math.min(1, (dir * offset) / 120));\n return (\n <div className={s.root({ className })}>\n <p className=\"sr-only\" aria-live=\"polite\">\n {message}\n </p>\n <div\n role=\"group\"\n aria-label={labels.deck}\n tabIndex={top ? 0 : -1}\n className={s.stack()}\n onKeyDown={(e) => {\n if (e.key === \"ArrowRight\") decide(\"like\");\n if (e.key === \"ArrowLeft\") decide(\"pass\");\n }}\n >\n {!top ? empty : null}\n {items\n .slice(0, 2)\n .reverse()\n .map((item) => {\n const isTop = item === top;\n return (\n <div\n key={getId(item)}\n aria-hidden={!isTop || undefined}\n inert={!isTop || undefined}\n className={s.layer()}\n style={\n isTop\n ? { transform: `translateX(${offset}px) rotate(${offset / 22}deg)`, transition: dragging && !leaving ? \"none\" : reduce ? \"none\" : \"transform 220ms var(--kz-ease, ease-out)\" }\n : { transform: \"scale(0.96)\", opacity: 0.9 }\n }\n onPointerDown={(e) => {\n if (!isTop || (e.target as HTMLElement).closest(\"button\")) return;\n start.current = { x: e.clientX, width: e.currentTarget.offsetWidth };\n e.currentTarget.setPointerCapture(e.pointerId);\n setDragging(true);\n }}\n onPointerMove={(e) => {\n if (start.current) setDx(e.clientX - start.current.x);\n }}\n onPointerUp={() => {\n const width = start.current?.width ?? 300;\n start.current = null;\n setDragging(false);\n if (dx > width / 3) decide(\"like\");\n else if (dx < -width / 3) decide(\"pass\");\n else setDx(0);\n }}\n >\n {renderCard(item)}\n {isTop ? (\n <>\n <span aria-hidden className={s.stamp({ className: \"left-6 -rotate-12 border-success text-fg-success\" })} style={{ opacity: stampOpacity(1) }}>\n {labels.likeStamp ?? labels.like}\n </span>\n <span aria-hidden className={s.stamp({ className: \"right-6 rotate-12 border-danger text-fg-danger\" })} style={{ opacity: stampOpacity(-1) }}>\n {labels.passStamp ?? labels.pass}\n </span>\n </>\n ) : null}\n </div>\n );\n })}\n </div>\n <div className={s.buttons()}>\n <button type=\"button\" aria-label={labels.pass} disabled={!top} onClick={() => decide(\"pass\")} className={s.button({ className: \"border-danger text-fg-danger\" })}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n <button type=\"button\" aria-label={labels.like} disabled={!top} onClick={() => decide(\"like\")} className={s.button({ className: \"border-success text-fg-success\" })}>\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <path d=\"M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z\" />\n </svg>\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAuDJ,SAEP,UAFO,KAEP,YAFO;AAnDR,IAAM,YAAY,GAAG;AAAA,EAC1B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,SAAS;AAAA,IACT,QACE;AAAA,IAEF,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,KAAK;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AACF,CAAC;AAwBM,SAAS,WAAW,EAAE,QAAQ,MAAM,KAAK,OAAO,MAAM,KAAK,QAAQ,cAAc,EAAE,UAAU,kBAAkB,MAAM,aAAa,GAAG,UAAU,GAAoB;AACxK,QAAM,IAAI,UAAU;AACpB,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAS,CAAC;AAC1C,QAAM,QAAQ,OAAO,KAAK;AAC1B,SACE,qBAAC,aAAQ,cAAY,QAAQ,SAAY,GAAG,IAAI,KAAK,GAAG,KAAK,MAAM,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAC/F;AAAA,YAAQ,oBAAC,SAAI,KAAK,MAAM,KAAK,KAAK,MAAM,OAAO,IAAI,WAAW,EAAE,MAAM,GAAG,WAAW,OAAO,IAAK;AAAA,IAChG,OAAO,SAAS,IACf,iCACE;AAAA,0BAAC,SAAI,WAAW,EAAE,KAAK,GAAG,eAA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AEJ,CAAC;AAAA;AAAA;AAAA,IACL;AAAA,IACA,qBAAC,SAAI,WAAW,EAAE,QAAQ,GACxB;AAAA,0BAAC,YAAO,MAAK,UAAS,cAAY,OAAO,MAAM,UAAU,CAAC,KAAK,SAAS,MAAM,OAAO,MAAM,GAAG,WAAW,EAAE,OAAO,EAAE,WAAW,+BAA+B,CAAC,GAC7J,8BAAC,SAAI,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,KAAI,eAAc,SAAQ,eAAW,MAC1G,8BAAC,UAAK,GAAE,wBAAuB,GACjC,GACF;AAAA,MACA,oBAAC,YAAO,MAAK,UAAS,cAAY,OAAO,MAAM,UAAU,CAAC,KAAK,SAAS,MAAM,OAAO,MAAM,GAAG,WAAW,EAAE,OAAO,EAAE,WAAW,iCAAiC,CAAC,GAC/J,8BAAC,SAAI,SAAQ,aAAY,MAAK,gBAAe,eAAW,MACtD,8BAAC,UAAK,GAAE,uEAAsE,GAChF,GACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/tabs.js
CHANGED
|
@@ -21,8 +21,8 @@ var tabs = tv({
|
|
|
21
21
|
variant: {
|
|
22
22
|
/* The section of a page: a line under the list, the active tab underlined in the accent. */
|
|
23
23
|
underline: {
|
|
24
|
-
list: "gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-
|
|
25
|
-
trigger: "relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg after:absolute after:rounded-
|
|
24
|
+
list: "gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-sm before:bg-accent data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:left-0 data-[orientation=horizontal]:before:h-0.5 data-[orientation=horizontal]:before:w-(--kz-ind-w) data-[orientation=horizontal]:before:translate-x-(--kz-ind-x) data-[orientation=vertical]:before:-right-px data-[orientation=vertical]:before:top-0 data-[orientation=vertical]:before:w-0.5 data-[orientation=vertical]:before:h-(--kz-ind-h) data-[orientation=vertical]:before:translate-y-(--kz-ind-y)",
|
|
25
|
+
trigger: "relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg after:absolute after:rounded-sm after:bg-transparent data-[state=active]:after:bg-accent data-[orientation=horizontal]:after:inset-x-2 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5 data-[orientation=vertical]:justify-start data-[orientation=vertical]:after:inset-y-1.5 data-[orientation=vertical]:after:-right-px data-[orientation=vertical]:after:w-0.5 group-data-[indicator=on]/tabs:data-[state=active]:after:bg-transparent"
|
|
26
26
|
},
|
|
27
27
|
/* A view switch: equal segments in a track, the active one filled. */
|
|
28
28
|
segmented: {
|
|
@@ -31,8 +31,8 @@ var tabs = tv({
|
|
|
31
31
|
},
|
|
32
32
|
/* Pills that scroll sideways on a phone: a feed's sections. */
|
|
33
33
|
pills: {
|
|
34
|
-
list: "gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-
|
|
35
|
-
trigger: "h-9 rounded-
|
|
34
|
+
list: "gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-sm before:border before:border-accent before:bg-accent-soft",
|
|
35
|
+
trigger: "h-9 rounded-sm border border-border-default bg-surface-1 px-4 text-xs text-fg-secondary hover:border-border-strong hover:text-fg data-[state=active]:border-accent data-[state=active]:bg-accent-soft data-[state=active]:text-fg group-data-[indicator=on]/tabs:data-[state=active]:border-transparent group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
},
|
package/dist/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tabs/tabs.tsx"],"sourcesContent":["// Client (a context). Radix Tabs does the roles (tablist, tab, tabpanel), the aria-selected / aria-controls wiring,\n// the roving focus (arrows, Home, End) and automatic activation: this file only holds the three looks.\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { useSlidingIndicator } from \"../sliding-indicator\";\n\nexport const tabs = tv({\n slots: {\n root: \"flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n // One light glides from the active tab to the next (`before:`, placed by useSlidingIndicator); until it is placed\n // (server render), each trigger carries its own active style.\n list:\n \"group/tabs relative isolate flex shrink-0 data-[orientation=vertical]:flex-col \" +\n \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:transition-[translate,width,height,opacity] before:duration-300 \" +\n \"motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n trigger:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n content: \"kz-fade min-w-0 flex-1 rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[state=inactive]:hidden\",\n },\n variants: {\n variant: {\n /* The section of a page: a line under the list, the active tab underlined in the accent. */\n underline: {\n list:\n \"gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-
|
|
1
|
+
{"version":3,"sources":["../src/tabs/tabs.tsx"],"sourcesContent":["// Client (a context). Radix Tabs does the roles (tablist, tab, tabpanel), the aria-selected / aria-controls wiring,\n// the roving focus (arrows, Home, End) and automatic activation: this file only holds the three looks.\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { useSlidingIndicator } from \"../sliding-indicator\";\n\nexport const tabs = tv({\n slots: {\n root: \"flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n // One light glides from the active tab to the next (`before:`, placed by useSlidingIndicator); until it is placed\n // (server render), each trigger carries its own active style.\n list:\n \"group/tabs relative isolate flex shrink-0 data-[orientation=vertical]:flex-col \" +\n \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:transition-[translate,width,height,opacity] before:duration-300 \" +\n \"motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n trigger:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n content: \"kz-fade min-w-0 flex-1 rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[state=inactive]:hidden\",\n },\n variants: {\n variant: {\n /* The section of a page: a line under the list, the active tab underlined in the accent. */\n underline: {\n list:\n \"gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-sm before:bg-accent \" +\n \"data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:left-0 data-[orientation=horizontal]:before:h-0.5 \" +\n \"data-[orientation=horizontal]:before:w-(--kz-ind-w) data-[orientation=horizontal]:before:translate-x-(--kz-ind-x) \" +\n \"data-[orientation=vertical]:before:-right-px data-[orientation=vertical]:before:top-0 data-[orientation=vertical]:before:w-0.5 \" +\n \"data-[orientation=vertical]:before:h-(--kz-ind-h) data-[orientation=vertical]:before:translate-y-(--kz-ind-y)\",\n trigger:\n \"relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg \" +\n \"after:absolute after:rounded-sm after:bg-transparent data-[state=active]:after:bg-accent \" +\n \"data-[orientation=horizontal]:after:inset-x-2 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5 \" +\n \"data-[orientation=vertical]:justify-start data-[orientation=vertical]:after:inset-y-1.5 data-[orientation=vertical]:after:-right-px data-[orientation=vertical]:after:w-0.5 \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:after:bg-transparent\",\n },\n /* A view switch: equal segments in a track, the active one filled. */\n segmented: {\n list:\n \"inline-grid auto-cols-fr grid-flow-col gap-1 self-start rounded-xl border border-border-default bg-surface-1 p-1 data-[orientation=vertical]:grid-flow-row \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:bg-accent before:shadow-sm\",\n trigger:\n \"min-h-8 rounded-lg px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-2 hover:text-fg \" +\n \"data-[state=active]:bg-accent data-[state=active]:text-on-accent data-[state=active]:shadow-sm data-[state=active]:hover:bg-accent \" +\n \"transition-colors group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent group-data-[indicator=on]/tabs:data-[state=active]:shadow-none\",\n },\n /* Pills that scroll sideways on a phone: a feed's sections. */\n pills: {\n list:\n \"gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) \" +\n \"before:rounded-sm before:border before:border-accent before:bg-accent-soft\",\n trigger:\n \"h-9 rounded-sm border border-border-default bg-surface-1 px-4 text-xs text-fg-secondary hover:border-border-strong hover:text-fg \" +\n \"data-[state=active]:border-accent data-[state=active]:bg-accent-soft data-[state=active]:text-fg \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:border-transparent group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent\",\n },\n },\n },\n defaultVariants: { variant: \"underline\" },\n});\n\nexport type TabsVariants = VariantProps<typeof tabs>;\ntype Variant = NonNullable<TabsVariants[\"variant\"]>;\n\nconst VariantContext = React.createContext<Variant>(\"underline\");\n\nexport type TabsRootProps = React.ComponentProps<typeof TabsPrimitive.Root> & {\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections). */\n variant?: TabsVariants[\"variant\"];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation` (horizontal by default), `variant` for the list. */\nexport function TabsRoot({ variant = \"underline\", className, ...props }: TabsRootProps) {\n return (\n <VariantContext.Provider value={variant}>\n <TabsPrimitive.Root data-variant={variant} className={tabs({ variant }).root({ className })} {...props} />\n </VariantContext.Provider>\n );\n}\n\n/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */\nexport function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n const variant = React.useContext(VariantContext);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=tab]\", active: \"[role=tab][data-state=active]\" });\n return <TabsPrimitive.List ref={ref} data-variant={variant} className={tabs({ variant }).list({ className })} {...props} />;\n}\n\nexport function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n const variant = React.useContext(VariantContext);\n return <TabsPrimitive.Trigger className={tabs({ variant }).trigger({ className })} {...props} />;\n}\n\nexport function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content className={tabs().content({ className })} {...props} />;\n}\n\n/** `Tabs.Root/List/Trigger/Content` — `variant` underline · segmented · pills on the root. */\nexport const Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent };\n"],"mappings":";;;;;;AAEA,SAAS,QAAQ,qBAAqB;AACtC,YAAY,WAAW;AACvB,SAAS,UAA6B;AA2EhC;AAvEC,IAAM,OAAO,GAAG;AAAA,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EAAE,WAAW,GAAG,MAAM,GAAuD;AACvG,SAAO,oBAAC,cAAc,SAAd,EAAsB,WAAW,KAAK,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACrF;AAGO,IAAM,OAAO,EAAE,MAAM,UAAU,MAAM,UAAU,SAAS,aAAa,SAAS,YAAY;","names":[]}
|
package/dist/tag-input.js
CHANGED
package/dist/tag-selector.js
CHANGED
package/dist/toast.js
CHANGED
|
@@ -85,7 +85,7 @@ function progressToast(message, { id, value, doneMessage, description, style, ..
|
|
|
85
85
|
icon: /* @__PURE__ */ jsx(LoaderGlyph, { value: ratio, className: "h-4 w-4 text-accent" }),
|
|
86
86
|
description: /* @__PURE__ */ jsxs("span", { className: "mt-1 flex flex-col gap-1.5", children: [
|
|
87
87
|
typeof description === "function" ? description() : description,
|
|
88
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "block h-1 w-full overflow-hidden rounded-
|
|
88
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "block h-1 w-full overflow-hidden rounded-sm bg-surface-3", children: /* @__PURE__ */ jsx("span", { className: "block h-full rounded-sm bg-linear-to-r from-accent to-accent-2 transition-[width] duration-500", style: { width: `${ratio * 100}%` } }) }),
|
|
89
89
|
/* @__PURE__ */ jsxs("span", { className: "tabular-nums", children: [
|
|
90
90
|
Math.round(ratio * 100),
|
|
91
91
|
" %"
|
package/dist/toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/toast/toast.tsx"],"sourcesContent":["// Client. sonner does the queue, the stacking, the swipe, the timers, the live region and the hotkey; the look is\n// ours: sonner's own styling is off (`unstyled`) and every part reads a role. The status tones are soft (a tinted\n// border and a coloured icon, the text stays `text-fg`): the invariant status tokens are too light for small text.\nimport type * as React from \"react\";\nimport { type ExternalToast, toast, Toaster as Sonner, type ToasterProps as SonnerProps } from \"sonner\";\n\nimport { cn } from \"../cn\";\nimport { LoaderGlyph } from \"../spinner/glyph\";\n\nexport type { ExternalToast } from \"sonner\";\nexport { toast } from \"sonner\";\n\nconst tone = (color: string) => cn(\"border-l-4\", color);\n\nexport const toastClassNames = {\n // `kz-toast`: a hairline at the bottom counts the time left, and pauses with the toast (hover, focus) — motion.css.\n toast:\n \"kz-toast group pointer-events-auto relative flex w-full items-start gap-3 overflow-hidden rounded-xl border border-border-default bg-surface-2 p-4 pr-10 \" +\n \"text-sm text-fg shadow-lg\",\n default: \"\",\n title: \"font-semibold text-fg\",\n description: \"mt-0.5 text-xs text-fg-secondary\",\n content: \"flex min-w-0 flex-1 flex-col\",\n icon: \"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center [&>svg]:h-4 [&>svg]:w-4\",\n success: tone(\"border-l-success [&_[data-icon]]:text-success\"),\n warning: tone(\"border-l-warning [&_[data-icon]]:text-warning\"),\n error: tone(\"border-l-danger [&_[data-icon]]:text-danger\"),\n info: tone(\"border-l-info [&_[data-icon]]:text-info\"),\n loading: \"\",\n actionButton:\n \"ml-auto shrink-0 self-center rounded-lg bg-accent px-3 py-1.5 text-xs font-semibold text-on-accent hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n cancelButton:\n \"shrink-0 self-center rounded-lg px-3 py-1.5 text-xs font-semibold text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n closeButton:\n \"absolute right-2 top-2 flex h-7 w-7 items-center justify-center rounded-full text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&>svg]:h-3.5 [&>svg]:w-3.5\",\n} satisfies NonNullable<NonNullable<SonnerProps[\"toastOptions\"]>[\"classNames\"]>;\n\nexport type ToasterProps = Omit<SonnerProps, \"richColors\" | \"theme\" | \"containerAriaLabel\" | \"toastOptions\"> & {\n /** The accessible name of the notifications region (sonner's `containerAriaLabel`) — passed translated. */\n label: string;\n /** The accessible name of each toast's close button — passed translated. */\n closeLabel: string;\n /** Extra options for every toast (duration, a className); the class names are merged with the platform's. */\n toastOptions?: Omit<NonNullable<SonnerProps[\"toastOptions\"]>, \"unstyled\" | \"closeButtonAriaLabel\">;\n};\n\n/** Mount once, in the root layout. Then call `toast()`, `toast.success/warning/error/info`, `toast.custom(…)`, and the helpers below. */\nexport function Toaster({ label, closeLabel, position = \"bottom-right\", closeButton = true, toastOptions, duration = 4000, ...props }: ToasterProps) {\n const extra = toastOptions?.classNames ?? {};\n const classNames = Object.fromEntries(\n Object.entries(toastClassNames).map(([key, value]) => [key, cn(value, extra[key as keyof typeof extra])]),\n ) as typeof toastClassNames;\n return (\n <Sonner\n position={position}\n closeButton={closeButton}\n containerAriaLabel={label}\n richColors={false}\n duration={duration}\n style={{ \"--kz-toast-duration\": Number.isFinite(duration) ? `${duration}ms` : \"none\" } as React.CSSProperties}\n toastOptions={{ ...toastOptions, unstyled: true, closeButtonAriaLabel: closeLabel, classNames }}\n {...props}\n />\n );\n}\n\n/** The time-left hairline of one toast: its own duration (none when it stays). */\nconst timer = (duration: number | undefined, style?: React.CSSProperties) =>\n ({ ...style, \"--kz-toast-duration\": duration === undefined ? undefined : Number.isFinite(duration) ? `${duration}ms` : \"none\" }) as React.CSSProperties;\n\nexport interface UndoToastOptions extends Omit<ExternalToast, \"action\" | \"cancel\"> {\n /** The label of the undo button (“Undo”) — passed translated. */\n undoLabel: string;\n /** Called when the user undoes: restore what was done. */\n onUndo: () => void;\n /** Called when the toast goes without an undo: make it final (delete for good, send…). */\n onCommit?: () => void;\n}\n\n/**\n * “Archived — Undo”: an action that waits before it becomes final. The hairline counts the time left to undo (6 s by\n * default, paused while hovered or focused); `onCommit` runs when it goes without an undo. Returns the toast's id.\n */\nexport function undoToast(message: React.ReactNode, { undoLabel, onUndo, onCommit, duration = 6000, style, onAutoClose, onDismiss, ...options }: UndoToastOptions) {\n let undone = false;\n const commit = () => {\n if (!undone) onCommit?.();\n };\n return toast(message, {\n ...options,\n duration,\n style: timer(duration, style),\n action: {\n label: undoLabel,\n onClick: () => {\n undone = true;\n onUndo();\n },\n },\n onAutoClose: (t) => {\n commit();\n onAutoClose?.(t);\n },\n onDismiss: (t) => {\n commit();\n onDismiss?.(t);\n },\n });\n}\n\nexport interface ProgressToastOptions extends Omit<ExternalToast, \"id\" | \"icon\"> {\n /** The toast to update: pass the id it returned the first time. */\n id?: string | number;\n /** Between 0 and 1. At 1 the toast turns to `doneMessage` (a success) and goes after the usual duration. */\n value: number;\n /** The message once done (“Uploaded”) — passed translated. */\n doneMessage?: React.ReactNode;\n}\n\n/**\n * A long task in a toast (an upload in the background): call it again with the same `id` as it advances — the glyph's\n * trace and a bar grow, without a new toast each time; at 1 it becomes a success. Returns the toast's id.\n */\nexport function progressToast(message: React.ReactNode, { id, value, doneMessage, description, style, ...options }: ProgressToastOptions) {\n const ratio = Math.min(1, Math.max(0, Number.isFinite(value) ? value : 0));\n if (ratio >= 1) return toast.success(doneMessage ?? message, { ...options, id, description, style: timer(options.duration, style) });\n return toast(message, {\n ...options,\n id,\n duration: Number.POSITIVE_INFINITY,\n style: timer(Number.POSITIVE_INFINITY, style),\n icon: <LoaderGlyph value={ratio} className=\"h-4 w-4 text-accent\" />,\n description: (\n <span className=\"mt-1 flex flex-col gap-1.5\">\n {typeof description === \"function\" ? description() : description}\n <span aria-hidden className=\"block h-1 w-full overflow-hidden rounded-full bg-surface-3\">\n <span className=\"block h-full rounded-full bg-linear-to-r from-accent to-accent-2 transition-[width] duration-500\" style={{ width: `${ratio * 100}%` }} />\n </span>\n <span className=\"tabular-nums\">{Math.round(ratio * 100)} %</span>\n </span>\n ),\n });\n}\n\nconst counts = new Map<string, number>();\n\nexport interface GroupedToastOptions extends Omit<ExternalToast, \"id\"> {\n /** The repeat count in words (`(n) => \\`${n} new messages\\``) — passed translated; default “×n”. */\n countLabel?: (count: number) => string;\n}\n\n/**\n * The same event again and again (new messages, failed retries) folds into one toast that counts — instead of a pile.\n * Toasts with the same `key` share one place; the count resets once it goes. Returns the toast's id.\n */\nexport function groupedToast(key: string, message: React.ReactNode, { countLabel = (n) => `×${n}`, onAutoClose, onDismiss, ...options }: GroupedToastOptions = {}) {\n const count = (counts.get(key) ?? 0) + 1;\n counts.set(key, count);\n const reset = () => counts.delete(key);\n return toast(message, {\n ...options,\n id: `group:${key}`,\n description: count > 1 ? countLabel(count) : options.description,\n onAutoClose: (t) => {\n reset();\n onAutoClose?.(t);\n },\n onDismiss: (t) => {\n reset();\n onDismiss?.(t);\n },\n });\n}\n"],"mappings":";;;;;;;;;AAIA,SAA6B,OAAO,WAAW,cAAgD;AAM/F,SAAS,SAAAA,cAAa;AA8ClB,cAqFI,YArFJ;AA5CJ,IAAM,OAAO,CAAC,UAAkB,GAAG,cAAc,KAAK;AAE/C,IAAM,kBAAkB;AAAA;AAAA,EAE7B,OACE;AAAA,EAEF,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS,KAAK,+CAA+C;AAAA,EAC7D,SAAS,KAAK,+CAA+C;AAAA,EAC7D,OAAO,KAAK,6CAA6C;AAAA,EACzD,MAAM,KAAK,yCAAyC;AAAA,EACpD,SAAS;AAAA,EACT,cACE;AAAA,EAEF,cACE;AAAA,EAEF,aACE;AAEJ;AAYO,SAAS,QAAQ,EAAE,OAAO,YAAY,WAAW,gBAAgB,cAAc,MAAM,cAAc,WAAW,KAAM,GAAG,MAAM,GAAiB;AACnJ,QAAM,QAAQ,cAAc,cAAc,CAAC;AAC3C,QAAM,aAAa,OAAO;AAAA,IACxB,OAAO,QAAQ,eAAe,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,GAAG,OAAO,MAAM,GAAyB,CAAC,CAAC,CAAC;AAAA,EAC1G;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,oBAAoB;AAAA,M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ACpB,GAAG;AAAA,IACH;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,OAAO,MAAM,OAAO,mBAAmB,KAAK;AAAA,IAC5C,MAAM,oBAAC,eAAY,OAAO,OAAO,WAAU,uBAAsB;AAAA,IACjE,aACE,qBAAC,UAAK,WAAU,8BACb;AAAA,aAAO,gBAAgB,aAAa,YAAY,IAAI;AAAA,MACrD,oBAAC,UAAK,eAAW,MAAC,WAAU,8DAC1B,8BAAC,UAAK,WAAU,oGAAmG,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,GAAG,GAC1J;AAAA,MACA,qBAAC,UAAK,WAAU,gBAAgB;AAAA,aAAK,MAAM,QAAQ,GAAG;AAAA,QAAE;AAAA,SAAE;AAAA,OAC5D;AAAA,EAEJ,CAAC;AACH;AAEA,IAAM,SAAS,oBAAI,IAAoB;AAWhC,SAAS,aAAa,KAAa,SAA0B,EAAE,aAAa,CAAC,MAAM,OAAI,CAAC,IAAI,aAAa,WAAW,GAAG,QAAQ,IAAyB,CAAC,GAAG;AACjK,QAAM,SAAS,OAAO,IAAI,GAAG,KAAK,KAAK;AACvC,SAAO,IAAI,KAAK,KAAK;AACrB,QAAM,QAAQ,MAAM,OAAO,OAAO,GAAG;AACrC,SAAO,MAAM,SAAS;AAAA,IACpB,GAAG;AAAA,IACH,IAAI,SAAS,GAAG;AAAA,IAChB,aAAa,QAAQ,IAAI,WAAW,KAAK,IAAI,QAAQ;AAAA,IACrD,aAAa,CAAC,MAAM;AAClB,YAAM;AACN,oBAAc,CAAC;AAAA,IACjB;AAAA,IACA,WAAW,CAAC,MAAM;AAChB,YAAM;AACN,kBAAY,CAAC;AAAA,IACf;AAAA,EACF,CAAC;AACH;","names":["toast"]}
|
|
1
|
+
{"version":3,"sources":["../src/toast/toast.tsx"],"sourcesContent":["// Client. sonner does the queue, the stacking, the swipe, the timers, the live region and the hotkey; the look is\n// ours: sonner's own styling is off (`unstyled`) and every part reads a role. The status tones are soft (a tinted\n// border and a coloured icon, the text stays `text-fg`): the invariant status tokens are too light for small text.\nimport type * as React from \"react\";\nimport { type ExternalToast, toast, Toaster as Sonner, type ToasterProps as SonnerProps } from \"sonner\";\n\nimport { cn } from \"../cn\";\nimport { LoaderGlyph } from \"../spinner/glyph\";\n\nexport type { ExternalToast } from \"sonner\";\nexport { toast } from \"sonner\";\n\nconst tone = (color: string) => cn(\"border-l-4\", color);\n\nexport const toastClassNames = {\n // `kz-toast`: a hairline at the bottom counts the time left, and pauses with the toast (hover, focus) — motion.css.\n toast:\n \"kz-toast group pointer-events-auto relative flex w-full items-start gap-3 overflow-hidden rounded-xl border border-border-default bg-surface-2 p-4 pr-10 \" +\n \"text-sm text-fg shadow-lg\",\n default: \"\",\n title: \"font-semibold text-fg\",\n description: \"mt-0.5 text-xs text-fg-secondary\",\n content: \"flex min-w-0 flex-1 flex-col\",\n icon: \"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center [&>svg]:h-4 [&>svg]:w-4\",\n success: tone(\"border-l-success [&_[data-icon]]:text-success\"),\n warning: tone(\"border-l-warning [&_[data-icon]]:text-warning\"),\n error: tone(\"border-l-danger [&_[data-icon]]:text-danger\"),\n info: tone(\"border-l-info [&_[data-icon]]:text-info\"),\n loading: \"\",\n actionButton:\n \"ml-auto shrink-0 self-center rounded-lg bg-accent px-3 py-1.5 text-xs font-semibold text-on-accent hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n cancelButton:\n \"shrink-0 self-center rounded-lg px-3 py-1.5 text-xs font-semibold text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n closeButton:\n \"absolute right-2 top-2 flex h-7 w-7 items-center justify-center rounded-full text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&>svg]:h-3.5 [&>svg]:w-3.5\",\n} satisfies NonNullable<NonNullable<SonnerProps[\"toastOptions\"]>[\"classNames\"]>;\n\nexport type ToasterProps = Omit<SonnerProps, \"richColors\" | \"theme\" | \"containerAriaLabel\" | \"toastOptions\"> & {\n /** The accessible name of the notifications region (sonner's `containerAriaLabel`) — passed translated. */\n label: string;\n /** The accessible name of each toast's close button — passed translated. */\n closeLabel: string;\n /** Extra options for every toast (duration, a className); the class names are merged with the platform's. */\n toastOptions?: Omit<NonNullable<SonnerProps[\"toastOptions\"]>, \"unstyled\" | \"closeButtonAriaLabel\">;\n};\n\n/** Mount once, in the root layout. Then call `toast()`, `toast.success/warning/error/info`, `toast.custom(…)`, and the helpers below. */\nexport function Toaster({ label, closeLabel, position = \"bottom-right\", closeButton = true, toastOptions, duration = 4000, ...props }: ToasterProps) {\n const extra = toastOptions?.classNames ?? {};\n const classNames = Object.fromEntries(\n Object.entries(toastClassNames).map(([key, value]) => [key, cn(value, extra[key as keyof typeof extra])]),\n ) as typeof toastClassNames;\n return (\n <Sonner\n position={position}\n closeButton={closeButton}\n containerAriaLabel={label}\n richColors={false}\n duration={duration}\n style={{ \"--kz-toast-duration\": Number.isFinite(duration) ? `${duration}ms` : \"none\" } as React.CSSProperties}\n toastOptions={{ ...toastOptions, unstyled: true, closeButtonAriaLabel: closeLabel, classNames }}\n {...props}\n />\n );\n}\n\n/** The time-left hairline of one toast: its own duration (none when it stays). */\nconst timer = (duration: number | undefined, style?: React.CSSProperties) =>\n ({ ...style, \"--kz-toast-duration\": duration === undefined ? undefined : Number.isFinite(duration) ? `${duration}ms` : \"none\" }) as React.CSSProperties;\n\nexport interface UndoToastOptions extends Omit<ExternalToast, \"action\" | \"cancel\"> {\n /** The label of the undo button (“Undo”) — passed translated. */\n undoLabel: string;\n /** Called when the user undoes: restore what was done. */\n onUndo: () => void;\n /** Called when the toast goes without an undo: make it final (delete for good, send…). */\n onCommit?: () => void;\n}\n\n/**\n * “Archived — Undo”: an action that waits before it becomes final. The hairline counts the time left to undo (6 s by\n * default, paused while hovered or focused); `onCommit` runs when it goes without an undo. Returns the toast's id.\n */\nexport function undoToast(message: React.ReactNode, { undoLabel, onUndo, onCommit, duration = 6000, style, onAutoClose, onDismiss, ...options }: UndoToastOptions) {\n let undone = false;\n const commit = () => {\n if (!undone) onCommit?.();\n };\n return toast(message, {\n ...options,\n duration,\n style: timer(duration, style),\n action: {\n label: undoLabel,\n onClick: () => {\n undone = true;\n onUndo();\n },\n },\n onAutoClose: (t) => {\n commit();\n onAutoClose?.(t);\n },\n onDismiss: (t) => {\n commit();\n onDismiss?.(t);\n },\n });\n}\n\nexport interface ProgressToastOptions extends Omit<ExternalToast, \"id\" | \"icon\"> {\n /** The toast to update: pass the id it returned the first time. */\n id?: string | number;\n /** Between 0 and 1. At 1 the toast turns to `doneMessage` (a success) and goes after the usual duration. */\n value: number;\n /** The message once done (“Uploaded”) — passed translated. */\n doneMessage?: React.ReactNode;\n}\n\n/**\n * A long task in a toast (an upload in the background): call it again with the same `id` as it advances — the glyph's\n * trace and a bar grow, without a new toast each time; at 1 it becomes a success. Returns the toast's id.\n */\nexport function progressToast(message: React.ReactNode, { id, value, doneMessage, description, style, ...options }: ProgressToastOptions) {\n const ratio = Math.min(1, Math.max(0, Number.isFinite(value) ? value : 0));\n if (ratio >= 1) return toast.success(doneMessage ?? message, { ...options, id, description, style: timer(options.duration, style) });\n return toast(message, {\n ...options,\n id,\n duration: Number.POSITIVE_INFINITY,\n style: timer(Number.POSITIVE_INFINITY, style),\n icon: <LoaderGlyph value={ratio} className=\"h-4 w-4 text-accent\" />,\n description: (\n <span className=\"mt-1 flex flex-col gap-1.5\">\n {typeof description === \"function\" ? description() : description}\n <span aria-hidden className=\"block h-1 w-full overflow-hidden rounded-sm bg-surface-3\">\n <span className=\"block h-full rounded-sm bg-linear-to-r from-accent to-accent-2 transition-[width] duration-500\" style={{ width: `${ratio * 100}%` }} />\n </span>\n <span className=\"tabular-nums\">{Math.round(ratio * 100)} %</span>\n </span>\n ),\n });\n}\n\nconst counts = new Map<string, number>();\n\nexport interface GroupedToastOptions extends Omit<ExternalToast, \"id\"> {\n /** The repeat count in words (`(n) => \\`${n} new messages\\``) — passed translated; default “×n”. */\n countLabel?: (count: number) => string;\n}\n\n/**\n * The same event again and again (new messages, failed retries) folds into one toast that counts — instead of a pile.\n * Toasts with the same `key` share one place; the count resets once it goes. Returns the toast's id.\n */\nexport function groupedToast(key: string, message: React.ReactNode, { countLabel = (n) => `×${n}`, onAutoClose, onDismiss, ...options }: GroupedToastOptions = {}) {\n const count = (counts.get(key) ?? 0) + 1;\n counts.set(key, count);\n const reset = () => counts.delete(key);\n return toast(message, {\n ...options,\n id: `group:${key}`,\n description: count > 1 ? countLabel(count) : options.description,\n onAutoClose: (t) => {\n reset();\n onAutoClose?.(t);\n },\n onDismiss: (t) => {\n reset();\n onDismiss?.(t);\n },\n });\n}\n"],"mappings":";;;;;;;;;AAIA,SAA6B,OAAO,WAAW,cAAgD;AAM/F,SAAS,SAAAA,cAAa;AA8ClB,cAqFI,YArFJ;AA5CJ,IAAM,OAAO,CAAC,UAAkB,GAAG,cAAc,KAAK;AAE/C,IAAM,kBAAkB;AAAA;AAAA,EAE7B,OACE;AAAA,EAEF,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS,KAAK,+CAA+C;AAAA,EAC7D,SAAS,KAAK,+CAA+C;AAAA,EAC7D,OAAO,KAAK,6CAA6C;AAAA,EACzD,MAAM,KAAK,yCAAyC;AAAA,EACpD,SAAS;AAAA,EACT,cACE;AAAA,EAEF,cACE;AAAA,EAEF,aACE;AAEJ;AAYO,SAAS,QAAQ,EAAE,OAAO,YAAY,WAAW,gBAAgB,cAAc,MAAM,cAAc,WAAW,KAAM,GAAG,MAAM,GAAiB;AACnJ,QAAM,QAAQ,cAAc,cAAc,CAAC;AAC3C,QAAM,aAAa,OAAO;AAAA,IACxB,OAAO,QAAQ,eAAe,EAAE,IAAI,CAAC,CAAC,KA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|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krizaka/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.0",
|
|
4
4
|
"description": "The Krizaka front-end platform's components: the primitives (button, card, dialog, toast, menu, field, tabs, chip, switch, slider, command palette, theme, countdown…) on the semantic --kz-* tokens, the animated marks (Krizaka, Orazaka, Orochia, Yasakia, Yororis) and the motion signature — web and /native.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"krizaka",
|
|
@@ -461,6 +461,26 @@
|
|
|
461
461
|
"types": "./dist/decision-list.d.ts",
|
|
462
462
|
"import": "./dist/decision-list.js"
|
|
463
463
|
},
|
|
464
|
+
"./specimen-tag": {
|
|
465
|
+
"types": "./dist/specimen-tag.d.ts",
|
|
466
|
+
"import": "./dist/specimen-tag.js"
|
|
467
|
+
},
|
|
468
|
+
"./bird-plate": {
|
|
469
|
+
"types": "./dist/bird-plate.d.ts",
|
|
470
|
+
"import": "./dist/bird-plate.js"
|
|
471
|
+
},
|
|
472
|
+
"./anatomy-plate": {
|
|
473
|
+
"types": "./dist/anatomy-plate.d.ts",
|
|
474
|
+
"import": "./dist/anatomy-plate.js"
|
|
475
|
+
},
|
|
476
|
+
"./page-index": {
|
|
477
|
+
"types": "./dist/page-index.d.ts",
|
|
478
|
+
"import": "./dist/page-index.js"
|
|
479
|
+
},
|
|
480
|
+
"./footnote": {
|
|
481
|
+
"types": "./dist/footnote.d.ts",
|
|
482
|
+
"import": "./dist/footnote.js"
|
|
483
|
+
},
|
|
464
484
|
"./code-block": {
|
|
465
485
|
"types": "./dist/code-block.d.ts",
|
|
466
486
|
"import": "./dist/code-block.js"
|
|
@@ -721,7 +741,7 @@
|
|
|
721
741
|
],
|
|
722
742
|
"peerDependencies": {
|
|
723
743
|
"@krizaka/query": ">=0.2.1",
|
|
724
|
-
"@krizaka/tailwind": ">=3.
|
|
744
|
+
"@krizaka/tailwind": ">=3.37.0",
|
|
725
745
|
"@maplibre/maplibre-react-native": ">=11",
|
|
726
746
|
"@shopify/flash-list": ">=2",
|
|
727
747
|
"expo-camera": ">=16",
|
|
@@ -1796,7 +1816,7 @@
|
|
|
1796
1816
|
{
|
|
1797
1817
|
"name": "./page",
|
|
1798
1818
|
"path": "dist/page.js",
|
|
1799
|
-
"limit": "1.
|
|
1819
|
+
"limit": "1.25 kB",
|
|
1800
1820
|
"gzip": true,
|
|
1801
1821
|
"ignore": [
|
|
1802
1822
|
"tailwind-variants",
|
|
@@ -1873,6 +1893,56 @@
|
|
|
1873
1893
|
"clsx"
|
|
1874
1894
|
]
|
|
1875
1895
|
},
|
|
1896
|
+
{
|
|
1897
|
+
"name": "./specimen-tag",
|
|
1898
|
+
"path": "dist/specimen-tag.js",
|
|
1899
|
+
"limit": "1.2 kB",
|
|
1900
|
+
"gzip": true,
|
|
1901
|
+
"ignore": [
|
|
1902
|
+
"tailwind-variants",
|
|
1903
|
+
"clsx"
|
|
1904
|
+
]
|
|
1905
|
+
},
|
|
1906
|
+
{
|
|
1907
|
+
"name": "./anatomy-plate",
|
|
1908
|
+
"path": "dist/anatomy-plate.js",
|
|
1909
|
+
"limit": "1 kB",
|
|
1910
|
+
"gzip": true,
|
|
1911
|
+
"ignore": [
|
|
1912
|
+
"tailwind-variants",
|
|
1913
|
+
"clsx"
|
|
1914
|
+
]
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
"name": "./page-index",
|
|
1918
|
+
"path": "dist/page-index.js",
|
|
1919
|
+
"limit": "1.2 kB",
|
|
1920
|
+
"gzip": true,
|
|
1921
|
+
"ignore": [
|
|
1922
|
+
"tailwind-variants",
|
|
1923
|
+
"clsx"
|
|
1924
|
+
]
|
|
1925
|
+
},
|
|
1926
|
+
{
|
|
1927
|
+
"name": "./footnote",
|
|
1928
|
+
"path": "dist/footnote.js",
|
|
1929
|
+
"limit": "1 kB",
|
|
1930
|
+
"gzip": true,
|
|
1931
|
+
"ignore": [
|
|
1932
|
+
"tailwind-variants",
|
|
1933
|
+
"clsx"
|
|
1934
|
+
]
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
"name": "./bird-plate",
|
|
1938
|
+
"path": "dist/bird-plate.js",
|
|
1939
|
+
"limit": "5.8 kB",
|
|
1940
|
+
"gzip": true,
|
|
1941
|
+
"ignore": [
|
|
1942
|
+
"tailwind-variants",
|
|
1943
|
+
"clsx"
|
|
1944
|
+
]
|
|
1945
|
+
},
|
|
1876
1946
|
{
|
|
1877
1947
|
"name": "./markdown (TanStack Markdown; the code blocks are ./code-block)",
|
|
1878
1948
|
"path": "dist/markdown.js",
|
|
@@ -2466,7 +2536,7 @@
|
|
|
2466
2536
|
"tailwind-variants": "^3.3.1",
|
|
2467
2537
|
"@krizaka/intl": "^0.2.1",
|
|
2468
2538
|
"@krizaka/pacer": "^0.1.0",
|
|
2469
|
-
"@krizaka/tokens": "^3.
|
|
2539
|
+
"@krizaka/tokens": "^3.37.0"
|
|
2470
2540
|
},
|
|
2471
2541
|
"scripts": {
|
|
2472
2542
|
"build": "node -e \"const fs=require('node:fs');fs.rmSync('dist',{recursive:true,force:true});for(const f of fs.readdirSync('registry/examples',{recursive:true}))if(/\\.(js|d\\.ts)$/.test(f))fs.rmSync('registry/examples/'+f)\" && tsup && node -e \"require('node:fs').copyFileSync('src/motion.css','dist/motion.css');require('node:fs').copyFileSync('src/blocks.css','dist/blocks.css');require('node:fs').copyFileSync('src/story.css','dist/story.css')\" && node scripts/build-registry.mjs",
|