@archytechtor/ui 0.0.0-stage → 0.1.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/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/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/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 +244 -0
- package/dist/index.js +114 -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 +126 -0
- package/dist/styles/theme.css +80 -0
- package/dist/styles/utilities.css +553 -0
- package/package.json +89 -3
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { FloatingAlignT, FloatingSideT } from "../../lib/floating.js";
|
|
2
|
+
import { CSSProperties, ReactNode, Ref, RefObject } from "react";
|
|
3
|
+
import { Combobox } from "@base-ui/react/combobox";
|
|
4
|
+
/**
|
|
5
|
+
* Пропсы части: className только строкой, render и style описаны по-русски
|
|
6
|
+
*/
|
|
7
|
+
export type PartPropsT<PropsT extends {
|
|
8
|
+
render?: unknown;
|
|
9
|
+
}> = Omit<PropsT, 'className' | 'render' | 'style'> & {
|
|
10
|
+
/** Классы элемента */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Свой элемент вместо стандартного: render={<a />}. Стили и пропсы переходят на него */
|
|
13
|
+
render?: PropsT['render'];
|
|
14
|
+
/** Инлайн-стили элемента */
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Пропсы корня Base UI
|
|
19
|
+
*/
|
|
20
|
+
export type RootPropsT<Value, Multiple extends boolean | undefined> = Combobox.Root.Props<Value, Multiple>;
|
|
21
|
+
/**
|
|
22
|
+
* Пропсы комбобокса
|
|
23
|
+
*/
|
|
24
|
+
export type ComboboxPropsT<Value, Multiple extends boolean | undefined = false> = {
|
|
25
|
+
/** Части комбобокса: поле, список */
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
/** Все пункты списка: массив значений или групп { value, items } — по ним идёт фильтрация */
|
|
28
|
+
items?: RootPropsT<Value, Multiple>['items'];
|
|
29
|
+
/** Уже отфильтрованные пункты — когда фильтруете сами, вместе с filter={null} */
|
|
30
|
+
filteredItems?: RootPropsT<Value, Multiple>['filteredItems'];
|
|
31
|
+
/** Своя функция фильтрации: true — показать пункт; null — не фильтровать */
|
|
32
|
+
filter?: RootPropsT<Value, Multiple>['filter'];
|
|
33
|
+
/** Выбор нескольких значений: value становится массивом, выбранное показывают чипы */
|
|
34
|
+
multiple?: Multiple;
|
|
35
|
+
/** Выбранное значение — контролируемый режим, вместе с onValueChange */
|
|
36
|
+
value?: RootPropsT<Value, Multiple>['value'];
|
|
37
|
+
/** Выбранное значение при первом рендере — неконтролируемый режим */
|
|
38
|
+
defaultValue?: RootPropsT<Value, Multiple>['defaultValue'];
|
|
39
|
+
/** Выбрано другое значение */
|
|
40
|
+
onValueChange?: RootPropsT<Value, Multiple>['onValueChange'];
|
|
41
|
+
/** Текст в поле — контролируемый режим, вместе с onInputValueChange */
|
|
42
|
+
inputValue?: string;
|
|
43
|
+
/** Текст в поле при первом рендере */
|
|
44
|
+
defaultInputValue?: string;
|
|
45
|
+
/** Изменился текст в поле: новый текст */
|
|
46
|
+
onInputValueChange?: (inputValue: string, eventDetails: Combobox.Root.ChangeEventDetails) => void;
|
|
47
|
+
/** Список открыт — контролируемый режим, вместе с onOpenChange */
|
|
48
|
+
open?: boolean;
|
|
49
|
+
/** Список открыт при первом рендере */
|
|
50
|
+
defaultOpen?: boolean;
|
|
51
|
+
/** Список открыли или закрыли: новое состояние */
|
|
52
|
+
onOpenChange?: (open: boolean, eventDetails: Combobox.Root.OpenChangeEventDetails) => void;
|
|
53
|
+
/** Анимация открытия или закрытия закончилась */
|
|
54
|
+
onOpenChangeComplete?: (open: boolean) => void;
|
|
55
|
+
/** Открывать список нажатием на поле. По умолчанию true */
|
|
56
|
+
openOnInputClick?: boolean;
|
|
57
|
+
/** Подсвечивать первый подходящий пункт при вводе, чтобы выбрать его Enter */
|
|
58
|
+
autoHighlight?: boolean;
|
|
59
|
+
/** Подсвечивать пункты наведением мыши. По умолчанию true */
|
|
60
|
+
highlightItemOnHover?: boolean;
|
|
61
|
+
/** Подсвечен другой пункт: его значение или undefined */
|
|
62
|
+
onItemHighlighted?: RootPropsT<Value, Multiple>['onItemHighlighted'];
|
|
63
|
+
/** Стрелки переходят с последнего пункта на первый и обратно. По умолчанию true */
|
|
64
|
+
loopFocus?: boolean;
|
|
65
|
+
/** Объект-значение → текст в поле. Для { value, label } не нужен: берётся label */
|
|
66
|
+
itemToStringLabel?: RootPropsT<Value, Multiple>['itemToStringLabel'];
|
|
67
|
+
/** Объект-значение → строка для отправки формы. Для { value, label } берётся value */
|
|
68
|
+
itemToStringValue?: RootPropsT<Value, Multiple>['itemToStringValue'];
|
|
69
|
+
/** Сравнение пункта с выбранным значением, если объекты не совпадают по ссылке */
|
|
70
|
+
isItemEqualToValue?: RootPropsT<Value, Multiple>['isItemEqualToValue'];
|
|
71
|
+
/** Сколько пунктов показывать после фильтрации; -1 — все. По умолчанию -1 */
|
|
72
|
+
limit?: number;
|
|
73
|
+
/** Локаль для сравнения строк при фильтрации */
|
|
74
|
+
locale?: Intl.LocalesArgument;
|
|
75
|
+
/** Список виртуализирован: пункты получают index вручную */
|
|
76
|
+
virtualized?: boolean;
|
|
77
|
+
/** Список встроен в страницу, а не во всплывающее окно */
|
|
78
|
+
inline?: boolean;
|
|
79
|
+
/** Блокировать прокрутку и нажатия вне списка, пока он открыт */
|
|
80
|
+
modal?: boolean;
|
|
81
|
+
/** Отключить комбобокс */
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
/** Только чтение: значение видно, но не меняется */
|
|
84
|
+
readOnly?: boolean;
|
|
85
|
+
/** Обязательное поле формы */
|
|
86
|
+
required?: boolean;
|
|
87
|
+
/** Имя поля в форме */
|
|
88
|
+
name?: string;
|
|
89
|
+
/** id формы, к которой относится поле, если оно вне её */
|
|
90
|
+
form?: string;
|
|
91
|
+
/** id скрытого поля формы */
|
|
92
|
+
id?: string;
|
|
93
|
+
/** Подсказка браузеру для автозаполнения */
|
|
94
|
+
autoComplete?: string;
|
|
95
|
+
/** Ref на поле ввода */
|
|
96
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
97
|
+
/** Ref с методами: close() — закрыть список, unmount() — убрать после своей анимации */
|
|
98
|
+
actionsRef?: RefObject<Combobox.Root.Actions | null>;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Пропсы выбранного значения
|
|
102
|
+
*/
|
|
103
|
+
export type ComboboxValuePropsT = {
|
|
104
|
+
/** Своё отображение: функция от выбранного значения или готовый узел */
|
|
105
|
+
children?: ReactNode | ((selectedValue: any) => ReactNode);
|
|
106
|
+
/** Текст, пока ничего не выбрано */
|
|
107
|
+
placeholder?: ReactNode;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Пропсы кнопки открытия
|
|
111
|
+
*/
|
|
112
|
+
export type ComboboxTriggerPropsT = PartPropsT<Omit<Combobox.Trigger.Props, 'disabled' | 'nativeButton'>> & {
|
|
113
|
+
/** Отключить кнопку */
|
|
114
|
+
disabled?: boolean;
|
|
115
|
+
/** render отрисовывает настоящий button. false — если там другой элемент. По умолчанию true */
|
|
116
|
+
nativeButton?: boolean;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Пропсы кнопки очистки
|
|
120
|
+
*/
|
|
121
|
+
export type ComboboxClearPropsT = PartPropsT<Omit<Combobox.Clear.Props, 'disabled' | 'keepMounted' | 'nativeButton'>> & {
|
|
122
|
+
/** Отключить кнопку */
|
|
123
|
+
disabled?: boolean;
|
|
124
|
+
/** Оставлять кнопку в DOM, когда очищать нечего */
|
|
125
|
+
keepMounted?: boolean;
|
|
126
|
+
/** render отрисовывает настоящий button. false — если там другой элемент. По умолчанию true */
|
|
127
|
+
nativeButton?: boolean;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Пропсы поля
|
|
131
|
+
*/
|
|
132
|
+
export type ComboboxInputPropsT = PartPropsT<Omit<Combobox.Input.Props, 'disabled'>> & {
|
|
133
|
+
/** Отключить поле и кнопки */
|
|
134
|
+
disabled?: boolean;
|
|
135
|
+
/** Показать стрелку, открывающую список. По умолчанию true */
|
|
136
|
+
showTrigger?: boolean;
|
|
137
|
+
/** Показать крестик очистки, когда есть значение */
|
|
138
|
+
showClear?: boolean;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Пропсы списка во всплывающем окне
|
|
142
|
+
*/
|
|
143
|
+
export type ComboboxContentPropsT = PartPropsT<Omit<Combobox.Popup.Props, 'initialFocus' | 'finalFocus'>> & {
|
|
144
|
+
/** Сторона поля, с которой появляется окно; при нехватке места окно перевернётся. По умолчанию bottom */
|
|
145
|
+
side?: FloatingSideT;
|
|
146
|
+
/** Расстояние от поля в px. По умолчанию 6 */
|
|
147
|
+
sideOffset?: number;
|
|
148
|
+
/** Выравнивание вдоль стороны поля. По умолчанию start */
|
|
149
|
+
align?: FloatingAlignT;
|
|
150
|
+
/** Сдвиг от выравнивания в px. По умолчанию 0 */
|
|
151
|
+
alignOffset?: number;
|
|
152
|
+
/** Элемент, к которому привязано окно, вместо поля: обычно ComboboxChips через useComboboxAnchor */
|
|
153
|
+
anchor?: Combobox.Positioner.Props['anchor'];
|
|
154
|
+
/** Куда поставить фокус при открытии: true — по умолчанию, false — не двигать, ref — на элемент */
|
|
155
|
+
initialFocus?: Combobox.Popup.Props['initialFocus'];
|
|
156
|
+
/** Куда вернуть фокус при закрытии: true — по умолчанию, false — не двигать, ref — на элемент */
|
|
157
|
+
finalFocus?: Combobox.Popup.Props['finalFocus'];
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Пропсы списка пунктов
|
|
161
|
+
*/
|
|
162
|
+
export type ComboboxListPropsT = PartPropsT<Omit<Combobox.List.Props, 'children'>> & {
|
|
163
|
+
/** Пункты: функция от пункта из items (item, index) или готовые ComboboxItem */
|
|
164
|
+
children?: ReactNode | ((item: any, index: number) => ReactNode);
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Пропсы пункта
|
|
168
|
+
*/
|
|
169
|
+
export type ComboboxItemPropsT = PartPropsT<Omit<Combobox.Item.Props, 'value' | 'index' | 'disabled' | 'nativeButton'>> & {
|
|
170
|
+
/** Значение пункта: строка или объект из items */
|
|
171
|
+
value?: unknown;
|
|
172
|
+
/** Номер пункта — только для виртуализированного списка */
|
|
173
|
+
index?: number;
|
|
174
|
+
/** Отключить пункт */
|
|
175
|
+
disabled?: boolean;
|
|
176
|
+
/** Ссылка на элемент пункта */
|
|
177
|
+
ref?: Ref<HTMLDivElement>;
|
|
178
|
+
/** render отрисовывает настоящий button. По умолчанию false */
|
|
179
|
+
nativeButton?: boolean;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Пропсы группы
|
|
183
|
+
*/
|
|
184
|
+
export type ComboboxGroupPropsT = PartPropsT<Omit<Combobox.Group.Props, 'items'>> & {
|
|
185
|
+
/** Пункты группы — для ComboboxCollection внутри */
|
|
186
|
+
items?: readonly unknown[];
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Пропсы подписи группы
|
|
190
|
+
*/
|
|
191
|
+
export type ComboboxLabelPropsT = PartPropsT<Combobox.GroupLabel.Props>;
|
|
192
|
+
/**
|
|
193
|
+
* Пропсы коллекции
|
|
194
|
+
*/
|
|
195
|
+
export type ComboboxCollectionPropsT = {
|
|
196
|
+
/** Функция от пункта группы: (item, index) => ComboboxItem */
|
|
197
|
+
children: (item: any, index: number) => ReactNode;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Пропсы пустого результата
|
|
201
|
+
*/
|
|
202
|
+
export type ComboboxEmptyPropsT = PartPropsT<Combobox.Empty.Props>;
|
|
203
|
+
/**
|
|
204
|
+
* Пропсы разделителя
|
|
205
|
+
*/
|
|
206
|
+
export type ComboboxSeparatorPropsT = PartPropsT<Omit<Combobox.Separator.Props, 'orientation'>> & {
|
|
207
|
+
/** Направление: horizontal — линия поперёк списка. По умолчанию horizontal */
|
|
208
|
+
orientation?: 'horizontal' | 'vertical';
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Пропсы поля с чипами
|
|
212
|
+
*/
|
|
213
|
+
export type ComboboxChipsPropsT = PartPropsT<Combobox.Chips.Props>;
|
|
214
|
+
/**
|
|
215
|
+
* Пропсы чипа
|
|
216
|
+
*/
|
|
217
|
+
export type ComboboxChipPropsT = PartPropsT<Combobox.Chip.Props> & {
|
|
218
|
+
/** Показать крестик удаления. По умолчанию true */
|
|
219
|
+
showRemove?: boolean;
|
|
220
|
+
/** Подпись крестика для скринридеров. По умолчанию «Удалить» */
|
|
221
|
+
removeLabel?: string;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Пропсы поля ввода среди чипов
|
|
225
|
+
*/
|
|
226
|
+
export type ComboboxChipsInputPropsT = PartPropsT<Omit<Combobox.Input.Props, 'disabled'>> & {
|
|
227
|
+
/** Отключить поле */
|
|
228
|
+
disabled?: boolean;
|
|
229
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CommandDialogPropsT, CommandEmptyPropsT, CommandGroupPropsT, CommandInputPropsT, CommandItemPropsT, CommandListPropsT, CommandPropsT, CommandSeparatorPropsT, CommandShortcutPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Палитра команд: поле поиска и список, который фильтруется по мере ввода
|
|
4
|
+
* @param props - пропсы палитры; value — выделенный пункт, shouldFilter, filter, loop — как в cmdk
|
|
5
|
+
* @returns div
|
|
6
|
+
*/
|
|
7
|
+
export declare function Command({ className, ...props }: CommandPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Палитра в диалоге: окно в верхней трети экрана, обычно открывается по ⌘K
|
|
10
|
+
* @param props - пропсы диалога; внутрь кладутся CommandInput и CommandList — Command уже есть
|
|
11
|
+
* @returns диалог
|
|
12
|
+
*/
|
|
13
|
+
export declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: CommandDialogPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Поле поиска: фильтрует список, слева иконка лупы
|
|
16
|
+
* @param props - пропсы поля; value и onValueChange — текст поиска
|
|
17
|
+
* @returns обёртка с полем
|
|
18
|
+
*/
|
|
19
|
+
export declare function CommandInput({ className, ...props }: CommandInputPropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Список пунктов: прокручивается, не выше 18rem
|
|
22
|
+
* @param props - пропсы списка; label — подпись для скринридеров, по умолчанию «Варианты»
|
|
23
|
+
* @returns div
|
|
24
|
+
*/
|
|
25
|
+
export declare function CommandList({ className, label, ...props }: CommandListPropsT): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Пустой результат: показывается, когда ничего не нашлось
|
|
28
|
+
* @param props - пропсы; children по умолчанию «Ничего не найдено»
|
|
29
|
+
* @returns div
|
|
30
|
+
*/
|
|
31
|
+
export declare function CommandEmpty({ className, children, ...props }: CommandEmptyPropsT): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Группа пунктов с заголовком heading
|
|
34
|
+
* @param props - пропсы группы
|
|
35
|
+
* @returns div
|
|
36
|
+
*/
|
|
37
|
+
export declare function CommandGroup({ className, ref, ...props }: CommandGroupPropsT): import("react").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* Разделитель между группами
|
|
40
|
+
* @param props - пропсы разделителя
|
|
41
|
+
* @returns div
|
|
42
|
+
*/
|
|
43
|
+
export declare function CommandSeparator({ className, ...props }: CommandSeparatorPropsT): import("react").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Пункт списка. data-checked={true} показывает галочку справа
|
|
46
|
+
* @param props - пропсы пункта; onSelect — пункт выбран, value — по нему идёт поиск
|
|
47
|
+
* @returns div с role="option"
|
|
48
|
+
*/
|
|
49
|
+
export declare function CommandItem({ className, children, ref, ...props }: CommandItemPropsT): import("react").JSX.Element;
|
|
50
|
+
/**
|
|
51
|
+
* Сочетание клавиш справа в пункте
|
|
52
|
+
* @param props - пропсы
|
|
53
|
+
* @returns span
|
|
54
|
+
*/
|
|
55
|
+
export declare function CommandShortcut({ className, ...props }: CommandShortcutPropsT): import("react").JSX.Element;
|
|
@@ -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;
|