@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,80 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Изображение галереи
|
|
4
|
+
* @property src - адрес изображения
|
|
5
|
+
* @property alt - описание для скринридера
|
|
6
|
+
* @property width - исходная ширина, по ней считаются пропорции плитки
|
|
7
|
+
* @property height - исходная высота, по ней считаются пропорции плитки
|
|
8
|
+
*/
|
|
9
|
+
export interface ImageGalleryImageI {
|
|
10
|
+
src: string;
|
|
11
|
+
alt: string;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Число колонок на разной ширине галереи
|
|
17
|
+
* @property desktop - от 768px, по умолчанию 3
|
|
18
|
+
* @property tablet - от 480px до 768px, по умолчанию 2
|
|
19
|
+
* @property mobile - уже 480px, по умолчанию 1
|
|
20
|
+
*/
|
|
21
|
+
export interface ImageGalleryColumnsI {
|
|
22
|
+
desktop?: number;
|
|
23
|
+
tablet?: number;
|
|
24
|
+
mobile?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Пропсы галереи
|
|
28
|
+
*/
|
|
29
|
+
export type ImageGalleryPropsT = Omit<ComponentProps<'div'>, 'children'> & {
|
|
30
|
+
/** Изображения галереи */
|
|
31
|
+
images: ImageGalleryImageI[];
|
|
32
|
+
/** Промежуток между изображениями, px. По умолчанию 16 */
|
|
33
|
+
gap?: number;
|
|
34
|
+
/** Число колонок для узкой, средней и широкой галереи. По умолчанию 1, 2 и 3 */
|
|
35
|
+
columns?: ImageGalleryColumnsI;
|
|
36
|
+
/** Загружать изображения, только когда они приближаются к видимой области. По умолчанию включено */
|
|
37
|
+
lazyLoading?: boolean;
|
|
38
|
+
/** Показывать только подходящие изображения */
|
|
39
|
+
filterImages?: (image: ImageGalleryImageI, index: number) => boolean;
|
|
40
|
+
/** Порядок изображений */
|
|
41
|
+
sortImages?: (first: ImageGalleryImageI, second: ImageGalleryImageI) => number;
|
|
42
|
+
/** Нажатие на изображение в сетке */
|
|
43
|
+
onImageClick?: (image: ImageGalleryImageI, index: number) => void;
|
|
44
|
+
/** Подпись кнопки открытия изображения для скринридера, по умолчанию «Открыть изображение» */
|
|
45
|
+
openLabel?: string;
|
|
46
|
+
/** Подпись закрытия просмотра для скринридера, по умолчанию «Закрыть» */
|
|
47
|
+
closeLabel?: string;
|
|
48
|
+
/** Классы плитки изображения */
|
|
49
|
+
itemClassName?: string;
|
|
50
|
+
/** Классы увеличенного изображения */
|
|
51
|
+
viewerClassName?: string;
|
|
52
|
+
/** Классы затемнения под увеличенным изображением */
|
|
53
|
+
backdropClassName?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Изображение с позицией и размером в сетке
|
|
57
|
+
* @property image - исходное изображение
|
|
58
|
+
* @property index - номер изображения в переданном списке
|
|
59
|
+
* @property x - отступ слева, px
|
|
60
|
+
* @property y - отступ сверху, px
|
|
61
|
+
* @property width - ширина плитки, px
|
|
62
|
+
* @property height - высота плитки, px
|
|
63
|
+
*/
|
|
64
|
+
export interface MasonryItemI {
|
|
65
|
+
image: ImageGalleryImageI;
|
|
66
|
+
index: number;
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Раскладка сетки
|
|
74
|
+
* @property items - плитки с позициями
|
|
75
|
+
* @property height - общая высота сетки, px
|
|
76
|
+
*/
|
|
77
|
+
export interface MasonryLayoutI {
|
|
78
|
+
items: MasonryItemI[];
|
|
79
|
+
height: number;
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input } from "./input.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/components/input/input.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Однострочное поле ввода
|
|
6
|
+
* @param props - пропсы поля
|
|
7
|
+
* @returns элемент input
|
|
8
|
+
*/
|
|
9
|
+
function Input({ className, type, ...props }) {
|
|
10
|
+
const classes = cn("h-8", "w-full", "min-w-0", "rounded-lg", "border", "border-input", "bg-transparent", "px-2.5", "py-1", "text-base", "transition-colors", "outline-none", "file:inline-flex", "file:h-6", "file:border-0", "file:bg-transparent", "file:text-sm", "file:font-medium", "file:text-foreground", "placeholder:text-muted-foreground", "focus-visible:border-ring", "focus-visible:ring-3", "focus-visible:ring-ring/50", "disabled:cursor-not-allowed", "disabled:bg-input/50", "disabled:opacity-50", "aria-invalid:border-destructive", "aria-invalid:ring-3", "aria-invalid:ring-destructive/20", "md:text-sm", "dark:bg-input/30", "dark:disabled:bg-input/80", "dark:aria-invalid:border-destructive/50", "dark:aria-invalid:ring-destructive/40", className);
|
|
11
|
+
return /* @__PURE__ */ jsx("input", {
|
|
12
|
+
type,
|
|
13
|
+
"data-slot": "input",
|
|
14
|
+
className: classes,
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { Input };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChangeEvent, ComponentProps } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Тип поля ввода: все значения атрибута type у input
|
|
4
|
+
*/
|
|
5
|
+
export type InputTypeT = 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url' | 'file' | 'date' | 'datetime-local' | 'month' | 'week' | 'time' | 'color' | 'range' | 'checkbox' | 'radio' | 'hidden' | 'button' | 'submit' | 'reset' | 'image';
|
|
6
|
+
/**
|
|
7
|
+
* Пропсы поля ввода
|
|
8
|
+
*/
|
|
9
|
+
export type InputPropsT = Omit<ComponentProps<'input'>, 'type' | 'value' | 'defaultValue' | 'placeholder' | 'disabled' | 'readOnly' | 'required' | 'aria-invalid' | 'onChange'> & {
|
|
10
|
+
/** Тип поля: text, email, password, number, search, tel, url, file и другие */
|
|
11
|
+
type?: InputTypeT;
|
|
12
|
+
/** Значение поля — контролируемый режим, вместе с onChange */
|
|
13
|
+
value?: string | number;
|
|
14
|
+
/** Значение при первом рендере — неконтролируемый режим */
|
|
15
|
+
defaultValue?: string | number;
|
|
16
|
+
/** Подсказка о формате, пока поле пустое */
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Отключённое состояние: поле нельзя изменить и выделить, оно не отправляется с формой */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Только для чтения: значение видно и выделяется, но не меняется */
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
/** Обязательное поле: форма не отправится, пока оно пустое */
|
|
23
|
+
required?: boolean;
|
|
24
|
+
/** Ошибка: красная рамка и объявление скринридеру, что значение неверное */
|
|
25
|
+
'aria-invalid'?: boolean;
|
|
26
|
+
/** Значение изменилось */
|
|
27
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputGroupAddonPropsT, InputGroupAlignT, InputGroupButtonPropsT, InputGroupButtonSizeT, InputGroupInputPropsT, InputGroupPropsT, InputGroupTextPropsT, InputGroupTextareaPropsT, inputGroupAddonVariants, inputGroupButtonVariants } from "./types.js";
|
|
2
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea } from "./input-group.js";
|
|
3
|
+
export { InputGroup, InputGroupAddon, type InputGroupAddonPropsT, type InputGroupAlignT, InputGroupButton, type InputGroupButtonPropsT, type InputGroupButtonSizeT, InputGroupInput, type InputGroupInputPropsT, type InputGroupPropsT, InputGroupText, type InputGroupTextPropsT, InputGroupTextarea, type InputGroupTextareaPropsT, inputGroupAddonVariants, inputGroupButtonVariants };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { inputGroupAddonVariants, inputGroupButtonVariants } from "./types.js";
|
|
2
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea } from "./input-group.js";
|
|
3
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { InputGroupAddonPropsT, InputGroupButtonPropsT, InputGroupInputPropsT, InputGroupPropsT, InputGroupTextPropsT, InputGroupTextareaPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Группа поля: поле ввода с иконками, текстом и кнопками внутри общей рамки
|
|
4
|
+
* @param props - пропсы группы
|
|
5
|
+
* @returns div с role="group"
|
|
6
|
+
*/
|
|
7
|
+
export declare function InputGroup({ className, ...props }: InputGroupPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Дополнение: иконка, текст или кнопки внутри рамки. Нажатие ставит фокус в поле
|
|
10
|
+
* @param props - пропсы дополнения
|
|
11
|
+
* @returns div с role="group"
|
|
12
|
+
*/
|
|
13
|
+
export declare function InputGroupAddon({ className, align, onClick, ...props }: InputGroupAddonPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Кнопка в группе: компактная, по умолчанию ghost
|
|
16
|
+
* @param props - пропсы кнопки; по умолчанию type="button", variant="ghost", size="xs"
|
|
17
|
+
* @returns кнопка
|
|
18
|
+
*/
|
|
19
|
+
export declare function InputGroupButton({ className, type, variant, size, ...props }: InputGroupButtonPropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Текст в группе: префикс или суффикс поля (₽, https://, @example.ru)
|
|
22
|
+
* @param props - пропсы текста
|
|
23
|
+
* @returns span
|
|
24
|
+
*/
|
|
25
|
+
export declare function InputGroupText({ className, ...props }: InputGroupTextPropsT): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Поле в группе: Input без своей рамки, рамку рисует группа
|
|
28
|
+
* @param props - пропсы поля
|
|
29
|
+
* @returns input
|
|
30
|
+
*/
|
|
31
|
+
export declare function InputGroupInput({ className, ...props }: InputGroupInputPropsT): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Многострочное поле в группе: Textarea без своей рамки
|
|
34
|
+
* @param props - пропсы поля
|
|
35
|
+
* @returns textarea
|
|
36
|
+
*/
|
|
37
|
+
export declare function InputGroupTextarea({ className, ...props }: InputGroupTextareaPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
|
+
import { Input } from "../input/input.js";
|
|
5
|
+
import { Textarea } from "../textarea/textarea.js";
|
|
6
|
+
import { inputGroupAddonVariants, inputGroupButtonVariants } from "./types.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
// src/components/input-group/input-group.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Группа поля: поле ввода с иконками, текстом и кнопками внутри общей рамки
|
|
11
|
+
* @param props - пропсы группы
|
|
12
|
+
* @returns div с role="group"
|
|
13
|
+
*/
|
|
14
|
+
function InputGroup({ className, ...props }) {
|
|
15
|
+
const classes = cn("group/input-group", "relative", "flex", "h-8", "w-full", "min-w-0", "items-center", "rounded-lg", "border", "border-input", "transition-colors", "outline-none", "has-[>textarea]:h-auto", "dark:bg-input/30", "keyboard:has-[[data-slot=input-group-control]:focus-visible]:border-ring", "keyboard:has-[[data-slot=input-group-control]:focus-visible]:ring-3", "keyboard:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive", "has-[[data-slot][aria-invalid=true]]:ring-3", "has-[[data-slot][aria-invalid=true]]:ring-destructive/20", "dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", "has-[[data-slot=input-group-control]:disabled]:bg-input/50", "has-[[data-slot=input-group-control]:disabled]:opacity-50", "dark:has-[[data-slot=input-group-control]:disabled]:bg-input/80", "keyboard:in-data-[slot=combobox-content]:focus-within:border-inherit", "keyboard:in-data-[slot=combobox-content]:focus-within:ring-0", "has-[>[data-align=block-end]]:h-auto", "has-[>[data-align=block-end]]:flex-col", "has-[>[data-align=block-start]]:h-auto", "has-[>[data-align=block-start]]:flex-col", "has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=inline-end]]:[&>input]:pr-1.5", "has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className);
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
"data-slot": "input-group",
|
|
18
|
+
role: "group",
|
|
19
|
+
className: classes,
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Дополнение: иконка, текст или кнопки внутри рамки. Нажатие ставит фокус в поле
|
|
25
|
+
* @param props - пропсы дополнения
|
|
26
|
+
* @returns div с role="group"
|
|
27
|
+
*/
|
|
28
|
+
function InputGroupAddon({ className, align = "inline-start", onClick, ...props }) {
|
|
29
|
+
const classes = cn(inputGroupAddonVariants({ align }), className);
|
|
30
|
+
/**
|
|
31
|
+
* Нажатие мимо кнопок ставит фокус в поле группы
|
|
32
|
+
* @param event - событие нажатия
|
|
33
|
+
*/
|
|
34
|
+
const focusInput = (event) => {
|
|
35
|
+
onClick?.(event);
|
|
36
|
+
const target = event.target;
|
|
37
|
+
if (event.defaultPrevented || target.closest("button")) return;
|
|
38
|
+
event.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ jsx("div", {
|
|
41
|
+
role: "group",
|
|
42
|
+
"data-slot": "input-group-addon",
|
|
43
|
+
"data-align": align,
|
|
44
|
+
className: classes,
|
|
45
|
+
onClick: focusInput,
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Кнопка в группе: компактная, по умолчанию ghost
|
|
51
|
+
* @param props - пропсы кнопки; по умолчанию type="button", variant="ghost", size="xs"
|
|
52
|
+
* @returns кнопка
|
|
53
|
+
*/
|
|
54
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
55
|
+
const classes = cn(inputGroupButtonVariants({ size }), className);
|
|
56
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
57
|
+
type,
|
|
58
|
+
"data-size": size,
|
|
59
|
+
variant,
|
|
60
|
+
className: classes,
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Текст в группе: префикс или суффикс поля (₽, https://, @example.ru)
|
|
66
|
+
* @param props - пропсы текста
|
|
67
|
+
* @returns span
|
|
68
|
+
*/
|
|
69
|
+
function InputGroupText({ className, ...props }) {
|
|
70
|
+
const classes = cn("flex", "items-center", "gap-2", "text-sm", "text-muted-foreground", "[&_svg]:pointer-events-none", "[&_svg:not([class*=size-])]:size-4", className);
|
|
71
|
+
return /* @__PURE__ */ jsx("span", {
|
|
72
|
+
"data-slot": "input-group-text",
|
|
73
|
+
className: classes,
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Поле в группе: Input без своей рамки, рамку рисует группа
|
|
79
|
+
* @param props - пропсы поля
|
|
80
|
+
* @returns input
|
|
81
|
+
*/
|
|
82
|
+
function InputGroupInput({ className, ...props }) {
|
|
83
|
+
const classes = cn("flex-1", "rounded-none", "border-0", "bg-transparent", "shadow-none", "ring-0", "focus-visible:ring-0", "disabled:bg-transparent", "aria-invalid:ring-0", "dark:bg-transparent", "dark:disabled:bg-transparent", className);
|
|
84
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
85
|
+
"data-slot": "input-group-control",
|
|
86
|
+
className: classes,
|
|
87
|
+
...props
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Многострочное поле в группе: Textarea без своей рамки
|
|
92
|
+
* @param props - пропсы поля
|
|
93
|
+
* @returns textarea
|
|
94
|
+
*/
|
|
95
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
96
|
+
const classes = cn("flex-1", "resize-none", "rounded-none", "border-0", "bg-transparent", "py-2", "shadow-none", "ring-0", "focus-visible:ring-0", "disabled:bg-transparent", "aria-invalid:ring-0", "dark:bg-transparent", "dark:disabled:bg-transparent", className);
|
|
97
|
+
return /* @__PURE__ */ jsx(Textarea, {
|
|
98
|
+
"data-slot": "input-group-control",
|
|
99
|
+
className: classes,
|
|
100
|
+
...props
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ButtonPropsT } from "../button/types.js";
|
|
2
|
+
import { InputPropsT } from "../input/types.js";
|
|
3
|
+
import { TextareaPropsT } from "../textarea/types.js";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
import { ComponentProps } from "react";
|
|
6
|
+
/**
|
|
7
|
+
* Пропсы группы поля
|
|
8
|
+
*/
|
|
9
|
+
export type InputGroupPropsT = ComponentProps<'div'>;
|
|
10
|
+
/**
|
|
11
|
+
* Стили дополнения: где оно стоит относительно поля
|
|
12
|
+
*/
|
|
13
|
+
export declare const inputGroupAddonVariants: (props?: ({
|
|
14
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Варианты стилей дополнения
|
|
18
|
+
*/
|
|
19
|
+
type InputGroupAddonVariantsT = VariantProps<typeof inputGroupAddonVariants>;
|
|
20
|
+
/**
|
|
21
|
+
* Положение дополнения: inline — слева или справа в строке, block — сверху или снизу
|
|
22
|
+
*/
|
|
23
|
+
export type InputGroupAlignT = NonNullable<InputGroupAddonVariantsT['align']>;
|
|
24
|
+
/**
|
|
25
|
+
* Пропсы дополнения
|
|
26
|
+
*/
|
|
27
|
+
export type InputGroupAddonPropsT = ComponentProps<'div'> & {
|
|
28
|
+
/** Положение: inline-start — слева, inline-end — справа, block-start — сверху, block-end — снизу */
|
|
29
|
+
align?: InputGroupAlignT;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Стили кнопки в группе: размер
|
|
33
|
+
*/
|
|
34
|
+
export declare const inputGroupButtonVariants: (props?: ({
|
|
35
|
+
size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
|
|
36
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Варианты стилей кнопки в группе
|
|
39
|
+
*/
|
|
40
|
+
type InputGroupButtonVariantsT = VariantProps<typeof inputGroupButtonVariants>;
|
|
41
|
+
/**
|
|
42
|
+
* Размер кнопки в группе
|
|
43
|
+
*/
|
|
44
|
+
export type InputGroupButtonSizeT = NonNullable<InputGroupButtonVariantsT['size']>;
|
|
45
|
+
/**
|
|
46
|
+
* Пропсы кнопки в группе
|
|
47
|
+
*/
|
|
48
|
+
export type InputGroupButtonPropsT = Omit<ButtonPropsT, 'size'> & {
|
|
49
|
+
/** Размер: xs и sm — с текстом, icon-xs и icon-sm — только иконка */
|
|
50
|
+
size?: InputGroupButtonSizeT;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Пропсы текста в группе
|
|
54
|
+
*/
|
|
55
|
+
export type InputGroupTextPropsT = ComponentProps<'span'>;
|
|
56
|
+
/**
|
|
57
|
+
* Пропсы поля в группе
|
|
58
|
+
*/
|
|
59
|
+
export type InputGroupInputPropsT = InputPropsT;
|
|
60
|
+
/**
|
|
61
|
+
* Пропсы многострочного поля в группе
|
|
62
|
+
*/
|
|
63
|
+
export type InputGroupTextareaPropsT = TextareaPropsT;
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/input-group/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Стили дополнения: где оно стоит относительно поля
|
|
5
|
+
*/
|
|
6
|
+
const inputGroupAddonVariants = cva([
|
|
7
|
+
"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none",
|
|
8
|
+
"group-data-[disabled=true]/input-group:opacity-50",
|
|
9
|
+
"[&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*=size-])]:size-4"
|
|
10
|
+
], {
|
|
11
|
+
variants: { align: {
|
|
12
|
+
"inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
|
13
|
+
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
14
|
+
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
15
|
+
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
16
|
+
} },
|
|
17
|
+
defaultVariants: { align: "inline-start" }
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Стили кнопки в группе: размер
|
|
21
|
+
*/
|
|
22
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
23
|
+
variants: { size: {
|
|
24
|
+
"xs": "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*=size-])]:size-3.5",
|
|
25
|
+
"sm": "",
|
|
26
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
|
27
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
28
|
+
} },
|
|
29
|
+
defaultVariants: { size: "xs" }
|
|
30
|
+
});
|
|
31
|
+
export { inputGroupAddonVariants, inputGroupButtonVariants };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputOTPGroupPropsT, InputOTPPropsT, InputOTPSeparatorPropsT, InputOTPSlotPropsT, InputOTPValidationT } from "./types.js";
|
|
2
|
+
import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "./input-otp.js";
|
|
3
|
+
export { InputOTP, InputOTPGroup, type InputOTPGroupPropsT, type InputOTPPropsT, InputOTPSeparator, type InputOTPSeparatorPropsT, InputOTPSlot, type InputOTPSlotPropsT, type InputOTPValidationT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "./input-otp.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { InputOTPGroupPropsT, InputOTPPropsT, InputOTPSeparatorPropsT, InputOTPSlotPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Поле одноразового кода: ячейки по символу, вставка кода целиком, автозаполнение из СМС
|
|
4
|
+
* @param props - пропсы поля; maxLength — длина кода, дочерние InputOTPGroup и InputOTPSlot — ячейки
|
|
5
|
+
* @returns поле
|
|
6
|
+
*/
|
|
7
|
+
export declare function InputOTP({ className, maxLength, validationType, onValueChange, onComplete, ...props }: InputOTPPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Группа ячеек: ячейки стоят вплотную с общей рамкой
|
|
10
|
+
* @param props - пропсы группы
|
|
11
|
+
* @returns div
|
|
12
|
+
*/
|
|
13
|
+
export declare function InputOTPGroup({ className, ...props }: InputOTPGroupPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Ячейка: поле для одного символа кода, активная подсвечена рамкой
|
|
16
|
+
* @param props - пропсы ячейки
|
|
17
|
+
* @returns input
|
|
18
|
+
*/
|
|
19
|
+
export declare function InputOTPSlot({ index, className, ...props }: InputOTPSlotPropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Разделитель между группами ячеек: короткая черта
|
|
22
|
+
* @param props - пропсы разделителя
|
|
23
|
+
* @returns div с role="separator"
|
|
24
|
+
*/
|
|
25
|
+
export declare function InputOTPSeparator(props: InputOTPSeparatorPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { MinusIcon } from "lucide-react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { OTPField } from "@base-ui/react/otp-field";
|
|
6
|
+
// src/components/input-otp/input-otp.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Поле одноразового кода: ячейки по символу, вставка кода целиком, автозаполнение из СМС
|
|
9
|
+
* @param props - пропсы поля; maxLength — длина кода, дочерние InputOTPGroup и InputOTPSlot — ячейки
|
|
10
|
+
* @returns поле
|
|
11
|
+
*/
|
|
12
|
+
function InputOTP({ className, maxLength, validationType = "numeric", onValueChange, onComplete, ...props }) {
|
|
13
|
+
const classes = cn("flex", "items-center", "gap-2", "has-disabled:opacity-50", className);
|
|
14
|
+
/**
|
|
15
|
+
* Код изменился: наружу только значение
|
|
16
|
+
* @param value - код
|
|
17
|
+
*/
|
|
18
|
+
const handleValueChange = (value) => onValueChange?.(value);
|
|
19
|
+
/**
|
|
20
|
+
* Код введён целиком: наружу только значение
|
|
21
|
+
* @param value - код
|
|
22
|
+
*/
|
|
23
|
+
const handleValueComplete = (value) => onComplete?.(value);
|
|
24
|
+
return /* @__PURE__ */ jsx(OTPField.Root, {
|
|
25
|
+
"data-slot": "input-otp",
|
|
26
|
+
length: maxLength,
|
|
27
|
+
validationType,
|
|
28
|
+
autoComplete: "one-time-code",
|
|
29
|
+
className: classes,
|
|
30
|
+
onValueChange: handleValueChange,
|
|
31
|
+
onValueComplete: handleValueComplete,
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Группа ячеек: ячейки стоят вплотную с общей рамкой
|
|
37
|
+
* @param props - пропсы группы
|
|
38
|
+
* @returns div
|
|
39
|
+
*/
|
|
40
|
+
function InputOTPGroup({ className, ...props }) {
|
|
41
|
+
const classes = cn("flex", "items-center", "rounded-lg", "has-aria-invalid:border-destructive", "has-aria-invalid:ring-3", "has-aria-invalid:ring-destructive/20", "dark:has-aria-invalid:ring-destructive/40", className);
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
"data-slot": "input-otp-group",
|
|
44
|
+
className: classes,
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Ячейка: поле для одного символа кода, активная подсвечена рамкой
|
|
50
|
+
* @param props - пропсы ячейки
|
|
51
|
+
* @returns input
|
|
52
|
+
*/
|
|
53
|
+
function InputOTPSlot({ index, className, ...props }) {
|
|
54
|
+
const classes = cn("relative", "flex", "size-8", "items-center", "justify-center", "border-y", "border-r", "border-input", "bg-transparent", "text-center", "text-sm", "caret-foreground", "transition-all", "outline-none", "first:rounded-l-lg", "first:border-l", "last:rounded-r-lg", "dark:bg-input/30", "focus:z-10", "focus-visible:border-ring", "focus-visible:ring-3", "focus-visible:ring-ring/50", "aria-invalid:border-destructive", "focus-visible:aria-invalid:border-destructive", "focus-visible:aria-invalid:ring-destructive/20", "dark:focus-visible:aria-invalid:ring-destructive/40", "disabled:cursor-not-allowed", className);
|
|
55
|
+
return /* @__PURE__ */ jsx(OTPField.Input, {
|
|
56
|
+
"data-slot": "input-otp-slot",
|
|
57
|
+
"data-index": index,
|
|
58
|
+
className: classes,
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Разделитель между группами ячеек: короткая черта
|
|
64
|
+
* @param props - пропсы разделителя
|
|
65
|
+
* @returns div с role="separator"
|
|
66
|
+
*/
|
|
67
|
+
function InputOTPSeparator(props) {
|
|
68
|
+
return /* @__PURE__ */ jsx("div", {
|
|
69
|
+
"data-slot": "input-otp-separator",
|
|
70
|
+
role: "separator",
|
|
71
|
+
className: "flex items-center [&_svg:not([class*=size-])]:size-4",
|
|
72
|
+
...props,
|
|
73
|
+
children: /* @__PURE__ */ jsx(MinusIcon, {})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { OTPField } from "@base-ui/react/otp-field";
|
|
4
|
+
/**
|
|
5
|
+
* Какие символы можно вводить: numeric — цифры, alpha — буквы, alphanumeric — цифры и буквы, none — любые
|
|
6
|
+
*/
|
|
7
|
+
export type InputOTPValidationT = 'numeric' | 'alpha' | 'alphanumeric' | 'none';
|
|
8
|
+
/**
|
|
9
|
+
* Пропсы поля одноразового кода
|
|
10
|
+
*/
|
|
11
|
+
export type InputOTPPropsT = PartPropsT<Omit<OTPField.Root.Props, 'length' | 'onValueChange' | 'onValueComplete'>> & {
|
|
12
|
+
/** Длина кода: сколько ячеек */
|
|
13
|
+
maxLength: number;
|
|
14
|
+
/** Какие символы можно вводить. По умолчанию numeric — только цифры */
|
|
15
|
+
validationType?: InputOTPValidationT;
|
|
16
|
+
/** Код — контролируемый режим, вместе с onValueChange */
|
|
17
|
+
value?: string;
|
|
18
|
+
/** Код при первом рендере — неконтролируемый режим */
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
/** Код изменился */
|
|
21
|
+
onValueChange?: (value: string) => void;
|
|
22
|
+
/** Код введён целиком */
|
|
23
|
+
onComplete?: (value: string) => void;
|
|
24
|
+
/** Отключить поле */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Скрыть символы точками, как пароль */
|
|
27
|
+
mask?: boolean;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Пропсы группы ячеек
|
|
31
|
+
*/
|
|
32
|
+
export type InputOTPGroupPropsT = ComponentProps<'div'>;
|
|
33
|
+
/**
|
|
34
|
+
* Пропсы ячейки
|
|
35
|
+
*/
|
|
36
|
+
export type InputOTPSlotPropsT = PartPropsT<OTPField.Input.Props> & {
|
|
37
|
+
/** Номер символа в коде, с нуля. Ячейки нумеруются по порядку сами, проп оставлен для читаемости разметки */
|
|
38
|
+
index?: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Пропсы разделителя
|
|
42
|
+
*/
|
|
43
|
+
export type InputOTPSeparatorPropsT = ComponentProps<'div'>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ItemActionsPropsT, ItemContentPropsT, ItemDescriptionPropsT, ItemFooterPropsT, ItemGroupPropsT, ItemHeaderPropsT, ItemMediaPropsT, ItemPropsT, ItemSeparatorPropsT, ItemTitlePropsT, itemMediaVariants, itemVariants } from "./types.js";
|
|
2
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle } from "./item.js";
|
|
3
|
+
export { Item, ItemActions, type ItemActionsPropsT, ItemContent, type ItemContentPropsT, ItemDescription, type ItemDescriptionPropsT, ItemFooter, type ItemFooterPropsT, ItemGroup, type ItemGroupPropsT, ItemHeader, type ItemHeaderPropsT, ItemMedia, type ItemMediaPropsT, type ItemPropsT, ItemSeparator, type ItemSeparatorPropsT, ItemTitle, type ItemTitlePropsT, itemMediaVariants, itemVariants };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { itemMediaVariants, itemVariants } from "./types.js";
|
|
2
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle } from "./item.js";
|
|
3
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, itemMediaVariants, itemVariants };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ItemActionsPropsT, ItemContentPropsT, ItemDescriptionPropsT, ItemFooterPropsT, ItemGroupPropsT, ItemHeaderPropsT, ItemMediaPropsT, ItemPropsT, ItemSeparatorPropsT, ItemTitlePropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Группа элементов: список с role="list"
|
|
4
|
+
* @param props - пропсы группы
|
|
5
|
+
* @returns список элементов
|
|
6
|
+
*/
|
|
7
|
+
export declare function ItemGroup({ className, ...props }: ItemGroupPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Разделитель между элементами группы
|
|
10
|
+
* @param props - пропсы разделителя
|
|
11
|
+
* @returns горизонтальная линия
|
|
12
|
+
*/
|
|
13
|
+
export declare function ItemSeparator({ className, ...props }: ItemSeparatorPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Элемент: строка списка с медиа, заголовком, описанием и действиями
|
|
16
|
+
* @param props - пропсы элемента
|
|
17
|
+
* @returns элемент или дочерний элемент в его стилях (render)
|
|
18
|
+
*/
|
|
19
|
+
export declare function Item({ className, variant, size, render, ...props }: ItemPropsT): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
20
|
+
/**
|
|
21
|
+
* Медиа элемента: иконка, аватар или изображение слева
|
|
22
|
+
* @param props - пропсы медиа
|
|
23
|
+
* @returns блок медиа
|
|
24
|
+
*/
|
|
25
|
+
export declare function ItemMedia({ className, variant, ...props }: ItemMediaPropsT): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Содержимое элемента: заголовок и описание
|
|
28
|
+
* @param props - пропсы содержимого
|
|
29
|
+
* @returns колонка содержимого
|
|
30
|
+
*/
|
|
31
|
+
export declare function ItemContent({ className, ...props }: ItemContentPropsT): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Заголовок элемента: одна строка
|
|
34
|
+
* @param props - пропсы заголовка
|
|
35
|
+
* @returns заголовок
|
|
36
|
+
*/
|
|
37
|
+
export declare function ItemTitle({ className, ...props }: ItemTitlePropsT): import("react").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* Описание элемента: до двух строк приглушённым текстом
|
|
40
|
+
* @param props - пропсы описания
|
|
41
|
+
* @returns описание
|
|
42
|
+
*/
|
|
43
|
+
export declare function ItemDescription({ className, ...props }: ItemDescriptionPropsT): import("react").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Действия элемента: кнопки, иконка перехода справа
|
|
46
|
+
* @param props - пропсы действий
|
|
47
|
+
* @returns блок действий
|
|
48
|
+
*/
|
|
49
|
+
export declare function ItemActions({ className, ...props }: ItemActionsPropsT): import("react").JSX.Element;
|
|
50
|
+
/**
|
|
51
|
+
* Шапка элемента: строка во всю ширину над содержимым
|
|
52
|
+
* @param props - пропсы шапки
|
|
53
|
+
* @returns шапка
|
|
54
|
+
*/
|
|
55
|
+
export declare function ItemHeader({ className, ...props }: ItemHeaderPropsT): import("react").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* Подвал элемента: строка во всю ширину под содержимым
|
|
58
|
+
* @param props - пропсы подвала
|
|
59
|
+
* @returns подвал
|
|
60
|
+
*/
|
|
61
|
+
export declare function ItemFooter({ className, ...props }: ItemFooterPropsT): import("react").JSX.Element;
|