@planningcenter/chat-react-native 3.1.0-rc.8 → 3.1.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 (263) hide show
  1. package/build/components/conversation/attachments/attachment_card.d.ts +9 -0
  2. package/build/components/conversation/attachments/attachment_card.d.ts.map +1 -0
  3. package/build/components/conversation/attachments/attachment_card.js +35 -0
  4. package/build/components/conversation/attachments/attachment_card.js.map +1 -0
  5. package/build/components/conversation/attachments/audio_attachment.d.ts +6 -0
  6. package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -0
  7. package/build/components/conversation/attachments/audio_attachment.js +84 -0
  8. package/build/components/conversation/attachments/audio_attachment.js.map +1 -0
  9. package/build/components/conversation/attachments/constants.d.ts +3 -0
  10. package/build/components/conversation/attachments/constants.d.ts.map +1 -0
  11. package/build/components/conversation/attachments/constants.js +4 -0
  12. package/build/components/conversation/attachments/constants.js.map +1 -0
  13. package/build/components/conversation/attachments/download_attachment_button.d.ts +9 -0
  14. package/build/components/conversation/attachments/download_attachment_button.d.ts.map +1 -0
  15. package/build/components/conversation/attachments/download_attachment_button.js +29 -0
  16. package/build/components/conversation/attachments/download_attachment_button.js.map +1 -0
  17. package/build/components/conversation/attachments/expanded_link.d.ts +5 -0
  18. package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -0
  19. package/build/components/conversation/attachments/expanded_link.js +44 -0
  20. package/build/components/conversation/attachments/expanded_link.js.map +1 -0
  21. package/build/components/conversation/attachments/generic_file_attachment.d.ts +7 -0
  22. package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -0
  23. package/build/components/conversation/attachments/generic_file_attachment.js +63 -0
  24. package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -0
  25. package/build/components/conversation/attachments/giphy_attachment.d.ts +6 -0
  26. package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -0
  27. package/build/components/conversation/attachments/giphy_attachment.js +42 -0
  28. package/build/components/conversation/attachments/giphy_attachment.js.map +1 -0
  29. package/build/components/conversation/attachments/image_attachment.d.ts +5 -0
  30. package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -0
  31. package/build/components/conversation/attachments/image_attachment.js +24 -0
  32. package/build/components/conversation/attachments/image_attachment.js.map +1 -0
  33. package/build/components/conversation/attachments/video_attachment.d.ts +6 -0
  34. package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -0
  35. package/build/components/conversation/attachments/video_attachment.js +64 -0
  36. package/build/components/conversation/attachments/video_attachment.js.map +1 -0
  37. package/build/components/conversation/message.d.ts +1 -1
  38. package/build/components/conversation/message.d.ts.map +1 -1
  39. package/build/components/conversation/message.js +13 -7
  40. package/build/components/conversation/message.js.map +1 -1
  41. package/build/components/conversation/message_attachments.d.ts +6 -0
  42. package/build/components/conversation/message_attachments.d.ts.map +1 -0
  43. package/build/components/conversation/message_attachments.js +52 -0
  44. package/build/components/conversation/message_attachments.js.map +1 -0
  45. package/build/components/conversation/message_markdown.d.ts +7 -0
  46. package/build/components/conversation/message_markdown.d.ts.map +1 -0
  47. package/build/components/conversation/message_markdown.js +38 -0
  48. package/build/components/conversation/message_markdown.js.map +1 -0
  49. package/build/components/conversations/conversation_preview.d.ts +9 -0
  50. package/build/components/conversations/conversation_preview.d.ts.map +1 -0
  51. package/build/components/conversations/conversation_preview.js +58 -0
  52. package/build/components/conversations/conversation_preview.js.map +1 -0
  53. package/build/components/conversations/conversations.d.ts +8 -0
  54. package/build/components/conversations/conversations.d.ts.map +1 -0
  55. package/build/components/conversations/conversations.js +40 -0
  56. package/build/components/conversations/conversations.js.map +1 -0
  57. package/build/components/conversations/unread_count_badge.d.ts +5 -0
  58. package/build/components/conversations/unread_count_badge.d.ts.map +1 -0
  59. package/build/components/conversations/unread_count_badge.js +33 -0
  60. package/build/components/conversations/unread_count_badge.js.map +1 -0
  61. package/build/components/display/badge.d.ts +9 -1
  62. package/build/components/display/badge.d.ts.map +1 -1
  63. package/build/components/display/badge.js +22 -10
  64. package/build/components/display/badge.js.map +1 -1
  65. package/build/components/display/button.d.ts +1 -1
  66. package/build/components/display/button.d.ts.map +1 -1
  67. package/build/components/display/button.js.map +1 -1
  68. package/build/components/display/child_notice.js +2 -2
  69. package/build/components/display/child_notice.js.map +1 -1
  70. package/build/components/display/icon.d.ts.map +1 -1
  71. package/build/components/display/icon.js +10 -8
  72. package/build/components/display/icon.js.map +1 -1
  73. package/build/components/display/text.js +2 -8
  74. package/build/components/display/text.js.map +1 -1
  75. package/build/components/display/text_button.d.ts +5 -1
  76. package/build/components/display/text_button.d.ts.map +1 -1
  77. package/build/components/display/text_button.js +7 -3
  78. package/build/components/display/text_button.js.map +1 -1
  79. package/build/components/index.d.ts +1 -1
  80. package/build/components/index.d.ts.map +1 -1
  81. package/build/components/index.js +1 -1
  82. package/build/components/index.js.map +1 -1
  83. package/build/components/page/error_boundary.d.ts +1 -1
  84. package/build/hooks/use_api.d.ts +6 -4
  85. package/build/hooks/use_api.d.ts.map +1 -1
  86. package/build/hooks/use_api.js +5 -2
  87. package/build/hooks/use_api.js.map +1 -1
  88. package/build/hooks/use_api_client.d.ts +1 -2
  89. package/build/hooks/use_api_client.d.ts.map +1 -1
  90. package/build/hooks/use_api_client.js.map +1 -1
  91. package/build/hooks/use_conversation.d.ts +79 -0
  92. package/build/hooks/use_conversation.d.ts.map +1 -1
  93. package/build/hooks/use_conversation.js +63 -2
  94. package/build/hooks/use_conversation.js.map +1 -1
  95. package/build/hooks/use_conversation_jolt_events.js +1 -1
  96. package/build/hooks/use_conversation_jolt_events.js.map +1 -1
  97. package/build/hooks/use_conversation_messages_jolt_events.js +1 -1
  98. package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
  99. package/build/hooks/use_conversations.d.ts +2 -3
  100. package/build/hooks/use_conversations.d.ts.map +1 -1
  101. package/build/hooks/use_conversations.js +3 -29
  102. package/build/hooks/use_conversations.js.map +1 -1
  103. package/build/hooks/use_groups.d.ts +214 -0
  104. package/build/hooks/use_groups.d.ts.map +1 -0
  105. package/build/hooks/use_groups.js +22 -0
  106. package/build/hooks/use_groups.js.map +1 -0
  107. package/build/hooks/use_groups_groups.d.ts +208 -0
  108. package/build/hooks/use_groups_groups.d.ts.map +1 -0
  109. package/build/hooks/use_groups_groups.js +18 -0
  110. package/build/hooks/use_groups_groups.js.map +1 -0
  111. package/build/hooks/use_services_team.d.ts +4 -0
  112. package/build/hooks/use_services_team.d.ts.map +1 -0
  113. package/build/hooks/use_services_team.js +22 -0
  114. package/build/hooks/use_services_team.js.map +1 -0
  115. package/build/hooks/use_suspense_api.d.ts +2 -1
  116. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  117. package/build/hooks/use_suspense_api.js +2 -1
  118. package/build/hooks/use_suspense_api.js.map +1 -1
  119. package/build/hooks/use_teams.d.ts +208 -0
  120. package/build/hooks/use_teams.d.ts.map +1 -0
  121. package/build/hooks/use_teams.js +22 -0
  122. package/build/hooks/use_teams.js.map +1 -0
  123. package/build/navigation/index.d.ts +11 -0
  124. package/build/navigation/index.d.ts.map +1 -1
  125. package/build/navigation/index.js +5 -0
  126. package/build/navigation/index.js.map +1 -1
  127. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  128. package/build/screens/conversation_details_screen.js +176 -56
  129. package/build/screens/conversation_details_screen.js.map +1 -1
  130. package/build/screens/conversation_filters_screen.d.ts +13 -0
  131. package/build/screens/conversation_filters_screen.d.ts.map +1 -0
  132. package/build/screens/conversation_filters_screen.js +346 -0
  133. package/build/screens/conversation_filters_screen.js.map +1 -0
  134. package/build/screens/conversation_screen.js +10 -4
  135. package/build/screens/conversation_screen.js.map +1 -1
  136. package/build/screens/conversations_screen.d.ts +4 -2
  137. package/build/screens/conversations_screen.d.ts.map +1 -1
  138. package/build/screens/conversations_screen.js +139 -11
  139. package/build/screens/conversations_screen.js.map +1 -1
  140. package/build/screens/create/conversation_select_recipients_screen.d.ts.map +1 -1
  141. package/build/screens/create/conversation_select_recipients_screen.js +3 -11
  142. package/build/screens/create/conversation_select_recipients_screen.js.map +1 -1
  143. package/build/types/resources/group_resource.d.ts +4 -2
  144. package/build/types/resources/group_resource.d.ts.map +1 -1
  145. package/build/types/resources/group_resource.js.map +1 -1
  146. package/build/types/resources/index.d.ts +1 -0
  147. package/build/types/resources/index.d.ts.map +1 -1
  148. package/build/types/resources/index.js +1 -0
  149. package/build/types/resources/index.js.map +1 -1
  150. package/build/types/resources/member_ability.d.ts +1 -0
  151. package/build/types/resources/member_ability.d.ts.map +1 -1
  152. package/build/types/resources/member_ability.js.map +1 -1
  153. package/build/types/resources/services/index.d.ts +2 -0
  154. package/build/types/resources/services/index.d.ts.map +1 -0
  155. package/build/types/resources/services/index.js +2 -0
  156. package/build/types/resources/services/index.js.map +1 -0
  157. package/build/types/resources/services/team_resource.d.ts +48 -0
  158. package/build/types/resources/services/team_resource.d.ts.map +1 -0
  159. package/build/types/resources/services/team_resource.js +7 -0
  160. package/build/types/resources/services/team_resource.js.map +1 -0
  161. package/build/utils/index.d.ts +1 -0
  162. package/build/utils/index.d.ts.map +1 -1
  163. package/build/utils/index.js +1 -0
  164. package/build/utils/index.js.map +1 -1
  165. package/build/utils/native_adapters/audio.d.ts +13 -0
  166. package/build/utils/native_adapters/audio.d.ts.map +1 -0
  167. package/build/utils/native_adapters/audio.js +7 -0
  168. package/build/utils/native_adapters/audio.js.map +1 -0
  169. package/build/utils/native_adapters/configuration.d.ts +7 -1
  170. package/build/utils/native_adapters/configuration.d.ts.map +1 -1
  171. package/build/utils/native_adapters/configuration.js +17 -1
  172. package/build/utils/native_adapters/configuration.js.map +1 -1
  173. package/build/utils/native_adapters/index.d.ts +2 -0
  174. package/build/utils/native_adapters/index.d.ts.map +1 -1
  175. package/build/utils/native_adapters/index.js +2 -0
  176. package/build/utils/native_adapters/index.js.map +1 -1
  177. package/build/utils/native_adapters/video.d.ts +25 -0
  178. package/build/utils/native_adapters/video.d.ts.map +1 -0
  179. package/build/utils/native_adapters/video.js +7 -0
  180. package/build/utils/native_adapters/video.js.map +1 -0
  181. package/build/utils/parse_simple_markdown.d.ts +7 -0
  182. package/build/utils/parse_simple_markdown.d.ts.map +1 -0
  183. package/build/utils/parse_simple_markdown.js +32 -0
  184. package/build/utils/parse_simple_markdown.js.map +1 -0
  185. package/build/utils/pluralize.d.ts +2 -0
  186. package/build/utils/pluralize.d.ts.map +1 -0
  187. package/build/utils/pluralize.js +10 -0
  188. package/build/utils/pluralize.js.map +1 -0
  189. package/build/utils/request/conversation.d.ts +10 -0
  190. package/build/utils/request/conversation.d.ts.map +1 -0
  191. package/build/utils/request/conversation.js +32 -0
  192. package/build/utils/request/conversation.js.map +1 -0
  193. package/build/utils/request/messages.d.ts +15 -0
  194. package/build/utils/request/messages.d.ts.map +1 -0
  195. package/build/utils/request/messages.js +22 -0
  196. package/build/utils/request/messages.js.map +1 -0
  197. package/build/utils/theme.d.ts +1 -1
  198. package/build/utils/theme.d.ts.map +1 -1
  199. package/build/utils/theme.js +1 -1
  200. package/build/utils/theme.js.map +1 -1
  201. package/package.json +2 -2
  202. package/src/__tests__/utils/parse_simple_markdown.ts +93 -0
  203. package/src/__tests__/utils/pluralize.tsx +17 -0
  204. package/src/components/conversation/attachments/attachment_card.tsx +46 -0
  205. package/src/components/conversation/attachments/audio_attachment.tsx +102 -0
  206. package/src/components/conversation/attachments/constants.ts +5 -0
  207. package/src/components/conversation/attachments/download_attachment_button.tsx +46 -0
  208. package/src/components/conversation/attachments/expanded_link.tsx +54 -0
  209. package/src/components/conversation/attachments/generic_file_attachment.tsx +75 -0
  210. package/src/components/conversation/attachments/giphy_attachment.tsx +56 -0
  211. package/src/components/conversation/attachments/image_attachment.tsx +31 -0
  212. package/src/components/conversation/attachments/video_attachment.tsx +92 -0
  213. package/src/components/conversation/message.tsx +15 -6
  214. package/src/components/conversation/message_attachments.tsx +61 -0
  215. package/src/components/conversation/message_markdown.tsx +52 -0
  216. package/src/components/conversations/conversation_preview.tsx +84 -0
  217. package/src/components/conversations/conversations.tsx +79 -0
  218. package/src/components/conversations/unread_count_badge.tsx +38 -0
  219. package/src/components/display/badge.tsx +41 -10
  220. package/src/components/display/button.tsx +1 -1
  221. package/src/components/display/child_notice.tsx +2 -2
  222. package/src/components/display/icon.tsx +10 -8
  223. package/src/components/display/text.tsx +1 -7
  224. package/src/components/display/text_button.tsx +12 -2
  225. package/src/components/index.tsx +1 -1
  226. package/src/hooks/use_api.ts +11 -10
  227. package/src/hooks/use_api_client.ts +1 -1
  228. package/src/hooks/use_conversation.ts +69 -2
  229. package/src/hooks/use_conversation_jolt_events.ts +1 -1
  230. package/src/hooks/use_conversation_messages_jolt_events.ts +1 -1
  231. package/src/hooks/use_conversations.ts +3 -31
  232. package/src/hooks/use_groups.ts +31 -0
  233. package/src/hooks/use_groups_groups.ts +20 -0
  234. package/src/hooks/use_services_team.ts +30 -0
  235. package/src/hooks/use_suspense_api.ts +4 -4
  236. package/src/hooks/use_teams.ts +25 -0
  237. package/src/navigation/index.tsx +8 -0
  238. package/src/screens/conversation_details_screen.tsx +284 -108
  239. package/src/screens/conversation_filters_screen.tsx +488 -0
  240. package/src/screens/conversation_screen.tsx +16 -4
  241. package/src/screens/conversations_screen.tsx +210 -13
  242. package/src/screens/create/conversation_select_recipients_screen.tsx +3 -11
  243. package/src/types/resources/group_resource.ts +5 -2
  244. package/src/types/resources/index.ts +1 -0
  245. package/src/types/resources/member_ability.ts +1 -0
  246. package/src/types/resources/services/index.ts +1 -0
  247. package/src/types/resources/services/team_resource.ts +60 -0
  248. package/src/utils/client/types.d.ts +2 -1
  249. package/src/utils/index.ts +1 -0
  250. package/src/utils/native_adapters/audio.ts +15 -0
  251. package/src/utils/native_adapters/configuration.ts +24 -1
  252. package/src/utils/native_adapters/index.ts +2 -0
  253. package/src/utils/native_adapters/video.ts +30 -0
  254. package/src/utils/parse_simple_markdown.ts +40 -0
  255. package/src/utils/pluralize.ts +11 -0
  256. package/src/utils/request/conversation.ts +46 -0
  257. package/src/utils/request/messages.ts +21 -0
  258. package/src/utils/theme.ts +2 -2
  259. package/build/components/conversations.d.ts +0 -3
  260. package/build/components/conversations.d.ts.map +0 -1
  261. package/build/components/conversations.js +0 -100
  262. package/build/components/conversations.js.map +0 -1
  263. package/src/components/conversations.tsx +0 -144
