@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/progress.json
CHANGED
|
@@ -1,12 +1,274 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "progress",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Progress",
|
|
5
|
+
"summary": "How far a task or a goal has come: a bar or a ring, determinate or indeterminate.",
|
|
6
|
+
"description": "How far a task or a goal has come: a bar or a ring, determinate or indeterminate.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "feedback",
|
|
9
|
+
"platforms": "both",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"For a task with a known end: an upload, a processing step, a profile to complete.",
|
|
12
|
+
"A ring with its amount in the centre for a goal: money raised, steps done.",
|
|
13
|
+
"Indeterminate (no `value`) for a wait of unknown length inside a layout."
|
|
14
|
+
],
|
|
15
|
+
"whenNotToUse": [
|
|
16
|
+
{
|
|
17
|
+
"when": "For a short, unknown wait with nothing to show.",
|
|
18
|
+
"use": "spinner"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"when": "While the content of a page loads.",
|
|
22
|
+
"use": "skeleton"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"when": "For the time left until a moment.",
|
|
26
|
+
"use": "countdown"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"bestPractices": [
|
|
30
|
+
"Always a `label` (“Upload”), translated: it names the bar.",
|
|
31
|
+
"Give `valueText` when the percentage is not what matters (“$420 of $1,000”).",
|
|
32
|
+
"Do not move the bar backwards: if a task restarts, say so."
|
|
33
|
+
],
|
|
34
|
+
"accessibility": {
|
|
35
|
+
"keyboard": [],
|
|
36
|
+
"notes": [
|
|
37
|
+
"`role=\"progressbar\"` named by `label`, with `aria-valuenow`, `aria-valuemax` and `aria-valuetext`.",
|
|
38
|
+
"Indeterminate: no value attributes; the motion stops under `prefers-reduced-motion`."
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"related": [
|
|
42
|
+
"spinner",
|
|
43
|
+
"skeleton",
|
|
44
|
+
"countdown"
|
|
45
|
+
],
|
|
46
|
+
"web": {
|
|
47
|
+
"entry": "@krizaka/ui/progress",
|
|
48
|
+
"import": "import { Progress } from \"@krizaka/ui/progress\";",
|
|
49
|
+
"props": [
|
|
50
|
+
{
|
|
51
|
+
"component": "Progress",
|
|
52
|
+
"description": "A progress bar or ring: `value` / `max`, indeterminate without a value. State: `data-state` (loading · complete · indeterminate).",
|
|
53
|
+
"props": [
|
|
54
|
+
{
|
|
55
|
+
"name": "label",
|
|
56
|
+
"type": "string",
|
|
57
|
+
"default": null,
|
|
58
|
+
"description": "The accessible name — passed translated (\"Upload\", \"Raised towards the goal\").",
|
|
59
|
+
"required": true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "children",
|
|
63
|
+
"type": "ReactNode",
|
|
64
|
+
"default": null,
|
|
65
|
+
"description": "A ring's centre: an amount, a percentage, an icon.",
|
|
66
|
+
"required": false
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "max",
|
|
70
|
+
"type": "number",
|
|
71
|
+
"default": "100",
|
|
72
|
+
"description": "The value that means complete.",
|
|
73
|
+
"required": false
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "size",
|
|
77
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
78
|
+
"default": "md",
|
|
79
|
+
"description": "sm · md · lg: the bar's thickness, the ring's diameter.",
|
|
80
|
+
"required": false
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "value",
|
|
84
|
+
"type": "number | null",
|
|
85
|
+
"default": null,
|
|
86
|
+
"description": "How far, between 0 and `max`. `null` or absent: indeterminate (a wait of unknown length).",
|
|
87
|
+
"required": false
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "valueText",
|
|
91
|
+
"type": "string",
|
|
92
|
+
"default": null,
|
|
93
|
+
"description": "The value in words for assistive technology (\"$420 of $1,000\") — default: the percentage.",
|
|
94
|
+
"required": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "variant",
|
|
98
|
+
"type": "\"bar\" | \"ring\"",
|
|
99
|
+
"default": "bar",
|
|
100
|
+
"description": "bar · ring (a ring holds its `children` in the centre).",
|
|
101
|
+
"required": false
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"examples": [
|
|
107
|
+
{
|
|
108
|
+
"name": "bar",
|
|
109
|
+
"title": "Bar",
|
|
110
|
+
"description": "A task with a known end.",
|
|
111
|
+
"path": "examples/progress/bar.tsx",
|
|
112
|
+
"module": "@krizaka/ui/registry/examples/progress/bar",
|
|
113
|
+
"code": "import { Progress } from \"@krizaka/ui/progress\";\n\nexport default function ProgressBar() {\n return <Progress label=\"Upload\" value={64} />;\n}\n"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "bar-sizes",
|
|
117
|
+
"title": "Bar sizes",
|
|
118
|
+
"description": "`sm`, `md`, `lg`.",
|
|
119
|
+
"path": "examples/progress/bar-sizes.tsx",
|
|
120
|
+
"module": "@krizaka/ui/registry/examples/progress/bar-sizes",
|
|
121
|
+
"code": "import { Progress } from \"@krizaka/ui/progress\";\n\nexport default function ProgressBarSizes() {\n return (\n <div className=\"flex flex-col gap-4\">\n <Progress label=\"Small\" size=\"sm\" value={30} />\n <Progress label=\"Medium\" size=\"md\" value={55} />\n <Progress label=\"Large\" size=\"lg\" value={80} />\n </div>\n );\n}\n"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "bar-indeterminate",
|
|
125
|
+
"title": "Indeterminate bar",
|
|
126
|
+
"description": "A wait of unknown length.",
|
|
127
|
+
"path": "examples/progress/bar-indeterminate.tsx",
|
|
128
|
+
"module": "@krizaka/ui/registry/examples/progress/bar-indeterminate",
|
|
129
|
+
"code": "import { Progress } from \"@krizaka/ui/progress\";\n\n// No `value`: a wait of unknown length (still under reduced motion).\nexport default function ProgressBarIndeterminate() {\n return <Progress label=\"Processing\" />;\n}\n"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "ring",
|
|
133
|
+
"title": "Ring",
|
|
134
|
+
"description": "A goal with its amount in the centre.",
|
|
135
|
+
"path": "examples/progress/ring.tsx",
|
|
136
|
+
"module": "@krizaka/ui/registry/examples/progress/ring",
|
|
137
|
+
"code": "import { Progress } from \"@krizaka/ui/progress\";\n\n// A ring holds its amount in the centre; `valueText` gives the words a screen reader reads.\nexport default function ProgressRing() {\n return (\n <div className=\"flex items-end gap-6\">\n <Progress variant=\"ring\" size=\"sm\" label=\"Profile completed\" value={40} />\n <Progress variant=\"ring\" size=\"md\" label=\"Raised\" value={420} max={1000} valueText=\"$420 of $1,000\">\n <span className=\"text-sm font-bold text-fg\">42%</span>\n </Progress>\n <Progress variant=\"ring\" size=\"lg\" label=\"Raised towards the goal\" value={750} max={1000} valueText=\"$750 of $1,000\">\n <span className=\"font-display text-2xl font-black text-fg\">$750</span>\n <span className=\"text-xs text-fg-secondary\">of $1,000</span>\n </Progress>\n </div>\n );\n}\n"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "ring-indeterminate",
|
|
141
|
+
"title": "Indeterminate ring",
|
|
142
|
+
"description": "A ring without a value.",
|
|
143
|
+
"path": "examples/progress/ring-indeterminate.tsx",
|
|
144
|
+
"module": "@krizaka/ui/registry/examples/progress/ring-indeterminate",
|
|
145
|
+
"code": "import { Progress } from \"@krizaka/ui/progress\";\n\nexport default function ProgressRingIndeterminate() {\n return <Progress variant=\"ring\" size=\"md\" label=\"Loading\" />;\n}\n"
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"native": {
|
|
150
|
+
"entry": "@krizaka/ui/native",
|
|
151
|
+
"import": "import { Progress } from \"@krizaka/ui/native\";",
|
|
152
|
+
"differences": [
|
|
153
|
+
"The ring's centre is native text (`Txt`).",
|
|
154
|
+
"Style with `style`, not `className`."
|
|
155
|
+
],
|
|
156
|
+
"props": [
|
|
157
|
+
{
|
|
158
|
+
"component": "Progress",
|
|
159
|
+
"description": "A progress bar or ring in the accent gradient (`accent` → `accent2`): it moves to `value` / `max` when it changes,\nindeterminate without a value. Still under reduced motion. A `progressbar` with its value for screen readers.",
|
|
160
|
+
"props": [
|
|
161
|
+
{
|
|
162
|
+
"name": "label",
|
|
163
|
+
"type": "string",
|
|
164
|
+
"default": null,
|
|
165
|
+
"description": "The accessible name — passed translated (\"Upload\", \"Raised towards the goal\").",
|
|
166
|
+
"required": true
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "children",
|
|
170
|
+
"type": "ReactNode",
|
|
171
|
+
"default": null,
|
|
172
|
+
"description": "A ring's centre: an amount, a percentage, an icon.",
|
|
173
|
+
"required": false
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "max",
|
|
177
|
+
"type": "number",
|
|
178
|
+
"default": "100",
|
|
179
|
+
"description": "The value of a full bar. Default 100.",
|
|
180
|
+
"required": false
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "size",
|
|
184
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
185
|
+
"default": "md",
|
|
186
|
+
"description": "sm · md (default) · lg: the bar's thickness or the ring's diameter.",
|
|
187
|
+
"required": false
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "style",
|
|
191
|
+
"type": "StyleProp<ViewStyle>",
|
|
192
|
+
"default": null,
|
|
193
|
+
"description": "Styles merged last.",
|
|
194
|
+
"required": false
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "value",
|
|
198
|
+
"type": "number | null",
|
|
199
|
+
"default": null,
|
|
200
|
+
"description": "How far, between 0 and `max`. `null` or absent: indeterminate (a wait of unknown length).",
|
|
201
|
+
"required": false
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "valueText",
|
|
205
|
+
"type": "string",
|
|
206
|
+
"default": null,
|
|
207
|
+
"description": "The value in words for screen readers (\"$420 of $1,000\") — default: the percentage.",
|
|
208
|
+
"required": false
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "variant",
|
|
212
|
+
"type": "\"bar\" | \"ring\"",
|
|
213
|
+
"default": "bar",
|
|
214
|
+
"description": "`bar` (default) or `ring`.",
|
|
215
|
+
"required": false
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"examples": [
|
|
221
|
+
{
|
|
222
|
+
"name": "bar",
|
|
223
|
+
"title": "Bar",
|
|
224
|
+
"description": "`sm`, `md`, `lg`.",
|
|
225
|
+
"path": "examples/progress/native/bar.tsx",
|
|
226
|
+
"module": "@krizaka/ui/registry/examples/progress/native/bar",
|
|
227
|
+
"code": "import { Progress } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\nexport default function NativeProgressBar() {\n return (\n <View style={{ width: 320, gap: 16 }}>\n <Progress label=\"Upload\" value={64} size=\"sm\" />\n <Progress label=\"Upload\" value={64} size=\"md\" />\n <Progress label=\"Upload\" value={64} size=\"lg\" />\n </View>\n );\n}\n",
|
|
228
|
+
"screenshots": {
|
|
229
|
+
"dark": "examples/progress/native/bar.dark.png",
|
|
230
|
+
"light": "examples/progress/native/bar.light.png"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "ring",
|
|
235
|
+
"title": "Ring",
|
|
236
|
+
"description": "A ring with its centre: an amount, a percentage.",
|
|
237
|
+
"path": "examples/progress/native/ring.tsx",
|
|
238
|
+
"module": "@krizaka/ui/registry/examples/progress/native/ring",
|
|
239
|
+
"code": "import { Progress, Txt } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\nexport default function NativeProgressRing() {\n return (\n <View style={{ flexDirection: \"row\", gap: 16, alignItems: \"center\" }}>\n <Progress variant=\"ring\" size=\"sm\" value={30} label=\"Goal\" />\n <Progress variant=\"ring\" size=\"md\" value={64} label=\"Goal\">\n <Txt variant=\"label\">64%</Txt>\n </Progress>\n <Progress variant=\"ring\" size=\"lg\" value={420} max={1000} label=\"Raised towards the goal\" valueText=\"$420 of $1,000\">\n <Txt variant=\"title\">$420</Txt>\n <Txt variant=\"caption\" tone=\"secondary\">\n of $1,000\n </Txt>\n </Progress>\n </View>\n );\n}\n",
|
|
240
|
+
"screenshots": {
|
|
241
|
+
"dark": "examples/progress/native/ring.dark.png",
|
|
242
|
+
"light": "examples/progress/native/ring.light.png"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "indeterminate",
|
|
247
|
+
"title": "Indeterminate",
|
|
248
|
+
"description": "No value: a wait of unknown length.",
|
|
249
|
+
"path": "examples/progress/native/indeterminate.tsx",
|
|
250
|
+
"module": "@krizaka/ui/registry/examples/progress/native/indeterminate",
|
|
251
|
+
"code": "import { Progress } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// No value: a wait of unknown length (still under reduced motion).\nexport default function NativeProgressIndeterminate() {\n return (\n <View style={{ width: 320, gap: 16 }}>\n <Progress label=\"Processing\" />\n <Progress variant=\"ring\" label=\"Processing\" />\n </View>\n );\n}\n",
|
|
252
|
+
"screenshots": {
|
|
253
|
+
"dark": "examples/progress/native/indeterminate.dark.png",
|
|
254
|
+
"light": "examples/progress/native/indeterminate.light.png"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
5
259
|
"files": [
|
|
260
|
+
{
|
|
261
|
+
"path": "meta.ts",
|
|
262
|
+
"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"
|
|
263
|
+
},
|
|
6
264
|
{
|
|
7
265
|
"path": "progress/index.ts",
|
|
8
266
|
"content": "/** @krizaka/ui/progress — `Progress` (bar · ring, indeterminate), `progress` (the slots). Server-safe. */\nexport { Progress, progress, type ProgressProps, type ProgressVariants } from \"./progress\";\n"
|
|
9
267
|
},
|
|
268
|
+
{
|
|
269
|
+
"path": "progress/meta.ts",
|
|
270
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Progress\",\n summary: \"How far a task or a goal has come: a bar or a ring, determinate or indeterminate.\",\n status: \"beta\",\n category: \"feedback\",\n platforms: \"both\",\n whenToUse: [\n \"For a task with a known end: an upload, a processing step, a profile to complete.\",\n \"A ring with its amount in the centre for a goal: money raised, steps done.\",\n \"Indeterminate (no `value`) for a wait of unknown length inside a layout.\",\n ],\n whenNotToUse: [\n { when: \"For a short, unknown wait with nothing to show.\", use: \"spinner\" },\n { when: \"While the content of a page loads.\", use: \"skeleton\" },\n { when: \"For the time left until a moment.\", use: \"countdown\" },\n ],\n bestPractices: [\n \"Always a `label` (“Upload”), translated: it names the bar.\",\n \"Give `valueText` when the percentage is not what matters (“$420 of $1,000”).\",\n \"Do not move the bar backwards: if a task restarts, say so.\",\n ],\n accessibility: {\n keyboard: [],\n notes: [\n \"`role=\\\"progressbar\\\"` named by `label`, with `aria-valuenow`, `aria-valuemax` and `aria-valuetext`.\",\n \"Indeterminate: no value attributes; the motion stops under `prefers-reduced-motion`.\",\n ],\n },\n related: [\"spinner\", \"skeleton\", \"countdown\"],\n web: {\n imports: [\"Progress\"],\n examples: [\n { name: \"bar\", title: \"Bar\", description: \"A task with a known end.\" },\n { name: \"bar-sizes\", title: \"Bar sizes\", description: \"`sm`, `md`, `lg`.\" },\n { name: \"bar-indeterminate\", title: \"Indeterminate bar\", description: \"A wait of unknown length.\" },\n { name: \"ring\", title: \"Ring\", description: \"A goal with its amount in the centre.\" },\n { name: \"ring-indeterminate\", title: \"Indeterminate ring\", description: \"A ring without a value.\" },\n ],\n },\n native: {\n imports: [\"Progress\"],\n differences: [\"The ring's centre is native text (`Txt`).\", \"Style with `style`, not `className`.\"],\n examples: [\n { name: \"bar\", title: \"Bar\", description: \"`sm`, `md`, `lg`.\" },\n { name: \"ring\", title: \"Ring\", description: \"A ring with its centre: an amount, a percentage.\" },\n { name: \"indeterminate\", title: \"Indeterminate\", description: \"No value: a wait of unknown length.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
271
|
+
},
|
|
10
272
|
{
|
|
11
273
|
"path": "progress/progress.tsx",
|
|
12
274
|
"content": "// Server-safe: no hook, no context. role=\"progressbar\" with aria-valuenow / aria-valuemax (none when indeterminate),\n// named by `label`. A bar or a ring; the ring can hold content in its centre (an amount, a percentage).\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const progress = tv({\n slots: {\n root: \"relative\",\n track: \"\",\n indicator: \"\",\n center: \"absolute inset-0 flex flex-col items-center justify-center text-center\",\n },\n variants: {\n variant: {\n bar: {\n root: \"w-full overflow-hidden rounded-full bg-surface-3\",\n indicator:\n \"kz-progress h-full rounded-full bg-linear-to-r from-accent to-accent-2 transition-[width] duration-500 motion-reduce:transition-none \" +\n \"data-[state=indeterminate]:w-2/5\",\n },\n ring: {\n root: \"inline-flex shrink-0 items-center justify-center\",\n track: \"stroke-border-default\",\n indicator:\n \"stroke-accent transition-[stroke-dashoffset] duration-1000 motion-reduce:transition-none \" +\n \"data-[state=indeterminate]:origin-center data-[state=indeterminate]:animate-spin motion-reduce:data-[state=indeterminate]:animate-none\",\n },\n },\n size: { sm: {}, md: {}, lg: {} },\n },\n compoundVariants: [\n { variant: \"bar\", size: \"sm\", class: { root: \"h-1\" } },\n { variant: \"bar\", size: \"md\", class: { root: \"h-2\" } },\n { variant: \"bar\", size: \"lg\", class: { root: \"h-3\" } },\n { variant: \"ring\", size: \"sm\", class: { root: \"h-10 w-10\" } },\n { variant: \"ring\", size: \"md\", class: { root: \"h-20 w-20\" } },\n { variant: \"ring\", size: \"lg\", class: { root: \"h-36 w-36\" } },\n ],\n defaultVariants: { variant: \"bar\", size: \"md\" },\n});\n\nexport type ProgressVariants = VariantProps<typeof progress>;\n\nexport type ProgressProps = Omit<React.ComponentProps<\"div\">, \"children\"> &\n ProgressVariants & {\n /** bar · ring (a ring holds its `children` in the centre). */\n variant?: ProgressVariants[\"variant\"];\n /** sm · md · lg: the bar's thickness, the ring's diameter. */\n size?: ProgressVariants[\"size\"];\n /** How far, between 0 and `max`. `null` or absent: indeterminate (a wait of unknown length). */\n value?: number | null;\n /** The value that means complete. */\n max?: number;\n /** The accessible name — passed translated (\"Upload\", \"Raised towards the goal\"). */\n label: string;\n /** The value in words for assistive technology (\"$420 of $1,000\") — default: the percentage. */\n valueText?: string;\n /** A ring's centre: an amount, a percentage, an icon. */\n children?: React.ReactNode;\n };\n\nconst STROKE = { sm: 12, md: 9, lg: 7 } as const;\n\n/** A progress bar or ring: `value` / `max`, indeterminate without a value. State: `data-state` (loading · complete · indeterminate). */\nexport function Progress({ variant = \"bar\", size = \"md\", value, max = 100, label, valueText, className, children, ...props }: ProgressProps) {\n const s = progress({ variant, size });\n const known = typeof value === \"number\" && Number.isFinite(value);\n const ratio = known ? Math.min(1, Math.max(0, value / (max || 1))) : 0;\n const percent = Math.round(ratio * 100);\n const state = !known ? \"indeterminate\" : ratio >= 1 ? \"complete\" : \"loading\";\n const aria = {\n role: \"progressbar\" as const,\n \"aria-label\": label,\n \"aria-valuemin\": known ? 0 : undefined,\n \"aria-valuemax\": known ? max : undefined,\n \"aria-valuenow\": known ? Math.min(max, Math.max(0, value)) : undefined,\n \"aria-valuetext\": known ? (valueText ?? `${percent}%`) : valueText,\n \"data-state\": state,\n \"data-value\": known ? value : undefined,\n \"data-variant\": variant,\n };\n if (variant === \"ring\") {\n const stroke = STROKE[size];\n const r = 50 - stroke / 2;\n return (\n <div {...aria} className={s.root({ className })} {...props}>\n <svg viewBox=\"0 0 100 100\" className=\"h-full w-full -rotate-90\" aria-hidden>\n <circle cx=\"50\" cy=\"50\" r={r} fill=\"none\" strokeWidth={stroke} className={s.track()} />\n <circle\n cx=\"50\"\n cy=\"50\"\n r={r}\n fill=\"none\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n pathLength={100}\n strokeDasharray={100}\n strokeDashoffset={known ? 100 - percent : 75}\n data-state={state}\n className={s.indicator()}\n />\n </svg>\n {children !== undefined && <div className={s.center()}>{children}</div>}\n </div>\n );\n }\n return (\n <div {...aria} className={s.root({ className })} {...props}>\n <div data-state={state} className={s.indicator()} style={known ? { width: `${ratio * 100}%` } : undefined} />\n </div>\n );\n}\n"
|
|
@@ -17,8 +279,8 @@
|
|
|
17
279
|
],
|
|
18
280
|
"registryDependencies": [],
|
|
19
281
|
"demo": {
|
|
20
|
-
"path": "
|
|
21
|
-
"content": "import { Progress } from \"@krizaka/ui/progress\";\n\nexport default function
|
|
282
|
+
"path": "examples/progress/bar.tsx",
|
|
283
|
+
"content": "import { Progress } from \"@krizaka/ui/progress\";\n\nexport default function ProgressBar() {\n return <Progress label=\"Upload\" value={64} />;\n}\n"
|
|
22
284
|
},
|
|
23
285
|
"props": [
|
|
24
286
|
{
|
|
@@ -1,12 +1,145 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "radio-group",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Radio group",
|
|
5
|
+
"summary": "One choice among a few options, all visible: dots with their words, or whole cards.",
|
|
6
|
+
"description": "One choice among a few options, all visible: dots with their words, or whole cards.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "forms",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"In a form, to choose exactly one of two to five options that should all be seen: a frequency, a quality.",
|
|
12
|
+
"`RadioGroup.Card` when each option needs more than a line: an amount, a plan, a payment method."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "For many options (a country).",
|
|
17
|
+
"use": "field"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "For independent options that can all be chosen.",
|
|
21
|
+
"use": "checkbox"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"when": "To filter a list at once, without a form.",
|
|
25
|
+
"use": "chip"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"when": "To switch between views.",
|
|
29
|
+
"use": "tabs"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"bestPractices": [
|
|
33
|
+
"Give the group a `label`: the question being answered.",
|
|
34
|
+
"Pre-select the safest or most common option with `defaultValue` when there is one.",
|
|
35
|
+
"Keep the labels parallel and short."
|
|
36
|
+
],
|
|
37
|
+
"accessibility": {
|
|
38
|
+
"keyboard": [
|
|
39
|
+
{
|
|
40
|
+
"keys": "Tab",
|
|
41
|
+
"action": "Moves into the group (one tab stop, on the chosen option) and out of it."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"keys": "Arrow keys",
|
|
45
|
+
"action": "Move to the next or previous option and choose it."
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"notes": [
|
|
49
|
+
"Radix RadioGroup: `role=\"radiogroup\"` named by `label`, `role=\"radio\"` with `aria-checked` on each option.",
|
|
50
|
+
"Disabled options are skipped by the arrows."
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"related": [
|
|
54
|
+
"checkbox",
|
|
55
|
+
"chip",
|
|
56
|
+
"field",
|
|
57
|
+
"switch"
|
|
58
|
+
],
|
|
59
|
+
"web": {
|
|
60
|
+
"entry": "@krizaka/ui/radio-group",
|
|
61
|
+
"import": "import { RadioGroup } from \"@krizaka/ui/radio-group\";",
|
|
62
|
+
"props": [
|
|
63
|
+
{
|
|
64
|
+
"component": "RadioGroupRoot",
|
|
65
|
+
"description": "`value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form.",
|
|
66
|
+
"props": [
|
|
67
|
+
{
|
|
68
|
+
"name": "invalid",
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"default": null,
|
|
71
|
+
"description": "Marks every radio invalid: aria-invalid (pair it with a `Field.Error`).",
|
|
72
|
+
"required": false
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "label",
|
|
76
|
+
"type": "string",
|
|
77
|
+
"default": null,
|
|
78
|
+
"description": "The group's accessible name — passed translated (or `aria-labelledby` a visible heading).",
|
|
79
|
+
"required": false
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"component": "RadioGroupItem",
|
|
85
|
+
"description": "A radio: a dot, and its words when given.",
|
|
86
|
+
"props": [
|
|
87
|
+
{
|
|
88
|
+
"name": "children",
|
|
89
|
+
"type": "ReactNode",
|
|
90
|
+
"default": null,
|
|
91
|
+
"description": "The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`.",
|
|
92
|
+
"required": false
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"component": "RadioGroupCard",
|
|
98
|
+
"description": "A whole card as the radio: its content is the radio's name. `data-state=\"checked\"` styles the chosen one.",
|
|
99
|
+
"props": []
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"examples": [
|
|
103
|
+
{
|
|
104
|
+
"name": "items",
|
|
105
|
+
"title": "Items",
|
|
106
|
+
"description": "Dots and their words, one disabled.",
|
|
107
|
+
"path": "examples/radio-group/items.tsx",
|
|
108
|
+
"module": "@krizaka/ui/registry/examples/radio-group/items",
|
|
109
|
+
"code": "import { RadioGroup } from \"@krizaka/ui/radio-group\";\n\nexport default function RadioGroupItems() {\n return (\n <RadioGroup.Root label=\"Notification frequency\" defaultValue=\"daily\">\n <RadioGroup.Item value=\"instant\">Instantly</RadioGroup.Item>\n <RadioGroup.Item value=\"daily\">Once a day</RadioGroup.Item>\n <RadioGroup.Item value=\"weekly\">Once a week</RadioGroup.Item>\n <RadioGroup.Item value=\"never\" disabled>\n Never\n </RadioGroup.Item>\n </RadioGroup.Root>\n );\n}\n"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "cards",
|
|
113
|
+
"title": "Cards",
|
|
114
|
+
"description": "Whole cards: the chosen one carries the accent.",
|
|
115
|
+
"path": "examples/radio-group/cards.tsx",
|
|
116
|
+
"module": "@krizaka/ui/registry/examples/radio-group/cards",
|
|
117
|
+
"code": "import { RadioGroup } from \"@krizaka/ui/radio-group\";\n\nconst AMOUNTS = [\n [\"5\", \"$5\", \"A coffee\"],\n [\"20\", \"$20\", \"A dinner\"],\n [\"50\", \"$50\", \"A night out\"],\n];\n\n// Whole cards: the chosen one carries the accent border and tint.\nexport default function RadioGroupCards() {\n return (\n <RadioGroup.Root label=\"Amount\" defaultValue=\"20\" className=\"grid w-[30rem] max-w-full grid-cols-3 gap-3\">\n {AMOUNTS.map(([value, amount, hint]) => (\n <RadioGroup.Card key={value} value={value}>\n <span className=\"font-display text-lg font-bold\">{amount}</span>\n <span className=\"text-xs text-fg-secondary\">{hint}</span>\n </RadioGroup.Card>\n ))}\n </RadioGroup.Root>\n );\n}\n"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "horizontal",
|
|
121
|
+
"title": "Horizontal",
|
|
122
|
+
"description": "`orientation=\"horizontal\"`: the items in a row.",
|
|
123
|
+
"path": "examples/radio-group/horizontal.tsx",
|
|
124
|
+
"module": "@krizaka/ui/registry/examples/radio-group/horizontal",
|
|
125
|
+
"code": "import { RadioGroup } from \"@krizaka/ui/radio-group\";\n\n// `orientation=\"horizontal\"`: left and right arrows, the items in a row.\nexport default function RadioGroupHorizontal() {\n return (\n <RadioGroup.Root label=\"Quality\" defaultValue=\"1080\" orientation=\"horizontal\" className=\"gap-5\">\n <RadioGroup.Item value=\"720\">720p</RadioGroup.Item>\n <RadioGroup.Item value=\"1080\">1080p</RadioGroup.Item>\n <RadioGroup.Item value=\"2160\">4K</RadioGroup.Item>\n </RadioGroup.Root>\n );\n}\n"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"native": null,
|
|
5
130
|
"files": [
|
|
131
|
+
{
|
|
132
|
+
"path": "meta.ts",
|
|
133
|
+
"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"
|
|
134
|
+
},
|
|
6
135
|
{
|
|
7
136
|
"path": "radio-group/index.ts",
|
|
8
137
|
"content": "/** @krizaka/ui/radio-group — `RadioGroup.Root/Item/Card`, `radioGroup` (the slots). Client (\"use client\"). */\nexport {\n RadioGroup,\n radioGroup,\n RadioGroupCard,\n RadioGroupItem,\n type RadioGroupItemProps,\n RadioGroupRoot,\n type RadioGroupRootProps,\n} from \"./radio-group\";\n"
|
|
9
138
|
},
|
|
139
|
+
{
|
|
140
|
+
"path": "radio-group/meta.ts",
|
|
141
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Radio group\",\n summary: \"One choice among a few options, all visible: dots with their words, or whole cards.\",\n status: \"beta\",\n category: \"forms\",\n platforms: \"web\",\n whenToUse: [\n \"In a form, to choose exactly one of two to five options that should all be seen: a frequency, a quality.\",\n \"`RadioGroup.Card` when each option needs more than a line: an amount, a plan, a payment method.\",\n ],\n whenNotToUse: [\n { when: \"For many options (a country).\", use: \"field\" },\n { when: \"For independent options that can all be chosen.\", use: \"checkbox\" },\n { when: \"To filter a list at once, without a form.\", use: \"chip\" },\n { when: \"To switch between views.\", use: \"tabs\" },\n ],\n bestPractices: [\n \"Give the group a `label`: the question being answered.\",\n \"Pre-select the safest or most common option with `defaultValue` when there is one.\",\n \"Keep the labels parallel and short.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Tab\", action: \"Moves into the group (one tab stop, on the chosen option) and out of it.\" },\n { keys: \"Arrow keys\", action: \"Move to the next or previous option and choose it.\" },\n ],\n notes: [\"Radix RadioGroup: `role=\\\"radiogroup\\\"` named by `label`, `role=\\\"radio\\\"` with `aria-checked` on each option.\", \"Disabled options are skipped by the arrows.\"],\n },\n related: [\"checkbox\", \"chip\", \"field\", \"switch\"],\n web: {\n imports: [\"RadioGroup\"],\n examples: [\n { name: \"items\", title: \"Items\", description: \"Dots and their words, one disabled.\" },\n { name: \"cards\", title: \"Cards\", description: \"Whole cards: the chosen one carries the accent.\" },\n { name: \"horizontal\", title: \"Horizontal\", description: \"`orientation=\\\"horizontal\\\"`: the items in a row.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
142
|
+
},
|
|
10
143
|
{
|
|
11
144
|
"path": "radio-group/radio-group.tsx",
|
|
12
145
|
"content": "// Client (a context). Radix RadioGroup: role=\"radiogroup\" / \"radio\", one tab stop, the arrows move and select, a\n// hidden input inside a form. Two looks: `RadioGroup.Item` (a dot and its words) and `RadioGroup.Card` (a whole card\n// is the radio: an amount, a pack, a payment method, a plan).\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const radioGroup = tv({\n slots: {\n root: \"grid gap-2 data-[orientation=horizontal]:flex data-[orientation=horizontal]:flex-wrap\",\n item:\n \"peer inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-strong bg-surface-1 transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"hover:border-accent disabled:cursor-not-allowed disabled:opacity-40 data-[state=checked]:border-accent aria-invalid:border-danger\",\n dot: \"h-2.5 w-2.5 rounded-full bg-accent\",\n label: \"flex cursor-pointer items-start gap-3 text-sm text-fg has-disabled:cursor-not-allowed has-disabled:opacity-60\",\n card:\n \"relative flex min-w-0 flex-col items-start gap-1 rounded-xl border border-border-default bg-surface-1 p-3 text-left text-sm text-fg transition-colors \" +\n \"hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"disabled:cursor-not-allowed disabled:opacity-40 data-[state=checked]:border-accent data-[state=checked]:bg-accent-soft \" +\n \"data-[state=checked]:shadow-sm\",\n },\n});\nconst s = radioGroup();\n\nexport type RadioGroupRootProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n /** The group's accessible name — passed translated (or `aria-labelledby` a visible heading). */\n label?: string;\n /** Marks every radio invalid: aria-invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation`, `required`, `name` for a form. */\nexport function RadioGroupRoot({ label, invalid, className, ...props }: RadioGroupRootProps) {\n return (\n <RadioGroupPrimitive.Root\n aria-label={label}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? \"\" : undefined}\n className={s.root({ className })}\n {...props}\n />\n );\n}\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioGroupPrimitive.Item>, \"children\"> & {\n /** The words next to the dot, clickable. Otherwise name it with `Field.Label htmlFor` or `aria-label`. */\n children?: React.ReactNode;\n};\n\n/** A radio: a dot, and its words when given. */\nexport function RadioGroupItem({ className, children, ...props }: RadioGroupItemProps) {\n const item = (\n <RadioGroupPrimitive.Item className={s.item({ className: children ? \"mt-0.5\" : className })} {...props}>\n <RadioGroupPrimitive.Indicator className={s.dot()} />\n </RadioGroupPrimitive.Item>\n );\n if (!children) return item;\n return (\n <label className={s.label({ className })}>\n {item}\n <span className=\"min-w-0\">{children}</span>\n </label>\n );\n}\n\n/** A whole card as the radio: its content is the radio's name. `data-state=\"checked\"` styles the chosen one. */\nexport function RadioGroupCard({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return <RadioGroupPrimitive.Item className={s.card({ className })} {...props} />;\n}\n\n/** `RadioGroup.Root/Item/Card`. */\nexport const RadioGroup = { Root: RadioGroupRoot, Item: RadioGroupItem, Card: RadioGroupCard };\n"
|
|
@@ -18,8 +151,8 @@
|
|
|
18
151
|
],
|
|
19
152
|
"registryDependencies": [],
|
|
20
153
|
"demo": {
|
|
21
|
-
"path": "
|
|
22
|
-
"content": "import { RadioGroup } from \"@krizaka/ui/radio-group\";\n\nexport default function
|
|
154
|
+
"path": "examples/radio-group/items.tsx",
|
|
155
|
+
"content": "import { RadioGroup } from \"@krizaka/ui/radio-group\";\n\nexport default function RadioGroupItems() {\n return (\n <RadioGroup.Root label=\"Notification frequency\" defaultValue=\"daily\">\n <RadioGroup.Item value=\"instant\">Instantly</RadioGroup.Item>\n <RadioGroup.Item value=\"daily\">Once a day</RadioGroup.Item>\n <RadioGroup.Item value=\"weekly\">Once a week</RadioGroup.Item>\n <RadioGroup.Item value=\"never\" disabled>\n Never\n </RadioGroup.Item>\n </RadioGroup.Root>\n );\n}\n"
|
|
23
156
|
},
|
|
24
157
|
"props": [
|
|
25
158
|
{
|