@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,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;
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { ROW_FORMS, texts } from "../../lib/locale.js";
|
|
4
|
+
import { pluralize } from "../../lib/format.js";
|
|
5
|
+
import { Button } from "../button/button.js";
|
|
6
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../dropdown-menu/dropdown-menu.js";
|
|
7
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/select.js";
|
|
8
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../table/table.js";
|
|
9
|
+
import { dataTableFeatures } from "./data-table-features.js";
|
|
10
|
+
import { ArrowDownIcon, ArrowUpIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, EyeOffIcon, Settings2Icon } from "lucide-react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { FlexRender, createColumnHelper, useTable } from "@tanstack/react-table";
|
|
13
|
+
// src/components/data-table/data-table.tsx
|
|
14
|
+
/**
|
|
15
|
+
* Помощник для описания столбцов таблицы с нужным типом строк
|
|
16
|
+
* @returns помощник: accessor(), display(), columns()
|
|
17
|
+
*/
|
|
18
|
+
function createDataTableColumnHelper() {
|
|
19
|
+
return createColumnHelper();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Создать таблицу: сортировка, фильтры, страницы, выбор строк и скрытие столбцов уже подключены
|
|
23
|
+
* @param options - data, columns и остальные параметры useTable
|
|
24
|
+
* @returns экземпляр таблицы для DataTable и помощников
|
|
25
|
+
*/
|
|
26
|
+
function useDataTable(options) {
|
|
27
|
+
return useTable({
|
|
28
|
+
features: dataTableFeatures,
|
|
29
|
+
...options
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Таблица данных: заголовки и строки текущей страницы в рамке
|
|
34
|
+
* @param props - пропсы; table — экземпляр из useDataTable
|
|
35
|
+
* @returns div с таблицей
|
|
36
|
+
*/
|
|
37
|
+
function DataTable({ table, emptyText = texts.empty, className, ...props }) {
|
|
38
|
+
const classes = cn("overflow-hidden", "rounded-md", "border", className);
|
|
39
|
+
const rows = table.getRowModel().rows;
|
|
40
|
+
const columnCount = table.getVisibleLeafColumns().length;
|
|
41
|
+
const headerRows = [];
|
|
42
|
+
const bodyRows = [];
|
|
43
|
+
for (const headerGroup of table.getHeaderGroups()) {
|
|
44
|
+
const cells = [];
|
|
45
|
+
for (const header of headerGroup.headers) {
|
|
46
|
+
const content = header.isPlaceholder ? null : /* @__PURE__ */ jsx(FlexRender, { header });
|
|
47
|
+
cells.push(/* @__PURE__ */ jsx(TableHead, { children: content }, header.id));
|
|
48
|
+
}
|
|
49
|
+
headerRows.push(/* @__PURE__ */ jsx(TableRow, { children: cells }, headerGroup.id));
|
|
50
|
+
}
|
|
51
|
+
for (const row of rows) {
|
|
52
|
+
const cells = [];
|
|
53
|
+
const state = row.getIsSelected() ? "selected" : void 0;
|
|
54
|
+
for (const cell of row.getVisibleCells()) cells.push(/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(FlexRender, { cell }) }, cell.id));
|
|
55
|
+
bodyRows.push(/* @__PURE__ */ jsx(TableRow, {
|
|
56
|
+
"data-state": state,
|
|
57
|
+
children: cells
|
|
58
|
+
}, row.id));
|
|
59
|
+
}
|
|
60
|
+
if (bodyRows.length === 0) bodyRows.push(/* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
|
|
61
|
+
colSpan: columnCount,
|
|
62
|
+
className: "h-24 text-center",
|
|
63
|
+
children: emptyText
|
|
64
|
+
}) }, "empty"));
|
|
65
|
+
return /* @__PURE__ */ jsx("div", {
|
|
66
|
+
"data-slot": "data-table",
|
|
67
|
+
className: classes,
|
|
68
|
+
...props,
|
|
69
|
+
children: /* @__PURE__ */ jsxs(Table, { children: [/* @__PURE__ */ jsx(TableHeader, { children: headerRows }), /* @__PURE__ */ jsx(TableBody, { children: bodyRows })] })
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Заголовок столбца с меню: сортировка по возрастанию и убыванию, скрыть столбец
|
|
74
|
+
* @param props - столбец и название
|
|
75
|
+
* @returns div с кнопкой меню или просто название, если сортировать нельзя
|
|
76
|
+
*/
|
|
77
|
+
function DataTableColumnHeader({ column, title, ascendingLabel = texts.sortAscending, descendingLabel = texts.sortDescending, hideLabel = texts.hide, className, ...props }) {
|
|
78
|
+
if (!column.getCanSort()) return /* @__PURE__ */ jsx("div", {
|
|
79
|
+
"data-slot": "data-table-column-header",
|
|
80
|
+
className: cn(className),
|
|
81
|
+
...props,
|
|
82
|
+
children: title
|
|
83
|
+
});
|
|
84
|
+
const sorted = column.getIsSorted();
|
|
85
|
+
let icon = /* @__PURE__ */ jsx(ChevronsUpDownIcon, {});
|
|
86
|
+
if (sorted === "desc") icon = /* @__PURE__ */ jsx(ArrowDownIcon, {});
|
|
87
|
+
else if (sorted === "asc") icon = /* @__PURE__ */ jsx(ArrowUpIcon, {});
|
|
88
|
+
const classes = cn("flex", "items-center", "gap-2", className);
|
|
89
|
+
const headerButtonClasses = "-ml-3 h-8 data-open:bg-accent in-[th:first-child]:-ml-2";
|
|
90
|
+
return /* @__PURE__ */ jsx("div", {
|
|
91
|
+
"data-slot": "data-table-column-header",
|
|
92
|
+
className: classes,
|
|
93
|
+
...props,
|
|
94
|
+
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
95
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
96
|
+
variant: "ghost",
|
|
97
|
+
size: "sm",
|
|
98
|
+
className: headerButtonClasses
|
|
99
|
+
}),
|
|
100
|
+
children: [/* @__PURE__ */ jsx("span", { children: title }), icon]
|
|
101
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
102
|
+
align: "start",
|
|
103
|
+
className: "w-auto",
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
106
|
+
onClick: () => column.toggleSorting(false),
|
|
107
|
+
children: [/* @__PURE__ */ jsx(ArrowUpIcon, {}), ascendingLabel]
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
110
|
+
onClick: () => column.toggleSorting(true),
|
|
111
|
+
children: [/* @__PURE__ */ jsx(ArrowDownIcon, {}), descendingLabel]
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
114
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
115
|
+
onClick: () => column.toggleVisibility(false),
|
|
116
|
+
children: [/* @__PURE__ */ jsx(EyeOffIcon, {}), hideLabel]
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
})] })
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/** Размеры страницы в выпадающем списке */
|
|
123
|
+
const PAGE_SIZES = [
|
|
124
|
+
10,
|
|
125
|
+
20,
|
|
126
|
+
25,
|
|
127
|
+
30,
|
|
128
|
+
40,
|
|
129
|
+
50
|
|
130
|
+
];
|
|
131
|
+
/**
|
|
132
|
+
* Пагинация таблицы: выбрано строк, размер страницы, номер страницы и кнопки перехода
|
|
133
|
+
* @param props - пропсы; table — экземпляр из useDataTable
|
|
134
|
+
* @returns div
|
|
135
|
+
*/
|
|
136
|
+
function DataTablePagination({ table, pageSizes = PAGE_SIZES, showSelected = true, className, ...props }) {
|
|
137
|
+
const { pageIndex, pageSize } = table.state.pagination;
|
|
138
|
+
const selectedCount = table.getFilteredSelectedRowModel().rows.length;
|
|
139
|
+
const totalCount = table.getFilteredRowModel().rows.length;
|
|
140
|
+
const rowsWord = pluralize(totalCount, ROW_FORMS);
|
|
141
|
+
const selectedText = `${texts.selected} ${selectedCount} ${texts.of} ${totalCount} ${rowsWord}`;
|
|
142
|
+
const pageNumber = pageIndex + 1;
|
|
143
|
+
const pageCount = Math.max(table.getPageCount(), 1);
|
|
144
|
+
const pageText = `${texts.page} ${pageNumber} ${texts.of} ${pageCount}`;
|
|
145
|
+
const canPrevious = table.getCanPreviousPage();
|
|
146
|
+
const canNext = table.getCanNextPage();
|
|
147
|
+
const classes = cn("flex", "flex-wrap", "items-center", "justify-between", "gap-x-6", "gap-y-2", "px-2", className);
|
|
148
|
+
const sizeItems = [];
|
|
149
|
+
for (const size of pageSizes) sizeItems.push(/* @__PURE__ */ jsx(SelectItem, {
|
|
150
|
+
value: `${size}`,
|
|
151
|
+
children: size
|
|
152
|
+
}, size));
|
|
153
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
154
|
+
"data-slot": "data-table-pagination",
|
|
155
|
+
className: classes,
|
|
156
|
+
...props,
|
|
157
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
158
|
+
className: "flex-1 text-sm whitespace-nowrap text-muted-foreground",
|
|
159
|
+
children: showSelected && selectedText
|
|
160
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
161
|
+
className: "flex flex-wrap items-center gap-x-6 gap-y-2 lg:gap-x-8",
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ jsxs("div", {
|
|
164
|
+
className: "flex items-center gap-2",
|
|
165
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
166
|
+
className: "text-sm font-medium whitespace-nowrap",
|
|
167
|
+
children: texts.rowsPerPage
|
|
168
|
+
}), /* @__PURE__ */ jsxs(Select, {
|
|
169
|
+
value: `${pageSize}`,
|
|
170
|
+
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
171
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
172
|
+
"aria-label": texts.rowsPerPage,
|
|
173
|
+
className: "h-8 w-[70px]",
|
|
174
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: `${pageSize}` })
|
|
175
|
+
}), /* @__PURE__ */ jsx(SelectContent, {
|
|
176
|
+
side: "top",
|
|
177
|
+
children: sizeItems
|
|
178
|
+
})]
|
|
179
|
+
})]
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ jsx("div", {
|
|
182
|
+
className: "flex min-w-[100px] items-center justify-center text-sm font-medium whitespace-nowrap",
|
|
183
|
+
children: pageText
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsxs("div", {
|
|
186
|
+
className: "flex items-center gap-2",
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
189
|
+
variant: "outline",
|
|
190
|
+
size: "icon",
|
|
191
|
+
className: "hidden size-8 lg:flex",
|
|
192
|
+
onClick: () => table.setPageIndex(0),
|
|
193
|
+
disabled: !canPrevious,
|
|
194
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
195
|
+
className: "sr-only",
|
|
196
|
+
children: texts.firstPage
|
|
197
|
+
}), /* @__PURE__ */ jsx(ChevronsLeftIcon, {})]
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
200
|
+
variant: "outline",
|
|
201
|
+
size: "icon",
|
|
202
|
+
className: "size-8",
|
|
203
|
+
onClick: () => table.previousPage(),
|
|
204
|
+
disabled: !canPrevious,
|
|
205
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
206
|
+
className: "sr-only",
|
|
207
|
+
children: texts.previousPage
|
|
208
|
+
}), /* @__PURE__ */ jsx(ChevronLeftIcon, {})]
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
211
|
+
variant: "outline",
|
|
212
|
+
size: "icon",
|
|
213
|
+
className: "size-8",
|
|
214
|
+
onClick: () => table.nextPage(),
|
|
215
|
+
disabled: !canNext,
|
|
216
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
217
|
+
className: "sr-only",
|
|
218
|
+
children: texts.nextPage
|
|
219
|
+
}), /* @__PURE__ */ jsx(ChevronRightIcon, {})]
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
222
|
+
variant: "outline",
|
|
223
|
+
size: "icon",
|
|
224
|
+
className: "hidden size-8 lg:flex",
|
|
225
|
+
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
|
226
|
+
disabled: !canNext,
|
|
227
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
228
|
+
className: "sr-only",
|
|
229
|
+
children: texts.lastPage
|
|
230
|
+
}), /* @__PURE__ */ jsx(ChevronsRightIcon, {})]
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
})]
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Название столбца для меню: заголовок-строка или id
|
|
240
|
+
* @param column - столбец
|
|
241
|
+
* @returns название
|
|
242
|
+
*/
|
|
243
|
+
function getColumnTitle(column) {
|
|
244
|
+
const header = column.columnDef.header;
|
|
245
|
+
if (typeof header === "string") return header;
|
|
246
|
+
return column.id;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Выбор столбцов: меню с флажками, какие столбцы показывать
|
|
250
|
+
* @param props - пропсы; table — экземпляр из useDataTable
|
|
251
|
+
* @returns меню
|
|
252
|
+
*/
|
|
253
|
+
function DataTableViewOptions({ table, label = texts.view, menuLabel = texts.columns, className }) {
|
|
254
|
+
const classes = cn("ml-auto", "h-8", className);
|
|
255
|
+
const items = [];
|
|
256
|
+
for (const column of table.getAllColumns()) {
|
|
257
|
+
if (typeof column.accessorFn === "undefined" || !column.getCanHide()) continue;
|
|
258
|
+
const title = getColumnTitle(column);
|
|
259
|
+
items.push(/* @__PURE__ */ jsx(DropdownMenuCheckboxItem, {
|
|
260
|
+
checked: column.getIsVisible(),
|
|
261
|
+
onCheckedChange: (value) => column.toggleVisibility(Boolean(value)),
|
|
262
|
+
children: title
|
|
263
|
+
}, column.id));
|
|
264
|
+
}
|
|
265
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
266
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
267
|
+
"data-slot": "data-table-view-options",
|
|
268
|
+
variant: "outline",
|
|
269
|
+
size: "sm",
|
|
270
|
+
className: classes
|
|
271
|
+
}),
|
|
272
|
+
children: [/* @__PURE__ */ jsx(Settings2Icon, {}), label]
|
|
273
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
274
|
+
align: "end",
|
|
275
|
+
className: "w-[180px]",
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, { children: menuLabel }) }),
|
|
278
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
279
|
+
items
|
|
280
|
+
]
|
|
281
|
+
})] });
|
|
282
|
+
}
|
|
283
|
+
export { DataTable, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, createDataTableColumnHelper, useDataTable };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { dataTableFeatures } from "./data-table-features.js";
|
|
2
|
+
import { DataTableColumnHeaderPropsT, DataTableFeaturesT, DataTableOptionsT, DataTablePaginationPropsT, DataTablePropsT, DataTableT, DataTableViewOptionsPropsT } from "./types.js";
|
|
3
|
+
import { DataTable, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, createDataTableColumnHelper, useDataTable } from "./data-table.js";
|
|
4
|
+
export { DataTable, DataTableColumnHeader, type DataTableColumnHeaderPropsT, type DataTableFeaturesT, type DataTableOptionsT, DataTablePagination, type DataTablePaginationPropsT, type DataTablePropsT, type DataTableT, DataTableViewOptions, type DataTableViewOptionsPropsT, createDataTableColumnHelper, dataTableFeatures, useDataTable };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { dataTableFeatures } from "./data-table-features.js";
|
|
2
|
+
import { DataTable, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, createDataTableColumnHelper, useDataTable } from "./data-table.js";
|
|
3
|
+
export { DataTable, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, createDataTableColumnHelper, dataTableFeatures, useDataTable };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { dataTableFeatures } from "./data-table-features.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import { Column, ReactTable, RowData, TableOptions } from "@tanstack/react-table";
|
|
4
|
+
/**
|
|
5
|
+
* Набор возможностей таблицы
|
|
6
|
+
*/
|
|
7
|
+
export type DataTableFeaturesT = typeof dataTableFeatures;
|
|
8
|
+
/**
|
|
9
|
+
* Экземпляр таблицы с возможностями dataTableFeatures
|
|
10
|
+
*/
|
|
11
|
+
export type DataTableT<TData extends RowData> = ReactTable<DataTableFeaturesT, TData>;
|
|
12
|
+
/**
|
|
13
|
+
* Параметры таблицы: как у useTable, но features уже заданы
|
|
14
|
+
*/
|
|
15
|
+
export type DataTableOptionsT<TData extends RowData> = Omit<TableOptions<DataTableFeaturesT, TData>, 'features'>;
|
|
16
|
+
/**
|
|
17
|
+
* Пропсы таблицы данных
|
|
18
|
+
*/
|
|
19
|
+
export type DataTablePropsT<TData extends RowData> = Omit<ComponentProps<'div'>, 'children'> & {
|
|
20
|
+
/** Таблица из useDataTable */
|
|
21
|
+
table: DataTableT<TData>;
|
|
22
|
+
/** Текст, когда строк нет. По умолчанию «Ничего не найдено» */
|
|
23
|
+
emptyText?: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Пропсы заголовка столбца
|
|
27
|
+
*/
|
|
28
|
+
export type DataTableColumnHeaderPropsT<TData extends RowData, TValue> = ComponentProps<'div'> & {
|
|
29
|
+
/** Столбец из контекста header */
|
|
30
|
+
column: Column<DataTableFeaturesT, TData, TValue>;
|
|
31
|
+
/** Название столбца */
|
|
32
|
+
title: string;
|
|
33
|
+
/** Подпись «По возрастанию». По умолчанию из locale */
|
|
34
|
+
ascendingLabel?: string;
|
|
35
|
+
/** Подпись «По убыванию». По умолчанию из locale */
|
|
36
|
+
descendingLabel?: string;
|
|
37
|
+
/** Подпись «Скрыть». По умолчанию из locale */
|
|
38
|
+
hideLabel?: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Пропсы пагинации
|
|
42
|
+
*/
|
|
43
|
+
export type DataTablePaginationPropsT<TData extends RowData> = ComponentProps<'div'> & {
|
|
44
|
+
/** Таблица из useDataTable */
|
|
45
|
+
table: DataTableT<TData>;
|
|
46
|
+
/** Варианты размера страницы. По умолчанию 10, 20, 25, 30, 40, 50 */
|
|
47
|
+
pageSizes?: number[];
|
|
48
|
+
/** Показать счётчик выбранных строк. По умолчанию true */
|
|
49
|
+
showSelected?: boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Пропсы выбора столбцов
|
|
53
|
+
*/
|
|
54
|
+
export type DataTableViewOptionsPropsT<TData extends RowData> = {
|
|
55
|
+
/** Таблица из useDataTable */
|
|
56
|
+
table: DataTableT<TData>;
|
|
57
|
+
/** Текст кнопки. По умолчанию «Вид» */
|
|
58
|
+
label?: string;
|
|
59
|
+
/** Заголовок меню. По умолчанию «Столбцы» */
|
|
60
|
+
menuLabel?: string;
|
|
61
|
+
/** Классы кнопки */
|
|
62
|
+
className?: string;
|
|
63
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DateInputPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Поле даты: ввод по маске дд.мм.гггг и выбор в календаре
|
|
4
|
+
* @param props - пропсы поля; value — дата, onValueChange — дата или null
|
|
5
|
+
* @returns группа поля
|
|
6
|
+
*/
|
|
7
|
+
export declare function DateInput({ value, defaultValue, onValueChange, showCalendar, calendarLabel, captionLayout, startMonth, endMonth, disabledDates, groupClassName, placeholder, onChange, onKeyDown, disabled, ...props }: DateInputPropsT): import("react").JSX.Element;
|