@telefonica/mistica 17.9.0 → 17.10.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/css/blau.css +40 -0
- package/css/community/cyber.css +40 -0
- package/css/esimflag.css +40 -0
- package/css/mistica.css +1 -1
- package/css/movistar.css +40 -0
- package/css/o2.css +41 -0
- package/css/telefonica.css +42 -0
- package/css/vivo-evolution.css +48 -0
- package/css/vivo.css +40 -0
- package/dist/accordion.css-mistica.js +8 -8
- package/dist/align.css-mistica.js +1 -1
- package/dist/autocomplete.css-mistica.js +4 -4
- package/dist/avatar.css-mistica.js +3 -3
- package/dist/badge.css-mistica.js +3 -3
- package/dist/box.css-mistica.js +13 -13
- package/dist/boxed.css-mistica.js +24 -24
- package/dist/button-group.css-mistica.js +3 -3
- package/dist/button-layout.css-mistica.js +15 -15
- package/dist/button.css-mistica.js +64 -64
- package/dist/callout.css-mistica.js +11 -11
- package/dist/card-internal.css-mistica.js +34 -34
- package/dist/carousel.css-mistica.js +35 -35
- package/dist/checkbox.css-mistica.js +15 -15
- package/dist/chip.css-mistica.js +20 -20
- package/dist/circle.css-mistica.js +1 -1
- package/dist/community/advanced-data-card.css-mistica.js +18 -18
- package/dist/community/ai-card.css-mistica.js +9 -9
- package/dist/community/blocks.css-mistica.js +3 -3
- package/dist/community/cyber/example-component.css-mistica.js +1 -1
- package/dist/community/example-component.css-mistica.js +2 -2
- package/dist/community/skins/cyber-skin.js +20 -0
- package/dist/counter.css-mistica.js +7 -7
- package/dist/cover-hero.css-mistica.js +13 -13
- package/dist/credit-card-number-field.css-mistica.js +5 -5
- package/dist/date-field.css-mistica.js +1 -1
- package/dist/date-time-picker.css-mistica.js +1 -1
- package/dist/dialog.css-mistica.js +8 -8
- package/dist/divider.css-mistica.js +5 -5
- package/dist/double-field.css-mistica.js +4 -4
- package/dist/drawer.css-mistica.js +10 -10
- package/dist/empty-state-card.css-mistica.js +1 -1
- package/dist/empty-state.css-mistica.js +12 -12
- package/dist/fade-in.css-mistica.js +1 -1
- package/dist/fade-out.css-mistica.js +1 -1
- package/dist/feedback.css-mistica.js +3 -3
- package/dist/file-upload.css-mistica.js +12 -12
- package/dist/fixed-footer-layout.css-mistica.js +5 -5
- package/dist/form.css-mistica.js +1 -1
- package/dist/grid-layout.css-mistica.js +3 -3
- package/dist/grid.css-mistica.js +120 -120
- package/dist/header.css-mistica.js +1 -1
- package/dist/hero.css-mistica.js +9 -9
- package/dist/horizontal-scroll.css-mistica.js +1 -1
- package/dist/icon-button.css-mistica.js +58 -58
- package/dist/icons/icon-chevron.css-mistica.js +2 -2
- package/dist/icons/icon-error.css-mistica.js +1 -1
- package/dist/image.css-mistica.js +7 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/inline.css-mistica.js +11 -11
- package/dist/list.css-mistica.js +32 -32
- package/dist/loading-bar.css-mistica.js +1 -1
- package/dist/loading-screen.css-mistica.js +9 -9
- package/dist/logo.css-mistica.js +5 -5
- package/dist/menu.css-mistica.js +12 -12
- package/dist/message.css-mistica.js +172 -0
- package/dist/message.css.d.ts +40 -0
- package/dist/message.d.ts +48 -0
- package/dist/message.js +389 -0
- package/dist/mosaic.css-mistica.js +1 -1
- package/dist/navigation-bar.css-mistica.js +20 -20
- package/dist/navigation-breadcrumbs.css-mistica.js +1 -1
- package/dist/navigation-shared.css-mistica.js +18 -18
- package/dist/package-version.js +1 -1
- package/dist/pagination.css-mistica.js +30 -29
- package/dist/pagination.css.d.ts +1 -2
- package/dist/pagination.d.ts +0 -16
- package/dist/pagination.js +108 -115
- package/dist/pin-field.css-mistica.js +8 -8
- package/dist/popover.css-mistica.js +1 -1
- package/dist/progress-bar.css-mistica.js +7 -7
- package/dist/radio-button.css-mistica.js +32 -32
- package/dist/rating.css-mistica.js +4 -4
- package/dist/responsive-layout.css-mistica.js +6 -6
- package/dist/screen-reader-only.css-mistica.js +1 -1
- package/dist/select.css-mistica.js +22 -22
- package/dist/sheet-action-row.css-mistica.js +2 -2
- package/dist/sheet-common.css-mistica.js +9 -9
- package/dist/sheet-info.css-mistica.js +3 -3
- package/dist/sidenav-bar-layout.css-mistica.js +2 -2
- package/dist/sidenav-bar.css-mistica.js +107 -107
- package/dist/skeletons.css-mistica.js +10 -10
- package/dist/skins/blau.js +20 -0
- package/dist/skins/esimflag.js +20 -0
- package/dist/skins/movistar.js +20 -0
- package/dist/skins/o2.d.ts +1 -0
- package/dist/skins/o2.js +21 -0
- package/dist/skins/skin-contract.css-mistica.js +769 -749
- package/dist/skins/skin-contract.css.d.ts +20 -0
- package/dist/skins/telefonica.js +20 -0
- package/dist/skins/types/colors.d.ts +10 -0
- package/dist/skins/vivo-evolution.js +20 -0
- package/dist/skins/vivo.js +20 -0
- package/dist/skip-link.css-mistica.js +2 -2
- package/dist/slider.css-mistica.js +27 -27
- package/dist/snackbar.css-mistica.js +17 -17
- package/dist/spinner.css-mistica.js +5 -5
- package/dist/square.css-mistica.js +1 -1
- package/dist/stack.css-mistica.js +5 -5
- package/dist/stacking-group.css-mistica.js +2 -2
- package/dist/stepper.css-mistica.js +10 -10
- package/dist/switch-component.css-mistica.js +39 -39
- package/dist/table.css-mistica.js +9 -9
- package/dist/tabs.css-mistica.js +19 -19
- package/dist/tag.css-mistica.js +1 -1
- package/dist/text-field-base.css-mistica.js +26 -26
- package/dist/text-field-components.css-mistica.js +12 -12
- package/dist/text-link.css-mistica.js +6 -6
- package/dist/text-tokens.d.ts +2 -0
- package/dist/text-tokens.js +46 -30
- package/dist/text.css-mistica.js +6 -6
- package/dist/timeline.css-mistica.js +13 -13
- package/dist/timer.css-mistica.js +8 -8
- package/dist/tooltip.css-mistica.js +3 -3
- package/dist/tooltip.js +88 -88
- package/dist/touchable.css-mistica.js +5 -5
- package/dist/utils/aspect-ratio-support.css-mistica.js +4 -4
- package/dist/video.css-mistica.js +2 -2
- package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
- package/dist-es/accordion.css-mistica.js +7 -7
- package/dist-es/align.css-mistica.js +1 -1
- package/dist-es/autocomplete.css-mistica.js +2 -2
- package/dist-es/avatar.css-mistica.js +2 -2
- package/dist-es/badge.css-mistica.js +2 -2
- package/dist-es/box.css-mistica.js +13 -13
- package/dist-es/boxed.css-mistica.js +23 -23
- package/dist-es/button-group.css-mistica.js +2 -2
- package/dist-es/button-layout.css-mistica.js +15 -15
- package/dist-es/button.css-mistica.js +43 -43
- package/dist-es/callout.css-mistica.js +11 -11
- package/dist-es/card-internal.css-mistica.js +23 -23
- package/dist-es/carousel.css-mistica.js +10 -10
- package/dist-es/checkbox.css-mistica.js +13 -13
- package/dist-es/chip.css-mistica.js +17 -17
- package/dist-es/circle.css-mistica.js +1 -1
- package/dist-es/community/advanced-data-card.css-mistica.js +9 -9
- package/dist-es/community/ai-card.css-mistica.js +3 -3
- package/dist-es/community/blocks.css-mistica.js +2 -2
- package/dist-es/community/cyber/example-component.css-mistica.js +1 -1
- package/dist-es/community/example-component.css-mistica.js +2 -2
- package/dist-es/community/skins/cyber-skin.js +20 -0
- package/dist-es/counter.css-mistica.js +2 -2
- package/dist-es/cover-hero.css-mistica.js +3 -3
- package/dist-es/credit-card-number-field.css-mistica.js +4 -4
- package/dist-es/date-field.css-mistica.js +1 -1
- package/dist-es/date-time-picker.css-mistica.js +1 -1
- package/dist-es/dialog.css-mistica.js +5 -5
- package/dist-es/divider.css-mistica.js +5 -5
- package/dist-es/double-field.css-mistica.js +4 -4
- package/dist-es/drawer.css-mistica.js +2 -2
- package/dist-es/empty-state-card.css-mistica.js +1 -1
- package/dist-es/empty-state.css-mistica.js +7 -7
- package/dist-es/fade-in.css-mistica.js +1 -1
- package/dist-es/fade-out.css-mistica.js +1 -1
- package/dist-es/feedback.css-mistica.js +2 -2
- package/dist-es/file-upload.css-mistica.js +8 -8
- package/dist-es/fixed-footer-layout.css-mistica.js +3 -3
- package/dist-es/form.css-mistica.js +1 -1
- package/dist-es/grid-layout.css-mistica.js +3 -3
- package/dist-es/grid.css-mistica.js +120 -120
- package/dist-es/header.css-mistica.js +1 -1
- package/dist-es/hero.css-mistica.js +3 -3
- package/dist-es/horizontal-scroll.css-mistica.js +1 -1
- package/dist-es/icon-button.css-mistica.js +56 -56
- package/dist-es/icons/icon-chevron.css-mistica.js +2 -2
- package/dist-es/icons/icon-error.css-mistica.js +1 -1
- package/dist-es/image.css-mistica.js +4 -4
- package/dist-es/index.js +2355 -2354
- package/dist-es/inline.css-mistica.js +11 -11
- package/dist-es/list.css-mistica.js +8 -8
- package/dist-es/loading-bar.css-mistica.js +1 -1
- package/dist-es/loading-screen.css-mistica.js +5 -5
- package/dist-es/logo.css-mistica.js +5 -5
- package/dist-es/menu.css-mistica.js +12 -12
- package/dist-es/message.css-mistica.js +41 -0
- package/dist-es/message.js +334 -0
- package/dist-es/mosaic.css-mistica.js +1 -1
- package/dist-es/navigation-bar.css-mistica.js +10 -10
- package/dist-es/navigation-breadcrumbs.css-mistica.js +1 -1
- package/dist-es/navigation-shared.css-mistica.js +10 -10
- package/dist-es/package-version.js +1 -1
- package/dist-es/pagination.css-mistica.js +23 -19
- package/dist-es/pagination.js +137 -141
- package/dist-es/pin-field.css-mistica.js +2 -2
- package/dist-es/popover.css-mistica.js +1 -1
- package/dist-es/progress-bar.css-mistica.js +7 -7
- package/dist-es/radio-button.css-mistica.js +24 -24
- package/dist-es/rating.css-mistica.js +4 -4
- package/dist-es/responsive-layout.css-mistica.js +6 -6
- package/dist-es/screen-reader-only.css-mistica.js +1 -1
- package/dist-es/select.css-mistica.js +18 -18
- package/dist-es/sheet-action-row.css-mistica.js +2 -2
- package/dist-es/sheet-common.css-mistica.js +2 -2
- package/dist-es/sheet-info.css-mistica.js +2 -2
- package/dist-es/sidenav-bar-layout.css-mistica.js +2 -2
- package/dist-es/sidenav-bar.css-mistica.js +72 -72
- package/dist-es/skeletons.css-mistica.js +7 -7
- package/dist-es/skins/blau.js +20 -0
- package/dist-es/skins/esimflag.js +20 -0
- package/dist-es/skins/movistar.js +20 -0
- package/dist-es/skins/o2.js +21 -0
- package/dist-es/skins/skin-contract.css-mistica.js +769 -749
- package/dist-es/skins/telefonica.js +20 -0
- package/dist-es/skins/vivo-evolution.js +20 -0
- package/dist-es/skins/vivo.js +20 -0
- package/dist-es/skip-link.css-mistica.js +2 -2
- package/dist-es/slider.css-mistica.js +20 -20
- package/dist-es/snackbar.css-mistica.js +5 -5
- package/dist-es/spinner.css-mistica.js +2 -2
- package/dist-es/square.css-mistica.js +1 -1
- package/dist-es/stack.css-mistica.js +5 -5
- package/dist-es/stacking-group.css-mistica.js +2 -2
- package/dist-es/stepper.css-mistica.js +4 -4
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.css-mistica.js +37 -37
- package/dist-es/table.css-mistica.js +9 -9
- package/dist-es/tabs.css-mistica.js +18 -18
- package/dist-es/tag.css-mistica.js +1 -1
- package/dist-es/text-field-base.css-mistica.js +17 -17
- package/dist-es/text-field-components.css-mistica.js +4 -4
- package/dist-es/text-link.css-mistica.js +6 -6
- package/dist-es/text-tokens.js +26 -16
- package/dist-es/text.css-mistica.js +6 -6
- package/dist-es/timeline.css-mistica.js +10 -10
- package/dist-es/timer.css-mistica.js +7 -7
- package/dist-es/tooltip.css-mistica.js +2 -2
- package/dist-es/tooltip.js +109 -109
- package/dist-es/touchable.css-mistica.js +2 -2
- package/dist-es/utils/aspect-ratio-support.css-mistica.js +3 -3
- package/dist-es/video.css-mistica.js +2 -2
- package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
- package/package.json +1 -1
- package/src/community/skins/cyber-skin.tsx +20 -0
- package/src/index.tsx +2 -0
- package/src/message.css.ts +148 -0
- package/src/message.tsx +303 -0
- package/src/package-version.tsx +1 -1
- package/src/pagination.css.ts +15 -18
- package/src/pagination.tsx +100 -102
- package/src/skins/blau.tsx +20 -0
- package/src/skins/esimflag.tsx +20 -0
- package/src/skins/movistar.tsx +20 -0
- package/src/skins/o2.tsx +21 -0
- package/src/skins/skin-contract.css.ts +10 -0
- package/src/skins/telefonica.tsx +20 -0
- package/src/skins/types/colors.tsx +10 -0
- package/src/skins/vivo-evolution.tsx +20 -0
- package/src/skins/vivo.tsx +20 -0
- package/src/text-tokens.tsx +14 -0
- package/src/tooltip.tsx +5 -2
package/src/pagination.tsx
CHANGED
|
@@ -40,105 +40,125 @@ export type PaginationProps = {
|
|
|
40
40
|
'aria-label'?: string;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
type
|
|
44
|
-
type
|
|
45
|
-
type
|
|
43
|
+
type Visibility = 'desktop' | 'mobile' | 'any';
|
|
44
|
+
type ResponsivePaginationItem = ExclusifyUnion<
|
|
45
|
+
{type: 'page'; page: number; current: boolean} | {type: 'ellipsis'}
|
|
46
|
+
> & {visibility: Visibility};
|
|
46
47
|
|
|
47
48
|
const DEFAULT_SURROUNDING_PAGE_COUNT = 1;
|
|
48
49
|
const FIRST_PAGE = 1;
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const DESKTOP_BOUNDARY_SLOT_COUNT = 4;
|
|
51
|
+
const MOBILE_BOUNDARY_SLOT_COUNT = 2;
|
|
52
|
+
|
|
53
|
+
const getVisibility = (desktop: boolean, mobile: boolean): Visibility =>
|
|
54
|
+
desktop && mobile ? 'any' : desktop ? 'desktop' : 'mobile';
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Creates one ordered list with viewport-specific visibility for pages and ellipses.
|
|
58
|
+
* With 20 pages and current page 10, desktop shows [1, ..., 9, 10, 11, ..., 20]
|
|
59
|
+
* and mobile shows [..., 9, 10, 11, ...]; only pages 1 and 20 are desktop-only.
|
|
60
|
+
*/
|
|
61
|
+
const getResponsivePaginationItems = ({
|
|
53
62
|
totalPages,
|
|
54
63
|
currentPage,
|
|
55
64
|
surroundingPageCount = DEFAULT_SURROUNDING_PAGE_COUNT,
|
|
56
|
-
includeBoundaryPages = true,
|
|
57
65
|
}: {
|
|
58
66
|
totalPages: number;
|
|
59
67
|
currentPage: number;
|
|
60
68
|
surroundingPageCount?: number;
|
|
61
|
-
|
|
62
|
-
}): Array<PaginationItem> => {
|
|
69
|
+
}): Array<ResponsivePaginationItem> => {
|
|
63
70
|
if (totalPages <= 1) {
|
|
64
71
|
return [];
|
|
65
72
|
}
|
|
66
73
|
|
|
67
|
-
const activePage =
|
|
68
|
-
const surroundingCount =
|
|
74
|
+
const activePage = Math.min(Math.max(currentPage, FIRST_PAGE), totalPages);
|
|
75
|
+
const surroundingCount = Math.min(Math.max(Math.floor(surroundingPageCount), 0), totalPages);
|
|
69
76
|
const dynamicPageCount = 2 * surroundingCount + 1;
|
|
77
|
+
const createPageRange = (start: number, end: number): Array<number> =>
|
|
78
|
+
Array.from({length: Math.max(0, end - start + 1)}, (_, index) => start + index);
|
|
70
79
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const page = index + FIRST_PAGE;
|
|
74
|
-
return {type: 'page', page, current: page === activePage};
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const lastPage = totalPages;
|
|
79
|
-
const createPageItem = (page: number): PaginationItem => ({
|
|
80
|
-
type: 'page',
|
|
81
|
-
page,
|
|
82
|
-
current: page === activePage,
|
|
83
|
-
});
|
|
84
|
-
const createPageRange = (start: number, end: number): Array<PaginationItem> =>
|
|
85
|
-
Array.from({length: Math.max(0, end - start + 1)}, (_, index) => createPageItem(start + index));
|
|
86
|
-
|
|
87
|
-
if (!includeBoundaryPages) {
|
|
88
|
-
const rangeStart = Math.max(
|
|
89
|
-
Math.min(activePage - surroundingCount, lastPage - dynamicPageCount),
|
|
90
|
-
FIRST_PAGE + 1
|
|
91
|
-
);
|
|
92
|
-
const rangeEnd = rangeStart + dynamicPageCount - 1;
|
|
93
|
-
const items: Array<PaginationItem> = [];
|
|
94
|
-
|
|
95
|
-
if (rangeStart > FIRST_PAGE + 1) {
|
|
96
|
-
items.push({type: 'ellipsis'});
|
|
97
|
-
} else {
|
|
98
|
-
items.push(createPageItem(FIRST_PAGE));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
items.push(...createPageRange(rangeStart, rangeEnd));
|
|
102
|
-
|
|
103
|
-
if (rangeEnd < lastPage - 1) {
|
|
104
|
-
items.push({type: 'ellipsis'});
|
|
105
|
-
} else if (rangeEnd < lastPage) {
|
|
106
|
-
items.push(createPageItem(lastPage));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return items;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const rangeStart = Math.max(
|
|
113
|
-
Math.min(activePage - surroundingCount, lastPage - dynamicPageCount - 1),
|
|
80
|
+
const desktopRangeStart = Math.max(
|
|
81
|
+
Math.min(activePage - surroundingCount, totalPages - dynamicPageCount - 1),
|
|
114
82
|
FIRST_PAGE + 2
|
|
115
83
|
);
|
|
116
|
-
const
|
|
84
|
+
const desktopRangeEnd = Math.min(
|
|
117
85
|
Math.max(activePage + surroundingCount, FIRST_PAGE + dynamicPageCount + 1),
|
|
118
|
-
|
|
86
|
+
totalPages - 2
|
|
87
|
+
);
|
|
88
|
+
const desktopPages = new Set(
|
|
89
|
+
totalPages <= dynamicPageCount + DESKTOP_BOUNDARY_SLOT_COUNT
|
|
90
|
+
? createPageRange(FIRST_PAGE, totalPages)
|
|
91
|
+
: [
|
|
92
|
+
FIRST_PAGE,
|
|
93
|
+
...(desktopRangeStart > FIRST_PAGE + 2 ? [] : [FIRST_PAGE + 1]),
|
|
94
|
+
...createPageRange(desktopRangeStart, desktopRangeEnd),
|
|
95
|
+
...(desktopRangeEnd < totalPages - 2 ? [] : [totalPages - 1]),
|
|
96
|
+
totalPages,
|
|
97
|
+
]
|
|
119
98
|
);
|
|
120
99
|
|
|
121
|
-
const
|
|
100
|
+
const mobileRangeStart = Math.max(
|
|
101
|
+
Math.min(activePage - surroundingCount, totalPages - dynamicPageCount),
|
|
102
|
+
FIRST_PAGE + 1
|
|
103
|
+
);
|
|
104
|
+
const mobileRangeEnd = mobileRangeStart + dynamicPageCount - 1;
|
|
105
|
+
const mobilePages = new Set(
|
|
106
|
+
totalPages <= dynamicPageCount + MOBILE_BOUNDARY_SLOT_COUNT
|
|
107
|
+
? createPageRange(FIRST_PAGE, totalPages)
|
|
108
|
+
: [
|
|
109
|
+
...(mobileRangeStart > FIRST_PAGE + 1 ? [] : [FIRST_PAGE]),
|
|
110
|
+
...createPageRange(mobileRangeStart, mobileRangeEnd),
|
|
111
|
+
...(mobileRangeEnd < totalPages - 1 ? [] : [totalPages]),
|
|
112
|
+
]
|
|
113
|
+
);
|
|
122
114
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
115
|
+
const items: Array<ResponsivePaginationItem> = [];
|
|
116
|
+
let lastDesktopPage = FIRST_PAGE - 1;
|
|
117
|
+
let lastMobilePage = FIRST_PAGE - 1;
|
|
118
|
+
let hasDesktopEllipsis = false;
|
|
119
|
+
let hasMobileEllipsis = false;
|
|
120
|
+
|
|
121
|
+
for (const page of [...new Set([...desktopPages, ...mobilePages])].sort((a, b) => a - b)) {
|
|
122
|
+
const isDesktop = desktopPages.has(page);
|
|
123
|
+
const isMobile = mobilePages.has(page);
|
|
124
|
+
const needsDesktopEllipsis: boolean =
|
|
125
|
+
!hasDesktopEllipsis && (!isDesktop || page > lastDesktopPage + 1);
|
|
126
|
+
const needsMobileEllipsis: boolean = !hasMobileEllipsis && (!isMobile || page > lastMobilePage + 1);
|
|
127
|
+
|
|
128
|
+
if ((isDesktop && needsDesktopEllipsis) || (isMobile && needsMobileEllipsis)) {
|
|
129
|
+
items.push({
|
|
130
|
+
type: 'ellipsis',
|
|
131
|
+
visibility: getVisibility(needsDesktopEllipsis, needsMobileEllipsis),
|
|
132
|
+
});
|
|
133
|
+
hasDesktopEllipsis ||= needsDesktopEllipsis;
|
|
134
|
+
hasMobileEllipsis ||= needsMobileEllipsis;
|
|
135
|
+
}
|
|
136
|
+
items.push({
|
|
137
|
+
type: 'page',
|
|
138
|
+
page,
|
|
139
|
+
current: page === activePage,
|
|
140
|
+
visibility: getVisibility(isDesktop, isMobile),
|
|
141
|
+
});
|
|
142
|
+
if (isDesktop) {
|
|
143
|
+
lastDesktopPage = page;
|
|
144
|
+
hasDesktopEllipsis = false;
|
|
145
|
+
}
|
|
146
|
+
if (isMobile) {
|
|
147
|
+
lastMobilePage = page;
|
|
148
|
+
hasMobileEllipsis = false;
|
|
149
|
+
}
|
|
127
150
|
}
|
|
128
151
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
items.push({type: 'ellipsis'});
|
|
133
|
-
} else {
|
|
134
|
-
items.push(createPageItem(lastPage - 1));
|
|
152
|
+
const needsDesktopEllipsis = lastDesktopPage < totalPages && !hasDesktopEllipsis;
|
|
153
|
+
const needsMobileEllipsis = lastMobilePage < totalPages && !hasMobileEllipsis;
|
|
154
|
+
if (needsDesktopEllipsis || needsMobileEllipsis) {
|
|
155
|
+
items.push({type: 'ellipsis', visibility: getVisibility(needsDesktopEllipsis, needsMobileEllipsis)});
|
|
135
156
|
}
|
|
136
|
-
|
|
137
|
-
items.push(createPageItem(lastPage));
|
|
138
|
-
|
|
139
157
|
return items;
|
|
140
158
|
};
|
|
141
159
|
|
|
160
|
+
const clamp = (value: number, min: number, max: number): number => Math.min(Math.max(value, min), max);
|
|
161
|
+
|
|
142
162
|
const PaginationLabel = ({children}: {children: React.ReactNode}): JSX.Element => {
|
|
143
163
|
return (
|
|
144
164
|
<Text3 as="span" medium color="currentColor" wordBreak={false}>
|
|
@@ -159,13 +179,12 @@ const getEllipsisColor = (variant: NonDeprecatedVariant): string => {
|
|
|
159
179
|
};
|
|
160
180
|
|
|
161
181
|
type PageListProps = {
|
|
162
|
-
items: Array<
|
|
182
|
+
items: Array<ResponsivePaginationItem>;
|
|
163
183
|
disabled?: boolean;
|
|
164
|
-
className?: string;
|
|
165
184
|
onPageClick: (page: number) => void;
|
|
166
185
|
};
|
|
167
186
|
|
|
168
|
-
const PageList = ({items, disabled,
|
|
187
|
+
const PageList = ({items, disabled, onPageClick}: PageListProps): JSX.Element => {
|
|
169
188
|
const {texts, t} = useTheme();
|
|
170
189
|
const variant = useThemeVariant();
|
|
171
190
|
const goToPageLabel = (page: number) =>
|
|
@@ -174,11 +193,12 @@ const PageList = ({items, disabled, className, onPageClick}: PageListProps): JSX
|
|
|
174
193
|
t(texts.paginationCurrentPage || tokens.paginationCurrentPage, String(page));
|
|
175
194
|
|
|
176
195
|
return (
|
|
177
|
-
<ol className={
|
|
196
|
+
<ol className={styles.pageList}>
|
|
178
197
|
{items.map((item, index) => {
|
|
198
|
+
const className = classnames(styles.pageListItem, styles.itemVisibility[item.visibility]);
|
|
179
199
|
if (item.type === 'ellipsis') {
|
|
180
200
|
return (
|
|
181
|
-
<li key={`ellipsis-${index}`} className={
|
|
201
|
+
<li key={`ellipsis-${index}`} className={className} aria-hidden="true">
|
|
182
202
|
<Text3 as="span" medium color={getEllipsisColor(variant)} wordBreak={false}>
|
|
183
203
|
...
|
|
184
204
|
</Text3>
|
|
@@ -188,7 +208,7 @@ const PageList = ({items, disabled, className, onPageClick}: PageListProps): JSX
|
|
|
188
208
|
|
|
189
209
|
if (item.current) {
|
|
190
210
|
return (
|
|
191
|
-
<li key={item.page} className={
|
|
211
|
+
<li key={item.page} className={className}>
|
|
192
212
|
<Touchable
|
|
193
213
|
className={classnames(
|
|
194
214
|
styles.currentPage,
|
|
@@ -208,7 +228,7 @@ const PageList = ({items, disabled, className, onPageClick}: PageListProps): JSX
|
|
|
208
228
|
}
|
|
209
229
|
|
|
210
230
|
return (
|
|
211
|
-
<li key={item.page} className={
|
|
231
|
+
<li key={item.page} className={className}>
|
|
212
232
|
<Touchable
|
|
213
233
|
className={classnames(styles.pageButton, styles.pageButtonVariants[variant])}
|
|
214
234
|
disabled={disabled}
|
|
@@ -281,17 +301,10 @@ export const Pagination = ({
|
|
|
281
301
|
|
|
282
302
|
const isPrevDisabled = activePage <= 1;
|
|
283
303
|
const isNextDisabled = activePage >= totalPages;
|
|
284
|
-
const
|
|
285
|
-
totalPages,
|
|
286
|
-
currentPage: activePage,
|
|
287
|
-
surroundingPageCount,
|
|
288
|
-
includeBoundaryPages: true,
|
|
289
|
-
});
|
|
290
|
-
const mobileItems = getPaginationItems({
|
|
304
|
+
const items = getResponsivePaginationItems({
|
|
291
305
|
totalPages,
|
|
292
306
|
currentPage: activePage,
|
|
293
307
|
surroundingPageCount,
|
|
294
|
-
includeBoundaryPages: false,
|
|
295
308
|
});
|
|
296
309
|
|
|
297
310
|
return (
|
|
@@ -328,22 +341,7 @@ export const Pagination = ({
|
|
|
328
341
|
</ButtonLink>
|
|
329
342
|
))}
|
|
330
343
|
|
|
331
|
-
{!hidePageList &&
|
|
332
|
-
<>
|
|
333
|
-
<PageList
|
|
334
|
-
items={desktopItems}
|
|
335
|
-
disabled={disabled}
|
|
336
|
-
className={styles.pageListDesktop}
|
|
337
|
-
onPageClick={goToPage}
|
|
338
|
-
/>
|
|
339
|
-
<PageList
|
|
340
|
-
items={mobileItems}
|
|
341
|
-
disabled={disabled}
|
|
342
|
-
className={styles.pageListMobile}
|
|
343
|
-
onPageClick={goToPage}
|
|
344
|
-
/>
|
|
345
|
-
</>
|
|
346
|
-
)}
|
|
344
|
+
{!hidePageList && <PageList items={items} disabled={disabled} onPageClick={goToPage} />}
|
|
347
345
|
{!hideNavigationControls &&
|
|
348
346
|
(mode === 'iconOnly' ? (
|
|
349
347
|
<IconButton
|
package/src/skins/blau.tsx
CHANGED
|
@@ -99,6 +99,16 @@ export const getBlauSkin: GetKnownSkin = () => {
|
|
|
99
99
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.17),
|
|
100
100
|
backgroundDropZoneMediaHover: applyAlpha(palette.grey6, 0.05),
|
|
101
101
|
backgroundDropZoneMediaDragover: applyAlpha(palette.grey6, 0.08),
|
|
102
|
+
messageBubbleBackgroundOutgoing: palette.grey1,
|
|
103
|
+
messageBubbleBackgroundOutgoingBrand: palette.grey1,
|
|
104
|
+
messageBubbleBackgroundOutgoingAlternative: palette.grey1,
|
|
105
|
+
messageBubbleBackgroundOutgoingNegative: palette.grey1,
|
|
106
|
+
messageBubbleBackgroundOutgoingMedia: palette.grey1,
|
|
107
|
+
messageBubbleBackgroundIncoming: palette.blauBluePrimary20,
|
|
108
|
+
messageBubbleBackgroundIncomingBrand: palette.white,
|
|
109
|
+
messageBubbleBackgroundIncomingAlternative: palette.white,
|
|
110
|
+
messageBubbleBackgroundIncomingNegative: palette.white,
|
|
111
|
+
messageBubbleBackgroundIncomingMedia: palette.white,
|
|
102
112
|
skeletonWave: palette.grey2,
|
|
103
113
|
borderLow: palette.grey1,
|
|
104
114
|
border: palette.grey3,
|
|
@@ -408,6 +418,16 @@ export const getBlauSkin: GetKnownSkin = () => {
|
|
|
408
418
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.15),
|
|
409
419
|
backgroundDropZoneMediaHover: applyAlpha(palette.white, 0.03),
|
|
410
420
|
backgroundDropZoneMediaDragover: applyAlpha(palette.white, 0.05),
|
|
421
|
+
messageBubbleBackgroundOutgoing: palette.darkModeGrey,
|
|
422
|
+
messageBubbleBackgroundOutgoingBrand: palette.darkModeGrey,
|
|
423
|
+
messageBubbleBackgroundOutgoingAlternative: palette.darkModeGrey,
|
|
424
|
+
messageBubbleBackgroundOutgoingNegative: palette.darkModeGrey,
|
|
425
|
+
messageBubbleBackgroundOutgoingMedia: palette.darkModeGrey,
|
|
426
|
+
messageBubbleBackgroundIncoming: palette.darkModeGrey,
|
|
427
|
+
messageBubbleBackgroundIncomingBrand: palette.darkModeGrey,
|
|
428
|
+
messageBubbleBackgroundIncomingAlternative: palette.darkModeGrey,
|
|
429
|
+
messageBubbleBackgroundIncomingNegative: palette.darkModeGrey,
|
|
430
|
+
messageBubbleBackgroundIncomingMedia: palette.darkModeGrey,
|
|
411
431
|
skeletonWave: palette.grey5,
|
|
412
432
|
borderLow: palette.darkModeBlack,
|
|
413
433
|
border: palette.darkModeGrey,
|
package/src/skins/esimflag.tsx
CHANGED
|
@@ -103,6 +103,16 @@ export const getEsimflagSkin: GetKnownSkin = () => {
|
|
|
103
103
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.17),
|
|
104
104
|
backgroundDropZoneMediaHover: applyAlpha(palette.blue55, 0.2),
|
|
105
105
|
backgroundDropZoneMediaDragover: applyAlpha(palette.blue55, 0.4),
|
|
106
|
+
messageBubbleBackgroundOutgoing: palette.blue10,
|
|
107
|
+
messageBubbleBackgroundOutgoingBrand: palette.blue10,
|
|
108
|
+
messageBubbleBackgroundOutgoingAlternative: palette.blue10,
|
|
109
|
+
messageBubbleBackgroundOutgoingNegative: palette.blue10,
|
|
110
|
+
messageBubbleBackgroundOutgoingMedia: palette.blue10,
|
|
111
|
+
messageBubbleBackgroundIncoming: palette.grey1,
|
|
112
|
+
messageBubbleBackgroundIncomingBrand: palette.white,
|
|
113
|
+
messageBubbleBackgroundIncomingAlternative: palette.white,
|
|
114
|
+
messageBubbleBackgroundIncomingNegative: palette.white,
|
|
115
|
+
messageBubbleBackgroundIncomingMedia: palette.white,
|
|
106
116
|
skeletonWave: palette.grey2,
|
|
107
117
|
borderLow: palette.grey1,
|
|
108
118
|
border: palette.grey3,
|
|
@@ -413,6 +423,16 @@ export const getEsimflagSkin: GetKnownSkin = () => {
|
|
|
413
423
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.08),
|
|
414
424
|
backgroundDropZoneMediaHover: applyAlpha(palette.white, 0.03),
|
|
415
425
|
backgroundDropZoneMediaDragover: applyAlpha(palette.white, 0.05),
|
|
426
|
+
messageBubbleBackgroundOutgoing: palette.darkModeGrey6,
|
|
427
|
+
messageBubbleBackgroundOutgoingBrand: palette.darkModeGrey6,
|
|
428
|
+
messageBubbleBackgroundOutgoingAlternative: palette.darkModeGrey6,
|
|
429
|
+
messageBubbleBackgroundOutgoingNegative: palette.darkModeGrey6,
|
|
430
|
+
messageBubbleBackgroundOutgoingMedia: palette.darkModeGrey6,
|
|
431
|
+
messageBubbleBackgroundIncoming: palette.darkModeGrey,
|
|
432
|
+
messageBubbleBackgroundIncomingBrand: palette.darkModeGrey,
|
|
433
|
+
messageBubbleBackgroundIncomingAlternative: palette.darkModeGrey,
|
|
434
|
+
messageBubbleBackgroundIncomingNegative: palette.darkModeGrey,
|
|
435
|
+
messageBubbleBackgroundIncomingMedia: palette.darkModeGrey,
|
|
416
436
|
borderLow: palette.darkModeBlack,
|
|
417
437
|
border: palette.darkModeGrey,
|
|
418
438
|
borderHigh: palette.grey5,
|
package/src/skins/movistar.tsx
CHANGED
|
@@ -110,6 +110,16 @@ export const getMovistarSkin: GetKnownSkin = () => {
|
|
|
110
110
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.17),
|
|
111
111
|
backgroundDropZoneMediaHover: applyAlpha(palette.movistarBlack, 0.2),
|
|
112
112
|
backgroundDropZoneMediaDragover: applyAlpha(palette.movistarBlack, 0.4),
|
|
113
|
+
messageBubbleBackgroundOutgoing: palette.blueLight,
|
|
114
|
+
messageBubbleBackgroundOutgoingBrand: palette.blueLight,
|
|
115
|
+
messageBubbleBackgroundOutgoingAlternative: palette.blueLight,
|
|
116
|
+
messageBubbleBackgroundOutgoingNegative: palette.blueLight,
|
|
117
|
+
messageBubbleBackgroundOutgoingMedia: palette.blueLight,
|
|
118
|
+
messageBubbleBackgroundIncoming: palette.grey100,
|
|
119
|
+
messageBubbleBackgroundIncomingBrand: palette.white,
|
|
120
|
+
messageBubbleBackgroundIncomingAlternative: palette.white,
|
|
121
|
+
messageBubbleBackgroundIncomingNegative: palette.white,
|
|
122
|
+
messageBubbleBackgroundIncomingMedia: palette.white,
|
|
113
123
|
skeletonWave: palette.grey200,
|
|
114
124
|
borderLow: palette.grey100,
|
|
115
125
|
border: palette.grey300,
|
|
@@ -419,6 +429,16 @@ export const getMovistarSkin: GetKnownSkin = () => {
|
|
|
419
429
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.05),
|
|
420
430
|
backgroundDropZoneMediaHover: applyAlpha(palette.white, 0.03),
|
|
421
431
|
backgroundDropZoneMediaDragover: applyAlpha(palette.white, 0.05),
|
|
432
|
+
messageBubbleBackgroundOutgoing: palette.blueDark,
|
|
433
|
+
messageBubbleBackgroundOutgoingBrand: palette.blueDark,
|
|
434
|
+
messageBubbleBackgroundOutgoingAlternative: palette.blueDark,
|
|
435
|
+
messageBubbleBackgroundOutgoingNegative: palette.blueDark,
|
|
436
|
+
messageBubbleBackgroundOutgoingMedia: palette.blueDark,
|
|
437
|
+
messageBubbleBackgroundIncoming: palette.darkModeGrey,
|
|
438
|
+
messageBubbleBackgroundIncomingBrand: palette.darkModeGrey,
|
|
439
|
+
messageBubbleBackgroundIncomingAlternative: palette.darkModeGrey,
|
|
440
|
+
messageBubbleBackgroundIncomingNegative: palette.darkModeGrey,
|
|
441
|
+
messageBubbleBackgroundIncomingMedia: palette.darkModeGrey,
|
|
422
442
|
skeletonWave: palette.grey600,
|
|
423
443
|
borderLow: palette.darkModeBlack,
|
|
424
444
|
border: palette.darkModeGrey,
|
package/src/skins/o2.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import type {GetKnownSkin, KnownSkin} from './types';
|
|
|
11
11
|
|
|
12
12
|
export const palette = {
|
|
13
13
|
beyondBlue: '#0050FF',
|
|
14
|
+
beyondBlue5: '#F2F6FF',
|
|
14
15
|
beyondBlue10: '#E5EDFF',
|
|
15
16
|
beyondBlue15: '#CCDCFF',
|
|
16
17
|
beyondBlue30: '#80A7FF',
|
|
@@ -106,6 +107,16 @@ export const getO2Skin: GetKnownSkin = () => {
|
|
|
106
107
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.17),
|
|
107
108
|
backgroundDropZoneMediaHover: applyAlpha(palette.beyondBlue90, 0.2),
|
|
108
109
|
backgroundDropZoneMediaDragover: applyAlpha(palette.beyondBlue90, 0.4),
|
|
110
|
+
messageBubbleBackgroundOutgoing: palette.beyondBlue5,
|
|
111
|
+
messageBubbleBackgroundOutgoingBrand: palette.beyondBlue5,
|
|
112
|
+
messageBubbleBackgroundOutgoingAlternative: palette.beyondBlue5,
|
|
113
|
+
messageBubbleBackgroundOutgoingNegative: palette.beyondBlue5,
|
|
114
|
+
messageBubbleBackgroundOutgoingMedia: palette.beyondBlue5,
|
|
115
|
+
messageBubbleBackgroundIncoming: palette.grey20,
|
|
116
|
+
messageBubbleBackgroundIncomingBrand: palette.white,
|
|
117
|
+
messageBubbleBackgroundIncomingAlternative: palette.white,
|
|
118
|
+
messageBubbleBackgroundIncomingNegative: palette.white,
|
|
119
|
+
messageBubbleBackgroundIncomingMedia: palette.white,
|
|
109
120
|
skeletonWave: palette.grey30,
|
|
110
121
|
borderLow: palette.grey20,
|
|
111
122
|
border: palette.grey30,
|
|
@@ -414,6 +425,16 @@ export const getO2Skin: GetKnownSkin = () => {
|
|
|
414
425
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.05),
|
|
415
426
|
backgroundDropZoneMediaHover: applyAlpha(palette.white, 0.03),
|
|
416
427
|
backgroundDropZoneMediaDragover: applyAlpha(palette.white, 0.05),
|
|
428
|
+
messageBubbleBackgroundOutgoing: palette.darkModeGrey6,
|
|
429
|
+
messageBubbleBackgroundOutgoingBrand: palette.darkModeGrey6,
|
|
430
|
+
messageBubbleBackgroundOutgoingAlternative: palette.darkModeGrey6,
|
|
431
|
+
messageBubbleBackgroundOutgoingNegative: palette.darkModeGrey6,
|
|
432
|
+
messageBubbleBackgroundOutgoingMedia: palette.darkModeGrey6,
|
|
433
|
+
messageBubbleBackgroundIncoming: palette.darkModeGrey,
|
|
434
|
+
messageBubbleBackgroundIncomingBrand: palette.darkModeGrey,
|
|
435
|
+
messageBubbleBackgroundIncomingAlternative: palette.darkModeGrey,
|
|
436
|
+
messageBubbleBackgroundIncomingNegative: palette.darkModeGrey,
|
|
437
|
+
messageBubbleBackgroundIncomingMedia: palette.darkModeGrey,
|
|
417
438
|
navigationBarBackground: palette.darkModeBlack,
|
|
418
439
|
skeletonWave: palette.grey80,
|
|
419
440
|
borderLow: palette.darkModeBlack,
|
|
@@ -47,6 +47,16 @@ const colors: Colors = {
|
|
|
47
47
|
backgroundDropZoneNegativeDragover: '',
|
|
48
48
|
backgroundDropZoneMediaHover: '',
|
|
49
49
|
backgroundDropZoneMediaDragover: '',
|
|
50
|
+
messageBubbleBackgroundOutgoing: '',
|
|
51
|
+
messageBubbleBackgroundOutgoingBrand: '',
|
|
52
|
+
messageBubbleBackgroundOutgoingAlternative: '',
|
|
53
|
+
messageBubbleBackgroundOutgoingNegative: '',
|
|
54
|
+
messageBubbleBackgroundOutgoingMedia: '',
|
|
55
|
+
messageBubbleBackgroundIncoming: '',
|
|
56
|
+
messageBubbleBackgroundIncomingBrand: '',
|
|
57
|
+
messageBubbleBackgroundIncomingAlternative: '',
|
|
58
|
+
messageBubbleBackgroundIncomingNegative: '',
|
|
59
|
+
messageBubbleBackgroundIncomingMedia: '',
|
|
50
60
|
skeletonWave: '',
|
|
51
61
|
borderLow: '',
|
|
52
62
|
border: '',
|
package/src/skins/telefonica.tsx
CHANGED
|
@@ -107,6 +107,16 @@ export const getTelefonicaSkin: GetKnownSkin = () => {
|
|
|
107
107
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.17),
|
|
108
108
|
backgroundDropZoneMediaHover: applyAlpha(palette.telefonicaBlue80, 0.2),
|
|
109
109
|
backgroundDropZoneMediaDragover: applyAlpha(palette.telefonicaBlue80, 0.4),
|
|
110
|
+
messageBubbleBackgroundOutgoing: palette.telefonicaBlue10,
|
|
111
|
+
messageBubbleBackgroundOutgoingBrand: palette.telefonicaBlue10,
|
|
112
|
+
messageBubbleBackgroundOutgoingAlternative: palette.telefonicaBlue10,
|
|
113
|
+
messageBubbleBackgroundOutgoingNegative: palette.telefonicaBlue10,
|
|
114
|
+
messageBubbleBackgroundOutgoingMedia: palette.telefonicaBlue10,
|
|
115
|
+
messageBubbleBackgroundIncoming: palette.grey1,
|
|
116
|
+
messageBubbleBackgroundIncomingBrand: palette.white,
|
|
117
|
+
messageBubbleBackgroundIncomingAlternative: palette.white,
|
|
118
|
+
messageBubbleBackgroundIncomingNegative: palette.white,
|
|
119
|
+
messageBubbleBackgroundIncomingMedia: palette.white,
|
|
110
120
|
skeletonWave: palette.grey2,
|
|
111
121
|
borderLow: palette.grey1,
|
|
112
122
|
border: palette.grey2,
|
|
@@ -416,6 +426,16 @@ export const getTelefonicaSkin: GetKnownSkin = () => {
|
|
|
416
426
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.05),
|
|
417
427
|
backgroundDropZoneMediaHover: applyAlpha(palette.white, 0.03),
|
|
418
428
|
backgroundDropZoneMediaDragover: applyAlpha(palette.white, 0.05),
|
|
429
|
+
messageBubbleBackgroundOutgoing: palette.darkModeGrey6,
|
|
430
|
+
messageBubbleBackgroundOutgoingBrand: palette.darkModeGrey6,
|
|
431
|
+
messageBubbleBackgroundOutgoingAlternative: palette.darkModeGrey6,
|
|
432
|
+
messageBubbleBackgroundOutgoingNegative: palette.darkModeGrey6,
|
|
433
|
+
messageBubbleBackgroundOutgoingMedia: palette.darkModeGrey6,
|
|
434
|
+
messageBubbleBackgroundIncoming: palette.darkModeGrey,
|
|
435
|
+
messageBubbleBackgroundIncomingBrand: palette.darkModeGrey,
|
|
436
|
+
messageBubbleBackgroundIncomingAlternative: palette.darkModeGrey,
|
|
437
|
+
messageBubbleBackgroundIncomingNegative: palette.darkModeGrey,
|
|
438
|
+
messageBubbleBackgroundIncomingMedia: palette.darkModeGrey,
|
|
419
439
|
skeletonWave: palette.grey8,
|
|
420
440
|
borderLow: palette.darkModeBlack,
|
|
421
441
|
border: palette.darkModeGrey,
|
|
@@ -49,6 +49,16 @@ export type Colors = {
|
|
|
49
49
|
backgroundDropZoneNegativeDragover: string;
|
|
50
50
|
backgroundDropZoneMediaHover: string;
|
|
51
51
|
backgroundDropZoneMediaDragover: string;
|
|
52
|
+
messageBubbleBackgroundOutgoing: string;
|
|
53
|
+
messageBubbleBackgroundOutgoingBrand: string;
|
|
54
|
+
messageBubbleBackgroundOutgoingAlternative: string;
|
|
55
|
+
messageBubbleBackgroundOutgoingNegative: string;
|
|
56
|
+
messageBubbleBackgroundOutgoingMedia: string;
|
|
57
|
+
messageBubbleBackgroundIncoming: string;
|
|
58
|
+
messageBubbleBackgroundIncomingBrand: string;
|
|
59
|
+
messageBubbleBackgroundIncomingAlternative: string;
|
|
60
|
+
messageBubbleBackgroundIncomingNegative: string;
|
|
61
|
+
messageBubbleBackgroundIncomingMedia: string;
|
|
52
62
|
skeletonWave: string;
|
|
53
63
|
borderLow: string;
|
|
54
64
|
border: string;
|
|
@@ -140,6 +140,16 @@ export const getVivoEvolutionSkin: GetKnownSkin = () => {
|
|
|
140
140
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.vivoNeutral0, 0.17),
|
|
141
141
|
backgroundDropZoneMediaHover: applyAlpha(palette.vivoPurple900, 0.3),
|
|
142
142
|
backgroundDropZoneMediaDragover: applyAlpha(palette.vivoPurple900, 0.5),
|
|
143
|
+
messageBubbleBackgroundOutgoing: palette.vivoNeutral25,
|
|
144
|
+
messageBubbleBackgroundOutgoingBrand: palette.vivoNeutral25,
|
|
145
|
+
messageBubbleBackgroundOutgoingAlternative: palette.vivoNeutral25,
|
|
146
|
+
messageBubbleBackgroundOutgoingNegative: palette.vivoNeutral25,
|
|
147
|
+
messageBubbleBackgroundOutgoingMedia: palette.vivoNeutral25,
|
|
148
|
+
messageBubbleBackgroundIncoming: palette.vivoNeutral25,
|
|
149
|
+
messageBubbleBackgroundIncomingBrand: palette.vivoNeutral0,
|
|
150
|
+
messageBubbleBackgroundIncomingAlternative: palette.vivoNeutral0,
|
|
151
|
+
messageBubbleBackgroundIncomingNegative: palette.vivoNeutral0,
|
|
152
|
+
messageBubbleBackgroundIncomingMedia: palette.vivoNeutral0,
|
|
143
153
|
skeletonWave: palette.vivoNeutral100,
|
|
144
154
|
borderLow: palette.vivoNeutral25,
|
|
145
155
|
border: palette.vivoNeutral200,
|
|
@@ -449,6 +459,16 @@ export const getVivoEvolutionSkin: GetKnownSkin = () => {
|
|
|
449
459
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.vivoNeutral0, 0.05),
|
|
450
460
|
backgroundDropZoneMediaHover: applyAlpha(palette.vivoNeutral0, 0.03),
|
|
451
461
|
backgroundDropZoneMediaDragover: applyAlpha(palette.vivoNeutral0, 0.05),
|
|
462
|
+
messageBubbleBackgroundOutgoing: palette.vivoNeutral900,
|
|
463
|
+
messageBubbleBackgroundOutgoingBrand: palette.vivoNeutral900,
|
|
464
|
+
messageBubbleBackgroundOutgoingAlternative: palette.vivoNeutral900,
|
|
465
|
+
messageBubbleBackgroundOutgoingNegative: palette.vivoNeutral900,
|
|
466
|
+
messageBubbleBackgroundOutgoingMedia: palette.vivoNeutral900,
|
|
467
|
+
messageBubbleBackgroundIncoming: palette.vivoNeutral900,
|
|
468
|
+
messageBubbleBackgroundIncomingBrand: palette.vivoNeutral900,
|
|
469
|
+
messageBubbleBackgroundIncomingAlternative: palette.vivoNeutral900,
|
|
470
|
+
messageBubbleBackgroundIncomingNegative: palette.vivoNeutral900,
|
|
471
|
+
messageBubbleBackgroundIncomingMedia: palette.vivoNeutral900,
|
|
452
472
|
skeletonWave: palette.vivoNeutral600,
|
|
453
473
|
borderLow: palette.vivoNeutral950,
|
|
454
474
|
border: palette.vivoNeutral900,
|
package/src/skins/vivo.tsx
CHANGED
|
@@ -96,6 +96,16 @@ export const getVivoSkin: GetKnownSkin = () => {
|
|
|
96
96
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.17),
|
|
97
97
|
backgroundDropZoneMediaHover: applyAlpha(palette.vivoPurpleDark, 0.3),
|
|
98
98
|
backgroundDropZoneMediaDragover: applyAlpha(palette.vivoPurpleDark, 0.5),
|
|
99
|
+
messageBubbleBackgroundOutgoing: palette.grey1,
|
|
100
|
+
messageBubbleBackgroundOutgoingBrand: palette.grey1,
|
|
101
|
+
messageBubbleBackgroundOutgoingAlternative: palette.grey1,
|
|
102
|
+
messageBubbleBackgroundOutgoingNegative: palette.grey1,
|
|
103
|
+
messageBubbleBackgroundOutgoingMedia: palette.grey1,
|
|
104
|
+
messageBubbleBackgroundIncoming: palette.grey1,
|
|
105
|
+
messageBubbleBackgroundIncomingBrand: palette.white,
|
|
106
|
+
messageBubbleBackgroundIncomingAlternative: palette.white,
|
|
107
|
+
messageBubbleBackgroundIncomingNegative: palette.white,
|
|
108
|
+
messageBubbleBackgroundIncomingMedia: palette.white,
|
|
99
109
|
skeletonWave: palette.grey2,
|
|
100
110
|
borderLow: palette.grey1,
|
|
101
111
|
border: palette.grey3,
|
|
@@ -405,6 +415,16 @@ export const getVivoSkin: GetKnownSkin = () => {
|
|
|
405
415
|
backgroundDropZoneNegativeDragover: applyAlpha(palette.white, 0.05),
|
|
406
416
|
backgroundDropZoneMediaHover: applyAlpha(palette.white, 0.03),
|
|
407
417
|
backgroundDropZoneMediaDragover: applyAlpha(palette.white, 0.05),
|
|
418
|
+
messageBubbleBackgroundOutgoing: palette.darkModeGrey,
|
|
419
|
+
messageBubbleBackgroundOutgoingBrand: palette.darkModeGrey,
|
|
420
|
+
messageBubbleBackgroundOutgoingAlternative: palette.darkModeGrey,
|
|
421
|
+
messageBubbleBackgroundOutgoingNegative: palette.darkModeGrey,
|
|
422
|
+
messageBubbleBackgroundOutgoingMedia: palette.darkModeGrey,
|
|
423
|
+
messageBubbleBackgroundIncoming: palette.darkModeGrey,
|
|
424
|
+
messageBubbleBackgroundIncomingBrand: palette.darkModeGrey,
|
|
425
|
+
messageBubbleBackgroundIncomingAlternative: palette.darkModeGrey,
|
|
426
|
+
messageBubbleBackgroundIncomingNegative: palette.darkModeGrey,
|
|
427
|
+
messageBubbleBackgroundIncomingMedia: palette.darkModeGrey,
|
|
408
428
|
skeletonWave: palette.grey5,
|
|
409
429
|
borderLow: palette.darkModeBlack,
|
|
410
430
|
border: palette.darkModeGrey,
|
package/src/text-tokens.tsx
CHANGED
|
@@ -786,3 +786,17 @@ export const fileUploadListLabel: TextToken = {
|
|
|
786
786
|
de: 'Hochgeladene Dateien',
|
|
787
787
|
pt: 'Arquivos enviados',
|
|
788
788
|
};
|
|
789
|
+
|
|
790
|
+
export const messageIncoming: TextToken = {
|
|
791
|
+
es: 'Mensaje',
|
|
792
|
+
en: 'Message',
|
|
793
|
+
pt: 'Mensagem',
|
|
794
|
+
de: 'Nachricht',
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
export const messageOutgoing: TextToken = {
|
|
798
|
+
es: 'Tú',
|
|
799
|
+
en: 'You',
|
|
800
|
+
pt: 'Você',
|
|
801
|
+
de: 'Du',
|
|
802
|
+
};
|
package/src/tooltip.tsx
CHANGED
|
@@ -70,8 +70,11 @@ const getElementDimensionsWithoutPadding = (element: HTMLElement) => {
|
|
|
70
70
|
parseFloat(getComputedStyle(element, null).paddingTop) +
|
|
71
71
|
parseFloat(getComputedStyle(element, null).paddingBottom);
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
// Chromium can return different offsetWidth/offsetHeight values at different subpixel positions.
|
|
74
|
+
// Use position-independent dimensions to avoid a measurement/positioning feedback loop.
|
|
75
|
+
const rect = element.getBoundingClientRect();
|
|
76
|
+
const width = rect.width - horizontalPadding;
|
|
77
|
+
const height = rect.height - verticalPadding;
|
|
75
78
|
return {width, height};
|
|
76
79
|
};
|
|
77
80
|
|