@planningcenter/chat-react-native 1.5.0 → 1.6.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 (206) hide show
  1. package/build/components/conversations.d.ts.map +1 -1
  2. package/build/components/conversations.js +29 -8
  3. package/build/components/conversations.js.map +1 -1
  4. package/build/components/display/button.d.ts +71 -0
  5. package/build/components/display/button.d.ts.map +1 -0
  6. package/build/components/display/button.js +136 -0
  7. package/build/components/display/button.js.map +1 -0
  8. package/build/components/display/button_color_utils.d.ts +24 -0
  9. package/build/components/display/button_color_utils.d.ts.map +1 -0
  10. package/build/components/display/button_color_utils.js +43 -0
  11. package/build/components/display/button_color_utils.js.map +1 -0
  12. package/build/components/display/heading.d.ts +4 -0
  13. package/build/components/display/heading.d.ts.map +1 -1
  14. package/build/components/display/heading.js +3 -0
  15. package/build/components/display/heading.js.map +1 -1
  16. package/build/components/display/icon.d.ts +8 -4
  17. package/build/components/display/icon.d.ts.map +1 -1
  18. package/build/components/display/icon.js +21 -13
  19. package/build/components/display/icon.js.map +1 -1
  20. package/build/components/display/image.d.ts +7 -2
  21. package/build/components/display/image.d.ts.map +1 -1
  22. package/build/components/display/image.js +5 -5
  23. package/build/components/display/image.js.map +1 -1
  24. package/build/components/display/index.d.ts +10 -7
  25. package/build/components/display/index.d.ts.map +1 -1
  26. package/build/components/display/index.js +10 -7
  27. package/build/components/display/index.js.map +1 -1
  28. package/build/components/display/spinner.d.ts +5 -1
  29. package/build/components/display/spinner.d.ts.map +1 -1
  30. package/build/components/display/spinner.js +19 -13
  31. package/build/components/display/spinner.js.map +1 -1
  32. package/build/components/display/text.d.ts +13 -3
  33. package/build/components/display/text.d.ts.map +1 -1
  34. package/build/components/display/text.js +17 -5
  35. package/build/components/display/text.js.map +1 -1
  36. package/build/components/display/text_button.d.ts +37 -0
  37. package/build/components/display/text_button.d.ts.map +1 -0
  38. package/build/components/display/text_button.js +36 -0
  39. package/build/components/display/text_button.js.map +1 -0
  40. package/build/components/display/text_inline_button.d.ts +12 -0
  41. package/build/components/display/text_inline_button.d.ts.map +1 -0
  42. package/build/components/display/text_inline_button.js +53 -0
  43. package/build/components/display/text_inline_button.js.map +1 -0
  44. package/build/components/index.d.ts +1 -0
  45. package/build/components/index.d.ts.map +1 -1
  46. package/build/components/index.js +1 -0
  47. package/build/components/index.js.map +1 -1
  48. package/build/components/primitive/avatar_primitive.d.ts +1 -1
  49. package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
  50. package/build/components/primitive/avatar_primitive.js +6 -9
  51. package/build/components/primitive/avatar_primitive.js.map +1 -1
  52. package/build/contexts/api_provider.d.ts +4 -6
  53. package/build/contexts/api_provider.d.ts.map +1 -1
  54. package/build/contexts/api_provider.js +13 -20
  55. package/build/contexts/api_provider.js.map +1 -1
  56. package/build/contexts/chat_context.d.ts +7 -5
  57. package/build/contexts/chat_context.d.ts.map +1 -1
  58. package/build/contexts/chat_context.js +40 -4
  59. package/build/contexts/chat_context.js.map +1 -1
  60. package/build/hooks/index.d.ts +4 -0
  61. package/build/hooks/index.d.ts.map +1 -1
  62. package/build/hooks/index.js +4 -0
  63. package/build/hooks/index.js.map +1 -1
  64. package/build/hooks/use_create_android_ripple_color.d.ts +4 -0
  65. package/build/hooks/use_create_android_ripple_color.d.ts.map +1 -0
  66. package/build/hooks/use_create_android_ripple_color.js +15 -0
  67. package/build/hooks/use_create_android_ripple_color.js.map +1 -0
  68. package/build/hooks/use_current_person.d.ts +3 -0
  69. package/build/hooks/use_current_person.d.ts.map +1 -0
  70. package/build/hooks/use_current_person.js +13 -0
  71. package/build/hooks/use_current_person.js.map +1 -0
  72. package/build/hooks/use_font_scale.d.ts +4 -0
  73. package/build/hooks/use_font_scale.d.ts.map +1 -0
  74. package/build/hooks/use_font_scale.js +8 -0
  75. package/build/hooks/use_font_scale.js.map +1 -0
  76. package/build/hooks/use_suspense_api.d.ts +61 -0
  77. package/build/hooks/use_suspense_api.d.ts.map +1 -0
  78. package/build/hooks/use_suspense_api.js +39 -0
  79. package/build/hooks/use_suspense_api.js.map +1 -0
  80. package/build/navigation/index.d.ts +1 -0
  81. package/build/navigation/index.d.ts.map +1 -1
  82. package/build/navigation/index.js +7 -4
  83. package/build/navigation/index.js.map +1 -1
  84. package/build/screens/conversation_screen.d.ts.map +1 -1
  85. package/build/screens/conversation_screen.js +59 -6
  86. package/build/screens/conversation_screen.js.map +1 -1
  87. package/build/screens/display.d.ts.map +1 -1
  88. package/build/screens/display.js +277 -51
  89. package/build/screens/display.js.map +1 -1
  90. package/build/screens/not_found.js +1 -1
  91. package/build/screens/not_found.js.map +1 -1
  92. package/build/types/api_primitives.d.ts +23 -0
  93. package/build/types/api_primitives.d.ts.map +1 -0
  94. package/build/types/api_primitives.js +2 -0
  95. package/build/types/api_primitives.js.map +1 -0
  96. package/build/types/index.d.ts +4 -0
  97. package/build/types/index.d.ts.map +1 -0
  98. package/build/types/index.js +4 -0
  99. package/build/types/index.js.map +1 -0
  100. package/build/types/resources/conversation.d.ts +15 -0
  101. package/build/types/resources/conversation.d.ts.map +1 -0
  102. package/build/types/resources/conversation.js +2 -0
  103. package/build/types/resources/conversation.js.map +1 -0
  104. package/build/types/resources/index.d.ts +5 -0
  105. package/build/types/resources/index.d.ts.map +1 -0
  106. package/build/types/resources/index.js +5 -0
  107. package/build/types/resources/index.js.map +1 -0
  108. package/build/types/resources/message.d.ts +16 -0
  109. package/build/types/resources/message.d.ts.map +1 -0
  110. package/build/types/resources/message.js +2 -0
  111. package/build/types/resources/message.js.map +1 -0
  112. package/build/types/resources/oauth_token.d.ts +9 -0
  113. package/build/types/resources/oauth_token.d.ts.map +1 -0
  114. package/build/types/resources/oauth_token.js +2 -0
  115. package/build/types/resources/oauth_token.js.map +1 -0
  116. package/build/types/resources/person.d.ts +9 -0
  117. package/build/types/resources/person.d.ts.map +1 -0
  118. package/build/types/resources/person.js +2 -0
  119. package/build/types/resources/person.js.map +1 -0
  120. package/build/types/resources/reaction.d.ts +10 -0
  121. package/build/types/resources/reaction.d.ts.map +1 -0
  122. package/build/types/resources/reaction.js +2 -0
  123. package/build/types/resources/reaction.js.map +1 -0
  124. package/build/types/utils/index.d.ts +4 -0
  125. package/build/types/utils/index.d.ts.map +1 -0
  126. package/build/types/utils/index.js +4 -0
  127. package/build/types/utils/index.js.map +1 -0
  128. package/build/utils/client/client.d.ts +21 -12
  129. package/build/utils/client/client.d.ts.map +1 -1
  130. package/build/utils/client/client.js +24 -22
  131. package/build/utils/client/client.js.map +1 -1
  132. package/build/utils/index.d.ts +1 -0
  133. package/build/utils/index.d.ts.map +1 -1
  134. package/build/utils/index.js +1 -0
  135. package/build/utils/index.js.map +1 -1
  136. package/build/utils/session.d.ts +0 -5
  137. package/build/utils/session.d.ts.map +1 -1
  138. package/build/utils/session.js +0 -10
  139. package/build/utils/session.js.map +1 -1
  140. package/build/utils/styles.d.ts +5 -0
  141. package/build/utils/styles.d.ts.map +1 -1
  142. package/build/utils/styles.js +9 -0
  143. package/build/utils/styles.js.map +1 -1
  144. package/build/utils/theme.d.ts +3 -1
  145. package/build/utils/theme.d.ts.map +1 -1
  146. package/build/utils/theme.js +6 -2
  147. package/build/utils/theme.js.map +1 -1
  148. package/build/vendor/tapestry/alias_tokens_color_map.d.ts +8 -0
  149. package/build/vendor/tapestry/alias_tokens_color_map.d.ts.map +1 -1
  150. package/build/vendor/tapestry/alias_tokens_color_map.js +8 -0
  151. package/build/vendor/tapestry/alias_tokens_color_map.js.map +1 -1
  152. package/build/vendor/tapestry/tokens.d.ts +21 -0
  153. package/build/vendor/tapestry/tokens.d.ts.map +1 -1
  154. package/build/vendor/tapestry/tokens.js +21 -0
  155. package/build/vendor/tapestry/tokens.js.map +1 -1
  156. package/package.json +4 -3
  157. package/src/__tests__/client.ts +72 -19
  158. package/src/__tests__/session.ts +0 -11
  159. package/src/__utils__/handlers.ts +1 -1
  160. package/src/components/conversations.tsx +33 -11
  161. package/src/components/display/button.tsx +293 -0
  162. package/src/components/display/button_color_utils.ts +72 -0
  163. package/src/components/display/heading.tsx +12 -0
  164. package/src/components/display/icon.tsx +35 -16
  165. package/src/components/display/image.tsx +29 -7
  166. package/src/components/display/index.ts +10 -7
  167. package/src/components/display/spinner.tsx +42 -13
  168. package/src/components/display/text.tsx +34 -13
  169. package/src/components/display/text_button.tsx +102 -0
  170. package/src/components/display/text_inline_button.tsx +91 -0
  171. package/src/components/index.tsx +1 -0
  172. package/src/components/primitive/avatar_primitive.tsx +12 -6
  173. package/src/contexts/api_provider.tsx +18 -26
  174. package/src/contexts/chat_context.tsx +61 -7
  175. package/src/hooks/index.ts +4 -0
  176. package/src/hooks/use_create_android_ripple_color.ts +18 -0
  177. package/src/hooks/use_current_person.ts +15 -0
  178. package/src/hooks/use_font_scale.ts +9 -0
  179. package/src/hooks/use_suspense_api.ts +60 -0
  180. package/src/navigation/index.tsx +14 -4
  181. package/src/screens/conversation_screen.tsx +83 -7
  182. package/src/screens/display.tsx +447 -51
  183. package/src/screens/not_found.tsx +1 -1
  184. package/src/types/api_primitives.ts +24 -0
  185. package/src/types/index.ts +3 -0
  186. package/src/types/resources/conversation.ts +15 -0
  187. package/src/types/resources/index.ts +4 -0
  188. package/src/types/resources/message.ts +18 -0
  189. package/src/types/resources/oauth_token.ts +8 -0
  190. package/src/types/resources/person.ts +9 -0
  191. package/src/types/resources/reaction.ts +9 -0
  192. package/src/types/utils/index.ts +6 -0
  193. package/src/utils/client/client.ts +41 -34
  194. package/src/utils/client/types.d.ts +2 -0
  195. package/src/utils/index.ts +1 -0
  196. package/src/utils/session.ts +0 -13
  197. package/src/utils/styles.ts +12 -0
  198. package/src/utils/theme.ts +9 -3
  199. package/src/vendor/tapestry/alias_tokens_color_map.ts +12 -0
  200. package/src/vendor/tapestry/tokens.ts +21 -0
  201. package/build/utils/api.d.ts +0 -9
  202. package/build/utils/api.d.ts.map +0 -1
  203. package/build/utils/api.js +0 -36
  204. package/build/utils/api.js.map +0 -1
  205. package/src/types.d.ts +0 -35
  206. package/src/utils/api.ts +0 -47
