Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♿️(frontend) Accessibility clean #641

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
745 changes: 745 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"@ag-media/react-pdf-table": "^2.0.1"
}
}
314 changes: 314 additions & 0 deletions q

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/frontend/apps/impress/src/components/DropButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ export const DropButton = ({
}: PropsWithChildren<DropButtonProps>) => {
const [isLocalOpen, setIsLocalOpen] = useState(isOpen);

const triggerRef = useRef(null);
const triggerRef = useRef<HTMLButtonElement>(null);
const firstFocusableRef = useRef<HTMLButtonElement>(null);

useEffect(() => {
setIsLocalOpen(isOpen);
}, [isOpen]);
if (isLocalOpen && firstFocusableRef.current) {
firstFocusableRef.current.focus();
}
}, [isLocalOpen]);

const onOpenChangeHandler = (isOpen: boolean) => {
setIsLocalOpen(isOpen);
Expand Down
17 changes: 17 additions & 0 deletions src/frontend/apps/impress/src/cunningham/cunningham-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -609,3 +609,20 @@ input:-webkit-autofill:focus {
.c__tooltip {
padding: 4px 6px;
}

button:focus {
background-color: var(
--c--components--button--primary-text--background--color-hover
);
border-radius: var(--c--components--button--border-radius--focus);
box-shadow: 0 0 0 2px var(--c--theme--colors--primary-400)
}

.new-doc-button {
color: white !important;
}

.new-doc-button:focus,
.new-doc-button:focus-visible {
color: white !important;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
BlockNoteSchema,
Dictionary,
locales,
withPageBreak,
} from '@blocknote/core';
import { BlockNoteSchema, Dictionary, locales } from '@blocknote/core';
import '@blocknote/core/fonts/inter.css';
import { BlockNoteView } from '@blocknote/mantine';
import '@blocknote/mantine/style.css';
Expand All @@ -27,7 +22,7 @@ import { randomColor } from '../utils';
import { BlockNoteSuggestionMenu } from './BlockNoteSuggestionMenu';
import { BlockNoteToolbar } from './BlockNoteToolbar';

export const blockNoteSchema = withPageBreak(BlockNoteSchema.create());
export const blockNoteSchema = BlockNoteSchema.create();

interface BlockNoteEditorProps {
doc: Doc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export const DocsGridItem = ({ doc }: DocsGridItemProps) => {
$css={css`
flex: ${flexLeft};
align-items: center;
&:focus {
outline: 2px solidrgb(33, 34, 82);
}
min-width: 0;
`}
href={`/docs/${doc.id}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const SimpleDocItem = ({
{isPinned ? (
<PinnedDocumentIcon aria-label={t('Pin document icon')} />
) : (
<SimpleFileIcon aria-label={t('Simple document icon')} />
<SimpleFileIcon aria-hidden="true" />
)}
</Box>
<Box $justify="center" $overflow="auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import { createGlobalStyle } from 'styled-components';
import { useCunninghamTheme } from '@/cunningham';

const GaufreStyle = createGlobalStyle`
.lasuite-gaufre-btn{
box-shadow: inset 0 0 0 0 !important;

&:focus {
outline: 2px solidrgb(33, 34, 82);
}

`;

export const LaGaufre = () => {
Expand Down
23 changes: 23 additions & 0 deletions src/frontend/apps/impress/src/features/language/LanguagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ export const LanguagePicker = () => {

const optionsPicker = useMemo(() => {
return (languages || []).map((lang) => ({
value: lang,
label: lang,
render: () => (
<Box
className="c_select__render"
$direction="row"
$gap="0.7rem"
$align="center"
>
<Text
$isMaterialIcon
$size="1rem"
$theme="primary"
$weight="bold"
$variation="800"
>
translate
</Text>
<Text $theme="primary" $weight="500" $variation="800" lang={lang}>
{LANGUAGES_ALLOWED[lang]}
</Text>
</Box>
),
label: LANGUAGES_ALLOWED[lang],
isSelected: language === lang,
callback: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const LeftPanel = () => {
overflow: hidden;
border-right: 1px solid ${colors['greyscale-200']};
`}
$background={colors['greyscale-000']}
>
<Box
$css={css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,39 @@ export const LeftPanelHeader = ({ children }: PropsWithChildren) => {
onClick={goToHome}
size="medium"
color="tertiary-text"
aria-label={t('Back to home page')}
icon={
<Icon $variation="800" $theme="primary" iconName="house" />
<span aria-hidden="true">
<Icon $variation="800" $theme="primary" iconName="house" />
</span>
}
/>
{authenticated && (
<Button
onClick={searchModal.open}
size="medium"
color="tertiary-text"
aria-label={t('Search')}
icon={
<Icon $variation="800" $theme="primary" iconName="search" />
<span aria-hidden="true">
<Icon
$variation="800"
$theme="primary"
iconName="search"
/>
</span>
}
/>
)}
</Box>
{authenticated && (
<Button onClick={createNewDoc}>{t('New doc')}</Button>
<Button
onClick={createNewDoc}
className="new-doc-button"
aria-label={t('New document')}
>
{t('New doc')}
</Button>
)}
</Box>
</SeparatedSection>
Expand Down
1 change: 1 addition & 0 deletions src/frontend/apps/impress/src/i18n/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
"My docs": "Mes documents",
"Name": "Nom",
"New doc": "Nouveau doc",
"New document": "Nouveau document",
"No active search": "Aucune recherche active",
"No document found": "Aucun document trouvé",
"No documents found": "Aucun document trouvé",
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/apps/impress/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ type AppPropsWithLayout = AppProps & {
export default function App({ Component, pageProps }: AppPropsWithLayout) {
useSWRegister();
const getLayout = Component.getLayout ?? ((page) => page);
const { t } = useTranslation();
const { t, i18n } = useTranslation();

useEffect(() => {
document.documentElement.lang = i18n.language;
}, [i18n.language]);

useEffect(() => {
console.log(
Expand Down
Loading