@vkontakte/vkui 4.21.0 → 4.22.2
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 +271 -37
- 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/GridAvatar/GridAvatar.d.ts +9 -0
- package/.cache/ts/src/components/InitialsAvatar/InitialsAvatar.d.ts +33 -0
- package/.cache/ts/src/components/Removable/Removable.d.ts +2 -1
- package/.cache/ts/src/components/TabbarItem/TabbarItem.d.ts +3 -1
- package/.cache/ts/src/index.d.ts +4 -0
- package/dist/cjs/components/ActionSheet/ActionSheet.js +1 -12
- package/dist/cjs/components/ActionSheet/ActionSheet.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/CardScroll/CardScroll.js +1 -1
- package/dist/cjs/components/CardScroll/CardScroll.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 +142 -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/CustomSelect/CustomSelect.d.ts +0 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js +2 -3
- package/dist/cjs/components/CustomSelect/CustomSelect.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.js +3 -5
- package/dist/cjs/components/FocusTrap/FocusTrap.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/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/NativeSelect/NativeSelect.js +2 -2
- package/dist/cjs/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cjs/components/Progress/Progress.js +6 -3
- package/dist/cjs/components/Progress/Progress.js.map +1 -1
- package/dist/cjs/components/Removable/Removable.d.ts +2 -1
- package/dist/cjs/components/Removable/Removable.js +20 -10
- package/dist/cjs/components/Removable/Removable.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/Tabbar/Tabbar.js +3 -1
- package/dist/cjs/components/Tabbar/Tabbar.js.map +1 -1
- package/dist/cjs/components/TabbarItem/TabbarItem.d.ts +3 -1
- package/dist/cjs/components/TabbarItem/TabbarItem.js +29 -11
- package/dist/cjs/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/cjs/components/View/View.js +53 -42
- package/dist/cjs/components/View/View.js.map +1 -1
- package/dist/cjs/components/View/ViewInfinite.js +63 -52
- package/dist/cjs/components/View/ViewInfinite.js.map +1 -1
- 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/prefixClass.js +7 -6
- package/dist/cjs/lib/prefixClass.js.map +1 -1
- package/dist/components/ActionSheet/ActionSheet.js +1 -11
- package/dist/components/ActionSheet/ActionSheet.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/CardScroll/CardScroll.js +1 -1
- package/dist/components/CardScroll/CardScroll.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 +126 -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/CustomSelect/CustomSelect.d.ts +0 -1
- package/dist/components/CustomSelect/CustomSelect.js +3 -5
- package/dist/components/CustomSelect/CustomSelect.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.js +3 -5
- package/dist/components/FocusTrap/FocusTrap.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/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/NativeSelect/NativeSelect.js +2 -2
- package/dist/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/components/Progress/Progress.js +6 -3
- package/dist/components/Progress/Progress.js.map +1 -1
- package/dist/components/Removable/Removable.d.ts +2 -1
- package/dist/components/Removable/Removable.js +20 -11
- package/dist/components/Removable/Removable.js.map +1 -1
- package/dist/components/SelectMimicry/SelectMimicry.js +2 -2
- package/dist/components/SelectMimicry/SelectMimicry.js.map +1 -1
- package/dist/components/Tabbar/Tabbar.js +3 -1
- package/dist/components/Tabbar/Tabbar.js.map +1 -1
- package/dist/components/TabbarItem/TabbarItem.d.ts +3 -1
- package/dist/components/TabbarItem/TabbarItem.js +26 -10
- package/dist/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/components/View/View.js +53 -42
- package/dist/components/View/View.js.map +1 -1
- package/dist/components/View/ViewInfinite.js +65 -54
- 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 +1 -11
- package/dist/cssm/components/ActionSheet/ActionSheet.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/CardScroll/CardScroll.js +1 -1
- package/dist/cssm/components/CardScroll/CardScroll.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 +126 -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/CustomSelect/CustomSelect.js +3 -5
- package/dist/cssm/components/CustomSelect/CustomSelect.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 +3 -5
- package/dist/cssm/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/cssm/components/FormItem/FormItem.css +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/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/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/NativeSelect/NativeSelect.js +2 -2
- package/dist/cssm/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cssm/components/Progress/Progress.js +6 -3
- package/dist/cssm/components/Progress/Progress.js.map +1 -1
- package/dist/cssm/components/Removable/Removable.css +1 -1
- package/dist/cssm/components/Removable/Removable.js +20 -11
- package/dist/cssm/components/Removable/Removable.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/Tabbar/Tabbar.css +1 -1
- package/dist/cssm/components/Tabbar/Tabbar.js +3 -1
- package/dist/cssm/components/Tabbar/Tabbar.js.map +1 -1
- package/dist/cssm/components/TabbarItem/TabbarItem.css +1 -1
- package/dist/cssm/components/TabbarItem/TabbarItem.js +26 -10
- package/dist/cssm/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/cssm/components/TabsItem/TabsItem.css +1 -1
- package/dist/cssm/components/View/View.js +53 -42
- package/dist/cssm/components/View/View.js.map +1 -1
- package/dist/cssm/components/View/ViewInfinite.js +65 -54
- package/dist/cssm/components/View/ViewInfinite.js.map +1 -1
- package/dist/cssm/index.js +2 -0
- package/dist/cssm/index.js.map +1 -1
- package/dist/cssm/lib/prefixClass.js +7 -6
- package/dist/cssm/lib/prefixClass.js.map +1 -1
- package/dist/cssm/styles/components.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/prefixClass.js +7 -6
- package/dist/lib/prefixClass.js.map +1 -1
- package/dist/vkui.css +1 -1
- package/dist/vkui.css.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionSheet/ActionSheet.tsx +1 -8
- package/src/components/Avatar/Avatar.tsx +5 -2
- package/src/components/CardScroll/CardScroll.tsx +4 -1
- package/src/components/Cell/Cell.css +22 -45
- 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/CustomSelect/CustomSelect.tsx +3 -4
- package/src/components/DropdownIcon/DropdownIcon.css +3 -0
- package/src/components/DropdownIcon/DropdownIcon.tsx +20 -0
- package/src/components/Epic/Readme.md +1 -0
- package/src/components/FocusTrap/FocusTrap.tsx +11 -8
- package/src/components/FormItem/FormItem.css +8 -8
- package/src/components/FormLayoutGroup/FormLayoutGroup.css +9 -3
- package/src/components/FormLayoutGroup/FormLayoutGroup.tsx +10 -1
- 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/InitialsAvatar/InitialsAvatar.css +53 -0
- package/src/components/InitialsAvatar/InitialsAvatar.tsx +90 -0
- package/src/components/InitialsAvatar/Readme.md +14 -0
- package/src/components/ModalRoot/Readme.md +2 -2
- package/src/components/NativeSelect/NativeSelect.tsx +2 -2
- package/src/components/Progress/Progress.tsx +8 -3
- package/src/components/Removable/Removable.css +9 -20
- package/src/components/Removable/Removable.tsx +19 -11
- package/src/components/Select/Select.css +1 -1
- package/src/components/SelectMimicry/SelectMimicry.tsx +2 -2
- package/src/components/SimpleCell/SimpleCell.css +10 -27
- package/src/components/Tabbar/Tabbar.css +15 -4
- package/src/components/Tabbar/Tabbar.tsx +3 -1
- package/src/components/TabbarItem/Readme.md +72 -0
- package/src/components/TabbarItem/TabbarItem.css +65 -14
- package/src/components/TabbarItem/TabbarItem.tsx +46 -22
- package/src/components/TabsItem/TabsItem.css +5 -2
- package/src/components/View/View.tsx +37 -31
- package/src/components/View/ViewInfinite.tsx +44 -38
- package/src/index.ts +4 -0
- package/src/lib/prefixClass.ts +9 -6
- package/src/styles/components.css +4 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { HasRootRef } from '../../types';
|
|
3
|
+
import { classNames } from '../../lib/classNames';
|
|
4
|
+
import Avatar, { AVATAR_DEFAULT_SHADOW, AVATAR_DEFAULT_SIZE } from '../Avatar/Avatar';
|
|
5
|
+
import './InitialsAvatar.css';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Градиенты, которые можно использовать в алгоритме поиска градиентов по числовому идентификатору пользователя.
|
|
9
|
+
* @example user.id % 6 + 1
|
|
10
|
+
*/
|
|
11
|
+
export type InitialsAvatarNumberGradients = 1 | 2 | 3 | 4 | 5 | 6;
|
|
12
|
+
export type InitialsAvatarTextGradients =
|
|
13
|
+
| 'red'
|
|
14
|
+
| 'pink'
|
|
15
|
+
| 'orange'
|
|
16
|
+
| 'yellow'
|
|
17
|
+
| 'green'
|
|
18
|
+
| 'l-blue'
|
|
19
|
+
| 'blue'
|
|
20
|
+
| 'violet';
|
|
21
|
+
|
|
22
|
+
export interface InitialsAvatarProps extends React.HTMLAttributes<HTMLDivElement>, HasRootRef<HTMLDivElement> {
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* `'red' | 'pink' | 'orange' | 'yellow' | 'green' | 'l-blue' | 'blue' | 'violet'`
|
|
26
|
+
*
|
|
27
|
+
* Если передано число, то оно будет сконвертировано в строчное представление цвета по следующей схеме:
|
|
28
|
+
*
|
|
29
|
+
* 1: 'red'
|
|
30
|
+
*
|
|
31
|
+
* 2: 'orange'
|
|
32
|
+
*
|
|
33
|
+
* 3: 'yellow'
|
|
34
|
+
*
|
|
35
|
+
* 4: 'green'
|
|
36
|
+
*
|
|
37
|
+
* 5: 'l-blue'
|
|
38
|
+
*
|
|
39
|
+
* 6: 'violet'
|
|
40
|
+
*/
|
|
41
|
+
gradientColor?: InitialsAvatarNumberGradients | InitialsAvatarTextGradients;
|
|
42
|
+
size?: number;
|
|
43
|
+
shadow?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const COLORS_NUMBER_TO_TEXT_MAP: Record<InitialsAvatarNumberGradients, InitialsAvatarTextGradients> = {
|
|
47
|
+
1: 'red',
|
|
48
|
+
2: 'orange',
|
|
49
|
+
3: 'yellow',
|
|
50
|
+
4: 'green',
|
|
51
|
+
5: 'l-blue',
|
|
52
|
+
6: 'violet',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function getInitialsFontSize(avatarSize: number) {
|
|
56
|
+
const calculatedFontSize = Math.ceil(avatarSize * 0.36);
|
|
57
|
+
const evenFix = calculatedFontSize % 2;
|
|
58
|
+
return calculatedFontSize + evenFix;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const InitialsAvatar: React.FC<InitialsAvatarProps> = ({
|
|
62
|
+
size = AVATAR_DEFAULT_SIZE,
|
|
63
|
+
shadow = AVATAR_DEFAULT_SHADOW,
|
|
64
|
+
children,
|
|
65
|
+
gradientColor,
|
|
66
|
+
style,
|
|
67
|
+
...restProps
|
|
68
|
+
}: InitialsAvatarProps) => {
|
|
69
|
+
const gradientName = typeof gradientColor === 'string' ? gradientColor : COLORS_NUMBER_TO_TEXT_MAP[gradientColor];
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Avatar
|
|
73
|
+
{...restProps}
|
|
74
|
+
style={{
|
|
75
|
+
...style,
|
|
76
|
+
fontSize: getInitialsFontSize(size),
|
|
77
|
+
}}
|
|
78
|
+
shadow={shadow}
|
|
79
|
+
size={size}
|
|
80
|
+
vkuiClass={classNames(
|
|
81
|
+
'InitialsAvatar',
|
|
82
|
+
`InitialsAvatar--color-${gradientName}`,
|
|
83
|
+
)}
|
|
84
|
+
>
|
|
85
|
+
<span aria-hidden="true" vkuiClass="InitialsAvatar__text">
|
|
86
|
+
{children}
|
|
87
|
+
</span>
|
|
88
|
+
</Avatar>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Компонент для отображения текстовых аватаров на фоне градиента (например, когда у пользователя нет установленного изображения).
|
|
2
|
+
Для лучшего отображения, рекомендуется использовать длину текста <b>не более 2 символов</b>.<br />
|
|
3
|
+
ВКонтакте использует формулу `user_id % 6 + 1` для определения градиента пользователя. Например, у пользователя c id 106 будет 5-й (`l-blue`) цвет градиента.
|
|
4
|
+
|
|
5
|
+
```jsx { "props": { "layout": false, "iframe": false } }
|
|
6
|
+
<div style={{ display: 'flex', padding: 12, gap: 8, flexFlow: 'row wrap' }}>
|
|
7
|
+
{[16, 20, 24, 28, 32, 36, 40, 44, 48, 56, 64, 72, 80, 88, 96].map((size) => {
|
|
8
|
+
const user = getRandomUser();
|
|
9
|
+
return (
|
|
10
|
+
<InitialsAvatar size={size} gradientColor={user.id % 6 + 1}>{user.initials}</InitialsAvatar>
|
|
11
|
+
)
|
|
12
|
+
})}
|
|
13
|
+
</div>
|
|
14
|
+
```
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
**Важно:** структура модальных страниц и карточек должна определяться единожды на старте приложения. Структура – это *декларация* приложения.
|
|
9
9
|
То есть, один раз определив структуру вида:
|
|
10
10
|
|
|
11
|
-
```jsx static
|
|
11
|
+
```jsx static
|
|
12
12
|
class App extends Component {
|
|
13
13
|
render() {
|
|
14
14
|
const modal = (
|
|
@@ -47,7 +47,7 @@ class App extends Component {
|
|
|
47
47
|
либо идентификатор предыдущей модалки, либо `null` для скрытия.
|
|
48
48
|
Каждой конкретной `ModalPage` или `ModalCard` можно передать свой обработчик `onClose`, если нужно переопределить поведение.
|
|
49
49
|
|
|
50
|
-
```jsx
|
|
50
|
+
```jsx { "props": { "layout": false, "adaptivity": true } }
|
|
51
51
|
const MODAL_PAGE_FILTERS = 'filters';
|
|
52
52
|
const MODAL_PAGE_COUNTRIES = 'countries';
|
|
53
53
|
const MODAL_PAGE_STORY_FEEDBACK = 'story-feedback';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { classNames } from '../../lib/classNames';
|
|
3
|
-
import {
|
|
3
|
+
import { DropdownIcon } from '../DropdownIcon/DropdownIcon';
|
|
4
4
|
import { FormField } from '../FormField/FormField';
|
|
5
5
|
import { HasAlign, HasRef, HasRootRef } from '../../types';
|
|
6
6
|
import { withAdaptivity, AdaptivityProps, SizeType } from '../../hoc/withAdaptivity';
|
|
@@ -64,7 +64,7 @@ const NativeSelect: React.FC<NativeSelectProps> = ({
|
|
|
64
64
|
style={style}
|
|
65
65
|
getRootRef={getRootRef}
|
|
66
66
|
disabled={disabled}
|
|
67
|
-
after={
|
|
67
|
+
after={<DropdownIcon />}
|
|
68
68
|
>
|
|
69
69
|
<select
|
|
70
70
|
{...restProps}
|
|
@@ -8,21 +8,26 @@ export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement>, Has
|
|
|
8
8
|
value?: number;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
const PROGRESS_MIN_VALUE = 0;
|
|
12
|
+
const PROGRESS_MAX_VALUE = 100;
|
|
13
|
+
|
|
11
14
|
const Progress: React.FC<ProgressProps> = ({ value, getRootRef, ...restProps }: ProgressProps) => {
|
|
12
15
|
const platform = usePlatform();
|
|
13
16
|
|
|
17
|
+
const progress = Math.max(PROGRESS_MIN_VALUE, Math.min(value, PROGRESS_MAX_VALUE));
|
|
18
|
+
|
|
14
19
|
return (
|
|
15
20
|
<div
|
|
16
21
|
aria-valuenow={value}
|
|
17
22
|
{...restProps}
|
|
18
23
|
role="progressbar"
|
|
19
|
-
aria-valuemin={
|
|
20
|
-
aria-valuemax={
|
|
24
|
+
aria-valuemin={PROGRESS_MIN_VALUE}
|
|
25
|
+
aria-valuemax={PROGRESS_MAX_VALUE}
|
|
21
26
|
ref={getRootRef}
|
|
22
27
|
vkuiClass={getClassName('Progress', platform)}
|
|
23
28
|
>
|
|
24
29
|
<div vkuiClass="Progress__bg" aria-hidden="true" />
|
|
25
|
-
<div vkuiClass="Progress__in" style={{ width: `${
|
|
30
|
+
<div vkuiClass="Progress__in" style={{ width: `${progress}%` }} aria-hidden="true" />
|
|
26
31
|
</div>
|
|
27
32
|
);
|
|
28
33
|
};
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
.Removable {
|
|
2
|
-
position: relative;
|
|
3
|
-
min-width: 0;
|
|
4
|
-
max-width: 100%;
|
|
5
|
-
flex-grow: 1;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
.Removable__content {
|
|
2
|
+
position: relative;
|
|
9
3
|
display: flex;
|
|
10
4
|
align-items: center;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.FormItem--removable .Removable__content,
|
|
14
|
-
.FormLayoutGroup--removable .Removable__content {
|
|
15
5
|
padding-left: var(--formitem_padding);
|
|
16
6
|
}
|
|
17
7
|
|
|
@@ -26,13 +16,13 @@
|
|
|
26
16
|
align-self: flex-start;
|
|
27
17
|
}
|
|
28
18
|
|
|
29
|
-
.FormItem--withTop .Removable__action,
|
|
30
|
-
.FormItem--withTop ~ .Removable__action {
|
|
19
|
+
.FormItem--removable.FormItem--withTop .Removable__action,
|
|
20
|
+
.FormLayoutGroup--removable .FormItem--withTop ~ .Removable__action {
|
|
31
21
|
top: 28px;
|
|
32
22
|
}
|
|
33
23
|
|
|
34
|
-
.FormItem--
|
|
35
|
-
.
|
|
24
|
+
.FormItem--sizeY-compact.FormItem--removable.FormItem--withTop .Removable__action,
|
|
25
|
+
.FormLayoutGroup--sizeY-compact.FormLayoutGroup--removable .FormItem--withTop ~ .Removable__action {
|
|
36
26
|
top: 26px;
|
|
37
27
|
}
|
|
38
28
|
|
|
@@ -107,23 +97,22 @@
|
|
|
107
97
|
background-color: var(--white);
|
|
108
98
|
}
|
|
109
99
|
|
|
110
|
-
.
|
|
111
|
-
.FormLayoutGroup--removable .Removable--ios .Removable__content {
|
|
100
|
+
.Removable--ios .Removable__content {
|
|
112
101
|
padding-left: 0;
|
|
113
102
|
padding-right: var(--formitem_padding);
|
|
114
103
|
}
|
|
115
104
|
|
|
116
|
-
.FormLayoutGroup--removable
|
|
105
|
+
.FormLayoutGroup--removable .Removable__content {
|
|
117
106
|
flex-wrap: wrap;
|
|
118
107
|
}
|
|
119
108
|
|
|
120
|
-
.FormLayoutGroup--removable .
|
|
109
|
+
.FormLayoutGroup--removable .FormItem--ios.FormItem--withTop ~ .Removable__offset {
|
|
121
110
|
order: -1;
|
|
122
111
|
display: block;
|
|
123
112
|
width: 100%;
|
|
124
113
|
height: 28px;
|
|
125
114
|
}
|
|
126
115
|
|
|
127
|
-
.FormLayoutGroup--removable.FormLayoutGroup--sizeY-compact .
|
|
116
|
+
.FormLayoutGroup--removable.FormLayoutGroup--sizeY-compact .FormItem--ios.FormItem--withTop ~ .Removable__offset {
|
|
128
117
|
height: 26px;
|
|
129
118
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { HasRootRef } from '../../types';
|
|
2
3
|
import { classNames } from '../../lib/classNames';
|
|
3
|
-
import { getTitleFromChildren } from '../../lib/utils';
|
|
4
|
+
import { getTitleFromChildren, noop } from '../../lib/utils';
|
|
5
|
+
import { useExternRef } from '../../hooks/useExternRef';
|
|
4
6
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
5
7
|
import { getClassName } from '../../helpers/getClassName';
|
|
6
8
|
import { useAdaptivity } from '../../hooks/useAdaptivity';
|
|
@@ -34,14 +36,16 @@ const RemovableIos: React.FC<RemovableIosOwnProps> = ({
|
|
|
34
36
|
removePlaceholderString,
|
|
35
37
|
children,
|
|
36
38
|
}) => {
|
|
37
|
-
const {
|
|
39
|
+
const { window } = useDOM();
|
|
38
40
|
|
|
39
41
|
const removeButtonRef = React.useRef(null);
|
|
40
42
|
const [removeOffset, updateRemoveOffset] = React.useState(0);
|
|
41
43
|
|
|
42
|
-
useGlobalEventListener(
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
useGlobalEventListener(window, 'click', () => {
|
|
45
|
+
if (removeOffset > 0) {
|
|
46
|
+
updateRemoveOffset(0);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
45
49
|
|
|
46
50
|
const onRemoveTransitionEnd = () => {
|
|
47
51
|
if (removeOffset > 0) {
|
|
@@ -49,7 +53,9 @@ const RemovableIos: React.FC<RemovableIosOwnProps> = ({
|
|
|
49
53
|
}
|
|
50
54
|
};
|
|
51
55
|
|
|
52
|
-
const onRemoveActivateClick = () => {
|
|
56
|
+
const onRemoveActivateClick = (e: React.MouseEvent) => {
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
|
|
53
59
|
const { offsetWidth = 0 } = removeButtonRef?.current;
|
|
54
60
|
updateRemoveOffset(offsetWidth);
|
|
55
61
|
};
|
|
@@ -82,7 +88,6 @@ const RemovableIos: React.FC<RemovableIosOwnProps> = ({
|
|
|
82
88
|
getRootRef={removeButtonRef}
|
|
83
89
|
vkuiClass="Removable__remove"
|
|
84
90
|
onClick={onRemoveClick}
|
|
85
|
-
onTransitionEnd={onRemoveTransitionEnd}
|
|
86
91
|
>
|
|
87
92
|
<span vkuiClass="Removable__remove-in">{removePlaceholder}</span>
|
|
88
93
|
</Tappable>
|
|
@@ -90,7 +95,7 @@ const RemovableIos: React.FC<RemovableIosOwnProps> = ({
|
|
|
90
95
|
);
|
|
91
96
|
};
|
|
92
97
|
|
|
93
|
-
interface RemovableOwnProps extends React.AllHTMLAttributes<HTMLElement>, RemovableProps {
|
|
98
|
+
interface RemovableOwnProps extends React.AllHTMLAttributes<HTMLElement>, RemovableProps, HasRootRef<HTMLDivElement> {
|
|
94
99
|
/**
|
|
95
100
|
* Расположение кнопки удаления.
|
|
96
101
|
*/
|
|
@@ -98,8 +103,9 @@ interface RemovableOwnProps extends React.AllHTMLAttributes<HTMLElement>, Remova
|
|
|
98
103
|
}
|
|
99
104
|
|
|
100
105
|
export const Removable: React.FC<RemovableOwnProps> = ({
|
|
106
|
+
getRootRef,
|
|
101
107
|
children,
|
|
102
|
-
onRemove,
|
|
108
|
+
onRemove = noop,
|
|
103
109
|
removePlaceholder = 'Удалить',
|
|
104
110
|
align = 'center',
|
|
105
111
|
...restProps
|
|
@@ -107,10 +113,11 @@ export const Removable: React.FC<RemovableOwnProps> = ({
|
|
|
107
113
|
const platform = usePlatform();
|
|
108
114
|
const { sizeY } = useAdaptivity();
|
|
109
115
|
|
|
116
|
+
const ref = useExternRef(getRootRef);
|
|
117
|
+
|
|
110
118
|
const onRemoveClick = (e: React.MouseEvent) => {
|
|
111
119
|
e.preventDefault();
|
|
112
|
-
|
|
113
|
-
onRemove && onRemove(e);
|
|
120
|
+
onRemove(e);
|
|
114
121
|
};
|
|
115
122
|
|
|
116
123
|
const removePlaceholderString: string = getTitleFromChildren(removePlaceholder);
|
|
@@ -118,6 +125,7 @@ export const Removable: React.FC<RemovableOwnProps> = ({
|
|
|
118
125
|
return (
|
|
119
126
|
<div
|
|
120
127
|
{...restProps}
|
|
128
|
+
ref={ref}
|
|
121
129
|
vkuiClass={classNames(
|
|
122
130
|
getClassName('Removable', platform),
|
|
123
131
|
`Removable--${align}`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { classNames } from '../../lib/classNames';
|
|
3
|
-
import {
|
|
3
|
+
import { DropdownIcon } from '../DropdownIcon/DropdownIcon';
|
|
4
4
|
import { FormField } from '../FormField/FormField';
|
|
5
5
|
import { HasAlign, HasRootRef } from '../../types';
|
|
6
6
|
import { withAdaptivity, AdaptivityProps, SizeType } from '../../hoc/withAdaptivity';
|
|
@@ -51,7 +51,7 @@ const SelectMimicry: React.FunctionComponent<SelectMimicryProps> = ({
|
|
|
51
51
|
getRootRef={getRootRef}
|
|
52
52
|
onClick={disabled ? null : onClick}
|
|
53
53
|
disabled={disabled}
|
|
54
|
-
after={
|
|
54
|
+
after={<DropdownIcon />}
|
|
55
55
|
>
|
|
56
56
|
<TypographyComponent Component="div" weight="regular" vkuiClass="Select__container">
|
|
57
57
|
<span vkuiClass="Select__title">{children || placeholder}</span>
|
|
@@ -5,18 +5,8 @@
|
|
|
5
5
|
white-space: nowrap;
|
|
6
6
|
text-decoration: none;
|
|
7
7
|
color: var(--text_primary);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.FormItem .SimpleCell {
|
|
11
|
-
width: 100%;
|
|
12
|
-
box-sizing: content-box;
|
|
13
|
-
margin: 0 calc(-1 * var(--formitem_padding));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.Cell--removable .SimpleCell {
|
|
17
|
-
max-width: 100%;
|
|
18
|
-
flex-grow: 1;
|
|
19
|
-
min-width: 0;
|
|
8
|
+
padding-left: 16px;
|
|
9
|
+
padding-right: 16px;
|
|
20
10
|
}
|
|
21
11
|
|
|
22
12
|
.SimpleCell--mult {
|
|
@@ -153,10 +143,6 @@
|
|
|
153
143
|
padding-right: 12px;
|
|
154
144
|
}
|
|
155
145
|
|
|
156
|
-
.Cell--removable .SimpleCell--ios {
|
|
157
|
-
padding-left: 0;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
146
|
.SimpleCell--ios .SimpleCell__main,
|
|
161
147
|
.SimpleCell--ios .SimpleCell__indicator {
|
|
162
148
|
padding-top: 9px;
|
|
@@ -193,17 +179,6 @@
|
|
|
193
179
|
* Android & VKCOM
|
|
194
180
|
*/
|
|
195
181
|
|
|
196
|
-
.SimpleCell--android,
|
|
197
|
-
.SimpleCell--vkcom {
|
|
198
|
-
padding-left: 16px;
|
|
199
|
-
padding-right: 16px;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.Cell--removable .SimpleCell--android,
|
|
203
|
-
.Cell--removable .SimpleCell--vkcom {
|
|
204
|
-
padding-right: 0;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
182
|
.SimpleCell--android .SimpleCell__main,
|
|
208
183
|
.SimpleCell--android .SimpleCell__indicator,
|
|
209
184
|
.SimpleCell--vkcom .SimpleCell__main,
|
|
@@ -255,3 +230,11 @@
|
|
|
255
230
|
.SimpleCell--sizeY-compact .SimpleCell__badge .Badge {
|
|
256
231
|
transform: translateY(.5px);
|
|
257
232
|
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* CMP:
|
|
236
|
+
* FormItem
|
|
237
|
+
*/
|
|
238
|
+
.FormItem > .SimpleCell {
|
|
239
|
+
margin: 0 calc(-1 * var(--formitem_padding));
|
|
240
|
+
}
|
|
@@ -5,14 +5,21 @@
|
|
|
5
5
|
left: 0;
|
|
6
6
|
width: 100%;
|
|
7
7
|
height: var(--tabbar_height);
|
|
8
|
-
|
|
9
|
-
align-items: stretch;
|
|
10
|
-
justify-content: center;
|
|
8
|
+
padding-bottom: var(--safe-area-inset-bottom);
|
|
11
9
|
box-sizing: content-box;
|
|
12
10
|
background: var(--header_alternate_background);
|
|
13
|
-
padding-bottom: var(--safe-area-inset-bottom);
|
|
14
11
|
}
|
|
15
12
|
|
|
13
|
+
.Tabbar__in {
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* iOS
|
|
21
|
+
*/
|
|
22
|
+
|
|
16
23
|
.Tabbar--ios.Tabbar--shadow::before {
|
|
17
24
|
position: absolute;
|
|
18
25
|
bottom: 100%;
|
|
@@ -36,6 +43,10 @@
|
|
|
36
43
|
}
|
|
37
44
|
}
|
|
38
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Android & VKCOM
|
|
48
|
+
*/
|
|
49
|
+
|
|
39
50
|
.Tabbar--android.Tabbar--shadow,
|
|
40
51
|
.Tabbar--vkcom.Tabbar--shadow {
|
|
41
52
|
box-shadow: 0 -2px 4px 0 rgba(0, 0, 0, .06), 0 0 2px 0 rgba(0, 0, 0, .08);
|
|
@@ -1 +1,73 @@
|
|
|
1
1
|
Элемент [Tabbar](#!/Tabbar). В качестве `children` рекомендуется использовать [иконку](https://vkcom.github.io/icons) 28 размера.
|
|
2
|
+
|
|
3
|
+
```jsx { "props": { "layout": false, "iframe": false } }
|
|
4
|
+
const [simple, setSimple] = useState('one');
|
|
5
|
+
const [text, setText] = useState('one');
|
|
6
|
+
const [horizontalText, setHorizontalText] = useState('one');
|
|
7
|
+
const [indicator, setIndicator] = useState('one');
|
|
8
|
+
|
|
9
|
+
<div style={{background: 'var(--background_page)', padding: '10px 0'}}>
|
|
10
|
+
<div style={{maxWidth: 768, margin: 'auto'}}>
|
|
11
|
+
<Tabbar style={{position: 'static', margin: '0 0 10px'}}>
|
|
12
|
+
<TabbarItem selected={simple === 'one'} onClick={() => setSimple('one')}><Icon28NewsfeedOutline/></TabbarItem>
|
|
13
|
+
<TabbarItem selected={simple === 'two'} onClick={() => setSimple('two')}><Icon28UserCircleOutline/></TabbarItem>
|
|
14
|
+
</Tabbar>
|
|
15
|
+
|
|
16
|
+
<Tabbar style={{position: 'static', margin: '10px 0'}}>
|
|
17
|
+
<TabbarItem selected={text === 'one'} onClick={() => setText('one')} text="Новости"><Icon28NewsfeedOutline/></TabbarItem>
|
|
18
|
+
<TabbarItem selected={text === 'two'} onClick={() => setText('two')} text="Профиль"><Icon28UserCircleOutline/></TabbarItem>
|
|
19
|
+
<TabbarItem selected={text === 'three'} onClick={() => setText('three')} text="Мессенджер"><Icon28MessageOutline/></TabbarItem>
|
|
20
|
+
</Tabbar>
|
|
21
|
+
|
|
22
|
+
<Tabbar itemsLayout="horizontal" style={{position: 'static', margin: '10px 0'}}>
|
|
23
|
+
<TabbarItem
|
|
24
|
+
selected={horizontalText === 'one'}
|
|
25
|
+
onClick={() => setHorizontalText('one')}
|
|
26
|
+
text="Новости"
|
|
27
|
+
>
|
|
28
|
+
<Icon28NewsfeedOutline/>
|
|
29
|
+
</TabbarItem>
|
|
30
|
+
<TabbarItem
|
|
31
|
+
selected={horizontalText === 'two'}
|
|
32
|
+
onClick={() => setHorizontalText('two')}
|
|
33
|
+
text="Профиль"
|
|
34
|
+
>
|
|
35
|
+
<Icon28UserCircleOutline/>
|
|
36
|
+
</TabbarItem>
|
|
37
|
+
<TabbarItem
|
|
38
|
+
selected={horizontalText === 'three'}
|
|
39
|
+
onClick={() => setHorizontalText('three')}
|
|
40
|
+
text="Мессенджер"
|
|
41
|
+
>
|
|
42
|
+
<Icon28MessageOutline/>
|
|
43
|
+
</TabbarItem>
|
|
44
|
+
</Tabbar>
|
|
45
|
+
|
|
46
|
+
<Tabbar style={{position: 'static', margin: '10px 0 0'}}>
|
|
47
|
+
<TabbarItem
|
|
48
|
+
selected={indicator === 'one'}
|
|
49
|
+
onClick={() => setIndicator('one')}
|
|
50
|
+
indicator={<Badge mode="prominent" />}
|
|
51
|
+
text="Новости"
|
|
52
|
+
>
|
|
53
|
+
<Icon28NewsfeedOutline />
|
|
54
|
+
</TabbarItem>
|
|
55
|
+
<TabbarItem
|
|
56
|
+
selected={indicator === 'two'}
|
|
57
|
+
onClick={() => setIndicator('two')}
|
|
58
|
+
text="Профиль"
|
|
59
|
+
>
|
|
60
|
+
<Icon28UserCircleOutline />
|
|
61
|
+
</TabbarItem>
|
|
62
|
+
<TabbarItem
|
|
63
|
+
selected={indicator === 'three'}
|
|
64
|
+
onClick={() => setIndicator('three')}
|
|
65
|
+
text="Мессенджер"
|
|
66
|
+
indicator={<Counter size="s" mode="prominent">3</Counter>}
|
|
67
|
+
>
|
|
68
|
+
<Icon28MessageOutline />
|
|
69
|
+
</TabbarItem>
|
|
70
|
+
</Tabbar>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
```
|
|
@@ -1,42 +1,54 @@
|
|
|
1
1
|
.TabbarItem {
|
|
2
|
-
flex-shrink: 0;
|
|
3
|
-
max-width: 100%;
|
|
4
|
-
flex-grow: 1;
|
|
5
|
-
flex-basis: 0;
|
|
6
|
-
overflow: hidden;
|
|
7
2
|
display: flex;
|
|
8
3
|
align-items: center;
|
|
9
4
|
justify-content: center;
|
|
10
5
|
color: var(--tabbar_inactive_icon);
|
|
11
6
|
text-decoration: none;
|
|
7
|
+
border: none;
|
|
8
|
+
outline: none;
|
|
9
|
+
padding: 0;
|
|
10
|
+
background: transparent;
|
|
11
|
+
height: var(--tabbar_height);
|
|
12
|
+
position: relative;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
.Tabbar
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
.Tabbar .TabbarItem {
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
flex-grow: 1;
|
|
20
|
+
flex-basis: 0;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
.TabbarItem--selected {
|
|
20
24
|
color: var(--tabbar_active_icon);
|
|
21
25
|
}
|
|
22
26
|
|
|
27
|
+
.TabbarItem__tappable {
|
|
28
|
+
position: absolute;
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
.TabbarItem__in {
|
|
24
|
-
align-self: center;
|
|
25
32
|
display: flex;
|
|
26
|
-
max-width: 100%;
|
|
27
33
|
padding: 0 2px;
|
|
28
|
-
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
height: 100%;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.Tabbar--l-vertical .TabbarItem--text .TabbarItem__in {
|
|
42
|
+
position: relative;
|
|
43
|
+
top: 2px;
|
|
29
44
|
}
|
|
30
45
|
|
|
31
46
|
.Tabbar--l-vertical .TabbarItem__in {
|
|
32
47
|
flex-direction: column;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
.Tabbar--l-horizontal .TabbarItem__in {
|
|
38
51
|
flex-direction: row;
|
|
39
|
-
align-items: center;
|
|
40
52
|
}
|
|
41
53
|
|
|
42
54
|
.TabbarItem__icon {
|
|
@@ -74,3 +86,42 @@
|
|
|
74
86
|
font-weight: 500;
|
|
75
87
|
margin-left: 8px;
|
|
76
88
|
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Android
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
.TabbarItem--android .TabbarItem__tappable {
|
|
95
|
+
width: calc(100% + 16px);
|
|
96
|
+
padding-bottom: calc(100% + 16px);
|
|
97
|
+
border-radius: 50%;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.TabbarItem--android:first-child {
|
|
101
|
+
border-top-left-radius: 0;
|
|
102
|
+
border-bottom-left-radius: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.TabbarItem--android:last-child {
|
|
106
|
+
border-top-right-radius: 0;
|
|
107
|
+
border-bottom-right-radius: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* iOS
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
.TabbarItem--ios .TabbarItem__tappable {
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
top: 0;
|
|
118
|
+
left: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.TabbarItem--ios .TabbarItem__in {
|
|
122
|
+
transition: transform .07s var(--ios-easing);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.TabbarItem--ios .TabbarItem__tappable--active + .TabbarItem__in {
|
|
126
|
+
transform: scale(.96);
|
|
127
|
+
}
|