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

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 (47) 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/index.d.ts +0 -1
  8. package/build/components/display/index.d.ts.map +1 -1
  9. package/build/components/display/index.js +0 -1
  10. package/build/components/display/index.js.map +1 -1
  11. package/build/components/primitive/blank_state_primitive.d.ts +38 -0
  12. package/build/components/primitive/blank_state_primitive.d.ts.map +1 -0
  13. package/build/components/primitive/blank_state_primitive.js +88 -0
  14. package/build/components/primitive/blank_state_primitive.js.map +1 -0
  15. package/build/screens/bug_report_screen.d.ts.map +1 -1
  16. package/build/screens/bug_report_screen.js +13 -7
  17. package/build/screens/bug_report_screen.js.map +1 -1
  18. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
  19. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +8 -2
  20. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
  21. package/build/screens/conversation_screen.d.ts.map +1 -1
  22. package/build/screens/conversation_screen.js +8 -7
  23. package/build/screens/conversation_screen.js.map +1 -1
  24. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
  25. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +13 -3
  26. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
  27. package/build/screens/design_system_screen.js +13 -8
  28. package/build/screens/design_system_screen.js.map +1 -1
  29. package/build/screens/send_giphy_screen.d.ts.map +1 -1
  30. package/build/screens/send_giphy_screen.js +10 -5
  31. package/build/screens/send_giphy_screen.js.map +1 -1
  32. package/package.json +2 -2
  33. package/src/components/conversation/empty_conversation_blank_state.tsx +10 -6
  34. package/src/components/conversations/conversations.tsx +7 -2
  35. package/src/components/display/index.ts +0 -1
  36. package/src/components/primitive/blank_state_primitive.tsx +194 -0
  37. package/src/screens/bug_report_screen.tsx +17 -15
  38. package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +11 -2
  39. package/src/screens/conversation_screen.tsx +13 -11
  40. package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +17 -6
  41. package/src/screens/design_system_screen.tsx +17 -13
  42. package/src/screens/send_giphy_screen.tsx +10 -11
  43. package/build/components/display/blank_state.d.ts +0 -18
  44. package/build/components/display/blank_state.d.ts.map +0 -1
  45. package/build/components/display/blank_state.js +0 -47
  46. package/build/components/display/blank_state.js.map +0 -1
  47. package/src/components/display/blank_state.tsx +0 -76
