@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,115 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { texts } from "../../lib/locale.js";
|
|
3
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } 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/breadcrumb/breadcrumb.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Навигационная цепочка: путь к текущей странице по иерархии разделов
|
|
10
|
+
* @param props - пропсы цепочки
|
|
11
|
+
* @returns элемент <nav>
|
|
12
|
+
*/
|
|
13
|
+
function Breadcrumb({ className, label = texts.breadcrumb, ...props }) {
|
|
14
|
+
const classes = cn(className);
|
|
15
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
16
|
+
"aria-label": label,
|
|
17
|
+
"data-slot": "breadcrumb",
|
|
18
|
+
className: classes,
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Список пунктов навигационной цепочки
|
|
24
|
+
* @param props - пропсы списка
|
|
25
|
+
* @returns элемент <ol>
|
|
26
|
+
*/
|
|
27
|
+
function BreadcrumbList({ className, ...props }) {
|
|
28
|
+
const classes = cn("flex", "flex-wrap", "items-center", "gap-1.5", "text-sm", "wrap-break-word", "text-muted-foreground", className);
|
|
29
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
30
|
+
"data-slot": "breadcrumb-list",
|
|
31
|
+
className: classes,
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Пункт навигационной цепочки: ссылка, текущая страница или многоточие
|
|
37
|
+
* @param props - пропсы пункта
|
|
38
|
+
* @returns элемент <li>
|
|
39
|
+
*/
|
|
40
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
41
|
+
const classes = cn("inline-flex", "items-center", "gap-1", className);
|
|
42
|
+
return /* @__PURE__ */ jsx("li", {
|
|
43
|
+
"data-slot": "breadcrumb-item",
|
|
44
|
+
className: classes,
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Ссылка на раздел в навигационной цепочке
|
|
50
|
+
* @param props - пропсы ссылки
|
|
51
|
+
* @returns ссылка или дочерний элемент в стилях ссылки (render)
|
|
52
|
+
*/
|
|
53
|
+
function BreadcrumbLink({ render, className, ...props }) {
|
|
54
|
+
const classes = cn("transition-colors", "hover:text-foreground", className);
|
|
55
|
+
return useRender({
|
|
56
|
+
defaultTagName: "a",
|
|
57
|
+
render,
|
|
58
|
+
props: mergeProps({
|
|
59
|
+
"data-slot": "breadcrumb-link",
|
|
60
|
+
className: classes
|
|
61
|
+
}, props)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Текущая страница: последний пункт цепочки, не ссылка
|
|
66
|
+
* @param props - пропсы текущей страницы
|
|
67
|
+
* @returns элемент с aria-current="page"
|
|
68
|
+
*/
|
|
69
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
70
|
+
const classes = cn("font-normal", "text-foreground", className);
|
|
71
|
+
return /* @__PURE__ */ jsx("span", {
|
|
72
|
+
"data-slot": "breadcrumb-page",
|
|
73
|
+
role: "link",
|
|
74
|
+
"aria-disabled": "true",
|
|
75
|
+
"aria-current": "page",
|
|
76
|
+
className: classes,
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Разделитель между пунктами, по умолчанию шеврон. Скрыт от скринридера
|
|
82
|
+
* @param props - пропсы разделителя; children заменяет иконку
|
|
83
|
+
* @returns элемент <li>
|
|
84
|
+
*/
|
|
85
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
86
|
+
const classes = cn("[&>svg]:size-3.5", className);
|
|
87
|
+
return /* @__PURE__ */ jsx("li", {
|
|
88
|
+
"data-slot": "breadcrumb-separator",
|
|
89
|
+
role: "presentation",
|
|
90
|
+
"aria-hidden": "true",
|
|
91
|
+
className: classes,
|
|
92
|
+
...props,
|
|
93
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Многоточие на месте свёрнутых пунктов длинной цепочки
|
|
98
|
+
* @param props - пропсы многоточия
|
|
99
|
+
* @returns иконка многоточия с текстом для скринридера
|
|
100
|
+
*/
|
|
101
|
+
function BreadcrumbEllipsis({ className, label = texts.more, ...props }) {
|
|
102
|
+
const classes = cn("flex", "size-5", "items-center", "justify-center", "[&>svg]:size-4", className);
|
|
103
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
104
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
105
|
+
role: "presentation",
|
|
106
|
+
"aria-hidden": "true",
|
|
107
|
+
className: classes,
|
|
108
|
+
...props,
|
|
109
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: "sr-only",
|
|
111
|
+
children: label
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BreadcrumbEllipsisPropsT, BreadcrumbItemPropsT, BreadcrumbLinkPropsT, BreadcrumbListPropsT, BreadcrumbPagePropsT, BreadcrumbPropsT, BreadcrumbSeparatorPropsT } from "./types.js";
|
|
2
|
+
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./breadcrumb.js";
|
|
3
|
+
export { Breadcrumb, BreadcrumbEllipsis, type BreadcrumbEllipsisPropsT, BreadcrumbItem, type BreadcrumbItemPropsT, BreadcrumbLink, type BreadcrumbLinkPropsT, BreadcrumbList, type BreadcrumbListPropsT, BreadcrumbPage, type BreadcrumbPagePropsT, type BreadcrumbPropsT, BreadcrumbSeparator, type BreadcrumbSeparatorPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./breadcrumb.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
/**
|
|
4
|
+
* Пропсы навигационной цепочки
|
|
5
|
+
*/
|
|
6
|
+
export type BreadcrumbPropsT = ComponentProps<'nav'> & {
|
|
7
|
+
/** Название навигации для скринридера (aria-label), по умолчанию «Навигационная цепочка» */
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Пропсы списка навигационной цепочки
|
|
12
|
+
*/
|
|
13
|
+
export type BreadcrumbListPropsT = ComponentProps<'ol'>;
|
|
14
|
+
/**
|
|
15
|
+
* Пропсы пункта навигационной цепочки
|
|
16
|
+
*/
|
|
17
|
+
export type BreadcrumbItemPropsT = ComponentProps<'li'>;
|
|
18
|
+
/**
|
|
19
|
+
* Пропсы ссылки навигационной цепочки
|
|
20
|
+
*/
|
|
21
|
+
export type BreadcrumbLinkPropsT = useRender.ComponentProps<'a'>;
|
|
22
|
+
/**
|
|
23
|
+
* Пропсы текущей страницы навигационной цепочки
|
|
24
|
+
*/
|
|
25
|
+
export type BreadcrumbPagePropsT = ComponentProps<'span'>;
|
|
26
|
+
/**
|
|
27
|
+
* Пропсы разделителя навигационной цепочки
|
|
28
|
+
*/
|
|
29
|
+
export type BreadcrumbSeparatorPropsT = ComponentProps<'li'>;
|
|
30
|
+
/**
|
|
31
|
+
* Пропсы многоточия навигационной цепочки
|
|
32
|
+
*/
|
|
33
|
+
export type BreadcrumbEllipsisPropsT = ComponentProps<'span'> & {
|
|
34
|
+
/** Текст для скринридера, по умолчанию «Ещё» */
|
|
35
|
+
label?: string;
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BubbleContentPropsT, BubbleGroupPropsT, BubblePropsT, BubbleReactionsPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Группа пузырей: подряд идущие сообщения одного автора
|
|
4
|
+
* @param props - пропсы группы
|
|
5
|
+
* @returns колонка пузырей
|
|
6
|
+
*/
|
|
7
|
+
export declare function BubbleGroup({ className, ...props }: BubbleGroupPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Пузырь: сообщение в чате
|
|
10
|
+
* @param props - пропсы пузыря
|
|
11
|
+
* @returns пузырь
|
|
12
|
+
*/
|
|
13
|
+
export declare function Bubble({ variant, align, className, ...props }: BubblePropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Содержимое пузыря: текст сообщения на цветной подложке
|
|
16
|
+
* @param props - пропсы содержимого
|
|
17
|
+
* @returns содержимое или дочерний элемент в его стилях (render)
|
|
18
|
+
*/
|
|
19
|
+
export declare function BubbleContent({ render, className, ...props }: BubbleContentPropsT): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
20
|
+
/**
|
|
21
|
+
* Реакции пузыря: эмодзи или кнопка на краю сообщения
|
|
22
|
+
* @param props - пропсы реакций
|
|
23
|
+
* @returns плашка реакций
|
|
24
|
+
*/
|
|
25
|
+
export declare function BubbleReactions({ side, align, className, ...props }: BubbleReactionsPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { bubbleReactionsVariants, bubbleVariants } from "./types.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
// src/components/bubble/bubble.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Группа пузырей: подряд идущие сообщения одного автора
|
|
9
|
+
* @param props - пропсы группы
|
|
10
|
+
* @returns колонка пузырей
|
|
11
|
+
*/
|
|
12
|
+
function BubbleGroup({ className, ...props }) {
|
|
13
|
+
const classes = cn("flex", "min-w-0", "flex-col", "gap-2", className);
|
|
14
|
+
return /* @__PURE__ */ jsx("div", {
|
|
15
|
+
"data-slot": "bubble-group",
|
|
16
|
+
className: classes,
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Пузырь: сообщение в чате
|
|
22
|
+
* @param props - пропсы пузыря
|
|
23
|
+
* @returns пузырь
|
|
24
|
+
*/
|
|
25
|
+
function Bubble({ variant = "default", align = "start", className, ...props }) {
|
|
26
|
+
const classes = cn(bubbleVariants({ variant }), className);
|
|
27
|
+
return /* @__PURE__ */ jsx("div", {
|
|
28
|
+
"data-slot": "bubble",
|
|
29
|
+
"data-variant": variant,
|
|
30
|
+
"data-align": align,
|
|
31
|
+
className: classes,
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Содержимое пузыря: текст сообщения на цветной подложке
|
|
37
|
+
* @param props - пропсы содержимого
|
|
38
|
+
* @returns содержимое или дочерний элемент в его стилях (render)
|
|
39
|
+
*/
|
|
40
|
+
function BubbleContent({ render, className, ...props }) {
|
|
41
|
+
const classes = cn("w-fit", "max-w-full", "min-w-0", "overflow-hidden", "rounded-xl", "border", "border-transparent", "px-3", "py-2", "text-sm", "leading-relaxed", "wrap-break-word", "group-data-[align=end]/bubble:self-end", "[button]:cursor-pointer", "[button]:text-left", "[button,a]:transition-colors", "[button,a]:outline-none", "[button,a]:focus-visible:border-ring", "[button,a]:focus-visible:ring-3", "[button,a]:focus-visible:ring-ring/30", className);
|
|
42
|
+
return useRender({
|
|
43
|
+
defaultTagName: "div",
|
|
44
|
+
render,
|
|
45
|
+
props: mergeProps({
|
|
46
|
+
"data-slot": "bubble-content",
|
|
47
|
+
className: classes
|
|
48
|
+
}, props)
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Реакции пузыря: эмодзи или кнопка на краю сообщения
|
|
53
|
+
* @param props - пропсы реакций
|
|
54
|
+
* @returns плашка реакций
|
|
55
|
+
*/
|
|
56
|
+
function BubbleReactions({ side = "bottom", align = "end", className, ...props }) {
|
|
57
|
+
const classes = cn(bubbleReactionsVariants({
|
|
58
|
+
side,
|
|
59
|
+
align
|
|
60
|
+
}), className);
|
|
61
|
+
return /* @__PURE__ */ jsx("div", {
|
|
62
|
+
"data-slot": "bubble-reactions",
|
|
63
|
+
"data-align": align,
|
|
64
|
+
"data-side": side,
|
|
65
|
+
className: classes,
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export { Bubble, BubbleContent, BubbleGroup, BubbleReactions };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BubbleContentPropsT, BubbleGroupPropsT, BubblePropsT, BubbleReactionsPropsT, bubbleReactionsVariants, bubbleVariants } from "./types.js";
|
|
2
|
+
import { Bubble, BubbleContent, BubbleGroup, BubbleReactions } from "./bubble.js";
|
|
3
|
+
export { Bubble, BubbleContent, type BubbleContentPropsT, BubbleGroup, type BubbleGroupPropsT, type BubblePropsT, BubbleReactions, type BubbleReactionsPropsT, bubbleReactionsVariants, bubbleVariants };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
/**
|
|
5
|
+
* Стили пузыря: цвет содержимого задаёт вариант.
|
|
6
|
+
* Содержимое-кнопка или ссылка (render у BubbleContent) меняет фон при наведении
|
|
7
|
+
*/
|
|
8
|
+
export declare const bubbleVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "muted" | "tinted" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Стили реакций: плашка на краю пузыря сверху или снизу
|
|
13
|
+
*/
|
|
14
|
+
export declare const bubbleReactionsVariants: (props?: ({
|
|
15
|
+
side?: "top" | "bottom" | null | undefined;
|
|
16
|
+
align?: "start" | "end" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Варианты оформления пузыря
|
|
20
|
+
*/
|
|
21
|
+
type BubbleVariantsT = VariantProps<typeof bubbleVariants>;
|
|
22
|
+
/**
|
|
23
|
+
* Пропсы группы пузырей
|
|
24
|
+
*/
|
|
25
|
+
export type BubbleGroupPropsT = ComponentProps<'div'>;
|
|
26
|
+
/**
|
|
27
|
+
* Пропсы пузыря
|
|
28
|
+
*/
|
|
29
|
+
export type BubblePropsT = ComponentProps<'div'> & {
|
|
30
|
+
/**
|
|
31
|
+
* Оформление: default — основной цвет, secondary, muted — приглушённый, tinted — оттенок основного,
|
|
32
|
+
* outline — с рамкой, ghost — без рамки и фона во всю ширину, destructive — ошибка
|
|
33
|
+
*/
|
|
34
|
+
variant?: BubbleVariantsT['variant'];
|
|
35
|
+
/** Сторона: start — слева (собеседник), end — справа (свои сообщения) */
|
|
36
|
+
align?: 'start' | 'end';
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Пропсы содержимого пузыря
|
|
40
|
+
*/
|
|
41
|
+
export type BubbleContentPropsT = useRender.ComponentProps<'div'>;
|
|
42
|
+
/**
|
|
43
|
+
* Пропсы реакций пузыря
|
|
44
|
+
*/
|
|
45
|
+
export type BubbleReactionsPropsT = ComponentProps<'div'> & {
|
|
46
|
+
/** Край пузыря по горизонтали: start — слева, end — справа */
|
|
47
|
+
align?: 'start' | 'end';
|
|
48
|
+
/** Край пузыря по вертикали: top — сверху, bottom — снизу */
|
|
49
|
+
side?: 'top' | 'bottom';
|
|
50
|
+
};
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/bubble/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Стили пузыря: цвет содержимого задаёт вариант.
|
|
5
|
+
* Содержимое-кнопка или ссылка (render у BubbleContent) меняет фон при наведении
|
|
6
|
+
*/
|
|
7
|
+
const bubbleVariants = cva(["group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1", "data-[align=end]:self-end data-[variant=ghost]:max-w-full group-data-[align=end]/message:self-end"], {
|
|
8
|
+
variants: { variant: {
|
|
9
|
+
default: ["*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground", "[&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80"],
|
|
10
|
+
secondary: ["*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground", "[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]"],
|
|
11
|
+
muted: ["*:data-[slot=bubble-content]:bg-muted", "[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]"],
|
|
12
|
+
tinted: [
|
|
13
|
+
"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)]",
|
|
14
|
+
"dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)]",
|
|
15
|
+
"*:data-[slot=bubble-content]:text-foreground",
|
|
16
|
+
"[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)]",
|
|
17
|
+
"dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]"
|
|
18
|
+
],
|
|
19
|
+
outline: [
|
|
20
|
+
"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background",
|
|
21
|
+
"[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted",
|
|
22
|
+
"[&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground",
|
|
23
|
+
"dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30"
|
|
24
|
+
],
|
|
25
|
+
ghost: [
|
|
26
|
+
"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent",
|
|
27
|
+
"*:data-[slot=bubble-content]:p-0",
|
|
28
|
+
"[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted",
|
|
29
|
+
"[&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground",
|
|
30
|
+
"dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50"
|
|
31
|
+
],
|
|
32
|
+
destructive: [
|
|
33
|
+
"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive",
|
|
34
|
+
"dark:*:data-[slot=bubble-content]:bg-destructive/20",
|
|
35
|
+
"[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20",
|
|
36
|
+
"dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"
|
|
37
|
+
]
|
|
38
|
+
} },
|
|
39
|
+
defaultVariants: { variant: "default" }
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Стили реакций: плашка на краю пузыря сверху или снизу
|
|
43
|
+
*/
|
|
44
|
+
const bubbleReactionsVariants = cva(["absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5", "text-sm ring-3 ring-card has-[button]:p-0"], {
|
|
45
|
+
variants: {
|
|
46
|
+
side: {
|
|
47
|
+
top: "top-0 -translate-y-3/4",
|
|
48
|
+
bottom: "bottom-0 translate-y-3/4"
|
|
49
|
+
},
|
|
50
|
+
align: {
|
|
51
|
+
start: "left-3",
|
|
52
|
+
end: "right-3"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
side: "bottom",
|
|
57
|
+
align: "end"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
export { bubbleReactionsVariants, bubbleVariants };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ButtonPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Кнопка: действие на странице или в форме. Ссылку в стилях кнопки рисуют через render={<a href />}
|
|
4
|
+
* @param props - пропсы кнопки
|
|
5
|
+
* @returns кнопка или свой элемент в стилях кнопки
|
|
6
|
+
*/
|
|
7
|
+
export declare function Button({ className, variant, size, disabled, loading, loadingLabel, render, nativeButton, onClick, holdToConfirm, holdDuration, holdResetDelay, onConfirm, onHoldCancel, confirmedContent, holdLabel, ref, children, ...props }: ButtonPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { texts } from "../../lib/locale.js";
|
|
4
|
+
import { buttonHoldFillVariants, buttonVariants } from "./types.js";
|
|
5
|
+
import { useHoldToConfirm } from "./use-hold-to-confirm.js";
|
|
6
|
+
import { LoaderCircleIcon } from "lucide-react";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Button } from "@base-ui/react/button";
|
|
9
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
10
|
+
import { isValidElement, useId } from "react";
|
|
11
|
+
// src/components/button/button.tsx
|
|
12
|
+
/**
|
|
13
|
+
* render отрисовывает не <button>: ссылку или другой элемент
|
|
14
|
+
* @param render - свой элемент
|
|
15
|
+
* @returns true, если это не кнопка
|
|
16
|
+
*/
|
|
17
|
+
function isCustomElement(render) {
|
|
18
|
+
if (render === void 0) return false;
|
|
19
|
+
return !isValidElement(render) || render.type !== "button";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Кнопка: действие на странице или в форме. Ссылку в стилях кнопки рисуют через render={<a href />}
|
|
23
|
+
* @param props - пропсы кнопки
|
|
24
|
+
* @returns кнопка или свой элемент в стилях кнопки
|
|
25
|
+
*/
|
|
26
|
+
function Button$1({ className, variant = "default", size = "default", disabled = false, loading = false, loadingLabel = texts.loading, render, nativeButton, onClick, holdToConfirm = false, holdDuration = 1500, holdResetDelay = 2e3, onConfirm, onHoldCancel, confirmedContent, holdLabel = texts.holdToConfirm, ref, children, ...props }) {
|
|
27
|
+
const isInactive = disabled || loading;
|
|
28
|
+
const isCustom = isCustomElement(render);
|
|
29
|
+
const holdLabelId = useId();
|
|
30
|
+
const hold = useHoldToConfirm({
|
|
31
|
+
enabled: holdToConfirm,
|
|
32
|
+
duration: holdDuration,
|
|
33
|
+
resetDelay: holdResetDelay,
|
|
34
|
+
disabled: isInactive,
|
|
35
|
+
onConfirm,
|
|
36
|
+
onCancel: onHoldCancel
|
|
37
|
+
});
|
|
38
|
+
const isConfirmed = hold.state === "confirmed";
|
|
39
|
+
const classes = cn(buttonVariants({
|
|
40
|
+
variant,
|
|
41
|
+
size
|
|
42
|
+
}), holdToConfirm && "relative", holdToConfirm && "touch-manipulation", holdToConfirm && "[-webkit-touch-callout:none]", holdToConfirm && "transition-[color,background-color,border-color,box-shadow,scale]", holdToConfirm && "duration-[600ms]", holdToConfirm && "ease-spring-bounce", holdToConfirm && "data-[hold=holding]:scale-[0.97]", holdToConfirm && "data-[hold=holding]:duration-200", holdToConfirm && "data-[hold=holding]:ease-out", holdToConfirm && "motion-reduce:scale-100", className);
|
|
43
|
+
/**
|
|
44
|
+
* Нажатие: у отключённой ссылки отменить переход и не вызывать onClick
|
|
45
|
+
* @param event - событие нажатия
|
|
46
|
+
*/
|
|
47
|
+
const handleClick = (event) => {
|
|
48
|
+
if (isInactive) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
onClick?.(event);
|
|
53
|
+
};
|
|
54
|
+
const ariaDisabled = isCustom && isInactive || void 0;
|
|
55
|
+
const nativeDisabled = isCustom ? void 0 : isInactive;
|
|
56
|
+
/**
|
|
57
|
+
* Элемент кнопки: в хук удержания и наружу
|
|
58
|
+
* @param node - элемент или null при размонтировании
|
|
59
|
+
*/
|
|
60
|
+
const setRef = (node) => {
|
|
61
|
+
hold.setElement(node);
|
|
62
|
+
if (typeof ref === "function") {
|
|
63
|
+
ref(node);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (ref) ref.current = node;
|
|
67
|
+
};
|
|
68
|
+
const holdProps = holdToConfirm ? {
|
|
69
|
+
...hold.handlers,
|
|
70
|
+
"data-hold": hold.state,
|
|
71
|
+
"aria-describedby": holdLabelId
|
|
72
|
+
} : {};
|
|
73
|
+
const rootProps = mergeProps(props, holdProps);
|
|
74
|
+
const fillClasses = buttonHoldFillVariants({ variant });
|
|
75
|
+
const fillContent = isConfirmed ? confirmedContent ?? /* @__PURE__ */ jsx(ButtonConfirmed, {}) : children;
|
|
76
|
+
const fillKey = isConfirmed ? "confirmed" : "idle";
|
|
77
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
78
|
+
"data-slot": "button",
|
|
79
|
+
"data-variant": variant,
|
|
80
|
+
"data-size": size,
|
|
81
|
+
"data-loading": loading || void 0,
|
|
82
|
+
"aria-busy": loading || void 0,
|
|
83
|
+
"aria-disabled": ariaDisabled,
|
|
84
|
+
disabled: nativeDisabled,
|
|
85
|
+
nativeButton: nativeButton ?? !isCustom,
|
|
86
|
+
render,
|
|
87
|
+
ref: setRef,
|
|
88
|
+
className: classes,
|
|
89
|
+
onClick: handleClick,
|
|
90
|
+
...rootProps,
|
|
91
|
+
children: [
|
|
92
|
+
loading && /* @__PURE__ */ jsx(ButtonSpinner, {}),
|
|
93
|
+
children,
|
|
94
|
+
loading && " ",
|
|
95
|
+
loading && /* @__PURE__ */ jsx("span", {
|
|
96
|
+
className: "sr-only",
|
|
97
|
+
children: loadingLabel
|
|
98
|
+
}),
|
|
99
|
+
holdToConfirm && /* @__PURE__ */ jsx("span", {
|
|
100
|
+
"data-slot": "button-hold-fill",
|
|
101
|
+
"aria-hidden": true,
|
|
102
|
+
className: fillClasses,
|
|
103
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
104
|
+
className: "inline-flex items-center gap-[inherit] animate-in duration-300 fade-in-0 zoom-in-90 blur-in",
|
|
105
|
+
children: fillContent
|
|
106
|
+
}, fillKey)
|
|
107
|
+
}),
|
|
108
|
+
holdToConfirm && /* @__PURE__ */ jsx("span", {
|
|
109
|
+
id: holdLabelId,
|
|
110
|
+
className: "sr-only",
|
|
111
|
+
children: holdLabel
|
|
112
|
+
}),
|
|
113
|
+
holdToConfirm && /* @__PURE__ */ jsx("span", {
|
|
114
|
+
"aria-live": "polite",
|
|
115
|
+
className: "sr-only",
|
|
116
|
+
children: isConfirmed && texts.done
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Содержимое после подтверждения удержанием: прорисованная галочка и «Готово»
|
|
123
|
+
* @returns галочка и текст
|
|
124
|
+
*/
|
|
125
|
+
function ButtonConfirmed() {
|
|
126
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("svg", {
|
|
127
|
+
viewBox: "0 0 24 24",
|
|
128
|
+
fill: "none",
|
|
129
|
+
stroke: "currentColor",
|
|
130
|
+
strokeWidth: 2.5,
|
|
131
|
+
strokeLinecap: "round",
|
|
132
|
+
strokeLinejoin: "round",
|
|
133
|
+
"aria-hidden": true,
|
|
134
|
+
"data-icon": "inline-start",
|
|
135
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
136
|
+
d: "M5 12.5l4.5 4.5L19 7.5",
|
|
137
|
+
pathLength: 1,
|
|
138
|
+
strokeDasharray: 1,
|
|
139
|
+
className: "animate-draw motion-reduce:animate-none"
|
|
140
|
+
})
|
|
141
|
+
}), texts.done] });
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Спиннер загрузки: декоративный, состояние объявляет текст loadingLabel
|
|
145
|
+
* @returns иконка спиннера
|
|
146
|
+
*/
|
|
147
|
+
function ButtonSpinner() {
|
|
148
|
+
return /* @__PURE__ */ jsx(LoaderCircleIcon, {
|
|
149
|
+
"data-slot": "button-spinner",
|
|
150
|
+
"data-icon": "inline-start",
|
|
151
|
+
"aria-hidden": true,
|
|
152
|
+
className: "animate-spin"
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
export { Button$1 as Button };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ButtonPropsT, HoldStateT, HoldToConfirmOptionsI, buttonHoldFillVariants, buttonVariants } from "./types.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import { useHoldToConfirm } from "./use-hold-to-confirm.js";
|
|
4
|
+
export { Button, type ButtonPropsT, type HoldStateT, type HoldToConfirmOptionsI, buttonHoldFillVariants, buttonVariants, useHoldToConfirm };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Button } from "@base-ui/react/button";
|
|
4
|
+
import { MouseEvent, ReactNode, Ref } from "react";
|
|
5
|
+
/**
|
|
6
|
+
* Стили кнопки: вариант оформления и размер.
|
|
7
|
+
* Экспортируются, чтобы оформить кнопкой другой элемент: buttonVariants({ variant: 'outline' }).
|
|
8
|
+
*
|
|
9
|
+
* Отключённая кнопка (disabled или aria-disabled у render) не теряет события мыши, чтобы показать
|
|
10
|
+
* курсор not-allowed (в загрузке — progress): нажатие блокирует сам disabled или обработчик Button,
|
|
11
|
+
* а цвета наведения у каждого варианта возвращаются к обычным.
|
|
12
|
+
*/
|
|
13
|
+
export declare const buttonVariants: (props?: ({
|
|
14
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
15
|
+
size?: "default" | "icon" | "sm" | "xs" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
16
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Варианты оформления и размеры кнопки
|
|
19
|
+
*/
|
|
20
|
+
export type ButtonVariantsT = VariantProps<typeof buttonVariants>;
|
|
21
|
+
/**
|
|
22
|
+
* Стили заливки удержания: растёт слева направо поверх кнопки, цвет контрастен варианту
|
|
23
|
+
*/
|
|
24
|
+
export declare const buttonHoldFillVariants: (props?: ({
|
|
25
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
26
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Пропсы кнопки
|
|
29
|
+
*/
|
|
30
|
+
export type ButtonPropsT = PartPropsT<Omit<Button.Props, 'onClick' | 'disabled' | 'ref'>> & {
|
|
31
|
+
/** Оформление: основная, контурная, второстепенная, без фона, опасное действие или ссылка */
|
|
32
|
+
variant?: ButtonVariantsT['variant'];
|
|
33
|
+
/** Размер: xs, sm, default, lg — для кнопки с текстом; icon-xs, icon-sm, icon, icon-lg — для кнопки с одной иконкой */
|
|
34
|
+
size?: ButtonVariantsT['size'];
|
|
35
|
+
/** Отключённое состояние: кнопка не нажимается */
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/** Состояние загрузки: спиннер вместо иконки в начале, кнопка отключена */
|
|
38
|
+
loading?: boolean;
|
|
39
|
+
/** Текст для скринридера во время загрузки, по умолчанию «Загрузка…» */
|
|
40
|
+
loadingLabel?: string;
|
|
41
|
+
/** Нажатие на кнопку. Не вызывается, пока кнопка отключена или в состоянии загрузки */
|
|
42
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
43
|
+
/** Подтверждение удержанием: действие срабатывает, только если держать кнопку holdDuration мс */
|
|
44
|
+
holdToConfirm?: boolean;
|
|
45
|
+
/** Сколько держать кнопку до подтверждения, мс. По умолчанию 1500 */
|
|
46
|
+
holdDuration?: number;
|
|
47
|
+
/** Через сколько мс после подтверждения кнопка вернётся в исходный вид; false — останется. По умолчанию 2000 */
|
|
48
|
+
holdResetDelay?: number | false;
|
|
49
|
+
/** Кнопку удержали до конца */
|
|
50
|
+
onConfirm?: () => void;
|
|
51
|
+
/** Кнопку отпустили раньше: доля пройденного пути от 0 до 1 */
|
|
52
|
+
onHoldCancel?: (progress: number) => void;
|
|
53
|
+
/** Содержимое после подтверждения, по умолчанию галочка и «Готово» */
|
|
54
|
+
confirmedContent?: ReactNode;
|
|
55
|
+
/** Подсказка для скринридера, по умолчанию «Нажмите и удерживайте, чтобы подтвердить» */
|
|
56
|
+
holdLabel?: string;
|
|
57
|
+
/** Ссылка на элемент кнопки */
|
|
58
|
+
ref?: Ref<HTMLElement>;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Состояние удержания: ожидание, удерживают, подтверждено, возврат к ожиданию
|
|
62
|
+
*/
|
|
63
|
+
export type HoldStateT = 'idle' | 'holding' | 'confirmed' | 'resetting';
|
|
64
|
+
/**
|
|
65
|
+
* Настройки удержания для подтверждения
|
|
66
|
+
* @property enabled - Включить удержание; false — обработчики ничего не делают
|
|
67
|
+
* @property duration - Сколько держать до подтверждения, мс
|
|
68
|
+
* @property resetDelay - Через сколько мс после подтверждения вернуться к ожиданию; false — остаться
|
|
69
|
+
* @property disabled - Не реагировать на нажатия
|
|
70
|
+
* @property onConfirm - Удержали до конца
|
|
71
|
+
* @property onCancel - Отпустили раньше: доля пройденного пути от 0 до 1
|
|
72
|
+
*/
|
|
73
|
+
export interface HoldToConfirmOptionsI {
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
duration: number;
|
|
76
|
+
resetDelay: number | false;
|
|
77
|
+
disabled: boolean;
|
|
78
|
+
onConfirm?: () => void;
|
|
79
|
+
onCancel?: (progress: number) => void;
|
|
80
|
+
}
|