@krizaka/ui 3.2.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-feed.d.ts +199 -0
- package/dist/activity-feed.js +155 -0
- package/dist/activity-feed.js.map +1 -0
- package/dist/argument-card.js +3 -3
- package/dist/{chunk-I5RVM5CW.js → chunk-2FRWNSRO.js} +2 -6
- package/dist/chunk-2FRWNSRO.js.map +1 -0
- package/dist/chunk-7Z4KHPFC.js +42 -0
- package/dist/chunk-7Z4KHPFC.js.map +1 -0
- package/dist/chunk-BTMFZ66D.js +135 -0
- package/dist/chunk-BTMFZ66D.js.map +1 -0
- package/dist/chunk-C2BRIFJG.js +13 -0
- package/dist/chunk-C2BRIFJG.js.map +1 -0
- package/dist/chunk-KDXRYUD3.js +39 -0
- package/dist/chunk-KDXRYUD3.js.map +1 -0
- package/dist/{chunk-2PUDI7JS.js → chunk-ZKVQGXLD.js} +5 -3
- package/dist/{chunk-2PUDI7JS.js.map → chunk-ZKVQGXLD.js.map} +1 -1
- package/dist/command.js +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/data-table.js +101 -133
- package/dist/data-table.js.map +1 -1
- package/dist/date-picker.d.ts +3 -1
- package/dist/date-picker.js +13 -13
- package/dist/date-picker.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/dropdown-menu.js +1 -1
- package/dist/filter-bar.js +3 -2
- package/dist/form.d.ts +23 -12
- package/dist/form.js +11 -47
- package/dist/form.js.map +1 -1
- package/dist/glow-card.js +1 -1
- package/dist/image-cropper.js +3 -1
- package/dist/image-cropper.js.map +1 -1
- 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/marquee.js +1 -1
- package/dist/motion.css +12 -1
- package/dist/native/form.d.ts +60 -15
- package/dist/native/form.js +103 -42
- package/dist/native/form.js.map +1 -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 +772 -6
- package/dist/native.js +2493 -741
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.js +1 -1
- package/dist/page-hero.js +3 -3
- package/dist/popover.js +1 -1
- package/dist/radio-group.d.ts +66 -32
- package/dist/radio-group.js +54 -10
- package/dist/radio-group.js.map +1 -1
- package/dist/slider.d.ts +96 -35
- package/dist/slider.js +67 -13
- package/dist/slider.js.map +1 -1
- package/dist/stat.d.ts +31 -2
- package/dist/stat.js +21 -4
- package/dist/stat.js.map +1 -1
- package/dist/terminal-replay.js +34 -60
- package/dist/terminal-replay.js.map +1 -1
- package/dist/toast.js +1 -1
- package/dist/tooltip.js +1 -1
- 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/video-player.js +3 -1
- package/dist/video-player.js.map +1 -1
- package/package.json +148 -11
- 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/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 +226 -4
- 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 +18 -4
- 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 +75 -4
- 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/combobox/native/multiple.d.ts +4 -0
- package/registry/examples/combobox/native/multiple.dark.png +0 -0
- package/registry/examples/combobox/native/multiple.js +15 -0
- package/registry/examples/combobox/native/multiple.light.png +0 -0
- package/registry/examples/combobox/native/multiple.tsx +15 -0
- package/registry/examples/combobox/native/search.d.ts +4 -0
- package/registry/examples/combobox/native/search.dark.png +0 -0
- package/registry/examples/combobox/native/search.js +15 -0
- package/registry/examples/combobox/native/search.light.png +0 -0
- package/registry/examples/combobox/native/search.tsx +15 -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/dialog/native/sheet.d.ts +4 -0
- package/registry/examples/dialog/native/sheet.dark.png +0 -0
- package/registry/examples/dialog/native/sheet.js +21 -0
- package/registry/examples/dialog/native/sheet.light.png +0 -0
- package/registry/examples/dialog/native/sheet.tsx +18 -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/field/native/select.d.ts +4 -0
- package/registry/examples/field/native/select.dark.png +0 -0
- package/registry/examples/field/native/select.js +29 -0
- package/registry/examples/field/native/select.light.png +0 -0
- package/registry/examples/field/native/select.tsx +25 -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/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/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/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/radio-group/buttons.d.ts +4 -0
- package/registry/examples/radio-group/buttons.js +17 -0
- package/registry/examples/radio-group/buttons.tsx +21 -0
- package/registry/examples/radio-group/cards.js +1 -1
- package/registry/examples/radio-group/cards.tsx +2 -2
- package/registry/examples/radio-group/native/buttons.d.ts +4 -0
- package/registry/examples/radio-group/native/buttons.dark.png +0 -0
- package/registry/examples/radio-group/native/buttons.js +25 -0
- package/registry/examples/radio-group/native/buttons.light.png +0 -0
- package/registry/examples/radio-group/native/buttons.tsx +21 -0
- package/registry/examples/radio-group/native/cards.d.ts +4 -0
- package/registry/examples/radio-group/native/cards.dark.png +0 -0
- package/registry/examples/radio-group/native/cards.js +23 -0
- package/registry/examples/radio-group/native/cards.light.png +0 -0
- package/registry/examples/radio-group/native/cards.tsx +19 -0
- package/registry/examples/radio-group/native/list.d.ts +4 -0
- package/registry/examples/radio-group/native/list.dark.png +0 -0
- package/registry/examples/radio-group/native/list.js +24 -0
- package/registry/examples/radio-group/native/list.light.png +0 -0
- package/registry/examples/radio-group/native/list.tsx +20 -0
- package/registry/examples/radio-group/native/segmented.d.ts +4 -0
- package/registry/examples/radio-group/native/segmented.dark.png +0 -0
- package/registry/examples/radio-group/native/segmented.js +24 -0
- package/registry/examples/radio-group/native/segmented.light.png +0 -0
- package/registry/examples/radio-group/native/segmented.tsx +20 -0
- package/registry/examples/radio-group/segmented.d.ts +4 -0
- package/registry/examples/radio-group/segmented.js +15 -0
- package/registry/examples/radio-group/segmented.tsx +12 -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/slider/floating.d.ts +4 -0
- package/registry/examples/slider/floating.js +11 -0
- package/registry/examples/slider/floating.tsx +12 -0
- package/registry/examples/slider/native/default.d.ts +4 -0
- package/registry/examples/slider/native/default.dark.png +0 -0
- package/registry/examples/slider/native/default.js +14 -0
- package/registry/examples/slider/native/default.light.png +0 -0
- package/registry/examples/slider/native/default.tsx +13 -0
- package/registry/examples/slider/native/range.d.ts +4 -0
- package/registry/examples/slider/native/range.dark.png +0 -0
- package/registry/examples/slider/native/range.js +12 -0
- package/registry/examples/slider/native/range.light.png +0 -0
- package/registry/examples/slider/native/range.tsx +11 -0
- package/registry/examples/slider/native/stepped.d.ts +4 -0
- package/registry/examples/slider/native/stepped.dark.png +0 -0
- package/registry/examples/slider/native/stepped.js +28 -0
- package/registry/examples/slider/native/stepped.light.png +0 -0
- package/registry/examples/slider/native/stepped.tsx +24 -0
- package/registry/examples/slider/native/vertical.d.ts +4 -0
- package/registry/examples/slider/native/vertical.dark.png +0 -0
- package/registry/examples/slider/native/vertical.js +16 -0
- package/registry/examples/slider/native/vertical.light.png +0 -0
- package/registry/examples/slider/native/vertical.tsx +13 -0
- package/registry/examples/slider/price-range.d.ts +4 -0
- package/registry/examples/slider/price-range.js +29 -0
- package/registry/examples/slider/price-range.tsx +27 -0
- package/registry/examples/slider/stepped.d.ts +4 -0
- package/registry/examples/slider/stepped.js +28 -0
- package/registry/examples/slider/stepped.tsx +24 -0
- package/registry/examples/slider/vertical.d.ts +4 -0
- package/registry/examples/slider/vertical.js +15 -0
- package/registry/examples/slider/vertical.tsx +14 -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/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/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/switch/native/default.d.ts +4 -0
- package/registry/examples/switch/native/default.dark.png +0 -0
- package/registry/examples/switch/native/default.js +16 -0
- package/registry/examples/switch/native/default.light.png +0 -0
- package/registry/examples/switch/native/default.tsx +13 -0
- package/registry/examples/switch/native/settings.d.ts +4 -0
- package/registry/examples/switch/native/settings.dark.png +0 -0
- package/registry/examples/switch/native/settings.js +20 -0
- package/registry/examples/switch/native/settings.light.png +0 -0
- package/registry/examples/switch/native/settings.tsx +17 -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/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/fab.json +122 -0
- package/registry/field.json +16 -4
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +1 -1
- package/registry/form.json +252 -44
- 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 +322 -44
- 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/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/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 +228 -16
- 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 +315 -14
- 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/stepper.json +75 -4
- package/registry/swipeable-row.json +124 -0
- package/registry/switch.json +116 -4
- package/registry/tab-bar.json +115 -0
- package/registry/tabs.json +96 -6
- package/registry/tag-input.json +1 -1
- 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/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/skills/choice-controls/SKILL.md +39 -0
- package/skills/form/SKILL.md +3 -0
- package/skills/map/SKILL.md +35 -0
- package/dist/chunk-I5RVM5CW.js.map +0 -1
- package/dist/chunk-RUPRYJ45.js +0 -82
- package/dist/chunk-RUPRYJ45.js.map +0 -1
package/registry/list.json
CHANGED
|
@@ -1,52 +1,224 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "list",
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "primitive",
|
|
4
4
|
"title": "List",
|
|
5
|
-
"summary": "
|
|
6
|
-
"description": "
|
|
5
|
+
"summary": "Records read top to bottom — a leading visual, a title and a line, details and actions beside — dense or comfortable, selectable, windowed when long.",
|
|
6
|
+
"description": "Records read top to bottom — a leading visual, a title and a line, details and actions beside — dense or comfortable, selectable, windowed when long.",
|
|
7
7
|
"status": "beta",
|
|
8
8
|
"category": "data-display",
|
|
9
|
-
"platforms": "
|
|
9
|
+
"platforms": "both",
|
|
10
10
|
"whenToUse": [
|
|
11
|
-
"
|
|
12
|
-
"A
|
|
11
|
+
"Orazaka's jobs, Orochia's viewers and tippers of a story, a creator's payouts.",
|
|
12
|
+
"A long feed on a phone: sections by day, pull to refresh, swipe actions (React Native)."
|
|
13
13
|
],
|
|
14
14
|
"whenNotToUse": [
|
|
15
15
|
{
|
|
16
|
-
"when": "
|
|
17
|
-
"use": "
|
|
16
|
+
"when": "For records with several values to compare side by side.",
|
|
17
|
+
"use": "data-table"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
"when": "For
|
|
21
|
-
"use": "
|
|
20
|
+
"when": "For what happened over time.",
|
|
21
|
+
"use": "activity-feed"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"when": "For facts about one thing.",
|
|
25
|
+
"use": "description-list"
|
|
22
26
|
}
|
|
23
27
|
],
|
|
24
28
|
"bestPractices": [
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"Keep `renderItem` light (no state per item): views are recycled while the person scrolls."
|
|
29
|
+
"One main action per row (a link or `onSelect`); secondary actions go in `actions`, beside it.",
|
|
30
|
+
"Show `loading` for the first page only; the next pages go in `footer` (a “Load more” button, a `Pagination`).",
|
|
31
|
+
"Past a few hundred rows, `virtualize` with a fixed row height."
|
|
29
32
|
],
|
|
30
33
|
"accessibility": {
|
|
31
|
-
"keyboard": [
|
|
34
|
+
"keyboard": [
|
|
35
|
+
{
|
|
36
|
+
"keys": "Tab",
|
|
37
|
+
"action": "Moves through the rows' main actions, their checkboxes and their secondary actions."
|
|
38
|
+
}
|
|
39
|
+
],
|
|
32
40
|
"notes": [
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
41
|
+
"A `ul` named by `aria-label`; the main action fills the row without nesting the others.",
|
|
42
|
+
"A windowed list is a scrolling region the keyboard can reach.",
|
|
43
|
+
"On React Native, swipe actions are also accessibility actions."
|
|
36
44
|
]
|
|
37
45
|
},
|
|
38
46
|
"related": [
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"spinner",
|
|
43
|
-
"pagination"
|
|
47
|
+
"data-table",
|
|
48
|
+
"activity-feed",
|
|
49
|
+
"description-list"
|
|
44
50
|
],
|
|
45
|
-
"web":
|
|
51
|
+
"web": {
|
|
52
|
+
"entry": "@krizaka/ui/list",
|
|
53
|
+
"import": "import { List } from \"@krizaka/ui/list\";",
|
|
54
|
+
"props": [
|
|
55
|
+
{
|
|
56
|
+
"component": "List",
|
|
57
|
+
"description": "A list of records: dense or comfortable, selectable, actions beside each row, windowed when long, with its states.",
|
|
58
|
+
"props": [
|
|
59
|
+
{
|
|
60
|
+
"name": "aria-label",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"default": null,
|
|
63
|
+
"description": "The list's accessible name (“Jobs”).",
|
|
64
|
+
"required": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "getId",
|
|
68
|
+
"type": "(item: T) => string",
|
|
69
|
+
"default": null,
|
|
70
|
+
"description": "A stable id per record: the React key and the selection's value.",
|
|
71
|
+
"required": true
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "items",
|
|
75
|
+
"type": "readonly T[]",
|
|
76
|
+
"default": null,
|
|
77
|
+
"description": "The records, in order.",
|
|
78
|
+
"required": true
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "row",
|
|
82
|
+
"type": "(item: T) => ListRow",
|
|
83
|
+
"default": null,
|
|
84
|
+
"description": "What a record shows: its title, line, visuals, details, actions and where it leads.",
|
|
85
|
+
"required": true
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "chevrons",
|
|
89
|
+
"type": "boolean",
|
|
90
|
+
"default": null,
|
|
91
|
+
"description": "Shows a chevron on the rows that lead somewhere.",
|
|
92
|
+
"required": false
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "className",
|
|
96
|
+
"type": "string",
|
|
97
|
+
"default": null,
|
|
98
|
+
"description": "Classes merged on the root.",
|
|
99
|
+
"required": false
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "defaultSelected",
|
|
103
|
+
"type": "readonly string[]",
|
|
104
|
+
"default": "[]",
|
|
105
|
+
"description": "The ids selected at first, uncontrolled.",
|
|
106
|
+
"required": false
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "density",
|
|
110
|
+
"type": "\"comfortable\" | \"compact\"",
|
|
111
|
+
"default": null,
|
|
112
|
+
"description": "comfortable (default: 64 px rows with a line) · compact (44 px: dense admin lists).",
|
|
113
|
+
"required": false
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "empty",
|
|
117
|
+
"type": "ReactNode",
|
|
118
|
+
"default": null,
|
|
119
|
+
"description": "Shown when there is no record (an `EmptyState`).",
|
|
120
|
+
"required": false
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "error",
|
|
124
|
+
"type": "ReactNode",
|
|
125
|
+
"default": null,
|
|
126
|
+
"description": "A failure in place of the rows (an `Alert` with a retry); announced.",
|
|
127
|
+
"required": false
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "footer",
|
|
131
|
+
"type": "ReactNode",
|
|
132
|
+
"default": null,
|
|
133
|
+
"description": "Under the list: a `Pagination`, a “Load more” button, a total.",
|
|
134
|
+
"required": false
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "labels",
|
|
138
|
+
"type": "Partial<ListLabels>",
|
|
139
|
+
"default": null,
|
|
140
|
+
"description": "The words, passed translated; English by default.",
|
|
141
|
+
"required": false
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "loading",
|
|
145
|
+
"type": "boolean",
|
|
146
|
+
"default": null,
|
|
147
|
+
"description": "Loading: `loadingRows` skeleton rows and `aria-busy`.",
|
|
148
|
+
"required": false
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "loadingRows",
|
|
152
|
+
"type": "number",
|
|
153
|
+
"default": "5",
|
|
154
|
+
"description": "How many skeleton rows. Default 5.",
|
|
155
|
+
"required": false
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "onSelectedChange",
|
|
159
|
+
"type": "((selected: string[]) => void)",
|
|
160
|
+
"default": null,
|
|
161
|
+
"description": "Called with the new selection.",
|
|
162
|
+
"required": false
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "selectable",
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"default": null,
|
|
168
|
+
"description": "A checkbox per row.",
|
|
169
|
+
"required": false
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "selected",
|
|
173
|
+
"type": "readonly string[]",
|
|
174
|
+
"default": null,
|
|
175
|
+
"description": "The ids selected (controlled).",
|
|
176
|
+
"required": false
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "virtualize",
|
|
180
|
+
"type": "{ rowHeight: number; height: number; overscan?: number; }",
|
|
181
|
+
"default": null,
|
|
182
|
+
"description": "Renders only the rows in view: fixed `rowHeight`, a scrolling region of `height` px.",
|
|
183
|
+
"required": false
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"examples": [
|
|
189
|
+
{
|
|
190
|
+
"name": "jobs",
|
|
191
|
+
"title": "Jobs",
|
|
192
|
+
"description": "Orazaka's jobs, each row opening its run, the status beside it.",
|
|
193
|
+
"path": "examples/list/jobs.tsx",
|
|
194
|
+
"module": "@krizaka/ui/registry/examples/list/jobs",
|
|
195
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\nimport { List } from \"@krizaka/ui/list\";\n\ntype Job = { id: string; name: string; studio: string; status: \"running\" | \"done\" | \"failed\"; when: string };\nconst jobs: Job[] = [\n { id: \"j1\", name: \"Dub “Sunset session” into English\", studio: \"Dubbing studio\", status: \"running\", when: \"now\" },\n { id: \"j2\", name: \"Transcribe the interview with Elena\", studio: \"Transcript studio\", status: \"done\", when: \"14:02\" },\n { id: \"j3\", name: \"Clip the five best moments\", studio: \"Clips studio\", status: \"failed\", when: \"12:15\" },\n];\nconst TONE = { running: \"accent\", done: \"success\", failed: \"danger\" } as const;\n\n// Orazaka's jobs: each row opens its run; the status and the time beside it.\nexport default function ListJobs() {\n return (\n <List\n aria-label=\"Jobs\"\n items={jobs}\n getId={(j) => j.id}\n chevrons\n row={(j) => ({\n title: j.name,\n description: j.studio,\n href: `#/jobs/${j.id}`,\n meta: (\n <>\n <Badge tone={TONE[j.status]}>{j.status}</Badge>\n <span>{j.when}</span>\n </>\n ),\n })}\n />\n );\n}\n"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "selectable",
|
|
199
|
+
"title": "Selectable, compact",
|
|
200
|
+
"description": "A story's viewers, picked for a thank-you.",
|
|
201
|
+
"path": "examples/list/selectable.tsx",
|
|
202
|
+
"module": "@krizaka/ui/registry/examples/list/selectable",
|
|
203
|
+
"code": "\"use client\";\n\nimport { Avatar } from \"@krizaka/ui/avatar\";\nimport { Button } from \"@krizaka/ui/button\";\nimport { List } from \"@krizaka/ui/list\";\nimport { useState } from \"react\";\n\nconst viewers = [\n { id: \"u1\", name: \"Mina Okafor\", handle: \"@mina\", tipped: \"$12\" },\n { id: \"u2\", name: \"Alex Moreau\", handle: \"@alex\", tipped: \"$5\" },\n { id: \"u3\", name: \"Elena Ruiz\", handle: \"@elena\", tipped: \"—\" },\n];\n\n// Compact and selectable: who watched a story, a thank-you for the ones you pick.\nexport default function ListSelectable() {\n const [selected, setSelected] = useState<string[]>([\"u1\"]);\n return (\n <List\n aria-label=\"Viewers of your story\"\n density=\"compact\"\n items={viewers}\n getId={(v) => v.id}\n selectable\n selected={selected}\n onSelectedChange={setSelected}\n row={(v) => ({ title: v.name, description: v.handle, leading: <Avatar alt={v.name} fallback={v.name.charAt(0)} size=\"sm\" />, meta: v.tipped })}\n footer={<Button size=\"sm\" variant=\"primary\" disabled={selected.length === 0}>{`Thank ${selected.length}`}</Button>}\n />\n );\n}\n"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "virtualized",
|
|
207
|
+
"title": "2,000 rows",
|
|
208
|
+
"description": "`virtualize`: only the rows in view are rendered.",
|
|
209
|
+
"path": "examples/list/virtualized.tsx",
|
|
210
|
+
"module": "@krizaka/ui/registry/examples/list/virtualized",
|
|
211
|
+
"code": "import { List } from \"@krizaka/ui/list\";\n\nconst payouts = Array.from({ length: 2_000 }, (_, i) => ({ id: `p${i}`, amount: `$${(120 + ((i * 37) % 900)).toFixed(2)}`, day: `Payout #${2_000 - i}` }));\n\n// 2,000 payouts: only the rows in view are rendered, in a region the keyboard scrolls.\nexport default function ListVirtualized() {\n return (\n <List\n aria-label=\"Payouts\"\n density=\"compact\"\n items={payouts}\n getId={(p) => p.id}\n virtualize={{ rowHeight: 44, height: 264 }}\n row={(p) => ({ title: p.day, meta: p.amount })}\n />\n );\n}\n"
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
46
215
|
"native": {
|
|
47
216
|
"entry": "@krizaka/ui/native/list",
|
|
48
217
|
"import": "import { List, useInfiniteList } from \"@krizaka/ui/native/list\";",
|
|
49
|
-
"differences": [
|
|
218
|
+
"differences": [
|
|
219
|
+
"Its own entry, `@krizaka/ui/native/list` (FlashList, an optional peer); rows are rendered by `renderItem`, not described by `row`.",
|
|
220
|
+
"`useInfiniteList` loads the next page near the end and refreshes on a pull, through @krizaka/query."
|
|
221
|
+
],
|
|
50
222
|
"props": [
|
|
51
223
|
{
|
|
52
224
|
"component": "List",
|
|
@@ -241,9 +413,174 @@
|
|
|
241
413
|
}
|
|
242
414
|
]
|
|
243
415
|
},
|
|
244
|
-
"files": [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
"
|
|
248
|
-
|
|
416
|
+
"files": [
|
|
417
|
+
{
|
|
418
|
+
"path": "glyphs.tsx",
|
|
419
|
+
"content": "// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\n"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"path": "list/index.ts",
|
|
423
|
+
"content": "/** @krizaka/ui/list — `List`: records read top to bottom, dense or comfortable, selectable, windowed when long. */\nexport { List, list, type ListLabels, listLabels, type ListProps, type ListRow } from \"./list\";\n"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"path": "list/list.tsx",
|
|
427
|
+
"content": "// Client (the selection, the windowing of long lists). A list of records read top to bottom: a leading visual, a\n// title and a line, trailing details and actions — dense or comfortable, selectable with a checkbox per row, windowed\n// past a few hundred rows, with its loading, empty and error states. A real `<ul>`: each row a `<li>`, its main action\n// a link or a button that fills the row, its secondary actions beside it (never nested in the main one).\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Checkbox } from \"../checkbox\";\nimport { ChevronGlyph } from \"../glyphs\";\nimport { useControllable } from \"../media\";\n\nexport const list = tv({\n slots: {\n root: \"w-full overflow-hidden rounded-xl border border-border-default bg-surface-1\",\n scroller: \"overflow-y-auto focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n ul: \"m-0 list-none divide-y divide-border-subtle p-0\",\n item: \"relative flex items-center gap-3 px-4 transition-colors data-[state=selected]:bg-accent-soft has-[[data-main]:hover]:bg-surface-2/60\",\n main:\n \"flex min-w-0 flex-1 items-center gap-3 self-stretch text-left text-fg outline-hidden \" +\n \"focus-visible:after:absolute focus-visible:after:inset-0.5 focus-visible:after:rounded-lg focus-visible:after:ring-2 focus-visible:after:ring-ring\",\n leading: \"flex shrink-0 items-center justify-center text-fg-secondary\",\n text: \"flex min-w-0 flex-1 flex-col\",\n title: \"truncate text-sm font-semibold text-fg\",\n description: \"line-clamp-2 text-xs text-fg-secondary\",\n meta: \"flex shrink-0 flex-col items-end gap-1 text-xs tabular-nums text-fg-secondary\",\n actions: \"relative z-10 flex shrink-0 items-center gap-1\",\n chevron: \"h-4 w-4 shrink-0 text-fg-muted\",\n message: \"px-4 py-10 text-center text-sm text-fg-secondary\",\n skeleton: \"animate-pulse rounded bg-surface-3 motion-reduce:animate-none\",\n footer: \"border-t border-border-default px-4 py-3\",\n },\n variants: {\n density: {\n comfortable: { item: \"min-h-16 py-2.5\" },\n compact: { item: \"min-h-11 py-1.5\", description: \"line-clamp-1\" },\n },\n },\n defaultVariants: { density: \"comfortable\" },\n});\n\nexport type ListLabels = {\n /** The checkbox of a row: `(title) => \"Select \" + title`. */\n selectRow: (title: string) => string;\n /** Read while the rows load (“Loading”). */\n loading: string;\n /** The default empty state (“Nothing to show”). */\n empty: string;\n};\n\nexport const listLabels: ListLabels = { selectRow: (title) => `Select ${title}`, loading: \"Loading\", empty: \"Nothing to show\" };\n\nexport type ListRow = {\n /** The row's main line — passed translated. */\n title: string;\n /** A second line (a detail, a status in words). */\n description?: React.ReactNode;\n /** Before the text: an `Avatar`, an icon, a thumbnail. */\n leading?: React.ReactNode;\n /** After the text: a time, an amount, a `Badge`. */\n meta?: React.ReactNode;\n /** Secondary actions beside the row (icon buttons, a menu) — outside the main action. */\n actions?: React.ReactNode;\n /** The row opens this address (its main action is a link). */\n href?: string;\n /** The row's main action (a button), when it is not a link. */\n onSelect?: () => void;\n};\n\nexport type ListProps<T> = {\n /** The records, in order. */\n items: readonly T[];\n /** A stable id per record: the React key and the selection's value. */\n getId: (item: T) => string;\n /** What a record shows: its title, line, visuals, details, actions and where it leads. */\n row: (item: T) => ListRow;\n /** The list's accessible name (“Jobs”). */\n \"aria-label\": string;\n /** comfortable (default: 64 px rows with a line) · compact (44 px: dense admin lists). */\n density?: \"comfortable\" | \"compact\";\n /** A checkbox per row. */\n selectable?: boolean;\n /** The ids selected (controlled). */\n selected?: readonly string[];\n /** The ids selected at first, uncontrolled. */\n defaultSelected?: readonly string[];\n /** Called with the new selection. */\n onSelectedChange?: (selected: string[]) => void;\n /** Shows a chevron on the rows that lead somewhere. */\n chevrons?: boolean;\n /** Loading: `loadingRows` skeleton rows and `aria-busy`. */\n loading?: boolean;\n /** How many skeleton rows. Default 5. */\n loadingRows?: number;\n /** A failure in place of the rows (an `Alert` with a retry); announced. */\n error?: React.ReactNode;\n /** Shown when there is no record (an `EmptyState`). */\n empty?: React.ReactNode;\n /** Renders only the rows in view: fixed `rowHeight`, a scrolling region of `height` px. */\n virtualize?: { rowHeight: number; height: number; overscan?: number };\n /** Under the list: a `Pagination`, a “Load more” button, a total. */\n footer?: React.ReactNode;\n /** The words, passed translated; English by default. */\n labels?: Partial<ListLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A list of records: dense or comfortable, selectable, actions beside each row, windowed when long, with its states. */\nexport function List<T>({\n items,\n getId,\n row,\n \"aria-label\": label,\n density,\n selectable,\n selected: selectedProp,\n defaultSelected = [],\n onSelectedChange,\n chevrons,\n loading,\n loadingRows = 5,\n error,\n empty,\n virtualize,\n footer,\n labels: given,\n className,\n}: ListProps<T>) {\n const labels = { ...listLabels, ...given };\n const s = list({ density });\n const [selected, setSelected] = useControllable<readonly string[]>(selectedProp, defaultSelected, onSelectedChange as (next: readonly string[]) => void);\n const [scrollTop, setScrollTop] = React.useState(0);\n const chosen = new Set(selected);\n const toggle = (id: string) => setSelected(chosen.has(id) ? selected.filter((x) => x !== id) : [...selected, id]);\n\n let shown = items;\n let before = 0;\n let after = 0;\n if (virtualize && !loading) {\n const overscan = virtualize.overscan ?? 6;\n const start = Math.max(0, Math.floor(scrollTop / virtualize.rowHeight) - overscan);\n const end = Math.min(items.length, Math.ceil((scrollTop + virtualize.height) / virtualize.rowHeight) + overscan);\n shown = items.slice(start, end);\n before = start * virtualize.rowHeight;\n after = (items.length - end) * virtualize.rowHeight;\n }\n\n let body: React.ReactNode;\n if (loading) {\n body = Array.from({ length: loadingRows }, (_, i) => (\n <li key={`loading-${i}`} aria-hidden className={s.item()}>\n <div className={s.skeleton({ className: \"h-9 w-9 rounded-full\" })} />\n <div className=\"flex flex-1 flex-col gap-2\">\n <div className={s.skeleton({ className: \"h-3.5 w-2/5\" })} />\n <div className={s.skeleton({ className: \"h-3 w-3/5\" })} />\n </div>\n </li>\n ));\n } else if (error) {\n body = (\n <li className={s.message()}>\n <div role=\"alert\">{error}</div>\n </li>\n );\n } else if (items.length === 0) {\n body = <li className={s.message()}>{empty ?? labels.empty}</li>;\n } else {\n body = shown.map((item) => {\n const id = getId(item);\n const r = row(item);\n const isChosen = chosen.has(id);\n const content = (\n <>\n {r.leading ? <span className={s.leading()}>{r.leading}</span> : null}\n <span className={s.text()}>\n <span className={s.title()}>{r.title}</span>\n {r.description ? <span className={s.description()}>{r.description}</span> : null}\n </span>\n {r.meta ? <span className={s.meta()}>{r.meta}</span> : null}\n {chevrons && (r.href || r.onSelect) ? <ChevronGlyph direction=\"right\" className={s.chevron()} /> : null}\n </>\n );\n return (\n <li key={id} data-state={isChosen ? \"selected\" : undefined} className={s.item()} style={virtualize ? { height: virtualize.rowHeight } : undefined}>\n {selectable ? <Checkbox checked={isChosen} onCheckedChange={() => toggle(id)} aria-label={labels.selectRow(r.title)} className=\"relative z-10\" /> : null}\n {r.href ? (\n <a href={r.href} data-main=\"\" className={s.main()}>\n {content}\n </a>\n ) : r.onSelect ? (\n <button type=\"button\" data-main=\"\" onClick={r.onSelect} className={s.main()}>\n {content}\n </button>\n ) : (\n <div className={s.main()}>{content}</div>\n )}\n {r.actions ? <div className={s.actions()}>{r.actions}</div> : null}\n </li>\n );\n });\n }\n\n const ul = (\n <ul aria-label={label} aria-busy={loading || undefined} className={s.ul()}>\n {before > 0 ? <li aria-hidden style={{ height: before }} /> : null}\n {body}\n {after > 0 ? <li aria-hidden style={{ height: after }} /> : null}\n </ul>\n );\n return (\n <div className={s.root({ className })}>\n {loading ? <span className=\"sr-only\" role=\"status\">{labels.loading}</span> : null}\n {virtualize ? (\n <div tabIndex={0} role=\"region\" aria-label={label} className={s.scroller()} style={{ height: virtualize.height }} onScroll={(e) => setScrollTop(e.currentTarget.scrollTop)}>\n {ul}\n </div>\n ) : (\n ul\n )}\n {footer ? <div className={s.footer()}>{footer}</div> : null}\n </div>\n );\n}\n"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"path": "list/meta.ts",
|
|
431
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"List\",\n summary: \"Records read top to bottom — a leading visual, a title and a line, details and actions beside — dense or comfortable, selectable, windowed when long.\",\n status: \"beta\",\n category: \"data-display\",\n platforms: \"both\",\n whenToUse: [\n \"Orazaka's jobs, Orochia's viewers and tippers of a story, a creator's payouts.\",\n \"A long feed on a phone: sections by day, pull to refresh, swipe actions (React Native).\",\n ],\n whenNotToUse: [\n { when: \"For records with several values to compare side by side.\", use: \"data-table\" },\n { when: \"For what happened over time.\", use: \"activity-feed\" },\n { when: \"For facts about one thing.\", use: \"description-list\" },\n ],\n bestPractices: [\n \"One main action per row (a link or `onSelect`); secondary actions go in `actions`, beside it.\",\n \"Show `loading` for the first page only; the next pages go in `footer` (a “Load more” button, a `Pagination`).\",\n \"Past a few hundred rows, `virtualize` with a fixed row height.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Tab\", action: \"Moves through the rows' main actions, their checkboxes and their secondary actions.\" }],\n notes: [\n \"A `ul` named by `aria-label`; the main action fills the row without nesting the others.\",\n \"A windowed list is a scrolling region the keyboard can reach.\",\n \"On React Native, swipe actions are also accessibility actions.\",\n ],\n },\n related: [\"data-table\", \"activity-feed\", \"description-list\"],\n web: {\n imports: [\"List\"],\n examples: [\n { name: \"jobs\", title: \"Jobs\", description: \"Orazaka's jobs, each row opening its run, the status beside it.\" },\n { name: \"selectable\", title: \"Selectable, compact\", description: \"A story's viewers, picked for a thank-you.\" },\n { name: \"virtualized\", title: \"2,000 rows\", description: \"`virtualize`: only the rows in view are rendered.\" },\n ],\n },\n native: {\n entry: \"@krizaka/ui/native/list\",\n imports: [\"List\", \"useInfiniteList\"],\n differences: [\n \"Its own entry, `@krizaka/ui/native/list` (FlashList, an optional peer); rows are rendered by `renderItem`, not described by `row`.\",\n \"`useInfiniteList` loads the next page near the end and refreshes on a pull, through @krizaka/query.\",\n ],\n examples: [\n { name: \"default\", title: \"Default\", description: \"Notifications with avatars, separators inset after the avatar.\" },\n { name: \"infinite\", title: \"Infinite\", description: \"`useInfiniteList` on a paginated API (faked here with `configureKrizakaFetch`): the next page near the end, pull to refresh.\" },\n { name: \"states\", title: \"Loading and empty\", description: \"Skeleton rows while the first page loads; the empty state with what to do next.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"path": "media.ts",
|
|
435
|
+
"content": "// Shared by the data and media primitives (client): the clock format, the reduced-motion preference, the\n// in-view observer, a debounced callback. Never an entry of its own.\nimport * as React from \"react\";\n\n/** Seconds as a clock: `75` → `1:15`, `3725` → `1:02:05`. Negative or unknown values read `0:00`. */\nexport function formatClock(seconds: number): string {\n const s = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const rest = String(s % 60).padStart(2, \"0\");\n return h > 0 ? `${h}:${String(m).padStart(2, \"0\")}:${rest}` : `${m}:${rest}`;\n}\n\n/** Clamps `value` between `min` and `max`. */\nexport const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (notify: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return () => undefined;\n const query = window.matchMedia(REDUCE);\n query.addEventListener?.(\"change\", notify);\n return () => query.removeEventListener?.(\"change\", notify);\n};\n\n/** `true` when the person asked for less motion (`prefers-reduced-motion: reduce`); follows a change of the setting. */\nexport function usePrefersReducedMotion(): boolean {\n return React.useSyncExternalStore(\n subscribeReduce,\n () => (typeof window !== \"undefined\" && window.matchMedia ? window.matchMedia(REDUCE).matches : false),\n () => false,\n );\n}\n\n/** The latest value of a callback, for an effect or an event that must not re-subscribe when it changes. */\nexport function useLatest<T>(value: T) {\n const ref = React.useRef(value);\n React.useLayoutEffect(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/** Calls `onChange(visible)` when at least `threshold` of the element enters or leaves the viewport. */\nexport function useInView(ref: React.RefObject<Element | null>, onChange: (visible: boolean) => void, enabled = true, threshold = 0.25) {\n const latest = useLatest(onChange);\n React.useEffect(() => {\n const element = ref.current;\n if (!enabled || !element || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => entry && latest.current(entry.isIntersecting), { threshold });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled, threshold, latest]);\n}\n\n/** A stable function that runs `callback` once `delay` ms have passed without a new call; `cancel()` drops the pending one. */\nexport function useDebouncedCallback<A extends unknown[]>(callback: (...args: A) => void, delay: number) {\n const latest = useLatest(callback);\n const [debounced] = React.useState(() => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let wait = delay;\n const run = (...args: A) => {\n clearTimeout(timer);\n if (wait <= 0) latest.current(...args);\n else timer = setTimeout(() => latest.current(...args), wait);\n };\n return Object.assign(run, {\n cancel: () => clearTimeout(timer),\n setDelay: (next: number) => {\n wait = next;\n },\n });\n });\n React.useEffect(() => debounced.setDelay(delay), [debounced, delay]);\n React.useEffect(() => () => debounced.cancel(), [debounced]);\n return debounced;\n}\n\n/** A value controlled by a prop when it is given, held inside otherwise; `set` calls `onChange` either way. */\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (next: T) => void) {\n const [inner, setInner] = React.useState(defaultValue);\n const controlled = value !== undefined;\n const current = controlled ? value : inner;\n const set = React.useCallback(\n (next: T) => {\n if (!controlled) setInner(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [current, set] as const;\n}\n\n/** Starts a media element without an unhandled rejection (autoplay refused, the source replaced meanwhile). */\nexport function playSafely(media: HTMLMediaElement | null | undefined) {\n try {\n const started = media?.play() as Promise<void> | undefined;\n started?.catch?.(() => undefined);\n } catch {\n // Not playable here (no media support): the controls stay as they are.\n }\n}\n"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"path": "meta.ts",
|
|
439
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"activity-feed\"\n | \"action-sheet\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"map\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"stepper\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
"dependencies": [
|
|
443
|
+
"tailwind-variants@^3.3.1"
|
|
444
|
+
],
|
|
445
|
+
"registryDependencies": [
|
|
446
|
+
"checkbox"
|
|
447
|
+
],
|
|
448
|
+
"demo": {
|
|
449
|
+
"path": "examples/list/jobs.tsx",
|
|
450
|
+
"content": "import { Badge } from \"@krizaka/ui/badge\";\nimport { List } from \"@krizaka/ui/list\";\n\ntype Job = { id: string; name: string; studio: string; status: \"running\" | \"done\" | \"failed\"; when: string };\nconst jobs: Job[] = [\n { id: \"j1\", name: \"Dub “Sunset session” into English\", studio: \"Dubbing studio\", status: \"running\", when: \"now\" },\n { id: \"j2\", name: \"Transcribe the interview with Elena\", studio: \"Transcript studio\", status: \"done\", when: \"14:02\" },\n { id: \"j3\", name: \"Clip the five best moments\", studio: \"Clips studio\", status: \"failed\", when: \"12:15\" },\n];\nconst TONE = { running: \"accent\", done: \"success\", failed: \"danger\" } as const;\n\n// Orazaka's jobs: each row opens its run; the status and the time beside it.\nexport default function ListJobs() {\n return (\n <List\n aria-label=\"Jobs\"\n items={jobs}\n getId={(j) => j.id}\n chevrons\n row={(j) => ({\n title: j.name,\n description: j.studio,\n href: `#/jobs/${j.id}`,\n meta: (\n <>\n <Badge tone={TONE[j.status]}>{j.status}</Badge>\n <span>{j.when}</span>\n </>\n ),\n })}\n />\n );\n}\n"
|
|
451
|
+
},
|
|
452
|
+
"props": [
|
|
453
|
+
{
|
|
454
|
+
"component": "List",
|
|
455
|
+
"description": "A list of records: dense or comfortable, selectable, actions beside each row, windowed when long, with its states.",
|
|
456
|
+
"props": [
|
|
457
|
+
{
|
|
458
|
+
"name": "aria-label",
|
|
459
|
+
"type": "string",
|
|
460
|
+
"default": null,
|
|
461
|
+
"description": "The list's accessible name (“Jobs”).",
|
|
462
|
+
"required": true
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"name": "getId",
|
|
466
|
+
"type": "(item: T) => string",
|
|
467
|
+
"default": null,
|
|
468
|
+
"description": "A stable id per record: the React key and the selection's value.",
|
|
469
|
+
"required": true
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"name": "items",
|
|
473
|
+
"type": "readonly T[]",
|
|
474
|
+
"default": null,
|
|
475
|
+
"description": "The records, in order.",
|
|
476
|
+
"required": true
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "row",
|
|
480
|
+
"type": "(item: T) => ListRow",
|
|
481
|
+
"default": null,
|
|
482
|
+
"description": "What a record shows: its title, line, visuals, details, actions and where it leads.",
|
|
483
|
+
"required": true
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "chevrons",
|
|
487
|
+
"type": "boolean",
|
|
488
|
+
"default": null,
|
|
489
|
+
"description": "Shows a chevron on the rows that lead somewhere.",
|
|
490
|
+
"required": false
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "className",
|
|
494
|
+
"type": "string",
|
|
495
|
+
"default": null,
|
|
496
|
+
"description": "Classes merged on the root.",
|
|
497
|
+
"required": false
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "defaultSelected",
|
|
501
|
+
"type": "readonly string[]",
|
|
502
|
+
"default": "[]",
|
|
503
|
+
"description": "The ids selected at first, uncontrolled.",
|
|
504
|
+
"required": false
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "density",
|
|
508
|
+
"type": "\"comfortable\" | \"compact\"",
|
|
509
|
+
"default": null,
|
|
510
|
+
"description": "comfortable (default: 64 px rows with a line) · compact (44 px: dense admin lists).",
|
|
511
|
+
"required": false
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "empty",
|
|
515
|
+
"type": "ReactNode",
|
|
516
|
+
"default": null,
|
|
517
|
+
"description": "Shown when there is no record (an `EmptyState`).",
|
|
518
|
+
"required": false
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "error",
|
|
522
|
+
"type": "ReactNode",
|
|
523
|
+
"default": null,
|
|
524
|
+
"description": "A failure in place of the rows (an `Alert` with a retry); announced.",
|
|
525
|
+
"required": false
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"name": "footer",
|
|
529
|
+
"type": "ReactNode",
|
|
530
|
+
"default": null,
|
|
531
|
+
"description": "Under the list: a `Pagination`, a “Load more” button, a total.",
|
|
532
|
+
"required": false
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"name": "labels",
|
|
536
|
+
"type": "Partial<ListLabels>",
|
|
537
|
+
"default": null,
|
|
538
|
+
"description": "The words, passed translated; English by default.",
|
|
539
|
+
"required": false
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"name": "loading",
|
|
543
|
+
"type": "boolean",
|
|
544
|
+
"default": null,
|
|
545
|
+
"description": "Loading: `loadingRows` skeleton rows and `aria-busy`.",
|
|
546
|
+
"required": false
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"name": "loadingRows",
|
|
550
|
+
"type": "number",
|
|
551
|
+
"default": "5",
|
|
552
|
+
"description": "How many skeleton rows. Default 5.",
|
|
553
|
+
"required": false
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"name": "onSelectedChange",
|
|
557
|
+
"type": "((selected: string[]) => void)",
|
|
558
|
+
"default": null,
|
|
559
|
+
"description": "Called with the new selection.",
|
|
560
|
+
"required": false
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"name": "selectable",
|
|
564
|
+
"type": "boolean",
|
|
565
|
+
"default": null,
|
|
566
|
+
"description": "A checkbox per row.",
|
|
567
|
+
"required": false
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"name": "selected",
|
|
571
|
+
"type": "readonly string[]",
|
|
572
|
+
"default": null,
|
|
573
|
+
"description": "The ids selected (controlled).",
|
|
574
|
+
"required": false
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"name": "virtualize",
|
|
578
|
+
"type": "{ rowHeight: number; height: number; overscan?: number; }",
|
|
579
|
+
"default": null,
|
|
580
|
+
"description": "Renders only the rows in view: fixed `rowHeight`, a scrolling region of `height` px.",
|
|
581
|
+
"required": false
|
|
582
|
+
}
|
|
583
|
+
]
|
|
584
|
+
}
|
|
585
|
+
]
|
|
249
586
|
}
|