stream-chat-react-native-core 9.1.3-beta.2 → 9.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/a11y/a11yUtils.js +40 -0
- package/lib/commonjs/a11y/a11yUtils.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useA11yLabel.js +15 -0
- package/lib/commonjs/a11y/hooks/useA11yLabel.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useAnnounceOnStateChange.js +36 -0
- package/lib/commonjs/a11y/hooks/useAnnounceOnStateChange.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useReducedMotionPreference.js +34 -0
- package/lib/commonjs/a11y/hooks/useReducedMotionPreference.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useResolvedModalAccessibilityProps.js +20 -0
- package/lib/commonjs/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useScreenReaderEnabled.js +37 -0
- package/lib/commonjs/a11y/hooks/useScreenReaderEnabled.js.map +1 -0
- package/lib/commonjs/a11y/index.js +70 -0
- package/lib/commonjs/a11y/index.js.map +1 -0
- package/lib/commonjs/components/AITypingIndicatorView/AITypingIndicatorView.js +10 -0
- package/lib/commonjs/components/AITypingIndicatorView/AITypingIndicatorView.js.map +1 -1
- package/lib/commonjs/components/Accessibility/NotificationAnnouncer.js +37 -0
- package/lib/commonjs/components/Accessibility/NotificationAnnouncer.js.map +1 -0
- package/lib/commonjs/components/Accessibility/hooks/useIncomingMessageAnnouncements.js +109 -0
- package/lib/commonjs/components/Accessibility/hooks/useIncomingMessageAnnouncements.js.map +1 -0
- package/lib/commonjs/components/Accessibility/index.js +37 -0
- package/lib/commonjs/components/Accessibility/index.js.map +1 -0
- package/lib/commonjs/components/Accessibility/useAccessibilityAnnouncer.js +15 -0
- package/lib/commonjs/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -0
- package/lib/commonjs/components/Channel/Channel.js +2 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js +4 -0
- package/lib/commonjs/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingDots.js +2 -0
- package/lib/commonjs/components/Indicators/LoadingDots.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +3 -0
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +2 -0
- package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +13 -6
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +5 -0
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageActionList.js +4 -1
- package/lib/commonjs/components/MessageMenu/MessageActionList.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageActionListItem.js +1 -0
- package/lib/commonjs/components/MessageMenu/MessageActionListItem.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js +1 -0
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/ReactionButton.js +6 -1
- package/lib/commonjs/components/MessageMenu/ReactionButton.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollOption.js +15 -0
- package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
- package/lib/commonjs/components/ProgressControl/ProgressControl.js +10 -0
- package/lib/commonjs/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +2 -0
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js +6 -3
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/Avatar.js +14 -2
- package/lib/commonjs/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/ChannelAvatar.js +3 -1
- package/lib/commonjs/components/ui/Avatar/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/UserAvatar.js +1 -0
- package/lib/commonjs/components/ui/Avatar/UserAvatar.js.map +1 -1
- package/lib/commonjs/components/ui/Button/Button.js +49 -19
- package/lib/commonjs/components/ui/Button/Button.js.map +1 -1
- package/lib/commonjs/components/ui/Input/Input.js +63 -21
- package/lib/commonjs/components/ui/Input/Input.js.map +1 -1
- package/lib/commonjs/contexts/accessibilityContext/AccessibilityContext.js +114 -0
- package/lib/commonjs/contexts/accessibilityContext/AccessibilityContext.js.map +1 -0
- package/lib/commonjs/contexts/accessibilityContext/index.js +15 -0
- package/lib/commonjs/contexts/accessibilityContext/index.js.map +1 -0
- package/lib/commonjs/contexts/index.js +11 -0
- package/lib/commonjs/contexts/index.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +19 -14
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/hooks/index.js +11 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/i18n/en.json +23 -1
- package/lib/commonjs/i18n/es.json +23 -1
- package/lib/commonjs/i18n/fr.json +23 -1
- package/lib/commonjs/i18n/he.json +23 -1
- package/lib/commonjs/i18n/hi.json +23 -1
- package/lib/commonjs/i18n/it.json +23 -1
- package/lib/commonjs/i18n/ja.json +23 -1
- package/lib/commonjs/i18n/ko.json +23 -1
- package/lib/commonjs/i18n/nl.json +23 -1
- package/lib/commonjs/i18n/pt-br.json +23 -1
- package/lib/commonjs/i18n/ru.json +23 -1
- package/lib/commonjs/i18n/tr.json +23 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/a11y/a11yUtils.js +40 -0
- package/lib/module/a11y/a11yUtils.js.map +1 -0
- package/lib/module/a11y/hooks/useA11yLabel.js +15 -0
- package/lib/module/a11y/hooks/useA11yLabel.js.map +1 -0
- package/lib/module/a11y/hooks/useAnnounceOnStateChange.js +36 -0
- package/lib/module/a11y/hooks/useAnnounceOnStateChange.js.map +1 -0
- package/lib/module/a11y/hooks/useReducedMotionPreference.js +34 -0
- package/lib/module/a11y/hooks/useReducedMotionPreference.js.map +1 -0
- package/lib/module/a11y/hooks/useResolvedModalAccessibilityProps.js +20 -0
- package/lib/module/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -0
- package/lib/module/a11y/hooks/useScreenReaderEnabled.js +37 -0
- package/lib/module/a11y/hooks/useScreenReaderEnabled.js.map +1 -0
- package/lib/module/a11y/index.js +70 -0
- package/lib/module/a11y/index.js.map +1 -0
- package/lib/module/components/AITypingIndicatorView/AITypingIndicatorView.js +10 -0
- package/lib/module/components/AITypingIndicatorView/AITypingIndicatorView.js.map +1 -1
- package/lib/module/components/Accessibility/NotificationAnnouncer.js +37 -0
- package/lib/module/components/Accessibility/NotificationAnnouncer.js.map +1 -0
- package/lib/module/components/Accessibility/hooks/useIncomingMessageAnnouncements.js +109 -0
- package/lib/module/components/Accessibility/hooks/useIncomingMessageAnnouncements.js.map +1 -0
- package/lib/module/components/Accessibility/index.js +37 -0
- package/lib/module/components/Accessibility/index.js.map +1 -0
- package/lib/module/components/Accessibility/useAccessibilityAnnouncer.js +15 -0
- package/lib/module/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -0
- package/lib/module/components/Channel/Channel.js +2 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js +4 -0
- package/lib/module/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js.map +1 -1
- package/lib/module/components/Indicators/LoadingDots.js +2 -0
- package/lib/module/components/Indicators/LoadingDots.js.map +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +3 -0
- package/lib/module/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +2 -0
- package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +13 -6
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +5 -0
- package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageActionList.js +4 -1
- package/lib/module/components/MessageMenu/MessageActionList.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageActionListItem.js +1 -0
- package/lib/module/components/MessageMenu/MessageActionListItem.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageReactionPicker.js +1 -0
- package/lib/module/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/module/components/MessageMenu/ReactionButton.js +6 -1
- package/lib/module/components/MessageMenu/ReactionButton.js.map +1 -1
- package/lib/module/components/Poll/components/PollOption.js +15 -0
- package/lib/module/components/Poll/components/PollOption.js.map +1 -1
- package/lib/module/components/ProgressControl/ProgressControl.js +10 -0
- package/lib/module/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +2 -0
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/UIComponents/BottomSheetModal.js +6 -3
- package/lib/module/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/module/components/index.js +11 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/ui/Avatar/Avatar.js +14 -2
- package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/ui/Avatar/ChannelAvatar.js +3 -1
- package/lib/module/components/ui/Avatar/ChannelAvatar.js.map +1 -1
- package/lib/module/components/ui/Avatar/UserAvatar.js +1 -0
- package/lib/module/components/ui/Avatar/UserAvatar.js.map +1 -1
- package/lib/module/components/ui/Button/Button.js +49 -19
- package/lib/module/components/ui/Button/Button.js.map +1 -1
- package/lib/module/components/ui/Input/Input.js +63 -21
- package/lib/module/components/ui/Input/Input.js.map +1 -1
- package/lib/module/contexts/accessibilityContext/AccessibilityContext.js +114 -0
- package/lib/module/contexts/accessibilityContext/AccessibilityContext.js.map +1 -0
- package/lib/module/contexts/accessibilityContext/index.js +15 -0
- package/lib/module/contexts/accessibilityContext/index.js.map +1 -0
- package/lib/module/contexts/index.js +11 -0
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +19 -14
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/hooks/index.js +11 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/i18n/en.json +23 -1
- package/lib/module/i18n/es.json +23 -1
- package/lib/module/i18n/fr.json +23 -1
- package/lib/module/i18n/he.json +23 -1
- package/lib/module/i18n/hi.json +23 -1
- package/lib/module/i18n/it.json +23 -1
- package/lib/module/i18n/ja.json +23 -1
- package/lib/module/i18n/ko.json +23 -1
- package/lib/module/i18n/nl.json +23 -1
- package/lib/module/i18n/pt-br.json +23 -1
- package/lib/module/i18n/ru.json +23 -1
- package/lib/module/i18n/tr.json +23 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/a11y/a11yUtils.d.ts +31 -0
- package/lib/typescript/a11y/a11yUtils.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useA11yLabel.d.ts +12 -0
- package/lib/typescript/a11y/hooks/useA11yLabel.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useAnnounceOnStateChange.d.ts +14 -0
- package/lib/typescript/a11y/hooks/useAnnounceOnStateChange.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useReducedMotionPreference.d.ts +6 -0
- package/lib/typescript/a11y/hooks/useReducedMotionPreference.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts +18 -0
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useScreenReaderEnabled.d.ts +10 -0
- package/lib/typescript/a11y/hooks/useScreenReaderEnabled.d.ts.map +1 -0
- package/lib/typescript/a11y/index.d.ts +7 -0
- package/lib/typescript/a11y/index.d.ts.map +1 -0
- package/lib/typescript/components/AITypingIndicatorView/AITypingIndicatorView.d.ts.map +1 -1
- package/lib/typescript/components/Accessibility/NotificationAnnouncer.d.ts +12 -0
- package/lib/typescript/components/Accessibility/NotificationAnnouncer.d.ts.map +1 -0
- package/lib/typescript/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts +20 -0
- package/lib/typescript/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts.map +1 -0
- package/lib/typescript/components/Accessibility/index.d.ts +4 -0
- package/lib/typescript/components/Accessibility/index.d.ts.map +1 -0
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts +15 -0
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts.map +1 -0
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.d.ts.map +1 -1
- package/lib/typescript/components/Indicators/LoadingDots.d.ts.map +1 -1
- package/lib/typescript/components/Indicators/LoadingErrorIndicator.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/ScrollToBottomButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageActionList.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageActionListItem.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageReactionPicker.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/ReactionButton.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
- package/lib/typescript/components/ProgressControl/ProgressControl.d.ts.map +1 -1
- package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
- package/lib/typescript/components/UIComponents/BottomSheetModal.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/ui/Avatar/Avatar.d.ts +12 -1
- package/lib/typescript/components/ui/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/ui/Avatar/ChannelAvatar.d.ts.map +1 -1
- package/lib/typescript/components/ui/Avatar/UserAvatar.d.ts.map +1 -1
- package/lib/typescript/components/ui/Button/Button.d.ts.map +1 -1
- package/lib/typescript/components/ui/Input/Input.d.ts.map +1 -1
- package/lib/typescript/contexts/accessibilityContext/AccessibilityContext.d.ts +34 -0
- package/lib/typescript/contexts/accessibilityContext/AccessibilityContext.d.ts.map +1 -0
- package/lib/typescript/contexts/accessibilityContext/index.d.ts +2 -0
- package/lib/typescript/contexts/accessibilityContext/index.d.ts.map +1 -0
- package/lib/typescript/contexts/index.d.ts +1 -0
- package/lib/typescript/contexts/index.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +7 -0
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts.map +1 -1
- package/lib/typescript/hooks/index.d.ts +1 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -1
- package/lib/typescript/hooks/useTranslatedMessage.d.ts +2 -2
- package/lib/typescript/i18n/en.json +23 -1
- package/lib/typescript/i18n/es.json +23 -1
- package/lib/typescript/i18n/fr.json +23 -1
- package/lib/typescript/i18n/he.json +23 -1
- package/lib/typescript/i18n/hi.json +23 -1
- package/lib/typescript/i18n/it.json +23 -1
- package/lib/typescript/i18n/ja.json +23 -1
- package/lib/typescript/i18n/ko.json +23 -1
- package/lib/typescript/i18n/nl.json +23 -1
- package/lib/typescript/i18n/pt-br.json +23 -1
- package/lib/typescript/i18n/ru.json +23 -1
- package/lib/typescript/i18n/tr.json +23 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +22 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/a11y/__tests__/a11yUtils.test.ts +70 -0
- package/src/a11y/a11yUtils.ts +50 -0
- package/src/a11y/hooks/useA11yLabel.ts +19 -0
- package/src/a11y/hooks/useAnnounceOnStateChange.ts +47 -0
- package/src/a11y/hooks/useReducedMotionPreference.ts +38 -0
- package/src/a11y/hooks/useResolvedModalAccessibilityProps.ts +30 -0
- package/src/a11y/hooks/useScreenReaderEnabled.ts +44 -0
- package/src/a11y/index.ts +6 -0
- package/src/components/AITypingIndicatorView/AITypingIndicatorView.tsx +17 -2
- package/src/components/AITypingIndicatorView/__tests__/AITypingIndicatorView.test.tsx +73 -0
- package/src/components/Accessibility/NotificationAnnouncer.tsx +43 -0
- package/src/components/Accessibility/__tests__/AccessibilityAnnouncer.test.tsx +75 -0
- package/src/components/Accessibility/hooks/useIncomingMessageAnnouncements.ts +157 -0
- package/src/components/Accessibility/index.ts +3 -0
- package/src/components/Accessibility/useAccessibilityAnnouncer.ts +30 -0
- package/src/components/Channel/Channel.tsx +3 -0
- package/src/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.tsx +14 -1
- package/src/components/Indicators/LoadingDots.tsx +5 -1
- package/src/components/Indicators/LoadingErrorIndicator.tsx +7 -1
- package/src/components/Indicators/LoadingIndicator.tsx +1 -1
- package/src/components/Message/MessageItemView/__tests__/__snapshots__/MessageAuthor.test.tsx.snap +2 -0
- package/src/components/MessageInput/__tests__/__snapshots__/AttachButton.test.tsx.snap +30 -15
- package/src/components/MessageInput/__tests__/__snapshots__/SendButton.test.tsx.snap +20 -10
- package/src/components/MessageList/MessageList.tsx +9 -0
- package/src/components/MessageList/ScrollToBottomButton.tsx +6 -0
- package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.tsx.snap +2 -1
- package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.tsx.snap +6 -0
- package/src/components/MessageMenu/MessageActionList.tsx +4 -1
- package/src/components/MessageMenu/MessageActionListItem.tsx +1 -0
- package/src/components/MessageMenu/MessageReactionPicker.tsx +1 -0
- package/src/components/MessageMenu/ReactionButton.tsx +9 -1
- package/src/components/Poll/components/PollOption.tsx +11 -0
- package/src/components/ProgressControl/ProgressControl.tsx +8 -0
- package/src/components/Reply/Reply.tsx +5 -1
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.tsx.snap +20 -6
- package/src/components/UIComponents/BottomSheetModal.tsx +4 -0
- package/src/components/index.ts +2 -0
- package/src/components/ui/Avatar/Avatar.tsx +23 -2
- package/src/components/ui/Avatar/ChannelAvatar.tsx +3 -0
- package/src/components/ui/Avatar/UserAvatar.tsx +1 -0
- package/src/components/ui/Button/Button.tsx +24 -0
- package/src/components/ui/Input/Input.tsx +35 -0
- package/src/contexts/accessibilityContext/AccessibilityContext.tsx +165 -0
- package/src/contexts/accessibilityContext/__tests__/AccessibilityContext.test.tsx +65 -0
- package/src/contexts/accessibilityContext/index.ts +1 -0
- package/src/contexts/index.ts +1 -0
- package/src/contexts/overlayContext/OverlayContext.tsx +7 -0
- package/src/contexts/overlayContext/OverlayProvider.tsx +18 -14
- package/src/contexts/overlayContext/__tests__/OverlayProvider.test.tsx +51 -0
- package/src/hooks/index.ts +1 -0
- package/src/i18n/en.json +23 -1
- package/src/i18n/es.json +23 -1
- package/src/i18n/fr.json +23 -1
- package/src/i18n/he.json +23 -1
- package/src/i18n/hi.json +23 -1
- package/src/i18n/it.json +23 -1
- package/src/i18n/ja.json +23 -1
- package/src/i18n/ko.json +23 -1
- package/src/i18n/nl.json +23 -1
- package/src/i18n/pt-br.json +23 -1
- package/src/i18n/ru.json +23 -1
- package/src/i18n/tr.json +23 -1
- package/src/version.json +1 -1
|
@@ -36,13 +36,14 @@ exports[`SendButton should render a SendButton 1`] = `
|
|
|
36
36
|
}
|
|
37
37
|
>
|
|
38
38
|
<View
|
|
39
|
+
accessibilityRole="button"
|
|
39
40
|
accessibilityState={
|
|
40
41
|
{
|
|
41
42
|
"busy": undefined,
|
|
42
43
|
"checked": undefined,
|
|
43
44
|
"disabled": false,
|
|
44
45
|
"expanded": undefined,
|
|
45
|
-
"selected":
|
|
46
|
+
"selected": false,
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
accessibilityValue={
|
|
@@ -194,13 +195,14 @@ exports[`SendButton should render a SendButton 1`] = `
|
|
|
194
195
|
}
|
|
195
196
|
>
|
|
196
197
|
<View
|
|
198
|
+
accessibilityRole="button"
|
|
197
199
|
accessibilityState={
|
|
198
200
|
{
|
|
199
201
|
"busy": undefined,
|
|
200
202
|
"checked": undefined,
|
|
201
203
|
"disabled": false,
|
|
202
204
|
"expanded": undefined,
|
|
203
|
-
"selected":
|
|
205
|
+
"selected": false,
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
208
|
accessibilityValue={
|
|
@@ -333,13 +335,14 @@ exports[`SendButton should render a SendButton 1`] = `
|
|
|
333
335
|
}
|
|
334
336
|
>
|
|
335
337
|
<View
|
|
338
|
+
accessibilityRole="button"
|
|
336
339
|
accessibilityState={
|
|
337
340
|
{
|
|
338
341
|
"busy": undefined,
|
|
339
342
|
"checked": undefined,
|
|
340
343
|
"disabled": false,
|
|
341
344
|
"expanded": undefined,
|
|
342
|
-
"selected":
|
|
345
|
+
"selected": false,
|
|
343
346
|
}
|
|
344
347
|
}
|
|
345
348
|
accessibilityValue={
|
|
@@ -501,13 +504,14 @@ exports[`SendButton should render a SendButton 1`] = `
|
|
|
501
504
|
}
|
|
502
505
|
>
|
|
503
506
|
<View
|
|
507
|
+
accessibilityRole="button"
|
|
504
508
|
accessibilityState={
|
|
505
509
|
{
|
|
506
510
|
"busy": undefined,
|
|
507
511
|
"checked": undefined,
|
|
508
512
|
"disabled": false,
|
|
509
513
|
"expanded": undefined,
|
|
510
|
-
"selected":
|
|
514
|
+
"selected": false,
|
|
511
515
|
}
|
|
512
516
|
}
|
|
513
517
|
accessibilityValue={
|
|
@@ -636,13 +640,14 @@ exports[`SendButton should render a SendButton 1`] = `
|
|
|
636
640
|
}
|
|
637
641
|
>
|
|
638
642
|
<View
|
|
643
|
+
accessibilityRole="button"
|
|
639
644
|
accessibilityState={
|
|
640
645
|
{
|
|
641
646
|
"busy": undefined,
|
|
642
647
|
"checked": undefined,
|
|
643
648
|
"disabled": false,
|
|
644
649
|
"expanded": undefined,
|
|
645
|
-
"selected":
|
|
650
|
+
"selected": false,
|
|
646
651
|
}
|
|
647
652
|
}
|
|
648
653
|
accessibilityValue={
|
|
@@ -903,13 +908,14 @@ exports[`SendButton should render a disabled SendButton 1`] = `
|
|
|
903
908
|
}
|
|
904
909
|
>
|
|
905
910
|
<View
|
|
911
|
+
accessibilityRole="button"
|
|
906
912
|
accessibilityState={
|
|
907
913
|
{
|
|
908
914
|
"busy": undefined,
|
|
909
915
|
"checked": undefined,
|
|
910
916
|
"disabled": true,
|
|
911
917
|
"expanded": undefined,
|
|
912
|
-
"selected":
|
|
918
|
+
"selected": false,
|
|
913
919
|
}
|
|
914
920
|
}
|
|
915
921
|
accessibilityValue={
|
|
@@ -1061,13 +1067,14 @@ exports[`SendButton should render a disabled SendButton 1`] = `
|
|
|
1061
1067
|
}
|
|
1062
1068
|
>
|
|
1063
1069
|
<View
|
|
1070
|
+
accessibilityRole="button"
|
|
1064
1071
|
accessibilityState={
|
|
1065
1072
|
{
|
|
1066
1073
|
"busy": undefined,
|
|
1067
1074
|
"checked": undefined,
|
|
1068
1075
|
"disabled": false,
|
|
1069
1076
|
"expanded": undefined,
|
|
1070
|
-
"selected":
|
|
1077
|
+
"selected": false,
|
|
1071
1078
|
}
|
|
1072
1079
|
}
|
|
1073
1080
|
accessibilityValue={
|
|
@@ -1200,13 +1207,14 @@ exports[`SendButton should render a disabled SendButton 1`] = `
|
|
|
1200
1207
|
}
|
|
1201
1208
|
>
|
|
1202
1209
|
<View
|
|
1210
|
+
accessibilityRole="button"
|
|
1203
1211
|
accessibilityState={
|
|
1204
1212
|
{
|
|
1205
1213
|
"busy": undefined,
|
|
1206
1214
|
"checked": undefined,
|
|
1207
1215
|
"disabled": false,
|
|
1208
1216
|
"expanded": undefined,
|
|
1209
|
-
"selected":
|
|
1217
|
+
"selected": false,
|
|
1210
1218
|
}
|
|
1211
1219
|
}
|
|
1212
1220
|
accessibilityValue={
|
|
@@ -1368,13 +1376,14 @@ exports[`SendButton should render a disabled SendButton 1`] = `
|
|
|
1368
1376
|
}
|
|
1369
1377
|
>
|
|
1370
1378
|
<View
|
|
1379
|
+
accessibilityRole="button"
|
|
1371
1380
|
accessibilityState={
|
|
1372
1381
|
{
|
|
1373
1382
|
"busy": undefined,
|
|
1374
1383
|
"checked": undefined,
|
|
1375
1384
|
"disabled": false,
|
|
1376
1385
|
"expanded": undefined,
|
|
1377
|
-
"selected":
|
|
1386
|
+
"selected": false,
|
|
1378
1387
|
}
|
|
1379
1388
|
}
|
|
1380
1389
|
accessibilityValue={
|
|
@@ -1503,13 +1512,14 @@ exports[`SendButton should render a disabled SendButton 1`] = `
|
|
|
1503
1512
|
}
|
|
1504
1513
|
>
|
|
1505
1514
|
<View
|
|
1515
|
+
accessibilityRole="button"
|
|
1506
1516
|
accessibilityState={
|
|
1507
1517
|
{
|
|
1508
1518
|
"busy": undefined,
|
|
1509
1519
|
"checked": undefined,
|
|
1510
1520
|
"disabled": false,
|
|
1511
1521
|
"expanded": undefined,
|
|
1512
|
-
"selected":
|
|
1522
|
+
"selected": false,
|
|
1513
1523
|
}
|
|
1514
1524
|
}
|
|
1515
1525
|
accessibilityValue={
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
ChannelContextValue,
|
|
38
38
|
useChannelContext,
|
|
39
39
|
} from '../../contexts/channelContext/ChannelContext';
|
|
40
|
+
|
|
40
41
|
import { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';
|
|
41
42
|
import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
|
|
42
43
|
import { useDebugContext } from '../../contexts/debugContext/DebugContext';
|
|
@@ -70,6 +71,7 @@ import { bumpOverlayLayoutRevision } from '../../state-store';
|
|
|
70
71
|
import { MessageInputHeightState } from '../../state-store/message-input-height-store';
|
|
71
72
|
import { primitives } from '../../theme';
|
|
72
73
|
import { transitions } from '../../utils/transitions';
|
|
74
|
+
import { useIncomingMessageAnnouncements } from '../Accessibility/hooks/useIncomingMessageAnnouncements';
|
|
73
75
|
import { MessageWrapper } from '../Message/MessageItemView/MessageWrapper';
|
|
74
76
|
|
|
75
77
|
// This is just to make sure that the scrolling happens in a different task queue.
|
|
@@ -365,6 +367,13 @@ const MessageListWithContext = (props: MessageListPropsWithContext) => {
|
|
|
365
367
|
messageInputHeightStoreSelector,
|
|
366
368
|
);
|
|
367
369
|
|
|
370
|
+
useIncomingMessageAnnouncements({
|
|
371
|
+
activeThreadId: thread?.id,
|
|
372
|
+
channel,
|
|
373
|
+
ownUserId: client.user?.id,
|
|
374
|
+
threadList,
|
|
375
|
+
});
|
|
376
|
+
|
|
368
377
|
const myMessageThemeString = useMemo(() => JSON.stringify(myMessageTheme), [myMessageTheme]);
|
|
369
378
|
|
|
370
379
|
const modifiedTheme = useMemo(
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
import Animated, { ZoomIn, ZoomOut } from 'react-native-reanimated';
|
|
5
5
|
|
|
6
|
+
import { useA11yLabel } from '../../a11y/hooks/useA11yLabel';
|
|
6
7
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
7
8
|
import { Down } from '../../icons/arrow-up';
|
|
8
9
|
import { primitives } from '../../theme';
|
|
@@ -22,6 +23,10 @@ export const ScrollToBottomButton = (props: ScrollToBottomButtonProps) => {
|
|
|
22
23
|
const {
|
|
23
24
|
theme: { semantics },
|
|
24
25
|
} = useTheme();
|
|
26
|
+
const a11yLabel = useA11yLabel(
|
|
27
|
+
unreadCount ? 'a11y/Scroll to latest, {{count}} unread' : 'a11y/Scroll to latest',
|
|
28
|
+
{ count: unreadCount ?? 0 },
|
|
29
|
+
);
|
|
25
30
|
|
|
26
31
|
if (!showNotification) {
|
|
27
32
|
return null;
|
|
@@ -42,6 +47,7 @@ export const ScrollToBottomButton = (props: ScrollToBottomButtonProps) => {
|
|
|
42
47
|
]}
|
|
43
48
|
>
|
|
44
49
|
<Button
|
|
50
|
+
accessibilityLabel={a11yLabel}
|
|
45
51
|
variant='secondary'
|
|
46
52
|
type='outline'
|
|
47
53
|
LeadingIcon={Down}
|
package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.tsx.snap
CHANGED
|
@@ -50,13 +50,14 @@ exports[`ScrollToBottomButton should render the message notification and match s
|
|
|
50
50
|
}
|
|
51
51
|
>
|
|
52
52
|
<View
|
|
53
|
+
accessibilityRole="button"
|
|
53
54
|
accessibilityState={
|
|
54
55
|
{
|
|
55
56
|
"busy": undefined,
|
|
56
57
|
"checked": undefined,
|
|
57
58
|
"disabled": false,
|
|
58
59
|
"expanded": undefined,
|
|
59
|
-
"selected":
|
|
60
|
+
"selected": false,
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
accessibilityValue={
|
|
@@ -87,6 +87,8 @@ exports[`TypingIndicator should match typing indicator snapshot 1`] = `
|
|
|
87
87
|
testID="avatar-image"
|
|
88
88
|
>
|
|
89
89
|
<Image
|
|
90
|
+
accessibilityElementsHidden={true}
|
|
91
|
+
importantForAccessibility="no"
|
|
90
92
|
onError={[Function]}
|
|
91
93
|
source={
|
|
92
94
|
{
|
|
@@ -147,6 +149,8 @@ exports[`TypingIndicator should match typing indicator snapshot 1`] = `
|
|
|
147
149
|
testID="avatar-image"
|
|
148
150
|
>
|
|
149
151
|
<Image
|
|
152
|
+
accessibilityElementsHidden={true}
|
|
153
|
+
importantForAccessibility="no"
|
|
150
154
|
onError={[Function]}
|
|
151
155
|
source={
|
|
152
156
|
{
|
|
@@ -186,6 +190,8 @@ exports[`TypingIndicator should match typing indicator snapshot 1`] = `
|
|
|
186
190
|
}
|
|
187
191
|
>
|
|
188
192
|
<View
|
|
193
|
+
accessibilityElementsHidden={true}
|
|
194
|
+
importantForAccessibility="no-hide-descendants"
|
|
189
195
|
style={
|
|
190
196
|
[
|
|
191
197
|
{
|
|
@@ -5,6 +5,7 @@ import { ScrollView } from 'react-native-gesture-handler';
|
|
|
5
5
|
|
|
6
6
|
import { MessageActionType } from './MessageActionListItem';
|
|
7
7
|
|
|
8
|
+
import { useA11yLabel } from '../../a11y/hooks/useA11yLabel';
|
|
8
9
|
import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
|
|
9
10
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
10
11
|
import { primitives } from '../../theme';
|
|
@@ -24,6 +25,7 @@ export type MessageActionListProps = {
|
|
|
24
25
|
export const MessageActionList = (props: MessageActionListProps) => {
|
|
25
26
|
const { messageActions } = props;
|
|
26
27
|
const { MessageActionListItem } = useComponentsContext();
|
|
28
|
+
const a11yLabel = useA11yLabel('a11y/Message actions');
|
|
27
29
|
const {
|
|
28
30
|
theme: {
|
|
29
31
|
messageMenu: {
|
|
@@ -43,7 +45,8 @@ export const MessageActionList = (props: MessageActionListProps) => {
|
|
|
43
45
|
|
|
44
46
|
return (
|
|
45
47
|
<ScrollView
|
|
46
|
-
accessibilityLabel='Message action list'
|
|
48
|
+
accessibilityLabel={a11yLabel ?? 'Message action list'}
|
|
49
|
+
accessibilityRole='menu'
|
|
47
50
|
contentContainerStyle={[styles.contentContainer, contentContainer]}
|
|
48
51
|
style={[styles.container, container]}
|
|
49
52
|
>
|
|
@@ -163,6 +163,7 @@ export const MessageReactionPicker = (props: MessageReactionPickerProps) => {
|
|
|
163
163
|
return (
|
|
164
164
|
<View
|
|
165
165
|
accessibilityLabel='Reaction Selector on long pressing message'
|
|
166
|
+
accessibilityRole='menu'
|
|
166
167
|
style={[styles.container, container]}
|
|
167
168
|
>
|
|
168
169
|
<MessageReactionPickerList onSelectReaction={onSelectReaction} />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { useA11yLabel } from '../../a11y/hooks/useA11yLabel';
|
|
4
5
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
5
6
|
import { IconProps } from '../../icons';
|
|
6
7
|
import { Button, ButtonProps } from '../ui';
|
|
@@ -50,10 +51,17 @@ export const ReactionButton = (props: ReactionButtonProps) => {
|
|
|
50
51
|
[Icon, reactionIconSize],
|
|
51
52
|
);
|
|
52
53
|
|
|
54
|
+
const a11yLabel = useA11yLabel('a11y/Reaction {{emoji}} by {{count}} users', {
|
|
55
|
+
count: count ?? '0',
|
|
56
|
+
emoji: type,
|
|
57
|
+
});
|
|
58
|
+
|
|
53
59
|
return (
|
|
54
60
|
<View style={styles.reactionButton}>
|
|
55
61
|
<Button
|
|
56
|
-
accessibilityLabel={
|
|
62
|
+
accessibilityLabel={
|
|
63
|
+
a11yLabel ?? `reaction-button-${type}-${selected ? 'selected' : 'unselected'}`
|
|
64
|
+
}
|
|
57
65
|
variant={'secondary'}
|
|
58
66
|
type={'outline'}
|
|
59
67
|
iconOnly={!count}
|
|
@@ -25,6 +25,11 @@ import { UserAvatarStack } from '../../ui/Avatar/AvatarStack';
|
|
|
25
25
|
import { useIsPollCreatedByCurrentUser } from '../hook/useIsPollCreatedByCurrentUser';
|
|
26
26
|
import { usePollState } from '../hooks/usePollState';
|
|
27
27
|
|
|
28
|
+
const pollVoteAccessibilityStates = {
|
|
29
|
+
checked: { checked: true, selected: true },
|
|
30
|
+
unchecked: { checked: false, selected: false },
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
28
33
|
export type PollOptionProps = {
|
|
29
34
|
option: PollOptionClass;
|
|
30
35
|
showProgressBar?: boolean;
|
|
@@ -190,9 +195,15 @@ export const VoteButton = ({ onPress, option }: PollVoteButtonProps) => {
|
|
|
190
195
|
}, [message, onPress, poll, toggleVote]);
|
|
191
196
|
|
|
192
197
|
const hasVote = !!ownVotesByOptionId[option.id];
|
|
198
|
+
const accessibilityState = hasVote
|
|
199
|
+
? pollVoteAccessibilityStates.checked
|
|
200
|
+
: pollVoteAccessibilityStates.unchecked;
|
|
193
201
|
|
|
194
202
|
return ownCapabilities.castPollVote && !isClosed ? (
|
|
195
203
|
<Pressable
|
|
204
|
+
accessibilityLabel={option.text}
|
|
205
|
+
accessibilityRole={poll.data?.enforce_unique_vote ? 'radio' : 'checkbox'}
|
|
206
|
+
accessibilityState={accessibilityState}
|
|
196
207
|
onPress={onPressHandler}
|
|
197
208
|
style={({ pressed }) => [
|
|
198
209
|
{ opacity: pressed ? 0.5 : 1 },
|
|
@@ -110,9 +110,17 @@ export const ProgressControl = (props: ProgressControlProps) => {
|
|
|
110
110
|
[widthInNumbers],
|
|
111
111
|
);
|
|
112
112
|
|
|
113
|
+
const progressPercent = Math.round(progress * 100);
|
|
114
|
+
const accessibilityValue = useMemo(
|
|
115
|
+
() => ({ max: 100, min: 0, now: progressPercent }),
|
|
116
|
+
[progressPercent],
|
|
117
|
+
);
|
|
118
|
+
|
|
113
119
|
return (
|
|
114
120
|
<GestureDetector gesture={pan}>
|
|
115
121
|
<View
|
|
122
|
+
accessibilityRole={onEndDrag ? 'adjustable' : 'progressbar'}
|
|
123
|
+
accessibilityValue={accessibilityValue}
|
|
116
124
|
onLayout={({ nativeEvent }) => {
|
|
117
125
|
setWidthInNumbers(nativeEvent.layout.width);
|
|
118
126
|
}}
|
|
@@ -151,7 +151,11 @@ export const ReplyWithContext = (props: ReplyPropsWithContext) => {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
return (
|
|
154
|
-
<View
|
|
154
|
+
<View
|
|
155
|
+
accessibilityLabel={title}
|
|
156
|
+
accessibilityRole='text'
|
|
157
|
+
style={[!messageFromContext?.quoted_message ? styles.wrapper : null, wrapper]}
|
|
158
|
+
>
|
|
155
159
|
<View style={[styles.container, container, stylesProp?.container]}>
|
|
156
160
|
<View style={[styles.leftContainer, leftContainer, stylesProp?.leftContainer]}>
|
|
157
161
|
<Text numberOfLines={1} style={[styles.title, titleStyle, stylesProp?.title]}>
|
|
@@ -412,6 +412,8 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
412
412
|
testID="avatar-image"
|
|
413
413
|
>
|
|
414
414
|
<Image
|
|
415
|
+
accessibilityElementsHidden={true}
|
|
416
|
+
importantForAccessibility="no"
|
|
415
417
|
onError={[Function]}
|
|
416
418
|
source={
|
|
417
419
|
{
|
|
@@ -753,6 +755,8 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
753
755
|
testID="avatar-image"
|
|
754
756
|
>
|
|
755
757
|
<Image
|
|
758
|
+
accessibilityElementsHidden={true}
|
|
759
|
+
importantForAccessibility="no"
|
|
756
760
|
onError={[Function]}
|
|
757
761
|
source={
|
|
758
762
|
{
|
|
@@ -1127,6 +1131,8 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1127
1131
|
testID="avatar-image"
|
|
1128
1132
|
>
|
|
1129
1133
|
<Image
|
|
1134
|
+
accessibilityElementsHidden={true}
|
|
1135
|
+
importantForAccessibility="no"
|
|
1130
1136
|
onError={[Function]}
|
|
1131
1137
|
source={
|
|
1132
1138
|
{
|
|
@@ -1459,6 +1465,8 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1459
1465
|
testID="avatar-image"
|
|
1460
1466
|
>
|
|
1461
1467
|
<Image
|
|
1468
|
+
accessibilityElementsHidden={true}
|
|
1469
|
+
importantForAccessibility="no"
|
|
1462
1470
|
onError={[Function]}
|
|
1463
1471
|
source={
|
|
1464
1472
|
{
|
|
@@ -1827,13 +1835,14 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1827
1835
|
}
|
|
1828
1836
|
>
|
|
1829
1837
|
<View
|
|
1838
|
+
accessibilityRole="button"
|
|
1830
1839
|
accessibilityState={
|
|
1831
1840
|
{
|
|
1832
1841
|
"busy": undefined,
|
|
1833
1842
|
"checked": undefined,
|
|
1834
1843
|
"disabled": false,
|
|
1835
1844
|
"expanded": undefined,
|
|
1836
|
-
"selected":
|
|
1845
|
+
"selected": false,
|
|
1837
1846
|
}
|
|
1838
1847
|
}
|
|
1839
1848
|
accessibilityValue={
|
|
@@ -2191,13 +2200,14 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
2191
2200
|
}
|
|
2192
2201
|
>
|
|
2193
2202
|
<View
|
|
2203
|
+
accessibilityRole="button"
|
|
2194
2204
|
accessibilityState={
|
|
2195
2205
|
{
|
|
2196
2206
|
"busy": undefined,
|
|
2197
2207
|
"checked": undefined,
|
|
2198
2208
|
"disabled": true,
|
|
2199
2209
|
"expanded": undefined,
|
|
2200
|
-
"selected":
|
|
2210
|
+
"selected": false,
|
|
2201
2211
|
}
|
|
2202
2212
|
}
|
|
2203
2213
|
accessibilityValue={
|
|
@@ -2374,13 +2384,14 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
2374
2384
|
}
|
|
2375
2385
|
>
|
|
2376
2386
|
<View
|
|
2387
|
+
accessibilityRole="button"
|
|
2377
2388
|
accessibilityState={
|
|
2378
2389
|
{
|
|
2379
2390
|
"busy": undefined,
|
|
2380
2391
|
"checked": undefined,
|
|
2381
2392
|
"disabled": false,
|
|
2382
2393
|
"expanded": undefined,
|
|
2383
|
-
"selected":
|
|
2394
|
+
"selected": false,
|
|
2384
2395
|
}
|
|
2385
2396
|
}
|
|
2386
2397
|
accessibilityValue={
|
|
@@ -2513,13 +2524,14 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
2513
2524
|
}
|
|
2514
2525
|
>
|
|
2515
2526
|
<View
|
|
2527
|
+
accessibilityRole="button"
|
|
2516
2528
|
accessibilityState={
|
|
2517
2529
|
{
|
|
2518
2530
|
"busy": undefined,
|
|
2519
2531
|
"checked": undefined,
|
|
2520
2532
|
"disabled": false,
|
|
2521
2533
|
"expanded": undefined,
|
|
2522
|
-
"selected":
|
|
2534
|
+
"selected": false,
|
|
2523
2535
|
}
|
|
2524
2536
|
}
|
|
2525
2537
|
accessibilityValue={
|
|
@@ -2681,13 +2693,14 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
2681
2693
|
}
|
|
2682
2694
|
>
|
|
2683
2695
|
<View
|
|
2696
|
+
accessibilityRole="button"
|
|
2684
2697
|
accessibilityState={
|
|
2685
2698
|
{
|
|
2686
2699
|
"busy": undefined,
|
|
2687
2700
|
"checked": undefined,
|
|
2688
2701
|
"disabled": false,
|
|
2689
2702
|
"expanded": undefined,
|
|
2690
|
-
"selected":
|
|
2703
|
+
"selected": false,
|
|
2691
2704
|
}
|
|
2692
2705
|
}
|
|
2693
2706
|
accessibilityValue={
|
|
@@ -2816,13 +2829,14 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
2816
2829
|
}
|
|
2817
2830
|
>
|
|
2818
2831
|
<View
|
|
2832
|
+
accessibilityRole="button"
|
|
2819
2833
|
accessibilityState={
|
|
2820
2834
|
{
|
|
2821
2835
|
"busy": undefined,
|
|
2822
2836
|
"checked": undefined,
|
|
2823
2837
|
"disabled": false,
|
|
2824
2838
|
"expanded": undefined,
|
|
2825
|
-
"selected":
|
|
2839
|
+
"selected": false,
|
|
2826
2840
|
}
|
|
2827
2841
|
}
|
|
2828
2842
|
accessibilityValue={
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
getBottomSheetTopSnapIndex,
|
|
39
39
|
} from './BottomSheetModal.utils';
|
|
40
40
|
|
|
41
|
+
import { useResolvedModalAccessibilityProps } from '../../a11y/hooks/useResolvedModalAccessibilityProps';
|
|
41
42
|
import { BottomSheetProvider } from '../../contexts/bottomSheetContext/BottomSheetContext';
|
|
42
43
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
43
44
|
import { useStableCallback } from '../../hooks';
|
|
@@ -501,6 +502,8 @@ const BottomSheetModalInner = (props: PropsWithChildren<BottomSheetModalProps>)
|
|
|
501
502
|
|
|
502
503
|
const onBackdropPress = useStableCallback(() => close());
|
|
503
504
|
|
|
505
|
+
const modalA11yProps = useResolvedModalAccessibilityProps();
|
|
506
|
+
|
|
504
507
|
const bottomSheetModalContextValue = useMemo(
|
|
505
508
|
() => ({
|
|
506
509
|
close,
|
|
@@ -523,6 +526,7 @@ const BottomSheetModalInner = (props: PropsWithChildren<BottomSheetModalProps>)
|
|
|
523
526
|
<Animated.View
|
|
524
527
|
pointerEvents='box-none'
|
|
525
528
|
style={[{ height: maxHeight }, sheetViewportAnimatedStyle]}
|
|
529
|
+
{...modalA11yProps}
|
|
526
530
|
>
|
|
527
531
|
<GestureDetector gesture={panGesture}>
|
|
528
532
|
<Animated.View style={[styles.container, { height: maxHeight }, container]}>
|
package/src/components/index.ts
CHANGED
|
@@ -3,16 +3,28 @@ import { ColorValue, StyleProp, StyleSheet, View, ViewStyle } from 'react-native
|
|
|
3
3
|
|
|
4
4
|
import { avatarSizes } from './constants';
|
|
5
5
|
|
|
6
|
+
import { useA11yLabel } from '../../../a11y/hooks/useA11yLabel';
|
|
6
7
|
import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext';
|
|
7
8
|
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
8
9
|
import { primitives } from '../../../theme';
|
|
9
10
|
|
|
10
11
|
export type AvatarProps = {
|
|
11
12
|
size: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
13
|
+
/**
|
|
14
|
+
* Override for the auto-generated accessibility label. When omitted and a
|
|
15
|
+
* `name` is provided, the SDK uses `a11y/Avatar of {{name}}`.
|
|
16
|
+
*/
|
|
17
|
+
accessibilityLabel?: string;
|
|
18
|
+
backgroundColor?: ColorValue;
|
|
12
19
|
imageUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Display name of the entity this avatar represents (user, channel). Used to
|
|
22
|
+
* compose the default `accessibilityLabel`. Optional — when neither this nor
|
|
23
|
+
* `accessibilityLabel` is provided, the avatar is left unlabeled.
|
|
24
|
+
*/
|
|
25
|
+
name?: string;
|
|
13
26
|
placeholder?: React.ReactNode;
|
|
14
27
|
showBorder?: boolean;
|
|
15
|
-
backgroundColor?: ColorValue;
|
|
16
28
|
style?: StyleProp<ViewStyle>;
|
|
17
29
|
};
|
|
18
30
|
|
|
@@ -24,14 +36,18 @@ export const Avatar = (props: AvatarProps) => {
|
|
|
24
36
|
const { ImageComponent } = useComponentsContext();
|
|
25
37
|
const defaultAvatarBg = semantics.avatarPaletteBg1;
|
|
26
38
|
const {
|
|
39
|
+
accessibilityLabel: accessibilityLabelOverride,
|
|
27
40
|
backgroundColor = defaultAvatarBg,
|
|
28
|
-
size,
|
|
29
41
|
imageUrl,
|
|
42
|
+
name,
|
|
30
43
|
placeholder,
|
|
31
44
|
showBorder,
|
|
45
|
+
size,
|
|
32
46
|
style,
|
|
33
47
|
} = props;
|
|
34
48
|
const styles = useStyles();
|
|
49
|
+
const composedLabel = useA11yLabel('a11y/Avatar of {{name}}', { name: name ?? '' });
|
|
50
|
+
const accessibilityLabel = accessibilityLabelOverride ?? (name ? composedLabel : undefined);
|
|
35
51
|
|
|
36
52
|
const onHandleError = useCallback(() => {
|
|
37
53
|
setError(true);
|
|
@@ -39,6 +55,9 @@ export const Avatar = (props: AvatarProps) => {
|
|
|
39
55
|
|
|
40
56
|
return (
|
|
41
57
|
<View
|
|
58
|
+
accessibilityLabel={accessibilityLabel}
|
|
59
|
+
accessibilityRole={accessibilityLabel ? 'image' : undefined}
|
|
60
|
+
accessible={accessibilityLabel ? true : undefined}
|
|
42
61
|
style={[
|
|
43
62
|
styles.container,
|
|
44
63
|
avatarSizes[size],
|
|
@@ -50,6 +69,8 @@ export const Avatar = (props: AvatarProps) => {
|
|
|
50
69
|
>
|
|
51
70
|
{imageUrl && !error ? (
|
|
52
71
|
<ImageComponent
|
|
72
|
+
accessibilityElementsHidden
|
|
73
|
+
importantForAccessibility='no'
|
|
53
74
|
onError={onHandleError}
|
|
54
75
|
source={{ uri: imageUrl }}
|
|
55
76
|
style={[styles.image, avatarSizes[size]]}
|
|
@@ -45,11 +45,14 @@ export const ChannelAvatar = (props: ChannelAvatarProps) => {
|
|
|
45
45
|
[usersForGroup, client.user?.id],
|
|
46
46
|
);
|
|
47
47
|
|
|
48
|
+
const channelName = (channel.data?.name as string | undefined) ?? channel.cid;
|
|
49
|
+
|
|
48
50
|
if (channelImage) {
|
|
49
51
|
return (
|
|
50
52
|
<Avatar
|
|
51
53
|
backgroundColor={avatarBackgroundColor}
|
|
52
54
|
imageUrl={channelImage}
|
|
55
|
+
name={channelName}
|
|
53
56
|
showBorder={showBorder}
|
|
54
57
|
size={size}
|
|
55
58
|
/>
|