@planningcenter/chat-react-native 3.14.0-rc.4 → 3.14.0

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.
Files changed (105) hide show
  1. package/build/components/conversation/empty_conversation_blank_state.d.ts.map +1 -1
  2. package/build/components/conversation/empty_conversation_blank_state.js +10 -2
  3. package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
  4. package/build/components/conversations/conversations.d.ts.map +1 -1
  5. package/build/components/conversations/conversations.js +7 -2
  6. package/build/components/conversations/conversations.js.map +1 -1
  7. package/build/components/display/action_button.d.ts.map +1 -1
  8. package/build/components/display/action_button.js +2 -1
  9. package/build/components/display/action_button.js.map +1 -1
  10. package/build/components/display/badge.js +5 -5
  11. package/build/components/display/badge.js.map +1 -1
  12. package/build/components/display/index.d.ts +0 -1
  13. package/build/components/display/index.d.ts.map +1 -1
  14. package/build/components/display/index.js +0 -1
  15. package/build/components/display/index.js.map +1 -1
  16. package/build/components/display/platform_modal_header_buttons.d.ts +4 -4
  17. package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
  18. package/build/components/display/platform_modal_header_buttons.js +2 -2
  19. package/build/components/display/platform_modal_header_buttons.js.map +1 -1
  20. package/build/components/display/text.d.ts +10 -2
  21. package/build/components/display/text.d.ts.map +1 -1
  22. package/build/components/display/text.js +0 -3
  23. package/build/components/display/text.js.map +1 -1
  24. package/build/components/display/toggle_button.d.ts.map +1 -1
  25. package/build/components/display/toggle_button.js +2 -2
  26. package/build/components/display/toggle_button.js.map +1 -1
  27. package/build/components/page/error_boundary.d.ts.map +1 -1
  28. package/build/components/page/error_boundary.js +11 -46
  29. package/build/components/page/error_boundary.js.map +1 -1
  30. package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
  31. package/build/components/primitive/avatar_primitive.js +14 -6
  32. package/build/components/primitive/avatar_primitive.js.map +1 -1
  33. package/build/components/primitive/blank_state_primitive.d.ts +41 -0
  34. package/build/components/primitive/blank_state_primitive.d.ts.map +1 -0
  35. package/build/components/primitive/blank_state_primitive.js +93 -0
  36. package/build/components/primitive/blank_state_primitive.js.map +1 -0
  37. package/build/navigation/index.d.ts.map +1 -1
  38. package/build/navigation/index.js +6 -6
  39. package/build/navigation/index.js.map +1 -1
  40. package/build/screens/bug_report_screen.d.ts.map +1 -1
  41. package/build/screens/bug_report_screen.js +17 -11
  42. package/build/screens/bug_report_screen.js.map +1 -1
  43. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  44. package/build/screens/conversation_details_screen.js +3 -3
  45. package/build/screens/conversation_details_screen.js.map +1 -1
  46. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
  47. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +8 -2
  48. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
  49. package/build/screens/conversation_new/components/filter_by_plan.js +2 -2
  50. package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
  51. package/build/screens/conversation_screen.d.ts.map +1 -1
  52. package/build/screens/conversation_screen.js +8 -7
  53. package/build/screens/conversation_screen.js.map +1 -1
  54. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
  55. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +13 -3
  56. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
  57. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  58. package/build/screens/conversations/components/list_header_component.js +2 -1
  59. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  60. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  61. package/build/screens/conversations/conversations_screen.js +2 -2
  62. package/build/screens/conversations/conversations_screen.js.map +1 -1
  63. package/build/screens/design_system_screen.js +13 -8
  64. package/build/screens/design_system_screen.js.map +1 -1
  65. package/build/screens/send_giphy_screen.d.ts.map +1 -1
  66. package/build/screens/send_giphy_screen.js +10 -5
  67. package/build/screens/send_giphy_screen.js.map +1 -1
  68. package/build/utils/styles.d.ts +1 -0
  69. package/build/utils/styles.d.ts.map +1 -1
  70. package/build/utils/styles.js +1 -0
  71. package/build/utils/styles.js.map +1 -1
  72. package/package.json +2 -2
  73. package/src/components/conversation/empty_conversation_blank_state.tsx +10 -6
  74. package/src/components/conversations/conversations.tsx +7 -2
  75. package/src/components/display/action_button.tsx +2 -0
  76. package/src/components/display/badge.tsx +5 -5
  77. package/src/components/display/index.ts +0 -1
  78. package/src/components/display/platform_modal_header_buttons.tsx +6 -6
  79. package/src/components/display/text.tsx +30 -2
  80. package/src/components/display/toggle_button.tsx +6 -2
  81. package/src/components/page/error_boundary.tsx +16 -47
  82. package/src/components/primitive/avatar_primitive.tsx +14 -6
  83. package/src/components/primitive/blank_state_primitive.tsx +211 -0
  84. package/src/navigation/index.tsx +6 -6
  85. package/src/screens/bug_report_screen.tsx +22 -20
  86. package/src/screens/conversation_details_screen.tsx +13 -4
  87. package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +11 -2
  88. package/src/screens/conversation_new/components/filter_by_plan.tsx +2 -2
  89. package/src/screens/conversation_screen.tsx +13 -11
  90. package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +17 -6
  91. package/src/screens/conversations/components/list_header_component.tsx +6 -1
  92. package/src/screens/conversations/conversations_screen.tsx +6 -2
  93. package/src/screens/design_system_screen.tsx +17 -13
  94. package/src/screens/send_giphy_screen.tsx +10 -11
  95. package/src/utils/styles.ts +1 -0
  96. package/build/components/display/blank_state.d.ts +0 -18
  97. package/build/components/display/blank_state.d.ts.map +0 -1
  98. package/build/components/display/blank_state.js +0 -47
  99. package/build/components/display/blank_state.js.map +0 -1
  100. package/build/navigation/header.d.ts +0 -10
  101. package/build/navigation/header.d.ts.map +0 -1
  102. package/build/navigation/header.js +0 -16
  103. package/build/navigation/header.js.map +0 -1
  104. package/src/components/display/blank_state.tsx +0 -76
  105. package/src/navigation/header.tsx +0 -24
