@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,270 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ContextMenu } from "@base-ui/react/context-menu";
|
|
6
|
+
// src/components/context-menu/context-menu.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Контекстное меню: список действий по правому клику или долгому нажатию на области
|
|
9
|
+
* @param props - пропсы меню
|
|
10
|
+
* @returns корень без своей разметки
|
|
11
|
+
*/
|
|
12
|
+
function ContextMenu$1({ onOpenChange, ...props }) {
|
|
13
|
+
/**
|
|
14
|
+
* Меню открыли или закрыли: наружу только флаг
|
|
15
|
+
* @param open - открыто ли
|
|
16
|
+
*/
|
|
17
|
+
const handleOpenChange = (open) => onOpenChange?.(open);
|
|
18
|
+
return /* @__PURE__ */ jsx(ContextMenu.Root, {
|
|
19
|
+
"data-slot": "context-menu",
|
|
20
|
+
onOpenChange: handleOpenChange,
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Портал: переносит меню в конец body. ContextMenuContent рендерит его сам
|
|
26
|
+
* @param props - пропсы портала
|
|
27
|
+
* @returns портал
|
|
28
|
+
*/
|
|
29
|
+
function ContextMenuPortal(props) {
|
|
30
|
+
return /* @__PURE__ */ jsx(ContextMenu.Portal, {
|
|
31
|
+
"data-slot": "context-menu-portal",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Область меню: правый клик или долгое нажатие по ней открывает меню у курсора
|
|
37
|
+
* @param props - пропсы области
|
|
38
|
+
* @returns div
|
|
39
|
+
*/
|
|
40
|
+
function ContextMenuTrigger({ className, ...props }) {
|
|
41
|
+
const classes = cn("select-none", className);
|
|
42
|
+
return /* @__PURE__ */ jsx(ContextMenu.Trigger, {
|
|
43
|
+
"data-slot": "context-menu-trigger",
|
|
44
|
+
className: classes,
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Классы окна меню */
|
|
49
|
+
const contentClasses = [
|
|
50
|
+
"z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin)",
|
|
51
|
+
"overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md",
|
|
52
|
+
"ring-1 ring-foreground/10 duration-100 outline-none data-closed:overflow-hidden",
|
|
53
|
+
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
54
|
+
"data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
55
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
56
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
57
|
+
];
|
|
58
|
+
/**
|
|
59
|
+
* Содержимое меню: рендерится в портале у курсора
|
|
60
|
+
* @param props - пропсы содержимого; по умолчанию side="right", align="start"
|
|
61
|
+
* @returns портал с меню
|
|
62
|
+
*/
|
|
63
|
+
function ContextMenuContent({ className, side = "right", sideOffset = 0, align = "start", alignOffset = 4, collisionPadding, arrowPadding, sticky, ...props }) {
|
|
64
|
+
const classes = cn(contentClasses, className);
|
|
65
|
+
const positionerProps = {
|
|
66
|
+
side,
|
|
67
|
+
sideOffset,
|
|
68
|
+
align,
|
|
69
|
+
alignOffset,
|
|
70
|
+
collisionPadding,
|
|
71
|
+
arrowPadding,
|
|
72
|
+
sticky
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ jsx(ContextMenu.Portal, { children: /* @__PURE__ */ jsx(ContextMenu.Positioner, {
|
|
75
|
+
className: "isolate z-50 outline-none",
|
|
76
|
+
...positionerProps,
|
|
77
|
+
children: /* @__PURE__ */ jsx(ContextMenu.Popup, {
|
|
78
|
+
"data-slot": "context-menu-content",
|
|
79
|
+
className: classes,
|
|
80
|
+
...props
|
|
81
|
+
})
|
|
82
|
+
}) });
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Группа пунктов: объединяет связанные действия; ContextMenuLabel кладётся внутрь неё
|
|
86
|
+
* @param props - пропсы группы
|
|
87
|
+
* @returns div с role="group"
|
|
88
|
+
*/
|
|
89
|
+
function ContextMenuGroup(props) {
|
|
90
|
+
return /* @__PURE__ */ jsx(ContextMenu.Group, {
|
|
91
|
+
"data-slot": "context-menu-group",
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Пункт меню: действие. Ссылку рисуют через render={<a href />}
|
|
97
|
+
* @param props - пропсы пункта
|
|
98
|
+
* @returns div с role="menuitem"
|
|
99
|
+
*/
|
|
100
|
+
function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
|
101
|
+
const classes = cn("group/context-menu-item", "relative", "flex", "cursor-default", "items-center", "gap-1.5", "rounded-md", "px-1.5", "py-1", "text-sm", "outline-hidden", "select-none", "data-inset:pl-7", "focus:bg-accent", "focus:text-accent-foreground", "focus:*:[svg]:text-accent-foreground", "data-[variant=destructive]:text-destructive", "data-[variant=destructive]:focus:bg-destructive/10", "data-[variant=destructive]:focus:text-destructive", "dark:data-[variant=destructive]:focus:bg-destructive/20", "data-[variant=destructive]:*:[svg]:text-destructive", "data-disabled:pointer-events-none", "data-disabled:opacity-50", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*=size-])]:size-4", className);
|
|
102
|
+
return /* @__PURE__ */ jsx(ContextMenu.Item, {
|
|
103
|
+
"data-slot": "context-menu-item",
|
|
104
|
+
"data-inset": inset,
|
|
105
|
+
"data-variant": variant,
|
|
106
|
+
className: classes,
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Классы пунктов-переключателей: флажка и радиокнопки
|
|
112
|
+
*/
|
|
113
|
+
const toggleItemClasses = [
|
|
114
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none",
|
|
115
|
+
"data-inset:pl-7 focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground",
|
|
116
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
117
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4"
|
|
118
|
+
];
|
|
119
|
+
/**
|
|
120
|
+
* Пункт-флажок: включает и выключает настройку, отмечен галочкой справа
|
|
121
|
+
* @param props - пропсы пункта
|
|
122
|
+
* @returns div с role="menuitemcheckbox"
|
|
123
|
+
*/
|
|
124
|
+
function ContextMenuCheckboxItem({ className, children, inset, onCheckedChange, ...props }) {
|
|
125
|
+
const classes = cn(toggleItemClasses, className);
|
|
126
|
+
/**
|
|
127
|
+
* Отметку переключили: наружу только состояние
|
|
128
|
+
* @param checked - отмечен ли
|
|
129
|
+
*/
|
|
130
|
+
const handleCheckedChange = (checked) => onCheckedChange?.(checked);
|
|
131
|
+
return /* @__PURE__ */ jsxs(ContextMenu.CheckboxItem, {
|
|
132
|
+
"data-slot": "context-menu-checkbox-item",
|
|
133
|
+
"data-inset": inset,
|
|
134
|
+
className: classes,
|
|
135
|
+
onCheckedChange: handleCheckedChange,
|
|
136
|
+
...props,
|
|
137
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
138
|
+
"data-slot": "context-menu-checkbox-item-indicator",
|
|
139
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
140
|
+
children: /* @__PURE__ */ jsx(ContextMenu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
141
|
+
}), children]
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Группа радиокнопок: из пунктов внутри выбран один
|
|
146
|
+
* @param props - пропсы группы
|
|
147
|
+
* @returns div с role="group"
|
|
148
|
+
*/
|
|
149
|
+
function ContextMenuRadioGroup({ onValueChange, ...props }) {
|
|
150
|
+
/**
|
|
151
|
+
* Выбран другой пункт: наружу только значение
|
|
152
|
+
* @param value - значение пункта
|
|
153
|
+
*/
|
|
154
|
+
const handleValueChange = (value) => onValueChange?.(value);
|
|
155
|
+
return /* @__PURE__ */ jsx(ContextMenu.RadioGroup, {
|
|
156
|
+
"data-slot": "context-menu-radio-group",
|
|
157
|
+
onValueChange: handleValueChange,
|
|
158
|
+
...props
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Пункт-радиокнопка: выбранный отмечен галочкой справа
|
|
163
|
+
* @param props - пропсы пункта
|
|
164
|
+
* @returns div с role="menuitemradio"
|
|
165
|
+
*/
|
|
166
|
+
function ContextMenuRadioItem({ className, children, inset, ...props }) {
|
|
167
|
+
const classes = cn(toggleItemClasses, className);
|
|
168
|
+
return /* @__PURE__ */ jsxs(ContextMenu.RadioItem, {
|
|
169
|
+
"data-slot": "context-menu-radio-item",
|
|
170
|
+
"data-inset": inset,
|
|
171
|
+
className: classes,
|
|
172
|
+
...props,
|
|
173
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
174
|
+
"data-slot": "context-menu-radio-item-indicator",
|
|
175
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
176
|
+
children: /* @__PURE__ */ jsx(ContextMenu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
177
|
+
}), children]
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Подпись: заголовок группы пунктов, не выбирается. Кладётся внутрь ContextMenuGroup
|
|
182
|
+
* или ContextMenuRadioGroup
|
|
183
|
+
* @param props - пропсы подписи
|
|
184
|
+
* @returns div
|
|
185
|
+
*/
|
|
186
|
+
function ContextMenuLabel({ className, inset, ...props }) {
|
|
187
|
+
const classes = cn("px-1.5", "py-1", "text-xs", "font-medium", "text-muted-foreground", "data-inset:pl-7", className);
|
|
188
|
+
return /* @__PURE__ */ jsx(ContextMenu.GroupLabel, {
|
|
189
|
+
"data-slot": "context-menu-label",
|
|
190
|
+
"data-inset": inset,
|
|
191
|
+
className: classes,
|
|
192
|
+
...props
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Разделитель: линия между группами пунктов
|
|
197
|
+
* @param props - пропсы разделителя
|
|
198
|
+
* @returns div с role="separator"
|
|
199
|
+
*/
|
|
200
|
+
function ContextMenuSeparator({ className, ...props }) {
|
|
201
|
+
const classes = cn("-mx-1", "my-1", "h-px", "bg-border", className);
|
|
202
|
+
return /* @__PURE__ */ jsx(ContextMenu.Separator, {
|
|
203
|
+
"data-slot": "context-menu-separator",
|
|
204
|
+
className: classes,
|
|
205
|
+
...props
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Сочетание клавиш: подсказка справа в пункте. Само сочетание не обрабатывает
|
|
210
|
+
* @param props - пропсы сочетания
|
|
211
|
+
* @returns span
|
|
212
|
+
*/
|
|
213
|
+
function ContextMenuShortcut({ className, ...props }) {
|
|
214
|
+
const classes = cn("ml-auto", "text-xs", "tracking-widest", "text-muted-foreground", "group-focus/context-menu-item:text-accent-foreground", className);
|
|
215
|
+
return /* @__PURE__ */ jsx("span", {
|
|
216
|
+
"data-slot": "context-menu-shortcut",
|
|
217
|
+
className: classes,
|
|
218
|
+
...props
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Подменю: вложенный список, открывается из пункта
|
|
223
|
+
* @param props - пропсы подменю
|
|
224
|
+
* @returns корень без своей разметки
|
|
225
|
+
*/
|
|
226
|
+
function ContextMenuSub({ onOpenChange, ...props }) {
|
|
227
|
+
/**
|
|
228
|
+
* Подменю открыли или закрыли: наружу только флаг
|
|
229
|
+
* @param open - открыто ли
|
|
230
|
+
*/
|
|
231
|
+
const handleOpenChange = (open) => onOpenChange?.(open);
|
|
232
|
+
return /* @__PURE__ */ jsx(ContextMenu.SubmenuRoot, {
|
|
233
|
+
"data-slot": "context-menu-sub",
|
|
234
|
+
onOpenChange: handleOpenChange,
|
|
235
|
+
...props
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Пункт, открывающий подменю: со стрелкой справа
|
|
240
|
+
* @param props - пропсы пункта
|
|
241
|
+
* @returns div с role="menuitem"
|
|
242
|
+
*/
|
|
243
|
+
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
244
|
+
const classes = cn("flex", "cursor-default", "items-center", "gap-1.5", "rounded-md", "px-1.5", "py-1", "text-sm", "outline-hidden", "select-none", "data-inset:pl-7", "focus:bg-accent", "focus:text-accent-foreground", "not-data-[variant=destructive]:focus:**:text-accent-foreground", "data-popup-open:bg-accent", "data-popup-open:text-accent-foreground", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*=size-])]:size-4", className);
|
|
245
|
+
return /* @__PURE__ */ jsxs(ContextMenu.SubmenuTrigger, {
|
|
246
|
+
"data-slot": "context-menu-sub-trigger",
|
|
247
|
+
"data-inset": inset,
|
|
248
|
+
className: classes,
|
|
249
|
+
...props,
|
|
250
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Содержимое подменю: появляется сбоку от пункта
|
|
255
|
+
* @param props - пропсы содержимого; по умолчанию side="right", align="start"
|
|
256
|
+
* @returns портал с подменю
|
|
257
|
+
*/
|
|
258
|
+
function ContextMenuSubContent({ className, side = "right", sideOffset = 0, align = "start", alignOffset = -3, ...props }) {
|
|
259
|
+
const classes = cn("w-auto", "min-w-32", "border", "shadow-lg", className);
|
|
260
|
+
return /* @__PURE__ */ jsx(ContextMenuContent, {
|
|
261
|
+
"data-slot": "context-menu-sub-content",
|
|
262
|
+
side,
|
|
263
|
+
sideOffset,
|
|
264
|
+
align,
|
|
265
|
+
alignOffset,
|
|
266
|
+
className: classes,
|
|
267
|
+
...props
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
export { ContextMenu$1 as ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ContextMenuCheckboxItemPropsT, ContextMenuContentPropsT, ContextMenuGroupPropsT, ContextMenuItemPropsT, ContextMenuItemVariantT, ContextMenuLabelPropsT, ContextMenuPortalPropsT, ContextMenuPropsT, ContextMenuRadioGroupPropsT, ContextMenuRadioItemPropsT, ContextMenuSeparatorPropsT, ContextMenuShortcutPropsT, ContextMenuSubContentPropsT, ContextMenuSubPropsT, ContextMenuSubTriggerPropsT, ContextMenuTriggerPropsT } from "./types.js";
|
|
2
|
+
import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./context-menu.js";
|
|
3
|
+
export { ContextMenu, ContextMenuCheckboxItem, type ContextMenuCheckboxItemPropsT, ContextMenuContent, type ContextMenuContentPropsT, ContextMenuGroup, type ContextMenuGroupPropsT, ContextMenuItem, type ContextMenuItemPropsT, type ContextMenuItemVariantT, ContextMenuLabel, type ContextMenuLabelPropsT, ContextMenuPortal, type ContextMenuPortalPropsT, type ContextMenuPropsT, ContextMenuRadioGroup, type ContextMenuRadioGroupPropsT, ContextMenuRadioItem, type ContextMenuRadioItemPropsT, ContextMenuSeparator, type ContextMenuSeparatorPropsT, ContextMenuShortcut, type ContextMenuShortcutPropsT, ContextMenuSub, ContextMenuSubContent, type ContextMenuSubContentPropsT, type ContextMenuSubPropsT, ContextMenuSubTrigger, type ContextMenuSubTriggerPropsT, ContextMenuTrigger, type ContextMenuTriggerPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./context-menu.js";
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { FloatingPropsT } from "../../lib/floating.js";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
import { ContextMenu } from "@base-ui/react/context-menu";
|
|
5
|
+
/**
|
|
6
|
+
* Пропсы выпадающего меню
|
|
7
|
+
*/
|
|
8
|
+
export type ContextMenuPropsT = Omit<ContextMenu.Root.Props, 'onOpenChange' | 'closeParentOnEsc'> & {
|
|
9
|
+
/** Меню открыто — контролируемый режим, вместе с onOpenChange */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** Меню открыто при первом рендере — неконтролируемый режим */
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
/** Меню открыли или закрыли: новое состояние */
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
/** Стрелки переходят с последнего пункта на первый и обратно. По умолчанию true */
|
|
16
|
+
loopFocus?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Пропсы портала
|
|
20
|
+
*/
|
|
21
|
+
export type ContextMenuPortalPropsT = ContextMenu.Portal.Props;
|
|
22
|
+
/**
|
|
23
|
+
* Пропсы области меню
|
|
24
|
+
*/
|
|
25
|
+
export type ContextMenuTriggerPropsT = PartPropsT<ContextMenu.Trigger.Props>;
|
|
26
|
+
/**
|
|
27
|
+
* Пропсы содержимого меню
|
|
28
|
+
*/
|
|
29
|
+
export type ContextMenuContentPropsT = PartPropsT<ContextMenu.Popup.Props> & FloatingPropsT;
|
|
30
|
+
/**
|
|
31
|
+
* Пропсы группы пунктов
|
|
32
|
+
*/
|
|
33
|
+
export type ContextMenuGroupPropsT = PartPropsT<ContextMenu.Group.Props>;
|
|
34
|
+
/**
|
|
35
|
+
* Вариант оформления пункта
|
|
36
|
+
*/
|
|
37
|
+
export type ContextMenuItemVariantT = 'default' | 'destructive';
|
|
38
|
+
/**
|
|
39
|
+
* Пропсы пункта меню
|
|
40
|
+
*/
|
|
41
|
+
export type ContextMenuItemPropsT = PartPropsT<ContextMenu.Item.Props> & {
|
|
42
|
+
/** Отступ слева под иконку, чтобы выровнять с пунктами с иконками */
|
|
43
|
+
inset?: boolean;
|
|
44
|
+
/** Вариант оформления: destructive — красный, для опасных действий */
|
|
45
|
+
variant?: ContextMenuItemVariantT;
|
|
46
|
+
/** Отключить пункт */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** Закрывать меню после нажатия. По умолчанию true */
|
|
49
|
+
closeOnClick?: boolean;
|
|
50
|
+
/** Текст для поиска набором букв, если содержимое пункта — не просто текст */
|
|
51
|
+
label?: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Пропсы пункта-флажка
|
|
55
|
+
*/
|
|
56
|
+
export type ContextMenuCheckboxItemPropsT = PartPropsT<Omit<ContextMenu.CheckboxItem.Props, 'onCheckedChange'>> & {
|
|
57
|
+
/** Отступ слева под иконку, чтобы выровнять с пунктами с иконками */
|
|
58
|
+
inset?: boolean;
|
|
59
|
+
/** Отмечен ли пункт — контролируемый режим, вместе с onCheckedChange */
|
|
60
|
+
checked?: boolean;
|
|
61
|
+
/** Отмечен ли пункт при первом рендере — неконтролируемый режим */
|
|
62
|
+
defaultChecked?: boolean;
|
|
63
|
+
/** Отметку переключили: новое состояние */
|
|
64
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
65
|
+
/** Отключить пункт */
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
/** Закрывать меню после выбора. По умолчанию false — меню остаётся открытым, чтобы выбрать несколько */
|
|
68
|
+
closeOnClick?: boolean;
|
|
69
|
+
/** Текст для поиска набором букв, если содержимое пункта — не просто текст */
|
|
70
|
+
label?: string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Пропсы группы радиокнопок
|
|
74
|
+
*/
|
|
75
|
+
export type ContextMenuRadioGroupPropsT = PartPropsT<Omit<ContextMenu.RadioGroup.Props, 'value' | 'defaultValue' | 'onValueChange'>> & {
|
|
76
|
+
/** Значение выбранного пункта — контролируемый режим, вместе с onValueChange */
|
|
77
|
+
value?: string;
|
|
78
|
+
/** Значение выбранного пункта при первом рендере — неконтролируемый режим */
|
|
79
|
+
defaultValue?: string;
|
|
80
|
+
/** Выбран другой пункт: его значение */
|
|
81
|
+
onValueChange?: (value: string) => void;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Пропсы пункта-радиокнопки
|
|
85
|
+
*/
|
|
86
|
+
export type ContextMenuRadioItemPropsT = PartPropsT<Omit<ContextMenu.RadioItem.Props, 'value'>> & {
|
|
87
|
+
/** Значение пункта: попадает в value группы при выборе */
|
|
88
|
+
value: string;
|
|
89
|
+
/** Отступ слева под иконку, чтобы выровнять с пунктами с иконками */
|
|
90
|
+
inset?: boolean;
|
|
91
|
+
/** Отключить пункт */
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
/** Закрывать меню после выбора. По умолчанию false — меню остаётся открытым */
|
|
94
|
+
closeOnClick?: boolean;
|
|
95
|
+
/** Текст для поиска набором букв, если содержимое пункта — не просто текст */
|
|
96
|
+
label?: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Пропсы подписи
|
|
100
|
+
*/
|
|
101
|
+
export type ContextMenuLabelPropsT = PartPropsT<ContextMenu.GroupLabel.Props> & {
|
|
102
|
+
/** Отступ слева под иконку, чтобы выровнять с пунктами с иконками */
|
|
103
|
+
inset?: boolean;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Пропсы разделителя
|
|
107
|
+
*/
|
|
108
|
+
export type ContextMenuSeparatorPropsT = PartPropsT<ContextMenu.Separator.Props>;
|
|
109
|
+
/**
|
|
110
|
+
* Пропсы сочетания клавиш
|
|
111
|
+
*/
|
|
112
|
+
export type ContextMenuShortcutPropsT = ComponentProps<'span'>;
|
|
113
|
+
/**
|
|
114
|
+
* Пропсы подменю
|
|
115
|
+
*/
|
|
116
|
+
export type ContextMenuSubPropsT = Omit<ContextMenu.SubmenuRoot.Props, 'onOpenChange'> & {
|
|
117
|
+
/** Подменю открыто — контролируемый режим, вместе с onOpenChange */
|
|
118
|
+
open?: boolean;
|
|
119
|
+
/** Подменю открыто при первом рендере — неконтролируемый режим */
|
|
120
|
+
defaultOpen?: boolean;
|
|
121
|
+
/** Подменю открыли или закрыли: новое состояние */
|
|
122
|
+
onOpenChange?: (open: boolean) => void;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Пропсы пункта, открывающего подменю
|
|
126
|
+
*/
|
|
127
|
+
export type ContextMenuSubTriggerPropsT = PartPropsT<ContextMenu.SubmenuTrigger.Props> & {
|
|
128
|
+
/** Отступ слева под иконку, чтобы выровнять с пунктами с иконками */
|
|
129
|
+
inset?: boolean;
|
|
130
|
+
/** Отключить пункт */
|
|
131
|
+
disabled?: boolean;
|
|
132
|
+
/** Текст для поиска набором букв, если содержимое пункта — не просто текст */
|
|
133
|
+
label?: string;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Пропсы содержимого подменю
|
|
137
|
+
*/
|
|
138
|
+
export type ContextMenuSubContentPropsT = ContextMenuContentPropsT;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Возможности таблицы: фильтрация, скрытие столбцов, страницы, выбор строк, сортировка.
|
|
3
|
+
* Передаётся в useTable как features
|
|
4
|
+
*/
|
|
5
|
+
export declare const dataTableFeatures: {
|
|
6
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
7
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
8
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
9
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
10
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
11
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
12
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
13
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
14
|
+
filterFns: {
|
|
15
|
+
includesString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
16
|
+
};
|
|
17
|
+
sortFns: {
|
|
18
|
+
alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
19
|
+
text: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { columnFilteringFeature, columnVisibilityFeature, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, filterFn_includesString, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_text, tableFeatures } from "@tanstack/react-table";
|
|
2
|
+
// src/components/data-table/data-table-features.ts
|
|
3
|
+
/**
|
|
4
|
+
* Возможности таблицы: фильтрация, скрытие столбцов, страницы, выбор строк, сортировка.
|
|
5
|
+
* Передаётся в useTable как features
|
|
6
|
+
*/
|
|
7
|
+
const dataTableFeatures = tableFeatures({
|
|
8
|
+
columnFilteringFeature,
|
|
9
|
+
columnVisibilityFeature,
|
|
10
|
+
rowPaginationFeature,
|
|
11
|
+
rowSelectionFeature,
|
|
12
|
+
rowSortingFeature,
|
|
13
|
+
filteredRowModel: createFilteredRowModel(),
|
|
14
|
+
paginatedRowModel: createPaginatedRowModel(),
|
|
15
|
+
sortedRowModel: createSortedRowModel(),
|
|
16
|
+
filterFns: { includesString: filterFn_includesString },
|
|
17
|
+
sortFns: {
|
|
18
|
+
alphanumeric: sortFn_alphanumeric,
|
|
19
|
+
text: sortFn_text
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export { dataTableFeatures };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DataTableColumnHeaderPropsT, DataTableOptionsT, DataTablePaginationPropsT, DataTablePropsT, DataTableViewOptionsPropsT } from "./types.js";
|
|
2
|
+
import { RowData } from "@tanstack/react-table";
|
|
3
|
+
/**
|
|
4
|
+
* Помощник для описания столбцов таблицы с нужным типом строк
|
|
5
|
+
* @returns помощник: accessor(), display(), columns()
|
|
6
|
+
*/
|
|
7
|
+
export declare function createDataTableColumnHelper<TData extends RowData>(): import("@tanstack/react-table").ColumnHelper<{
|
|
8
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
9
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
10
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
11
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
12
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
13
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
14
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
15
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
16
|
+
filterFns: {
|
|
17
|
+
includesString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
18
|
+
};
|
|
19
|
+
sortFns: {
|
|
20
|
+
alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
21
|
+
text: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
22
|
+
};
|
|
23
|
+
}, TData>;
|
|
24
|
+
/**
|
|
25
|
+
* Создать таблицу: сортировка, фильтры, страницы, выбор строк и скрытие столбцов уже подключены
|
|
26
|
+
* @param options - data, columns и остальные параметры useTable
|
|
27
|
+
* @returns экземпляр таблицы для DataTable и помощников
|
|
28
|
+
*/
|
|
29
|
+
export declare function useDataTable<TData extends RowData>(options: DataTableOptionsT<TData>): import("@tanstack/react-table").ReactTable<{
|
|
30
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
31
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
32
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
33
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
34
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
35
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
36
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
37
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
38
|
+
filterFns: {
|
|
39
|
+
includesString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
40
|
+
};
|
|
41
|
+
sortFns: {
|
|
42
|
+
alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
43
|
+
text: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
44
|
+
};
|
|
45
|
+
}, TData, import("@tanstack/react-table").TableState_ColumnFiltering & import("@tanstack/react-table").TableState_ColumnVisibility & import("@tanstack/react-table").TableState_RowPagination & import("@tanstack/react-table").TableState_RowSelection & import("@tanstack/react-table").TableState_RowSorting>;
|
|
46
|
+
/**
|
|
47
|
+
* Таблица данных: заголовки и строки текущей страницы в рамке
|
|
48
|
+
* @param props - пропсы; table — экземпляр из useDataTable
|
|
49
|
+
* @returns div с таблицей
|
|
50
|
+
*/
|
|
51
|
+
export declare function DataTable<TData extends RowData>({ table, emptyText, className, ...props }: DataTablePropsT<TData>): import("react").JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* Заголовок столбца с меню: сортировка по возрастанию и убыванию, скрыть столбец
|
|
54
|
+
* @param props - столбец и название
|
|
55
|
+
* @returns div с кнопкой меню или просто название, если сортировать нельзя
|
|
56
|
+
*/
|
|
57
|
+
export declare function DataTableColumnHeader<TData extends RowData, TValue>({ column, title, ascendingLabel, descendingLabel, hideLabel, className, ...props }: DataTableColumnHeaderPropsT<TData, TValue>): import("react").JSX.Element;
|
|
58
|
+
/**
|
|
59
|
+
* Пагинация таблицы: выбрано строк, размер страницы, номер страницы и кнопки перехода
|
|
60
|
+
* @param props - пропсы; table — экземпляр из useDataTable
|
|
61
|
+
* @returns div
|
|
62
|
+
*/
|
|
63
|
+
export declare function DataTablePagination<TData extends RowData>({ table, pageSizes, showSelected, className, ...props }: DataTablePaginationPropsT<TData>): import("react").JSX.Element;
|
|
64
|
+
/**
|
|
65
|
+
* Выбор столбцов: меню с флажками, какие столбцы показывать
|
|
66
|
+
* @param props - пропсы; table — экземпляр из useDataTable
|
|
67
|
+
* @returns меню
|
|
68
|
+
*/
|
|
69
|
+
export declare function DataTableViewOptions<TData extends RowData>({ table, label, menuLabel, className }: DataTableViewOptionsPropsT<TData>): import("react").JSX.Element;
|