@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,123 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createHighlighterCore } from "shiki/core";
|
|
3
|
+
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
4
|
+
// src/components/code-block/highlighter.tsx
|
|
5
|
+
/** Поддерживаемые языки: каждый загружается при первом использовании */
|
|
6
|
+
const languages = {
|
|
7
|
+
bash: () => import("shiki/langs/shellscript.mjs"),
|
|
8
|
+
css: () => import("shiki/langs/css.mjs"),
|
|
9
|
+
diff: () => import("shiki/langs/diff.mjs"),
|
|
10
|
+
html: () => import("shiki/langs/html.mjs"),
|
|
11
|
+
javascript: () => import("shiki/langs/javascript.mjs"),
|
|
12
|
+
json: () => import("shiki/langs/json.mjs"),
|
|
13
|
+
jsx: () => import("shiki/langs/jsx.mjs"),
|
|
14
|
+
markdown: () => import("shiki/langs/markdown.mjs"),
|
|
15
|
+
python: () => import("shiki/langs/python.mjs"),
|
|
16
|
+
sql: () => import("shiki/langs/sql.mjs"),
|
|
17
|
+
tsx: () => import("shiki/langs/tsx.mjs"),
|
|
18
|
+
typescript: () => import("shiki/langs/typescript.mjs"),
|
|
19
|
+
yaml: () => import("shiki/langs/yaml.mjs")
|
|
20
|
+
};
|
|
21
|
+
/** Другие имена языков */
|
|
22
|
+
const aliases = {
|
|
23
|
+
js: "javascript",
|
|
24
|
+
md: "markdown",
|
|
25
|
+
py: "python",
|
|
26
|
+
sh: "bash",
|
|
27
|
+
shell: "bash",
|
|
28
|
+
shellscript: "bash",
|
|
29
|
+
ts: "typescript",
|
|
30
|
+
yml: "yaml",
|
|
31
|
+
zsh: "bash"
|
|
32
|
+
};
|
|
33
|
+
let highlighterPromise;
|
|
34
|
+
/**
|
|
35
|
+
* Получить общий экземпляр shiki со светлой и тёмной темой
|
|
36
|
+
* @returns экземпляр shiki
|
|
37
|
+
*/
|
|
38
|
+
function getHighlighter() {
|
|
39
|
+
highlighterPromise ??= createHighlighterCore({
|
|
40
|
+
themes: [import("shiki/themes/one-light.mjs"), import("shiki/themes/one-dark-pro.mjs")],
|
|
41
|
+
langs: [],
|
|
42
|
+
engine: createJavaScriptRegexEngine({ forgiving: true })
|
|
43
|
+
});
|
|
44
|
+
return highlighterPromise;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Найти язык по имени или псевдониму
|
|
48
|
+
* @param language - имя языка
|
|
49
|
+
* @returns язык, ansi или null, если язык не поддерживается
|
|
50
|
+
*/
|
|
51
|
+
function getLanguage(language) {
|
|
52
|
+
const name = language.toLowerCase();
|
|
53
|
+
if (name === "ansi") return name;
|
|
54
|
+
if (name in languages) return name;
|
|
55
|
+
return aliases[name] ?? null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Отрисовать строку токенов: цвет светлой и тёмной темы в CSS-переменных
|
|
59
|
+
* @param line - токены строки
|
|
60
|
+
* @returns узлы строки
|
|
61
|
+
*/
|
|
62
|
+
function renderLine(line) {
|
|
63
|
+
const nodes = [];
|
|
64
|
+
line.forEach((token, index) => {
|
|
65
|
+
nodes.push(/* @__PURE__ */ jsx("span", {
|
|
66
|
+
style: token.htmlStyle,
|
|
67
|
+
className: "text-(--shiki-light) dark:text-(--shiki-dark)",
|
|
68
|
+
children: token.content
|
|
69
|
+
}, index));
|
|
70
|
+
});
|
|
71
|
+
return nodes;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Загрузить язык и вернуть подсветку для него
|
|
75
|
+
* @param language - имя языка: ts, tsx, json, bash, ansi…
|
|
76
|
+
* @returns подсветка или null для языка не из списка
|
|
77
|
+
*/
|
|
78
|
+
async function loadHighlighter(language) {
|
|
79
|
+
const lang = getLanguage(language);
|
|
80
|
+
if (lang === null) return null;
|
|
81
|
+
const shiki = await getHighlighter();
|
|
82
|
+
if (lang !== "ansi" && !shiki.getLoadedLanguages().includes(lang)) await shiki.loadLanguage(languages[lang]);
|
|
83
|
+
/**
|
|
84
|
+
* Подсветить код
|
|
85
|
+
* @param code - код
|
|
86
|
+
* @param state - состояние грамматики, с которого продолжить
|
|
87
|
+
* @returns строки и состояние грамматики после последней
|
|
88
|
+
*/
|
|
89
|
+
const highlight = (code, state) => {
|
|
90
|
+
/**
|
|
91
|
+
* Разбить текст на токены
|
|
92
|
+
* @param text - текст
|
|
93
|
+
* @returns строки токенов
|
|
94
|
+
*/
|
|
95
|
+
const tokenize = (text) => shiki.codeToTokens(text, {
|
|
96
|
+
lang,
|
|
97
|
+
themes: {
|
|
98
|
+
light: "one-light",
|
|
99
|
+
dark: "one-dark-pro"
|
|
100
|
+
},
|
|
101
|
+
defaultColor: false,
|
|
102
|
+
grammarState: state
|
|
103
|
+
}).tokens;
|
|
104
|
+
const tokens = lang === "ansi" ? code.split("\n").flatMap((line) => tokenize(line)) : tokenize(code);
|
|
105
|
+
return {
|
|
106
|
+
lines: tokens.map(renderLine),
|
|
107
|
+
state: shiki.getLastGrammarState(tokens)
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
return { highlight };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Подсветить код целиком
|
|
114
|
+
* @param code - код
|
|
115
|
+
* @param language - имя языка
|
|
116
|
+
* @returns по узлу React на строку или null для языка не из списка
|
|
117
|
+
*/
|
|
118
|
+
async function highlightCode(code, language) {
|
|
119
|
+
const highlighter = await loadHighlighter(language);
|
|
120
|
+
if (highlighter === null) return null;
|
|
121
|
+
return highlighter.highlight(code).lines;
|
|
122
|
+
}
|
|
123
|
+
export { highlightCode, loadHighlighter };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CodeBlockActionsPropsT, CodeBlockContentPropsT, CodeBlockCopyButtonPropsT, CodeBlockFooterPropsT, CodeBlockHeaderPropsT, CodeBlockLinePropsT, CodeBlockPropsT, CodeBlockTitlePropsT, CodeHighlighterI, HighlightResultI, codeBlockLineVariants, codeBlockVariants } from "./types.js";
|
|
2
|
+
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle } from "./code-block.js";
|
|
3
|
+
import { highlightCode, loadHighlighter } from "./highlighter.js";
|
|
4
|
+
import { useHighlightedCode } from "./use-highlighted-code.js";
|
|
5
|
+
export { CodeBlock, CodeBlockActions, type CodeBlockActionsPropsT, CodeBlockContent, type CodeBlockContentPropsT, CodeBlockCopyButton, type CodeBlockCopyButtonPropsT, CodeBlockFooter, type CodeBlockFooterPropsT, CodeBlockHeader, type CodeBlockHeaderPropsT, CodeBlockLine, type CodeBlockLinePropsT, type CodeBlockPropsT, CodeBlockTitle, type CodeBlockTitlePropsT, type CodeHighlighterI, type HighlightResultI, codeBlockLineVariants, codeBlockVariants, highlightCode, loadHighlighter, useHighlightedCode };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { codeBlockLineVariants, codeBlockVariants } from "./types.js";
|
|
2
|
+
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle } from "./code-block.js";
|
|
3
|
+
import { highlightCode, loadHighlighter } from "./highlighter.js";
|
|
4
|
+
import { useHighlightedCode } from "./use-highlighted-code.js";
|
|
5
|
+
export { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, codeBlockLineVariants, codeBlockVariants, highlightCode, loadHighlighter, useHighlightedCode };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ButtonPropsT } from "../button/types.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
import { GrammarState } from "shiki/core";
|
|
5
|
+
/**
|
|
6
|
+
* Стили блока кода: обычный или блок ошибки
|
|
7
|
+
*/
|
|
8
|
+
export declare const codeBlockVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Стили строки кода: обычная, подсвеченная, добавленная или удалённая
|
|
13
|
+
*/
|
|
14
|
+
export declare const codeBlockLineVariants: (props?: ({
|
|
15
|
+
variant?: "default" | "added" | "removed" | "highlighted" | null | undefined;
|
|
16
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Вариант оформления блока кода
|
|
19
|
+
*/
|
|
20
|
+
export type CodeBlockVariantsT = VariantProps<typeof codeBlockVariants>;
|
|
21
|
+
/**
|
|
22
|
+
* Вариант строки кода
|
|
23
|
+
*/
|
|
24
|
+
export type CodeBlockLineVariantsT = VariantProps<typeof codeBlockLineVariants>;
|
|
25
|
+
/**
|
|
26
|
+
* Пропсы блока кода
|
|
27
|
+
*/
|
|
28
|
+
export type CodeBlockPropsT = ComponentProps<'div'> & {
|
|
29
|
+
/** Оформление: default — обычный код, destructive — вывод ошибки */
|
|
30
|
+
variant?: CodeBlockVariantsT['variant'];
|
|
31
|
+
/** Размер: default или sm — мельче шрифт и отступы */
|
|
32
|
+
size?: 'default' | 'sm';
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Пропсы шапки блока кода
|
|
36
|
+
*/
|
|
37
|
+
export type CodeBlockHeaderPropsT = ComponentProps<'div'>;
|
|
38
|
+
/**
|
|
39
|
+
* Пропсы заголовка блока кода
|
|
40
|
+
*/
|
|
41
|
+
export type CodeBlockTitlePropsT = ComponentProps<'div'>;
|
|
42
|
+
/**
|
|
43
|
+
* Пропсы действий блока кода
|
|
44
|
+
*/
|
|
45
|
+
export type CodeBlockActionsPropsT = ComponentProps<'div'>;
|
|
46
|
+
/**
|
|
47
|
+
* Пропсы кнопки копирования
|
|
48
|
+
*/
|
|
49
|
+
export type CodeBlockCopyButtonPropsT = ButtonPropsT & {
|
|
50
|
+
/** Текст, который копируется в буфер обмена */
|
|
51
|
+
value: string;
|
|
52
|
+
/** Подпись кнопки для скринридера, по умолчанию «Копировать» */
|
|
53
|
+
copyLabel?: string;
|
|
54
|
+
/** Подпись после копирования и объявление для скринридера, по умолчанию «Скопировано» */
|
|
55
|
+
copiedLabel?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Пропсы содержимого блока кода
|
|
59
|
+
*/
|
|
60
|
+
export type CodeBlockContentPropsT = ComponentProps<'pre'> & {
|
|
61
|
+
/** Переносить длинные строки вместо горизонтальной прокрутки */
|
|
62
|
+
wrap?: boolean;
|
|
63
|
+
/** Показывать номера строк */
|
|
64
|
+
lineNumbers?: boolean;
|
|
65
|
+
/** Номер первой строки, по умолчанию 1 */
|
|
66
|
+
startLine?: number;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Пропсы строки кода
|
|
70
|
+
*/
|
|
71
|
+
export type CodeBlockLinePropsT = ComponentProps<'span'> & {
|
|
72
|
+
/** Оформление: default, highlighted — подсвечена, added — добавлена (+), removed — удалена (−) */
|
|
73
|
+
variant?: CodeBlockLineVariantsT['variant'];
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Пропсы подвала блока кода
|
|
77
|
+
*/
|
|
78
|
+
export type CodeBlockFooterPropsT = ComponentProps<'div'>;
|
|
79
|
+
/**
|
|
80
|
+
* Результат подсветки
|
|
81
|
+
* @property lines - по узлу React на строку
|
|
82
|
+
* @property state - состояние грамматики после последней строки: продолжить подсветку с того же места
|
|
83
|
+
*/
|
|
84
|
+
export interface HighlightResultI {
|
|
85
|
+
lines: ReactNode[];
|
|
86
|
+
state?: GrammarState;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Подсветка для одного языка
|
|
90
|
+
* @property highlight - подсветить код, продолжая с состояния грамматики
|
|
91
|
+
*/
|
|
92
|
+
export interface CodeHighlighterI {
|
|
93
|
+
highlight: (code: string, state?: GrammarState) => HighlightResultI;
|
|
94
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/code-block/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Стили блока кода: обычный или блок ошибки
|
|
5
|
+
*/
|
|
6
|
+
const codeBlockVariants = cva([
|
|
7
|
+
"group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-lg text-sm",
|
|
8
|
+
"data-[size=sm]:text-xs",
|
|
9
|
+
"keyboard:has-[>[data-slot=code-block-content]:focus-visible]:ring-3",
|
|
10
|
+
"keyboard:has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/50"
|
|
11
|
+
], {
|
|
12
|
+
variants: { variant: {
|
|
13
|
+
default: "bg-muted text-foreground ring-1 ring-foreground/5 dark:ring-foreground/10",
|
|
14
|
+
destructive: ["bg-destructive/5 text-destructive ring-1 ring-destructive/15", "dark:bg-destructive/10 dark:ring-destructive/20"]
|
|
15
|
+
} },
|
|
16
|
+
defaultVariants: { variant: "default" }
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Стили строки кода: обычная, подсвеченная, добавленная или удалённая
|
|
20
|
+
*/
|
|
21
|
+
const codeBlockLineVariants = cva([
|
|
22
|
+
"relative -mx-3 block min-h-lh px-3 group-data-[size=sm]/code-block:-mx-2.5 group-data-[size=sm]/code-block:px-2.5",
|
|
23
|
+
"after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none",
|
|
24
|
+
"in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3",
|
|
25
|
+
"in-data-numbered:[counter-increment:line]",
|
|
26
|
+
"in-data-numbered:before:min-w-6 in-data-numbered:before:text-end in-data-numbered:before:text-muted-foreground",
|
|
27
|
+
"in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none",
|
|
28
|
+
"in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']"
|
|
29
|
+
], {
|
|
30
|
+
variants: { variant: {
|
|
31
|
+
default: "",
|
|
32
|
+
added: "bg-foreground/5 after:content-['+']",
|
|
33
|
+
removed: "bg-destructive/10 after:text-destructive after:content-['−']",
|
|
34
|
+
highlighted: "bg-foreground/5"
|
|
35
|
+
} },
|
|
36
|
+
defaultVariants: { variant: "default" }
|
|
37
|
+
});
|
|
38
|
+
export { codeBlockLineVariants, codeBlockVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Подсветить код по строкам. Пока язык загружается — строки без подсветки.
|
|
4
|
+
* При потоковом коде подсвечиваются только новые строки, начиная с состояния последней
|
|
5
|
+
* @param value - код
|
|
6
|
+
* @param language - имя языка: ts, tsx, json, bash, ansi…
|
|
7
|
+
* @returns по узлу React на строку — для CodeBlockLine
|
|
8
|
+
*/
|
|
9
|
+
export declare function useHighlightedCode(value: string, language: string): ReactNode[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { loadHighlighter } from "./highlighter.js";
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
4
|
+
// src/components/code-block/use-highlighted-code.ts
|
|
5
|
+
/**
|
|
6
|
+
* Подсветить код по строкам. Пока язык загружается — строки без подсветки.
|
|
7
|
+
* При потоковом коде подсвечиваются только новые строки, начиная с состояния последней
|
|
8
|
+
* @param value - код
|
|
9
|
+
* @param language - имя языка: ts, tsx, json, bash, ansi…
|
|
10
|
+
* @returns по узлу React на строку — для CodeBlockLine
|
|
11
|
+
*/
|
|
12
|
+
function useHighlightedCode(value, language) {
|
|
13
|
+
const code = value.endsWith("\n") ? value.slice(0, -1) : value;
|
|
14
|
+
const [loaded, setLoaded] = useState(null);
|
|
15
|
+
const highlighter = loaded?.language === language ? loaded.highlighter : null;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
let isCancelled = false;
|
|
18
|
+
/**
|
|
19
|
+
* Сохранить загруженную подсветку, если язык ещё актуален
|
|
20
|
+
* @param next - подсветка
|
|
21
|
+
*/
|
|
22
|
+
const saveHighlighter = (next) => {
|
|
23
|
+
if (!isCancelled) setLoaded({
|
|
24
|
+
language,
|
|
25
|
+
highlighter: next
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
loadHighlighter(language).then(saveHighlighter).catch(() => void 0);
|
|
29
|
+
return () => {
|
|
30
|
+
isCancelled = true;
|
|
31
|
+
};
|
|
32
|
+
}, [language]);
|
|
33
|
+
const [done, setDone] = useState({
|
|
34
|
+
highlighter: null,
|
|
35
|
+
text: "",
|
|
36
|
+
lines: []
|
|
37
|
+
});
|
|
38
|
+
let next = done;
|
|
39
|
+
if (next.highlighter !== highlighter || !code.startsWith(next.text)) next = {
|
|
40
|
+
highlighter,
|
|
41
|
+
text: "",
|
|
42
|
+
lines: []
|
|
43
|
+
};
|
|
44
|
+
const end = code.lastIndexOf("\n") + 1;
|
|
45
|
+
if (highlighter !== null && end > next.text.length) {
|
|
46
|
+
const result = highlighter.highlight(code.slice(next.text.length, end - 1), next.state);
|
|
47
|
+
next = {
|
|
48
|
+
highlighter,
|
|
49
|
+
text: code.slice(0, end),
|
|
50
|
+
lines: next.lines.concat(result.lines),
|
|
51
|
+
state: result.state
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (next !== done) setDone(next);
|
|
55
|
+
const tail = code.slice(end);
|
|
56
|
+
return useMemo(() => {
|
|
57
|
+
if (highlighter === null) return code.split("\n");
|
|
58
|
+
const tailLine = highlighter.highlight(tail, next.state).lines[0];
|
|
59
|
+
return next.lines.concat([tailLine]);
|
|
60
|
+
}, [
|
|
61
|
+
code,
|
|
62
|
+
highlighter,
|
|
63
|
+
next,
|
|
64
|
+
tail
|
|
65
|
+
]);
|
|
66
|
+
}
|
|
67
|
+
export { useHighlightedCode };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CollapsibleContentPropsT, CollapsiblePropsT, CollapsibleTriggerPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Раскрывающийся блок: показывает и скрывает содержимое по нажатию на переключатель
|
|
4
|
+
* @param props - пропсы блока
|
|
5
|
+
* @returns обёртка переключателя и содержимого
|
|
6
|
+
*/
|
|
7
|
+
export declare function Collapsible({ onOpenChange, ...props }: CollapsiblePropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Переключатель: кнопка, которая раскрывает и скрывает содержимое. Свою кнопку — через render={<Button />}
|
|
10
|
+
* @param props - пропсы переключателя
|
|
11
|
+
* @returns кнопка с aria-expanded
|
|
12
|
+
*/
|
|
13
|
+
export declare function CollapsibleTrigger(props: CollapsibleTriggerPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Содержимое: видно, пока блок раскрыт
|
|
16
|
+
* @param props - пропсы содержимого
|
|
17
|
+
* @returns раскрываемый блок
|
|
18
|
+
*/
|
|
19
|
+
export declare function CollapsibleContent(props: CollapsibleContentPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
4
|
+
// src/components/collapsible/collapsible.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Раскрывающийся блок: показывает и скрывает содержимое по нажатию на переключатель
|
|
7
|
+
* @param props - пропсы блока
|
|
8
|
+
* @returns обёртка переключателя и содержимого
|
|
9
|
+
*/
|
|
10
|
+
function Collapsible$1({ onOpenChange, ...props }) {
|
|
11
|
+
/**
|
|
12
|
+
* Блок раскрыли или скрыли: наружу только флаг
|
|
13
|
+
* @param open - раскрыт ли
|
|
14
|
+
*/
|
|
15
|
+
const handleOpenChange = (open) => onOpenChange?.(open);
|
|
16
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
17
|
+
"data-slot": "collapsible",
|
|
18
|
+
onOpenChange: handleOpenChange,
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Переключатель: кнопка, которая раскрывает и скрывает содержимое. Свою кнопку — через render={<Button />}
|
|
24
|
+
* @param props - пропсы переключателя
|
|
25
|
+
* @returns кнопка с aria-expanded
|
|
26
|
+
*/
|
|
27
|
+
function CollapsibleTrigger(props) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
29
|
+
"data-slot": "collapsible-trigger",
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Содержимое: видно, пока блок раскрыт
|
|
35
|
+
* @param props - пропсы содержимого
|
|
36
|
+
* @returns раскрываемый блок
|
|
37
|
+
*/
|
|
38
|
+
function CollapsibleContent(props) {
|
|
39
|
+
return /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
40
|
+
"data-slot": "collapsible-content",
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export { Collapsible$1 as Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CollapsibleContentPropsT, CollapsiblePropsT, CollapsibleTriggerPropsT } from "./types.js";
|
|
2
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
3
|
+
export { Collapsible, CollapsibleContent, type CollapsibleContentPropsT, type CollapsiblePropsT, CollapsibleTrigger, type CollapsibleTriggerPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
3
|
+
/**
|
|
4
|
+
* Пропсы раскрывающегося блока
|
|
5
|
+
*/
|
|
6
|
+
export type CollapsiblePropsT = PartPropsT<Omit<Collapsible.Root.Props, 'onOpenChange'>> & {
|
|
7
|
+
/** Блок раскрыт — контролируемый режим, вместе с onOpenChange */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
/** Блок раскрыт при первом рендере — неконтролируемый режим */
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
/** Блок раскрыли или скрыли: новое состояние */
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
/** Отключить переключение */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Пропсы переключателя
|
|
18
|
+
*/
|
|
19
|
+
export type CollapsibleTriggerPropsT = PartPropsT<Collapsible.Trigger.Props>;
|
|
20
|
+
/**
|
|
21
|
+
* Пропсы содержимого
|
|
22
|
+
*/
|
|
23
|
+
export type CollapsibleContentPropsT = PartPropsT<Collapsible.Panel.Props> & {
|
|
24
|
+
/** Держать содержимое в DOM, даже когда блок скрыт: для поиска по странице и своих анимаций */
|
|
25
|
+
keepMounted?: boolean;
|
|
26
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ComboboxChipPropsT, ComboboxChipsInputPropsT, ComboboxChipsPropsT, ComboboxClearPropsT, ComboboxCollectionPropsT, ComboboxContentPropsT, ComboboxEmptyPropsT, ComboboxGroupPropsT, ComboboxInputPropsT, ComboboxItemPropsT, ComboboxLabelPropsT, ComboboxListPropsT, ComboboxPropsT, ComboboxSeparatorPropsT, ComboboxTriggerPropsT, ComboboxValuePropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Комбобокс: поле с поиском и выпадающим списком, выбор одного или нескольких значений
|
|
4
|
+
* @param props - пропсы комбобокса; items — пункты, по ним идёт фильтрация
|
|
5
|
+
* @returns корень без своей разметки
|
|
6
|
+
*/
|
|
7
|
+
export declare function Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxPropsT<Value, Multiple>): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Выбранное значение: текст выбранного пункта или функция для своего отображения
|
|
10
|
+
* @param props - пропсы значения
|
|
11
|
+
* @returns текст без своей разметки
|
|
12
|
+
*/
|
|
13
|
+
export declare function ComboboxValue(props: ComboboxValuePropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Кнопка открытия списка: справа стрелка вниз
|
|
16
|
+
* @param props - пропсы кнопки; render — оформить другим элементом, например Button
|
|
17
|
+
* @returns кнопка
|
|
18
|
+
*/
|
|
19
|
+
export declare function ComboboxTrigger({ className, children, ...props }: ComboboxTriggerPropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Кнопка очистки: крестик, сбрасывает выбранное значение и текст
|
|
22
|
+
* @param props - пропсы кнопки; aria-label по умолчанию «Очистить»
|
|
23
|
+
* @returns кнопка
|
|
24
|
+
*/
|
|
25
|
+
export declare function ComboboxClear({ className, 'aria-label': ariaLabel, ...props }: ComboboxClearPropsT): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Поле с поиском: ввод фильтрует список, справа стрелка и крестик очистки.
|
|
28
|
+
* В children можно положить InputGroupAddon с иконкой
|
|
29
|
+
* @param props - пропсы поля; className уходит на рамку InputGroup
|
|
30
|
+
* @returns группа поля
|
|
31
|
+
*/
|
|
32
|
+
export declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxInputPropsT): import("react").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* Всплывающее окно со списком: рендерится в портале под полем, шириной с поле.
|
|
35
|
+
* Внутрь кладутся ComboboxEmpty и ComboboxList, при необходимости ComboboxInput
|
|
36
|
+
* @param props - пропсы окна; по умолчанию side="bottom", align="start", sideOffset={6}
|
|
37
|
+
* @returns портал с окном
|
|
38
|
+
*/
|
|
39
|
+
export declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: ComboboxContentPropsT): import("react").JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* Список пунктов: прокручивается внутри окна
|
|
42
|
+
* @param props - пропсы списка; children — функция (item, index) => ComboboxItem
|
|
43
|
+
* @returns div с role="listbox"
|
|
44
|
+
*/
|
|
45
|
+
export declare function ComboboxList({ className, ...props }: ComboboxListPropsT): import("react").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* Пункт списка: у выбранного справа галочка
|
|
48
|
+
* @param props - пропсы пункта; value — значение пункта
|
|
49
|
+
* @returns div с role="option"
|
|
50
|
+
*/
|
|
51
|
+
export declare function ComboboxItem({ className, children, ref, ...props }: ComboboxItemPropsT): import("react").JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* Группа пунктов с подписью ComboboxLabel
|
|
54
|
+
* @param props - пропсы группы
|
|
55
|
+
* @returns div с role="group"
|
|
56
|
+
*/
|
|
57
|
+
export declare function ComboboxGroup({ className, ...props }: ComboboxGroupPropsT): import("react").JSX.Element;
|
|
58
|
+
/**
|
|
59
|
+
* Подпись группы: мелкий приглушённый текст
|
|
60
|
+
* @param props - пропсы подписи
|
|
61
|
+
* @returns div
|
|
62
|
+
*/
|
|
63
|
+
export declare function ComboboxLabel({ className, ...props }: ComboboxLabelPropsT): import("react").JSX.Element;
|
|
64
|
+
/**
|
|
65
|
+
* Коллекция: отрисовывает пункты группы из ComboboxGroup items
|
|
66
|
+
* @param props - пропсы коллекции
|
|
67
|
+
* @returns пункты без своей разметки
|
|
68
|
+
*/
|
|
69
|
+
export declare function ComboboxCollection(props: ComboboxCollectionPropsT): import("react").JSX.Element;
|
|
70
|
+
/**
|
|
71
|
+
* Пустой результат: показывается, когда ничего не нашлось
|
|
72
|
+
* @param props - пропсы; children по умолчанию «Ничего не найдено»
|
|
73
|
+
* @returns div
|
|
74
|
+
*/
|
|
75
|
+
export declare function ComboboxEmpty({ className, children, ...props }: ComboboxEmptyPropsT): import("react").JSX.Element;
|
|
76
|
+
/**
|
|
77
|
+
* Разделитель между группами
|
|
78
|
+
* @param props - пропсы разделителя
|
|
79
|
+
* @returns div с role="separator"
|
|
80
|
+
*/
|
|
81
|
+
export declare function ComboboxSeparator({ className, ...props }: ComboboxSeparatorPropsT): import("react").JSX.Element;
|
|
82
|
+
/**
|
|
83
|
+
* Поле с чипами для выбора нескольких значений: чипы и ComboboxChipsInput в общей рамке
|
|
84
|
+
* @param props - пропсы поля; ref передайте в anchor у ComboboxContent
|
|
85
|
+
* @returns div
|
|
86
|
+
*/
|
|
87
|
+
export declare function ComboboxChips({ className, ...props }: ComboboxChipsPropsT): import("react").JSX.Element;
|
|
88
|
+
/**
|
|
89
|
+
* Чип выбранного значения: текст и крестик удаления
|
|
90
|
+
* @param props - пропсы чипа
|
|
91
|
+
* @returns div
|
|
92
|
+
*/
|
|
93
|
+
export declare function ComboboxChip({ className, children, showRemove, removeLabel, ...props }: ComboboxChipPropsT): import("react").JSX.Element;
|
|
94
|
+
/**
|
|
95
|
+
* Поле ввода среди чипов: занимает оставшееся место в строке
|
|
96
|
+
* @param props - пропсы поля
|
|
97
|
+
* @returns input
|
|
98
|
+
*/
|
|
99
|
+
export declare function ComboboxChipsInput({ className, ...props }: ComboboxChipsInputPropsT): import("react").JSX.Element;
|
|
100
|
+
/**
|
|
101
|
+
* Ref для привязки окна к полю с чипами: передайте в ComboboxChips ref и в ComboboxContent anchor
|
|
102
|
+
* @returns ref на div
|
|
103
|
+
*/
|
|
104
|
+
export declare function useComboboxAnchor(): import("react").RefObject<HTMLDivElement | null>;
|