@@ -11,17 +11,17 @@ import {
11
11
  Text,
12
12
  TextInlineButton,
13
13
  ImageAttachmentPreview,
14
- BlankState,
15
14
  Icon,
16
15
  KeyboardView,
17
16
  } from '../components'
17
+ import BlankState from '../components/primitive/blank_state_primitive'
18
18
  import { useTheme } from '../hooks'
19
19
  import { useUploadClient } from '../hooks/use_upload_client'
20
20
  import { ImagePicker, ImagePickerResult, platformFontWeightBold } from '../utils'
21
21
  import { useReportBugAction } from '../hooks/use_report_bug_action'
22
22
  import {
23
- HeaderCancelButton,
24
- HeaderSubmitButton,
23
+ HeaderDismissButton,
24
+ HeaderTextButton,
25
25
  } from '../components/display/platform_modal_header_buttons'
26
26
  import { DefaultLoading } from '../components/page/loading'
27
27
  import { startsWith } from 'lodash'
@@ -46,7 +46,7 @@ export const BugReportScreenOptions = ({
46
46
  }: NativeStackScreenProps<any>): NativeStackNavigationOptions => ({
47
47
  presentation: 'modal',
48
48
  title: 'Report a bug',
49
- headerLeft: () => <HeaderCancelButton title="Cancel" onPress={() => navigation.goBack()} />,
49
+ headerLeft: () => <HeaderDismissButton title="Cancel" onPress={() => navigation.goBack()} />,
50
50
  })
51
51
 