@@ -12,7 +12,7 @@ declare const VARIANTS: {
12
12
  readonly outline: "outline";
13
13
  };
14
14
  type VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS];
15
- interface ButtonProps extends PressableProps {
15
+ export interface ButtonProps extends PressableProps {
16
16
  /**
17
17
  * Specifies whether fonts should be scaled down automatically to fit given style constraints.
18
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/display/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAQ7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAMlE,QAAA,MAAM,KAAK;;;;CAID,CAAA;AAEV,KAAK,SAAS,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAA;AAYnD,QAAA,MAAM,QAAQ;;;CAGJ,CAAA;AAEV,KAAK,YAAY,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAA;AAa5D,UAAU,WAAY,SAAQ,cAAc;IAC1C;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAClC;;OAEG;IACH,iBAAiB,CAAC,EAAE,SAAS,CAAA;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,SAAS,CAAA;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,aAAa,CA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,EAAE,qBAAqB,CAAA;IAClC;;OAEG;IACH,iBAAiB,CAAC,EAAE,SAAS,CAAA;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,SAAS,CAAA;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB;AAED,wBAAgB,MAAM,CAAC,EACrB,oBAA4B,EAC5B,gBAAuB,EACvB,UAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,QAAgB,EAChB,YAAY,EACZ,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,gBAAgB,EAChB,IAAW,EACX,KAAK,EACL,OAAgB,EAChB,GAAG,KAAK,EACT,EAAE,WAAW,qBA4Db"}
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/display/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEhE,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,E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EAAE;YACP,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;SACtC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet, Text, View } from 'react-native'\nimport type { PressableProps, ViewStyle } from 'react-native'\nimport LinearGradient from 'react-native-linear-gradient'\nimport { Icon } from './icon'\nimport { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { platformFontWeightBold, platformPressedOpacityStyle } from '../../utils'\nimport { Spinner } from './spinner'\nimport { getColorKey, useButtonColorOptionMap, useGradientColorMap } from './utils/button_colors'\nimport type { ButtonAppearanceUnion } from './utils/button_colors'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst SIZES = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n} as const\n\ntype SizeUnion = (typeof SIZES)[keyof typeof SIZES]\ntype SizeStyle = Record<\n SizeUnion,\n {\n fontSize: number\n paddingHorizontal: number\n height: number\n borderRadius: number\n gap: number\n }\n>\n\nconst VARIANTS = {\n fill: 'fill',\n outline: 'outline',\n} as const\n\ntype VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]\ntype VariantColors = Record<\n VariantUnion,\n {\n backgroundColor: string\n color: string\n }\n>\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface ButtonProps extends PressableProps {\n /**\n * Specifies whether fonts should be scaled down automatically to fit given style constraints.\n */\n adjustsFontSizeToFit?: boolean\n /**\n * Specifies whether fonts should scale to respect the device's text size accessibility settings. The default is true.\n */\n allowFontScaling?: boolean\n /**\n * Updates the button's colors\n */\n appearance?: ButtonAppearanceUnion\n /**\n * Styles the inner View that wraps the button's content\n */\n buttonInnerStyles?: ViewStyle\n /**\n * Styles the outer LinearGradient that gives the button it's backgrounnd and outline color\n */\n buttonOuterStyles?: ViewStyle\n /**\n * Generates an icon to the left of the button text\n */\n iconNameLeft?: string\n /**\n * Generates an icon to the right of the button text\n */\n iconNameRight?: string\n /**\n * Disables the button and replaces its content with a spinner\n */\n loading?: boolean\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n */\n minimumFontScale?: number\n /**\n * Changes the overall size of the button and its contents\n */\n size?: SizeUnion\n /**\n * Renders as text within the button\n */\n title: string\n /**\n * Fill buttons are visually more propmonitent then outline buttons\n */\n variant?: VariantUnion\n}\n\nexport function Button({\n adjustsFontSizeToFit = false,\n allowFontScaling = true,\n appearance = 'interaction',\n buttonInnerStyles,\n buttonOuterStyles,\n disabled = false,\n iconNameLeft,\n iconNameRight,\n loading,\n maxFontSizeMultiplier,\n minimumFontScale,\n size = 'md',\n title,\n variant = 'fill',\n ...props\n}: ButtonProps) {\n const styles = useStyles({ appearance, disabled, loading, maxFontSizeMultiplier, size, variant })\n const gradientOptionsMap = useGradientColorMap()\n const colorKey = getColorKey({ disabled, loading, appearance })\n\n const textStyles = [styles.text, disabled && styles.textDisabled, loading && styles.iconLoading]\n const iconStyles = [styles.icon, disabled && styles.iconDisabled, loading && styles.textLoading]\n\n const androidRippleColor = useCreateAndroidRippleColor({ color: gradientOptionsMap[colorKey][0] })\n\n return (\n <Pressable\n style={({ pressed }) => [styles.pressable, pressed && platformPressedOpacityStyle]}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n accessibilityState={{ busy: loading }}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n {...props}\n >\n <LinearGradient\n start={{ x: 0.1, y: 0.1 }}\n end={{ x: 0.9, y: 0.9 }}\n colors={gradientOptionsMap[colorKey]}\n style={[styles.colorWrapper, buttonOuterStyles]}\n >\n {loading && (\n <Spinner\n size={styles.spinner.fontSize}\n maxFontSizeMultiplier={maxFontSizeMultiplier || 0}\n />\n )}\n <View style={[styles.innerWrapper, buttonInnerStyles]}>\n {iconNameLeft && (\n <Icon\n name={iconNameLeft}\n style={iconStyles}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n <Text\n allowFontScaling={allowFontScaling}\n minimumFontScale={minimumFontScale}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n numberOfLines={1}\n style={textStyles}\n >\n {title}\n </Text>\n {iconNameRight && (\n <Icon\n name={iconNameRight}\n style={iconStyles}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n </View>\n </LinearGradient>\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({\n appearance = 'interaction',\n disabled = false,\n loading = false,\n maxFontSizeMultiplier,\n size = 'md',\n variant = 'fill',\n}: Partial<ButtonProps>) => {\n const { colors, button } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n const colorOptionMap = useButtonColorOptionMap()\n\n const outlineHeightOffset = size === 'sm' ? 2 : 4\n const outlineMarginOffset = size === 'sm' ? 1 : 2\n\n const sizeStyleMap: SizeStyle = {\n [SIZES.sm]: {\n fontSize: 12,\n paddingHorizontal: 12 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 24 * fontScale - outlineHeightOffset,\n gap: 4 * fontScale,\n },\n [SIZES.md]: {\n fontSize: 14,\n paddingHorizontal: 16 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 32 * fontScale - outlineHeightOffset,\n gap: 6 * fontScale,\n },\n [SIZES.lg]: {\n fontSize: 16,\n paddingHorizontal: 24 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 40 * fontScale - outlineHeightOffset,\n gap: 8 * fontScale,\n },\n }\n\n const variantOutlineColor =\n disabled || loading ? colors.fillColorNeutral090 : colors.fillColorNeutral100Inverted\n\n const variantStyleMap: VariantColors = {\n fill: {\n backgroundColor: 'transparent',\n color: tokens.colorNeutral100White,\n },\n outline: {\n backgroundColor: variantOutlineColor,\n color: colorOptionMap[appearance],\n },\n }\n\n return StyleSheet.create({\n pressable: {\n borderRadius: sizeStyleMap[size].borderRadius,\n overflow: 'hidden',\n },\n colorWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: sizeStyleMap[size].borderRadius,\n },\n innerWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n margin: outlineMarginOffset,\n gap: sizeStyleMap[size].gap,\n borderRadius: sizeStyleMap[size].borderRadius - outlineMarginOffset,\n height: sizeStyleMap[size].height,\n backgroundColor: variantStyleMap[variant].backgroundColor,\n paddingHorizontal: sizeStyleMap[size].paddingHorizontal,\n },\n text: {\n textAlign: 'center',\n textAlignVertical: 'center',\n includeFontPadding: false,\n fontWeight: platformFontWeightBold,\n fontSize: sizeStyleMap[size].fontSize,\n color: variantStyleMap[variant].color,\n },\n textDisabled: {\n color: colors.textColorDefaultDisabled,\n },\n textLoading: {\n opacity: 0,\n },\n icon: {\n fontSize: sizeStyleMap[size].fontSize,\n color: variantStyleMap[variant].color,\n },\n iconDisabled: {\n color: colors.iconColorDefaultDisabled,\n },\n iconLoading: {\n opacity: 0,\n },\n spinner: {\n fontSize: sizeStyleMap[size].fontSize,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/display/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEhE,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAA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AE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;SACtC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet, Text, View } from 'react-native'\nimport type { PressableProps, ViewStyle } from 'react-native'\nimport LinearGradient from 'react-native-linear-gradient'\nimport { Icon } from './icon'\nimport { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { platformFontWeightBold, platformPressedOpacityStyle } from '../../utils'\nimport { Spinner } from './spinner'\nimport { getColorKey, useButtonColorOptionMap, useGradientColorMap } from './utils/button_colors'\nimport type { ButtonAppearanceUnion } from './utils/button_colors'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst SIZES = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n} as const\n\ntype SizeUnion = (typeof SIZES)[keyof typeof SIZES]\ntype SizeStyle = Record<\n SizeUnion,\n {\n fontSize: number\n paddingHorizontal: number\n height: number\n borderRadius: number\n gap: number\n }\n>\n\nconst VARIANTS = {\n fill: 'fill',\n outline: 'outline',\n} as const\n\ntype VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]\ntype VariantColors = Record<\n VariantUnion,\n {\n backgroundColor: string\n color: string\n }\n>\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface ButtonProps extends PressableProps {\n /**\n * Specifies whether fonts should be scaled down automatically to fit given style constraints.\n */\n adjustsFontSizeToFit?: boolean\n /**\n * Specifies whether fonts should scale to respect the device's text size accessibility settings. The default is true.\n */\n allowFontScaling?: boolean\n /**\n * Updates the button's colors\n */\n appearance?: ButtonAppearanceUnion\n /**\n * Styles the inner View that wraps the button's content\n */\n buttonInnerStyles?: ViewStyle\n /**\n * Styles the outer LinearGradient that gives the button it's backgrounnd and outline color\n */\n buttonOuterStyles?: ViewStyle\n /**\n * Generates an icon to the left of the button text\n */\n iconNameLeft?: string\n /**\n * Generates an icon to the right of the button text\n */\n iconNameRight?: string\n /**\n * Disables the button and replaces its content with a spinner\n */\n loading?: boolean\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n */\n minimumFontScale?: number\n /**\n * Changes the overall size of the button and its contents\n */\n size?: SizeUnion\n /**\n * Renders as text within the button\n */\n title: string\n /**\n * Fill buttons are visually more propmonitent then outline buttons\n */\n variant?: VariantUnion\n}\n\nexport function Button({\n adjustsFontSizeToFit = false,\n allowFontScaling = true,\n appearance = 'interaction',\n buttonInnerStyles,\n buttonOuterStyles,\n disabled = false,\n iconNameLeft,\n iconNameRight,\n loading,\n maxFontSizeMultiplier,\n minimumFontScale,\n size = 'md',\n title,\n variant = 'fill',\n ...props\n}: ButtonProps) {\n const styles = useStyles({ appearance, disabled, loading, maxFontSizeMultiplier, size, variant })\n const gradientOptionsMap = useGradientColorMap()\n const colorKey = getColorKey({ disabled, loading, appearance })\n\n const textStyles = [styles.text, disabled && styles.textDisabled, loading && styles.iconLoading]\n const iconStyles = [styles.icon, disabled && styles.iconDisabled, loading && styles.textLoading]\n\n const androidRippleColor = useCreateAndroidRippleColor({ color: gradientOptionsMap[colorKey][0] })\n\n return (\n <Pressable\n style={({ pressed }) => [styles.pressable, pressed && platformPressedOpacityStyle]}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n accessibilityState={{ busy: loading }}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n {...props}\n >\n <LinearGradient\n start={{ x: 0.1, y: 0.1 }}\n end={{ x: 0.9, y: 0.9 }}\n colors={gradientOptionsMap[colorKey]}\n style={[styles.colorWrapper, buttonOuterStyles]}\n >\n {loading && (\n <Spinner\n size={styles.spinner.fontSize}\n maxFontSizeMultiplier={maxFontSizeMultiplier || 0}\n />\n )}\n <View style={[styles.innerWrapper, buttonInnerStyles]}>\n {iconNameLeft && (\n <Icon\n name={iconNameLeft}\n style={iconStyles}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n <Text\n allowFontScaling={allowFontScaling}\n minimumFontScale={minimumFontScale}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n numberOfLines={1}\n style={textStyles}\n >\n {title}\n </Text>\n {iconNameRight && (\n <Icon\n name={iconNameRight}\n style={iconStyles}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n </View>\n </LinearGradient>\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({\n appearance = 'interaction',\n disabled = false,\n loading = false,\n maxFontSizeMultiplier,\n size = 'md',\n variant = 'fill',\n}: Partial<ButtonProps>) => {\n const { colors, button } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n const colorOptionMap = useButtonColorOptionMap()\n\n const outlineHeightOffset = size === 'sm' ? 2 : 4\n const outlineMarginOffset = size === 'sm' ? 1 : 2\n\n const sizeStyleMap: SizeStyle = {\n [SIZES.sm]: {\n fontSize: 12,\n paddingHorizontal: 12 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 24 * fontScale - outlineHeightOffset,\n gap: 4 * fontScale,\n },\n [SIZES.md]: {\n fontSize: 14,\n paddingHorizontal: 16 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 32 * fontScale - outlineHeightOffset,\n gap: 6 * fontScale,\n },\n [SIZES.lg]: {\n fontSize: 16,\n paddingHorizontal: 24 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 40 * fontScale - outlineHeightOffset,\n gap: 8 * fontScale,\n },\n }\n\n const variantOutlineColor =\n disabled || loading ? colors.fillColorNeutral090 : colors.fillColorNeutral100Inverted\n\n const variantStyleMap: VariantColors = {\n fill: {\n backgroundColor: 'transparent',\n color: tokens.colorNeutral100White,\n },\n outline: {\n backgroundColor: variantOutlineColor,\n color: colorOptionMap[appearance],\n },\n }\n\n return StyleSheet.create({\n pressable: {\n borderRadius: sizeStyleMap[size].borderRadius,\n overflow: 'hidden',\n },\n colorWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: sizeStyleMap[size].borderRadius,\n },\n innerWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n margin: outlineMarginOffset,\n gap: sizeStyleMap[size].gap,\n borderRadius: sizeStyleMap[size].borderRadius - outlineMarginOffset,\n height: sizeStyleMap[size].height,\n backgroundColor: variantStyleMap[variant].backgroundColor,\n paddingHorizontal: sizeStyleMap[size].paddingHorizontal,\n },\n text: {\n textAlign: 'center',\n textAlignVertical: 'center',\n includeFontPadding: false,\n fontWeight: platformFontWeightBold,\n fontSize: sizeStyleMap[size].fontSize,\n color: variantStyleMap[variant].color,\n },\n textDisabled: {\n color: colors.textColorDefaultDisabled,\n },\n textLoading: {\n opacity: 0,\n },\n icon: {\n fontSize: sizeStyleMap[size].fontSize,\n color: variantStyleMap[variant].color,\n },\n iconDisabled: {\n color: colors.iconColorDefaultDisabled,\n },\n iconLoading: {\n opacity: 0,\n },\n spinner: {\n fontSize: sizeStyleMap[size].fontSize,\n },\n })\n}\n"]}
@@ -3,11 +3,11 @@ import { BannerCollapsible } from './banner_collapsible';
3
3
  import BannerPrimitive from '../primitive/banner_primitive';
4
4
  import { View, StyleSheet } from 'react-native';
5
5
  import { Avatar } from './avatar';
6
- import { platformFontWeightMedium } from '../../utils';
6
+ import { platformFontWeightMedium, pluralize } from '../../utils';
7
7
  import { Text } from './text';
8
8
  export function ChildNotice({ childMembers }) {
9
9
  const styles = useStyles();
10
- const heading = `${childMembers.length} members under age 13`;
10
+ const heading = `${pluralize(childMembers.length, 'member')} under age 13`;
11
11
  return (<BannerCollapsible appearance="warning" iconName="general.shieldExclamation" heading={heading}>
12
12
  <BannerPrimitive.Text>
13
13
  Under age members cannot chat. They won't see conversations or notifications.
@@ -1 +1 @@
1
- {"version":3,"file":"child_notice.js","sourceRoot":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,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAC1C;MAAA,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1C;QAAA,CAAC,KAAK,CAAC,IAAI,CACb;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,eAAe,EAAE;YACf,SAAS,EAAE,CAAC;YACZ,GAAG,EAAE,CAAC;SACP;QACD,KAAK,EAAE;YACL,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,IAAI,EAAE;YACJ,UAAU,EAAE,wBAAwB;SACrC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { MemberResource } from '../../types'\nimport { BannerCollapsible } from './banner_collapsible'\nimport BannerPrimitive from '../primitive/banner_primitive'\nimport { View, StyleSheet } from 'react-native'\nimport { Avatar } from './avatar'\nimport { platformFontWeightMedium } from '../../utils'\nimport { Text } from './text'\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface ChildNoticeProps {\n childMembers: MemberResource[]\n}\n\nexport function ChildNotice({ childMembers }: ChildNoticeProps) {\n const styles = useStyles()\n const heading = `${childMembers.length} members under age 13`\n\n return (\n <BannerCollapsible appearance=\"warning\" iconName=\"general.shieldExclamation\" heading={heading}>\n <BannerPrimitive.Text>\n Under age members cannot chat. They won't see conversations or notifications.\n </BannerPrimitive.Text>\n <View style={styles.childrenWrapper}>\n {childMembers?.map(child => <Child key={child.id} child={child} />)}\n </View>\n </BannerCollapsible>\n )\n}\n\nfunction Child({ child }: { child: MemberResource }) {\n const styles = useStyles()\n return (\n <View style={styles.child}>\n <Avatar sourceUri={child.avatar} size=\"sm\" />\n <Text variant=\"tertiary\" style={styles.name}>\n {child.name}\n </Text>\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = () => {\n return StyleSheet.create({\n childrenWrapper: {\n marginTop: 8,\n gap: 8,\n },\n child: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n name: {\n fontWeight: platformFontWeightMedium,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"child_notice.js","sourceRoot":"","sources":["../../../src/components/display/child_notice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,eAAe,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAU7B,MAAM,UAAU,WAAW,CAAC,EAAE,YAAY,EAAoB;IAC5D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,OAAO,GAAG,GAAG,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAA;IAE1E,OAAO,CACL,CAAC,iBAAiB,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAC5F;MAAA,CAAC,eAAe,CAAC,IAAI,CACnB;;MACF,EAAE,eAAe,CAAC,IAAI,CACtB;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAClC;QAAA,CAAC,YAAY,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAG,CAAC,CACrE;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,iBAAiB,CAAC,CACrB,CAAA;AACH,CAAC;AAED,SAAS,KAAK,CAAC,EAAE,KAAK,EAA6B;IACjD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACxB;MAAA,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAC1C;MAAA,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1C;QAAA,CAAC,KAAK,CAAC,IAAI,CACb;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,eAAe,EAAE;YACf,SAAS,EAAE,CAAC;YACZ,GAAG,EAAE,CAAC;SACP;QACD,KAAK,EAAE;YACL,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,IAAI,EAAE;YACJ,UAAU,EAAE,wBAAwB;SACrC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { MemberResource } from '../../types'\nimport { BannerCollapsible } from './banner_collapsible'\nimport BannerPrimitive from '../primitive/banner_primitive'\nimport { View, StyleSheet } from 'react-native'\nimport { Avatar } from './avatar'\nimport { platformFontWeightMedium, pluralize } from '../../utils'\nimport { Text } from './text'\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface ChildNoticeProps {\n childMembers: MemberResource[]\n}\n\nexport function ChildNotice({ childMembers }: ChildNoticeProps) {\n const styles = useStyles()\n const heading = `${pluralize(childMembers.length, 'member')} under age 13`\n\n return (\n <BannerCollapsible appearance=\"warning\" iconName=\"general.shieldExclamation\" heading={heading}>\n <BannerPrimitive.Text>\n Under age members cannot chat. They won't see conversations or notifications.\n </BannerPrimitive.Text>\n <View style={styles.childrenWrapper}>\n {childMembers?.map(child => <Child key={child.id} child={child} />)}\n </View>\n </BannerCollapsible>\n )\n}\n\nfunction Child({ child }: { child: MemberResource }) {\n const styles = useStyles()\n return (\n <View style={styles.child}>\n <Avatar sourceUri={child.avatar} size=\"sm\" />\n <Text variant=\"tertiary\" style={styles.name}>\n {child.name}\n </Text>\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = () => {\n return StyleSheet.create({\n childrenWrapper: {\n marginTop: 8,\n gap: 8,\n },\n child: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n name: {\n fontWeight: platformFontWeightMedium,\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/display/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AA4BhD,KAAK,SAAS,GAAG,SAAS,GAAG;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAMD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,QAAQ,EAAE,KAAK,GAAG,UAAU,CAAC;IACnE;;;OAGG;IACH,IAAI,EAAE,MAAM,CA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,KAAK,EACT,EAAE,SAAS,qBA0BX"}
@@ -2,27 +2,29 @@ import React from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
  import { SvgXml } from 'react-native-svg';
4
4
  import { useFontScale, useTheme } from '../../hooks';
5
- import * as general from '@planningcenter/icons/paths/general';
6
- import * as groups from '@planningcenter/icons/paths/groups';
5
+ import * as api from '@planningcenter/icons/paths/api';
6
+ import * as brand from '@planningcenter/icons/paths/brand';
7
7
  import * as calendar from '@planningcenter/icons/paths/calendar';
8
- import * as people from '@planningcenter/icons/paths/people';
9
8
  import * as churchCenter from '@planningcenter/icons/paths/church-center';
9
+ import * as general from '@planningcenter/icons/paths/general';
10
+ import * as groups from '@planningcenter/icons/paths/groups';
10
11
  import * as logomark from '@planningcenter/icons/paths/logomark';
11
- import * as brand from '@planningcenter/icons/paths/brand';
12
- import * as api from '@planningcenter/icons/paths/api';
12
+ import * as people from '@planningcenter/icons/paths/people';
13
+ import * as services from '@planningcenter/icons/paths/services';
13
14
  // =================================
14
15
  // ====== Constants ================
15
16
  // =================================
16
17
  const FALLBACK_SIZE = 12;
17
18
  const ICONS = {
18
19
  api,
20
+ brand,
19
21
  calendar,
20
- people,
21
22
  churchCenter,
22
- groups,
23
23
  general,
24
+ groups,
24
25
  logomark,
25
- brand,
26
+ people,
27
+ services,
26
28
  };
27
29
  export function Icon({ color, name, size, style, accessibilityElementsHidden, accessibilityLabel, maxFontSizeMultiplier, ...props }) {
28
30
  const flattenStyles = StyleSheet.flatten(style);
@@ -1 +1 @@
1
- {"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/display/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACp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,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,IAAI,MAAM,CAAC,uBAAuB;SAC/C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport type { ColorValue, StyleProp, ViewStyle } from 'react-native'\nimport { SvgXml } from 'react-native-svg'\nimport type { XmlProps } from 'react-native-svg'\nimport { useFontScale, useTheme } from '../../hooks'\nimport * as general from '@planningcenter/icons/paths/general'\nimport * as groups from '@planningcenter/icons/paths/groups'\nimport * as calendar from '@planningcenter/icons/paths/calendar'\nimport * as people from '@planningcenter/icons/paths/people'\nimport * as churchCenter from '@planningcenter/icons/paths/church-center'\nimport * as logomark from '@planningcenter/icons/paths/logomark'\nimport * as brand from '@planningcenter/icons/paths/brand'\nimport * as api from '@planningcenter/icons/paths/api'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst FALLBACK_SIZE = 12\n\nconst ICONS = {\n api,\n calendar,\n people,\n churchCenter,\n groups,\n general,\n logomark,\n brand,\n} as const\n\ntype IconStyle = ViewStyle & {\n fontSize?: number\n color?: string\n}\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface IconProps extends Omit<XmlProps, 'xml' | 'fontSize'> {\n /**\n * Made up of the set.iconName.\n * Example: \"general.textMessage\"\n */\n name: string\n /**\n * This sets a static size for the icon.\n * Providing a fontSize style will allow the icon to scale with the device's text a11y size.\n */\n size?: number\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Changes the color of the icon. Most cases should use a theme color to support light/dark mode.\n */\n color?: ColorValue\n /**\n * Icon can handle ViewStyle, color, and fontSize.\n */\n style?: StyleProp<IconStyle>\n}\n\nexport function Icon({\n color,\n name,\n size,\n style,\n accessibilityElementsHidden,\n accessibilityLabel,\n maxFontSizeMultiplier,\n ...props\n}: IconProps) {\n const flattenStyles = StyleSheet.flatten(style)\n const iconSize = useGetIconSize(size, flattenStyles, maxFontSizeMultiplier)\n const path = getIconPath(name)\n const styles = useStyles({ color, iconSize })\n\n if (!path) {\n console.warn(`No icon available named ${name}. Remember to use the format \"set.iconName\"`)\n return <View style={styles.noIcon} />\n }\n\n return (\n <SvgXml\n accessibilityElementsHidden={accessibilityElementsHidden}\n accessibilityLabel={accessibilityLabel}\n xml={`\n <svg viewBox=\"0 0 16 16\">\n <path d=\"${path}\" fill=\"currentColor\" />\n </svg>\n `}\n height={iconSize}\n width={iconSize}\n style={{ ...styles.icon, ...flattenStyles }}\n {...props}\n />\n )\n}\n\nconst useGetIconSize = (size?: number, style?: IconStyle, maxFontSizeMultiplier?: number) => {\n const fontSize = style?.fontSize\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n\n if (fontSize) return fontSize * fontScale\n\n return size || FALLBACK_SIZE\n}\n\nconst getIconPath = (name: string): string => {\n const [setName, iconName] = name.split('.')\n\n return ICONS[setName]?.[iconName]\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ color, iconSize }: { color?: ColorValue; iconSize: number }) => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n noIcon: {\n backgroundColor: colors.iconColorDefaultDisabled,\n width: iconSize,\n height: iconSize,\n borderRadius: iconSize / 2,\n },\n icon: {\n color: color || colors.iconColorDefaultPrimary,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/display/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAA;AACtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAA;AAC1D,OAAO,KAAK,QAAQ,MAAM,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uB;SAC/C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport type { ColorValue, StyleProp, ViewStyle } from 'react-native'\nimport { SvgXml } from 'react-native-svg'\nimport type { XmlProps } from 'react-native-svg'\nimport { useFontScale, useTheme } from '../../hooks'\nimport * as api from '@planningcenter/icons/paths/api'\nimport * as brand from '@planningcenter/icons/paths/brand'\nimport * as calendar from '@planningcenter/icons/paths/calendar'\nimport * as churchCenter from '@planningcenter/icons/paths/church-center'\nimport * as general from '@planningcenter/icons/paths/general'\nimport * as groups from '@planningcenter/icons/paths/groups'\nimport * as logomark from '@planningcenter/icons/paths/logomark'\nimport * as people from '@planningcenter/icons/paths/people'\nimport * as services from '@planningcenter/icons/paths/services'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst FALLBACK_SIZE = 12\n\nconst ICONS = {\n api,\n brand,\n calendar,\n churchCenter,\n general,\n groups,\n logomark,\n people,\n services,\n} as const\n\ntype IconStyle = ViewStyle & {\n fontSize?: number\n color?: string\n}\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface IconProps extends Omit<XmlProps, 'xml' | 'fontSize'> {\n /**\n * Made up of the set.iconName.\n * Example: \"general.textMessage\"\n */\n name: string\n /**\n * This sets a static size for the icon.\n * Providing a fontSize style will allow the icon to scale with the device's text a11y size.\n */\n size?: number\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Changes the color of the icon. Most cases should use a theme color to support light/dark mode.\n */\n color?: ColorValue\n /**\n * Icon can handle ViewStyle, color, and fontSize.\n */\n style?: StyleProp<IconStyle>\n}\n\nexport function Icon({\n color,\n name,\n size,\n style,\n accessibilityElementsHidden,\n accessibilityLabel,\n maxFontSizeMultiplier,\n ...props\n}: IconProps) {\n const flattenStyles = StyleSheet.flatten(style)\n const iconSize = useGetIconSize(size, flattenStyles, maxFontSizeMultiplier)\n const path = getIconPath(name)\n const styles = useStyles({ color, iconSize })\n\n if (!path) {\n console.warn(`No icon available named ${name}. Remember to use the format \"set.iconName\"`)\n return <View style={styles.noIcon} />\n }\n\n return (\n <SvgXml\n accessibilityElementsHidden={accessibilityElementsHidden}\n accessibilityLabel={accessibilityLabel}\n xml={`\n <svg viewBox=\"0 0 16 16\">\n <path d=\"${path}\" fill=\"currentColor\" />\n </svg>\n `}\n height={iconSize}\n width={iconSize}\n style={{ ...styles.icon, ...flattenStyles }}\n {...props}\n />\n )\n}\n\nconst useGetIconSize = (size?: number, style?: IconStyle, maxFontSizeMultiplier?: number) => {\n const fontSize = style?.fontSize\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n\n if (fontSize) return fontSize * fontScale\n\n return size || FALLBACK_SIZE\n}\n\nconst getIconPath = (name: string): string => {\n const [setName, iconName] = name.split('.')\n\n return ICONS[setName]?.[iconName]\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ color, iconSize }: { color?: ColorValue; iconSize: number }) => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n noIcon: {\n backgroundColor: colors.iconColorDefaultDisabled,\n width: iconSize,\n height: iconSize,\n borderRadius: iconSize / 2,\n },\n icon: {\n color: color || colors.iconColorDefaultPrimary,\n },\n })\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { useTheme } from '../../hooks';
2
2
  import React from 'react';
3
- import { Platform, StyleSheet, Text as ReactNativeText } from 'react-native';
3
+ import { StyleSheet, Text as ReactNativeText } from 'react-native';
4
4
  import { tokens } from '../../vendor/tapestry/tokens';
5
5
  // =================================
6
6
  // ====== Constants ================
@@ -19,7 +19,7 @@ export function Text({ style, variant = 'plain', children, ...props }) {
19
19
  [VARIANTS.tertiary]: styles.tertiary,
20
20
  [VARIANTS.footnote]: styles.footnote,
21
21
  };
22
- return (<ReactNativeText style={[styles.global, variantStyleMap[variant], style]} {...props}>
22
+ return (<ReactNativeText style={[variantStyleMap[variant], style]} {...props}>
23
23
  {children}
24
24
  </ReactNativeText>);
25
25
  }
@@ -29,12 +29,6 @@ export function Text({ style, variant = 'plain', children, ...props }) {
29
29
  const useStyles = () => {
30
30
  const { colors } = useTheme();
31
31
  return StyleSheet.create({
32
- global: {
33
- fontFamily: Platform.select({
34
- ios: 'System',
35
- android: 'normal',
36
- }),
37
- },
38
32
  plain: {
39
33
  color: colors.textColorDefaultPrimary,
40
34
  fontSize: tokens.fontSizeMd,
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/components/display/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,cAAc,CAAA;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAErD,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,QAAQ,GAAG;IACf,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;CACZ,CAAA;AAgBV,MAAM,UAAU,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa;IAC9E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,eAAe,GAAkB;QACrC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK;QAC9B,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,SAAS;QACtC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ;QACpC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ;KACrC,CAAA;IAED,OAAO,CACL,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAClF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,eAAe,CAAC,CACnB,CAAA;AACH,CAAC;AAED,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAC1B,GAAG,EAAE,QAAQ;gBACb,OAAO,EAAE,QAAQ;aAClB,CAAC;SACH;QACD,KAAK,EAAE;YACL,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,iEAAiE;QACjE,4DAA4D;QAC5D,gGAAgG;QAChG,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useTheme } from '../../hooks'\nimport React from 'react'\nimport { Platform, StyleSheet, Text as ReactNativeText } from 'react-native'\nimport type { TextStyle, TextProps as ReactNativeTextProps } from 'react-native'\nimport { tokens } from '../../vendor/tapestry/tokens'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst VARIANTS = {\n plain: 'plain',\n secondary: 'secondary',\n tertiary: 'tertiary',\n footnote: 'footnote',\n} as const\n\ntype VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]\ntype VariantStyles = Record<VariantUnion, TextStyle>\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface TextProps extends ReactNativeTextProps {\n /**\n * Changes the styles and size of the text.\n */\n variant?: VariantUnion\n}\n\nexport function Text({ style, variant = 'plain', children, ...props }: TextProps) {\n const styles = useStyles()\n const variantStyleMap: VariantStyles = {\n [VARIANTS.plain]: styles.plain,\n [VARIANTS.secondary]: styles.secondary,\n [VARIANTS.tertiary]: styles.tertiary,\n [VARIANTS.footnote]: styles.footnote,\n }\n\n return (\n <ReactNativeText style={[styles.global, variantStyleMap[variant], style]} {...props}>\n {children}\n </ReactNativeText>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n global: {\n fontFamily: Platform.select({\n ios: 'System',\n android: 'normal',\n }),\n },\n plain: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n // This is a dupe of the plain variant to support the legacy API.\n // Once we move to the new Doxy font scale we can remove it.\n // See: https://www.figma.com/design/ZR0ZP6FdbOBOK3fUSpRr0Q/CC-Redux-2025?node-id=156-1069&m=dev\n secondary: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n tertiary: {\n color: colors.textColorDefaultSecondary,\n fontSize: tokens.fontSizeSm,\n },\n footnote: {\n color: colors.textColorDefaultSecondary,\n fontSize: tokens.fontSizeXs,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/components/display/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAY,UAAU,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,cAAc,CAAA;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B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UAAU;SAC5B;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useTheme } from '../../hooks'\nimport React from 'react'\nimport { Platform, StyleSheet, Text as ReactNativeText } from 'react-native'\nimport type { TextStyle, TextProps as ReactNativeTextProps } from 'react-native'\nimport { tokens } from '../../vendor/tapestry/tokens'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst VARIANTS = {\n plain: 'plain',\n secondary: 'secondary',\n tertiary: 'tertiary',\n footnote: 'footnote',\n} as const\n\ntype VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]\ntype VariantStyles = Record<VariantUnion, TextStyle>\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface TextProps extends ReactNativeTextProps {\n /**\n * Changes the styles and size of the text.\n */\n variant?: VariantUnion\n}\n\nexport function Text({ style, variant = 'plain', children, ...props }: TextProps) {\n const styles = useStyles()\n const variantStyleMap: VariantStyles = {\n [VARIANTS.plain]: styles.plain,\n [VARIANTS.secondary]: styles.secondary,\n [VARIANTS.tertiary]: styles.tertiary,\n [VARIANTS.footnote]: styles.footnote,\n }\n\n return (\n <ReactNativeText style={[variantStyleMap[variant], style]} {...props}>\n {children}\n </ReactNativeText>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n plain: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n // This is a dupe of the plain variant to support the legacy API.\n // Once we move to the new Doxy font scale we can remove it.\n // See: https://www.figma.com/design/ZR0ZP6FdbOBOK3fUSpRr0Q/CC-Redux-2025?node-id=156-1069&m=dev\n secondary: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n tertiary: {\n color: colors.textColorDefaultSecondary,\n fontSize: tokens.fontSizeSm,\n },\n footnote: {\n color: colors.textColorDefaultSecondary,\n fontSize: tokens.fontSizeXs,\n },\n })\n}\n"]}
@@ -31,7 +31,11 @@ interface TextButtonProps extends PressableProps {
31
31
  * Changes the styles and size of the text.
32
32
  */
33
33
  variant?: TextProps['variant'];
34
+ /**
35
+ * Changes the styles and size of the text.
36
+ */
37
+ textStyle?: TextProps['style'];
34
38
  }
35
- export declare function TextButton({ adjustsFontSizeToFit, allowFontScaling, appearance, disabled, children, maxFontSizeMultiplier, minimumFontScale, variant, ...props }: TextButtonProps): React.JSX.Element;
39
+ export declare function TextButton({ adjustsFontSizeToFit, allowFontScaling, appearance, disabled, children, maxFontSizeMultiplier, minimumFontScale, variant, style, textStyle, ...props }: TextButtonProps): React.JSX.Element;
36
40
  export {};
37
41
  //# sourceMappingURL=text_button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text_button.d.ts","sourceRoot":"","sources":["../../../src/components/display/text_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAIlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAMlE,UAAU,eAAgB,SAAQ,cAAc;IAC9C;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;IAChC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC/B;AAED,wBAAgB,UAAU,CAAC,EACzB,oBAA4B,EAC5B,gBAAuB,EACvB,UAA0B,EAC1B,QAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,EAChB,OAAiB,EACjB,GAAG,KAAK,EACT,EAAE,eAAe,qBAwBjB"}
1
+ {"version":3,"file":"text_button.d.ts","sourceRoot":"","sources":["../../../src/components/display/text_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAIlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAMlE,UAAU,eAAgB,SAAQ,cAAc;IAC9C;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;IAChC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;CAC/B;AAED,wBAAgB,UAAU,CAAC,EACzB,oBAA4B,EAC5B,gBAAuB,EACvB,UAA0B,EAC1B,QAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,EAChB,OAAiB,EACjB,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,qBA4BjB"}
@@ -4,11 +4,15 @@ import { useTheme } from '../../hooks';
4
4
  import { platformFontWeightMedium } from '../../utils';
5
5
  import { Text } from './text';
6
6
  import { getColorKey, useButtonColorOptionMap } from './utils/button_colors';
7
- export function TextButton({ adjustsFontSizeToFit = false, allowFontScaling = true, appearance = 'interaction', disabled = false, children, maxFontSizeMultiplier, minimumFontScale, variant = 'plain', ...props }) {
7
+ export function TextButton({ adjustsFontSizeToFit = false, allowFontScaling = true, appearance = 'interaction', disabled = false, children, maxFontSizeMultiplier, minimumFontScale, variant = 'plain', style, textStyle, ...props }) {
8
8
  const styles = useStyles({ appearance, disabled });
9
- return (<Pressable accessibilityRole="button" disabled={disabled} style={({ pressed }) => pressed && styles.pressed} // Android & iOS intentionally get the same pressed style
9
+ const overrideStyles = StyleSheet.flatten(style); // Ensures the pressed styles still get applied
10
+ return (<Pressable accessibilityRole="button" disabled={disabled} style={({ pressed }) => ({
11
+ ...(pressed ? styles.pressed : null),
12
+ ...overrideStyles,
13
+ })} // Android & iOS intentionally get the same pressed style
10
14
  hitSlop={10} {...props}>
11
- <Text adjustsFontSizeToFit={adjustsFontSizeToFit} allowFontScaling={allowFontScaling} maxFontSizeMultiplier={maxFontSizeMultiplier} minimumFontScale={minimumFontScale} numberOfLines={1} style={[styles.text, disabled && styles.disabled]} variant={variant}>
15
+ <Text adjustsFontSizeToFit={adjustsFontSizeToFit} allowFontScaling={allowFontScaling} maxFontSizeMultiplier={maxFontSizeMultiplier} minimumFontScale={minimumFontScale} numberOfLines={1} style={[styles.text, disabled && styles.disabled, textStyle]} variant={variant}>
12
16
  {children}
13
17
  </Text>
14
18
  </Pressable>);
@@ -1 +1 @@
1
- {"version":3,"file":"text_button.js","sourceRoot":"","sources":["../../../src/components/display/text_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,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;IAAA,EAAE,SAAS,CAAC,CACb,CAAA;AACH,CAAC;AAED,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,SAAS,GAAG,CAAC,EAAE,UAAU,GAAG,aAAa,EAAE,QAAQ,GAAG,KAAK,EAA4B,EAAE,EAAE;IAC/F,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;IACtD,MAAM,cAAc,GAAG,uBAAuB,EAAE,CAAA;IAEhD,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE;YACJ,UAAU,EAAE,wBAAwB;YACpC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC;SAChC;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,OAAO,EAAE;YACP,OAAO,EAAE,GAAG;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet } from 'react-native'\nimport type { PressableProps } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { platformFontWeightMedium } from '../../utils'\nimport { Text } from './text'\nimport type { TextProps } from './text'\nimport { getColorKey, useButtonColorOptionMap } from './utils/button_colors'\nimport type { ButtonAppearanceUnion } from './utils/button_colors'\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface TextButtonProps extends PressableProps {\n /**\n * Specifies whether fonts should be scaled down automatically to fit given style constraints.\n */\n adjustsFontSizeToFit?: boolean\n /**\n * Specifies whether fonts should scale to respect the device's text size accessibility settings. The default is true.\n */\n allowFontScaling?: boolean\n /**\n * Updates the button's colors\n */\n appearance?: ButtonAppearanceUnion\n /**\n * Renders text within a `Text`\n */\n children?: TextProps['children']\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n */\n minimumFontScale?: number\n /**\n * Changes the styles and size of the text.\n */\n variant?: TextProps['variant']\n}\n\nexport function TextButton({\n adjustsFontSizeToFit = false,\n allowFontScaling = true,\n appearance = 'interaction',\n disabled = false,\n children,\n maxFontSizeMultiplier,\n minimumFontScale,\n variant = 'plain',\n ...props\n}: TextButtonProps) {\n const styles = useStyles({ appearance, disabled })\n\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={disabled}\n style={({ pressed }) => pressed && styles.pressed} // Android & iOS intentionally get the same pressed style\n hitSlop={10}\n {...props}\n >\n <Text\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n allowFontScaling={allowFontScaling}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n minimumFontScale={minimumFontScale}\n numberOfLines={1}\n style={[styles.text, disabled && styles.disabled]}\n variant={variant}\n >\n {children}\n </Text>\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ appearance = 'interaction', disabled = false }: Partial<TextButtonProps>) => {\n const { colors } = useTheme()\n const colorKey = getColorKey({ disabled, appearance })\n const colorOptionMap = useButtonColorOptionMap()\n\n return StyleSheet.create({\n text: {\n fontWeight: platformFontWeightMedium,\n color: colorOptionMap[colorKey],\n },\n disabled: {\n color: colors.textColorDefaultDisabled,\n },\n pressed: {\n opacity: 0.5,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"text_button.js","sourceRoot":"","sources":["../../../src/components/display/text_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAE,WA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,EAAE,IAAI,CACR;IAAA,EAAE,SAAS,CAAC,CACb,CAAA;AACH,CAAC;AAED,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,SAAS,GAAG,CAAC,EAAE,UAAU,GAAG,aAAa,EAAE,QAAQ,GAAG,KAAK,EAA4B,EAAE,EAAE;IAC/F,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;IACtD,MAAM,cAAc,GAAG,uBAAuB,EAAE,CAAA;IAEhD,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE;YACJ,UAAU,EAAE,wBAAwB;YACpC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC;SAChC;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,OAAO,EAAE;YACP,OAAO,EAAE,GAAG;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet } from 'react-native'\nimport type { PressableProps } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { platformFontWeightMedium } from '../../utils'\nimport { Text } from './text'\nimport type { TextProps } from './text'\nimport { getColorKey, useButtonColorOptionMap } from './utils/button_colors'\nimport type { ButtonAppearanceUnion } from './utils/button_colors'\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface TextButtonProps extends PressableProps {\n /**\n * Specifies whether fonts should be scaled down automatically to fit given style constraints.\n */\n adjustsFontSizeToFit?: boolean\n /**\n * Specifies whether fonts should scale to respect the device's text size accessibility settings. The default is true.\n */\n allowFontScaling?: boolean\n /**\n * Updates the button's colors\n */\n appearance?: ButtonAppearanceUnion\n /**\n * Renders text within a `Text`\n */\n children?: TextProps['children']\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n */\n minimumFontScale?: number\n /**\n * Changes the styles and size of the text.\n */\n variant?: TextProps['variant']\n /**\n * Changes the styles and size of the text.\n */\n textStyle?: TextProps['style']\n}\n\nexport function TextButton({\n adjustsFontSizeToFit = false,\n allowFontScaling = true,\n appearance = 'interaction',\n disabled = false,\n children,\n maxFontSizeMultiplier,\n minimumFontScale,\n variant = 'plain',\n style,\n textStyle,\n ...props\n}: TextButtonProps) {\n const styles = useStyles({ appearance, disabled })\n const overrideStyles = StyleSheet.flatten(style) // Ensures the pressed styles still get applied\n\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={disabled}\n style={({ pressed }) => ({\n ...(pressed ? styles.pressed : null),\n ...overrideStyles,\n })} // Android & iOS intentionally get the same pressed style\n hitSlop={10}\n {...props}\n >\n <Text\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n allowFontScaling={allowFontScaling}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n minimumFontScale={minimumFontScale}\n numberOfLines={1}\n style={[styles.text, disabled && styles.disabled, textStyle]}\n variant={variant}\n >\n {children}\n </Text>\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ appearance = 'interaction', disabled = false }: Partial<TextButtonProps>) => {\n const { colors } = useTheme()\n const colorKey = getColorKey({ disabled, appearance })\n const colorOptionMap = useButtonColorOptionMap()\n\n return StyleSheet.create({\n text: {\n fontWeight: platformFontWeightMedium,\n color: colorOptionMap[colorKey],\n },\n disabled: {\n color: colors.textColorDefaultDisabled,\n },\n pressed: {\n opacity: 0.5,\n },\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- export * from './conversations';
1
+ export * from './conversations/conversations';
2
2
  export * from './page/error_boundary';
3
3
  export * from './display';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA"}
@@ -1,4 +1,4 @@
1
- export * from './conversations';
1
+ export * from './conversations/conversations';
2
2
  export * from './page/error_boundary';
3
3
  export * from './display';
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA","sourcesContent":["export * from './conversations'\nexport * from './page/error_boundary'\nexport * from './display'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA","sourcesContent":["export * from './conversations/conversations'\nexport * from './page/error_boundary'\nexport * from './display'\n"]}
@@ -10,7 +10,7 @@ declare class ErrorBoundary extends React.Component<PropsWithChildren<{
10
10
  componentDidCatch(error: any): void;
11
11
  handleError(error: any): void;
12
12
  handleReset: () => void;
13
- render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
13
+ render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
14
14
  }
15
15
  export default ErrorBoundary;
16
16
  //# sourceMappingURL=error_boundary.d.ts.map
@@ -1,10 +1,12 @@
1
1
  import { AnyUseSuspenseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
2
2
  import { ApiCollection, ApiResource, ResourceObject } from '../types';
3
3
  import { GetRequest } from '../utils/client/types';
4
- interface SuspenseGetOptions extends GetRequest {
5
- app?: 'chat' | 'groups';
4
+ import { App } from './use_api_client';
5
+ interface ApiGetOptions extends GetRequest {
6
+ app?: App;
7
+ enabled?: boolean;
6
8
  }
7
- export declare const useApiGet: <T extends ResourceObject | ResourceObject[]>(args: SuspenseGetOptions) => {
9
+ export declare const useApiGet: <T extends ResourceObject | ResourceObject[]>(args: ApiGetOptions) => {
8
10
  error: Response;
9
11
  isError: true;
10
12
  isPending: false;
@@ -174,7 +176,7 @@ export declare const useApiGet: <T extends ResourceObject | ResourceObject[]>(ar
174
176
  meta?: Record<string, unknown> | undefined;
175
177
  };
176
178
  export type SuspensePaginatorOptions = Omit<AnyUseSuspenseInfiniteQueryOptions, 'getNextPageParam' | 'initialPageParam' | 'queryFn' | 'queryKey'>;
177
- export declare const useApiPaginator: <T extends ResourceObject>(args: SuspenseGetOptions, opts?: SuspensePaginatorOptions) => {
179
+ export declare const useApiPaginator: <T extends ResourceObject>(args: ApiGetOptions, opts?: SuspensePaginatorOptions) => {
178
180
  data: T[];
179
181
  error: Response;
180
182
  isError: true;
@@ -1 +1 @@
1
- {"version":3,"file":"use_api.d.ts","sourceRoot":"","sources":["../../src/hooks/use_api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,YAAY,EAGb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,UAAU,EAAe,MAAM,uBAAuB,CAAA;AAI/D,UAAU,kBAAmB,SAAQ,UAAU;IAC7C,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CACxB;AAED,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EAAE,QAC7D,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;CASzF,CAAA;AAOD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,kCAAkC,EAClC,kBAAkB,GAAG,kBAAkB,GAAG,SAAS,GAAG,UAAU,CACjE,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,cAAc,QAChD,aAAa,SACZ,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyChC,CAAA"}
@@ -4,6 +4,7 @@ import { getRequestQueryKey } from './use_suspense_api';
4
4
  export const useApiGet = (args) => {
5
5
  const { data, ...query } = useQuery({
6
6
  queryKey: getRequestQueryKey(args),
7
+ enabled: args.enabled,
7
8
  });
8
9
  return { ...data, ...query };
9
10
  };
@@ -15,9 +16,10 @@ export const useApiPaginator = (args, opts) => {
15
16
  const pageParmWhere = pageParam?.where || {};
16
17
  const argsWhere = args.data.where || {};
17
18
  const where = { ...argsWhere, ...pageParmWhere };
19
+ const app = args.app || 'chat';
18
20
  const offset = pageParam?.offset || args.data.offset;
19
21
  const data = { ...args.data, where, offset };
20
- return apiClient.chat.get({
22
+ return apiClient[app].get({
21
23
  url: args.url,
22
24
  data,
23
25
  });
@@ -32,9 +34,10 @@ export const useApiPaginator = (args, opts) => {
32
34
  return { offset: Number(offset) };
33
35
  return undefined;
34
36
  },
37
+ enabled: args.enabled,
35
38
  ...(opts || {}),
36
39
  });
37
- const data = query.data?.pages.flatMap(page => page.data) || [];
40
+ const data = query.data?.pages?.flatMap(page => page.data) || [];
38
41
  return { ...query, data };
39
42
  };
40
43
  //# sourceMappingURL=use_api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_api.js","sourceR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AC,CAAA;QACJ,CAAC;QACD,gBAAgB,EAAE,EAA0B;QAC5C,gBAAgB,EAAE,QAAQ,CAAC,EAAE;YAC3B,MAAM,IAAI,GAAa,QAAQ,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAA;YAChD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;YAE7B,IAAI,IAAI;gBAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAA;YAC3C,IAAI,MAAM;gBAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAA;YAE7C,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;KAChB,CAAC,CAAA;IAEF,MAAM,IAAI,GAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAEpE,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,CAAA;AAC3B,CAAC,CAAA","sourcesContent":["import {\n AnyUseSuspenseInfiniteQueryOptions,\n InfiniteData,\n useInfiniteQuery,\n useQuery,\n} from '@tanstack/react-query'\nimport { ApiCollection, ApiResource, ResourceObject } from '../types'\nimport { GetRequest, RequestData } from '../utils/client/types'\nimport { useApiClient } from './use_api_client'\nimport { getRequestQueryKey } from './use_suspense_api'\n\ninterface SuspenseGetOptions extends GetRequest {\n app?: 'chat' | 'groups'\n}\n\nexport const useApiGet = <T extends ResourceObject | ResourceObject[]>(\n args: SuspenseGetOptions\n) => {\n type Resource = ApiResource<T>\n\n const { data, ...query } = useQuery<Resource, Response>({\n queryKey: getRequestQueryKey(args),\n })\n\n return { ...data, ...query }\n}\n\ntype NextMeta = Partial<{\n offset: string\n idLt: string\n}>\n\nexport type SuspensePaginatorOptions = Omit<\n AnyUseSuspenseInfiniteQueryOptions,\n 'getNextPageParam' | 'initialPageParam' | 'queryFn' | 'queryKey'\n>\n\nexport const useApiPaginator = <T extends ResourceObject>(\n args: SuspenseGetOptions,\n opts?: SuspensePaginatorOptions\n) => {\n const apiClient = useApiClient()\n const query = useInfiniteQuery<\n ApiCollection<T>,\n Response,\n InfiniteData<ApiCollection<T>>,\n any,\n Partial<RequestData> | undefined\n >({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ pageParam }) => {\n const pageParmWhere = pageParam?.where || {}\n const argsWhere = args.data.where || {}\n const where = { ...argsWhere, ...pageParmWhere }\n\n const offset = pageParam?.offset || args.data.offset\n const data = { ...args.data, where, offset }\n\n return apiClient.chat.get({\n url: args.url,\n data,\n })\n },\n initialPageParam: {} as Partial<RequestData>,\n getNextPageParam: lastPage => {\n const next: NextMeta = lastPage.meta?.next || {}\n const { offset, idLt } = next\n\n if (idLt) return { where: { id_lt: idLt } }\n if (offset) return { offset: Number(offset) }\n\n return undefined\n },\n ...(opts || {}),\n })\n\n const data: T[] = query.data?.pages.flatMap(page => page.data) || []\n\n return { ...query, data }\n}\n"]}
1
+ {"version":3,"file":"use_api.js","sourceRoot":"","sources":["../../src/hooks/use_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAO,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAOvD,MAAM,CAAC,MAAM,SAAS,GAAG,CAA8C,IAAmB,EAAE,EAAE;IAG5F,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,QAAQ,CAAqB;QACtD,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC;QAClC,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,CAAA;AAC9B,CAAC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,SAAS,CAAA;QAClB,CAAC;QACD,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;KAChB,CAAC,CAAA;IAEF,MAAM,IAAI,GAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAErE,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,CAAA;AAC3B,CAAC,CAAA","sourcesContent":["import {\n AnyUseSuspenseInfiniteQueryOptions,\n InfiniteData,\n useInfiniteQuery,\n useQuery,\n} from '@tanstack/react-query'\nimport { ApiCollection, ApiResource, ResourceObject } from '../types'\nimport { GetRequest, RequestData } from '../utils/client/types'\nimport { App, useApiClient } from './use_api_client'\nimport { getRequestQueryKey } from './use_suspense_api'\n\ninterface ApiGetOptions extends GetRequest {\n app?: App\n enabled?: boolean\n}\n\nexport const useApiGet = <T extends ResourceObject | ResourceObject[]>(args: ApiGetOptions) => {\n type Resource = ApiResource<T>\n\n const { data, ...query } = useQuery<Resource, Response>({\n queryKey: getRequestQueryKey(args),\n enabled: args.enabled,\n })\n\n return { ...data, ...query }\n}\n\ntype NextMeta = Partial<{\n offset: string\n idLt: string\n}>\n\nexport type SuspensePaginatorOptions = Omit<\n AnyUseSuspenseInfiniteQueryOptions,\n 'getNextPageParam' | 'initialPageParam' | 'queryFn' | 'queryKey'\n>\n\nexport const useApiPaginator = <T extends ResourceObject>(\n args: ApiGetOptions,\n opts?: SuspensePaginatorOptions\n) => {\n const apiClient = useApiClient()\n const query = useInfiniteQuery<\n ApiCollection<T>,\n Response,\n InfiniteData<ApiCollection<T>>,\n any,\n Partial<RequestData> | undefined\n >({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ pageParam }) => {\n const pageParmWhere = pageParam?.where || {}\n const argsWhere = args.data.where || {}\n const where = { ...argsWhere, ...pageParmWhere }\n const app = args.app || 'chat'\n const offset = pageParam?.offset || args.data.offset\n const data = { ...args.data, where, offset }\n\n return apiClient[app].get({\n url: args.url,\n data,\n })\n },\n initialPageParam: {} as Partial<RequestData>,\n getNextPageParam: lastPage => {\n const next: NextMeta = lastPage.meta?.next || {}\n const { offset, idLt } = next\n\n if (idLt) return { where: { id_lt: idLt } }\n if (offset) return { offset: Number(offset) }\n\n return undefined\n },\n enabled: args.enabled,\n ...(opts || {}),\n })\n\n const data: T[] = query.data?.pages?.flatMap(page => page.data) || []\n\n return { ...query, data }\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  import { Client } from '../utils/client';
2
- type App = 'chat' | 'groups' | 'services';
2
+ export type App = 'chat' | 'groups' | 'services';
3
3
  export type ApiClient = {
4
4
  [_K in App]: Client;
5
5
  };
6
6
  export declare const useApiClient: () => ApiClient;
7
- export {};
8
7
  //# sourceMappingURL=use_api_client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_api_client.d.ts","sourceRoot":"","sources":["../../src/hooks/use_api_client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,KAAK,GAAG,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAA;AAGzC,MAAM,MAAM,SAAS,GAAG;KAAG,EAAE,IAAI,GAAG,GAAG,MAAM;CAAE,CAAA;AAE/C,eAAO,MAAM,YAAY,iBAiBxB,CAAA"}
1
+ {"version":3,"file":"use_api_client.d.ts","sourceRoot":"","sources":["../../src/hooks/use_api_client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAA;AAGhD,MAAM,MAAM,SAAS,GAAG;KAAG,EAAE,IAAI,GAAG,GAAG,MAAM;CAAE,CAAA;AAE/C,eAAO,MAAM,YAAY,iBAiBxB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"use_api_client.js","sourceRoot":"","sources":["../../src/hooks/use_api_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAGxC,MAAM,IAAI,GAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;AAIlD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IACnE,MAAM,GAAG,GAAG,OAAO,CACjB,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACvB,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,MAAM,CAAC;YACpB,GAAG;YACH,OAAO;YACP,OAAO,EAAE,YAAY;YACrB,sBAAsB;SACvB,CAAC,CAAA;QACF,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAe,CAAC,EACrB,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAClC,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA","sourcesContent":["import { useContext, useMemo } from 'react'\nimport { ChatContext } from '../contexts/chat_context'\nimport { Client } from '../utils/client'\n\ntype App = 'chat' | 'groups' | 'services'\nconst apps: App[] = ['chat', 'groups', 'services']\n\nexport type ApiClient = { [_K in App]: Client }\n\nexport const useApiClient = () => {\n const { session, onUnauthorizedResponse } = useContext(ChatContext)\n const api = useMemo(\n () =>\n apps.reduce((acc, app) => {\n acc[app] = new Client({\n app,\n session,\n version: '2018-11-01',\n onUnauthorizedResponse,\n })\n return acc\n }, {} as ApiClient),\n [session, onUnauthorizedResponse]\n )\n\n return api\n}\n"]}
1
+ {"version":3,"file":"use_api_client.js","sourceRoot":"","sources":["../../src/hooks/use_api_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAGxC,MAAM,IAAI,GAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;AAIlD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IACnE,MAAM,GAAG,GAAG,OAAO,CACjB,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACvB,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,MAAM,CAAC;YACpB,GAAG;YACH,OAAO;YACP,OAAO,EAAE,YAAY;YACrB,sBAAsB;SACvB,CAAC,CAAA;QACF,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAe,CAAC,EACrB,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAClC,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA","sourcesContent":["import { useContext, useMemo } from 'react'\nimport { ChatContext } from '../contexts/chat_context'\nimport { Client } from '../utils/client'\n\nexport type App = 'chat' | 'groups' | 'services'\nconst apps: App[] = ['chat', 'groups', 'services']\n\nexport type ApiClient = { [_K in App]: Client }\n\nexport const useApiClient = () => {\n const { session, onUnauthorizedResponse } = useContext(ChatContext)\n const api = useMemo(\n () =>\n apps.reduce((acc, app) => {\n acc[app] = new Client({\n app,\n session,\n version: '2018-11-01',\n onUnauthorizedResponse,\n })\n return acc\n }, {} as ApiClient),\n [session, onUnauthorizedResponse]\n )\n\n return api\n}\n"]}
@@ -8,6 +8,7 @@ export declare const getConversationRequestArgs: ({ conversation_id }: {
8
8
  Conversation: string[];
9
9
  MemberAbility: string[];
10
10
  ConversationBadge: string[];
11
+ Group: string[];
11
12
  };
12
13
  include: string[];
13
14
  };
@@ -119,4 +120,82 @@ export declare const useConversationMute: ({ conversation_id }: {
119
120
  export declare const useConversationUpdate: ({ conversation_id }: {
120
121
  conversation_id: number;
121
122
  }) => import("@tanstack/react-query").UseMutationResult<ApiResource<ConversationResource>, Error, Partial<ConversationResource>, void>;
123
+ export declare const useConversationDelete: ({ conversation_id }: {
124
+ conversation_id: number;
125
+ }) => import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
126
+ export declare const useConversationDisableReplies: ({ conversation_id }: {
127
+ conversation_id: number;
128
+ }) => {
129
+ data: undefined;
130
+ variables: undefined;
131
+ error: null;
132
+ isError: false;
133
+ isIdle: true;
134
+ isPending: false;
135
+ isSuccess: false;
136
+ status: "idle";
137
+ reset: () => void;
138
+ context: ApiResource<ConversationResource> | undefined;
139
+ failureCount: number;
140
+ failureReason: Error | null;
141
+ isPaused: boolean;
142
+ submittedAt: number;
143
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, ApiResource<ConversationResource>>;
144
+ repliesDisabled: boolean;
145
+ setRepliesDisabled: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, ApiResource<ConversationResource>>;
146
+ } | {
147
+ data: undefined;
148
+ variables: boolean;
149
+ error: null;
150
+ isError: false;
151
+ isIdle: false;
152
+ isPending: true;
153
+ isSuccess: false;
154
+ status: "pending";
155
+ reset: () => void;
156
+ context: ApiResource<ConversationResource> | undefined;
157
+ failureCount: number;
158
+ failureReason: Error | null;
159
+ isPaused: boolean;
160
+ submittedAt: number;
161
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, ApiResource<ConversationResource>>;
162
+ repliesDisabled: boolean;
163
+ setRepliesDisabled: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, ApiResource<ConversationResource>>;
164
+ } | {
165
+ data: undefined;
166
+ error: Error;
167
+ variables: boolean;
168
+ isError: true;
169
+ isIdle: false;
170
+ isPending: false;
171
+ isSuccess: false;
172
+ status: "error";
173
+ reset: () => void;
174
+ context: ApiResource<ConversationResource> | undefined;
175
+ failureCount: number;
176
+ failureReason: Error | null;
177
+ isPaused: boolean;
178
+ submittedAt: number;
179
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, ApiResource<ConversationResource>>;
180
+ repliesDisabled: boolean;
181
+ setRepliesDisabled: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, ApiResource<ConversationResource>>;
182
+ } | {
183
+ data: ApiResource<ConversationResource>;
184
+ error: null;
185
+ variables: boolean;
186
+ isError: false;
187
+ isIdle: false;
188
+ isPending: false;
189
+ isSuccess: true;
190
+ status: "success";
191
+ reset: () => void;
192
+ context: ApiResource<ConversationResource> | undefined;
193
+ failureCount: number;
194
+ failureReason: Error | null;
195
+ isPaused: boolean;
196
+ submittedAt: number;
197
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationResource>, Error, boolean, ApiResource<ConversationResource>>;
198
+ repliesDisabled: boolean;
199
+ setRepliesDisabled: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationResource>, Error, boolean, ApiResource<ConversationResource>>;
200
+ };
122
201
  //# sourceMappingURL=use_conversation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use_conversation.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAK5D,eAAO,MAAM,0BAA0B,wBAAyB;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;CAyBzF,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;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