@forthtilliath/forth-ui 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +279 -0
- package/dist/components/accordion/accordion-items.d.ts +3 -0
- package/dist/components/accordion/accordion-items.d.ts.map +1 -0
- package/dist/components/accordion/accordion-items.js +18 -0
- package/dist/components/accordion/accordion-multiple.d.ts +3 -0
- package/dist/components/accordion/accordion-multiple.d.ts.map +1 -0
- package/dist/components/accordion/accordion-multiple.js +8 -0
- package/dist/components/accordion/accordion-single.d.ts +3 -0
- package/dist/components/accordion/accordion-single.d.ts.map +1 -0
- package/dist/components/accordion/accordion-single.js +8 -0
- package/dist/components/accordion/accordion.d.ts +17 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +23 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/types.d.ts +100 -0
- package/dist/components/accordion/types.d.ts.map +1 -0
- package/dist/components/accordion/types.js +1 -0
- package/dist/components/accordion/variants.d.ts +25 -0
- package/dist/components/accordion/variants.d.ts.map +1 -0
- package/dist/components/accordion/variants.js +96 -0
- package/dist/components/alert/alert.d.ts +38 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/alert.js +32 -0
- package/dist/components/alert/index.d.ts +5 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js +4 -0
- package/dist/components/alert/variants.d.ts +8 -0
- package/dist/components/alert/variants.d.ts.map +1 -0
- package/dist/components/alert/variants.js +110 -0
- package/dist/components/avatar/avatar-group.d.ts +26 -0
- package/dist/components/avatar/avatar-group.d.ts.map +1 -0
- package/dist/components/avatar/avatar-group.js +29 -0
- package/dist/components/avatar/avatar.d.ts +107 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.js +26 -0
- package/dist/components/avatar/constants.d.ts +13 -0
- package/dist/components/avatar/constants.d.ts.map +1 -0
- package/dist/components/avatar/constants.js +8 -0
- package/dist/components/avatar/index.d.ts +5 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/avatar/variants.d.ts +31 -0
- package/dist/components/avatar/variants.d.ts.map +1 -0
- package/dist/components/avatar/variants.js +147 -0
- package/dist/components/badge/badge.d.ts +48 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.js +33 -0
- package/dist/components/badge/index.d.ts +4 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/badge/variants.d.ts +12 -0
- package/dist/components/badge/variants.d.ts.map +1 -0
- package/dist/components/badge/variants.js +134 -0
- package/dist/components/banner/banner.d.ts +43 -0
- package/dist/components/banner/banner.d.ts.map +1 -0
- package/dist/components/banner/banner.js +44 -0
- package/dist/components/banner/index.d.ts +4 -0
- package/dist/components/banner/index.d.ts.map +1 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/banner/variants.d.ts +9 -0
- package/dist/components/banner/variants.d.ts.map +1 -0
- package/dist/components/banner/variants.js +111 -0
- package/dist/components/bento-grid/bento-grid.d.ts +23 -0
- package/dist/components/bento-grid/bento-grid.d.ts.map +1 -0
- package/dist/components/bento-grid/bento-grid.js +30 -0
- package/dist/components/bento-grid/index.d.ts +3 -0
- package/dist/components/bento-grid/index.d.ts.map +1 -0
- package/dist/components/bento-grid/index.js +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +29 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.js +28 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/button/button-group.d.ts +16 -0
- package/dist/components/button/button-group.d.ts.map +1 -0
- package/dist/components/button/button-group.js +13 -0
- package/dist/components/button/button.d.ts +28 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +20 -0
- package/dist/components/button/index.d.ts +6 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/button/variants.d.ts +7 -0
- package/dist/components/button/variants.d.ts.map +1 -0
- package/dist/components/button/variants.js +27 -0
- package/dist/components/checkbox/checkbox-group.d.ts +30 -0
- package/dist/components/checkbox/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox-group.js +32 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/chip.d.ts +27 -0
- package/dist/components/chip/chip.d.ts.map +1 -0
- package/dist/components/chip/chip.js +18 -0
- package/dist/components/chip/index.d.ts +3 -0
- package/dist/components/chip/index.d.ts.map +1 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/code-block/code-block.d.ts +31 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/code-block.js +57 -0
- package/dist/components/code-block/index.d.ts +3 -0
- package/dist/components/code-block/index.d.ts.map +1 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/collapsible/collapsible.d.ts +41 -0
- package/dist/components/collapsible/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.js +50 -0
- package/dist/components/collapsible/index.d.ts +7 -0
- package/dist/components/collapsible/index.d.ts.map +1 -0
- package/dist/components/collapsible/index.js +3 -0
- package/dist/components/color-picker/color-picker.d.ts +24 -0
- package/dist/components/color-picker/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker.js +40 -0
- package/dist/components/color-picker/index.d.ts +3 -0
- package/dist/components/color-picker/index.d.ts.map +1 -0
- package/dist/components/color-picker/index.js +1 -0
- package/dist/components/combobox/combobox.d.ts +31 -0
- package/dist/components/combobox/combobox.d.ts.map +1 -0
- package/dist/components/combobox/combobox.js +30 -0
- package/dist/components/combobox/index.d.ts +5 -0
- package/dist/components/combobox/index.d.ts.map +1 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/combobox/multi-select.d.ts +30 -0
- package/dist/components/combobox/multi-select.d.ts.map +1 -0
- package/dist/components/combobox/multi-select.js +53 -0
- package/dist/components/command-palette/command-palette.d.ts +37 -0
- package/dist/components/command-palette/command-palette.d.ts.map +1 -0
- package/dist/components/command-palette/command-palette.js +46 -0
- package/dist/components/command-palette/index.d.ts +3 -0
- package/dist/components/command-palette/index.d.ts.map +1 -0
- package/dist/components/command-palette/index.js +1 -0
- package/dist/components/confirm-dialog/confirm-context.d.ts +15 -0
- package/dist/components/confirm-dialog/confirm-context.d.ts.map +1 -0
- package/dist/components/confirm-dialog/confirm-context.js +2 -0
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +18 -0
- package/dist/components/confirm-dialog/confirm-dialog.d.ts.map +1 -0
- package/dist/components/confirm-dialog/confirm-dialog.js +40 -0
- package/dist/components/confirm-dialog/index.d.ts +4 -0
- package/dist/components/confirm-dialog/index.d.ts.map +1 -0
- package/dist/components/confirm-dialog/index.js +2 -0
- package/dist/components/confirm-dialog/use-confirm.d.ts +4 -0
- package/dist/components/confirm-dialog/use-confirm.d.ts.map +1 -0
- package/dist/components/confirm-dialog/use-confirm.js +10 -0
- package/dist/components/count-animation/count-animation.d.ts +20 -0
- package/dist/components/count-animation/count-animation.d.ts.map +1 -0
- package/dist/components/count-animation/count-animation.js +42 -0
- package/dist/components/count-animation/index.d.ts +3 -0
- package/dist/components/count-animation/index.d.ts.map +1 -0
- package/dist/components/count-animation/index.js +1 -0
- package/dist/components/date-picker/date-picker.d.ts +27 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.js +37 -0
- package/dist/components/date-picker/index.d.ts +3 -0
- package/dist/components/date-picker/index.d.ts.map +1 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/description-list/description-list.d.ts +16 -0
- package/dist/components/description-list/description-list.d.ts.map +1 -0
- package/dist/components/description-list/description-list.js +24 -0
- package/dist/components/description-list/index.d.ts +2 -0
- package/dist/components/description-list/index.d.ts.map +1 -0
- package/dist/components/description-list/index.js +1 -0
- package/dist/components/dropdrawer/dropdrawer.d.ts +27 -0
- package/dist/components/dropdrawer/dropdrawer.d.ts.map +1 -0
- package/dist/components/dropdrawer/dropdrawer.js +26 -0
- package/dist/components/dropdrawer/index.d.ts +3 -0
- package/dist/components/dropdrawer/index.d.ts.map +1 -0
- package/dist/components/dropdrawer/index.js +1 -0
- package/dist/components/dropzone/dropzone.d.ts +27 -0
- package/dist/components/dropzone/dropzone.d.ts.map +1 -0
- package/dist/components/dropzone/dropzone.js +83 -0
- package/dist/components/dropzone/index.d.ts +3 -0
- package/dist/components/dropzone/index.d.ts.map +1 -0
- package/dist/components/dropzone/index.js +1 -0
- package/dist/components/field/field.d.ts +41 -0
- package/dist/components/field/field.d.ts.map +1 -0
- package/dist/components/field/field.js +48 -0
- package/dist/components/field/index.d.ts +3 -0
- package/dist/components/field/index.d.ts.map +1 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/file-list/file-list.d.ts +29 -0
- package/dist/components/file-list/file-list.d.ts.map +1 -0
- package/dist/components/file-list/file-list.js +52 -0
- package/dist/components/file-list/index.d.ts +3 -0
- package/dist/components/file-list/index.d.ts.map +1 -0
- package/dist/components/file-list/index.js +1 -0
- package/dist/components/grid/context.d.ts +12 -0
- package/dist/components/grid/context.d.ts.map +1 -0
- package/dist/components/grid/context.js +5 -0
- package/dist/components/grid/grid-item.d.ts +14 -0
- package/dist/components/grid/grid-item.d.ts.map +1 -0
- package/dist/components/grid/grid-item.js +13 -0
- package/dist/components/grid/grid.d.ts +16 -0
- package/dist/components/grid/grid.d.ts.map +1 -0
- package/dist/components/grid/grid.js +19 -0
- package/dist/components/grid/index.d.ts +3 -0
- package/dist/components/grid/index.d.ts.map +1 -0
- package/dist/components/grid/index.js +2 -0
- package/dist/components/grid/variants.d.ts +16 -0
- package/dist/components/grid/variants.d.ts.map +1 -0
- package/dist/components/grid/variants.js +74 -0
- package/dist/components/image-input/image-input.d.ts +21 -0
- package/dist/components/image-input/image-input.d.ts.map +1 -0
- package/dist/components/image-input/image-input.js +45 -0
- package/dist/components/image-input/index.d.ts +3 -0
- package/dist/components/image-input/index.d.ts.map +1 -0
- package/dist/components/image-input/index.js +1 -0
- package/dist/components/infinite-scroll/index.d.ts +3 -0
- package/dist/components/infinite-scroll/index.d.ts.map +1 -0
- package/dist/components/infinite-scroll/index.js +1 -0
- package/dist/components/infinite-scroll/infinite-scroll.d.ts +20 -0
- package/dist/components/infinite-scroll/infinite-scroll.d.ts.map +1 -0
- package/dist/components/infinite-scroll/infinite-scroll.js +33 -0
- package/dist/components/kbd/index.d.ts +2 -0
- package/dist/components/kbd/index.d.ts.map +1 -0
- package/dist/components/kbd/index.js +1 -0
- package/dist/components/kbd/kbd.d.ts +15 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -0
- package/dist/components/kbd/kbd.js +19 -0
- package/dist/components/link/index.d.ts +7 -0
- package/dist/components/link/index.d.ts.map +1 -0
- package/dist/components/link/index.js +3 -0
- package/dist/components/link/link-preview.d.ts +36 -0
- package/dist/components/link/link-preview.d.ts.map +1 -0
- package/dist/components/link/link-preview.js +27 -0
- package/dist/components/link/link.d.ts +27 -0
- package/dist/components/link/link.d.ts.map +1 -0
- package/dist/components/link/link.js +39 -0
- package/dist/components/link/variants.d.ts +8 -0
- package/dist/components/link/variants.d.ts.map +1 -0
- package/dist/components/link/variants.js +26 -0
- package/dist/components/marquee/index.d.ts +3 -0
- package/dist/components/marquee/index.d.ts.map +1 -0
- package/dist/components/marquee/index.js +1 -0
- package/dist/components/marquee/marquee.d.ts +22 -0
- package/dist/components/marquee/marquee.d.ts.map +1 -0
- package/dist/components/marquee/marquee.js +19 -0
- package/dist/components/multi-step-loader/index.d.ts +3 -0
- package/dist/components/multi-step-loader/index.d.ts.map +1 -0
- package/dist/components/multi-step-loader/index.js +1 -0
- package/dist/components/multi-step-loader/multi-step-loader.d.ts +41 -0
- package/dist/components/multi-step-loader/multi-step-loader.d.ts.map +1 -0
- package/dist/components/multi-step-loader/multi-step-loader.js +53 -0
- package/dist/components/navbar/index.d.ts +5 -0
- package/dist/components/navbar/index.d.ts.map +1 -0
- package/dist/components/navbar/index.js +2 -0
- package/dist/components/navbar/navbar-mobile-menu.d.ts +24 -0
- package/dist/components/navbar/navbar-mobile-menu.d.ts.map +1 -0
- package/dist/components/navbar/navbar-mobile-menu.js +18 -0
- package/dist/components/navbar/navbar.d.ts +24 -0
- package/dist/components/navbar/navbar.d.ts.map +1 -0
- package/dist/components/navbar/navbar.js +33 -0
- package/dist/components/notification-center/index.d.ts +3 -0
- package/dist/components/notification-center/index.d.ts.map +1 -0
- package/dist/components/notification-center/index.js +1 -0
- package/dist/components/notification-center/notification-center.d.ts +28 -0
- package/dist/components/notification-center/notification-center.d.ts.map +1 -0
- package/dist/components/notification-center/notification-center.js +24 -0
- package/dist/components/number-input/index.d.ts +3 -0
- package/dist/components/number-input/index.d.ts.map +1 -0
- package/dist/components/number-input/index.js +1 -0
- package/dist/components/number-input/number-input.d.ts +22 -0
- package/dist/components/number-input/number-input.d.ts.map +1 -0
- package/dist/components/number-input/number-input.js +37 -0
- package/dist/components/pagination/index.d.ts +5 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +2 -0
- package/dist/components/pagination/pagination-range.d.ts +17 -0
- package/dist/components/pagination/pagination-range.d.ts.map +1 -0
- package/dist/components/pagination/pagination-range.js +30 -0
- package/dist/components/pagination/pagination.d.ts +26 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/pagination/pagination.js +48 -0
- package/dist/components/password-input/index.d.ts +5 -0
- package/dist/components/password-input/index.d.ts.map +1 -0
- package/dist/components/password-input/index.js +2 -0
- package/dist/components/password-input/password-input.d.ts +15 -0
- package/dist/components/password-input/password-input.d.ts.map +1 -0
- package/dist/components/password-input/password-input.js +23 -0
- package/dist/components/password-input/password-strength-meter.d.ts +18 -0
- package/dist/components/password-input/password-strength-meter.d.ts.map +1 -0
- package/dist/components/password-input/password-strength-meter.js +40 -0
- package/dist/components/progress/index.d.ts +4 -0
- package/dist/components/progress/index.d.ts.map +1 -0
- package/dist/components/progress/index.js +1 -0
- package/dist/components/progress/progress.d.ts +25 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/progress.js +23 -0
- package/dist/components/progress/variants.d.ts +7 -0
- package/dist/components/progress/variants.d.ts.map +1 -0
- package/dist/components/progress/variants.js +25 -0
- package/dist/components/qr-code/index.d.ts +3 -0
- package/dist/components/qr-code/index.d.ts.map +1 -0
- package/dist/components/qr-code/index.js +1 -0
- package/dist/components/qr-code/qr-code.d.ts +28 -0
- package/dist/components/qr-code/qr-code.d.ts.map +1 -0
- package/dist/components/qr-code/qr-code.js +27 -0
- package/dist/components/radio/index.d.ts +3 -0
- package/dist/components/radio/index.d.ts.map +1 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/radio/radio-card.d.ts +25 -0
- package/dist/components/radio/radio-card.d.ts.map +1 -0
- package/dist/components/radio/radio-card.js +24 -0
- package/dist/components/rating/index.d.ts +3 -0
- package/dist/components/rating/index.d.ts.map +1 -0
- package/dist/components/rating/index.js +1 -0
- package/dist/components/rating/rating.d.ts +23 -0
- package/dist/components/rating/rating.d.ts.map +1 -0
- package/dist/components/rating/rating.js +41 -0
- package/dist/components/relative-time/index.d.ts +3 -0
- package/dist/components/relative-time/index.d.ts.map +1 -0
- package/dist/components/relative-time/index.js +1 -0
- package/dist/components/relative-time/relative-time.d.ts +32 -0
- package/dist/components/relative-time/relative-time.d.ts.map +1 -0
- package/dist/components/relative-time/relative-time.js +62 -0
- package/dist/components/reparent/index.d.ts +3 -0
- package/dist/components/reparent/index.d.ts.map +1 -0
- package/dist/components/reparent/index.js +1 -0
- package/dist/components/reparent/reparent.d.ts +31 -0
- package/dist/components/reparent/reparent.d.ts.map +1 -0
- package/dist/components/reparent/reparent.js +51 -0
- package/dist/components/repeat/index.d.ts +2 -0
- package/dist/components/repeat/index.d.ts.map +1 -0
- package/dist/components/repeat/index.js +1 -0
- package/dist/components/repeat/repeat.d.ts +27 -0
- package/dist/components/repeat/repeat.d.ts.map +1 -0
- package/dist/components/repeat/repeat.js +15 -0
- package/dist/components/scroll-progress/index.d.ts +3 -0
- package/dist/components/scroll-progress/index.d.ts.map +1 -0
- package/dist/components/scroll-progress/index.js +1 -0
- package/dist/components/scroll-progress/scroll-progress.d.ts +19 -0
- package/dist/components/scroll-progress/scroll-progress.d.ts.map +1 -0
- package/dist/components/scroll-progress/scroll-progress.js +36 -0
- package/dist/components/scroll-shadow/index.d.ts +3 -0
- package/dist/components/scroll-shadow/index.d.ts.map +1 -0
- package/dist/components/scroll-shadow/index.js +1 -0
- package/dist/components/scroll-shadow/scroll-shadow.d.ts +20 -0
- package/dist/components/scroll-shadow/scroll-shadow.d.ts.map +1 -0
- package/dist/components/scroll-shadow/scroll-shadow.js +44 -0
- package/dist/components/scrollspy/index.d.ts +3 -0
- package/dist/components/scrollspy/index.d.ts.map +1 -0
- package/dist/components/scrollspy/index.js +1 -0
- package/dist/components/scrollspy/use-scrollspy.d.ts +30 -0
- package/dist/components/scrollspy/use-scrollspy.d.ts.map +1 -0
- package/dist/components/scrollspy/use-scrollspy.js +35 -0
- package/dist/components/separator/index.d.ts +3 -0
- package/dist/components/separator/index.d.ts.map +1 -0
- package/dist/components/separator/index.js +1 -0
- package/dist/components/separator/separator.d.ts +22 -0
- package/dist/components/separator/separator.d.ts.map +1 -0
- package/dist/components/separator/separator.js +21 -0
- package/dist/components/snippet/index.d.ts +3 -0
- package/dist/components/snippet/index.d.ts.map +1 -0
- package/dist/components/snippet/index.js +1 -0
- package/dist/components/snippet/snippet.d.ts +25 -0
- package/dist/components/snippet/snippet.d.ts.map +1 -0
- package/dist/components/snippet/snippet.js +33 -0
- package/dist/components/sortable/index.d.ts +3 -0
- package/dist/components/sortable/index.d.ts.map +1 -0
- package/dist/components/sortable/index.js +1 -0
- package/dist/components/sortable/sortable.d.ts +22 -0
- package/dist/components/sortable/sortable.d.ts.map +1 -0
- package/dist/components/sortable/sortable.js +47 -0
- package/dist/components/spacer/index.d.ts +3 -0
- package/dist/components/spacer/index.d.ts.map +1 -0
- package/dist/components/spacer/index.js +1 -0
- package/dist/components/spacer/spacer.d.ts +24 -0
- package/dist/components/spacer/spacer.d.ts.map +1 -0
- package/dist/components/spacer/spacer.js +23 -0
- package/dist/components/spinner/index.d.ts +4 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/spinner/spinner.d.ts +22 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.js +19 -0
- package/dist/components/spinner/variants.d.ts +6 -0
- package/dist/components/spinner/variants.d.ts.map +1 -0
- package/dist/components/spinner/variants.js +13 -0
- package/dist/components/stepper/index.d.ts +3 -0
- package/dist/components/stepper/index.d.ts.map +1 -0
- package/dist/components/stepper/index.js +1 -0
- package/dist/components/stepper/stepper.d.ts +26 -0
- package/dist/components/stepper/stepper.d.ts.map +1 -0
- package/dist/components/stepper/stepper.js +27 -0
- package/dist/components/submit-button/index.d.ts +3 -0
- package/dist/components/submit-button/index.d.ts.map +1 -0
- package/dist/components/submit-button/index.js +1 -0
- package/dist/components/submit-button/submit-button.d.ts +19 -0
- package/dist/components/submit-button/submit-button.d.ts.map +1 -0
- package/dist/components/submit-button/submit-button.js +23 -0
- package/dist/components/tags-input/index.d.ts +3 -0
- package/dist/components/tags-input/index.d.ts.map +1 -0
- package/dist/components/tags-input/index.js +1 -0
- package/dist/components/tags-input/tags-input.d.ts +26 -0
- package/dist/components/tags-input/tags-input.d.ts.map +1 -0
- package/dist/components/tags-input/tags-input.js +61 -0
- package/dist/components/timeline/index.d.ts +3 -0
- package/dist/components/timeline/index.d.ts.map +1 -0
- package/dist/components/timeline/index.js +1 -0
- package/dist/components/timeline/timeline.d.ts +24 -0
- package/dist/components/timeline/timeline.d.ts.map +1 -0
- package/dist/components/timeline/timeline.js +21 -0
- package/dist/components/tree/index.d.ts +3 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/index.js +1 -0
- package/dist/components/tree/tree.d.ts +26 -0
- package/dist/components/tree/tree.d.ts.map +1 -0
- package/dist/components/tree/tree.js +32 -0
- package/dist/globals.css +3004 -0
- package/package.json +63 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/stepper/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stepper } from "./stepper";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface StepperStep {
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface StepperProps {
|
|
7
|
+
steps: StepperStep[];
|
|
8
|
+
/** The current step, 0-indexed. Steps before it are complete. */
|
|
9
|
+
value: number;
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A numbered sequence of steps for a multi-stage flow (checkout, onboarding,
|
|
15
|
+
* setup wizards), showing completed/current/upcoming state.
|
|
16
|
+
*
|
|
17
|
+
* _Inspired from multiple sources, to make a consistent and reusable component._
|
|
18
|
+
* @see https://originui.com/stepper
|
|
19
|
+
* @see https://ktui.io/docs/stepper
|
|
20
|
+
*
|
|
21
|
+
* @version 0.1.0
|
|
22
|
+
* @author Forth
|
|
23
|
+
* @copyright 2026 Forth
|
|
24
|
+
*/
|
|
25
|
+
export declare function Stepper({ steps, value, orientation, className, }: StepperProps): React.JSX.Element;
|
|
26
|
+
//# sourceMappingURL=stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../../src/components/stepper/stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,KAAK,EACL,WAA0B,EAC1B,SAAS,GACV,EAAE,YAAY,qBAkFd"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CheckIcon } from "lucide-react";
|
|
3
|
+
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
4
|
+
/**
|
|
5
|
+
* A numbered sequence of steps for a multi-stage flow (checkout, onboarding,
|
|
6
|
+
* setup wizards), showing completed/current/upcoming state.
|
|
7
|
+
*
|
|
8
|
+
* _Inspired from multiple sources, to make a consistent and reusable component._
|
|
9
|
+
* @see https://originui.com/stepper
|
|
10
|
+
* @see https://ktui.io/docs/stepper
|
|
11
|
+
*
|
|
12
|
+
* @version 0.1.0
|
|
13
|
+
* @author Forth
|
|
14
|
+
* @copyright 2026 Forth
|
|
15
|
+
*/
|
|
16
|
+
export function Stepper({ steps, value, orientation = "horizontal", className, }) {
|
|
17
|
+
return (_jsx("ol", { "data-slot": "stepper", className: cn("flex", orientation === "horizontal" ? "w-full flex-row" : "flex-col", className), children: steps.map((step, index) => {
|
|
18
|
+
const isComplete = index < value;
|
|
19
|
+
const isCurrent = index === value;
|
|
20
|
+
const isLast = index === steps.length - 1;
|
|
21
|
+
return (_jsxs("li", { className: cn("flex", orientation === "horizontal"
|
|
22
|
+
? "flex-1 flex-col items-center"
|
|
23
|
+
: "flex-row gap-3", !isLast && orientation === "horizontal" && "relative"), children: [_jsxs("div", { className: cn("flex items-center", orientation === "horizontal" ? "w-full" : "flex-col"), children: [_jsx("span", { "data-state": isComplete ? "complete" : isCurrent ? "current" : "upcoming", className: cn("border-input text-muted-foreground flex size-8 shrink-0 items-center justify-center rounded-full border text-sm font-medium", "data-[state=complete]:bg-primary data-[state=complete]:border-primary data-[state=complete]:text-primary-foreground", "data-[state=current]:border-primary data-[state=current]:text-primary"), children: isComplete ? _jsx(CheckIcon, { className: "size-4" }) : index + 1 }), !isLast && (_jsx("span", { "aria-hidden": "true", "data-state": isComplete ? "complete" : "upcoming", className: cn("bg-border data-[state=complete]:bg-primary shrink-0", orientation === "horizontal"
|
|
24
|
+
? "mx-2 h-px flex-1"
|
|
25
|
+
: "my-1 ml-4 h-6 w-px") }))] }), _jsxs("div", { className: cn(orientation === "horizontal" ? "mt-2 text-center" : "pb-6"), children: [_jsx("p", { className: cn("text-sm font-medium", isCurrent ? "text-foreground" : "text-muted-foreground"), children: step.label }), step.description !== undefined && (_jsx("p", { className: "text-muted-foreground text-xs", children: step.description }))] })] }, index));
|
|
26
|
+
}) }));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/submit-button/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SubmitButton } from "./submit-button";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ButtonProps } from "../button";
|
|
2
|
+
export type SubmitButtonProps = Omit<ButtonProps, "type" | "loading">;
|
|
3
|
+
/**
|
|
4
|
+
* A submit `Button` that shows its own loading state automatically while
|
|
5
|
+
* its parent `<form>` is submitting — via React's `useFormStatus`, so no
|
|
6
|
+
* manual pending-state prop drilling is needed (unlike `Button`'s own
|
|
7
|
+
* `loading`, which the caller controls explicitly).
|
|
8
|
+
*
|
|
9
|
+
* Must be rendered as a descendant of a `<form>` — `useFormStatus` reads
|
|
10
|
+
* that nearest parent form's pending state.
|
|
11
|
+
*
|
|
12
|
+
* @see https://shuip.xyz/components/submit-button
|
|
13
|
+
*
|
|
14
|
+
* @version 0.1.0
|
|
15
|
+
* @author Forth
|
|
16
|
+
* @copyright 2026 Forth
|
|
17
|
+
*/
|
|
18
|
+
export declare function SubmitButton(props: SubmitButtonProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=submit-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-button.d.ts","sourceRoot":"","sources":["../../../src/components/submit-button/submit-button.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAGpD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useFormStatus } from "react-dom";
|
|
4
|
+
import { Button } from "../button";
|
|
5
|
+
/**
|
|
6
|
+
* A submit `Button` that shows its own loading state automatically while
|
|
7
|
+
* its parent `<form>` is submitting — via React's `useFormStatus`, so no
|
|
8
|
+
* manual pending-state prop drilling is needed (unlike `Button`'s own
|
|
9
|
+
* `loading`, which the caller controls explicitly).
|
|
10
|
+
*
|
|
11
|
+
* Must be rendered as a descendant of a `<form>` — `useFormStatus` reads
|
|
12
|
+
* that nearest parent form's pending state.
|
|
13
|
+
*
|
|
14
|
+
* @see https://shuip.xyz/components/submit-button
|
|
15
|
+
*
|
|
16
|
+
* @version 0.1.0
|
|
17
|
+
* @author Forth
|
|
18
|
+
* @copyright 2026 Forth
|
|
19
|
+
*/
|
|
20
|
+
export function SubmitButton(props) {
|
|
21
|
+
const { pending } = useFormStatus();
|
|
22
|
+
return _jsx(Button, { type: "submit", loading: pending, ...props });
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tags-input/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TagsInput } from "./tags-input";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TagsInputProps {
|
|
3
|
+
value?: string[];
|
|
4
|
+
defaultValue?: string[];
|
|
5
|
+
onValueChange?: (value: string[]) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Maximum number of tags allowed. */
|
|
9
|
+
max?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A flexible input for adding/removing multiple tags — `Enter`/`,` commits
|
|
14
|
+
* the current text as a tag, `Backspace` on an empty input removes the
|
|
15
|
+
* last one. Renders tags as forth-ui's own dismissible `Badge`.
|
|
16
|
+
*
|
|
17
|
+
* _Inspired from multiple sources, to make a consistent and reusable component._
|
|
18
|
+
* @see https://www.hextaui.com/docs/ui/components/tag-input
|
|
19
|
+
* @see https://www.kibo-ui.com/components/tags
|
|
20
|
+
*
|
|
21
|
+
* @version 0.1.0
|
|
22
|
+
* @author Forth
|
|
23
|
+
* @copyright 2026 Forth
|
|
24
|
+
*/
|
|
25
|
+
export declare function TagsInput({ value, defaultValue, onValueChange, placeholder, disabled, max, className, }: TagsInputProps): React.JSX.Element;
|
|
26
|
+
//# sourceMappingURL=tags-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags-input.d.ts","sourceRoot":"","sources":["../../../src/components/tags-input/tags-input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,WAAwB,EACxB,QAAgB,EAChB,GAAG,EACH,SAAS,GACV,EAAE,cAAc,qBA+EhB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
5
|
+
import { Badge } from "../badge";
|
|
6
|
+
/**
|
|
7
|
+
* A flexible input for adding/removing multiple tags — `Enter`/`,` commits
|
|
8
|
+
* the current text as a tag, `Backspace` on an empty input removes the
|
|
9
|
+
* last one. Renders tags as forth-ui's own dismissible `Badge`.
|
|
10
|
+
*
|
|
11
|
+
* _Inspired from multiple sources, to make a consistent and reusable component._
|
|
12
|
+
* @see https://www.hextaui.com/docs/ui/components/tag-input
|
|
13
|
+
* @see https://www.kibo-ui.com/components/tags
|
|
14
|
+
*
|
|
15
|
+
* @version 0.1.0
|
|
16
|
+
* @author Forth
|
|
17
|
+
* @copyright 2026 Forth
|
|
18
|
+
*/
|
|
19
|
+
export function TagsInput({ value, defaultValue, onValueChange, placeholder = "Add tag…", disabled = false, max, className, }) {
|
|
20
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue ?? []);
|
|
21
|
+
const [inputValue, setInputValue] = React.useState("");
|
|
22
|
+
const tags = value ?? uncontrolledValue;
|
|
23
|
+
function update(next) {
|
|
24
|
+
setUncontrolledValue(next);
|
|
25
|
+
onValueChange?.(next);
|
|
26
|
+
}
|
|
27
|
+
function addTag(tag) {
|
|
28
|
+
const trimmed = tag.trim();
|
|
29
|
+
if (trimmed.length === 0 || tags.includes(trimmed)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (max !== undefined && tags.length >= max) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
update([...tags, trimmed]);
|
|
36
|
+
setInputValue("");
|
|
37
|
+
}
|
|
38
|
+
function removeTag(tag) {
|
|
39
|
+
update(tags.filter((t) => t !== tag));
|
|
40
|
+
}
|
|
41
|
+
function handleKeyDown(e) {
|
|
42
|
+
if (e.key === "Enter" || e.key === ",") {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
addTag(inputValue);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (e.key === "Backspace" && inputValue.length === 0) {
|
|
48
|
+
const lastTag = tags.at(-1);
|
|
49
|
+
if (lastTag !== undefined) {
|
|
50
|
+
removeTag(lastTag);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return (_jsxs("div", { "data-slot": "tags-input", className: cn("border-input focus-within:border-ring focus-within:ring-ring/50 flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-transparent px-3 py-1.5 shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]", disabled && "pointer-events-none cursor-not-allowed opacity-50", className), children: [tags.map((tag) => (_jsx(Badge, { variant: "secondary", dismissible: true, open: true, onOpenChange: () => {
|
|
55
|
+
removeTag(tag);
|
|
56
|
+
}, children: tag }, tag))), _jsx("input", { value: inputValue, onChange: (e) => {
|
|
57
|
+
setInputValue(e.target.value);
|
|
58
|
+
}, onKeyDown: handleKeyDown, onBlur: () => {
|
|
59
|
+
addTag(inputValue);
|
|
60
|
+
}, placeholder: tags.length === 0 ? placeholder : undefined, disabled: disabled, className: "placeholder:text-muted-foreground min-w-24 flex-1 bg-transparent text-sm outline-none disabled:cursor-not-allowed" })] }));
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/timeline/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Timeline } from "./timeline";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface TimelineItemData {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
date?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface TimelineProps {
|
|
9
|
+
items: TimelineItemData[];
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A vertical sequence of dated events, connected by a line.
|
|
14
|
+
*
|
|
15
|
+
* _Inspired from multiple sources, to make a consistent and reusable component._
|
|
16
|
+
* @see https://originui.com/timeline
|
|
17
|
+
* @see https://ui.aceternity.com/components/timeline
|
|
18
|
+
*
|
|
19
|
+
* @version 0.1.0
|
|
20
|
+
* @author Forth
|
|
21
|
+
* @copyright 2026 Forth
|
|
22
|
+
*/
|
|
23
|
+
export declare function Timeline({ items, className }: TimelineProps): React.JSX.Element;
|
|
24
|
+
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/components/timeline/timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,aAAa,qBAiC3D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
3
|
+
/**
|
|
4
|
+
* A vertical sequence of dated events, connected by a line.
|
|
5
|
+
*
|
|
6
|
+
* _Inspired from multiple sources, to make a consistent and reusable component._
|
|
7
|
+
* @see https://originui.com/timeline
|
|
8
|
+
* @see https://ui.aceternity.com/components/timeline
|
|
9
|
+
*
|
|
10
|
+
* @version 0.1.0
|
|
11
|
+
* @author Forth
|
|
12
|
+
* @copyright 2026 Forth
|
|
13
|
+
*/
|
|
14
|
+
export function Timeline({ items, className }) {
|
|
15
|
+
return (_jsx("ol", { "data-slot": "timeline", className: cn("grid", className), children: items.map((item, index) => {
|
|
16
|
+
const isLast = index === items.length - 1;
|
|
17
|
+
return (
|
|
18
|
+
// eslint-disable-next-line @eslint-react/no-array-index-key -- `title` is an arbitrary ReactNode with no guaranteed unique field
|
|
19
|
+
_jsxs("li", { className: "grid grid-cols-[2rem_1fr] gap-x-3", children: [_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("span", { className: "border-primary bg-background text-primary flex size-8 shrink-0 items-center justify-center rounded-full border [&>svg]:size-4", children: item.icon }), !isLast && (_jsx("span", { "aria-hidden": "true", className: "bg-border w-px flex-1" }))] }), _jsxs("div", { className: cn("grid gap-1", !isLast && "pb-6"), children: [item.date !== undefined && (_jsx("p", { className: "text-muted-foreground text-xs", children: item.date })), _jsx("p", { className: "text-sm font-medium", children: item.title }), item.description !== undefined && (_jsx("p", { className: "text-muted-foreground text-sm", children: item.description }))] })] }, index));
|
|
20
|
+
}) }));
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tree/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tree } from "./tree";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface TreeNode {
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
children?: TreeNode[];
|
|
6
|
+
}
|
|
7
|
+
export interface TreeProps {
|
|
8
|
+
data: TreeNode[];
|
|
9
|
+
defaultExpanded?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A hierarchical, expandable/collapsible list of nodes (file explorer,
|
|
14
|
+
* nested categories) — built on forth-ui's own `Collapsible` for each
|
|
15
|
+
* branch's expand animation rather than reimplementing it.
|
|
16
|
+
*
|
|
17
|
+
* _Inspired from multiple sources, to make a consistent and reusable component._
|
|
18
|
+
* @see https://originui.com/tree
|
|
19
|
+
* @see https://www.hextaui.com/docs/ui/components/tree
|
|
20
|
+
*
|
|
21
|
+
* @version 0.1.0
|
|
22
|
+
* @author Forth
|
|
23
|
+
* @copyright 2026 Forth
|
|
24
|
+
*/
|
|
25
|
+
export declare function Tree({ data, defaultExpanded, className }: TreeProps): React.JSX.Element;
|
|
26
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/components/tree/tree.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,eAAuB,EAAE,SAAS,EAAE,EAAE,SAAS,qBAS3E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronRightIcon, FileIcon, FolderIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "@forthtilliath/shadcn-ui/lib/utils";
|
|
5
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../collapsible";
|
|
6
|
+
/**
|
|
7
|
+
* A hierarchical, expandable/collapsible list of nodes (file explorer,
|
|
8
|
+
* nested categories) — built on forth-ui's own `Collapsible` for each
|
|
9
|
+
* branch's expand animation rather than reimplementing it.
|
|
10
|
+
*
|
|
11
|
+
* _Inspired from multiple sources, to make a consistent and reusable component._
|
|
12
|
+
* @see https://originui.com/tree
|
|
13
|
+
* @see https://www.hextaui.com/docs/ui/components/tree
|
|
14
|
+
*
|
|
15
|
+
* @version 0.1.0
|
|
16
|
+
* @author Forth
|
|
17
|
+
* @copyright 2026 Forth
|
|
18
|
+
*/
|
|
19
|
+
export function Tree({ data, defaultExpanded = false, className }) {
|
|
20
|
+
return (_jsx("ul", { "data-slot": "tree", className: cn("grid gap-0.5 text-sm", className), children: data.map((node, index) => (
|
|
21
|
+
// eslint-disable-next-line @eslint-react/no-array-index-key -- `label` is an arbitrary ReactNode with no guaranteed unique field
|
|
22
|
+
_jsx(TreeItem, { node: node, defaultExpanded: defaultExpanded }, index))) }));
|
|
23
|
+
}
|
|
24
|
+
function TreeItem({ node, defaultExpanded, }) {
|
|
25
|
+
const hasChildren = node.children !== undefined && node.children.length > 0;
|
|
26
|
+
if (!hasChildren) {
|
|
27
|
+
return (_jsxs("li", { className: "hover:bg-accent flex items-center gap-1.5 rounded-md px-2 py-1 pl-7", children: [node.icon ?? _jsx(FileIcon, { className: "text-muted-foreground size-4" }), node.label] }));
|
|
28
|
+
}
|
|
29
|
+
return (_jsx("li", { children: _jsxs(Collapsible, { defaultOpen: defaultExpanded, children: [_jsxs(CollapsibleTrigger, { hideChevron: true, className: "hover:bg-accent flex w-full items-center gap-1.5 rounded-md px-2 py-1 [&>svg:first-child]:transition-transform [&[data-state=open]>svg:first-child]:rotate-90", children: [_jsx(ChevronRightIcon, { className: "size-4 shrink-0" }), node.icon ?? _jsx(FolderIcon, { className: "text-muted-foreground size-4" }), node.label] }), _jsx(CollapsibleContent, { className: "pl-4", children: _jsx("ul", { className: "grid gap-0.5", children: node.children?.map((child, index) => (_jsx(TreeItem
|
|
30
|
+
// eslint-disable-next-line @eslint-react/no-array-index-key -- see above
|
|
31
|
+
, { node: child, defaultExpanded: defaultExpanded }, index))) }) })] }) }));
|
|
32
|
+
}
|