@@ -1,16 +1,69 @@
1
- import React from 'react';
2
- import { StyleSheet, View } from 'react-native';
1
+ import { useNavigation } from '@react-navigation/native';
2
+ import React, { useEffect } from 'react';
3
+ import { FlatList, SafeAreaView, StyleSheet, TextInput, View } from 'react-native';
3
4
  import { Text } from '../components/display';
5
+ import { useSuspenseGet, useSuspensePaginator } from '../hooks/use_suspense_api';
6
+ import { useTheme } from '../hooks';
4
7
  export function ConversationScreen({ route }) {
5
- return (<View style={styles.container}>
6
- <Text>{JSON.stringify(route.params, null, 2)}</Text>
7
- </View>);
8
+ const navigation = useNavigation();
9
+ const { conversation_id } = route.params;
10
+ const { data: conversation } = useSuspenseGet({
11
+ url: `/me/conversations/${conversation_id}`,
12
+ data: {
13
+ fields: {
14
+ Conversation: ['title'],
15
+ },
16
+ },
17
+ });
18
+ const { data, refetch, isRefetching, fetchNextPage } = useSuspensePaginator({
19
+ url: `/me/conversations/${conversation_id}/messages`,
20
+ data: {
21
+ perPage: 25,
22
+ fields: {
23
+ Message: ['text', 'mine'],
24
+ },
25
+ },
26
+ });
27
+ useEffect(() => {
28
+ navigation.setOptions({ title: conversation?.title });
29
+ }, [conversation, conversation_id, navigation]);
30
+ return (<SafeAreaView style={styles.container}>
31
+ <FlatList inverted contentContainerStyle={styles.listContainer} refreshing={isRefetching} onRefresh={refetch} data={data} keyExtractor={item => item.id} renderItem={({ item }) => <Message {...item}/>} onEndReached={() => fetchNextPage()}/>
32
+ <View style={styles.textInputContainer}>
33
+ <TextInput aria-disabled={true} placeholder="Send a message" onChangeText={() => console.log('TODO: Implement sending a message')} value="" style={styles.textInput}/>
34
+ </View>
35
+ </SafeAreaView>);
8
36
  }
37
+ function Message(message) {
38
+ const { text } = message;
39
+ const styles = useMessageStyles(message);
40
+ return <Text style={styles.message}>{text}</Text>;
41
+ }
42
+ const useMessageStyles = ({ mine }) => {
43
+ const { colors } = useTheme();
44
+ return StyleSheet.create({
45
+ message: {
46
+ alignSelf: mine ? 'flex-end' : 'flex-start',
47
+ backgroundColor: mine ? colors.fillColorNeutral040 : colors.fillColorNeutral050Base,
48
+ borderRadius: 16,
49
+ borderBottomLeftRadius: mine ? 16 : 0,
50
+ borderBottomRightRadius: mine ? 0 : 16,
51
+ padding: 12,
52
+ color: colors.textColorDefaultPrimary,
53
+ },
54
+ });
55
+ };
9
56
  const styles = StyleSheet.create({
10
57
  container: {
11
58
  flex: 1,
12
59
  justifyContent: 'center',
13
- gap: 8,
14
60
  },
61
+ listContainer: {
62
+ gap: 12,
63
+ paddingHorizontal: 16,
64
+ paddingTop: 12,
65
+ },
66
+ textInputContainer: { borderTopWidth: 1, padding: 12 },
67
+ textInput: { borderRadius: 16, borderWidth: 1, padding: 12 },
15
68
  });
