@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,179 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { texts } from "../../lib/locale.js";
|
|
4
|
+
import { InputGroup, InputGroupAddon } from "../input-group/input-group.js";
|
|
5
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../dialog/dialog.js";
|
|
6
|
+
import { CheckIcon, SearchIcon } from "lucide-react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Command } from "cmdk";
|
|
9
|
+
// src/components/command/command.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Прокрутить список палитры так, чтобы элемент стал виден. Двигается только список:
|
|
12
|
+
* встроенный scrollIntoView прокрутил бы и страницу, если палитра за краем экрана
|
|
13
|
+
* @param element - пункт или заголовок группы
|
|
14
|
+
*/
|
|
15
|
+
function scrollIntoList(element) {
|
|
16
|
+
const list = element.closest("[cmdk-list]");
|
|
17
|
+
if (!list) return;
|
|
18
|
+
const listRect = list.getBoundingClientRect();
|
|
19
|
+
const rect = element.getBoundingClientRect();
|
|
20
|
+
if (rect.top < listRect.top) list.scrollTop -= listRect.top - rect.top;
|
|
21
|
+
else if (rect.bottom > listRect.bottom) list.scrollTop += rect.bottom - listRect.bottom;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Подменить scrollIntoView элемента на прокрутку только внутри списка
|
|
25
|
+
* @param element - пункт или корень группы (подменяется у заголовка группы)
|
|
26
|
+
*/
|
|
27
|
+
function keepScrollInList(element) {
|
|
28
|
+
if (!element) return;
|
|
29
|
+
const target = element.querySelector("[cmdk-group-heading]") ?? element;
|
|
30
|
+
target.scrollIntoView = () => scrollIntoList(target);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Передать элемент и в свой обработчик, и в ref потребителя
|
|
34
|
+
* @param ref - ref из пропсов
|
|
35
|
+
* @returns ref-колбэк
|
|
36
|
+
*/
|
|
37
|
+
function withScrollInList(ref) {
|
|
38
|
+
return (element) => {
|
|
39
|
+
keepScrollInList(element);
|
|
40
|
+
if (typeof ref === "function") ref(element);
|
|
41
|
+
else if (ref) ref.current = element;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Палитра команд: поле поиска и список, который фильтруется по мере ввода
|
|
46
|
+
* @param props - пропсы палитры; value — выделенный пункт, shouldFilter, filter, loop — как в cmdk
|
|
47
|
+
* @returns div
|
|
48
|
+
*/
|
|
49
|
+
function Command$1({ className, ...props }) {
|
|
50
|
+
const classes = cn("flex", "size-full", "flex-col", "overflow-hidden", "rounded-xl!", "bg-popover", "p-1", "text-popover-foreground", className);
|
|
51
|
+
return /* @__PURE__ */ jsx(Command, {
|
|
52
|
+
"data-slot": "command",
|
|
53
|
+
className: classes,
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Палитра в диалоге: окно в верхней трети экрана, обычно открывается по ⌘K
|
|
59
|
+
* @param props - пропсы диалога; внутрь кладутся CommandInput и CommandList — Command уже есть
|
|
60
|
+
* @returns диалог
|
|
61
|
+
*/
|
|
62
|
+
function CommandDialog({ title = texts.commandPalette, description = texts.commandPaletteDescription, children, className, showCloseButton = false, ...props }) {
|
|
63
|
+
const classes = cn("top-1/3", "translate-y-0", "overflow-hidden", "rounded-xl!", "p-0", className);
|
|
64
|
+
return /* @__PURE__ */ jsxs(Dialog, {
|
|
65
|
+
...props,
|
|
66
|
+
children: [/* @__PURE__ */ jsxs(DialogHeader, {
|
|
67
|
+
className: "sr-only",
|
|
68
|
+
children: [/* @__PURE__ */ jsx(DialogTitle, { children: title }), /* @__PURE__ */ jsx(DialogDescription, { children: description })]
|
|
69
|
+
}), /* @__PURE__ */ jsx(DialogContent, {
|
|
70
|
+
className: classes,
|
|
71
|
+
showCloseButton,
|
|
72
|
+
children: /* @__PURE__ */ jsx(Command$1, { children })
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Поле поиска: фильтрует список, слева иконка лупы
|
|
78
|
+
* @param props - пропсы поля; value и onValueChange — текст поиска
|
|
79
|
+
* @returns обёртка с полем
|
|
80
|
+
*/
|
|
81
|
+
function CommandInput({ className, ...props }) {
|
|
82
|
+
const classes = cn("w-full", "text-sm", "outline-hidden", "disabled:cursor-not-allowed", "disabled:opacity-50", className);
|
|
83
|
+
return /* @__PURE__ */ jsx("div", {
|
|
84
|
+
"data-slot": "command-input-wrapper",
|
|
85
|
+
className: "p-1 pb-0",
|
|
86
|
+
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
87
|
+
className: "h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",
|
|
88
|
+
children: [/* @__PURE__ */ jsx(Command.Input, {
|
|
89
|
+
"data-slot": "command-input",
|
|
90
|
+
className: classes,
|
|
91
|
+
...props
|
|
92
|
+
}), /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }) })]
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Список пунктов: прокручивается, не выше 18rem
|
|
98
|
+
* @param props - пропсы списка; label — подпись для скринридеров, по умолчанию «Варианты»
|
|
99
|
+
* @returns div
|
|
100
|
+
*/
|
|
101
|
+
function CommandList({ className, label = texts.suggestions, ...props }) {
|
|
102
|
+
const classes = cn("max-h-72", "scroll-py-1", "overflow-x-hidden", "overflow-y-auto", "outline-none", "[scrollbar-width:none]", className);
|
|
103
|
+
return /* @__PURE__ */ jsx(Command.List, {
|
|
104
|
+
"data-slot": "command-list",
|
|
105
|
+
label,
|
|
106
|
+
className: classes,
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Пустой результат: показывается, когда ничего не нашлось
|
|
112
|
+
* @param props - пропсы; children по умолчанию «Ничего не найдено»
|
|
113
|
+
* @returns div
|
|
114
|
+
*/
|
|
115
|
+
function CommandEmpty({ className, children = texts.empty, ...props }) {
|
|
116
|
+
const classes = cn("py-6", "text-center", "text-sm", className);
|
|
117
|
+
return /* @__PURE__ */ jsx(Command.Empty, {
|
|
118
|
+
"data-slot": "command-empty",
|
|
119
|
+
className: classes,
|
|
120
|
+
...props,
|
|
121
|
+
children
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Группа пунктов с заголовком heading
|
|
126
|
+
* @param props - пропсы группы
|
|
127
|
+
* @returns div
|
|
128
|
+
*/
|
|
129
|
+
function CommandGroup({ className, ref, ...props }) {
|
|
130
|
+
const classes = cn("overflow-hidden", "p-1", "text-foreground", "**:[[cmdk-group-heading]]:px-2", "**:[[cmdk-group-heading]]:py-1.5", "**:[[cmdk-group-heading]]:text-xs", "**:[[cmdk-group-heading]]:font-medium", "**:[[cmdk-group-heading]]:text-muted-foreground", className);
|
|
131
|
+
return /* @__PURE__ */ jsx(Command.Group, {
|
|
132
|
+
ref: withScrollInList(ref),
|
|
133
|
+
"data-slot": "command-group",
|
|
134
|
+
className: classes,
|
|
135
|
+
...props
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Разделитель между группами
|
|
140
|
+
* @param props - пропсы разделителя
|
|
141
|
+
* @returns div
|
|
142
|
+
*/
|
|
143
|
+
function CommandSeparator({ className, ...props }) {
|
|
144
|
+
const classes = cn("-mx-1", "h-px", "bg-border", className);
|
|
145
|
+
return /* @__PURE__ */ jsx(Command.Separator, {
|
|
146
|
+
"data-slot": "command-separator",
|
|
147
|
+
className: classes,
|
|
148
|
+
...props
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Пункт списка. data-checked={true} показывает галочку справа
|
|
153
|
+
* @param props - пропсы пункта; onSelect — пункт выбран, value — по нему идёт поиск
|
|
154
|
+
* @returns div с role="option"
|
|
155
|
+
*/
|
|
156
|
+
function CommandItem({ className, children, ref, ...props }) {
|
|
157
|
+
const classes = cn("group/command-item", "relative", "flex", "cursor-default", "items-center", "gap-2", "rounded-sm", "px-2", "py-1.5", "text-sm", "outline-hidden", "select-none", "in-data-[slot=dialog-content]:rounded-lg!", "data-[selected=true]:bg-muted", "data-[selected=true]:text-foreground", "data-[selected=true]:*:[svg]:text-foreground", "data-[disabled=true]:pointer-events-none", "data-[disabled=true]:opacity-50", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*=size-])]:size-4", className);
|
|
158
|
+
return /* @__PURE__ */ jsxs(Command.Item, {
|
|
159
|
+
ref: withScrollInList(ref),
|
|
160
|
+
"data-slot": "command-item",
|
|
161
|
+
className: classes,
|
|
162
|
+
...props,
|
|
163
|
+
children: [children, /* @__PURE__ */ jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })]
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Сочетание клавиш справа в пункте
|
|
168
|
+
* @param props - пропсы
|
|
169
|
+
* @returns span
|
|
170
|
+
*/
|
|
171
|
+
function CommandShortcut({ className, ...props }) {
|
|
172
|
+
const classes = cn("ml-auto", "text-xs", "tracking-widest", "text-muted-foreground", "group-data-[selected=true]/command-item:text-foreground", className);
|
|
173
|
+
return /* @__PURE__ */ jsx("span", {
|
|
174
|
+
"data-slot": "command-shortcut",
|
|
175
|
+
className: classes,
|
|
176
|
+
...props
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
export { Command$1 as Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CommandDialogPropsT, CommandEmptyPropsT, CommandGroupPropsT, CommandInputPropsT, CommandItemPropsT, CommandListPropsT, CommandPropsT, CommandSeparatorPropsT, CommandShortcutPropsT } from "./types.js";
|
|
2
|
+
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./command.js";
|
|
3
|
+
export { Command, CommandDialog, type CommandDialogPropsT, CommandEmpty, type CommandEmptyPropsT, CommandGroup, type CommandGroupPropsT, CommandInput, type CommandInputPropsT, CommandItem, type CommandItemPropsT, CommandList, type CommandListPropsT, type CommandPropsT, CommandSeparator, type CommandSeparatorPropsT, CommandShortcut, type CommandShortcutPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./command.js";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DialogPropsT } from "../dialog/types.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import { Command } from "cmdk";
|
|
4
|
+
/**
|
|
5
|
+
* Пропсы палитры команд
|
|
6
|
+
*/
|
|
7
|
+
export type CommandPropsT = Omit<ComponentProps<typeof Command>, 'value' | 'defaultValue' | 'onValueChange' | 'label' | 'shouldFilter' | 'filter' | 'loop' | 'disablePointerSelection' | 'vimBindings'> & {
|
|
8
|
+
/** Значение выделенного пункта — контролируемый режим, вместе с onValueChange */
|
|
9
|
+
value?: string;
|
|
10
|
+
/** Значение выделенного пункта при первом рендере */
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/** Выделен другой пункт: его значение */
|
|
13
|
+
onValueChange?: (value: string) => void;
|
|
14
|
+
/** Подпись палитры для скринридеров */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Фильтровать и сортировать пункты по запросу. false — фильтруете сами. По умолчанию true */
|
|
17
|
+
shouldFilter?: boolean;
|
|
18
|
+
/** Своя функция ранжирования: 0 — скрыть пункт, больше — выше в списке */
|
|
19
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
20
|
+
/** Стрелки переходят с последнего пункта на первый и обратно */
|
|
21
|
+
loop?: boolean;
|
|
22
|
+
/** Не выделять пункты наведением мыши */
|
|
23
|
+
disablePointerSelection?: boolean;
|
|
24
|
+
/** Сочетания Ctrl+N/J/P/K для перехода по пунктам. По умолчанию true */
|
|
25
|
+
vimBindings?: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Пропсы палитры в диалоге
|
|
29
|
+
*/
|
|
30
|
+
export type CommandDialogPropsT = Omit<DialogPropsT, 'children'> & {
|
|
31
|
+
/** Содержимое палитры */
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
/** Заголовок диалога для скринридеров */
|
|
34
|
+
title?: string;
|
|
35
|
+
/** Описание диалога для скринридеров */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Классы окна диалога */
|
|
38
|
+
className?: string;
|
|
39
|
+
/** Показать крестик в углу окна */
|
|
40
|
+
showCloseButton?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Пропсы поля поиска
|
|
44
|
+
*/
|
|
45
|
+
export type CommandInputPropsT = ComponentProps<typeof Command.Input>;
|
|
46
|
+
/**
|
|
47
|
+
* Пропсы списка
|
|
48
|
+
*/
|
|
49
|
+
export type CommandListPropsT = ComponentProps<typeof Command.List>;
|
|
50
|
+
/**
|
|
51
|
+
* Пропсы пустого результата
|
|
52
|
+
*/
|
|
53
|
+
export type CommandEmptyPropsT = ComponentProps<typeof Command.Empty>;
|
|
54
|
+
/**
|
|
55
|
+
* Пропсы группы
|
|
56
|
+
*/
|
|
57
|
+
export type CommandGroupPropsT = ComponentProps<typeof Command.Group>;
|
|
58
|
+
/**
|
|
59
|
+
* Пропсы разделителя
|
|
60
|
+
*/
|
|
61
|
+
export type CommandSeparatorPropsT = ComponentProps<typeof Command.Separator>;
|
|
62
|
+
/**
|
|
63
|
+
* Пропсы пункта
|
|
64
|
+
*/
|
|
65
|
+
export type CommandItemPropsT = ComponentProps<typeof Command.Item>;
|
|
66
|
+
/**
|
|
67
|
+
* Пропсы сочетания клавиш
|
|
68
|
+
*/
|
|
69
|
+
export type CommandShortcutPropsT = ComponentProps<'span'>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ContextMenuCheckboxItemPropsT, ContextMenuContentPropsT, ContextMenuGroupPropsT, ContextMenuItemPropsT, ContextMenuLabelPropsT, ContextMenuPortalPropsT, ContextMenuPropsT, ContextMenuRadioGroupPropsT, ContextMenuRadioItemPropsT, ContextMenuSeparatorPropsT, ContextMenuShortcutPropsT, ContextMenuSubContentPropsT, ContextMenuSubPropsT, ContextMenuSubTriggerPropsT, ContextMenuTriggerPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Контекстное меню: список действий по правому клику или долгому нажатию на области
|
|
4
|
+
* @param props - пропсы меню
|
|
5
|
+
* @returns корень без своей разметки
|
|
6
|
+
*/
|
|
7
|
+
export declare function ContextMenu({ onOpenChange, ...props }: ContextMenuPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Портал: переносит меню в конец body. ContextMenuContent рендерит его сам
|
|
10
|
+
* @param props - пропсы портала
|
|
11
|
+
* @returns портал
|
|
12
|
+
*/
|
|
13
|
+
export declare function ContextMenuPortal(props: ContextMenuPortalPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Область меню: правый клик или долгое нажатие по ней открывает меню у курсора
|
|
16
|
+
* @param props - пропсы области
|
|
17
|
+
* @returns div
|
|
18
|
+
*/
|
|
19
|
+
export declare function ContextMenuTrigger({ className, ...props }: ContextMenuTriggerPropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Содержимое меню: рендерится в портале у курсора
|
|
22
|
+
* @param props - пропсы содержимого; по умолчанию side="right", align="start"
|
|
23
|
+
* @returns портал с меню
|
|
24
|
+
*/
|
|
25
|
+
export declare function ContextMenuContent({ className, side, sideOffset, align, alignOffset, collisionPadding, arrowPadding, sticky, ...props }: ContextMenuContentPropsT): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Группа пунктов: объединяет связанные действия; ContextMenuLabel кладётся внутрь неё
|
|
28
|
+
* @param props - пропсы группы
|
|
29
|
+
* @returns div с role="group"
|
|
30
|
+
*/
|
|
31
|
+
export declare function ContextMenuGroup(props: ContextMenuGroupPropsT): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Пункт меню: действие. Ссылку рисуют через render={<a href />}
|
|
34
|
+
* @param props - пропсы пункта
|
|
35
|
+
* @returns div с role="menuitem"
|
|
36
|
+
*/
|
|
37
|
+
export declare function ContextMenuItem({ className, inset, variant, ...props }: ContextMenuItemPropsT): import("react").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* Пункт-флажок: включает и выключает настройку, отмечен галочкой справа
|
|
40
|
+
* @param props - пропсы пункта
|
|
41
|
+
* @returns div с role="menuitemcheckbox"
|
|
42
|
+
*/
|
|
43
|
+
export declare function ContextMenuCheckboxItem({ className, children, inset, onCheckedChange, ...props }: ContextMenuCheckboxItemPropsT): import("react").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Группа радиокнопок: из пунктов внутри выбран один
|
|
46
|
+
* @param props - пропсы группы
|
|
47
|
+
* @returns div с role="group"
|
|
48
|
+
*/
|
|
49
|
+
export declare function ContextMenuRadioGroup({ onValueChange, ...props }: ContextMenuRadioGroupPropsT): import("react").JSX.Element;
|
|
50
|
+
/**
|
|
51
|
+
* Пункт-радиокнопка: выбранный отмечен галочкой справа
|
|
52
|
+
* @param props - пропсы пункта
|
|
53
|
+
* @returns div с role="menuitemradio"
|
|
54
|
+
*/
|
|
55
|
+
export declare function ContextMenuRadioItem({ className, children, inset, ...props }: ContextMenuRadioItemPropsT): import("react").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* Подпись: заголовок группы пунктов, не выбирается. Кладётся внутрь ContextMenuGroup
|
|
58
|
+
* или ContextMenuRadioGroup
|
|
59
|
+
* @param props - пропсы подписи
|
|
60
|
+
* @returns div
|
|
61
|
+
*/
|
|
62
|
+
export declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuLabelPropsT): import("react").JSX.Element;
|
|
63
|
+
/**
|
|
64
|
+
* Разделитель: линия между группами пунктов
|
|
65
|
+
* @param props - пропсы разделителя
|
|
66
|
+
* @returns div с role="separator"
|
|
67
|
+
*/
|
|
68
|
+
export declare function ContextMenuSeparator({ className, ...props }: ContextMenuSeparatorPropsT): import("react").JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* Сочетание клавиш: подсказка справа в пункте. Само сочетание не обрабатывает
|
|
71
|
+
* @param props - пропсы сочетания
|
|
72
|
+
* @returns span
|
|
73
|
+
*/
|
|
74
|
+
export declare function ContextMenuShortcut({ className, ...props }: ContextMenuShortcutPropsT): import("react").JSX.Element;
|
|
75
|
+
/**
|
|
76
|
+
* Подменю: вложенный список, открывается из пункта
|
|
77
|
+
* @param props - пропсы подменю
|
|
78
|
+
* @returns корень без своей разметки
|
|
79
|
+
*/
|
|
80
|
+
export declare function ContextMenuSub({ onOpenChange, ...props }: ContextMenuSubPropsT): import("react").JSX.Element;
|
|
81
|
+
/**
|
|
82
|
+
* Пункт, открывающий подменю: со стрелкой справа
|
|
83
|
+
* @param props - пропсы пункта
|
|
84
|
+
* @returns div с role="menuitem"
|
|
85
|
+
*/
|
|
86
|
+
export declare function ContextMenuSubTrigger({ className, inset, children, ...props }: ContextMenuSubTriggerPropsT): import("react").JSX.Element;
|
|
87
|
+
/**
|
|
88
|
+
* Содержимое подменю: появляется сбоку от пункта
|
|
89
|
+
* @param props - пропсы содержимого; по умолчанию side="right", align="start"
|
|
90
|
+
* @returns портал с подменю
|
|
91
|
+
*/
|
|
92
|
+
export declare function ContextMenuSubContent({ className, side, sideOffset, align, alignOffset, ...props }: ContextMenuSubContentPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ContextMenu } from "@base-ui/react/context-menu";
|
|
6
|
+
// src/components/context-menu/context-menu.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Контекстное меню: список действий по правому клику или долгому нажатию на области
|
|
9
|
+
* @param props - пропсы меню
|
|
10
|
+
* @returns корень без своей разметки
|
|
11
|
+
*/
|
|
12
|
+
function ContextMenu$1({ onOpenChange, ...props }) {
|
|
13
|
+
/**
|
|
14
|
+
* Меню открыли или закрыли: наружу только флаг
|
|
15
|
+
* @param open - открыто ли
|
|
16
|
+
*/
|
|
17
|
+
const handleOpenChange = (open) => onOpenChange?.(open);
|
|
18
|
+
return /* @__PURE__ */ jsx(ContextMenu.Root, {
|
|
19
|
+
"data-slot": "context-menu",
|
|
20
|
+
onOpenChange: handleOpenChange,
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Портал: переносит меню в конец body. ContextMenuContent рендерит его сам
|
|
26
|
+
* @param props - пропсы портала
|
|
27
|
+
* @returns портал
|
|
28
|
+
*/
|
|
29
|
+
function ContextMenuPortal(props) {
|
|
30
|
+
return /* @__PURE__ */ jsx(ContextMenu.Portal, {
|
|
31
|
+
"data-slot": "context-menu-portal",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Область меню: правый клик или долгое нажатие по ней открывает меню у курсора
|
|
37
|
+
* @param props - пропсы области
|
|
38
|
+
* @returns div
|
|
39
|
+
*/
|
|
40
|
+
function ContextMenuTrigger({ className, ...props }) {
|
|
41
|
+
const classes = cn("select-none", className);
|
|
42
|
+
return /* @__PURE__ */ jsx(ContextMenu.Trigger, {
|
|
43
|
+
"data-slot": "context-menu-trigger",
|
|
44
|
+
className: classes,
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Классы окна меню */
|
|
49
|
+
const contentClasses = [
|
|
50
|
+
"z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin)",
|
|
51
|
+
"overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md",
|
|
52
|
+
"ring-1 ring-foreground/10 duration-100 outline-none data-closed:overflow-hidden",
|
|
53
|
+
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
54
|
+
"data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
55
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
56
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
57
|
+
];
|
|
58
|
+
/**
|
|
59
|
+
* Содержимое меню: рендерится в портале у курсора
|
|
60
|
+
* @param props - пропсы содержимого; по умолчанию side="right", align="start"
|
|
61
|
+
* @returns портал с меню
|
|
62
|
+
*/
|
|
63
|
+
function ContextMenuContent({ className, side = "right", sideOffset = 0, align = "start", alignOffset = 4, collisionPadding, arrowPadding, sticky, ...props }) {
|
|
64
|
+
const classes = cn(contentClasses, className);
|
|
65
|
+
const positionerProps = {
|
|
66
|
+
side,
|
|
67
|
+
sideOffset,
|
|
68
|
+
align,
|
|
69
|
+
alignOffset,
|
|
70
|
+
collisionPadding,
|
|
71
|
+
arrowPadding,
|
|
72
|
+
sticky
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ jsx(ContextMenu.Portal, { children: /* @__PURE__ */ jsx(ContextMenu.Positioner, {
|
|
75
|
+
className: "isolate z-50 outline-none",
|
|
76
|
+
...positionerProps,
|
|
77
|
+
children: /* @__PURE__ */ jsx(ContextMenu.Popup, {
|
|
78
|
+
"data-slot": "context-menu-content",
|
|
79
|
+
className: classes,
|
|
80
|
+
...props
|
|
81
|
+
})
|
|
82
|
+
}) });
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Группа пунктов: объединяет связанные действия; ContextMenuLabel кладётся внутрь неё
|
|
86
|
+
* @param props - пропсы группы
|
|
87
|
+
* @returns div с role="group"
|
|
88
|
+
*/
|
|
89
|
+
function ContextMenuGroup(props) {
|
|
90
|
+
return /* @__PURE__ */ jsx(ContextMenu.Group, {
|
|
91
|
+
"data-slot": "context-menu-group",
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Пункт меню: действие. Ссылку рисуют через render={<a href />}
|
|
97
|
+
* @param props - пропсы пункта
|
|
98
|
+
* @returns div с role="menuitem"
|
|
99
|
+
*/
|
|
100
|
+
function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
|
101
|
+
const classes = cn("group/context-menu-item", "relative", "flex", "cursor-default", "items-center", "gap-1.5", "rounded-md", "px-1.5", "py-1", "text-sm", "outline-hidden", "select-none", "data-inset:pl-7", "focus:bg-accent", "focus:text-accent-foreground", "focus:*:[svg]:text-accent-foreground", "data-[variant=destructive]:text-destructive", "data-[variant=destructive]:focus:bg-destructive/10", "data-[variant=destructive]:focus:text-destructive", "dark:data-[variant=destructive]:focus:bg-destructive/20", "data-[variant=destructive]:*:[svg]:text-destructive", "data-disabled:pointer-events-none", "data-disabled:opacity-50", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*=size-])]:size-4", className);
|
|
102
|
+
return /* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
103
|
+
"data-slot": "context-menu-item",
|
|
104
|
+
"data-inset": inset,
|
|
105
|
+
"data-variant": variant,
|
|
106
|
+
className: classes,
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Классы пунктов-переключателей: флажка и радиокнопки
|
|
112
|
+
*/
|
|
113
|
+
const toggleItemClasses = [
|
|
114
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none",
|
|
115
|
+
"data-inset:pl-7 focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground",
|
|
116
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
117
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4"
|
|
118
|
+
];
|
|
119
|
+
/**
|
|
120
|
+
* Пункт-флажок: включает и выключает настройку, отмечен галочкой справа
|
|
121
|
+
* @param props - пропсы пункта
|
|
122
|
+
* @returns div с role="menuitemcheckbox"
|
|
123
|
+
*/
|
|
124
|
+
function ContextMenuCheckboxItem({ className, children, inset, onCheckedChange, ...props }) {
|
|
125
|
+
const classes = cn(toggleItemClasses, className);
|
|
126
|
+
/**
|
|
127
|
+
* Отметку переключили: наружу только состояние
|
|
128
|
+
* @param checked - отмечен ли
|
|
129
|
+
*/
|
|
130
|
+
const handleCheckedChange = (checked) => onCheckedChange?.(checked);
|
|
131
|
+
return /* @__PURE__ */ jsxs(ContextMenu.CheckboxItem, {
|
|
132
|
+
"data-slot": "context-menu-checkbox-item",
|
|
133
|
+
"data-inset": inset,
|
|
134
|
+
className: classes,
|
|
135
|
+
onCheckedChange: handleCheckedChange,
|
|
136
|
+
...props,
|
|
137
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
138
|
+
"data-slot": "context-menu-checkbox-item-indicator",
|
|
139
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
140
|
+
children: /* @__PURE__ */ jsx(ContextMenu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
141
|
+
}), children]
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Группа радиокнопок: из пунктов внутри выбран один
|
|
146
|
+
* @param props - пропсы группы
|
|
147
|
+
* @returns div с role="group"
|
|
148
|
+
*/
|
|
149
|
+
function ContextMenuRadioGroup({ onValueChange, ...props }) {
|
|
150
|
+
/**
|
|
151
|
+
* Выбран другой пункт: наружу только значение
|
|
152
|
+
* @param value - значение пункта
|
|
153
|
+
*/
|
|
154
|
+
const handleValueChange = (value) => onValueChange?.(value);
|
|
155
|
+
return /* @__PURE__ */ jsx(ContextMenu.RadioGroup, {
|
|
156
|
+
"data-slot": "context-menu-radio-group",
|
|
157
|
+
onValueChange: handleValueChange,
|
|
158
|
+
...props
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Пункт-радиокнопка: выбранный отмечен галочкой справа
|
|
163
|
+
* @param props - пропсы пункта
|
|
164
|
+
* @returns div с role="menuitemradio"
|
|
165
|
+
*/
|
|
166
|
+
function ContextMenuRadioItem({ className, children, inset, ...props }) {
|
|
167
|
+
const classes = cn(toggleItemClasses, className);
|
|
168
|
+
return /* @__PURE__ */ jsxs(ContextMenu.RadioItem, {
|
|
169
|
+
"data-slot": "context-menu-radio-item",
|
|
170
|
+
"data-inset": inset,
|
|
171
|
+
className: classes,
|
|
172
|
+
...props,
|
|
173
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
174
|
+
"data-slot": "context-menu-radio-item-indicator",
|
|
175
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
176
|
+
children: /* @__PURE__ */ jsx(ContextMenu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
177
|
+
}), children]
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Подпись: заголовок группы пунктов, не выбирается. Кладётся внутрь ContextMenuGroup
|
|
182
|
+
* или ContextMenuRadioGroup
|
|
183
|
+
* @param props - пропсы подписи
|
|
184
|
+
* @returns div
|
|
185
|
+
*/
|
|
186
|
+
function ContextMenuLabel({ className, inset, ...props }) {
|
|
187
|
+
const classes = cn("px-1.5", "py-1", "text-xs", "font-medium", "text-muted-foreground", "data-inset:pl-7", className);
|
|
188
|
+
return /* @__PURE__ */ jsx(ContextMenu.GroupLabel, {
|
|
189
|
+
"data-slot": "context-menu-label",
|
|
190
|
+
"data-inset": inset,
|
|
191
|
+
className: classes,
|
|
192
|
+
...props
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Разделитель: линия между группами пунктов
|
|
197
|
+
* @param props - пропсы разделителя
|
|
198
|
+
* @returns div с role="separator"
|
|
199
|
+
*/
|
|
200
|
+
function ContextMenuSeparator({ className, ...props }) {
|
|
201
|
+
const classes = cn("-mx-1", "my-1", "h-px", "bg-border", className);
|
|
202
|
+
return /* @__PURE__ */ jsx(ContextMenu.Separator, {
|
|
203
|
+
"data-slot": "context-menu-separator",
|
|
204
|
+
className: classes,
|
|
205
|
+
...props
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Сочетание клавиш: подсказка справа в пункте. Само сочетание не обрабатывает
|
|
210
|
+
* @param props - пропсы сочетания
|
|
211
|
+
* @returns span
|
|
212
|
+
*/
|
|
213
|
+
function ContextMenuShortcut({ className, ...props }) {
|
|
214
|
+
const classes = cn("ml-auto", "text-xs", "tracking-widest", "text-muted-foreground", "group-focus/context-menu-item:text-accent-foreground", className);
|
|
215
|
+
return /* @__PURE__ */ jsx("span", {
|
|
216
|
+
"data-slot": "context-menu-shortcut",
|
|
217
|
+
className: classes,
|
|
218
|
+
...props
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Подменю: вложенный список, открывается из пункта
|
|
223
|
+
* @param props - пропсы подменю
|
|
224
|
+
* @returns корень без своей разметки
|
|
225
|
+
*/
|
|
226
|
+
function ContextMenuSub({ onOpenChange, ...props }) {
|
|
227
|
+
/**
|
|
228
|
+
* Подменю открыли или закрыли: наружу только флаг
|
|
229
|
+
* @param open - открыто ли
|
|
230
|
+
*/
|
|
231
|
+
const handleOpenChange = (open) => onOpenChange?.(open);
|
|
232
|
+
return /* @__PURE__ */ jsx(ContextMenu.SubmenuRoot, {
|
|
233
|
+
"data-slot": "context-menu-sub",
|
|
234
|
+
onOpenChange: handleOpenChange,
|
|
235
|
+
...props
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Пункт, открывающий подменю: со стрелкой справа
|
|
240
|
+
* @param props - пропсы пункта
|
|
241
|
+
* @returns div с role="menuitem"
|
|
242
|
+
*/
|
|
243
|
+
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
244
|
+
const classes = cn("flex", "cursor-default", "items-center", "gap-1.5", "rounded-md", "px-1.5", "py-1", "text-sm", "outline-hidden", "select-none", "data-inset:pl-7", "focus:bg-accent", "focus:text-accent-foreground", "not-data-[variant=destructive]:focus:**:text-accent-foreground", "data-popup-open:bg-accent", "data-popup-open:text-accent-foreground", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*=size-])]:size-4", className);
|
|
245
|
+
return /* @__PURE__ */ jsxs(ContextMenu.SubmenuTrigger, {
|
|
246
|
+
"data-slot": "context-menu-sub-trigger",
|
|
247
|
+
"data-inset": inset,
|
|
248
|
+
className: classes,
|
|
249
|
+
...props,
|
|
250
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Содержимое подменю: появляется сбоку от пункта
|
|
255
|
+
* @param props - пропсы содержимого; по умолчанию side="right", align="start"
|
|
256
|
+
* @returns портал с подменю
|
|
257
|
+
*/
|
|
258
|
+
function ContextMenuSubContent({ className, side = "right", sideOffset = 0, align = "start", alignOffset = -3, ...props }) {
|
|
259
|
+
const classes = cn("w-auto", "min-w-32", "border", "shadow-lg", className);
|
|
260
|
+
return /* @__PURE__ */ jsx(ContextMenuContent, {
|
|
261
|
+
"data-slot": "context-menu-sub-content",
|
|
262
|
+
side,
|
|
263
|
+
sideOffset,
|
|
264
|
+
align,
|
|
265
|
+
alignOffset,
|
|
266
|
+
className: classes,
|
|
267
|
+
...props
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
export { ContextMenu$1 as ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ContextMenuCheckboxItemPropsT, ContextMenuContentPropsT, ContextMenuGroupPropsT, ContextMenuItemPropsT, ContextMenuItemVariantT, ContextMenuLabelPropsT, ContextMenuPortalPropsT, ContextMenuPropsT, ContextMenuRadioGroupPropsT, ContextMenuRadioItemPropsT, ContextMenuSeparatorPropsT, ContextMenuShortcutPropsT, ContextMenuSubContentPropsT, ContextMenuSubPropsT, ContextMenuSubTriggerPropsT, ContextMenuTriggerPropsT } from "./types.js";
|
|
2
|
+
import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./context-menu.js";
|
|
3
|
+
export { ContextMenu, ContextMenuCheckboxItem, type ContextMenuCheckboxItemPropsT, ContextMenuContent, type ContextMenuContentPropsT, ContextMenuGroup, type ContextMenuGroupPropsT, ContextMenuItem, type ContextMenuItemPropsT, type ContextMenuItemVariantT, ContextMenuLabel, type ContextMenuLabelPropsT, ContextMenuPortal, type ContextMenuPortalPropsT, type ContextMenuPropsT, ContextMenuRadioGroup, type ContextMenuRadioGroupPropsT, ContextMenuRadioItem, type ContextMenuRadioItemPropsT, ContextMenuSeparator, type ContextMenuSeparatorPropsT, ContextMenuShortcut, type ContextMenuShortcutPropsT, ContextMenuSub, ContextMenuSubContent, type ContextMenuSubContentPropsT, type ContextMenuSubPropsT, ContextMenuSubTrigger, type ContextMenuSubTriggerPropsT, ContextMenuTrigger, type ContextMenuTriggerPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./context-menu.js";
|