@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,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { toggleVariants } from "../toggle/types.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { createContext, useContext } from "react";
|
|
6
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
7
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
8
|
+
// src/components/toggle-group/toggle-group.tsx
|
|
9
|
+
/** Настройки группы: кнопки берут из них оформление и размер */
|
|
10
|
+
const ToggleGroupContext = createContext({
|
|
11
|
+
spacing: 2,
|
|
12
|
+
orientation: "horizontal"
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Группа переключателей: одна или несколько нажатых кнопок из набора
|
|
16
|
+
* @param props - пропсы группы
|
|
17
|
+
* @returns группа с ролью group
|
|
18
|
+
*/
|
|
19
|
+
function ToggleGroup$1({ className, variant, size, spacing = 2, orientation = "horizontal", style, children, onValueChange, ...props }) {
|
|
20
|
+
const classes = cn("group/toggle-group", "flex", "w-fit", "flex-row", "items-center", "gap-[--spacing(var(--gap))]", "rounded-lg", "data-[size=sm]:rounded-[min(var(--radius-md),10px)]", "data-vertical:flex-col", "data-vertical:items-stretch", className);
|
|
21
|
+
const groupStyle = Object.assign({ "--gap": spacing }, style);
|
|
22
|
+
const context = {
|
|
23
|
+
variant,
|
|
24
|
+
size,
|
|
25
|
+
spacing,
|
|
26
|
+
orientation
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Выбор изменился: наружу только значения
|
|
30
|
+
* @param value - значения нажатых кнопок
|
|
31
|
+
*/
|
|
32
|
+
const handleValueChange = (value) => onValueChange?.(value);
|
|
33
|
+
return /* @__PURE__ */ jsx(ToggleGroup, {
|
|
34
|
+
"data-slot": "toggle-group",
|
|
35
|
+
"data-variant": variant,
|
|
36
|
+
"data-size": size,
|
|
37
|
+
"data-spacing": spacing,
|
|
38
|
+
"data-orientation": orientation,
|
|
39
|
+
orientation,
|
|
40
|
+
style: groupStyle,
|
|
41
|
+
className: classes,
|
|
42
|
+
onValueChange: handleValueChange,
|
|
43
|
+
...props,
|
|
44
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext, {
|
|
45
|
+
value: context,
|
|
46
|
+
children
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/** Классы кнопки, зависящие от группы: слитные кнопки при spacing=0 */
|
|
51
|
+
const itemClasses = [
|
|
52
|
+
"shrink-0 focus:z-10 focus-visible:z-10",
|
|
53
|
+
"group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2",
|
|
54
|
+
"group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5",
|
|
55
|
+
"group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5",
|
|
56
|
+
"group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg",
|
|
57
|
+
"group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg",
|
|
58
|
+
"group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg",
|
|
59
|
+
"group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg",
|
|
60
|
+
"group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0",
|
|
61
|
+
"group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0",
|
|
62
|
+
"group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l",
|
|
63
|
+
"group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t"
|
|
64
|
+
];
|
|
65
|
+
/**
|
|
66
|
+
* Кнопка группы переключателей
|
|
67
|
+
* @param props - пропсы кнопки
|
|
68
|
+
* @returns кнопка с aria-pressed
|
|
69
|
+
*/
|
|
70
|
+
function ToggleGroupItem({ className, variant = "default", size = "default", disabled = false, ...props }) {
|
|
71
|
+
const context = useContext(ToggleGroupContext);
|
|
72
|
+
const itemVariant = context.variant ?? variant;
|
|
73
|
+
const itemSize = context.size ?? size;
|
|
74
|
+
const classes = cn(itemClasses, toggleVariants({
|
|
75
|
+
variant: itemVariant,
|
|
76
|
+
size: itemSize
|
|
77
|
+
}), className);
|
|
78
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
79
|
+
"data-slot": "toggle-group-item",
|
|
80
|
+
"data-variant": itemVariant,
|
|
81
|
+
"data-size": itemSize,
|
|
82
|
+
"data-spacing": context.spacing,
|
|
83
|
+
disabled,
|
|
84
|
+
className: classes,
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export { ToggleGroup$1 as ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { toggleVariants } from "../toggle/types.js";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
5
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
6
|
+
/**
|
|
7
|
+
* Варианты оформления и размеры кнопок группы
|
|
8
|
+
*/
|
|
9
|
+
type ToggleVariantsT = VariantProps<typeof toggleVariants>;
|
|
10
|
+
/**
|
|
11
|
+
* Ориентация группы
|
|
12
|
+
*/
|
|
13
|
+
type ToggleGroupOrientationT = 'horizontal' | 'vertical';
|
|
14
|
+
/**
|
|
15
|
+
* Пропсы группы переключателей
|
|
16
|
+
*/
|
|
17
|
+
export type ToggleGroupPropsT = PartPropsT<Omit<ToggleGroup.Props, 'value' | 'defaultValue' | 'onValueChange' | 'orientation'>> & {
|
|
18
|
+
/** Оформление всех кнопок группы: без фона или с рамкой */
|
|
19
|
+
variant?: ToggleVariantsT['variant'];
|
|
20
|
+
/** Размер всех кнопок группы: sm, default, lg */
|
|
21
|
+
size?: ToggleVariantsT['size'];
|
|
22
|
+
/** Отступ между кнопками в шагах сетки (1 шаг = 0.25rem); 0 — кнопки слитно */
|
|
23
|
+
spacing?: number;
|
|
24
|
+
/** Ориентация: горизонтальная или вертикальная. Задаёт и навигацию стрелками */
|
|
25
|
+
orientation?: ToggleGroupOrientationT;
|
|
26
|
+
/** Можно нажать несколько кнопок. По умолчанию false — нажата одна */
|
|
27
|
+
multiple?: boolean;
|
|
28
|
+
/** Значения нажатых кнопок — контролируемый режим, вместе с onValueChange */
|
|
29
|
+
value?: string[];
|
|
30
|
+
/** Значения нажатых кнопок при первом рендере — неконтролируемый режим */
|
|
31
|
+
defaultValue?: string[];
|
|
32
|
+
/** Выбор изменился: значения нажатых кнопок */
|
|
33
|
+
onValueChange?: (value: string[]) => void;
|
|
34
|
+
/** Отключить все кнопки группы */
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/** Переход фокуса стрелками: с последней кнопки на первую и обратно. По умолчанию true */
|
|
37
|
+
loopFocus?: boolean;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Пропсы кнопки группы
|
|
41
|
+
*/
|
|
42
|
+
export type ToggleGroupItemPropsT = PartPropsT<Omit<Toggle.Props, 'value'>> & {
|
|
43
|
+
/** Значение кнопки: попадает в value группы, когда кнопка нажата */
|
|
44
|
+
value: string;
|
|
45
|
+
/** Оформление кнопки; оформление группы важнее */
|
|
46
|
+
variant?: ToggleVariantsT['variant'];
|
|
47
|
+
/** Размер кнопки; размер группы важнее */
|
|
48
|
+
size?: ToggleVariantsT['size'];
|
|
49
|
+
/** Отключить кнопку */
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TooltipContentPropsT, TooltipPropsT, TooltipProviderPropsT, TooltipTriggerPropsT } from "./types.js";
|
|
2
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
3
|
+
export { Tooltip, TooltipContent, type TooltipContentPropsT, type TooltipPropsT, TooltipProvider, type TooltipProviderPropsT, TooltipTrigger, type TooltipTriggerPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TooltipContentPropsT, TooltipPropsT, TooltipProviderPropsT, TooltipTriggerPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Провайдер подсказок: общие задержки для всех подсказок внутри. Ставится один раз в корень приложения
|
|
4
|
+
* @param props - пропсы провайдера
|
|
5
|
+
* @returns провайдер без своей разметки
|
|
6
|
+
*/
|
|
7
|
+
export declare function TooltipProvider({ delay, ...props }: TooltipProviderPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Подсказка: короткий текст при наведении или фокусе на элемент
|
|
10
|
+
* @param props - пропсы подсказки
|
|
11
|
+
* @returns корень без своей разметки
|
|
12
|
+
*/
|
|
13
|
+
export declare function Tooltip({ onOpenChange, ...props }: TooltipPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Элемент с подсказкой: при наведении и фокусе показывает её. Свою кнопку — через render={<Button />}
|
|
16
|
+
* @param props - пропсы элемента
|
|
17
|
+
* @returns кнопка
|
|
18
|
+
*/
|
|
19
|
+
export declare function TooltipTrigger(props: TooltipTriggerPropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Содержимое подсказки: тёмная плашка со стрелкой, рендерится в портале
|
|
22
|
+
* @param props - пропсы содержимого; по умолчанию side="top", sideOffset={4}
|
|
23
|
+
* @returns портал с подсказкой
|
|
24
|
+
*/
|
|
25
|
+
export declare function TooltipContent({ className, side, sideOffset, align, alignOffset, collisionPadding, arrowPadding, sticky, hidden, children, ...props }: TooltipContentPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Tooltip } from "@base-ui/react/tooltip";
|
|
5
|
+
// src/components/tooltip/tooltip.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Провайдер подсказок: общие задержки для всех подсказок внутри. Ставится один раз в корень приложения
|
|
8
|
+
* @param props - пропсы провайдера
|
|
9
|
+
* @returns провайдер без своей разметки
|
|
10
|
+
*/
|
|
11
|
+
function TooltipProvider({ delay = 0, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Tooltip.Provider, {
|
|
13
|
+
"data-slot": "tooltip-provider",
|
|
14
|
+
delay,
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Подсказка: короткий текст при наведении или фокусе на элемент
|
|
20
|
+
* @param props - пропсы подсказки
|
|
21
|
+
* @returns корень без своей разметки
|
|
22
|
+
*/
|
|
23
|
+
function Tooltip$1({ onOpenChange, ...props }) {
|
|
24
|
+
/**
|
|
25
|
+
* Подсказку показали или скрыли: наружу только флаг
|
|
26
|
+
* @param open - открыта ли
|
|
27
|
+
*/
|
|
28
|
+
const handleOpenChange = (open) => onOpenChange?.(open);
|
|
29
|
+
return /* @__PURE__ */ jsx(Tooltip.Root, {
|
|
30
|
+
"data-slot": "tooltip",
|
|
31
|
+
onOpenChange: handleOpenChange,
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Элемент с подсказкой: при наведении и фокусе показывает её. Свою кнопку — через render={<Button />}
|
|
37
|
+
* @param props - пропсы элемента
|
|
38
|
+
* @returns кнопка
|
|
39
|
+
*/
|
|
40
|
+
function TooltipTrigger(props) {
|
|
41
|
+
return /* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
42
|
+
"data-slot": "tooltip-trigger",
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/** Классы стрелки: по оси стороны её двигает Base UI, поперёк — эти классы */
|
|
47
|
+
const arrowClasses = cn("z-50", "size-2.5", "translate-y-[calc(-50%-2px)]", "rotate-45", "rounded-[2px]", "bg-foreground", "fill-foreground", "data-[side=bottom]:top-1", "data-[side=top]:-bottom-2.5", "data-[side=left]:top-1/2!", "data-[side=left]:-right-1", "data-[side=left]:-translate-y-1/2", "data-[side=right]:top-1/2!", "data-[side=right]:-left-1", "data-[side=right]:-translate-y-1/2");
|
|
48
|
+
/**
|
|
49
|
+
* Содержимое подсказки: тёмная плашка со стрелкой, рендерится в портале
|
|
50
|
+
* @param props - пропсы содержимого; по умолчанию side="top", sideOffset={4}
|
|
51
|
+
* @returns портал с подсказкой
|
|
52
|
+
*/
|
|
53
|
+
function TooltipContent({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, collisionPadding, arrowPadding, sticky, hidden, children, ...props }) {
|
|
54
|
+
const classes = cn("z-50", "inline-flex", "w-fit", "max-w-xs", "origin-(--transform-origin)", "items-center", "gap-1.5", "rounded-md", "bg-foreground", "px-3", "py-1.5", "text-xs", "text-background", "has-data-[slot=kbd]:pr-1.5", "**:data-[slot=kbd]:relative", "**:data-[slot=kbd]:isolate", "**:data-[slot=kbd]:z-50", "**:data-[slot=kbd]:rounded-sm", "data-open:animate-in", "data-open:fade-in-0", "data-open:zoom-in-95", "data-closed:animate-out", "data-closed:fade-out-0", "data-closed:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2", "data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2", "data-[side=top]:slide-in-from-bottom-2", className);
|
|
55
|
+
const positionerProps = {
|
|
56
|
+
side,
|
|
57
|
+
sideOffset,
|
|
58
|
+
align,
|
|
59
|
+
alignOffset,
|
|
60
|
+
collisionPadding,
|
|
61
|
+
arrowPadding,
|
|
62
|
+
sticky
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
65
|
+
className: "isolate z-50",
|
|
66
|
+
hidden,
|
|
67
|
+
...positionerProps,
|
|
68
|
+
children: /* @__PURE__ */ jsxs(Tooltip.Popup, {
|
|
69
|
+
"data-slot": "tooltip-content",
|
|
70
|
+
className: classes,
|
|
71
|
+
...props,
|
|
72
|
+
children: [children, /* @__PURE__ */ jsx(Tooltip.Arrow, {
|
|
73
|
+
"data-slot": "tooltip-arrow",
|
|
74
|
+
className: arrowClasses
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
}) });
|
|
78
|
+
}
|
|
79
|
+
export { Tooltip$1 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { FloatingPropsT } from "../../lib/floating.js";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { Tooltip } from "@base-ui/react/tooltip";
|
|
5
|
+
/**
|
|
6
|
+
* Пропсы провайдера подсказок
|
|
7
|
+
*/
|
|
8
|
+
export type TooltipProviderPropsT = {
|
|
9
|
+
/** Подсказки внутри провайдера */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** Задержка перед показом в мс. По умолчанию 0 */
|
|
12
|
+
delay?: number;
|
|
13
|
+
/** Задержка перед скрытием в мс. По умолчанию 0 */
|
|
14
|
+
closeDelay?: number;
|
|
15
|
+
/** Сколько мс после закрытия одной подсказки следующая открывается без задержки. По умолчанию 400 */
|
|
16
|
+
timeout?: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Пропсы подсказки
|
|
20
|
+
*/
|
|
21
|
+
export type TooltipPropsT = Omit<Tooltip.Root.Props, 'onOpenChange'> & {
|
|
22
|
+
/** Подсказка открыта — контролируемый режим, вместе с onOpenChange */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
/** Подсказка открыта при первом рендере — неконтролируемый режим */
|
|
25
|
+
defaultOpen?: boolean;
|
|
26
|
+
/** Подсказку показали или скрыли: новое состояние */
|
|
27
|
+
onOpenChange?: (open: boolean) => void;
|
|
28
|
+
/** Закрывать подсказку, когда курсор переходит на неё саму */
|
|
29
|
+
disableHoverablePopup?: boolean;
|
|
30
|
+
/** Не показывать подсказку */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Пропсы элемента с подсказкой
|
|
35
|
+
*/
|
|
36
|
+
export type TooltipTriggerPropsT = PartPropsT<Tooltip.Trigger.Props> & {
|
|
37
|
+
/** Задержка перед показом в мс. По умолчанию — из TooltipProvider */
|
|
38
|
+
delay?: number;
|
|
39
|
+
/** Задержка перед скрытием в мс. По умолчанию — из TooltipProvider */
|
|
40
|
+
closeDelay?: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Пропсы содержимого подсказки
|
|
44
|
+
*/
|
|
45
|
+
export type TooltipContentPropsT = PartPropsT<Tooltip.Popup.Props> & FloatingPropsT & {
|
|
46
|
+
/** Скрыть подсказку, не закрывая её: например, когда панель развёрнута и подсказка не нужна */
|
|
47
|
+
hidden?: boolean;
|
|
48
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TraceCollapsibleContentPropsT, TraceCollapsiblePropsT, TraceCollapsibleTriggerPropsT, TraceDescriptionPropsT, TraceIconPropsT, TraceLinePropsT, TracePropsT, TraceStatusT, TraceTitlePropsT } from "./types.js";
|
|
2
|
+
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle } from "./trace.js";
|
|
3
|
+
export { Trace, TraceCollapsible, TraceCollapsibleContent, type TraceCollapsibleContentPropsT, type TraceCollapsiblePropsT, TraceCollapsibleTrigger, type TraceCollapsibleTriggerPropsT, TraceDescription, type TraceDescriptionPropsT, TraceIcon, type TraceIconPropsT, TraceLine, type TraceLinePropsT, type TracePropsT, type TraceStatusT, TraceTitle, type TraceTitlePropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle } from "./trace.js";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { TraceCollapsibleContentPropsT, TraceCollapsiblePropsT, TraceCollapsibleTriggerPropsT, TraceDescriptionPropsT, TraceIconPropsT, TraceLinePropsT, TracePropsT, TraceTitlePropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Ход работы: список шагов, вызовов инструментов и рассуждений ассистента.
|
|
4
|
+
* Ссылка или кнопка, в которую обёрнута строка TraceLine, получает кольцо фокуса
|
|
5
|
+
* @param props - пропсы списка
|
|
6
|
+
* @returns контейнер шагов
|
|
7
|
+
*/
|
|
8
|
+
export declare function Trace({ className, ...props }: TracePropsT): import("react").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Строка хода работы: иконка, заголовок и описание.
|
|
11
|
+
* Внутри ссылки или кнопки подсвечивается при наведении
|
|
12
|
+
* @param props - пропсы строки
|
|
13
|
+
* @returns строка
|
|
14
|
+
*/
|
|
15
|
+
export declare function TraceLine({ className, status, ...props }: TraceLinePropsT): import("react").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Иконка строки: декоративная, скрыта от скринридера
|
|
18
|
+
* @param props - пропсы иконки
|
|
19
|
+
* @returns обёртка иконки
|
|
20
|
+
*/
|
|
21
|
+
export declare function TraceIcon({ className, ...props }: TraceIconPropsT): import("react").JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* Заголовок строки: обрезается многоточием
|
|
24
|
+
* @param props - пропсы заголовка
|
|
25
|
+
* @returns заголовок
|
|
26
|
+
*/
|
|
27
|
+
export declare function TraceTitle({ className, ...props }: TraceTitlePropsT): import("react").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Описание строки: длительность, счётчик, путь файла
|
|
30
|
+
* @param props - пропсы описания
|
|
31
|
+
* @returns описание
|
|
32
|
+
*/
|
|
33
|
+
export declare function TraceDescription({ className, ...props }: TraceDescriptionPropsT): import("react").JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Раскрывающийся шаг: строка-переключатель и подробности под ней
|
|
36
|
+
* @param props - пропсы шага
|
|
37
|
+
* @returns корень раскрывающегося шага
|
|
38
|
+
*/
|
|
39
|
+
export declare function TraceCollapsible({ className, onOpenChange, ...props }: TraceCollapsiblePropsT): import("react").JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* Переключатель шага: строка и шеврон, который поворачивается при раскрытии
|
|
42
|
+
* @param props - пропсы переключателя
|
|
43
|
+
* @returns кнопка
|
|
44
|
+
*/
|
|
45
|
+
export declare function TraceCollapsibleTrigger({ className, children, ...props }: TraceCollapsibleTriggerPropsT): import("react").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* Подробности шага: раскрываются с анимацией, слева — вертикальная линия.
|
|
48
|
+
* className применяется к внутреннему блоку с линией
|
|
49
|
+
* @param props - пропсы подробностей
|
|
50
|
+
* @returns раскрывающийся блок
|
|
51
|
+
*/
|
|
52
|
+
export declare function TraceCollapsibleContent({ className, children, ...props }: TraceCollapsibleContentPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { ChevronRightIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
6
|
+
// src/components/trace/trace.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Ход работы: список шагов, вызовов инструментов и рассуждений ассистента.
|
|
9
|
+
* Ссылка или кнопка, в которую обёрнута строка TraceLine, получает кольцо фокуса
|
|
10
|
+
* @param props - пропсы списка
|
|
11
|
+
* @returns контейнер шагов
|
|
12
|
+
*/
|
|
13
|
+
function Trace({ className, ...props }) {
|
|
14
|
+
const classes = cn("flex", "w-full", "min-w-0", "flex-col", "gap-2", "*:has-[>[data-slot=trace-line]]:flex", "*:has-[>[data-slot=trace-line]]:w-fit", "*:has-[>[data-slot=trace-line]]:max-w-full", "*:has-[>[data-slot=trace-line]]:min-w-0", "*:has-[>[data-slot=trace-line]]:rounded-md", "*:has-[>[data-slot=trace-line]]:text-left", "*:has-[>[data-slot=trace-line]]:outline-none", "*:has-[>[data-slot=trace-line]]:focus-visible:ring-3", "*:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/50", className);
|
|
15
|
+
return /* @__PURE__ */ jsx("div", {
|
|
16
|
+
"data-slot": "trace",
|
|
17
|
+
className: classes,
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Строка хода работы: иконка, заголовок и описание.
|
|
23
|
+
* Внутри ссылки или кнопки подсвечивается при наведении
|
|
24
|
+
* @param props - пропсы строки
|
|
25
|
+
* @returns строка
|
|
26
|
+
*/
|
|
27
|
+
function TraceLine({ className, status, ...props }) {
|
|
28
|
+
const classes = cn("flex", "w-fit", "max-w-full", "min-w-0", "items-center", "gap-2", "text-sm", "text-muted-foreground", "transition-colors", "in-[a,button]:cursor-pointer", "in-[a:hover,button:hover]:text-foreground", "data-[status=error]:text-destructive", "data-[status=error]:in-[a:hover,button:hover]:text-destructive", "data-[status=pending]:opacity-60", "data-[status=running]:*:data-[slot=trace-title]:shimmer", className);
|
|
29
|
+
return /* @__PURE__ */ jsx("span", {
|
|
30
|
+
"data-slot": "trace-line",
|
|
31
|
+
"data-status": status,
|
|
32
|
+
className: classes,
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Иконка строки: декоративная, скрыта от скринридера
|
|
38
|
+
* @param props - пропсы иконки
|
|
39
|
+
* @returns обёртка иконки
|
|
40
|
+
*/
|
|
41
|
+
function TraceIcon({ className, ...props }) {
|
|
42
|
+
const classes = cn("flex", "size-4", "shrink-0", "items-center", "justify-center", "[&_svg]:pointer-events-none", "[&_svg:not([class*=size-])]:size-4", "[[data-slot=trace-title]~&]:-ml-1", className);
|
|
43
|
+
return /* @__PURE__ */ jsx("span", {
|
|
44
|
+
"data-slot": "trace-icon",
|
|
45
|
+
"aria-hidden": true,
|
|
46
|
+
className: classes,
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Заголовок строки: обрезается многоточием
|
|
52
|
+
* @param props - пропсы заголовка
|
|
53
|
+
* @returns заголовок
|
|
54
|
+
*/
|
|
55
|
+
function TraceTitle({ className, ...props }) {
|
|
56
|
+
const classes = cn("min-w-0", "truncate", "motion-reduce:shimmer-none", className);
|
|
57
|
+
return /* @__PURE__ */ jsx("span", {
|
|
58
|
+
"data-slot": "trace-title",
|
|
59
|
+
className: classes,
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Описание строки: длительность, счётчик, путь файла
|
|
65
|
+
* @param props - пропсы описания
|
|
66
|
+
* @returns описание
|
|
67
|
+
*/
|
|
68
|
+
function TraceDescription({ className, ...props }) {
|
|
69
|
+
const classes = cn("shrink-0", "text-muted-foreground/70", "tabular-nums", className);
|
|
70
|
+
return /* @__PURE__ */ jsx("span", {
|
|
71
|
+
"data-slot": "trace-description",
|
|
72
|
+
className: classes,
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Раскрывающийся шаг: строка-переключатель и подробности под ней
|
|
78
|
+
* @param props - пропсы шага
|
|
79
|
+
* @returns корень раскрывающегося шага
|
|
80
|
+
*/
|
|
81
|
+
function TraceCollapsible({ className, onOpenChange, ...props }) {
|
|
82
|
+
const classes = cn("flex", "w-full", "min-w-0", "flex-col", className);
|
|
83
|
+
/**
|
|
84
|
+
* Шаг открыли или закрыли: наружу только флаг
|
|
85
|
+
* @param open - открыт ли
|
|
86
|
+
*/
|
|
87
|
+
const handleOpenChange = (open) => onOpenChange?.(open);
|
|
88
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
89
|
+
"data-slot": "trace-collapsible",
|
|
90
|
+
className: classes,
|
|
91
|
+
onOpenChange: handleOpenChange,
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Переключатель шага: строка и шеврон, который поворачивается при раскрытии
|
|
97
|
+
* @param props - пропсы переключателя
|
|
98
|
+
* @returns кнопка
|
|
99
|
+
*/
|
|
100
|
+
function TraceCollapsibleTrigger({ className, children, ...props }) {
|
|
101
|
+
const classes = cn("group/trace-collapsible-trigger", "flex", "w-fit", "max-w-full", "min-w-0", "cursor-pointer", "items-center", "gap-1", "rounded-md", "text-left", "text-muted-foreground", "transition-colors", "outline-none", "hover:text-foreground", "focus-visible:ring-3", "focus-visible:ring-ring/50", "has-[[data-status=error]]:text-destructive", className);
|
|
102
|
+
return /* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
103
|
+
"data-slot": "trace-collapsible-trigger",
|
|
104
|
+
className: classes,
|
|
105
|
+
...props,
|
|
106
|
+
children: [children, /* @__PURE__ */ jsx(TraceIcon, {
|
|
107
|
+
className: "transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90",
|
|
108
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Подробности шага: раскрываются с анимацией, слева — вертикальная линия.
|
|
114
|
+
* className применяется к внутреннему блоку с линией
|
|
115
|
+
* @param props - пропсы подробностей
|
|
116
|
+
* @returns раскрывающийся блок
|
|
117
|
+
*/
|
|
118
|
+
function TraceCollapsibleContent({ className, children, ...props }) {
|
|
119
|
+
const contentClasses = cn("h-(--collapsible-panel-height)", "min-w-0", "overflow-hidden", "transition-[height]", "duration-200", "data-starting-style:h-0", "data-ending-style:h-0");
|
|
120
|
+
const innerClasses = cn("mt-2", "mb-1", "ml-[calc(--spacing(2)-1px)]", "min-w-0", "border-l", "pr-1", "pl-4", "leading-relaxed", "wrap-break-word", "text-muted-foreground", className);
|
|
121
|
+
return /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
122
|
+
"data-slot": "trace-collapsible-content",
|
|
123
|
+
className: contentClasses,
|
|
124
|
+
...props,
|
|
125
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
126
|
+
"data-slot": "trace-collapsible-content-inner",
|
|
127
|
+
className: innerClasses,
|
|
128
|
+
children
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
4
|
+
/**
|
|
5
|
+
* Статус строки хода работы: выполняется, ошибка или ожидает
|
|
6
|
+
*/
|
|
7
|
+
export type TraceStatusT = 'running' | 'error' | 'pending';
|
|
8
|
+
/**
|
|
9
|
+
* Пропсы списка хода работы
|
|
10
|
+
*/
|
|
11
|
+
export type TracePropsT = ComponentProps<'div'>;
|
|
12
|
+
/**
|
|
13
|
+
* Пропсы строки хода работы
|
|
14
|
+
*/
|
|
15
|
+
export type TraceLinePropsT = ComponentProps<'span'> & {
|
|
16
|
+
/** Статус: running — заголовок мерцает, error — красный цвет, pending — приглушённая строка */
|
|
17
|
+
status?: TraceStatusT;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Пропсы иконки строки
|
|
21
|
+
*/
|
|
22
|
+
export type TraceIconPropsT = ComponentProps<'span'>;
|
|
23
|
+
/**
|
|
24
|
+
* Пропсы заголовка строки
|
|
25
|
+
*/
|
|
26
|
+
export type TraceTitlePropsT = ComponentProps<'span'>;
|
|
27
|
+
/**
|
|
28
|
+
* Пропсы описания строки
|
|
29
|
+
*/
|
|
30
|
+
export type TraceDescriptionPropsT = ComponentProps<'span'>;
|
|
31
|
+
/**
|
|
32
|
+
* Пропсы раскрывающегося шага
|
|
33
|
+
*/
|
|
34
|
+
export type TraceCollapsiblePropsT = PartPropsT<Omit<Collapsible.Root.Props, 'onOpenChange'>> & {
|
|
35
|
+
/** Открыт ли шаг — контролируемый режим, вместе с onOpenChange */
|
|
36
|
+
open?: boolean;
|
|
37
|
+
/** Открыт ли шаг при первом рендере — неконтролируемый режим */
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
/** Шаг открыли или закрыли */
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
/** Отключённый шаг: не раскрывается */
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Пропсы переключателя шага
|
|
46
|
+
*/
|
|
47
|
+
export type TraceCollapsibleTriggerPropsT = PartPropsT<Collapsible.Trigger.Props>;
|
|
48
|
+
/**
|
|
49
|
+
* Пропсы подробностей шага
|
|
50
|
+
*/
|
|
51
|
+
export type TraceCollapsibleContentPropsT = PartPropsT<Collapsible.Panel.Props> & {
|
|
52
|
+
/** Держать подробности в DOM и когда шаг закрыт */
|
|
53
|
+
keepMounted?: boolean;
|
|
54
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
/**
|
|
4
|
+
* Стили текста: заголовки, абзац, цитата, список, код и вспомогательные стили.
|
|
5
|
+
* Экспортируются, чтобы оформить текстом другой элемент: typographyVariants({ variant: 'lead' }).
|
|
6
|
+
*/
|
|
7
|
+
export declare const typographyVariants: (props?: ({
|
|
8
|
+
variant?: "link" | "blockquote" | "code" | "h1" | "h2" | "h3" | "h4" | "p" | "small" | "list" | "lead" | "large" | "muted" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Стили текста
|
|
12
|
+
*/
|
|
13
|
+
type TypographyVariantsT = VariantProps<typeof typographyVariants>;
|
|
14
|
+
/**
|
|
15
|
+
* Стиль текста
|
|
16
|
+
*/
|
|
17
|
+
export type TypographyVariantT = NonNullable<TypographyVariantsT['variant']>;
|
|
18
|
+
/**
|
|
19
|
+
* Пропсы текста
|
|
20
|
+
*/
|
|
21
|
+
export type TypographyPropsT = useRender.ComponentProps<'p'> & {
|
|
22
|
+
/**
|
|
23
|
+
* Стиль: h1–h4 — заголовки, p — абзац, blockquote — цитата, list — маркированный список,
|
|
24
|
+
* code — код в строке, lead — вводный абзац, large, small, muted — крупный, мелкий
|
|
25
|
+
* и приглушённый текст, link — ссылка. Задаёт и элемент: h1 → <h1>, list → <ul>, lead → <p>
|
|
26
|
+
*/
|
|
27
|
+
variant?: TypographyVariantT;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/typography/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Стили текста: заголовки, абзац, цитата, список, код и вспомогательные стили.
|
|
5
|
+
* Экспортируются, чтобы оформить текстом другой элемент: typographyVariants({ variant: 'lead' }).
|
|
6
|
+
*/
|
|
7
|
+
const typographyVariants = cva("", {
|
|
8
|
+
variants: { variant: {
|
|
9
|
+
h1: "scroll-m-20 text-4xl font-extrabold tracking-tight text-balance",
|
|
10
|
+
h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0",
|
|
11
|
+
h3: "scroll-m-20 text-2xl font-semibold tracking-tight",
|
|
12
|
+
h4: "scroll-m-20 text-xl font-semibold tracking-tight",
|
|
13
|
+
p: "leading-7 [&:not(:first-child)]:mt-6",
|
|
14
|
+
blockquote: "mt-6 border-l-2 pl-6 italic",
|
|
15
|
+
list: "my-6 ml-6 list-disc [&>li]:mt-2",
|
|
16
|
+
code: "relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",
|
|
17
|
+
lead: "text-xl text-muted-foreground",
|
|
18
|
+
large: "text-lg font-semibold",
|
|
19
|
+
small: "text-sm leading-none font-medium",
|
|
20
|
+
muted: "text-sm text-muted-foreground",
|
|
21
|
+
link: "font-medium text-primary underline underline-offset-4"
|
|
22
|
+
} },
|
|
23
|
+
defaultVariants: { variant: "p" }
|
|
24
|
+
});
|
|
25
|
+
export { typographyVariants };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TypographyPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Текст в одном из стилей типографики: заголовок, абзац, цитата, список, код
|
|
4
|
+
* @param props - пропсы текста
|
|
5
|
+
* @returns элемент стиля или дочерний элемент в этом стиле (render)
|
|
6
|
+
*/
|
|
7
|
+
export declare function Typography({ className, variant, render, ...props }: TypographyPropsT): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|