@krizaka/ui 2.0.0-beta.4 → 2.0.0-beta.6
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 +40 -23
- package/dist/{button-8La7l0V4.d.ts → button-D5aSsmxX.d.ts} +3 -3
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/button.js.map +1 -1
- package/dist/card.js +1 -1
- package/dist/card.js.map +1 -1
- package/dist/{chunk-ZUD4U22H.js → chunk-6DJ6SQY3.js} +2 -2
- package/dist/chunk-6DJ6SQY3.js.map +1 -0
- package/dist/{chunk-3X5MVH54.js → chunk-IUGBKMJC.js} +2 -2
- package/dist/command.js +2 -2
- package/dist/confirm-button.d.ts +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.js +90 -65
- package/dist/index.js.map +1 -1
- package/dist/motion.css +52 -2
- package/dist/native.d.ts +67 -4
- package/dist/native.js +359 -92
- package/dist/native.js.map +1 -1
- package/dist/section-backdrop.d.ts +75 -0
- package/dist/section-backdrop.js +27 -0
- package/dist/section-backdrop.js.map +1 -0
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +1 -1
- package/package.json +26 -12
- package/registry/alert.json +141 -3
- package/registry/avatar.json +299 -3
- package/registry/badge.json +233 -3
- package/registry/button.json +497 -4
- package/registry/card.json +412 -4
- package/registry/checkbox.json +127 -3
- package/registry/chip.json +394 -3
- package/registry/cn.json +51 -3
- package/registry/command.json +222 -3
- package/registry/confirm-button.json +170 -3
- package/registry/countdown.json +273 -3
- 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/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/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 +40 -0
- package/registry/examples/command/dialog.tsx +36 -0
- package/registry/examples/command/inline.d.ts +4 -0
- package/registry/{demos/command.js → examples/command/inline.js} +3 -3
- package/registry/{demos/command.tsx → examples/command/inline.tsx} +1 -1
- 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/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/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/examples/section-backdrop/hero.js +14 -0
- package/registry/examples/section-backdrop/hero.tsx +10 -0
- 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 +141 -3
- package/registry/index.json +361 -32
- 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 +214 -0
- 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 +189 -3
- package/registry/toast.json +190 -3
- package/registry/tooltip.json +143 -3
- package/registry/txt.json +97 -0
- package/dist/chunk-ZUD4U22H.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/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-3X5MVH54.js.map → chunk-IUGBKMJC.js.map} +0 -0
package/registry/avatar.json
CHANGED
|
@@ -1,7 +1,295 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "avatar",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Avatar",
|
|
5
|
+
"summary": "A person or an account: their picture, or initials while it loads, when it fails or when there is none.",
|
|
6
|
+
"description": "A person or an account: their picture, or initials while it loads, when it fails or when there is none.",
|
|
7
|
+
"status": "stable",
|
|
8
|
+
"category": "data-display",
|
|
9
|
+
"platforms": "both",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"Next to a name: comments, creators, members, the signed-in account in a header.",
|
|
12
|
+
"`Avatar.Group` to show who takes part (followers, collaborators) in little space."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "For a product, a video or a place: use an image in a card.",
|
|
17
|
+
"use": "card"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "As the only way to say who someone is: show their name too, or give the avatar an `alt`."
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"bestPractices": [
|
|
24
|
+
"Always pass a `fallback` (initials) on the web: images fail, and the layout should not jump.",
|
|
25
|
+
"Use one size per list: `sm` in dense lists, `md` by default, `lg`/`xl` on a profile.",
|
|
26
|
+
"In a group, set `max` so a long list ends with `+n` instead of overflowing."
|
|
27
|
+
],
|
|
28
|
+
"accessibility": {
|
|
29
|
+
"keyboard": [],
|
|
30
|
+
"notes": [
|
|
31
|
+
"With `alt`, the picture is an image named by it; without `alt`, it is decorative — put the name in the text next to it.",
|
|
32
|
+
"The fallback initials are shown, not announced, when an `alt` names the person."
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"related": [
|
|
36
|
+
"card",
|
|
37
|
+
"badge",
|
|
38
|
+
"skeleton"
|
|
39
|
+
],
|
|
40
|
+
"web": {
|
|
41
|
+
"entry": "@krizaka/ui/avatar",
|
|
42
|
+
"import": "import { Avatar } from \"@krizaka/ui/avatar\";",
|
|
43
|
+
"props": [
|
|
44
|
+
{
|
|
45
|
+
"component": "Avatar",
|
|
46
|
+
"description": "`Avatar` (an image with a fallback) and `Avatar.Group`.",
|
|
47
|
+
"props": [
|
|
48
|
+
{
|
|
49
|
+
"name": "alt",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"default": null,
|
|
52
|
+
"description": "The image's text alternative (the person's name); empty when a visible name sits next to the avatar.",
|
|
53
|
+
"required": false
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "fallback",
|
|
57
|
+
"type": "ReactNode",
|
|
58
|
+
"default": null,
|
|
59
|
+
"description": "Shown while the image loads, when it fails or when there is none: initials, an icon.",
|
|
60
|
+
"required": false
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "size",
|
|
64
|
+
"type": "AvatarSize",
|
|
65
|
+
"default": "md",
|
|
66
|
+
"description": "xs · sm · md · lg · xl.",
|
|
67
|
+
"required": false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "src",
|
|
71
|
+
"type": "string | null",
|
|
72
|
+
"default": null,
|
|
73
|
+
"description": "The image's URL; `null` or nothing shows the `fallback`.",
|
|
74
|
+
"required": false
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"component": "AvatarGroup",
|
|
80
|
+
"description": "Overlapping avatars; past `max`, a `+n` avatar counts the rest.",
|
|
81
|
+
"props": [
|
|
82
|
+
{
|
|
83
|
+
"name": "max",
|
|
84
|
+
"type": "number",
|
|
85
|
+
"default": null,
|
|
86
|
+
"description": "How many avatars are shown; the rest becomes a `+n` avatar.",
|
|
87
|
+
"required": false
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "size",
|
|
91
|
+
"type": "AvatarSize",
|
|
92
|
+
"default": null,
|
|
93
|
+
"description": "The size of the `+n` avatar (match the avatars of the group).",
|
|
94
|
+
"required": false
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"component": "AvatarRoot",
|
|
100
|
+
"description": "",
|
|
101
|
+
"props": [
|
|
102
|
+
{
|
|
103
|
+
"name": "alt",
|
|
104
|
+
"type": "string",
|
|
105
|
+
"default": "",
|
|
106
|
+
"description": "The image's text alternative (the person's name); empty when a visible name sits next to the avatar.",
|
|
107
|
+
"required": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "fallback",
|
|
111
|
+
"type": "ReactNode",
|
|
112
|
+
"default": null,
|
|
113
|
+
"description": "Shown while the image loads, when it fails or when there is none: initials, an icon.",
|
|
114
|
+
"required": false
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "size",
|
|
118
|
+
"type": "AvatarSize",
|
|
119
|
+
"default": "md",
|
|
120
|
+
"description": "xs · sm · md · lg · xl.",
|
|
121
|
+
"required": false
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "src",
|
|
125
|
+
"type": "string | null",
|
|
126
|
+
"default": null,
|
|
127
|
+
"description": "The image's URL; `null` or nothing shows the `fallback`.",
|
|
128
|
+
"required": false
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"examples": [
|
|
134
|
+
{
|
|
135
|
+
"name": "with-image",
|
|
136
|
+
"title": "With an image",
|
|
137
|
+
"description": "A picture named by `alt`, with initials as `fallback`.",
|
|
138
|
+
"path": "examples/avatar/with-image.tsx",
|
|
139
|
+
"module": "@krizaka/ui/registry/examples/avatar/with-image",
|
|
140
|
+
"code": "import { Avatar } from \"@krizaka/ui/avatar\";\n\n// A self-contained portrait (no network).\nconst PORTRAIT =\n \"data:image/svg+xml;utf8,\" +\n encodeURIComponent(\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 80 80\"><rect width=\"80\" height=\"80\" fill=\"#3b82f6\"/>' +\n '<circle cx=\"40\" cy=\"31\" r=\"14\" fill=\"#dbeafe\"/><path d=\"M12 80a28 24 0 0 1 56 0z\" fill=\"#dbeafe\"/></svg>',\n );\n\nexport default function AvatarWithImage() {\n return <Avatar src={PORTRAIT} alt=\"Oussama\" fallback=\"OA\" />;\n}\n"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "fallback",
|
|
144
|
+
"title": "Fallback",
|
|
145
|
+
"description": "No image: the initials.",
|
|
146
|
+
"path": "examples/avatar/fallback.tsx",
|
|
147
|
+
"module": "@krizaka/ui/registry/examples/avatar/fallback",
|
|
148
|
+
"code": "import { Avatar } from \"@krizaka/ui/avatar\";\n\n// No image (or while it loads, or when it fails): the initials.\nexport default function AvatarFallback() {\n return <Avatar fallback=\"OA\" />;\n}\n"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "sizes",
|
|
152
|
+
"title": "Sizes",
|
|
153
|
+
"description": "`xs`, `sm`, `md` (default), `lg`, `xl`.",
|
|
154
|
+
"path": "examples/avatar/sizes.tsx",
|
|
155
|
+
"module": "@krizaka/ui/registry/examples/avatar/sizes",
|
|
156
|
+
"code": "import { Avatar } from \"@krizaka/ui/avatar\";\n\nexport default function AvatarSizes() {\n return (\n <div className=\"flex items-center gap-3\">\n <Avatar size=\"xs\" fallback=\"OA\" />\n <Avatar size=\"sm\" fallback=\"OA\" />\n <Avatar size=\"md\" fallback=\"OA\" />\n <Avatar size=\"lg\" fallback=\"OA\" />\n <Avatar size=\"xl\" fallback=\"OA\" />\n </div>\n );\n}\n"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "group",
|
|
160
|
+
"title": "Group",
|
|
161
|
+
"description": "`Avatar.Group` with `max`: the others become `+n`.",
|
|
162
|
+
"path": "examples/avatar/group.tsx",
|
|
163
|
+
"module": "@krizaka/ui/registry/examples/avatar/group",
|
|
164
|
+
"code": "import { Avatar } from \"@krizaka/ui/avatar\";\n\nconst PORTRAIT =\n \"data:image/svg+xml;utf8,\" +\n encodeURIComponent(\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 80 80\"><rect width=\"80\" height=\"80\" fill=\"#3b82f6\"/>' +\n '<circle cx=\"40\" cy=\"31\" r=\"14\" fill=\"#dbeafe\"/><path d=\"M12 80a28 24 0 0 1 56 0z\" fill=\"#dbeafe\"/></svg>',\n );\n\n// `max={3}`: the others become `+n`.\nexport default function AvatarGroup() {\n return (\n <Avatar.Group max={3} size=\"sm\">\n <Avatar size=\"sm\" src={PORTRAIT} alt=\"Oussama\" />\n <Avatar size=\"sm\" fallback=\"LM\" />\n <Avatar size=\"sm\" fallback=\"SK\" />\n <Avatar size=\"sm\" fallback=\"JD\" />\n <Avatar size=\"sm\" fallback=\"AR\" />\n </Avatar.Group>\n );\n}\n"
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"native": {
|
|
169
|
+
"entry": "@krizaka/ui/native",
|
|
170
|
+
"import": "import { Avatar } from \"@krizaka/ui/native\";",
|
|
171
|
+
"differences": [
|
|
172
|
+
"The fallback is the initial of `alt` when `fallback` is not given.",
|
|
173
|
+
"`size` also takes a number of points.",
|
|
174
|
+
"`src` is a URI string (an `Image` source), not a URL object."
|
|
175
|
+
],
|
|
176
|
+
"props": [
|
|
177
|
+
{
|
|
178
|
+
"component": "AvatarRoot",
|
|
179
|
+
"description": "A round picture; the initial (or `fallback`) when there is none or it fails to load.",
|
|
180
|
+
"props": [
|
|
181
|
+
{
|
|
182
|
+
"name": "alt",
|
|
183
|
+
"type": "string",
|
|
184
|
+
"default": "",
|
|
185
|
+
"description": "The person's name: the image's accessible name and the source of the default initial.",
|
|
186
|
+
"required": false
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "fallback",
|
|
190
|
+
"type": "ReactNode",
|
|
191
|
+
"default": null,
|
|
192
|
+
"description": "Shown while there is no image or when it fails: default, the first letter of `alt`.",
|
|
193
|
+
"required": false
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "size",
|
|
197
|
+
"type": "number | AvatarSize",
|
|
198
|
+
"default": "md",
|
|
199
|
+
"description": "A size of the scale, or points.",
|
|
200
|
+
"required": false
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "src",
|
|
204
|
+
"type": "string | null",
|
|
205
|
+
"default": null,
|
|
206
|
+
"description": "The image URI; absent, `null` or failing: the fallback.",
|
|
207
|
+
"required": false
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"component": "AvatarGroup",
|
|
213
|
+
"description": "Overlapping avatars; past `max`, a `+n` avatar counts the rest.",
|
|
214
|
+
"props": [
|
|
215
|
+
{
|
|
216
|
+
"name": "max",
|
|
217
|
+
"type": "number",
|
|
218
|
+
"default": null,
|
|
219
|
+
"description": "How many avatars are shown; the rest becomes a `+n` avatar.",
|
|
220
|
+
"required": false
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "size",
|
|
224
|
+
"type": "number | AvatarSize",
|
|
225
|
+
"default": "md",
|
|
226
|
+
"description": "The size of the avatars (and of the `+n` one).",
|
|
227
|
+
"required": false
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"component": "Avatar",
|
|
233
|
+
"description": "`Avatar` (an image with a fallback) and `Avatar.Group`.",
|
|
234
|
+
"props": [
|
|
235
|
+
{
|
|
236
|
+
"name": "alt",
|
|
237
|
+
"type": "string",
|
|
238
|
+
"default": null,
|
|
239
|
+
"description": "The person's name: the image's accessible name and the source of the default initial.",
|
|
240
|
+
"required": false
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "fallback",
|
|
244
|
+
"type": "ReactNode",
|
|
245
|
+
"default": null,
|
|
246
|
+
"description": "Shown while there is no image or when it fails: default, the first letter of `alt`.",
|
|
247
|
+
"required": false
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "size",
|
|
251
|
+
"type": "number | AvatarSize",
|
|
252
|
+
"default": null,
|
|
253
|
+
"description": "A size of the scale, or points.",
|
|
254
|
+
"required": false
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"name": "src",
|
|
258
|
+
"type": "string | null",
|
|
259
|
+
"default": null,
|
|
260
|
+
"description": "The image URI; absent, `null` or failing: the fallback.",
|
|
261
|
+
"required": false
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"examples": [
|
|
267
|
+
{
|
|
268
|
+
"name": "sizes",
|
|
269
|
+
"title": "Sizes",
|
|
270
|
+
"description": "Without an image: the initial of `alt`, from `xs` to `xl`.",
|
|
271
|
+
"path": "examples/avatar/native/sizes.tsx",
|
|
272
|
+
"module": "@krizaka/ui/registry/examples/avatar/native/sizes",
|
|
273
|
+
"code": "import { Avatar } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// Without an image: the initial of `alt`.\nexport default function NativeAvatarSizes() {\n return (\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8 }}>\n <Avatar alt=\"Maya\" size=\"xs\" />\n <Avatar alt=\"Maya\" size=\"sm\" />\n <Avatar alt=\"Maya\" size=\"md\" />\n <Avatar alt=\"Maya\" size=\"lg\" />\n <Avatar alt=\"Maya\" size=\"xl\" />\n </View>\n );\n}\n",
|
|
274
|
+
"screenshots": {
|
|
275
|
+
"dark": "examples/avatar/native/sizes.dark.png",
|
|
276
|
+
"light": "examples/avatar/native/sizes.light.png"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "group",
|
|
281
|
+
"title": "Group",
|
|
282
|
+
"description": "`Avatar.Group max={3}`: the rest becomes `+n`.",
|
|
283
|
+
"path": "examples/avatar/native/group.tsx",
|
|
284
|
+
"module": "@krizaka/ui/registry/examples/avatar/native/group",
|
|
285
|
+
"code": "import { Avatar } from \"@krizaka/ui/native\";\n\nexport default function NativeAvatarGroup() {\n return (\n <Avatar.Group max={3} size=\"md\">\n <Avatar alt=\"Maya\" />\n <Avatar alt=\"Noor\" />\n <Avatar alt=\"Ines\" />\n <Avatar alt=\"Theo\" />\n <Avatar alt=\"Lou\" />\n </Avatar.Group>\n );\n}\n",
|
|
286
|
+
"screenshots": {
|
|
287
|
+
"dark": "examples/avatar/native/group.dark.png",
|
|
288
|
+
"light": "examples/avatar/native/group.light.png"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
},
|
|
5
293
|
"files": [
|
|
6
294
|
{
|
|
7
295
|
"path": "avatar/avatar.tsx",
|
|
@@ -10,6 +298,14 @@
|
|
|
10
298
|
{
|
|
11
299
|
"path": "avatar/index.ts",
|
|
12
300
|
"content": "/** @krizaka/ui/avatar — `Avatar`, `Avatar.Group`. Client (\"use client\"). */\nexport { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, AvatarRoot, type AvatarSize } from \"./avatar\";\n"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"path": "avatar/meta.ts",
|
|
304
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Avatar\",\n summary: \"A person or an account: their picture, or initials while it loads, when it fails or when there is none.\",\n status: \"stable\",\n category: \"data-display\",\n platforms: \"both\",\n whenToUse: [\n \"Next to a name: comments, creators, members, the signed-in account in a header.\",\n \"`Avatar.Group` to show who takes part (followers, collaborators) in little space.\",\n ],\n whenNotToUse: [\n { when: \"For a product, a video or a place: use an image in a card.\", use: \"card\" },\n { when: \"As the only way to say who someone is: show their name too, or give the avatar an `alt`.\" },\n ],\n bestPractices: [\n \"Always pass a `fallback` (initials) on the web: images fail, and the layout should not jump.\",\n \"Use one size per list: `sm` in dense lists, `md` by default, `lg`/`xl` on a profile.\",\n \"In a group, set `max` so a long list ends with `+n` instead of overflowing.\",\n ],\n accessibility: {\n keyboard: [],\n notes: [\n \"With `alt`, the picture is an image named by it; without `alt`, it is decorative — put the name in the text next to it.\",\n \"The fallback initials are shown, not announced, when an `alt` names the person.\",\n ],\n },\n related: [\"card\", \"badge\", \"skeleton\"],\n web: {\n imports: [\"Avatar\"],\n examples: [\n { name: \"with-image\", title: \"With an image\", description: \"A picture named by `alt`, with initials as `fallback`.\" },\n { name: \"fallback\", title: \"Fallback\", description: \"No image: the initials.\" },\n { name: \"sizes\", title: \"Sizes\", description: \"`xs`, `sm`, `md` (default), `lg`, `xl`.\" },\n { name: \"group\", title: \"Group\", description: \"`Avatar.Group` with `max`: the others become `+n`.\" },\n ],\n },\n native: {\n imports: [\"Avatar\"],\n differences: [\n \"The fallback is the initial of `alt` when `fallback` is not given.\",\n \"`size` also takes a number of points.\",\n \"`src` is a URI string (an `Image` source), not a URL object.\",\n ],\n examples: [\n { name: \"sizes\", title: \"Sizes\", description: \"Without an image: the initial of `alt`, from `xs` to `xl`.\" },\n { name: \"group\", title: \"Group\", description: \"`Avatar.Group max={3}`: the rest becomes `+n`.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"path": "meta.ts",
|
|
308
|
+
"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"
|
|
13
309
|
}
|
|
14
310
|
],
|
|
15
311
|
"dependencies": [
|
|
@@ -18,8 +314,8 @@
|
|
|
18
314
|
],
|
|
19
315
|
"registryDependencies": [],
|
|
20
316
|
"demo": {
|
|
21
|
-
"path": "
|
|
22
|
-
"content": "import { Avatar } from \"@krizaka/ui/avatar\";\n\n// A self-contained portrait (no network).\nconst PORTRAIT =\n \"data:image/svg+xml;utf8,\" +\n encodeURIComponent(\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 80 80\"><rect width=\"80\" height=\"80\" fill=\"#3b82f6\"/>' +\n '<circle cx=\"40\" cy=\"31\" r=\"14\" fill=\"#dbeafe\"/><path d=\"M12 80a28 24 0 0 1 56 0z\" fill=\"#dbeafe\"/></svg>',\n );\n\nexport default function
|
|
317
|
+
"path": "examples/avatar/with-image.tsx",
|
|
318
|
+
"content": "import { Avatar } from \"@krizaka/ui/avatar\";\n\n// A self-contained portrait (no network).\nconst PORTRAIT =\n \"data:image/svg+xml;utf8,\" +\n encodeURIComponent(\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 80 80\"><rect width=\"80\" height=\"80\" fill=\"#3b82f6\"/>' +\n '<circle cx=\"40\" cy=\"31\" r=\"14\" fill=\"#dbeafe\"/><path d=\"M12 80a28 24 0 0 1 56 0z\" fill=\"#dbeafe\"/></svg>',\n );\n\nexport default function AvatarWithImage() {\n return <Avatar src={PORTRAIT} alt=\"Oussama\" fallback=\"OA\" />;\n}\n"
|
|
23
319
|
},
|
|
24
320
|
"props": [
|
|
25
321
|
{
|
package/registry/badge.json
CHANGED
|
@@ -1,7 +1,229 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "badge",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Badge",
|
|
5
|
+
"summary": "A short status or label: a tone, two sizes, an optional dot that can pulse.",
|
|
6
|
+
"description": "A short status or label: a tone, two sizes, an optional dot that can pulse.",
|
|
7
|
+
"status": "stable",
|
|
8
|
+
"category": "data-display",
|
|
9
|
+
"platforms": "both",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"To label the state of an item: paid, pending, new, live, ending soon.",
|
|
12
|
+
"On a media (`tone=\"scrim\"`): a duration, a quality, a live marker.",
|
|
13
|
+
"With a `dot` (and `pulse`) for something happening now."
|
|
14
|
+
],
|
|
15
|
+
"whenNotToUse": [
|
|
16
|
+
{
|
|
17
|
+
"when": "For something the user can click or select.",
|
|
18
|
+
"use": "chip"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"when": "For a message the user must read.",
|
|
22
|
+
"use": "alert"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"when": "For a key figure with a trend.",
|
|
26
|
+
"use": "stat"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"bestPractices": [
|
|
30
|
+
"One or two words: a badge is scanned, not read.",
|
|
31
|
+
"Keep the tone meaningful: `success`, `warning`, `danger` for states; `accent` to highlight; `neutral` otherwise.",
|
|
32
|
+
"`pulse` only for what is live: a page full of pulsing dots says nothing."
|
|
33
|
+
],
|
|
34
|
+
"accessibility": {
|
|
35
|
+
"keyboard": [],
|
|
36
|
+
"notes": [
|
|
37
|
+
"A plain `<span>`: its text is read with the content around it; the dot is decorative.",
|
|
38
|
+
"The colour is never the only signal: the words say the state.",
|
|
39
|
+
"The pulse stops under `prefers-reduced-motion`."
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"related": [
|
|
43
|
+
"chip",
|
|
44
|
+
"stat",
|
|
45
|
+
"card"
|
|
46
|
+
],
|
|
47
|
+
"web": {
|
|
48
|
+
"entry": "@krizaka/ui/badge",
|
|
49
|
+
"import": "import { Badge } from \"@krizaka/ui/badge\";",
|
|
50
|
+
"props": [
|
|
51
|
+
{
|
|
52
|
+
"component": "Badge",
|
|
53
|
+
"description": "",
|
|
54
|
+
"props": [
|
|
55
|
+
{
|
|
56
|
+
"name": "dot",
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": null,
|
|
59
|
+
"description": "A small dot before the text, in the tone's colour (pulsing with `pulse`).",
|
|
60
|
+
"required": false
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "pulse",
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"default": null,
|
|
66
|
+
"description": "Makes the `dot` pulse (stopped under reduced motion).",
|
|
67
|
+
"required": false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "size",
|
|
71
|
+
"type": "\"sm\" | \"md\"",
|
|
72
|
+
"default": "sm",
|
|
73
|
+
"description": "sm · md.",
|
|
74
|
+
"required": false
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "tone",
|
|
78
|
+
"type": "\"success\" | \"warning\" | \"danger\" | \"neutral\" | \"accent\" | \"scrim\"",
|
|
79
|
+
"default": "neutral",
|
|
80
|
+
"description": "neutral · accent · success · warning · danger (soft tints, the text stays a text role) · scrim (on a media).",
|
|
81
|
+
"required": false
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"examples": [
|
|
87
|
+
{
|
|
88
|
+
"name": "neutral",
|
|
89
|
+
"title": "Neutral",
|
|
90
|
+
"description": "The default tone.",
|
|
91
|
+
"path": "examples/badge/neutral.tsx",
|
|
92
|
+
"module": "@krizaka/ui/registry/examples/badge/neutral",
|
|
93
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\n\nexport default function BadgeNeutral() {\n return <Badge>New</Badge>;\n}\n"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "accent",
|
|
97
|
+
"title": "Accent",
|
|
98
|
+
"description": "To highlight: new, featured.",
|
|
99
|
+
"path": "examples/badge/accent.tsx",
|
|
100
|
+
"module": "@krizaka/ui/registry/examples/badge/accent",
|
|
101
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\n\nexport default function BadgeAccent() {\n return (\n <Badge tone=\"accent\" dot>\n New\n </Badge>\n );\n}\n"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "success",
|
|
105
|
+
"title": "Success",
|
|
106
|
+
"description": "A good state: paid, verified.",
|
|
107
|
+
"path": "examples/badge/success.tsx",
|
|
108
|
+
"module": "@krizaka/ui/registry/examples/badge/success",
|
|
109
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\n\nexport default function BadgeSuccess() {\n return (\n <Badge tone=\"success\" dot>\n Paid\n </Badge>\n );\n}\n"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "warning",
|
|
113
|
+
"title": "Warning",
|
|
114
|
+
"description": "A state that needs attention soon.",
|
|
115
|
+
"path": "examples/badge/warning.tsx",
|
|
116
|
+
"module": "@krizaka/ui/registry/examples/badge/warning",
|
|
117
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\n\nexport default function BadgeWarning() {\n return (\n <Badge tone=\"warning\" dot>\n Pending\n </Badge>\n );\n}\n"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "danger",
|
|
121
|
+
"title": "Danger with pulse",
|
|
122
|
+
"description": "Urgent, happening now: the dot pulses.",
|
|
123
|
+
"path": "examples/badge/danger.tsx",
|
|
124
|
+
"module": "@krizaka/ui/registry/examples/badge/danger",
|
|
125
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\n\nexport default function BadgeDanger() {\n return (\n <Badge tone=\"danger\" dot pulse>\n Ends soon\n </Badge>\n );\n}\n"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "scrim",
|
|
129
|
+
"title": "On a media",
|
|
130
|
+
"description": "`tone=\"scrim\"`: the veil and the text are identical in both themes.",
|
|
131
|
+
"path": "examples/badge/scrim.tsx",
|
|
132
|
+
"module": "@krizaka/ui/registry/examples/badge/scrim",
|
|
133
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\n\n// On a media: the veil and the text are invariant, identical in both themes.\nexport default function BadgeScrim() {\n return (\n <div className=\"flex h-24 w-40 items-start bg-media p-2.5\">\n <Badge tone=\"scrim\">4K</Badge>\n </div>\n );\n}\n"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "medium",
|
|
137
|
+
"title": "Medium",
|
|
138
|
+
"description": "`size=\"md\"` for a badge next to a heading.",
|
|
139
|
+
"path": "examples/badge/medium.tsx",
|
|
140
|
+
"module": "@krizaka/ui/registry/examples/badge/medium",
|
|
141
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\n\nexport default function BadgeMedium() {\n return (\n <Badge tone=\"accent\" size=\"md\">\n Featured\n </Badge>\n );\n}\n"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"native": {
|
|
146
|
+
"entry": "@krizaka/ui/native",
|
|
147
|
+
"import": "import { Badge } from \"@krizaka/ui/native\";",
|
|
148
|
+
"differences": [
|
|
149
|
+
"The text is set in capitals by the component.",
|
|
150
|
+
"No `className`: style it with `style`."
|
|
151
|
+
],
|
|
152
|
+
"props": [
|
|
153
|
+
{
|
|
154
|
+
"component": "Badge",
|
|
155
|
+
"description": "A short status in capitals: a tone, a size, an optional (pulsing) dot.",
|
|
156
|
+
"props": [
|
|
157
|
+
{
|
|
158
|
+
"name": "dot",
|
|
159
|
+
"type": "boolean",
|
|
160
|
+
"default": null,
|
|
161
|
+
"description": "A small dot before the text, in the tone's colour.",
|
|
162
|
+
"required": false
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "pulse",
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"default": null,
|
|
168
|
+
"description": "The dot breathes (still when the system reduces motion).",
|
|
169
|
+
"required": false
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "size",
|
|
173
|
+
"type": "\"sm\" | \"md\"",
|
|
174
|
+
"default": "sm",
|
|
175
|
+
"description": "sm (default) · md.",
|
|
176
|
+
"required": false
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "tone",
|
|
180
|
+
"type": "BadgeTone",
|
|
181
|
+
"default": "neutral",
|
|
182
|
+
"description": "neutral (default) · accent · success · warning · danger · scrim (on a media).",
|
|
183
|
+
"required": false
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"examples": [
|
|
189
|
+
{
|
|
190
|
+
"name": "tones",
|
|
191
|
+
"title": "Tones",
|
|
192
|
+
"description": "`neutral`, `accent`, `success`, `warning`, `danger`.",
|
|
193
|
+
"path": "examples/badge/native/tones.tsx",
|
|
194
|
+
"module": "@krizaka/ui/registry/examples/badge/native/tones",
|
|
195
|
+
"code": "import { Badge } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\nexport default function NativeBadgeTones() {\n return (\n <View style={{ flexDirection: \"row\", gap: 8 }}>\n <Badge tone=\"neutral\">Live</Badge>\n <Badge tone=\"accent\">Live</Badge>\n <Badge tone=\"success\">Live</Badge>\n <Badge tone=\"warning\">Live</Badge>\n <Badge tone=\"danger\">Live</Badge>\n </View>\n );\n}\n",
|
|
196
|
+
"screenshots": {
|
|
197
|
+
"dark": "examples/badge/native/tones.dark.png",
|
|
198
|
+
"light": "examples/badge/native/tones.light.png"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "dot",
|
|
203
|
+
"title": "Dot",
|
|
204
|
+
"description": "`sm` and `md`, with a pulsing dot.",
|
|
205
|
+
"path": "examples/badge/native/dot.tsx",
|
|
206
|
+
"module": "@krizaka/ui/registry/examples/badge/native/dot",
|
|
207
|
+
"code": "import { Badge } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// `pulse` stops under reduced motion.\nexport default function NativeBadgeDot() {\n return (\n <View style={{ flexDirection: \"row\", gap: 8 }}>\n <Badge tone=\"danger\" dot pulse>\n Live\n </Badge>\n <Badge tone=\"danger\" size=\"md\" dot pulse>\n Live\n </Badge>\n </View>\n );\n}\n",
|
|
208
|
+
"screenshots": {
|
|
209
|
+
"dark": "examples/badge/native/dot.dark.png",
|
|
210
|
+
"light": "examples/badge/native/dot.light.png"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "scrim",
|
|
215
|
+
"title": "On a media",
|
|
216
|
+
"description": "`scrim`: identical in both themes.",
|
|
217
|
+
"path": "examples/badge/native/scrim.tsx",
|
|
218
|
+
"module": "@krizaka/ui/registry/examples/badge/native/scrim",
|
|
219
|
+
"code": "import { Badge, useTheme } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// `scrim`: on a media, identical in both themes.\nexport default function NativeBadgeScrim() {\n const { theme } = useTheme();\n return (\n <View style={{ backgroundColor: theme.media, padding: 24, borderRadius: 12 }}>\n <Badge tone=\"scrim\" dot>\n Ending soon\n </Badge>\n </View>\n );\n}\n",
|
|
220
|
+
"screenshots": {
|
|
221
|
+
"dark": "examples/badge/native/scrim.dark.png",
|
|
222
|
+
"light": "examples/badge/native/scrim.light.png"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
},
|
|
5
227
|
"files": [
|
|
6
228
|
{
|
|
7
229
|
"path": "badge/badge.tsx",
|
|
@@ -10,6 +232,14 @@
|
|
|
10
232
|
{
|
|
11
233
|
"path": "badge/index.ts",
|
|
12
234
|
"content": "/** @krizaka/ui/badge — `Badge`, `badgeVariants`. Server-safe. */\nexport { Badge, type BadgeProps, type BadgeVariants, badgeVariants } from \"./badge\";\n"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"path": "badge/meta.ts",
|
|
238
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Badge\",\n summary: \"A short status or label: a tone, two sizes, an optional dot that can pulse.\",\n status: \"stable\",\n category: \"data-display\",\n platforms: \"both\",\n whenToUse: [\n \"To label the state of an item: paid, pending, new, live, ending soon.\",\n \"On a media (`tone=\\\"scrim\\\"`): a duration, a quality, a live marker.\",\n \"With a `dot` (and `pulse`) for something happening now.\",\n ],\n whenNotToUse: [\n { when: \"For something the user can click or select.\", use: \"chip\" },\n { when: \"For a message the user must read.\", use: \"alert\" },\n { when: \"For a key figure with a trend.\", use: \"stat\" },\n ],\n bestPractices: [\n \"One or two words: a badge is scanned, not read.\",\n \"Keep the tone meaningful: `success`, `warning`, `danger` for states; `accent` to highlight; `neutral` otherwise.\",\n \"`pulse` only for what is live: a page full of pulsing dots says nothing.\",\n ],\n accessibility: {\n keyboard: [],\n notes: [\n \"A plain `<span>`: its text is read with the content around it; the dot is decorative.\",\n \"The colour is never the only signal: the words say the state.\",\n \"The pulse stops under `prefers-reduced-motion`.\",\n ],\n },\n related: [\"chip\", \"stat\", \"card\"],\n web: {\n imports: [\"Badge\"],\n examples: [\n { name: \"neutral\", title: \"Neutral\", description: \"The default tone.\" },\n { name: \"accent\", title: \"Accent\", description: \"To highlight: new, featured.\" },\n { name: \"success\", title: \"Success\", description: \"A good state: paid, verified.\" },\n { name: \"warning\", title: \"Warning\", description: \"A state that needs attention soon.\" },\n { name: \"danger\", title: \"Danger with pulse\", description: \"Urgent, happening now: the dot pulses.\" },\n { name: \"scrim\", title: \"On a media\", description: \"`tone=\\\"scrim\\\"`: the veil and the text are identical in both themes.\" },\n { name: \"medium\", title: \"Medium\", description: \"`size=\\\"md\\\"` for a badge next to a heading.\" },\n ],\n },\n native: {\n imports: [\"Badge\"],\n differences: [\"The text is set in capitals by the component.\", \"No `className`: style it with `style`.\"],\n examples: [\n { name: \"tones\", title: \"Tones\", description: \"`neutral`, `accent`, `success`, `warning`, `danger`.\" },\n { name: \"dot\", title: \"Dot\", description: \"`sm` and `md`, with a pulsing dot.\" },\n { name: \"scrim\", title: \"On a media\", description: \"`scrim`: identical in both themes.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"path": "meta.ts",
|
|
242
|
+
"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"
|
|
13
243
|
}
|
|
14
244
|
],
|
|
15
245
|
"dependencies": [
|
|
@@ -17,8 +247,8 @@
|
|
|
17
247
|
],
|
|
18
248
|
"registryDependencies": [],
|
|
19
249
|
"demo": {
|
|
20
|
-
"path": "
|
|
21
|
-
"content": "import { Badge } from \"@krizaka/ui/badge\";\n\nexport default function
|
|
250
|
+
"path": "examples/badge/neutral.tsx",
|
|
251
|
+
"content": "import { Badge } from \"@krizaka/ui/badge\";\n\nexport default function BadgeNeutral() {\n return <Badge>New</Badge>;\n}\n"
|
|
22
252
|
},
|
|
23
253
|
"props": [
|
|
24
254
|
{
|