@@ -0,0 +1,194 @@
1
+ import React, { FC, ReactNode } from 'react'
2
+ import { View, StyleSheet, ViewStyle } from 'react-native'
3
+ import { useTheme } from '../../hooks'
4
+ import {
5
+ Button,
6
+ Heading,
7
+ Icon,
8
+ Text,
9
+ type ButtonProps,
10
+ type HeadingProps,
11
+ type IconString,
12
+ type IconStyle,
13
+ type TextProps,
14
+ } from '../display'
15
+
16
+ // ========================================
17
+ // ====== Exports =========================
18
+ // ========================================
19
+
20
+ const BlankState = {
21
+ Root: BlankStateRoot,
22
+ Imagery: BlankStateImagery,
23
+ Content: BlankStateContent,
24
+ Heading: BlankStateHeading,
25
+ Text: BlankStateText,
26
+ Button: BlankStateButton,
27
+ } as const
28
+
29
+ type BlankStateComponents = {
30
+ Root: FC<BlankStateRootProps>
31
+ Imagery: FC<BlankStateImageryProps>
32
+ Content: FC<BlankStateContentProps>
33
+ Heading: FC<BlankStateHeadingProps>
34
+ Text: FC<BlankStateTextProps>
35
+ Button: FC<BlankStateButtonProps>
36
+ }
37
+
38
+ export default BlankState as BlankStateComponents
39
+ export type {
40
+ BlankStateRootProps,
41
+ BlankStateImageryProps,
42
+ BlankStateContentProps,
43
+ BlankStateHeadingProps,
44
+ BlankStateTextProps,
45
+ BlankStateButtonProps,
46
+ }
47
+
48
+ // ========================================
49
+ // ====== BlankStateRoot ==================
50
+ // ========================================
51
+
52
+ interface BlankStateRootProps {
53
+ children: ReactNode
54
+ style?: ViewStyle
55
+ }
56
+
57
+ function BlankStateRoot({ children, style }: BlankStateRootProps) {
58
+ const styles = useStyles()
59
+
60
+ return <View style={[styles.container, style]}>{children}</View>
61
+ }
62
+
63
+ BlankStateRoot.displayName = 'BlankState.Root'
64
+
65
+ // ========================================
66
+ // ====== BlankStateImagery ===============
67
+ // ========================================
68
+
69
+ interface BlankStateImageryProps {
70
+ name: IconString
71
+ size?: number
72
+ style?: IconStyle
73
+ }
74
+
75
+ function BlankStateImagery({ name, size = 32, style }: BlankStateImageryProps) {
76
+ const styles = useStyles()
77
+
78
+ /*
79
+ NOTE:
80
+ BlankState.Imagery will eventually return more then just an Icon component
81
+ Eventually it will need to return SVG illustrations from the theme or internally for Services Mobile.
82
+ This first step of using a more abstract component just allows us to keep this component open to change, without being overly perscriptive on how the change should be implomented.
83
+
84
+ */
85
+
86
+ return <Icon name={name} size={size} style={[styles.imagery, style]} />
87
+ }
88
+
89
+ BlankStateImagery.displayName = 'BlankState.Imagery'
90
+
91
+ // ========================================
92
+ // ====== BlankStateContent ===============
93
+ // ========================================
94
+
95
+ interface BlankStateContentProps {
96
+ children: ReactNode
97
+ style?: ViewStyle
98
+ }
99
+
100
+ function BlankStateContent({ children, style }: BlankStateContentProps) {
101
+ const styles = useStyles()
102
+
103
+ return <View style={[styles.content, style]}>{children}</View>
104
+ }
105
+
106
+ BlankStateContent.displayName = 'BlankState.Content'
107
+
108
+ // ========================================
109
+ // ====== BlankStateHeading ===============
110
+ // ========================================
111
+
112
+ interface BlankStateHeadingProps {
113
+ children: ReactNode
114
+ style?: HeadingProps['style']
115
+ }
116
+
117
+ function BlankStateHeading({ children, style }: BlankStateHeadingProps) {
118
+ const styles = useStyles()
119
+
120
+ return (
121
+ <Heading variant="h3" style={[styles.heading, style]}>
122
+ {children}
123
+ </Heading>
124
+ )
125
+ }
126
+
127
+ BlankStateHeading.displayName = 'BlankState.Heading'
128
+
129
+ // ========================================
130
+ // ====== BlankStateText ==================
131
+ // ========================================
132
+
133
+ interface BlankStateTextProps {
134
+ children: ReactNode
135
+ style?: TextProps['style']
136
+ }
137
+
138
+ function BlankStateText({ children, style }: BlankStateTextProps) {
139
+ const styles = useStyles()
140
+
141
+ return (
142
+ <Text variant="tertiary" style={[styles.text, style]}>
143
+ {children}
144
+ </Text>
145
+ )
146
+ }
147
+
148
+ BlankStateText.displayName = 'BlankState.Text'
149
+
150
+ // ========================================
151
+ // ====== BlankStateButton ================
152
+ // ========================================
153
+
154
+ interface BlankStateButtonProps extends ButtonProps {}
155
+
156
+ function BlankStateButton(props: BlankStateButtonProps) {
157
+ return <Button variant="outline" size="sm" {...props} />
158
+ }
159
+
160
+ BlankStateButton.displayName = 'BlankState.Button'
161
+
162
+ // ========================================
163
+ // ====== Styles ==========================
164
+ // ========================================
165
+
166
+ const useStyles = () => {
167
+ const { colors } = useTheme()
168
+
169
+ return StyleSheet.create({
170
+ container: {
171
+ flex: 1,
172
+ alignItems: 'center',
173
+ justifyContent: 'center',
174
+ gap: 16,
175
+ padding: 16,
176
+ },
177
+ imagery: {
178
+ color: colors.iconColorDefaultDisabled,
179
+ },
180
+ content: {
181
+ alignItems: 'center',
182
+ gap: 4,
183
+ maxWidth: 250,
184
+ },
185
+ heading: {
186
+ textAlign: 'center',
187
+ color: colors.textColorDefaultSecondary,
188
+ },
189
+ text: {
190
+ textAlign: 'center',
191
+ color: colors.textColorDefaultSecondary,
192
+ },
193
+ })
194
+ }
@@ -11,10 +11,10 @@ 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'
@@ -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
 
@@ -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()
@@ -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,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
 
@@ -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,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
- }