@krizaka/ui 2.0.0-beta.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -28
- package/dist/{button-D5aSsmxX.d.ts → button-Cgfkg_3y.d.ts} +5 -1
- package/dist/button.d.ts +5 -1
- package/dist/button.js +4 -2
- package/dist/button.js.map +1 -1
- package/dist/card.d.ts +7 -1
- package/dist/card.js +2 -2
- package/dist/card.js.map +1 -1
- package/dist/{chunk-IUGBKMJC.js → chunk-FHYZSO2S.js} +2 -2
- package/dist/{chunk-6DJ6SQY3.js → chunk-PESA2R4U.js} +5 -3
- package/dist/chunk-PESA2R4U.js.map +1 -0
- package/dist/command.d.ts +11 -2
- package/dist/command.js +17 -6
- package/dist/command.js.map +1 -1
- package/dist/confirm-button.d.ts +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/countdown.d.ts +7 -6
- package/dist/countdown.js +12 -8
- package/dist/countdown.js.map +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dropdown-menu.js +3 -3
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/field.js +2 -2
- package/dist/field.js.map +1 -1
- package/dist/native.d.ts +56 -6
- package/dist/native.js +129 -85
- package/dist/native.js.map +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +1 -1
- package/package.json +11 -11
- package/registry/alert.json +141 -3
- package/registry/avatar.json +314 -3
- package/registry/badge.json +233 -3
- package/registry/button.json +522 -8
- package/registry/card.json +427 -4
- package/registry/checkbox.json +127 -3
- package/registry/chip.json +394 -3
- package/registry/cn.json +51 -3
- package/registry/command.json +246 -5
- package/registry/confirm-button.json +172 -5
- package/registry/countdown.json +318 -7
- package/registry/dialog.json +310 -3
- package/registry/dropdown-menu.json +117 -4
- package/registry/empty-state.json +170 -3
- package/registry/examples/alert/danger.d.ts +4 -0
- package/registry/examples/alert/danger.js +22 -0
- package/registry/examples/alert/danger.tsx +25 -0
- package/registry/examples/alert/info.d.ts +4 -0
- package/registry/{demos/alert.js → examples/alert/info.js} +3 -3
- package/registry/{demos/alert.tsx → examples/alert/info.tsx} +1 -1
- package/registry/examples/alert/success.d.ts +4 -0
- package/registry/examples/alert/success.js +12 -0
- package/registry/examples/alert/success.tsx +15 -0
- package/registry/examples/alert/title-only.d.ts +4 -0
- package/registry/examples/alert/title-only.js +11 -0
- package/registry/examples/alert/title-only.tsx +5 -0
- package/registry/examples/alert/warning.d.ts +4 -0
- package/registry/examples/alert/warning.js +13 -0
- package/registry/examples/alert/warning.tsx +17 -0
- package/registry/examples/avatar/fallback.d.ts +4 -0
- package/registry/examples/avatar/fallback.js +11 -0
- package/registry/examples/avatar/fallback.tsx +6 -0
- package/registry/examples/avatar/group.d.ts +4 -0
- package/registry/examples/avatar/group.js +20 -0
- package/registry/examples/avatar/group.tsx +21 -0
- package/registry/examples/avatar/native/group.d.ts +4 -0
- package/registry/examples/avatar/native/group.dark.png +0 -0
- package/registry/examples/avatar/native/group.js +17 -0
- package/registry/examples/avatar/native/group.light.png +0 -0
- package/registry/examples/avatar/native/group.tsx +13 -0
- package/registry/examples/avatar/native/sizes.d.ts +4 -0
- package/registry/examples/avatar/native/sizes.dark.png +0 -0
- package/registry/examples/avatar/native/sizes.js +18 -0
- package/registry/examples/avatar/native/sizes.light.png +0 -0
- package/registry/examples/avatar/native/sizes.tsx +15 -0
- package/registry/examples/avatar/sizes.d.ts +4 -0
- package/registry/examples/avatar/sizes.js +17 -0
- package/registry/examples/avatar/sizes.tsx +13 -0
- package/registry/examples/avatar/with-image.d.ts +4 -0
- package/registry/{demos/avatar.js → examples/avatar/with-image.js} +3 -3
- package/registry/{demos/avatar.tsx → examples/avatar/with-image.tsx} +1 -1
- package/registry/examples/badge/accent.d.ts +4 -0
- package/registry/examples/badge/accent.js +11 -0
- package/registry/examples/badge/accent.tsx +9 -0
- package/registry/examples/badge/danger.d.ts +4 -0
- package/registry/examples/badge/danger.js +11 -0
- package/registry/examples/badge/danger.tsx +9 -0
- package/registry/examples/badge/medium.d.ts +4 -0
- package/registry/examples/badge/medium.js +11 -0
- package/registry/examples/badge/medium.tsx +9 -0
- package/registry/examples/badge/native/dot.d.ts +4 -0
- package/registry/examples/badge/native/dot.dark.png +0 -0
- package/registry/examples/badge/native/dot.js +15 -0
- package/registry/examples/badge/native/dot.light.png +0 -0
- package/registry/examples/badge/native/dot.tsx +16 -0
- package/registry/examples/badge/native/scrim.d.ts +4 -0
- package/registry/examples/badge/native/scrim.dark.png +0 -0
- package/registry/examples/badge/native/scrim.js +13 -0
- package/registry/examples/badge/native/scrim.light.png +0 -0
- package/registry/examples/badge/native/scrim.tsx +14 -0
- package/registry/examples/badge/native/tones.d.ts +4 -0
- package/registry/examples/badge/native/tones.dark.png +0 -0
- package/registry/examples/badge/native/tones.js +18 -0
- package/registry/examples/badge/native/tones.light.png +0 -0
- package/registry/examples/badge/native/tones.tsx +14 -0
- package/registry/examples/badge/neutral.d.ts +4 -0
- package/registry/{demos/badge.js → examples/badge/neutral.js} +3 -3
- package/registry/{demos/badge.tsx → examples/badge/neutral.tsx} +1 -1
- package/registry/examples/badge/scrim.d.ts +4 -0
- package/registry/examples/badge/scrim.js +11 -0
- package/registry/examples/badge/scrim.tsx +10 -0
- package/registry/examples/badge/success.d.ts +4 -0
- package/registry/examples/badge/success.js +11 -0
- package/registry/examples/badge/success.tsx +9 -0
- package/registry/examples/badge/warning.d.ts +4 -0
- package/registry/examples/badge/warning.js +11 -0
- package/registry/examples/badge/warning.tsx +9 -0
- package/registry/examples/button/as-child-link.d.ts +4 -0
- package/registry/examples/button/as-child-link.js +11 -0
- package/registry/examples/button/as-child-link.tsx +10 -0
- package/registry/examples/button/danger.d.ts +4 -0
- package/registry/examples/button/danger.js +11 -0
- package/registry/examples/button/danger.tsx +5 -0
- package/registry/examples/button/disabled.d.ts +4 -0
- package/registry/examples/button/disabled.js +11 -0
- package/registry/examples/button/disabled.tsx +9 -0
- package/registry/examples/button/ghost.d.ts +4 -0
- package/registry/examples/button/ghost.js +11 -0
- package/registry/examples/button/ghost.tsx +5 -0
- package/registry/examples/button/gradient.d.ts +4 -0
- package/registry/examples/button/gradient.js +11 -0
- package/registry/examples/button/gradient.tsx +5 -0
- package/registry/examples/button/icon.d.ts +4 -0
- package/registry/examples/button/icon.js +14 -0
- package/registry/examples/button/icon.tsx +18 -0
- package/registry/examples/button/loading.d.ts +4 -0
- package/registry/examples/button/loading.js +11 -0
- package/registry/examples/button/loading.tsx +10 -0
- package/registry/examples/button/native/danger.d.ts +4 -0
- package/registry/examples/button/native/danger.dark.png +0 -0
- package/registry/examples/button/native/danger.js +12 -0
- package/registry/examples/button/native/danger.light.png +0 -0
- package/registry/examples/button/native/danger.tsx +5 -0
- package/registry/examples/button/native/disabled.d.ts +4 -0
- package/registry/examples/button/native/disabled.dark.png +0 -0
- package/registry/examples/button/native/disabled.js +11 -0
- package/registry/examples/button/native/disabled.light.png +0 -0
- package/registry/examples/button/native/disabled.tsx +5 -0
- package/registry/examples/button/native/ghost.d.ts +4 -0
- package/registry/examples/button/native/ghost.dark.png +0 -0
- package/registry/examples/button/native/ghost.js +12 -0
- package/registry/examples/button/native/ghost.light.png +0 -0
- package/registry/examples/button/native/ghost.tsx +5 -0
- package/registry/examples/button/native/gradient.d.ts +4 -0
- package/registry/examples/button/native/gradient.dark.png +0 -0
- package/registry/examples/button/native/gradient.js +12 -0
- package/registry/examples/button/native/gradient.light.png +0 -0
- package/registry/examples/button/native/gradient.tsx +5 -0
- package/registry/examples/button/native/icon-only.d.ts +4 -0
- package/registry/examples/button/native/icon-only.dark.png +0 -0
- package/registry/examples/button/native/icon-only.js +19 -0
- package/registry/examples/button/native/icon-only.light.png +0 -0
- package/registry/examples/button/native/icon-only.tsx +21 -0
- package/registry/examples/button/native/icon.d.ts +4 -0
- package/registry/examples/button/native/icon.dark.png +0 -0
- package/registry/examples/button/native/icon.js +16 -0
- package/registry/examples/button/native/icon.light.png +0 -0
- package/registry/examples/button/native/icon.tsx +15 -0
- package/registry/examples/button/native/loading.d.ts +4 -0
- package/registry/examples/button/native/loading.dark.png +0 -0
- package/registry/examples/button/native/loading.js +11 -0
- package/registry/examples/button/native/loading.light.png +0 -0
- package/registry/examples/button/native/loading.tsx +6 -0
- package/registry/examples/button/native/outline.d.ts +4 -0
- package/registry/examples/button/native/outline.dark.png +0 -0
- package/registry/examples/button/native/outline.js +12 -0
- package/registry/examples/button/native/outline.light.png +0 -0
- package/registry/examples/button/native/outline.tsx +5 -0
- package/registry/examples/button/native/primary.d.ts +4 -0
- package/registry/examples/button/native/primary.dark.png +0 -0
- package/registry/examples/button/native/primary.js +12 -0
- package/registry/examples/button/native/primary.light.png +0 -0
- package/registry/examples/button/native/primary.tsx +5 -0
- package/registry/examples/button/native/secondary.d.ts +4 -0
- package/registry/examples/button/native/secondary.dark.png +0 -0
- package/registry/examples/button/native/secondary.js +12 -0
- package/registry/examples/button/native/secondary.light.png +0 -0
- package/registry/examples/button/native/secondary.tsx +6 -0
- package/registry/examples/button/native/sizes.d.ts +4 -0
- package/registry/examples/button/native/sizes.dark.png +0 -0
- package/registry/examples/button/native/sizes.js +15 -0
- package/registry/examples/button/native/sizes.light.png +0 -0
- package/registry/examples/button/native/sizes.tsx +11 -0
- package/registry/examples/button/outline.d.ts +4 -0
- package/registry/examples/button/outline.js +11 -0
- package/registry/examples/button/outline.tsx +5 -0
- package/registry/examples/button/pill.d.ts +4 -0
- package/registry/examples/button/pill.js +11 -0
- package/registry/examples/button/pill.tsx +9 -0
- package/registry/examples/button/primary.d.ts +4 -0
- package/registry/{demos/button.js → examples/button/primary.js} +3 -3
- package/registry/{demos/button.tsx → examples/button/primary.tsx} +1 -1
- package/registry/examples/button/secondary.d.ts +4 -0
- package/registry/examples/button/secondary.js +11 -0
- package/registry/examples/button/secondary.tsx +6 -0
- package/registry/examples/button/sizes.d.ts +4 -0
- package/registry/examples/button/sizes.js +15 -0
- package/registry/examples/button/sizes.tsx +17 -0
- package/registry/examples/card/interactive-link.d.ts +4 -0
- package/registry/examples/card/interactive-link.js +15 -0
- package/registry/examples/card/interactive-link.tsx +16 -0
- package/registry/examples/card/media-card.d.ts +4 -0
- package/registry/{demos/card.js → examples/card/media-card.js} +3 -3
- package/registry/{demos/card.tsx → examples/card/media-card.tsx} +1 -1
- package/registry/examples/card/media-fallback.d.ts +4 -0
- package/registry/examples/card/media-fallback.js +18 -0
- package/registry/examples/card/media-fallback.tsx +22 -0
- package/registry/examples/card/native/body.d.ts +4 -0
- package/registry/examples/card/native/body.dark.png +0 -0
- package/registry/examples/card/native/body.js +15 -0
- package/registry/examples/card/native/body.light.png +0 -0
- package/registry/examples/card/native/body.tsx +13 -0
- package/registry/examples/card/native/default.d.ts +4 -0
- package/registry/examples/card/native/default.dark.png +0 -0
- package/registry/examples/card/native/default.js +24 -0
- package/registry/examples/card/native/default.light.png +0 -0
- package/registry/examples/card/native/default.tsx +28 -0
- package/registry/examples/card/native/elevated.d.ts +4 -0
- package/registry/examples/card/native/elevated.dark.png +0 -0
- package/registry/examples/card/native/elevated.js +24 -0
- package/registry/examples/card/native/elevated.light.png +0 -0
- package/registry/examples/card/native/elevated.tsx +28 -0
- package/registry/examples/card/native/pressable.d.ts +4 -0
- package/registry/examples/card/native/pressable.dark.png +0 -0
- package/registry/examples/card/native/pressable.js +15 -0
- package/registry/examples/card/native/pressable.light.png +0 -0
- package/registry/examples/card/native/pressable.tsx +13 -0
- package/registry/examples/card/reveal-grid.d.ts +4 -0
- package/registry/examples/card/reveal-grid.js +28 -0
- package/registry/examples/card/reveal-grid.tsx +31 -0
- package/registry/examples/card/stat-card.d.ts +4 -0
- package/registry/examples/card/stat-card.js +18 -0
- package/registry/examples/card/stat-card.tsx +17 -0
- package/registry/examples/checkbox/checked.d.ts +4 -0
- package/registry/examples/checkbox/checked.js +11 -0
- package/registry/examples/checkbox/checked.tsx +5 -0
- package/registry/examples/checkbox/disabled.d.ts +4 -0
- package/registry/examples/checkbox/disabled.js +14 -0
- package/registry/examples/checkbox/disabled.tsx +12 -0
- package/registry/examples/checkbox/indeterminate.d.ts +4 -0
- package/registry/examples/checkbox/indeterminate.js +11 -0
- package/registry/examples/checkbox/indeterminate.tsx +6 -0
- package/registry/examples/checkbox/invalid.d.ts +4 -0
- package/registry/examples/checkbox/invalid.js +15 -0
- package/registry/examples/checkbox/invalid.tsx +14 -0
- package/registry/examples/checkbox/unchecked.d.ts +4 -0
- package/registry/{demos/checkbox.js → examples/checkbox/unchecked.js} +3 -3
- package/registry/{demos/checkbox.tsx → examples/checkbox/unchecked.tsx} +2 -1
- package/registry/examples/chip/multiple.d.ts +4 -0
- package/registry/examples/chip/multiple.js +16 -0
- package/registry/examples/chip/multiple.tsx +12 -0
- package/registry/examples/chip/native/multiple.d.ts +4 -0
- package/registry/examples/chip/native/multiple.dark.png +0 -0
- package/registry/examples/chip/native/multiple.js +18 -0
- package/registry/examples/chip/native/multiple.light.png +0 -0
- package/registry/examples/chip/native/multiple.tsx +17 -0
- package/registry/examples/chip/native/removable.d.ts +4 -0
- package/registry/examples/chip/native/removable.dark.png +0 -0
- package/registry/examples/chip/native/removable.js +17 -0
- package/registry/examples/chip/native/removable.light.png +0 -0
- package/registry/examples/chip/native/removable.tsx +15 -0
- package/registry/examples/chip/native/single.d.ts +4 -0
- package/registry/examples/chip/native/single.dark.png +0 -0
- package/registry/examples/chip/native/single.js +15 -0
- package/registry/examples/chip/native/single.light.png +0 -0
- package/registry/examples/chip/native/single.tsx +11 -0
- package/registry/examples/chip/native/toggle.d.ts +4 -0
- package/registry/examples/chip/native/toggle.dark.png +0 -0
- package/registry/examples/chip/native/toggle.js +17 -0
- package/registry/examples/chip/native/toggle.light.png +0 -0
- package/registry/examples/chip/native/toggle.tsx +16 -0
- package/registry/examples/chip/removable.d.ts +4 -0
- package/registry/examples/chip/removable.js +16 -0
- package/registry/examples/chip/removable.tsx +15 -0
- package/registry/examples/chip/single.d.ts +4 -0
- package/registry/examples/chip/single.js +16 -0
- package/registry/examples/chip/single.tsx +13 -0
- package/registry/examples/chip/small.d.ts +4 -0
- package/registry/examples/chip/small.js +16 -0
- package/registry/examples/chip/small.tsx +12 -0
- package/registry/examples/chip/toggle.d.ts +4 -0
- package/registry/{demos/chip.js → examples/chip/toggle.js} +3 -3
- package/registry/{demos/chip.tsx → examples/chip/toggle.tsx} +2 -1
- package/registry/examples/cn/merge.d.ts +4 -0
- package/registry/{demos/cn.js → examples/cn/merge.js} +3 -3
- package/registry/{demos/cn.tsx → examples/cn/merge.tsx} +1 -1
- package/registry/examples/command/dialog.d.ts +4 -0
- package/registry/examples/command/dialog.js +39 -0
- package/registry/examples/command/dialog.tsx +35 -0
- package/registry/examples/command/inline.d.ts +4 -0
- package/registry/{demos/command.js → examples/command/inline.js} +4 -5
- package/registry/{demos/command.tsx → examples/command/inline.tsx} +2 -3
- package/registry/examples/command/no-results.d.ts +4 -0
- package/registry/examples/command/no-results.js +19 -0
- package/registry/examples/command/no-results.tsx +20 -0
- package/registry/examples/confirm-button/armed.d.ts +4 -0
- package/registry/examples/confirm-button/armed.js +12 -0
- package/registry/examples/confirm-button/armed.tsx +14 -0
- package/registry/examples/confirm-button/idle.d.ts +4 -0
- package/registry/{demos/confirm-button.js → examples/confirm-button/idle.js} +3 -3
- package/registry/{demos/confirm-button.tsx → examples/confirm-button/idle.tsx} +1 -1
- package/registry/examples/confirm-button/with-text.d.ts +4 -0
- package/registry/examples/confirm-button/with-text.js +12 -0
- package/registry/examples/confirm-button/with-text.tsx +12 -0
- package/registry/examples/countdown/days.d.ts +4 -0
- package/registry/examples/countdown/days.js +13 -0
- package/registry/examples/countdown/days.tsx +10 -0
- package/registry/examples/countdown/ended.d.ts +4 -0
- package/registry/examples/countdown/ended.js +13 -0
- package/registry/examples/countdown/ended.tsx +10 -0
- package/registry/examples/countdown/hours.d.ts +4 -0
- package/registry/{demos/countdown.js → examples/countdown/hours.js} +3 -3
- package/registry/{demos/countdown.tsx → examples/countdown/hours.tsx} +1 -1
- package/registry/examples/countdown/native/days.d.ts +4 -0
- package/registry/examples/countdown/native/days.dark.png +0 -0
- package/registry/examples/countdown/native/days.js +13 -0
- package/registry/examples/countdown/native/days.light.png +0 -0
- package/registry/examples/countdown/native/days.tsx +7 -0
- package/registry/examples/countdown/native/hours.d.ts +4 -0
- package/registry/examples/countdown/native/hours.dark.png +0 -0
- package/registry/examples/countdown/native/hours.js +13 -0
- package/registry/examples/countdown/native/hours.light.png +0 -0
- package/registry/examples/countdown/native/hours.tsx +7 -0
- package/registry/examples/countdown/native/sizes.d.ts +4 -0
- package/registry/examples/countdown/native/sizes.dark.png +0 -0
- package/registry/examples/countdown/native/sizes.js +18 -0
- package/registry/examples/countdown/native/sizes.light.png +0 -0
- package/registry/examples/countdown/native/sizes.tsx +15 -0
- package/registry/examples/countdown/native/urgent.d.ts +4 -0
- package/registry/examples/countdown/native/urgent.dark.png +0 -0
- package/registry/examples/countdown/native/urgent.js +13 -0
- package/registry/examples/countdown/native/urgent.light.png +0 -0
- package/registry/examples/countdown/native/urgent.tsx +7 -0
- package/registry/examples/countdown/native/with-label.d.ts +4 -0
- package/registry/examples/countdown/native/with-label.dark.png +0 -0
- package/registry/examples/countdown/native/with-label.js +13 -0
- package/registry/examples/countdown/native/with-label.light.png +0 -0
- package/registry/examples/countdown/native/with-label.tsx +7 -0
- package/registry/examples/countdown/sizes.d.ts +4 -0
- package/registry/examples/countdown/sizes.js +18 -0
- package/registry/examples/countdown/sizes.tsx +17 -0
- package/registry/examples/countdown/urgent.d.ts +4 -0
- package/registry/examples/countdown/urgent.js +13 -0
- package/registry/examples/countdown/urgent.tsx +10 -0
- package/registry/examples/countdown/with-label.d.ts +4 -0
- package/registry/examples/countdown/with-label.js +13 -0
- package/registry/examples/countdown/with-label.tsx +10 -0
- package/registry/examples/dialog/alert-destructive.d.ts +4 -0
- package/registry/examples/dialog/alert-destructive.js +24 -0
- package/registry/examples/dialog/alert-destructive.tsx +20 -0
- package/registry/examples/dialog/bottom.d.ts +4 -0
- package/registry/examples/dialog/bottom.js +29 -0
- package/registry/examples/dialog/bottom.tsx +32 -0
- package/registry/examples/dialog/center.d.ts +4 -0
- package/registry/{demos/dialog.js → examples/dialog/center.js} +3 -3
- package/registry/{demos/dialog.tsx → examples/dialog/center.tsx} +1 -1
- package/registry/examples/dialog/gate.d.ts +4 -0
- package/registry/examples/dialog/gate.js +24 -0
- package/registry/examples/dialog/gate.tsx +27 -0
- package/registry/examples/dialog/right.d.ts +4 -0
- package/registry/examples/dialog/right.js +29 -0
- package/registry/examples/dialog/right.tsx +32 -0
- package/registry/examples/dialog/sheet-form.d.ts +4 -0
- package/registry/examples/dialog/sheet-form.js +35 -0
- package/registry/examples/dialog/sheet-form.tsx +36 -0
- package/registry/examples/dropdown-menu/actions.d.ts +4 -0
- package/registry/{demos/dropdown-menu.js → examples/dropdown-menu/actions.js} +3 -3
- package/registry/{demos/dropdown-menu.tsx → examples/dropdown-menu/actions.tsx} +1 -1
- package/registry/examples/empty-state/default.d.ts +4 -0
- package/registry/{demos/empty-state.js → examples/empty-state/default.js} +3 -3
- package/registry/{demos/empty-state.tsx → examples/empty-state/default.tsx} +1 -1
- package/registry/examples/empty-state/native/default.d.ts +4 -0
- package/registry/examples/empty-state/native/default.dark.png +0 -0
- package/registry/examples/empty-state/native/default.js +25 -0
- package/registry/examples/empty-state/native/default.light.png +0 -0
- package/registry/examples/empty-state/native/default.tsx +25 -0
- package/registry/examples/empty-state/title-only.d.ts +4 -0
- package/registry/examples/empty-state/title-only.js +11 -0
- package/registry/examples/empty-state/title-only.tsx +5 -0
- package/registry/examples/empty-state/with-action.d.ts +4 -0
- package/registry/examples/empty-state/with-action.js +24 -0
- package/registry/examples/empty-state/with-action.tsx +25 -0
- package/registry/examples/field/default.d.ts +4 -0
- package/registry/{demos/field.js → examples/field/default.js} +3 -3
- package/registry/{demos/field.tsx → examples/field/default.tsx} +1 -1
- package/registry/examples/field/disabled.d.ts +4 -0
- package/registry/examples/field/disabled.js +14 -0
- package/registry/examples/field/disabled.tsx +10 -0
- package/registry/examples/field/invalid.d.ts +4 -0
- package/registry/examples/field/invalid.js +15 -0
- package/registry/examples/field/invalid.tsx +12 -0
- package/registry/examples/field/select.d.ts +4 -0
- package/registry/examples/field/select.js +18 -0
- package/registry/examples/field/select.tsx +15 -0
- package/registry/examples/field/textarea.d.ts +4 -0
- package/registry/examples/field/textarea.js +14 -0
- package/registry/examples/field/textarea.tsx +10 -0
- package/registry/examples/kbd/key.d.ts +4 -0
- package/registry/{demos/kbd.js → examples/kbd/key.js} +3 -3
- package/registry/{demos/kbd.tsx → examples/kbd/key.tsx} +1 -1
- package/registry/examples/kbd/shortcut.d.ts +4 -0
- package/registry/examples/kbd/shortcut.js +15 -0
- package/registry/examples/kbd/shortcut.tsx +11 -0
- package/registry/examples/kbd/small.d.ts +4 -0
- package/registry/examples/kbd/small.js +11 -0
- package/registry/examples/kbd/small.tsx +5 -0
- package/registry/examples/page-header/default.d.ts +4 -0
- package/registry/{demos/page-header.js → examples/page-header/default.js} +3 -3
- package/registry/{demos/page-header.tsx → examples/page-header/default.tsx} +1 -1
- package/registry/examples/page-header/with-actions.d.ts +4 -0
- package/registry/examples/page-header/with-actions.js +22 -0
- package/registry/examples/page-header/with-actions.tsx +17 -0
- package/registry/examples/page-header/with-breadcrumb.d.ts +4 -0
- package/registry/examples/page-header/with-breadcrumb.js +24 -0
- package/registry/examples/page-header/with-breadcrumb.tsx +26 -0
- package/registry/examples/popover/form.d.ts +4 -0
- package/registry/{demos/popover.js → examples/popover/form.js} +3 -3
- package/registry/{demos/popover.tsx → examples/popover/form.tsx} +1 -1
- package/registry/examples/progress/bar-indeterminate.d.ts +4 -0
- package/registry/examples/progress/bar-indeterminate.js +11 -0
- package/registry/examples/progress/bar-indeterminate.tsx +6 -0
- package/registry/examples/progress/bar-sizes.d.ts +4 -0
- package/registry/examples/progress/bar-sizes.js +15 -0
- package/registry/examples/progress/bar-sizes.tsx +11 -0
- package/registry/examples/progress/bar.d.ts +4 -0
- package/registry/{demos/progress.js → examples/progress/bar.js} +3 -3
- package/registry/{demos/progress.tsx → examples/progress/bar.tsx} +1 -1
- package/registry/examples/progress/native/bar.d.ts +4 -0
- package/registry/examples/progress/native/bar.dark.png +0 -0
- package/registry/examples/progress/native/bar.js +16 -0
- package/registry/examples/progress/native/bar.light.png +0 -0
- package/registry/examples/progress/native/bar.tsx +12 -0
- package/registry/examples/progress/native/indeterminate.d.ts +4 -0
- package/registry/examples/progress/native/indeterminate.dark.png +0 -0
- package/registry/examples/progress/native/indeterminate.js +15 -0
- package/registry/examples/progress/native/indeterminate.light.png +0 -0
- package/registry/examples/progress/native/indeterminate.tsx +12 -0
- package/registry/examples/progress/native/ring.d.ts +4 -0
- package/registry/examples/progress/native/ring.dark.png +0 -0
- package/registry/examples/progress/native/ring.js +19 -0
- package/registry/examples/progress/native/ring.light.png +0 -0
- package/registry/examples/progress/native/ring.tsx +19 -0
- package/registry/examples/progress/ring-indeterminate.d.ts +4 -0
- package/registry/examples/progress/ring-indeterminate.js +11 -0
- package/registry/examples/progress/ring-indeterminate.tsx +5 -0
- package/registry/examples/progress/ring.d.ts +4 -0
- package/registry/examples/progress/ring.js +18 -0
- package/registry/examples/progress/ring.tsx +17 -0
- package/registry/examples/radio-group/cards.d.ts +4 -0
- package/registry/examples/radio-group/cards.js +19 -0
- package/registry/examples/radio-group/cards.tsx +21 -0
- package/registry/examples/radio-group/horizontal.d.ts +4 -0
- package/registry/examples/radio-group/horizontal.js +15 -0
- package/registry/examples/radio-group/horizontal.tsx +12 -0
- package/registry/examples/radio-group/items.d.ts +4 -0
- package/registry/{demos/radio-group.js → examples/radio-group/items.js} +3 -3
- package/registry/{demos/radio-group.tsx → examples/radio-group/items.tsx} +1 -1
- package/registry/examples/section-backdrop/depth-of-field.d.ts +4 -0
- package/registry/examples/section-backdrop/depth-of-field.js +18 -0
- package/registry/examples/section-backdrop/depth-of-field.tsx +13 -0
- package/registry/examples/section-backdrop/hero.d.ts +4 -0
- package/registry/{demos/section-backdrop.js → examples/section-backdrop/hero.js} +3 -3
- package/registry/{demos/section-backdrop.tsx → examples/section-backdrop/hero.tsx} +1 -1
- package/registry/examples/section-backdrop/plain.d.ts +4 -0
- package/registry/examples/section-backdrop/plain.js +11 -0
- package/registry/examples/section-backdrop/plain.tsx +10 -0
- package/registry/examples/section-backdrop/sequence.d.ts +4 -0
- package/registry/examples/section-backdrop/sequence.js +14 -0
- package/registry/examples/section-backdrop/sequence.tsx +15 -0
- package/registry/examples/section-backdrop/up.d.ts +4 -0
- package/registry/examples/section-backdrop/up.js +11 -0
- package/registry/examples/section-backdrop/up.tsx +10 -0
- package/registry/examples/segmented/native/default.d.ts +4 -0
- package/registry/examples/segmented/native/default.dark.png +0 -0
- package/registry/examples/segmented/native/default.js +19 -0
- package/registry/examples/segmented/native/default.light.png +0 -0
- package/registry/examples/segmented/native/default.tsx +19 -0
- package/registry/examples/segmented/native/small.d.ts +4 -0
- package/registry/examples/segmented/native/small.dark.png +0 -0
- package/registry/examples/segmented/native/small.js +19 -0
- package/registry/examples/segmented/native/small.light.png +0 -0
- package/registry/examples/segmented/native/small.tsx +19 -0
- package/registry/examples/separator/horizontal.d.ts +4 -0
- package/registry/{demos/separator.js → examples/separator/horizontal.js} +3 -3
- package/registry/{demos/separator.tsx → examples/separator/horizontal.tsx} +1 -1
- package/registry/examples/separator/vertical.d.ts +4 -0
- package/registry/examples/separator/vertical.js +17 -0
- package/registry/examples/separator/vertical.tsx +14 -0
- package/registry/examples/skeleton/circle.d.ts +4 -0
- package/registry/examples/skeleton/circle.js +11 -0
- package/registry/examples/skeleton/circle.tsx +5 -0
- package/registry/examples/skeleton/composition.d.ts +4 -0
- package/registry/{demos/skeleton.js → examples/skeleton/composition.js} +3 -3
- package/registry/{demos/skeleton.tsx → examples/skeleton/composition.tsx} +1 -1
- package/registry/examples/skeleton/native/shapes.d.ts +4 -0
- package/registry/examples/skeleton/native/shapes.dark.png +0 -0
- package/registry/examples/skeleton/native/shapes.js +21 -0
- package/registry/examples/skeleton/native/shapes.light.png +0 -0
- package/registry/examples/skeleton/native/shapes.tsx +18 -0
- package/registry/examples/skeleton/rect.d.ts +4 -0
- package/registry/examples/skeleton/rect.js +11 -0
- package/registry/examples/skeleton/rect.tsx +5 -0
- package/registry/examples/skeleton/text.d.ts +4 -0
- package/registry/examples/skeleton/text.js +11 -0
- package/registry/examples/skeleton/text.tsx +5 -0
- package/registry/examples/slider/centred.d.ts +4 -0
- package/registry/examples/slider/centred.js +11 -0
- package/registry/examples/slider/centred.tsx +8 -0
- package/registry/examples/slider/default.d.ts +4 -0
- package/registry/{demos/slider.js → examples/slider/default.js} +3 -3
- package/registry/{demos/slider.tsx → examples/slider/default.tsx} +1 -1
- package/registry/examples/slider/disabled.d.ts +4 -0
- package/registry/examples/slider/disabled.js +11 -0
- package/registry/examples/slider/disabled.tsx +5 -0
- package/registry/examples/slider/range.d.ts +4 -0
- package/registry/examples/slider/range.js +22 -0
- package/registry/examples/slider/range.tsx +18 -0
- package/registry/examples/slider/with-label.d.ts +4 -0
- package/registry/examples/slider/with-label.js +11 -0
- package/registry/examples/slider/with-label.tsx +8 -0
- package/registry/examples/slot/as-child.d.ts +4 -0
- package/registry/{demos/slot.js → examples/slot/as-child.js} +3 -3
- package/registry/{demos/slot.tsx → examples/slot/as-child.tsx} +1 -1
- package/registry/examples/slot/visually-hidden.d.ts +4 -0
- package/registry/examples/slot/visually-hidden.js +14 -0
- package/registry/examples/slot/visually-hidden.tsx +13 -0
- package/registry/examples/spinner/default.d.ts +4 -0
- package/registry/{demos/spinner.js → examples/spinner/default.js} +3 -3
- package/registry/{demos/spinner.tsx → examples/spinner/default.tsx} +1 -1
- package/registry/examples/spinner/muted.d.ts +4 -0
- package/registry/examples/spinner/muted.js +11 -0
- package/registry/examples/spinner/muted.tsx +6 -0
- package/registry/examples/spinner/native/sizes.d.ts +4 -0
- package/registry/examples/spinner/native/sizes.dark.png +0 -0
- package/registry/examples/spinner/native/sizes.js +16 -0
- package/registry/examples/spinner/native/sizes.light.png +0 -0
- package/registry/examples/spinner/native/sizes.tsx +13 -0
- package/registry/examples/spinner/sizes.d.ts +4 -0
- package/registry/examples/spinner/sizes.js +15 -0
- package/registry/examples/spinner/sizes.tsx +11 -0
- package/registry/examples/stat/down.d.ts +4 -0
- package/registry/examples/stat/down.js +11 -0
- package/registry/examples/stat/down.tsx +5 -0
- package/registry/examples/stat/flat.d.ts +4 -0
- package/registry/examples/stat/flat.js +11 -0
- package/registry/examples/stat/flat.tsx +5 -0
- package/registry/examples/stat/plain.d.ts +4 -0
- package/registry/examples/stat/plain.js +11 -0
- package/registry/examples/stat/plain.tsx +5 -0
- package/registry/examples/stat/row.d.ts +4 -0
- package/registry/examples/stat/row.js +15 -0
- package/registry/examples/stat/row.tsx +12 -0
- package/registry/examples/stat/up.d.ts +4 -0
- package/registry/{demos/stat.js → examples/stat/up.js} +3 -3
- package/registry/{demos/stat.tsx → examples/stat/up.tsx} +1 -1
- package/registry/examples/switch/disabled.d.ts +4 -0
- package/registry/examples/switch/disabled.js +14 -0
- package/registry/examples/switch/disabled.tsx +10 -0
- package/registry/examples/switch/off.d.ts +4 -0
- package/registry/{demos/switch.js → examples/switch/off.js} +3 -3
- package/registry/{demos/switch.tsx → examples/switch/off.tsx} +1 -1
- package/registry/examples/switch/on.d.ts +4 -0
- package/registry/examples/switch/on.js +11 -0
- package/registry/examples/switch/on.tsx +5 -0
- package/registry/examples/switch/small.d.ts +4 -0
- package/registry/examples/switch/small.js +11 -0
- package/registry/examples/switch/small.tsx +5 -0
- package/registry/examples/switch/with-label.d.ts +4 -0
- package/registry/examples/switch/with-label.js +18 -0
- package/registry/examples/switch/with-label.tsx +17 -0
- package/registry/examples/tabs/pills.d.ts +4 -0
- package/registry/examples/tabs/pills.js +20 -0
- package/registry/examples/tabs/pills.tsx +23 -0
- package/registry/examples/tabs/segmented.d.ts +4 -0
- package/registry/examples/tabs/segmented.js +20 -0
- package/registry/examples/tabs/segmented.tsx +23 -0
- package/registry/examples/tabs/underline.d.ts +4 -0
- package/registry/{demos/tabs.js → examples/tabs/underline.js} +3 -3
- package/registry/{demos/tabs.tsx → examples/tabs/underline.tsx} +1 -1
- package/registry/examples/tabs/vertical.d.ts +4 -0
- package/registry/examples/tabs/vertical.js +20 -0
- package/registry/examples/tabs/vertical.tsx +23 -0
- package/registry/examples/theme/native/provider.d.ts +4 -0
- package/registry/examples/theme/native/provider.js +23 -0
- package/registry/examples/theme/native/provider.tsx +21 -0
- package/registry/examples/theme/secondary.d.ts +4 -0
- package/registry/examples/theme/secondary.js +11 -0
- package/registry/examples/theme/secondary.tsx +10 -0
- package/registry/examples/theme/toggle.d.ts +4 -0
- package/registry/{demos/theme.js → examples/theme/toggle.js} +3 -3
- package/registry/{demos/theme.tsx → examples/theme/toggle.tsx} +1 -1
- package/registry/examples/toast/custom.d.ts +4 -0
- package/registry/examples/toast/custom.js +30 -0
- package/registry/examples/toast/custom.tsx +35 -0
- package/registry/examples/toast/native/notification.d.ts +4 -0
- package/registry/examples/toast/native/notification.dark.png +0 -0
- package/registry/examples/toast/native/notification.js +29 -0
- package/registry/examples/toast/native/notification.light.png +0 -0
- package/registry/examples/toast/native/notification.tsx +30 -0
- package/registry/examples/toast/native/tones.d.ts +4 -0
- package/registry/examples/toast/native/tones.dark.png +0 -0
- package/registry/examples/toast/native/tones.js +28 -0
- package/registry/examples/toast/native/tones.light.png +0 -0
- package/registry/examples/toast/native/tones.tsx +25 -0
- package/registry/examples/toast/tones.d.ts +4 -0
- package/registry/{demos/toast.js → examples/toast/tones.js} +3 -3
- package/registry/{demos/toast.tsx → examples/toast/tones.tsx} +1 -1
- package/registry/examples/tooltip/right.d.ts +4 -0
- package/registry/examples/tooltip/right.js +15 -0
- package/registry/examples/tooltip/right.tsx +15 -0
- package/registry/examples/tooltip/top.d.ts +4 -0
- package/registry/{demos/tooltip.js → examples/tooltip/top.js} +3 -3
- package/registry/{demos/tooltip.tsx → examples/tooltip/top.tsx} +1 -1
- package/registry/examples/txt/native/tones.d.ts +4 -0
- package/registry/examples/txt/native/tones.dark.png +0 -0
- package/registry/examples/txt/native/tones.js +16 -0
- package/registry/examples/txt/native/tones.light.png +0 -0
- package/registry/examples/txt/native/tones.tsx +17 -0
- package/registry/examples/txt/native/variants.d.ts +4 -0
- package/registry/examples/txt/native/variants.dark.png +0 -0
- package/registry/examples/txt/native/variants.js +18 -0
- package/registry/examples/txt/native/variants.light.png +0 -0
- package/registry/examples/txt/native/variants.tsx +15 -0
- package/registry/field.json +142 -4
- package/registry/index.json +353 -33
- package/registry/kbd.json +90 -3
- package/registry/page-header.json +121 -3
- package/registry/popover.json +90 -3
- package/registry/progress.json +265 -3
- package/registry/radio-group.json +136 -3
- package/registry/section-backdrop.json +144 -3
- package/registry/segmented.json +125 -0
- package/registry/separator.json +67 -3
- package/registry/skeleton.json +166 -3
- package/registry/slider.json +177 -3
- package/registry/slot.json +79 -3
- package/registry/spinner.json +144 -3
- package/registry/stat.json +140 -3
- package/registry/switch.json +130 -3
- package/registry/tabs.json +117 -3
- package/registry/theme.json +190 -4
- package/registry/toast.json +190 -3
- package/registry/tooltip.json +143 -3
- package/registry/txt.json +97 -0
- package/dist/chunk-6DJ6SQY3.js.map +0 -1
- package/registry/demos/alert.d.ts +0 -5
- package/registry/demos/avatar.d.ts +0 -5
- package/registry/demos/badge.d.ts +0 -5
- package/registry/demos/button.d.ts +0 -5
- package/registry/demos/card.d.ts +0 -5
- package/registry/demos/checkbox.d.ts +0 -5
- package/registry/demos/chip.d.ts +0 -5
- package/registry/demos/cn.d.ts +0 -7
- package/registry/demos/command.d.ts +0 -5
- package/registry/demos/confirm-button.d.ts +0 -5
- package/registry/demos/countdown.d.ts +0 -5
- package/registry/demos/dialog.d.ts +0 -7
- package/registry/demos/dropdown-menu.d.ts +0 -7
- package/registry/demos/empty-state.d.ts +0 -5
- package/registry/demos/field.d.ts +0 -5
- package/registry/demos/kbd.d.ts +0 -5
- package/registry/demos/page-header.d.ts +0 -5
- package/registry/demos/popover.d.ts +0 -7
- package/registry/demos/progress.d.ts +0 -5
- package/registry/demos/radio-group.d.ts +0 -5
- package/registry/demos/section-backdrop.d.ts +0 -5
- package/registry/demos/separator.d.ts +0 -5
- package/registry/demos/skeleton.d.ts +0 -5
- package/registry/demos/slider.d.ts +0 -5
- package/registry/demos/slot.d.ts +0 -5
- package/registry/demos/spinner.d.ts +0 -5
- package/registry/demos/stat.d.ts +0 -5
- package/registry/demos/switch.d.ts +0 -5
- package/registry/demos/tabs.d.ts +0 -5
- package/registry/demos/theme.d.ts +0 -5
- package/registry/demos/toast.d.ts +0 -8
- package/registry/demos/tooltip.d.ts +0 -7
- /package/dist/{chunk-IUGBKMJC.js.map → chunk-FHYZSO2S.js.map} +0 -0
package/registry/slider.json
CHANGED
|
@@ -1,12 +1,186 @@
|
|
|
1
1
|
{
|
|
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.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "forms",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"For a value chosen by feel within bounds: volume, speed, brightness.",
|
|
12
|
+
"Two thumbs for a range: a price, a duration."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "For an exact number the user knows: an input of type number.",
|
|
17
|
+
"use": "field"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "For a few named options.",
|
|
21
|
+
"use": "radio-group"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"bestPractices": [
|
|
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."
|
|
27
|
+
],
|
|
28
|
+
"accessibility": {
|
|
29
|
+
"keyboard": [
|
|
30
|
+
{
|
|
31
|
+
"keys": "Arrow keys",
|
|
32
|
+
"action": "Move by one step."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"keys": "Page Up / Page Down",
|
|
36
|
+
"action": "Move by a larger step."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"keys": "Home / End",
|
|
40
|
+
"action": "Go to the minimum or the maximum."
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"notes": [
|
|
44
|
+
"Radix Slider: each thumb is a `slider` named by `label` (or `thumbLabels` for a range).",
|
|
45
|
+
"`formatValue` also gives `aria-valuetext`: the value as it is read."
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"related": [
|
|
49
|
+
"field",
|
|
50
|
+
"progress",
|
|
51
|
+
"switch"
|
|
52
|
+
],
|
|
53
|
+
"web": {
|
|
54
|
+
"entry": "@krizaka/ui/slider",
|
|
55
|
+
"import": "import { Slider } from \"@krizaka/ui/slider\";",
|
|
56
|
+
"props": [
|
|
57
|
+
{
|
|
58
|
+
"component": "Slider",
|
|
59
|
+
"description": "A slider on one value or a range: `value`/`defaultValue` + `onValueChange`, `min`, `max`, `step`.",
|
|
60
|
+
"props": [
|
|
61
|
+
{
|
|
62
|
+
"name": "label",
|
|
63
|
+
"type": "string",
|
|
64
|
+
"default": null,
|
|
65
|
+
"description": "The accessible name — of the thumb, or of both thumbs of a range — passed translated.",
|
|
66
|
+
"required": true
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "defaultValue",
|
|
70
|
+
"type": "SliderValue",
|
|
71
|
+
"default": null,
|
|
72
|
+
"description": "The value at first, uncontrolled: one number, or two for a range.",
|
|
73
|
+
"required": false
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "formatValue",
|
|
77
|
+
"type": "((value: number) => string)",
|
|
78
|
+
"default": null,
|
|
79
|
+
"description": "The value as words (aria-valuetext) and as shown: \"1.5×\", \"−12 %\", \"3 min\".",
|
|
80
|
+
"required": false
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "onValueChange",
|
|
84
|
+
"type": "((value: V) => void)",
|
|
85
|
+
"default": null,
|
|
86
|
+
"description": "Called on every move, with one number or two.",
|
|
87
|
+
"required": false
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "onValueCommit",
|
|
91
|
+
"type": "((value: V) => void)",
|
|
92
|
+
"default": null,
|
|
93
|
+
"description": "Called once the drag or the key press ends.",
|
|
94
|
+
"required": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "origin",
|
|
98
|
+
"type": "number",
|
|
99
|
+
"default": null,
|
|
100
|
+
"description": "Fills from this value instead of the minimum (a ±range from 0: brightness, balance). One thumb only.",
|
|
101
|
+
"required": false
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "showLabel",
|
|
105
|
+
"type": "boolean",
|
|
106
|
+
"default": null,
|
|
107
|
+
"description": "Shows the label and the value above the track. Without it, `label` only names the thumb.",
|
|
108
|
+
"required": false
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "thumbLabels",
|
|
112
|
+
"type": "[string, string]",
|
|
113
|
+
"default": null,
|
|
114
|
+
"description": "For a range: each thumb's own name ([\"Minimum\", \"Maximum\"]), passed translated.",
|
|
115
|
+
"required": false
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "value",
|
|
119
|
+
"type": "SliderValue",
|
|
120
|
+
"default": null,
|
|
121
|
+
"description": "One number (a thumb) or two (a range). Controlled with `onValueChange`.",
|
|
122
|
+
"required": false
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"examples": [
|
|
128
|
+
{
|
|
129
|
+
"name": "default",
|
|
130
|
+
"title": "Default",
|
|
131
|
+
"description": "The thumb alone, named by `label`.",
|
|
132
|
+
"path": "examples/slider/default.tsx",
|
|
133
|
+
"module": "@krizaka/ui/registry/examples/slider/default",
|
|
134
|
+
"code": "import { Slider } from \"@krizaka/ui/slider\";\n\nexport default function SliderDefault() {\n return <Slider label=\"Volume\" defaultValue={60} />;\n}\n"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "with-label",
|
|
138
|
+
"title": "With a label",
|
|
139
|
+
"description": "`showLabel`: the label and the formatted value above the track.",
|
|
140
|
+
"path": "examples/slider/with-label.tsx",
|
|
141
|
+
"module": "@krizaka/ui/registry/examples/slider/with-label",
|
|
142
|
+
"code": "\"use client\";\n\nimport { Slider } from \"@krizaka/ui/slider\";\n\n// `showLabel`: the label and the formatted value above the track.\nexport default function SliderWithLabel() {\n return <Slider label=\"Speed\" showLabel defaultValue={1.5} min={0.5} max={2} step={0.25} formatValue={(v) => `${v}×`} />;\n}\n"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "centred",
|
|
146
|
+
"title": "Centred",
|
|
147
|
+
"description": "`origin={0}` on a ± range.",
|
|
148
|
+
"path": "examples/slider/centred.tsx",
|
|
149
|
+
"module": "@krizaka/ui/registry/examples/slider/centred",
|
|
150
|
+
"code": "\"use client\";\n\nimport { Slider } from \"@krizaka/ui/slider\";\n\n// `origin={0}` on a ±range: the fill starts at the centre.\nexport default function SliderCentred() {\n return <Slider label=\"Brightness\" showLabel defaultValue={-30} min={-100} max={100} origin={0} formatValue={(v) => `${v > 0 ? \"+\" : \"\"}${v} %`} />;\n}\n"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "range",
|
|
154
|
+
"title": "Range",
|
|
155
|
+
"description": "Two thumbs, each named.",
|
|
156
|
+
"path": "examples/slider/range.tsx",
|
|
157
|
+
"module": "@krizaka/ui/registry/examples/slider/range",
|
|
158
|
+
"code": "\"use client\";\n\nimport { Slider } from \"@krizaka/ui/slider\";\n\n// Two thumbs, each named by `thumbLabels`.\nexport default function SliderRange() {\n return (\n <Slider<[number, number]>\n label=\"Price\"\n thumbLabels={[\"Minimum price\", \"Maximum price\"]}\n showLabel\n defaultValue={[10, 60]}\n max={100}\n step={5}\n formatValue={(v) => `$${v}`}\n />\n );\n}\n"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "disabled",
|
|
162
|
+
"title": "Disabled",
|
|
163
|
+
"description": "Not available.",
|
|
164
|
+
"path": "examples/slider/disabled.tsx",
|
|
165
|
+
"module": "@krizaka/ui/registry/examples/slider/disabled",
|
|
166
|
+
"code": "import { Slider } from \"@krizaka/ui/slider\";\n\nexport default function SliderDisabled() {\n return <Slider label=\"Volume\" defaultValue={60} disabled />;\n}\n"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"native": null,
|
|
5
171
|
"files": [
|
|
172
|
+
{
|
|
173
|
+
"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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"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\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 /** 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
|
+
},
|
|
6
176
|
{
|
|
7
177
|
"path": "slider/index.ts",
|
|
8
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"
|
|
9
179
|
},
|
|
180
|
+
{
|
|
181
|
+
"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: \"web\",\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 ],\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 ],\n },\n} satisfies ComponentMeta;\n"
|
|
183
|
+
},
|
|
10
184
|
{
|
|
11
185
|
"path": "slider/slider.tsx",
|
|
12
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"
|
|
@@ -18,8 +192,8 @@
|
|
|
18
192
|
],
|
|
19
193
|
"registryDependencies": [],
|
|
20
194
|
"demo": {
|
|
21
|
-
"path": "
|
|
22
|
-
"content": "import { Slider } from \"@krizaka/ui/slider\";\n\nexport default function
|
|
195
|
+
"path": "examples/slider/default.tsx",
|
|
196
|
+
"content": "import { Slider } from \"@krizaka/ui/slider\";\n\nexport default function SliderDefault() {\n return <Slider label=\"Volume\" defaultValue={60} />;\n}\n"
|
|
23
197
|
},
|
|
24
198
|
"props": [
|
|
25
199
|
{
|
package/registry/slot.json
CHANGED
|
@@ -1,11 +1,87 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slot",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Slot",
|
|
5
|
+
"summary": "`Slot` merges its props and classes into its only child — the engine of `asChild` — and `VisuallyHidden` names things for screen readers only.",
|
|
6
|
+
"description": "`Slot` merges its props and classes into its only child — the engine of `asChild` — and `VisuallyHidden` names things for screen readers only.",
|
|
7
|
+
"status": "stable",
|
|
8
|
+
"category": "foundations",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"To give your own component an `asChild` prop.",
|
|
12
|
+
"`VisuallyHidden` for words that only assistive technology needs: an icon button's name, a table caption."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "To style a link like a button: `asChild` on the button does it.",
|
|
17
|
+
"use": "button"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "To hide something from everyone: use `hidden`."
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"bestPractices": [
|
|
24
|
+
"`Slot` takes exactly one child element.",
|
|
25
|
+
"Prefer a visible label to `VisuallyHidden` when there is room for one."
|
|
26
|
+
],
|
|
27
|
+
"accessibility": {
|
|
28
|
+
"keyboard": [],
|
|
29
|
+
"notes": [
|
|
30
|
+
"`VisuallyHidden` is read by screen readers and not shown.",
|
|
31
|
+
"`Slot` keeps the child's element: a link stays a link, with its role and keyboard."
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"related": [
|
|
35
|
+
"button",
|
|
36
|
+
"cn"
|
|
37
|
+
],
|
|
38
|
+
"web": {
|
|
39
|
+
"entry": "@krizaka/ui/slot",
|
|
40
|
+
"import": "import { Slot, VisuallyHidden } from \"@krizaka/ui/slot\";",
|
|
41
|
+
"props": [
|
|
42
|
+
{
|
|
43
|
+
"component": "Slot",
|
|
44
|
+
"description": "Merges its props, `className` and `ref` into its only child: the engine of every `asChild`.",
|
|
45
|
+
"props": []
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"component": "VisuallyHidden",
|
|
49
|
+
"description": "Hidden on screen, read by assistive technology.",
|
|
50
|
+
"props": []
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"examples": [
|
|
54
|
+
{
|
|
55
|
+
"name": "as-child",
|
|
56
|
+
"title": "Slot",
|
|
57
|
+
"description": "The link is rendered, styled by the Slot.",
|
|
58
|
+
"path": "examples/slot/as-child.tsx",
|
|
59
|
+
"module": "@krizaka/ui/registry/examples/slot/as-child",
|
|
60
|
+
"code": "import { Slot, VisuallyHidden } from \"@krizaka/ui/slot\";\n\nexport default function SlotAsChild() {\n // Slot merges its props and classes into its only child: the link is rendered, styled by the Slot.\n return (\n <Slot className=\"text-sm font-semibold text-fg underline underline-offset-4\">\n <a href=\"#docs\">\n Read the docs\n <VisuallyHidden> about Slot</VisuallyHidden>\n </a>\n </Slot>\n );\n}\n"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "visually-hidden",
|
|
64
|
+
"title": "VisuallyHidden",
|
|
65
|
+
"description": "An icon button named for screen readers.",
|
|
66
|
+
"path": "examples/slot/visually-hidden.tsx",
|
|
67
|
+
"module": "@krizaka/ui/registry/examples/slot/visually-hidden",
|
|
68
|
+
"code": "import { VisuallyHidden } from \"@krizaka/ui/slot\";\n\n// A name for assistive technology only: the icon is seen, the words are read.\nexport default function SlotVisuallyHidden() {\n return (\n <button type=\"button\" className=\"inline-flex h-10 w-10 items-center justify-center rounded-lg border border-border-default text-fg\">\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n <VisuallyHidden>Close</VisuallyHidden>\n </button>\n );\n}\n"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"native": null,
|
|
5
73
|
"files": [
|
|
74
|
+
{
|
|
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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"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\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 /** 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
|
+
},
|
|
6
78
|
{
|
|
7
79
|
"path": "slot/index.ts",
|
|
8
80
|
"content": "/** @krizaka/ui/slot — `Slot` (what `asChild` renders) and `VisuallyHidden` (a name for assistive technology only), from Radix. */\nimport { Slot as SlotPrimitive, VisuallyHidden as VisuallyHiddenPrimitive } from \"radix-ui\";\n\n/** Merges its props, `className` and `ref` into its only child: the engine of every `asChild`. */\nexport const Slot = SlotPrimitive.Root;\n/** Hidden on screen, read by assistive technology. */\nexport const VisuallyHidden = VisuallyHiddenPrimitive.Root;\n"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"path": "slot/meta.ts",
|
|
84
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Slot\",\n summary: \"`Slot` merges its props and classes into its only child — the engine of `asChild` — and `VisuallyHidden` names things for screen readers only.\",\n status: \"stable\",\n category: \"foundations\",\n platforms: \"web\",\n whenToUse: [\"To give your own component an `asChild` prop.\", \"`VisuallyHidden` for words that only assistive technology needs: an icon button's name, a table caption.\"],\n whenNotToUse: [\n { when: \"To style a link like a button: `asChild` on the button does it.\", use: \"button\" },\n { when: \"To hide something from everyone: use `hidden`.\" },\n ],\n bestPractices: [\"`Slot` takes exactly one child element.\", \"Prefer a visible label to `VisuallyHidden` when there is room for one.\"],\n accessibility: {\n keyboard: [],\n notes: [\"`VisuallyHidden` is read by screen readers and not shown.\", \"`Slot` keeps the child's element: a link stays a link, with its role and keyboard.\"],\n },\n related: [\"button\", \"cn\"],\n web: {\n imports: [\"Slot\", \"VisuallyHidden\"],\n examples: [\n { name: \"as-child\", title: \"Slot\", description: \"The link is rendered, styled by the Slot.\" },\n { name: \"visually-hidden\", title: \"VisuallyHidden\", description: \"An icon button named for screen readers.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
9
85
|
}
|
|
10
86
|
],
|
|
11
87
|
"dependencies": [
|
|
@@ -13,8 +89,8 @@
|
|
|
13
89
|
],
|
|
14
90
|
"registryDependencies": [],
|
|
15
91
|
"demo": {
|
|
16
|
-
"path": "
|
|
17
|
-
"content": "import { Slot, VisuallyHidden } from \"@krizaka/ui/slot\";\n\nexport default function
|
|
92
|
+
"path": "examples/slot/as-child.tsx",
|
|
93
|
+
"content": "import { Slot, VisuallyHidden } from \"@krizaka/ui/slot\";\n\nexport default function SlotAsChild() {\n // Slot merges its props and classes into its only child: the link is rendered, styled by the Slot.\n return (\n <Slot className=\"text-sm font-semibold text-fg underline underline-offset-4\">\n <a href=\"#docs\">\n Read the docs\n <VisuallyHidden> about Slot</VisuallyHidden>\n </a>\n </Slot>\n );\n}\n"
|
|
18
94
|
},
|
|
19
95
|
"props": [
|
|
20
96
|
{
|
package/registry/spinner.json
CHANGED
|
@@ -1,12 +1,153 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spinner",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Spinner",
|
|
5
|
+
"summary": "An indeterminate wait: a turning ring named by `label`.",
|
|
6
|
+
"description": "An indeterminate wait: a turning ring named by `label`.",
|
|
7
|
+
"status": "stable",
|
|
8
|
+
"category": "feedback",
|
|
9
|
+
"platforms": "both",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"For a short wait of unknown length: a search, a refresh, an infinite list loading more."
|
|
12
|
+
],
|
|
13
|
+
"whenNotToUse": [
|
|
14
|
+
{
|
|
15
|
+
"when": "When the layout of what is loading is known.",
|
|
16
|
+
"use": "skeleton"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"when": "When the progress is known.",
|
|
20
|
+
"use": "progress"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"when": "Inside a button that runs an action: set `loading` on the button.",
|
|
24
|
+
"use": "button"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"bestPractices": [
|
|
28
|
+
"One spinner per region: never a page full of them.",
|
|
29
|
+
"Pass `label` translated (“Loading”, “Searching”)."
|
|
30
|
+
],
|
|
31
|
+
"accessibility": {
|
|
32
|
+
"keyboard": [],
|
|
33
|
+
"notes": [
|
|
34
|
+
"`role=\"status\"` named by `label`: announced politely.",
|
|
35
|
+
"It stops turning under `prefers-reduced-motion`."
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"related": [
|
|
39
|
+
"skeleton",
|
|
40
|
+
"progress",
|
|
41
|
+
"button"
|
|
42
|
+
],
|
|
43
|
+
"web": {
|
|
44
|
+
"entry": "@krizaka/ui/spinner",
|
|
45
|
+
"import": "import { Spinner } from \"@krizaka/ui/spinner\";",
|
|
46
|
+
"props": [
|
|
47
|
+
{
|
|
48
|
+
"component": "Spinner",
|
|
49
|
+
"description": "A turning ring with `role=\"status\"` (it stops turning under prefers-reduced-motion).",
|
|
50
|
+
"props": [
|
|
51
|
+
{
|
|
52
|
+
"name": "label",
|
|
53
|
+
"type": "string",
|
|
54
|
+
"default": null,
|
|
55
|
+
"description": "The accessible name of the wait, e.g. \"Loading\" — passed translated.",
|
|
56
|
+
"required": true
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "size",
|
|
60
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
61
|
+
"default": "md",
|
|
62
|
+
"description": "sm · md · lg.",
|
|
63
|
+
"required": false
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"examples": [
|
|
69
|
+
{
|
|
70
|
+
"name": "default",
|
|
71
|
+
"title": "Default",
|
|
72
|
+
"description": "Named by `label`.",
|
|
73
|
+
"path": "examples/spinner/default.tsx",
|
|
74
|
+
"module": "@krizaka/ui/registry/examples/spinner/default",
|
|
75
|
+
"code": "import { Spinner } from \"@krizaka/ui/spinner\";\n\nexport default function SpinnerDefault() {\n return <Spinner label=\"Loading\" />;\n}\n"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "sizes",
|
|
79
|
+
"title": "Sizes",
|
|
80
|
+
"description": "`sm`, `md`, `lg`.",
|
|
81
|
+
"path": "examples/spinner/sizes.tsx",
|
|
82
|
+
"module": "@krizaka/ui/registry/examples/spinner/sizes",
|
|
83
|
+
"code": "import { Spinner } from \"@krizaka/ui/spinner\";\n\nexport default function SpinnerSizes() {\n return (\n <div className=\"flex items-center gap-4\">\n <Spinner label=\"Loading\" size=\"sm\" />\n <Spinner label=\"Loading\" size=\"md\" />\n <Spinner label=\"Loading\" size=\"lg\" />\n </div>\n );\n}\n"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "muted",
|
|
87
|
+
"title": "Muted",
|
|
88
|
+
"description": "The colour follows `className`.",
|
|
89
|
+
"path": "examples/spinner/muted.tsx",
|
|
90
|
+
"module": "@krizaka/ui/registry/examples/spinner/muted",
|
|
91
|
+
"code": "import { Spinner } from \"@krizaka/ui/spinner\";\n\n// The colour follows `className` (here a text role).\nexport default function SpinnerMuted() {\n return <Spinner label=\"Loading\" className=\"text-fg-secondary\" />;\n}\n"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"native": {
|
|
96
|
+
"entry": "@krizaka/ui/native",
|
|
97
|
+
"import": "import { Spinner } from \"@krizaka/ui/native\";",
|
|
98
|
+
"differences": [
|
|
99
|
+
"The platform's `ActivityIndicator`, in the accent."
|
|
100
|
+
],
|
|
101
|
+
"props": [
|
|
102
|
+
{
|
|
103
|
+
"component": "Spinner",
|
|
104
|
+
"description": "An indeterminate wait: the platform's activity indicator in the accent, named by `label`.",
|
|
105
|
+
"props": [
|
|
106
|
+
{
|
|
107
|
+
"name": "label",
|
|
108
|
+
"type": "string",
|
|
109
|
+
"default": null,
|
|
110
|
+
"description": "The accessible name of the wait, e.g. \"Loading\" — passed translated.",
|
|
111
|
+
"required": true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "size",
|
|
115
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
116
|
+
"default": "md",
|
|
117
|
+
"description": "sm · md (default) · lg.",
|
|
118
|
+
"required": false
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"examples": [
|
|
124
|
+
{
|
|
125
|
+
"name": "sizes",
|
|
126
|
+
"title": "Sizes",
|
|
127
|
+
"description": "`sm`, `md`, `lg`, named by `label`.",
|
|
128
|
+
"path": "examples/spinner/native/sizes.tsx",
|
|
129
|
+
"module": "@krizaka/ui/registry/examples/spinner/native/sizes",
|
|
130
|
+
"code": "import { Spinner } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// The platform's indicator in the accent, named by `label`.\nexport default function NativeSpinnerSizes() {\n return (\n <View style={{ flexDirection: \"row\", gap: 16, alignItems: \"center\" }}>\n <Spinner label=\"Loading\" size=\"sm\" />\n <Spinner label=\"Loading\" size=\"md\" />\n <Spinner label=\"Loading\" size=\"lg\" />\n </View>\n );\n}\n",
|
|
131
|
+
"screenshots": {
|
|
132
|
+
"dark": "examples/spinner/native/sizes.dark.png",
|
|
133
|
+
"light": "examples/spinner/native/sizes.light.png"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
5
138
|
"files": [
|
|
139
|
+
{
|
|
140
|
+
"path": "meta.ts",
|
|
141
|
+
"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 | \"alert\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"cn\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"kbd\"\n | \"page-header\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"switch\"\n | \"tabs\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\";\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/** The group of the catalogue. */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"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\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 /** 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"
|
|
142
|
+
},
|
|
6
143
|
{
|
|
7
144
|
"path": "spinner/index.ts",
|
|
8
145
|
"content": "/** @krizaka/ui/spinner — `Spinner`, `spinnerVariants`. Server-safe. */\nexport { Spinner, type SpinnerProps, spinnerVariants } from \"./spinner\";\n"
|
|
9
146
|
},
|
|
147
|
+
{
|
|
148
|
+
"path": "spinner/meta.ts",
|
|
149
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Spinner\",\n summary: \"An indeterminate wait: a turning ring named by `label`.\",\n status: \"stable\",\n category: \"feedback\",\n platforms: \"both\",\n whenToUse: [\"For a short wait of unknown length: a search, a refresh, an infinite list loading more.\"],\n whenNotToUse: [\n { when: \"When the layout of what is loading is known.\", use: \"skeleton\" },\n { when: \"When the progress is known.\", use: \"progress\" },\n { when: \"Inside a button that runs an action: set `loading` on the button.\", use: \"button\" },\n ],\n bestPractices: [\"One spinner per region: never a page full of them.\", \"Pass `label` translated (“Loading”, “Searching”).\"],\n accessibility: {\n keyboard: [],\n notes: [\"`role=\\\"status\\\"` named by `label`: announced politely.\", \"It stops turning under `prefers-reduced-motion`.\"],\n },\n related: [\"skeleton\", \"progress\", \"button\"],\n web: {\n imports: [\"Spinner\"],\n examples: [\n { name: \"default\", title: \"Default\", description: \"Named by `label`.\" },\n { name: \"sizes\", title: \"Sizes\", description: \"`sm`, `md`, `lg`.\" },\n { name: \"muted\", title: \"Muted\", description: \"The colour follows `className`.\" },\n ],\n },\n native: {\n imports: [\"Spinner\"],\n differences: [\"The platform's `ActivityIndicator`, in the accent.\"],\n examples: [{ name: \"sizes\", title: \"Sizes\", description: \"`sm`, `md`, `lg`, named by `label`.\" }],\n },\n} satisfies ComponentMeta;\n"
|
|
150
|
+
},
|
|
10
151
|
{
|
|
11
152
|
"path": "spinner/spinner.tsx",
|
|
12
153
|
"content": "// Server-safe. An indeterminate wait: an SVG ring, announced as a status with its `label`.\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const spinnerVariants = tv({\n base: \"shrink-0 text-accent motion-safe:animate-spin\",\n variants: { size: { sm: \"h-4 w-4\", md: \"h-6 w-6\", lg: \"h-10 w-10\" } },\n defaultVariants: { size: \"md\" },\n});\n\nexport type SpinnerProps = Omit<React.ComponentProps<\"svg\">, \"children\"> &\n VariantProps<typeof spinnerVariants> & {\n /**\n * sm · md · lg.\n * @default \"md\"\n */\n size?: VariantProps<typeof spinnerVariants>[\"size\"];\n /** The accessible name of the wait, e.g. \"Loading\" — passed translated. */\n label: string;\n };\n\n/** A turning ring with `role=\"status\"` (it stops turning under prefers-reduced-motion). */\nexport function Spinner({ label, size, className, ...props }: SpinnerProps) {\n return (\n <svg\n role=\"status\"\n aria-label={label}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n data-size={size ?? \"md\"}\n className={spinnerVariants({ size, className })}\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" strokeOpacity=\"0.2\" strokeWidth=\"3\" />\n <path d=\"M21 12a9 9 0 0 0-9-9\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n"
|
|
@@ -17,8 +158,8 @@
|
|
|
17
158
|
],
|
|
18
159
|
"registryDependencies": [],
|
|
19
160
|
"demo": {
|
|
20
|
-
"path": "
|
|
21
|
-
"content": "import { Spinner } from \"@krizaka/ui/spinner\";\n\nexport default function
|
|
161
|
+
"path": "examples/spinner/default.tsx",
|
|
162
|
+
"content": "import { Spinner } from \"@krizaka/ui/spinner\";\n\nexport default function SpinnerDefault() {\n return <Spinner label=\"Loading\" />;\n}\n"
|
|
22
163
|
},
|
|
23
164
|
"props": [
|
|
24
165
|
{
|