16
69
  //# sourceMappingURL=conversation_screen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAO5C,MAAM,UAAU,kBAAkB,CAAC,EAAE,KAAK,EAA2B;IACnE,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CACrD;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,GAAG,EAAE,CAAC;KACP;CACF,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Text } from '../components/display'\n\nexport type ConversationScreenProps = StaticScreenProps<{\n conversation_id: string\n chat_group_graph_id: string\n}>\n\nexport function ConversationScreen({ route }: ConversationScreenProps) {\n return (\n <View style={styles.container}>\n <Text>{JSON.stringify(route.params, null, 2)}</Text>\n </View>\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n gap: 8,\n },\n})\n"]}
1
+ {"version":3,"file":"conversation_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAOnC,MAAM,UAAU,kBAAkB,CAAC,EAAE,KAAK,EAA2B;IACnE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IAExC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,cAAc,CAAuB;QAClE,GAAG,EAAE,qBAAqB,eAAe,EAAE;QAC3C,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,YAAY,EAAE,CAAC,OAAO,CAAC;aACxB;SACF;KACF,CAAC,CAAA;IAEF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,oBAAoB,CAAkB;QAC3F,GAAG,EAAE,qBAAqB,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AAE,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;CAC7D,CAAC,CAAA","sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useEffect } from 'react'\nimport { FlatList, SafeAreaView, StyleSheet, TextInput, View } from 'react-native'\nimport { Text } from '../components/display'\nimport { useSuspenseGet, useSuspensePaginator } from '../hooks/use_suspense_api'\nimport { ConversationResource, MessageResource } from '../types'\nimport { useTheme } from '../hooks'\n\nexport type ConversationScreenProps = StaticScreenProps<{\n conversation_id: string\n chat_group_graph_id: string\n}>\n\nexport function ConversationScreen({ route }: ConversationScreenProps) {\n const navigation = useNavigation()\n const { conversation_id } = route.params\n\n const { data: conversation } = useSuspenseGet<ConversationResource>({\n url: `/me/conversations/${conversation_id}`,\n data: {\n fields: {\n Conversation: ['title'],\n },\n },\n })\n\n const { data, refetch, isRefetching, fetchNextPage } = useSuspensePaginator<MessageResource>({\n url: `/me/conversations/${conversation_id}/messages`,\n data: {\n perPage: 25,\n fields: {\n Message: ['text', 'mine'],\n },\n },\n })\n\n useEffect(() => {\n navigation.setOptions({ title: conversation?.title })\n }, [conversation, conversation_id, navigation])\n\n return (\n <SafeAreaView style={styles.container}>\n <FlatList\n inverted\n contentContainerStyle={styles.listContainer}\n refreshing={isRefetching}\n onRefresh={refetch}\n data={data}\n keyExtractor={item => item.id}\n renderItem={({ item }) => <Message {...item} />}\n onEndReached={() => fetchNextPage()}\n />\n <View style={styles.textInputContainer}>\n <TextInput\n aria-disabled={true}\n placeholder=\"Send a message\"\n onChangeText={() => console.log('TODO: Implement sending a message')}\n value=\"\"\n style={styles.textInput}\n />\n </View>\n </SafeAreaView>\n )\n}\n\nfunction Message(message: MessageResource) {\n const { text } = message\n const styles = useMessageStyles(message)\n\n return <Text style={styles.message}>{text}</Text>\n}\n\nconst useMessageStyles = ({ mine }: MessageResource) => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n message: {\n alignSelf: mine ? 'flex-end' : 'flex-start',\n backgroundColor: mine ? colors.fillColorNeutral040 : colors.fillColorNeutral050Base,\n borderRadius: 16,\n borderBottomLeftRadius: mine ? 16 : 0,\n borderBottomRightRadius: mine ? 0 : 16,\n padding: 12,\n color: colors.textColorDefaultPrimary,\n },\n })\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n listContainer: {\n gap: 12,\n paddingHorizontal: 16,\n paddingTop: 12,\n },\n textInputContainer: { borderTopWidth: 1, padding: 12 },\n textInput: { borderRadius: 16, borderWidth: 1, padding: 12 },\n})\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/screens/display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAyBzB,wBAAgB,aAAa,sBAmD5B"}
1
+ {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/screens/display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAuCvC,wBAAgB,aAAa,sBAyV5B"}
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
- import { ScrollView, StyleSheet, View } from 'react-native';
1
+ import React, { useState } from 'react';
2
+ import { Alert, Pressable, ScrollView, StyleSheet, View } from 'react-native';
3
3
  import { useTheme } from '../hooks';
4
- import { Avatar, AvatarGroup, Heading, Icon, Image, Spinner, Text } from '../components/display';
5
- import { space } from '../utils/space';
4
+ import { Avatar, AvatarGroup, Button, Heading, Icon, Image, Spinner, Text, TextButton, TextInlineButton, } from '../components/display';
5
+ import { space, MAX_FONT_SIZE_MULTIPLIER, platformPressedOpacityStyle } from '../utils';
6
6
  const URL = {
7
7
  image: 'https://picsum.photos/seed/picsum/200',
8
8
  broken: 'https://broken.url',
@@ -21,61 +21,279 @@ const URL = {
21
21
  'https://i.pravatar.cc/200?img=27',
22
22
  ],
23
23
  };
24
+ const buttonPress = () => Alert.alert('Button clicked');
24
25
  export function DisplayScreen() {
25
26
  const styles = useStyles();
26
27
  return (<ScrollView contentContainerStyle={styles.container} style={styles.scrollView}>
27
- <View style={styles.column}>
28
- <View style={[styles.row, styles.spinnerContainer]}>
29
- <Spinner size={24}/>
30
- </View>
31
- <View style={styles.row}>
32
- <Image source={{ uri: URL.broken }} style={styles.image}/>
33
- <Image source={{ uri: URL.image }} style={styles.image}/>
34
- </View>
35
- <View style={styles.row}>
36
- <Avatar sourceUri={URL.broken}/>
37
- <Avatar size="md" sourceUri={URL.avatar_fallback}/>
38
- <Avatar sourceUri={URL.avatar}/>
39
- </View>
40
- <View style={styles.row}>
41
- <Avatar presence="offline" sourceUri={URL.broken}/>
42
- <Avatar presence="online" size="md" sourceUri={URL.avatar_fallback}/>
43
- <Avatar presence="offline" sourceUri={URL.avatar}/>
44
- </View>
45
- <View style={styles.row}>
46
- <AvatarGroup sourceUris={[URL.broken]}/>
47
- <AvatarGroup sourceUris={[URL.broken, URL.broken, ...URL.two_avatars]}/>
48
- <AvatarGroup sourceUris={[URL.avatar]}/>
49
- <AvatarGroup sourceUris={URL.two_avatars}/>
50
- <AvatarGroup sourceUris={URL.three_avatars}/>
51
- <AvatarGroup sourceUris={URL.four_avatars}/>
52
- </View>
53
- <View style={styles.row}>
54
- <Icon name="missingIcon" size={20}/>
55
- <Icon name="general.textMessage" size={20}/>
56
- <Icon name="churchCenter.sort" style={styles.icon}/>
57
- </View>
58
- <View style={styles.row}>
59
- <Text>Plain text</Text>
60
- <Text variant="secondary">Secondary</Text>
61
- <Text variant="tertiary">Tertiary</Text>
62
- <Text variant="footnote">Footnote</Text>
63
- </View>
64
- <View style={styles.row}>
65
- <Heading>Heading 1</Heading>
66
- <Heading variant="h2">Heading 2</Heading>
67
- <Heading variant="h3">Heading 3</Heading>
68
- <Heading variant="h4">Heading 4</Heading>
69
- </View>
70
- </View>
28
+ <CollapsableSection title="Molecules">
29
+ <Row>
30
+ <Text>🚧 Coming soon! 🚧</Text>
31
+ </Row>
32
+ </CollapsableSection>
33
+ <CollapsableSection title="Atoms" isLast>
34
+ <Group title="Spinner" description="Loading indicators that can be used within or close to atomic components. Not intended for full-screen loading.">
35
+ <Row style={styles.spinnerContainer}>
36
+ <Spinner size={24}/>
37
+ </Row>
38
+ </Group>
39
+ <Group title="Image" description="Foundational way of displaying images. Loading or broken images will fallback to show a spinner. Hide decortive images from screen readers with `alt=''`.">
40
+ <Row>
41
+ <Image source={{ uri: URL.broken }} style={styles.image} alt="Mountain sunrise"/>
42
+ <Image source={{ uri: URL.image }} style={styles.image} alt="Mountain sunrise"/>
43
+ <Image source={{ uri: URL.image }} style={styles.image} alt=""/>
44
+ </Row>
45
+ </Group>
46
+ <Group title="Avatar" description='Displays the profile image for a user in different sizes and has a loading fallback. Can optionally show an online/offline "presence" indicator.'>
47
+ <Row>
48
+ <Avatar sourceUri={URL.broken}/>
49
+ <Avatar size="md" sourceUri={URL.avatar_fallback}/>
50
+ <Avatar sourceUri={URL.avatar}/>
51
+ </Row>
52
+ <Row>
53
+ <Avatar presence="offline" sourceUri={URL.broken}/>
54
+ <Avatar presence="online" size="md" sourceUri={URL.avatar_fallback}/>
55
+ <Avatar presence="offline" sourceUri={URL.avatar}/>
56
+ </Row>
57
+ </Group>
58
+ <Group title="AvatarGroup" description="Shows 1-4 images in a grid at different sizes. Loading fallback shows until all images successfully load.">
59
+ <Row>
60
+ <AvatarGroup sourceUris={[URL.broken]}/>
61
+ <AvatarGroup sourceUris={[URL.broken, URL.broken, ...URL.two_avatars]}/>
62
+ <AvatarGroup sourceUris={[URL.avatar]}/>
63
+ <AvatarGroup sourceUris={URL.two_avatars}/>
64
+ <AvatarGroup sourceUris={URL.three_avatars}/>
65
+ <AvatarGroup sourceUris={URL.four_avatars}/>
66
+ </Row>
67
+ </Group>
68
+ <Group title="Icon" description="Displays any icon from @planningcenter/icons. Missing icons will fallback to a grey circle. Styling with `fontSize` will allow it to scale with the device's text a11y size.">
69
+ <Row>
70
+ <Icon name="missingIcon" size={20}/>
71
+ <Icon name="general.textMessage" size={20}/>
72
+ <Icon name="churchCenter.sort" style={styles.icon}/>
73
+ </Row>
74
+ </Group>
75
+ <Group title="Button" description="Feature fill and outline variants for primary and danger usecases, along with disabled & loading states. Optionally shows icons to the left and right of the text.">
76
+ <Row>
77
+ <Button onPress={buttonPress} title="Default" size="sm"/>
78
+ <Button onPress={buttonPress} title="Default" size="md"/>
79
+ <Button onPress={buttonPress} title="Danger" appearance="danger" size="lg"/>
80
+ </Row>
81
+ <Row>
82
+ <Button disabled onPress={buttonPress} title="Disabled" size="sm"/>
83
+ <Button disabled onPress={buttonPress} title="Disabled" size="md"/>
84
+ <Button disabled onPress={buttonPress} title="Disabled" appearance="danger" size="lg"/>
85
+ </Row>
86
+ <Row>
87
+ <Button onPress={buttonPress} title="Default" size="sm" iconNameLeft="general.plus" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
88
+ <Button onPress={buttonPress} title="Default" size="md" iconNameRight="churchCenter.sort" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
89
+ <Button onPress={buttonPress} title="Danger" appearance="danger" size="lg" iconNameLeft="groups.cards" iconNameRight="general.downChevron" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
90
+ </Row>
91
+ <Row>
92
+ <Button loading onPress={buttonPress} title="Default" size="sm"/>
93
+ <Button loading onPress={buttonPress} title="Default" size="md"/>
94
+ <Button loading onPress={buttonPress} title="Danger" appearance="danger" size="lg"/>
95
+ </Row>
96
+ <Row>
97
+ <Button onPress={buttonPress} title="Default" size="sm" variant="outline"/>
98
+ <Button onPress={buttonPress} title="Default" size="md" variant="outline"/>
99
+ <Button onPress={buttonPress} title="Danger" appearance="danger" size="lg" variant="outline"/>
100
+ </Row>
101
+ <Row>
102
+ <Button onPress={buttonPress} title="Default" size="sm" variant="outline" iconNameLeft="general.plus" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
103
+ <Button onPress={buttonPress} title="Default" size="md" variant="outline" iconNameRight="churchCenter.sort" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
104
+ <Button onPress={buttonPress} title="Danger" appearance="danger" size="lg" variant="outline" iconNameLeft="groups.cards" iconNameRight="general.downChevron" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
105
+ </Row>
106
+ <Row>
107
+ <Button disabled onPress={buttonPress} title="Disabled" size="sm" variant="outline" iconNameLeft="general.plus" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
108
+ <Button disabled onPress={buttonPress} title="Disabled" size="md" variant="outline" iconNameRight="churchCenter.sort" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
109
+ <Button disabled onPress={buttonPress} title="Disabled" appearance="danger" size="lg" variant="outline" iconNameLeft="groups.cards" iconNameRight="general.downChevron" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
110
+ </Row>
111
+ <Row>
112
+ <Button loading onPress={buttonPress} title="Default" size="sm" variant="outline" iconNameLeft="general.plus" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
113
+ <Button loading onPress={buttonPress} title="Default" size="md" variant="outline" iconNameRight="churchCenter.sort" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
114
+ <Button loading onPress={buttonPress} title="Danger" appearance="danger" size="lg" variant="outline" iconNameLeft="groups.cards" iconNameRight="general.downChevron" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}/>
115
+ </Row>
116
+ </Group>
117
+ <Group title="TextButton" description="Pressable text with default & danger appearance options. Can be disabled and accept `Text` variance props.">
118
+ <Row>
119
+ <TextButton onPress={buttonPress}>Default</TextButton>
120
+ <TextButton onPress={buttonPress} variant="secondary">
121
+ Default
122
+ </TextButton>
123
+ <TextButton onPress={buttonPress} variant="tertiary">
124
+ Default
125
+ </TextButton>
126
+ <TextButton onPress={buttonPress} variant="footnote">
127
+ Default
128
+ </TextButton>
129
+ </Row>
130
+ <Row>
131
+ <TextButton onPress={buttonPress} appearance="danger">
132
+ Danger
133
+ </TextButton>
134
+ <TextButton onPress={buttonPress} variant="secondary" appearance="danger">
135
+ Danger
136
+ </TextButton>
137
+ <TextButton onPress={buttonPress} variant="tertiary" appearance="danger">
138
+ Danger
139
+ </TextButton>
140
+ <TextButton onPress={buttonPress} variant="footnote" appearance="danger">
141
+ Danger
142
+ </TextButton>
143
+ </Row>
144
+ <Row>
145
+ <TextButton onPress={buttonPress} disabled>
146
+ Disabled
147
+ </TextButton>
148
+ <TextButton onPress={buttonPress} variant="secondary" disabled>
149
+ Disabled
150
+ </TextButton>
151
+ <TextButton onPress={buttonPress} variant="tertiary" disabled>
152
+ Disabled
153
+ </TextButton>
154
+ <TextButton onPress={buttonPress} variant="footnote" disabled>
155
+ Disabled
156
+ </TextButton>
157
+ </Row>
158
+ </Group>
159
+ <Group title="TextInlineButton" description="Supports nesting within `Text`. Temporary component until React Native fixes a layout bug in `Pressable` which used in `TextButton`.">
160
+ <Row style={styles.alignRowLeft}>
161
+ <Text>
162
+ This text is next to{' '}
163
+ <TextInlineButton onPress={buttonPress}>default button text</TextInlineButton> Lorem
164
+ ipsum dolor{' '}
165
+ <TextInlineButton onPress={buttonPress} appearance="danger">
166
+ danger button text
167
+ </TextInlineButton>{' '}
168
+ consectetur{' '}
169
+ <TextInlineButton onPress={buttonPress} disabled>
170
+ disabled button text
171
+ </TextInlineButton>{' '}
172
+ elit.
173
+ </Text>
174
+ <Text variant="secondary">
175
+ This text is next to{' '}
176
+ <TextInlineButton variant="secondary" onPress={buttonPress}>
177
+ default button text
178
+ </TextInlineButton>{' '}
179
+ Lorem ipsum dolor{' '}
180
+ <TextInlineButton variant="secondary" onPress={buttonPress} appearance="danger">
181
+ danger button text
182
+ </TextInlineButton>{' '}
183
+ consectetur{' '}
184
+ <TextInlineButton variant="secondary" onPress={buttonPress} disabled>
185
+ disabled button text
186
+ </TextInlineButton>{' '}
187
+ elit.
188
+ </Text>
189
+ <Text variant="tertiary">
190
+ This text is next to{' '}
191
+ <TextInlineButton variant="tertiary" onPress={buttonPress}>
192
+ default button text
193
+ </TextInlineButton>{' '}
194
+ Lorem ipsum dolor{' '}
195
+ <TextInlineButton variant="tertiary" onPress={buttonPress} appearance="danger">
196
+ danger button text
197
+ </TextInlineButton>{' '}
198
+ consectetur{' '}
199
+ <TextInlineButton variant="tertiary" onPress={buttonPress} disabled>
200
+ disabled button text
201
+ </TextInlineButton>{' '}
202
+ elit.
203
+ </Text>
204
+ <Text variant="footnote">
205
+ This text is next to{' '}
206
+ <TextInlineButton variant="footnote" onPress={buttonPress}>
207
+ default button text
208
+ </TextInlineButton>{' '}
209
+ Lorem ipsum dolor{' '}
210
+ <TextInlineButton variant="footnote" onPress={buttonPress} appearance="danger">
211
+ danger button text
212
+ </TextInlineButton>{' '}
213
+ consectetur{' '}
214
+ <TextInlineButton variant="footnote" onPress={buttonPress} disabled>
215
+ disabled button text
216
+ </TextInlineButton>{' '}
217
+ elit.
218
+ </Text>
219
+ </Row>
220
+ </Group>
221
+ <Group title="Heading" description="Use for headings & titles as it includes the a11y 'header' role. Change the size and style with the h1-h4 variants.">
222
+ <Row>
223
+ <Heading>Heading 1</Heading>
224
+ <Heading variant="h2">Heading 2</Heading>
225
+ <Heading variant="h3">Heading 3</Heading>
226
+ <Heading variant="h4">Heading 4</Heading>
227
+ </Row>
228
+ </Group>
229
+ <Group title="Text" description="Use for body copy and supporting text.">
230
+ <Row>
231
+ <Text>Plain text</Text>
232
+ <Text variant="secondary">Secondary</Text>
233
+ <Text variant="tertiary">Tertiary</Text>
234
+ <Text variant="footnote">Footnote</Text>
235
+ </Row>
236
+ </Group>
237
+ </CollapsableSection>
71
238
  </ScrollView>);
72
239
  }
