@codefast/ui 0.5.0-canary.5 → 0.5.0-canary.7
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/CHANGELOG.md +67 -0
- package/README.md +59 -355
- package/dist/components/accordion.d.ts +37 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +33 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +102 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +75 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +38 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +32 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +13 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +13 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/{attachment.d.mts → attachment.d.ts} +21 -55
- package/dist/components/attachment.d.ts.map +1 -0
- package/dist/components/attachment.js +65 -0
- package/dist/components/attachment.js.map +1 -0
- package/dist/components/avatar.d.ts +55 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +44 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +15 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +62 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +52 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/bubble.d.ts +50 -0
- package/dist/components/bubble.d.ts.map +1 -0
- package/dist/components/bubble.js +34 -0
- package/dist/components/bubble.js.map +1 -0
- package/dist/components/button-group.d.ts +32 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +29 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +16 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +18 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +27 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +96 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +62 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +49 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/{carousel.d.mts → carousel.d.ts} +25 -52
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +137 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +101 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +217 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox-cards.d.ts +23 -0
- package/dist/components/checkbox-cards.d.ts.map +1 -0
- package/dist/components/checkbox-cards.js +22 -0
- package/dist/components/checkbox-cards.js.map +1 -0
- package/dist/components/checkbox-group.d.ts +21 -0
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +21 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.d.ts +13 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +15 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +29 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +25 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.d.ts +91 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +71 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +136 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +99 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.d.ts +86 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +64 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/direction.d.ts +19 -0
- package/dist/components/direction.d.ts.map +1 -0
- package/dist/components/direction.js +17 -0
- package/dist/components/direction.js.map +1 -0
- package/dist/components/drawer.d.ts +74 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +57 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +136 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +99 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.d.ts +53 -0
- package/dist/components/empty.d.ts.map +1 -0
- package/dist/components/empty.js +44 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +95 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +86 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/{form.d.mts → form.d.ts} +15 -33
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +97 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/hover-card.d.ts +37 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +32 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +56 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +56 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-number.d.ts +60 -0
- package/dist/components/input-number.d.ts.map +1 -0
- package/dist/components/input-number.js +68 -0
- package/dist/components/input-number.js.map +1 -0
- package/dist/components/input-otp.d.ts +40 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +41 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input-password.d.ts +13 -0
- package/dist/components/input-password.d.ts.map +1 -0
- package/dist/components/input-password.js +19 -0
- package/dist/components/input-password.js.map +1 -0
- package/dist/components/input-search.d.ts +17 -0
- package/dist/components/input-search.d.ts.map +1 -0
- package/dist/components/input-search.js +24 -0
- package/dist/components/input-search.js.map +1 -0
- package/dist/components/input.d.ts +12 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +13 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.d.ts +88 -0
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +71 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.d.ts +20 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +13 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +14 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/{marker.d.mts → marker.d.ts} +9 -21
- package/dist/components/marker.d.ts.map +1 -0
- package/dist/components/marker.js +28 -0
- package/dist/components/marker.js.map +1 -0
- package/dist/components/menubar.d.ts +144 -0
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +105 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/message-scroller.d.ts +67 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +46 -0
- package/dist/components/message-scroller.js.map +1 -0
- package/dist/components/{message.d.mts → message.d.ts} +11 -31
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +43 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/native-select.d.ts +30 -0
- package/dist/components/native-select.d.ts.map +1 -0
- package/dist/components/native-select.js +26 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +71 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +58 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +70 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +51 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +69 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +56 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress-circle.d.ts +72 -0
- package/dist/components/progress-circle.d.ts.map +1 -0
- package/dist/components/progress-circle.js +58 -0
- package/dist/components/progress-circle.js.map +1 -0
- package/dist/components/progress.d.ts +13 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +16 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-cards.d.ts +21 -0
- package/dist/components/radio-cards.d.ts.map +1 -0
- package/dist/components/radio-cards.js +21 -0
- package/dist/components/radio-cards.js.map +1 -0
- package/dist/components/radio-group.d.ts +21 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +20 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/radio.d.ts +14 -0
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/radio.js +14 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/resizable.d.ts +31 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +26 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.d.ts +27 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +29 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +87 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +70 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +23 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +21 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +88 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +69 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +231 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +279 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +12 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +13 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +13 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +21 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +14 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +32 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +30 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +14 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +68 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +55 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +38 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +33 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +12 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +13 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.d.ts +30 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +42 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +15 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +14 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +45 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +38 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/{use-animated-value.d.mts → use-animated-value.d.ts} +2 -4
- package/dist/hooks/use-animated-value.d.ts.map +1 -0
- package/dist/hooks/use-animated-value.js +73 -0
- package/dist/hooks/use-animated-value.js.map +1 -0
- package/dist/hooks/{use-copy-to-clipboard.d.mts → use-copy-to-clipboard.d.ts} +6 -11
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.js +48 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/hooks/{use-is-mobile.d.mts → use-is-mobile.d.ts} +2 -4
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +25 -0
- package/dist/hooks/use-is-mobile.js.map +1 -0
- package/dist/hooks/{use-media-query.d.mts → use-media-query.d.ts} +2 -4
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +55 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-message-scroller-commands.d.ts +22 -0
- package/dist/hooks/use-message-scroller-commands.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-commands.js +190 -0
- package/dist/hooks/use-message-scroller-commands.js.map +1 -0
- package/dist/hooks/use-message-scroller-controller.d.ts +12 -0
- package/dist/hooks/use-message-scroller-controller.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-controller.js +471 -0
- package/dist/hooks/use-message-scroller-controller.js.map +1 -0
- package/dist/hooks/use-message-scroller-refs.d.ts +54 -0
- package/dist/hooks/use-message-scroller-refs.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-refs.js +88 -0
- package/dist/hooks/use-message-scroller-refs.js.map +1 -0
- package/dist/hooks/{use-mutation-observer.d.mts → use-mutation-observer.d.ts} +3 -6
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
- package/dist/hooks/use-mutation-observer.js +42 -0
- package/dist/hooks/use-mutation-observer.js.map +1 -0
- package/dist/hooks/{use-pagination.d.mts → use-pagination.d.ts} +21 -28
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-pagination.js +117 -0
- package/dist/hooks/use-pagination.js.map +1 -0
- package/dist/index.d.ts +181 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/message-scroller/{geometry.d.mts → geometry.d.ts} +40 -73
- package/dist/lib/message-scroller/geometry.d.ts.map +1 -0
- package/dist/lib/message-scroller/geometry.js +246 -0
- package/dist/lib/message-scroller/geometry.js.map +1 -0
- package/dist/lib/message-scroller/{stores.d.mts → stores.d.ts} +3 -5
- package/dist/lib/message-scroller/stores.d.ts.map +1 -0
- package/dist/lib/message-scroller/stores.js +64 -0
- package/dist/lib/message-scroller/stores.js.map +1 -0
- package/dist/lib/message-scroller/types.d.ts +170 -0
- package/dist/lib/message-scroller/types.d.ts.map +1 -0
- package/dist/lib/message-scroller/types.js +66 -0
- package/dist/lib/message-scroller/types.js.map +1 -0
- package/dist/lib/message-scroller/{utils.d.mts → utils.d.ts} +2 -3
- package/dist/lib/message-scroller/utils.d.ts.map +1 -0
- package/dist/lib/message-scroller/utils.js +11 -0
- package/dist/lib/message-scroller/utils.js.map +1 -0
- package/dist/lib/{use-render.d.mts → use-render.d.ts} +14 -19
- package/dist/lib/use-render.d.ts.map +1 -0
- package/dist/lib/use-render.js +119 -0
- package/dist/lib/use-render.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/{utils.mjs → utils.js} +1 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/primitives/checkbox-group.d.ts +135 -0
- package/dist/primitives/checkbox-group.d.ts.map +1 -0
- package/dist/primitives/checkbox-group.js +120 -0
- package/dist/primitives/checkbox-group.js.map +1 -0
- package/dist/primitives/input-number.d.ts +109 -0
- package/dist/primitives/input-number.d.ts.map +1 -0
- package/dist/primitives/input-number.js +532 -0
- package/dist/primitives/input-number.js.map +1 -0
- package/dist/primitives/input.d.ts +77 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +83 -0
- package/dist/primitives/input.js.map +1 -0
- package/dist/primitives/message-scroller.d.ts +43 -0
- package/dist/primitives/message-scroller.d.ts.map +1 -0
- package/dist/primitives/message-scroller.js +210 -0
- package/dist/primitives/message-scroller.js.map +1 -0
- package/dist/primitives/progress-circle.d.ts +166 -0
- package/dist/primitives/progress-circle.d.ts.map +1 -0
- package/dist/primitives/progress-circle.js +171 -0
- package/dist/primitives/progress-circle.js.map +1 -0
- package/dist/variants/{alert.d.mts → alert.d.ts} +8 -9
- package/dist/variants/alert.d.ts.map +1 -0
- package/dist/variants/alert.js +24 -0
- package/dist/variants/alert.js.map +1 -0
- package/dist/variants/{attachment.d.mts → attachment.d.ts} +17 -18
- package/dist/variants/attachment.d.ts.map +1 -0
- package/dist/variants/attachment.js +54 -0
- package/dist/variants/attachment.js.map +1 -0
- package/dist/variants/badge.d.ts +21 -0
- package/dist/variants/badge.d.ts.map +1 -0
- package/dist/variants/badge.js +28 -0
- package/dist/variants/badge.js.map +1 -0
- package/dist/variants/{bubble.d.mts → bubble.d.ts} +21 -22
- package/dist/variants/bubble.d.ts.map +1 -0
- package/dist/variants/bubble.js +57 -0
- package/dist/variants/bubble.js.map +1 -0
- package/dist/variants/{button-group.d.mts → button-group.d.ts} +8 -9
- package/dist/variants/button-group.d.ts.map +1 -0
- package/dist/variants/button-group.js +24 -0
- package/dist/variants/button-group.js.map +1 -0
- package/dist/variants/button.d.ts +31 -0
- package/dist/variants/button.d.ts.map +1 -0
- package/dist/variants/button.js +39 -0
- package/dist/variants/button.js.map +1 -0
- package/dist/variants/{empty.d.mts → empty.d.ts} +8 -9
- package/dist/variants/empty.d.ts.map +1 -0
- package/dist/variants/empty.js +24 -0
- package/dist/variants/empty.js.map +1 -0
- package/dist/variants/field.d.ts +18 -0
- package/dist/variants/field.d.ts.map +1 -0
- package/dist/variants/field.js +25 -0
- package/dist/variants/field.js.map +1 -0
- package/dist/variants/{input-group.d.mts → input-group.d.ts} +16 -17
- package/dist/variants/input-group.d.ts.map +1 -0
- package/dist/variants/input-group.js +55 -0
- package/dist/variants/input-group.js.map +1 -0
- package/dist/variants/{item.d.mts → item.d.ts} +19 -20
- package/dist/variants/item.d.ts.map +1 -0
- package/dist/variants/item.js +50 -0
- package/dist/variants/item.js.map +1 -0
- package/dist/variants/{marker.d.mts → marker.d.ts} +9 -10
- package/dist/variants/marker.d.ts.map +1 -0
- package/dist/variants/marker.js +27 -0
- package/dist/variants/marker.js.map +1 -0
- package/dist/variants/{navigation-menu.d.mts → navigation-menu.d.ts} +4 -5
- package/dist/variants/navigation-menu.d.ts.map +1 -0
- package/dist/variants/navigation-menu.js +15 -0
- package/dist/variants/navigation-menu.js.map +1 -0
- package/dist/variants/progress-circle.d.ts +51 -0
- package/dist/variants/progress-circle.d.ts.map +1 -0
- package/dist/variants/progress-circle.js +36 -0
- package/dist/variants/progress-circle.js.map +1 -0
- package/dist/variants/scroll-area.d.ts +23 -0
- package/dist/variants/scroll-area.d.ts.map +1 -0
- package/dist/variants/scroll-area.js +63 -0
- package/dist/variants/scroll-area.js.map +1 -0
- package/dist/variants/separator.d.ts +22 -0
- package/dist/variants/separator.d.ts.map +1 -0
- package/dist/variants/separator.js +30 -0
- package/dist/variants/separator.js.map +1 -0
- package/dist/variants/sheet.d.ts +19 -0
- package/dist/variants/sheet.d.ts.map +1 -0
- package/dist/variants/sheet.js +26 -0
- package/dist/variants/sheet.js.map +1 -0
- package/dist/variants/sidebar.d.ts +22 -0
- package/dist/variants/sidebar.d.ts.map +1 -0
- package/dist/variants/sidebar.js +30 -0
- package/dist/variants/sidebar.js.map +1 -0
- package/dist/variants/{tabs.d.mts → tabs.d.ts} +8 -9
- package/dist/variants/tabs.d.ts.map +1 -0
- package/dist/variants/tabs.js +24 -0
- package/dist/variants/tabs.js.map +1 -0
- package/dist/variants/toggle.d.ts +22 -0
- package/dist/variants/toggle.d.ts.map +1 -0
- package/dist/variants/toggle.js +30 -0
- package/dist/variants/toggle.js.map +1 -0
- package/package.json +256 -265
- package/src/components/accordion.tsx +3 -3
- package/src/components/alert-dialog.tsx +7 -7
- package/src/components/alert.tsx +1 -1
- package/src/components/aspect-ratio.tsx +1 -1
- package/src/components/attachment.tsx +1 -1
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +1 -1
- package/src/components/breadcrumb.tsx +3 -6
- package/src/components/bubble.tsx +1 -1
- package/src/components/button-group.tsx +2 -2
- package/src/components/button.tsx +1 -1
- package/src/components/calendar.tsx +2 -2
- package/src/components/card.tsx +2 -2
- package/src/components/checkbox-cards.tsx +2 -2
- package/src/components/checkbox.tsx +1 -1
- package/src/components/collapsible.tsx +1 -1
- package/src/components/context-menu.tsx +8 -8
- package/src/components/dialog.tsx +9 -6
- package/src/components/direction.tsx +1 -1
- package/src/components/drawer.tsx +3 -3
- package/src/components/dropdown-menu.tsx +8 -8
- package/src/components/empty.tsx +3 -3
- package/src/components/field.tsx +5 -5
- package/src/components/form.tsx +2 -2
- package/src/components/hover-card.tsx +2 -2
- package/src/components/input-group.tsx +2 -2
- package/src/components/input-number.tsx +167 -105
- package/src/components/input-otp.tsx +2 -2
- package/src/components/input.tsx +1 -1
- package/src/components/item.tsx +1 -1
- package/src/components/label.tsx +1 -1
- package/src/components/marker.tsx +1 -1
- package/src/components/menubar.tsx +12 -12
- package/src/components/native-select.tsx +1 -1
- package/src/components/navigation-menu.tsx +3 -3
- package/src/components/pagination.tsx +4 -4
- package/src/components/popover.tsx +3 -3
- package/src/components/progress.tsx +2 -2
- package/src/components/radio-cards.tsx +3 -3
- package/src/components/radio-group.tsx +2 -2
- package/src/components/scroll-area.tsx +1 -1
- package/src/components/select.tsx +5 -5
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +4 -4
- package/src/components/sidebar.tsx +11 -4
- package/src/components/slider.tsx +3 -3
- package/src/components/spinner.tsx +1 -1
- package/src/components/switch.tsx +1 -1
- package/src/components/tabs.tsx +2 -2
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle-group.tsx +3 -3
- package/src/components/toggle.tsx +1 -1
- package/src/components/tooltip.tsx +1 -1
- package/src/lib/message-scroller/geometry.ts +6 -2
- package/src/lib/message-scroller/stores.ts +2 -2
- package/src/primitives/checkbox-group.tsx +5 -6
- package/src/primitives/input-number.tsx +122 -43
- package/src/variants/alert.ts +1 -1
- package/src/variants/button-group.ts +3 -3
- package/src/variants/button.ts +9 -10
- package/src/variants/empty.ts +1 -1
- package/src/variants/field.ts +3 -3
- package/src/variants/input-group.ts +3 -3
- package/src/variants/item.ts +2 -2
- package/src/variants/navigation-menu.ts +1 -1
- package/src/variants/tabs.ts +1 -1
- package/src/variants/toggle.ts +4 -4
- package/dist/components/accordion.d.mts +0 -52
- package/dist/components/accordion.mjs +0 -65
- package/dist/components/alert-dialog.d.mts +0 -135
- package/dist/components/alert-dialog.mjs +0 -130
- package/dist/components/alert.d.mts +0 -51
- package/dist/components/alert.mjs +0 -50
- package/dist/components/aspect-ratio.d.mts +0 -16
- package/dist/components/aspect-ratio.mjs +0 -14
- package/dist/components/attachment.mjs +0 -112
- package/dist/components/avatar.d.mts +0 -75
- package/dist/components/avatar.mjs +0 -67
- package/dist/components/badge.d.mts +0 -21
- package/dist/components/badge.mjs +0 -20
- package/dist/components/breadcrumb.d.mts +0 -85
- package/dist/components/breadcrumb.mjs +0 -89
- package/dist/components/bubble.d.mts +0 -67
- package/dist/components/bubble.mjs +0 -58
- package/dist/components/button-group.d.mts +0 -45
- package/dist/components/button-group.mjs +0 -43
- package/dist/components/button.d.mts +0 -24
- package/dist/components/button.mjs +0 -35
- package/dist/components/calendar.d.mts +0 -43
- package/dist/components/calendar.mjs +0 -117
- package/dist/components/card.d.mts +0 -85
- package/dist/components/card.mjs +0 -76
- package/dist/components/carousel.mjs +0 -172
- package/dist/components/chart.d.mts +0 -135
- package/dist/components/chart.mjs +0 -214
- package/dist/components/checkbox-cards.d.mts +0 -29
- package/dist/components/checkbox-cards.mjs +0 -36
- package/dist/components/checkbox-group.d.mts +0 -28
- package/dist/components/checkbox-group.mjs +0 -32
- package/dist/components/checkbox.d.mts +0 -17
- package/dist/components/checkbox.mjs +0 -22
- package/dist/components/collapsible.d.mts +0 -36
- package/dist/components/collapsible.mjs +0 -32
- package/dist/components/command.d.mts +0 -127
- package/dist/components/command.mjs +0 -125
- package/dist/components/context-menu.d.mts +0 -188
- package/dist/components/context-menu.mjs +0 -172
- package/dist/components/dialog.d.mts +0 -115
- package/dist/components/dialog.mjs +0 -121
- package/dist/components/direction.d.mts +0 -24
- package/dist/components/direction.mjs +0 -18
- package/dist/components/drawer.d.mts +0 -101
- package/dist/components/drawer.mjs +0 -97
- package/dist/components/dropdown-menu.d.mts +0 -189
- package/dist/components/dropdown-menu.mjs +0 -178
- package/dist/components/empty.d.mts +0 -73
- package/dist/components/empty.mjs +0 -70
- package/dist/components/field.d.mts +0 -131
- package/dist/components/field.mjs +0 -135
- package/dist/components/form.mjs +0 -113
- package/dist/components/hover-card.d.mts +0 -50
- package/dist/components/hover-card.mjs +0 -49
- package/dist/components/input-group.d.mts +0 -79
- package/dist/components/input-group.mjs +0 -87
- package/dist/components/input-number.d.mts +0 -36
- package/dist/components/input-number.mjs +0 -86
- package/dist/components/input-otp.d.mts +0 -53
- package/dist/components/input-otp.mjs +0 -62
- package/dist/components/input-password.d.mts +0 -19
- package/dist/components/input-password.mjs +0 -38
- package/dist/components/input-search.d.mts +0 -26
- package/dist/components/input-search.mjs +0 -51
- package/dist/components/input.d.mts +0 -17
- package/dist/components/input.mjs +0 -16
- package/dist/components/item.d.mts +0 -123
- package/dist/components/item.mjs +0 -120
- package/dist/components/kbd.d.mts +0 -27
- package/dist/components/kbd.mjs +0 -25
- package/dist/components/label.d.mts +0 -17
- package/dist/components/label.mjs +0 -16
- package/dist/components/marker.mjs +0 -42
- package/dist/components/menubar.d.mts +0 -202
- package/dist/components/menubar.mjs +0 -188
- package/dist/components/message-scroller.d.mts +0 -89
- package/dist/components/message-scroller.mjs +0 -77
- package/dist/components/message.mjs +0 -66
- package/dist/components/native-select.d.mts +0 -41
- package/dist/components/native-select.mjs +0 -46
- package/dist/components/navigation-menu.d.mts +0 -100
- package/dist/components/navigation-menu.mjs +0 -103
- package/dist/components/pagination.d.mts +0 -94
- package/dist/components/pagination.mjs +0 -107
- package/dist/components/popover.d.mts +0 -93
- package/dist/components/popover.mjs +0 -88
- package/dist/components/progress-circle.d.mts +0 -89
- package/dist/components/progress-circle.mjs +0 -80
- package/dist/components/progress.d.mts +0 -18
- package/dist/components/progress.mjs +0 -21
- package/dist/components/radio-cards.d.mts +0 -26
- package/dist/components/radio-cards.mjs +0 -35
- package/dist/components/radio-group.d.mts +0 -28
- package/dist/components/radio-group.mjs +0 -31
- package/dist/components/radio.d.mts +0 -20
- package/dist/components/radio.mjs +0 -18
- package/dist/components/resizable.d.mts +0 -41
- package/dist/components/resizable.mjs +0 -36
- package/dist/components/scroll-area.d.mts +0 -39
- package/dist/components/scroll-area.mjs +0 -56
- package/dist/components/select.d.mts +0 -122
- package/dist/components/select.mjs +0 -131
- package/dist/components/separator.d.mts +0 -32
- package/dist/components/separator.mjs +0 -33
- package/dist/components/sheet.d.mts +0 -119
- package/dist/components/sheet.mjs +0 -123
- package/dist/components/sidebar.d.mts +0 -320
- package/dist/components/sidebar.mjs +0 -414
- package/dist/components/skeleton.d.mts +0 -16
- package/dist/components/skeleton.mjs +0 -15
- package/dist/components/slider.d.mts +0 -21
- package/dist/components/slider.mjs +0 -41
- package/dist/components/sonner.d.mts +0 -16
- package/dist/components/sonner.mjs +0 -32
- package/dist/components/spinner.d.mts +0 -20
- package/dist/components/spinner.mjs +0 -42
- package/dist/components/switch.d.mts +0 -20
- package/dist/components/switch.mjs +0 -21
- package/dist/components/table.d.mts +0 -93
- package/dist/components/table.mjs +0 -89
- package/dist/components/tabs.d.mts +0 -53
- package/dist/components/tabs.mjs +0 -53
- package/dist/components/textarea.d.mts +0 -16
- package/dist/components/textarea.mjs +0 -15
- package/dist/components/toggle-group.d.mts +0 -46
- package/dist/components/toggle-group.mjs +0 -58
- package/dist/components/toggle.d.mts +0 -20
- package/dist/components/toggle.mjs +0 -20
- package/dist/components/tooltip.d.mts +0 -61
- package/dist/components/tooltip.mjs +0 -59
- package/dist/hooks/use-animated-value.mjs +0 -65
- package/dist/hooks/use-copy-to-clipboard.mjs +0 -44
- package/dist/hooks/use-is-mobile.mjs +0 -27
- package/dist/hooks/use-media-query.mjs +0 -51
- package/dist/hooks/use-message-scroller-commands.d.mts +0 -39
- package/dist/hooks/use-message-scroller-commands.mjs +0 -165
- package/dist/hooks/use-message-scroller-controller.d.mts +0 -19
- package/dist/hooks/use-message-scroller-controller.mjs +0 -382
- package/dist/hooks/use-message-scroller-refs.d.mts +0 -60
- package/dist/hooks/use-message-scroller-refs.mjs +0 -77
- package/dist/hooks/use-mutation-observer.mjs +0 -42
- package/dist/hooks/use-pagination.mjs +0 -122
- package/dist/index.d.mts +0 -96
- package/dist/index.mjs +0 -95
- package/dist/lib/message-scroller/geometry.mjs +0 -199
- package/dist/lib/message-scroller/stores.mjs +0 -52
- package/dist/lib/message-scroller/types.d.mts +0 -171
- package/dist/lib/message-scroller/types.mjs +0 -53
- package/dist/lib/message-scroller/utils.mjs +0 -12
- package/dist/lib/use-render.mjs +0 -84
- package/dist/lib/utils.d.mts +0 -2
- package/dist/primitives/checkbox-group.d.mts +0 -154
- package/dist/primitives/checkbox-group.mjs +0 -137
- package/dist/primitives/input-number.d.mts +0 -119
- package/dist/primitives/input-number.mjs +0 -532
- package/dist/primitives/input.d.mts +0 -81
- package/dist/primitives/input.mjs +0 -80
- package/dist/primitives/message-scroller.d.mts +0 -88
- package/dist/primitives/message-scroller.mjs +0 -240
- package/dist/primitives/progress-circle.d.mts +0 -195
- package/dist/primitives/progress-circle.mjs +0 -189
- package/dist/variants/alert.mjs +0 -15
- package/dist/variants/attachment.mjs +0 -42
- package/dist/variants/badge.d.mts +0 -22
- package/dist/variants/badge.mjs +0 -19
- package/dist/variants/bubble.mjs +0 -45
- package/dist/variants/button-group.mjs +0 -15
- package/dist/variants/button.d.mts +0 -32
- package/dist/variants/button.mjs +0 -34
- package/dist/variants/empty.mjs +0 -15
- package/dist/variants/field.d.mts +0 -19
- package/dist/variants/field.mjs +0 -16
- package/dist/variants/input-group.mjs +0 -34
- package/dist/variants/input-number.d.mts +0 -45
- package/dist/variants/input-number.mjs +0 -40
- package/dist/variants/item.mjs +0 -38
- package/dist/variants/marker.mjs +0 -18
- package/dist/variants/navigation-menu.mjs +0 -8
- package/dist/variants/progress-circle.d.mts +0 -52
- package/dist/variants/progress-circle.mjs +0 -45
- package/dist/variants/scroll-area.d.mts +0 -24
- package/dist/variants/scroll-area.mjs +0 -58
- package/dist/variants/separator.d.mts +0 -23
- package/dist/variants/separator.mjs +0 -25
- package/dist/variants/sheet.d.mts +0 -20
- package/dist/variants/sheet.mjs +0 -17
- package/dist/variants/sidebar.d.mts +0 -23
- package/dist/variants/sidebar.mjs +0 -25
- package/dist/variants/tabs.mjs +0 -15
- package/dist/variants/toggle.d.mts +0 -23
- package/dist/variants/toggle.mjs +0 -25
- package/src/variants/input-number.ts +0 -65
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
# @codefast/ui
|
|
2
2
|
|
|
3
|
+
## 0.5.0-canary.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @codefast/tailwind-variants@0.5.0-canary.7
|
|
9
|
+
|
|
10
|
+
## 0.5.0-canary.6
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [#552](https://github.com/codefastlabs/codefast/pull/552) [`78bf5a4`](https://github.com/codefastlabs/codefast/commit/78bf5a494de8276f5eeb262bc5dc45c882bb63f7) Thanks [@thevuong](https://github.com/thevuong)! - Refine two surfaces for a more consistent container language:
|
|
15
|
+
|
|
16
|
+
- `CardFooter` is now a distinct tinted tray by default (`border-t bg-muted/50` with full `--card-spacing` padding). `Card` drops its bottom padding when a footer is present (`has-data-[slot=card-footer]:pb-0`) so the tint reaches the card's bottom edge. Footers that previously relied on the transparent, opt-in-border behavior will now render with a background and top border.
|
|
17
|
+
- `Empty` uses `rounded-xl` instead of `rounded-lg`, matching `Card`'s corner radius for a consistent container language.
|
|
18
|
+
|
|
19
|
+
- [#552](https://github.com/codefastlabs/codefast/pull/552) [`e7839f2`](https://github.com/codefastlabs/codefast/commit/e7839f2d49da7b3af805aafcb6863a32e18e9563) Thanks [@thevuong](https://github.com/thevuong)! - Add chat surface components: `Attachment` (file/media card with upload states, three sizes, and horizontal/vertical orientations), `Bubble` (message bubble with seven variants, alignment, and reaction pills), `Message` (avatar + content row with start/end alignment), and `Marker` (inline feed divider). Each ships per-component and `./variants/*` subpath exports, stories, and unit tests.
|
|
20
|
+
|
|
21
|
+
Also adds `scroll-fade-*` (scroll-aware, RTL-mirrored edge fades) and `shimmer` (text loading shimmer) utilities to the foundation preset, used by these components and available on any scroller.
|
|
22
|
+
|
|
23
|
+
- [#552](https://github.com/codefastlabs/codefast/pull/552) [`5e74e3e`](https://github.com/codefastlabs/codefast/commit/5e74e3e426a10d26f86a053a15acf971dc0115dc) Thanks [@thevuong](https://github.com/thevuong)! - Add `MessageScroller`, a headless-driven scroll manager for chat transcripts: follow-the-bottom autoscroll, scroll preservation on prepend, anchored streaming turns, `defaultScrollPosition`, and a self-hiding scroll-to-edge button. Ships the styled component (`@codefast/ui/message-scroller`), the headless primitive (`@codefast/ui/primitives/message-scroller`), and the `useMessageScroller`, `useMessageScrollerScrollable`, and `useMessageScrollerVisibility` hooks.
|
|
24
|
+
|
|
25
|
+
The scroll engine (geometry, stores, and controller hooks) is vendored from an external message-scroller implementation into `@codefast/ui` internals and adapted to codefast conventions, so it carries no extra runtime dependency. Adds an internal `useRender` utility that backs the primitives' `render` prop.
|
|
26
|
+
|
|
27
|
+
- [`ca47aff`](https://github.com/codefastlabs/codefast/commit/ca47aff20ebb5ac9e4c3db759da31102ff9d5f84) Thanks [@thevuong](https://github.com/thevuong)! - Rename four APIs whose names misstated their role (Swift API Design Guidelines pass).
|
|
28
|
+
|
|
29
|
+
**Breaking:**
|
|
30
|
+
|
|
31
|
+
- `ProgressCircle`: `animate` → `animated` (a boolean should read as an assertion, not a bare verb) and `customLabel` → `renderLabel` (the prop holds a render function, not a label value; "custom" was filler). `useAnimatedValue`'s third parameter follows suit.
|
|
32
|
+
- `MessageScrollerItem`: `scrollAnchor` → `isScrollAnchor` (assertion form, matching the existing `isActive` convention). The emitted `data-scroll-anchor` attribute is unchanged.
|
|
33
|
+
- `UsePaginationProps` → `UsePaginationOptions` — a hook takes options, not component props.
|
|
34
|
+
|
|
35
|
+
- [#552](https://github.com/codefastlabs/codefast/pull/552) [`feb5639`](https://github.com/codefastlabs/codefast/commit/feb5639ea4443b8c1c90e638e3f9d12e6a32b14e) Thanks [@thevuong](https://github.com/thevuong)! - Complete RTL hardening across the component library, closing the last physical-direction gaps and making the carousel direction-aware.
|
|
36
|
+
|
|
37
|
+
- `AvatarGroup` now flips its overlap in RTL (`rtl:space-x-reverse`).
|
|
38
|
+
- `SidebarRail`'s off-canvas drag line mirrors correctly (`after:start-full`).
|
|
39
|
+
- **`Carousel` is now direction-aware:** it forwards the resolved reading direction to Embla (so drag/snap physics mirror in RTL) and swaps the arrow-key mapping (in RTL the **Left** arrow advances, **Right** retreats). An explicit `opts.direction` still wins. This is a behavior change for RTL consumers who relied on the previous physical arrow-key mapping.
|
|
40
|
+
|
|
41
|
+
Also adds an internal `audit:rtl` script and a Direction (LTR/RTL) Storybook toolbar to keep physical-direction utilities from regressing.
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- [`3e1050b`](https://github.com/codefastlabs/codefast/commit/3e1050b4e51e8eefd5fce9a979e78acce09a0683) Thanks [@thevuong](https://github.com/thevuong)! - Remove the dead `separator` prop from the `Breadcrumb` root — it was never consumed (a vestige of the old upstream shape) and only leaked onto the `<nav>` element as an invalid DOM attribute. Custom separators keep working the supported way: pass children to `<BreadcrumbSeparator>`.
|
|
46
|
+
|
|
47
|
+
- [#632](https://github.com/codefastlabs/codefast/pull/632) [`44035ca`](https://github.com/codefastlabs/codefast/commit/44035ca29c99f7e9d9a760f758496965253b650a) Thanks [@thevuong](https://github.com/thevuong)! - Annotate `CheckboxGroupItem`'s `onCheckedChange` callback with a `CheckedState` type derived from the underlying Radix primitive. Radix's `radix-ui` umbrella namespace merge dropped the contextual type for the inline callback parameter, tripping `noImplicitAny` during the build; deriving the type from `Root` keeps it in lockstep with the primitive.
|
|
48
|
+
|
|
49
|
+
- [#552](https://github.com/codefastlabs/codefast/pull/552) [`04c82de`](https://github.com/codefastlabs/codefast/commit/04c82ded0a01a6a12a4dd66cd35d5635718ba699) Thanks [@thevuong](https://github.com/thevuong)! - Fix a hydration mismatch in `SidebarMenuSkeleton`: its placeholder width was derived from `Math.random()`, which produced different values on the server and client. It now derives a stable, varied width (50–90%) from `useId`, so server and client render the same markup.
|
|
50
|
+
|
|
51
|
+
- Updated dependencies []:
|
|
52
|
+
- @codefast/tailwind-variants@0.5.0-canary.6
|
|
53
|
+
|
|
54
|
+
## 1.0.0-canary.7
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- [#632](https://github.com/codefastlabs/codefast/pull/632) [`44035ca`](https://github.com/codefastlabs/codefast/commit/44035ca29c99f7e9d9a760f758496965253b650a) Thanks [@thevuong](https://github.com/thevuong)! - Annotate `CheckboxGroupItem`'s `onCheckedChange` callback with a `CheckedState` type derived from the underlying Radix primitive. Radix's `radix-ui` umbrella namespace merge dropped the contextual type for the inline callback parameter, tripping `noImplicitAny` during the build; deriving the type from `Root` keeps it in lockstep with the primitive.
|
|
59
|
+
|
|
60
|
+
- Updated dependencies []:
|
|
61
|
+
- @codefast/tailwind-variants@1.0.0-canary.7
|
|
62
|
+
|
|
63
|
+
## 1.0.0-canary.6
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies []:
|
|
68
|
+
- @codefast/tailwind-variants@1.0.0-canary.6
|
|
69
|
+
|
|
3
70
|
## 0.5.0-canary.5
|
|
4
71
|
|
|
5
72
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,140 +1,102 @@
|
|
|
1
1
|
# @codefast/ui
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://github.com/codefastlabs/codefast/actions/workflows/release.yml)
|
|
6
|
-
[](https://www.npmjs.com/package/@codefast/ui)
|
|
7
|
-
[](https://www.npmjs.com/package/@codefast/ui)
|
|
8
|
-
[](https://bundlephobia.com/package/@codefast/ui)
|
|
9
|
-
[](https://opensource.org/licenses/MIT)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Table of Contents
|
|
14
|
-
|
|
15
|
-
- [Why @codefast/ui](#why-codefastui)
|
|
16
|
-
- [Requirements](#requirements)
|
|
17
|
-
- [Installation](#installation)
|
|
18
|
-
- [Styling](#styling)
|
|
19
|
-
- [With an existing Tailwind 4 setup (recommended)](#with-an-existing-tailwind-4-setup-recommended)
|
|
20
|
-
- [Standalone (no Tailwind yet)](#standalone-no-tailwind-yet)
|
|
21
|
-
- [Theme palettes](#theme-palettes)
|
|
22
|
-
- [Dark mode](#dark-mode)
|
|
23
|
-
- [Customizing tokens](#customizing-tokens)
|
|
24
|
-
- [Quick Start](#quick-start)
|
|
25
|
-
- [Component catalog](#component-catalog)
|
|
26
|
-
- [Hooks](#hooks)
|
|
27
|
-
- [Primitives and utilities](#primitives-and-utilities)
|
|
28
|
-
- [SSR with Nitro (TanStack Start)](#ssr-with-nitro-tanstack-start)
|
|
29
|
-
- [Troubleshooting](#troubleshooting)
|
|
30
|
-
- [Accessibility](#accessibility)
|
|
31
|
-
- [Browser support](#browser-support)
|
|
32
|
-
- [Contributing](#contributing)
|
|
33
|
-
- [License](#license)
|
|
34
|
-
- [Changelog](#changelog)
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Why @codefast/ui
|
|
39
|
-
|
|
40
|
-
- **62+ components** across layout, form, navigation, overlay, and data-display categories.
|
|
41
|
-
- **Built on [Radix UI](https://www.radix-ui.com/)** — keyboard navigation, focus management, and ARIA semantics come for free.
|
|
42
|
-
- **Tailwind CSS 4** tokens shipped as CSS files (`@codefast/ui/css/*`), with 22 palette variants and a dark-mode scheme.
|
|
43
|
-
- **Fully typed.** Every component exports its props (`ButtonProps`, `DialogContentProps`, …) for use in wrappers.
|
|
44
|
-
- **Side-effect-free ESM** with per-component subpaths — bundlers tree-shake to what you actually import.
|
|
45
|
-
- **Dependency-light.** Only the Radix + headless-UI libraries that each component needs are pulled in.
|
|
46
|
-
|
|
47
|
-
---
|
|
3
|
+
70+ accessible React components built on [Radix UI](https://www.radix-ui.com/) primitives and styled with Tailwind CSS 4 — fully typed, tree-shakeable, themeable.
|
|
48
4
|
|
|
49
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@codefast/ui)
|
|
6
|
+
[](https://github.com/codefastlabs/codefast/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
**[codefastlabs.com](https://codefastlabs.com)** — full documentation with live previews and copy-ready source for every component.
|
|
9
|
+
|
|
10
|
+
## Highlights
|
|
50
11
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
12
|
+
- **70+ accessible components** — keyboard navigation, focus management, and ARIA semantics come from Radix UI primitives.
|
|
13
|
+
- **Fully typed** — every component exports its prop types (`ButtonProps`, `DialogContentProps`, …) for use in wrappers.
|
|
14
|
+
- **Tree-shakeable ESM** — per-component subpath exports mean bundlers only include what you import.
|
|
15
|
+
- **Themeable in plain CSS** — 22 palettes of `oklch` design tokens, dark mode included, no JavaScript required.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
54
18
|
|
|
55
|
-
|
|
19
|
+
- React 19 (`react` and `react-dom` are peer dependencies; `@types/react` and `@types/react-dom` are optional peers)
|
|
20
|
+
- Tailwind CSS 4 at build time
|
|
56
21
|
|
|
57
22
|
## Installation
|
|
58
23
|
|
|
59
24
|
```bash
|
|
60
25
|
pnpm add @codefast/ui
|
|
61
|
-
# or
|
|
62
|
-
npm install @codefast/ui
|
|
63
|
-
# or
|
|
64
|
-
yarn add @codefast/ui
|
|
65
26
|
```
|
|
66
27
|
|
|
67
|
-
|
|
28
|
+
Or the equivalent with your package manager: `npm install @codefast/ui`, `yarn add @codefast/ui`, or `bun add @codefast/ui`.
|
|
29
|
+
|
|
30
|
+
The package is in canary pre-release on the way to 1.0. To follow the canary channel:
|
|
68
31
|
|
|
69
32
|
```bash
|
|
70
|
-
pnpm add
|
|
71
|
-
pnpm add -D @types/react @types/react-dom
|
|
33
|
+
pnpm add @codefast/ui@canary
|
|
72
34
|
```
|
|
73
35
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## Styling
|
|
77
|
-
|
|
78
|
-
`@codefast/ui` ships theme tokens and component-layer styles as CSS files under `@codefast/ui/css/*`. Pick the integration that matches your project.
|
|
79
|
-
|
|
80
|
-
### With an existing Tailwind 4 setup (recommended)
|
|
36
|
+
## Quick Start
|
|
81
37
|
|
|
82
|
-
Import
|
|
38
|
+
Import a theme and the preset after `tailwindcss` in your global stylesheet:
|
|
83
39
|
|
|
84
40
|
```css
|
|
85
|
-
/* src/styles.css (or app/globals.css, …) */
|
|
86
41
|
@import "tailwindcss";
|
|
87
|
-
|
|
88
|
-
/* @codefast/ui tokens + preset */
|
|
89
|
-
@import "@codefast/ui/css/themes/slate.css";
|
|
42
|
+
@import "@codefast/ui/css/themes/neutral.css";
|
|
90
43
|
@import "@codefast/ui/css/preset.css";
|
|
91
44
|
```
|
|
92
45
|
|
|
93
|
-
Then
|
|
46
|
+
Then use any component:
|
|
94
47
|
|
|
95
|
-
```
|
|
96
|
-
import "
|
|
48
|
+
```tsx
|
|
49
|
+
import { Button } from "@codefast/ui/button";
|
|
50
|
+
|
|
51
|
+
export function MyPage() {
|
|
52
|
+
return <Button variant="outline">Click me</Button>;
|
|
53
|
+
}
|
|
97
54
|
```
|
|
98
55
|
|
|
99
|
-
|
|
56
|
+
If your app doesn't run Tailwind itself, import the bundled stylesheet instead — it includes Tailwind 4, the neutral theme, and the preset in one file:
|
|
100
57
|
|
|
101
|
-
|
|
58
|
+
```css
|
|
59
|
+
@import "@codefast/ui/css/style.css";
|
|
60
|
+
```
|
|
102
61
|
|
|
103
|
-
|
|
62
|
+
## Per-component imports
|
|
104
63
|
|
|
105
|
-
|
|
106
|
-
|
|
64
|
+
Every component ships as its own subpath export, so bundlers only pull in what you import:
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { Button } from "@codefast/ui/button";
|
|
68
|
+
import { Dialog, DialogContent, DialogTitle, DialogTrigger } from "@codefast/ui/dialog";
|
|
107
69
|
```
|
|
108
70
|
|
|
109
|
-
|
|
71
|
+
All components and their prop types (`ButtonProps`, `DialogContentProps`, …) are also re-exported from the root entry `@codefast/ui`.
|
|
110
72
|
|
|
111
|
-
|
|
73
|
+
Beyond components, the package exposes:
|
|
112
74
|
|
|
113
|
-
|
|
75
|
+
- `@codefast/ui/hooks/*` — standalone hooks, e.g. `useMediaQuery` from `@codefast/ui/hooks/use-media-query`
|
|
76
|
+
- `@codefast/ui/variants/*` — the underlying variant functions, e.g. `buttonVariants` from `@codefast/ui/variants/button` for styling custom elements
|
|
77
|
+
- `@codefast/ui/primitives/*` — unstyled building blocks used by the styled components
|
|
78
|
+
- `@codefast/ui/lib/utils` — the `cn()` classname merge helper
|
|
114
79
|
|
|
115
|
-
|
|
116
|
-
amber · blue · cyan · emerald · fuchsia · gray · green · indigo · lime · neutral
|
|
117
|
-
orange · pink · purple · red · rose · sky · slate · stone · teal · violet · yellow · zinc
|
|
118
|
-
```
|
|
80
|
+
## Theming
|
|
119
81
|
|
|
120
|
-
|
|
82
|
+
Theme tokens live in plain CSS files. Swap `themes/neutral.css` in the import above for any palette under `@codefast/ui/css/themes/`:
|
|
121
83
|
|
|
122
|
-
|
|
84
|
+
```
|
|
85
|
+
amber · blue · cyan · emerald · fuchsia · gray · green · indigo · lime · neutral · orange
|
|
86
|
+
pink · purple · red · rose · sky · slate · stone · teal · violet · yellow · zinc
|
|
87
|
+
```
|
|
123
88
|
|
|
124
|
-
Toggle the `dark` class
|
|
89
|
+
Each palette defines light tokens on `:root` and dark tokens under `.dark`. Toggle dark mode by adding the `dark` class to `<html>` (or any ancestor):
|
|
125
90
|
|
|
126
91
|
```ts
|
|
127
92
|
document.documentElement.classList.toggle("dark", isDark);
|
|
128
93
|
```
|
|
129
94
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
### Customizing tokens
|
|
133
|
-
|
|
134
|
-
Override CSS custom properties after the imports:
|
|
95
|
+
Customize by overriding CSS custom properties after the imports:
|
|
135
96
|
|
|
136
97
|
```css
|
|
137
|
-
@import "
|
|
98
|
+
@import "tailwindcss";
|
|
99
|
+
@import "@codefast/ui/css/themes/neutral.css";
|
|
138
100
|
@import "@codefast/ui/css/preset.css";
|
|
139
101
|
|
|
140
102
|
:root {
|
|
@@ -147,270 +109,12 @@ Override CSS custom properties after the imports:
|
|
|
147
109
|
}
|
|
148
110
|
```
|
|
149
111
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
## Quick Start
|
|
153
|
-
|
|
154
|
-
```tsx
|
|
155
|
-
import { Button, Card, CardContent, CardHeader, CardTitle } from "@codefast/ui";
|
|
156
|
-
|
|
157
|
-
export function Hero() {
|
|
158
|
-
return (
|
|
159
|
-
<Card className="w-96">
|
|
160
|
-
<CardHeader>
|
|
161
|
-
<CardTitle>Welcome to Codefast UI</CardTitle>
|
|
162
|
-
</CardHeader>
|
|
163
|
-
<CardContent className="space-y-4">
|
|
164
|
-
<p>A typed React component library built on Radix and Tailwind CSS 4.</p>
|
|
165
|
-
<Button>Get started</Button>
|
|
166
|
-
</CardContent>
|
|
167
|
-
</Card>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Prefer per-component imports when you care about bundle visibility:
|
|
173
|
-
|
|
174
|
-
```tsx
|
|
175
|
-
import { Button } from "@codefast/ui/button";
|
|
176
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@codefast/ui/dialog";
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Every subpath from the table below is tree-shakeable and ships its own types.
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Component catalog
|
|
184
|
-
|
|
185
|
-
All components are also re-exported from the root entry `@codefast/ui`.
|
|
186
|
-
|
|
187
|
-
### Layout & structure
|
|
188
|
-
|
|
189
|
-
| Component | Subpath | Notes |
|
|
190
|
-
| ------------- | --------------------------- | --------------------------------------------- |
|
|
191
|
-
| `AspectRatio` | `@codefast/ui/aspect-ratio` | Maintain a consistent width/height ratio. |
|
|
192
|
-
| `Card` | `@codefast/ui/card` | Container with header/content/footer. |
|
|
193
|
-
| `Resizable` | `@codefast/ui/resizable` | Split-panel layouts (react-resizable-panels). |
|
|
194
|
-
| `ScrollArea` | `@codefast/ui/scroll-area` | Styled scroll container with custom bars. |
|
|
195
|
-
| `Separator` | `@codefast/ui/separator` | Decorative or semantic divider. |
|
|
196
|
-
| `Sidebar` | `@codefast/ui/sidebar` | App shell sidebar primitive. |
|
|
197
|
-
| `Skeleton` | `@codefast/ui/skeleton` | Loading placeholder. |
|
|
198
|
-
|
|
199
|
-
### Forms & inputs
|
|
200
|
-
|
|
201
|
-
| Component | Subpath | Notes |
|
|
202
|
-
| ---------------- | ----------------------------------------- | ----------------------------------------- |
|
|
203
|
-
| `Button` | `@codefast/ui/button` | Variants + sizes via Tailwind Variants. |
|
|
204
|
-
| `ButtonGroup` | `@codefast/ui/button-group` | Segmented button container. |
|
|
205
|
-
| `Checkbox` | `@codefast/ui/checkbox` | Single checkbox. |
|
|
206
|
-
| `CheckboxCards` | `@codefast/ui/checkbox-cards` | Card-style multi-select. |
|
|
207
|
-
| `CheckboxGroup` | `@codefast/ui/checkbox-group` | Controlled multi-select group. |
|
|
208
|
-
| `Field` / `Form` | `@codefast/ui/field`, `@codefast/ui/form` | Form primitives, integrates with RHF. |
|
|
209
|
-
| `Input` | `@codefast/ui/input` | Standard text input. |
|
|
210
|
-
| `InputGroup` | `@codefast/ui/input-group` | Prefixed / suffixed composite input. |
|
|
211
|
-
| `InputNumber` | `@codefast/ui/input-number` | Numeric stepper with keyboard support. |
|
|
212
|
-
| `InputOTP` | `@codefast/ui/input-otp` | One-time-password code input (input-otp). |
|
|
213
|
-
| `InputPassword` | `@codefast/ui/input-password` | Password field with visibility toggle. |
|
|
214
|
-
| `InputSearch` | `@codefast/ui/input-search` | Search field with clear affordance. |
|
|
215
|
-
| `Label` | `@codefast/ui/label` | Accessible form label. |
|
|
216
|
-
| `NativeSelect` | `@codefast/ui/native-select` | Styled `<select>` wrapper. |
|
|
217
|
-
| `Radio` | `@codefast/ui/radio` | Single radio button. |
|
|
218
|
-
| `RadioCards` | `@codefast/ui/radio-cards` | Card-style single-select. |
|
|
219
|
-
| `RadioGroup` | `@codefast/ui/radio-group` | Controlled single-select group. |
|
|
220
|
-
| `Select` | `@codefast/ui/select` | Rich dropdown (Radix Select). |
|
|
221
|
-
| `Slider` | `@codefast/ui/slider` | Range slider. |
|
|
222
|
-
| `Switch` | `@codefast/ui/switch` | Boolean toggle. |
|
|
223
|
-
| `Textarea` | `@codefast/ui/textarea` | Multi-line input. |
|
|
224
|
-
| `Toggle` | `@codefast/ui/toggle` | Pressable toggle button. |
|
|
225
|
-
| `ToggleGroup` | `@codefast/ui/toggle-group` | Grouped toggles. |
|
|
226
|
-
|
|
227
|
-
### Navigation
|
|
228
|
-
|
|
229
|
-
| Component | Subpath | Notes |
|
|
230
|
-
| ---------------- | ------------------------------ | --------------------------- |
|
|
231
|
-
| `Breadcrumb` | `@codefast/ui/breadcrumb` | Breadcrumb trail. |
|
|
232
|
-
| `Menubar` | `@codefast/ui/menubar` | Desktop-style menubar. |
|
|
233
|
-
| `NavigationMenu` | `@codefast/ui/navigation-menu` | Top-level nav with flyouts. |
|
|
234
|
-
| `Pagination` | `@codefast/ui/pagination` | Page number controls. |
|
|
235
|
-
| `Tabs` | `@codefast/ui/tabs` | Tabbed content. |
|
|
236
|
-
|
|
237
|
-
### Overlay & feedback
|
|
238
|
-
|
|
239
|
-
| Component | Subpath | Notes |
|
|
240
|
-
| -------------- | ---------------------------- | ------------------------------------- |
|
|
241
|
-
| `AlertDialog` | `@codefast/ui/alert-dialog` | Confirm / destructive dialog. |
|
|
242
|
-
| `Command` | `@codefast/ui/command` | Command palette (cmdk). |
|
|
243
|
-
| `ContextMenu` | `@codefast/ui/context-menu` | Right-click menu. |
|
|
244
|
-
| `Dialog` | `@codefast/ui/dialog` | Modal dialog. |
|
|
245
|
-
| `Drawer` | `@codefast/ui/drawer` | Mobile-friendly drawer (vaul). |
|
|
246
|
-
| `DropdownMenu` | `@codefast/ui/dropdown-menu` | Menu triggered from a button. |
|
|
247
|
-
| `HoverCard` | `@codefast/ui/hover-card` | Rich hover preview. |
|
|
248
|
-
| `Popover` | `@codefast/ui/popover` | Floating panel anchored to a trigger. |
|
|
249
|
-
| `Sheet` | `@codefast/ui/sheet` | Side-sheet (dialog from edge). |
|
|
250
|
-
| `Sonner` | `@codefast/ui/sonner` | Toast stack (sonner). |
|
|
251
|
-
| `Tooltip` | `@codefast/ui/tooltip` | Keyboard-friendly tooltip. |
|
|
252
|
-
|
|
253
|
-
### Data display & content
|
|
254
|
-
|
|
255
|
-
| Component | Subpath | Notes |
|
|
256
|
-
| ---------------- | ------------------------------ | ------------------------------- |
|
|
257
|
-
| `Accordion` | `@codefast/ui/accordion` | Collapsible sections. |
|
|
258
|
-
| `Alert` | `@codefast/ui/alert` | Inline status message. |
|
|
259
|
-
| `Avatar` | `@codefast/ui/avatar` | User avatar with fallback. |
|
|
260
|
-
| `Badge` | `@codefast/ui/badge` | Status pill. |
|
|
261
|
-
| `Calendar` | `@codefast/ui/calendar` | Date picker (@daypicker/react). |
|
|
262
|
-
| `Carousel` | `@codefast/ui/carousel` | Slider (embla-carousel). |
|
|
263
|
-
| `Chart` | `@codefast/ui/chart` | Responsive charts (recharts). |
|
|
264
|
-
| `Collapsible` | `@codefast/ui/collapsible` | Expand/collapse primitive. |
|
|
265
|
-
| `Empty` | `@codefast/ui/empty` | Empty-state illustration block. |
|
|
266
|
-
| `Item` | `@codefast/ui/item` | List-item building block. |
|
|
267
|
-
| `Kbd` | `@codefast/ui/kbd` | Keyboard-key styling. |
|
|
268
|
-
| `Progress` | `@codefast/ui/progress` | Linear progress bar. |
|
|
269
|
-
| `ProgressCircle` | `@codefast/ui/progress-circle` | Circular progress indicator. |
|
|
270
|
-
| `Spinner` | `@codefast/ui/spinner` | Busy indicator. |
|
|
271
|
-
| `Table` | `@codefast/ui/table` | Semantic table + styled cells. |
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
## Hooks
|
|
276
|
-
|
|
277
|
-
Available from `@codefast/ui/hooks/*`:
|
|
278
|
-
|
|
279
|
-
| Hook | Subpath | Purpose |
|
|
280
|
-
| --------------------- | ------------------------------------------ | ------------------------------------------------ |
|
|
281
|
-
| `useAnimatedValue` | `@codefast/ui/hooks/use-animated-value` | Tween a number over time with easing control. |
|
|
282
|
-
| `useCopyToClipboard` | `@codefast/ui/hooks/use-copy-to-clipboard` | Clipboard write with success state. |
|
|
283
|
-
| `useIsMobile` | `@codefast/ui/hooks/use-is-mobile` | Boolean for the standard mobile breakpoint. |
|
|
284
|
-
| `useMediaQuery` | `@codefast/ui/hooks/use-media-query` | Subscribe to a `matchMedia` query, SSR-safe. |
|
|
285
|
-
| `useMutationObserver` | `@codefast/ui/hooks/use-mutation-observer` | Run a callback on DOM mutations. |
|
|
286
|
-
| `usePagination` | `@codefast/ui/hooks/use-pagination` | Page range / ellipsis helper for pagination UIs. |
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
## Primitives and utilities
|
|
291
|
-
|
|
292
|
-
Low-level building blocks, used internally by the styled components, exposed for custom wrappers.
|
|
293
|
-
|
|
294
|
-
| Import | Contents |
|
|
295
|
-
| ----------------------------------------- | -------------------------------------------------------- |
|
|
296
|
-
| `@codefast/ui/primitives/input` | Unstyled controlled-input primitive. |
|
|
297
|
-
| `@codefast/ui/primitives/input-number` | Numeric stepper logic (keyboard, parsing, clamp). |
|
|
298
|
-
| `@codefast/ui/primitives/checkbox-group` | Controlled checkbox-group state machine. |
|
|
299
|
-
| `@codefast/ui/primitives/progress-circle` | Math + a11y primitive for circular progress. |
|
|
300
|
-
| `@codefast/ui/lib/utils` | `cn()` — classname merge helper used by every component. |
|
|
301
|
-
| `@codefast/ui/css/themes/*` | Theme palette CSS files (see [Styling](#styling)). |
|
|
302
|
-
| `@codefast/ui/css/preset.css` | Tailwind preset: variants, `cf-*` utilities, base layer. |
|
|
303
|
-
| `@codefast/ui/css/style.css` | Bundled Tailwind + default palette + preset. |
|
|
304
|
-
|
|
305
|
-
```tsx
|
|
306
|
-
import { cn } from "@codefast/ui/lib/utils";
|
|
307
|
-
|
|
308
|
-
const classes = cn("rounded-md px-3 py-1", disabled && "opacity-50");
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
---
|
|
312
|
-
|
|
313
|
-
## SSR with Nitro (TanStack Start)
|
|
314
|
-
|
|
315
|
-
If you ship TanStack Start behind **[Nitro](https://v3.nitro.build/)** and **Vite 8 (Rolldown)**, you may hit a server-side `TypeError` referencing `__extends` or `__toESM(...).default` during route loaders or SSR. It originates from CJS `tslib` usage inside overlay-related dependencies (Dialog, Sheet, Menu, …) that reach for `react-remove-scroll-bar` and friends.
|
|
316
|
-
|
|
317
|
-
**Fix** — make Nitro resolve the ESM entry points of those packages via the `module` export condition. Pass it to the `nitro` plugin so the server build picks ESM over CJS:
|
|
318
|
-
|
|
319
|
-
```ts
|
|
320
|
-
// vite.config.ts
|
|
321
|
-
import { defineConfig } from "vite";
|
|
322
|
-
import { nitro } from "nitro/vite";
|
|
323
|
-
|
|
324
|
-
export default defineConfig({
|
|
325
|
-
plugins: [
|
|
326
|
-
// tanstackStart(), …
|
|
327
|
-
nitro({ exportConditions: ["module"] }),
|
|
328
|
-
],
|
|
329
|
-
});
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
Keep the client `resolve.conditions` aligned with the server so both sides resolve the same entry points — a mismatch can otherwise surface as a hydration warning:
|
|
333
|
-
|
|
334
|
-
```ts
|
|
335
|
-
export default defineConfig({
|
|
336
|
-
resolve: {
|
|
337
|
-
conditions: ["module"],
|
|
338
|
-
},
|
|
339
|
-
// …
|
|
340
|
-
});
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
## Troubleshooting
|
|
346
|
-
|
|
347
|
-
| Issue | Fix |
|
|
348
|
-
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
|
|
349
|
-
| Components render unstyled | Make sure CSS imports run before the first component mounts (import from the app entry). |
|
|
350
|
-
| Tailwind output is duplicated | Use the palette + `preset.css` import — don't also import `css/style.css` in the same app. |
|
|
351
|
-
| Dark mode doesn't apply | Add the `dark` class to `<html>` (or any ancestor). See [Dark mode](#dark-mode). |
|
|
352
|
-
| `Cannot destructure property '__extends'` in SSR | Pass `exportConditions: ["module"]` to the `nitro` plugin (see above). |
|
|
353
|
-
| Missing font or radius after palette switch | Re-import the palette **before** `preset.css`. Preset depends on palette variables being defined. |
|
|
354
|
-
|
|
355
|
-
---
|
|
356
|
-
|
|
357
|
-
## Accessibility
|
|
358
|
-
|
|
359
|
-
Every component inherits Radix's accessibility guarantees and is audited with `jest-axe` in the test suite:
|
|
360
|
-
|
|
361
|
-
- Full keyboard navigation (`Tab`, arrows, `Enter` / `Space`, `Escape`, `Home` / `End`).
|
|
362
|
-
- Correct ARIA roles, `aria-expanded`, `aria-controls`, and live regions where relevant.
|
|
363
|
-
- Focus trap + restore for overlays (Dialog, AlertDialog, Sheet, Drawer, DropdownMenu, …).
|
|
364
|
-
- Respects `prefers-reduced-motion`.
|
|
365
|
-
- High-contrast friendly color tokens — palettes use `oklch` and ship explicit `--ring`, `--border` values.
|
|
366
|
-
|
|
367
|
-
---
|
|
368
|
-
|
|
369
|
-
## Browser support
|
|
370
|
-
|
|
371
|
-
Last two versions of Chrome, Edge, Firefox, and Safari. Internet Explorer is not supported.
|
|
372
|
-
|
|
373
|
-
---
|
|
374
|
-
|
|
375
|
-
## Contributing
|
|
376
|
-
|
|
377
|
-
This package lives in the [Codefast monorepo](https://github.com/codefastlabs/codefast). From the repo root:
|
|
378
|
-
|
|
379
|
-
```bash
|
|
380
|
-
pnpm --filter @codefast/ui build
|
|
381
|
-
pnpm --filter @codefast/ui dev # watch build via tsdown
|
|
382
|
-
pnpm --filter @codefast/ui test
|
|
383
|
-
pnpm --filter @codefast/ui test:coverage
|
|
384
|
-
pnpm --filter @codefast/ui check-types
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
Adding a component:
|
|
388
|
-
|
|
389
|
-
1. Implement it under `src/components/<name>.tsx`.
|
|
390
|
-
2. Export the component and its prop types from `src/index.ts`.
|
|
391
|
-
3. Add a new subpath entry in `package.json → exports` following the existing pattern.
|
|
392
|
-
4. Add tests under `src/components/__tests__` (unit + `jest-axe` if interactive).
|
|
393
|
-
5. Run `pnpm --filter @codefast/ui build` to verify `tsdown` picks up the new entry.
|
|
394
|
-
|
|
395
|
-
CSS exports under `@codefast/ui/css/*` map to `src/css/`:
|
|
112
|
+
## Documentation
|
|
396
113
|
|
|
397
|
-
|
|
398
|
-
css/
|
|
399
|
-
├── style.css # Tailwind + themes/neutral + preset
|
|
400
|
-
├── preset.css # Aggregates foundation + utilities
|
|
401
|
-
├── foundation/ # source, variants, tokens, motion, base
|
|
402
|
-
├── utilities/ # shared + component utilities referenced in TSX
|
|
403
|
-
└── themes/ # amber.css … zinc.css
|
|
404
|
-
```
|
|
114
|
+
Browse the full component gallery — live previews, usage examples, and copy-ready source — at **[codefastlabs.com](https://codefastlabs.com)**.
|
|
405
115
|
|
|
406
|
-
|
|
116
|
+
The package is developed in the [codefast monorepo](https://github.com/codefastlabs/codefast); see the [changelog](https://github.com/codefastlabs/codefast/blob/main/packages/ui/CHANGELOG.md) for release history.
|
|
407
117
|
|
|
408
118
|
## License
|
|
409
119
|
|
|
410
|
-
[MIT](https://
|
|
411
|
-
|
|
412
|
-
---
|
|
413
|
-
|
|
414
|
-
## Changelog
|
|
415
|
-
|
|
416
|
-
See [CHANGELOG.md](./CHANGELOG.md) for the full version history. Releases are also published on [npm](https://www.npmjs.com/package/@codefast/ui?activeTab=versions).
|
|
120
|
+
[MIT](https://github.com/codefastlabs/codefast/blob/main/LICENSE)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as AccordionPrimitive from "radix-ui/accordion";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
type AccordionProps = ComponentProps<typeof AccordionPrimitive.Root>;
|
|
7
|
+
/**
|
|
8
|
+
* @since 0.3.16-canary.0
|
|
9
|
+
*/
|
|
10
|
+
declare function Accordion({ className, ...props }: AccordionProps): JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* @since 0.3.16-canary.0
|
|
13
|
+
*/
|
|
14
|
+
type AccordionItemProps = ComponentProps<typeof AccordionPrimitive.Item>;
|
|
15
|
+
/**
|
|
16
|
+
* @since 0.3.16-canary.0
|
|
17
|
+
*/
|
|
18
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* @since 0.3.16-canary.0
|
|
21
|
+
*/
|
|
22
|
+
type AccordionTriggerProps = ComponentProps<typeof AccordionPrimitive.Trigger>;
|
|
23
|
+
/**
|
|
24
|
+
* @since 0.3.16-canary.0
|
|
25
|
+
*/
|
|
26
|
+
declare function AccordionTrigger({ children, className, ...props }: AccordionTriggerProps): JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* @since 0.3.16-canary.0
|
|
29
|
+
*/
|
|
30
|
+
type AccordionContentProps = ComponentProps<typeof AccordionPrimitive.Content>;
|
|
31
|
+
/**
|
|
32
|
+
* @since 0.3.16-canary.0
|
|
33
|
+
*/
|
|
34
|
+
declare function AccordionContent({ children, className, ...props }: AccordionContentProps): JSX.Element;
|
|
35
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
36
|
+
export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps };
|
|
37
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,kBAAkB,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjD;;GAEG;AACH,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAErE;;GAEG;AACH,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAEvE;AAMD;;GAEG;AACH,KAAK,kBAAkB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAEzE;;GAEG;AACH,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAI/E;AAMD;;GAEG;AACH,KAAK,qBAAqB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAE/E;;GAEG;AACH,iBAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAuB/F;AAMD;;GAEG;AACH,KAAK,qBAAqB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAE/E;;GAEG;AACH,iBAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAiB/F;AAMD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC;AACxE,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
3
|
+
import * as AccordionPrimitive from "radix-ui/accordion";
|
|
4
|
+
import { cn } from "#/lib/utils";
|
|
5
|
+
/**
|
|
6
|
+
* @since 0.3.16-canary.0
|
|
7
|
+
*/
|
|
8
|
+
function Accordion({ className, ...props }) {
|
|
9
|
+
return _jsx(AccordionPrimitive.Root, { className: cn("flex w-full flex-col", className), "data-slot": "accordion", ...props });
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @since 0.3.16-canary.0
|
|
13
|
+
*/
|
|
14
|
+
function AccordionItem({ className, ...props }) {
|
|
15
|
+
return (_jsx(AccordionPrimitive.Item, { className: cn("not-last:border-b", className), "data-slot": "accordion-item", ...props }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @since 0.3.16-canary.0
|
|
19
|
+
*/
|
|
20
|
+
function AccordionTrigger({ children, className, ...props }) {
|
|
21
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { className: cn("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-start text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ms-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground", className), "data-slot": "accordion-trigger", ...props, children: [children, _jsx(ChevronDownIcon, { className: "pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden", "data-slot": "accordion-trigger-icon" }), _jsx(ChevronUpIcon, { className: "pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline", "data-slot": "accordion-trigger-icon" })] }) }));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @since 0.3.16-canary.0
|
|
25
|
+
*/
|
|
26
|
+
function AccordionContent({ children, className, ...props }) {
|
|
27
|
+
return (_jsx(AccordionPrimitive.Content, { className: "overflow-hidden text-sm ease-snappy data-open:animate-accordion-down data-open:animation-duration-expand-in data-closed:animate-accordion-up data-closed:ease-exit data-closed:animation-duration-expand-out", "data-slot": "accordion-content", ...props, children: _jsx("div", { className: cn("h-(--radix-accordion-content-height) pt-0 pb-2.5 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4", className), children: children }) }));
|
|
28
|
+
}
|
|
29
|
+
/* -----------------------------------------------------------------------------
|
|
30
|
+
* Exports
|
|
31
|
+
* -------------------------------------------------------------------------- */
|
|
32
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
33
|
+
//# sourceMappingURL=accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,kBAAkB,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAWjC;;GAEG;AACH,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAkB;IACxD,OAAO,KAAC,kBAAkB,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,eAAY,WAAW,KAAK,KAAK,GAAI,CAAC;AACxH,CAAC;AAWD;;GAEG;AACH,SAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAsB;IAChE,OAAO,CACL,KAAC,kBAAkB,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,eAAY,gBAAgB,KAAK,KAAK,GAAI,CACjH,CAAC;AACJ,CAAC;AAWD;;GAEG;AACH,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAChF,OAAO,CACL,KAAC,kBAAkB,CAAC,MAAM,IAAC,SAAS,EAAC,MAAM,YACzC,MAAC,kBAAkB,CAAC,OAAO,IACzB,SAAS,EAAE,EAAE,CACX,mfAAmf,EACnf,SAAS,CACV,eACS,mBAAmB,KACzB,KAAK,aAER,QAAQ,EACT,KAAC,eAAe,IACd,SAAS,EAAC,2EAA2E,eAC3E,wBAAwB,GAClC,EACF,KAAC,aAAa,IACZ,SAAS,EAAC,kFAAkF,eAClF,wBAAwB,GAClC,IACyB,GACH,CAC7B,CAAC;AACJ,CAAC;AAWD;;GAEG;AACH,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAChF,OAAO,CACL,KAAC,kBAAkB,CAAC,OAAO,IACzB,SAAS,EAAC,8MAA8M,eAC9M,mBAAmB,KACzB,KAAK,YAET,cACE,SAAS,EAAE,EAAE,CACX,mJAAmJ,EACnJ,SAAS,CACV,YAEA,QAAQ,GACL,GACqB,CAC9B,CAAC;AACJ,CAAC;AAED;;gFAEgF;AAEhF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC"}
|