@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/slider.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "slider",
|
|
3
3
|
"type": "primitive",
|
|
4
4
|
"title": "Slider",
|
|
5
|
-
"summary": "A value or a range chosen by dragging a thumb along a track, with arrows and Page keys.",
|
|
6
|
-
"description": "A value or a range chosen by dragging a thumb along a track, with arrows and Page keys.",
|
|
5
|
+
"summary": "A value or a range chosen by dragging a thumb along a track — steps you can see, the value floating over the thumb, the brand’s gradient, horizontal or vertical — with arrows and Page keys.",
|
|
6
|
+
"description": "A value or a range chosen by dragging a thumb along a track — steps you can see, the value floating over the thumb, the brand’s gradient, horizontal or vertical — with arrows and Page keys.",
|
|
7
7
|
"status": "beta",
|
|
8
8
|
"category": "forms",
|
|
9
|
-
"platforms": "
|
|
9
|
+
"platforms": "both",
|
|
10
10
|
"whenToUse": [
|
|
11
11
|
"For a value chosen by feel within bounds: volume, speed, brightness.",
|
|
12
12
|
"Two thumbs for a range: a price, a duration."
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
],
|
|
24
24
|
"bestPractices": [
|
|
25
25
|
"Show the value (`showLabel`) when it matters, formatted by `formatValue`.",
|
|
26
|
-
"Choose a `step` people can reach with the arrows; `origin` to fill from a centre on a ± range."
|
|
26
|
+
"Choose a `step` people can reach with the arrows; `origin` to fill from a centre on a ± range.",
|
|
27
|
+
"Show the steps (`ticks`) when there are few of them, and name the ends (`marks`) when the bounds are not obvious."
|
|
27
28
|
],
|
|
28
29
|
"accessibility": {
|
|
29
30
|
"keyboard": [
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"props": [
|
|
57
58
|
{
|
|
58
59
|
"component": "Slider",
|
|
59
|
-
"description": "A slider on one value or a range: `value`/`defaultValue` + `onValueChange`, `min`, `max`, `step`.",
|
|
60
|
+
"description": "A slider on one value or a range: `value`/`defaultValue` + `onValueChange`, `min`, `max`, `step`, `orientation`.",
|
|
60
61
|
"props": [
|
|
61
62
|
{
|
|
62
63
|
"name": "label",
|
|
@@ -72,6 +73,13 @@
|
|
|
72
73
|
"description": "The value at first, uncontrolled: one number, or two for a range.",
|
|
73
74
|
"required": false
|
|
74
75
|
},
|
|
76
|
+
{
|
|
77
|
+
"name": "floatingValue",
|
|
78
|
+
"type": "boolean | \"always\"",
|
|
79
|
+
"default": null,
|
|
80
|
+
"description": "Shows the value floating over the thumb while it is hovered, focused or held (`\"always\"`: at all times).",
|
|
81
|
+
"required": false
|
|
82
|
+
},
|
|
75
83
|
{
|
|
76
84
|
"name": "formatValue",
|
|
77
85
|
"type": "((value: number) => string)",
|
|
@@ -79,6 +87,13 @@
|
|
|
79
87
|
"description": "The value as words (aria-valuetext) and as shown: \"1.5×\", \"−12 %\", \"3 min\".",
|
|
80
88
|
"required": false
|
|
81
89
|
},
|
|
90
|
+
{
|
|
91
|
+
"name": "marks",
|
|
92
|
+
"type": "readonly SliderMark[]",
|
|
93
|
+
"default": null,
|
|
94
|
+
"description": "Words under the track at some values (`[{ value: 0, label: \"0\" }, { value: 100, label: \"100\" }]`). Horizontal only.",
|
|
95
|
+
"required": false
|
|
96
|
+
},
|
|
82
97
|
{
|
|
83
98
|
"name": "onValueChange",
|
|
84
99
|
"type": "((value: V) => void)",
|
|
@@ -97,7 +112,7 @@
|
|
|
97
112
|
"name": "origin",
|
|
98
113
|
"type": "number",
|
|
99
114
|
"default": null,
|
|
100
|
-
"description": "Fills from this value instead of the minimum (a ±range from 0: brightness, balance). One thumb only.",
|
|
115
|
+
"description": "Fills from this value instead of the minimum (a ±range from 0: brightness, balance). One horizontal thumb only.",
|
|
101
116
|
"required": false
|
|
102
117
|
},
|
|
103
118
|
{
|
|
@@ -107,6 +122,13 @@
|
|
|
107
122
|
"description": "Shows the label and the value above the track. Without it, `label` only names the thumb.",
|
|
108
123
|
"required": false
|
|
109
124
|
},
|
|
125
|
+
{
|
|
126
|
+
"name": "size",
|
|
127
|
+
"type": "\"md\" | \"lg\"",
|
|
128
|
+
"default": "md",
|
|
129
|
+
"description": "md · lg (a thicker track and thumb: a hero control, a touch screen).",
|
|
130
|
+
"required": false
|
|
131
|
+
},
|
|
110
132
|
{
|
|
111
133
|
"name": "thumbLabels",
|
|
112
134
|
"type": "[string, string]",
|
|
@@ -114,6 +136,20 @@
|
|
|
114
136
|
"description": "For a range: each thumb's own name ([\"Minimum\", \"Maximum\"]), passed translated.",
|
|
115
137
|
"required": false
|
|
116
138
|
},
|
|
139
|
+
{
|
|
140
|
+
"name": "ticks",
|
|
141
|
+
"type": "boolean | readonly number[]",
|
|
142
|
+
"default": null,
|
|
143
|
+
"description": "Draws a graduation at every step (`true`, up to 40 of them) or at the values given.",
|
|
144
|
+
"required": false
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "tone",
|
|
148
|
+
"type": "\"gradient\" | \"solid\"",
|
|
149
|
+
"default": "gradient",
|
|
150
|
+
"description": "`gradient` (the brand's accent → accent-2, a glow) or `solid` (the accent alone).",
|
|
151
|
+
"required": false
|
|
152
|
+
},
|
|
117
153
|
{
|
|
118
154
|
"name": "value",
|
|
119
155
|
"type": "SliderValue",
|
|
@@ -164,33 +200,263 @@
|
|
|
164
200
|
"path": "examples/slider/disabled.tsx",
|
|
165
201
|
"module": "@krizaka/ui/registry/examples/slider/disabled",
|
|
166
202
|
"code": "import { Slider } from \"@krizaka/ui/slider\";\n\nexport default function SliderDisabled() {\n return <Slider label=\"Volume\" defaultValue={60} disabled />;\n}\n"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "stepped",
|
|
206
|
+
"title": "Steps and marks",
|
|
207
|
+
"description": "`ticks` draws a graduation per step, `marks` their words under the track.",
|
|
208
|
+
"path": "examples/slider/stepped.tsx",
|
|
209
|
+
"module": "@krizaka/ui/registry/examples/slider/stepped",
|
|
210
|
+
"code": "\"use client\";\n\nimport { Slider } from \"@krizaka/ui/slider\";\n\n// Steps you can feel: a graduation at each one, their words under the track.\nexport default function SliderStepped() {\n return (\n <Slider\n label=\"Playback speed\"\n showLabel\n defaultValue={1}\n min={0.5}\n max={2}\n step={0.25}\n ticks\n marks={[\n { value: 0.5, label: \"0.5×\" },\n { value: 1, label: \"1×\" },\n { value: 2, label: \"2×\" },\n ]}\n formatValue={(v) => `${v}×`}\n />\n );\n}\n"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"name": "floating",
|
|
214
|
+
"title": "Floating value",
|
|
215
|
+
"description": "`floatingValue`: the value over the thumb while it is touched; `size=\"lg\"`.",
|
|
216
|
+
"path": "examples/slider/floating.tsx",
|
|
217
|
+
"module": "@krizaka/ui/registry/examples/slider/floating",
|
|
218
|
+
"code": "\"use client\";\n\nimport { Slider } from \"@krizaka/ui/slider\";\n\n// The value floats over the thumb while it is touched (`\"always\"` here, to be seen at rest); a thicker track.\nexport default function SliderFloating() {\n return (\n <div className=\"pt-10\">\n <Slider label=\"Creator's share\" size=\"lg\" defaultValue={70} step={5} floatingValue=\"always\" formatValue={(v) => `${v} %`} />\n </div>\n );\n}\n"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "price-range",
|
|
222
|
+
"title": "Price range",
|
|
223
|
+
"description": "Two thumbs, their values floating, the bounds written under the track.",
|
|
224
|
+
"path": "examples/slider/price-range.tsx",
|
|
225
|
+
"module": "@krizaka/ui/registry/examples/slider/price-range",
|
|
226
|
+
"code": "\"use client\";\n\nimport { Slider } from \"@krizaka/ui/slider\";\nimport * as React from \"react\";\n\n// A price range in the brand's gradient: two floating values, the bounds written under the track.\nexport default function SliderPriceRange() {\n const [price, setPrice] = React.useState<[number, number]>([40, 160]);\n return (\n <div className=\"pt-10\">\n <Slider<[number, number]>\n label=\"Price\"\n thumbLabels={[\"Minimum price\", \"Maximum price\"]}\n value={price}\n onValueChange={setPrice}\n max={250}\n step={10}\n floatingValue=\"always\"\n marks={[\n { value: 0, label: \"$0\" },\n { value: 250, label: \"$250+\" },\n ]}\n formatValue={(v) => `$${v}`}\n />\n </div>\n );\n}\n"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"name": "vertical",
|
|
230
|
+
"title": "Vertical",
|
|
231
|
+
"description": "`orientation=\"vertical\"`: faders; `tone=\"solid\"` for the accent alone.",
|
|
232
|
+
"path": "examples/slider/vertical.tsx",
|
|
233
|
+
"module": "@krizaka/ui/registry/examples/slider/vertical",
|
|
234
|
+
"code": "\"use client\";\n\nimport { Slider } from \"@krizaka/ui/slider\";\n\n// Vertical faders: a mixer's channels, the accent alone, steps marked.\nexport default function SliderVertical() {\n return (\n <div className=\"flex h-48 gap-8\">\n <Slider label=\"Voice\" orientation=\"vertical\" tone=\"solid\" defaultValue={70} step={10} ticks formatValue={(v) => `${v} %`} />\n <Slider label=\"Music\" orientation=\"vertical\" tone=\"solid\" defaultValue={40} step={10} ticks formatValue={(v) => `${v} %`} />\n <Slider label=\"Effects\" orientation=\"vertical\" defaultValue={55} step={10} ticks formatValue={(v) => `${v} %`} />\n </div>\n );\n}\n"
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
"native": {
|
|
239
|
+
"entry": "@krizaka/ui/native",
|
|
240
|
+
"import": "import { Slider } from \"@krizaka/ui/native\";",
|
|
241
|
+
"differences": [
|
|
242
|
+
"Drawn by the theme with a pan responder: drag anywhere on the track, the nearest thumb follows; a `selection` haptic at each step passed (the app's `haptics`).",
|
|
243
|
+
"Each thumb is an adjustable control for VoiceOver and TalkBack: swipe up or down by a step, its value read as words.",
|
|
244
|
+
"`floatingValue` shows the value over the thumb while it is dragged (`\"always\"`: at rest too)."
|
|
245
|
+
],
|
|
246
|
+
"props": [
|
|
247
|
+
{
|
|
248
|
+
"component": "Slider",
|
|
249
|
+
"description": "A slider for React Native — the web `Slider`: one value or a range, drawn by the theme, dragged anywhere on the track.\nEach step the thumb passes ticks under the thumb (`selection` haptic); for VoiceOver and TalkBack each thumb is an\nadjustable control (swipe up or down by a step), its value read as words.",
|
|
250
|
+
"props": [
|
|
251
|
+
{
|
|
252
|
+
"name": "label",
|
|
253
|
+
"type": "string",
|
|
254
|
+
"default": null,
|
|
255
|
+
"description": "The accessible name of the thumb (or of both thumbs of a range), passed translated.",
|
|
256
|
+
"required": true
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "defaultValue",
|
|
260
|
+
"type": "SliderValue",
|
|
261
|
+
"default": null,
|
|
262
|
+
"description": "The value at first, uncontrolled.",
|
|
263
|
+
"required": false
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "disabled",
|
|
267
|
+
"type": "boolean",
|
|
268
|
+
"default": null,
|
|
269
|
+
"description": "Not available.",
|
|
270
|
+
"required": false
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "floatingValue",
|
|
274
|
+
"type": "boolean | \"always\"",
|
|
275
|
+
"default": null,
|
|
276
|
+
"description": "Shows the value floating over the thumb while it is dragged (`\"always\"`: at all times).",
|
|
277
|
+
"required": false
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "formatValue",
|
|
281
|
+
"type": "((value: number) => string)",
|
|
282
|
+
"default": null,
|
|
283
|
+
"description": "The value as words (read, and shown): \"1.5×\", \"15 %\".",
|
|
284
|
+
"required": false
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"name": "marks",
|
|
288
|
+
"type": "readonly { value: number; label: string; }[]",
|
|
289
|
+
"default": null,
|
|
290
|
+
"description": "Words under the track at some values. Horizontal only.",
|
|
291
|
+
"required": false
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"name": "max",
|
|
295
|
+
"type": "number",
|
|
296
|
+
"default": "100",
|
|
297
|
+
"description": "The highest value. Default 100.",
|
|
298
|
+
"required": false
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "min",
|
|
302
|
+
"type": "number",
|
|
303
|
+
"default": "0",
|
|
304
|
+
"description": "The lowest value. Default 0.",
|
|
305
|
+
"required": false
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "onValueChange",
|
|
309
|
+
"type": "((value: V) => void)",
|
|
310
|
+
"default": null,
|
|
311
|
+
"description": "Called on every step the thumb passes.",
|
|
312
|
+
"required": false
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "onValueCommit",
|
|
316
|
+
"type": "((value: V) => void)",
|
|
317
|
+
"default": null,
|
|
318
|
+
"description": "Called once the thumb is released (or an accessibility action is done).",
|
|
319
|
+
"required": false
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "orientation",
|
|
323
|
+
"type": "\"horizontal\" | \"vertical\"",
|
|
324
|
+
"default": "horizontal",
|
|
325
|
+
"description": "`horizontal` (default) or `vertical` (give the slider a height).",
|
|
326
|
+
"required": false
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"name": "showLabel",
|
|
330
|
+
"type": "boolean",
|
|
331
|
+
"default": null,
|
|
332
|
+
"description": "Shows the label and the value above the track.",
|
|
333
|
+
"required": false
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "step",
|
|
337
|
+
"type": "number",
|
|
338
|
+
"default": "1",
|
|
339
|
+
"description": "The step. Default 1.",
|
|
340
|
+
"required": false
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "style",
|
|
344
|
+
"type": "StyleProp<ViewStyle>",
|
|
345
|
+
"default": null,
|
|
346
|
+
"description": "Styles merged last.",
|
|
347
|
+
"required": false
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "thumbLabels",
|
|
351
|
+
"type": "[string, string]",
|
|
352
|
+
"default": null,
|
|
353
|
+
"description": "For a range: each thumb's own name ([\"Minimum\", \"Maximum\"]), passed translated.",
|
|
354
|
+
"required": false
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"name": "ticks",
|
|
358
|
+
"type": "boolean | readonly number[]",
|
|
359
|
+
"default": null,
|
|
360
|
+
"description": "A graduation at every step (`true`, up to 40) or at the values given.",
|
|
361
|
+
"required": false
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"name": "tone",
|
|
365
|
+
"type": "\"gradient\" | \"solid\"",
|
|
366
|
+
"default": "gradient",
|
|
367
|
+
"description": "`gradient` (accent → accent-2, default) or `solid`.",
|
|
368
|
+
"required": false
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"name": "value",
|
|
372
|
+
"type": "SliderValue",
|
|
373
|
+
"default": null,
|
|
374
|
+
"description": "One number (a thumb) or two (a range), controlled.",
|
|
375
|
+
"required": false
|
|
376
|
+
}
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
],
|
|
380
|
+
"examples": [
|
|
381
|
+
{
|
|
382
|
+
"name": "default",
|
|
383
|
+
"title": "Default",
|
|
384
|
+
"description": "One value, labelled, the value floating while dragged.",
|
|
385
|
+
"path": "examples/slider/native/default.tsx",
|
|
386
|
+
"module": "@krizaka/ui/registry/examples/slider/native/default",
|
|
387
|
+
"code": "import { Slider } from \"@krizaka/ui/native\";\nimport * as React from \"react\";\nimport { View } from \"react-native\";\n\n// One value, its label and value above the track; the value floats over the thumb while it is dragged.\nexport default function NativeSliderDefault() {\n const [share, setShare] = React.useState(70);\n return (\n <View style={{ width: 300 }}>\n <Slider label=\"Creator's share\" showLabel floatingValue value={share} onValueChange={setShare} step={5} formatValue={(v) => `${v} %`} />\n </View>\n );\n}\n",
|
|
388
|
+
"screenshots": {
|
|
389
|
+
"dark": "examples/slider/native/default.dark.png",
|
|
390
|
+
"light": "examples/slider/native/default.light.png"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "stepped",
|
|
395
|
+
"title": "Steps and marks",
|
|
396
|
+
"description": "A graduation per step, words under the track.",
|
|
397
|
+
"path": "examples/slider/native/stepped.tsx",
|
|
398
|
+
"module": "@krizaka/ui/registry/examples/slider/native/stepped",
|
|
399
|
+
"code": "import { Slider } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// Steps you feel: a graduation at each one, a selection haptic as the thumb passes it, words under the track.\nexport default function NativeSliderStepped() {\n return (\n <View style={{ width: 300 }}>\n <Slider\n label=\"Playback speed\"\n showLabel\n defaultValue={1}\n min={0.5}\n max={2}\n step={0.25}\n ticks\n marks={[\n { value: 0.5, label: \"0.5×\" },\n { value: 2, label: \"2×\" },\n ]}\n formatValue={(v) => `${v}×`}\n />\n </View>\n );\n}\n",
|
|
400
|
+
"screenshots": {
|
|
401
|
+
"dark": "examples/slider/native/stepped.dark.png",
|
|
402
|
+
"light": "examples/slider/native/stepped.light.png"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "range",
|
|
407
|
+
"title": "Range",
|
|
408
|
+
"description": "Two named thumbs in the brand's gradient.",
|
|
409
|
+
"path": "examples/slider/native/range.tsx",
|
|
410
|
+
"module": "@krizaka/ui/registry/examples/slider/native/range",
|
|
411
|
+
"code": "import { Slider } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// A price range in the brand's gradient: two named thumbs, their values floating.\nexport default function NativeSliderRange() {\n return (\n <View style={{ width: 300, paddingTop: 36 }}>\n <Slider<[number, number]> label=\"Price\" thumbLabels={[\"Minimum price\", \"Maximum price\"]} defaultValue={[40, 160]} max={250} step={10} floatingValue=\"always\" formatValue={(v) => `$${v}`} />\n </View>\n );\n}\n",
|
|
412
|
+
"screenshots": {
|
|
413
|
+
"dark": "examples/slider/native/range.dark.png",
|
|
414
|
+
"light": "examples/slider/native/range.light.png"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "vertical",
|
|
419
|
+
"title": "Vertical",
|
|
420
|
+
"description": "Faders, the accent alone.",
|
|
421
|
+
"path": "examples/slider/native/vertical.tsx",
|
|
422
|
+
"module": "@krizaka/ui/registry/examples/slider/native/vertical",
|
|
423
|
+
"code": "import { Slider } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// Vertical faders, the accent alone, steps marked.\nexport default function NativeSliderVertical() {\n return (\n <View style={{ flexDirection: \"row\", gap: 24, height: 180 }}>\n <Slider label=\"Voice\" orientation=\"vertical\" tone=\"solid\" defaultValue={70} step={10} ticks />\n <Slider label=\"Music\" orientation=\"vertical\" tone=\"solid\" defaultValue={40} step={10} ticks />\n <Slider label=\"Effects\" orientation=\"vertical\" defaultValue={55} step={10} ticks />\n </View>\n );\n}\n",
|
|
424
|
+
"screenshots": {
|
|
425
|
+
"dark": "examples/slider/native/vertical.dark.png",
|
|
426
|
+
"light": "examples/slider/native/vertical.light.png"
|
|
427
|
+
}
|
|
167
428
|
}
|
|
168
429
|
]
|
|
169
430
|
},
|
|
170
|
-
"native": null,
|
|
171
431
|
"files": [
|
|
172
432
|
{
|
|
173
433
|
"path": "meta.ts",
|
|
174
|
-
"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 | \"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 | \"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 | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\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 | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\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"
|
|
434
|
+
"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"
|
|
175
435
|
},
|
|
176
436
|
{
|
|
177
437
|
"path": "slider/index.ts",
|
|
178
|
-
"content": "/** @krizaka/ui/slider — `Slider` (one value or a range), `slider` (the slots). Client (\"use client\"). */\nexport { Slider, slider, type SliderProps, type SliderValue } from \"./slider\";\n"
|
|
438
|
+
"content": "/** @krizaka/ui/slider — `Slider` (one value or a range), `slider` (the slots). Client (\"use client\"). */\nexport { Slider, slider, type SliderMark, type SliderProps, type SliderValue } from \"./slider\";\n"
|
|
179
439
|
},
|
|
180
440
|
{
|
|
181
441
|
"path": "slider/meta.ts",
|
|
182
|
-
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Slider\",\n summary: \"A value or a range chosen by dragging a thumb along a track, with arrows and Page keys.\",\n status: \"beta\",\n category: \"forms\",\n platforms: \"
|
|
442
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Slider\",\n summary: \"A value or a range chosen by dragging a thumb along a track — steps you can see, the value floating over the thumb, the brand\\u2019s gradient, horizontal or vertical — with arrows and Page keys.\",\n status: \"beta\",\n category: \"forms\",\n platforms: \"both\",\n whenToUse: [\"For a value chosen by feel within bounds: volume, speed, brightness.\", \"Two thumbs for a range: a price, a duration.\"],\n whenNotToUse: [\n { when: \"For an exact number the user knows: an input of type number.\", use: \"field\" },\n { when: \"For a few named options.\", use: \"radio-group\" },\n ],\n bestPractices: [\n \"Show the value (`showLabel`) when it matters, formatted by `formatValue`.\",\n \"Choose a `step` people can reach with the arrows; `origin` to fill from a centre on a ± range.\",\n \"Show the steps (`ticks`) when there are few of them, and name the ends (`marks`) when the bounds are not obvious.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Arrow keys\", action: \"Move by one step.\" },\n { keys: \"Page Up / Page Down\", action: \"Move by a larger step.\" },\n { keys: \"Home / End\", action: \"Go to the minimum or the maximum.\" },\n ],\n notes: [\n \"Radix Slider: each thumb is a `slider` named by `label` (or `thumbLabels` for a range).\",\n \"`formatValue` also gives `aria-valuetext`: the value as it is read.\",\n ],\n },\n related: [\"field\", \"progress\", \"switch\"],\n web: {\n imports: [\"Slider\"],\n examples: [\n { name: \"default\", title: \"Default\", description: \"The thumb alone, named by `label`.\" },\n { name: \"with-label\", title: \"With a label\", description: \"`showLabel`: the label and the formatted value above the track.\" },\n { name: \"centred\", title: \"Centred\", description: \"`origin={0}` on a ± range.\" },\n { name: \"range\", title: \"Range\", description: \"Two thumbs, each named.\" },\n { name: \"disabled\", title: \"Disabled\", description: \"Not available.\" },\n { name: \"stepped\", title: \"Steps and marks\", description: \"`ticks` draws a graduation per step, `marks` their words under the track.\" },\n { name: \"floating\", title: \"Floating value\", description: \"`floatingValue`: the value over the thumb while it is touched; `size=\\\"lg\\\"`.\" },\n { name: \"price-range\", title: \"Price range\", description: \"Two thumbs, their values floating, the bounds written under the track.\" },\n { name: \"vertical\", title: \"Vertical\", description: \"`orientation=\\\"vertical\\\"`: faders; `tone=\\\"solid\\\"` for the accent alone.\" },\n ],\n },\n native: {\n imports: [\"Slider\"],\n differences: [\n \"Drawn by the theme with a pan responder: drag anywhere on the track, the nearest thumb follows; a `selection` haptic at each step passed (the app's `haptics`).\",\n \"Each thumb is an adjustable control for VoiceOver and TalkBack: swipe up or down by a step, its value read as words.\",\n \"`floatingValue` shows the value over the thumb while it is dragged (`\\\"always\\\"`: at rest too).\",\n ],\n examples: [\n { name: \"default\", title: \"Default\", description: \"One value, labelled, the value floating while dragged.\" },\n { name: \"stepped\", title: \"Steps and marks\", description: \"A graduation per step, words under the track.\" },\n { name: \"range\", title: \"Range\", description: \"Two named thumbs in the brand's gradient.\" },\n { name: \"vertical\", title: \"Vertical\", description: \"Faders, the accent alone.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
183
443
|
},
|
|
184
444
|
{
|
|
185
445
|
"path": "slider/slider.tsx",
|
|
186
|
-
"content": "// Client. Radix Slider: role=\"slider\" on each thumb, arrows / Page Up / Page Down / Home / End, a range with two\n// thumbs. The words arrive as props: `label` names the thumb(s), `formatValue` gives the aria-valuetext and the value\n// shown next to a visible label.\nimport { Slider as SliderPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const slider = tv({\n slots: {\n root: \"flex flex-col gap-2\",\n header: \"flex items-baseline justify-between gap-3 text-xs font-semibold text-fg-secondary\",\n value: \"font-mono text-[11px] tabular-nums text-fg-secondary\",\n control:\n \"relative flex h-6 w-full touch-none select-none items-center data-disabled:cursor-not-allowed data-disabled:opacity-40\",\n track: \"relative h-1.5 w-full grow overflow-hidden rounded-full bg-surface-3\",\n range: \"absolute h-full rounded-full bg-linear-to-r from-accent to-accent-2\",\n thumb:\n \"block h-5 w-5 cursor-grab rounded-full border border-border-strong bg-fg-on-media shadow-md transition-[box-shadow] \" +\n \"focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-ring/50 active:cursor-grabbing\",\n },\n});\n\nexport type SliderValue = number | [number, number];\n\nexport type SliderProps<V extends SliderValue = number> = Omit<\n React.ComponentProps<typeof SliderPrimitive.Root>,\n \"value\" | \"defaultValue\" | \"onValueChange\" | \"onValueCommit\" | \"children\"\n> & {\n /** One number (a thumb) or two (a range). Controlled with `onValueChange`. */\n value?: V;\n /** The value at first, uncontrolled: one number, or two for a range. */\n defaultValue?: V;\n /** Called on every move, with one number or two. */\n onValueChange?: (value: V) => void;\n /** Called once the drag or the key press ends. */\n onValueCommit?: (value: V) => void;\n /** The accessible name — of the thumb, or of both thumbs of a range — passed translated. */\n label: string;\n /** For a range: each thumb's own name ([\"Minimum\", \"Maximum\"]), passed translated. */\n thumbLabels?: [string, string];\n /** The value as words (aria-valuetext) and as shown: \"1.5×\", \"−12 %\", \"3 min\". */\n formatValue?: (value: number) => string;\n /** Shows the label and the value above the track. Without it, `label` only names the thumb. */\n showLabel?: boolean;\n /** Fills from this value instead of the minimum (a ±range from 0: brightness, balance). One thumb only. */\n origin?: number;\n};\n\nconst toArray = (v: SliderValue | undefined) => (v === undefined ? undefined : typeof v === \"number\" ? [v] : v);\n\n/** A slider on one value or a range: `value`/`defaultValue` + `onValueChange`, `min`, `max`, `step`. */\nexport function Slider<V extends SliderValue = number>({\n value,\n defaultValue,\n onValueChange,\n onValueCommit,\n label,\n thumbLabels,\n formatValue = String,\n showLabel,\n origin,\n min = 0,\n max = 100,\n className,\n ...props\n}: SliderProps<V>) {\n const s = slider();\n const range = Array.isArray(value ?? defaultValue);\n const [inner, setInner] = React.useState(() => toArray(defaultValue) ?? [min]);\n const current = toArray(value) ?? inner;\n const out = (next: number[]) => (range ? next : next[0]) as V;\n const pct = (v: number) => ((v - min) / (max - min || 1)) * 100;\n const fill =\n origin !== undefined && !range\n ? { left: `${Math.min(pct(origin), pct(current[0]))}%`, right: `${100 - Math.max(pct(origin), pct(current[0]))}%` }\n : undefined;\n const id = React.useId();\n return (\n <div className={s.root({ className })} data-range={range ? \"\" : undefined}>\n {showLabel && (\n <div className={s.header()}>\n <span id={`${id}-label`}>{label}</span>\n <span className={s.value()} aria-hidden>\n {current.map(formatValue).join(\" – \")}\n </span>\n </div>\n )}\n <SliderPrimitive.Root\n min={min}\n max={max}\n value={current}\n onValueChange={(next) => {\n if (value === undefined) setInner(next);\n onValueChange?.(out(next));\n }}\n onValueCommit={onValueCommit && ((next) => onValueCommit(out(next)))}\n className={s.control()}\n {...props}\n >\n <SliderPrimitive.Track className={s.track()}>\n {fill ? <span data-origin=\"\" className={s.range()} style={fill} /> : <SliderPrimitive.Range className={s.range()} />}\n </SliderPrimitive.Track>\n {current.map((v, i) => (\n <SliderPrimitive.Thumb\n key={i}\n aria-label={range ? (thumbLabels?.[i] ?? label) : showLabel ? undefined : label}\n aria-labelledby={!range && showLabel ? `${id}-label` : undefined}\n aria-valuetext={formatValue(v)}\n className={s.thumb()}\n />\n ))}\n </SliderPrimitive.Root>\n </div>\n );\n}\n"
|
|
446
|
+
"content": "// Client. Radix Slider: role=\"slider\" on each thumb, arrows / Page Up / Page Down / Home / End, a range with two\n// thumbs, horizontal or vertical. The words arrive as props: `label` names the thumb(s), `formatValue` gives the\n// aria-valuetext and the value shown (above the track, or floating over the thumb while it is touched). `ticks` draws the\n// graduations of the steps (and `marks` their words under the track); `tone` fills with the brand's gradient or its\n// accent alone.\nimport { Slider as SliderPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { tv } from \"../tv\";\n\nexport const slider = tv({\n slots: {\n root: \"flex flex-col gap-2 data-[orientation=vertical]:h-full data-[orientation=vertical]:items-center\",\n header: \"flex items-baseline justify-between gap-3 text-xs font-semibold text-fg-secondary\",\n value: \"font-mono text-[11px] tabular-nums text-fg-secondary\",\n control:\n \"relative flex touch-none select-none items-center data-disabled:cursor-not-allowed data-disabled:opacity-40 \" +\n \"data-[orientation=horizontal]:h-6 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-6 data-[orientation=vertical]:flex-col\",\n track:\n \"relative grow overflow-hidden rounded-full bg-surface-3 inset-shadow-well \" +\n \"data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\",\n range: \"absolute rounded-full data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full\",\n thumb:\n \"group/thumb relative block h-5 w-5 cursor-grab rounded-full border-2 border-accent bg-fg-on-media shadow-raised transition-[box-shadow,scale] duration-150 \" +\n \"hover:scale-110 focus-visible:outline-hidden focus-visible:focus-ring active:scale-110 active:cursor-grabbing motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:active:scale-100\",\n // The value over the thumb: shown while the thumb is hovered, focused or held.\n bubble:\n \"pointer-events-none absolute bottom-full left-1/2 mb-2.5 -translate-x-1/2 whitespace-nowrap rounded-lg bg-fg px-2 py-1 font-mono text-[11px] font-semibold tabular-nums text-surface-0 opacity-0 shadow-floating \" +\n \"transition-opacity duration-150 after:absolute after:left-1/2 after:top-full after:-translate-x-1/2 after:border-4 after:border-transparent after:border-t-fg \" +\n \"group-hover/thumb:opacity-100 group-focus-visible/thumb:opacity-100 group-active/thumb:opacity-100 data-[always]:opacity-100 motion-reduce:transition-none\",\n bubbleVertical: \"bottom-auto left-full top-1/2 mb-0 ml-3 -translate-x-0 -translate-y-1/2 after:hidden\",\n ticks: \"pointer-events-none absolute inset-0\",\n tick: \"absolute rounded-full bg-border-strong data-[on]:bg-on-accent/70 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-px data-[orientation=horizontal]:-translate-x-1/2 data-[orientation=horizontal]:-translate-y-1/2 data-[orientation=vertical]:left-1/2 data-[orientation=vertical]:h-px data-[orientation=vertical]:w-1 data-[orientation=vertical]:-translate-x-1/2 data-[orientation=vertical]:translate-y-1/2\",\n marks: \"relative h-4 w-full text-[11px] font-medium tabular-nums text-fg-secondary\",\n mark: \"absolute top-0 -translate-x-1/2 whitespace-nowrap first:translate-x-0 last:-translate-x-full\",\n },\n variants: {\n tone: {\n /** The brand's signature: accent → accent-2, a glow under it. */\n gradient: { range: \"bg-linear-to-r from-accent to-accent-2 shadow-glow data-[orientation=vertical]:bg-linear-to-t\" },\n /** The accent alone. */\n solid: { range: \"bg-accent\" },\n },\n size: {\n md: {},\n lg: {\n track: \"data-[orientation=horizontal]:h-2.5 data-[orientation=vertical]:w-2.5\",\n thumb: \"h-6 w-6\",\n control: \"data-[orientation=horizontal]:h-8 data-[orientation=vertical]:w-8\",\n },\n },\n },\n defaultVariants: { tone: \"gradient\", size: \"md\" },\n});\n\nexport type SliderValue = number | [number, number];\n\nexport type SliderMark = {\n /** Where the mark stands. */\n value: number;\n /** Its words under the track (\"0\", \"50 %\", \"Max\"), passed translated. */\n label: string;\n};\n\nexport type SliderProps<V extends SliderValue = number> = Omit<\n React.ComponentProps<typeof SliderPrimitive.Root>,\n \"value\" | \"defaultValue\" | \"onValueChange\" | \"onValueCommit\" | \"children\"\n> & {\n /** One number (a thumb) or two (a range). Controlled with `onValueChange`. */\n value?: V;\n /** The value at first, uncontrolled: one number, or two for a range. */\n defaultValue?: V;\n /** Called on every move, with one number or two. */\n onValueChange?: (value: V) => void;\n /** Called once the drag or the key press ends. */\n onValueCommit?: (value: V) => void;\n /** The accessible name — of the thumb, or of both thumbs of a range — passed translated. */\n label: string;\n /** For a range: each thumb's own name ([\"Minimum\", \"Maximum\"]), passed translated. */\n thumbLabels?: [string, string];\n /** The value as words (aria-valuetext) and as shown: \"1.5×\", \"−12 %\", \"3 min\". */\n formatValue?: (value: number) => string;\n /** Shows the label and the value above the track. Without it, `label` only names the thumb. */\n showLabel?: boolean;\n /** Shows the value floating over the thumb while it is hovered, focused or held (`\"always\"`: at all times). */\n floatingValue?: boolean | \"always\";\n /** Fills from this value instead of the minimum (a ±range from 0: brightness, balance). One horizontal thumb only. */\n origin?: number;\n /** Draws a graduation at every step (`true`, up to 40 of them) or at the values given. */\n ticks?: boolean | readonly number[];\n /** Words under the track at some values (`[{ value: 0, label: \"0\" }, { value: 100, label: \"100\" }]`). Horizontal only. */\n marks?: readonly SliderMark[];\n /**\n * `gradient` (the brand's accent → accent-2, a glow) or `solid` (the accent alone).\n * @default \"gradient\"\n */\n tone?: \"gradient\" | \"solid\";\n /**\n * md · lg (a thicker track and thumb: a hero control, a touch screen).\n * @default \"md\"\n */\n size?: \"md\" | \"lg\";\n};\n\nconst toArray = (v: SliderValue | undefined) => (v === undefined ? undefined : typeof v === \"number\" ? [v] : v);\n\n/** A slider on one value or a range: `value`/`defaultValue` + `onValueChange`, `min`, `max`, `step`, `orientation`. */\nexport function Slider<V extends SliderValue = number>({\n value,\n defaultValue,\n onValueChange,\n onValueCommit,\n label,\n thumbLabels,\n formatValue = String,\n showLabel,\n floatingValue,\n origin,\n ticks,\n marks,\n tone,\n size,\n min = 0,\n max = 100,\n step = 1,\n orientation = \"horizontal\",\n className,\n ...props\n}: SliderProps<V>) {\n const s = slider({ tone, size });\n const range = Array.isArray(value ?? defaultValue);\n const vertical = orientation === \"vertical\";\n const [inner, setInner] = React.useState(() => toArray(defaultValue) ?? [min]);\n const current = toArray(value) ?? inner;\n const out = (next: number[]) => (range ? next : next[0]) as V;\n const pct = (v: number) => ((v - min) / (max - min || 1)) * 100;\n const fill =\n origin !== undefined && !range && !vertical\n ? { left: `${Math.min(pct(origin), pct(current[0]!))}%`, right: `${100 - Math.max(pct(origin), pct(current[0]!))}%` }\n : undefined;\n const lo = range ? Math.min(...current) : (origin ?? min);\n const hi = range ? Math.max(...current) : current[0]!;\n const tickValues = ticks === true ? (max - min) / step <= 40 ? Array.from({ length: Math.round((max - min) / step) + 1 }, (_, i) => min + i * step) : [] : ticks ? [...ticks] : [];\n const id = React.useId();\n return (\n <div className={s.root({ className })} data-range={range ? \"\" : undefined} data-orientation={orientation}>\n {showLabel && (\n <div className={s.header()}>\n <span id={`${id}-label`}>{label}</span>\n <span className={s.value()} aria-hidden>\n {current.map(formatValue).join(\" – \")}\n </span>\n </div>\n )}\n <SliderPrimitive.Root\n min={min}\n max={max}\n step={step}\n orientation={orientation}\n value={current}\n onValueChange={(next) => {\n if (value === undefined) setInner(next);\n onValueChange?.(out(next));\n }}\n onValueCommit={onValueCommit && ((next) => onValueCommit(out(next)))}\n className={s.control()}\n {...props}\n >\n <SliderPrimitive.Track className={s.track()}>\n {fill ? <span data-origin=\"\" data-orientation={orientation} className={s.range()} style={fill} /> : <SliderPrimitive.Range className={s.range()} />}\n {tickValues.length ? (\n <span aria-hidden className={s.ticks()}>\n {tickValues.map((t) => (\n <span\n key={t}\n data-orientation={orientation}\n data-on={t > lo && t < hi ? \"\" : undefined}\n className={s.tick()}\n style={vertical ? { bottom: `${pct(t)}%` } : { left: `${pct(t)}%` }}\n />\n ))}\n </span>\n ) : null}\n </SliderPrimitive.Track>\n {current.map((v, i) => (\n <SliderPrimitive.Thumb\n key={i}\n aria-label={range ? (thumbLabels?.[i] ?? label) : showLabel ? undefined : label}\n aria-labelledby={!range && showLabel ? `${id}-label` : undefined}\n aria-valuetext={formatValue(v)}\n className={s.thumb()}\n >\n {floatingValue ? (\n <span aria-hidden data-always={floatingValue === \"always\" ? \"\" : undefined} className={s.bubble({ className: vertical ? s.bubbleVertical() : undefined })}>\n {formatValue(v)}\n </span>\n ) : null}\n </SliderPrimitive.Thumb>\n ))}\n </SliderPrimitive.Root>\n {marks?.length && !vertical ? (\n <div aria-hidden className={s.marks()}>\n {marks.map((m) => (\n <span key={m.value} className={s.mark()} style={{ left: `${pct(m.value)}%` }}>\n {m.label}\n </span>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"path": "tv.ts",
|
|
450
|
+
"content": "import { createTV } from \"tailwind-variants\";\n\nimport { twMergeConfig } from \"./cn\";\n\n/** `tv` with the preset's utilities known to the merge engine (`twMergeConfig`): what a primitive wearing the material is styled with. */\nexport const tv = createTV({ twMergeConfig });\n"
|
|
187
451
|
}
|
|
188
452
|
],
|
|
189
453
|
"dependencies": [
|
|
190
454
|
"radix-ui@^1.7.0",
|
|
191
455
|
"tailwind-variants@^3.3.1"
|
|
192
456
|
],
|
|
193
|
-
"registryDependencies": [
|
|
457
|
+
"registryDependencies": [
|
|
458
|
+
"cn"
|
|
459
|
+
],
|
|
194
460
|
"demo": {
|
|
195
461
|
"path": "examples/slider/default.tsx",
|
|
196
462
|
"content": "import { Slider } from \"@krizaka/ui/slider\";\n\nexport default function SliderDefault() {\n return <Slider label=\"Volume\" defaultValue={60} />;\n}\n"
|
|
@@ -198,7 +464,7 @@
|
|
|
198
464
|
"props": [
|
|
199
465
|
{
|
|
200
466
|
"component": "Slider",
|
|
201
|
-
"description": "A slider on one value or a range: `value`/`defaultValue` + `onValueChange`, `min`, `max`, `step`.",
|
|
467
|
+
"description": "A slider on one value or a range: `value`/`defaultValue` + `onValueChange`, `min`, `max`, `step`, `orientation`.",
|
|
202
468
|
"props": [
|
|
203
469
|
{
|
|
204
470
|
"name": "label",
|
|
@@ -214,6 +480,13 @@
|
|
|
214
480
|
"description": "The value at first, uncontrolled: one number, or two for a range.",
|
|
215
481
|
"required": false
|
|
216
482
|
},
|
|
483
|
+
{
|
|
484
|
+
"name": "floatingValue",
|
|
485
|
+
"type": "boolean | \"always\"",
|
|
486
|
+
"default": null,
|
|
487
|
+
"description": "Shows the value floating over the thumb while it is hovered, focused or held (`\"always\"`: at all times).",
|
|
488
|
+
"required": false
|
|
489
|
+
},
|
|
217
490
|
{
|
|
218
491
|
"name": "formatValue",
|
|
219
492
|
"type": "((value: number) => string)",
|
|
@@ -221,6 +494,13 @@
|
|
|
221
494
|
"description": "The value as words (aria-valuetext) and as shown: \"1.5×\", \"−12 %\", \"3 min\".",
|
|
222
495
|
"required": false
|
|
223
496
|
},
|
|
497
|
+
{
|
|
498
|
+
"name": "marks",
|
|
499
|
+
"type": "readonly SliderMark[]",
|
|
500
|
+
"default": null,
|
|
501
|
+
"description": "Words under the track at some values (`[{ value: 0, label: \"0\" }, { value: 100, label: \"100\" }]`). Horizontal only.",
|
|
502
|
+
"required": false
|
|
503
|
+
},
|
|
224
504
|
{
|
|
225
505
|
"name": "onValueChange",
|
|
226
506
|
"type": "((value: V) => void)",
|
|
@@ -239,7 +519,7 @@
|
|
|
239
519
|
"name": "origin",
|
|
240
520
|
"type": "number",
|
|
241
521
|
"default": null,
|
|
242
|
-
"description": "Fills from this value instead of the minimum (a ±range from 0: brightness, balance). One thumb only.",
|
|
522
|
+
"description": "Fills from this value instead of the minimum (a ±range from 0: brightness, balance). One horizontal thumb only.",
|
|
243
523
|
"required": false
|
|
244
524
|
},
|
|
245
525
|
{
|
|
@@ -249,6 +529,13 @@
|
|
|
249
529
|
"description": "Shows the label and the value above the track. Without it, `label` only names the thumb.",
|
|
250
530
|
"required": false
|
|
251
531
|
},
|
|
532
|
+
{
|
|
533
|
+
"name": "size",
|
|
534
|
+
"type": "\"md\" | \"lg\"",
|
|
535
|
+
"default": "md",
|
|
536
|
+
"description": "md · lg (a thicker track and thumb: a hero control, a touch screen).",
|
|
537
|
+
"required": false
|
|
538
|
+
},
|
|
252
539
|
{
|
|
253
540
|
"name": "thumbLabels",
|
|
254
541
|
"type": "[string, string]",
|
|
@@ -256,6 +543,20 @@
|
|
|
256
543
|
"description": "For a range: each thumb's own name ([\"Minimum\", \"Maximum\"]), passed translated.",
|
|
257
544
|
"required": false
|
|
258
545
|
},
|
|
546
|
+
{
|
|
547
|
+
"name": "ticks",
|
|
548
|
+
"type": "boolean | readonly number[]",
|
|
549
|
+
"default": null,
|
|
550
|
+
"description": "Draws a graduation at every step (`true`, up to 40 of them) or at the values given.",
|
|
551
|
+
"required": false
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"name": "tone",
|
|
555
|
+
"type": "\"gradient\" | \"solid\"",
|
|
556
|
+
"default": "gradient",
|
|
557
|
+
"description": "`gradient` (the brand's accent → accent-2, a glow) or `solid` (the accent alone).",
|
|
558
|
+
"required": false
|
|
559
|
+
},
|
|
259
560
|
{
|
|
260
561
|
"name": "value",
|
|
261
562
|
"type": "SliderValue",
|
package/registry/slot.json
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"files": [
|
|
74
74
|
{
|
|
75
75
|
"path": "meta.ts",
|
|
76
|
-
"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 | \"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 | \"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 | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\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 | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\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"
|
|
76
|
+
"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"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"path": "slot/index.ts",
|