@archytechtor/ui 0.0.0-stage → 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 +105 -2
- package/dist/components/accordion/accordion.d.ts +25 -0
- package/dist/components/accordion/accordion.js +88 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/types.d.ts +39 -0
- package/dist/components/alert/alert.d.ts +25 -0
- package/dist/components/alert/alert.js +59 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/alert/index.js +3 -0
- package/dist/components/alert/types.d.ts +32 -0
- package/dist/components/alert/types.js +19 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +73 -0
- package/dist/components/alert-dialog/alert-dialog.js +170 -0
- package/dist/components/alert-dialog/index.d.ts +3 -0
- package/dist/components/alert-dialog/index.js +1 -0
- package/dist/components/alert-dialog/types.d.ts +80 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +8 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +20 -0
- package/dist/components/aspect-ratio/index.d.ts +3 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/aspect-ratio/types.d.ts +8 -0
- package/dist/components/attachment/attachment.d.ts +57 -0
- package/dist/components/attachment/attachment.js +139 -0
- package/dist/components/attachment/index.d.ts +3 -0
- package/dist/components/attachment/index.js +3 -0
- package/dist/components/attachment/types.d.ts +79 -0
- package/dist/components/attachment/types.js +43 -0
- package/dist/components/avatar/avatar.d.ts +39 -0
- package/dist/components/avatar/avatar.js +88 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/avatar/index.js +3 -0
- package/dist/components/avatar/types.d.ts +54 -0
- package/dist/components/avatar/types.js +21 -0
- package/dist/components/badge/badge.d.ts +7 -0
- package/dist/components/badge/badge.js +23 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.js +3 -0
- package/dist/components/badge/types.d.ts +21 -0
- package/dist/components/badge/types.js +26 -0
- package/dist/components/bottom-nav/bottom-nav.d.ts +19 -0
- package/dist/components/bottom-nav/bottom-nav.js +59 -0
- package/dist/components/bottom-nav/index.d.ts +3 -0
- package/dist/components/bottom-nav/index.js +3 -0
- package/dist/components/bottom-nav/types.d.ts +45 -0
- package/dist/components/bottom-nav/types.js +44 -0
- package/dist/components/box/box.d.ts +7 -0
- package/dist/components/box/box.js +26 -0
- package/dist/components/box/index.d.ts +3 -0
- package/dist/components/box/index.js +3 -0
- package/dist/components/box/types.d.ts +23 -0
- package/dist/components/box/types.js +27 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +43 -0
- package/dist/components/breadcrumb/breadcrumb.js +115 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/breadcrumb/types.d.ts +36 -0
- package/dist/components/bubble/bubble.d.ts +25 -0
- package/dist/components/bubble/bubble.js +69 -0
- package/dist/components/bubble/index.d.ts +3 -0
- package/dist/components/bubble/index.js +3 -0
- package/dist/components/bubble/types.d.ts +51 -0
- package/dist/components/bubble/types.js +60 -0
- package/dist/components/button/button.d.ts +7 -0
- package/dist/components/button/button.js +155 -0
- package/dist/components/button/index.d.ts +4 -0
- package/dist/components/button/index.js +4 -0
- package/dist/components/button/types.d.ts +80 -0
- package/dist/components/button/types.js +99 -0
- package/dist/components/button/use-hold-to-confirm.d.ts +25 -0
- package/dist/components/button/use-hold-to-confirm.js +161 -0
- package/dist/components/button-group/button-group.d.ts +20 -0
- package/dist/components/button-group/button-group.js +62 -0
- package/dist/components/button-group/index.d.ts +3 -0
- package/dist/components/button-group/index.js +3 -0
- package/dist/components/button-group/types.d.ts +30 -0
- package/dist/components/button-group/types.js +19 -0
- package/dist/components/calendar/calendar.d.ts +15 -0
- package/dist/components/calendar/calendar.js +157 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/calendar/types.d.ts +21 -0
- package/dist/components/card/card.d.ts +43 -0
- package/dist/components/card/card.js +97 -0
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/card/index.js +3 -0
- package/dist/components/card/types.d.ts +44 -0
- package/dist/components/card/types.js +19 -0
- package/dist/components/carousel/carousel.d.ts +36 -0
- package/dist/components/carousel/carousel.js +190 -0
- package/dist/components/carousel/index.d.ts +3 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/carousel/types.d.ts +79 -0
- package/dist/components/chart/chart.d.ts +35 -0
- package/dist/components/chart/chart.js +212 -0
- package/dist/components/chart/index.d.ts +3 -0
- package/dist/components/chart/index.js +1 -0
- package/dist/components/chart/types.d.ts +89 -0
- package/dist/components/chart/types.js +7 -0
- package/dist/components/checkbox/checkbox.d.ts +7 -0
- package/dist/components/checkbox/checkbox.js +31 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox/types.d.ts +25 -0
- package/dist/components/code-block/code-block.d.ts +49 -0
- package/dist/components/code-block/code-block.js +188 -0
- package/dist/components/code-block/highlighter.d.ts +15 -0
- package/dist/components/code-block/highlighter.js +123 -0
- package/dist/components/code-block/index.d.ts +5 -0
- package/dist/components/code-block/index.js +5 -0
- package/dist/components/code-block/types.d.ts +94 -0
- package/dist/components/code-block/types.js +38 -0
- package/dist/components/code-block/use-highlighted-code.d.ts +9 -0
- package/dist/components/code-block/use-highlighted-code.js +67 -0
- package/dist/components/collapsible/collapsible.d.ts +19 -0
- package/dist/components/collapsible/collapsible.js +44 -0
- package/dist/components/collapsible/index.d.ts +3 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/collapsible/types.d.ts +26 -0
- package/dist/components/combobox/combobox.d.ts +104 -0
- package/dist/components/combobox/combobox.js +365 -0
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/combobox/types.d.ts +229 -0
- package/dist/components/command/command.d.ts +55 -0
- package/dist/components/command/command.js +179 -0
- package/dist/components/command/index.d.ts +3 -0
- package/dist/components/command/index.js +1 -0
- package/dist/components/command/types.d.ts +69 -0
- package/dist/components/context-menu/context-menu.d.ts +92 -0
- package/dist/components/context-menu/context-menu.js +270 -0
- package/dist/components/context-menu/index.d.ts +3 -0
- package/dist/components/context-menu/index.js +1 -0
- package/dist/components/context-menu/types.d.ts +138 -0
- package/dist/components/data-table/data-table-features.d.ts +21 -0
- package/dist/components/data-table/data-table-features.js +22 -0
- package/dist/components/data-table/data-table.d.ts +69 -0
- package/dist/components/data-table/data-table.js +283 -0
- package/dist/components/data-table/index.d.ts +4 -0
- package/dist/components/data-table/index.js +3 -0
- package/dist/components/data-table/types.d.ts +63 -0
- package/dist/components/date-input/date-input.d.ts +7 -0
- package/dist/components/date-input/date-input.js +147 -0
- package/dist/components/date-input/index.d.ts +3 -0
- package/dist/components/date-input/index.js +1 -0
- package/dist/components/date-input/types.d.ts +27 -0
- package/dist/components/date-picker/date-picker.d.ts +7 -0
- package/dist/components/date-picker/date-picker.js +74 -0
- package/dist/components/date-picker/index.d.ts +3 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-picker/types.d.ts +38 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +7 -0
- package/dist/components/date-range-picker/date-range-picker.js +89 -0
- package/dist/components/date-range-picker/index.d.ts +3 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/date-range-picker/types.d.ts +43 -0
- package/dist/components/dialog/dialog.d.ts +61 -0
- package/dist/components/dialog/dialog.js +160 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/dialog/types.d.ts +68 -0
- package/dist/components/drawer/drawer.d.ts +69 -0
- package/dist/components/drawer/drawer.js +245 -0
- package/dist/components/drawer/index.d.ts +3 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/drawer/types.d.ts +93 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +92 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +268 -0
- package/dist/components/dropdown-menu/index.d.ts +3 -0
- package/dist/components/dropdown-menu/index.js +1 -0
- package/dist/components/dropdown-menu/types.d.ts +143 -0
- package/dist/components/empty/empty.d.ts +37 -0
- package/dist/components/empty/empty.js +84 -0
- package/dist/components/empty/index.d.ts +3 -0
- package/dist/components/empty/index.js +3 -0
- package/dist/components/empty/types.d.ts +39 -0
- package/dist/components/empty/types.js +13 -0
- package/dist/components/expanded-card/expanded-card.d.ts +43 -0
- package/dist/components/expanded-card/expanded-card.js +352 -0
- package/dist/components/expanded-card/index.d.ts +3 -0
- package/dist/components/expanded-card/index.js +1 -0
- package/dist/components/expanded-card/types.d.ts +52 -0
- package/dist/components/field/field.d.ts +62 -0
- package/dist/components/field/field.js +173 -0
- package/dist/components/field/index.d.ts +3 -0
- package/dist/components/field/index.js +3 -0
- package/dist/components/field/types.d.ts +81 -0
- package/dist/components/field/types.js +21 -0
- package/dist/components/form/form.d.ts +49 -0
- package/dist/components/form/form.js +136 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/types.d.ts +59 -0
- package/dist/components/grid/grid.d.ts +7 -0
- package/dist/components/grid/grid.js +36 -0
- package/dist/components/grid/index.d.ts +3 -0
- package/dist/components/grid/index.js +3 -0
- package/dist/components/grid/types.d.ts +35 -0
- package/dist/components/grid/types.js +102 -0
- package/dist/components/hover-card/hover-card.d.ts +19 -0
- package/dist/components/hover-card/hover-card.js +63 -0
- package/dist/components/hover-card/index.d.ts +3 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/hover-card/types.d.ts +27 -0
- package/dist/components/image-gallery/image-gallery.d.ts +8 -0
- package/dist/components/image-gallery/image-gallery.js +294 -0
- package/dist/components/image-gallery/index.d.ts +4 -0
- package/dist/components/image-gallery/index.js +3 -0
- package/dist/components/image-gallery/masonry.d.ts +11 -0
- package/dist/components/image-gallery/masonry.js +62 -0
- package/dist/components/image-gallery/types.d.ts +80 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/input.d.ts +7 -0
- package/dist/components/input/input.js +18 -0
- package/dist/components/input/types.d.ts +28 -0
- package/dist/components/input-group/index.d.ts +3 -0
- package/dist/components/input-group/index.js +3 -0
- package/dist/components/input-group/input-group.d.ts +37 -0
- package/dist/components/input-group/input-group.js +103 -0
- package/dist/components/input-group/types.d.ts +64 -0
- package/dist/components/input-group/types.js +31 -0
- package/dist/components/input-otp/index.d.ts +3 -0
- package/dist/components/input-otp/index.js +1 -0
- package/dist/components/input-otp/input-otp.d.ts +25 -0
- package/dist/components/input-otp/input-otp.js +76 -0
- package/dist/components/input-otp/types.d.ts +43 -0
- package/dist/components/item/index.d.ts +3 -0
- package/dist/components/item/index.js +3 -0
- package/dist/components/item/item.d.ts +61 -0
- package/dist/components/item/item.js +149 -0
- package/dist/components/item/types.d.ts +75 -0
- package/dist/components/item/types.js +48 -0
- package/dist/components/kbd/index.d.ts +3 -0
- package/dist/components/kbd/index.js +1 -0
- package/dist/components/kbd/kbd.d.ts +13 -0
- package/dist/components/kbd/kbd.js +30 -0
- package/dist/components/kbd/types.d.ts +9 -0
- package/dist/components/label/index.d.ts +3 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/label/label.d.ts +7 -0
- package/dist/components/label/label.js +17 -0
- package/dist/components/label/types.d.ts +8 -0
- package/dist/components/loader/index.d.ts +3 -0
- package/dist/components/loader/index.js +3 -0
- package/dist/components/loader/loader.d.ts +8 -0
- package/dist/components/loader/loader.js +386 -0
- package/dist/components/loader/types.d.ts +27 -0
- package/dist/components/loader/types.js +58 -0
- package/dist/components/marker/index.d.ts +3 -0
- package/dist/components/marker/index.js +3 -0
- package/dist/components/marker/marker.d.ts +19 -0
- package/dist/components/marker/marker.js +51 -0
- package/dist/components/marker/types.d.ts +30 -0
- package/dist/components/marker/types.js +16 -0
- package/dist/components/menubar/index.d.ts +3 -0
- package/dist/components/menubar/index.js +1 -0
- package/dist/components/menubar/menubar.d.ts +98 -0
- package/dist/components/menubar/menubar.js +284 -0
- package/dist/components/menubar/types.d.ts +146 -0
- package/dist/components/message/index.d.ts +3 -0
- package/dist/components/message/index.js +1 -0
- package/dist/components/message/message.d.ts +37 -0
- package/dist/components/message/message.js +83 -0
- package/dist/components/message/types.d.ts +32 -0
- package/dist/components/message-scroller/index.d.ts +4 -0
- package/dist/components/message-scroller/index.js +3 -0
- package/dist/components/message-scroller/message-scroller-primitive.d.ts +21 -0
- package/dist/components/message-scroller/message-scroller-primitive.js +1349 -0
- package/dist/components/message-scroller/message-scroller.d.ts +39 -0
- package/dist/components/message-scroller/message-scroller.js +103 -0
- package/dist/components/message-scroller/types.d.ts +107 -0
- package/dist/components/money-input/index.d.ts +3 -0
- package/dist/components/money-input/index.js +1 -0
- package/dist/components/money-input/money-input.d.ts +7 -0
- package/dist/components/money-input/money-input.js +143 -0
- package/dist/components/money-input/types.d.ts +20 -0
- package/dist/components/morph-image/index.d.ts +3 -0
- package/dist/components/morph-image/index.js +3 -0
- package/dist/components/morph-image/morph-image.d.ts +8 -0
- package/dist/components/morph-image/morph-image.js +155 -0
- package/dist/components/morph-image/types.d.ts +38 -0
- package/dist/components/morph-image/types.js +18 -0
- package/dist/components/native-select/index.d.ts +3 -0
- package/dist/components/native-select/index.js +3 -0
- package/dist/components/native-select/native-select.d.ts +20 -0
- package/dist/components/native-select/native-select.js +57 -0
- package/dist/components/native-select/types.d.ts +52 -0
- package/dist/components/native-select/types.js +23 -0
- package/dist/components/navigation-menu/index.d.ts +3 -0
- package/dist/components/navigation-menu/index.js +3 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +50 -0
- package/dist/components/navigation-menu/navigation-menu.js +145 -0
- package/dist/components/navigation-menu/types.d.ts +79 -0
- package/dist/components/navigation-menu/types.js +15 -0
- package/dist/components/number-stepper/index.d.ts +3 -0
- package/dist/components/number-stepper/index.js +3 -0
- package/dist/components/number-stepper/number-stepper.d.ts +9 -0
- package/dist/components/number-stepper/number-stepper.js +223 -0
- package/dist/components/number-stepper/types.d.ts +47 -0
- package/dist/components/number-stepper/types.js +174 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/pagination.d.ts +43 -0
- package/dist/components/pagination/pagination.js +121 -0
- package/dist/components/pagination/types.d.ts +37 -0
- package/dist/components/phone-input/index.d.ts +3 -0
- package/dist/components/phone-input/index.js +1 -0
- package/dist/components/phone-input/phone-input.d.ts +7 -0
- package/dist/components/phone-input/phone-input.js +54 -0
- package/dist/components/phone-input/types.d.ts +12 -0
- package/dist/components/popover/index.d.ts +3 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/popover.d.ts +37 -0
- package/dist/components/popover/popover.js +100 -0
- package/dist/components/popover/types.d.ts +51 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/index.js +1 -0
- package/dist/components/progress/progress.d.ts +32 -0
- package/dist/components/progress/progress.js +100 -0
- package/dist/components/progress/types.d.ts +31 -0
- package/dist/components/questionnaire/index.d.ts +3 -0
- package/dist/components/questionnaire/index.js +1 -0
- package/dist/components/questionnaire/questionnaire-primitive.js +1563 -0
- package/dist/components/questionnaire/questionnaire.d.ts +91 -0
- package/dist/components/questionnaire/questionnaire.js +315 -0
- package/dist/components/questionnaire/types.d.ts +203 -0
- package/dist/components/radio-group/index.d.ts +3 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/radio-group/radio-group.d.ts +13 -0
- package/dist/components/radio-group/radio-group.js +44 -0
- package/dist/components/radio-group/types.d.ts +33 -0
- package/dist/components/reorder-list/index.d.ts +3 -0
- package/dist/components/reorder-list/index.js +1 -0
- package/dist/components/reorder-list/reorder-list.d.ts +19 -0
- package/dist/components/reorder-list/reorder-list.js +279 -0
- package/dist/components/reorder-list/types.d.ts +65 -0
- package/dist/components/resizable/index.d.ts +3 -0
- package/dist/components/resizable/index.js +1 -0
- package/dist/components/resizable/resizable.d.ts +19 -0
- package/dist/components/resizable/resizable.js +44 -0
- package/dist/components/resizable/types.d.ts +89 -0
- package/dist/components/scroll-area/index.d.ts +3 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area/scroll-area.js +47 -0
- package/dist/components/scroll-area/types.d.ts +19 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/select.d.ts +61 -0
- package/dist/components/select/select.js +183 -0
- package/dist/components/select/types.d.ts +100 -0
- package/dist/components/separator/index.d.ts +3 -0
- package/dist/components/separator/index.js +1 -0
- package/dist/components/separator/separator.d.ts +7 -0
- package/dist/components/separator/separator.js +20 -0
- package/dist/components/separator/types.d.ts +9 -0
- package/dist/components/sheet/index.d.ts +3 -0
- package/dist/components/sheet/index.js +1 -0
- package/dist/components/sheet/sheet.d.ts +61 -0
- package/dist/components/sheet/sheet.js +155 -0
- package/dist/components/sheet/types.d.ts +69 -0
- package/dist/components/sidebar/index.d.ts +3 -0
- package/dist/components/sidebar/index.js +3 -0
- package/dist/components/sidebar/sidebar.d.ts +145 -0
- package/dist/components/sidebar/sidebar.js +550 -0
- package/dist/components/sidebar/types.d.ts +186 -0
- package/dist/components/sidebar/types.js +42 -0
- package/dist/components/sidebar/use-mobile.js +21 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/skeleton.d.ts +8 -0
- package/dist/components/skeleton/skeleton.js +18 -0
- package/dist/components/skeleton/types.d.ts +5 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/slider/slider.d.ts +7 -0
- package/dist/components/slider/slider.js +106 -0
- package/dist/components/slider/types.d.ts +39 -0
- package/dist/components/spinner/index.d.ts +3 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/spinner/spinner.d.ts +7 -0
- package/dist/components/spinner/spinner.js +21 -0
- package/dist/components/spinner/types.d.ts +8 -0
- package/dist/components/stack/index.d.ts +3 -0
- package/dist/components/stack/index.js +3 -0
- package/dist/components/stack/stack.d.ts +7 -0
- package/dist/components/stack/stack.js +29 -0
- package/dist/components/stack/types.d.ts +56 -0
- package/dist/components/stack/types.js +62 -0
- package/dist/components/statistics/index.d.ts +3 -0
- package/dist/components/statistics/index.js +3 -0
- package/dist/components/statistics/statistics.d.ts +31 -0
- package/dist/components/statistics/statistics.js +141 -0
- package/dist/components/statistics/types.d.ts +84 -0
- package/dist/components/statistics/types.js +27 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/switch/index.js +3 -0
- package/dist/components/switch/switch.d.ts +7 -0
- package/dist/components/switch/switch.js +32 -0
- package/dist/components/switch/types.d.ts +37 -0
- package/dist/components/switch/types.js +23 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/table.d.ts +49 -0
- package/dist/components/table/table.js +112 -0
- package/dist/components/table/types.d.ts +33 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/tabs/index.js +3 -0
- package/dist/components/tabs/tabs.d.ts +25 -0
- package/dist/components/tabs/tabs.js +81 -0
- package/dist/components/tabs/types.d.ts +61 -0
- package/dist/components/tabs/types.js +18 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/textarea.d.ts +7 -0
- package/dist/components/textarea/textarea.js +17 -0
- package/dist/components/textarea/types.d.ts +26 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toast/toast.d.ts +63 -0
- package/dist/components/toast/toast.js +321 -0
- package/dist/components/toast/types.d.ts +120 -0
- package/dist/components/toggle/index.d.ts +3 -0
- package/dist/components/toggle/index.js +3 -0
- package/dist/components/toggle/toggle.d.ts +7 -0
- package/dist/components/toggle/toggle.js +32 -0
- package/dist/components/toggle/types.d.ts +35 -0
- package/dist/components/toggle/types.js +37 -0
- package/dist/components/toggle-group/index.d.ts +3 -0
- package/dist/components/toggle-group/index.js +1 -0
- package/dist/components/toggle-group/toggle-group.d.ts +13 -0
- package/dist/components/toggle-group/toggle-group.js +88 -0
- package/dist/components/toggle-group/types.d.ts +52 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/tooltip.d.ts +25 -0
- package/dist/components/tooltip/tooltip.js +79 -0
- package/dist/components/tooltip/types.d.ts +48 -0
- package/dist/components/trace/index.d.ts +3 -0
- package/dist/components/trace/index.js +1 -0
- package/dist/components/trace/trace.d.ts +52 -0
- package/dist/components/trace/trace.js +132 -0
- package/dist/components/trace/types.d.ts +54 -0
- package/dist/components/typography/index.d.ts +3 -0
- package/dist/components/typography/index.js +3 -0
- package/dist/components/typography/types.d.ts +29 -0
- package/dist/components/typography/types.js +25 -0
- package/dist/components/typography/typography.d.ts +7 -0
- package/dist/components/typography/typography.js +40 -0
- package/dist/components/video-player/index.d.ts +6 -0
- package/dist/components/video-player/index.js +5 -0
- package/dist/components/video-player/types.d.ts +143 -0
- package/dist/components/video-player/use-video-player.js +319 -0
- package/dist/components/video-player/video-player-context.d.ts +45 -0
- package/dist/components/video-player/video-player-context.js +15 -0
- package/dist/components/video-player/video-player-controls.d.ts +38 -0
- package/dist/components/video-player/video-player-controls.js +226 -0
- package/dist/components/video-player/video-player-overlay.d.ts +13 -0
- package/dist/components/video-player/video-player-overlay.js +113 -0
- package/dist/components/video-player/video-player.d.ts +8 -0
- package/dist/components/video-player/video-player.js +139 -0
- package/dist/index.d.ts +259 -0
- package/dist/index.js +124 -0
- package/dist/lib/floating.d.ts +44 -0
- package/dist/lib/focus-source.js +51 -0
- package/dist/lib/format.d.ts +67 -0
- package/dist/lib/format.js +130 -0
- package/dist/lib/locale.d.ts +104 -0
- package/dist/lib/locale.js +103 -0
- package/dist/lib/part-props.d.ts +15 -0
- package/dist/lib/use-controllable-state.js +22 -0
- package/dist/lib/utils.d.ts +9 -0
- package/dist/lib/utils.js +16 -0
- package/dist/styles/index.css +128 -0
- package/dist/styles/theme.css +84 -0
- package/dist/styles/utilities.css +553 -0
- package/package.json +89 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CardActionPropsT, CardContentPropsT, CardDescriptionPropsT, CardFooterPropsT, CardHeaderPropsT, CardPropsT, CardTitlePropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Карточка: контейнер с шапкой, содержимым и подвалом
|
|
4
|
+
* @param props - пропсы карточки
|
|
5
|
+
* @returns карточка
|
|
6
|
+
*/
|
|
7
|
+
export declare function Card({ className, size, ...props }: CardPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Шапка карточки: заголовок, описание и действие справа
|
|
10
|
+
* @param props - пропсы шапки
|
|
11
|
+
* @returns шапка
|
|
12
|
+
*/
|
|
13
|
+
export declare function CardHeader({ className, ...props }: CardHeaderPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Заголовок карточки
|
|
16
|
+
* @param props - пропсы заголовка
|
|
17
|
+
* @returns заголовок
|
|
18
|
+
*/
|
|
19
|
+
export declare function CardTitle({ className, ...props }: CardTitlePropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Описание карточки: поясняющий текст под заголовком
|
|
22
|
+
* @param props - пропсы описания
|
|
23
|
+
* @returns описание
|
|
24
|
+
*/
|
|
25
|
+
export declare function CardDescription({ className, ...props }: CardDescriptionPropsT): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Действие в правом верхнем углу шапки: кнопка, бейдж
|
|
28
|
+
* @param props - пропсы действия
|
|
29
|
+
* @returns блок действия
|
|
30
|
+
*/
|
|
31
|
+
export declare function CardAction({ className, ...props }: CardActionPropsT): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Содержимое карточки
|
|
34
|
+
* @param props - пропсы содержимого
|
|
35
|
+
* @returns содержимое
|
|
36
|
+
*/
|
|
37
|
+
export declare function CardContent({ className, ...props }: CardContentPropsT): import("react").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* Подвал карточки: действия и дополнительная информация
|
|
40
|
+
* @param props - пропсы подвала
|
|
41
|
+
* @returns подвал
|
|
42
|
+
*/
|
|
43
|
+
export declare function CardFooter({ className, ...props }: CardFooterPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { cardVariants } from "./types.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/components/card/card.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Карточка: контейнер с шапкой, содержимым и подвалом
|
|
7
|
+
* @param props - пропсы карточки
|
|
8
|
+
* @returns карточка
|
|
9
|
+
*/
|
|
10
|
+
function Card({ className, size = "default", ...props }) {
|
|
11
|
+
const classes = cn(cardVariants({ size }), className);
|
|
12
|
+
return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
"data-slot": "card",
|
|
14
|
+
"data-size": size,
|
|
15
|
+
className: classes,
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Шапка карточки: заголовок, описание и действие справа
|
|
21
|
+
* @param props - пропсы шапки
|
|
22
|
+
* @returns шапка
|
|
23
|
+
*/
|
|
24
|
+
function CardHeader({ className, ...props }) {
|
|
25
|
+
const classes = cn("group/card-header", "@container/card-header", "grid", "auto-rows-min", "items-start", "gap-1", "rounded-t-xl", "px-(--card-spacing)", "has-data-[slot=card-action]:grid-cols-[1fr_auto]", "has-data-[slot=card-description]:grid-rows-[auto_auto]", "[.border-b]:pb-(--card-spacing)", className);
|
|
26
|
+
return /* @__PURE__ */ jsx("div", {
|
|
27
|
+
"data-slot": "card-header",
|
|
28
|
+
className: classes,
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Заголовок карточки
|
|
34
|
+
* @param props - пропсы заголовка
|
|
35
|
+
* @returns заголовок
|
|
36
|
+
*/
|
|
37
|
+
function CardTitle({ className, ...props }) {
|
|
38
|
+
const classes = cn("text-base", "leading-snug", "font-medium", "group-data-[size=sm]/card:text-sm", className);
|
|
39
|
+
return /* @__PURE__ */ jsx("div", {
|
|
40
|
+
"data-slot": "card-title",
|
|
41
|
+
className: classes,
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Описание карточки: поясняющий текст под заголовком
|
|
47
|
+
* @param props - пропсы описания
|
|
48
|
+
* @returns описание
|
|
49
|
+
*/
|
|
50
|
+
function CardDescription({ className, ...props }) {
|
|
51
|
+
const classes = cn("text-sm", "text-muted-foreground", className);
|
|
52
|
+
return /* @__PURE__ */ jsx("div", {
|
|
53
|
+
"data-slot": "card-description",
|
|
54
|
+
className: classes,
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Действие в правом верхнем углу шапки: кнопка, бейдж
|
|
60
|
+
* @param props - пропсы действия
|
|
61
|
+
* @returns блок действия
|
|
62
|
+
*/
|
|
63
|
+
function CardAction({ className, ...props }) {
|
|
64
|
+
const classes = cn("col-start-2", "row-span-2", "row-start-1", "self-start", "justify-self-end", className);
|
|
65
|
+
return /* @__PURE__ */ jsx("div", {
|
|
66
|
+
"data-slot": "card-action",
|
|
67
|
+
className: classes,
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Содержимое карточки
|
|
73
|
+
* @param props - пропсы содержимого
|
|
74
|
+
* @returns содержимое
|
|
75
|
+
*/
|
|
76
|
+
function CardContent({ className, ...props }) {
|
|
77
|
+
const classes = cn("px-(--card-spacing)", className);
|
|
78
|
+
return /* @__PURE__ */ jsx("div", {
|
|
79
|
+
"data-slot": "card-content",
|
|
80
|
+
className: classes,
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Подвал карточки: действия и дополнительная информация
|
|
86
|
+
* @param props - пропсы подвала
|
|
87
|
+
* @returns подвал
|
|
88
|
+
*/
|
|
89
|
+
function CardFooter({ className, ...props }) {
|
|
90
|
+
const classes = cn("flex", "items-center", "rounded-b-xl", "border-t", "bg-muted/50", "p-(--card-spacing)", className);
|
|
91
|
+
return /* @__PURE__ */ jsx("div", {
|
|
92
|
+
"data-slot": "card-footer",
|
|
93
|
+
className: classes,
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CardActionPropsT, CardContentPropsT, CardDescriptionPropsT, CardFooterPropsT, CardHeaderPropsT, CardPropsT, CardTitlePropsT, cardVariants } from "./types.js";
|
|
2
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.js";
|
|
3
|
+
export { Card, CardAction, type CardActionPropsT, CardContent, type CardContentPropsT, CardDescription, type CardDescriptionPropsT, CardFooter, type CardFooterPropsT, CardHeader, type CardHeaderPropsT, type CardPropsT, CardTitle, type CardTitlePropsT, cardVariants };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Стили карточки: размер задаёт отступы через CSS-переменную --card-spacing.
|
|
5
|
+
* Свои отступы — классом: className={'[--card-spacing:--spacing(6)]'}.
|
|
6
|
+
*/
|
|
7
|
+
export declare const cardVariants: (props?: ({
|
|
8
|
+
size?: "default" | "sm" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Размеры карточки
|
|
12
|
+
*/
|
|
13
|
+
export type CardVariantsT = VariantProps<typeof cardVariants>;
|
|
14
|
+
/**
|
|
15
|
+
* Пропсы карточки
|
|
16
|
+
*/
|
|
17
|
+
export type CardPropsT = ComponentProps<'div'> & {
|
|
18
|
+
/** Размер: default — отступы 16px, sm — компактные отступы 12px */
|
|
19
|
+
size?: CardVariantsT['size'];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Пропсы шапки карточки
|
|
23
|
+
*/
|
|
24
|
+
export type CardHeaderPropsT = ComponentProps<'div'>;
|
|
25
|
+
/**
|
|
26
|
+
* Пропсы заголовка карточки
|
|
27
|
+
*/
|
|
28
|
+
export type CardTitlePropsT = ComponentProps<'div'>;
|
|
29
|
+
/**
|
|
30
|
+
* Пропсы описания карточки
|
|
31
|
+
*/
|
|
32
|
+
export type CardDescriptionPropsT = ComponentProps<'div'>;
|
|
33
|
+
/**
|
|
34
|
+
* Пропсы действия в шапке карточки
|
|
35
|
+
*/
|
|
36
|
+
export type CardActionPropsT = ComponentProps<'div'>;
|
|
37
|
+
/**
|
|
38
|
+
* Пропсы содержимого карточки
|
|
39
|
+
*/
|
|
40
|
+
export type CardContentPropsT = ComponentProps<'div'>;
|
|
41
|
+
/**
|
|
42
|
+
* Пропсы подвала карточки
|
|
43
|
+
*/
|
|
44
|
+
export type CardFooterPropsT = ComponentProps<'div'>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/card/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Стили карточки: размер задаёт отступы через CSS-переменную --card-spacing.
|
|
5
|
+
* Свои отступы — классом: className={'[--card-spacing:--spacing(6)]'}.
|
|
6
|
+
*/
|
|
7
|
+
const cardVariants = cva([
|
|
8
|
+
"group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing)",
|
|
9
|
+
"text-sm text-card-foreground ring-1 ring-foreground/10",
|
|
10
|
+
"has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0",
|
|
11
|
+
"*:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl"
|
|
12
|
+
], {
|
|
13
|
+
variants: { size: {
|
|
14
|
+
default: "[--card-spacing:--spacing(4)]",
|
|
15
|
+
sm: "[--card-spacing:--spacing(3)]"
|
|
16
|
+
} },
|
|
17
|
+
defaultVariants: { size: "default" }
|
|
18
|
+
});
|
|
19
|
+
export { cardVariants };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CarouselContentPropsT, CarouselContextI, CarouselItemPropsT, CarouselNextPropsT, CarouselPreviousPropsT, CarouselPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Состояние карусели: API, направление, функции прокрутки
|
|
4
|
+
* @returns состояние из Carousel
|
|
5
|
+
*/
|
|
6
|
+
export declare function useCarousel(): CarouselContextI;
|
|
7
|
+
/**
|
|
8
|
+
* Карусель на Embla: слайды листаются свайпом, кнопками и стрелками клавиатуры
|
|
9
|
+
* @param props - пропсы карусели
|
|
10
|
+
* @returns div с role="region"
|
|
11
|
+
*/
|
|
12
|
+
export declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: CarouselPropsT): import("react").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Лента слайдов: область прокрутки с CarouselItem внутри
|
|
15
|
+
* @param props - пропсы ленты; className уходит на внутренний flex-контейнер
|
|
16
|
+
* @returns div
|
|
17
|
+
*/
|
|
18
|
+
export declare function CarouselContent({ className, ...props }: CarouselContentPropsT): import("react").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Слайд: по умолчанию во всю ширину; basis-1/2, basis-1/3 — несколько слайдов в ряд
|
|
21
|
+
* @param props - пропсы слайда
|
|
22
|
+
* @returns div с role="group"
|
|
23
|
+
*/
|
|
24
|
+
export declare function CarouselItem({ className, ...props }: CarouselItemPropsT): import("react").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* Кнопка «назад»: круглая, слева от карусели, неактивна на первом слайде
|
|
27
|
+
* @param props - пропсы кнопки; по умолчанию variant="outline", size="icon-sm"
|
|
28
|
+
* @returns кнопка
|
|
29
|
+
*/
|
|
30
|
+
export declare function CarouselPrevious({ className, variant, size, label, onClick, ...props }: CarouselPreviousPropsT): import("react").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Кнопка «вперёд»: круглая, справа от карусели, неактивна на последнем слайде
|
|
33
|
+
* @param props - пропсы кнопки; по умолчанию variant="outline", size="icon-sm"
|
|
34
|
+
* @returns кнопка
|
|
35
|
+
*/
|
|
36
|
+
export declare function CarouselNext({ className, variant, size, label, onClick, ...props }: CarouselNextPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { texts } from "../../lib/locale.js";
|
|
4
|
+
import { Button } from "../button/button.js";
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createContext, useCallback, useContext, useEffect, useEffectEvent, useState } from "react";
|
|
8
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
9
|
+
// src/components/carousel/carousel.tsx
|
|
10
|
+
/** Состояние карусели */
|
|
11
|
+
const CarouselContext = createContext(null);
|
|
12
|
+
/**
|
|
13
|
+
* Состояние карусели: API, направление, функции прокрутки
|
|
14
|
+
* @returns состояние из Carousel
|
|
15
|
+
*/
|
|
16
|
+
function useCarousel() {
|
|
17
|
+
const context = useContext(CarouselContext);
|
|
18
|
+
if (!context) throw new Error("useCarousel работает только внутри Carousel");
|
|
19
|
+
return context;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Карусель на Embla: слайды листаются свайпом, кнопками и стрелками клавиатуры
|
|
23
|
+
* @param props - пропсы карусели
|
|
24
|
+
* @returns div с role="region"
|
|
25
|
+
*/
|
|
26
|
+
function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
|
|
27
|
+
const axis = orientation === "horizontal" ? "x" : "y";
|
|
28
|
+
const [carouselRef, api] = useEmblaCarousel({
|
|
29
|
+
...opts,
|
|
30
|
+
axis
|
|
31
|
+
}, plugins);
|
|
32
|
+
const [canScrollPrev, setCanScrollPrev] = useState(false);
|
|
33
|
+
const [canScrollNext, setCanScrollNext] = useState(false);
|
|
34
|
+
const updateScroll = useCallback((carouselApi) => {
|
|
35
|
+
if (!carouselApi) return;
|
|
36
|
+
setCanScrollPrev(carouselApi.canScrollPrev());
|
|
37
|
+
setCanScrollNext(carouselApi.canScrollNext());
|
|
38
|
+
}, []);
|
|
39
|
+
const scrollPrev = useCallback(() => {
|
|
40
|
+
api?.scrollPrev();
|
|
41
|
+
}, [api]);
|
|
42
|
+
const scrollNext = useCallback(() => {
|
|
43
|
+
api?.scrollNext();
|
|
44
|
+
}, [api]);
|
|
45
|
+
/**
|
|
46
|
+
* Стрелки влево и вправо листают слайды
|
|
47
|
+
* @param event - нажатие клавиши
|
|
48
|
+
*/
|
|
49
|
+
const handleKeyDown = (event) => {
|
|
50
|
+
if (event.key === "ArrowLeft") {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
scrollPrev();
|
|
53
|
+
} else if (event.key === "ArrowRight") {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
scrollNext();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const notifyApi = useEffectEvent((carouselApi) => setApi?.(carouselApi));
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (api) notifyApi(api);
|
|
61
|
+
}, [api]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!api) return;
|
|
64
|
+
updateScroll(api);
|
|
65
|
+
api.on("reInit", updateScroll);
|
|
66
|
+
api.on("select", updateScroll);
|
|
67
|
+
return () => {
|
|
68
|
+
api.off("reInit", updateScroll);
|
|
69
|
+
api.off("select", updateScroll);
|
|
70
|
+
};
|
|
71
|
+
}, [api, updateScroll]);
|
|
72
|
+
const context = {
|
|
73
|
+
carouselRef,
|
|
74
|
+
api,
|
|
75
|
+
opts,
|
|
76
|
+
orientation,
|
|
77
|
+
scrollPrev,
|
|
78
|
+
scrollNext,
|
|
79
|
+
canScrollPrev,
|
|
80
|
+
canScrollNext
|
|
81
|
+
};
|
|
82
|
+
const classes = cn("relative", className);
|
|
83
|
+
return /* @__PURE__ */ jsx(CarouselContext.Provider, {
|
|
84
|
+
value: context,
|
|
85
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
86
|
+
onKeyDownCapture: handleKeyDown,
|
|
87
|
+
className: classes,
|
|
88
|
+
role: "region",
|
|
89
|
+
"aria-roledescription": texts.carousel,
|
|
90
|
+
"data-slot": "carousel",
|
|
91
|
+
...props,
|
|
92
|
+
children
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Лента слайдов: область прокрутки с CarouselItem внутри
|
|
98
|
+
* @param props - пропсы ленты; className уходит на внутренний flex-контейнер
|
|
99
|
+
* @returns div
|
|
100
|
+
*/
|
|
101
|
+
function CarouselContent({ className, ...props }) {
|
|
102
|
+
const { carouselRef, orientation } = useCarousel();
|
|
103
|
+
const classes = cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className);
|
|
104
|
+
return /* @__PURE__ */ jsx("div", {
|
|
105
|
+
ref: carouselRef,
|
|
106
|
+
className: "overflow-hidden",
|
|
107
|
+
"data-slot": "carousel-content",
|
|
108
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
109
|
+
className: classes,
|
|
110
|
+
...props
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Слайд: по умолчанию во всю ширину; basis-1/2, basis-1/3 — несколько слайдов в ряд
|
|
116
|
+
* @param props - пропсы слайда
|
|
117
|
+
* @returns div с role="group"
|
|
118
|
+
*/
|
|
119
|
+
function CarouselItem({ className, ...props }) {
|
|
120
|
+
const { orientation } = useCarousel();
|
|
121
|
+
const classes = cn("min-w-0", "shrink-0", "grow-0", "basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className);
|
|
122
|
+
return /* @__PURE__ */ jsx("div", {
|
|
123
|
+
role: "group",
|
|
124
|
+
"aria-roledescription": texts.slide,
|
|
125
|
+
"data-slot": "carousel-item",
|
|
126
|
+
className: classes,
|
|
127
|
+
...props
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Кнопка «назад»: круглая, слева от карусели, неактивна на первом слайде
|
|
132
|
+
* @param props - пропсы кнопки; по умолчанию variant="outline", size="icon-sm"
|
|
133
|
+
* @returns кнопка
|
|
134
|
+
*/
|
|
135
|
+
function CarouselPrevious({ className, variant = "outline", size = "icon-sm", label = texts.previousSlide, onClick, ...props }) {
|
|
136
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
137
|
+
const classes = cn("absolute", "touch-manipulation", "rounded-full", orientation === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className);
|
|
138
|
+
/**
|
|
139
|
+
* Нажатие: пролистать назад и передать событие наружу
|
|
140
|
+
* @param event - нажатие
|
|
141
|
+
*/
|
|
142
|
+
const handleClick = (event) => {
|
|
143
|
+
scrollPrev();
|
|
144
|
+
onClick?.(event);
|
|
145
|
+
};
|
|
146
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
147
|
+
"data-slot": "carousel-previous",
|
|
148
|
+
variant,
|
|
149
|
+
size,
|
|
150
|
+
className: classes,
|
|
151
|
+
disabled: !canScrollPrev,
|
|
152
|
+
onClick: handleClick,
|
|
153
|
+
...props,
|
|
154
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
155
|
+
className: "sr-only",
|
|
156
|
+
children: label
|
|
157
|
+
})]
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Кнопка «вперёд»: круглая, справа от карусели, неактивна на последнем слайде
|
|
162
|
+
* @param props - пропсы кнопки; по умолчанию variant="outline", size="icon-sm"
|
|
163
|
+
* @returns кнопка
|
|
164
|
+
*/
|
|
165
|
+
function CarouselNext({ className, variant = "outline", size = "icon-sm", label = texts.nextSlide, onClick, ...props }) {
|
|
166
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
167
|
+
const classes = cn("absolute", "touch-manipulation", "rounded-full", orientation === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className);
|
|
168
|
+
/**
|
|
169
|
+
* Нажатие: пролистать вперёд и передать событие наружу
|
|
170
|
+
* @param event - нажатие
|
|
171
|
+
*/
|
|
172
|
+
const handleClick = (event) => {
|
|
173
|
+
scrollNext();
|
|
174
|
+
onClick?.(event);
|
|
175
|
+
};
|
|
176
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
177
|
+
"data-slot": "carousel-next",
|
|
178
|
+
variant,
|
|
179
|
+
size,
|
|
180
|
+
className: classes,
|
|
181
|
+
disabled: !canScrollNext,
|
|
182
|
+
onClick: handleClick,
|
|
183
|
+
...props,
|
|
184
|
+
children: [/* @__PURE__ */ jsx(ChevronRightIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
185
|
+
className: "sr-only",
|
|
186
|
+
children: label
|
|
187
|
+
})]
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CarouselApiT, CarouselContentPropsT, CarouselContextI, CarouselItemPropsT, CarouselNextPropsT, CarouselOptionsT, CarouselOrientationT, CarouselPluginT, CarouselPreviousPropsT, CarouselPropsT } from "./types.js";
|
|
2
|
+
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel } from "./carousel.js";
|
|
3
|
+
export { Carousel, type CarouselApiT, CarouselContent, type CarouselContentPropsT, type CarouselContextI, CarouselItem, type CarouselItemPropsT, CarouselNext, type CarouselNextPropsT, type CarouselOptionsT, type CarouselOrientationT, type CarouselPluginT, CarouselPrevious, type CarouselPreviousPropsT, type CarouselPropsT, useCarousel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel } from "./carousel.js";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ButtonPropsT } from "../button/types.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
4
|
+
/**
|
|
5
|
+
* API карусели Embla: scrollTo(), selectedScrollSnap(), on('select')…
|
|
6
|
+
*/
|
|
7
|
+
export type CarouselApiT = UseEmblaCarouselType[1];
|
|
8
|
+
/**
|
|
9
|
+
* Параметры useEmblaCarousel
|
|
10
|
+
*/
|
|
11
|
+
export type UseCarouselParametersT = Parameters<typeof useEmblaCarousel>;
|
|
12
|
+
/**
|
|
13
|
+
* Настройки Embla: loop, align, slidesToScroll…
|
|
14
|
+
*/
|
|
15
|
+
export type CarouselOptionsT = UseCarouselParametersT[0];
|
|
16
|
+
/**
|
|
17
|
+
* Плагины Embla: автопрокрутка, колесо мыши…
|
|
18
|
+
*/
|
|
19
|
+
export type CarouselPluginT = UseCarouselParametersT[1];
|
|
20
|
+
/**
|
|
21
|
+
* Направление карусели
|
|
22
|
+
*/
|
|
23
|
+
export type CarouselOrientationT = 'horizontal' | 'vertical';
|
|
24
|
+
/**
|
|
25
|
+
* Состояние карусели для частей
|
|
26
|
+
* @property carouselRef - ref на область прокрутки
|
|
27
|
+
* @property api - API Embla
|
|
28
|
+
* @property opts - настройки Embla
|
|
29
|
+
* @property orientation - направление
|
|
30
|
+
* @property scrollPrev - к предыдущему слайду
|
|
31
|
+
* @property scrollNext - к следующему слайду
|
|
32
|
+
* @property canScrollPrev - есть слайд слева
|
|
33
|
+
* @property canScrollNext - есть слайд справа
|
|
34
|
+
*/
|
|
35
|
+
export interface CarouselContextI {
|
|
36
|
+
carouselRef: UseEmblaCarouselType[0];
|
|
37
|
+
api: CarouselApiT;
|
|
38
|
+
opts?: CarouselOptionsT;
|
|
39
|
+
orientation: CarouselOrientationT;
|
|
40
|
+
scrollPrev: () => void;
|
|
41
|
+
scrollNext: () => void;
|
|
42
|
+
canScrollPrev: boolean;
|
|
43
|
+
canScrollNext: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Пропсы карусели
|
|
47
|
+
*/
|
|
48
|
+
export type CarouselPropsT = ComponentProps<'div'> & {
|
|
49
|
+
/** Настройки Embla: loop, align, slidesToScroll… */
|
|
50
|
+
opts?: CarouselOptionsT;
|
|
51
|
+
/** Плагины Embla: автопрокрутка и другие */
|
|
52
|
+
plugins?: CarouselPluginT;
|
|
53
|
+
/** Направление: horizontal или vertical. По умолчанию horizontal */
|
|
54
|
+
orientation?: CarouselOrientationT;
|
|
55
|
+
/** Получить API Embla, когда карусель готова */
|
|
56
|
+
setApi?: (api: CarouselApiT) => void;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Пропсы ленты слайдов
|
|
60
|
+
*/
|
|
61
|
+
export type CarouselContentPropsT = ComponentProps<'div'>;
|
|
62
|
+
/**
|
|
63
|
+
* Пропсы слайда
|
|
64
|
+
*/
|
|
65
|
+
export type CarouselItemPropsT = ComponentProps<'div'>;
|
|
66
|
+
/**
|
|
67
|
+
* Пропсы кнопки «назад»
|
|
68
|
+
*/
|
|
69
|
+
export type CarouselPreviousPropsT = ButtonPropsT & {
|
|
70
|
+
/** Подпись для скринридеров. По умолчанию «Предыдущий слайд» */
|
|
71
|
+
label?: string;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Пропсы кнопки «вперёд»
|
|
75
|
+
*/
|
|
76
|
+
export type CarouselNextPropsT = ButtonPropsT & {
|
|
77
|
+
/** Подпись для скринридеров. По умолчанию «Следующий слайд» */
|
|
78
|
+
label?: string;
|
|
79
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ChartContainerPropsT, ChartLegendContentPropsT, ChartStylePropsT, ChartTooltipContentPropsT } from "./types.js";
|
|
2
|
+
import * as RechartsPrimitive from "recharts";
|
|
3
|
+
/**
|
|
4
|
+
* Контейнер графика: подстраивает график под размер, задаёт цвета рядов и оформление осей.
|
|
5
|
+
* Высоту задайте через className, по умолчанию пропорции 16:9
|
|
6
|
+
* @param props - пропсы контейнера; config — подписи и цвета рядов
|
|
7
|
+
* @returns div с графиком
|
|
8
|
+
*/
|
|
9
|
+
export declare function ChartContainer({ id, className, children, config, initialDimension, ...props }: ChartContainerPropsT): import("react").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Стили графика: CSS-переменные --color-<ключ> для светлой и тёмной темы
|
|
12
|
+
* @param props - id графика и настройки рядов
|
|
13
|
+
* @returns style или null, если цветов нет
|
|
14
|
+
*/
|
|
15
|
+
export declare function ChartStyle({ id, config }: ChartStylePropsT): import("react").JSX.Element | null;
|
|
16
|
+
/**
|
|
17
|
+
* Подсказка графика: Tooltip из recharts. В content передайте ChartTooltipContent
|
|
18
|
+
*/
|
|
19
|
+
export declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
20
|
+
/**
|
|
21
|
+
* Содержимое подсказки: заголовок и значения рядов с цветными отметками. Числа — в формате ru-RU
|
|
22
|
+
* @param props - данные от recharts и настройки вида
|
|
23
|
+
* @returns div или null, если подсказка скрыта
|
|
24
|
+
*/
|
|
25
|
+
export declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }: ChartTooltipContentPropsT): import("react").JSX.Element | null;
|
|
26
|
+
/**
|
|
27
|
+
* Легенда графика: Legend из recharts. В content передайте ChartLegendContent
|
|
28
|
+
*/
|
|
29
|
+
export declare const ChartLegend: import("react").MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Содержимое легенды: цветной квадрат или иконка и подпись каждого ряда
|
|
32
|
+
* @param props - данные от recharts и настройки вида
|
|
33
|
+
* @returns div или null, если рядов нет
|
|
34
|
+
*/
|
|
35
|
+
export declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey }: ChartLegendContentPropsT): import("react").JSX.Element | null;
|