Skip to content

Commit 6eea486

Browse files
authored
Improve UI components with tooltips, accessibility fixes, and reusable locale/theme selectors (#790)
### Summary & Motivation Add tooltip support to all form field components to provide better user guidance. Form fields like account name, region, and title now have contextual tooltips explaining their purpose. - Add MultiSelect component for multiple selection dropdowns. - Extract LocaleSwitcher and ThemeModeSelector into reusable components. - Add fixed dialog width utilities (w-dialog-md, w-dialog-lg) using @Utility directive to prevent layout inconsistencies across languages. - Add button variant to Link component for consistent styling. - Fix Modal component to pass props only to ModalOverlay, preventing prop spreading issues. - Lock verification code input after pasting to prevent extra characters. - Remove incorrect aria-hidden attributes from Table wrapper divs. - Add aria-label to newsletter email input for accessibility. - Remove Dutch (nl-NL) language support from the application. ### Downstream projects 1. Remove Dutch language translations by deleting `application/your-self-contained-system/WebApp/shared/translations/locale/nl-NL.po`. 2. Update all Dialog components to use the new standard width utilities instead of max-w classes. Replace `sm:max-w-lg` with `sm:w-dialog-md` and similar patterns with `sm:w-dialog-lg` for larger dialogs. ```diff - <Dialog className="sm:max-w-lg"> + <Dialog className="sm:w-dialog-md"> ``` ### Checklist - [x] I have added tests, or done manual regression tests - [x] I have updated the documentation, if necessary
2 parents d1bc1ca + ba49a1d commit 6eea486

File tree

35 files changed

+445
-662
lines changed

35 files changed

+445
-662
lines changed

application/account-management/WebApp/federated-modules/common/AcceptInvitationDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function AcceptInvitationDialog({
5454

5555
return (
5656
<Modal isOpen={isOpen} onOpenChange={onOpenChange} isDismissable={true}>
57-
<Dialog className="sm:max-w-lg">
57+
<Dialog className="sm:w-dialog-md">
5858
<XIcon
5959
onClick={() => onOpenChange(false)}
6060
className="absolute top-2 right-2 h-10 w-10 cursor-pointer p-2 hover:bg-muted"

application/account-management/WebApp/federated-modules/common/SupportDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function SupportDialog({ children }: Readonly<SupportDialogProps>) {
1616
<DialogTrigger>
1717
{children}
1818
<Modal isDismissable={true} zIndex="high">
19-
<Dialog className="sm:max-w-lg">
19+
<Dialog className="sm:w-dialog-md">
2020
{({ close }) => (
2121
<>
2222
<XIcon onClick={close} className="absolute top-2 right-2 h-10 w-10 cursor-pointer p-2 hover:bg-muted" />

application/account-management/WebApp/federated-modules/common/UserProfileModal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ export default function UserProfileModal({ isOpen, onOpenChange }: Readonly<Prof
135135
</Heading>
136136
</Dialog>
137137
) : (
138-
<Dialog aria-label={t`User profile`} className="max-sm:flex max-sm:flex-col max-sm:overflow-hidden">
138+
<Dialog
139+
aria-label={t`User profile`}
140+
className="max-sm:flex max-sm:flex-col max-sm:overflow-hidden sm:w-dialog-lg"
141+
>
139142
<XIcon onClick={closeDialog} className="absolute top-2 right-2 h-10 w-10 cursor-pointer p-2 hover:bg-muted" />
140143
<DialogHeader description={<Trans>Update your profile picture and personal details here.</Trans>}>
141144
<Heading slot="title" className="text-2xl">
@@ -237,6 +240,7 @@ export default function UserProfileModal({ isOpen, onOpenChange }: Readonly<Prof
237240
<TextField
238241
name="title"
239242
label={t`Title`}
243+
tooltip={t`Your professional title or role`}
240244
defaultValue={user?.title}
241245
placeholder={t`E.g. Software engineer`}
242246
/>

application/account-management/WebApp/routes/(index)/-components/FooterSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function FooterSection() {
1212
<div className="font-normal text-base text-muted-foreground">Technology that has your back.</div>
1313
</div>
1414
<div className="right flex flex-col items-center gap-4 md:flex-row">
15-
<TextField type="email" placeholder="Enter your email" />
15+
<TextField type="email" placeholder="Enter your email" aria-label="Email address" />
1616
{/* Button component is used to display a call to action */}
1717
<Button variant="primary">Subscribe</Button>
1818
</div>

application/account-management/WebApp/routes/admin/account/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ export function AccountSettings() {
335335
isDisabled={updateCurrentTenantMutation.isPending}
336336
isReadOnly={!isOwner}
337337
label={t`Account name`}
338+
tooltip={isOwner ? t`The name of your account, shown to users and in email notifications` : undefined}
338339
description={!isOwner ? t`Only account owners can modify the account name` : undefined}
339340
validationBehavior="aria"
340341
/>

application/account-management/WebApp/routes/admin/users/-components/InviteUserDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function InviteUserDialog({ isOpen, onOpenChange }: Readonly<Invi
3434

3535
return (
3636
<Modal isOpen={isOpen} onOpenChange={onOpenChange} isDismissable={true}>
37-
<Dialog>
37+
<Dialog className="sm:w-dialog-md">
3838
<XIcon
3939
onClick={() => onOpenChange(false)}
4040
className="absolute top-2 right-2 h-10 w-10 cursor-pointer p-2 hover:bg-muted"

application/account-management/WebApp/routes/admin/users/-components/TenantNameRequiredDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface TenantNameRequiredDialogProps {
1616
export function TenantNameRequiredDialog({ isOpen, onOpenChange }: Readonly<TenantNameRequiredDialogProps>) {
1717
return (
1818
<Modal isOpen={isOpen} onOpenChange={onOpenChange} isDismissable={true}>
19-
<Dialog className="sm:max-w-lg">
19+
<Dialog className="sm:w-dialog-md">
2020
{({ close }) => (
2121
<>
2222
<XIcon onClick={close} className="absolute top-2 right-2 h-10 w-10 cursor-pointer p-2 hover:bg-muted" />

application/account-management/WebApp/routes/signup/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export function StartSignupForm() {
9393
name="region"
9494
selectedKey="europe"
9595
label={t`Region`}
96+
tooltip={t`Data storage location for privacy and compliance. This cannot be changed later.`}
9697
description={t`This is the region where your data is stored`}
9798
isRequired={true}
9899
className="flex w-full flex-col"

application/account-management/WebApp/rsbuild.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ export default defineConfig({
3636
"./FederatedTopMenu": "./federated-modules/topMenu/FederatedTopMenu.tsx",
3737
"./AuthSyncModal": "./federated-modules/common/AuthSyncModal.tsx",
3838
"./translations/en-US": "./shared/translations/locale/en-US.ts",
39-
"./translations/da-DK": "./shared/translations/locale/da-DK.ts",
40-
"./translations/nl-NL": "./shared/translations/locale/nl-NL.ts"
39+
"./translations/da-DK": "./shared/translations/locale/da-DK.ts"
4140
}
4241
})
4342
]

application/account-management/WebApp/shared/translations/locale/da-DK.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ msgstr "Mørk"
176176
msgid "Dashboard"
177177
msgstr "Dashboard"
178178

179+
msgid "Data storage location for privacy and compliance. This cannot be changed later."
180+
msgstr "Datalagringsplacering for privatliv og compliance. Dette kan ikke ændres senere."
181+
179182
msgid "Decline"
180183
msgstr "Afslå"
181184

@@ -457,6 +460,9 @@ msgstr "System"
457460
msgid "Terms of use"
458461
msgstr "Brugsvilkår"
459462

463+
msgid "The name of your account, shown to users and in email notifications"
464+
msgstr "Navnet på din konto, vist til brugere og i e-mail-notifikationer"
465+
460466
msgid "Theme"
461467
msgstr "Tema"
462468

@@ -579,6 +585,9 @@ msgstr "Din konto blev skiftet i en anden browsertab."
579585
msgid "Your account was switched to <0>{newTenantName}</0> in another browser tab."
580586
msgstr "Din konto blev skiftet til <0>{newTenantName}</0> i en anden browsertab."
581587

588+
msgid "Your professional title or role"
589+
msgstr "Din professionelle titel eller rolle"
590+
582591
msgid "Your team needs to know who's inviting them. Add an account name to get started."
583592
msgstr "Dit team skal vide, hvem der inviterer dem. Tilføj et kontonavn for at komme i gang."
584593

0 commit comments

Comments
 (0)