@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,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Radio } from "@base-ui/react/radio";
|
|
5
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
6
|
+
// src/components/radio-group/radio-group.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Группа переключателей: выбор одного варианта из нескольких
|
|
9
|
+
* @param props - пропсы группы
|
|
10
|
+
* @returns элемент с role=radiogroup
|
|
11
|
+
*/
|
|
12
|
+
function RadioGroup$1({ className, onValueChange, ...props }) {
|
|
13
|
+
const classes = cn("grid", "w-full", "gap-2", className);
|
|
14
|
+
/**
|
|
15
|
+
* Выбран другой вариант: наружу только значение
|
|
16
|
+
* @param value - значение варианта
|
|
17
|
+
*/
|
|
18
|
+
const handleValueChange = (value) => onValueChange?.(value);
|
|
19
|
+
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
20
|
+
"data-slot": "radio-group",
|
|
21
|
+
className: classes,
|
|
22
|
+
onValueChange: handleValueChange,
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Вариант группы: круглая кнопка с точкой, когда выбран
|
|
28
|
+
* @param props - пропсы варианта
|
|
29
|
+
* @returns элемент с role=radio
|
|
30
|
+
*/
|
|
31
|
+
function RadioGroupItem({ className, ...props }) {
|
|
32
|
+
const classes = cn("group/radio-group-item", "peer", "relative", "flex", "aspect-square", "size-4", "shrink-0", "rounded-full", "border", "border-input", "outline-none", "keyboard:group-has-[:focus-visible]/field-label:ring-0", "keyboard:group-has-[:focus-visible]/field-label:not-data-checked:border-input", "after:absolute", "after:-inset-x-3", "after:-inset-y-2", "focus-visible:border-ring", "focus-visible:ring-3", "focus-visible:ring-ring/50", "data-disabled:cursor-not-allowed", "data-disabled:opacity-50", "aria-invalid:border-destructive", "aria-invalid:ring-3", "aria-invalid:ring-destructive/20", "aria-invalid:aria-checked:border-primary", "dark:bg-input/30", "dark:aria-invalid:border-destructive/50", "dark:aria-invalid:ring-destructive/40", "data-checked:border-primary", "data-checked:bg-primary", "data-checked:text-primary-foreground", "dark:data-checked:bg-primary", "keyboard:group-has-[:focus-visible]/field-label:data-checked:border-primary", className);
|
|
33
|
+
return /* @__PURE__ */ jsx(Radio.Root, {
|
|
34
|
+
"data-slot": "radio-group-item",
|
|
35
|
+
className: classes,
|
|
36
|
+
...props,
|
|
37
|
+
children: /* @__PURE__ */ jsx(Radio.Indicator, {
|
|
38
|
+
"data-slot": "radio-group-indicator",
|
|
39
|
+
className: "flex size-4 items-center justify-center",
|
|
40
|
+
children: /* @__PURE__ */ jsx("span", { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" })
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export { RadioGroup$1 as RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { Radio } from "@base-ui/react/radio";
|
|
3
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
4
|
+
/**
|
|
5
|
+
* Пропсы группы переключателей
|
|
6
|
+
*/
|
|
7
|
+
export type RadioGroupPropsT = PartPropsT<Omit<RadioGroup.Props, 'value' | 'defaultValue' | 'onValueChange'>> & {
|
|
8
|
+
/** Значение выбранного варианта — контролируемый режим, вместе с onValueChange */
|
|
9
|
+
value?: string;
|
|
10
|
+
/** Значение выбранного варианта при первом рендере — неконтролируемый режим */
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/** Выбран другой вариант: его значение */
|
|
13
|
+
onValueChange?: (value: string) => void;
|
|
14
|
+
/** Отключить все варианты группы */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Обязательное поле: форма не отправится, пока вариант не выбран */
|
|
17
|
+
required?: boolean;
|
|
18
|
+
/** Имя поля при отправке формы */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** Только чтение: выбор виден, но не меняется */
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Пропсы варианта группы
|
|
25
|
+
*/
|
|
26
|
+
export type RadioGroupItemPropsT = PartPropsT<Omit<Radio.Root.Props, 'value' | 'children'>> & {
|
|
27
|
+
/** Значение варианта: попадает в value группы, когда вариант выбран */
|
|
28
|
+
value: string;
|
|
29
|
+
/** Отключить только этот вариант */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Ошибка: красная рамка и объявление скринридеру, что значение неверное */
|
|
32
|
+
'aria-invalid'?: boolean;
|
|
33
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ReorderListHandlePropsT, ReorderListItemPropsT, ReorderListOrientationT, ReorderListPropsT } from "./types.js";
|
|
2
|
+
import { ReorderList, ReorderListHandle, ReorderListItem } from "./reorder-list.js";
|
|
3
|
+
export { ReorderList, ReorderListHandle, type ReorderListHandlePropsT, ReorderListItem, type ReorderListItemPropsT, type ReorderListOrientationT, type ReorderListPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReorderList, ReorderListHandle, ReorderListItem } from "./reorder-list.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReorderListHandlePropsT, ReorderListItemPropsT, ReorderListPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Список с перетаскиванием: порядок меняют мышью, пальцем и стрелками клавиатуры
|
|
4
|
+
* @param props - пропсы списка
|
|
5
|
+
* @returns список ul с элементами в текущем порядке
|
|
6
|
+
*/
|
|
7
|
+
export declare function ReorderList({ className, value, defaultValue, onValueChange, onValueCommitted, orientation, withHandle, disabled, hint, getMoveAnnouncement, children, ...props }: ReorderListPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Элемент списка: тянется целиком или за ручку, двигается стрелками, Home и End
|
|
10
|
+
* @param props - пропсы элемента
|
|
11
|
+
* @returns элемент li
|
|
12
|
+
*/
|
|
13
|
+
export declare function ReorderListItem({ value, className, disabled, style, onKeyDown, children, ...props }: ReorderListItemPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Ручка перетаскивания: кнопка внутри ReorderListItem, тянется мышью и двигается стрелками
|
|
16
|
+
* @param props - пропсы ручки
|
|
17
|
+
* @returns кнопка ручки
|
|
18
|
+
*/
|
|
19
|
+
export declare function ReorderListHandle({ className, 'aria-label': ariaLabel, onPointerDown, onKeyDown, children, ...props }: ReorderListHandlePropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { GripHorizontalIcon, GripVerticalIcon } from "lucide-react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Children, createContext, isValidElement, useContext, useId, useState } from "react";
|
|
6
|
+
import { Reorder, useDragControls, useReducedMotion } from "motion/react";
|
|
7
|
+
// src/components/reorder-list/reorder-list.tsx
|
|
8
|
+
/** Тексты по умолчанию: каждый переопределяется пропом */
|
|
9
|
+
const defaultTexts = {
|
|
10
|
+
handleLabel: "Переместить",
|
|
11
|
+
verticalHint: "Чтобы изменить порядок, нажимайте стрелки вверх и вниз",
|
|
12
|
+
horizontalHint: "Чтобы изменить порядок, нажимайте стрелки влево и вправо"
|
|
13
|
+
};
|
|
14
|
+
/** Настройки списка: элементы берут из них ориентацию, режим ручки и порядок */
|
|
15
|
+
const ReorderListContext = createContext({
|
|
16
|
+
order: [],
|
|
17
|
+
orientation: "vertical",
|
|
18
|
+
withHandle: false,
|
|
19
|
+
disabled: false,
|
|
20
|
+
hintId: void 0,
|
|
21
|
+
moveItem: () => void 0,
|
|
22
|
+
commit: () => void 0
|
|
23
|
+
});
|
|
24
|
+
/** Настройки элемента: ручка запускает перетаскивание и слушает клавиши */
|
|
25
|
+
const ReorderListItemContext = createContext({
|
|
26
|
+
dragControls: null,
|
|
27
|
+
disabled: false,
|
|
28
|
+
handleKeyDown: () => void 0
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Объявление по умолчанию: «Позиция 2 из 5»
|
|
32
|
+
* @param position - позиция с единицы
|
|
33
|
+
* @param total - число элементов
|
|
34
|
+
* @returns текст для скринридера
|
|
35
|
+
*/
|
|
36
|
+
function getDefaultAnnouncement(position, total) {
|
|
37
|
+
return `Позиция ${position} из ${total}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Собрать элементы списка из children по их значениям
|
|
41
|
+
* @param children - дочерние узлы списка
|
|
42
|
+
* @returns элементы по значению
|
|
43
|
+
*/
|
|
44
|
+
function collectItems(children) {
|
|
45
|
+
const items = /* @__PURE__ */ new Map();
|
|
46
|
+
for (const child of Children.toArray(children)) {
|
|
47
|
+
if (!isValidElement(child)) continue;
|
|
48
|
+
if (typeof child.props.value !== "string") continue;
|
|
49
|
+
items.set(child.props.value, child);
|
|
50
|
+
}
|
|
51
|
+
return items;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Согласовать сохранённый порядок с текущими элементами: убрать исчезнувшие, добавить новые в конец
|
|
55
|
+
* @param order - сохранённый порядок
|
|
56
|
+
* @param ids - значения элементов в разметке
|
|
57
|
+
* @returns порядок без лишних значений
|
|
58
|
+
*/
|
|
59
|
+
function mergeOrder(order, ids) {
|
|
60
|
+
const known = new Set(ids);
|
|
61
|
+
const result = order.filter((id) => known.has(id));
|
|
62
|
+
const placed = new Set(result);
|
|
63
|
+
for (const id of ids) if (!placed.has(id)) result.push(id);
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Список с перетаскиванием: порядок меняют мышью, пальцем и стрелками клавиатуры
|
|
68
|
+
* @param props - пропсы списка
|
|
69
|
+
* @returns список ul с элементами в текущем порядке
|
|
70
|
+
*/
|
|
71
|
+
function ReorderList({ className, value, defaultValue, onValueChange, onValueCommitted, orientation = "vertical", withHandle = false, disabled = false, hint, getMoveAnnouncement = getDefaultAnnouncement, children, ...props }) {
|
|
72
|
+
const hintId = useId();
|
|
73
|
+
const items = collectItems(children);
|
|
74
|
+
const ids = [...items.keys()];
|
|
75
|
+
const [innerOrder, setInnerOrder] = useState(defaultValue ?? ids);
|
|
76
|
+
const [announcement, setAnnouncement] = useState("");
|
|
77
|
+
const order = mergeOrder(value ?? innerOrder, ids);
|
|
78
|
+
const isVertical = orientation === "vertical";
|
|
79
|
+
const defaultHint = isVertical ? defaultTexts.verticalHint : defaultTexts.horizontalHint;
|
|
80
|
+
const hintText = hint ?? defaultHint;
|
|
81
|
+
const classes = cn("m-0", "flex", "list-none", "gap-2", "p-0", "data-[orientation=vertical]:flex-col", "data-[orientation=horizontal]:flex-row", className);
|
|
82
|
+
const orderedItems = [];
|
|
83
|
+
for (const id of order) {
|
|
84
|
+
const item = items.get(id);
|
|
85
|
+
if (item) orderedItems.push(item);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Записать новый порядок: во внутреннее состояние (если не контролируется) и наружу
|
|
89
|
+
* @param nextOrder - новый порядок значений
|
|
90
|
+
*/
|
|
91
|
+
const updateOrder = (nextOrder) => {
|
|
92
|
+
if (value === void 0) setInnerOrder(nextOrder);
|
|
93
|
+
onValueChange?.(nextOrder);
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Перемещение клавишей: сдвинуть элемент и объявить новую позицию
|
|
97
|
+
* @param itemValue - значение элемента
|
|
98
|
+
* @param targetIndex - позиция с нуля, выходящая за края упирается в край
|
|
99
|
+
*/
|
|
100
|
+
const moveItem = (itemValue, targetIndex) => {
|
|
101
|
+
const fromIndex = order.indexOf(itemValue);
|
|
102
|
+
const toIndex = Math.min(Math.max(targetIndex, 0), order.length - 1);
|
|
103
|
+
if (fromIndex === -1 || fromIndex === toIndex) return;
|
|
104
|
+
const nextOrder = order.slice();
|
|
105
|
+
nextOrder.splice(fromIndex, 1);
|
|
106
|
+
nextOrder.splice(toIndex, 0, itemValue);
|
|
107
|
+
updateOrder(nextOrder);
|
|
108
|
+
onValueCommitted?.(nextOrder);
|
|
109
|
+
setAnnouncement(getMoveAnnouncement(toIndex + 1, nextOrder.length));
|
|
110
|
+
};
|
|
111
|
+
/** Перетаскивание закончилось: сообщить итоговый порядок */
|
|
112
|
+
const commit = () => onValueCommitted?.(order);
|
|
113
|
+
const context = {
|
|
114
|
+
order,
|
|
115
|
+
orientation,
|
|
116
|
+
withHandle,
|
|
117
|
+
disabled,
|
|
118
|
+
hintId,
|
|
119
|
+
moveItem,
|
|
120
|
+
commit
|
|
121
|
+
};
|
|
122
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
123
|
+
/* @__PURE__ */ jsx(Reorder.Group, {
|
|
124
|
+
"data-slot": "reorder-list",
|
|
125
|
+
"data-orientation": orientation,
|
|
126
|
+
"data-disabled": disabled || void 0,
|
|
127
|
+
axis: isVertical ? "y" : "x",
|
|
128
|
+
values: order,
|
|
129
|
+
onReorder: updateOrder,
|
|
130
|
+
className: classes,
|
|
131
|
+
...props,
|
|
132
|
+
children: /* @__PURE__ */ jsx(ReorderListContext, {
|
|
133
|
+
value: context,
|
|
134
|
+
children: orderedItems
|
|
135
|
+
})
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ jsx("span", {
|
|
138
|
+
id: hintId,
|
|
139
|
+
className: "sr-only",
|
|
140
|
+
children: hintText
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ jsx("span", {
|
|
143
|
+
"aria-live": "polite",
|
|
144
|
+
className: "sr-only",
|
|
145
|
+
children: announcement
|
|
146
|
+
})
|
|
147
|
+
] });
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Позиция, куда клавиша переносит элемент
|
|
151
|
+
* @param key - нажатая клавиша
|
|
152
|
+
* @param index - текущая позиция
|
|
153
|
+
* @param total - число элементов
|
|
154
|
+
* @param orientation - ориентация списка
|
|
155
|
+
* @returns позиция с нуля или null, если клавиша не двигает элемент
|
|
156
|
+
*/
|
|
157
|
+
function getTargetIndex(key, index, total, orientation) {
|
|
158
|
+
const isVertical = orientation === "vertical";
|
|
159
|
+
const previousKey = isVertical ? "ArrowUp" : "ArrowLeft";
|
|
160
|
+
const nextKey = isVertical ? "ArrowDown" : "ArrowRight";
|
|
161
|
+
if (key === previousKey) return index - 1;
|
|
162
|
+
if (key === nextKey) return index + 1;
|
|
163
|
+
if (key === "Home") return 0;
|
|
164
|
+
if (key === "End") return total - 1;
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Элемент списка: тянется целиком или за ручку, двигается стрелками, Home и End
|
|
169
|
+
* @param props - пропсы элемента
|
|
170
|
+
* @returns элемент li
|
|
171
|
+
*/
|
|
172
|
+
function ReorderListItem({ value, className, disabled = false, style, onKeyDown, children, ...props }) {
|
|
173
|
+
const list = useContext(ReorderListContext);
|
|
174
|
+
const dragControls = useDragControls();
|
|
175
|
+
const isReducedMotion = useReducedMotion();
|
|
176
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
177
|
+
const isDisabled = disabled || list.disabled;
|
|
178
|
+
const isWhole = !list.withHandle && !isDisabled;
|
|
179
|
+
const tabIndex = isWhole ? 0 : void 0;
|
|
180
|
+
const classes = cn("relative", "list-none", "rounded-lg", "bg-background", "transition-shadow", "outline-none", "select-none", "data-dragging:z-10", "data-dragging:shadow-lg", "data-whole:cursor-grab", "data-whole:active:cursor-grabbing", "data-whole:focus-visible:ring-3", "data-whole:focus-visible:ring-ring/50", "data-disabled:cursor-not-allowed", "data-disabled:opacity-50", className);
|
|
181
|
+
const dragStyle = isReducedMotion ? void 0 : { scale: 1.02 };
|
|
182
|
+
/**
|
|
183
|
+
* Клавиша перемещения: сдвинуть элемент
|
|
184
|
+
* @param event - событие клавиатуры
|
|
185
|
+
*/
|
|
186
|
+
const handleMoveKey = (event) => {
|
|
187
|
+
const index = list.order.indexOf(value);
|
|
188
|
+
const targetIndex = getTargetIndex(event.key, index, list.order.length, list.orientation);
|
|
189
|
+
if (isDisabled || targetIndex === null) return;
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
list.moveItem(value, targetIndex);
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Клавиша на самом элементе: двигает его только когда фокус на элементе, а не на вложенном поле
|
|
195
|
+
* @param event - событие клавиатуры
|
|
196
|
+
*/
|
|
197
|
+
const handleKeyDown = (event) => {
|
|
198
|
+
onKeyDown?.(event);
|
|
199
|
+
if (!isWhole || event.target !== event.currentTarget) return;
|
|
200
|
+
handleMoveKey(event);
|
|
201
|
+
};
|
|
202
|
+
/** Перетаскивание началось */
|
|
203
|
+
const handleDragStart = () => setIsDragging(true);
|
|
204
|
+
/** Перетаскивание закончилось */
|
|
205
|
+
const handleDragEnd = () => {
|
|
206
|
+
setIsDragging(false);
|
|
207
|
+
list.commit();
|
|
208
|
+
};
|
|
209
|
+
const itemContext = {
|
|
210
|
+
dragControls,
|
|
211
|
+
disabled: isDisabled,
|
|
212
|
+
handleKeyDown: handleMoveKey
|
|
213
|
+
};
|
|
214
|
+
return /* @__PURE__ */ jsx(Reorder.Item, {
|
|
215
|
+
"data-slot": "reorder-list-item",
|
|
216
|
+
"data-dragging": isDragging || void 0,
|
|
217
|
+
"data-whole": isWhole || void 0,
|
|
218
|
+
"data-disabled": isDisabled || void 0,
|
|
219
|
+
value,
|
|
220
|
+
dragListener: isWhole,
|
|
221
|
+
dragControls,
|
|
222
|
+
whileDrag: dragStyle,
|
|
223
|
+
tabIndex,
|
|
224
|
+
"aria-describedby": isWhole ? list.hintId : void 0,
|
|
225
|
+
"aria-disabled": isDisabled || void 0,
|
|
226
|
+
style,
|
|
227
|
+
className: classes,
|
|
228
|
+
onKeyDown: handleKeyDown,
|
|
229
|
+
onDragStart: handleDragStart,
|
|
230
|
+
onDragEnd: handleDragEnd,
|
|
231
|
+
...props,
|
|
232
|
+
children: /* @__PURE__ */ jsx(ReorderListItemContext, {
|
|
233
|
+
value: itemContext,
|
|
234
|
+
children
|
|
235
|
+
})
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Ручка перетаскивания: кнопка внутри ReorderListItem, тянется мышью и двигается стрелками
|
|
240
|
+
* @param props - пропсы ручки
|
|
241
|
+
* @returns кнопка ручки
|
|
242
|
+
*/
|
|
243
|
+
function ReorderListHandle({ className, "aria-label": ariaLabel = defaultTexts.handleLabel, onPointerDown, onKeyDown, children, ...props }) {
|
|
244
|
+
const list = useContext(ReorderListContext);
|
|
245
|
+
const item = useContext(ReorderListItemContext);
|
|
246
|
+
const classes = cn("inline-flex", "size-7", "shrink-0", "cursor-grab", "touch-none", "items-center", "justify-center", "rounded-md", "text-muted-foreground", "transition-colors", "outline-none", "active:cursor-grabbing", "hover:bg-muted", "hover:text-foreground", "focus-visible:ring-3", "focus-visible:ring-ring/50", "disabled:pointer-events-none", "disabled:opacity-50", "[&_svg]:pointer-events-none", "[&_svg:not([class*=size-])]:size-4", className);
|
|
247
|
+
const Icon = list.orientation === "vertical" ? GripVerticalIcon : GripHorizontalIcon;
|
|
248
|
+
/**
|
|
249
|
+
* Нажатие на ручку: начать перетаскивание элемента
|
|
250
|
+
* @param event - событие указателя
|
|
251
|
+
*/
|
|
252
|
+
const handlePointerDown = (event) => {
|
|
253
|
+
onPointerDown?.(event);
|
|
254
|
+
if (item.disabled || event.defaultPrevented) return;
|
|
255
|
+
item.dragControls?.start(event);
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Клавиша на ручке: переместить элемент
|
|
259
|
+
* @param event - событие клавиатуры
|
|
260
|
+
*/
|
|
261
|
+
const handleKeyDown = (event) => {
|
|
262
|
+
onKeyDown?.(event);
|
|
263
|
+
if (event.defaultPrevented) return;
|
|
264
|
+
item.handleKeyDown(event);
|
|
265
|
+
};
|
|
266
|
+
return /* @__PURE__ */ jsx("button", {
|
|
267
|
+
"data-slot": "reorder-list-handle",
|
|
268
|
+
type: "button",
|
|
269
|
+
disabled: item.disabled,
|
|
270
|
+
"aria-label": ariaLabel,
|
|
271
|
+
"aria-describedby": list.hintId,
|
|
272
|
+
className: classes,
|
|
273
|
+
onPointerDown: handlePointerDown,
|
|
274
|
+
onKeyDown: handleKeyDown,
|
|
275
|
+
...props,
|
|
276
|
+
children: children ?? /* @__PURE__ */ jsx(Icon, { "aria-hidden": true })
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
export { ReorderList, ReorderListHandle, ReorderListItem };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ComponentProps, KeyboardEvent, ReactNode, Ref } from "react";
|
|
2
|
+
import "motion/react";
|
|
3
|
+
/**
|
|
4
|
+
* Ориентация списка
|
|
5
|
+
*/
|
|
6
|
+
export type ReorderListOrientationT = 'vertical' | 'horizontal';
|
|
7
|
+
/**
|
|
8
|
+
* Свойства HTML-списка, которые занимает анимация перетаскивания
|
|
9
|
+
*/
|
|
10
|
+
export type MotionConflictKeysT = 'onDrag' | 'onDragStart' | 'onDragEnd' | 'onDragEnter' | 'onDragExit' | 'onDragLeave' | 'onDragOver' | 'onAnimationStart' | 'onAnimationEnd' | 'onAnimationIteration' | 'defaultValue' | 'ref';
|
|
11
|
+
/**
|
|
12
|
+
* Пропсы списка с перетаскиванием
|
|
13
|
+
*/
|
|
14
|
+
export type ReorderListPropsT = Omit<ComponentProps<'ul'>, MotionConflictKeysT> & {
|
|
15
|
+
/** Классы списка */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Порядок элементов — значения (value) элементов; контролируемый режим, вместе с onValueChange */
|
|
18
|
+
value?: string[];
|
|
19
|
+
/** Порядок элементов при первом рендере — неконтролируемый режим. По умолчанию порядок в разметке */
|
|
20
|
+
defaultValue?: string[];
|
|
21
|
+
/** Порядок изменился (при перетаскивании — при каждом обмене местами): значения элементов */
|
|
22
|
+
onValueChange?: (value: string[]) => void;
|
|
23
|
+
/** Перетаскивание закончилось или элемент сдвинут клавишей: итоговый порядок */
|
|
24
|
+
onValueCommitted?: (value: string[]) => void;
|
|
25
|
+
/** Ориентация: вертикальный или горизонтальный список. Задаёт и клавиши перемещения */
|
|
26
|
+
orientation?: ReorderListOrientationT;
|
|
27
|
+
/** Тянуть только за ручку (ReorderListHandle). По умолчанию false — элемент тянется целиком */
|
|
28
|
+
withHandle?: boolean;
|
|
29
|
+
/** Отключить перетаскивание всех элементов */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Подсказка про клавиши для скринридера, по умолчанию «Чтобы изменить порядок, нажимайте стрелки…» */
|
|
32
|
+
hint?: string;
|
|
33
|
+
/** Объявление скринридеру после перемещения клавишей: позиция с единицы и число элементов */
|
|
34
|
+
getMoveAnnouncement?: (position: number, total: number) => string;
|
|
35
|
+
/** Элементы списка (ReorderListItem) */
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
/** Ссылка на элемент списка */
|
|
38
|
+
ref?: Ref<HTMLUListElement>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Пропсы элемента списка
|
|
42
|
+
*/
|
|
43
|
+
export type ReorderListItemPropsT = Omit<ComponentProps<'li'>, MotionConflictKeysT | 'value'> & {
|
|
44
|
+
/** Уникальное значение элемента: по нему хранится порядок */
|
|
45
|
+
value: string;
|
|
46
|
+
/** Классы элемента */
|
|
47
|
+
className?: string;
|
|
48
|
+
/** Отключить перетаскивание этого элемента */
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/** Содержимое элемента */
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
/** Ссылка на элемент li */
|
|
53
|
+
ref?: Ref<HTMLLIElement>;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Пропсы ручки перетаскивания
|
|
57
|
+
*/
|
|
58
|
+
export type ReorderListHandlePropsT = Omit<ComponentProps<'button'>, 'type'> & {
|
|
59
|
+
/** Классы ручки */
|
|
60
|
+
className?: string;
|
|
61
|
+
/** Название ручки для скринридера, по умолчанию «Переместить» */
|
|
62
|
+
'aria-label'?: string;
|
|
63
|
+
/** Своя иконка вместо точек-захвата */
|
|
64
|
+
children?: ReactNode;
|
|
65
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ResizableHandlePropsT, ResizablePanelGroupPropsT, ResizablePanelPropsT } from "./types.js";
|
|
2
|
+
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "./resizable.js";
|
|
3
|
+
export { ResizableHandle, type ResizableHandlePropsT, ResizablePanel, ResizablePanelGroup, type ResizablePanelGroupPropsT, type ResizablePanelPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "./resizable.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResizableHandlePropsT, ResizablePanelGroupPropsT, ResizablePanelPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Группа панелей: панели, размеры которых меняются перетаскиванием разделителя
|
|
4
|
+
* @param props - пропсы группы; orientation — направление
|
|
5
|
+
* @returns div
|
|
6
|
+
*/
|
|
7
|
+
export declare function ResizablePanelGroup({ className, ...props }: ResizablePanelGroupPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Панель внутри группы
|
|
10
|
+
* @param props - пропсы панели; defaultSize, minSize, maxSize — размеры
|
|
11
|
+
* @returns div
|
|
12
|
+
*/
|
|
13
|
+
export declare function ResizablePanel(props: ResizablePanelPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Разделитель между панелями: тянется мышью, двигается стрелками с клавиатуры
|
|
16
|
+
* @param props - пропсы разделителя; withHandle — ручка посередине
|
|
17
|
+
* @returns div с role="separator"
|
|
18
|
+
*/
|
|
19
|
+
export declare function ResizableHandle({ withHandle, className, ...props }: ResizableHandlePropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
5
|
+
// src/components/resizable/resizable.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Группа панелей: панели, размеры которых меняются перетаскиванием разделителя
|
|
8
|
+
* @param props - пропсы группы; orientation — направление
|
|
9
|
+
* @returns div
|
|
10
|
+
*/
|
|
11
|
+
function ResizablePanelGroup({ className, ...props }) {
|
|
12
|
+
const classes = cn("flex", "h-full", "w-full", "aria-[orientation=vertical]:flex-col", className);
|
|
13
|
+
return /* @__PURE__ */ jsx(ResizablePrimitive.Group, {
|
|
14
|
+
"data-slot": "resizable-panel-group",
|
|
15
|
+
className: classes,
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Панель внутри группы
|
|
21
|
+
* @param props - пропсы панели; defaultSize, minSize, maxSize — размеры
|
|
22
|
+
* @returns div
|
|
23
|
+
*/
|
|
24
|
+
function ResizablePanel(props) {
|
|
25
|
+
return /* @__PURE__ */ jsx(ResizablePrimitive.Panel, {
|
|
26
|
+
"data-slot": "resizable-panel",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Разделитель между панелями: тянется мышью, двигается стрелками с клавиатуры
|
|
32
|
+
* @param props - пропсы разделителя; withHandle — ручка посередине
|
|
33
|
+
* @returns div с role="separator"
|
|
34
|
+
*/
|
|
35
|
+
function ResizableHandle({ withHandle, className, ...props }) {
|
|
36
|
+
const classes = cn("relative", "flex", "w-px", "items-center", "justify-center", "bg-border", "ring-offset-background", "after:absolute", "after:inset-y-0", "after:left-1/2", "after:w-1", "after:-translate-x-1/2", "focus-visible:ring-1", "focus-visible:ring-ring", "focus-visible:outline-hidden", "aria-[orientation=horizontal]:h-px", "aria-[orientation=horizontal]:w-full", "aria-[orientation=horizontal]:after:left-0", "aria-[orientation=horizontal]:after:h-1", "aria-[orientation=horizontal]:after:w-full", "aria-[orientation=horizontal]:after:translate-x-0", "aria-[orientation=horizontal]:after:-translate-y-1/2", "[&[aria-orientation=horizontal]>div]:rotate-90", className);
|
|
37
|
+
return /* @__PURE__ */ jsx(ResizablePrimitive.Separator, {
|
|
38
|
+
"data-slot": "resizable-handle",
|
|
39
|
+
className: classes,
|
|
40
|
+
...props,
|
|
41
|
+
children: withHandle && /* @__PURE__ */ jsx("div", { className: "z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border" })
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode, Ref } from "react";
|
|
2
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
|
+
/**
|
|
4
|
+
* Пропсы группы панелей
|
|
5
|
+
*/
|
|
6
|
+
export type ResizablePanelGroupPropsT = Omit<ResizablePrimitive.GroupProps, 'children' | 'className' | 'defaultLayout' | 'disableCursor' | 'disabled' | 'elementRef' | 'groupRef' | 'id' | 'onLayoutChange' | 'onLayoutChanged' | 'resizePreviewMode' | 'resizeTargetMinimumSize' | 'orientation' | 'style'> & {
|
|
7
|
+
/** Панели и разделители */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Классы группы */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Направление: horizontal — панели в ряд, vertical — друг под другом. По умолчанию horizontal */
|
|
12
|
+
orientation?: 'horizontal' | 'vertical';
|
|
13
|
+
/** Начальные размеры панелей в процентах: { id панели: размер } */
|
|
14
|
+
defaultLayout?: ResizablePrimitive.Layout;
|
|
15
|
+
/** Не менять курсор при перетаскивании */
|
|
16
|
+
disableCursor?: boolean;
|
|
17
|
+
/** Запретить менять размеры */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** id группы — по нему сохраняется раскладка */
|
|
20
|
+
id?: string;
|
|
21
|
+
/** Размеры меняются при перетаскивании: новая раскладка */
|
|
22
|
+
onLayoutChange?: (layout: ResizablePrimitive.Layout) => void;
|
|
23
|
+
/** Перетаскивание закончилось: итоговая раскладка */
|
|
24
|
+
onLayoutChanged?: (layout: ResizablePrimitive.Layout, meta: ResizablePrimitive.LayoutChangedMeta) => void;
|
|
25
|
+
/** Как показывать размер во время перетаскивания */
|
|
26
|
+
resizePreviewMode?: ResizablePrimitive.GroupProps['resizePreviewMode'];
|
|
27
|
+
/** Минимальная область захвата разделителя в px: coarse — для пальца, fine — для мыши */
|
|
28
|
+
resizeTargetMinimumSize?: ResizablePrimitive.GroupProps['resizeTargetMinimumSize'];
|
|
29
|
+
/** Ref на элемент группы */
|
|
30
|
+
elementRef?: Ref<HTMLDivElement | null>;
|
|
31
|
+
/** Ref с методами группы: getLayout(), setLayout() */
|
|
32
|
+
groupRef?: Ref<ResizablePrimitive.GroupImperativeHandle | null>;
|
|
33
|
+
/** Инлайн-стили группы */
|
|
34
|
+
style?: CSSProperties;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Пропсы панели
|
|
38
|
+
*/
|
|
39
|
+
export type ResizablePanelPropsT = Omit<ResizablePrimitive.PanelProps, 'className' | 'collapsedSize' | 'collapsedThreshold' | 'collapsible' | 'defaultSize' | 'disabled' | 'elementRef' | 'groupResizeBehavior' | 'id' | 'maxSize' | 'minSize' | 'onResize' | 'panelRef' | 'style'> & {
|
|
40
|
+
/** Классы панели */
|
|
41
|
+
className?: string;
|
|
42
|
+
/** Начальный размер: число — проценты, строка — '50%', '200px', '10rem' */
|
|
43
|
+
defaultSize?: number | string;
|
|
44
|
+
/** Минимальный размер */
|
|
45
|
+
minSize?: number | string;
|
|
46
|
+
/** Максимальный размер */
|
|
47
|
+
maxSize?: number | string;
|
|
48
|
+
/** Панель можно свернуть, перетащив разделитель дальше минимума */
|
|
49
|
+
collapsible?: boolean;
|
|
50
|
+
/** Размер свёрнутой панели. По умолчанию 0 */
|
|
51
|
+
collapsedSize?: number | string;
|
|
52
|
+
/** Насколько перетащить за минимум, чтобы панель свернулась */
|
|
53
|
+
collapsedThreshold?: number | string;
|
|
54
|
+
/** Запретить менять размер панели */
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
/** Как панель меняется при изменении размера группы: доля или пиксели */
|
|
57
|
+
groupResizeBehavior?: 'preserve-relative-size' | 'preserve-pixel-size';
|
|
58
|
+
/** id панели — ключ в раскладке */
|
|
59
|
+
id?: string;
|
|
60
|
+
/** Размер панели изменился: новый размер, id и прежний размер */
|
|
61
|
+
onResize?: ResizablePrimitive.PanelProps['onResize'];
|
|
62
|
+
/** Ref на элемент панели */
|
|
63
|
+
elementRef?: Ref<HTMLDivElement | null>;
|
|
64
|
+
/** Ref с методами панели: collapse(), expand(), resize() */
|
|
65
|
+
panelRef?: Ref<ResizablePrimitive.PanelImperativeHandle | null>;
|
|
66
|
+
/** Инлайн-стили панели */
|
|
67
|
+
style?: CSSProperties;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Пропсы разделителя
|
|
71
|
+
*/
|
|
72
|
+
export type ResizableHandlePropsT = Omit<ResizablePrimitive.SeparatorProps, 'className' | 'disabled' | 'disableDoubleClick' | 'elementRef' | 'id' | 'preview' | 'style'> & {
|
|
73
|
+
/** Показать ручку посередине разделителя */
|
|
74
|
+
withHandle?: boolean;
|
|
75
|
+
/** Классы разделителя */
|
|
76
|
+
className?: string;
|
|
77
|
+
/** Запретить перетаскивание */
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
/** Не возвращать начальный размер двойным нажатием */
|
|
80
|
+
disableDoubleClick?: boolean;
|
|
81
|
+
/** id разделителя */
|
|
82
|
+
id?: string;
|
|
83
|
+
/** Что показывать на месте разделителя во время перетаскивания */
|
|
84
|
+
preview?: ReactNode;
|
|
85
|
+
/** Ref на элемент разделителя */
|
|
86
|
+
elementRef?: Ref<HTMLDivElement>;
|
|
87
|
+
/** Инлайн-стили разделителя */
|
|
88
|
+
style?: CSSProperties;
|
|
89
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ScrollArea, ScrollBar } from "./scroll-area.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScrollAreaPropsT, ScrollBarPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Область прокрутки: нативная прокрутка с тонкими полосами в стиле интерфейса
|
|
4
|
+
* @param props - пропсы области; размер задаётся className (h-72, w-96)
|
|
5
|
+
* @returns обёртка с видимой областью, вертикальной полосой и углом
|
|
6
|
+
*/
|
|
7
|
+
export declare function ScrollArea({ className, children, ...props }: ScrollAreaPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Полоса прокрутки: вертикальная уже есть в ScrollArea, горизонтальную добавляют внутрь ScrollArea
|
|
10
|
+
* @param props - пропсы полосы
|
|
11
|
+
* @returns полоса с ползунком
|
|
12
|
+
*/
|
|
13
|
+
export declare function ScrollBar({ className, orientation, ...props }: ScrollBarPropsT): import("react").JSX.Element;
|