@vkontakte/vkui 7.3.8 → 7.4.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/dist/components/ActionSheet/ActionSheet.d.ts +1 -1
- package/dist/components/ActionSheet/ActionSheet.d.ts.map +1 -1
- package/dist/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/components/AppRoot/ScrollContext.js +2 -2
- package/dist/components/AppRoot/ScrollContext.js.map +1 -1
- package/dist/components/Banner/Banner.d.ts +2 -2
- package/dist/components/Banner/Banner.d.ts.map +1 -1
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +9 -7
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/CalendarRange/CalendarRange.d.ts +9 -2
- package/dist/components/CalendarRange/CalendarRange.d.ts.map +1 -1
- package/dist/components/CalendarRange/CalendarRange.js +48 -35
- package/dist/components/CalendarRange/CalendarRange.js.map +1 -1
- package/dist/components/CalendarRange/types.d.ts +2 -0
- package/dist/components/CalendarRange/types.d.ts.map +1 -0
- package/dist/components/CalendarRange/types.js +3 -0
- package/dist/components/CalendarRange/types.js.map +1 -0
- package/dist/components/CalendarRange/utils.d.ts +29 -0
- package/dist/components/CalendarRange/utils.d.ts.map +1 -0
- package/dist/components/CalendarRange/utils.js +123 -0
- package/dist/components/CalendarRange/utils.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/ChipsInput/useChipsInput.d.ts.map +1 -1
- package/dist/components/ChipsInput/useChipsInput.js +21 -2
- package/dist/components/ChipsInput/useChipsInput.js.map +1 -1
- package/dist/components/ChipsInputBase/types.d.ts +5 -1
- package/dist/components/ChipsInputBase/types.d.ts.map +1 -1
- package/dist/components/ChipsInputBase/types.js.map +1 -1
- package/dist/components/Clickable/Clickable.d.ts +4 -0
- package/dist/components/Clickable/Clickable.d.ts.map +1 -1
- package/dist/components/Clickable/Clickable.js +9 -5
- package/dist/components/Clickable/Clickable.js.map +1 -1
- package/dist/components/Clickable/RealClickable.d.ts +1 -1
- package/dist/components/Clickable/RealClickable.d.ts.map +1 -1
- package/dist/components/Clickable/RealClickable.js +3 -2
- package/dist/components/Clickable/RealClickable.js.map +1 -1
- package/dist/components/ContentCard/ContentCard.d.ts +2 -2
- package/dist/components/ContentCard/ContentCard.d.ts.map +1 -1
- package/dist/components/ContentCard/ContentCard.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts +4 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/DateInput/DateInput.d.ts +1 -1
- package/dist/components/DateInput/DateInput.d.ts.map +1 -1
- package/dist/components/DateInput/DateInput.js +48 -50
- package/dist/components/DateInput/DateInput.js.map +1 -1
- package/dist/components/DateRangeInput/DateRangeInput.d.ts +22 -2
- package/dist/components/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/components/DateRangeInput/DateRangeInput.js +159 -66
- package/dist/components/DateRangeInput/DateRangeInput.js.map +1 -1
- package/dist/components/FocusTrap/FocusTrap.d.ts +1 -1
- package/dist/components/FocusTrap/FocusTrap.d.ts.map +1 -1
- package/dist/components/FocusTrap/FocusTrap.js +6 -3
- package/dist/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/components/HorizontalCell/HorizontalCell.d.ts +2 -2
- package/dist/components/HorizontalCell/HorizontalCell.d.ts.map +1 -1
- package/dist/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore.d.ts +2 -2
- package/dist/components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore.d.ts.map +1 -1
- package/dist/components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +2 -2
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/InputLike/InputLike.d.ts +1 -1
- package/dist/components/InputLike/InputLike.d.ts.map +1 -1
- package/dist/components/InputLike/InputLike.js +7 -6
- package/dist/components/InputLike/InputLike.js.map +1 -1
- package/dist/components/Link/Link.d.ts +2 -2
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.js +2 -1
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/MiniInfoCell/MiniInfoCell.d.ts.map +1 -1
- package/dist/components/MiniInfoCell/MiniInfoCell.js +1 -8
- package/dist/components/MiniInfoCell/MiniInfoCell.js.map +1 -1
- package/dist/components/ModalOutsideButton/ModalOutsideButton.d.ts +2 -2
- package/dist/components/ModalOutsideButton/ModalOutsideButton.d.ts.map +1 -1
- package/dist/components/ModalOutsideButton/ModalOutsideButton.js.map +1 -1
- package/dist/components/NumberInputLike/NumberInputLike.d.ts +8 -0
- package/dist/components/NumberInputLike/NumberInputLike.d.ts.map +1 -0
- package/dist/components/NumberInputLike/NumberInputLike.js +45 -0
- package/dist/components/NumberInputLike/NumberInputLike.js.map +1 -0
- package/dist/components/Pagination/PaginationPage/PaginationPageButton.d.ts +2 -2
- package/dist/components/Pagination/PaginationPage/PaginationPageButton.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationPage/PaginationPageButton.js.map +1 -1
- package/dist/components/PanelHeader/PanelHeader.d.ts +3 -1
- package/dist/components/PanelHeader/PanelHeader.d.ts.map +1 -1
- package/dist/components/PanelHeader/PanelHeader.js.map +1 -1
- package/dist/components/PanelHeaderButton/PanelHeaderButton.d.ts +2 -2
- package/dist/components/PanelHeaderButton/PanelHeaderButton.d.ts.map +1 -1
- package/dist/components/PanelHeaderButton/PanelHeaderButton.js.map +1 -1
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Removable/Removable.d.ts +1 -4
- package/dist/components/Removable/Removable.d.ts.map +1 -1
- package/dist/components/Removable/Removable.js +39 -116
- package/dist/components/Removable/Removable.js.map +1 -1
- package/dist/components/Removable/RemovableIos.d.ts +10 -0
- package/dist/components/Removable/RemovableIos.d.ts.map +1 -0
- package/dist/components/Removable/RemovableIos.js +124 -0
- package/dist/components/Removable/RemovableIos.js.map +1 -0
- package/dist/components/RichCell/RichCell.d.ts +2 -2
- package/dist/components/RichCell/RichCell.d.ts.map +1 -1
- package/dist/components/RichCell/RichCell.js.map +1 -1
- package/dist/components/ScreenSpinner/ScreenSpinner.d.ts.map +1 -1
- package/dist/components/ScreenSpinner/ScreenSpinner.js +4 -2
- package/dist/components/ScreenSpinner/ScreenSpinner.js.map +1 -1
- package/dist/components/ScreenSpinner/ScreenSpinnerContainer.d.ts +2 -2
- package/dist/components/ScreenSpinner/ScreenSpinnerContainer.d.ts.map +1 -1
- package/dist/components/ScreenSpinner/ScreenSpinnerContainer.js +4 -3
- package/dist/components/ScreenSpinner/ScreenSpinnerContainer.js.map +1 -1
- package/dist/components/SelectionControl/SelectionControl.d.ts +2 -2
- package/dist/components/SelectionControl/SelectionControl.d.ts.map +1 -1
- package/dist/components/SelectionControl/SelectionControl.js.map +1 -1
- package/dist/components/SimpleCell/SimpleCell.d.ts +2 -2
- package/dist/components/SimpleCell/SimpleCell.d.ts.map +1 -1
- package/dist/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +5 -1
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +7 -4
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts +5 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +6 -3
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/SubnavigationButton/SubnavigationButton.d.ts +2 -2
- package/dist/components/SubnavigationButton/SubnavigationButton.d.ts.map +1 -1
- package/dist/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +13 -9
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +14 -10
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/TabsController.d.ts +7 -0
- package/dist/components/Tabs/TabsController.d.ts.map +1 -0
- package/dist/components/Tabs/TabsController.js +19 -0
- package/dist/components/Tabs/TabsController.js.map +1 -0
- package/dist/components/Tabs/TabsModeContext.d.ts +13 -0
- package/dist/components/Tabs/TabsModeContext.d.ts.map +1 -0
- package/dist/components/Tabs/TabsModeContext.js +11 -0
- package/dist/components/Tabs/TabsModeContext.js.map +1 -0
- package/dist/components/TabsItem/TabsItem.d.ts +3 -3
- package/dist/components/TabsItem/TabsItem.d.ts.map +1 -1
- package/dist/components/TabsItem/TabsItem.js +21 -6
- package/dist/components/TabsItem/TabsItem.js.map +1 -1
- package/dist/components/Tappable/Tappable.d.ts +1 -0
- package/dist/components/Tappable/Tappable.d.ts.map +1 -1
- package/dist/components/Tappable/Tappable.js.map +1 -1
- package/dist/components/ToolButton/ToolButton.d.ts +2 -2
- package/dist/components/ToolButton/ToolButton.d.ts.map +1 -1
- package/dist/components/ToolButton/ToolButton.js.map +1 -1
- package/dist/components/View/ViewInfinite.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cssm/components/AppRoot/ScrollContext.js +2 -2
- package/dist/cssm/components/AppRoot/ScrollContext.js.map +1 -1
- package/dist/cssm/components/Banner/Banner.js.map +1 -1
- package/dist/cssm/components/Button/Button.js.map +1 -1
- package/dist/cssm/components/Calendar/Calendar.js +9 -7
- package/dist/cssm/components/Calendar/Calendar.js.map +1 -1
- package/dist/cssm/components/CalendarRange/CalendarRange.js +44 -31
- package/dist/cssm/components/CalendarRange/CalendarRange.js.map +1 -1
- package/dist/cssm/components/CalendarRange/types.js +3 -0
- package/dist/cssm/components/CalendarRange/types.js.map +1 -0
- package/dist/cssm/components/CalendarRange/utils.js +122 -0
- package/dist/cssm/components/CalendarRange/utils.js.map +1 -0
- package/dist/cssm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/cssm/components/ChipsInput/useChipsInput.js +21 -2
- package/dist/cssm/components/ChipsInput/useChipsInput.js.map +1 -1
- package/dist/cssm/components/ChipsInputBase/types.js.map +1 -1
- package/dist/cssm/components/Clickable/Clickable.js +4 -3
- package/dist/cssm/components/Clickable/Clickable.js.map +1 -1
- package/dist/cssm/components/Clickable/RealClickable.js +1 -1
- package/dist/cssm/components/Clickable/RealClickable.js.map +1 -1
- package/dist/cssm/components/ContentCard/ContentCard.js.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/DateInput/DateInput.js +45 -46
- package/dist/cssm/components/DateInput/DateInput.js.map +1 -1
- package/dist/cssm/components/DateRangeInput/DateRangeInput.js +148 -58
- package/dist/cssm/components/DateRangeInput/DateRangeInput.js.map +1 -1
- package/dist/cssm/components/FocusTrap/FocusTrap.js +4 -2
- package/dist/cssm/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/cssm/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore.js.map +1 -1
- package/dist/cssm/components/IconButton/IconButton.js.map +1 -1
- package/dist/cssm/components/InputLike/InputLike.js +3 -3
- package/dist/cssm/components/InputLike/InputLike.js.map +1 -1
- package/dist/cssm/components/Link/Link.js +1 -0
- package/dist/cssm/components/Link/Link.js.map +1 -1
- package/dist/cssm/components/MiniInfoCell/MiniInfoCell.js +1 -8
- package/dist/cssm/components/MiniInfoCell/MiniInfoCell.js.map +1 -1
- package/dist/cssm/components/ModalOutsideButton/ModalOutsideButton.js.map +1 -1
- package/dist/cssm/components/NumberInputLike/NumberInputLike.js +33 -0
- package/dist/cssm/components/NumberInputLike/NumberInputLike.js.map +1 -0
- package/dist/cssm/components/Pagination/PaginationPage/PaginationPageButton.js.map +1 -1
- package/dist/cssm/components/PanelHeader/PanelHeader.js.map +1 -1
- package/dist/cssm/components/PanelHeaderButton/PanelHeaderButton.js.map +1 -1
- package/dist/cssm/components/Radio/Radio.js.map +1 -1
- package/dist/cssm/components/Removable/Removable.js +39 -115
- package/dist/cssm/components/Removable/Removable.js.map +1 -1
- package/dist/cssm/components/Removable/Removable.module.css +9 -0
- package/dist/cssm/components/Removable/RemovableIos.js +118 -0
- package/dist/cssm/components/Removable/RemovableIos.js.map +1 -0
- package/dist/cssm/components/RichCell/RichCell.js.map +1 -1
- package/dist/cssm/components/ScreenSpinner/ScreenSpinner.js +2 -1
- package/dist/cssm/components/ScreenSpinner/ScreenSpinner.js.map +1 -1
- package/dist/cssm/components/ScreenSpinner/ScreenSpinnerContainer.js +3 -2
- package/dist/cssm/components/ScreenSpinner/ScreenSpinnerContainer.js.map +1 -1
- package/dist/cssm/components/SelectionControl/SelectionControl.js.map +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cssm/components/Skeleton/Skeleton.js +6 -3
- package/dist/cssm/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/cssm/components/Spinner/Spinner.js +5 -2
- package/dist/cssm/components/Spinner/Spinner.js.map +1 -1
- package/dist/cssm/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/cssm/components/Tabs/Tabs.js +10 -9
- package/dist/cssm/components/Tabs/Tabs.js.map +1 -1
- package/dist/cssm/components/Tabs/TabsController.js +19 -0
- package/dist/cssm/components/Tabs/TabsController.js.map +1 -0
- package/dist/cssm/components/Tabs/TabsModeContext.js +11 -0
- package/dist/cssm/components/Tabs/TabsModeContext.js.map +1 -0
- package/dist/cssm/components/TabsItem/TabsItem.js +17 -4
- package/dist/cssm/components/TabsItem/TabsItem.js.map +1 -1
- package/dist/cssm/components/Tappable/Tappable.js.map +1 -1
- package/dist/cssm/components/ToolButton/ToolButton.js.map +1 -1
- package/dist/cssm/components/View/ViewInfinite.js.map +1 -1
- package/dist/cssm/hooks/useCalendar.js +0 -10
- package/dist/cssm/hooks/useCalendar.js.map +1 -1
- package/dist/cssm/hooks/useDateInput.js +28 -17
- package/dist/cssm/hooks/useDateInput.js.map +1 -1
- package/dist/cssm/hooks/useEventListener.js.map +1 -1
- package/dist/cssm/hooks/useExternRef.js.map +1 -1
- package/dist/cssm/hooks/useFocusTrap.js +2 -2
- package/dist/cssm/hooks/useFocusTrap.js.map +1 -1
- package/dist/cssm/hooks/useMutationObserver.js +6 -5
- package/dist/cssm/hooks/useMutationObserver.js.map +1 -1
- package/dist/cssm/lib/dom.js +7 -1
- package/dist/cssm/lib/dom.js.map +1 -1
- package/dist/cssm/lib/floating/customResizeObserver.js.map +1 -1
- package/dist/cssm/lib/floating/index.js.map +1 -1
- package/dist/cssm/lib/floating/types/common.js.map +1 -1
- package/dist/cssm/lib/sheet/controllers/BottomSheetController.js.map +1 -1
- package/dist/cssm/lib/sheet/controllers/CSSTransitionController.js.map +1 -1
- package/dist/cssm/styles/animationVisibilityDelay.js +10 -0
- package/dist/cssm/styles/animationVisibilityDelay.js.map +1 -0
- package/dist/cssm/styles/animationVisibilityDelay.module.css +13 -0
- package/dist/cssm/styles/themes.css +4 -2
- package/dist/hooks/useCalendar.d.ts +0 -3
- package/dist/hooks/useCalendar.d.ts.map +1 -1
- package/dist/hooks/useCalendar.js +0 -10
- package/dist/hooks/useCalendar.js.map +1 -1
- package/dist/hooks/useDateInput.d.ts.map +1 -1
- package/dist/hooks/useDateInput.js +29 -18
- package/dist/hooks/useDateInput.js.map +1 -1
- package/dist/hooks/useEventListener.js.map +1 -1
- package/dist/hooks/useExternRef.js.map +1 -1
- package/dist/hooks/useFocusTrap.d.ts +5 -1
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +2 -2
- package/dist/hooks/useFocusTrap.js.map +1 -1
- package/dist/hooks/useMutationObserver.d.ts +2 -1
- package/dist/hooks/useMutationObserver.d.ts.map +1 -1
- package/dist/hooks/useMutationObserver.js +6 -5
- package/dist/hooks/useMutationObserver.js.map +1 -1
- package/dist/lib/dom.d.ts.map +1 -1
- package/dist/lib/dom.js +7 -1
- package/dist/lib/dom.js.map +1 -1
- package/dist/lib/floating/customResizeObserver.js.map +1 -1
- package/dist/lib/floating/index.d.ts +1 -1
- package/dist/lib/floating/index.d.ts.map +1 -1
- package/dist/lib/floating/index.js.map +1 -1
- package/dist/lib/floating/types/common.d.ts +1 -1
- package/dist/lib/floating/types/common.d.ts.map +1 -1
- package/dist/lib/floating/types/common.js.map +1 -1
- package/dist/lib/sheet/controllers/BottomSheetController.js.map +1 -1
- package/dist/lib/sheet/controllers/CSSTransitionController.js.map +1 -1
- package/dist/styles/animationVisibilityDelay.d.ts +3 -0
- package/dist/styles/animationVisibilityDelay.d.ts.map +1 -0
- package/dist/styles/animationVisibilityDelay.js +10 -0
- package/dist/styles/animationVisibilityDelay.js.map +1 -0
- package/dist/vkui.css +1 -1
- package/dist/vkui.css.map +1 -1
- package/package.json +3 -6
- package/src/components/ActionSheet/ActionSheet.tsx +4 -1
- package/src/components/AppRoot/AppRoot.mdx +1 -1
- package/src/components/AppRoot/ScrollContext.tsx +2 -2
- package/src/components/Banner/Banner.tsx +2 -2
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Calendar/Calendar.tsx +8 -7
- package/src/components/CalendarRange/CalendarRange.tsx +65 -42
- package/src/components/CalendarRange/types.ts +1 -0
- package/src/components/CalendarRange/utils.ts +190 -0
- package/src/components/Checkbox/Checkbox.tsx +2 -2
- package/src/components/ChipsInput/useChipsInput.ts +23 -2
- package/src/components/ChipsInputBase/types.ts +5 -1
- package/src/components/Clickable/Clickable.tsx +12 -4
- package/src/components/Clickable/RealClickable.tsx +1 -0
- package/src/components/ContentCard/ContentCard.tsx +2 -2
- package/src/components/CustomSelect/CustomSelect.tsx +11 -7
- package/src/components/DateInput/DateInput.tsx +41 -43
- package/src/components/DateRangeInput/DateRangeInput.tsx +183 -65
- package/src/components/FocusTrap/FocusTrap.tsx +3 -0
- package/src/components/FormItem/FormItemTop/FormItemTop.mdx +1 -1
- package/src/components/HorizontalCell/HorizontalCell.tsx +2 -2
- package/src/components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore.tsx +2 -2
- package/src/components/IconButton/IconButton.tsx +2 -2
- package/src/components/InputLike/InputLike.tsx +4 -3
- package/src/components/Link/Link.tsx +3 -2
- package/src/components/MiniInfoCell/MiniInfoCell.tsx +2 -7
- package/src/components/ModalOutsideButton/ModalOutsideButton.tsx +2 -2
- package/src/components/NumberInputLike/NumberInputLike.tsx +56 -0
- package/src/components/Pagination/PaginationPage/PaginationPageButton.tsx +2 -2
- package/src/components/PanelHeader/PanelHeader.tsx +3 -1
- package/src/components/PanelHeaderButton/PanelHeaderButton.tsx +2 -2
- package/src/components/Radio/Radio.tsx +2 -2
- package/src/components/Removable/Removable.module.css +9 -0
- package/src/components/Removable/Removable.module.css.d.ts.map +1 -1
- package/src/components/Removable/Removable.tsx +50 -120
- package/src/components/Removable/RemovableIos.tsx +135 -0
- package/src/components/RichCell/RichCell.tsx +2 -2
- package/src/components/ScreenSpinner/ScreenSpinner.tsx +8 -1
- package/src/components/ScreenSpinner/ScreenSpinnerContainer.tsx +4 -1
- package/src/components/SelectionControl/SelectionControl.tsx +2 -2
- package/src/components/SimpleCell/SimpleCell.tsx +2 -2
- package/src/components/Skeleton/Skeleton.tsx +15 -2
- package/src/components/Spinner/Spinner.tsx +13 -1
- package/src/components/SubnavigationButton/SubnavigationButton.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +23 -19
- package/src/components/Tabs/TabsController.ts +37 -0
- package/src/components/Tabs/TabsModeContext.ts +24 -0
- package/src/components/TabsItem/TabsItem.tsx +22 -5
- package/src/components/Tappable/Tappable.tsx +5 -0
- package/src/components/ToolButton/ToolButton.tsx +2 -2
- package/src/components/UnstyledTextField/UnstyledTextField.mdx +1 -1
- package/src/hooks/useCalendar.ts +0 -12
- package/src/hooks/useDateInput.ts +21 -12
- package/src/hooks/useFocusTrap.ts +10 -1
- package/src/hooks/useMutationObserver.ts +7 -4
- package/src/lib/dom.tsx +7 -1
- package/src/lib/floating/index.ts +2 -0
- package/src/lib/floating/types/common.ts +2 -0
- package/src/styles/animationVisibilityDelay.module.css +13 -0
- package/src/styles/animationVisibilityDelay.module.css.d.ts.map +1 -0
- package/src/styles/animationVisibilityDelay.ts +13 -0
|
@@ -8,7 +8,7 @@ import { useAdaptivity } from '../../hooks/useAdaptivity';
|
|
|
8
8
|
import { useDateInput } from '../../hooks/useDateInput';
|
|
9
9
|
import { useCustomEnsuredControl } from '../../hooks/useEnsuredControl';
|
|
10
10
|
import { useExternRef } from '../../hooks/useExternRef';
|
|
11
|
-
import {
|
|
11
|
+
import { type UseFocusTrapProps } from '../../hooks/useFocusTrap';
|
|
12
12
|
import { format, isMatch, parse } from '../../lib/date';
|
|
13
13
|
import type { PlacementWithAuto } from '../../lib/floating';
|
|
14
14
|
import type { HasRootRef } from '../../types';
|
|
@@ -18,10 +18,12 @@ import {
|
|
|
18
18
|
type CalendarRangeTestsProps,
|
|
19
19
|
type DateRangeType,
|
|
20
20
|
} from '../CalendarRange/CalendarRange';
|
|
21
|
+
import { useConfigProvider } from '../ConfigProvider/ConfigProviderContext';
|
|
22
|
+
import { FocusTrap } from '../FocusTrap/FocusTrap';
|
|
21
23
|
import { FormField, type FormFieldProps } from '../FormField/FormField';
|
|
22
24
|
import { IconButton } from '../IconButton/IconButton';
|
|
23
|
-
import { InputLike } from '../InputLike/InputLike';
|
|
24
25
|
import { InputLikeDivider } from '../InputLike/InputLikeDivider';
|
|
26
|
+
import { NumberInputLike } from '../NumberInputLike/NumberInputLike';
|
|
25
27
|
import { Popper } from '../Popper/Popper';
|
|
26
28
|
import { Text } from '../Typography/Text/Text';
|
|
27
29
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';
|
|
@@ -88,6 +90,7 @@ export interface DateRangeInputProps
|
|
|
88
90
|
| 'nextMonthIcon'
|
|
89
91
|
| 'renderDayContent'
|
|
90
92
|
>,
|
|
93
|
+
Pick<UseFocusTrapProps, 'restoreFocus'>,
|
|
91
94
|
HasRootRef<HTMLDivElement>,
|
|
92
95
|
Omit<FormFieldProps, 'maxHeight'>,
|
|
93
96
|
DateRangeInputTestsProps {
|
|
@@ -107,6 +110,10 @@ export interface DateRangeInputProps
|
|
|
107
110
|
* Обработчик изменения состояния открытия календаря.
|
|
108
111
|
*/
|
|
109
112
|
onCalendarOpenChanged?: (opened: boolean) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Label для календаря.
|
|
115
|
+
*/
|
|
116
|
+
calendarLabel?: string;
|
|
110
117
|
/**
|
|
111
118
|
* Label для кнопки очистки. Делает доступным для ассистивных технологий.
|
|
112
119
|
*/
|
|
@@ -143,6 +150,21 @@ export interface DateRangeInputProps
|
|
|
143
150
|
* Отключение открытия календаря.
|
|
144
151
|
*/
|
|
145
152
|
disableCalendar?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Позволяет отключить захват фокуса при появлении календаря.
|
|
155
|
+
*/
|
|
156
|
+
disableFocusTrap?: UseFocusTrapProps['disabled'];
|
|
157
|
+
/**
|
|
158
|
+
* Включает режим в котором DateRangeInput доступен
|
|
159
|
+
* для ассистивных технологий.
|
|
160
|
+
* В этом режиме:
|
|
161
|
+
* - календарь больше не открывает при фокусе на DateRangeInput;
|
|
162
|
+
* - иконка календаря видна всегда, чтобы пользователи
|
|
163
|
+
* ассистивных технологий могли открыть календарь по клику на иконку;
|
|
164
|
+
* - календарь при открытии получает фокус, клавиатурный
|
|
165
|
+
* фокус зациклен и не выходит за пределы календаря пока календарь не закрыт.
|
|
166
|
+
*/
|
|
167
|
+
accessible?: boolean; // TODO [>=8]: включить по умолчанию.
|
|
146
168
|
}
|
|
147
169
|
|
|
148
170
|
const elementsConfig = (index: number) => {
|
|
@@ -185,6 +207,13 @@ const getInternalValue = (value: CalendarRangeProps['value']) => {
|
|
|
185
207
|
return newValue;
|
|
186
208
|
};
|
|
187
209
|
|
|
210
|
+
const CALENDAR_MUTATION_OBSERVER_OPTIONS: MutationObserverInit = {
|
|
211
|
+
childList: true,
|
|
212
|
+
subtree: true,
|
|
213
|
+
attributes: true,
|
|
214
|
+
attributeFilter: ['tabindex'],
|
|
215
|
+
};
|
|
216
|
+
|
|
188
217
|
/**
|
|
189
218
|
* @see https://vkcom.github.io/VKUI/#/DateRangeInput
|
|
190
219
|
*/
|
|
@@ -192,10 +221,10 @@ export const DateRangeInput = ({
|
|
|
192
221
|
shouldDisableDate,
|
|
193
222
|
disableFuture,
|
|
194
223
|
disablePast,
|
|
195
|
-
value: valueProp,
|
|
224
|
+
'value': valueProp,
|
|
196
225
|
defaultValue,
|
|
197
226
|
onChange,
|
|
198
|
-
calendarPlacement: calendarPlacementProp = 'bottom-start',
|
|
227
|
+
'calendarPlacement': calendarPlacementProp = 'bottom-start',
|
|
199
228
|
style,
|
|
200
229
|
className,
|
|
201
230
|
closeOnChange = true,
|
|
@@ -204,24 +233,24 @@ export const DateRangeInput = ({
|
|
|
204
233
|
name,
|
|
205
234
|
autoFocus,
|
|
206
235
|
disabled,
|
|
207
|
-
|
|
208
|
-
|
|
236
|
+
disableFocusTrap,
|
|
237
|
+
restoreFocus,
|
|
238
|
+
calendarLabel = 'Календарь',
|
|
209
239
|
prevMonthLabel = 'Предыдущий месяц',
|
|
210
240
|
nextMonthLabel = 'Следующий месяц',
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
changeEndYearLabel = 'Изменить год окончания',
|
|
241
|
+
changeMonthLabel = 'Месяц',
|
|
242
|
+
changeYearLabel = 'Год',
|
|
243
|
+
changeStartDayLabel = 'День начала',
|
|
244
|
+
changeStartMonthLabel = 'Месяц начала',
|
|
245
|
+
changeStartYearLabel = 'Год начала',
|
|
246
|
+
changeEndDayLabel = 'День окончания',
|
|
247
|
+
changeEndMonthLabel = 'Месяц окончания',
|
|
248
|
+
changeEndYearLabel = 'Год окончания',
|
|
220
249
|
clearFieldLabel = 'Очистить поле',
|
|
221
250
|
showCalendarLabel = 'Показать календарь',
|
|
251
|
+
'aria-label': ariaLabel = '',
|
|
222
252
|
prevMonthIcon,
|
|
223
253
|
nextMonthIcon,
|
|
224
|
-
disableCalendar = false,
|
|
225
254
|
onCalendarOpenChanged,
|
|
226
255
|
renderDayContent,
|
|
227
256
|
calendarTestsProps,
|
|
@@ -230,6 +259,9 @@ export const DateRangeInput = ({
|
|
|
230
259
|
clearButtonTestId,
|
|
231
260
|
showCalendarButtonTestId,
|
|
232
261
|
id,
|
|
262
|
+
accessible,
|
|
263
|
+
readOnly,
|
|
264
|
+
'disableCalendar': disableCalendarProp = false,
|
|
233
265
|
...props
|
|
234
266
|
}: DateRangeInputProps): React.ReactNode => {
|
|
235
267
|
const daysStartRef = React.useRef<HTMLSpanElement>(null);
|
|
@@ -239,6 +271,8 @@ export const DateRangeInput = ({
|
|
|
239
271
|
const monthsEndRef = React.useRef<HTMLSpanElement>(null);
|
|
240
272
|
const yearsEndRef = React.useRef<HTMLSpanElement>(null);
|
|
241
273
|
|
|
274
|
+
const disableCalendar = readOnly ? true : disableCalendarProp;
|
|
275
|
+
|
|
242
276
|
const _onChange = React.useCallback(
|
|
243
277
|
(newValue: DateRangeType | null | undefined) => onChange?.(newValue || undefined),
|
|
244
278
|
[onChange],
|
|
@@ -307,6 +341,7 @@ export const DateRangeInput = ({
|
|
|
307
341
|
open,
|
|
308
342
|
openCalendar,
|
|
309
343
|
closeCalendar,
|
|
344
|
+
toggleCalendar,
|
|
310
345
|
internalValue,
|
|
311
346
|
handleKeyDown,
|
|
312
347
|
setFocusedElement,
|
|
@@ -317,13 +352,14 @@ export const DateRangeInput = ({
|
|
|
317
352
|
maxElement: 5,
|
|
318
353
|
refs,
|
|
319
354
|
autoFocus,
|
|
320
|
-
disabled,
|
|
355
|
+
disabled: disabled || readOnly,
|
|
321
356
|
elementsConfig,
|
|
322
357
|
onClear,
|
|
323
358
|
onInternalValueChange,
|
|
324
359
|
getInternalValue,
|
|
325
360
|
value,
|
|
326
361
|
onCalendarOpenChanged,
|
|
362
|
+
accessible,
|
|
327
363
|
});
|
|
328
364
|
|
|
329
365
|
const { sizeY = 'none' } = useAdaptivity();
|
|
@@ -347,38 +383,87 @@ export const DateRangeInput = ({
|
|
|
347
383
|
const [calendarPlacement, setCalendarPlacement] =
|
|
348
384
|
React.useState<PlacementWithAuto>(calendarPlacementProp);
|
|
349
385
|
|
|
386
|
+
const { locale } = useConfigProvider();
|
|
387
|
+
const currentDateLabel = React.useMemo(() => {
|
|
388
|
+
if (!value) {
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
const [startDate, endDate] = value;
|
|
392
|
+
if (!startDate || !endDate) {
|
|
393
|
+
return null;
|
|
394
|
+
}
|
|
395
|
+
return [
|
|
396
|
+
new Intl.DateTimeFormat(locale, {
|
|
397
|
+
weekday: 'long',
|
|
398
|
+
year: 'numeric',
|
|
399
|
+
month: 'long',
|
|
400
|
+
day: 'numeric',
|
|
401
|
+
}).format(startDate),
|
|
402
|
+
new Intl.DateTimeFormat(locale, {
|
|
403
|
+
weekday: 'long',
|
|
404
|
+
year: 'numeric',
|
|
405
|
+
month: 'long',
|
|
406
|
+
day: 'numeric',
|
|
407
|
+
}).format(endDate),
|
|
408
|
+
].join(' - ');
|
|
409
|
+
}, [locale, value]);
|
|
410
|
+
|
|
411
|
+
const currentDateLabelId = React.useId();
|
|
412
|
+
const ariaLabelId = React.useId();
|
|
413
|
+
|
|
414
|
+
const showCalendarOnInputAreaClick = React.useCallback(() => {
|
|
415
|
+
handleFieldEnter();
|
|
416
|
+
if (accessible) {
|
|
417
|
+
openCalendar();
|
|
418
|
+
}
|
|
419
|
+
}, [handleFieldEnter, openCalendar, accessible]);
|
|
420
|
+
|
|
350
421
|
return (
|
|
351
422
|
<FormField
|
|
352
423
|
style={style}
|
|
353
424
|
className={classNames(sizeY !== 'regular' && sizeYClassNames[sizeY], className)}
|
|
354
425
|
getRootRef={handleRootRef}
|
|
426
|
+
role="group"
|
|
427
|
+
aria-labelledby={`${ariaLabelId} ${currentDateLabelId}`}
|
|
355
428
|
after={
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
<
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
<
|
|
369
|
-
|
|
370
|
-
|
|
429
|
+
<>
|
|
430
|
+
{!disableCalendar && (accessible || (!accessible && !value)) ? (
|
|
431
|
+
<IconButton
|
|
432
|
+
hoverMode="opacity"
|
|
433
|
+
label={showCalendarLabel}
|
|
434
|
+
onClick={toggleCalendar}
|
|
435
|
+
data-testid={showCalendarButtonTestId}
|
|
436
|
+
>
|
|
437
|
+
<Icon20CalendarOutline />
|
|
438
|
+
</IconButton>
|
|
439
|
+
) : null}
|
|
440
|
+
{value && !readOnly ? (
|
|
441
|
+
<IconButton
|
|
442
|
+
hoverMode="opacity"
|
|
443
|
+
label={clearFieldLabel}
|
|
444
|
+
onClick={clear}
|
|
445
|
+
data-testid={clearButtonTestId}
|
|
446
|
+
>
|
|
447
|
+
<Icon16Clear />
|
|
448
|
+
</IconButton>
|
|
449
|
+
) : null}
|
|
450
|
+
</>
|
|
371
451
|
}
|
|
372
452
|
disabled={disabled}
|
|
373
|
-
onClick={callMultiple(handleFieldEnter, onClick)}
|
|
374
|
-
onFocus={callMultiple(handleFieldEnter, onFocus)}
|
|
375
453
|
{...props}
|
|
376
454
|
>
|
|
377
455
|
<div className={dateInputStyles.wrapper}>
|
|
456
|
+
{ariaLabel && <VisuallyHidden id={ariaLabelId}>{ariaLabel}</VisuallyHidden>}
|
|
457
|
+
{currentDateLabel && (
|
|
458
|
+
<VisuallyHidden id={currentDateLabelId}>{currentDateLabel}</VisuallyHidden>
|
|
459
|
+
)}
|
|
378
460
|
<VisuallyHidden
|
|
379
461
|
id={id}
|
|
380
462
|
Component="input"
|
|
463
|
+
readOnly
|
|
464
|
+
aria-hidden
|
|
381
465
|
name={name}
|
|
466
|
+
tabIndex={readOnly ? 0 : -1}
|
|
382
467
|
value={
|
|
383
468
|
value
|
|
384
469
|
? `${value[0] ? format(value[0], 'dd.MM.yyyy') : ''} - ${
|
|
@@ -386,64 +471,89 @@ export const DateRangeInput = ({
|
|
|
386
471
|
}`
|
|
387
472
|
: ''
|
|
388
473
|
}
|
|
474
|
+
onFocus={handleFieldEnter}
|
|
389
475
|
/>
|
|
390
|
-
<Text className={dateInputStyles.input}
|
|
391
|
-
<
|
|
476
|
+
<Text className={dateInputStyles.input} onClick={showCalendarOnInputAreaClick}>
|
|
477
|
+
<NumberInputLike
|
|
478
|
+
value={internalValue[0]}
|
|
479
|
+
minValue={1}
|
|
480
|
+
maxValue={31}
|
|
481
|
+
onKeyDown={readOnly ? undefined : handleKeyDown}
|
|
392
482
|
length={2}
|
|
393
483
|
getRootRef={daysStartRef}
|
|
394
484
|
index={0}
|
|
485
|
+
readOnly={readOnly}
|
|
395
486
|
onElementSelect={setFocusedElement}
|
|
396
|
-
value={internalValue[0]}
|
|
397
487
|
label={changeStartDayLabel}
|
|
398
488
|
data-testid={startDateTestsProps?.day}
|
|
399
489
|
/>
|
|
400
490
|
<InputLikeDivider>.</InputLikeDivider>
|
|
401
|
-
<
|
|
491
|
+
<NumberInputLike
|
|
492
|
+
value={internalValue[1]}
|
|
493
|
+
minValue={1}
|
|
494
|
+
maxValue={12}
|
|
495
|
+
onKeyDown={handleKeyDown}
|
|
402
496
|
length={2}
|
|
403
497
|
getRootRef={monthsStartRef}
|
|
404
498
|
index={1}
|
|
405
499
|
onElementSelect={setFocusedElement}
|
|
406
|
-
|
|
500
|
+
readOnly={readOnly}
|
|
407
501
|
label={changeStartMonthLabel}
|
|
408
502
|
data-testid={startDateTestsProps?.month}
|
|
409
503
|
/>
|
|
410
504
|
<InputLikeDivider>.</InputLikeDivider>
|
|
411
|
-
<
|
|
505
|
+
<NumberInputLike
|
|
506
|
+
value={internalValue[2]}
|
|
507
|
+
minValue={1}
|
|
508
|
+
maxValue={275750}
|
|
509
|
+
onKeyDown={handleKeyDown}
|
|
412
510
|
length={4}
|
|
413
511
|
getRootRef={yearsStartRef}
|
|
414
512
|
index={2}
|
|
415
513
|
onElementSelect={setFocusedElement}
|
|
416
|
-
|
|
514
|
+
readOnly={readOnly}
|
|
417
515
|
label={changeStartYearLabel}
|
|
418
516
|
data-testid={startDateTestsProps?.year}
|
|
419
517
|
/>
|
|
420
518
|
<InputLikeDivider>{' — '}</InputLikeDivider>
|
|
421
|
-
<
|
|
519
|
+
<NumberInputLike
|
|
520
|
+
value={internalValue[3]}
|
|
521
|
+
minValue={1}
|
|
522
|
+
maxValue={31}
|
|
523
|
+
onKeyDown={handleKeyDown}
|
|
422
524
|
length={2}
|
|
423
525
|
getRootRef={daysEndRef}
|
|
424
526
|
index={3}
|
|
425
527
|
onElementSelect={setFocusedElement}
|
|
426
|
-
|
|
528
|
+
readOnly={readOnly}
|
|
427
529
|
label={changeEndDayLabel}
|
|
428
530
|
data-testid={endDateTestsProps?.day}
|
|
429
531
|
/>
|
|
430
532
|
<InputLikeDivider>.</InputLikeDivider>
|
|
431
|
-
<
|
|
533
|
+
<NumberInputLike
|
|
534
|
+
value={internalValue[4]}
|
|
535
|
+
minValue={1}
|
|
536
|
+
maxValue={12}
|
|
537
|
+
onKeyDown={handleKeyDown}
|
|
432
538
|
length={2}
|
|
433
539
|
getRootRef={monthsEndRef}
|
|
434
540
|
index={4}
|
|
435
541
|
onElementSelect={setFocusedElement}
|
|
436
|
-
|
|
542
|
+
readOnly={readOnly}
|
|
437
543
|
label={changeEndMonthLabel}
|
|
438
544
|
data-testid={endDateTestsProps?.month}
|
|
439
545
|
/>
|
|
440
546
|
<InputLikeDivider>.</InputLikeDivider>
|
|
441
|
-
<
|
|
547
|
+
<NumberInputLike
|
|
548
|
+
value={internalValue[5]}
|
|
549
|
+
minValue={1}
|
|
550
|
+
maxValue={275750}
|
|
551
|
+
onKeyDown={handleKeyDown}
|
|
442
552
|
length={4}
|
|
443
553
|
getRootRef={yearsEndRef}
|
|
444
554
|
index={5}
|
|
445
555
|
onElementSelect={setFocusedElement}
|
|
446
|
-
|
|
556
|
+
readOnly={readOnly}
|
|
447
557
|
label={changeEndYearLabel}
|
|
448
558
|
data-testid={endDateTestsProps?.year}
|
|
449
559
|
/>
|
|
@@ -456,25 +566,33 @@ export const DateRangeInput = ({
|
|
|
456
566
|
placement={calendarPlacement}
|
|
457
567
|
onPlacementChange={setCalendarPlacement}
|
|
458
568
|
>
|
|
459
|
-
<
|
|
460
|
-
value={value}
|
|
461
|
-
onChange={onCalendarChange}
|
|
462
|
-
disablePast={disablePast}
|
|
463
|
-
disableFuture={disableFuture}
|
|
464
|
-
shouldDisableDate={shouldDisableDate}
|
|
569
|
+
<FocusTrap
|
|
465
570
|
onClose={closeCalendar}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
571
|
+
disabled={disableFocusTrap ?? !accessible}
|
|
572
|
+
restoreFocus={restoreFocus ?? Boolean(accessible)}
|
|
573
|
+
captureEscapeKeyboardEvent={false}
|
|
574
|
+
mutationObserverOptions={CALENDAR_MUTATION_OBSERVER_OPTIONS}
|
|
575
|
+
>
|
|
576
|
+
<CalendarRange
|
|
577
|
+
value={value}
|
|
578
|
+
role="dialog"
|
|
579
|
+
onChange={onCalendarChange}
|
|
580
|
+
aria-label={calendarLabel}
|
|
581
|
+
disablePast={disablePast}
|
|
582
|
+
disableFuture={disableFuture}
|
|
583
|
+
shouldDisableDate={shouldDisableDate}
|
|
584
|
+
getRootRef={calendarRef}
|
|
585
|
+
disablePickers={disablePickers}
|
|
586
|
+
prevMonthLabel={prevMonthLabel}
|
|
587
|
+
nextMonthLabel={nextMonthLabel}
|
|
588
|
+
changeMonthLabel={changeMonthLabel}
|
|
589
|
+
changeYearLabel={changeYearLabel}
|
|
590
|
+
prevMonthIcon={prevMonthIcon}
|
|
591
|
+
nextMonthIcon={nextMonthIcon}
|
|
592
|
+
renderDayContent={renderDayContent}
|
|
593
|
+
{...calendarTestsProps}
|
|
594
|
+
/>
|
|
595
|
+
</FocusTrap>
|
|
478
596
|
</Popper>
|
|
479
597
|
)}
|
|
480
598
|
</FormField>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { type AllHTMLAttributes } from 'react';
|
|
4
4
|
import { useExternRef } from '../../hooks/useExternRef';
|
|
5
5
|
import { useFocusTrap, type UseFocusTrapProps } from '../../hooks/useFocusTrap';
|
|
6
|
+
import { DEFAULT_MUTATION_OBSERVER_OPTIONS } from '../../hooks/useMutationObserver';
|
|
6
7
|
import type { HasComponent, HasRootRef } from '../../types';
|
|
7
8
|
|
|
8
9
|
export interface FocusTrapProps<T extends HTMLElement = HTMLElement>
|
|
@@ -25,6 +26,7 @@ export const FocusTrap = <T extends HTMLElement = HTMLElement>({
|
|
|
25
26
|
getRootRef,
|
|
26
27
|
children,
|
|
27
28
|
captureEscapeKeyboardEvent = true,
|
|
29
|
+
mutationObserverOptions = DEFAULT_MUTATION_OBSERVER_OPTIONS,
|
|
28
30
|
...restProps
|
|
29
31
|
}: FocusTrapProps<T>): React.ReactNode => {
|
|
30
32
|
const ref = useExternRef<T>(getRootRef);
|
|
@@ -37,6 +39,7 @@ export const FocusTrap = <T extends HTMLElement = HTMLElement>({
|
|
|
37
39
|
timeout,
|
|
38
40
|
onClose,
|
|
39
41
|
captureEscapeKeyboardEvent,
|
|
42
|
+
mutationObserverOptions,
|
|
40
43
|
});
|
|
41
44
|
|
|
42
45
|
return (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Title, ArgTypes, Story, Stories, Description } from '@storybook/blocks';
|
|
1
|
+
import { Meta, Title, ArgTypes, Story, Stories, Description } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { FormItemTop } from './FormItemTop';
|
|
3
3
|
import { FormItemTopAside } from './FormItemTopAside';
|
|
4
4
|
import { FormItemTopLabel } from './FormItemTopLabel';
|
|
@@ -3,7 +3,7 @@ import { classNames, hasReactNode } from '@vkontakte/vkjs';
|
|
|
3
3
|
import { mergeStyle } from '../../helpers/mergeStyle';
|
|
4
4
|
import type { CSSCustomProperties, HasRef, HasRootRef, LiteralUnion } from '../../types';
|
|
5
5
|
import { Avatar } from '../Avatar/Avatar';
|
|
6
|
-
import { Tappable, type
|
|
6
|
+
import { Tappable, type TappableOmitProps } from '../Tappable/Tappable';
|
|
7
7
|
import { Caption } from '../Typography/Caption/Caption';
|
|
8
8
|
import { Footnote } from '../Typography/Footnote/Footnote';
|
|
9
9
|
import { Subhead } from '../Typography/Subhead/Subhead';
|
|
@@ -27,7 +27,7 @@ const textAlignClassNames = {
|
|
|
27
27
|
type HorizontalCellSizes = 's' | 'm' | 'l' | 'xl' | 'auto';
|
|
28
28
|
|
|
29
29
|
export interface HorizontalCellProps
|
|
30
|
-
extends Omit<
|
|
30
|
+
extends Omit<TappableOmitProps, 'size' | 'getRootRef' | 'title' | 'borderRadiusMode'>,
|
|
31
31
|
HasRootRef<HTMLDivElement>,
|
|
32
32
|
HasRef<HTMLDivElement> {
|
|
33
33
|
/**
|
|
@@ -2,7 +2,7 @@ import { Icon28ChevronRightCircle } from '@vkontakte/icons';
|
|
|
2
2
|
import { classNames } from '@vkontakte/vkjs';
|
|
3
3
|
import type { HasRef, HasRootRef, LiteralUnion } from '../../../types';
|
|
4
4
|
import type { ImageBaseSize } from '../../ImageBase/ImageBase';
|
|
5
|
-
import { Tappable, type
|
|
5
|
+
import { Tappable, type TappableOmitProps } from '../../Tappable/Tappable';
|
|
6
6
|
import { Subhead, type SubheadProps } from '../../Typography/Subhead/Subhead';
|
|
7
7
|
import styles from './HorizontalCellShowMore.module.css';
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ const sizeClassNames = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export interface HorizontalCellShowMoreProps
|
|
15
|
-
extends Omit<
|
|
15
|
+
extends Omit<TappableOmitProps, 'getRootRef' | 'size' | 'borderRadiusMode'>,
|
|
16
16
|
HasRef<HTMLElement>,
|
|
17
17
|
HasRootRef<HTMLDivElement> {
|
|
18
18
|
/**
|
|
@@ -5,7 +5,7 @@ import { useAdaptivity } from '../../hooks/useAdaptivity';
|
|
|
5
5
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
6
6
|
import { hasAccessibleName } from '../../lib/accessibility';
|
|
7
7
|
import { COMMON_WARNINGS, warnOnce } from '../../lib/warnOnce';
|
|
8
|
-
import { Tappable, type
|
|
8
|
+
import { Tappable, type TappableOmitProps } from '../Tappable/Tappable';
|
|
9
9
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';
|
|
10
10
|
import styles from './IconButton.module.css';
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ const sizeYClassNames = {
|
|
|
14
14
|
compact: styles.sizeYCompact,
|
|
15
15
|
} as const;
|
|
16
16
|
|
|
17
|
-
export interface IconButtonProps extends
|
|
17
|
+
export interface IconButtonProps extends TappableOmitProps {
|
|
18
18
|
/**
|
|
19
19
|
* Текст кнопки-иконки. Делает ее доступной для ассистивных технологий.
|
|
20
20
|
*/
|
|
@@ -35,9 +35,10 @@ export const InputLike = ({
|
|
|
35
35
|
length,
|
|
36
36
|
index,
|
|
37
37
|
onElementSelect,
|
|
38
|
-
onClick,
|
|
39
38
|
onFocus,
|
|
40
39
|
label,
|
|
40
|
+
readOnly,
|
|
41
|
+
onKeyDown,
|
|
41
42
|
...restProps
|
|
42
43
|
}: InputLikeProps) => {
|
|
43
44
|
const handleElementSelect = React.useCallback(
|
|
@@ -52,9 +53,9 @@ export const InputLike = ({
|
|
|
52
53
|
<RootComponent
|
|
53
54
|
Component="span"
|
|
54
55
|
baseClassName={value?.length === length ? styles.host : undefined}
|
|
55
|
-
tabIndex={0}
|
|
56
|
-
onClick={onClick}
|
|
56
|
+
tabIndex={readOnly ? -1 : 0}
|
|
57
57
|
onFocus={callMultiple(onFocus, handleElementSelect)}
|
|
58
|
+
onKeyDown={readOnly ? undefined : onKeyDown}
|
|
58
59
|
{...restProps}
|
|
59
60
|
>
|
|
60
61
|
{label && <VisuallyHidden>{label}</VisuallyHidden>}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import { classNames } from '@vkontakte/vkjs';
|
|
3
|
-
import { Tappable, type
|
|
3
|
+
import { Tappable, type TappableOmitProps } from '../Tappable/Tappable';
|
|
4
4
|
import styles from './Link.module.css';
|
|
5
5
|
|
|
6
|
-
export interface LinkProps extends
|
|
6
|
+
export interface LinkProps extends TappableOmitProps {
|
|
7
7
|
/**
|
|
8
8
|
* Иконка слева.
|
|
9
9
|
*/
|
|
@@ -41,6 +41,7 @@ export const Link = ({
|
|
|
41
41
|
activeMode="opacity"
|
|
42
42
|
hoverMode={styles.hover}
|
|
43
43
|
focusVisibleMode="outside"
|
|
44
|
+
DefaultComponent="span"
|
|
44
45
|
{...restProps}
|
|
45
46
|
baseClassName={classNames(
|
|
46
47
|
styles.host,
|
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { Icon16Chevron } from '@vkontakte/icons';
|
|
3
3
|
import { classNames, hasReactNode } from '@vkontakte/vkjs';
|
|
4
4
|
import type { HTMLAttributesWithRootRef } from '../../types';
|
|
5
|
-
import { RootComponent } from '../RootComponent/RootComponent';
|
|
6
5
|
import { Tappable } from '../Tappable/Tappable';
|
|
7
6
|
import { Paragraph } from '../Typography/Paragraph/Paragraph';
|
|
8
7
|
import styles from './MiniInfoCell.module.css';
|
|
@@ -88,13 +87,9 @@ export const MiniInfoCell = ({
|
|
|
88
87
|
</React.Fragment>
|
|
89
88
|
);
|
|
90
89
|
|
|
91
|
-
return
|
|
92
|
-
<Tappable
|
|
90
|
+
return (
|
|
91
|
+
<Tappable {...restProps} baseClassName={cellClasses}>
|
|
93
92
|
{cellContent}
|
|
94
93
|
</Tappable>
|
|
95
|
-
) : (
|
|
96
|
-
<RootComponent {...restProps} baseClassName={cellClasses}>
|
|
97
|
-
{cellContent}
|
|
98
|
-
</RootComponent>
|
|
99
94
|
);
|
|
100
95
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { Tappable, type
|
|
4
|
+
import { Tappable, type TappableOmitProps } from '../Tappable/Tappable';
|
|
5
5
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';
|
|
6
6
|
import styles from './ModalOutsideButton.module.css';
|
|
7
7
|
|
|
8
|
-
export interface ModalOutsideButtonProps extends
|
|
8
|
+
export interface ModalOutsideButtonProps extends TappableOmitProps {
|
|
9
9
|
/**
|
|
10
10
|
* Текст для скринридера.
|
|
11
11
|
*/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { InputLike, type InputLikeProps } from '../InputLike/InputLike';
|
|
4
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
5
|
+
|
|
6
|
+
export interface NumberInputLikeProps extends Omit<InputLikeProps, 'value'> {
|
|
7
|
+
value?: number | string;
|
|
8
|
+
maxValue?: number;
|
|
9
|
+
minValue?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const stringifyValue = (
|
|
13
|
+
value: NumberInputLikeProps['value'],
|
|
14
|
+
length: number,
|
|
15
|
+
): string | undefined => {
|
|
16
|
+
if (value === undefined) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
if (typeof value === 'string') {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
return String(value).padStart(length, '0');
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const NumberInputLike: React.FC<NumberInputLikeProps> = ({
|
|
26
|
+
value,
|
|
27
|
+
length,
|
|
28
|
+
minValue,
|
|
29
|
+
maxValue,
|
|
30
|
+
readOnly,
|
|
31
|
+
disabled,
|
|
32
|
+
label,
|
|
33
|
+
onKeyDown,
|
|
34
|
+
'aria-label': ariaLabel,
|
|
35
|
+
...restProps
|
|
36
|
+
}) => {
|
|
37
|
+
const stringValue = stringifyValue(value, length);
|
|
38
|
+
return (
|
|
39
|
+
<InputLike
|
|
40
|
+
role="spinbutton"
|
|
41
|
+
value={stringValue}
|
|
42
|
+
length={length}
|
|
43
|
+
aria-valuemin={minValue}
|
|
44
|
+
aria-valuemax={maxValue}
|
|
45
|
+
aria-valuenow={value !== undefined ? Number(value) : undefined}
|
|
46
|
+
aria-valuetext={stringValue}
|
|
47
|
+
aria-readonly={readOnly}
|
|
48
|
+
aria-disabled={disabled}
|
|
49
|
+
aria-label={label}
|
|
50
|
+
label={label}
|
|
51
|
+
tabIndex={readOnly ? -1 : 0}
|
|
52
|
+
onKeyDown={readOnly ? undefined : onKeyDown}
|
|
53
|
+
{...restProps}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { classNames } from '@vkontakte/vkjs';
|
|
5
5
|
import { type SizeTypeValues } from '../../../lib/adaptivity';
|
|
6
|
-
import { Tappable, type
|
|
6
|
+
import { Tappable, type TappableOmitProps } from '../../Tappable/Tappable';
|
|
7
7
|
import { Text } from '../../Typography/Text/Text';
|
|
8
8
|
import { VisuallyHidden } from '../../VisuallyHidden/VisuallyHidden';
|
|
9
9
|
import type { PaginationProps } from '../Pagination';
|
|
@@ -24,7 +24,7 @@ export interface PaginationPageButtonProps extends PaginationPageButtonOpts {
|
|
|
24
24
|
|
|
25
25
|
const getTappablePropsFromPaginationPage = (
|
|
26
26
|
opts: PaginationPageButtonOpts,
|
|
27
|
-
):
|
|
27
|
+
): TappableOmitProps & { 'data-page': number } => {
|
|
28
28
|
const {
|
|
29
29
|
isCurrent = false,
|
|
30
30
|
getPageLabel,
|