@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,365 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { texts } from "../../lib/locale.js";
|
|
4
|
+
import { Button } from "../button/button.js";
|
|
5
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../input-group/input-group.js";
|
|
6
|
+
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useEffect, useRef } from "react";
|
|
9
|
+
import { Combobox } from "@base-ui/react/combobox";
|
|
10
|
+
// src/components/combobox/combobox.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Комбобокс: поле с поиском и выпадающим списком, выбор одного или нескольких значений
|
|
13
|
+
* @param props - пропсы комбобокса; items — пункты, по ним идёт фильтрация
|
|
14
|
+
* @returns корень без своей разметки
|
|
15
|
+
*/
|
|
16
|
+
function Combobox$1(props) {
|
|
17
|
+
return /* @__PURE__ */ jsx(Combobox.Root, { ...props });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Выбранное значение: текст выбранного пункта или функция для своего отображения
|
|
21
|
+
* @param props - пропсы значения
|
|
22
|
+
* @returns текст без своей разметки
|
|
23
|
+
*/
|
|
24
|
+
function ComboboxValue(props) {
|
|
25
|
+
return /* @__PURE__ */ jsx(Combobox.Value, {
|
|
26
|
+
"data-slot": "combobox-value",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Кнопка открытия списка: справа стрелка вниз
|
|
32
|
+
* @param props - пропсы кнопки; render — оформить другим элементом, например Button
|
|
33
|
+
* @returns кнопка
|
|
34
|
+
*/
|
|
35
|
+
function ComboboxTrigger({ className, children, ...props }) {
|
|
36
|
+
const classes = cn("[&_svg:not([class*=size-])]:size-4", className);
|
|
37
|
+
return /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
38
|
+
"data-slot": "combobox-trigger",
|
|
39
|
+
className: classes,
|
|
40
|
+
...props,
|
|
41
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
42
|
+
"data-slot": "combobox-trigger-icon",
|
|
43
|
+
className: "pointer-events-none size-4 text-muted-foreground"
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Кнопка очистки: крестик, сбрасывает выбранное значение и текст
|
|
49
|
+
* @param props - пропсы кнопки; aria-label по умолчанию «Очистить»
|
|
50
|
+
* @returns кнопка
|
|
51
|
+
*/
|
|
52
|
+
function ComboboxClear({ className, "aria-label": ariaLabel = texts.clear, ...props }) {
|
|
53
|
+
const classes = cn(className);
|
|
54
|
+
const button = /* @__PURE__ */ jsx(InputGroupButton, {
|
|
55
|
+
variant: "ghost",
|
|
56
|
+
size: "icon-xs"
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ jsx(Combobox.Clear, {
|
|
59
|
+
"data-slot": "combobox-clear",
|
|
60
|
+
"aria-label": ariaLabel,
|
|
61
|
+
render: button,
|
|
62
|
+
className: classes,
|
|
63
|
+
...props,
|
|
64
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Поле с поиском: ввод фильтрует список, справа стрелка и крестик очистки.
|
|
69
|
+
* В children можно положить InputGroupAddon с иконкой
|
|
70
|
+
* @param props - пропсы поля; className уходит на рамку InputGroup
|
|
71
|
+
* @returns группа поля
|
|
72
|
+
*/
|
|
73
|
+
function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
|
|
74
|
+
const classes = cn("w-auto", className);
|
|
75
|
+
const input = /* @__PURE__ */ jsx(InputGroupInput, { disabled });
|
|
76
|
+
const triggerButton = /* @__PURE__ */ jsx(InputGroupButton, {
|
|
77
|
+
size: "icon-xs",
|
|
78
|
+
variant: "ghost",
|
|
79
|
+
"data-slot": "input-group-button",
|
|
80
|
+
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
|
|
81
|
+
});
|
|
82
|
+
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
83
|
+
className: classes,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx(Combobox.Input, {
|
|
86
|
+
render: input,
|
|
87
|
+
...props
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsxs(InputGroupAddon, {
|
|
90
|
+
align: "inline-end",
|
|
91
|
+
children: [showTrigger && /* @__PURE__ */ jsx(ComboboxTrigger, {
|
|
92
|
+
"aria-label": texts.openList,
|
|
93
|
+
render: triggerButton,
|
|
94
|
+
disabled
|
|
95
|
+
}), showClear && /* @__PURE__ */ jsx(ComboboxClear, { disabled })]
|
|
96
|
+
}),
|
|
97
|
+
children
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/** Сколько мс после колеса, касания или клавиши прокрутка считается пользовательской */
|
|
102
|
+
const USER_SCROLL_WINDOW = 300;
|
|
103
|
+
/** Клавиши, которыми пользователь прокручивает страницу */
|
|
104
|
+
const scrollKeys = /* @__PURE__ */ new Set([
|
|
105
|
+
"PageUp",
|
|
106
|
+
"PageDown",
|
|
107
|
+
"Home",
|
|
108
|
+
"End",
|
|
109
|
+
" "
|
|
110
|
+
]);
|
|
111
|
+
/**
|
|
112
|
+
* Пока окно списка открыто, страница не прокручивается сама: прокрутку, которую вызвал
|
|
113
|
+
* не пользователь (фокус, scrollIntoView, сдвиг раскладки), откатываем на прежнее место
|
|
114
|
+
*/
|
|
115
|
+
function usePageScrollGuard() {
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
let left = window.scrollX;
|
|
118
|
+
let top = window.scrollY;
|
|
119
|
+
let userUntil = 0;
|
|
120
|
+
/** Пользователь крутит колесо, касается экрана или тянет полосу прокрутки */
|
|
121
|
+
const markUser = () => {
|
|
122
|
+
userUntil = performance.now() + USER_SCROLL_WINDOW;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Клавиша прокрутки страницы
|
|
126
|
+
* @param event - событие клавиатуры
|
|
127
|
+
*/
|
|
128
|
+
const handleKeyDown = (event) => {
|
|
129
|
+
if (scrollKeys.has(event.key)) markUser();
|
|
130
|
+
};
|
|
131
|
+
/** Прокрутка: своя — запоминаем место, чужая — возвращаем */
|
|
132
|
+
const handleScroll = () => {
|
|
133
|
+
if (performance.now() < userUntil) {
|
|
134
|
+
left = window.scrollX;
|
|
135
|
+
top = window.scrollY;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (window.scrollX !== left || window.scrollY !== top) window.scrollTo(left, top);
|
|
139
|
+
};
|
|
140
|
+
window.addEventListener("wheel", markUser, { passive: true });
|
|
141
|
+
window.addEventListener("touchmove", markUser, { passive: true });
|
|
142
|
+
window.addEventListener("pointerdown", markUser);
|
|
143
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
144
|
+
window.addEventListener("scroll", handleScroll);
|
|
145
|
+
return () => {
|
|
146
|
+
window.removeEventListener("wheel", markUser);
|
|
147
|
+
window.removeEventListener("touchmove", markUser);
|
|
148
|
+
window.removeEventListener("pointerdown", markUser);
|
|
149
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
150
|
+
window.removeEventListener("scroll", handleScroll);
|
|
151
|
+
};
|
|
152
|
+
}, []);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Защита прокрутки страницы: монтируется только вместе с открытым окном
|
|
156
|
+
* @returns ничего не рисует
|
|
157
|
+
*/
|
|
158
|
+
function PageScrollGuard() {
|
|
159
|
+
usePageScrollGuard();
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Всплывающее окно со списком: рендерится в портале под полем, шириной с поле.
|
|
164
|
+
* Внутрь кладутся ComboboxEmpty и ComboboxList, при необходимости ComboboxInput
|
|
165
|
+
* @param props - пропсы окна; по умолчанию side="bottom", align="start", sideOffset={6}
|
|
166
|
+
* @returns портал с окном
|
|
167
|
+
*/
|
|
168
|
+
function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
|
|
169
|
+
const hasAnchor = Boolean(anchor);
|
|
170
|
+
const classes = cn("group/combobox-content", "relative", "max-h-72", "w-(--anchor-width)", "max-w-(--available-width)", "min-w-36", "min-w-[calc(var(--anchor-width)+--spacing(7))]", "origin-(--transform-origin)", "overflow-hidden", "rounded-lg", "bg-popover", "text-popover-foreground", "shadow-md", "ring-1", "ring-foreground/10", "duration-100", "data-[chips=true]:min-w-(--anchor-width)", "data-open:animate-in", "data-open:fade-in-0", "data-open:zoom-in-95", "data-closed:animate-out", "data-closed:fade-out-0", "data-closed:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2", "data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2", "data-[side=top]:slide-in-from-bottom-2", "*:data-[slot=input-group]:m-1", "*:data-[slot=input-group]:mb-0", "*:data-[slot=input-group]:h-8", "*:data-[slot=input-group]:border-input/30", "*:data-[slot=input-group]:bg-input/30", "*:data-[slot=input-group]:shadow-none", className);
|
|
171
|
+
return /* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsxs(Combobox.Positioner, {
|
|
172
|
+
side,
|
|
173
|
+
sideOffset,
|
|
174
|
+
align,
|
|
175
|
+
alignOffset,
|
|
176
|
+
anchor,
|
|
177
|
+
className: "isolate z-50",
|
|
178
|
+
children: [/* @__PURE__ */ jsx(PageScrollGuard, {}), /* @__PURE__ */ jsx(Combobox.Popup, {
|
|
179
|
+
"data-slot": "combobox-content",
|
|
180
|
+
"data-chips": hasAnchor,
|
|
181
|
+
className: classes,
|
|
182
|
+
...props
|
|
183
|
+
})]
|
|
184
|
+
}) });
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Список пунктов: прокручивается внутри окна
|
|
188
|
+
* @param props - пропсы списка; children — функция (item, index) => ComboboxItem
|
|
189
|
+
* @returns div с role="listbox"
|
|
190
|
+
*/
|
|
191
|
+
function ComboboxList({ className, ...props }) {
|
|
192
|
+
const classes = cn("max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))]", "scroll-py-1", "overflow-y-auto", "overscroll-contain", "p-1", "[scrollbar-width:none]", "data-empty:p-0", className);
|
|
193
|
+
return /* @__PURE__ */ jsx(Combobox.List, {
|
|
194
|
+
"data-slot": "combobox-list",
|
|
195
|
+
className: classes,
|
|
196
|
+
...props
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Прокрутить список так, чтобы пункт стал виден; страница при этом не двигается
|
|
201
|
+
* @param item - пункт списка
|
|
202
|
+
*/
|
|
203
|
+
function scrollItemInList(item) {
|
|
204
|
+
const list = item.closest("[data-slot=combobox-list]");
|
|
205
|
+
if (!list) return;
|
|
206
|
+
const padding = Number.parseFloat(getComputedStyle(list).scrollPaddingTop) || 0;
|
|
207
|
+
const listRect = list.getBoundingClientRect();
|
|
208
|
+
const itemRect = item.getBoundingClientRect();
|
|
209
|
+
const top = listRect.top + padding;
|
|
210
|
+
const bottom = listRect.bottom - padding;
|
|
211
|
+
if (itemRect.top < top) list.scrollTop -= top - itemRect.top;
|
|
212
|
+
else if (itemRect.bottom > bottom) list.scrollTop += itemRect.bottom - bottom;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Пункт списка: у выбранного справа галочка
|
|
216
|
+
* @param props - пропсы пункта; value — значение пункта
|
|
217
|
+
* @returns div с role="option"
|
|
218
|
+
*/
|
|
219
|
+
function ComboboxItem({ className, children, ref, ...props }) {
|
|
220
|
+
const classes = cn("relative", "flex", "w-full", "cursor-default", "items-center", "gap-2", "rounded-md", "py-1", "pr-8", "pl-1.5", "text-sm", "outline-hidden", "select-none", "data-highlighted:bg-accent", "data-highlighted:text-accent-foreground", "not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground", "data-disabled:pointer-events-none", "data-disabled:opacity-50", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*=size-])]:size-4", className);
|
|
221
|
+
const indicator = /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" });
|
|
222
|
+
/**
|
|
223
|
+
* Пункт подсвечивается с прокруткой (scrollIntoView): прокручиваем только список,
|
|
224
|
+
* иначе браузер двигает и страницу, если окно списка выходит за край экрана
|
|
225
|
+
* @param node - элемент пункта
|
|
226
|
+
*/
|
|
227
|
+
const itemRef = (node) => {
|
|
228
|
+
if (node) node.scrollIntoView = () => scrollItemInList(node);
|
|
229
|
+
if (typeof ref === "function") ref(node);
|
|
230
|
+
else if (ref) ref.current = node;
|
|
231
|
+
};
|
|
232
|
+
return /* @__PURE__ */ jsxs(Combobox.Item, {
|
|
233
|
+
ref: itemRef,
|
|
234
|
+
"data-slot": "combobox-item",
|
|
235
|
+
className: classes,
|
|
236
|
+
...props,
|
|
237
|
+
children: [children, /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
238
|
+
"data-slot": "combobox-item-indicator",
|
|
239
|
+
render: indicator,
|
|
240
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" })
|
|
241
|
+
})]
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Группа пунктов с подписью ComboboxLabel
|
|
246
|
+
* @param props - пропсы группы
|
|
247
|
+
* @returns div с role="group"
|
|
248
|
+
*/
|
|
249
|
+
function ComboboxGroup({ className, ...props }) {
|
|
250
|
+
const classes = cn(className);
|
|
251
|
+
return /* @__PURE__ */ jsx(Combobox.Group, {
|
|
252
|
+
"data-slot": "combobox-group",
|
|
253
|
+
className: classes,
|
|
254
|
+
...props
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Подпись группы: мелкий приглушённый текст
|
|
259
|
+
* @param props - пропсы подписи
|
|
260
|
+
* @returns div
|
|
261
|
+
*/
|
|
262
|
+
function ComboboxLabel({ className, ...props }) {
|
|
263
|
+
const classes = cn("px-2", "py-1.5", "text-xs", "text-muted-foreground", className);
|
|
264
|
+
return /* @__PURE__ */ jsx(Combobox.GroupLabel, {
|
|
265
|
+
"data-slot": "combobox-label",
|
|
266
|
+
className: classes,
|
|
267
|
+
...props
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Коллекция: отрисовывает пункты группы из ComboboxGroup items
|
|
272
|
+
* @param props - пропсы коллекции
|
|
273
|
+
* @returns пункты без своей разметки
|
|
274
|
+
*/
|
|
275
|
+
function ComboboxCollection(props) {
|
|
276
|
+
return /* @__PURE__ */ jsx(Combobox.Collection, {
|
|
277
|
+
"data-slot": "combobox-collection",
|
|
278
|
+
...props
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Пустой результат: показывается, когда ничего не нашлось
|
|
283
|
+
* @param props - пропсы; children по умолчанию «Ничего не найдено»
|
|
284
|
+
* @returns div
|
|
285
|
+
*/
|
|
286
|
+
function ComboboxEmpty({ className, children = texts.empty, ...props }) {
|
|
287
|
+
const classes = cn("hidden", "w-full", "justify-center", "py-2", "text-center", "text-sm", "text-muted-foreground", "group-data-empty/combobox-content:flex", className);
|
|
288
|
+
return /* @__PURE__ */ jsx(Combobox.Empty, {
|
|
289
|
+
"data-slot": "combobox-empty",
|
|
290
|
+
className: classes,
|
|
291
|
+
...props,
|
|
292
|
+
children
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Разделитель между группами
|
|
297
|
+
* @param props - пропсы разделителя
|
|
298
|
+
* @returns div с role="separator"
|
|
299
|
+
*/
|
|
300
|
+
function ComboboxSeparator({ className, ...props }) {
|
|
301
|
+
const classes = cn("-mx-1", "my-1", "h-px", "bg-border", className);
|
|
302
|
+
return /* @__PURE__ */ jsx(Combobox.Separator, {
|
|
303
|
+
"data-slot": "combobox-separator",
|
|
304
|
+
className: classes,
|
|
305
|
+
...props
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Поле с чипами для выбора нескольких значений: чипы и ComboboxChipsInput в общей рамке
|
|
310
|
+
* @param props - пропсы поля; ref передайте в anchor у ComboboxContent
|
|
311
|
+
* @returns div
|
|
312
|
+
*/
|
|
313
|
+
function ComboboxChips({ className, ...props }) {
|
|
314
|
+
const classes = cn("flex", "min-h-8", "flex-wrap", "items-center", "gap-1", "rounded-lg", "border", "border-input", "bg-transparent", "bg-clip-padding", "px-2.5", "py-1", "text-sm", "transition-colors", "dark:bg-input/30", "keyboard:focus-within:border-ring", "keyboard:focus-within:ring-3", "keyboard:focus-within:ring-ring/50", "has-aria-invalid:border-destructive", "has-aria-invalid:ring-3", "has-aria-invalid:ring-destructive/20", "dark:has-aria-invalid:border-destructive/50", "dark:has-aria-invalid:ring-destructive/40", "has-data-[slot=combobox-chip]:px-1", className);
|
|
315
|
+
return /* @__PURE__ */ jsx(Combobox.Chips, {
|
|
316
|
+
"data-slot": "combobox-chips",
|
|
317
|
+
className: classes,
|
|
318
|
+
...props
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Чип выбранного значения: текст и крестик удаления
|
|
323
|
+
* @param props - пропсы чипа
|
|
324
|
+
* @returns div
|
|
325
|
+
*/
|
|
326
|
+
function ComboboxChip({ className, children, showRemove = true, removeLabel = texts.delete, ...props }) {
|
|
327
|
+
const classes = cn("flex", "h-[calc(--spacing(5.25))]", "w-fit", "items-center", "justify-center", "gap-1", "rounded-sm", "bg-muted", "px-1.5", "text-xs", "font-medium", "whitespace-nowrap", "text-foreground", "has-data-[slot=combobox-chip-remove]:pr-0", "has-disabled:pointer-events-none", "has-disabled:cursor-not-allowed", "has-disabled:opacity-50", className);
|
|
328
|
+
const button = /* @__PURE__ */ jsx(Button, {
|
|
329
|
+
variant: "ghost",
|
|
330
|
+
size: "icon-xs"
|
|
331
|
+
});
|
|
332
|
+
return /* @__PURE__ */ jsxs(Combobox.Chip, {
|
|
333
|
+
"data-slot": "combobox-chip",
|
|
334
|
+
className: classes,
|
|
335
|
+
...props,
|
|
336
|
+
children: [children, showRemove && /* @__PURE__ */ jsx(Combobox.ChipRemove, {
|
|
337
|
+
"data-slot": "combobox-chip-remove",
|
|
338
|
+
"aria-label": removeLabel,
|
|
339
|
+
render: button,
|
|
340
|
+
className: "-ml-1 opacity-50 hover:opacity-100",
|
|
341
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
342
|
+
})]
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Поле ввода среди чипов: занимает оставшееся место в строке
|
|
347
|
+
* @param props - пропсы поля
|
|
348
|
+
* @returns input
|
|
349
|
+
*/
|
|
350
|
+
function ComboboxChipsInput({ className, ...props }) {
|
|
351
|
+
const classes = cn("min-w-16", "flex-1", "outline-none", className);
|
|
352
|
+
return /* @__PURE__ */ jsx(Combobox.Input, {
|
|
353
|
+
"data-slot": "combobox-chip-input",
|
|
354
|
+
className: classes,
|
|
355
|
+
...props
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Ref для привязки окна к полю с чипами: передайте в ComboboxChips ref и в ComboboxContent anchor
|
|
360
|
+
* @returns ref на div
|
|
361
|
+
*/
|
|
362
|
+
function useComboboxAnchor() {
|
|
363
|
+
return useRef(null);
|
|
364
|
+
}
|
|
365
|
+
export { Combobox$1 as Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ComboboxChipPropsT, ComboboxChipsInputPropsT, ComboboxChipsPropsT, ComboboxClearPropsT, ComboboxCollectionPropsT, ComboboxContentPropsT, ComboboxEmptyPropsT, ComboboxGroupPropsT, ComboboxInputPropsT, ComboboxItemPropsT, ComboboxLabelPropsT, ComboboxListPropsT, ComboboxPropsT, ComboboxSeparatorPropsT, ComboboxTriggerPropsT, ComboboxValuePropsT } from "./types.js";
|
|
2
|
+
import { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor } from "./combobox.js";
|
|
3
|
+
export { Combobox, ComboboxChip, type ComboboxChipPropsT, ComboboxChips, ComboboxChipsInput, type ComboboxChipsInputPropsT, type ComboboxChipsPropsT, ComboboxClear, type ComboboxClearPropsT, ComboboxCollection, type ComboboxCollectionPropsT, ComboboxContent, type ComboboxContentPropsT, ComboboxEmpty, type ComboboxEmptyPropsT, ComboboxGroup, type ComboboxGroupPropsT, ComboboxInput, type ComboboxInputPropsT, ComboboxItem, type ComboboxItemPropsT, ComboboxLabel, type ComboboxLabelPropsT, ComboboxList, type ComboboxListPropsT, type ComboboxPropsT, ComboboxSeparator, type ComboboxSeparatorPropsT, ComboboxTrigger, type ComboboxTriggerPropsT, ComboboxValue, type ComboboxValuePropsT, useComboboxAnchor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor } from "./combobox.js";
|
|
@@ -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;
|