Skip to content

Commit 9ce2656

Browse files
committed
Added dialog titles everywhere for accessibility
1 parent 1d59c4e commit 9ce2656

File tree

32 files changed

+1453
-217
lines changed

32 files changed

+1453
-217
lines changed

examples/example_pro/src/FirestoreApp/DemoImportAction.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
Dialog,
66
DialogActions,
77
DialogContent,
8+
DialogTitle,
89
FileUploadIcon,
910
IconButton,
1011
Tooltip,
@@ -26,8 +27,8 @@ export function DemoImportAction({}: CollectionActionsProps) {
2627

2728
<Dialog open={open}
2829
maxWidth={"lg"}>
30+
<DialogTitle>Import data</DialogTitle>
2931
<DialogContent className={"flex flex-col gap-4 my-4"}>
30-
<Typography variant={"h6"}>Import data</Typography>
3132
<Typography variant={"body2"}>The import feature is disabled in this demo</Typography>
3233
</DialogContent>
3334
<DialogActions>

examples/example_pro/src/FirestoreApp/collection_actions/OpenAIInstructionsActions.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import React, { useEffect } from "react";
22
import { useSideDialogsController } from "@firecms/core";
3-
import { AutoFixHighIcon, Button, Dialog, DialogActions, DialogContent, IconButton, Typography, } from "@firecms/ui";
3+
import {
4+
AutoFixHighIcon,
5+
Button,
6+
Dialog,
7+
DialogActions,
8+
DialogContent,
9+
DialogTitle,
10+
IconButton,
11+
Typography,
12+
} from "@firecms/ui";
413

514
/**
615
* This whole component is a big hack used to point the user to the
@@ -37,10 +46,8 @@ export function OpenAIInstructionsActions() {
3746
open={open}
3847
onOpenChange={setOpen}
3948
>
49+
<DialogTitle>OpenAI data enhancement</DialogTitle>
4050
<DialogContent className="p-8 flex flex-col space-y-2">
41-
<Typography variant={"h5"} gutterBottom>
42-
OpenAI data enhancement DEMO
43-
</Typography>
4451
<Typography gutterBottom>
4552
Try it out by clicking on <b>ADD BOOK</b> and
4653
then typing the title of your favourite book on the <b>AUTOFILL

examples/example_pro/src/FirestoreApp/views/ClientUIComponentsShowcase.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
Dialog,
1818
DialogActions,
1919
DialogContent,
20+
DialogTitle,
2021
ExpandablePanel,
2122
FaceIcon,
2223
FiberManualRecordIcon,
@@ -342,9 +343,10 @@ export default function ClientUIComponentsShowcase({
342343
<Typography variant="subtitle2">Dialog</Typography>
343344
<Button onClick={() => setDialogOpen(true)}>Open Dialog</Button>
344345
<Dialog open={isDialogOpen} onOpenChange={setDialogOpen}>
345-
346+
<DialogTitle>
347+
Dialog
348+
</DialogTitle>
346349
<DialogContent>
347-
<Typography variant={"h6"} className={"mb-2"}>Dialog</Typography>
348350
This UI kit is amazing!
349351
</DialogContent>
350352
<DialogActions>

packages/collection_editor/src/ui/collection_editor/CollectionEditorDialog.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
Dialog,
3333
DialogActions,
3434
DialogContent,
35+
DialogTitle,
3536
DoneIcon,
3637
IconButton,
3738
LoadingButton,
@@ -114,6 +115,7 @@ export function CollectionEditorDialog(props: CollectionEditorDialogProps) {
114115
maxWidth={"7xl"}
115116
onOpenChange={(open) => !open ? handleCancel() : undefined}
116117
>
118+
<DialogTitle hidden>Collection editor</DialogTitle>
117119
{open && <CollectionEditor {...props}
118120
handleCancel={handleCancel}
119121
setFormDirty={setFormDirty}/>}

packages/collection_editor/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import { useCustomizationController } from "@firecms/core";
2-
import { Button, Dialog, DialogActions, DialogContent, Typography } from "@firecms/ui";
2+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography } from "@firecms/ui";
33
import React from "react";
44

5-
export function EntityCustomViewsSelectDialog({ open, onClose }: { open: boolean, onClose: (selectedViewKey?: string) => void }) {
5+
export function EntityCustomViewsSelectDialog({
6+
open,
7+
onClose
8+
}: { open: boolean, onClose: (selectedViewKey?: string) => void }) {
69
const {
710
entityViews,
811
} = useCustomizationController();
912

1013
return <Dialog
1114
maxWidth={"md"}
1215
open={open}>
16+
<DialogTitle>Select custom view</DialogTitle>
1317
<DialogContent className={"flex flex-col gap-4"}>
14-
<Typography variant={"h6"}>
15-
Select view
16-
</Typography>
1718
{entityViews?.map((view) => {
1819
return <Button
1920
key={view.key}

packages/collection_editor/src/ui/collection_editor/EnumForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Dialog,
1212
DialogActions,
1313
DialogContent,
14+
DialogTitle,
1415
IconButton,
1516
ListIcon,
1617
Paper,
@@ -327,7 +328,7 @@ function EnumEntryDialog({
327328
open={open}
328329
onOpenChange={(open) => !open ? onClose() : undefined}
329330
>
330-
331+
<DialogTitle hidden>Enum form dialog</DialogTitle>
331332
<DialogContent>
332333
{index !== undefined &&
333334
<div>

packages/collection_editor/src/ui/collection_editor/GetCodeDialog.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EntityCollection, isEmptyObject, useSnackbarController } from "@firecms/core";
2-
import { Button, ContentCopyIcon, Dialog, DialogActions, DialogContent, Typography, } from "@firecms/ui";
2+
import { Button, ContentCopyIcon, Dialog, DialogActions, DialogContent, DialogTitle, Typography, } from "@firecms/ui";
33
import React from "react";
44
import JSON5 from "json5";
55
import { Highlight, themes } from "prism-react-renderer"
@@ -20,10 +20,9 @@ export function GetCodeDialog({
2020
return <Dialog open={open}
2121
onOpenChange={onOpenChange}
2222
maxWidth={"4xl"}>
23+
<DialogTitle variant={"h6"}>Code for {collection.name}</DialogTitle>
2324
<DialogContent>
24-
<Typography variant={"h6"} className={"my-4"}>
25-
Code for {collection.name}
26-
</Typography>
25+
2726
<Typography variant={"body2"} className={"my-4 mb-8"}>
2827
If you want to customise the collection in code, you can add this collection code to your CMS
2928
app configuration.

packages/collection_editor/src/ui/collection_editor/PropertyEditView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ export function PropertyFormDialog({
275275
e.stopPropagation();
276276
formexRef.current?.handleSubmit(e)
277277
}}>
278+
<DialogTitle hidden>Property edit view</DialogTitle>
278279
<DialogContent>
280+
279281
<PropertyForm {...formProps}
280282
onDismiss={onCancel}
281283
onPropertyChanged={(params) => {

packages/collection_editor/src/ui/collection_editor/UnsavedChangesDialog.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { Button, Dialog, DialogActions, DialogContent, Typography } from "@firecms/ui";
2+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography } from "@firecms/ui";
33

44
export interface UnsavedChangesDialogProps {
55
open: boolean;
@@ -24,11 +24,9 @@ export function UnsavedChangesDialog({
2424
aria-labelledby="alert-dialog-title"
2525
aria-describedby="alert-dialog-description"
2626
>
27-
<DialogContent>
28-
<Typography variant={"h6"}>
29-
{title ?? "Unsaved changes"}
30-
</Typography>
3127

28+
<DialogTitle>{title ?? "Unsaved changes"}</DialogTitle>
29+
<DialogContent>
3230
{body && <Typography>
3331
{body}
3432
</Typography>}

packages/data_export/src/export/BasicExportAction.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Dialog,
99
DialogActions,
1010
DialogContent,
11+
DialogTitle,
1112
GetAppIcon,
1213
IconButton,
1314
Tooltip,
@@ -70,9 +71,10 @@ export function BasicExportAction({
7071
open={open}
7172
onOpenChange={setOpen}
7273
maxWidth={"xl"}>
73-
<DialogContent className={"flex flex-col gap-4 my-4"}>
7474

75-
<Typography variant={"h6"}>Export data</Typography>
75+
<DialogTitle variant={"h6"}>Export data</DialogTitle>
76+
77+
<DialogContent className={"flex flex-col gap-4 my-4"}>
7678

7779
<div>Download the the content of this table as a CSV</div>
7880

0 commit comments

Comments
 (0)