@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,170 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
6
|
+
// src/components/alert-dialog/alert-dialog.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Диалог подтверждения: прерывает работу и ждёт ответа. Не закрывается кликом мимо окна
|
|
9
|
+
* @param props - пропсы диалога
|
|
10
|
+
* @returns корень диалога без своей разметки
|
|
11
|
+
*/
|
|
12
|
+
function AlertDialog$1({ onOpenChange, ...props }) {
|
|
13
|
+
/**
|
|
14
|
+
* Диалог открыли или закрыли: наружу только флаг
|
|
15
|
+
* @param open - открыт ли
|
|
16
|
+
*/
|
|
17
|
+
const handleOpenChange = (open) => onOpenChange?.(open);
|
|
18
|
+
return /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
19
|
+
"data-slot": "alert-dialog",
|
|
20
|
+
onOpenChange: handleOpenChange,
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Кнопка открытия диалога. Свою кнопку — через render={<Button />}
|
|
26
|
+
* @param props - пропсы кнопки
|
|
27
|
+
* @returns кнопка с aria-haspopup="dialog"
|
|
28
|
+
*/
|
|
29
|
+
function AlertDialogTrigger(props) {
|
|
30
|
+
return /* @__PURE__ */ jsx(AlertDialog.Trigger, {
|
|
31
|
+
"data-slot": "alert-dialog-trigger",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Портал: переносит оверлей и окно в конец body
|
|
37
|
+
* @param props - пропсы портала
|
|
38
|
+
* @returns портал
|
|
39
|
+
*/
|
|
40
|
+
function AlertDialogPortal(props) {
|
|
41
|
+
return /* @__PURE__ */ jsx(AlertDialog.Portal, {
|
|
42
|
+
"data-slot": "alert-dialog-portal",
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Оверлей: затемняет и размывает страницу под диалогом
|
|
48
|
+
* @param props - пропсы оверлея
|
|
49
|
+
* @returns полупрозрачный слой на весь экран
|
|
50
|
+
*/
|
|
51
|
+
function AlertDialogOverlay({ className, ...props }) {
|
|
52
|
+
const classes = cn("fixed", "inset-0", "z-50", "bg-black/10", "duration-100", "supports-backdrop-filter:backdrop-blur-xs", "data-open:animate-in", "data-open:fade-in-0", "data-closed:animate-out", "data-closed:fade-out-0", className);
|
|
53
|
+
return /* @__PURE__ */ jsx(AlertDialog.Backdrop, {
|
|
54
|
+
"data-slot": "alert-dialog-overlay",
|
|
55
|
+
className: classes,
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Окно диалога: рендерится в портале поверх оверлея, по центру экрана
|
|
61
|
+
* @param props - пропсы окна
|
|
62
|
+
* @returns портал с оверлеем и окном
|
|
63
|
+
*/
|
|
64
|
+
function AlertDialogContent({ className, size = "default", ...props }) {
|
|
65
|
+
const classes = cn("group/alert-dialog-content", "fixed", "top-1/2", "left-1/2", "z-50", "grid", "w-full", "-translate-x-1/2", "-translate-y-1/2", "gap-4", "rounded-xl", "bg-popover", "p-4", "text-popover-foreground", "ring-1", "ring-foreground/10", "duration-100", "outline-none", "data-[size=default]:max-w-xs", "data-[size=sm]:max-w-xs", "data-[size=default]:sm:max-w-sm", "data-open:animate-in", "data-open:fade-in-0", "data-open:zoom-in-95", "data-closed:animate-out", "data-closed:fade-out-0", "data-closed:zoom-out-95", className);
|
|
66
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog.Popup, {
|
|
67
|
+
"data-slot": "alert-dialog-content",
|
|
68
|
+
"data-size": size,
|
|
69
|
+
className: classes,
|
|
70
|
+
...props
|
|
71
|
+
})] });
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Шапка диалога: иконка, заголовок и описание. В размере sm и на узком экране — по центру
|
|
75
|
+
* @param props - пропсы шапки
|
|
76
|
+
* @returns блок
|
|
77
|
+
*/
|
|
78
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
79
|
+
const classes = cn("grid", "grid-rows-[auto_1fr]", "place-items-center", "gap-1.5", "text-center", "has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr]", "has-data-[slot=alert-dialog-media]:gap-x-4", "sm:group-data-[size=default]/alert-dialog-content:place-items-start", "sm:group-data-[size=default]/alert-dialog-content:text-left", "sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className);
|
|
80
|
+
return /* @__PURE__ */ jsx("div", {
|
|
81
|
+
"data-slot": "alert-dialog-header",
|
|
82
|
+
className: classes,
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Подвал диалога: кнопки отмены и действия
|
|
88
|
+
* @param props - пропсы подвала
|
|
89
|
+
* @returns блок с серым фоном и разделителем
|
|
90
|
+
*/
|
|
91
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
92
|
+
const classes = cn("-mx-4", "-mb-4", "flex", "flex-col-reverse", "gap-2", "rounded-b-xl", "border-t", "bg-muted/50", "p-4", "sm:flex-row", "sm:justify-end", "group-data-[size=sm]/alert-dialog-content:grid", "group-data-[size=sm]/alert-dialog-content:grid-cols-2", className);
|
|
93
|
+
return /* @__PURE__ */ jsx("div", {
|
|
94
|
+
"data-slot": "alert-dialog-footer",
|
|
95
|
+
className: classes,
|
|
96
|
+
...props
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Иконка диалога: квадрат с иконкой над заголовком или слева от него
|
|
101
|
+
* @param props - пропсы иконки
|
|
102
|
+
* @returns блок
|
|
103
|
+
*/
|
|
104
|
+
function AlertDialogMedia({ className, ...props }) {
|
|
105
|
+
const classes = cn("mb-2", "inline-flex", "size-10", "items-center", "justify-center", "rounded-md", "bg-muted", "sm:group-data-[size=default]/alert-dialog-content:row-span-2", "*:[svg:not([class*=size-])]:size-6", className);
|
|
106
|
+
return /* @__PURE__ */ jsx("div", {
|
|
107
|
+
"data-slot": "alert-dialog-media",
|
|
108
|
+
className: classes,
|
|
109
|
+
...props
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Заголовок диалога: озвучивается при открытии
|
|
114
|
+
* @param props - пропсы заголовка
|
|
115
|
+
* @returns h2
|
|
116
|
+
*/
|
|
117
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
118
|
+
const classes = cn("text-base", "font-medium", "sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className);
|
|
119
|
+
return /* @__PURE__ */ jsx(AlertDialog.Title, {
|
|
120
|
+
"data-slot": "alert-dialog-title",
|
|
121
|
+
className: classes,
|
|
122
|
+
...props
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Описание диалога: озвучивается после заголовка
|
|
127
|
+
* @param props - пропсы описания
|
|
128
|
+
* @returns p
|
|
129
|
+
*/
|
|
130
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
131
|
+
const classes = cn("text-sm", "text-balance", "text-muted-foreground", "md:text-pretty", "*:[a]:underline", "*:[a]:underline-offset-3", "*:[a]:hover:text-foreground", className);
|
|
132
|
+
return /* @__PURE__ */ jsx(AlertDialog.Description, {
|
|
133
|
+
"data-slot": "alert-dialog-description",
|
|
134
|
+
className: classes,
|
|
135
|
+
...props
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Кнопка действия: подтверждает и закрывает диалог
|
|
140
|
+
* @param props - пропсы кнопки
|
|
141
|
+
* @returns кнопка
|
|
142
|
+
*/
|
|
143
|
+
function AlertDialogAction({ variant = "default", size = "default", ...props }) {
|
|
144
|
+
const button = /* @__PURE__ */ jsx(Button, {
|
|
145
|
+
variant,
|
|
146
|
+
size
|
|
147
|
+
});
|
|
148
|
+
return /* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
149
|
+
"data-slot": "alert-dialog-action",
|
|
150
|
+
render: button,
|
|
151
|
+
...props
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Кнопка отмены: закрывает диалог без действия
|
|
156
|
+
* @param props - пропсы кнопки
|
|
157
|
+
* @returns кнопка
|
|
158
|
+
*/
|
|
159
|
+
function AlertDialogCancel({ variant = "outline", size = "default", ...props }) {
|
|
160
|
+
const button = /* @__PURE__ */ jsx(Button, {
|
|
161
|
+
variant,
|
|
162
|
+
size
|
|
163
|
+
});
|
|
164
|
+
return /* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
165
|
+
"data-slot": "alert-dialog-cancel",
|
|
166
|
+
render: button,
|
|
167
|
+
...props
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
export { AlertDialog$1 as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AlertDialogActionPropsT, AlertDialogCancelPropsT, AlertDialogContentPropsT, AlertDialogDescriptionPropsT, AlertDialogFooterPropsT, AlertDialogHeaderPropsT, AlertDialogMediaPropsT, AlertDialogOverlayPropsT, AlertDialogPortalPropsT, AlertDialogPropsT, AlertDialogSizeT, AlertDialogTitlePropsT, AlertDialogTriggerPropsT } from "./types.js";
|
|
2
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from "./alert-dialog.js";
|
|
3
|
+
export { AlertDialog, AlertDialogAction, type AlertDialogActionPropsT, AlertDialogCancel, type AlertDialogCancelPropsT, AlertDialogContent, type AlertDialogContentPropsT, AlertDialogDescription, type AlertDialogDescriptionPropsT, AlertDialogFooter, type AlertDialogFooterPropsT, AlertDialogHeader, type AlertDialogHeaderPropsT, AlertDialogMedia, type AlertDialogMediaPropsT, AlertDialogOverlay, type AlertDialogOverlayPropsT, AlertDialogPortal, type AlertDialogPortalPropsT, type AlertDialogPropsT, type AlertDialogSizeT, AlertDialogTitle, type AlertDialogTitlePropsT, AlertDialogTrigger, type AlertDialogTriggerPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from "./alert-dialog.js";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { ButtonPropsT } from "../button/types.js";
|
|
3
|
+
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
4
|
+
import { ComponentProps } from "react";
|
|
5
|
+
/**
|
|
6
|
+
* Пропсы диалога подтверждения
|
|
7
|
+
*/
|
|
8
|
+
export type AlertDialogPropsT = Omit<AlertDialog.Root.Props, 'onOpenChange'> & {
|
|
9
|
+
/** Диалог открыт — контролируемый режим, вместе с onOpenChange */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** Диалог открыт при первом рендере — неконтролируемый режим */
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
/** Диалог открыли или закрыли: новое состояние */
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Пропсы кнопки открытия
|
|
18
|
+
*/
|
|
19
|
+
export type AlertDialogTriggerPropsT = PartPropsT<AlertDialog.Trigger.Props>;
|
|
20
|
+
/**
|
|
21
|
+
* Пропсы портала
|
|
22
|
+
*/
|
|
23
|
+
export type AlertDialogPortalPropsT = AlertDialog.Portal.Props;
|
|
24
|
+
/**
|
|
25
|
+
* Пропсы оверлея
|
|
26
|
+
*/
|
|
27
|
+
export type AlertDialogOverlayPropsT = PartPropsT<AlertDialog.Backdrop.Props>;
|
|
28
|
+
/**
|
|
29
|
+
* Размер окна: default — кнопки в ряд справа, sm — узкое окно, кнопки в две колонки
|
|
30
|
+
*/
|
|
31
|
+
export type AlertDialogSizeT = 'default' | 'sm';
|
|
32
|
+
/**
|
|
33
|
+
* Пропсы окна диалога
|
|
34
|
+
*/
|
|
35
|
+
export type AlertDialogContentPropsT = PartPropsT<AlertDialog.Popup.Props> & {
|
|
36
|
+
/** Размер окна: default — кнопки в ряд справа, sm — узкое окно, кнопки в две колонки */
|
|
37
|
+
size?: AlertDialogSizeT;
|
|
38
|
+
/** Куда перевести фокус при открытии: элемент или false — оставить на месте */
|
|
39
|
+
initialFocus?: AlertDialog.Popup.Props['initialFocus'];
|
|
40
|
+
/** Куда вернуть фокус при закрытии: элемент или false — никуда */
|
|
41
|
+
finalFocus?: AlertDialog.Popup.Props['finalFocus'];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Пропсы шапки
|
|
45
|
+
*/
|
|
46
|
+
export type AlertDialogHeaderPropsT = ComponentProps<'div'>;
|
|
47
|
+
/**
|
|
48
|
+
* Пропсы подвала
|
|
49
|
+
*/
|
|
50
|
+
export type AlertDialogFooterPropsT = ComponentProps<'div'>;
|
|
51
|
+
/**
|
|
52
|
+
* Пропсы иконки
|
|
53
|
+
*/
|
|
54
|
+
export type AlertDialogMediaPropsT = ComponentProps<'div'>;
|
|
55
|
+
/**
|
|
56
|
+
* Пропсы заголовка
|
|
57
|
+
*/
|
|
58
|
+
export type AlertDialogTitlePropsT = PartPropsT<AlertDialog.Title.Props>;
|
|
59
|
+
/**
|
|
60
|
+
* Пропсы описания
|
|
61
|
+
*/
|
|
62
|
+
export type AlertDialogDescriptionPropsT = PartPropsT<AlertDialog.Description.Props>;
|
|
63
|
+
/**
|
|
64
|
+
* Пропсы кнопки действия
|
|
65
|
+
*/
|
|
66
|
+
export type AlertDialogActionPropsT = PartPropsT<AlertDialog.Close.Props> & {
|
|
67
|
+
/** Вариант оформления кнопки */
|
|
68
|
+
variant?: ButtonPropsT['variant'];
|
|
69
|
+
/** Размер кнопки */
|
|
70
|
+
size?: ButtonPropsT['size'];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Пропсы кнопки отмены
|
|
74
|
+
*/
|
|
75
|
+
export type AlertDialogCancelPropsT = PartPropsT<AlertDialog.Close.Props> & {
|
|
76
|
+
/** Вариант оформления кнопки */
|
|
77
|
+
variant?: ButtonPropsT['variant'];
|
|
78
|
+
/** Размер кнопки */
|
|
79
|
+
size?: ButtonPropsT['size'];
|
|
80
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AspectRatioPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Блок с заданным соотношением сторон: изображение, видео, карта.
|
|
4
|
+
* Ширина берётся от родителя, высота вычисляется из ratio
|
|
5
|
+
* @param props - пропсы блока: ratio (например, 16 / 9), className, содержимое
|
|
6
|
+
* @returns блок с соотношением сторон
|
|
7
|
+
*/
|
|
8
|
+
export declare function AspectRatio({ ratio, className, style, ...props }: AspectRatioPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/components/aspect-ratio/aspect-ratio.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Блок с заданным соотношением сторон: изображение, видео, карта.
|
|
6
|
+
* Ширина берётся от родителя, высота вычисляется из ratio
|
|
7
|
+
* @param props - пропсы блока: ratio (например, 16 / 9), className, содержимое
|
|
8
|
+
* @returns блок с соотношением сторон
|
|
9
|
+
*/
|
|
10
|
+
function AspectRatio({ ratio = 1, className, style, ...props }) {
|
|
11
|
+
const classes = cn("relative", "aspect-(--ratio)", className);
|
|
12
|
+
const ratioStyle = Object.assign({ "--ratio": ratio }, style);
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
"data-slot": "aspect-ratio",
|
|
15
|
+
style: ratioStyle,
|
|
16
|
+
className: classes,
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export { AspectRatio };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AspectRatio } from "./aspect-ratio.js";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AttachmentActionPropsT, AttachmentActionsPropsT, AttachmentContentPropsT, AttachmentDescriptionPropsT, AttachmentGroupPropsT, AttachmentMediaPropsT, AttachmentPropsT, AttachmentTitlePropsT, AttachmentTriggerPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Вложение: файл или изображение в сообщении, с состоянием загрузки
|
|
4
|
+
* @param props - пропсы вложения
|
|
5
|
+
* @returns карточка вложения
|
|
6
|
+
*/
|
|
7
|
+
export declare function Attachment({ className, state, size, orientation, ...props }: AttachmentPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Медиа вложения: иконка типа файла, спиннер или превью
|
|
10
|
+
* @param props - пропсы медиа
|
|
11
|
+
* @returns квадратная плашка медиа
|
|
12
|
+
*/
|
|
13
|
+
export declare function AttachmentMedia({ className, variant, ...props }: AttachmentMediaPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Содержимое вложения: название и описание
|
|
16
|
+
* @param props - пропсы содержимого
|
|
17
|
+
* @returns колонка содержимого
|
|
18
|
+
*/
|
|
19
|
+
export declare function AttachmentContent({ className, ...props }: AttachmentContentPropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Название вложения: одна строка, мерцает во время загрузки и обработки
|
|
22
|
+
* @param props - пропсы названия
|
|
23
|
+
* @returns название
|
|
24
|
+
*/
|
|
25
|
+
export declare function AttachmentTitle({ className, ...props }: AttachmentTitlePropsT): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Описание вложения: тип, размер, ход загрузки
|
|
28
|
+
* @param props - пропсы описания
|
|
29
|
+
* @returns описание
|
|
30
|
+
*/
|
|
31
|
+
export declare function AttachmentDescription({ className, ...props }: AttachmentDescriptionPropsT): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Действия вложения: кнопки поверх области нажатия.
|
|
34
|
+
* У вертикального вложения — в правом верхнем углу превью
|
|
35
|
+
* @param props - пропсы действий
|
|
36
|
+
* @returns блок действий
|
|
37
|
+
*/
|
|
38
|
+
export declare function AttachmentActions({ className, ...props }: AttachmentActionsPropsT): import("react").JSX.Element;
|
|
39
|
+
/**
|
|
40
|
+
* Действие вложения: кнопка с иконкой — удалить, отменить, повторить.
|
|
41
|
+
* Без текста — подпись задаётся через aria-label
|
|
42
|
+
* @param props - пропсы кнопки
|
|
43
|
+
* @returns кнопка, по умолчанию ghost размера icon-xs
|
|
44
|
+
*/
|
|
45
|
+
export declare function AttachmentAction({ className, variant, size, ...props }: AttachmentActionPropsT): import("react").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* Область нажатия вложения: растягивается на всю карточку и открывает файл или превью
|
|
48
|
+
* @param props - пропсы области
|
|
49
|
+
* @returns кнопка или свой элемент (render={<a href />}) поверх карточки
|
|
50
|
+
*/
|
|
51
|
+
export declare function AttachmentTrigger({ className, render, type, ...props }: AttachmentTriggerPropsT): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
52
|
+
/**
|
|
53
|
+
* Группа вложений: горизонтальная прокрутка с привязкой к карточкам
|
|
54
|
+
* @param props - пропсы группы
|
|
55
|
+
* @returns прокручиваемая строка вложений
|
|
56
|
+
*/
|
|
57
|
+
export declare function AttachmentGroup({ className, ...props }: AttachmentGroupPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { attachmentMediaVariants, attachmentVariants } from "./types.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
7
|
+
// src/components/attachment/attachment.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Вложение: файл или изображение в сообщении, с состоянием загрузки
|
|
10
|
+
* @param props - пропсы вложения
|
|
11
|
+
* @returns карточка вложения
|
|
12
|
+
*/
|
|
13
|
+
function Attachment({ className, state = "done", size = "default", orientation = "horizontal", ...props }) {
|
|
14
|
+
const classes = cn(attachmentVariants({
|
|
15
|
+
size,
|
|
16
|
+
orientation
|
|
17
|
+
}), className);
|
|
18
|
+
return /* @__PURE__ */ jsx("div", {
|
|
19
|
+
"data-slot": "attachment",
|
|
20
|
+
"data-state": state,
|
|
21
|
+
"data-size": size,
|
|
22
|
+
"data-orientation": orientation,
|
|
23
|
+
className: classes,
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Медиа вложения: иконка типа файла, спиннер или превью
|
|
29
|
+
* @param props - пропсы медиа
|
|
30
|
+
* @returns квадратная плашка медиа
|
|
31
|
+
*/
|
|
32
|
+
function AttachmentMedia({ className, variant = "icon", ...props }) {
|
|
33
|
+
const classes = cn(attachmentMediaVariants({ variant }), className);
|
|
34
|
+
return /* @__PURE__ */ jsx("div", {
|
|
35
|
+
"data-slot": "attachment-media",
|
|
36
|
+
"data-variant": variant,
|
|
37
|
+
className: classes,
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Содержимое вложения: название и описание
|
|
43
|
+
* @param props - пропсы содержимого
|
|
44
|
+
* @returns колонка содержимого
|
|
45
|
+
*/
|
|
46
|
+
function AttachmentContent({ className, ...props }) {
|
|
47
|
+
const classes = cn("max-w-full", "min-w-0", "flex-1", "leading-tight", "group-data-[orientation=vertical]/attachment:px-1", className);
|
|
48
|
+
return /* @__PURE__ */ jsx("div", {
|
|
49
|
+
"data-slot": "attachment-content",
|
|
50
|
+
className: classes,
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Название вложения: одна строка, мерцает во время загрузки и обработки
|
|
56
|
+
* @param props - пропсы названия
|
|
57
|
+
* @returns название
|
|
58
|
+
*/
|
|
59
|
+
function AttachmentTitle({ className, ...props }) {
|
|
60
|
+
const classes = cn("block", "max-w-full", "min-w-0", "truncate", "font-medium", "group-data-[state=processing]/attachment:shimmer", "group-data-[state=uploading]/attachment:shimmer", className);
|
|
61
|
+
return /* @__PURE__ */ jsx("span", {
|
|
62
|
+
"data-slot": "attachment-title",
|
|
63
|
+
className: classes,
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Описание вложения: тип, размер, ход загрузки
|
|
69
|
+
* @param props - пропсы описания
|
|
70
|
+
* @returns описание
|
|
71
|
+
*/
|
|
72
|
+
function AttachmentDescription({ className, ...props }) {
|
|
73
|
+
const classes = cn("mt-0.5", "block", "max-w-full", "min-w-0", "truncate", "text-xs", "text-muted-foreground", "group-data-[state=error]/attachment:text-destructive/80", className);
|
|
74
|
+
return /* @__PURE__ */ jsx("span", {
|
|
75
|
+
"data-slot": "attachment-description",
|
|
76
|
+
className: classes,
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Действия вложения: кнопки поверх области нажатия.
|
|
82
|
+
* У вертикального вложения — в правом верхнем углу превью
|
|
83
|
+
* @param props - пропсы действий
|
|
84
|
+
* @returns блок действий
|
|
85
|
+
*/
|
|
86
|
+
function AttachmentActions({ className, ...props }) {
|
|
87
|
+
const classes = cn("relative", "z-20", "flex", "shrink-0", "items-center", "group-data-[orientation=vertical]/attachment:absolute", "group-data-[orientation=vertical]/attachment:top-3", "group-data-[orientation=vertical]/attachment:right-3", "group-data-[orientation=vertical]/attachment:gap-1", className);
|
|
88
|
+
return /* @__PURE__ */ jsx("div", {
|
|
89
|
+
"data-slot": "attachment-actions",
|
|
90
|
+
className: classes,
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Действие вложения: кнопка с иконкой — удалить, отменить, повторить.
|
|
96
|
+
* Без текста — подпись задаётся через aria-label
|
|
97
|
+
* @param props - пропсы кнопки
|
|
98
|
+
* @returns кнопка, по умолчанию ghost размера icon-xs
|
|
99
|
+
*/
|
|
100
|
+
function AttachmentAction({ className, variant = "ghost", size = "icon-xs", ...props }) {
|
|
101
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
102
|
+
"data-slot": "attachment-action",
|
|
103
|
+
variant,
|
|
104
|
+
size,
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Область нажатия вложения: растягивается на всю карточку и открывает файл или превью
|
|
111
|
+
* @param props - пропсы области
|
|
112
|
+
* @returns кнопка или свой элемент (render={<a href />}) поверх карточки
|
|
113
|
+
*/
|
|
114
|
+
function AttachmentTrigger({ className, render, type, ...props }) {
|
|
115
|
+
const classes = cn("absolute", "inset-0", "z-10", "cursor-pointer", "outline-none", className);
|
|
116
|
+
return useRender({
|
|
117
|
+
defaultTagName: "button",
|
|
118
|
+
render,
|
|
119
|
+
props: mergeProps({
|
|
120
|
+
"data-slot": "attachment-trigger",
|
|
121
|
+
type: render ? void 0 : type ?? "button",
|
|
122
|
+
className: classes
|
|
123
|
+
}, props)
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Группа вложений: горизонтальная прокрутка с привязкой к карточкам
|
|
128
|
+
* @param props - пропсы группы
|
|
129
|
+
* @returns прокручиваемая строка вложений
|
|
130
|
+
*/
|
|
131
|
+
function AttachmentGroup({ className, ...props }) {
|
|
132
|
+
const classes = cn("flex", "min-w-0", "scroll-px-1", "snap-x", "snap-mandatory", "gap-3", "overflow-x-auto", "overscroll-x-contain", "py-1", "scroll-fade-x", "no-scrollbar", "*:data-[slot=attachment]:flex-none", "*:data-[slot=attachment]:snap-start", className);
|
|
133
|
+
return /* @__PURE__ */ jsx("div", {
|
|
134
|
+
"data-slot": "attachment-group",
|
|
135
|
+
className: classes,
|
|
136
|
+
...props
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
export { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AttachmentActionPropsT, AttachmentActionsPropsT, AttachmentContentPropsT, AttachmentDescriptionPropsT, AttachmentGroupPropsT, AttachmentMediaPropsT, AttachmentPropsT, AttachmentStateT, AttachmentTitlePropsT, AttachmentTriggerPropsT, attachmentMediaVariants, attachmentVariants } from "./types.js";
|
|
2
|
+
import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger } from "./attachment.js";
|
|
3
|
+
export { Attachment, AttachmentAction, type AttachmentActionPropsT, AttachmentActions, type AttachmentActionsPropsT, AttachmentContent, type AttachmentContentPropsT, AttachmentDescription, type AttachmentDescriptionPropsT, AttachmentGroup, type AttachmentGroupPropsT, AttachmentMedia, type AttachmentMediaPropsT, type AttachmentPropsT, type AttachmentStateT, AttachmentTitle, type AttachmentTitlePropsT, AttachmentTrigger, type AttachmentTriggerPropsT, attachmentMediaVariants, attachmentVariants };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { attachmentMediaVariants, attachmentVariants } from "./types.js";
|
|
2
|
+
import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger } from "./attachment.js";
|
|
3
|
+
export { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, attachmentMediaVariants, attachmentVariants };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ButtonPropsT } from "../button/types.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
/**
|
|
6
|
+
* Стили вложения: размер и ориентация.
|
|
7
|
+
* Состояние задаёт data-state: idle — пунктирная рамка, error — рамка ошибки
|
|
8
|
+
*/
|
|
9
|
+
export declare const attachmentVariants: (props?: ({
|
|
10
|
+
size?: "default" | "sm" | "xs" | null | undefined;
|
|
11
|
+
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Стили медиа вложения: иконка или превью изображения
|
|
15
|
+
*/
|
|
16
|
+
export declare const attachmentMediaVariants: (props?: ({
|
|
17
|
+
variant?: "image" | "icon" | null | undefined;
|
|
18
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Размер и ориентация вложения
|
|
21
|
+
*/
|
|
22
|
+
export type AttachmentVariantsT = VariantProps<typeof attachmentVariants>;
|
|
23
|
+
/**
|
|
24
|
+
* Варианты медиа вложения
|
|
25
|
+
*/
|
|
26
|
+
export type AttachmentMediaVariantsT = VariantProps<typeof attachmentMediaVariants>;
|
|
27
|
+
/**
|
|
28
|
+
* Состояние вложения
|
|
29
|
+
*/
|
|
30
|
+
export type AttachmentStateT = 'idle' | 'uploading' | 'processing' | 'error' | 'done';
|
|
31
|
+
/**
|
|
32
|
+
* Пропсы вложения
|
|
33
|
+
*/
|
|
34
|
+
export type AttachmentPropsT = ComponentProps<'div'> & {
|
|
35
|
+
/**
|
|
36
|
+
* Состояние: idle — выбрано, ещё не загружено; uploading — загружается; processing — обрабатывается;
|
|
37
|
+
* error — ошибка; done — готово
|
|
38
|
+
*/
|
|
39
|
+
state?: AttachmentStateT;
|
|
40
|
+
/** Размер: default, sm или xs */
|
|
41
|
+
size?: AttachmentVariantsT['size'];
|
|
42
|
+
/** Ориентация: horizontal — строка, vertical — карточка с превью сверху */
|
|
43
|
+
orientation?: AttachmentVariantsT['orientation'];
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Пропсы медиа вложения
|
|
47
|
+
*/
|
|
48
|
+
export type AttachmentMediaPropsT = ComponentProps<'div'> & {
|
|
49
|
+
/** Оформление: icon — иконка на плашке, image — превью изображения */
|
|
50
|
+
variant?: AttachmentMediaVariantsT['variant'];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Пропсы содержимого вложения
|
|
54
|
+
*/
|
|
55
|
+
export type AttachmentContentPropsT = ComponentProps<'div'>;
|
|
56
|
+
/**
|
|
57
|
+
* Пропсы названия вложения
|
|
58
|
+
*/
|
|
59
|
+
export type AttachmentTitlePropsT = ComponentProps<'span'>;
|
|
60
|
+
/**
|
|
61
|
+
* Пропсы описания вложения
|
|
62
|
+
*/
|
|
63
|
+
export type AttachmentDescriptionPropsT = ComponentProps<'span'>;
|
|
64
|
+
/**
|
|
65
|
+
* Пропсы блока действий вложения
|
|
66
|
+
*/
|
|
67
|
+
export type AttachmentActionsPropsT = ComponentProps<'div'>;
|
|
68
|
+
/**
|
|
69
|
+
* Пропсы действия вложения
|
|
70
|
+
*/
|
|
71
|
+
export type AttachmentActionPropsT = ButtonPropsT;
|
|
72
|
+
/**
|
|
73
|
+
* Пропсы области нажатия вложения
|
|
74
|
+
*/
|
|
75
|
+
export type AttachmentTriggerPropsT = useRender.ComponentProps<'button'>;
|
|
76
|
+
/**
|
|
77
|
+
* Пропсы группы вложений
|
|
78
|
+
*/
|
|
79
|
+
export type AttachmentGroupPropsT = ComponentProps<'div'>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/attachment/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Стили вложения: размер и ориентация.
|
|
5
|
+
* Состояние задаёт data-state: idle — пунктирная рамка, error — рамка ошибки
|
|
6
|
+
*/
|
|
7
|
+
const attachmentVariants = cva([
|
|
8
|
+
"group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border",
|
|
9
|
+
"bg-card text-card-foreground transition-colors",
|
|
10
|
+
"keyboard:focus-within:ring-1 keyboard:focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50",
|
|
11
|
+
"data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed"
|
|
12
|
+
], { variants: {
|
|
13
|
+
size: {
|
|
14
|
+
default: ["gap-2 text-sm has-data-[slot=attachment-media]:p-2", "has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2"],
|
|
15
|
+
sm: ["gap-2.5 text-xs has-data-[slot=attachment-media]:p-1.5", "has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5"],
|
|
16
|
+
xs: ["gap-1.5 rounded-lg text-xs has-data-[slot=attachment-media]:p-1", "has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1"]
|
|
17
|
+
},
|
|
18
|
+
orientation: {
|
|
19
|
+
horizontal: "min-w-40 items-center",
|
|
20
|
+
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
|
|
21
|
+
}
|
|
22
|
+
} });
|
|
23
|
+
/**
|
|
24
|
+
* Стили медиа вложения: иконка или превью изображения
|
|
25
|
+
*/
|
|
26
|
+
const attachmentMediaVariants = cva([
|
|
27
|
+
"relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg",
|
|
28
|
+
"bg-muted text-foreground [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4",
|
|
29
|
+
"group-data-[size=sm]/attachment:w-8",
|
|
30
|
+
"group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md",
|
|
31
|
+
"group-data-[size=xs]/attachment:[&_svg:not([class*=size-])]:size-3.5",
|
|
32
|
+
"group-data-[orientation=vertical]/attachment:w-full",
|
|
33
|
+
"group-data-[orientation=vertical]/attachment:[&_svg:not([class*=size-])]:size-6",
|
|
34
|
+
"group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6!",
|
|
35
|
+
"group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive"
|
|
36
|
+
], {
|
|
37
|
+
variants: { variant: {
|
|
38
|
+
icon: "",
|
|
39
|
+
image: ["opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100", "*:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"]
|
|
40
|
+
} },
|
|
41
|
+
defaultVariants: { variant: "icon" }
|
|
42
|
+
});
|
|
43
|
+
export { attachmentMediaVariants, attachmentVariants };
|