240
+ function CollapsableSection({ children, title, isLast = false }) {
241
+ const styles = useStyles();
242
+ const { colors } = useTheme();
243
+ const [collapsed, setCollapsed] = useState(true);
244
+ return (<View style={[styles.section, styles.sectionBorderTop, isLast && styles.sectionBorderBottom]}>
245
+ <Pressable onPress={() => setCollapsed(!collapsed)} style={({ pressed }) => [styles.sectionHeader, pressed && platformPressedOpacityStyle]} android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}>
246
+ <Heading>{title}</Heading>
247
+ <Icon name={collapsed ? 'general.plus' : 'general.minus'} size={16}/>
248
+ </Pressable>
249
+ {!collapsed && <View style={styles.sectionChildren}>{children}</View>}
250
+ </View>);
251
+ }
252
+ function Group({ title, description, children }) {
253
+ const styles = useStyles();
254
+ return (<View style={styles.group}>
255
+ <View style={styles.groupHeading}>
256
+ <Heading variant="h3">{title}</Heading>
257
+ {description && <Text variant="footnote">{description}</Text>}
258
+ </View>
259
+ {children}
260
+ </View>);
261
+ }
262
+ function Row({ children, style }) {
263
+ const styles = useStyles();
264
+ return <View style={[styles.row, style]}>{children}</View>;
265
+ }
73
266
  const useStyles = () => {
74
267
  const { colors } = useTheme();
75
268
  return StyleSheet.create({
76
- scrollView: { flex: 1, backgroundColor: colors.fillColorNeutral100Inverted },
77
- container: { gap: space(2), padding: space(3) },
269
+ scrollView: {
270
+ flex: 1,
271
+ backgroundColor: colors.fillColorNeutral100Inverted,
272
+ },
273
+ container: {
274
+ padding: space(3),
275
+ },
78
276
  listItem: { color: colors.fillColorNeutral020 },
277
+ section: {
278
+ gap: space(1),
279
+ borderColor: colors.fillColorNeutral020,
280
+ },
281
+ sectionBorderTop: {
282
+ borderTopWidth: 1,
283
+ },
284
+ sectionBorderBottom: {
285
+ borderBottomWidth: 1,
286
+ },
287
+ sectionHeader: {
288
+ flexDirection: 'row',
289
+ justifyContent: 'space-between',
290
+ alignItems: 'center',
291
+ paddingVertical: space(3),
292
+ },
293
+ sectionChildren: {
294
+ paddingBottom: space(3),
295
+ gap: space(6),
296
+ },
79
297
  row: {
80
298
  gap: space(2),
81
299
  flexDirection: 'row',
@@ -83,7 +301,15 @@ const useStyles = () => {
83
301
  justifyContent: 'center',
84
302
  flexWrap: 'wrap',
85
303
  },
86
- column: { gap: space(4) },
304
+ alignRowLeft: {
305
+ justifyContent: 'flex-start',
306
+ },
307
+ group: {
308
+ gap: space(3),
309
+ },
310
+ groupHeading: {
311
+ gap: space(1),
312
+ },
87
313
  spinnerContainer: {
88
314
  height: space(2.5),
89
315
  },
@@ -1 +1 @@
1
- {"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/screens/display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAChG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,MAAM,GAAG,GAAG;IACV,KAAK,EAAE,uCAAuC;IAC9C,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,kCAAkC;IAC1C,eAAe,EAAE,kEAAkE;IACnF,WAAW,EAAE,CAAC,kCAAkC,EAAE,kCAAkC,CAAC;IACrF,aAAa,EAAE;QACb,kCAAkC;QAClC,kCAAkC;QAClC,kCAAkC;KACnC;IACD,YAAY,EAAE;QACZ,kCAAkC;QAClC,kCAAkC;QAClC,kCAAkC;QAClC,kCAAkC;KACnC;CACF,CAAA;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAC5E;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CACzB;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,C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EAAE;YAChB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;SACnB;QACD,KAAK,EAAE;YACL,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,yBAAyB;SACxC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { useTheme } from '../hooks'\nimport { Avatar, AvatarGroup, Heading, Icon, Image, Spinner, Text } from '../components/display'\nimport { space } from '../utils/space'\n\nconst URL = {\n image: 'https://picsum.photos/seed/picsum/200',\n broken: 'https://broken.url',\n avatar: 'https://i.pravatar.cc/200?img=22',\n avatar_fallback: 'https://avatars.planningcenteronline.com/uploads/initials/PR.png',\n two_avatars: ['https://i.pravatar.cc/200?img=22', 'https://i.pravatar.cc/200?img=23'],\n three_avatars: [\n 'https://i.pravatar.cc/200?img=22',\n 'https://i.pravatar.cc/200?img=23',\n 'https://i.pravatar.cc/200?img=24',\n ],\n four_avatars: [\n 'https://i.pravatar.cc/200?img=30',\n 'https://i.pravatar.cc/200?img=29',\n 'https://i.pravatar.cc/200?img=28',\n 'https://i.pravatar.cc/200?img=27',\n ],\n}\n\nexport function DisplayScreen() {\n const styles = useStyles()\n\n return (\n <ScrollView contentContainerStyle={styles.container} style={styles.scrollView}>\n <View style={styles.column}>\n <View style={[styles.row, styles.spinnerContainer]}>\n <Spinner size={24} />\n </View>\n <View style={styles.row}>\n <Image source={{ uri: URL.broken }} style={styles.image} />\n <Image source={{ uri: URL.image }} style={styles.image} />\n </View>\n <View style={styles.row}>\n <Avatar sourceUri={URL.broken} />\n <Avatar size=\"md\" sourceUri={URL.avatar_fallback} />\n <Avatar sourceUri={URL.avatar} />\n </View>\n <View style={styles.row}>\n <Avatar presence=\"offline\" sourceUri={URL.broken} />\n <Avatar presence=\"online\" size=\"md\" sourceUri={URL.avatar_fallback} />\n <Avatar presence=\"offline\" sourceUri={URL.avatar} />\n </View>\n <View style={styles.row}>\n <AvatarGroup sourceUris={[URL.broken]} />\n <AvatarGroup sourceUris={[URL.broken, URL.broken, ...URL.two_avatars]} />\n <AvatarGroup sourceUris={[URL.avatar]} />\n <AvatarGroup sourceUris={URL.two_avatars} />\n <AvatarGroup sourceUris={URL.three_avatars} />\n <AvatarGroup sourceUris={URL.four_avatars} />\n </View>\n <View style={styles.row}>\n <Icon name=\"missingIcon\" size={20} />\n <Icon name=\"general.textMessage\" size={20} />\n <Icon name=\"churchCenter.sort\" style={styles.icon} />\n </View>\n <View style={styles.row}>\n <Text>Plain text</Text>\n <Text variant=\"secondary\">Secondary</Text>\n <Text variant=\"tertiary\">Tertiary</Text>\n <Text variant=\"footnote\">Footnote</Text>\n </View>\n <View style={styles.row}>\n <Heading>Heading 1</Heading>\n <Heading variant=\"h2\">Heading 2</Heading>\n <Heading variant=\"h3\">Heading 3</Heading>\n <Heading variant=\"h4\">Heading 4</Heading>\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n scrollView: { flex: 1, backgroundColor: colors.fillColorNeutral100Inverted },\n container: { gap: space(2), padding: space(3) },\n listItem: { color: colors.fillColorNeutral020 },\n row: {\n gap: space(2),\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n flexWrap: 'wrap',\n },\n column: { gap: space(4) },\n spinnerContainer: {\n height: space(2.5),\n },\n image: {\n width: 100,\n height: 100,\n },\n icon: {\n fontSize: 20,\n color: colors.iconColorDefaultSecondary,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/screens/display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,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AAU,EAAE,QAAQ;YACpB,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;SAC1B;QACD,eAAe,EAAE;YACf,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;YACvB,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;SACd;QACD,GAAG,EAAE;YACH,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;YACb,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,QAAQ,EAAE,MAAM;SACjB;QACD,YAAY,EAAE;YACZ,cAAc,EAAE,YAAY;SAC7B;QACD,KAAK,EAAE;YACL,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;SACd;QACD,YAAY,EAAE;YACZ,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;SACd;QACD,gBAAgB,EAAE;YAChB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;SACnB;QACD,KAAK,EAAE;YACL,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,yBAAyB;SACxC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useState } from 'react'\nimport { Alert, Pressable, ScrollView, StyleSheet, View } from 'react-native'\nimport type { ViewStyle } from 'react-native'\nimport { useTheme } from '../hooks'\nimport {\n Avatar,\n AvatarGroup,\n Button,\n Heading,\n Icon,\n Image,\n Spinner,\n Text,\n TextButton,\n TextInlineButton,\n} from '../components/display'\nimport { space, MAX_FONT_SIZE_MULTIPLIER, platformPressedOpacityStyle } from '../utils'\n\nconst URL = {\n image: 'https://picsum.photos/seed/picsum/200',\n broken: 'https://broken.url',\n avatar: 'https://i.pravatar.cc/200?img=22',\n avatar_fallback: 'https://avatars.planningcenteronline.com/uploads/initials/PR.png',\n two_avatars: ['https://i.pravatar.cc/200?img=22', 'https://i.pravatar.cc/200?img=23'],\n three_avatars: [\n 'https://i.pravatar.cc/200?img=22',\n 'https://i.pravatar.cc/200?img=23',\n 'https://i.pravatar.cc/200?img=24',\n ],\n four_avatars: [\n 'https://i.pravatar.cc/200?img=30',\n 'https://i.pravatar.cc/200?img=29',\n 'https://i.pravatar.cc/200?img=28',\n 'https://i.pravatar.cc/200?img=27',\n ],\n}\n\nconst buttonPress = () => Alert.alert('Button clicked')\n\nexport function DisplayScreen() {\n const styles = useStyles()\n\n return (\n <ScrollView contentContainerStyle={styles.container} style={styles.scrollView}>\n <CollapsableSection title=\"Molecules\">\n <Row>\n <Text>🚧 Coming soon! 🚧</Text>\n </Row>\n </CollapsableSection>\n <CollapsableSection title=\"Atoms\" isLast>\n <Group\n title=\"Spinner\"\n description=\"Loading indicators that can be used within or close to atomic components. Not intended for full-screen loading.\"\n >\n <Row style={styles.spinnerContainer}>\n <Spinner size={24} />\n </Row>\n </Group>\n <Group\n title=\"Image\"\n description=\"Foundational way of displaying images. Loading or broken images will fallback to show a spinner. Hide decortive images from screen readers with `alt=''`.\"\n >\n <Row>\n <Image source={{ uri: URL.broken }} style={styles.image} alt=\"Mountain sunrise\" />\n <Image source={{ uri: URL.image }} style={styles.image} alt=\"Mountain sunrise\" />\n <Image source={{ uri: URL.image }} style={styles.image} alt=\"\" />\n </Row>\n </Group>\n <Group\n title=\"Avatar\"\n description='Displays the profile image for a user in different sizes and has a loading fallback. Can optionally show an online/offline \"presence\" indicator.'\n >\n <Row>\n <Avatar sourceUri={URL.broken} />\n <Avatar size=\"md\" sourceUri={URL.avatar_fallback} />\n <Avatar sourceUri={URL.avatar} />\n </Row>\n <Row>\n <Avatar presence=\"offline\" sourceUri={URL.broken} />\n <Avatar presence=\"online\" size=\"md\" sourceUri={URL.avatar_fallback} />\n <Avatar presence=\"offline\" sourceUri={URL.avatar} />\n </Row>\n </Group>\n <Group\n title=\"AvatarGroup\"\n description=\"Shows 1-4 images in a grid at different sizes. Loading fallback shows until all images successfully load.\"\n >\n <Row>\n <AvatarGroup sourceUris={[URL.broken]} />\n <AvatarGroup sourceUris={[URL.broken, URL.broken, ...URL.two_avatars]} />\n <AvatarGroup sourceUris={[URL.avatar]} />\n <AvatarGroup sourceUris={URL.two_avatars} />\n <AvatarGroup sourceUris={URL.three_avatars} />\n <AvatarGroup sourceUris={URL.four_avatars} />\n </Row>\n </Group>\n <Group\n title=\"Icon\"\n description=\"Displays any icon from @planningcenter/icons. Missing icons will fallback to a grey circle. Styling with `fontSize` will allow it to scale with the device's text a11y size.\"\n >\n <Row>\n <Icon name=\"missingIcon\" size={20} />\n <Icon name=\"general.textMessage\" size={20} />\n <Icon name=\"churchCenter.sort\" style={styles.icon} />\n </Row>\n </Group>\n <Group\n title=\"Button\"\n description=\"Feature fill and outline variants for primary and danger usecases, along with disabled & loading states. Optionally shows icons to the left and right of the text.\"\n >\n <Row>\n <Button onPress={buttonPress} title=\"Default\" size=\"sm\" />\n <Button onPress={buttonPress} title=\"Default\" size=\"md\" />\n <Button onPress={buttonPress} title=\"Danger\" appearance=\"danger\" size=\"lg\" />\n </Row>\n <Row>\n <Button disabled onPress={buttonPress} title=\"Disabled\" size=\"sm\" />\n <Button disabled onPress={buttonPress} title=\"Disabled\" size=\"md\" />\n <Button disabled onPress={buttonPress} title=\"Disabled\" appearance=\"danger\" size=\"lg\" />\n </Row>\n <Row>\n <Button\n onPress={buttonPress}\n title=\"Default\"\n size=\"sm\"\n iconNameLeft=\"general.plus\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Button\n onPress={buttonPress}\n title=\"Default\"\n size=\"md\"\n iconNameRight=\"churchCenter.sort\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Button\n onPress={buttonPress}\n title=\"Danger\"\n appearance=\"danger\"\n size=\"lg\"\n iconNameLeft=\"groups.cards\"\n iconNameRight=\"general.downChevron\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n </Row>\n <Row>\n <Button loading onPress={buttonPress} title=\"Default\" size=\"sm\" />\n <Button loading onPress={buttonPress} title=\"Default\" size=\"md\" />\n <Button loading onPress={buttonPress} title=\"Danger\" appearance=\"danger\" size=\"lg\" />\n </Row>\n <Row>\n <Button onPress={buttonPress} title=\"Default\" size=\"sm\" variant=\"outline\" />\n <Button onPress={buttonPress} title=\"Default\" size=\"md\" variant=\"outline\" />\n <Button\n onPress={buttonPress}\n title=\"Danger\"\n appearance=\"danger\"\n size=\"lg\"\n variant=\"outline\"\n />\n </Row>\n <Row>\n <Button\n onPress={buttonPress}\n title=\"Default\"\n size=\"sm\"\n variant=\"outline\"\n iconNameLeft=\"general.plus\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Button\n onPress={buttonPress}\n title=\"Default\"\n size=\"md\"\n variant=\"outline\"\n iconNameRight=\"churchCenter.sort\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Button\n onPress={buttonPress}\n title=\"Danger\"\n appearance=\"danger\"\n size=\"lg\"\n variant=\"outline\"\n iconNameLeft=\"groups.cards\"\n iconNameRight=\"general.downChevron\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n </Row>\n <Row>\n <Button\n disabled\n onPress={buttonPress}\n title=\"Disabled\"\n size=\"sm\"\n variant=\"outline\"\n iconNameLeft=\"general.plus\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Button\n disabled\n onPress={buttonPress}\n title=\"Disabled\"\n size=\"md\"\n variant=\"outline\"\n iconNameRight=\"churchCenter.sort\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Button\n disabled\n onPress={buttonPress}\n title=\"Disabled\"\n appearance=\"danger\"\n size=\"lg\"\n variant=\"outline\"\n iconNameLeft=\"groups.cards\"\n iconNameRight=\"general.downChevron\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n </Row>\n <Row>\n <Button\n loading\n onPress={buttonPress}\n title=\"Default\"\n size=\"sm\"\n variant=\"outline\"\n iconNameLeft=\"general.plus\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Button\n loading\n onPress={buttonPress}\n title=\"Default\"\n size=\"md\"\n variant=\"outline\"\n iconNameRight=\"churchCenter.sort\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Button\n loading\n onPress={buttonPress}\n title=\"Danger\"\n appearance=\"danger\"\n size=\"lg\"\n variant=\"outline\"\n iconNameLeft=\"groups.cards\"\n iconNameRight=\"general.downChevron\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n </Row>\n </Group>\n <Group\n title=\"TextButton\"\n description=\"Pressable text with default & danger appearance options. Can be disabled and accept `Text` variance props.\"\n >\n <Row>\n <TextButton onPress={buttonPress}>Default</TextButton>\n <TextButton onPress={buttonPress} variant=\"secondary\">\n Default\n </TextButton>\n <TextButton onPress={buttonPress} variant=\"tertiary\">\n Default\n </TextButton>\n <TextButton onPress={buttonPress} variant=\"footnote\">\n Default\n </TextButton>\n </Row>\n <Row>\n <TextButton onPress={buttonPress} appearance=\"danger\">\n Danger\n </TextButton>\n <TextButton onPress={buttonPress} variant=\"secondary\" appearance=\"danger\">\n Danger\n </TextButton>\n <TextButton onPress={buttonPress} variant=\"tertiary\" appearance=\"danger\">\n Danger\n </TextButton>\n <TextButton onPress={buttonPress} variant=\"footnote\" appearance=\"danger\">\n Danger\n </TextButton>\n </Row>\n <Row>\n <TextButton onPress={buttonPress} disabled>\n Disabled\n </TextButton>\n <TextButton onPress={buttonPress} variant=\"secondary\" disabled>\n Disabled\n </TextButton>\n <TextButton onPress={buttonPress} variant=\"tertiary\" disabled>\n Disabled\n </TextButton>\n <TextButton onPress={buttonPress} variant=\"footnote\" disabled>\n Disabled\n </TextButton>\n </Row>\n </Group>\n <Group\n title=\"TextInlineButton\"\n description=\"Supports nesting within `Text`. Temporary component until React Native fixes a layout bug in `Pressable` which used in `TextButton`.\"\n >\n <Row style={styles.alignRowLeft}>\n <Text>\n This text is next to{' '}\n <TextInlineButton onPress={buttonPress}>default button text</TextInlineButton> Lorem\n ipsum dolor{' '}\n <TextInlineButton onPress={buttonPress} appearance=\"danger\">\n danger button text\n </TextInlineButton>{' '}\n consectetur{' '}\n <TextInlineButton onPress={buttonPress} disabled>\n disabled button text\n </TextInlineButton>{' '}\n elit.\n </Text>\n <Text variant=\"secondary\">\n This text is next to{' '}\n <TextInlineButton variant=\"secondary\" onPress={buttonPress}>\n default button text\n </TextInlineButton>{' '}\n Lorem ipsum dolor{' '}\n <TextInlineButton variant=\"secondary\" onPress={buttonPress} appearance=\"danger\">\n danger button text\n </TextInlineButton>{' '}\n consectetur{' '}\n <TextInlineButton variant=\"secondary\" onPress={buttonPress} disabled>\n disabled button text\n </TextInlineButton>{' '}\n elit.\n </Text>\n <Text variant=\"tertiary\">\n This text is next to{' '}\n <TextInlineButton variant=\"tertiary\" onPress={buttonPress}>\n default button text\n </TextInlineButton>{' '}\n Lorem ipsum dolor{' '}\n <TextInlineButton variant=\"tertiary\" onPress={buttonPress} appearance=\"danger\">\n danger button text\n </TextInlineButton>{' '}\n consectetur{' '}\n <TextInlineButton variant=\"tertiary\" onPress={buttonPress} disabled>\n disabled button text\n </TextInlineButton>{' '}\n elit.\n </Text>\n <Text variant=\"footnote\">\n This text is next to{' '}\n <TextInlineButton variant=\"footnote\" onPress={buttonPress}>\n default button text\n </TextInlineButton>{' '}\n Lorem ipsum dolor{' '}\n <TextInlineButton variant=\"footnote\" onPress={buttonPress} appearance=\"danger\">\n danger button text\n </TextInlineButton>{' '}\n consectetur{' '}\n <TextInlineButton variant=\"footnote\" onPress={buttonPress} disabled>\n disabled button text\n </TextInlineButton>{' '}\n elit.\n </Text>\n </Row>\n </Group>\n <Group\n title=\"Heading\"\n description=\"Use for headings & titles as it includes the a11y 'header' role. Change the size and style with the h1-h4 variants.\"\n >\n <Row>\n <Heading>Heading 1</Heading>\n <Heading variant=\"h2\">Heading 2</Heading>\n <Heading variant=\"h3\">Heading 3</Heading>\n <Heading variant=\"h4\">Heading 4</Heading>\n </Row>\n </Group>\n <Group title=\"Text\" description=\"Use for body copy and supporting text.\">\n <Row>\n <Text>Plain text</Text>\n <Text variant=\"secondary\">Secondary</Text>\n <Text variant=\"tertiary\">Tertiary</Text>\n <Text variant=\"footnote\">Footnote</Text>\n </Row>\n </Group>\n </CollapsableSection>\n </ScrollView>\n )\n}\n\ninterface CollapsableSectionProps {\n children: React.ReactNode\n title: string\n isLast?: boolean\n}\n\nfunction CollapsableSection({ children, title, isLast = false }: CollapsableSectionProps) {\n const styles = useStyles()\n const { colors } = useTheme()\n const [collapsed, setCollapsed] = useState(true)\n\n return (\n <View style={[styles.section, styles.sectionBorderTop, isLast && styles.sectionBorderBottom]}>\n <Pressable\n onPress={() => setCollapsed(!collapsed)}\n style={({ pressed }) => [styles.sectionHeader, pressed && platformPressedOpacityStyle]}\n android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}\n >\n <Heading>{title}</Heading>\n <Icon name={collapsed ? 'general.plus' : 'general.minus'} size={16} />\n </Pressable>\n {!collapsed && <View style={styles.sectionChildren}>{children}</View>}\n </View>\n )\n}\n\ninterface GroupProps {\n title: string\n description?: string\n children: React.ReactNode\n}\n\nfunction Group({ title, description, children }: GroupProps) {\n const styles = useStyles()\n return (\n <View style={styles.group}>\n <View style={styles.groupHeading}>\n <Heading variant=\"h3\">{title}</Heading>\n {description && <Text variant=\"footnote\">{description}</Text>}\n </View>\n {children}\n </View>\n )\n}\n\ninterface RowProps {\n children: React.ReactNode\n style?: ViewStyle\n}\n\nfunction Row({ children, style }: RowProps) {\n const styles = useStyles()\n return <View style={[styles.row, style]}>{children}</View>\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n scrollView: {\n flex: 1,\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n container: {\n padding: space(3),\n },\n listItem: { color: colors.fillColorNeutral020 },\n section: {\n gap: space(1),\n borderColor: colors.fillColorNeutral020,\n },\n sectionBorderTop: {\n borderTopWidth: 1,\n },\n sectionBorderBottom: {\n borderBottomWidth: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingVertical: space(3),\n },\n sectionChildren: {\n paddingBottom: space(3),\n gap: space(6),\n },\n row: {\n gap: space(2),\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n flexWrap: 'wrap',\n },\n alignRowLeft: {\n justifyContent: 'flex-start',\n },\n group: {\n gap: space(3),\n },\n groupHeading: {\n gap: space(1),\n },\n spinnerContainer: {\n height: space(2.5),\n },\n image: {\n width: 100,\n height: 100,\n },\n icon: {\n fontSize: 20,\n color: colors.iconColorDefaultSecondary,\n },\n })\n}\n"]}
@@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native';
4
4
  export function NotFound() {
5
5
  return (<View style={styles.container}>
6
6
  <Text>404</Text>
7
- <Button screen="Conversations">Go to Home</Button>
7
+ <Button href="Conversations">Go to Home</Button>
8
8
  </View>);
9
9
  }
10
10
  const styles = StyleSheet.create({
@@ -1 +1 @@
1
- {"version":3,"file":"not_found.js","sourceRoot":"","sources":["../../src/screens/not_found.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,UAAU,QAAQ;IACtB,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CACf;MAAA,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CACnD;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,EAAE;KACR;CACF,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Button, Text } from '@react-navigation/elements'\nimport { StyleSheet, View } from 'react-native'\n\nexport function NotFound() {\n return (\n <View style={styles.container}>\n <Text>404</Text>\n <Button screen=\"Conversations\">Go to Home</Button>\n </View>\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n gap: 10,\n },\n})\n"]}
1
+ {"version":3,"file":"not_found.js","sourceRoot":"","sources":["../../src/screens/not_found.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,UAAU,QAAQ;IACtB,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CACf;MAAA,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CACjD;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,EAAE;KACR;CACF,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Button, Text } from '@react-navigation/elements'\nimport { StyleSheet, View } from 'react-native'\n\nexport function NotFound() {\n return (\n <View style={styles.container}>\n <Text>404</Text>\n <Button href=\"Conversations\">Go to Home</Button>\n </View>\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n gap: 10,\n },\n})\n"]}
@@ -0,0 +1,23 @@
1
+ export interface ResourceObject {
2
+ id: string;
3
+ type: string;
4
+ }
5
+ export type ApiResource<Type = ResourceObject> = {
6
+ data: Type;
7
+ links: Record<string, string>;
8
+ meta: Record<string, unknown>;
9
+ };
10
+ export type ApiCollection<Type = ResourceObject> = {
11
+ data: Type[];
12
+ links: Record<string, string>;
13
+ meta: CollectionMeta;
14
+ };
15
+ interface CollectionMeta {
16
+ count: number;
17
+ totalCount: number;
18
+ next?: Record<string, unknown>;
19
+ parent?: ResourceObject;
20
+ [attributeName: string]: unknown;
21
+ }
22
+ export {};
23
+ //# sourceMappingURL=api_primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api_primitives.d.ts","sourceRoot":"","sources":["../../src/types/api_primitives.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,WAAW,CAAC,IAAI,GAAG,cAAc,IAAI;IAC/C,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,aAAa,CAAC,IAAI,GAAG,cAAc,IAAI;IACjD,IAAI,EAAE,IAAI,EAAE,CAAA;IACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,IAAI,EAAE,cAAc,CAAA;CACrB,CAAA;AAED,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CACjC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=api_primitives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api_primitives.js","sourceRoot":"","sources":["../../src/types/api_primitives.ts"],"names":[],"mappings":"","sourcesContent":["export interface ResourceObject {\n id: string\n type: string\n}\n\nexport type ApiResource<Type = ResourceObject> = {\n data: Type\n links: Record<string, string>\n meta: Record<string, unknown>\n}\n\nexport type ApiCollection<Type = ResourceObject> = {\n data: Type[]\n links: Record<string, string>\n meta: CollectionMeta\n}\n\ninterface CollectionMeta {\n count: number\n totalCount: number\n next?: Record<string, unknown>\n parent?: ResourceObject\n [attributeName: string]: unknown\n}\n"]}