@vkontakte/vkui 4.19.0 → 4.22.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/.cache/.eslintcache +1 -1
- package/.cache/.stylelintcache +1 -1
- package/.cache/.tsbuildinfo +493 -125
- package/.cache/ts/src/components/ActionSheet/types.d.ts +2 -2
- package/.cache/ts/src/components/Alert/Alert.d.ts +1 -0
- package/.cache/ts/src/components/AppRoot/AppRootContext.d.ts +1 -0
- package/.cache/ts/src/components/Avatar/Avatar.d.ts +2 -0
- package/.cache/ts/src/components/Cell/Cell.d.ts +11 -0
- package/.cache/ts/src/components/Cell/CellCheckbox/CellCheckbox.d.ts +5 -0
- package/.cache/ts/src/components/Cell/CellDragger/CellDragger.d.ts +6 -0
- package/.cache/ts/src/components/Cell/useDraggable.d.ts +13 -0
- package/.cache/ts/src/components/CustomSelect/CustomSelect.d.ts +0 -1
- package/.cache/ts/src/components/DropdownIcon/DropdownIcon.d.ts +3 -0
- package/.cache/ts/src/components/FocusTrap/FocusTrap.d.ts +8 -0
- package/.cache/ts/src/components/FormField/FormField.d.ts +2 -3
- package/.cache/ts/src/components/FormItem/FormItem.d.ts +2 -3
- package/.cache/ts/src/components/FormLayout/FormLayout.d.ts +2 -4
- package/.cache/ts/src/components/GridAvatar/GridAvatar.d.ts +9 -0
- package/.cache/ts/src/components/HorizontalCell/HorizontalCell.d.ts +2 -3
- package/.cache/ts/src/components/HorizontalScroll/HorizontalScroll.d.ts +3 -2
- package/.cache/ts/src/components/InitialsAvatar/InitialsAvatar.d.ts +33 -0
- package/.cache/ts/src/components/Link/Link.d.ts +1 -2
- package/.cache/ts/src/components/ModalRoot/types.d.ts +0 -1
- package/.cache/ts/src/components/ModalRoot/useModalManager.d.ts +37 -0
- package/.cache/ts/src/components/PullToRefresh/PullToRefresh.d.ts +0 -1
- package/.cache/ts/src/components/Removable/Removable.d.ts +2 -1
- package/.cache/ts/src/components/SimpleCell/SimpleCell.d.ts +2 -2
- package/.cache/ts/src/components/SplitCol/SplitCol.d.ts +3 -3
- package/.cache/ts/src/components/SubnavigationBar/SubnavigationBar.d.ts +2 -1
- package/.cache/ts/src/components/Switch/Switch.d.ts +2 -3
- package/.cache/ts/src/components/Tappable/Tappable.d.ts +2 -3
- package/.cache/ts/src/components/Touch/Touch.d.ts +16 -17
- package/.cache/ts/src/components/Typography/Caption/Caption.d.ts +2 -2
- package/.cache/ts/src/components/Typography/Headline/Headline.d.ts +2 -2
- package/.cache/ts/src/components/Typography/Subhead/Subhead.d.ts +2 -2
- package/.cache/ts/src/components/Typography/Text/Text.d.ts +2 -3
- package/.cache/ts/src/components/Typography/Title/Title.d.ts +2 -2
- package/.cache/ts/src/components/View/utils.d.ts +2 -0
- package/.cache/ts/src/index.d.ts +4 -0
- package/.cache/ts/src/lib/accessibility.d.ts +4 -2
- package/.cache/ts/src/lib/is.d.ts +1 -0
- package/.cache/ts/src/lib/supportEvents.d.ts +3 -1
- package/.cache/ts/src/testing/utils.d.ts +2 -0
- package/.cache/ts/src/types.d.ts +3 -0
- package/dist/cjs/components/ActionSheet/ActionSheet.js +13 -12
- package/dist/cjs/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cjs/components/ActionSheet/ActionSheetDropdown.js +3 -1
- package/dist/cjs/components/ActionSheet/ActionSheetDropdown.js.map +1 -1
- package/dist/cjs/components/ActionSheet/ActionSheetDropdownDesktop.js +10 -5
- package/dist/cjs/components/ActionSheet/ActionSheetDropdownDesktop.js.map +1 -1
- package/dist/cjs/components/ActionSheet/types.d.ts +2 -2
- package/dist/cjs/components/Alert/Alert.d.ts +1 -0
- package/dist/cjs/components/Alert/Alert.js +12 -3
- package/dist/cjs/components/Alert/Alert.js.map +1 -1
- package/dist/cjs/components/AppRoot/AppRoot.js +2 -1
- package/dist/cjs/components/AppRoot/AppRoot.js.map +1 -1
- package/dist/cjs/components/AppRoot/AppRootContext.d.ts +1 -0
- package/dist/cjs/components/AppRoot/AppRootContext.js.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.d.ts +2 -0
- package/dist/cjs/components/Avatar/Avatar.js +7 -3
- package/dist/cjs/components/Avatar/Avatar.js.map +1 -1
- package/dist/cjs/components/Banner/Banner.js.map +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/Cell/Cell.d.ts +11 -0
- package/dist/cjs/components/Cell/Cell.js +109 -182
- package/dist/cjs/components/Cell/Cell.js.map +1 -1
- package/dist/cjs/components/Cell/CellCheckbox/CellCheckbox.d.ts +5 -0
- package/dist/cjs/components/Cell/CellCheckbox/CellCheckbox.js +50 -0
- package/dist/cjs/components/Cell/CellCheckbox/CellCheckbox.js.map +1 -0
- package/dist/cjs/components/Cell/CellDragger/CellDragger.d.ts +6 -0
- package/dist/cjs/components/Cell/CellDragger/CellDragger.js +53 -0
- package/dist/cjs/components/Cell/CellDragger/CellDragger.js.map +1 -0
- package/dist/cjs/components/Cell/useDraggable.d.ts +13 -0
- package/dist/cjs/components/Cell/useDraggable.js +140 -0
- package/dist/cjs/components/Cell/useDraggable.js.map +1 -0
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js +2 -2
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cjs/components/Counter/Counter.js.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.d.ts +0 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js +6 -4
- package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cjs/components/DatePicker/DatePicker.js +6 -4
- package/dist/cjs/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/cjs/components/DropdownIcon/DropdownIcon.d.ts +3 -0
- package/dist/cjs/components/DropdownIcon/DropdownIcon.js +37 -0
- package/dist/cjs/components/DropdownIcon/DropdownIcon.js.map +1 -0
- package/dist/cjs/components/FocusTrap/FocusTrap.d.ts +8 -0
- package/dist/cjs/components/FocusTrap/FocusTrap.js +165 -0
- package/dist/cjs/components/FocusTrap/FocusTrap.js.map +1 -0
- package/dist/cjs/components/FormField/FormField.d.ts +2 -3
- package/dist/cjs/components/FormField/FormField.js.map +1 -1
- package/dist/cjs/components/FormItem/FormItem.d.ts +2 -3
- package/dist/cjs/components/FormItem/FormItem.js.map +1 -1
- package/dist/cjs/components/FormLayout/FormLayout.d.ts +2 -4
- package/dist/cjs/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/cjs/components/FormLayoutGroup/FormLayoutGroup.js +1 -0
- package/dist/cjs/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/cjs/components/GridAvatar/GridAvatar.d.ts +9 -0
- package/dist/cjs/components/GridAvatar/GridAvatar.js +61 -0
- package/dist/cjs/components/GridAvatar/GridAvatar.js.map +1 -0
- package/dist/cjs/components/Header/Header.js.map +1 -1
- package/dist/cjs/components/HorizontalCell/HorizontalCell.d.ts +2 -3
- package/dist/cjs/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.d.ts +3 -2
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.js +10 -13
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/cjs/components/InitialsAvatar/InitialsAvatar.d.ts +33 -0
- package/dist/cjs/components/InitialsAvatar/InitialsAvatar.js +64 -0
- package/dist/cjs/components/InitialsAvatar/InitialsAvatar.js.map +1 -0
- package/dist/cjs/components/Link/Link.d.ts +1 -2
- package/dist/cjs/components/Link/Link.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRoot.js +184 -368
- package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRootContext.js +0 -3
- package/dist/cjs/components/ModalRoot/ModalRootContext.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRootDesktop.js +74 -244
- package/dist/cjs/components/ModalRoot/ModalRootDesktop.js.map +1 -1
- package/dist/cjs/components/ModalRoot/types.d.ts +0 -1
- package/dist/cjs/components/ModalRoot/types.js.map +1 -1
- package/dist/cjs/components/ModalRoot/useModalManager.d.ts +37 -0
- package/dist/cjs/components/ModalRoot/useModalManager.js +213 -0
- package/dist/cjs/components/ModalRoot/useModalManager.js.map +1 -0
- package/dist/cjs/components/NativeSelect/NativeSelect.js +2 -2
- package/dist/cjs/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cjs/components/PullToRefresh/PullToRefresh.d.ts +0 -1
- package/dist/cjs/components/PullToRefresh/PullToRefresh.js +34 -25
- package/dist/cjs/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/cjs/components/Removable/Removable.d.ts +2 -1
- package/dist/cjs/components/Removable/Removable.js +75 -66
- package/dist/cjs/components/Removable/Removable.js.map +1 -1
- package/dist/cjs/components/Root/Root.js +1 -0
- package/dist/cjs/components/Root/Root.js.map +1 -1
- package/dist/cjs/components/Search/Search.js +1 -1
- package/dist/cjs/components/Search/Search.js.map +1 -1
- package/dist/cjs/components/SelectMimicry/SelectMimicry.js +2 -2
- package/dist/cjs/components/SelectMimicry/SelectMimicry.js.map +1 -1
- package/dist/cjs/components/SimpleCell/SimpleCell.d.ts +2 -2
- package/dist/cjs/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cjs/components/SplitCol/SplitCol.d.ts +3 -3
- package/dist/cjs/components/SplitCol/SplitCol.js +2 -4
- package/dist/cjs/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/cjs/components/SubnavigationBar/SubnavigationBar.d.ts +2 -1
- package/dist/cjs/components/SubnavigationBar/SubnavigationBar.js +38 -11
- package/dist/cjs/components/SubnavigationBar/SubnavigationBar.js.map +1 -1
- package/dist/cjs/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.d.ts +2 -3
- package/dist/cjs/components/Switch/Switch.js +18 -8
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/Tappable/Tappable.d.ts +2 -3
- package/dist/cjs/components/Tappable/Tappable.js.map +1 -1
- package/dist/cjs/components/Textarea/Textarea.js +9 -7
- package/dist/cjs/components/Textarea/Textarea.js.map +1 -1
- package/dist/cjs/components/Touch/Touch.d.ts +16 -17
- package/dist/cjs/components/Touch/Touch.js +34 -14
- package/dist/cjs/components/Touch/Touch.js.map +1 -1
- package/dist/cjs/components/Typography/Caption/Caption.d.ts +2 -2
- package/dist/cjs/components/Typography/Caption/Caption.js +4 -2
- package/dist/cjs/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/cjs/components/Typography/Headline/Headline.d.ts +2 -2
- package/dist/cjs/components/Typography/Headline/Headline.js +2 -1
- package/dist/cjs/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/cjs/components/Typography/Subhead/Subhead.d.ts +2 -2
- package/dist/cjs/components/Typography/Subhead/Subhead.js +2 -1
- package/dist/cjs/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/cjs/components/Typography/Text/Text.d.ts +2 -3
- package/dist/cjs/components/Typography/Text/Text.js +2 -1
- package/dist/cjs/components/Typography/Text/Text.js.map +1 -1
- package/dist/cjs/components/Typography/Title/Title.d.ts +2 -2
- package/dist/cjs/components/Typography/Title/Title.js +9 -4
- package/dist/cjs/components/Typography/Title/Title.js.map +1 -1
- package/dist/cjs/components/View/View.js +68 -75
- package/dist/cjs/components/View/View.js.map +1 -1
- package/dist/cjs/components/View/ViewInfinite.js +78 -85
- package/dist/cjs/components/View/ViewInfinite.js.map +1 -1
- package/dist/cjs/components/View/utils.d.ts +2 -0
- package/dist/cjs/components/View/utils.js +13 -0
- package/dist/cjs/components/View/utils.js.map +1 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +16 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/accessibility.d.ts +4 -2
- package/dist/cjs/lib/accessibility.js +8 -1
- package/dist/cjs/lib/accessibility.js.map +1 -1
- package/dist/cjs/lib/is.d.ts +1 -0
- package/dist/cjs/lib/is.js +13 -0
- package/dist/cjs/lib/is.js.map +1 -0
- package/dist/cjs/lib/prefixClass.js +7 -6
- package/dist/cjs/lib/prefixClass.js.map +1 -1
- package/dist/cjs/lib/supportEvents.d.ts +3 -1
- package/dist/cjs/lib/supportEvents.js +1 -4
- package/dist/cjs/lib/supportEvents.js.map +1 -1
- package/dist/cjs/types.d.ts +3 -0
- package/dist/components/ActionSheet/ActionSheet.js +12 -12
- package/dist/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/components/ActionSheet/ActionSheetDropdown.js +2 -1
- package/dist/components/ActionSheet/ActionSheetDropdown.js.map +1 -1
- package/dist/components/ActionSheet/ActionSheetDropdownDesktop.js +9 -5
- package/dist/components/ActionSheet/ActionSheetDropdownDesktop.js.map +1 -1
- package/dist/components/ActionSheet/types.d.ts +2 -2
- package/dist/components/Alert/Alert.d.ts +1 -0
- package/dist/components/Alert/Alert.js +11 -3
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/AppRoot/AppRoot.js +2 -1
- package/dist/components/AppRoot/AppRoot.js.map +1 -1
- package/dist/components/AppRoot/AppRootContext.d.ts +1 -0
- package/dist/components/AppRoot/AppRootContext.js.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +2 -0
- package/dist/components/Avatar/Avatar.js +4 -2
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Cell/Cell.d.ts +11 -0
- package/dist/components/Cell/Cell.js +103 -177
- package/dist/components/Cell/Cell.js.map +1 -1
- package/dist/components/Cell/CellCheckbox/CellCheckbox.d.ts +5 -0
- package/dist/components/Cell/CellCheckbox/CellCheckbox.js +31 -0
- package/dist/components/Cell/CellCheckbox/CellCheckbox.js.map +1 -0
- package/dist/components/Cell/CellDragger/CellDragger.d.ts +6 -0
- package/dist/components/Cell/CellDragger/CellDragger.js +30 -0
- package/dist/components/Cell/CellDragger/CellDragger.js.map +1 -0
- package/dist/components/Cell/useDraggable.d.ts +13 -0
- package/dist/components/Cell/useDraggable.js +125 -0
- package/dist/components/Cell/useDraggable.js.map +1 -0
- package/dist/components/ChipsSelect/ChipsSelect.js +2 -2
- package/dist/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/components/Counter/Counter.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts +0 -1
- package/dist/components/CustomSelect/CustomSelect.js +6 -6
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +6 -4
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/DropdownIcon/DropdownIcon.d.ts +3 -0
- package/dist/components/DropdownIcon/DropdownIcon.js +19 -0
- package/dist/components/DropdownIcon/DropdownIcon.js.map +1 -0
- package/dist/components/FocusTrap/FocusTrap.d.ts +8 -0
- package/dist/components/FocusTrap/FocusTrap.js +138 -0
- package/dist/components/FocusTrap/FocusTrap.js.map +1 -0
- package/dist/components/FormField/FormField.d.ts +2 -3
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/FormItem/FormItem.d.ts +2 -3
- package/dist/components/FormItem/FormItem.js.map +1 -1
- package/dist/components/FormLayout/FormLayout.d.ts +2 -4
- package/dist/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/components/FormLayoutGroup/FormLayoutGroup.js +1 -0
- package/dist/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/components/GridAvatar/GridAvatar.d.ts +9 -0
- package/dist/components/GridAvatar/GridAvatar.js +41 -0
- package/dist/components/GridAvatar/GridAvatar.js.map +1 -0
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/HorizontalCell/HorizontalCell.d.ts +2 -3
- package/dist/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/components/HorizontalScroll/HorizontalScroll.d.ts +3 -2
- package/dist/components/HorizontalScroll/HorizontalScroll.js +10 -12
- package/dist/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/components/InitialsAvatar/InitialsAvatar.d.ts +33 -0
- package/dist/components/InitialsAvatar/InitialsAvatar.js +46 -0
- package/dist/components/InitialsAvatar/InitialsAvatar.js.map +1 -0
- package/dist/components/Link/Link.d.ts +1 -2
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/ModalRoot/ModalRoot.js +181 -371
- package/dist/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/components/ModalRoot/ModalRootContext.js +0 -3
- package/dist/components/ModalRoot/ModalRootContext.js.map +1 -1
- package/dist/components/ModalRoot/ModalRootDesktop.js +72 -248
- package/dist/components/ModalRoot/ModalRootDesktop.js.map +1 -1
- package/dist/components/ModalRoot/types.d.ts +0 -1
- package/dist/components/ModalRoot/types.js.map +1 -1
- package/dist/components/ModalRoot/useModalManager.d.ts +37 -0
- package/dist/components/ModalRoot/useModalManager.js +189 -0
- package/dist/components/ModalRoot/useModalManager.js.map +1 -0
- package/dist/components/NativeSelect/NativeSelect.js +2 -2
- package/dist/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/components/PullToRefresh/PullToRefresh.d.ts +0 -1
- package/dist/components/PullToRefresh/PullToRefresh.js +35 -25
- package/dist/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/components/Removable/Removable.d.ts +2 -1
- package/dist/components/Removable/Removable.js +73 -64
- package/dist/components/Removable/Removable.js.map +1 -1
- package/dist/components/Root/Root.js +1 -0
- package/dist/components/Root/Root.js.map +1 -1
- package/dist/components/Search/Search.js +1 -1
- package/dist/components/Search/Search.js.map +1 -1
- package/dist/components/SelectMimicry/SelectMimicry.js +2 -2
- package/dist/components/SelectMimicry/SelectMimicry.js.map +1 -1
- package/dist/components/SimpleCell/SimpleCell.d.ts +2 -2
- package/dist/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/components/SplitCol/SplitCol.d.ts +3 -3
- package/dist/components/SplitCol/SplitCol.js +2 -4
- package/dist/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/components/SubnavigationBar/SubnavigationBar.d.ts +2 -1
- package/dist/components/SubnavigationBar/SubnavigationBar.js +38 -11
- package/dist/components/SubnavigationBar/SubnavigationBar.js.map +1 -1
- package/dist/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -3
- package/dist/components/Switch/Switch.js +15 -8
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Tappable/Tappable.d.ts +2 -3
- package/dist/components/Tappable/Tappable.js.map +1 -1
- package/dist/components/Textarea/Textarea.js +9 -6
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Touch/Touch.d.ts +16 -17
- package/dist/components/Touch/Touch.js +34 -14
- package/dist/components/Touch/Touch.js.map +1 -1
- package/dist/components/Typography/Caption/Caption.d.ts +2 -2
- package/dist/components/Typography/Caption/Caption.js +4 -2
- package/dist/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/components/Typography/Headline/Headline.d.ts +2 -2
- package/dist/components/Typography/Headline/Headline.js +2 -1
- package/dist/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/components/Typography/Subhead/Subhead.d.ts +2 -2
- package/dist/components/Typography/Subhead/Subhead.js +2 -1
- package/dist/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/components/Typography/Text/Text.d.ts +2 -3
- package/dist/components/Typography/Text/Text.js +2 -1
- package/dist/components/Typography/Text/Text.js.map +1 -1
- package/dist/components/Typography/Title/Title.d.ts +2 -2
- package/dist/components/Typography/Title/Title.js +9 -4
- package/dist/components/Typography/Title/Title.js.map +1 -1
- package/dist/components/View/View.js +67 -75
- package/dist/components/View/View.js.map +1 -1
- package/dist/components/View/ViewInfinite.js +79 -87
- package/dist/components/View/ViewInfinite.js.map +1 -1
- package/dist/components/View/utils.d.ts +2 -0
- package/dist/components/View/utils.js +6 -0
- package/dist/components/View/utils.js.map +1 -0
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheet.js +12 -12
- package/dist/cssm/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheetDropdown.js +2 -1
- package/dist/cssm/components/ActionSheet/ActionSheetDropdown.js.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheetDropdownDesktop.js +9 -5
- package/dist/cssm/components/ActionSheet/ActionSheetDropdownDesktop.js.map +1 -1
- package/dist/cssm/components/Alert/Alert.js +11 -3
- package/dist/cssm/components/Alert/Alert.js.map +1 -1
- package/dist/cssm/components/AppRoot/AppRoot.js +2 -1
- package/dist/cssm/components/AppRoot/AppRoot.js.map +1 -1
- package/dist/cssm/components/AppRoot/AppRootContext.js.map +1 -1
- package/dist/cssm/components/Avatar/Avatar.js +4 -2
- package/dist/cssm/components/Avatar/Avatar.js.map +1 -1
- package/dist/cssm/components/Banner/Banner.js.map +1 -1
- package/dist/cssm/components/Button/Button.css +1 -1
- package/dist/cssm/components/Button/Button.js.map +1 -1
- package/dist/cssm/components/Cell/Cell.css +1 -1
- package/dist/cssm/components/Cell/Cell.js +103 -177
- package/dist/cssm/components/Cell/Cell.js.map +1 -1
- package/dist/cssm/components/Cell/CellCheckbox/CellCheckbox.css +1 -0
- package/dist/cssm/components/Cell/CellCheckbox/CellCheckbox.js +32 -0
- package/dist/cssm/components/Cell/CellCheckbox/CellCheckbox.js.map +1 -0
- package/dist/cssm/components/Cell/CellDragger/CellDragger.css +1 -0
- package/dist/cssm/components/Cell/CellDragger/CellDragger.js +31 -0
- package/dist/cssm/components/Cell/CellDragger/CellDragger.js.map +1 -0
- package/dist/cssm/components/Cell/useDraggable.js +125 -0
- package/dist/cssm/components/Cell/useDraggable.js.map +1 -0
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js +2 -2
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cssm/components/Counter/Counter.js.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js +6 -6
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/DatePicker/DatePicker.js +6 -4
- package/dist/cssm/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/cssm/components/DropdownIcon/DropdownIcon.css +1 -0
- package/dist/cssm/components/DropdownIcon/DropdownIcon.js +20 -0
- package/dist/cssm/components/DropdownIcon/DropdownIcon.js.map +1 -0
- package/dist/cssm/components/FocusTrap/FocusTrap.js +138 -0
- package/dist/cssm/components/FocusTrap/FocusTrap.js.map +1 -0
- package/dist/cssm/components/FocusVisible/FocusVisible.css +1 -1
- package/dist/cssm/components/FormField/FormField.css +1 -1
- package/dist/cssm/components/FormField/FormField.js.map +1 -1
- package/dist/cssm/components/FormItem/FormItem.css +1 -1
- package/dist/cssm/components/FormItem/FormItem.js.map +1 -1
- package/dist/cssm/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.css +1 -1
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.js +1 -0
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/cssm/components/Gallery/Gallery.css +1 -1
- package/dist/cssm/components/GridAvatar/GridAvatar.css +1 -0
- package/dist/cssm/components/GridAvatar/GridAvatar.js +42 -0
- package/dist/cssm/components/GridAvatar/GridAvatar.js.map +1 -0
- package/dist/cssm/components/Header/Header.js.map +1 -1
- package/dist/cssm/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScroll.js +10 -12
- package/dist/cssm/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScrollArrow.css +1 -1
- package/dist/cssm/components/IconButton/IconButton.css +1 -1
- package/dist/cssm/components/InitialsAvatar/InitialsAvatar.css +1 -0
- package/dist/cssm/components/InitialsAvatar/InitialsAvatar.js +52 -0
- package/dist/cssm/components/InitialsAvatar/InitialsAvatar.js.map +1 -0
- package/dist/cssm/components/Link/Link.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.js +181 -371
- package/dist/cssm/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRootContext.js +0 -3
- package/dist/cssm/components/ModalRoot/ModalRootContext.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRootDesktop.js +72 -248
- package/dist/cssm/components/ModalRoot/ModalRootDesktop.js.map +1 -1
- package/dist/cssm/components/ModalRoot/types.js.map +1 -1
- package/dist/cssm/components/ModalRoot/useModalManager.js +189 -0
- package/dist/cssm/components/ModalRoot/useModalManager.js.map +1 -0
- package/dist/cssm/components/NativeSelect/NativeSelect.js +2 -2
- package/dist/cssm/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cssm/components/PullToRefresh/PullToRefresh.js +35 -25
- package/dist/cssm/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/cssm/components/Removable/Removable.css +1 -1
- package/dist/cssm/components/Removable/Removable.js +73 -64
- package/dist/cssm/components/Removable/Removable.js.map +1 -1
- package/dist/cssm/components/Root/Root.css +1 -1
- package/dist/cssm/components/Root/Root.js +1 -0
- package/dist/cssm/components/Root/Root.js.map +1 -1
- package/dist/cssm/components/Search/Search.css +1 -1
- package/dist/cssm/components/Search/Search.js +1 -1
- package/dist/cssm/components/Search/Search.js.map +1 -1
- package/dist/cssm/components/Select/Select.css +1 -1
- package/dist/cssm/components/SelectMimicry/SelectMimicry.js +2 -2
- package/dist/cssm/components/SelectMimicry/SelectMimicry.js.map +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.css +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cssm/components/SplitCol/SplitCol.js +2 -4
- package/dist/cssm/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/cssm/components/SubnavigationBar/SubnavigationBar.js +38 -11
- package/dist/cssm/components/SubnavigationBar/SubnavigationBar.js.map +1 -1
- package/dist/cssm/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/cssm/components/Switch/Switch.css +1 -1
- package/dist/cssm/components/Switch/Switch.js +15 -8
- package/dist/cssm/components/Switch/Switch.js.map +1 -1
- package/dist/cssm/components/Tappable/Tappable.js.map +1 -1
- package/dist/cssm/components/Textarea/Textarea.js +9 -6
- package/dist/cssm/components/Textarea/Textarea.js.map +1 -1
- package/dist/cssm/components/Touch/Touch.js +34 -14
- package/dist/cssm/components/Touch/Touch.js.map +1 -1
- package/dist/cssm/components/Typography/Caption/Caption.js +4 -2
- package/dist/cssm/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/cssm/components/Typography/Headline/Headline.js +2 -1
- package/dist/cssm/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/cssm/components/Typography/Subhead/Subhead.js +2 -1
- package/dist/cssm/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/cssm/components/Typography/Text/Text.js +2 -1
- package/dist/cssm/components/Typography/Text/Text.js.map +1 -1
- package/dist/cssm/components/Typography/Title/Title.js +9 -4
- package/dist/cssm/components/Typography/Title/Title.js.map +1 -1
- package/dist/cssm/components/View/View.js +67 -75
- package/dist/cssm/components/View/View.js.map +1 -1
- package/dist/cssm/components/View/ViewInfinite.js +79 -87
- package/dist/cssm/components/View/ViewInfinite.js.map +1 -1
- package/dist/cssm/components/View/utils.js +6 -0
- package/dist/cssm/components/View/utils.js.map +1 -0
- package/dist/cssm/index.js +2 -0
- package/dist/cssm/index.js.map +1 -1
- package/dist/cssm/lib/accessibility.js +6 -0
- package/dist/cssm/lib/accessibility.js.map +1 -1
- package/dist/cssm/lib/is.js +6 -0
- package/dist/cssm/lib/is.js.map +1 -0
- package/dist/cssm/lib/prefixClass.js +7 -6
- package/dist/cssm/lib/prefixClass.js.map +1 -1
- package/dist/cssm/lib/supportEvents.js +1 -4
- package/dist/cssm/lib/supportEvents.js.map +1 -1
- package/dist/cssm/styles/components.css +1 -1
- package/dist/cssm/styles/themes.css +1 -1
- package/dist/cssm/styles/vkcom_light.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/accessibility.d.ts +4 -2
- package/dist/lib/accessibility.js +6 -0
- package/dist/lib/accessibility.js.map +1 -1
- package/dist/lib/is.d.ts +1 -0
- package/dist/lib/is.js +6 -0
- package/dist/lib/is.js.map +1 -0
- package/dist/lib/prefixClass.js +7 -6
- package/dist/lib/prefixClass.js.map +1 -1
- package/dist/lib/supportEvents.d.ts +3 -1
- package/dist/lib/supportEvents.js +1 -4
- package/dist/lib/supportEvents.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/vkui.css +2 -2
- package/dist/vkui.css.map +1 -1
- package/package.json +8 -4
- package/src/components/ActionSheet/ActionSheet.tsx +9 -7
- package/src/components/ActionSheet/ActionSheetDropdown.tsx +3 -2
- package/src/components/ActionSheet/ActionSheetDropdownDesktop.tsx +9 -5
- package/src/components/ActionSheet/Readme.md +18 -14
- package/src/components/ActionSheet/types.ts +2 -2
- package/src/components/Alert/Alert.tsx +11 -4
- package/src/components/Alert/Readme.md +15 -11
- package/src/components/AppRoot/AppRoot.tsx +1 -0
- package/src/components/AppRoot/AppRootContext.ts +1 -0
- package/src/components/Avatar/Avatar.tsx +5 -2
- package/src/components/Banner/Banner.tsx +4 -5
- package/src/components/Button/Button.css +26 -53
- package/src/components/Button/Button.tsx +2 -3
- package/src/components/Card/Readme.md +6 -6
- package/src/components/Cell/Cell.css +21 -58
- package/src/components/Cell/Cell.tsx +101 -162
- package/src/components/Cell/CellCheckbox/CellCheckbox.css +17 -0
- package/src/components/Cell/CellCheckbox/CellCheckbox.tsx +42 -0
- package/src/components/Cell/CellDragger/CellDragger.css +4 -0
- package/src/components/Cell/CellDragger/CellDragger.tsx +40 -0
- package/src/components/Cell/Readme.md +89 -51
- package/src/components/Cell/useDraggable.tsx +112 -0
- package/src/components/ChipsSelect/ChipsSelect.tsx +2 -2
- package/src/components/Counter/Counter.tsx +2 -2
- package/src/components/CustomSelect/CustomSelect.tsx +6 -5
- package/src/components/DatePicker/DatePicker.tsx +5 -5
- package/src/components/DropdownIcon/DropdownIcon.css +3 -0
- package/src/components/DropdownIcon/DropdownIcon.tsx +20 -0
- package/src/components/Epic/Readme.md +1 -1
- package/src/components/FocusTrap/FocusTrap.tsx +125 -0
- package/src/components/FocusVisible/FocusVisible.css +12 -4
- package/src/components/FormField/FormField.css +0 -1
- package/src/components/FormField/FormField.tsx +2 -2
- package/src/components/FormItem/FormItem.css +13 -14
- package/src/components/FormItem/FormItem.tsx +2 -3
- package/src/components/FormLayout/FormLayout.tsx +2 -4
- package/src/components/FormLayoutGroup/FormLayoutGroup.css +11 -7
- package/src/components/FormLayoutGroup/FormLayoutGroup.tsx +10 -1
- package/src/components/Gallery/Gallery.css +2 -3
- package/src/components/Gallery/Readme.md +89 -109
- package/src/components/GridAvatar/GridAvatar.css +37 -0
- package/src/components/GridAvatar/GridAvatar.tsx +55 -0
- package/src/components/GridAvatar/Readme.md +12 -0
- package/src/components/Group/Readme.md +18 -14
- package/src/components/Header/Header.tsx +4 -4
- package/src/components/HorizontalCell/HorizontalCell.tsx +3 -3
- package/src/components/HorizontalScroll/HorizontalScroll.tsx +14 -18
- package/src/components/HorizontalScroll/HorizontalScrollArrow.css +2 -2
- package/src/components/IconButton/IconButton.css +7 -0
- package/src/components/InitialsAvatar/InitialsAvatar.css +53 -0
- package/src/components/InitialsAvatar/InitialsAvatar.tsx +90 -0
- package/src/components/InitialsAvatar/Readme.md +14 -0
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/MiniInfoCell/Readme.md +66 -62
- package/src/components/ModalDismissButton/Readme.md +13 -10
- package/src/components/ModalRoot/ModalRoot.tsx +170 -344
- package/src/components/ModalRoot/ModalRootContext.tsx +0 -1
- package/src/components/ModalRoot/ModalRootDesktop.tsx +62 -243
- package/src/components/ModalRoot/Readme.md +35 -27
- package/src/components/ModalRoot/types.ts +0 -1
- package/src/components/ModalRoot/useModalManager.tsx +174 -0
- package/src/components/NativeSelect/NativeSelect.tsx +2 -2
- package/src/components/PullToRefresh/PullToRefresh.tsx +30 -25
- package/src/components/Removable/Removable.css +16 -63
- package/src/components/Removable/Removable.tsx +84 -64
- package/src/components/Root/Root.css +5 -0
- package/src/components/Root/Root.tsx +4 -1
- package/src/components/ScreenSpinner/Readme.md +13 -9
- package/src/components/Search/Search.css +1 -1
- package/src/components/Search/Search.tsx +3 -3
- package/src/components/Select/Select.css +1 -1
- package/src/components/SelectMimicry/SelectMimicry.tsx +2 -2
- package/src/components/SimpleCell/SimpleCell.css +10 -18
- package/src/components/SimpleCell/SimpleCell.tsx +3 -5
- package/src/components/SplitCol/SplitCol.tsx +4 -8
- package/src/components/SplitLayout/Readme.md +2 -2
- package/src/components/SubnavigationBar/Readme.md +90 -86
- package/src/components/SubnavigationBar/SubnavigationBar.tsx +32 -14
- package/src/components/SubnavigationButton/SubnavigationButton.tsx +2 -3
- package/src/components/Switch/Readme.md +6 -6
- package/src/components/Switch/Switch.css +46 -15
- package/src/components/Switch/Switch.tsx +16 -8
- package/src/components/Tappable/Tappable.tsx +2 -3
- package/src/components/Textarea/Readme.md +3 -0
- package/src/components/Textarea/Textarea.tsx +10 -6
- package/src/components/Touch/Touch.tsx +51 -31
- package/src/components/Typography/Caption/Caption.tsx +4 -4
- package/src/components/Typography/Headline/Headline.tsx +3 -3
- package/src/components/Typography/Subhead/Subhead.tsx +3 -3
- package/src/components/Typography/Text/Text.tsx +3 -4
- package/src/components/Typography/Title/Title.tsx +9 -5
- package/src/components/View/Readme.md +42 -56
- package/src/components/View/View.tsx +46 -61
- package/src/components/View/ViewInfinite.tsx +52 -67
- package/src/components/View/utils.ts +8 -0
- package/src/index.ts +4 -0
- package/src/lib/accessibility.ts +22 -2
- package/src/lib/is.ts +10 -0
- package/src/lib/prefixClass.ts +9 -6
- package/src/lib/supportEvents.ts +1 -4
- package/src/styles/components.css +4 -0
- package/src/styles/vkcom_light.css +3 -3
- package/src/testing/utils.tsx +41 -0
- package/src/types.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/vkui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.22.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"@types/jest": "^26.0.15",
|
|
38
38
|
"@types/jest-image-snapshot": "^4.1.3",
|
|
39
39
|
"@types/node": "^12.7.2",
|
|
40
|
-
"@types/react": "^16.
|
|
41
|
-
"@types/react-dom": "^16.
|
|
40
|
+
"@types/react": "^16.14.20",
|
|
41
|
+
"@types/react-dom": "^16.9.14",
|
|
42
42
|
"@types/webpack-dev-server": "^3.11.1",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "^2.28.0",
|
|
44
44
|
"@typescript-eslint/parser": "^2.0.0",
|
|
45
|
-
"@vkontakte/appearance": "https://github.com/VKCOM/Appearance#v9.
|
|
45
|
+
"@vkontakte/appearance": "https://github.com/VKCOM/Appearance#v9.29.0",
|
|
46
46
|
"@vkontakte/eslint-config": "2.5.0",
|
|
47
47
|
"@vkontakte/icons": "^1.109.0",
|
|
48
48
|
"@vkontakte/vk-bridge": "^2.1.3",
|
|
@@ -101,6 +101,10 @@
|
|
|
101
101
|
"webpack-merge": "^4.2.2",
|
|
102
102
|
"yargs": "^15.4.1"
|
|
103
103
|
},
|
|
104
|
+
"resolutions": {
|
|
105
|
+
"@types/react": "^16.14.20",
|
|
106
|
+
"@types/react-dom": "^16.9.14"
|
|
107
|
+
},
|
|
104
108
|
"bin": {
|
|
105
109
|
"generate_scheme": "./tasks/generate_scheme.js"
|
|
106
110
|
},
|
|
@@ -13,6 +13,7 @@ import { useAdaptivity } from '../../hooks/useAdaptivity';
|
|
|
13
13
|
import { useObjectMemo } from '../../hooks/useObjectMemo';
|
|
14
14
|
import { warnOnce } from '../../lib/warnOnce';
|
|
15
15
|
import { SharedDropdownProps, PopupDirection, ToggleRef } from './types';
|
|
16
|
+
import { noop } from '@vkontakte/vkjs';
|
|
16
17
|
import './ActionSheet.css';
|
|
17
18
|
|
|
18
19
|
export interface ActionSheetProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -53,11 +54,10 @@ export const ActionSheet: React.FC<ActionSheetProps> = ({
|
|
|
53
54
|
const [closing, setClosing] = React.useState(false);
|
|
54
55
|
const onClose = () => setClosing(true);
|
|
55
56
|
|
|
56
|
-
const
|
|
57
|
+
const closeAction = React.useRef<VoidFunction>(noop);
|
|
57
58
|
const afterClose = () => {
|
|
58
59
|
restProps.onClose();
|
|
59
|
-
|
|
60
|
-
setCloseAction(undefined);
|
|
60
|
+
closeAction.current();
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
if (process.env.NODE_ENV === 'development' && !restProps.onClose) {
|
|
@@ -67,7 +67,9 @@ export const ActionSheet: React.FC<ActionSheetProps> = ({
|
|
|
67
67
|
const { viewWidth, viewHeight, hasMouse } = useAdaptivity();
|
|
68
68
|
const isDesktop = viewWidth >= ViewWidth.SMALL_TABLET && (hasMouse || viewHeight >= ViewHeight.MEDIUM);
|
|
69
69
|
|
|
70
|
-
const
|
|
70
|
+
const timeout = platform === IOS ? 300 : 200;
|
|
71
|
+
|
|
72
|
+
const fallbackTransitionFinish = useTimeout(afterClose, timeout);
|
|
71
73
|
React.useEffect(() => {
|
|
72
74
|
if (closing) {
|
|
73
75
|
if (isDesktop) {
|
|
@@ -84,7 +86,7 @@ export const ActionSheet: React.FC<ActionSheetProps> = ({
|
|
|
84
86
|
event.persist();
|
|
85
87
|
|
|
86
88
|
if (autoclose) {
|
|
87
|
-
|
|
89
|
+
closeAction.current = () => action && action(event);
|
|
88
90
|
setClosing(true);
|
|
89
91
|
} else {
|
|
90
92
|
action && action(event);
|
|
@@ -109,9 +111,9 @@ export const ActionSheet: React.FC<ActionSheetProps> = ({
|
|
|
109
111
|
<ActionSheetContext.Provider value={contextValue}>
|
|
110
112
|
<DropdownComponent
|
|
111
113
|
closing={closing}
|
|
112
|
-
|
|
113
|
-
onTransitionEnd={closing && !isDesktop ? afterClose : null}
|
|
114
|
+
timeout={timeout}
|
|
114
115
|
{...restProps as Omit<SharedDropdownProps, 'closing'>}
|
|
116
|
+
onClose={onClose}
|
|
115
117
|
>
|
|
116
118
|
{(hasReactNode(header) || hasReactNode(text)) &&
|
|
117
119
|
<header vkuiClass="ActionSheet__header">
|
|
@@ -3,6 +3,7 @@ import { getClassName } from '../../helpers/getClassName';
|
|
|
3
3
|
import { classNames } from '../../lib/classNames';
|
|
4
4
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
5
5
|
import { SharedDropdownProps } from './types';
|
|
6
|
+
import { FocusTrap } from '../FocusTrap/FocusTrap';
|
|
6
7
|
import './ActionSheet.css';
|
|
7
8
|
|
|
8
9
|
const stopPropagation: React.MouseEventHandler = (e) => e.stopPropagation();
|
|
@@ -19,7 +20,7 @@ export const ActionSheetDropdown: React.FC<SharedDropdownProps> = ({
|
|
|
19
20
|
const baseClaseName = getClassName('ActionSheet', platform);
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
|
-
<
|
|
23
|
+
<FocusTrap
|
|
23
24
|
{...restProps}
|
|
24
25
|
onClick={stopPropagation}
|
|
25
26
|
vkuiClass={classNames(baseClaseName, {
|
|
@@ -27,6 +28,6 @@ export const ActionSheetDropdown: React.FC<SharedDropdownProps> = ({
|
|
|
27
28
|
})}
|
|
28
29
|
>
|
|
29
30
|
{children}
|
|
30
|
-
</
|
|
31
|
+
</FocusTrap>
|
|
31
32
|
);
|
|
32
33
|
};
|
|
@@ -8,6 +8,7 @@ import { warnOnce } from '../../lib/warnOnce';
|
|
|
8
8
|
import { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';
|
|
9
9
|
import { useEventListener } from '../../hooks/useEventListener';
|
|
10
10
|
import { SharedDropdownProps } from './types';
|
|
11
|
+
import { FocusTrap } from '../FocusTrap/FocusTrap';
|
|
11
12
|
import './ActionSheet.css';
|
|
12
13
|
|
|
13
14
|
const warn = warnOnce('ActionSheet');
|
|
@@ -53,7 +54,7 @@ export const ActionSheetDropdownDesktop: React.FC<SharedDropdownProps> = ({
|
|
|
53
54
|
});
|
|
54
55
|
}, [toggleRef]);
|
|
55
56
|
|
|
56
|
-
const bodyClickListener = useEventListener('click', (e) => {
|
|
57
|
+
const bodyClickListener = useEventListener('click', (e: MouseEvent) => {
|
|
57
58
|
const dropdownElement = elementRef?.current;
|
|
58
59
|
if (dropdownElement && !dropdownElement.contains(e.target as Node)) {
|
|
59
60
|
onClose();
|
|
@@ -66,17 +67,20 @@ export const ActionSheetDropdownDesktop: React.FC<SharedDropdownProps> = ({
|
|
|
66
67
|
});
|
|
67
68
|
}, []);
|
|
68
69
|
|
|
70
|
+
const onClick = React.useCallback((e) => e.stopPropagation(), []);
|
|
71
|
+
|
|
69
72
|
return (
|
|
70
|
-
<
|
|
73
|
+
<FocusTrap
|
|
74
|
+
onClose={onClose}
|
|
71
75
|
{...restProps}
|
|
72
|
-
|
|
73
|
-
onClick={
|
|
76
|
+
getRootRef={elementRef}
|
|
77
|
+
onClick={onClick}
|
|
74
78
|
style={dropdownStyles}
|
|
75
79
|
vkuiClass={classNames(getClassName('ActionSheet', platform), 'ActionSheet--desktop', {
|
|
76
80
|
'ActionSheet--closing': closing,
|
|
77
81
|
}, `ActionSheet--sizeY-${sizeY}`)}
|
|
78
82
|
>
|
|
79
83
|
{children}
|
|
80
|
-
</
|
|
84
|
+
</FocusTrap>
|
|
81
85
|
);
|
|
82
86
|
};
|
|
@@ -11,7 +11,7 @@ ActionSheet – имитация [нативного компонента](https
|
|
|
11
11
|
> В коде примера ниже можно посмотреть, как добавить такой элемент.
|
|
12
12
|
Для Android версии он не нужен.
|
|
13
13
|
|
|
14
|
-
```jsx
|
|
14
|
+
```jsx { "props": { "layout": false, "adaptivity": true } }
|
|
15
15
|
const [popout, setPopout] = useState(null);
|
|
16
16
|
const onClose = () => setPopout(null);
|
|
17
17
|
const [filter, setFilter] = useState('best');
|
|
@@ -192,17 +192,21 @@ const openBaseTop = () => setPopout(
|
|
|
192
192
|
|
|
193
193
|
React.useEffect(openBase, []);
|
|
194
194
|
|
|
195
|
-
<
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
<
|
|
199
|
-
<
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
</
|
|
195
|
+
<SplitLayout popout={popout}>
|
|
196
|
+
<SplitCol>
|
|
197
|
+
<View activePanel="panel">
|
|
198
|
+
<Panel id="panel">
|
|
199
|
+
<PanelHeader>ActionSheet</PanelHeader>
|
|
200
|
+
<Group>
|
|
201
|
+
<CellButton getRootRef={baseTargetRef} onClick={openBase}>Базовый список</CellButton>
|
|
202
|
+
<CellButton getRootRef={iconsTargetRef} onClick={openIcons}>Список с иконками</CellButton>
|
|
203
|
+
<CellButton getRootRef={subtitleTargetRef} onClick={openSubtitle}>С подзаголовком</CellButton>
|
|
204
|
+
<CellButton getRootRef={selectableTargetRef} onClick={openSelectable}>Выделяемые</CellButton>
|
|
205
|
+
<CellButton getRootRef={titleTargetRef} onClick={openTitle}>C заголовком</CellButton>
|
|
206
|
+
<CellButton getRootRef={baseTopTargetRef} onClick={openBaseTop}>Базовый список, открывается наверх на десктопах</CellButton>
|
|
207
|
+
</Group>
|
|
208
|
+
</Panel>
|
|
209
|
+
</View>
|
|
210
|
+
</SplitCol>
|
|
211
|
+
</SplitLayout>
|
|
208
212
|
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { FocusTrapProps } from '../FocusTrap/FocusTrap';
|
|
2
3
|
|
|
3
4
|
export type PopupDirection = 'top' | 'bottom' | ((elRef: React.RefObject<HTMLDivElement>) => 'top' | 'bottom');
|
|
4
5
|
export type ToggleRef = Element | null | undefined | React.RefObject<Element>;
|
|
5
6
|
|
|
6
|
-
export interface SharedDropdownProps extends React.
|
|
7
|
+
export interface SharedDropdownProps extends React.AllHTMLAttributes<HTMLElement>, FocusTrapProps {
|
|
7
8
|
closing: boolean;
|
|
8
|
-
onClose: VoidFunction;
|
|
9
9
|
toggleRef: ToggleRef;
|
|
10
10
|
popupDirection: PopupDirection;
|
|
11
11
|
}
|
|
@@ -14,6 +14,7 @@ import Headline from '../Typography/Headline/Headline';
|
|
|
14
14
|
import Title from '../Typography/Title/Title';
|
|
15
15
|
import Caption from '../Typography/Caption/Caption';
|
|
16
16
|
import ModalDismissButton from '../ModalDismissButton/ModalDismissButton';
|
|
17
|
+
import { FocusTrap } from '../FocusTrap/FocusTrap';
|
|
17
18
|
import './Alert.css';
|
|
18
19
|
|
|
19
20
|
export type AlertActionInterface = AlertProps['actions'][0] & React.AnchorHTMLAttributes<HTMLElement>;
|
|
@@ -59,6 +60,10 @@ class Alert extends React.Component<AlertProps, AlertState> {
|
|
|
59
60
|
actions: [],
|
|
60
61
|
};
|
|
61
62
|
|
|
63
|
+
private get timeout(): number {
|
|
64
|
+
return this.props.platform === ANDROID || this.props.platform === VKCOM ? 200 : 300;
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
onItemClick: ItemClickHander = (item: AlertActionInterface) => () => {
|
|
63
68
|
const { action, autoclose } = item;
|
|
64
69
|
|
|
@@ -94,7 +99,7 @@ class Alert extends React.Component<AlertProps, AlertState> {
|
|
|
94
99
|
this.element.current.addEventListener(transitionEvent.name, eventHandler);
|
|
95
100
|
} else {
|
|
96
101
|
clearTimeout(this.transitionFinishTimeout);
|
|
97
|
-
this.transitionFinishTimeout = setTimeout(eventHandler.bind(this), this.
|
|
102
|
+
this.transitionFinishTimeout = setTimeout(eventHandler.bind(this), this.timeout);
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
105
|
|
|
@@ -180,10 +185,12 @@ class Alert extends React.Component<AlertProps, AlertState> {
|
|
|
180
185
|
style={style}
|
|
181
186
|
onClick={this.onClose}
|
|
182
187
|
>
|
|
183
|
-
<
|
|
188
|
+
<FocusTrap
|
|
184
189
|
{...restProps}
|
|
185
|
-
|
|
190
|
+
getRootRef={this.element}
|
|
186
191
|
onClick={this.stopPropagation}
|
|
192
|
+
onClose={this.onClose}
|
|
193
|
+
timeout={this.timeout}
|
|
187
194
|
vkuiClass={classNames(getClassName('Alert', platform), {
|
|
188
195
|
'Alert--v': resolvedActionsLayout === 'vertical',
|
|
189
196
|
'Alert--h': resolvedActionsLayout === 'horizontal',
|
|
@@ -200,7 +207,7 @@ class Alert extends React.Component<AlertProps, AlertState> {
|
|
|
200
207
|
<footer vkuiClass="Alert__actions">
|
|
201
208
|
{actions.map(this.renderAction)}
|
|
202
209
|
</footer>
|
|
203
|
-
</
|
|
210
|
+
</FocusTrap>
|
|
204
211
|
</PopoutWrapper>
|
|
205
212
|
);
|
|
206
213
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
> 4. В VKCOM версии возможно только горизонтальное расположение кнопок.
|
|
23
23
|
> 5. Порядок кнопок должен быть одинаковым на всех платформах (см. пункт 2).
|
|
24
24
|
|
|
25
|
-
```jsx
|
|
25
|
+
```jsx { "props": { "layout": false, "adaptivity": true } }
|
|
26
26
|
class Example extends React.Component {
|
|
27
27
|
constructor(props) {
|
|
28
28
|
super(props);
|
|
@@ -96,16 +96,20 @@ class Example extends React.Component {
|
|
|
96
96
|
|
|
97
97
|
render() {
|
|
98
98
|
return (
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
<SplitLayout popout={this.state.popout}>
|
|
100
|
+
<SplitCol>
|
|
101
|
+
<View activePanel="alert">
|
|
102
|
+
<Panel id="alert">
|
|
103
|
+
<PanelHeader>Alert</PanelHeader>
|
|
104
|
+
<Group>
|
|
105
|
+
<CellButton onClick={this.openAction}>Лишить права</CellButton>
|
|
106
|
+
<CellButton onClick={this.openDeleteion}>Удалить документ</CellButton>
|
|
107
|
+
{this.state.actionsLog.map((value, i) => <Div key={i}>{value}</Div>)}
|
|
108
|
+
</Group>
|
|
109
|
+
</Panel>
|
|
110
|
+
</View>
|
|
111
|
+
</SplitCol>
|
|
112
|
+
</SplitLayout>
|
|
109
113
|
)
|
|
110
114
|
}
|
|
111
115
|
}
|
|
@@ -135,6 +135,7 @@ export const AppRoot: React.FC<AppRootProps> = withAdaptivity(({
|
|
|
135
135
|
appRoot: rootRef,
|
|
136
136
|
portalRoot: portalRoot,
|
|
137
137
|
embedded: mode === 'embedded',
|
|
138
|
+
keyboardInput: isKeyboardInputActive,
|
|
138
139
|
}}>
|
|
139
140
|
<ScrollContext.Provider value={scrollController}>
|
|
140
141
|
<IconSettingsProvider classPrefix="vkui" globalClasses={!noLegacyClasses}>
|
|
@@ -106,10 +106,13 @@ const Avatar: React.FC<AvatarProps> = ({
|
|
|
106
106
|
);
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
+
export const AVATAR_DEFAULT_SIZE = 48;
|
|
110
|
+
export const AVATAR_DEFAULT_SHADOW = true;
|
|
111
|
+
|
|
109
112
|
Avatar.defaultProps = {
|
|
110
|
-
size:
|
|
113
|
+
size: AVATAR_DEFAULT_SIZE,
|
|
111
114
|
mode: 'default',
|
|
112
|
-
shadow:
|
|
115
|
+
shadow: AVATAR_DEFAULT_SHADOW,
|
|
113
116
|
};
|
|
114
117
|
|
|
115
118
|
export default Avatar;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { HasComponent } from '../../types';
|
|
2
3
|
import { getClassName } from '../../helpers/getClassName';
|
|
3
4
|
import { classNames } from '../../lib/classNames';
|
|
4
5
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
@@ -75,17 +76,15 @@ export interface BannerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
75
76
|
actions?: React.ReactNode;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
Component?: React.ElementType;
|
|
80
|
-
}
|
|
79
|
+
type BannerTypographyProps = Pick<BannerProps, 'size'> & HasComponent;
|
|
81
80
|
|
|
82
|
-
const BannerHeader: React.FC<BannerTypographyProps> = ({ size, ...restProps }
|
|
81
|
+
const BannerHeader: React.FC<BannerTypographyProps> = ({ size, ...restProps }) => {
|
|
83
82
|
return size === 'm'
|
|
84
83
|
? <Title level="2" weight="medium" {...restProps} />
|
|
85
84
|
: <Headline weight="medium" {...restProps} />;
|
|
86
85
|
};
|
|
87
86
|
|
|
88
|
-
const BannerSubheader: React.FC<BannerTypographyProps> = ({ size, ...restProps }
|
|
87
|
+
const BannerSubheader: React.FC<BannerTypographyProps> = ({ size, ...restProps }) => {
|
|
89
88
|
return size === 'm'
|
|
90
89
|
? <Text weight="regular" {...restProps} />
|
|
91
90
|
: <Subhead weight="regular" {...restProps} />;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
text-decoration: none;
|
|
6
6
|
border: none;
|
|
7
|
-
min-height:
|
|
7
|
+
min-height: 28px;
|
|
8
8
|
margin: 0;
|
|
9
|
-
padding:
|
|
9
|
+
padding: 0;
|
|
10
10
|
user-select: none;
|
|
11
11
|
border-radius: 8px;
|
|
12
12
|
max-width: 100%;
|
|
@@ -24,8 +24,10 @@
|
|
|
24
24
|
align-items: center;
|
|
25
25
|
justify-content: center;
|
|
26
26
|
width: 100%;
|
|
27
|
-
height:
|
|
27
|
+
min-height: inherit;
|
|
28
|
+
padding: 1px 16px;
|
|
28
29
|
text-align: center;
|
|
30
|
+
box-sizing: border-box;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
.Button--aln-left .Button__in {
|
|
@@ -59,16 +61,13 @@
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
.Button__content {
|
|
62
|
-
padding-top: 4px;
|
|
63
|
-
padding-bottom: 6px;
|
|
64
64
|
white-space: nowrap;
|
|
65
65
|
text-overflow: ellipsis;
|
|
66
66
|
overflow: hidden;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.Button__content--caps {
|
|
70
|
-
|
|
71
|
-
padding-bottom: 7px;
|
|
70
|
+
transform: translateY(0);
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
.Button__spinner {
|
|
@@ -130,21 +129,6 @@
|
|
|
130
129
|
color: var(--white);
|
|
131
130
|
}
|
|
132
131
|
|
|
133
|
-
.Button--sz-m {
|
|
134
|
-
min-height: 36px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.Button--sz-m .Button__content {
|
|
138
|
-
padding-top: 5px;
|
|
139
|
-
padding-bottom: 7px;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.Button--sz-l {
|
|
143
|
-
min-height: 44px;
|
|
144
|
-
padding-left: 20px;
|
|
145
|
-
padding-right: 20px;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
132
|
.Button--sz-l .Button__before:not(:last-child) {
|
|
149
133
|
margin-right: 8px;
|
|
150
134
|
}
|
|
@@ -153,31 +137,29 @@
|
|
|
153
137
|
margin-left: 8px;
|
|
154
138
|
}
|
|
155
139
|
|
|
156
|
-
.Button--sz-l .Button__content {
|
|
157
|
-
padding-top: 10px;
|
|
158
|
-
padding-bottom: 12px;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
140
|
.Button--sz-l .Button__in {
|
|
162
141
|
justify-content: center;
|
|
142
|
+
padding-left: 20px;
|
|
143
|
+
padding-right: 20px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.Button:not(.Button--sz-s) .Button__content {
|
|
147
|
+
transform: translateY(-1px);
|
|
163
148
|
}
|
|
164
149
|
|
|
165
150
|
/**
|
|
166
151
|
* iOS
|
|
167
152
|
*/
|
|
168
153
|
.Button--ios {
|
|
154
|
+
min-height: 26px;
|
|
169
155
|
border-radius: 10px;
|
|
170
156
|
}
|
|
171
157
|
|
|
172
|
-
.Button--ios.Button--sz-l .Button__content {
|
|
173
|
-
padding-top: 9px;
|
|
174
|
-
padding-bottom: 11px;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
158
|
/**
|
|
178
159
|
* VKCOM
|
|
179
160
|
*/
|
|
180
161
|
.Button--vkcom {
|
|
162
|
+
min-height: 26px;
|
|
181
163
|
border-radius: 4px;
|
|
182
164
|
}
|
|
183
165
|
|
|
@@ -190,36 +172,27 @@
|
|
|
190
172
|
/**
|
|
191
173
|
* sizeY COMPACT
|
|
192
174
|
*/
|
|
193
|
-
.Button--
|
|
194
|
-
min-height:
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.Button--sizeY-compact .Button__content {
|
|
198
|
-
padding-top: 3px;
|
|
199
|
-
padding-bottom: 5px;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.Button--sizeY-compact .Button__content--caps {
|
|
203
|
-
padding-top: 5px;
|
|
204
|
-
padding-bottom: 5px;
|
|
175
|
+
.Button--sz-m {
|
|
176
|
+
min-height: 32px;
|
|
205
177
|
}
|
|
206
178
|
|
|
207
|
-
.Button--
|
|
208
|
-
min-height:
|
|
179
|
+
.Button--sz-l {
|
|
180
|
+
min-height: 36px;
|
|
209
181
|
}
|
|
210
182
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
183
|
+
/**
|
|
184
|
+
* sizeY REGULAR
|
|
185
|
+
*/
|
|
186
|
+
.Button--sizeY-regular {
|
|
187
|
+
min-height: 30px;
|
|
214
188
|
}
|
|
215
189
|
|
|
216
|
-
.Button--sizeY-
|
|
190
|
+
.Button--sizeY-regular.Button--sz-m {
|
|
217
191
|
min-height: 36px;
|
|
218
192
|
}
|
|
219
193
|
|
|
220
|
-
.Button--sizeY-
|
|
221
|
-
|
|
222
|
-
padding-bottom: 8px;
|
|
194
|
+
.Button--sizeY-regular.Button--sz-l {
|
|
195
|
+
min-height: 44px;
|
|
223
196
|
}
|
|
224
197
|
|
|
225
198
|
/**
|
|
@@ -6,7 +6,7 @@ import Title from '../Typography/Title/Title';
|
|
|
6
6
|
import Text from '../Typography/Text/Text';
|
|
7
7
|
import Subhead from '../Typography/Subhead/Subhead';
|
|
8
8
|
import Caption from '../Typography/Caption/Caption';
|
|
9
|
-
import { HasAlign } from '../../types';
|
|
9
|
+
import { HasAlign, HasComponent } from '../../types';
|
|
10
10
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
11
11
|
import { AdaptivityProps, SizeType, withAdaptivity } from '../../hoc/withAdaptivity';
|
|
12
12
|
import { Platform, IOS, VKCOM } from '../../lib/platform';
|
|
@@ -24,12 +24,11 @@ export interface VKUIButtonProps extends HasAlign {
|
|
|
24
24
|
|
|
25
25
|
export interface ButtonProps extends Omit<TappableProps, 'size'>, VKUIButtonProps {}
|
|
26
26
|
|
|
27
|
-
interface ButtonTypographyProps {
|
|
27
|
+
interface ButtonTypographyProps extends HasComponent {
|
|
28
28
|
size: ButtonProps['size'];
|
|
29
29
|
platform: Platform;
|
|
30
30
|
sizeY: AdaptivityProps['sizeY'];
|
|
31
31
|
children?: ButtonProps['children'];
|
|
32
|
-
Component?: React.ElementType;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
const ButtonTypography: React.FC<ButtonTypographyProps> = (props: ButtonTypographyProps) => {
|
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
<PanelHeader>Card</PanelHeader>
|
|
5
5
|
<Group>
|
|
6
6
|
<Group mode="plain" header={<Header mode="secondary">Дефолтный стиль</Header>}>
|
|
7
|
-
<CardGrid>
|
|
8
|
-
<Card
|
|
7
|
+
<CardGrid size="l">
|
|
8
|
+
<Card>
|
|
9
9
|
<div style={{ height: 96 }} />
|
|
10
10
|
</Card>
|
|
11
11
|
</CardGrid>
|
|
12
12
|
</Group>
|
|
13
13
|
<Group mode="plain" header={<Header mode="secondary">С внутренней обводкой</Header>}>
|
|
14
|
-
<CardGrid>
|
|
15
|
-
<Card
|
|
14
|
+
<CardGrid size="l">
|
|
15
|
+
<Card mode="outline">
|
|
16
16
|
<div style={{ height: 96 }} />
|
|
17
17
|
</Card>
|
|
18
18
|
</CardGrid>
|
|
19
19
|
</Group>
|
|
20
20
|
<Group mode="plain" header={<Header mode="secondary">С внешней тенью</Header>}>
|
|
21
|
-
<CardGrid>
|
|
22
|
-
<Card
|
|
21
|
+
<CardGrid size="l">
|
|
22
|
+
<Card mode="shadow">
|
|
23
23
|
<div style={{ height: 96 }} />
|
|
24
24
|
</Card>
|
|
25
25
|
</CardGrid>
|