@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,186 @@
|
|
|
1
|
+
import { ButtonPropsT } from "../button/types.js";
|
|
2
|
+
import { SeparatorPropsT } from "../separator/types.js";
|
|
3
|
+
import { InputPropsT } from "../input/types.js";
|
|
4
|
+
import { TooltipContentPropsT } from "../tooltip/types.js";
|
|
5
|
+
import { VariantProps } from "class-variance-authority";
|
|
6
|
+
import { ComponentProps } from "react";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
/**
|
|
9
|
+
* Состояние боковой панели
|
|
10
|
+
* @property state - expanded — раскрыта, collapsed — свёрнута
|
|
11
|
+
* @property open - раскрыта на десктопе
|
|
12
|
+
* @property setOpen - раскрыть или свернуть на десктопе
|
|
13
|
+
* @property openMobile - открыта шторка на мобильном
|
|
14
|
+
* @property setOpenMobile - открыть или закрыть шторку
|
|
15
|
+
* @property isMobile - мобильный экран
|
|
16
|
+
* @property toggleSidebar - переключить панель или шторку
|
|
17
|
+
*/
|
|
18
|
+
export interface SidebarContextI {
|
|
19
|
+
state: 'expanded' | 'collapsed';
|
|
20
|
+
open: boolean;
|
|
21
|
+
setOpen: (open: boolean) => void;
|
|
22
|
+
openMobile: boolean;
|
|
23
|
+
setOpenMobile: (open: boolean) => void;
|
|
24
|
+
isMobile: boolean;
|
|
25
|
+
toggleSidebar: () => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Пропсы провайдера
|
|
29
|
+
*/
|
|
30
|
+
export type SidebarProviderPropsT = ComponentProps<'div'> & {
|
|
31
|
+
/** Панель раскрыта при первом рендере. По умолчанию true */
|
|
32
|
+
defaultOpen?: boolean;
|
|
33
|
+
/** Панель раскрыта — контролируемый режим, вместе с onOpenChange */
|
|
34
|
+
open?: boolean;
|
|
35
|
+
/** Панель раскрыли или свернули: новое состояние */
|
|
36
|
+
onOpenChange?: (open: boolean) => void;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Сторона экрана для панели
|
|
40
|
+
*/
|
|
41
|
+
export type SidebarSideT = 'left' | 'right';
|
|
42
|
+
/**
|
|
43
|
+
* Вид панели: sidebar — во всю высоту, floating — парящая карточка, inset — содержимое в карточке
|
|
44
|
+
*/
|
|
45
|
+
export type SidebarVariantT = 'sidebar' | 'floating' | 'inset';
|
|
46
|
+
/**
|
|
47
|
+
* Как сворачивается панель: offcanvas — уезжает за край, icon — до иконок, none — не сворачивается
|
|
48
|
+
*/
|
|
49
|
+
export type SidebarCollapsibleT = 'offcanvas' | 'icon' | 'none';
|
|
50
|
+
/**
|
|
51
|
+
* Пропсы панели
|
|
52
|
+
*/
|
|
53
|
+
export type SidebarPropsT = ComponentProps<'div'> & {
|
|
54
|
+
/** Сторона экрана. По умолчанию left */
|
|
55
|
+
side?: SidebarSideT;
|
|
56
|
+
/** Вид: sidebar, floating или inset. По умолчанию sidebar */
|
|
57
|
+
variant?: SidebarVariantT;
|
|
58
|
+
/** Как сворачивается: offcanvas, icon или none. По умолчанию offcanvas */
|
|
59
|
+
collapsible?: SidebarCollapsibleT;
|
|
60
|
+
/** Заголовок шторки на мобильном для скринридеров. По умолчанию «Боковая панель» */
|
|
61
|
+
mobileTitle?: string;
|
|
62
|
+
/** Описание шторки на мобильном для скринридеров */
|
|
63
|
+
mobileDescription?: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Пропсы кнопки переключения
|
|
67
|
+
*/
|
|
68
|
+
export type SidebarTriggerPropsT = ButtonPropsT & {
|
|
69
|
+
/** Подпись для скринридеров. По умолчанию «Переключить боковую панель» */
|
|
70
|
+
label?: string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Пропсы полосы у края панели
|
|
74
|
+
*/
|
|
75
|
+
export type SidebarRailPropsT = ComponentProps<'button'> & {
|
|
76
|
+
/** Подпись для скринридеров и всплывающая подсказка. По умолчанию «Переключить боковую панель» */
|
|
77
|
+
label?: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Пропсы основной области
|
|
81
|
+
*/
|
|
82
|
+
export type SidebarInsetPropsT = ComponentProps<'main'>;
|
|
83
|
+
/**
|
|
84
|
+
* Пропсы поля в панели
|
|
85
|
+
*/
|
|
86
|
+
export type SidebarInputPropsT = InputPropsT;
|
|
87
|
+
/**
|
|
88
|
+
* Пропсы шапки панели
|
|
89
|
+
*/
|
|
90
|
+
export type SidebarHeaderPropsT = ComponentProps<'div'>;
|
|
91
|
+
/**
|
|
92
|
+
* Пропсы подвала панели
|
|
93
|
+
*/
|
|
94
|
+
export type SidebarFooterPropsT = ComponentProps<'div'>;
|
|
95
|
+
/**
|
|
96
|
+
* Пропсы разделителя панели
|
|
97
|
+
*/
|
|
98
|
+
export type SidebarSeparatorPropsT = SeparatorPropsT;
|
|
99
|
+
/**
|
|
100
|
+
* Пропсы содержимого панели
|
|
101
|
+
*/
|
|
102
|
+
export type SidebarContentPropsT = ComponentProps<'div'>;
|
|
103
|
+
/**
|
|
104
|
+
* Пропсы группы
|
|
105
|
+
*/
|
|
106
|
+
export type SidebarGroupPropsT = ComponentProps<'div'>;
|
|
107
|
+
/**
|
|
108
|
+
* Пропсы подписи группы
|
|
109
|
+
*/
|
|
110
|
+
export type SidebarGroupLabelPropsT = useRender.ComponentProps<'div'> & {};
|
|
111
|
+
/**
|
|
112
|
+
* Пропсы действия группы
|
|
113
|
+
*/
|
|
114
|
+
export type SidebarGroupActionPropsT = useRender.ComponentProps<'button'> & {};
|
|
115
|
+
/**
|
|
116
|
+
* Пропсы содержимого группы
|
|
117
|
+
*/
|
|
118
|
+
export type SidebarGroupContentPropsT = ComponentProps<'div'>;
|
|
119
|
+
/**
|
|
120
|
+
* Пропсы меню
|
|
121
|
+
*/
|
|
122
|
+
export type SidebarMenuPropsT = ComponentProps<'ul'>;
|
|
123
|
+
/**
|
|
124
|
+
* Пропсы пункта меню
|
|
125
|
+
*/
|
|
126
|
+
export type SidebarMenuItemPropsT = ComponentProps<'li'>;
|
|
127
|
+
/**
|
|
128
|
+
* Стили кнопки пункта меню: вид и размер.
|
|
129
|
+
* Экспортируются, чтобы оформить так же другой элемент
|
|
130
|
+
*/
|
|
131
|
+
export declare const sidebarMenuButtonVariants: (props?: ({
|
|
132
|
+
variant?: "default" | "outline" | null | undefined;
|
|
133
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
134
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
135
|
+
/**
|
|
136
|
+
* Варианты стилей кнопки пункта меню
|
|
137
|
+
*/
|
|
138
|
+
export type SidebarMenuButtonVariantsT = VariantProps<typeof sidebarMenuButtonVariants>;
|
|
139
|
+
/**
|
|
140
|
+
* Пропсы кнопки пункта меню
|
|
141
|
+
*/
|
|
142
|
+
export type SidebarMenuButtonPropsT = useRender.ComponentProps<'button'> & {
|
|
143
|
+
/** Текущий раздел: пункт подсвечен */
|
|
144
|
+
isActive?: boolean;
|
|
145
|
+
/** Подсказка, когда панель свёрнута до иконок: текст или пропсы TooltipContent */
|
|
146
|
+
tooltip?: string | TooltipContentPropsT;
|
|
147
|
+
/** Вид: default или outline — с рамкой */
|
|
148
|
+
variant?: SidebarMenuButtonVariantsT['variant'];
|
|
149
|
+
/** Размер: default — 32px, sm — 28px, lg — 48px */
|
|
150
|
+
size?: SidebarMenuButtonVariantsT['size'];
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Пропсы действия пункта меню
|
|
154
|
+
*/
|
|
155
|
+
export type SidebarMenuActionPropsT = useRender.ComponentProps<'button'> & {
|
|
156
|
+
/** Показывать только при наведении на пункт */
|
|
157
|
+
showOnHover?: boolean;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Пропсы счётчика пункта меню
|
|
161
|
+
*/
|
|
162
|
+
export type SidebarMenuBadgePropsT = ComponentProps<'div'>;
|
|
163
|
+
/**
|
|
164
|
+
* Пропсы заглушки пункта меню
|
|
165
|
+
*/
|
|
166
|
+
export type SidebarMenuSkeletonPropsT = ComponentProps<'div'> & {
|
|
167
|
+
/** Показать заглушку иконки */
|
|
168
|
+
showIcon?: boolean;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Пропсы подменю
|
|
172
|
+
*/
|
|
173
|
+
export type SidebarMenuSubPropsT = ComponentProps<'ul'>;
|
|
174
|
+
/**
|
|
175
|
+
* Пропсы пункта подменю
|
|
176
|
+
*/
|
|
177
|
+
export type SidebarMenuSubItemPropsT = ComponentProps<'li'>;
|
|
178
|
+
/**
|
|
179
|
+
* Пропсы кнопки подменю
|
|
180
|
+
*/
|
|
181
|
+
export type SidebarMenuSubButtonPropsT = useRender.ComponentProps<'a'> & {
|
|
182
|
+
/** Размер текста: md — 14px, sm — 12px. По умолчанию md */
|
|
183
|
+
size?: 'sm' | 'md';
|
|
184
|
+
/** Текущий раздел: пункт подсвечен */
|
|
185
|
+
isActive?: boolean;
|
|
186
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/sidebar/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Стили кнопки пункта меню: вид и размер.
|
|
5
|
+
* Экспортируются, чтобы оформить так же другой элемент
|
|
6
|
+
*/
|
|
7
|
+
const sidebarMenuButtonVariants = cva([
|
|
8
|
+
"peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm",
|
|
9
|
+
"ring-sidebar-ring outline-hidden transition-[width,height,padding] focus-visible:ring-2",
|
|
10
|
+
"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
11
|
+
"active:bg-sidebar-accent active:text-sidebar-accent-foreground",
|
|
12
|
+
"data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground",
|
|
13
|
+
"data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground",
|
|
14
|
+
"group-has-data-[sidebar=menu-action]/menu-item:pr-8",
|
|
15
|
+
"group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2!",
|
|
16
|
+
"disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
17
|
+
"[&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
|
|
18
|
+
"group-data-[collapsible=icon]:[&:not(:has(svg,img,[data-slot=avatar]))]:justify-center",
|
|
19
|
+
"group-data-[collapsible=icon]:[&:not(:has(svg,img,[data-slot=avatar]))]:px-0!",
|
|
20
|
+
"group-data-[collapsible=icon]:[&:not(:has(svg,img,[data-slot=avatar]))_span]:w-[1ch]",
|
|
21
|
+
"group-data-[collapsible=icon]:[&:not(:has(svg,img,[data-slot=avatar]))_span]:overflow-hidden",
|
|
22
|
+
"group-data-[collapsible=icon]:[&:not(:has(svg,img,[data-slot=avatar]))_span]:text-clip!",
|
|
23
|
+
"group-data-[collapsible=icon]:[&:not(:has(svg,img,[data-slot=avatar]))_span]:font-medium",
|
|
24
|
+
"group-data-[collapsible=icon]:[&:not(:has(svg,img,[data-slot=avatar]))_span~span]:hidden"
|
|
25
|
+
], {
|
|
26
|
+
variants: {
|
|
27
|
+
variant: {
|
|
28
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
29
|
+
outline: ["bg-background shadow-[0_0_0_1px_var(--sidebar-border)]", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"]
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
default: "h-8 text-sm",
|
|
33
|
+
sm: "h-7 text-xs",
|
|
34
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "default",
|
|
39
|
+
size: "default"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export { sidebarMenuButtonVariants };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
// src/components/sidebar/use-mobile.ts
|
|
3
|
+
/** Ширина экрана, с которой начинается десктоп, px */
|
|
4
|
+
const MOBILE_BREAKPOINT = 768;
|
|
5
|
+
/**
|
|
6
|
+
* Экран уже 768px: боковая панель открывается шторкой
|
|
7
|
+
* @returns мобильный ли экран; при первом рендере на сервере — false
|
|
8
|
+
*/
|
|
9
|
+
function useIsMobile() {
|
|
10
|
+
const [isMobile, setIsMobile] = useState(void 0);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const query = window.matchMedia(`(max-width: 767px)`);
|
|
13
|
+
/** Ширина экрана изменилась */
|
|
14
|
+
const updateMobile = () => setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
15
|
+
query.addEventListener("change", updateMobile);
|
|
16
|
+
updateMobile();
|
|
17
|
+
return () => query.removeEventListener("change", updateMobile);
|
|
18
|
+
}, []);
|
|
19
|
+
return Boolean(isMobile);
|
|
20
|
+
}
|
|
21
|
+
export { useIsMobile };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Skeleton } from "./skeleton.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SkeletonPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Заглушка: пульсирующий блок на месте контента, пока он загружается.
|
|
4
|
+
* Размер и форма задаются классами: className={'h-4 w-[250px]'}, className={'size-10 rounded-full'}
|
|
5
|
+
* @param props - пропсы заглушки
|
|
6
|
+
* @returns блок-заглушка
|
|
7
|
+
*/
|
|
8
|
+
export declare function Skeleton({ className, ...props }: SkeletonPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/components/skeleton/skeleton.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Заглушка: пульсирующий блок на месте контента, пока он загружается.
|
|
6
|
+
* Размер и форма задаются классами: className={'h-4 w-[250px]'}, className={'size-10 rounded-full'}
|
|
7
|
+
* @param props - пропсы заглушки
|
|
8
|
+
* @returns блок-заглушка
|
|
9
|
+
*/
|
|
10
|
+
function Skeleton({ className, ...props }) {
|
|
11
|
+
const classes = cn("animate-pulse", "rounded-md", "bg-muted", className);
|
|
12
|
+
return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
"data-slot": "skeleton",
|
|
14
|
+
className: classes,
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { Skeleton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Slider } from "./slider.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SliderPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Слайдер: выбор значения или диапазона перетаскиванием бегунка
|
|
4
|
+
* @param props - пропсы слайдера
|
|
5
|
+
* @returns слайдер с бегунками по числу значений
|
|
6
|
+
*/
|
|
7
|
+
export declare function Slider({ className, defaultValue, value, min, max, orientation, thumbLabels, 'aria-label': ariaLabel, onValueChange, onValueCommit, ...props }: SliderPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { texts } from "../../lib/locale.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { Slider } from "@base-ui/react/slider";
|
|
7
|
+
// src/components/slider/slider.tsx
|
|
8
|
+
/** Подписи бегунков диапазона: «Минимум» и «Максимум» */
|
|
9
|
+
const RANGE_THUMB_LABELS = [texts.minimum, texts.maximum];
|
|
10
|
+
/**
|
|
11
|
+
* Подпись бегунка для скринридера по умолчанию
|
|
12
|
+
* @param index - номер бегунка с нуля
|
|
13
|
+
* @param count - сколько всего бегунков
|
|
14
|
+
* @param sliderLabel - aria-label слайдера: подпись одиночного бегунка
|
|
15
|
+
* @returns подпись бегунка
|
|
16
|
+
*/
|
|
17
|
+
function getThumbLabel(index, count, sliderLabel) {
|
|
18
|
+
if (count === 2) return RANGE_THUMB_LABELS[index];
|
|
19
|
+
if (count > 2) return `Значение ${index + 1} из ${count}`;
|
|
20
|
+
return sliderLabel;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Значение слайдера в виде массива
|
|
24
|
+
* @param value - число или массив
|
|
25
|
+
* @returns массив значений
|
|
26
|
+
*/
|
|
27
|
+
function toArray(value) {
|
|
28
|
+
if (typeof value === "number") return [value];
|
|
29
|
+
return [...value];
|
|
30
|
+
}
|
|
31
|
+
/** Классы корня */
|
|
32
|
+
const rootClasses = "data-horizontal:w-full data-vertical:h-full";
|
|
33
|
+
/** Классы области перетаскивания */
|
|
34
|
+
const controlClasses = cn("relative", "flex", "w-full", "touch-none", "items-center", "select-none", "data-disabled:opacity-50", "data-vertical:h-full", "data-vertical:min-h-40", "data-vertical:w-auto", "data-vertical:flex-col");
|
|
35
|
+
/** Классы дорожки */
|
|
36
|
+
const trackClasses = cn("relative", "grow", "overflow-hidden", "rounded-full", "bg-muted", "data-horizontal:h-1", "data-horizontal:w-full", "data-vertical:h-full", "data-vertical:w-1");
|
|
37
|
+
/** Классы заполненной части дорожки */
|
|
38
|
+
const rangeClasses = cn("absolute", "bg-primary", "select-none", "data-horizontal:h-full", "data-vertical:w-full");
|
|
39
|
+
/**
|
|
40
|
+
* Классы бегунка. Белая заливка в обеих темах: bg-background в светлой, bg-foreground в тёмной
|
|
41
|
+
* (временная замена отдельному токену)
|
|
42
|
+
*/
|
|
43
|
+
const thumbClasses = cn("relative", "block", "size-3", "shrink-0", "rounded-full", "border", "border-ring", "bg-background", "dark:bg-foreground", "ring-ring/50", "transition-[color,box-shadow]", "select-none", "after:absolute", "after:-inset-2", "hover:ring-3", "focus-visible:ring-3", "focus-visible:outline-hidden", "active:ring-3", "data-disabled:pointer-events-none", "data-disabled:opacity-50");
|
|
44
|
+
/**
|
|
45
|
+
* Слайдер: выбор значения или диапазона перетаскиванием бегунка
|
|
46
|
+
* @param props - пропсы слайдера
|
|
47
|
+
* @returns слайдер с бегунками по числу значений
|
|
48
|
+
*/
|
|
49
|
+
function Slider$1({ className, defaultValue, value, min = 0, max = 100, orientation = "horizontal", thumbLabels, "aria-label": ariaLabel, onValueChange, onValueCommit, ...props }) {
|
|
50
|
+
const values = useMemo(() => {
|
|
51
|
+
if (Array.isArray(value)) return value;
|
|
52
|
+
if (Array.isArray(defaultValue)) return defaultValue;
|
|
53
|
+
return [min];
|
|
54
|
+
}, [
|
|
55
|
+
value,
|
|
56
|
+
defaultValue,
|
|
57
|
+
min
|
|
58
|
+
]);
|
|
59
|
+
const classes = cn(rootClasses, className);
|
|
60
|
+
const thumbs = [];
|
|
61
|
+
for (let index = 0; index < values.length; index++) {
|
|
62
|
+
const label = thumbLabels?.[index] ?? getThumbLabel(index, values.length, ariaLabel);
|
|
63
|
+
thumbs.push(/* @__PURE__ */ jsx(Slider.Thumb, {
|
|
64
|
+
"data-slot": "slider-thumb",
|
|
65
|
+
"aria-label": label,
|
|
66
|
+
className: thumbClasses
|
|
67
|
+
}, index));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Значение меняется: наружу всегда массив
|
|
71
|
+
* @param next - значение от Base UI: число или массив
|
|
72
|
+
*/
|
|
73
|
+
const handleValueChange = (next) => onValueChange?.(toArray(next));
|
|
74
|
+
/**
|
|
75
|
+
* Значение зафиксировано: наружу всегда массив
|
|
76
|
+
* @param next - значение от Base UI: число или массив
|
|
77
|
+
*/
|
|
78
|
+
const handleValueCommitted = (next) => onValueCommit?.(toArray(next));
|
|
79
|
+
return /* @__PURE__ */ jsx(Slider.Root, {
|
|
80
|
+
"data-slot": "slider",
|
|
81
|
+
defaultValue,
|
|
82
|
+
value,
|
|
83
|
+
min,
|
|
84
|
+
max,
|
|
85
|
+
orientation,
|
|
86
|
+
thumbAlignment: "edge",
|
|
87
|
+
"aria-label": ariaLabel,
|
|
88
|
+
className: classes,
|
|
89
|
+
onValueChange: handleValueChange,
|
|
90
|
+
onValueCommitted: handleValueCommitted,
|
|
91
|
+
...props,
|
|
92
|
+
children: /* @__PURE__ */ jsxs(Slider.Control, {
|
|
93
|
+
"data-slot": "slider-control",
|
|
94
|
+
className: controlClasses,
|
|
95
|
+
children: [/* @__PURE__ */ jsx(Slider.Track, {
|
|
96
|
+
"data-slot": "slider-track",
|
|
97
|
+
className: trackClasses,
|
|
98
|
+
children: /* @__PURE__ */ jsx(Slider.Indicator, {
|
|
99
|
+
"data-slot": "slider-range",
|
|
100
|
+
className: rangeClasses
|
|
101
|
+
})
|
|
102
|
+
}), thumbs]
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export { Slider$1 as Slider };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { Slider } from "@base-ui/react/slider";
|
|
3
|
+
/**
|
|
4
|
+
* Пропсы слайдера
|
|
5
|
+
*/
|
|
6
|
+
export type SliderPropsT = PartPropsT<Omit<Slider.Root.Props, 'value' | 'defaultValue' | 'onValueChange' | 'onValueCommitted' | 'orientation' | 'children'>> & {
|
|
7
|
+
/** Значения бегунков — контролируемый режим, вместе с onValueChange. Сколько значений, столько бегунков */
|
|
8
|
+
value?: number[];
|
|
9
|
+
/** Значения бегунков при первом рендере — неконтролируемый режим */
|
|
10
|
+
defaultValue?: number[];
|
|
11
|
+
/** Значение меняется во время перетаскивания или нажатия стрелок */
|
|
12
|
+
onValueChange?: (value: number[]) => void;
|
|
13
|
+
/** Значение зафиксировано: бегунок отпустили или нажали клавишу */
|
|
14
|
+
onValueCommit?: (value: number[]) => void;
|
|
15
|
+
/** Минимальное значение */
|
|
16
|
+
min?: number;
|
|
17
|
+
/** Максимальное значение */
|
|
18
|
+
max?: number;
|
|
19
|
+
/** Шаг изменения значения */
|
|
20
|
+
step?: number;
|
|
21
|
+
/** Шаг при Page Up / Page Down и Shift + стрелка. По умолчанию 10 */
|
|
22
|
+
largeStep?: number;
|
|
23
|
+
/** Минимальное расстояние между бегунками в шагах */
|
|
24
|
+
minStepsBetweenValues?: number;
|
|
25
|
+
/** Ориентация: горизонтальная или вертикальная */
|
|
26
|
+
orientation?: 'horizontal' | 'vertical';
|
|
27
|
+
/** Отключённое состояние: значение нельзя изменить */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Имя поля для отправки формы */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** id формы, к которой относится поле, если слайдер вне её разметки */
|
|
32
|
+
form?: string;
|
|
33
|
+
/** Бегунки при встрече: push — толкают друг друга, swap — меняются местами, none — останавливаются */
|
|
34
|
+
thumbCollisionBehavior?: 'push' | 'swap' | 'none';
|
|
35
|
+
/** Подпись слайдера для скринридера; у одиночного бегунка становится и его подписью */
|
|
36
|
+
'aria-label'?: string;
|
|
37
|
+
/** Подписи бегунков для скринридера по порядку. По умолчанию «Минимум» и «Максимум» у диапазона, «Значение 1 из 3» у трёх и более */
|
|
38
|
+
thumbLabels?: string[];
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Spinner } from "./spinner.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SpinnerPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Спиннер: индикатор загрузки. Размер задаётся классом: className={'size-6'}
|
|
4
|
+
* @param props - пропсы спиннера
|
|
5
|
+
* @returns вращающаяся иконка с role="status"
|
|
6
|
+
*/
|
|
7
|
+
export declare function Spinner({ className, 'aria-label': ariaLabel, ...props }: SpinnerPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { texts } from "../../lib/locale.js";
|
|
3
|
+
import { Loader2Icon } from "lucide-react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/spinner/spinner.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Спиннер: индикатор загрузки. Размер задаётся классом: className={'size-6'}
|
|
8
|
+
* @param props - пропсы спиннера
|
|
9
|
+
* @returns вращающаяся иконка с role="status"
|
|
10
|
+
*/
|
|
11
|
+
function Spinner({ className, "aria-label": ariaLabel = texts.loading, ...props }) {
|
|
12
|
+
const classes = cn("size-4", "animate-spin", className);
|
|
13
|
+
return /* @__PURE__ */ jsx(Loader2Icon, {
|
|
14
|
+
"data-slot": "spinner",
|
|
15
|
+
role: "status",
|
|
16
|
+
"aria-label": ariaLabel,
|
|
17
|
+
className: classes,
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export { Spinner };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StackPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Стек: элементы в столбик или в строку с отступом между ними
|
|
4
|
+
* @param props - пропсы стека
|
|
5
|
+
* @returns стек или свой элемент в стилях стека (render)
|
|
6
|
+
*/
|
|
7
|
+
export declare function Stack({ className, direction, gap, align, justify, wrap, render, ...props }: StackPropsT): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { stackVariants } from "./types.js";
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
// src/components/stack/stack.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Стек: элементы в столбик или в строку с отступом между ними
|
|
8
|
+
* @param props - пропсы стека
|
|
9
|
+
* @returns стек или свой элемент в стилях стека (render)
|
|
10
|
+
*/
|
|
11
|
+
function Stack({ className, direction = "column", gap = 2, align = "stretch", justify = "start", wrap = false, render, ...props }) {
|
|
12
|
+
const classes = cn(stackVariants({
|
|
13
|
+
direction,
|
|
14
|
+
gap,
|
|
15
|
+
align,
|
|
16
|
+
justify,
|
|
17
|
+
wrap
|
|
18
|
+
}), className);
|
|
19
|
+
return useRender({
|
|
20
|
+
defaultTagName: "div",
|
|
21
|
+
render,
|
|
22
|
+
props: mergeProps({
|
|
23
|
+
"data-slot": "stack",
|
|
24
|
+
"data-direction": direction,
|
|
25
|
+
"className": classes
|
|
26
|
+
}, props)
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { Stack };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
/**
|
|
4
|
+
* Отступы между элементами по шкале Tailwind: 4 → gap-4 (16px).
|
|
5
|
+
* Классы перечислены целиком, чтобы Tailwind потребителя их увидел.
|
|
6
|
+
*/
|
|
7
|
+
export declare const gapClasses: {
|
|
8
|
+
0: string;
|
|
9
|
+
0.5: string;
|
|
10
|
+
1: string;
|
|
11
|
+
1.5: string;
|
|
12
|
+
2: string;
|
|
13
|
+
2.5: string;
|
|
14
|
+
3: string;
|
|
15
|
+
4: string;
|
|
16
|
+
5: string;
|
|
17
|
+
6: string;
|
|
18
|
+
8: string;
|
|
19
|
+
10: string;
|
|
20
|
+
12: string;
|
|
21
|
+
16: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Стили стека: направление, отступ, выравнивание и перенос.
|
|
25
|
+
* Экспортируются, чтобы разложить стеком другой элемент: stackVariants({ direction: 'row' }).
|
|
26
|
+
*/
|
|
27
|
+
export declare const stackVariants: (props?: ({
|
|
28
|
+
direction?: "row" | "column" | null | undefined;
|
|
29
|
+
gap?: 0 | 1 | 2 | 0.5 | 1.5 | 2.5 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
30
|
+
align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
|
|
31
|
+
justify?: "center" | "start" | "end" | "between" | "around" | "evenly" | null | undefined;
|
|
32
|
+
wrap?: boolean | null | undefined;
|
|
33
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Направление, отступ, выравнивание и перенос стека
|
|
36
|
+
*/
|
|
37
|
+
export type StackVariantsT = VariantProps<typeof stackVariants>;
|
|
38
|
+
/**
|
|
39
|
+
* Отступ между элементами по шкале Tailwind
|
|
40
|
+
*/
|
|
41
|
+
export type GapT = keyof typeof gapClasses;
|
|
42
|
+
/**
|
|
43
|
+
* Пропсы стека
|
|
44
|
+
*/
|
|
45
|
+
export type StackPropsT = useRender.ComponentProps<'div'> & {
|
|
46
|
+
/** Направление: column — сверху вниз, row — слева направо */
|
|
47
|
+
direction?: StackVariantsT['direction'];
|
|
48
|
+
/** Отступ между элементами по шкале Tailwind: 4 → 16px. По умолчанию 2 (8px) */
|
|
49
|
+
gap?: GapT;
|
|
50
|
+
/** Выравнивание поперёк направления: по началу, центру, концу, растянуть или по базовой линии текста */
|
|
51
|
+
align?: StackVariantsT['align'];
|
|
52
|
+
/** Распределение вдоль направления: по началу, центру, концу или с равными промежутками */
|
|
53
|
+
justify?: StackVariantsT['justify'];
|
|
54
|
+
/** Переносить элементы на новую строку, если не помещаются */
|
|
55
|
+
wrap?: boolean;
|
|
56
|
+
};
|