52
52
  interface Attachment {
@@ -150,7 +150,7 @@ ${stepsToResolve}`
150
150
  navigation.setOptions({
151
151
  // eslint-disable-next-line react/no-unstable-nested-components
152
152
  headerRight: () => (
153
- <HeaderSubmitButton title="Submit" onPress={handleSubmit} disabled={!formValid} />
153
+ <HeaderTextButton title="Submit" onPress={handleSubmit} disabled={!formValid} />
154
154
  ),
155
155
  })
156
156
  }, [formValid, handleSubmit, navigation])
@@ -165,20 +165,22 @@ ${stepsToResolve}`
165
165
 
166
166
  if (status === 'success') {
167
167
  return (
168
- <BlankState
169
- iconName="general.checkCircle"
170
- iconStyle={styles.successIcon}
171
- title="Thank you!"
172
- titleStyle={styles.successTitle}
173
- subtitle="We appreciate you taking the time to help improve chat! We'll take a look at the issue you reported."
174
- subtitleStyle={styles.successSubtitle}
175
- buttonProps={{
176
- title: 'Return to chat',
177
- onPress: navigation.goBack,
178
- size: 'lg',
179
- variant: 'fill',
180
- }}
181
- />
168
+ <BlankState.Root>
169
+ <BlankState.Imagery name="general.checkCircle" style={styles.successIcon} />
170
+ <BlankState.Content>
171
+ <BlankState.Heading style={styles.successTitle}>Thank you!</BlankState.Heading>
172
+ <BlankState.Text style={styles.successSubtitle}>
173
+ We appreciate you taking the time to help improve chat! We'll take a look at the issue
174
+ you reported.
175
+ </BlankState.Text>
176
+ </BlankState.Content>
177
+ <BlankState.Button
178
+ title="Return to chat"
179
+ onPress={navigation.goBack}
180
+ size="lg"
181
+ variant="fill"
182
+ />
183
+ </BlankState.Root>
182
184
  )
183
185
  }
184
186
 
@@ -235,7 +237,7 @@ ${stepsToResolve}`
235
237
  >
236
238
  <View style={styles.modalContainer}>
237
239
  <View style={styles.modalHeader}>
238
- <HeaderCancelButton title="Cancel" onPress={() => setShowBugTypePicker(false)} />
240
+ <HeaderDismissButton title="Cancel" onPress={() => setShowBugTypePicker(false)} />
239
241
  <Text style={styles.modalTitle}>Select Bug Type</Text>
240
242
  <View style={styles.modalHeaderSpacer} />
241
243
  </View>
@@ -12,7 +12,6 @@ import {
12
12
  StyleSheet,
13
13
  TextInput,
14
14
  View,
15
- type TextStyle,
16
15
  type ViewStyle,
17
16
  type ViewProps,
18
17
  Pressable,
@@ -20,7 +19,17 @@ import {
20
19
  Platform,
21
20
  } from 'react-native'
22
21
  import { HeaderTitle as ElementsHeaderTitle, HeaderTitleProps } from '@react-navigation/elements'
23
- import { Badge, ChildNotice, Heading, Icon, Person, Switch, Text, TextButton } from '../components'
22
+ import {
23
+ Badge,
24
+ ChildNotice,
25
+ Heading,
26
+ Icon,
27
+ Person,
28
+ Switch,
29
+ Text,
30
+ TextButton,
31
+ type TextStyle,
32
+ } from '../components'
24
33
  import { useSuspensePaginator, useTheme } from '../hooks'
25
34
  import {
26
35
  useConversation,
@@ -30,7 +39,7 @@ import {
30
39
  useConversationUpdate,
31
40
  } from '../hooks/use_conversation'
32
41
  import { MemberResource, isDefined } from '../types'
33
- import { HeaderSubmitButton } from '../components/display/platform_modal_header_buttons'
42
+ import { HeaderTextButton } from '../components/display/platform_modal_header_buttons'
34
43
  import { FlashList } from '@shopify/flash-list'
35
44
  import { tokens } from '../vendor/tapestry/tokens'
36
45
  import { ButtonAppearanceUnion } from '../components/display/utils/button_colors'
@@ -192,7 +201,7 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
192
201
 
193
202
  const HeaderRight = useCallback(() => {
194
203
  return (
195
- <HeaderSubmitButton
204
+ <HeaderTextButton
196
205
  onPress={() => {
197
206
  saveTitle({ title: trimmedTitle || conversation.title })
198
207
  navigation.goBack()
@@ -4,7 +4,8 @@ import React, { useCallback, useMemo, useState } from 'react'
4
4
  import { LayoutChangeEvent, Platform, StyleSheet, View } from 'react-native'
5
5
  import { FlatList, TextInput } from 'react-native-gesture-handler'
6
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
7
- import { BlankState, Heading, ToggleButton } from '../../components'
7
+ import { Heading, ToggleButton } from '../../components'
8
+ import BlankState from '../../components/primitive/blank_state_primitive'
8
9
  import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'
9
10
  import { useTheme } from '../../hooks'
10
11
  import { tokens } from '../../vendor/tapestry/tokens'
@@ -120,7 +121,7 @@ export const ConversationFilterRecipientsScreen = ({
120
121
  ? `service-type-${item.data.serviceTypeId}`
121
122
  : `team-${item.data.teamId}-${item.data.serviceTypeId}`
122
123
  }
123
- ListEmptyComponent={isFetched ? <BlankState title="No teams found" /> : <DefaultLoading />}
124
+ ListEmptyComponent={isFetched ? <ListBlankState /> : <DefaultLoading />}
124
125
  renderItem={({ item }) => {
125
126
  switch (item.type) {
126
127
  case SectionTypes.header:
@@ -150,6 +151,14 @@ export const ConversationFilterRecipientsScreen = ({
150
151
  )
151
152
  }
152
153
 
154
+ const ListBlankState = () => {
155
+ return (
156
+ <BlankState.Root>
157
+ <BlankState.Heading>No teams found</BlankState.Heading>
158
+ </BlankState.Root>
159
+ )
160
+ }
161
+
153
162
  const TeamFilters = ({ onLayout }: { onLayout?: (event: LayoutChangeEvent) => void }) => {
154
163
  const styles = useStyles()
155
164
  const { colors } = useTheme()
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
2
2
  import { StyleSheet, View, FlatList, Platform } from 'react-native'
3
3
  import { Header, PlatformPressable } from '@react-navigation/elements'
4
4
  import { Banner, Icon, Spinner, Text, Heading } from '../../../components'
5
- import { HeaderCancelButton } from '../../../components/display/platform_modal_header_buttons'
5
+ import { HeaderDismissButton } from '../../../components/display/platform_modal_header_buttons'
6
6
  import { useTeamPlans } from '../../../hooks/services/use_team_plans'
7
7
  import { useTheme } from '../../../hooks'
8
8
  import { tokens } from '../../../vendor/tapestry/tokens'
@@ -192,7 +192,7 @@ export function FilterByPlanModal({
192
192
  // ==========================================
193
193
 
194
194
  const createStableHeaderRight = (onClose: () => void) => () => (
195
- <HeaderCancelButton onPress={onClose} title="Cancel" />
195
+ <HeaderDismissButton onPress={onClose} title="Cancel" />
196
196
  )
197
197
 
198
198
  function OptionItem({ plan, isSelected, onPress }: OptionItemProps) {
@@ -18,7 +18,7 @@ import {
18
18
  MemberDisabledRepliesBanner,
19
19
  } from '../components/conversation/disabled_replies_banners'
20
20
  import { EmptyConversationBlankState } from '../components/conversation/empty_conversation_blank_state'
21
- import { BlankState } from '../components/display/blank_state'
21
+ import BlankState from '../components/primitive/blank_state_primitive'
22
22
  import { Message } from '../components/conversation/message'
23
23
  import { MessageForm } from '../components/conversation/message_form'
24
24
  import { TypingIndicator } from '../components/conversation/typing_indicator'
@@ -94,16 +94,18 @@ export function ConversationScreen({ route }: ConversationScreenProps) {
94
94
  if (!conversation || conversation.deleted) {
95
95
  return (
96
96
  <View style={styles.container}>
97
- <BlankState
98
- iconName="general.outlinedTextMessage"
99
- title="This conversation has been deleted"
100
- buttonProps={{
101
- onPress: navigation.goBack,
102
- title: 'Back to conversations',
103
- accessibilityHint: 'Navigates back to the conversations list',
104
- accessibilityRole: 'link',
105
- }}
106
- />
97
+ <BlankState.Root>
98
+ <BlankState.Imagery name="general.outlinedTextMessage" />
99
+ <BlankState.Content>
100
+ <BlankState.Heading>This conversation has been deleted</BlankState.Heading>
101
+ </BlankState.Content>
102
+ <BlankState.Button
103
+ onPress={navigation.goBack}
104
+ title="Back to conversations"
105
+ accessibilityHint="Navigates back to the conversations list"
106
+ accessibilityRole="link"
107
+ />
108
+ </BlankState.Root>
107
109
  </View>
108
110
  )
109
111
  }
@@ -1,7 +1,8 @@
1
1
  import { useNavigation } from '@react-navigation/native'
2
2
  import React from 'react'
3
3
  import { ScrollView, StyleSheet, View } from 'react-native'
4
- import { BlankState, Button, Heading } from '../../components'
4
+ import { Button, Heading } from '../../components'
5
+ import BlankState from '../../components/primitive/blank_state_primitive'
5
6
  import { GroupsGroupResource } from '../../types'
6
7
  import { useGroupsGroups } from '../../hooks/use_groups_groups'
7
8
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
@@ -95,10 +96,7 @@ export const ConversationSelectRecipientsScreen = ({
95
96
  {isGroupsFetching ? (
96
97
  <DefaultLoading />
97
98
  ) : groupsWithCreatePermission.length === 0 ? (
98
- <BlankState
99
- subtitle="Join a group with chat enabled and permissions to start a new conversation."
100
- style={styles.blankState}
101
- />
99
+ <RecipientsBlankState subtitle="Join a group with chat enabled and permissions to start a new conversation." />
102
100
  ) : (
103
101
  <>
104
102
  {visibleGroups.map(group => {
@@ -167,7 +165,7 @@ export const ConversationSelectRecipientsScreen = ({
167
165
  )}
168
166
  </>
169
167
  ) : (
170
- <BlankState subtitle="You don't lead any teams." style={styles.blankState} />
168
+ <RecipientsBlankState subtitle="You don't lead any teams." />
171
169
  )}
172
170
  </View>
173
171
  </View>
@@ -176,6 +174,19 @@ export const ConversationSelectRecipientsScreen = ({
176
174
  )
177
175
  }
178
176
 
177
+ const RecipientsBlankState = ({ subtitle }: { subtitle: string }) => {
178
+ const styles = useStyles()
179
+
180
+ return (
181
+ <BlankState.Root style={styles.blankState}>
182
+ <BlankState.Imagery name="general.outlinedTextMessage" />
183
+ <BlankState.Content>
184
+ <BlankState.Text>{subtitle}</BlankState.Text>
185
+ </BlankState.Content>
186
+ </BlankState.Root>
187
+ )
188
+ }
189
+
179
190
  const useStyles = () => {
180
191
  const { bottom } = useSafeAreaInsets()
181
192
 
@@ -8,6 +8,7 @@ import { useCanDisplayGroups } from '../../../hooks/use_groups'
8
8
  import { ConversationsScreenProps } from '../conversations_screen'
9
9
  import { ChatGroupBadge } from './chat_group_badge'
10
10
  import { Haptic } from '../../../utils/native_adapters'
11
+ import { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../../utils'
11
12
 
12
13
  const ROW_PADDING_HORIZONTAL = 16
13
14
 
@@ -63,7 +64,11 @@ export const ListHeaderComponent = () => {
63
64
  <Heading numberOfLines={1} variant="h2">
64
65
  Conversations
65
66
  </Heading>
66
- <TextButton onPress={alertMarkAllRead} disabled={isPending}>
67
+ <TextButton
68
+ onPress={alertMarkAllRead}
69
+ disabled={isPending}
70
+ maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
71
+ >
67
72
  Mark all read
68
73
  </TextButton>
69
74
  </View>
@@ -6,7 +6,7 @@ import { ActionButton } from '../../components/display/action_button'
6
6
  import { ConversationsContextProvider } from '../../contexts/conversations_context'
7
7
  import { useCanCreateConversations } from '../../hooks'
8
8
  import { GraphId } from '../../types/resources/group_resource'
9
- import { destructureChatGroupGraphId } from '../../utils'
9
+ import { destructureChatGroupGraphId, MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'
10
10
  import { ListHeaderComponent } from './components/list_header_component'
11
11
  import { AppName } from '../../types/resources/app_name'
12
12
 
@@ -69,7 +69,11 @@ export function ConversationsScreen({ route }: ConversationsScreenProps) {
69
69
  onPress={handleNewConversationNavigation}
70
70
  buttonIconNameLeft="churchCenter.signups"
71
71
  secondaryButton={
72
- <TextButton variant="tertiary" onPress={reportABug}>
72
+ <TextButton
73
+ variant="tertiary"
74
+ onPress={reportABug}
75
+ maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
76
+ >
73
77
  Report a bug
74
78
  </TextButton>
75
79
  }
@@ -8,7 +8,6 @@ import {
8
8
  Badge,
9
9
  Banner,
10
10
  BannerCollapsible,
11
- BlankState,
12
11
  Button,
13
12
  ToggleButton,
14
13
  Heading,
@@ -23,6 +22,7 @@ import {
23
22
  TextInlineButton,
24
23
  ImageAttachmentPreview,
25
24
  } from '../components/display'
25
+ import BlankState from '../components/primitive/blank_state_primitive'
26
26
  import {
27
27
  MAX_FONT_SIZE_MULTIPLIER,
28
28
  platformPressedOpacityStyle,
@@ -1056,20 +1056,24 @@ function MiscComponentsSection({ isLast }: SectionProps) {
1056
1056
  </Group>
1057
1057
  <Group
1058
1058
  title="BlankState"
1059
- description="Displays a title and an optional icon, subtitle, and button. Button can be customized via `buttonProps`."
1059
+ description="Compound component with primitives to display imagary, heading, title, and a button."
1060
1060
  >
1061
1061
  <Column>
1062
- <BlankState
1063
- iconName="general.outlinedTextMessage"
1064
- title="No messages"
1065
- subtitle="Conversation is hidden from everyone until you send a message."
1066
- buttonProps={{
1067
- onPress: buttonPress,
1068
- title: 'Go back',
1069
- accessibilityHint: 'Navigates back to the conversations list',
1070
- accessibilityRole: 'link',
1071
- }}
1072
- />
1062
+ <BlankState.Root>
1063
+ <BlankState.Imagery name="general.outlinedTextMessage" />
1064
+ <BlankState.Content>
1065
+ <BlankState.Heading>No messages</BlankState.Heading>
1066
+ <BlankState.Text>
1067
+ Conversation is hidden from everyone until you send a message.
1068
+ </BlankState.Text>
1069
+ </BlankState.Content>
1070
+ <BlankState.Button
1071
+ onPress={buttonPress}
1072
+ title="Go back"
1073
+ accessibilityHint="Navigates back to the conversations list"
1074
+ accessibilityRole="link"
1075
+ />
1076
+ </BlankState.Root>
1073
1077
  </Column>
1074
1078
  </Group>
1075
1079
  </CollapsableSection>
@@ -1,7 +1,8 @@
1
1
  import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'
2
2
  import React from 'react'
3
3
  import { Image as NativeImage, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'
4
- import { BlankState, Button, IconButton, IconString, TextButton } from '../components'
4
+ import { Button, IconButton, IconString, TextButton } from '../components'
5
+ import BlankState from '../components/primitive/blank_state_primitive'
5
6
  import { DefaultLoading } from '../components/page/loading'
6
7
  import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'
7
8
  import { useCreateAndroidRippleColor, useTheme } from '../hooks'
@@ -36,16 +37,14 @@ export function SendGiphyScreen({ route }: SendGiphyScreenProps) {
36
37
  if (!result)
37
38
  return (
38
39
  <FormSheet.Root contentStyle={styles.blankStateContainer}>
39
- <BlankState
40
- style={styles.blankState}
41
- title="No Giphys found"
42
- subtitle="Try a different search term."
43
- iconName="general.bolt"
44
- buttonProps={{
45
- onPress: () => navigation.goBack(),
46
- title: 'Close',
47
- }}
48
- />
40
+ <BlankState.Root style={styles.blankState}>
41
+ <BlankState.Imagery name="general.bolt" />
42
+ <BlankState.Content>
43
+ <BlankState.Heading>No Giphys found</BlankState.Heading>
44
+ <BlankState.Text>Try a different search term.</BlankState.Text>
45
+ </BlankState.Content>
46
+ <BlankState.Button onPress={() => navigation.goBack()} title="Close" />
47
+ </BlankState.Root>
49
48
  </FormSheet.Root>
50
49
  )
51
50
 
@@ -2,6 +2,7 @@ import { Platform } from 'react-native'
2
2
  import { tokens } from '../vendor/tapestry/tokens'
3
3
 
4
4
  export const MAX_FONT_SIZE_MULTIPLIER = 1.5
5
+ export const MAX_FONT_SIZE_MULTIPLIER_LANDMARK = 1.3 // Use in headers, footers, toolbars, etc.
5
6
 
6
7
  export const CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL = 16 // TODO: move to `screens/conversation/utils/styles` when `/screens/conversation` is created
7
8
 
@@ -1,18 +0,0 @@
1
- import { type ViewStyle } from 'react-native';
2
- import { type HeadingProps } from './heading';
3
- import { type IconString, type IconStyle } from './icon';
4
- import { type TextProps } from './text';
5
- import { type ButtonProps } from './button';
6
- interface BlankStateProps {
7
- iconName?: IconString;
8
- iconStyle?: IconStyle;
9
- title?: string;
10
- titleStyle?: HeadingProps['style'];
11
- subtitle?: string;
12
- subtitleStyle?: TextProps['style'];
13
- style?: ViewStyle;
14
- buttonProps?: ButtonProps;
15
- }
16
- export declare const BlankState: ({ iconName, title, titleStyle, subtitle, subtitleStyle, style, iconStyle, buttonProps, }: BlankStateProps) => import("react").JSX.Element;
17
- export {};
18
- //# sourceMappingURL=blank_state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blank_state.d.ts","sourceRoot":"","sources":["../../../src/components/display/blank_state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAc,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAEnD,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAClC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,eAAO,MAAM,UAAU,6FASpB,eAAe,gCAsBjB,CAAA"}
@@ -1,47 +0,0 @@
1
- import { View, StyleSheet } from 'react-native';
2
- import { Heading } from './heading';
3
- import { Icon } from './icon';
4
- import { Text } from './text';
5
- import { useTheme } from '../../hooks';
6
- import { Button } from './button';
7
- export const BlankState = ({ iconName, title, titleStyle, subtitle, subtitleStyle, style, iconStyle, buttonProps, }) => {
8
- const styles = useStyles();
9
- return (<View style={[styles.container, style]}>
10
- {iconName && <Icon name={iconName} size={32} style={[styles.icon, iconStyle]}/>}
11
-
12
- <View style={styles.content}>
13
- {title && (<Heading variant="h3" style={[styles.baseText, titleStyle]}>
14
- {title}
15
- </Heading>)}
16
- {subtitle && (<Text variant="tertiary" style={[styles.baseText, subtitleStyle]}>
17
- {subtitle}
18
- </Text>)}
19
- </View>
20
- {buttonProps && <Button variant="outline" size="sm" {...buttonProps}/>}
21
- </View>);
22
- };
23
- const useStyles = () => {
24
- const { colors } = useTheme();
25
- return StyleSheet.create({
26
- container: {
27
- flex: 1,
28
- alignItems: 'center',
29
- justifyContent: 'center',
30
- gap: 16,
31
- padding: 16,
32
- },
33
- icon: {
34
- color: colors.iconColorDefaultDisabled,
35
- },
36
- content: {
37
- alignItems: 'center',
38
- gap: 4,
39
- maxWidth: 250,
40
- },
41
- baseText: {
42
- textAlign: 'center',
43
- color: colors.textColorDefaultSecondary,
44
- },
45
- });
46
- };
47
- //# sourceMappingURL=blank_state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blank_state.js","sourceRoot":"","sources":["../../../src/components/display/blank_state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,UAAU,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAqB,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,IAAI,EAAmC,MAAM,QAAQ,CAAA;AAC9D,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AAanD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,UAAU,EACV,QAAQ,EACR,aAAa,EACb,KAAK,EACL,SAAS,EACT,WAAW,GACK,EAAE,EAAE;IACpB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACrC;MAAA,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,EAAG,CAEhF;;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAC1B;QAAA,CAAC,KAAK,IAAI,CACR,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CACzD;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,OAAO,CAAC,CACX,CACD;QAAA,CAAC,QAAQ,IAAI,CACX,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAC/D;YAAA,CAAC,QAAQ,CACX;UAAA,EAAE,IAAI,CAAC,CACR,CACH;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,EAAG,CACzE;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,EAAE;SACZ;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,GAAG;SACd;QACD,QAAQ,EAAE;YACR,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,MAAM,CAAC,yBAAyB;SACxC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { View, type ViewStyle, StyleSheet } from 'react-native'\nimport { Heading, type HeadingProps } from './heading'\nimport { Icon, type IconString, type IconStyle } from './icon'\nimport { Text, type TextProps } from './text'\nimport { useTheme } from '../../hooks'\nimport { Button, type ButtonProps } from './button'\n\ninterface BlankStateProps {\n iconName?: IconString\n iconStyle?: IconStyle\n title?: string\n titleStyle?: HeadingProps['style']\n subtitle?: string\n subtitleStyle?: TextProps['style']\n style?: ViewStyle\n buttonProps?: ButtonProps\n}\n\nexport const BlankState = ({\n iconName,\n title,\n titleStyle,\n subtitle,\n subtitleStyle,\n style,\n iconStyle,\n buttonProps,\n}: BlankStateProps) => {\n const styles = useStyles()\n\n return (\n <View style={[styles.container, style]}>\n {iconName && <Icon name={iconName} size={32} style={[styles.icon, iconStyle]} />}\n\n <View style={styles.content}>\n {title && (\n <Heading variant=\"h3\" style={[styles.baseText, titleStyle]}>\n {title}\n </Heading>\n )}\n {subtitle && (\n <Text variant=\"tertiary\" style={[styles.baseText, subtitleStyle]}>\n {subtitle}\n </Text>\n )}\n </View>\n {buttonProps && <Button variant=\"outline\" size=\"sm\" {...buttonProps} />}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n gap: 16,\n padding: 16,\n },\n icon: {\n color: colors.iconColorDefaultDisabled,\n },\n content: {\n alignItems: 'center',\n gap: 4,\n maxWidth: 250,\n },\n baseText: {\n textAlign: 'center',\n color: colors.textColorDefaultSecondary,\n },\n })\n}\n"]}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { HeaderButtonProps } from '@react-navigation/elements';
3
- import { TextProps, TextStyle } from 'react-native';
4
- type HeaderRightButtonProps = HeaderButtonProps & {
5
- children: TextProps['children'];
6
- textStyle?: TextStyle;
7
- };
8
- export declare const HeaderRightButton: (props: HeaderRightButtonProps) => React.JSX.Element;
9
- export {};
10
- //# sourceMappingURL=header.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/navigation/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAgB,iBAAiB,EAAQ,MAAM,4BAA4B,CAAA;AAClF,OAAO,EAAc,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE/D,KAAK,sBAAsB,GAAG,iBAAiB,GAAG;IAChD,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,sBAc9D,CAAA"}
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { HeaderButton, Text } from '@react-navigation/elements';
3
- import { StyleSheet } from 'react-native';
4
- export const HeaderRightButton = (props) => {
5
- const styles = StyleSheet.create({
6
- text: {
7
- fontSize: 16,
8
- },
9
- });
10
- return (<HeaderButton {...props} style={props.style}>
11
- <Text style={[styles.text, props.textStyle]} numberOfLines={1}>
12
- {props.children}
13
- </Text>
14
- </HeaderButton>);
15
- };
16
- //# sourceMappingURL=header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/navigation/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAqB,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAClF,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAA;AAO/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IACjE,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC/B,IAAI,EAAE;YACJ,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;IAEF,OAAO,CACL,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAC1C;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAC5D;QAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,YAAY,CAAC,CAChB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { HeaderButton, HeaderButtonProps, Text } from '@react-navigation/elements'\nimport { StyleSheet, TextProps, TextStyle } from 'react-native'\n\ntype HeaderRightButtonProps = HeaderButtonProps & {\n children: TextProps['children']\n textStyle?: TextStyle\n}\n\nexport const HeaderRightButton = (props: HeaderRightButtonProps) => {\n const styles = StyleSheet.create({\n text: {\n fontSize: 16,\n },\n })\n\n return (\n <HeaderButton {...props} style={props.style}>\n <Text style={[styles.text, props.textStyle]} numberOfLines={1}>\n {props.children}\n </Text>\n </HeaderButton>\n )\n}\n"]}
@@ -1,76 +0,0 @@
1
- import { View, type ViewStyle, StyleSheet } from 'react-native'
2
- import { Heading, type HeadingProps } from './heading'
3
- import { Icon, type IconString, type IconStyle } from './icon'
4
- import { Text, type TextProps } from './text'
5
- import { useTheme } from '../../hooks'
6
- import { Button, type ButtonProps } from './button'
7
-
8
- interface BlankStateProps {
9
- iconName?: IconString
10
- iconStyle?: IconStyle
11
- title?: string
12
- titleStyle?: HeadingProps['style']
13
- subtitle?: string
14
- subtitleStyle?: TextProps['style']
15
- style?: ViewStyle
16
- buttonProps?: ButtonProps
17
- }
18
-
19
- export const BlankState = ({
20
- iconName,
21
- title,
22
- titleStyle,
23
- subtitle,
24
- subtitleStyle,
25
- style,
26
- iconStyle,
27
- buttonProps,
28
- }: BlankStateProps) => {
29
- const styles = useStyles()
30
-
31
- return (
32
- <View style={[styles.container, style]}>
33
- {iconName && <Icon name={iconName} size={32} style={[styles.icon, iconStyle]} />}
34
-
35
- <View style={styles.content}>
36
- {title && (
37
- <Heading variant="h3" style={[styles.baseText, titleStyle]}>
38
- {title}
39
- </Heading>
40
- )}
41
- {subtitle && (
42
- <Text variant="tertiary" style={[styles.baseText, subtitleStyle]}>
43
- {subtitle}
44
- </Text>
45
- )}
46
- </View>
47
- {buttonProps && <Button variant="outline" size="sm" {...buttonProps} />}
48
- </View>
49
- )
50
- }
51
-
52
- const useStyles = () => {
53
- const { colors } = useTheme()
54
-
55
- return StyleSheet.create({
56
- container: {
57
- flex: 1,
58
- alignItems: 'center',
59
- justifyContent: 'center',
60
- gap: 16,
61
- padding: 16,
62
- },
63
- icon: {
64
- color: colors.iconColorDefaultDisabled,
65
- },
66
- content: {
67
- alignItems: 'center',
68
- gap: 4,
69
- maxWidth: 250,
70
- },
71
- baseText: {
72
- textAlign: 'center',
73
- color: colors.textColorDefaultSecondary,
74
- },
75
- })
76
- }
@@ -1,24 +0,0 @@
1
- import React from 'react'
2
- import { HeaderButton, HeaderButtonProps, Text } from '@react-navigation/elements'
3
- import { StyleSheet, TextProps, TextStyle } from 'react-native'
4
-
5
- type HeaderRightButtonProps = HeaderButtonProps & {
6
- children: TextProps['children']
7
- textStyle?: TextStyle
8
- }
9
-
10
- export const HeaderRightButton = (props: HeaderRightButtonProps) => {
11
- const styles = StyleSheet.create({
12
- text: {
13
- fontSize: 16,
14
- },
15
- })
16
-
17
- return (
18
- <HeaderButton {...props} style={props.style}>
19
- <Text style={[styles.text, props.textStyle]} numberOfLines={1}>
20
- {props.children}
21
- </Text>
22
- </HeaderButton>
23
- )
24
- }