@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/toast.json
CHANGED
|
@@ -1,12 +1,199 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toast",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Toast",
|
|
5
|
+
"summary": "A short message that comes and goes: `toast()` from anywhere, one `Toaster` per app.",
|
|
6
|
+
"description": "A short message that comes and goes: `toast()` from anywhere, one `Toaster` per app.",
|
|
7
|
+
"status": "stable",
|
|
8
|
+
"category": "feedback",
|
|
9
|
+
"platforms": "both",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"To confirm the result of an action: saved, sent, payment received.",
|
|
12
|
+
"For an event the user did not trigger but should know: a new follower, a live auction.",
|
|
13
|
+
"With an action (“Retry”, “Undo”) when there is one obvious next step."
|
|
14
|
+
],
|
|
15
|
+
"whenNotToUse": [
|
|
16
|
+
{
|
|
17
|
+
"when": "For a message that must stay until the situation changes.",
|
|
18
|
+
"use": "alert"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"when": "When the user must answer.",
|
|
22
|
+
"use": "dialog"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"when": "To report a form's errors: show them next to the fields.",
|
|
26
|
+
"use": "field"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"bestPractices": [
|
|
30
|
+
"Mount one `Toaster` in the root layout, with its `label` and `closeLabel` translated.",
|
|
31
|
+
"A title in a few words, a description only if it adds something.",
|
|
32
|
+
"Never put the only way to do something in a toast: it goes away."
|
|
33
|
+
],
|
|
34
|
+
"accessibility": {
|
|
35
|
+
"keyboard": [
|
|
36
|
+
{
|
|
37
|
+
"keys": "F8",
|
|
38
|
+
"action": "Moves the focus to the toasts region (sonner's hotkey)."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"keys": "Tab / Enter",
|
|
42
|
+
"action": "Reach and press a toast's action or close button."
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"notes": [
|
|
46
|
+
"The region is a landmark named by `label`; toasts are announced politely.",
|
|
47
|
+
"Toasts pause while hovered or focused."
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"related": [
|
|
51
|
+
"alert",
|
|
52
|
+
"dialog",
|
|
53
|
+
"confirm-button"
|
|
54
|
+
],
|
|
55
|
+
"web": {
|
|
56
|
+
"entry": "@krizaka/ui/toast",
|
|
57
|
+
"import": "import { toast, Toaster } from \"@krizaka/ui/toast\";",
|
|
58
|
+
"props": [
|
|
59
|
+
{
|
|
60
|
+
"component": "Toaster",
|
|
61
|
+
"description": "Mount once, in the root layout. Then call `toast()`, `toast.success/warning/error/info`, `toast.custom(…)`.",
|
|
62
|
+
"props": [
|
|
63
|
+
{
|
|
64
|
+
"name": "closeLabel",
|
|
65
|
+
"type": "string",
|
|
66
|
+
"default": null,
|
|
67
|
+
"description": "The accessible name of each toast's close button — passed translated.",
|
|
68
|
+
"required": true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "label",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"default": null,
|
|
74
|
+
"description": "The accessible name of the notifications region (sonner's `containerAriaLabel`) — passed translated.",
|
|
75
|
+
"required": true
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "toastOptions",
|
|
79
|
+
"type": "Omit<ToastOptions, \"unstyled\" | \"closeButtonAriaLabel\">",
|
|
80
|
+
"default": null,
|
|
81
|
+
"description": "Extra options for every toast (duration, a className); the class names are merged with the platform's.",
|
|
82
|
+
"required": false
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"examples": [
|
|
88
|
+
{
|
|
89
|
+
"name": "tones",
|
|
90
|
+
"title": "Tones",
|
|
91
|
+
"description": "Default, success, warning and error with an action.",
|
|
92
|
+
"path": "examples/toast/tones.tsx",
|
|
93
|
+
"module": "@krizaka/ui/registry/examples/toast/tones",
|
|
94
|
+
"code": "\"use client\";\n\nimport { Button } from \"@krizaka/ui/button\";\nimport { toast, Toaster } from \"@krizaka/ui/toast\";\nimport { useEffect } from \"react\";\n\n// Each toaster has its own `id`: the toasts of this demo stay in this demo's toaster.\nconst toasterId = \"tones\";\nconst show = () => {\n toast(\"Draft saved\", { toasterId, description: \"Autosaved a moment ago.\" });\n toast.success(\"Payment received\", { toasterId, description: \"€12.00 from @maya.\" });\n toast.warning(\"Your balance is low\", { toasterId, description: \"Two tips left before a top-up.\" });\n toast.error(\"Upload failed\", { toasterId, description: \"The connection dropped at 64 %.\", action: { label: \"Retry\", onClick: () => {} } });\n};\n\n/** `defaultOpen`: the toasts show at once and stay (the screenshot); otherwise the button shows them. */\nexport default function ToastTones({ defaultOpen = false }: { defaultOpen?: boolean }) {\n useEffect(() => {\n if (!defaultOpen) return;\n toast.dismiss();\n show();\n }, [defaultOpen]);\n return (\n <>\n <Toaster id={toasterId} label=\"Notifications\" closeLabel=\"Dismiss\" position=\"bottom-right\" expand visibleToasts={4} duration={defaultOpen ? Number.POSITIVE_INFINITY : undefined} />\n <Button variant=\"outline\" onClick={show}>\n Show again\n </Button>\n </>\n );\n}\n"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "custom",
|
|
98
|
+
"title": "Custom",
|
|
99
|
+
"description": "`toast.custom`: your JSX in the platform's shell.",
|
|
100
|
+
"path": "examples/toast/custom.tsx",
|
|
101
|
+
"module": "@krizaka/ui/registry/examples/toast/custom",
|
|
102
|
+
"code": "\"use client\";\n\nimport { Avatar } from \"@krizaka/ui/avatar\";\nimport { Button } from \"@krizaka/ui/button\";\nimport { toast, Toaster } from \"@krizaka/ui/toast\";\nimport { useEffect } from \"react\";\n\n// `toast.custom`: your JSX in the platform's shell — a live notification. One `Toaster` per app, in the root layout.\nconst show = () =>\n toast.custom(\n () => (\n <div className=\"flex items-center gap-3\">\n <Avatar fallback=\"MA\" size=\"sm\" />\n <div className=\"flex flex-col\">\n <span className=\"text-sm font-semibold text-fg\">Maya started following you</span>\n <span className=\"text-xs font-normal text-fg-secondary\">Just now</span>\n </div>\n </div>\n ),\n { toasterId: \"custom\" },\n );\n\nexport default function ToastCustom({ defaultOpen = false }: { defaultOpen?: boolean }) {\n useEffect(() => {\n if (defaultOpen) show();\n }, [defaultOpen]);\n return (\n <>\n <Toaster id=\"custom\" label=\"Notifications\" closeLabel=\"Dismiss\" position=\"bottom-right\" duration={defaultOpen ? Number.POSITIVE_INFINITY : undefined} />\n <Button variant=\"outline\" onClick={show}>\n Show a notification\n </Button>\n </>\n );\n}\n"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"native": {
|
|
107
|
+
"entry": "@krizaka/ui/native",
|
|
108
|
+
"import": "import { toast, Toaster } from \"@krizaka/ui/native\";",
|
|
109
|
+
"differences": [
|
|
110
|
+
"`Toaster` takes `offset` (the safe-area inset) instead of a position; mount it inside `ThemeProvider`.",
|
|
111
|
+
"Actions take `onPress`; a toast takes `onPress` to open what it is about.",
|
|
112
|
+
"No `toast.custom`: an `icon` before the text instead."
|
|
113
|
+
],
|
|
114
|
+
"props": [
|
|
115
|
+
{
|
|
116
|
+
"component": "Toaster",
|
|
117
|
+
"description": "Mount once, at the root (inside `ThemeProvider`). Then call `toast()` from anywhere.",
|
|
118
|
+
"props": [
|
|
119
|
+
{
|
|
120
|
+
"name": "closeLabel",
|
|
121
|
+
"type": "string",
|
|
122
|
+
"default": null,
|
|
123
|
+
"description": "The accessible name of each toast's close button — passed translated.",
|
|
124
|
+
"required": true
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "duration",
|
|
128
|
+
"type": "number",
|
|
129
|
+
"default": "6000",
|
|
130
|
+
"description": "Default milliseconds on screen.",
|
|
131
|
+
"required": false
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "max",
|
|
135
|
+
"type": "number",
|
|
136
|
+
"default": "3",
|
|
137
|
+
"description": "At most this many on screen; the oldest leave first.",
|
|
138
|
+
"required": false
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "offset",
|
|
142
|
+
"type": "number",
|
|
143
|
+
"default": "12",
|
|
144
|
+
"description": "Distance from the edge, e.g. the safe-area inset + a margin (no safe-area dependency here).",
|
|
145
|
+
"required": false
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "position",
|
|
149
|
+
"type": "\"top\" | \"bottom\"",
|
|
150
|
+
"default": "top",
|
|
151
|
+
"description": "Where the toasts stack: `top` (default) or `bottom`.",
|
|
152
|
+
"required": false
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"examples": [
|
|
158
|
+
{
|
|
159
|
+
"name": "tones",
|
|
160
|
+
"title": "Tones",
|
|
161
|
+
"description": "Default, success, and error with an action.",
|
|
162
|
+
"path": "examples/toast/native/tones.tsx",
|
|
163
|
+
"module": "@krizaka/ui/registry/examples/toast/native/tones",
|
|
164
|
+
"code": "import { Button, toast, Toaster } from \"@krizaka/ui/native\";\nimport { useEffect } from \"react\";\nimport { View } from \"react-native\";\n\nconst show = () => {\n toast(\"Draft saved\", { description: \"Autosaved a moment ago.\" });\n toast.success(\"Payment received\", { description: \"€12.00 from @maya.\" });\n toast.error(\"Upload failed\", { description: \"The connection dropped at 64 %.\", action: { label: \"Retry\", onPress: () => {} } });\n};\n\n// One `Toaster` at the root of the app (`offset` = the safe-area inset); `toast()` from anywhere.\nexport default function NativeToastTones({ defaultOpen = false }: { defaultOpen?: boolean }) {\n useEffect(() => {\n if (!defaultOpen) return;\n toast.dismiss();\n show();\n return () => toast.dismiss();\n }, [defaultOpen]);\n return (\n <View style={{ width: 360, height: 260, justifyContent: \"flex-end\" }}>\n <Button variant=\"outline\" label=\"Show the toasts\" onPress={show} />\n <Toaster closeLabel=\"Dismiss\" duration={defaultOpen ? Number.POSITIVE_INFINITY : undefined} />\n </View>\n );\n}\n",
|
|
165
|
+
"screenshots": {
|
|
166
|
+
"dark": "examples/toast/native/tones.dark.png",
|
|
167
|
+
"light": "examples/toast/native/tones.light.png"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "notification",
|
|
172
|
+
"title": "Notification",
|
|
173
|
+
"description": "An icon, tap to open it; `id` shows it once.",
|
|
174
|
+
"path": "examples/toast/native/notification.tsx",
|
|
175
|
+
"module": "@krizaka/ui/registry/examples/toast/native/notification",
|
|
176
|
+
"code": "import { Button, toast, Toaster, useTheme } from \"@krizaka/ui/native\";\nimport { useEffect } from \"react\";\nimport { View } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nfunction BellIcon({ color }: { color: string }) {\n return (\n <Svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\" stroke={color} strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <Path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.94 1.94 0 0 0 3.4 0\" />\n </Svg>\n );\n}\n\n// `id` replaces a toast already shown (a notification shown once); `onPress` opens what it is about.\nexport default function NativeToastNotification({ defaultOpen = false }: { defaultOpen?: boolean }) {\n const { theme } = useTheme();\n const show = () => toast(\"@maya started a live auction\", { id: \"n-42\", icon: <BellIcon color={theme.textPrimary} />, onPress: () => {} });\n useEffect(() => {\n if (!defaultOpen) return;\n toast.dismiss();\n show();\n return () => toast.dismiss();\n }, [defaultOpen]); // eslint-disable-line react-hooks/exhaustive-deps -- shown once, at load\n return (\n <View style={{ width: 360, height: 260, justifyContent: \"flex-end\" }}>\n <Button variant=\"outline\" label=\"Show a notification\" onPress={show} />\n <Toaster closeLabel=\"Dismiss\" duration={defaultOpen ? Number.POSITIVE_INFINITY : undefined} />\n </View>\n );\n}\n",
|
|
177
|
+
"screenshots": {
|
|
178
|
+
"dark": "examples/toast/native/notification.dark.png",
|
|
179
|
+
"light": "examples/toast/native/notification.light.png"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
5
184
|
"files": [
|
|
185
|
+
{
|
|
186
|
+
"path": "meta.ts",
|
|
187
|
+
"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"
|
|
188
|
+
},
|
|
6
189
|
{
|
|
7
190
|
"path": "toast/index.ts",
|
|
8
191
|
"content": "/** @krizaka/ui/toast — `Toaster` (sonner, styled by roles), `toast`. Client (\"use client\"). */\nexport { type ExternalToast, toast, toastClassNames, Toaster, type ToasterProps } from \"./toast\";\n"
|
|
9
192
|
},
|
|
193
|
+
{
|
|
194
|
+
"path": "toast/meta.ts",
|
|
195
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Toast\",\n summary: \"A short message that comes and goes: `toast()` from anywhere, one `Toaster` per app.\",\n status: \"stable\",\n category: \"feedback\",\n platforms: \"both\",\n whenToUse: [\n \"To confirm the result of an action: saved, sent, payment received.\",\n \"For an event the user did not trigger but should know: a new follower, a live auction.\",\n \"With an action (“Retry”, “Undo”) when there is one obvious next step.\",\n ],\n whenNotToUse: [\n { when: \"For a message that must stay until the situation changes.\", use: \"alert\" },\n { when: \"When the user must answer.\", use: \"dialog\" },\n { when: \"To report a form's errors: show them next to the fields.\", use: \"field\" },\n ],\n bestPractices: [\n \"Mount one `Toaster` in the root layout, with its `label` and `closeLabel` translated.\",\n \"A title in a few words, a description only if it adds something.\",\n \"Never put the only way to do something in a toast: it goes away.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"F8\", action: \"Moves the focus to the toasts region (sonner's hotkey).\" },\n { keys: \"Tab / Enter\", action: \"Reach and press a toast's action or close button.\" },\n ],\n notes: [\"The region is a landmark named by `label`; toasts are announced politely.\", \"Toasts pause while hovered or focused.\"],\n },\n related: [\"alert\", \"dialog\", \"confirm-button\"],\n web: {\n imports: [\"toast\", \"Toaster\"],\n examples: [\n { name: \"tones\", title: \"Tones\", description: \"Default, success, warning and error with an action.\" },\n { name: \"custom\", title: \"Custom\", description: \"`toast.custom`: your JSX in the platform's shell.\" },\n ],\n },\n native: {\n imports: [\"toast\", \"Toaster\"],\n differences: [\n \"`Toaster` takes `offset` (the safe-area inset) instead of a position; mount it inside `ThemeProvider`.\",\n \"Actions take `onPress`; a toast takes `onPress` to open what it is about.\",\n \"No `toast.custom`: an `icon` before the text instead.\",\n ],\n examples: [\n { name: \"tones\", title: \"Tones\", description: \"Default, success, and error with an action.\" },\n { name: \"notification\", title: \"Notification\", description: \"An icon, tap to open it; `id` shows it once.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
196
|
+
},
|
|
10
197
|
{
|
|
11
198
|
"path": "toast/toast.tsx",
|
|
12
199
|
"content": "// Client. sonner does the queue, the stacking, the swipe, the timers, the live region and the hotkey; the look is\n// ours: sonner's own styling is off (`unstyled`) and every part reads a role. The status tones are soft (a tinted\n// border and a coloured icon, the text stays `text-fg`): the invariant status tokens are too light for small text.\nimport { Toaster as Sonner, type ToasterProps as SonnerProps } from \"sonner\";\n\nimport { cn } from \"../cn\";\n\nexport type { ExternalToast } from \"sonner\";\nexport { toast } from \"sonner\";\n\nconst tone = (color: string) => cn(\"border-l-4\", color);\n\nexport const toastClassNames = {\n toast:\n \"group pointer-events-auto relative flex w-full items-start gap-3 rounded-xl border border-border-default bg-surface-2 p-4 pr-10 \" +\n \"text-sm text-fg shadow-lg\",\n default: \"\",\n title: \"font-semibold text-fg\",\n description: \"mt-0.5 text-xs text-fg-secondary\",\n content: \"flex min-w-0 flex-1 flex-col\",\n icon: \"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center [&>svg]:h-4 [&>svg]:w-4\",\n success: tone(\"border-l-success [&_[data-icon]]:text-success\"),\n warning: tone(\"border-l-warning [&_[data-icon]]:text-warning\"),\n error: tone(\"border-l-danger [&_[data-icon]]:text-danger\"),\n info: tone(\"border-l-info [&_[data-icon]]:text-info\"),\n loading: \"\",\n actionButton:\n \"ml-auto shrink-0 self-center rounded-lg bg-accent px-3 py-1.5 text-xs font-semibold text-on-accent hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n cancelButton:\n \"shrink-0 self-center rounded-lg px-3 py-1.5 text-xs font-semibold text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n closeButton:\n \"absolute right-2 top-2 flex h-7 w-7 items-center justify-center rounded-full text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&>svg]:h-3.5 [&>svg]:w-3.5\",\n} satisfies NonNullable<NonNullable<SonnerProps[\"toastOptions\"]>[\"classNames\"]>;\n\nexport type ToasterProps = Omit<SonnerProps, \"richColors\" | \"theme\" | \"containerAriaLabel\" | \"toastOptions\"> & {\n /** The accessible name of the notifications region (sonner's `containerAriaLabel`) — passed translated. */\n label: string;\n /** The accessible name of each toast's close button — passed translated. */\n closeLabel: string;\n /** Extra options for every toast (duration, a className); the class names are merged with the platform's. */\n toastOptions?: Omit<NonNullable<SonnerProps[\"toastOptions\"]>, \"unstyled\" | \"closeButtonAriaLabel\">;\n};\n\n/** Mount once, in the root layout. Then call `toast()`, `toast.success/warning/error/info`, `toast.custom(…)`. */\nexport function Toaster({ label, closeLabel, position = \"bottom-right\", closeButton = true, toastOptions, ...props }: ToasterProps) {\n const extra = toastOptions?.classNames ?? {};\n const classNames = Object.fromEntries(\n Object.entries(toastClassNames).map(([key, value]) => [key, cn(value, extra[key as keyof typeof extra])]),\n ) as typeof toastClassNames;\n return (\n <Sonner\n position={position}\n closeButton={closeButton}\n containerAriaLabel={label}\n richColors={false}\n toastOptions={{ ...toastOptions, unstyled: true, closeButtonAriaLabel: closeLabel, classNames }}\n {...props}\n />\n );\n}\n"
|
|
@@ -19,8 +206,8 @@
|
|
|
19
206
|
"cn"
|
|
20
207
|
],
|
|
21
208
|
"demo": {
|
|
22
|
-
"path": "
|
|
23
|
-
"content": "\"use client\";\n\nimport { Button } from \"@krizaka/ui/button\";\nimport { toast, Toaster } from \"@krizaka/ui/toast\";\nimport { useEffect } from \"react\";\n\n// Each toaster has its own `id`: the toasts of this demo stay in this demo's toaster.\nconst toasterId = \"tones\";\nconst show = () => {\n toast(\"Draft saved\", { toasterId, description: \"Autosaved a moment ago.\" });\n toast.success(\"Payment received\", { toasterId, description: \"€12.00 from @maya.\" });\n toast.warning(\"Your balance is low\", { toasterId, description: \"Two tips left before a top-up.\" });\n toast.error(\"Upload failed\", { toasterId, description: \"The connection dropped at 64 %.\", action: { label: \"Retry\", onClick: () => {} } });\n};\n\n/** `defaultOpen`: the toasts show at once and stay (the screenshot); otherwise the button shows them. */\nexport default function
|
|
209
|
+
"path": "examples/toast/tones.tsx",
|
|
210
|
+
"content": "\"use client\";\n\nimport { Button } from \"@krizaka/ui/button\";\nimport { toast, Toaster } from \"@krizaka/ui/toast\";\nimport { useEffect } from \"react\";\n\n// Each toaster has its own `id`: the toasts of this demo stay in this demo's toaster.\nconst toasterId = \"tones\";\nconst show = () => {\n toast(\"Draft saved\", { toasterId, description: \"Autosaved a moment ago.\" });\n toast.success(\"Payment received\", { toasterId, description: \"€12.00 from @maya.\" });\n toast.warning(\"Your balance is low\", { toasterId, description: \"Two tips left before a top-up.\" });\n toast.error(\"Upload failed\", { toasterId, description: \"The connection dropped at 64 %.\", action: { label: \"Retry\", onClick: () => {} } });\n};\n\n/** `defaultOpen`: the toasts show at once and stay (the screenshot); otherwise the button shows them. */\nexport default function ToastTones({ defaultOpen = false }: { defaultOpen?: boolean }) {\n useEffect(() => {\n if (!defaultOpen) return;\n toast.dismiss();\n show();\n }, [defaultOpen]);\n return (\n <>\n <Toaster id={toasterId} label=\"Notifications\" closeLabel=\"Dismiss\" position=\"bottom-right\" expand visibleToasts={4} duration={defaultOpen ? Number.POSITIVE_INFINITY : undefined} />\n <Button variant=\"outline\" onClick={show}>\n Show again\n </Button>\n </>\n );\n}\n"
|
|
24
211
|
},
|
|
25
212
|
"props": [
|
|
26
213
|
{
|
package/registry/tooltip.json
CHANGED
|
@@ -1,16 +1,156 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tooltip",
|
|
3
3
|
"type": "primitive",
|
|
4
|
-
"
|
|
4
|
+
"title": "Tooltip",
|
|
5
|
+
"summary": "A short label shown on hover and on keyboard focus, next to its trigger.",
|
|
6
|
+
"description": "A short label shown on hover and on keyboard focus, next to its trigger.",
|
|
7
|
+
"status": "stable",
|
|
8
|
+
"category": "overlays",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"To name an icon button for sighted mouse users: copy, share, more.",
|
|
12
|
+
"To show a shortcut next to an action."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "For information people need to complete a task: put it in the page.",
|
|
17
|
+
"use": "field"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "For interactive content (links, buttons).",
|
|
21
|
+
"use": "popover"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"when": "On touch screens as the only label: there is no hover."
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"bestPractices": [
|
|
28
|
+
"A few words, no punctuation: “Copy the link”.",
|
|
29
|
+
"The trigger keeps its own accessible name (an `IconButton` `label`); the tooltip repeats it for the eye."
|
|
30
|
+
],
|
|
31
|
+
"accessibility": {
|
|
32
|
+
"keyboard": [
|
|
33
|
+
{
|
|
34
|
+
"keys": "Tab",
|
|
35
|
+
"action": "Focusing the trigger shows the tooltip at once."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"keys": "Esc",
|
|
39
|
+
"action": "Hides it."
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"notes": [
|
|
43
|
+
"Radix Tooltip: `role=\"tooltip\"`, linked to the trigger by `aria-describedby`.",
|
|
44
|
+
"It opens on hover after `delayDuration` (300 ms) and never holds focus."
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"related": [
|
|
48
|
+
"button",
|
|
49
|
+
"popover",
|
|
50
|
+
"kbd"
|
|
51
|
+
],
|
|
52
|
+
"web": {
|
|
53
|
+
"entry": "@krizaka/ui/tooltip",
|
|
54
|
+
"import": "import { Tooltip } from \"@krizaka/ui/tooltip\";",
|
|
55
|
+
"props": [
|
|
56
|
+
{
|
|
57
|
+
"component": "Tooltip",
|
|
58
|
+
"description": "",
|
|
59
|
+
"props": [
|
|
60
|
+
{
|
|
61
|
+
"name": "children",
|
|
62
|
+
"type": "ReactNode",
|
|
63
|
+
"default": null,
|
|
64
|
+
"description": "The trigger, rendered as is (`asChild`): a focusable element.",
|
|
65
|
+
"required": true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "content",
|
|
69
|
+
"type": "ReactNode",
|
|
70
|
+
"default": null,
|
|
71
|
+
"description": "What the tooltip says — passed translated.",
|
|
72
|
+
"required": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "container",
|
|
76
|
+
"type": "HTMLElement | null",
|
|
77
|
+
"default": null,
|
|
78
|
+
"description": "The element the portal renders into (default: document.body).",
|
|
79
|
+
"required": false
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "defaultOpen",
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"default": null,
|
|
85
|
+
"description": "Open at first, uncontrolled.",
|
|
86
|
+
"required": false
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "delayDuration",
|
|
90
|
+
"type": "number",
|
|
91
|
+
"default": "300",
|
|
92
|
+
"description": "Hover delay in ms before it opens (300 by default).",
|
|
93
|
+
"required": false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "onOpenChange",
|
|
97
|
+
"type": "((open: boolean) => void)",
|
|
98
|
+
"default": null,
|
|
99
|
+
"description": "Called when it opens or closes.",
|
|
100
|
+
"required": false
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "open",
|
|
104
|
+
"type": "boolean",
|
|
105
|
+
"default": null,
|
|
106
|
+
"description": "Open or closed (controlled), with `onOpenChange`.",
|
|
107
|
+
"required": false
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"component": "TooltipProvider",
|
|
113
|
+
"description": "Optional, once near the root: shares `delayDuration` and the skip delay between tooltips.",
|
|
114
|
+
"props": []
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"examples": [
|
|
118
|
+
{
|
|
119
|
+
"name": "top",
|
|
120
|
+
"title": "Top",
|
|
121
|
+
"description": "Above its trigger (the default).",
|
|
122
|
+
"path": "examples/tooltip/top.tsx",
|
|
123
|
+
"module": "@krizaka/ui/registry/examples/tooltip/top",
|
|
124
|
+
"code": "import { IconButton } from \"@krizaka/ui/button\";\nimport { Tooltip } from \"@krizaka/ui/tooltip\";\n\nexport default function TooltipTop({ defaultOpen = false }: { defaultOpen?: boolean }) {\n return (\n <Tooltip content=\"Copy the link\" defaultOpen={defaultOpen}>\n <IconButton label=\"Copy\" variant=\"outline\">\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <rect x=\"9\" y=\"9\" width=\"12\" height=\"12\" rx=\"2\" />\n <path d=\"M5 15V5a2 2 0 0 1 2-2h10\" />\n </svg>\n </IconButton>\n </Tooltip>\n );\n}\n"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "right",
|
|
128
|
+
"title": "Right",
|
|
129
|
+
"description": "`side=\"right\"`.",
|
|
130
|
+
"path": "examples/tooltip/right.tsx",
|
|
131
|
+
"module": "@krizaka/ui/registry/examples/tooltip/right",
|
|
132
|
+
"code": "import { IconButton } from \"@krizaka/ui/button\";\nimport { Tooltip } from \"@krizaka/ui/tooltip\";\n\nexport default function TooltipRight({ defaultOpen = false }: { defaultOpen?: boolean }) {\n return (\n <Tooltip content=\"Copy the link\" side=\"right\" defaultOpen={defaultOpen}>\n <IconButton label=\"Copy\" variant=\"outline\">\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <rect x=\"9\" y=\"9\" width=\"12\" height=\"12\" rx=\"2\" />\n <path d=\"M5 15V5a2 2 0 0 1 2-2h10\" />\n </svg>\n </IconButton>\n </Tooltip>\n );\n}\n"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"native": null,
|
|
5
137
|
"files": [
|
|
6
138
|
{
|
|
7
139
|
"path": "floating.ts",
|
|
8
140
|
"content": "// The one surface of everything that floats next to its trigger (popover, menu, tooltip): a raised surface, a border,\n// the large shadow and the `kz-pop` entrance from the side Radix measured (`--radix-*-transform-origin`).\nexport const floating =\n \"kz-pop z-50 rounded-lg border border-border-default bg-surface-2 text-fg shadow-lg outline-hidden\";\n"
|
|
9
141
|
},
|
|
142
|
+
{
|
|
143
|
+
"path": "meta.ts",
|
|
144
|
+
"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"
|
|
145
|
+
},
|
|
10
146
|
{
|
|
11
147
|
"path": "tooltip/index.ts",
|
|
12
148
|
"content": "/** @krizaka/ui/tooltip — `Tooltip`, `TooltipProvider`. Client (\"use client\"). */\nexport { Tooltip, type TooltipProps, TooltipProvider } from \"./tooltip\";\n"
|
|
13
149
|
},
|
|
150
|
+
{
|
|
151
|
+
"path": "tooltip/meta.ts",
|
|
152
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Tooltip\",\n summary: \"A short label shown on hover and on keyboard focus, next to its trigger.\",\n status: \"stable\",\n category: \"overlays\",\n platforms: \"web\",\n whenToUse: [\"To name an icon button for sighted mouse users: copy, share, more.\", \"To show a shortcut next to an action.\"],\n whenNotToUse: [\n { when: \"For information people need to complete a task: put it in the page.\", use: \"field\" },\n { when: \"For interactive content (links, buttons).\", use: \"popover\" },\n { when: \"On touch screens as the only label: there is no hover.\" },\n ],\n bestPractices: [\n \"A few words, no punctuation: “Copy the link”.\",\n \"The trigger keeps its own accessible name (an `IconButton` `label`); the tooltip repeats it for the eye.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Tab\", action: \"Focusing the trigger shows the tooltip at once.\" },\n { keys: \"Esc\", action: \"Hides it.\" },\n ],\n notes: [\"Radix Tooltip: `role=\\\"tooltip\\\"`, linked to the trigger by `aria-describedby`.\", \"It opens on hover after `delayDuration` (300 ms) and never holds focus.\"],\n },\n related: [\"button\", \"popover\", \"kbd\"],\n web: {\n imports: [\"Tooltip\"],\n examples: [\n { name: \"top\", title: \"Top\", description: \"Above its trigger (the default).\" },\n { name: \"right\", title: \"Right\", description: \"`side=\\\"right\\\"`.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
153
|
+
},
|
|
14
154
|
{
|
|
15
155
|
"path": "tooltip/tooltip.tsx",
|
|
16
156
|
"content": "// Client (a portal). A short label for a control, on hover after `delayDuration` and on keyboard focus at once;\n// Escape dismisses it. It names nothing: the control keeps its own accessible name (an IconButton's `label`).\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { floating } from \"../floating\";\n\n/** Optional, once near the root: shares `delayDuration` and the skip delay between tooltips. */\nexport const TooltipProvider = TooltipPrimitive.Provider;\n\nexport type TooltipProps = Omit<React.ComponentProps<typeof TooltipPrimitive.Content>, \"content\" | \"children\"> & {\n /** What the tooltip says — passed translated. */\n content: React.ReactNode;\n /** The trigger, rendered as is (`asChild`): a focusable element. */\n children: React.ReactNode;\n /** Open or closed (controlled), with `onOpenChange`. */\n open?: boolean;\n /** Open at first, uncontrolled. */\n defaultOpen?: boolean;\n /** Called when it opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Hover delay in ms before it opens (300 by default). */\n delayDuration?: number;\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n};\n\nexport function Tooltip({\n content,\n children,\n open,\n defaultOpen,\n onOpenChange,\n delayDuration = 300,\n container,\n sideOffset = 6,\n collisionPadding = 8,\n className,\n ...props\n}: TooltipProps) {\n return (\n <TooltipPrimitive.Provider delayDuration={delayDuration}>\n <TooltipPrimitive.Root open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={container}>\n <TooltipPrimitive.Content\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(floating, \"max-w-xs px-2.5 py-1.5 text-xs font-medium origin-(--radix-tooltip-content-transform-origin)\", className)}\n {...props}\n >\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.Provider>\n );\n}\n"
|
|
@@ -23,8 +163,8 @@
|
|
|
23
163
|
"cn"
|
|
24
164
|
],
|
|
25
165
|
"demo": {
|
|
26
|
-
"path": "
|
|
27
|
-
"content": "import { IconButton } from \"@krizaka/ui/button\";\nimport { Tooltip } from \"@krizaka/ui/tooltip\";\n\nexport default function
|
|
166
|
+
"path": "examples/tooltip/top.tsx",
|
|
167
|
+
"content": "import { IconButton } from \"@krizaka/ui/button\";\nimport { Tooltip } from \"@krizaka/ui/tooltip\";\n\nexport default function TooltipTop({ defaultOpen = false }: { defaultOpen?: boolean }) {\n return (\n <Tooltip content=\"Copy the link\" defaultOpen={defaultOpen}>\n <IconButton label=\"Copy\" variant=\"outline\">\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <rect x=\"9\" y=\"9\" width=\"12\" height=\"12\" rx=\"2\" />\n <path d=\"M5 15V5a2 2 0 0 1 2-2h10\" />\n </svg>\n </IconButton>\n </Tooltip>\n );\n}\n"
|
|
28
168
|
},
|
|
29
169
|
"props": [
|
|
30
170
|
{
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "txt",
|
|
3
|
+
"type": "native",
|
|
4
|
+
"title": "Txt",
|
|
5
|
+
"summary": "Text in the platform's type scale, coloured by a role of the current theme.",
|
|
6
|
+
"description": "Text in the platform's type scale, coloured by a role of the current theme.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "foundations",
|
|
9
|
+
"platforms": "native",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"For every text of a React Native screen: titles, body, captions, labels, figures (`mono`)."
|
|
12
|
+
],
|
|
13
|
+
"whenNotToUse": [
|
|
14
|
+
{
|
|
15
|
+
"when": "On the web: use the preset's text utilities (`text-fg`, `font-display`).",
|
|
16
|
+
"use": "theme"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"when": "For a status label.",
|
|
20
|
+
"use": "badge"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"bestPractices": [
|
|
24
|
+
"Pick a `variant` from the scale and a `tone` from the roles: never a font size or a colour by hand.",
|
|
25
|
+
"`muted` only for large text or what is off: it reaches AA only as large text."
|
|
26
|
+
],
|
|
27
|
+
"accessibility": {
|
|
28
|
+
"keyboard": [],
|
|
29
|
+
"notes": [
|
|
30
|
+
"`title` and `display` are headers for screen readers.",
|
|
31
|
+
"It follows the system's font scaling."
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"related": [
|
|
35
|
+
"theme",
|
|
36
|
+
"badge"
|
|
37
|
+
],
|
|
38
|
+
"web": null,
|
|
39
|
+
"native": {
|
|
40
|
+
"entry": "@krizaka/ui/native",
|
|
41
|
+
"import": "import { Txt } from \"@krizaka/ui/native\";",
|
|
42
|
+
"differences": [],
|
|
43
|
+
"props": [
|
|
44
|
+
{
|
|
45
|
+
"component": "Txt",
|
|
46
|
+
"description": "Text in the platform's scale, coloured by a role of the current theme. `title` and `display` are headers for screen readers.",
|
|
47
|
+
"props": [
|
|
48
|
+
{
|
|
49
|
+
"name": "tone",
|
|
50
|
+
"type": "TxtTone",
|
|
51
|
+
"default": "text",
|
|
52
|
+
"description": "A text role of the theme (default `text`).",
|
|
53
|
+
"required": false
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "variant",
|
|
57
|
+
"type": "TxtVariant",
|
|
58
|
+
"default": "body",
|
|
59
|
+
"description": "The type scale: display · title · body (default) · caption · label · mono (tabular figures).",
|
|
60
|
+
"required": false
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"examples": [
|
|
66
|
+
{
|
|
67
|
+
"name": "variants",
|
|
68
|
+
"title": "Variants",
|
|
69
|
+
"description": "`display`, `title`, `body`, `caption`, `label`, `mono`.",
|
|
70
|
+
"path": "examples/txt/native/variants.tsx",
|
|
71
|
+
"module": "@krizaka/ui/registry/examples/txt/native/variants",
|
|
72
|
+
"code": "import { Txt } from \"@krizaka/ui/native\";\n\n// The platform's type scale: display · title · body · caption · label · mono.\nexport default function NativeTxtVariants() {\n return (\n <>\n <Txt variant=\"display\">Every night, a new set.</Txt>\n <Txt variant=\"title\">Every night, a new set.</Txt>\n <Txt variant=\"body\">Every night, a new set.</Txt>\n <Txt variant=\"caption\">Every night, a new set.</Txt>\n <Txt variant=\"label\">Every night, a new set.</Txt>\n <Txt variant=\"mono\">01:24:09</Txt>\n </>\n );\n}\n",
|
|
73
|
+
"screenshots": {
|
|
74
|
+
"dark": "examples/txt/native/variants.dark.png",
|
|
75
|
+
"light": "examples/txt/native/variants.light.png"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "tones",
|
|
80
|
+
"title": "Tones",
|
|
81
|
+
"description": "`text`, `secondary`, `muted`, `accent`.",
|
|
82
|
+
"path": "examples/txt/native/tones.tsx",
|
|
83
|
+
"module": "@krizaka/ui/registry/examples/txt/native/tones",
|
|
84
|
+
"code": "import { Txt } from \"@krizaka/ui/native\";\n\n// The text roles; `muted` reaches AA only as large text, like the status roles.\nexport default function NativeTxtTones() {\n return (\n <>\n <Txt tone=\"text\">Every night, a new set.</Txt>\n <Txt tone=\"secondary\">Every night, a new set.</Txt>\n <Txt tone=\"muted\" variant=\"display\">\n Every night, a new set.\n </Txt>\n <Txt tone=\"accent\" variant=\"title\">\n Every night, a new set.\n </Txt>\n </>\n );\n}\n",
|
|
85
|
+
"screenshots": {
|
|
86
|
+
"dark": "examples/txt/native/tones.dark.png",
|
|
87
|
+
"light": "examples/txt/native/tones.light.png"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"files": [],
|
|
93
|
+
"dependencies": [],
|
|
94
|
+
"registryDependencies": [],
|
|
95
|
+
"demo": null,
|
|
96
|
+
"props": []
|
|
97
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/button/button.tsx"],"sourcesContent":["// Server-safe: no hook, no context. `buttonVariants` styles a <Link> or a Server Component without the component.\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const buttonVariants = tv({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98]\",\n variants: {\n variant: {\n primary: \"bg-accent text-on-accent shadow-sm hover:bg-accent-hover\",\n secondary: \"border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3\",\n outline: \"border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent\",\n ghost: \"text-fg-secondary hover:bg-surface-2 hover:text-fg\",\n // The danger token is invariant and too light for small text on a light surface (3.6:1): the label stays a\n // text role, the border and the tint carry the danger.\n danger: \"border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20\",\n },\n size: { sm: \"h-8 px-3 text-xs\", md: \"h-10 px-4 text-sm\", lg: \"h-12 px-6 text-sm\", icon: \"h-10 w-10\" },\n shape: { rounded: \"rounded-lg\", pill: \"rounded-full\" },\n },\n defaultVariants: { variant: \"secondary\", size: \"md\", shape: \"rounded\" },\n});\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonProps = React.ComponentProps<\"button\"> &\n ButtonVariants & {\n /**\n * The look: `primary` (the accent), `secondary` (a raised surface), `outline`, `ghost`, `danger`.\n * @default \"secondary\"\n */\n variant?: ButtonVariants[\"variant\"];\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"md\"\n */\n size?: ButtonVariants[\"size\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** Renders the child (e.g. a <Link>) instead of the <button>, with props, classes and ref merged. */\n asChild?: boolean;\n /** Disables and signals the wait (aria-busy, data-loading) — the product adds a spinner if it wants one. */\n loading?: boolean;\n };\n\nexport function Button({ asChild, loading, variant, size, shape, className, disabled, ...props }: ButtonProps) {\n const Comp = asChild ? Slot.Root : \"button\";\n return (\n <Comp\n type={asChild ? undefined : \"button\"}\n aria-busy={loading || undefined}\n data-loading={loading ? \"\" : undefined}\n data-variant={variant ?? \"secondary\"}\n disabled={asChild ? undefined : disabled || loading}\n aria-disabled={asChild && (disabled || loading) ? true : undefined}\n className={buttonVariants({ variant, size, shape, className })}\n {...props}\n />\n );\n}\n\nexport type IconButtonProps = Omit<ButtonProps, \"size\"> & {\n /** The accessible name (and tooltip) of the button — required, passed translated. */\n label: string;\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"icon\"\n */\n size?: ButtonProps[\"size\"];\n};\n\n/** An icon-only button: `label` is required, it is its accessible name. */\nexport function IconButton({ label, size = \"icon\", ...props }: IconButtonProps) {\n return <Button aria-label={label} title={label} size={size} {...props} />;\n}\n"],"mappings":";;;AACA,SAAS,YAAY;AAErB,SAAS,UAA6B;AAmDlC;AAjDG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,MACE;AAAA,EAGF,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,IACV;AAAA,IACA,MAAM,EAAE,IAAI,oBAAoB,IAAI,qBAAqB,IAAI,qBAAqB,MAAM,YAAY;AAAA,IACpG,OAAO,EAAE,SAAS,cAAc,MAAM,eAAe;AAAA,EACvD;AAAA,EACA,iBAAiB,EAAE,SAAS,aAAa,MAAM,MAAM,OAAO,UAAU;AACxE,CAAC;AA2BM,SAAS,OAAO,EAAE,SAAS,SAAS,SAAS,MAAM,OAAO,WAAW,UAAU,GAAG,MAAM,GAAgB;AAC7G,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,UAAU,SAAY;AAAA,MAC5B,aAAW,WAAW;AAAA,MACtB,gBAAc,UAAU,KAAK;AAAA,MAC7B,gBAAc,WAAW;AAAA,MACzB,UAAU,UAAU,SAAY,YAAY;AAAA,MAC5C,iBAAe,YAAY,YAAY,WAAW,OAAO;AAAA,MACzD,WAAW,eAAe,EAAE,SAAS,MAAM,OAAO,UAAU,CAAC;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAaO,SAAS,WAAW,EAAE,OAAO,OAAO,QAAQ,GAAG,MAAM,GAAoB;AAC9E,SAAO,oBAAC,UAAO,cAAY,OAAO,OAAO,OAAO,MAAa,GAAG,OAAO;AACzE;","names":[]}
|
package/registry/demos/card.d.ts
DELETED
package/registry/demos/chip.d.ts
DELETED
package/registry/demos/cn.d.ts
DELETED