@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/checkbox.json
CHANGED
|
@@ -1,7 +1,123 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "checkbox",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Checkbox",
|
|
5
|
+
"summary": "A box to check: checked, unchecked or indeterminate, with its words as one clickable label.",
|
|
6
|
+
"description": "A box to check: checked, unchecked or indeterminate, with its words as one clickable label.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "forms",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"In a form, for a choice that is submitted with it: accept the terms, subscribe to a list.",
|
|
12
|
+
"For several independent options in a list, and “select all” (indeterminate when some are)."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "For a setting that applies at once, without a submit.",
|
|
17
|
+
"use": "switch"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "To choose one option among several.",
|
|
21
|
+
"use": "radio-group"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"when": "To filter a list with a few options shown as pills.",
|
|
25
|
+
"use": "chip"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"bestPractices": [
|
|
29
|
+
"Say what checking does, in the positive: “Email me the receipts”, not “Don't email me”.",
|
|
30
|
+
"Pass the words as children: the whole line is the label and the click target.",
|
|
31
|
+
"In a `Field`, set `invalid` and point `aria-describedby` at the `Field.Error`."
|
|
32
|
+
],
|
|
33
|
+
"accessibility": {
|
|
34
|
+
"keyboard": [
|
|
35
|
+
{
|
|
36
|
+
"keys": "Space",
|
|
37
|
+
"action": "Toggles the box."
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"notes": [
|
|
41
|
+
"Radix Checkbox: `role=\"checkbox\"` with `aria-checked` true, false or mixed.",
|
|
42
|
+
"The children are its label; without children, give it `aria-label` or a `Field.Label htmlFor`.",
|
|
43
|
+
"`invalid` sets `aria-invalid`; the error is read through `aria-describedby`."
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"related": [
|
|
47
|
+
"switch",
|
|
48
|
+
"radio-group",
|
|
49
|
+
"field",
|
|
50
|
+
"chip"
|
|
51
|
+
],
|
|
52
|
+
"web": {
|
|
53
|
+
"entry": "@krizaka/ui/checkbox",
|
|
54
|
+
"import": "import { Checkbox } from \"@krizaka/ui/checkbox\";",
|
|
55
|
+
"props": [
|
|
56
|
+
{
|
|
57
|
+
"component": "Checkbox",
|
|
58
|
+
"description": "A checkbox: `checked`/`defaultChecked` (`true` · `false` · `\"indeterminate\"`) + `onCheckedChange`.",
|
|
59
|
+
"props": [
|
|
60
|
+
{
|
|
61
|
+
"name": "children",
|
|
62
|
+
"type": "ReactNode",
|
|
63
|
+
"default": null,
|
|
64
|
+
"description": "The text next to the box, clickable: the box and its words in one `<label>`. Otherwise name it with\n`Field.Label htmlFor` or `aria-label`.",
|
|
65
|
+
"required": false
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "invalid",
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"default": null,
|
|
71
|
+
"description": "Marks it invalid: aria-invalid and data-invalid (pair it with a `Field.Error` in aria-describedby).",
|
|
72
|
+
"required": false
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"examples": [
|
|
78
|
+
{
|
|
79
|
+
"name": "unchecked",
|
|
80
|
+
"title": "Unchecked",
|
|
81
|
+
"description": "Its words as children: one clickable label.",
|
|
82
|
+
"path": "examples/checkbox/unchecked.tsx",
|
|
83
|
+
"module": "@krizaka/ui/registry/examples/checkbox/unchecked",
|
|
84
|
+
"code": "import { Checkbox } from \"@krizaka/ui/checkbox\";\n\n// Its words as children: one clickable label.\nexport default function CheckboxUnchecked() {\n return <Checkbox>I accept the terms of use</Checkbox>;\n}\n"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "checked",
|
|
88
|
+
"title": "Checked",
|
|
89
|
+
"description": "`defaultChecked` (or `checked` + `onCheckedChange`).",
|
|
90
|
+
"path": "examples/checkbox/checked.tsx",
|
|
91
|
+
"module": "@krizaka/ui/registry/examples/checkbox/checked",
|
|
92
|
+
"code": "import { Checkbox } from \"@krizaka/ui/checkbox\";\n\nexport default function CheckboxChecked() {\n return <Checkbox defaultChecked>I accept the terms of use</Checkbox>;\n}\n"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "indeterminate",
|
|
96
|
+
"title": "Indeterminate",
|
|
97
|
+
"description": "`checked=\"indeterminate\"`: some of a list.",
|
|
98
|
+
"path": "examples/checkbox/indeterminate.tsx",
|
|
99
|
+
"module": "@krizaka/ui/registry/examples/checkbox/indeterminate",
|
|
100
|
+
"code": "import { Checkbox } from \"@krizaka/ui/checkbox\";\n\n// `checked=\"indeterminate\"`: some of a list are selected.\nexport default function CheckboxIndeterminate() {\n return <Checkbox checked=\"indeterminate\">Select all videos</Checkbox>;\n}\n"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "disabled",
|
|
104
|
+
"title": "Disabled",
|
|
105
|
+
"description": "Not available, checked or not.",
|
|
106
|
+
"path": "examples/checkbox/disabled.tsx",
|
|
107
|
+
"module": "@krizaka/ui/registry/examples/checkbox/disabled",
|
|
108
|
+
"code": "import { Checkbox } from \"@krizaka/ui/checkbox\";\n\nexport default function CheckboxDisabled() {\n return (\n <div className=\"flex flex-col gap-3\">\n <Checkbox disabled>Email me the receipts</Checkbox>\n <Checkbox disabled defaultChecked>\n Keep me signed in\n </Checkbox>\n </div>\n );\n}\n"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "invalid",
|
|
112
|
+
"title": "Invalid",
|
|
113
|
+
"description": "In a `Field`, with its error.",
|
|
114
|
+
"path": "examples/checkbox/invalid.tsx",
|
|
115
|
+
"module": "@krizaka/ui/registry/examples/checkbox/invalid",
|
|
116
|
+
"code": "import { Checkbox } from \"@krizaka/ui/checkbox\";\nimport { Field } from \"@krizaka/ui/field\";\n\n// In a `Field`: `invalid` and its error, wired by `aria-describedby`.\nexport default function CheckboxInvalid() {\n return (\n <Field.Root className=\"w-80\">\n <Checkbox invalid aria-describedby=\"age-error\">\n I am 18 or older\n </Checkbox>\n <Field.Error id=\"age-error\">You must be 18 or older to continue.</Field.Error>\n </Field.Root>\n );\n}\n"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"native": null,
|
|
5
121
|
"files": [
|
|
6
122
|
{
|
|
7
123
|
"path": "checkbox/checkbox.tsx",
|
|
@@ -10,6 +126,14 @@
|
|
|
10
126
|
{
|
|
11
127
|
"path": "checkbox/index.ts",
|
|
12
128
|
"content": "/** @krizaka/ui/checkbox — `Checkbox` (checked · unchecked · indeterminate), `checkbox` (the slots). Client (\"use client\"). */\nexport { Checkbox, checkbox, type CheckboxProps } from \"./checkbox\";\n"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"path": "checkbox/meta.ts",
|
|
132
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Checkbox\",\n summary: \"A box to check: checked, unchecked or indeterminate, with its words as one clickable label.\",\n status: \"beta\",\n category: \"forms\",\n platforms: \"web\",\n whenToUse: [\n \"In a form, for a choice that is submitted with it: accept the terms, subscribe to a list.\",\n \"For several independent options in a list, and “select all” (indeterminate when some are).\",\n ],\n whenNotToUse: [\n { when: \"For a setting that applies at once, without a submit.\", use: \"switch\" },\n { when: \"To choose one option among several.\", use: \"radio-group\" },\n { when: \"To filter a list with a few options shown as pills.\", use: \"chip\" },\n ],\n bestPractices: [\n \"Say what checking does, in the positive: “Email me the receipts”, not “Don't email me”.\",\n \"Pass the words as children: the whole line is the label and the click target.\",\n \"In a `Field`, set `invalid` and point `aria-describedby` at the `Field.Error`.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Space\", action: \"Toggles the box.\" }],\n notes: [\n \"Radix Checkbox: `role=\\\"checkbox\\\"` with `aria-checked` true, false or mixed.\",\n \"The children are its label; without children, give it `aria-label` or a `Field.Label htmlFor`.\",\n \"`invalid` sets `aria-invalid`; the error is read through `aria-describedby`.\",\n ],\n },\n related: [\"switch\", \"radio-group\", \"field\", \"chip\"],\n web: {\n imports: [\"Checkbox\"],\n examples: [\n { name: \"unchecked\", title: \"Unchecked\", description: \"Its words as children: one clickable label.\" },\n { name: \"checked\", title: \"Checked\", description: \"`defaultChecked` (or `checked` + `onCheckedChange`).\" },\n { name: \"indeterminate\", title: \"Indeterminate\", description: \"`checked=\\\"indeterminate\\\"`: some of a list.\" },\n { name: \"disabled\", title: \"Disabled\", description: \"Not available, checked or not.\" },\n { name: \"invalid\", title: \"Invalid\", description: \"In a `Field`, with its error.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"path": "meta.ts",
|
|
136
|
+
"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
137
|
}
|
|
14
138
|
],
|
|
15
139
|
"dependencies": [
|
|
@@ -18,8 +142,8 @@
|
|
|
18
142
|
],
|
|
19
143
|
"registryDependencies": [],
|
|
20
144
|
"demo": {
|
|
21
|
-
"path": "
|
|
22
|
-
"content": "import { Checkbox } from \"@krizaka/ui/checkbox\";\n\nexport default function
|
|
145
|
+
"path": "examples/checkbox/unchecked.tsx",
|
|
146
|
+
"content": "import { Checkbox } from \"@krizaka/ui/checkbox\";\n\n// Its words as children: one clickable label.\nexport default function CheckboxUnchecked() {\n return <Checkbox>I accept the terms of use</Checkbox>;\n}\n"
|
|
23
147
|
},
|
|
24
148
|
"props": [
|
|
25
149
|
{
|
package/registry/chip.json
CHANGED
|
@@ -1,7 +1,390 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chip",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Chip",
|
|
5
|
+
"summary": "A selectable pill: alone a toggle, in a group a single or multiple choice, or a removable tag.",
|
|
6
|
+
"description": "A selectable pill: alone a toggle, in a group a single or multiple choice, or a removable tag.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "forms",
|
|
9
|
+
"platforms": "both",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"To filter a list with a few short options shown at once: format, genre, speed.",
|
|
12
|
+
"`Chip.Group type=\"multiple\"` for several tags; `type=\"single\"` (with `required`) for one filter.",
|
|
13
|
+
"`removable` for the values already chosen: tags, recipients, active filters."
|
|
14
|
+
],
|
|
15
|
+
"whenNotToUse": [
|
|
16
|
+
{
|
|
17
|
+
"when": "To switch between views of the same page.",
|
|
18
|
+
"use": "tabs"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"when": "To choose in a form that is submitted, with labels that read as sentences.",
|
|
22
|
+
"use": "radio-group"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"when": "For a status that cannot be changed.",
|
|
26
|
+
"use": "badge"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"when": "To run an action.",
|
|
30
|
+
"use": "button"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"bestPractices": [
|
|
34
|
+
"One or two words per chip; the group's `label` says what is being chosen.",
|
|
35
|
+
"Keep the order stable when a chip is selected: do not move it to the front.",
|
|
36
|
+
"Give each removable chip a `removeLabel` that names it: “Remove #night”, not “Remove”."
|
|
37
|
+
],
|
|
38
|
+
"accessibility": {
|
|
39
|
+
"keyboard": [
|
|
40
|
+
{
|
|
41
|
+
"keys": "Tab",
|
|
42
|
+
"action": "Moves into the group (one tab stop) and out of it."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"keys": "Arrow keys",
|
|
46
|
+
"action": "Move between the chips of a group."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"keys": "Space / Enter",
|
|
50
|
+
"action": "Toggles the focused chip."
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"notes": [
|
|
54
|
+
"Radix Toggle and ToggleGroup: alone `aria-pressed`; in a single group a radio (`aria-checked`), in a multiple group pressed buttons.",
|
|
55
|
+
"`Chip.Group` takes `label` as the group's accessible name.",
|
|
56
|
+
"The remove button is a separate button named by `removeLabel`."
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"related": [
|
|
60
|
+
"tabs",
|
|
61
|
+
"radio-group",
|
|
62
|
+
"checkbox",
|
|
63
|
+
"badge"
|
|
64
|
+
],
|
|
65
|
+
"web": {
|
|
66
|
+
"entry": "@krizaka/ui/chip",
|
|
67
|
+
"import": "import { Chip } from \"@krizaka/ui/chip\";",
|
|
68
|
+
"props": [
|
|
69
|
+
{
|
|
70
|
+
"component": "Chip",
|
|
71
|
+
"description": "`Chip` (selectable, removable) and `Chip.Group` (single · multiple).",
|
|
72
|
+
"props": [
|
|
73
|
+
{
|
|
74
|
+
"name": "onRemove",
|
|
75
|
+
"type": "() => void",
|
|
76
|
+
"default": null,
|
|
77
|
+
"description": "Runs when the remove button is pressed.",
|
|
78
|
+
"required": true
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "removeLabel",
|
|
82
|
+
"type": "string",
|
|
83
|
+
"default": null,
|
|
84
|
+
"description": "The accessible name of the remove button — passed translated, e.g. \"Remove #night\".",
|
|
85
|
+
"required": true
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "defaultSelected",
|
|
89
|
+
"type": "boolean",
|
|
90
|
+
"default": null,
|
|
91
|
+
"description": "Alone: pressed at first, uncontrolled.",
|
|
92
|
+
"required": false
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "onSelectedChange",
|
|
96
|
+
"type": "((selected: boolean) => void)",
|
|
97
|
+
"default": null,
|
|
98
|
+
"description": "Alone: called with the new state on every press.",
|
|
99
|
+
"required": false
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "removable",
|
|
103
|
+
"type": "boolean",
|
|
104
|
+
"default": null,
|
|
105
|
+
"description": "A pressable chip (the default); `true` makes it a static chip with a remove button.\nA static chip (a chosen tag, an applied filter) with a remove button.",
|
|
106
|
+
"required": false
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "selected",
|
|
110
|
+
"type": "boolean",
|
|
111
|
+
"default": null,
|
|
112
|
+
"description": "Alone: pressed or not (`defaultSelected` uncontrolled), `onSelectedChange` on every press.",
|
|
113
|
+
"required": false
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "size",
|
|
117
|
+
"type": "\"sm\" | \"md\"",
|
|
118
|
+
"default": "md",
|
|
119
|
+
"description": "sm · md (inside `Chip.Group`, the group's size by default).",
|
|
120
|
+
"required": false
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "value",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"default": null,
|
|
126
|
+
"description": "Inside `Chip.Group`: the value this chip stands for (required there, ignored alone).",
|
|
127
|
+
"required": false
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"component": "ChipGroup",
|
|
133
|
+
"description": "Chips that choose together: `type` single · multiple, `value`/`defaultValue` + `onValueChange`.",
|
|
134
|
+
"props": [
|
|
135
|
+
{
|
|
136
|
+
"name": "type",
|
|
137
|
+
"type": "\"single\" | \"multiple\"",
|
|
138
|
+
"default": null,
|
|
139
|
+
"description": "One choice: the chips behave as radios.\nAny number of choices: the chips are pressed buttons.",
|
|
140
|
+
"required": true
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "defaultValue",
|
|
144
|
+
"type": "string | string[]",
|
|
145
|
+
"default": null,
|
|
146
|
+
"description": "The value chosen at first, uncontrolled.\nThe values chosen at first, uncontrolled.",
|
|
147
|
+
"required": false
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "disabled",
|
|
151
|
+
"type": "boolean",
|
|
152
|
+
"default": null,
|
|
153
|
+
"description": "Disables every chip of the group.",
|
|
154
|
+
"required": false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "label",
|
|
158
|
+
"type": "string",
|
|
159
|
+
"default": null,
|
|
160
|
+
"description": "The group's accessible name — passed translated (\"Filter by format\").",
|
|
161
|
+
"required": false
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "loop",
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"default": null,
|
|
167
|
+
"description": "Arrow keys wrap from the last chip to the first (default `true`).",
|
|
168
|
+
"required": false
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "onValueChange",
|
|
172
|
+
"type": "((value: string) => void) | ((value: string[]) => void)",
|
|
173
|
+
"default": null,
|
|
174
|
+
"description": "Called with the new value on every choice.\nCalled with the new values on every press.",
|
|
175
|
+
"required": false
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "orientation",
|
|
179
|
+
"type": "\"horizontal\" | \"vertical\"",
|
|
180
|
+
"default": null,
|
|
181
|
+
"description": "The arrow keys that move: left / right (horizontal, a row) or up / down (vertical, a column).",
|
|
182
|
+
"required": false
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "required",
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"default": null,
|
|
188
|
+
"description": "Keeps one chip selected: pressing the selected chip does not clear it (default `false`).",
|
|
189
|
+
"required": false
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "size",
|
|
193
|
+
"type": "\"sm\" | \"md\"",
|
|
194
|
+
"default": "md",
|
|
195
|
+
"description": "sm · md: the size of every chip of the group.",
|
|
196
|
+
"required": false
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "value",
|
|
200
|
+
"type": "string | string[]",
|
|
201
|
+
"default": null,
|
|
202
|
+
"description": "The chosen value (controlled), `\"\"` when none.\nThe chosen values (controlled).",
|
|
203
|
+
"required": false
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"examples": [
|
|
209
|
+
{
|
|
210
|
+
"name": "toggle",
|
|
211
|
+
"title": "Toggle",
|
|
212
|
+
"description": "Alone, off and on: a pressed button.",
|
|
213
|
+
"path": "examples/chip/toggle.tsx",
|
|
214
|
+
"module": "@krizaka/ui/registry/examples/chip/toggle",
|
|
215
|
+
"code": "import { Chip } from \"@krizaka/ui/chip\";\n\n// Alone, a chip is a pressed button: `selected` / `onSelectedChange`, or `defaultSelected`.\nexport default function ChipToggle() {\n return (\n <div className=\"flex gap-2\">\n <Chip>Subtitles</Chip>\n <Chip defaultSelected>HD</Chip>\n <Chip disabled>4K</Chip>\n </div>\n );\n}\n"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "single",
|
|
219
|
+
"title": "Single choice",
|
|
220
|
+
"description": "One choice in a group: a filter; `required` keeps one chosen.",
|
|
221
|
+
"path": "examples/chip/single.tsx",
|
|
222
|
+
"module": "@krizaka/ui/registry/examples/chip/single",
|
|
223
|
+
"code": "import { Chip } from \"@krizaka/ui/chip\";\n\n// One choice: a filter. `required` keeps one chosen.\nexport default function ChipSingle() {\n return (\n <Chip.Group type=\"single\" label=\"Format\" defaultValue=\"all\" required>\n <Chip value=\"all\">All</Chip>\n <Chip value=\"videos\">Videos</Chip>\n <Chip value=\"stories\">Stories</Chip>\n <Chip value=\"collections\">Collections</Chip>\n </Chip.Group>\n );\n}\n"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "multiple",
|
|
227
|
+
"title": "Multiple choice",
|
|
228
|
+
"description": "Several choices: tags.",
|
|
229
|
+
"path": "examples/chip/multiple.tsx",
|
|
230
|
+
"module": "@krizaka/ui/registry/examples/chip/multiple",
|
|
231
|
+
"code": "import { Chip } from \"@krizaka/ui/chip\";\n\nexport default function ChipMultiple() {\n return (\n <Chip.Group type=\"multiple\" label=\"Tags\" defaultValue={[\"night\", \"rain\"]}>\n <Chip value=\"night\">#night</Chip>\n <Chip value=\"city\">#city</Chip>\n <Chip value=\"rain\">#rain</Chip>\n <Chip value=\"neon\">#neon</Chip>\n </Chip.Group>\n );\n}\n"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "small",
|
|
235
|
+
"title": "Small",
|
|
236
|
+
"description": "`size=\"sm\"` for dense toolbars.",
|
|
237
|
+
"path": "examples/chip/small.tsx",
|
|
238
|
+
"module": "@krizaka/ui/registry/examples/chip/small",
|
|
239
|
+
"code": "import { Chip } from \"@krizaka/ui/chip\";\n\nexport default function ChipSmall() {\n return (\n <Chip.Group type=\"single\" label=\"Speed\" size=\"sm\" defaultValue=\"1\">\n <Chip value=\"0.5\">0.5×</Chip>\n <Chip value=\"1\">1×</Chip>\n <Chip value=\"1.5\">1.5×</Chip>\n <Chip value=\"2\">2×</Chip>\n </Chip.Group>\n );\n}\n"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "removable",
|
|
243
|
+
"title": "Removable",
|
|
244
|
+
"description": "Chosen tags, each with a named remove button.",
|
|
245
|
+
"path": "examples/chip/removable.tsx",
|
|
246
|
+
"module": "@krizaka/ui/registry/examples/chip/removable",
|
|
247
|
+
"code": "import { Chip } from \"@krizaka/ui/chip\";\n\n// Chosen tags, each with a named remove button.\nexport default function ChipRemovable() {\n return (\n <div className=\"flex flex-wrap gap-2\">\n <Chip removable removeLabel=\"Remove #night\" onRemove={() => {}}>\n #night\n </Chip>\n <Chip removable removeLabel=\"Remove #city\" onRemove={() => {}}>\n #city\n </Chip>\n </div>\n );\n}\n"
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
"native": {
|
|
252
|
+
"entry": "@krizaka/ui/native",
|
|
253
|
+
"import": "import { Chip } from \"@krizaka/ui/native\";",
|
|
254
|
+
"differences": [
|
|
255
|
+
"The group's name is `aria-label` (not `label`).",
|
|
256
|
+
"`scrollable` makes the group one horizontal row: a filter bar.",
|
|
257
|
+
"`onPress` semantics: a chip alone is a checkbox, in a single group a radio."
|
|
258
|
+
],
|
|
259
|
+
"props": [
|
|
260
|
+
{
|
|
261
|
+
"component": "Chip",
|
|
262
|
+
"description": "`Chip` and `Chip.Group`.",
|
|
263
|
+
"props": [
|
|
264
|
+
{
|
|
265
|
+
"name": "children",
|
|
266
|
+
"type": "ReactNode",
|
|
267
|
+
"default": null,
|
|
268
|
+
"description": "The text (passed translated) or a node (an icon and a text).",
|
|
269
|
+
"required": true
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "onRemove",
|
|
273
|
+
"type": "() => void",
|
|
274
|
+
"default": null,
|
|
275
|
+
"description": "Called when its remove button is pressed.",
|
|
276
|
+
"required": true
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "removeLabel",
|
|
280
|
+
"type": "string",
|
|
281
|
+
"default": null,
|
|
282
|
+
"description": "The accessible name of the remove button — passed translated, e.g. \"Remove #night\".",
|
|
283
|
+
"required": true
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "defaultSelected",
|
|
287
|
+
"type": "boolean",
|
|
288
|
+
"default": null,
|
|
289
|
+
"description": "Uncontrolled: selected at first (alone, outside a group).",
|
|
290
|
+
"required": false
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "onSelectedChange",
|
|
294
|
+
"type": "((selected: boolean) => void)",
|
|
295
|
+
"default": null,
|
|
296
|
+
"description": "Alone: called with the new state when it is pressed.",
|
|
297
|
+
"required": false
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "removable",
|
|
301
|
+
"type": "boolean",
|
|
302
|
+
"default": null,
|
|
303
|
+
"description": "A static chip (a chosen tag, an applied filter) with a remove button.",
|
|
304
|
+
"required": false
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "selected",
|
|
308
|
+
"type": "boolean",
|
|
309
|
+
"default": null,
|
|
310
|
+
"description": "Alone: pressed or not (`defaultSelected` uncontrolled), `onSelectedChange` on every press.",
|
|
311
|
+
"required": false
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"name": "size",
|
|
315
|
+
"type": "ChipSize",
|
|
316
|
+
"default": null,
|
|
317
|
+
"description": "sm · md (default); in a group, the group's size.",
|
|
318
|
+
"required": false
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "style",
|
|
322
|
+
"type": "StyleProp<ViewStyle>",
|
|
323
|
+
"default": null,
|
|
324
|
+
"description": "Styles merged last.",
|
|
325
|
+
"required": false
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "value",
|
|
329
|
+
"type": "string",
|
|
330
|
+
"default": null,
|
|
331
|
+
"description": "Inside `Chip.Group`: the value this chip stands for (required there, ignored alone).",
|
|
332
|
+
"required": false
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"examples": [
|
|
338
|
+
{
|
|
339
|
+
"name": "toggle",
|
|
340
|
+
"title": "Toggle",
|
|
341
|
+
"description": "Off and on; `sm` and `md`; disabled.",
|
|
342
|
+
"path": "examples/chip/native/toggle.tsx",
|
|
343
|
+
"module": "@krizaka/ui/registry/examples/chip/native/toggle",
|
|
344
|
+
"code": "import { Chip } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// Alone, a chip is a checkbox: `selected` / `onSelectedChange`, or `defaultSelected`.\nexport default function NativeChipToggle() {\n return (\n <View style={{ flexDirection: \"row\", gap: 8, alignItems: \"center\" }}>\n <Chip>Night</Chip>\n <Chip defaultSelected>Live</Chip>\n <Chip size=\"sm\" defaultSelected>\n Small\n </Chip>\n <Chip disabled>Disabled</Chip>\n </View>\n );\n}\n",
|
|
345
|
+
"screenshots": {
|
|
346
|
+
"dark": "examples/chip/native/toggle.dark.png",
|
|
347
|
+
"light": "examples/chip/native/toggle.light.png"
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"name": "single",
|
|
352
|
+
"title": "Single choice",
|
|
353
|
+
"description": "`Chip.Group type=\"single\"`: one value.",
|
|
354
|
+
"path": "examples/chip/native/single.tsx",
|
|
355
|
+
"module": "@krizaka/ui/registry/examples/chip/native/single",
|
|
356
|
+
"code": "import { Chip } from \"@krizaka/ui/native\";\n\nexport default function NativeChipSingle() {\n return (\n <Chip.Group type=\"single\" defaultValue=\"all\" aria-label=\"Filter\">\n <Chip value=\"all\">All</Chip>\n <Chip value=\"live\">Live</Chip>\n <Chip value=\"ending\">Ending soon</Chip>\n </Chip.Group>\n );\n}\n",
|
|
357
|
+
"screenshots": {
|
|
358
|
+
"dark": "examples/chip/native/single.dark.png",
|
|
359
|
+
"light": "examples/chip/native/single.light.png"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "multiple",
|
|
364
|
+
"title": "Filter bar",
|
|
365
|
+
"description": "`type=\"multiple\" scrollable`: one horizontal row.",
|
|
366
|
+
"path": "examples/chip/native/multiple.tsx",
|
|
367
|
+
"module": "@krizaka/ui/registry/examples/chip/native/multiple",
|
|
368
|
+
"code": "import { Chip } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// `scrollable`: one horizontal row, a filter bar.\nexport default function NativeChipMultiple() {\n return (\n <View style={{ width: 320 }}>\n <Chip.Group type=\"multiple\" defaultValue={[\"house\", \"techno\"]} aria-label=\"Genres\" scrollable>\n <Chip value=\"house\">House</Chip>\n <Chip value=\"techno\">Techno</Chip>\n <Chip value=\"ambient\">Ambient</Chip>\n <Chip value=\"jazz\">Jazz</Chip>\n <Chip value=\"soul\">Soul</Chip>\n </Chip.Group>\n </View>\n );\n}\n",
|
|
369
|
+
"screenshots": {
|
|
370
|
+
"dark": "examples/chip/native/multiple.dark.png",
|
|
371
|
+
"light": "examples/chip/native/multiple.light.png"
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "removable",
|
|
376
|
+
"title": "Removable",
|
|
377
|
+
"description": "A chosen tag with its own named remove button.",
|
|
378
|
+
"path": "examples/chip/native/removable.tsx",
|
|
379
|
+
"module": "@krizaka/ui/registry/examples/chip/native/removable",
|
|
380
|
+
"code": "import { Chip } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\nexport default function NativeChipRemovable() {\n return (\n <View style={{ flexDirection: \"row\", gap: 8 }}>\n <Chip removable removeLabel=\"Remove #night\" onRemove={() => {}}>\n #night\n </Chip>\n <Chip removable removeLabel=\"Remove #live\" onRemove={() => {}}>\n #live\n </Chip>\n </View>\n );\n}\n",
|
|
381
|
+
"screenshots": {
|
|
382
|
+
"dark": "examples/chip/native/removable.dark.png",
|
|
383
|
+
"light": "examples/chip/native/removable.light.png"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
},
|
|
5
388
|
"files": [
|
|
6
389
|
{
|
|
7
390
|
"path": "chip/chip.tsx",
|
|
@@ -10,6 +393,14 @@
|
|
|
10
393
|
{
|
|
11
394
|
"path": "chip/index.ts",
|
|
12
395
|
"content": "/** @krizaka/ui/chip — `Chip` (selectable, removable), `Chip.Group` (single · multiple), `chip` (the slots). Client (\"use client\"). */\nexport { Chip, chip, ChipGroup, type ChipGroupProps, type ChipProps, type ChipVariants } from \"./chip\";\n"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"path": "chip/meta.ts",
|
|
399
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Chip\",\n summary: \"A selectable pill: alone a toggle, in a group a single or multiple choice, or a removable tag.\",\n status: \"beta\",\n category: \"forms\",\n platforms: \"both\",\n whenToUse: [\n \"To filter a list with a few short options shown at once: format, genre, speed.\",\n \"`Chip.Group type=\\\"multiple\\\"` for several tags; `type=\\\"single\\\"` (with `required`) for one filter.\",\n \"`removable` for the values already chosen: tags, recipients, active filters.\",\n ],\n whenNotToUse: [\n { when: \"To switch between views of the same page.\", use: \"tabs\" },\n { when: \"To choose in a form that is submitted, with labels that read as sentences.\", use: \"radio-group\" },\n { when: \"For a status that cannot be changed.\", use: \"badge\" },\n { when: \"To run an action.\", use: \"button\" },\n ],\n bestPractices: [\n \"One or two words per chip; the group's `label` says what is being chosen.\",\n \"Keep the order stable when a chip is selected: do not move it to the front.\",\n \"Give each removable chip a `removeLabel` that names it: “Remove #night”, not “Remove”.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Tab\", action: \"Moves into the group (one tab stop) and out of it.\" },\n { keys: \"Arrow keys\", action: \"Move between the chips of a group.\" },\n { keys: \"Space / Enter\", action: \"Toggles the focused chip.\" },\n ],\n notes: [\n \"Radix Toggle and ToggleGroup: alone `aria-pressed`; in a single group a radio (`aria-checked`), in a multiple group pressed buttons.\",\n \"`Chip.Group` takes `label` as the group's accessible name.\",\n \"The remove button is a separate button named by `removeLabel`.\",\n ],\n },\n related: [\"tabs\", \"radio-group\", \"checkbox\", \"badge\"],\n web: {\n imports: [\"Chip\"],\n examples: [\n { name: \"toggle\", title: \"Toggle\", description: \"Alone, off and on: a pressed button.\" },\n { name: \"single\", title: \"Single choice\", description: \"One choice in a group: a filter; `required` keeps one chosen.\" },\n { name: \"multiple\", title: \"Multiple choice\", description: \"Several choices: tags.\" },\n { name: \"small\", title: \"Small\", description: \"`size=\\\"sm\\\"` for dense toolbars.\" },\n { name: \"removable\", title: \"Removable\", description: \"Chosen tags, each with a named remove button.\" },\n ],\n },\n native: {\n imports: [\"Chip\"],\n differences: [\n \"The group's name is `aria-label` (not `label`).\",\n \"`scrollable` makes the group one horizontal row: a filter bar.\",\n \"`onPress` semantics: a chip alone is a checkbox, in a single group a radio.\",\n ],\n examples: [\n { name: \"toggle\", title: \"Toggle\", description: \"Off and on; `sm` and `md`; disabled.\" },\n { name: \"single\", title: \"Single choice\", description: \"`Chip.Group type=\\\"single\\\"`: one value.\" },\n { name: \"multiple\", title: \"Filter bar\", description: \"`type=\\\"multiple\\\" scrollable`: one horizontal row.\" },\n { name: \"removable\", title: \"Removable\", description: \"A chosen tag with its own named remove button.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"path": "meta.ts",
|
|
403
|
+
"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
404
|
}
|
|
14
405
|
],
|
|
15
406
|
"dependencies": [
|
|
@@ -18,8 +409,8 @@
|
|
|
18
409
|
],
|
|
19
410
|
"registryDependencies": [],
|
|
20
411
|
"demo": {
|
|
21
|
-
"path": "
|
|
22
|
-
"content": "import { Chip } from \"@krizaka/ui/chip\";\n\nexport default function
|
|
412
|
+
"path": "examples/chip/toggle.tsx",
|
|
413
|
+
"content": "import { Chip } from \"@krizaka/ui/chip\";\n\n// Alone, a chip is a pressed button: `selected` / `onSelectedChange`, or `defaultSelected`.\nexport default function ChipToggle() {\n return (\n <div className=\"flex gap-2\">\n <Chip>Subtitles</Chip>\n <Chip defaultSelected>HD</Chip>\n <Chip disabled>4K</Chip>\n </div>\n );\n}\n"
|
|
23
414
|
},
|
|
24
415
|
"props": [
|
|
25
416
|
{
|