@krizaka/ui 3.3.0 → 3.5.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/activity-feed.d.ts +199 -0
- package/dist/activity-feed.js +155 -0
- package/dist/activity-feed.js.map +1 -0
- package/dist/chat.d.ts +187 -0
- package/dist/chat.js +132 -0
- package/dist/chat.js.map +1 -0
- package/dist/chunk-7Z4KHPFC.js +42 -0
- package/dist/chunk-7Z4KHPFC.js.map +1 -0
- package/dist/chunk-ECSCA3CN.js +128 -0
- package/dist/chunk-ECSCA3CN.js.map +1 -0
- package/dist/chunk-F2GKFIYK.js +47 -0
- package/dist/chunk-F2GKFIYK.js.map +1 -0
- package/dist/data-table.js +84 -231
- package/dist/data-table.js.map +1 -1
- package/dist/description-list.d.ts +105 -0
- package/dist/description-list.js +49 -0
- package/dist/description-list.js.map +1 -0
- package/dist/index.js +13 -66
- package/dist/index.js.map +1 -1
- package/dist/kanban.d.ts +132 -0
- package/dist/kanban.js +187 -0
- package/dist/kanban.js.map +1 -0
- package/dist/list.d.ts +153 -0
- package/dist/list.js +130 -0
- package/dist/list.js.map +1 -0
- package/dist/map.d.ts +463 -0
- package/dist/map.js +952 -0
- package/dist/map.js.map +1 -0
- package/dist/match-dialog.d.ts +30 -0
- package/dist/match-dialog.js +146 -0
- package/dist/match-dialog.js.map +1 -0
- package/dist/motion.css +12 -1
- package/dist/native/map.d.ts +200 -0
- package/dist/native/map.js +673 -0
- package/dist/native/map.js.map +1 -0
- package/dist/native/media-picker.d.ts +58 -0
- package/dist/native/media-picker.js +63 -0
- package/dist/native/media-picker.js.map +1 -0
- package/dist/native.d.ts +952 -75
- package/dist/native.js +2572 -889
- package/dist/native.js.map +1 -1
- package/dist/photo-grid.d.ts +122 -0
- package/dist/photo-grid.js +94 -0
- package/dist/photo-grid.js.map +1 -0
- package/dist/stat.d.ts +31 -2
- package/dist/stat.js +21 -4
- package/dist/stat.js.map +1 -1
- package/dist/step-progress.d.ts +20 -0
- package/dist/step-progress.js +17 -0
- package/dist/step-progress.js.map +1 -0
- package/dist/swipe-deck.d.ts +183 -0
- package/dist/swipe-deck.js +144 -0
- package/dist/swipe-deck.js.map +1 -0
- package/dist/tag-selector.d.ts +26 -0
- package/dist/tag-selector.js +21 -0
- package/dist/tag-selector.js.map +1 -0
- package/dist/tree-view.d.ts +111 -0
- package/dist/tree-view.js +154 -0
- package/dist/tree-view.js.map +1 -0
- package/dist/verified-badge.d.ts +16 -0
- package/dist/verified-badge.js +23 -0
- package/dist/verified-badge.js.map +1 -0
- package/package.json +245 -10
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/action-sheet.json +121 -0
- package/registry/activity-feed.json +468 -0
- package/registry/alert.json +1 -1
- package/registry/app-shell.json +1 -1
- 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 +58 -3
- package/registry/badge.json +1 -1
- package/registry/button.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chat.json +917 -0
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +2 -2
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +232 -0
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/action-sheet/native/video-actions.d.ts +4 -0
- package/registry/examples/action-sheet/native/video-actions.dark.png +0 -0
- package/registry/examples/action-sheet/native/video-actions.js +30 -0
- package/registry/examples/action-sheet/native/video-actions.light.png +0 -0
- package/registry/examples/action-sheet/native/video-actions.tsx +24 -0
- package/registry/examples/activity-feed/job-activity.d.ts +4 -0
- package/registry/examples/activity-feed/job-activity.js +21 -0
- package/registry/examples/activity-feed/job-activity.tsx +17 -0
- package/registry/examples/activity-feed/live.d.ts +4 -0
- package/registry/examples/activity-feed/live.js +23 -0
- package/registry/examples/activity-feed/live.tsx +24 -0
- package/registry/examples/activity-feed/native/notifications.d.ts +4 -0
- package/registry/examples/activity-feed/native/notifications.dark.png +0 -0
- package/registry/examples/activity-feed/native/notifications.js +18 -0
- package/registry/examples/activity-feed/native/notifications.light.png +0 -0
- package/registry/examples/activity-feed/native/notifications.tsx +18 -0
- package/registry/examples/activity-feed/timeline.d.ts +4 -0
- package/registry/examples/activity-feed/timeline.js +25 -0
- package/registry/examples/activity-feed/timeline.tsx +19 -0
- package/registry/examples/avatar/native/presence.d.ts +4 -0
- package/registry/examples/avatar/native/presence.dark.png +0 -0
- package/registry/examples/avatar/native/presence.js +18 -0
- package/registry/examples/avatar/native/presence.light.png +0 -0
- package/registry/examples/avatar/native/presence.tsx +15 -0
- package/registry/examples/chat/conversation.d.ts +4 -0
- package/registry/examples/chat/conversation.js +22 -0
- package/registry/examples/chat/conversation.tsx +21 -0
- package/registry/examples/chat/inbox.d.ts +4 -0
- package/registry/examples/chat/inbox.js +15 -0
- package/registry/examples/chat/inbox.tsx +12 -0
- package/registry/examples/chat/native/conversation.d.ts +4 -0
- package/registry/examples/chat/native/conversation.dark.png +0 -0
- package/registry/examples/chat/native/conversation.js +23 -0
- package/registry/examples/chat/native/conversation.light.png +0 -0
- package/registry/examples/chat/native/conversation.tsx +20 -0
- package/registry/examples/chat/native/inbox.d.ts +4 -0
- package/registry/examples/chat/native/inbox.dark.png +0 -0
- package/registry/examples/chat/native/inbox.js +16 -0
- package/registry/examples/chat/native/inbox.light.png +0 -0
- package/registry/examples/chat/native/inbox.tsx +13 -0
- package/registry/examples/description-list/job-details.d.ts +4 -0
- package/registry/examples/description-list/job-details.js +23 -0
- package/registry/examples/description-list/job-details.tsx +17 -0
- package/registry/examples/description-list/key-value-grid.d.ts +4 -0
- package/registry/examples/description-list/key-value-grid.js +22 -0
- package/registry/examples/description-list/key-value-grid.tsx +16 -0
- package/registry/examples/description-list/native/job-details.d.ts +4 -0
- package/registry/examples/description-list/native/job-details.dark.png +0 -0
- package/registry/examples/description-list/native/job-details.js +33 -0
- package/registry/examples/description-list/native/job-details.light.png +0 -0
- package/registry/examples/description-list/native/job-details.tsx +24 -0
- package/registry/examples/description-list/receipt.d.ts +4 -0
- package/registry/examples/description-list/receipt.js +23 -0
- package/registry/examples/description-list/receipt.tsx +17 -0
- package/registry/examples/fab/native/extended.d.ts +4 -0
- package/registry/examples/fab/native/extended.dark.png +0 -0
- package/registry/examples/fab/native/extended.js +18 -0
- package/registry/examples/fab/native/extended.light.png +0 -0
- package/registry/examples/fab/native/extended.tsx +23 -0
- package/registry/examples/header/native/large-title.d.ts +4 -0
- package/registry/examples/header/native/large-title.dark.png +0 -0
- package/registry/examples/header/native/large-title.js +23 -0
- package/registry/examples/header/native/large-title.light.png +0 -0
- package/registry/examples/header/native/large-title.tsx +31 -0
- package/registry/examples/image-viewer/native/gallery.d.ts +4 -0
- package/registry/examples/image-viewer/native/gallery.dark.png +0 -0
- package/registry/examples/image-viewer/native/gallery.js +22 -0
- package/registry/examples/image-viewer/native/gallery.light.png +0 -0
- package/registry/examples/image-viewer/native/gallery.tsx +21 -0
- package/registry/examples/kanban/moderation.d.ts +4 -0
- package/registry/examples/kanban/moderation.js +35 -0
- package/registry/examples/kanban/moderation.tsx +37 -0
- package/registry/examples/list/jobs.d.ts +4 -0
- package/registry/examples/list/jobs.js +35 -0
- package/registry/examples/list/jobs.tsx +33 -0
- package/registry/examples/list/selectable.d.ts +4 -0
- package/registry/examples/list/selectable.js +33 -0
- package/registry/examples/list/selectable.tsx +30 -0
- package/registry/examples/list/virtualized.d.ts +4 -0
- package/registry/examples/list/virtualized.js +22 -0
- package/registry/examples/list/virtualized.tsx +17 -0
- package/registry/examples/loader/native/block.d.ts +4 -0
- package/registry/examples/loader/native/block.dark.png +0 -0
- package/registry/examples/loader/native/block.js +12 -0
- package/registry/examples/loader/native/block.light.png +0 -0
- package/registry/examples/loader/native/block.tsx +11 -0
- package/registry/examples/loader/native/job-wait.d.ts +4 -0
- package/registry/examples/loader/native/job-wait.dark.png +0 -0
- package/registry/examples/loader/native/job-wait.js +17 -0
- package/registry/examples/loader/native/job-wait.light.png +0 -0
- package/registry/examples/loader/native/job-wait.tsx +14 -0
- package/registry/examples/map/cluster.d.ts +4 -0
- package/registry/examples/map/cluster.js +16 -0
- package/registry/examples/map/cluster.tsx +18 -0
- package/registry/examples/map/location-picker.d.ts +4 -0
- package/registry/examples/map/location-picker.js +24 -0
- package/registry/examples/map/location-picker.tsx +22 -0
- package/registry/examples/map/native/location-picker.d.ts +4 -0
- package/registry/examples/map/native/location-picker.dark.png +0 -0
- package/registry/examples/map/native/location-picker.js +14 -0
- package/registry/examples/map/native/location-picker.light.png +0 -0
- package/registry/examples/map/native/location-picker.tsx +13 -0
- package/registry/examples/map/native/places.d.ts +4 -0
- package/registry/examples/map/native/places.dark.png +0 -0
- package/registry/examples/map/native/places.js +25 -0
- package/registry/examples/map/native/places.light.png +0 -0
- package/registry/examples/map/native/places.tsx +27 -0
- package/registry/examples/map/places.d.ts +4 -0
- package/registry/examples/map/places.js +28 -0
- package/registry/examples/map/places.tsx +28 -0
- package/registry/examples/map/static.d.ts +4 -0
- package/registry/examples/map/static.js +22 -0
- package/registry/examples/map/static.tsx +18 -0
- package/registry/examples/match-dialog/its-a-match.d.ts +4 -0
- package/registry/examples/match-dialog/its-a-match.js +29 -0
- package/registry/examples/match-dialog/its-a-match.tsx +25 -0
- package/registry/examples/match-dialog/native/its-a-match.d.ts +4 -0
- package/registry/examples/match-dialog/native/its-a-match.dark.png +0 -0
- package/registry/examples/match-dialog/native/its-a-match.js +28 -0
- package/registry/examples/match-dialog/native/its-a-match.light.png +0 -0
- package/registry/examples/match-dialog/native/its-a-match.tsx +22 -0
- package/registry/examples/media-picker/native/story.d.ts +4 -0
- package/registry/examples/media-picker/native/story.dark.png +0 -0
- package/registry/examples/media-picker/native/story.js +30 -0
- package/registry/examples/media-picker/native/story.light.png +0 -0
- package/registry/examples/media-picker/native/story.tsx +26 -0
- package/registry/examples/meter/native/credits.d.ts +4 -0
- package/registry/examples/meter/native/credits.dark.png +0 -0
- package/registry/examples/meter/native/credits.js +15 -0
- package/registry/examples/meter/native/credits.light.png +0 -0
- package/registry/examples/meter/native/credits.tsx +12 -0
- package/registry/examples/meter/native/split-ring.d.ts +4 -0
- package/registry/examples/meter/native/split-ring.dark.png +0 -0
- package/registry/examples/meter/native/split-ring.js +24 -0
- package/registry/examples/meter/native/split-ring.light.png +0 -0
- package/registry/examples/meter/native/split-ring.tsx +19 -0
- package/registry/examples/number-ticker/native/balance.d.ts +4 -0
- package/registry/examples/number-ticker/native/balance.dark.png +0 -0
- package/registry/examples/number-ticker/native/balance.js +18 -0
- package/registry/examples/number-ticker/native/balance.light.png +0 -0
- package/registry/examples/number-ticker/native/balance.tsx +17 -0
- package/registry/examples/onboarding/native/first-launch.d.ts +4 -0
- package/registry/examples/onboarding/native/first-launch.dark.png +0 -0
- package/registry/examples/onboarding/native/first-launch.js +23 -0
- package/registry/examples/onboarding/native/first-launch.light.png +0 -0
- package/registry/examples/onboarding/native/first-launch.tsx +19 -0
- package/registry/examples/otp-input/native/invalid.d.ts +4 -0
- package/registry/examples/otp-input/native/invalid.dark.png +0 -0
- package/registry/examples/otp-input/native/invalid.js +15 -0
- package/registry/examples/otp-input/native/invalid.light.png +0 -0
- package/registry/examples/otp-input/native/invalid.tsx +14 -0
- package/registry/examples/otp-input/native/verify.d.ts +4 -0
- package/registry/examples/otp-input/native/verify.dark.png +0 -0
- package/registry/examples/otp-input/native/verify.js +17 -0
- package/registry/examples/otp-input/native/verify.light.png +0 -0
- package/registry/examples/otp-input/native/verify.tsx +14 -0
- package/registry/examples/permission-prompt/native/blocked.d.ts +4 -0
- package/registry/examples/permission-prompt/native/blocked.dark.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.js +25 -0
- package/registry/examples/permission-prompt/native/blocked.light.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.tsx +21 -0
- package/registry/examples/permission-prompt/native/camera.d.ts +4 -0
- package/registry/examples/permission-prompt/native/camera.dark.png +0 -0
- package/registry/examples/permission-prompt/native/camera.js +25 -0
- package/registry/examples/permission-prompt/native/camera.light.png +0 -0
- package/registry/examples/permission-prompt/native/camera.tsx +21 -0
- package/registry/examples/photo-grid/native/profile-photos.d.ts +4 -0
- package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.js +27 -0
- package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.tsx +24 -0
- package/registry/examples/photo-grid/profile-photos.d.ts +4 -0
- package/registry/examples/photo-grid/profile-photos.js +28 -0
- package/registry/examples/photo-grid/profile-photos.tsx +25 -0
- package/registry/examples/pull-to-refresh/native/feed.d.ts +4 -0
- package/registry/examples/pull-to-refresh/native/feed.dark.png +0 -0
- package/registry/examples/pull-to-refresh/native/feed.js +14 -0
- package/registry/examples/pull-to-refresh/native/feed.light.png +0 -0
- package/registry/examples/pull-to-refresh/native/feed.tsx +19 -0
- package/registry/examples/screen/native/app-shell.d.ts +4 -0
- package/registry/examples/screen/native/app-shell.dark.png +0 -0
- package/registry/examples/screen/native/app-shell.js +25 -0
- package/registry/examples/screen/native/app-shell.light.png +0 -0
- package/registry/examples/screen/native/app-shell.tsx +33 -0
- package/registry/examples/screen/native/auth.d.ts +4 -0
- package/registry/examples/screen/native/auth.dark.png +0 -0
- package/registry/examples/screen/native/auth.js +24 -0
- package/registry/examples/screen/native/auth.light.png +0 -0
- package/registry/examples/screen/native/auth.tsx +20 -0
- package/registry/examples/screen/native/chat.d.ts +4 -0
- package/registry/examples/screen/native/chat.dark.png +0 -0
- package/registry/examples/screen/native/chat.js +27 -0
- package/registry/examples/screen/native/chat.light.png +0 -0
- package/registry/examples/screen/native/chat.tsx +22 -0
- package/registry/examples/screen/native/feed.d.ts +4 -0
- package/registry/examples/screen/native/feed.dark.png +0 -0
- package/registry/examples/screen/native/feed.js +24 -0
- package/registry/examples/screen/native/feed.light.png +0 -0
- package/registry/examples/screen/native/feed.tsx +34 -0
- package/registry/examples/screen/native/profile.d.ts +4 -0
- package/registry/examples/screen/native/profile.dark.png +0 -0
- package/registry/examples/screen/native/profile.js +29 -0
- package/registry/examples/screen/native/profile.light.png +0 -0
- package/registry/examples/screen/native/profile.tsx +27 -0
- package/registry/examples/screen/native/settings.d.ts +4 -0
- package/registry/examples/screen/native/settings.dark.png +0 -0
- package/registry/examples/screen/native/settings.js +20 -0
- package/registry/examples/screen/native/settings.light.png +0 -0
- package/registry/examples/screen/native/settings.tsx +19 -0
- package/registry/examples/search-field/native/cancel.d.ts +4 -0
- package/registry/examples/search-field/native/cancel.dark.png +0 -0
- package/registry/examples/search-field/native/cancel.js +14 -0
- package/registry/examples/search-field/native/cancel.light.png +0 -0
- package/registry/examples/search-field/native/cancel.tsx +13 -0
- package/registry/examples/stat/grid.d.ts +4 -0
- package/registry/examples/stat/grid.js +17 -0
- package/registry/examples/stat/grid.tsx +14 -0
- package/registry/examples/step-progress/native/sign-up.d.ts +4 -0
- package/registry/examples/step-progress/native/sign-up.dark.png +0 -0
- package/registry/examples/step-progress/native/sign-up.js +12 -0
- package/registry/examples/step-progress/native/sign-up.light.png +0 -0
- package/registry/examples/step-progress/native/sign-up.tsx +11 -0
- package/registry/examples/step-progress/sign-up.d.ts +4 -0
- package/registry/examples/step-progress/sign-up.js +22 -0
- package/registry/examples/step-progress/sign-up.tsx +16 -0
- package/registry/examples/stepper/native/run.d.ts +4 -0
- package/registry/examples/stepper/native/run.dark.png +0 -0
- package/registry/examples/stepper/native/run.js +24 -0
- package/registry/examples/stepper/native/run.light.png +0 -0
- package/registry/examples/stepper/native/run.tsx +20 -0
- package/registry/examples/swipe-deck/discover.d.ts +4 -0
- package/registry/examples/swipe-deck/discover.js +41 -0
- package/registry/examples/swipe-deck/discover.tsx +37 -0
- package/registry/examples/swipe-deck/native/discover.d.ts +4 -0
- package/registry/examples/swipe-deck/native/discover.dark.png +0 -0
- package/registry/examples/swipe-deck/native/discover.js +39 -0
- package/registry/examples/swipe-deck/native/discover.light.png +0 -0
- package/registry/examples/swipe-deck/native/discover.tsx +35 -0
- package/registry/examples/swipeable-row/native/conversation.d.ts +4 -0
- package/registry/examples/swipeable-row/native/conversation.dark.png +0 -0
- package/registry/examples/swipeable-row/native/conversation.js +30 -0
- package/registry/examples/swipeable-row/native/conversation.light.png +0 -0
- package/registry/examples/swipeable-row/native/conversation.tsx +27 -0
- package/registry/examples/tab-bar/native/main-sections.d.ts +4 -0
- package/registry/examples/tab-bar/native/main-sections.dark.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.js +29 -0
- package/registry/examples/tab-bar/native/main-sections.light.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.tsx +30 -0
- package/registry/examples/tabs/native/sections.d.ts +4 -0
- package/registry/examples/tabs/native/sections.dark.png +0 -0
- package/registry/examples/tabs/native/sections.js +23 -0
- package/registry/examples/tabs/native/sections.light.png +0 -0
- package/registry/examples/tabs/native/sections.tsx +19 -0
- package/registry/examples/tabs/native/segmented.d.ts +4 -0
- package/registry/examples/tabs/native/segmented.dark.png +0 -0
- package/registry/examples/tabs/native/segmented.js +22 -0
- package/registry/examples/tabs/native/segmented.light.png +0 -0
- package/registry/examples/tabs/native/segmented.tsx +18 -0
- package/registry/examples/tag-selector/interests.d.ts +4 -0
- package/registry/examples/tag-selector/interests.js +14 -0
- package/registry/examples/tag-selector/interests.tsx +12 -0
- package/registry/examples/tag-selector/native/interests.d.ts +4 -0
- package/registry/examples/tag-selector/native/interests.dark.png +0 -0
- package/registry/examples/tag-selector/native/interests.js +15 -0
- package/registry/examples/tag-selector/native/interests.light.png +0 -0
- package/registry/examples/tag-selector/native/interests.tsx +15 -0
- package/registry/examples/toast/native/snackbar.d.ts +4 -0
- package/registry/examples/toast/native/snackbar.dark.png +0 -0
- package/registry/examples/toast/native/snackbar.js +23 -0
- package/registry/examples/toast/native/snackbar.light.png +0 -0
- package/registry/examples/toast/native/snackbar.tsx +21 -0
- package/registry/examples/tree-view/docs.d.ts +4 -0
- package/registry/examples/tree-view/docs.js +24 -0
- package/registry/examples/tree-view/docs.tsx +22 -0
- package/registry/examples/tree-view/lazy.d.ts +4 -0
- package/registry/examples/tree-view/lazy.js +21 -0
- package/registry/examples/tree-view/lazy.tsx +19 -0
- package/registry/examples/verified-badge/native/verified.d.ts +4 -0
- package/registry/examples/verified-badge/native/verified.dark.png +0 -0
- package/registry/examples/verified-badge/native/verified.js +18 -0
- package/registry/examples/verified-badge/native/verified.light.png +0 -0
- package/registry/examples/verified-badge/native/verified.tsx +15 -0
- package/registry/examples/verified-badge/verified.d.ts +4 -0
- package/registry/examples/verified-badge/verified.js +17 -0
- package/registry/examples/verified-badge/verified.tsx +13 -0
- package/registry/fab.json +122 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +1 -1
- package/registry/form.json +2 -2
- package/registry/gallery-page.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/header.json +137 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/image-viewer.json +107 -0
- package/registry/index.json +441 -25
- package/registry/iso.json +1 -1
- package/registry/kanban.json +253 -0
- package/registry/kbd.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +367 -30
- package/registry/loader.json +157 -4
- package/registry/longform-page.json +1 -1
- package/registry/map.json +1368 -0
- 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 +300 -0
- package/registry/media-capture.json +1 -1
- package/registry/media-picker.json +129 -0
- package/registry/meter.json +136 -4
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +96 -4
- package/registry/onboarding.json +95 -0
- package/registry/otp-input.json +150 -0
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/permission-prompt.json +172 -0
- package/registry/photo-grid.json +302 -0
- 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/pull-to-refresh.json +74 -0
- package/registry/radio-group.json +1 -1
- package/registry/screen.json +184 -0
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +30 -3
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +68 -5
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +255 -0
- package/registry/stepper.json +75 -4
- package/registry/swipe-deck.json +512 -0
- package/registry/swipeable-row.json +124 -0
- package/registry/switch.json +1 -1
- package/registry/tab-bar.json +115 -0
- package/registry/tabs.json +94 -4
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +276 -0
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +8 -1
- package/registry/toast.json +17 -3
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +291 -0
- package/registry/verified-badge.json +202 -0
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/skills/map/SKILL.md +35 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type ActivityTone = "neutral" | "accent" | "success" | "warning" | "danger" | "info";
|
|
5
|
+
type ActivityEvent = {
|
|
6
|
+
/** A stable id. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** When it happened: an ISO date-time, an epoch in ms or a `Date`. */
|
|
9
|
+
at: string | number | Date;
|
|
10
|
+
/** What happened, in a sentence — passed translated (“Mina tipped your video $5”). */
|
|
11
|
+
title: string;
|
|
12
|
+
/** A detail under it. */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Who did it (folds a run of the same `kind` by the same actor). */
|
|
15
|
+
actor?: string;
|
|
16
|
+
/** The kind of event (`tip`, `bid`, `job.done`): with `actor`, what folds. */
|
|
17
|
+
kind?: string;
|
|
18
|
+
/** The tone of its marker: success for a payout, danger for a failure. */
|
|
19
|
+
tone?: ActivityTone;
|
|
20
|
+
};
|
|
21
|
+
type ActivityGroup<T extends ActivityEvent> = {
|
|
22
|
+
/** The day's heading (“Today”, “Yesterday”, “Monday, Oct 6”). */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Its events, newest first; a folded run is its newest event with `count` > 1. */
|
|
25
|
+
events: {
|
|
26
|
+
event: T;
|
|
27
|
+
count: number;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
/** Groups events (any order) by day, newest first, folding runs of the same actor and kind when `fold` is set. */
|
|
31
|
+
declare function groupActivity<T extends ActivityEvent>(events: readonly T[], { now, locale, today, yesterday, fold }?: {
|
|
32
|
+
now?: Date;
|
|
33
|
+
locale?: string;
|
|
34
|
+
today?: string;
|
|
35
|
+
yesterday?: string;
|
|
36
|
+
fold?: boolean;
|
|
37
|
+
}): ActivityGroup<T>[];
|
|
38
|
+
/** “2 minutes ago”, “yesterday”: how long ago, in the largest unit that reads well (`style` short: “2 min. ago”). */
|
|
39
|
+
declare function timeAgo(at: string | number | Date, { now, locale, style }?: {
|
|
40
|
+
now?: Date;
|
|
41
|
+
locale?: string;
|
|
42
|
+
style?: "long" | "short" | "narrow";
|
|
43
|
+
}): string;
|
|
44
|
+
|
|
45
|
+
declare const activityFeed: tailwind_variants.TVReturnType<{
|
|
46
|
+
[key: string]: {
|
|
47
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
48
|
+
root?: tailwind_variants.ClassValue;
|
|
49
|
+
group?: tailwind_variants.ClassValue;
|
|
50
|
+
heading?: tailwind_variants.ClassValue;
|
|
51
|
+
ol?: tailwind_variants.ClassValue;
|
|
52
|
+
item?: tailwind_variants.ClassValue;
|
|
53
|
+
marker?: tailwind_variants.ClassValue;
|
|
54
|
+
rail?: tailwind_variants.ClassValue;
|
|
55
|
+
body?: tailwind_variants.ClassValue;
|
|
56
|
+
title?: tailwind_variants.ClassValue;
|
|
57
|
+
count?: tailwind_variants.ClassValue;
|
|
58
|
+
description?: tailwind_variants.ClassValue;
|
|
59
|
+
time?: tailwind_variants.ClassValue;
|
|
60
|
+
leading?: tailwind_variants.ClassValue;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
} | {
|
|
64
|
+
[x: string]: {
|
|
65
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
66
|
+
root?: tailwind_variants.ClassValue;
|
|
67
|
+
group?: tailwind_variants.ClassValue;
|
|
68
|
+
heading?: tailwind_variants.ClassValue;
|
|
69
|
+
ol?: tailwind_variants.ClassValue;
|
|
70
|
+
item?: tailwind_variants.ClassValue;
|
|
71
|
+
marker?: tailwind_variants.ClassValue;
|
|
72
|
+
rail?: tailwind_variants.ClassValue;
|
|
73
|
+
body?: tailwind_variants.ClassValue;
|
|
74
|
+
title?: tailwind_variants.ClassValue;
|
|
75
|
+
count?: tailwind_variants.ClassValue;
|
|
76
|
+
description?: tailwind_variants.ClassValue;
|
|
77
|
+
time?: tailwind_variants.ClassValue;
|
|
78
|
+
leading?: tailwind_variants.ClassValue;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
} | {}, {
|
|
82
|
+
root: string;
|
|
83
|
+
group: string;
|
|
84
|
+
heading: string;
|
|
85
|
+
ol: string;
|
|
86
|
+
item: string;
|
|
87
|
+
marker: string;
|
|
88
|
+
rail: string;
|
|
89
|
+
body: string;
|
|
90
|
+
title: string;
|
|
91
|
+
count: string;
|
|
92
|
+
description: string;
|
|
93
|
+
time: string;
|
|
94
|
+
leading: string;
|
|
95
|
+
}, undefined, {
|
|
96
|
+
[key: string]: {
|
|
97
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
98
|
+
root?: tailwind_variants.ClassValue;
|
|
99
|
+
group?: tailwind_variants.ClassValue;
|
|
100
|
+
heading?: tailwind_variants.ClassValue;
|
|
101
|
+
ol?: tailwind_variants.ClassValue;
|
|
102
|
+
item?: tailwind_variants.ClassValue;
|
|
103
|
+
marker?: tailwind_variants.ClassValue;
|
|
104
|
+
rail?: tailwind_variants.ClassValue;
|
|
105
|
+
body?: tailwind_variants.ClassValue;
|
|
106
|
+
title?: tailwind_variants.ClassValue;
|
|
107
|
+
count?: tailwind_variants.ClassValue;
|
|
108
|
+
description?: tailwind_variants.ClassValue;
|
|
109
|
+
time?: tailwind_variants.ClassValue;
|
|
110
|
+
leading?: tailwind_variants.ClassValue;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
} | {}, {
|
|
114
|
+
root: string;
|
|
115
|
+
group: string;
|
|
116
|
+
heading: string;
|
|
117
|
+
ol: string;
|
|
118
|
+
item: string;
|
|
119
|
+
marker: string;
|
|
120
|
+
rail: string;
|
|
121
|
+
body: string;
|
|
122
|
+
title: string;
|
|
123
|
+
count: string;
|
|
124
|
+
description: string;
|
|
125
|
+
time: string;
|
|
126
|
+
leading: string;
|
|
127
|
+
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
128
|
+
root: string;
|
|
129
|
+
group: string;
|
|
130
|
+
heading: string;
|
|
131
|
+
ol: string;
|
|
132
|
+
item: string;
|
|
133
|
+
marker: string;
|
|
134
|
+
rail: string;
|
|
135
|
+
body: string;
|
|
136
|
+
title: string;
|
|
137
|
+
count: string;
|
|
138
|
+
description: string;
|
|
139
|
+
time: string;
|
|
140
|
+
leading: string;
|
|
141
|
+
}>>;
|
|
142
|
+
type ActivityFeedLabels = {
|
|
143
|
+
/** The heading of today's events. */
|
|
144
|
+
today: string;
|
|
145
|
+
/** The heading of yesterday's. */
|
|
146
|
+
yesterday: string;
|
|
147
|
+
/** A folded run: `(n) => "×" + n` (“3 times”). */
|
|
148
|
+
times: (count: number) => string;
|
|
149
|
+
/** Announced when new events arrive in a live feed: `(n) => n + " new events"`. */
|
|
150
|
+
newEvents: (count: number) => string;
|
|
151
|
+
};
|
|
152
|
+
declare const activityFeedLabels: ActivityFeedLabels;
|
|
153
|
+
type ActivityFeedProps<T extends ActivityEvent> = {
|
|
154
|
+
/** The events, in any order. */
|
|
155
|
+
events: readonly T[];
|
|
156
|
+
/** The feed's accessible name (“Activity”). */
|
|
157
|
+
"aria-label": string;
|
|
158
|
+
/** The locale of the dates and the “… ago”. Default `en-US`. */
|
|
159
|
+
locale?: string;
|
|
160
|
+
/** Now, for the “… ago” and the day headings (pass it from the server for the same text on both sides). */
|
|
161
|
+
now?: Date;
|
|
162
|
+
/** Refresh the “… ago” every minute. Default true. */
|
|
163
|
+
ticking?: boolean;
|
|
164
|
+
/** Fold the runs of the same actor and kind. Default true. */
|
|
165
|
+
fold?: boolean;
|
|
166
|
+
/** Announce new events politely (a stream). */
|
|
167
|
+
live?: boolean;
|
|
168
|
+
/** Before an event's text: its actor's `Avatar`, an icon. */
|
|
169
|
+
leading?: (event: T) => React.ReactNode;
|
|
170
|
+
/** After an event's text: an action (Reply, View). */
|
|
171
|
+
action?: (event: T) => React.ReactNode;
|
|
172
|
+
/** The words, passed translated; English by default. */
|
|
173
|
+
labels?: Partial<ActivityFeedLabels>;
|
|
174
|
+
/** Shown when there is no event (an `EmptyState`). */
|
|
175
|
+
empty?: React.ReactNode;
|
|
176
|
+
/** Classes merged on the root. */
|
|
177
|
+
className?: string;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* What happened, newest first: grouped by day, runs folded (“Mina tipped ×3”), “2 min ago” kept fresh, new events
|
|
181
|
+
* announced when `live`. Orazaka's job activity, Orochia's notifications, the console's audit log.
|
|
182
|
+
*/
|
|
183
|
+
declare function ActivityFeed<T extends ActivityEvent>({ events, "aria-label": label, locale, now: given, ticking, fold, live, leading, action, labels: words, empty, className }: ActivityFeedProps<T>): React.JSX.Element;
|
|
184
|
+
type TimelineProps<T extends ActivityEvent> = {
|
|
185
|
+
/** One thing's events, oldest first (a job's run, a payout's life). */
|
|
186
|
+
events: readonly T[];
|
|
187
|
+
/** The timeline's accessible name (“History of the payout”). */
|
|
188
|
+
"aria-label": string;
|
|
189
|
+
/** The locale of the times. Default `en-US`. */
|
|
190
|
+
locale?: string;
|
|
191
|
+
/** How a time is written: `time` (14:02, default), `datetime`, `date`. */
|
|
192
|
+
timeStyle?: "time" | "datetime" | "date";
|
|
193
|
+
/** Classes merged on the list. */
|
|
194
|
+
className?: string;
|
|
195
|
+
};
|
|
196
|
+
/** One thing's history on a rail, oldest first: each event a marker in its tone, its time and its words. */
|
|
197
|
+
declare function Timeline<T extends ActivityEvent>({ events, "aria-label": label, locale, timeStyle, className }: TimelineProps<T>): React.JSX.Element;
|
|
198
|
+
|
|
199
|
+
export { type ActivityEvent, ActivityFeed, type ActivityFeedLabels, type ActivityFeedProps, type ActivityGroup, type ActivityTone, Timeline, type TimelineProps, activityFeed, activityFeedLabels, groupActivity, timeAgo };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/activity-feed/activity-feed.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { tv } from "tailwind-variants";
|
|
6
|
+
|
|
7
|
+
// src/activity-feed/group.ts
|
|
8
|
+
var dayKey = (date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
|
|
9
|
+
function groupActivity(events, { now = /* @__PURE__ */ new Date(), locale = "en-US", today = "Today", yesterday = "Yesterday", fold = true } = {}) {
|
|
10
|
+
const sorted = [...events].sort((a, b) => new Date(b.at).getTime() - new Date(a.at).getTime());
|
|
11
|
+
const day = new Intl.DateTimeFormat(locale, { weekday: "long", month: "short", day: "numeric" });
|
|
12
|
+
const todayKey = dayKey(now);
|
|
13
|
+
const yesterdayKey = dayKey(new Date(now.getTime() - 864e5));
|
|
14
|
+
const groups = [];
|
|
15
|
+
let current = null;
|
|
16
|
+
let currentKey = "";
|
|
17
|
+
for (const event of sorted) {
|
|
18
|
+
const date = new Date(event.at);
|
|
19
|
+
const key = dayKey(date);
|
|
20
|
+
if (!current || key !== currentKey) {
|
|
21
|
+
currentKey = key;
|
|
22
|
+
current = { label: key === todayKey ? today : key === yesterdayKey ? yesterday : day.format(date), events: [] };
|
|
23
|
+
groups.push(current);
|
|
24
|
+
}
|
|
25
|
+
const last = current.events[current.events.length - 1];
|
|
26
|
+
if (fold && last && event.actor && event.kind && last.event.actor === event.actor && last.event.kind === event.kind) last.count += 1;
|
|
27
|
+
else current.events.push({ event, count: 1 });
|
|
28
|
+
}
|
|
29
|
+
return groups;
|
|
30
|
+
}
|
|
31
|
+
var UNITS = [
|
|
32
|
+
["second", 60],
|
|
33
|
+
["minute", 60],
|
|
34
|
+
["hour", 24],
|
|
35
|
+
["day", 7],
|
|
36
|
+
["week", 4.35],
|
|
37
|
+
["month", 12],
|
|
38
|
+
["year", Number.POSITIVE_INFINITY]
|
|
39
|
+
];
|
|
40
|
+
function timeAgo(at, { now = /* @__PURE__ */ new Date(), locale = "en-US", style = "short" } = {}) {
|
|
41
|
+
let value = (new Date(at).getTime() - now.getTime()) / 1e3;
|
|
42
|
+
let unit = "second";
|
|
43
|
+
for (const [name, size] of UNITS) {
|
|
44
|
+
unit = name;
|
|
45
|
+
if (Math.abs(value) < size - 0.5) break;
|
|
46
|
+
value /= size;
|
|
47
|
+
}
|
|
48
|
+
return new Intl.RelativeTimeFormat(locale, { numeric: "auto", style }).format(Math.round(value) + 0, unit);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/activity-feed/activity-feed.tsx
|
|
52
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
53
|
+
var activityFeed = tv({
|
|
54
|
+
slots: {
|
|
55
|
+
root: "flex flex-col gap-5",
|
|
56
|
+
group: "flex flex-col gap-1",
|
|
57
|
+
heading: "sticky top-0 z-10 bg-surface-0/90 py-1 text-xs font-semibold uppercase tracking-wider text-fg-secondary backdrop-blur-sm",
|
|
58
|
+
ol: "m-0 flex list-none flex-col p-0",
|
|
59
|
+
item: "relative flex gap-3 py-2.5",
|
|
60
|
+
marker: "relative mt-1 flex h-2.5 w-2.5 shrink-0 rounded-full bg-[var(--kz-af-tone)] ring-4 ring-surface-0",
|
|
61
|
+
rail: "absolute left-[4.5px] top-5 -bottom-1 w-px bg-border-default",
|
|
62
|
+
body: "flex min-w-0 flex-1 flex-col",
|
|
63
|
+
title: "text-sm text-fg",
|
|
64
|
+
count: "ml-1.5 inline-flex rounded-full bg-surface-3 px-1.5 text-xs font-semibold tabular-nums text-fg-secondary",
|
|
65
|
+
description: "text-xs text-fg-secondary",
|
|
66
|
+
time: "shrink-0 pt-0.5 text-xs tabular-nums text-fg-secondary",
|
|
67
|
+
leading: "shrink-0"
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var TONE = {
|
|
71
|
+
neutral: "var(--kz-border-strong)",
|
|
72
|
+
accent: "var(--kz-accent)",
|
|
73
|
+
success: "var(--kz-success)",
|
|
74
|
+
warning: "var(--kz-warning)",
|
|
75
|
+
danger: "var(--kz-danger)",
|
|
76
|
+
info: "var(--kz-info)"
|
|
77
|
+
};
|
|
78
|
+
var activityFeedLabels = {
|
|
79
|
+
today: "Today",
|
|
80
|
+
yesterday: "Yesterday",
|
|
81
|
+
times: (count) => `\xD7${count}`,
|
|
82
|
+
newEvents: (count) => count === 1 ? "1 new event" : `${count} new events`
|
|
83
|
+
};
|
|
84
|
+
function useNow(initial, ticking) {
|
|
85
|
+
const [now, setNow] = React.useState(() => initial ?? /* @__PURE__ */ new Date());
|
|
86
|
+
React.useEffect(() => {
|
|
87
|
+
if (!ticking) return;
|
|
88
|
+
const timer = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
|
|
89
|
+
return () => clearInterval(timer);
|
|
90
|
+
}, [ticking]);
|
|
91
|
+
return now;
|
|
92
|
+
}
|
|
93
|
+
function ActivityFeed({ events, "aria-label": label, locale = "en-US", now: given, ticking = true, fold = true, live, leading, action, labels: words, empty, className }) {
|
|
94
|
+
const labels = { ...activityFeedLabels, ...words };
|
|
95
|
+
const s = activityFeed();
|
|
96
|
+
const now = useNow(given, ticking && !given);
|
|
97
|
+
const groups = groupActivity(events, { now, locale, today: labels.today, yesterday: labels.yesterday, fold });
|
|
98
|
+
const seen = React.useRef(events.length);
|
|
99
|
+
const [announcement, setAnnouncement] = React.useState("");
|
|
100
|
+
React.useEffect(() => {
|
|
101
|
+
const added = events.length - seen.current;
|
|
102
|
+
seen.current = events.length;
|
|
103
|
+
if (!live || added <= 0) return;
|
|
104
|
+
const timer = setTimeout(() => setAnnouncement(labels.newEvents(added)), 0);
|
|
105
|
+
return () => clearTimeout(timer);
|
|
106
|
+
}, [events.length, live]);
|
|
107
|
+
return /* @__PURE__ */ jsxs("section", { "aria-label": label, className: s.root({ className }), children: [
|
|
108
|
+
live ? /* @__PURE__ */ jsx("p", { className: "sr-only", "aria-live": "polite", children: announcement }) : null,
|
|
109
|
+
groups.length === 0 && empty ? empty : null,
|
|
110
|
+
groups.map((group) => /* @__PURE__ */ jsxs("div", { className: s.group(), children: [
|
|
111
|
+
/* @__PURE__ */ jsx("h3", { className: s.heading(), children: group.label }),
|
|
112
|
+
/* @__PURE__ */ jsx("ol", { className: s.ol(), children: group.events.map(({ event, count }) => {
|
|
113
|
+
const date = new Date(event.at);
|
|
114
|
+
return /* @__PURE__ */ jsxs("li", { className: s.item(), style: { ["--kz-af-tone"]: TONE[event.tone ?? "neutral"] }, children: [
|
|
115
|
+
leading ? /* @__PURE__ */ jsx("span", { className: s.leading(), children: leading(event) }) : /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: s.marker() }),
|
|
116
|
+
/* @__PURE__ */ jsxs("span", { className: s.body(), children: [
|
|
117
|
+
/* @__PURE__ */ jsxs("span", { className: s.title(), children: [
|
|
118
|
+
event.title,
|
|
119
|
+
count > 1 ? /* @__PURE__ */ jsx("span", { className: s.count(), children: labels.times(count) }) : null
|
|
120
|
+
] }),
|
|
121
|
+
event.description ? /* @__PURE__ */ jsx("span", { className: s.description(), children: event.description }) : null
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ jsx("time", { dateTime: date.toISOString(), title: date.toLocaleString(locale), className: s.time(), children: timeAgo(date, { now, locale }) }),
|
|
124
|
+
action ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: action(event) }) : null
|
|
125
|
+
] }, event.id);
|
|
126
|
+
}) })
|
|
127
|
+
] }, group.label))
|
|
128
|
+
] });
|
|
129
|
+
}
|
|
130
|
+
function Timeline({ events, "aria-label": label, locale = "en-US", timeStyle = "time", className }) {
|
|
131
|
+
const s = activityFeed();
|
|
132
|
+
const options = timeStyle === "time" ? { hour: "2-digit", minute: "2-digit" } : timeStyle === "date" ? { dateStyle: "medium" } : { dateStyle: "medium", timeStyle: "short" };
|
|
133
|
+
const write = new Intl.DateTimeFormat(locale, options);
|
|
134
|
+
return /* @__PURE__ */ jsx("ol", { "aria-label": label, className: s.ol({ className }), children: events.map((event, i) => {
|
|
135
|
+
const date = new Date(event.at);
|
|
136
|
+
return /* @__PURE__ */ jsxs("li", { className: s.item(), style: { ["--kz-af-tone"]: TONE[event.tone ?? "neutral"] }, children: [
|
|
137
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: s.marker() }),
|
|
138
|
+
i < events.length - 1 ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: s.rail() }) : null,
|
|
139
|
+
/* @__PURE__ */ jsxs("span", { className: s.body(), children: [
|
|
140
|
+
/* @__PURE__ */ jsx("span", { className: s.title(), children: event.title }),
|
|
141
|
+
event.description ? /* @__PURE__ */ jsx("span", { className: s.description(), children: event.description }) : null
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsx("time", { dateTime: date.toISOString(), className: s.time(), children: write.format(date) })
|
|
144
|
+
] }, event.id);
|
|
145
|
+
}) });
|
|
146
|
+
}
|
|
147
|
+
export {
|
|
148
|
+
ActivityFeed,
|
|
149
|
+
Timeline,
|
|
150
|
+
activityFeed,
|
|
151
|
+
activityFeedLabels,
|
|
152
|
+
groupActivity,
|
|
153
|
+
timeAgo
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=activity-feed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/activity-feed/activity-feed.tsx","../src/activity-feed/group.ts"],"sourcesContent":["// Client (the clock of “… ago”, the announcement of new events). What happened, newest first: an activity feed\n// grouped by day with folded runs and relative times, announced politely when it is live; and a `Timeline` — one\n// thing's history on a rail, oldest first. Words are props.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { type ActivityEvent, type ActivityTone, groupActivity, timeAgo } from \"./group\";\n\nexport const activityFeed = tv({\n slots: {\n root: \"flex flex-col gap-5\",\n group: \"flex flex-col gap-1\",\n heading: \"sticky top-0 z-10 bg-surface-0/90 py-1 text-xs font-semibold uppercase tracking-wider text-fg-secondary backdrop-blur-sm\",\n ol: \"m-0 flex list-none flex-col p-0\",\n item: \"relative flex gap-3 py-2.5\",\n marker: \"relative mt-1 flex h-2.5 w-2.5 shrink-0 rounded-full bg-[var(--kz-af-tone)] ring-4 ring-surface-0\",\n rail: \"absolute left-[4.5px] top-5 -bottom-1 w-px bg-border-default\",\n body: \"flex min-w-0 flex-1 flex-col\",\n title: \"text-sm text-fg\",\n count: \"ml-1.5 inline-flex rounded-full bg-surface-3 px-1.5 text-xs font-semibold tabular-nums text-fg-secondary\",\n description: \"text-xs text-fg-secondary\",\n time: \"shrink-0 pt-0.5 text-xs tabular-nums text-fg-secondary\",\n leading: \"shrink-0\",\n },\n});\n\nconst TONE: Record<ActivityTone, string> = {\n neutral: \"var(--kz-border-strong)\",\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success)\",\n warning: \"var(--kz-warning)\",\n danger: \"var(--kz-danger)\",\n info: \"var(--kz-info)\",\n};\n\nexport type ActivityFeedLabels = {\n /** The heading of today's events. */\n today: string;\n /** The heading of yesterday's. */\n yesterday: string;\n /** A folded run: `(n) => \"×\" + n` (“3 times”). */\n times: (count: number) => string;\n /** Announced when new events arrive in a live feed: `(n) => n + \" new events\"`. */\n newEvents: (count: number) => string;\n};\n\nexport const activityFeedLabels: ActivityFeedLabels = {\n today: \"Today\",\n yesterday: \"Yesterday\",\n times: (count) => `×${count}`,\n newEvents: (count) => (count === 1 ? \"1 new event\" : `${count} new events`),\n};\n\nexport type ActivityFeedProps<T extends ActivityEvent> = {\n /** The events, in any order. */\n events: readonly T[];\n /** The feed's accessible name (“Activity”). */\n \"aria-label\": string;\n /** The locale of the dates and the “… ago”. Default `en-US`. */\n locale?: string;\n /** Now, for the “… ago” and the day headings (pass it from the server for the same text on both sides). */\n now?: Date;\n /** Refresh the “… ago” every minute. Default true. */\n ticking?: boolean;\n /** Fold the runs of the same actor and kind. Default true. */\n fold?: boolean;\n /** Announce new events politely (a stream). */\n live?: boolean;\n /** Before an event's text: its actor's `Avatar`, an icon. */\n leading?: (event: T) => React.ReactNode;\n /** After an event's text: an action (Reply, View). */\n action?: (event: T) => React.ReactNode;\n /** The words, passed translated; English by default. */\n labels?: Partial<ActivityFeedLabels>;\n /** Shown when there is no event (an `EmptyState`). */\n empty?: React.ReactNode;\n /** Classes merged on the root. */\n className?: string;\n};\n\nfunction useNow(initial: Date | undefined, ticking: boolean) {\n const [now, setNow] = React.useState(() => initial ?? new Date());\n React.useEffect(() => {\n if (!ticking) return;\n const timer = setInterval(() => setNow(new Date()), 60_000);\n return () => clearInterval(timer);\n }, [ticking]);\n return now;\n}\n\n/**\n * What happened, newest first: grouped by day, runs folded (“Mina tipped ×3”), “2 min ago” kept fresh, new events\n * announced when `live`. Orazaka's job activity, Orochia's notifications, the console's audit log.\n */\nexport function ActivityFeed<T extends ActivityEvent>({ events, \"aria-label\": label, locale = \"en-US\", now: given, ticking = true, fold = true, live, leading, action, labels: words, empty, className }: ActivityFeedProps<T>) {\n const labels = { ...activityFeedLabels, ...words };\n const s = activityFeed();\n const now = useNow(given, ticking && !given);\n const groups = groupActivity(events, { now, locale, today: labels.today, yesterday: labels.yesterday, fold });\n const seen = React.useRef(events.length);\n const [announcement, setAnnouncement] = React.useState(\"\");\n React.useEffect(() => {\n const added = events.length - seen.current;\n seen.current = events.length;\n if (!live || added <= 0) return;\n const timer = setTimeout(() => setAnnouncement(labels.newEvents(added)), 0);\n return () => clearTimeout(timer);\n }, [events.length, live]); // eslint-disable-line react-hooks/exhaustive-deps -- announce on a new count only\n return (\n <section aria-label={label} className={s.root({ className })}>\n {live ? (\n <p className=\"sr-only\" aria-live=\"polite\">\n {announcement}\n </p>\n ) : null}\n {groups.length === 0 && empty ? empty : null}\n {groups.map((group) => (\n <div key={group.label} className={s.group()}>\n <h3 className={s.heading()}>{group.label}</h3>\n <ol className={s.ol()}>\n {group.events.map(({ event, count }) => {\n const date = new Date(event.at);\n return (\n <li key={event.id} className={s.item()} style={{ [\"--kz-af-tone\" as string]: TONE[event.tone ?? \"neutral\"] }}>\n {leading ? <span className={s.leading()}>{leading(event)}</span> : <span aria-hidden className={s.marker()} />}\n <span className={s.body()}>\n <span className={s.title()}>\n {event.title}\n {count > 1 ? <span className={s.count()}>{labels.times(count)}</span> : null}\n </span>\n {event.description ? <span className={s.description()}>{event.description}</span> : null}\n </span>\n <time dateTime={date.toISOString()} title={date.toLocaleString(locale)} className={s.time()}>\n {timeAgo(date, { now, locale })}\n </time>\n {action ? <span className=\"shrink-0\">{action(event)}</span> : null}\n </li>\n );\n })}\n </ol>\n </div>\n ))}\n </section>\n );\n}\n\nexport type TimelineProps<T extends ActivityEvent> = {\n /** One thing's events, oldest first (a job's run, a payout's life). */\n events: readonly T[];\n /** The timeline's accessible name (“History of the payout”). */\n \"aria-label\": string;\n /** The locale of the times. Default `en-US`. */\n locale?: string;\n /** How a time is written: `time` (14:02, default), `datetime`, `date`. */\n timeStyle?: \"time\" | \"datetime\" | \"date\";\n /** Classes merged on the list. */\n className?: string;\n};\n\n/** One thing's history on a rail, oldest first: each event a marker in its tone, its time and its words. */\nexport function Timeline<T extends ActivityEvent>({ events, \"aria-label\": label, locale = \"en-US\", timeStyle = \"time\", className }: TimelineProps<T>) {\n const s = activityFeed();\n const options: Intl.DateTimeFormatOptions =\n timeStyle === \"time\" ? { hour: \"2-digit\", minute: \"2-digit\" } : timeStyle === \"date\" ? { dateStyle: \"medium\" } : { dateStyle: \"medium\", timeStyle: \"short\" };\n const write = new Intl.DateTimeFormat(locale, options);\n return (\n <ol aria-label={label} className={s.ol({ className })}>\n {events.map((event, i) => {\n const date = new Date(event.at);\n return (\n <li key={event.id} className={s.item()} style={{ [\"--kz-af-tone\" as string]: TONE[event.tone ?? \"neutral\"] }}>\n <span aria-hidden className={s.marker()} />\n {i < events.length - 1 ? <span aria-hidden className={s.rail()} /> : null}\n <span className={s.body()}>\n <span className={s.title()}>{event.title}</span>\n {event.description ? <span className={s.description()}>{event.description}</span> : null}\n </span>\n <time dateTime={date.toISOString()} className={s.time()}>\n {write.format(date)}\n </time>\n </li>\n );\n })}\n </ol>\n );\n}\n","// Shared by the web and React Native ActivityFeed: the events grouped by day (“Today”, “Yesterday”, a date), the same\n// events of one actor in a row folded into one (“Mina tipped 3 times”), and how long ago each happened — Intl only.\n\nexport type ActivityTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\nexport type ActivityEvent = {\n /** A stable id. */\n id: string;\n /** When it happened: an ISO date-time, an epoch in ms or a `Date`. */\n at: string | number | Date;\n /** What happened, in a sentence — passed translated (“Mina tipped your video $5”). */\n title: string;\n /** A detail under it. */\n description?: string;\n /** Who did it (folds a run of the same `kind` by the same actor). */\n actor?: string;\n /** The kind of event (`tip`, `bid`, `job.done`): with `actor`, what folds. */\n kind?: string;\n /** The tone of its marker: success for a payout, danger for a failure. */\n tone?: ActivityTone;\n};\n\nexport type ActivityGroup<T extends ActivityEvent> = {\n /** The day's heading (“Today”, “Yesterday”, “Monday, Oct 6”). */\n label: string;\n /** Its events, newest first; a folded run is its newest event with `count` > 1. */\n events: { event: T; count: number }[];\n};\n\nconst dayKey = (date: Date) => `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;\n\n/** Groups events (any order) by day, newest first, folding runs of the same actor and kind when `fold` is set. */\nexport function groupActivity<T extends ActivityEvent>(\n events: readonly T[],\n { now = new Date(), locale = \"en-US\", today = \"Today\", yesterday = \"Yesterday\", fold = true }: { now?: Date; locale?: string; today?: string; yesterday?: string; fold?: boolean } = {},\n): ActivityGroup<T>[] {\n const sorted = [...events].sort((a, b) => new Date(b.at).getTime() - new Date(a.at).getTime());\n const day = new Intl.DateTimeFormat(locale, { weekday: \"long\", month: \"short\", day: \"numeric\" });\n const todayKey = dayKey(now);\n const yesterdayKey = dayKey(new Date(now.getTime() - 86_400_000));\n const groups: ActivityGroup<T>[] = [];\n let current: ActivityGroup<T> | null = null;\n let currentKey = \"\";\n for (const event of sorted) {\n const date = new Date(event.at);\n const key = dayKey(date);\n if (!current || key !== currentKey) {\n currentKey = key;\n current = { label: key === todayKey ? today : key === yesterdayKey ? yesterday : day.format(date), events: [] };\n groups.push(current);\n }\n const last = current.events[current.events.length - 1];\n if (fold && last && event.actor && event.kind && last.event.actor === event.actor && last.event.kind === event.kind) last.count += 1;\n else current.events.push({ event, count: 1 });\n }\n return groups;\n}\n\nconst UNITS: [Intl.RelativeTimeFormatUnit, number][] = [\n [\"second\", 60],\n [\"minute\", 60],\n [\"hour\", 24],\n [\"day\", 7],\n [\"week\", 4.35],\n [\"month\", 12],\n [\"year\", Number.POSITIVE_INFINITY],\n];\n\n/** “2 minutes ago”, “yesterday”: how long ago, in the largest unit that reads well (`style` short: “2 min. ago”). */\nexport function timeAgo(at: string | number | Date, { now = new Date(), locale = \"en-US\", style = \"short\" }: { now?: Date; locale?: string; style?: \"long\" | \"short\" | \"narrow\" } = {}): string {\n let value = (new Date(at).getTime() - now.getTime()) / 1000;\n let unit: Intl.RelativeTimeFormatUnit = \"second\";\n for (const [name, size] of UNITS) {\n unit = name;\n if (Math.abs(value) < size - 0.5) break;\n value /= size;\n }\n return new Intl.RelativeTimeFormat(locale, { numeric: \"auto\", style }).format(Math.round(value) + 0, unit);\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;;;ACyBnB,IAAM,SAAS,CAAC,SAAe,GAAG,KAAK,YAAY,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC;AAGlF,SAAS,cACd,QACA,EAAE,MAAM,oBAAI,KAAK,GAAG,SAAS,SAAS,QAAQ,SAAS,YAAY,aAAa,OAAO,KAAK,IAAyF,CAAC,GAClK;AACpB,QAAM,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,EAAE,EAAE,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC;AAC7F,QAAM,MAAM,IA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AAkB,WAAW,EAAE,KAAK,GAAG,OAAO,EAAE,CAAC,cAAwB,GAAG,KAAK,MAAM,QAAQ,SAAS,EAAE,GACzG;AAAA,0BAAC,UAAK,eAAW,MAAC,WAAW,EAAE,OAAO,GAAG;AAAA,MACxC,IAAI,OAAO,SAAS,IAAI,oBAAC,UAAK,eAAW,MAAC,WAAW,EAAE,KAAK,GAAG,IAAK;AAAA,MACrE,qBAAC,UAAK,WAAW,EAAE,KAAK,GACtB;AAAA,4BAAC,UAAK,WAAW,EAAE,MAAM,GAAI,gBAAM,OAAM;AAAA,QACxC,MAAM,cAAc,oBAAC,UAAK,WAAW,EAAE,YAAY,GAAI,gBAAM,aAAY,IAAU;AAAA,SACtF;AAAA,MACA,oBAAC,UAAK,UAAU,KAAK,YAAY,GAAG,WAAW,EAAE,KAAK,GACnD,gBAAM,OAAO,IAAI,GACpB;AAAA,SATO,MAAM,EAUf;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
|
package/dist/chat.d.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare const chat: tailwind_variants.TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
7
|
+
input?: tailwind_variants.ClassValue;
|
|
8
|
+
time?: tailwind_variants.ClassValue;
|
|
9
|
+
send?: tailwind_variants.ClassValue;
|
|
10
|
+
row?: tailwind_variants.ClassValue;
|
|
11
|
+
status?: tailwind_variants.ClassValue;
|
|
12
|
+
bubble?: tailwind_variants.ClassValue;
|
|
13
|
+
context?: tailwind_variants.ClassValue;
|
|
14
|
+
typing?: tailwind_variants.ClassValue;
|
|
15
|
+
dot?: tailwind_variants.ClassValue;
|
|
16
|
+
composer?: tailwind_variants.ClassValue;
|
|
17
|
+
item?: tailwind_variants.ClassValue;
|
|
18
|
+
count?: tailwind_variants.ClassValue;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
} | {
|
|
22
|
+
[x: string]: {
|
|
23
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
24
|
+
input?: tailwind_variants.ClassValue;
|
|
25
|
+
time?: tailwind_variants.ClassValue;
|
|
26
|
+
send?: tailwind_variants.ClassValue;
|
|
27
|
+
row?: tailwind_variants.ClassValue;
|
|
28
|
+
status?: tailwind_variants.ClassValue;
|
|
29
|
+
bubble?: tailwind_variants.ClassValue;
|
|
30
|
+
context?: tailwind_variants.ClassValue;
|
|
31
|
+
typing?: tailwind_variants.ClassValue;
|
|
32
|
+
dot?: tailwind_variants.ClassValue;
|
|
33
|
+
composer?: tailwind_variants.ClassValue;
|
|
34
|
+
item?: tailwind_variants.ClassValue;
|
|
35
|
+
count?: tailwind_variants.ClassValue;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
} | {}, {
|
|
39
|
+
row: string;
|
|
40
|
+
bubble: string;
|
|
41
|
+
context: string;
|
|
42
|
+
time: string;
|
|
43
|
+
status: string;
|
|
44
|
+
typing: string;
|
|
45
|
+
dot: string;
|
|
46
|
+
composer: string;
|
|
47
|
+
input: string;
|
|
48
|
+
send: string;
|
|
49
|
+
item: string;
|
|
50
|
+
count: string;
|
|
51
|
+
}, undefined, {
|
|
52
|
+
[key: string]: {
|
|
53
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
54
|
+
input?: tailwind_variants.ClassValue;
|
|
55
|
+
time?: tailwind_variants.ClassValue;
|
|
56
|
+
send?: tailwind_variants.ClassValue;
|
|
57
|
+
row?: tailwind_variants.ClassValue;
|
|
58
|
+
status?: tailwind_variants.ClassValue;
|
|
59
|
+
bubble?: tailwind_variants.ClassValue;
|
|
60
|
+
context?: tailwind_variants.ClassValue;
|
|
61
|
+
typing?: tailwind_variants.ClassValue;
|
|
62
|
+
dot?: tailwind_variants.ClassValue;
|
|
63
|
+
composer?: tailwind_variants.ClassValue;
|
|
64
|
+
item?: tailwind_variants.ClassValue;
|
|
65
|
+
count?: tailwind_variants.ClassValue;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
} | {}, {
|
|
69
|
+
row: string;
|
|
70
|
+
bubble: string;
|
|
71
|
+
context: string;
|
|
72
|
+
time: string;
|
|
73
|
+
status: string;
|
|
74
|
+
typing: string;
|
|
75
|
+
dot: string;
|
|
76
|
+
composer: string;
|
|
77
|
+
input: string;
|
|
78
|
+
send: string;
|
|
79
|
+
item: string;
|
|
80
|
+
count: string;
|
|
81
|
+
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
82
|
+
row: string;
|
|
83
|
+
bubble: string;
|
|
84
|
+
context: string;
|
|
85
|
+
time: string;
|
|
86
|
+
status: string;
|
|
87
|
+
typing: string;
|
|
88
|
+
dot: string;
|
|
89
|
+
composer: string;
|
|
90
|
+
input: string;
|
|
91
|
+
send: string;
|
|
92
|
+
item: string;
|
|
93
|
+
count: string;
|
|
94
|
+
}>>;
|
|
95
|
+
type MessageStatus = "sending" | "sent" | "delivered" | "read" | "failed";
|
|
96
|
+
type MessageBubbleLabels = {
|
|
97
|
+
/** The words of each status, shown under the last message of yours. */
|
|
98
|
+
status?: Partial<Record<MessageStatus, string>>;
|
|
99
|
+
/** A failed message's retry button (“Retry”). */
|
|
100
|
+
retry?: string;
|
|
101
|
+
};
|
|
102
|
+
type MessageBubbleProps = {
|
|
103
|
+
/** The text. */
|
|
104
|
+
text: string;
|
|
105
|
+
/** Yours (right, in the accent) or theirs (left). */
|
|
106
|
+
mine?: boolean;
|
|
107
|
+
/** The time, written by the app (“14:02”). */
|
|
108
|
+
time?: string;
|
|
109
|
+
/** Where a message of yours stands; shown when `showStatus`. */
|
|
110
|
+
status?: MessageStatus;
|
|
111
|
+
/** Show the status under the bubble (the last message of yours). */
|
|
112
|
+
showStatus?: boolean;
|
|
113
|
+
/** A line above the text: what it answers. */
|
|
114
|
+
context?: string;
|
|
115
|
+
/** Sends a failed message again (a button under it). */
|
|
116
|
+
onRetry?: () => void;
|
|
117
|
+
/** Part of a run of the same sender: the corner towards the next one is tighter. */
|
|
118
|
+
grouped?: "first" | "middle" | "last" | "single";
|
|
119
|
+
/** The words, passed translated. */
|
|
120
|
+
labels?: MessageBubbleLabels;
|
|
121
|
+
/** Classes merged on the row. */
|
|
122
|
+
className?: string;
|
|
123
|
+
};
|
|
124
|
+
/** A message: yours in the accent on the right, theirs on the left, the time inside, the receipt under the last of yours. */
|
|
125
|
+
declare function MessageBubble({ text, mine, time, status, showStatus, context, onRetry, grouped, labels, className }: MessageBubbleProps): React.JSX.Element;
|
|
126
|
+
type TypingIndicatorProps = {
|
|
127
|
+
/** What is read and shown beside the dots (“Elena is typing”) — passed translated. */
|
|
128
|
+
label: string;
|
|
129
|
+
/** Show the words beside the dots. */
|
|
130
|
+
showLabel?: boolean;
|
|
131
|
+
/** Classes merged on the root. */
|
|
132
|
+
className?: string;
|
|
133
|
+
};
|
|
134
|
+
/** Three dots that breathe while the other person types, announced politely; still under reduced motion. */
|
|
135
|
+
declare function TypingIndicator({ label, showLabel, className }: TypingIndicatorProps): React.JSX.Element;
|
|
136
|
+
type MessageComposerProps = {
|
|
137
|
+
/** The draft (controlled). */
|
|
138
|
+
value: string;
|
|
139
|
+
/** Called on every key. */
|
|
140
|
+
onValueChange: (text: string) => void;
|
|
141
|
+
/** Sends the draft (Enter, or the button); Shift+Enter adds a line. */
|
|
142
|
+
onSend: () => void;
|
|
143
|
+
/** The input's name and placeholder (“Message”). */
|
|
144
|
+
placeholder: string;
|
|
145
|
+
/** The send button's name (“Send”). */
|
|
146
|
+
sendLabel: string;
|
|
147
|
+
/** Before the input: an attach button. */
|
|
148
|
+
leading?: React.ReactNode;
|
|
149
|
+
/** Cannot write: the reason in its place. */
|
|
150
|
+
disabledReason?: string;
|
|
151
|
+
/** The longest message. Default 4000. */
|
|
152
|
+
maxLength?: number;
|
|
153
|
+
/** Classes merged on the root. */
|
|
154
|
+
className?: string;
|
|
155
|
+
};
|
|
156
|
+
/** Where a message is written: a growing textarea (Enter sends, Shift+Enter a new line), an attach slot, a send button. */
|
|
157
|
+
declare function MessageComposer({ value, onValueChange, onSend, placeholder, sendLabel, leading, disabledReason, maxLength, className }: MessageComposerProps): React.JSX.Element;
|
|
158
|
+
type ConversationItemProps = {
|
|
159
|
+
/** The other person's name. */
|
|
160
|
+
name: string;
|
|
161
|
+
/** Their avatar's URL. */
|
|
162
|
+
avatar?: string | null;
|
|
163
|
+
/** The last message, or “typing…”. */
|
|
164
|
+
preview: string;
|
|
165
|
+
/** The preview is the typing signal: in the accent. */
|
|
166
|
+
typing?: boolean;
|
|
167
|
+
/** When (“14:02”, “Mon”). */
|
|
168
|
+
time?: string;
|
|
169
|
+
/** Unread messages: a count, the name in bold. */
|
|
170
|
+
unread?: number;
|
|
171
|
+
/** The unread count in words (“3 unread”). */
|
|
172
|
+
unreadLabel?: string;
|
|
173
|
+
/** Before the name: a presence dot (online). */
|
|
174
|
+
online?: boolean;
|
|
175
|
+
/** The presence in words (“online”). */
|
|
176
|
+
onlineLabel?: string;
|
|
177
|
+
/** Opens the conversation (a link). */
|
|
178
|
+
href?: string;
|
|
179
|
+
/** Opens the conversation (a button). */
|
|
180
|
+
onSelect?: () => void;
|
|
181
|
+
/** Classes merged on the row. */
|
|
182
|
+
className?: string;
|
|
183
|
+
};
|
|
184
|
+
/** A conversation in the list: avatar, name, the last message or typing, the time, the unread count. */
|
|
185
|
+
declare function ConversationItem({ name, avatar, preview, typing, time, unread, unreadLabel, online, onlineLabel, href, onSelect, className }: ConversationItemProps): React.JSX.Element;
|
|
186
|
+
|
|
187
|
+
export { ConversationItem, type ConversationItemProps, MessageBubble, type MessageBubbleLabels, type MessageBubbleProps, MessageComposer, type MessageComposerProps, type MessageStatus, TypingIndicator, type TypingIndicatorProps, chat };
|