diff --git a/.changeset/green-rules-cover.md b/.changeset/green-rules-cover.md new file mode 100644 index 0000000000000..0501761799753 --- /dev/null +++ b/.changeset/green-rules-cover.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Improves color contrast in image gallery icon buttons to meet WCAG compliance. diff --git a/apps/meteor/client/components/ImageGallery/ImageGallery.tsx b/apps/meteor/client/components/ImageGallery/ImageGallery.tsx index 621caedc6fc38..9884c463e8986 100644 --- a/apps/meteor/client/components/ImageGallery/ImageGallery.tsx +++ b/apps/meteor/client/components/ImageGallery/ImageGallery.tsx @@ -1,6 +1,6 @@ import type { IUpload } from '@rocket.chat/core-typings'; import { css } from '@rocket.chat/css-in-js'; -import { Box, ButtonGroup, IconButton, Palette, Throbber } from '@rocket.chat/fuselage'; +import { Box, ButtonGroup, IconButton, Palette, PaletteStyleTag, Throbber, padding } from '@rocket.chat/fuselage'; import { useRef, useState } from 'react'; import { FocusScope } from 'react-aria'; import { createPortal } from 'react-dom'; @@ -32,10 +32,8 @@ const swiperStyle = css` background-color: var(--rcx-color-surface-overlay, rgba(0, 0, 0, 0.6)); } - .rcx-swiper-close-button, - .rcx-swiper-prev-button, - .rcx-swiper-next-button { - color: var(--rcx-color-font-pure-white, #ffffff) !important; + .swiper-slide { + padding: ${padding('x144')} ${padding('x60')} ${padding('x96')}; } .rcx-swiper-prev-button, @@ -96,11 +94,7 @@ const swiperStyle = css` width: 100%; display: flex; justify-content: flex-end; - transition: background-color 0.2s; - &:hover { - background-color: ${Palette.surface['surface-overlay']}; - transition: background-color 0.2s; - } + background-color: ${Palette.surface['surface-sidebar']}; } `; @@ -126,77 +120,97 @@ export const ImageGallery = ({ images, onClose, loadMore }: { images: IUpload[]; const preventPropagation = usePreventPropagation(); return createPortal( - - -
- - {zoomScale !== 1 && ( - - )} + <> + + + +
+ + {zoomScale !== 1 && ( + + )} + + + + - - - - - String(keyCode) === '27' && onClose()} - modules={[Navigation, Zoom, Keyboard, A11y]} - onInit={(swiper: SwiperClass) => setSwiperInst(swiper)} - onSlidesGridLengthChange={(swiper: SwiperClass) => { - swiper.slideTo(images.length - gridSize, 0); - setGridSize(images.length); - }} - onReachBeginning={loadMore} - initialSlide={images.length - 1} - > - {[...images].reverse().map(({ _id, path, url }) => ( - -
- {/* eslint-disable-next-line - jsx-a11y/no-noninteractive-element-interactions, - jsx-a11y/click-events-have-key-events - */} - -
- + String(keyCode) === '27' && onClose()} + modules={[Navigation, Zoom, Keyboard, A11y]} + onInit={(swiper: SwiperClass) => setSwiperInst(swiper)} + onSlidesGridLengthChange={(swiper: SwiperClass) => { + swiper.slideTo(images.length - gridSize, 0); + setGridSize(images.length); + }} + onReachBeginning={loadMore} + initialSlide={images.length - 1} + > + {[...images].reverse().map(({ _id, path, url }) => ( + +
+ {/* eslint-disable-next-line + jsx-a11y/no-noninteractive-element-interactions, + jsx-a11y/click-events-have-key-events + */} + +
+ +
-
- - ))} - -
- - , +
+ ))} +
+
+
+
+ , document.body, ); };