@archytechtor/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +105 -2
- package/dist/components/accordion/accordion.d.ts +25 -0
- package/dist/components/accordion/accordion.js +88 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/types.d.ts +39 -0
- package/dist/components/alert/alert.d.ts +25 -0
- package/dist/components/alert/alert.js +59 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/alert/index.js +3 -0
- package/dist/components/alert/types.d.ts +32 -0
- package/dist/components/alert/types.js +19 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +73 -0
- package/dist/components/alert-dialog/alert-dialog.js +170 -0
- package/dist/components/alert-dialog/index.d.ts +3 -0
- package/dist/components/alert-dialog/index.js +1 -0
- package/dist/components/alert-dialog/types.d.ts +80 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +8 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +20 -0
- package/dist/components/aspect-ratio/index.d.ts +3 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/aspect-ratio/types.d.ts +8 -0
- package/dist/components/attachment/attachment.d.ts +57 -0
- package/dist/components/attachment/attachment.js +139 -0
- package/dist/components/attachment/index.d.ts +3 -0
- package/dist/components/attachment/index.js +3 -0
- package/dist/components/attachment/types.d.ts +79 -0
- package/dist/components/attachment/types.js +43 -0
- package/dist/components/avatar/avatar.d.ts +39 -0
- package/dist/components/avatar/avatar.js +88 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/avatar/index.js +3 -0
- package/dist/components/avatar/types.d.ts +54 -0
- package/dist/components/avatar/types.js +21 -0
- package/dist/components/badge/badge.d.ts +7 -0
- package/dist/components/badge/badge.js +23 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.js +3 -0
- package/dist/components/badge/types.d.ts +21 -0
- package/dist/components/badge/types.js +26 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +43 -0
- package/dist/components/breadcrumb/breadcrumb.js +115 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/breadcrumb/types.d.ts +36 -0
- package/dist/components/bubble/bubble.d.ts +25 -0
- package/dist/components/bubble/bubble.js +69 -0
- package/dist/components/bubble/index.d.ts +3 -0
- package/dist/components/bubble/index.js +3 -0
- package/dist/components/bubble/types.d.ts +51 -0
- package/dist/components/bubble/types.js +60 -0
- package/dist/components/button/button.d.ts +7 -0
- package/dist/components/button/button.js +155 -0
- package/dist/components/button/index.d.ts +4 -0
- package/dist/components/button/index.js +4 -0
- package/dist/components/button/types.d.ts +80 -0
- package/dist/components/button/types.js +99 -0
- package/dist/components/button/use-hold-to-confirm.d.ts +25 -0
- package/dist/components/button/use-hold-to-confirm.js +161 -0
- package/dist/components/button-group/button-group.d.ts +20 -0
- package/dist/components/button-group/button-group.js +62 -0
- package/dist/components/button-group/index.d.ts +3 -0
- package/dist/components/button-group/index.js +3 -0
- package/dist/components/button-group/types.d.ts +30 -0
- package/dist/components/button-group/types.js +19 -0
- package/dist/components/calendar/calendar.d.ts +15 -0
- package/dist/components/calendar/calendar.js +157 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/calendar/types.d.ts +21 -0
- package/dist/components/card/card.d.ts +43 -0
- package/dist/components/card/card.js +97 -0
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/card/index.js +3 -0
- package/dist/components/card/types.d.ts +44 -0
- package/dist/components/card/types.js +19 -0
- package/dist/components/carousel/carousel.d.ts +36 -0
- package/dist/components/carousel/carousel.js +190 -0
- package/dist/components/carousel/index.d.ts +3 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/carousel/types.d.ts +79 -0
- package/dist/components/chart/chart.d.ts +35 -0
- package/dist/components/chart/chart.js +212 -0
- package/dist/components/chart/index.d.ts +3 -0
- package/dist/components/chart/index.js +1 -0
- package/dist/components/chart/types.d.ts +89 -0
- package/dist/components/chart/types.js +7 -0
- package/dist/components/checkbox/checkbox.d.ts +7 -0
- package/dist/components/checkbox/checkbox.js +31 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox/types.d.ts +25 -0
- package/dist/components/code-block/code-block.d.ts +49 -0
- package/dist/components/code-block/code-block.js +188 -0
- package/dist/components/code-block/highlighter.d.ts +15 -0
- package/dist/components/code-block/highlighter.js +123 -0
- package/dist/components/code-block/index.d.ts +5 -0
- package/dist/components/code-block/index.js +5 -0
- package/dist/components/code-block/types.d.ts +94 -0
- package/dist/components/code-block/types.js +38 -0
- package/dist/components/code-block/use-highlighted-code.d.ts +9 -0
- package/dist/components/code-block/use-highlighted-code.js +67 -0
- package/dist/components/collapsible/collapsible.d.ts +19 -0
- package/dist/components/collapsible/collapsible.js +44 -0
- package/dist/components/collapsible/index.d.ts +3 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/collapsible/types.d.ts +26 -0
- package/dist/components/combobox/combobox.d.ts +104 -0
- package/dist/components/combobox/combobox.js +365 -0
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/combobox/types.d.ts +229 -0
- package/dist/components/command/command.d.ts +55 -0
- package/dist/components/command/command.js +179 -0
- package/dist/components/command/index.d.ts +3 -0
- package/dist/components/command/index.js +1 -0
- package/dist/components/command/types.d.ts +69 -0
- package/dist/components/context-menu/context-menu.d.ts +92 -0
- package/dist/components/context-menu/context-menu.js +270 -0
- package/dist/components/context-menu/index.d.ts +3 -0
- package/dist/components/context-menu/index.js +1 -0
- package/dist/components/context-menu/types.d.ts +138 -0
- package/dist/components/data-table/data-table-features.d.ts +21 -0
- package/dist/components/data-table/data-table-features.js +22 -0
- package/dist/components/data-table/data-table.d.ts +69 -0
- package/dist/components/data-table/data-table.js +283 -0
- package/dist/components/data-table/index.d.ts +4 -0
- package/dist/components/data-table/index.js +3 -0
- package/dist/components/data-table/types.d.ts +63 -0
- package/dist/components/date-input/date-input.d.ts +7 -0
- package/dist/components/date-input/date-input.js +147 -0
- package/dist/components/date-input/index.d.ts +3 -0
- package/dist/components/date-input/index.js +1 -0
- package/dist/components/date-input/types.d.ts +27 -0
- package/dist/components/date-picker/date-picker.d.ts +7 -0
- package/dist/components/date-picker/date-picker.js +74 -0
- package/dist/components/date-picker/index.d.ts +3 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-picker/types.d.ts +38 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +7 -0
- package/dist/components/date-range-picker/date-range-picker.js +89 -0
- package/dist/components/date-range-picker/index.d.ts +3 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/date-range-picker/types.d.ts +43 -0
- package/dist/components/dialog/dialog.d.ts +61 -0
- package/dist/components/dialog/dialog.js +160 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/dialog/types.d.ts +68 -0
- package/dist/components/drawer/drawer.d.ts +69 -0
- package/dist/components/drawer/drawer.js +245 -0
- package/dist/components/drawer/index.d.ts +3 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/drawer/types.d.ts +93 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +92 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +268 -0
- package/dist/components/dropdown-menu/index.d.ts +3 -0
- package/dist/components/dropdown-menu/index.js +1 -0
- package/dist/components/dropdown-menu/types.d.ts +143 -0
- package/dist/components/empty/empty.d.ts +37 -0
- package/dist/components/empty/empty.js +84 -0
- package/dist/components/empty/index.d.ts +3 -0
- package/dist/components/empty/index.js +3 -0
- package/dist/components/empty/types.d.ts +39 -0
- package/dist/components/empty/types.js +13 -0
- package/dist/components/expanded-card/expanded-card.d.ts +43 -0
- package/dist/components/expanded-card/expanded-card.js +352 -0
- package/dist/components/expanded-card/index.d.ts +3 -0
- package/dist/components/expanded-card/index.js +1 -0
- package/dist/components/expanded-card/types.d.ts +52 -0
- package/dist/components/field/field.d.ts +62 -0
- package/dist/components/field/field.js +173 -0
- package/dist/components/field/index.d.ts +3 -0
- package/dist/components/field/index.js +3 -0
- package/dist/components/field/types.d.ts +81 -0
- package/dist/components/field/types.js +21 -0
- package/dist/components/form/form.d.ts +49 -0
- package/dist/components/form/form.js +136 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/types.d.ts +59 -0
- package/dist/components/hover-card/hover-card.d.ts +19 -0
- package/dist/components/hover-card/hover-card.js +63 -0
- package/dist/components/hover-card/index.d.ts +3 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/hover-card/types.d.ts +27 -0
- package/dist/components/image-gallery/image-gallery.d.ts +8 -0
- package/dist/components/image-gallery/image-gallery.js +294 -0
- package/dist/components/image-gallery/index.d.ts +4 -0
- package/dist/components/image-gallery/index.js +3 -0
- package/dist/components/image-gallery/masonry.d.ts +11 -0
- package/dist/components/image-gallery/masonry.js +62 -0
- package/dist/components/image-gallery/types.d.ts +80 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/input.d.ts +7 -0
- package/dist/components/input/input.js +18 -0
- package/dist/components/input/types.d.ts +28 -0
- package/dist/components/input-group/index.d.ts +3 -0
- package/dist/components/input-group/index.js +3 -0
- package/dist/components/input-group/input-group.d.ts +37 -0
- package/dist/components/input-group/input-group.js +103 -0
- package/dist/components/input-group/types.d.ts +64 -0
- package/dist/components/input-group/types.js +31 -0
- package/dist/components/input-otp/index.d.ts +3 -0
- package/dist/components/input-otp/index.js +1 -0
- package/dist/components/input-otp/input-otp.d.ts +25 -0
- package/dist/components/input-otp/input-otp.js +76 -0
- package/dist/components/input-otp/types.d.ts +43 -0
- package/dist/components/item/index.d.ts +3 -0
- package/dist/components/item/index.js +3 -0
- package/dist/components/item/item.d.ts +61 -0
- package/dist/components/item/item.js +149 -0
- package/dist/components/item/types.d.ts +75 -0
- package/dist/components/item/types.js +48 -0
- package/dist/components/kbd/index.d.ts +3 -0
- package/dist/components/kbd/index.js +1 -0
- package/dist/components/kbd/kbd.d.ts +13 -0
- package/dist/components/kbd/kbd.js +30 -0
- package/dist/components/kbd/types.d.ts +9 -0
- package/dist/components/label/index.d.ts +3 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/label/label.d.ts +7 -0
- package/dist/components/label/label.js +17 -0
- package/dist/components/label/types.d.ts +8 -0
- package/dist/components/loader/index.d.ts +3 -0
- package/dist/components/loader/index.js +3 -0
- package/dist/components/loader/loader.d.ts +8 -0
- package/dist/components/loader/loader.js +386 -0
- package/dist/components/loader/types.d.ts +27 -0
- package/dist/components/loader/types.js +58 -0
- package/dist/components/marker/index.d.ts +3 -0
- package/dist/components/marker/index.js +3 -0
- package/dist/components/marker/marker.d.ts +19 -0
- package/dist/components/marker/marker.js +51 -0
- package/dist/components/marker/types.d.ts +30 -0
- package/dist/components/marker/types.js +16 -0
- package/dist/components/menubar/index.d.ts +3 -0
- package/dist/components/menubar/index.js +1 -0
- package/dist/components/menubar/menubar.d.ts +98 -0
- package/dist/components/menubar/menubar.js +284 -0
- package/dist/components/menubar/types.d.ts +146 -0
- package/dist/components/message/index.d.ts +3 -0
- package/dist/components/message/index.js +1 -0
- package/dist/components/message/message.d.ts +37 -0
- package/dist/components/message/message.js +83 -0
- package/dist/components/message/types.d.ts +32 -0
- package/dist/components/message-scroller/index.d.ts +4 -0
- package/dist/components/message-scroller/index.js +3 -0
- package/dist/components/message-scroller/message-scroller-primitive.d.ts +21 -0
- package/dist/components/message-scroller/message-scroller-primitive.js +1349 -0
- package/dist/components/message-scroller/message-scroller.d.ts +39 -0
- package/dist/components/message-scroller/message-scroller.js +103 -0
- package/dist/components/message-scroller/types.d.ts +107 -0
- package/dist/components/money-input/index.d.ts +3 -0
- package/dist/components/money-input/index.js +1 -0
- package/dist/components/money-input/money-input.d.ts +7 -0
- package/dist/components/money-input/money-input.js +143 -0
- package/dist/components/money-input/types.d.ts +20 -0
- package/dist/components/morph-image/index.d.ts +3 -0
- package/dist/components/morph-image/index.js +3 -0
- package/dist/components/morph-image/morph-image.d.ts +8 -0
- package/dist/components/morph-image/morph-image.js +155 -0
- package/dist/components/morph-image/types.d.ts +38 -0
- package/dist/components/morph-image/types.js +18 -0
- package/dist/components/native-select/index.d.ts +3 -0
- package/dist/components/native-select/index.js +3 -0
- package/dist/components/native-select/native-select.d.ts +20 -0
- package/dist/components/native-select/native-select.js +57 -0
- package/dist/components/native-select/types.d.ts +52 -0
- package/dist/components/native-select/types.js +23 -0
- package/dist/components/navigation-menu/index.d.ts +3 -0
- package/dist/components/navigation-menu/index.js +3 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +50 -0
- package/dist/components/navigation-menu/navigation-menu.js +145 -0
- package/dist/components/navigation-menu/types.d.ts +79 -0
- package/dist/components/navigation-menu/types.js +15 -0
- package/dist/components/number-stepper/index.d.ts +3 -0
- package/dist/components/number-stepper/index.js +3 -0
- package/dist/components/number-stepper/number-stepper.d.ts +9 -0
- package/dist/components/number-stepper/number-stepper.js +223 -0
- package/dist/components/number-stepper/types.d.ts +47 -0
- package/dist/components/number-stepper/types.js +174 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/pagination.d.ts +43 -0
- package/dist/components/pagination/pagination.js +121 -0
- package/dist/components/pagination/types.d.ts +37 -0
- package/dist/components/phone-input/index.d.ts +3 -0
- package/dist/components/phone-input/index.js +1 -0
- package/dist/components/phone-input/phone-input.d.ts +7 -0
- package/dist/components/phone-input/phone-input.js +54 -0
- package/dist/components/phone-input/types.d.ts +12 -0
- package/dist/components/popover/index.d.ts +3 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/popover.d.ts +37 -0
- package/dist/components/popover/popover.js +100 -0
- package/dist/components/popover/types.d.ts +51 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/index.js +1 -0
- package/dist/components/progress/progress.d.ts +32 -0
- package/dist/components/progress/progress.js +100 -0
- package/dist/components/progress/types.d.ts +31 -0
- package/dist/components/questionnaire/index.d.ts +3 -0
- package/dist/components/questionnaire/index.js +1 -0
- package/dist/components/questionnaire/questionnaire-primitive.js +1563 -0
- package/dist/components/questionnaire/questionnaire.d.ts +91 -0
- package/dist/components/questionnaire/questionnaire.js +315 -0
- package/dist/components/questionnaire/types.d.ts +203 -0
- package/dist/components/radio-group/index.d.ts +3 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/radio-group/radio-group.d.ts +13 -0
- package/dist/components/radio-group/radio-group.js +44 -0
- package/dist/components/radio-group/types.d.ts +33 -0
- package/dist/components/reorder-list/index.d.ts +3 -0
- package/dist/components/reorder-list/index.js +1 -0
- package/dist/components/reorder-list/reorder-list.d.ts +19 -0
- package/dist/components/reorder-list/reorder-list.js +279 -0
- package/dist/components/reorder-list/types.d.ts +65 -0
- package/dist/components/resizable/index.d.ts +3 -0
- package/dist/components/resizable/index.js +1 -0
- package/dist/components/resizable/resizable.d.ts +19 -0
- package/dist/components/resizable/resizable.js +44 -0
- package/dist/components/resizable/types.d.ts +89 -0
- package/dist/components/scroll-area/index.d.ts +3 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area/scroll-area.js +47 -0
- package/dist/components/scroll-area/types.d.ts +19 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/select.d.ts +61 -0
- package/dist/components/select/select.js +183 -0
- package/dist/components/select/types.d.ts +100 -0
- package/dist/components/separator/index.d.ts +3 -0
- package/dist/components/separator/index.js +1 -0
- package/dist/components/separator/separator.d.ts +7 -0
- package/dist/components/separator/separator.js +20 -0
- package/dist/components/separator/types.d.ts +9 -0
- package/dist/components/sheet/index.d.ts +3 -0
- package/dist/components/sheet/index.js +1 -0
- package/dist/components/sheet/sheet.d.ts +61 -0
- package/dist/components/sheet/sheet.js +155 -0
- package/dist/components/sheet/types.d.ts +69 -0
- package/dist/components/sidebar/index.d.ts +3 -0
- package/dist/components/sidebar/index.js +3 -0
- package/dist/components/sidebar/sidebar.d.ts +145 -0
- package/dist/components/sidebar/sidebar.js +550 -0
- package/dist/components/sidebar/types.d.ts +186 -0
- package/dist/components/sidebar/types.js +42 -0
- package/dist/components/sidebar/use-mobile.js +21 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/skeleton.d.ts +8 -0
- package/dist/components/skeleton/skeleton.js +18 -0
- package/dist/components/skeleton/types.d.ts +5 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/slider/slider.d.ts +7 -0
- package/dist/components/slider/slider.js +106 -0
- package/dist/components/slider/types.d.ts +39 -0
- package/dist/components/spinner/index.d.ts +3 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/spinner/spinner.d.ts +7 -0
- package/dist/components/spinner/spinner.js +21 -0
- package/dist/components/spinner/types.d.ts +8 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/switch/index.js +3 -0
- package/dist/components/switch/switch.d.ts +7 -0
- package/dist/components/switch/switch.js +32 -0
- package/dist/components/switch/types.d.ts +37 -0
- package/dist/components/switch/types.js +23 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/table.d.ts +49 -0
- package/dist/components/table/table.js +112 -0
- package/dist/components/table/types.d.ts +33 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/tabs/index.js +3 -0
- package/dist/components/tabs/tabs.d.ts +25 -0
- package/dist/components/tabs/tabs.js +81 -0
- package/dist/components/tabs/types.d.ts +61 -0
- package/dist/components/tabs/types.js +18 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/textarea.d.ts +7 -0
- package/dist/components/textarea/textarea.js +17 -0
- package/dist/components/textarea/types.d.ts +26 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toast/toast.d.ts +63 -0
- package/dist/components/toast/toast.js +321 -0
- package/dist/components/toast/types.d.ts +120 -0
- package/dist/components/toggle/index.d.ts +3 -0
- package/dist/components/toggle/index.js +3 -0
- package/dist/components/toggle/toggle.d.ts +7 -0
- package/dist/components/toggle/toggle.js +32 -0
- package/dist/components/toggle/types.d.ts +35 -0
- package/dist/components/toggle/types.js +37 -0
- package/dist/components/toggle-group/index.d.ts +3 -0
- package/dist/components/toggle-group/index.js +1 -0
- package/dist/components/toggle-group/toggle-group.d.ts +13 -0
- package/dist/components/toggle-group/toggle-group.js +88 -0
- package/dist/components/toggle-group/types.d.ts +52 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/tooltip.d.ts +25 -0
- package/dist/components/tooltip/tooltip.js +79 -0
- package/dist/components/tooltip/types.d.ts +48 -0
- package/dist/components/trace/index.d.ts +3 -0
- package/dist/components/trace/index.js +1 -0
- package/dist/components/trace/trace.d.ts +52 -0
- package/dist/components/trace/trace.js +132 -0
- package/dist/components/trace/types.d.ts +54 -0
- package/dist/components/typography/index.d.ts +3 -0
- package/dist/components/typography/index.js +3 -0
- package/dist/components/typography/types.d.ts +29 -0
- package/dist/components/typography/types.js +25 -0
- package/dist/components/typography/typography.d.ts +7 -0
- package/dist/components/typography/typography.js +40 -0
- package/dist/components/video-player/index.d.ts +6 -0
- package/dist/components/video-player/index.js +5 -0
- package/dist/components/video-player/types.d.ts +143 -0
- package/dist/components/video-player/use-video-player.js +319 -0
- package/dist/components/video-player/video-player-context.d.ts +45 -0
- package/dist/components/video-player/video-player-context.js +15 -0
- package/dist/components/video-player/video-player-controls.d.ts +38 -0
- package/dist/components/video-player/video-player-controls.js +226 -0
- package/dist/components/video-player/video-player-overlay.d.ts +13 -0
- package/dist/components/video-player/video-player-overlay.js +113 -0
- package/dist/components/video-player/video-player.d.ts +8 -0
- package/dist/components/video-player/video-player.js +139 -0
- package/dist/index.d.ts +244 -0
- package/dist/index.js +114 -0
- package/dist/lib/floating.d.ts +44 -0
- package/dist/lib/focus-source.js +51 -0
- package/dist/lib/format.d.ts +67 -0
- package/dist/lib/format.js +130 -0
- package/dist/lib/locale.d.ts +104 -0
- package/dist/lib/locale.js +103 -0
- package/dist/lib/part-props.d.ts +15 -0
- package/dist/lib/use-controllable-state.js +22 -0
- package/dist/lib/utils.d.ts +9 -0
- package/dist/lib/utils.js +16 -0
- package/dist/styles/index.css +126 -0
- package/dist/styles/theme.css +80 -0
- package/dist/styles/utilities.css +553 -0
- package/package.json +89 -3
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { NUMBER_LOCALE, texts } from "../../lib/locale.js";
|
|
4
|
+
import { numberStepperButtonVariants, numberStepperVariants } from "./types.js";
|
|
5
|
+
import { ChevronDownIcon, ChevronUpIcon, MinusIcon, PlusIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useMemo, useRef, useState } from "react";
|
|
8
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
9
|
+
// src/components/number-stepper/number-stepper.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Число знаков после запятой
|
|
12
|
+
* @param value - число
|
|
13
|
+
* @returns количество знаков
|
|
14
|
+
*/
|
|
15
|
+
function decimalsOf(value) {
|
|
16
|
+
return String(value).split(".")[1]?.length ?? 0;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Цифра, которая при смене уезжает в сторону изменения значения, а новая въезжает следом
|
|
20
|
+
* @param props - пропсы цифры
|
|
21
|
+
* @returns цифра
|
|
22
|
+
*/
|
|
23
|
+
function RollingDigit({ digit, trend }) {
|
|
24
|
+
const [current, setCurrent] = useState(digit);
|
|
25
|
+
const [previous, setPrevious] = useState(null);
|
|
26
|
+
const [changes, setChanges] = useState(0);
|
|
27
|
+
if (digit !== current) {
|
|
28
|
+
setPrevious(current);
|
|
29
|
+
setCurrent(digit);
|
|
30
|
+
setChanges(changes + 1);
|
|
31
|
+
}
|
|
32
|
+
const isUp = trend === 1;
|
|
33
|
+
const enterClasses = cn("inline-block", "duration-450", "ease-[cubic-bezier(0.2,0.8,0.2,1)]", "motion-reduce:animate-none", changes > 0 && "animate-in fade-in-0", changes > 0 && isUp && "slide-in-from-bottom-full", changes > 0 && !isUp && "slide-in-from-top-full");
|
|
34
|
+
const exitClasses = cn("absolute", "inset-0", "animate-out", "fade-out-0", "duration-450", "ease-[cubic-bezier(0.2,0.8,0.2,1)]", "fill-mode-forwards", "motion-reduce:hidden", isUp && "slide-out-to-top-full", !isUp && "slide-out-to-bottom-full");
|
|
35
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
36
|
+
className: "relative inline-block overflow-hidden",
|
|
37
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: enterClasses,
|
|
39
|
+
children: current
|
|
40
|
+
}, changes), previous !== null && /* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: exitClasses,
|
|
42
|
+
onAnimationEnd: () => setPrevious(null),
|
|
43
|
+
children: previous
|
|
44
|
+
}, `previous-${changes}`)]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Значение поверх поля ввода: цифры прокручиваются, остальные символы стоят на месте.
|
|
49
|
+
* Цифры нумеруются с конца, чтобы при появлении нового разряда единицы не перескакивали
|
|
50
|
+
* @param props - пропсы значения
|
|
51
|
+
* @returns значение
|
|
52
|
+
*/
|
|
53
|
+
function NumberStepperValue({ value, formatter, trend }) {
|
|
54
|
+
if (value === null) return null;
|
|
55
|
+
const characters = [];
|
|
56
|
+
for (const part of formatter.formatToParts(value)) characters.push(...part.value);
|
|
57
|
+
const items = [];
|
|
58
|
+
let position = 0;
|
|
59
|
+
for (let index = characters.length - 1; index >= 0; index--) {
|
|
60
|
+
const character = characters[index] ?? "";
|
|
61
|
+
const isDigit = character >= "0" && character <= "9";
|
|
62
|
+
const key = `${position}`;
|
|
63
|
+
position += 1;
|
|
64
|
+
if (isDigit) {
|
|
65
|
+
items.unshift(/* @__PURE__ */ jsx(RollingDigit, {
|
|
66
|
+
digit: character,
|
|
67
|
+
trend
|
|
68
|
+
}, key));
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
items.unshift(/* @__PURE__ */ jsx("span", { children: character }, key));
|
|
72
|
+
}
|
|
73
|
+
const classes = cn("pointer-events-none", "col-start-1", "row-start-1", "inline-flex", "whitespace-pre", "group-has-[input[aria-invalid=true]]/number-stepper:text-destructive");
|
|
74
|
+
return /* @__PURE__ */ jsx("span", {
|
|
75
|
+
"aria-hidden": true,
|
|
76
|
+
"data-slot": "number-stepper-value",
|
|
77
|
+
className: classes,
|
|
78
|
+
children: items
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Толчок значения к нажатой стороне на границе диапазона
|
|
83
|
+
* @param element - элемент значения
|
|
84
|
+
* @param direction - куда толкать: 1 — вперёд, -1 — назад
|
|
85
|
+
* @param isHorizontal - по горизонтали или вертикали
|
|
86
|
+
*/
|
|
87
|
+
function nudge(element, direction, isHorizontal) {
|
|
88
|
+
if (!element || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
89
|
+
const sign = isHorizontal ? direction : -direction;
|
|
90
|
+
const keyframes = [
|
|
91
|
+
0,
|
|
92
|
+
4,
|
|
93
|
+
-3,
|
|
94
|
+
0
|
|
95
|
+
].map((offset) => {
|
|
96
|
+
const shift = offset * sign;
|
|
97
|
+
return { translate: isHorizontal ? `${shift}px 0` : `0 ${shift}px` };
|
|
98
|
+
});
|
|
99
|
+
element.animate(keyframes, {
|
|
100
|
+
duration: 220,
|
|
101
|
+
easing: "ease-out"
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Степпер: число с кнопками «−» и «+». Держите кнопку — значение меняется всё быстрее;
|
|
106
|
+
* стрелки ↑↓ меняют на step, Shift+стрелки и PageUp/PageDown — на largeStep, Home/End — к границам.
|
|
107
|
+
* Значение можно ввести с клавиатуры, цифры прокручиваются в сторону изменения
|
|
108
|
+
* @param props - пропсы степпера
|
|
109
|
+
* @returns степпер
|
|
110
|
+
*/
|
|
111
|
+
function NumberStepper({ className, variant = "outline", size = "default", orientation = "horizontal", value, defaultValue, onValueChange, onValueCommitted, format, min, max, label = texts.value, disabled, "aria-invalid": ariaInvalid, ...props }) {
|
|
112
|
+
const isControlled = value !== void 0;
|
|
113
|
+
const isHorizontal = orientation === "horizontal";
|
|
114
|
+
const [innerValue, setInnerValue] = useState(defaultValue ?? null);
|
|
115
|
+
const [trend, setTrend] = useState(1);
|
|
116
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
117
|
+
const valueRef = useRef(null);
|
|
118
|
+
const shownValue = isControlled ? value : innerValue;
|
|
119
|
+
const formatter = useMemo(() => new Intl.NumberFormat(NUMBER_LOCALE, format), [format]);
|
|
120
|
+
/**
|
|
121
|
+
* Значение изменилось: запомнить направление, на границе — толчок
|
|
122
|
+
* @param next - новое значение
|
|
123
|
+
* @param details - причина изменения
|
|
124
|
+
*/
|
|
125
|
+
const handleValueChange = (next, details) => {
|
|
126
|
+
const direction = (next ?? 0) >= (shownValue ?? 0) ? 1 : -1;
|
|
127
|
+
const isTyped = details.reason.startsWith("input");
|
|
128
|
+
const isAtLimit = next !== null && (next === max || next === min);
|
|
129
|
+
setTrend(direction);
|
|
130
|
+
if (!isTyped) setIsEditing(false);
|
|
131
|
+
if (!isControlled) setInnerValue(next);
|
|
132
|
+
if (isAtLimit && !isTyped && next !== shownValue) nudge(valueRef.current, direction, isHorizontal);
|
|
133
|
+
onValueChange?.(next);
|
|
134
|
+
};
|
|
135
|
+
const rootClasses = cn(numberStepperVariants({
|
|
136
|
+
variant,
|
|
137
|
+
size,
|
|
138
|
+
orientation
|
|
139
|
+
}), className);
|
|
140
|
+
const buttonClasses = numberStepperButtonVariants({
|
|
141
|
+
variant,
|
|
142
|
+
size,
|
|
143
|
+
orientation
|
|
144
|
+
});
|
|
145
|
+
const inputClasses = cn("col-start-1", "row-start-1", "h-full", "min-w-0", "bg-transparent", "px-0.5", "text-center", "outline-none", "disabled:cursor-not-allowed", isEditing && "aria-invalid:text-destructive", !isEditing && "text-transparent caret-transparent selection:bg-transparent", variant === "ghost" && "rounded-sm focus-visible:ring-3 focus-visible:ring-ring/50");
|
|
146
|
+
/**
|
|
147
|
+
* Клавиша в поле: печать символа или удаление — режим ввода, где виден текст поля
|
|
148
|
+
* @param event - событие клавиатуры
|
|
149
|
+
*/
|
|
150
|
+
const handleInputKeyDown = (event) => {
|
|
151
|
+
const isPrintable = event.key.length === 1 && !event.ctrlKey && !event.metaKey;
|
|
152
|
+
const isErase = event.key === "Backspace" || event.key === "Delete";
|
|
153
|
+
if (isPrintable || isErase) setIsEditing(true);
|
|
154
|
+
};
|
|
155
|
+
const stepValue = props.step === "any" ? 0 : props.step ?? 1;
|
|
156
|
+
const decimals = Math.max(decimalsOf(stepValue), 0);
|
|
157
|
+
const widthSamples = [
|
|
158
|
+
min,
|
|
159
|
+
max,
|
|
160
|
+
shownValue
|
|
161
|
+
];
|
|
162
|
+
let widthChars = 2;
|
|
163
|
+
for (const sample of widthSamples) if (typeof sample === "number" && Number.isFinite(sample)) widthChars = Math.max(widthChars, formatter.format(sample).length);
|
|
164
|
+
const inputStyle = { width: `${widthChars + (isHorizontal ? 1 : 0) + decimals}ch` };
|
|
165
|
+
const DecrementIcon = isHorizontal ? MinusIcon : ChevronDownIcon;
|
|
166
|
+
const IncrementIcon = isHorizontal ? PlusIcon : ChevronUpIcon;
|
|
167
|
+
const decrement = /* @__PURE__ */ jsx(NumberField.Decrement, {
|
|
168
|
+
"data-slot": "number-stepper-decrement",
|
|
169
|
+
"aria-label": `${texts.decrease}: ${label}`,
|
|
170
|
+
className: buttonClasses,
|
|
171
|
+
children: /* @__PURE__ */ jsx(DecrementIcon, { "aria-hidden": true })
|
|
172
|
+
});
|
|
173
|
+
const increment = /* @__PURE__ */ jsx(NumberField.Increment, {
|
|
174
|
+
"data-slot": "number-stepper-increment",
|
|
175
|
+
"aria-label": `${texts.increase}: ${label}`,
|
|
176
|
+
className: buttonClasses,
|
|
177
|
+
children: /* @__PURE__ */ jsx(IncrementIcon, { "aria-hidden": true })
|
|
178
|
+
});
|
|
179
|
+
return /* @__PURE__ */ jsx(NumberField.Root, {
|
|
180
|
+
"data-slot": "number-stepper",
|
|
181
|
+
"data-variant": variant,
|
|
182
|
+
"data-size": size,
|
|
183
|
+
"data-orientation": orientation,
|
|
184
|
+
value,
|
|
185
|
+
defaultValue,
|
|
186
|
+
format,
|
|
187
|
+
locale: NUMBER_LOCALE,
|
|
188
|
+
min,
|
|
189
|
+
max,
|
|
190
|
+
disabled,
|
|
191
|
+
className: "inline-flex w-fit",
|
|
192
|
+
onValueChange: handleValueChange,
|
|
193
|
+
onValueCommitted: (next) => onValueCommitted?.(next),
|
|
194
|
+
...props,
|
|
195
|
+
children: /* @__PURE__ */ jsxs(NumberField.Group, {
|
|
196
|
+
"data-slot": "number-stepper-group",
|
|
197
|
+
className: rootClasses,
|
|
198
|
+
children: [
|
|
199
|
+
isHorizontal ? decrement : increment,
|
|
200
|
+
/* @__PURE__ */ jsxs("div", {
|
|
201
|
+
ref: valueRef,
|
|
202
|
+
className: "grid h-full place-items-center",
|
|
203
|
+
children: [/* @__PURE__ */ jsx(NumberField.Input, {
|
|
204
|
+
"data-slot": "number-stepper-input",
|
|
205
|
+
"aria-label": label,
|
|
206
|
+
"aria-invalid": ariaInvalid,
|
|
207
|
+
style: inputStyle,
|
|
208
|
+
className: inputClasses,
|
|
209
|
+
onPointerDown: () => setIsEditing(true),
|
|
210
|
+
onKeyDown: handleInputKeyDown,
|
|
211
|
+
onBlur: () => setIsEditing(false)
|
|
212
|
+
}), !isEditing && /* @__PURE__ */ jsx(NumberStepperValue, {
|
|
213
|
+
value: shownValue,
|
|
214
|
+
formatter,
|
|
215
|
+
trend
|
|
216
|
+
})]
|
|
217
|
+
}),
|
|
218
|
+
isHorizontal ? increment : decrement
|
|
219
|
+
]
|
|
220
|
+
})
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
export { NumberStepper };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PartPropsT } from "../../lib/part-props.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
4
|
+
/**
|
|
5
|
+
* Стили степпера: вариант оформления, размер и ориентация.
|
|
6
|
+
* Экспортируются, чтобы оформить степпером другой элемент
|
|
7
|
+
*/
|
|
8
|
+
export declare const numberStepperVariants: (props?: ({
|
|
9
|
+
variant?: "outline" | "ghost" | "pill" | null | undefined;
|
|
10
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Стили кнопок степпера: «−» и «+» (в вертикальном — стрелки)
|
|
15
|
+
*/
|
|
16
|
+
export declare const numberStepperButtonVariants: (props?: ({
|
|
17
|
+
variant?: "outline" | "ghost" | "pill" | null | undefined;
|
|
18
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
19
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
20
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Варианты оформления, размеры и ориентации степпера
|
|
23
|
+
*/
|
|
24
|
+
export type NumberStepperVariantsT = VariantProps<typeof numberStepperVariants>;
|
|
25
|
+
/**
|
|
26
|
+
* Пропсы степпера
|
|
27
|
+
*/
|
|
28
|
+
export type NumberStepperPropsT = PartPropsT<Omit<NumberField.Root.Props, 'value' | 'defaultValue' | 'onValueChange' | 'onValueCommitted' | 'locale' | 'children'>> & {
|
|
29
|
+
/** Значение — контролируемый режим, вместе с onValueChange; null — пусто */
|
|
30
|
+
value?: number | null;
|
|
31
|
+
/** Значение при первом рендере — неконтролируемый режим */
|
|
32
|
+
defaultValue?: number;
|
|
33
|
+
/** Значение изменилось: кнопкой, клавишей, колесом или вводом */
|
|
34
|
+
onValueChange?: (value: number | null) => void;
|
|
35
|
+
/** Значение зафиксировано: отпустили кнопку, ушли из поля или нажали клавишу */
|
|
36
|
+
onValueCommitted?: (value: number | null) => void;
|
|
37
|
+
/** Оформление: с рамкой (outline), капсула с заливкой кнопок (pill) или без рамки (ghost) */
|
|
38
|
+
variant?: NumberStepperVariantsT['variant'];
|
|
39
|
+
/** Размер: sm, default, lg */
|
|
40
|
+
size?: NumberStepperVariantsT['size'];
|
|
41
|
+
/** Ориентация: кнопки по бокам (horizontal) или сверху и снизу (vertical) */
|
|
42
|
+
orientation?: NumberStepperVariantsT['orientation'];
|
|
43
|
+
/** Подпись для скринридера: поле читается «{label}», кнопки — «Увеличить {label}». По умолчанию «Значение» */
|
|
44
|
+
label?: string;
|
|
45
|
+
/** Ошибка: красная рамка и объявление скринридеру, что значение неверное */
|
|
46
|
+
'aria-invalid'?: boolean;
|
|
47
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/number-stepper/types.ts
|
|
3
|
+
/**
|
|
4
|
+
* Стили степпера: вариант оформления, размер и ориентация.
|
|
5
|
+
* Экспортируются, чтобы оформить степпером другой элемент
|
|
6
|
+
*/
|
|
7
|
+
const numberStepperVariants = cva(["group/number-stepper inline-flex w-fit items-center justify-between font-medium tabular-nums", "data-disabled:cursor-not-allowed data-disabled:opacity-50"], {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
outline: [
|
|
11
|
+
"rounded-lg border border-input bg-transparent transition-[color,box-shadow] dark:bg-input/30",
|
|
12
|
+
"keyboard:has-[input:focus-visible]:border-ring keyboard:has-[input:focus-visible]:ring-3 keyboard:has-[input:focus-visible]:ring-ring/50",
|
|
13
|
+
"has-[input[aria-invalid=true]]:border-destructive has-[input[aria-invalid=true]]:ring-3",
|
|
14
|
+
"has-[input[aria-invalid=true]]:ring-destructive/20 dark:has-[input[aria-invalid=true]]:ring-destructive/40"
|
|
15
|
+
],
|
|
16
|
+
pill: [
|
|
17
|
+
"rounded-full border border-input bg-background p-0.5 transition-[color,box-shadow] dark:bg-input/30",
|
|
18
|
+
"keyboard:has-[input:focus-visible]:border-ring keyboard:has-[input:focus-visible]:ring-3 keyboard:has-[input:focus-visible]:ring-ring/50",
|
|
19
|
+
"has-[input[aria-invalid=true]]:border-destructive has-[input[aria-invalid=true]]:ring-3",
|
|
20
|
+
"has-[input[aria-invalid=true]]:ring-destructive/20 dark:has-[input[aria-invalid=true]]:ring-destructive/40"
|
|
21
|
+
],
|
|
22
|
+
ghost: ""
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
sm: "text-sm",
|
|
26
|
+
default: "text-sm",
|
|
27
|
+
lg: "text-base"
|
|
28
|
+
},
|
|
29
|
+
orientation: {
|
|
30
|
+
horizontal: "flex-row gap-0.5",
|
|
31
|
+
vertical: "min-w-10 flex-col gap-0.5"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
compoundVariants: [
|
|
35
|
+
{
|
|
36
|
+
orientation: "horizontal",
|
|
37
|
+
size: "sm",
|
|
38
|
+
className: "h-7"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
orientation: "horizontal",
|
|
42
|
+
size: "default",
|
|
43
|
+
className: "h-8"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
orientation: "horizontal",
|
|
47
|
+
size: "lg",
|
|
48
|
+
className: "h-9"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
variant: "outline",
|
|
52
|
+
orientation: "horizontal",
|
|
53
|
+
className: "px-0.5"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
variant: "outline",
|
|
57
|
+
orientation: "vertical",
|
|
58
|
+
className: "py-0.5"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
variant: "pill",
|
|
62
|
+
orientation: "vertical",
|
|
63
|
+
className: "min-w-0"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
defaultVariants: {
|
|
67
|
+
variant: "outline",
|
|
68
|
+
size: "default",
|
|
69
|
+
orientation: "horizontal"
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Стили кнопок степпера: «−» и «+» (в вертикальном — стрелки)
|
|
74
|
+
*/
|
|
75
|
+
const numberStepperButtonVariants = cva([
|
|
76
|
+
"relative inline-flex shrink-0 cursor-pointer touch-manipulation items-center justify-center outline-none select-none",
|
|
77
|
+
"transition-[color,background-color,scale] duration-300 ease-spring active:scale-90 motion-reduce:active:scale-100",
|
|
78
|
+
"disabled:pointer-events-none disabled:opacity-40",
|
|
79
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
80
|
+
], {
|
|
81
|
+
variants: {
|
|
82
|
+
variant: {
|
|
83
|
+
outline: "rounded-md text-muted-foreground hover:bg-muted hover:text-foreground dark:hover:bg-input/50",
|
|
84
|
+
pill: "rounded-full bg-primary text-primary-foreground hover:bg-primary/80",
|
|
85
|
+
ghost: "rounded-md text-muted-foreground hover:bg-muted hover:text-foreground dark:hover:bg-muted/50"
|
|
86
|
+
},
|
|
87
|
+
size: {
|
|
88
|
+
sm: "[&_svg:not([class*=size-])]:size-3.5",
|
|
89
|
+
default: "[&_svg:not([class*=size-])]:size-4",
|
|
90
|
+
lg: "[&_svg:not([class*=size-])]:size-4.5"
|
|
91
|
+
},
|
|
92
|
+
orientation: {
|
|
93
|
+
horizontal: "",
|
|
94
|
+
vertical: ""
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
compoundVariants: [
|
|
98
|
+
{
|
|
99
|
+
orientation: "horizontal",
|
|
100
|
+
variant: "outline",
|
|
101
|
+
size: "sm",
|
|
102
|
+
className: "size-5"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
orientation: "horizontal",
|
|
106
|
+
variant: "outline",
|
|
107
|
+
size: "default",
|
|
108
|
+
className: "size-6"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
orientation: "horizontal",
|
|
112
|
+
variant: "outline",
|
|
113
|
+
size: "lg",
|
|
114
|
+
className: "size-7"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
variant: "pill",
|
|
118
|
+
size: "sm",
|
|
119
|
+
className: "size-5"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
variant: "pill",
|
|
123
|
+
size: "default",
|
|
124
|
+
className: "size-6"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
variant: "pill",
|
|
128
|
+
size: "lg",
|
|
129
|
+
className: "size-7"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
orientation: "horizontal",
|
|
133
|
+
variant: "ghost",
|
|
134
|
+
size: "sm",
|
|
135
|
+
className: "size-7"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
orientation: "horizontal",
|
|
139
|
+
variant: "ghost",
|
|
140
|
+
size: "default",
|
|
141
|
+
className: "size-8"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
orientation: "horizontal",
|
|
145
|
+
variant: "ghost",
|
|
146
|
+
size: "lg",
|
|
147
|
+
className: "size-9"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
orientation: "vertical",
|
|
151
|
+
variant: ["outline", "ghost"],
|
|
152
|
+
size: "sm",
|
|
153
|
+
className: "h-5 w-full"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
orientation: "vertical",
|
|
157
|
+
variant: ["outline", "ghost"],
|
|
158
|
+
size: "default",
|
|
159
|
+
className: "h-6 w-full"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
orientation: "vertical",
|
|
163
|
+
variant: ["outline", "ghost"],
|
|
164
|
+
size: "lg",
|
|
165
|
+
className: "h-7 w-full"
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
defaultVariants: {
|
|
169
|
+
variant: "outline",
|
|
170
|
+
size: "default",
|
|
171
|
+
orientation: "horizontal"
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export { numberStepperButtonVariants, numberStepperVariants };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PaginationContentPropsT, PaginationEllipsisPropsT, PaginationItemPropsT, PaginationLinkPropsT, PaginationPropsT, PaginationStepPropsT } from "./types.js";
|
|
2
|
+
import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "./pagination.js";
|
|
3
|
+
export { Pagination, PaginationContent, type PaginationContentPropsT, PaginationEllipsis, type PaginationEllipsisPropsT, PaginationItem, type PaginationItemPropsT, PaginationLink, type PaginationLinkPropsT, PaginationNext, PaginationPrevious, type PaginationPropsT, type PaginationStepPropsT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "./pagination.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PaginationContentPropsT, PaginationEllipsisPropsT, PaginationItemPropsT, PaginationLinkPropsT, PaginationPropsT, PaginationStepPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Постраничная навигация: ссылки на страницы, «Назад» и «Далее»
|
|
4
|
+
* @param props - пропсы навигации; aria-label по умолчанию «Постраничная навигация»
|
|
5
|
+
* @returns nav
|
|
6
|
+
*/
|
|
7
|
+
export declare function Pagination({ className, ...props }: PaginationPropsT): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Список страниц
|
|
10
|
+
* @param props - пропсы списка
|
|
11
|
+
* @returns ul
|
|
12
|
+
*/
|
|
13
|
+
export declare function PaginationContent({ className, ...props }: PaginationContentPropsT): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Элемент списка страниц
|
|
16
|
+
* @param props - пропсы элемента
|
|
17
|
+
* @returns li
|
|
18
|
+
*/
|
|
19
|
+
export declare function PaginationItem(props: PaginationItemPropsT): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Ссылка на страницу: выглядит как кнопка, текущая — с обводкой
|
|
22
|
+
* @param props - пропсы ссылки
|
|
23
|
+
* @returns a
|
|
24
|
+
*/
|
|
25
|
+
export declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkPropsT): import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Ссылка на предыдущую страницу
|
|
28
|
+
* @param props - пропсы ссылки; text по умолчанию «Назад», aria-label — «Предыдущая страница»
|
|
29
|
+
* @returns a
|
|
30
|
+
*/
|
|
31
|
+
export declare function PaginationPrevious({ className, text, ...props }: PaginationStepPropsT): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Ссылка на следующую страницу
|
|
34
|
+
* @param props - пропсы ссылки; text по умолчанию «Далее», aria-label — «Следующая страница»
|
|
35
|
+
* @returns a
|
|
36
|
+
*/
|
|
37
|
+
export declare function PaginationNext({ className, text, ...props }: PaginationStepPropsT): import("react").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* Многоточие: пропущенные страницы
|
|
40
|
+
* @param props - пропсы многоточия
|
|
41
|
+
* @returns span
|
|
42
|
+
*/
|
|
43
|
+
export declare function PaginationEllipsis({ className, label, ...props }: PaginationEllipsisPropsT): import("react").JSX.Element;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { texts } from "../../lib/locale.js";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
// src/components/pagination/pagination.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Постраничная навигация: ссылки на страницы, «Назад» и «Далее»
|
|
9
|
+
* @param props - пропсы навигации; aria-label по умолчанию «Постраничная навигация»
|
|
10
|
+
* @returns nav
|
|
11
|
+
*/
|
|
12
|
+
function Pagination({ className, ...props }) {
|
|
13
|
+
const classes = cn("mx-auto", "flex", "w-full", "justify-center", className);
|
|
14
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
15
|
+
role: "navigation",
|
|
16
|
+
"aria-label": texts.pagination,
|
|
17
|
+
"data-slot": "pagination",
|
|
18
|
+
className: classes,
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Список страниц
|
|
24
|
+
* @param props - пропсы списка
|
|
25
|
+
* @returns ul
|
|
26
|
+
*/
|
|
27
|
+
function PaginationContent({ className, ...props }) {
|
|
28
|
+
const classes = cn("flex", "items-center", "gap-0.5", className);
|
|
29
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
30
|
+
"data-slot": "pagination-content",
|
|
31
|
+
className: classes,
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Элемент списка страниц
|
|
37
|
+
* @param props - пропсы элемента
|
|
38
|
+
* @returns li
|
|
39
|
+
*/
|
|
40
|
+
function PaginationItem(props) {
|
|
41
|
+
return /* @__PURE__ */ jsx("li", {
|
|
42
|
+
"data-slot": "pagination-item",
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Ссылка на страницу: выглядит как кнопка, текущая — с обводкой
|
|
48
|
+
* @param props - пропсы ссылки
|
|
49
|
+
* @returns a
|
|
50
|
+
*/
|
|
51
|
+
function PaginationLink({ className, isActive, size = "icon", ...props }) {
|
|
52
|
+
const variant = isActive ? "outline" : "ghost";
|
|
53
|
+
const current = isActive ? "page" : void 0;
|
|
54
|
+
const classes = cn(className);
|
|
55
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
56
|
+
variant,
|
|
57
|
+
size,
|
|
58
|
+
className: classes,
|
|
59
|
+
render: /* @__PURE__ */ jsx("a", {}),
|
|
60
|
+
role: "link",
|
|
61
|
+
"aria-current": current,
|
|
62
|
+
"data-slot": "pagination-link",
|
|
63
|
+
"data-active": isActive,
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Ссылка на предыдущую страницу
|
|
69
|
+
* @param props - пропсы ссылки; text по умолчанию «Назад», aria-label — «Предыдущая страница»
|
|
70
|
+
* @returns a
|
|
71
|
+
*/
|
|
72
|
+
function PaginationPrevious({ className, text = texts.previous, ...props }) {
|
|
73
|
+
const classes = cn("pl-1.5!", className);
|
|
74
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
75
|
+
"aria-label": texts.previousPage,
|
|
76
|
+
size: "default",
|
|
77
|
+
className: classes,
|
|
78
|
+
...props,
|
|
79
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, { "data-icon": "inline-start" }), /* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: "hidden sm:block",
|
|
81
|
+
children: text
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Ссылка на следующую страницу
|
|
87
|
+
* @param props - пропсы ссылки; text по умолчанию «Далее», aria-label — «Следующая страница»
|
|
88
|
+
* @returns a
|
|
89
|
+
*/
|
|
90
|
+
function PaginationNext({ className, text = texts.next, ...props }) {
|
|
91
|
+
const classes = cn("pr-1.5!", className);
|
|
92
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
93
|
+
"aria-label": texts.nextPage,
|
|
94
|
+
size: "default",
|
|
95
|
+
className: classes,
|
|
96
|
+
...props,
|
|
97
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
98
|
+
className: "hidden sm:block",
|
|
99
|
+
children: text
|
|
100
|
+
}), /* @__PURE__ */ jsx(ChevronRightIcon, { "data-icon": "inline-end" })]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Многоточие: пропущенные страницы
|
|
105
|
+
* @param props - пропсы многоточия
|
|
106
|
+
* @returns span
|
|
107
|
+
*/
|
|
108
|
+
function PaginationEllipsis({ className, label = texts.morePages, ...props }) {
|
|
109
|
+
const classes = cn("flex", "size-8", "items-center", "justify-center", "[&_svg:not([class*=size-])]:size-4", className);
|
|
110
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
111
|
+
"aria-hidden": true,
|
|
112
|
+
"data-slot": "pagination-ellipsis",
|
|
113
|
+
className: classes,
|
|
114
|
+
...props,
|
|
115
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
116
|
+
className: "sr-only",
|
|
117
|
+
children: label
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ButtonPropsT } from "../button/types.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Пропсы постраничной навигации
|
|
5
|
+
*/
|
|
6
|
+
export type PaginationPropsT = ComponentProps<'nav'>;
|
|
7
|
+
/**
|
|
8
|
+
* Пропсы списка страниц
|
|
9
|
+
*/
|
|
10
|
+
export type PaginationContentPropsT = ComponentProps<'ul'>;
|
|
11
|
+
/**
|
|
12
|
+
* Пропсы элемента списка
|
|
13
|
+
*/
|
|
14
|
+
export type PaginationItemPropsT = ComponentProps<'li'>;
|
|
15
|
+
/**
|
|
16
|
+
* Пропсы ссылки на страницу
|
|
17
|
+
*/
|
|
18
|
+
export type PaginationLinkPropsT = ComponentProps<'a'> & {
|
|
19
|
+
/** Текущая страница: обводка и aria-current="page" */
|
|
20
|
+
isActive?: boolean;
|
|
21
|
+
/** Размер кнопки-ссылки. По умолчанию icon */
|
|
22
|
+
size?: ButtonPropsT['size'];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Пропсы ссылки «Назад» и «Далее»
|
|
26
|
+
*/
|
|
27
|
+
export type PaginationStepPropsT = PaginationLinkPropsT & {
|
|
28
|
+
/** Текст рядом со стрелкой; на узком экране скрыт */
|
|
29
|
+
text?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Пропсы многоточия
|
|
33
|
+
*/
|
|
34
|
+
export type PaginationEllipsisPropsT = ComponentProps<'span'> & {
|
|
35
|
+
/** Подпись для скринридеров */
|
|
36
|
+
label?: string;
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PhoneInput } from "./phone-input.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PhoneInputPropsT } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Поле телефона: маска +7 (XXX) XXX-XX-XX форматирует номер по мере ввода
|
|
4
|
+
* @param props - пропсы Input; value — телефон в любом виде, onValueChange — +7 и цифры
|
|
5
|
+
* @returns input
|
|
6
|
+
*/
|
|
7
|
+
export declare function PhoneInput({ value, defaultValue, onValueChange, onChange, placeholder, ...props }: PhoneInputPropsT): import("react").JSX.Element;
|