Skip to content

Commit 2605a25

Browse files
authored
Arial label for close button, cancel and confirm button for prompt component (#6014)
* Arial label for close button, cancel and confirm button for prompt component * optional * api
1 parent 524310f commit 2605a25

7 files changed

Lines changed: 36 additions & 4 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Prompt",
5+
"comment": "Arial label for close button, cancel and confirm button for prompt component",
6+
"packageName": "@azure/communication-react",
7+
"email": "96077406+carocao-msft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/communication-react/review/beta/communication-react.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ export interface CallCompositeStrings {
851851
captionsSettingsSpokenLanguageDropdownLabel?: string;
852852
chatButtonLabel: string;
853853
close: string;
854+
closeButtonLabel?: string;
854855
complianceBannerNowOnlyRecording: string;
855856
complianceBannerNowOnlyTranscription: string;
856857
complianceBannerRecordingAndTranscriptionSaved: string;

packages/communication-react/review/stable/communication-react.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ export interface CallCompositeStrings {
699699
captionsSettingsSpokenLanguageDropdownLabel?: string;
700700
chatButtonLabel: string;
701701
close: string;
702+
closeButtonLabel?: string;
702703
complianceBannerNowOnlyRecording: string;
703704
complianceBannerNowOnlyTranscription: string;
704705
complianceBannerRecordingAndTranscriptionSaved: string;

packages/react-composites/src/composites/CallComposite/Strings.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,10 @@ export interface CallCompositeStrings {
912912
* Label for mute all cancel button
913913
*/
914914
muteAllCancelButtonLabel: string;
915+
/**
916+
* Aria label for close button in modal dialogs
917+
*/
918+
closeButtonLabel?: string;
915919
/**
916920
* Label for join breakout room button
917921
*/

packages/react-composites/src/composites/CallComposite/components/Prompt.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,18 @@ export const Prompt = (props: PromptProps): JSX.Element => {
5555
<Text className={mergeStyles({ fontSize: '0.875rem' })}>{props.text}</Text>
5656
</Stack>
5757
<Stack horizontal horizontalAlign="end" tokens={{ childrenGap: '0.5rem' }}>
58-
<PrimaryButton styles={buttonTextStyles} text={props.confirmButtonLabel} onClick={props.onConfirm} />
59-
<DefaultButton styles={buttonTextStyles} text={props.cancelButtonLabel} onClick={props.onCancel} />
58+
<PrimaryButton
59+
styles={buttonTextStyles}
60+
text={props.confirmButtonLabel}
61+
ariaLabel={props.confirmButtonLabel}
62+
onClick={props.onConfirm}
63+
/>
64+
<DefaultButton
65+
styles={buttonTextStyles}
66+
text={props.cancelButtonLabel}
67+
ariaLabel={props.cancelButtonLabel}
68+
onClick={props.onCancel}
69+
/>
6070
</Stack>
6171
</Modal>
6272
);

packages/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@ export const usePeoplePane = (props: {
102102
confirmButtonLabel: localeStrings.muteAllConfirmButtonLabel,
103103
heading: localeStrings.muteAllDialogTitle,
104104
text: localeStrings.muteAllDialogContent,
105-
cancelButtonLabel: localeStrings.muteAllCancelButtonLabel
105+
cancelButtonLabel: localeStrings.muteAllCancelButtonLabel,
106+
closeButtonLabel: localeStrings.closeButtonLabel
106107
}),
107108
[
108109
localeStrings.muteAllConfirmButtonLabel,
109110
localeStrings.muteAllDialogTitle,
110111
localeStrings.muteAllDialogContent,
111-
localeStrings.muteAllCancelButtonLabel
112+
localeStrings.muteAllCancelButtonLabel,
113+
localeStrings.closeButtonLabel
112114
]
113115
);
114116

@@ -577,6 +579,7 @@ export const usePeoplePane = (props: {
577579
text={localeStrings.forbidOthersAudioDialogContent}
578580
confirmButtonLabel={localeStrings.forbidOthersAudioConfirmButtonLabel}
579581
cancelButtonLabel={localeStrings.forbidOthersAudioCancelButtonLabel}
582+
closeButtonLabel={localeStrings.closeButtonLabel}
580583
styles={{ main: { minWidth: '22.5rem', padding: '1.5rem' } }}
581584
onConfirm={() => onForbidAllAttendeesPromptConfirm()}
582585
isOpen={showForbidOthersAudioPrompt}
@@ -589,6 +592,7 @@ export const usePeoplePane = (props: {
589592
text={localeStrings.permitOthersAudioDialogContent}
590593
confirmButtonLabel={localeStrings.permitOthersAudioConfirmButtonLabel}
591594
cancelButtonLabel={localeStrings.permitOthersAudioCancelButtonLabel}
595+
closeButtonLabel={localeStrings.closeButtonLabel}
592596
styles={{ main: { minWidth: '22.5rem', padding: '1.5rem' } }}
593597
onConfirm={() => onPermitAllAttendeesPromptConfirm()}
594598
isOpen={showPermitOthersAudioPrompt}
@@ -601,6 +605,7 @@ export const usePeoplePane = (props: {
601605
text={localeStrings.forbidOthersVideoDialogContent}
602606
confirmButtonLabel={localeStrings.forbidOthersVideoConfirmButtonLabel}
603607
cancelButtonLabel={localeStrings.forbidOthersVideoCancelButtonLabel}
608+
closeButtonLabel={localeStrings.closeButtonLabel}
604609
styles={{ main: { minWidth: '22.5rem', padding: '1.5rem' } }}
605610
onConfirm={() => onForbidOthersVideoPromptConfirm()}
606611
isOpen={showForbidOthersVideoPrompt}
@@ -613,6 +618,7 @@ export const usePeoplePane = (props: {
613618
text={localeStrings.permitOthersVideoDialogContent}
614619
confirmButtonLabel={localeStrings.permitOthersVideoConfirmButtonLabel}
615620
cancelButtonLabel={localeStrings.permitOthersVideoCancelButtonLabel}
621+
closeButtonLabel={localeStrings.closeButtonLabel}
616622
styles={{ main: { minWidth: '22.5rem', padding: '1.5rem' } }}
617623
onConfirm={() => onPermitOthersVideoPromptConfirm()}
618624
isOpen={showPermitOthersVideoPrompt}

packages/react-composites/src/composites/localization/locales/en-US/strings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@
371371
"muteAllDialogContent": "This will mute everyone in the meeting but you.",
372372
"muteAllConfirmButtonLabel": "Mute all",
373373
"muteAllCancelButtonLabel": "Cancel",
374+
"closeButtonLabel": "Close",
374375
"joinBreakoutRoomButtonLabel": "Join breakout room",
375376
"returnFromBreakoutRoomButtonLabel": "Leave room",
376377
"leaveBreakoutRoomAndMeetingButtonLabel": "Leave meeting",

0 commit comments

Comments
 (0)