@tactics/toddle-styleguide 1.2.6 → 1.2.8

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 (236) hide show
  1. package/App.tsx +13 -0
  2. package/index.d.ts +3 -1
  3. package/index.tsx +50 -46
  4. package/package.json +1 -1
  5. package/src/components/atoms/backdrop/backdrop.component.d.ts +7 -4
  6. package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +628 -1810
  7. package/src/components/atoms/calendar/calendar.component.d.ts +11 -6
  8. package/src/components/atoms/check-switch/check-switch.component.d.ts +3 -3
  9. package/src/components/atoms/footer/footer.component.d.ts +6 -6
  10. package/src/components/atoms/heading-components/all-caps-heading/all-caps-heading.component.d.ts +10 -2
  11. package/src/components/atoms/heading-components/heading1/heading1.component.d.ts +10 -2
  12. package/src/components/atoms/heading-components/heading2/heading2.component.d.ts +10 -2
  13. package/src/components/atoms/heading-components/heading3/heading3.component.d.ts +10 -2
  14. package/src/components/atoms/heading-components/heading4/heading4.component.d.ts +10 -2
  15. package/src/components/atoms/heading-components/index.d.ts +6 -6
  16. package/src/components/atoms/image-bubble/image-bubble.component.d.ts +9 -6
  17. package/src/components/atoms/increment-input/increment-input.component.d.ts +8 -4
  18. package/src/components/atoms/logo/logo.component.d.ts +4 -4
  19. package/src/components/atoms/paragraph-components/index.d.ts +4 -4
  20. package/src/components/atoms/paragraph-components/paragraph/paragraph.component.d.ts +10 -2
  21. package/src/components/atoms/paragraph-components/small-text/small-text.component.d.ts +10 -2
  22. package/src/components/atoms/paragraph-components/tiny-text/tiny-text.component.d.ts +10 -2
  23. package/src/components/atoms/quick-message/__snapshots__/quick-message.test.js.snap +72 -0
  24. package/src/components/atoms/quick-message/quick-message.component.d.ts +11 -0
  25. package/src/components/atoms/quick-message/quick-message.component.tsx +32 -0
  26. package/src/components/atoms/quick-message/quick-message.preview.d.ts +1 -0
  27. package/src/components/atoms/quick-message/quick-message.preview.tsx +33 -0
  28. package/src/components/atoms/quick-message/quick-message.styles.d.ts +14 -0
  29. package/src/components/atoms/quick-message/quick-message.styles.js +18 -0
  30. package/src/components/atoms/quick-message/quick-message.test.js +26 -0
  31. package/src/components/atoms/split-container/split-container.component.d.ts +7 -4
  32. package/src/components/atoms/static-wave/static-wave.component.d.ts +11 -6
  33. package/src/components/atoms/text-input/text-input.component.d.ts +10 -6
  34. package/src/components/atoms/text-input/text-input.preview.d.ts +1 -1
  35. package/src/components/molecules/avatar/avatar.component.d.ts +18 -11
  36. package/src/components/molecules/blocked-message/blocked-message.component.d.ts +4 -2
  37. package/src/components/molecules/button/__snapshots__/button.test.js.snap +72 -0
  38. package/src/components/molecules/button/button.component.d.ts +21 -12
  39. package/src/components/molecules/button/button.component.tsx +8 -15
  40. package/src/components/molecules/button/button.preview.tsx +5 -0
  41. package/src/components/molecules/button/button.styles.d.ts +17 -13
  42. package/src/components/molecules/button/button.test.js +6 -0
  43. package/src/components/molecules/calendar-select/calendar-select.component.d.ts +12 -7
  44. package/src/components/molecules/cancel-link/cancel-link.component.d.ts +4 -4
  45. package/src/components/molecules/checkbox/checkbox.component.d.ts +9 -5
  46. package/src/components/molecules/contact-role/contact-role.component.d.ts +6 -3
  47. package/src/components/molecules/date-input/date-input.component.d.ts +7 -4
  48. package/src/components/molecules/day/day.component.d.ts +6 -6
  49. package/src/components/molecules/default-select/default-select.component.d.ts +6 -3
  50. package/src/components/molecules/department_logo/department-logo.component.d.ts +5 -3
  51. package/src/components/molecules/failed-to-send/__snapshots__/failed-bubble.test.js.snap +2 -0
  52. package/src/components/molecules/failed-to-send/failed-bubble.component.d.ts +11 -5
  53. package/src/components/molecules/failed-to-send/failed-bubble.component.tsx +6 -4
  54. package/src/components/molecules/failed-to-send/failed-bubble.test.js +56 -0
  55. package/src/components/molecules/filter-range/filter-range.component.d.ts +14 -7
  56. package/src/components/molecules/filter-tab/filter-tab.component.d.ts +11 -6
  57. package/src/components/molecules/filter-tab/filter-tab.component.tsx +9 -5
  58. package/src/components/molecules/filter-tab/filter-tab.preview.tsx +2 -2
  59. package/src/components/molecules/filter-tab/filter-tab.test.js +2 -2
  60. package/src/components/molecules/info/info.component.d.ts +4 -4
  61. package/src/components/molecules/language-button/language-button.component.d.ts +8 -4
  62. package/src/components/molecules/message-input/message-input.component.d.ts +11 -7
  63. package/src/components/molecules/more-info-button/more-info-button.component.d.ts +8 -4
  64. package/src/components/molecules/password-input/password-input.component.d.ts +9 -5
  65. package/src/components/molecules/pill/pill.component.d.ts +5 -5
  66. package/src/components/molecules/pressable-icon/pressable-icon.component.d.ts +10 -5
  67. package/src/components/molecules/quick-filter/quick-filter.component.d.ts +16 -9
  68. package/src/components/molecules/search-input/search.component.d.ts +14 -8
  69. package/src/components/molecules/search-input/search.preview.d.ts +1 -1
  70. package/src/components/molecules/select-link/select-link.component.d.ts +4 -4
  71. package/src/components/molecules/select-list-item/select-list-item.component.d.ts +13 -7
  72. package/src/components/molecules/select-picker/select-picker.component.d.ts +13 -8
  73. package/src/components/molecules/send-bubble/__snapshots__/send-text-bubble.test.js.snap +12 -0
  74. package/src/components/molecules/send-bubble/send-text-bubble.component.d.ts +17 -9
  75. package/src/components/molecules/send-bubble/send-text-bubble.component.tsx +17 -6
  76. package/src/components/molecules/send-bubble/send-text-bubble.test.js +71 -0
  77. package/src/components/molecules/snackbar/snackbar.component.d.ts +5 -5
  78. package/src/components/molecules/swipe/swipe.component.d.ts +5 -5
  79. package/src/components/molecules/tag/tag.component.d.ts +11 -5
  80. package/src/components/molecules/time-picker/time-picker.component.d.ts +10 -5
  81. package/src/components/molecules/time-tracker/time-tracker.component.d.ts +10 -6
  82. package/src/components/molecules/timeline/timeline.component.d.ts +6 -3
  83. package/src/components/molecules/timestamp/timestamp.component.d.ts +3 -3
  84. package/src/components/molecules/wave-background/wave.component.d.ts +7 -2
  85. package/src/components/molecules/wide-button/wide-button.component.d.ts +11 -6
  86. package/src/components/organisms/child-list-item/__snapshots__/child-list-item.test.js.snap +0 -4
  87. package/src/components/organisms/child-list-item/child-list-item.component.d.ts +32 -17
  88. package/src/components/organisms/child-list-item/child-list-item.preview.tsx +1 -0
  89. package/src/components/organisms/child-list-item/child-list-item.styles.js +0 -2
  90. package/src/components/organisms/contact-item/contact-item.component.d.ts +11 -6
  91. package/src/components/organisms/day-select/day-select.component.d.ts +10 -6
  92. package/src/components/organisms/day-select/day-select.component.tsx +5 -1
  93. package/src/components/organisms/loading-indicator/animation-style.animate.d.ts +13 -3
  94. package/src/components/organisms/loading-indicator/dot.component.d.ts +3 -3
  95. package/src/components/organisms/loading-indicator/loading-indicator.component.d.ts +9 -2
  96. package/src/components/organisms/my-child-list-item/__snapshots__/my-child-list-item.test.js.snap +0 -2
  97. package/src/components/organisms/my-child-list-item/my-child-list-item.component.d.ts +18 -10
  98. package/src/components/organisms/my-child-list-item/my-child-list-item.preview.tsx +1 -0
  99. package/src/components/organisms/my-child-list-item/my-child-list-item.styles.js +0 -1
  100. package/src/components/organisms/person-info-card/person-info-card.component.d.ts +18 -9
  101. package/src/components/organisms/person-info-card/person-info-card.component.tsx +3 -0
  102. package/src/components/organisms/tab-view/__snapshots__/tab-view.test.js.snap +421 -0
  103. package/src/components/organisms/tab-view/tab-view.component.d.ts +15 -0
  104. package/src/components/organisms/tab-view/tab-view.component.tsx +48 -0
  105. package/src/components/organisms/tab-view/tab-view.preview.d.ts +1 -0
  106. package/src/components/organisms/tab-view/tab-view.preview.tsx +36 -0
  107. package/src/components/organisms/tab-view/tab-view.styles.d.ts +10 -0
  108. package/src/components/organisms/tab-view/tab-view.styles.js +14 -0
  109. package/src/components/organisms/tab-view/tab-view.test.js +37 -0
  110. package/src/components/organisms/text-bubble/__snapshots__/text-bubble.test.js.snap +21 -0
  111. package/src/components/organisms/text-bubble/text-bubble.component.d.ts +24 -13
  112. package/src/components/organisms/text-bubble/text-bubble.component.tsx +15 -5
  113. package/src/components/organisms/text-bubble/text-bubble.preview.tsx +6 -1
  114. package/src/components/organisms/text-bubble/text-bubble.styles.d.ts +5 -5
  115. package/src/components/organisms/text-bubble/text-bubble.styles.js +2 -0
  116. package/src/components/organisms/text-bubble/text-bubble.test.js +7 -0
  117. package/src/components/templates/modal/components/fade-panel.component.d.ts +16 -8
  118. package/src/components/templates/modal/modal.component.d.ts +14 -7
  119. package/src/components/templates/popover/components/foreground/foreground.component.d.ts +4 -4
  120. package/src/components/templates/popover/components/modal/close/close.component.d.ts +4 -4
  121. package/src/components/templates/popover/components/modal/heading/heading.component.d.ts +4 -4
  122. package/src/components/templates/popover/components/modal/modal.component.d.ts +17 -8
  123. package/src/components/templates/popover/components/modal/modal.component.tsx +8 -2
  124. package/src/components/templates/popover/components/modal/scroll-content/scroll-content.component.d.ts +5 -3
  125. package/src/components/templates/popover/popover.component.d.ts +15 -7
  126. package/src/components/templates/popover/popover.component.tsx +3 -0
  127. package/src/components/templates/popover-action/popover-action.component.d.ts +8 -4
  128. package/src/context/loading-dots.context.d.ts +9 -6
  129. package/src/context/theme.context.d.ts +47 -47
  130. package/src/gradients/main/main.gradient.d.ts +4 -2
  131. package/src/icons/index.d.ts +7 -2
  132. package/src/icons/outline/calendar/calendar.icon.d.ts +2 -2
  133. package/src/icons/outline/chat/chat.icon.d.ts +2 -2
  134. package/src/icons/outline/chat-alt/chat-alt.icon.d.ts +2 -2
  135. package/src/icons/outline/check-circle/check-circle.icon.d.ts +5 -2
  136. package/src/icons/outline/chevron-left/chevron-left.icon.d.ts +5 -2
  137. package/src/icons/outline/chevron-right/chevron-right.icon.d.ts +5 -2
  138. package/src/icons/outline/clock/clock.icon.d.ts +2 -2
  139. package/src/icons/outline/cloud-download/cloud-download.icon.d.ts +5 -2
  140. package/src/icons/outline/currency-euro/currency-euro.icon.d.ts +5 -2
  141. package/src/icons/outline/document-text/document-text.icon.d.ts +5 -2
  142. package/src/icons/outline/exclamation/exclamation.icon.d.ts +5 -2
  143. package/src/icons/outline/exclamation-circle/exclamation-circle.icon.d.ts +5 -2
  144. package/src/icons/outline/eye/eye.icon.d.ts +2 -2
  145. package/src/icons/outline/eye-off/eye-off.icon.d.ts +2 -2
  146. package/src/icons/outline/filter/filter.icon.d.ts +2 -2
  147. package/src/icons/outline/information-circle/information-circle.icon.d.ts +5 -2
  148. package/src/icons/outline/logout/logout.icon.d.ts +2 -2
  149. package/src/icons/outline/mail/mail.icon.d.ts +2 -2
  150. package/src/icons/outline/mail-open/mail-open.icon.d.ts +2 -2
  151. package/src/icons/outline/menu/menu.icon.d.ts +2 -2
  152. package/src/icons/outline/minus-sm/minus-sm.icon.d.ts +5 -2
  153. package/src/icons/outline/office-building/office-building.icon.d.ts +5 -2
  154. package/src/icons/outline/outline.d.ts +6 -2
  155. package/src/icons/outline/paper-airplane/paper-airplane.icon.d.ts +5 -2
  156. package/src/icons/outline/paperclip/paperclip.icon.d.ts +5 -2
  157. package/src/icons/outline/pencil/pencil.icon.d.ts +2 -2
  158. package/src/icons/outline/phone/phone.icon.d.ts +2 -2
  159. package/src/icons/outline/plus/plus.icon.d.ts +2 -2
  160. package/src/icons/outline/plus-sm/plus-sm.icon.d.ts +5 -2
  161. package/src/icons/outline/qrcode/qrcode.icon.d.ts +2 -2
  162. package/src/icons/outline/refresh/refresh.icon.d.ts +2 -2
  163. package/src/icons/outline/search/search.icon.d.ts +2 -2
  164. package/src/icons/outline/selector/selector.icon.d.ts +2 -2
  165. package/src/icons/outline/sm-view-grid-add/sm-view-grid-add.icon.d.ts +5 -2
  166. package/src/icons/outline/status-online/status-online.icon.d.ts +5 -2
  167. package/src/icons/outline/thumb-up/thumb-up.icon.d.ts +2 -2
  168. package/src/icons/outline/trash/trash.icon.d.ts +2 -2
  169. package/src/icons/outline/user/user.icon.d.ts +2 -2
  170. package/src/icons/outline/user-group/user-group.icon.d.ts +5 -2
  171. package/src/icons/outline/users/users.icon.d.ts +2 -2
  172. package/src/icons/outline/xmark/xmark.icon.d.ts +2 -2
  173. package/src/icons/solid/calendar/calendar.icon.d.ts +2 -2
  174. package/src/icons/solid/chat/chat.icon.d.ts +2 -2
  175. package/src/icons/solid/chat-alt/chat-alt-solid.icon.d.ts +2 -2
  176. package/src/icons/solid/check-circle/check-circle.icon.d.ts +5 -2
  177. package/src/icons/solid/chevron-left/chevron-left.icon.d.ts +5 -2
  178. package/src/icons/solid/chevron-right/chevron-right.icon.d.ts +5 -2
  179. package/src/icons/solid/clock/clock-solid.icon.d.ts +2 -2
  180. package/src/icons/solid/cloud-download/cloud-download.icon.d.ts +5 -2
  181. package/src/icons/solid/currency-euro/currency-euro.icon.d.ts +5 -2
  182. package/src/icons/solid/document-text/document-text-solid.icon.d.ts +5 -2
  183. package/src/icons/solid/exclamation/exclamation.icon.d.ts +5 -2
  184. package/src/icons/solid/exclamation-circle/exclamation-circle.icon.d.ts +5 -2
  185. package/src/icons/solid/eye/eye.icon.d.ts +2 -2
  186. package/src/icons/solid/eye-off/eye-off.icon.d.ts +2 -2
  187. package/src/icons/solid/filter/filter.icon.d.ts +2 -2
  188. package/src/icons/solid/information-circle/information-circle-solid.icon.d.ts +5 -2
  189. package/src/icons/solid/logout/logout.icon.d.ts +2 -2
  190. package/src/icons/solid/mail/mail.icon.d.ts +2 -2
  191. package/src/icons/solid/mail-open/mail-open.icon.d.ts +2 -2
  192. package/src/icons/solid/menu/menu.icon.d.ts +2 -2
  193. package/src/icons/solid/minus-sm/minus-sm.icon.d.ts +5 -2
  194. package/src/icons/solid/office-building/office-building.icon.d.ts +5 -2
  195. package/src/icons/solid/paper-airplane/paper-airplane.icon.d.ts +5 -2
  196. package/src/icons/solid/paperclip/paperclip.icon.d.ts +5 -2
  197. package/src/icons/solid/pencil/pencil-solid.icon.d.ts +2 -2
  198. package/src/icons/solid/phone/phone-solid.icon.d.ts +2 -2
  199. package/src/icons/solid/plus/plus.icon.d.ts +2 -2
  200. package/src/icons/solid/plus-sm/plus-sm.icon.d.ts +5 -2
  201. package/src/icons/solid/qrcode/qrcode.icon.d.ts +2 -2
  202. package/src/icons/solid/refresh/refresh-solid.icon.d.ts +2 -2
  203. package/src/icons/solid/search/search.icon.d.ts +2 -2
  204. package/src/icons/solid/selector/selector.icon.d.ts +2 -2
  205. package/src/icons/solid/sm-view-grid-add/sm-view-grid-add.icon.d.ts +5 -2
  206. package/src/icons/solid/solid.d.ts +6 -2
  207. package/src/icons/solid/status-online/status-online-solid.icon.d.ts +5 -2
  208. package/src/icons/solid/thumb-up/thumb-up.icon.d.ts +2 -2
  209. package/src/icons/solid/trash/trash-solid.icon.d.ts +2 -2
  210. package/src/icons/solid/user/user.icon.d.ts +2 -2
  211. package/src/icons/solid/user-group/user-group.icon.d.ts +5 -2
  212. package/src/icons/solid/users/users-solid.icon.d.ts +2 -2
  213. package/src/icons/solid/xmark/xmark.icon.d.ts +2 -2
  214. package/src/interfaces/icon.interface.d.ts +5 -5
  215. package/src/models/hex-color.model.d.ts +4 -4
  216. package/src/models/initials.model.d.ts +5 -5
  217. package/src/theme/font/font.d.ts +70 -70
  218. package/src/theme/font/index.d.ts +3 -3
  219. package/src/theme/provider/index.d.ts +3 -3
  220. package/src/theme/provider/parent.theme.d.ts +45 -45
  221. package/src/theme/provider/staff-member.theme.d.ts +45 -45
  222. package/src/theme/responsive/index.d.ts +5 -2
  223. package/src/theme/scale/index.d.ts +10 -10
  224. package/src/types/bubble-alignment.enum.d.ts +2 -2
  225. package/src/types/icontype.type.d.ts +41 -1
  226. package/src/types/keyboard-types.enum.d.ts +7 -7
  227. package/src/types/loading-dots.type.d.ts +6 -6
  228. package/src/types/size.enum.d.ts +3 -3
  229. package/src/types/text-properties.type.d.ts +8 -8
  230. package/src/types/visual-state.enum.d.ts +5 -5
  231. package/src/utilities/color-handler/color-handler.d.ts +6 -2
  232. package/src/utilities/toddle-datetime/interfaces/duration.interface.d.ts +18 -18
  233. package/src/utilities/toddle-datetime/interfaces/toddle-datetime.interface.d.ts +14 -14
  234. package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +92 -40
  235. package/src/utilities/toddle-datetime/types/duration-like.type.d.ts +1 -1
  236. package/src/utilities/toddle-datetime/types/toddle-datetime.type.d.ts +11 -2
@@ -1,11 +1,18 @@
1
- import { VisualState } from '../../../types/visual-state.enum';
1
+ import {VisualState} from '../../../types/visual-state.enum';
2
2
  type QuickFilterProps = {
3
- id: string;
4
- isLoading: boolean;
5
- amount: number;
6
- isSelected?: boolean;
7
- onSelect: (id: string) => void;
8
- visualState: VisualState;
3
+ id: string;
4
+ isLoading: boolean;
5
+ amount: number;
6
+ isSelected?: boolean;
7
+ onSelect: (id: string) => void;
8
+ visualState: VisualState;
9
9
  };
10
- declare const QuickFilter: ({ id, isLoading, amount, isSelected, onSelect, visualState, }: QuickFilterProps) => JSX.Element;
11
- export { QuickFilter as QuickFilter };
10
+ declare const QuickFilter: ({
11
+ id,
12
+ isLoading,
13
+ amount,
14
+ isSelected,
15
+ onSelect,
16
+ visualState,
17
+ }: QuickFilterProps) => JSX.Element;
18
+ export {QuickFilter as QuickFilter};
@@ -1,10 +1,16 @@
1
- import { KeyBoardTypes } from '../../../types/keyboard-types.enum';
1
+ import {KeyBoardTypes} from '../../../types/keyboard-types.enum';
2
2
  type SearchProps = {
3
- placeholder?: string;
4
- onchangeText?: (text: string) => void;
5
- value: string;
6
- keyboardType: KeyBoardTypes;
7
- onPressSearch: (text: string) => void;
3
+ placeholder?: string;
4
+ onchangeText?: (text: string) => void;
5
+ value: string;
6
+ keyboardType: KeyBoardTypes;
7
+ onPressSearch: (text: string) => void;
8
8
  };
9
- declare const Search: ({ placeholder, onchangeText, value, keyboardType, onPressSearch, }: SearchProps) => JSX.Element;
10
- export { Search as Search };
9
+ declare const Search: ({
10
+ placeholder,
11
+ onchangeText,
12
+ value,
13
+ keyboardType,
14
+ onPressSearch,
15
+ }: SearchProps) => JSX.Element;
16
+ export {Search as Search};
@@ -1 +1 @@
1
- export declare const SearchPreview: ({}?: {}) => JSX.Element;
1
+ export declare const SearchPreview: ({}: {}) => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  type SelectLinkProps = {
2
- label: string;
3
- onPress: () => void;
2
+ label: string;
3
+ onPress: () => void;
4
4
  };
5
- declare const SelectLink: ({ label, onPress }: SelectLinkProps) => JSX.Element;
6
- export { SelectLink as SelectLink };
5
+ declare const SelectLink: ({label, onPress}: SelectLinkProps) => JSX.Element;
6
+ export {SelectLink as SelectLink};
@@ -1,10 +1,16 @@
1
1
  import * as React from 'react';
2
2
  type SelectListProps = {
3
- title: string;
4
- subtitle?: string;
5
- icon: React.ReactElement;
6
- onPress?: () => void;
7
- inverse?: boolean;
3
+ title: string;
4
+ subtitle?: string;
5
+ icon: React.ReactElement;
6
+ onPress?: () => void;
7
+ inverse?: boolean;
8
8
  };
9
- declare const SelectListItem: ({ title, subtitle, icon, onPress, inverse, }: SelectListProps) => JSX.Element;
10
- export { SelectListItem as SelectListItem };
9
+ declare const SelectListItem: ({
10
+ title,
11
+ subtitle,
12
+ icon,
13
+ onPress,
14
+ inverse,
15
+ }: SelectListProps) => JSX.Element;
16
+ export {SelectListItem as SelectListItem};
@@ -1,11 +1,16 @@
1
1
  type PickerProps = {
2
- placeholder?: string;
3
- data: {
4
- value: number | string;
5
- label: string;
6
- }[];
7
- onChange: (item: string) => void;
8
- defaultValue: string;
2
+ placeholder?: string;
3
+ data: {
4
+ value: number | string;
5
+ label: string;
6
+ }[];
7
+ onChange: (item: string) => void;
8
+ defaultValue: string;
9
9
  };
10
- export declare const SelectPicker: ({ placeholder, data, onChange, defaultValue, }: PickerProps) => JSX.Element;
10
+ export declare const SelectPicker: ({
11
+ placeholder,
12
+ data,
13
+ onChange,
14
+ defaultValue,
15
+ }: PickerProps) => JSX.Element;
11
16
  export {};
@@ -110,6 +110,7 @@ exports[`Failed text bubble test shows a DEFAULT RECEIVED text bubble that is sw
110
110
  onResponderTerminate={[Function]}
111
111
  onResponderTerminationRequest={[Function]}
112
112
  onStartShouldSetResponder={[Function]}
113
+ testID="edit-button"
113
114
  >
114
115
  <RNSVGSvgView
115
116
  align="xMidYMid"
@@ -210,6 +211,7 @@ exports[`Failed text bubble test shows a DEFAULT RECEIVED text bubble that is sw
210
211
  onResponderTerminate={[Function]}
211
212
  onResponderTerminationRequest={[Function]}
212
213
  onStartShouldSetResponder={[Function]}
214
+ testID="delete-button"
213
215
  >
214
216
  <RNSVGSvgView
215
217
  align="xMidYMid"
@@ -440,6 +442,7 @@ exports[`Failed text bubble test shows a DEFAULT SENT text bubble that is swipea
440
442
  onResponderTerminate={[Function]}
441
443
  onResponderTerminationRequest={[Function]}
442
444
  onStartShouldSetResponder={[Function]}
445
+ testID="edit-button"
443
446
  >
444
447
  <RNSVGSvgView
445
448
  align="xMidYMid"
@@ -540,6 +543,7 @@ exports[`Failed text bubble test shows a DEFAULT SENT text bubble that is swipea
540
543
  onResponderTerminate={[Function]}
541
544
  onResponderTerminationRequest={[Function]}
542
545
  onStartShouldSetResponder={[Function]}
546
+ testID="delete-button"
543
547
  >
544
548
  <RNSVGSvgView
545
549
  align="xMidYMid"
@@ -770,6 +774,7 @@ exports[`Failed text bubble test shows a WARNING RECEIVED text bubble that is sw
770
774
  onResponderTerminate={[Function]}
771
775
  onResponderTerminationRequest={[Function]}
772
776
  onStartShouldSetResponder={[Function]}
777
+ testID="edit-button"
773
778
  >
774
779
  <RNSVGSvgView
775
780
  align="xMidYMid"
@@ -870,6 +875,7 @@ exports[`Failed text bubble test shows a WARNING RECEIVED text bubble that is sw
870
875
  onResponderTerminate={[Function]}
871
876
  onResponderTerminationRequest={[Function]}
872
877
  onStartShouldSetResponder={[Function]}
878
+ testID="delete-button"
873
879
  >
874
880
  <RNSVGSvgView
875
881
  align="xMidYMid"
@@ -1100,6 +1106,7 @@ exports[`Failed text bubble test shows a WARNING SENT text bubble that is swipea
1100
1106
  onResponderTerminate={[Function]}
1101
1107
  onResponderTerminationRequest={[Function]}
1102
1108
  onStartShouldSetResponder={[Function]}
1109
+ testID="edit-button"
1103
1110
  >
1104
1111
  <RNSVGSvgView
1105
1112
  align="xMidYMid"
@@ -1200,6 +1207,7 @@ exports[`Failed text bubble test shows a WARNING SENT text bubble that is swipea
1200
1207
  onResponderTerminate={[Function]}
1201
1208
  onResponderTerminationRequest={[Function]}
1202
1209
  onStartShouldSetResponder={[Function]}
1210
+ testID="delete-button"
1203
1211
  >
1204
1212
  <RNSVGSvgView
1205
1213
  align="xMidYMid"
@@ -1430,6 +1438,7 @@ exports[`Failed text bubble test shows an ERROR RECEIVED text bubble that is swi
1430
1438
  onResponderTerminate={[Function]}
1431
1439
  onResponderTerminationRequest={[Function]}
1432
1440
  onStartShouldSetResponder={[Function]}
1441
+ testID="edit-button"
1433
1442
  >
1434
1443
  <RNSVGSvgView
1435
1444
  align="xMidYMid"
@@ -1530,6 +1539,7 @@ exports[`Failed text bubble test shows an ERROR RECEIVED text bubble that is swi
1530
1539
  onResponderTerminate={[Function]}
1531
1540
  onResponderTerminationRequest={[Function]}
1532
1541
  onStartShouldSetResponder={[Function]}
1542
+ testID="delete-button"
1533
1543
  >
1534
1544
  <RNSVGSvgView
1535
1545
  align="xMidYMid"
@@ -1760,6 +1770,7 @@ exports[`Failed text bubble test shows an ERROR SENT text bubble that is swipeab
1760
1770
  onResponderTerminate={[Function]}
1761
1771
  onResponderTerminationRequest={[Function]}
1762
1772
  onStartShouldSetResponder={[Function]}
1773
+ testID="edit-button"
1763
1774
  >
1764
1775
  <RNSVGSvgView
1765
1776
  align="xMidYMid"
@@ -1860,6 +1871,7 @@ exports[`Failed text bubble test shows an ERROR SENT text bubble that is swipeab
1860
1871
  onResponderTerminate={[Function]}
1861
1872
  onResponderTerminationRequest={[Function]}
1862
1873
  onStartShouldSetResponder={[Function]}
1874
+ testID="delete-button"
1863
1875
  >
1864
1876
  <RNSVGSvgView
1865
1877
  align="xMidYMid"
@@ -1,11 +1,19 @@
1
- import { BubbleAlignment } from '../../../types/bubble-alignment.enum';
2
- import { VisualState } from '../../../types/visual-state.enum';
1
+ import {BubbleAlignment} from '../../../types/bubble-alignment.enum';
2
+ import {VisualState} from '../../../types/visual-state.enum';
3
3
  type FailedBubbleProps = {
4
- text: string;
5
- visualState: VisualState;
6
- bubbleAlignment: BubbleAlignment;
7
- onPressEdit: () => void;
8
- onPressDelete: () => void;
4
+ id: string;
5
+ text: string;
6
+ visualState: VisualState;
7
+ bubbleAlignment: BubbleAlignment;
8
+ onPressEdit: (id: string) => void;
9
+ onPressDelete: (id: string) => void;
9
10
  };
10
- declare const SendTextBubble: ({ text, visualState, bubbleAlignment, onPressEdit, onPressDelete, }: FailedBubbleProps) => JSX.Element;
11
- export { SendTextBubble };
11
+ declare const SendTextBubble: ({
12
+ id,
13
+ text,
14
+ visualState,
15
+ bubbleAlignment,
16
+ onPressEdit,
17
+ onPressDelete,
18
+ }: FailedBubbleProps) => JSX.Element;
19
+ export {SendTextBubble};
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import {useContext} from 'react';
2
+ import {useContext, useEffect, useRef} from 'react';
3
3
 
4
4
  import {Animated, Pressable, View} from 'react-native';
5
5
  import {ThemeCtx} from '../../../context/theme.context';
@@ -12,14 +12,16 @@ import {VisualState} from '../../../types/visual-state.enum';
12
12
  import {SmallText} from '../../atoms/paragraph-components';
13
13
 
14
14
  type FailedBubbleProps = {
15
+ id: string;
15
16
  text: string;
16
17
  visualState: VisualState;
17
18
  bubbleAlignment: BubbleAlignment;
18
- onPressEdit: () => void;
19
- onPressDelete: () => void;
19
+ onPressEdit: (id: string) => void;
20
+ onPressDelete: (id: string) => void;
20
21
  };
21
22
 
22
23
  const SendTextBubble = ({
24
+ id,
23
25
  text,
24
26
  visualState,
25
27
  bubbleAlignment,
@@ -29,6 +31,12 @@ const SendTextBubble = ({
29
31
  const context = useContext(ThemeCtx);
30
32
  const styles = Stylesheet(context, visualState, bubbleAlignment);
31
33
 
34
+ const swipeableRef = useRef<Swipeable>(null);
35
+
36
+ useEffect(() => {
37
+ swipeableRef.current?.close();
38
+ }, [text]);
39
+
32
40
  function iconColorCheck() {
33
41
  return visualState === VisualState.DEFAULT
34
42
  ? context.colors.main['0']
@@ -59,12 +67,12 @@ const SendTextBubble = ({
59
67
  return (
60
68
  <View style={styles.swipedRow}>
61
69
  <Animated.View style={[styles.swipedIcon, {opacity}]}>
62
- <Pressable onPress={onPressEdit}>
70
+ <Pressable onPress={() => onPressEdit(id)} testID="edit-button">
63
71
  <Icon style={'regular'} name={'pencil'} color={iconColorCheck()} />
64
72
  </Pressable>
65
73
  </Animated.View>
66
74
  <Animated.View style={[styles.swipedIcon, {opacity}]}>
67
- <Pressable onPress={onPressDelete}>
75
+ <Pressable onPress={() => onPressDelete(id)} testID="delete-button">
68
76
  <Icon style={'regular'} name={'trash'} color={iconColorCheck()} />
69
77
  </Pressable>
70
78
  </Animated.View>
@@ -75,7 +83,10 @@ const SendTextBubble = ({
75
83
  return (
76
84
  <GestureHandlerRootView>
77
85
  <View style={styles.textBubbleContainer}>
78
- <Swipeable renderRightActions={RenderEditDeleteAction}>
86
+ <Swipeable
87
+ ref={swipeableRef}
88
+ renderRightActions={RenderEditDeleteAction}
89
+ >
79
90
  <SmallText
80
91
  textColor={textColorCheck(visualState)}
81
92
  addStyle={styles.text}
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
2
  import renderer from 'react-test-renderer';
3
3
  import {SendTextBubble} from './send-text-bubble.component';
4
+ import {fireEvent, render} from '@testing-library/react-native';
5
+ import {VisualState} from '../../../types/visual-state.enum';
6
+ import {BubbleAlignment} from '../../../types/bubble-alignment.enum';
4
7
 
5
8
  describe('Failed text bubble test', () => {
6
9
  it('shows a DEFAULT SENT text bubble that is swipeable with edit and trash icon, which if we press them we can edit or delete the message', () => {
7
10
  const tree = renderer
8
11
  .create(
9
12
  <SendTextBubble
13
+ id={'1'}
10
14
  text={'This is a test'}
11
15
  visualState="DEFAULT"
12
16
  bubbleAlignment="SENT"
@@ -22,6 +26,7 @@ describe('Failed text bubble test', () => {
22
26
  const tree = renderer
23
27
  .create(
24
28
  <SendTextBubble
29
+ id={'2'}
25
30
  text={'This is a test'}
26
31
  visualState="DEFAULT"
27
32
  bubbleAlignment="RECEIVE"
@@ -37,6 +42,7 @@ describe('Failed text bubble test', () => {
37
42
  const tree = renderer
38
43
  .create(
39
44
  <SendTextBubble
45
+ id={'3'}
40
46
  text={'This is a test'}
41
47
  visualState="WARNING"
42
48
  bubbleAlignment="SENT"
@@ -52,6 +58,7 @@ describe('Failed text bubble test', () => {
52
58
  const tree = renderer
53
59
  .create(
54
60
  <SendTextBubble
61
+ id={'4'}
55
62
  text={'This is a test'}
56
63
  visualState="WARNING"
57
64
  bubbleAlignment="RECEIVE"
@@ -67,6 +74,7 @@ describe('Failed text bubble test', () => {
67
74
  const tree = renderer
68
75
  .create(
69
76
  <SendTextBubble
77
+ id={'4'}
70
78
  text={'This is a test'}
71
79
  visualState="ERROR"
72
80
  bubbleAlignment="SENT"
@@ -82,6 +90,7 @@ describe('Failed text bubble test', () => {
82
90
  const tree = renderer
83
91
  .create(
84
92
  <SendTextBubble
93
+ id={'5'}
85
94
  text={'This is a test'}
86
95
  visualState="ERROR"
87
96
  bubbleAlignment="RECEIVE"
@@ -94,3 +103,65 @@ describe('Failed text bubble test', () => {
94
103
  expect(tree).toMatchSnapshot();
95
104
  });
96
105
  });
106
+
107
+ describe('SendTextBubble', () => {
108
+ const mockId = '123';
109
+ const mockText = 'Hello, world!';
110
+ const mockVisualState = VisualState.DEFAULT;
111
+ const mockBubbleAlignment = BubbleAlignment.SENT;
112
+ const mockOnPressEdit = jest.fn();
113
+ const mockOnPressDelete = jest.fn();
114
+
115
+ afterEach(() => {
116
+ jest.clearAllMocks();
117
+ });
118
+
119
+ it('should render the component correctly', () => {
120
+ const {getByText} = render(
121
+ <SendTextBubble
122
+ id={mockId}
123
+ text={mockText}
124
+ visualState={mockVisualState}
125
+ bubbleAlignment={mockBubbleAlignment}
126
+ onPressEdit={mockOnPressEdit}
127
+ onPressDelete={mockOnPressDelete}
128
+ />
129
+ );
130
+
131
+ expect(getByText(mockText)).toBeDefined();
132
+ });
133
+
134
+ it('should call onPressEdit when the edit button is pressed', () => {
135
+ const {getByTestId} = render(
136
+ <SendTextBubble
137
+ id={mockId}
138
+ text={mockText}
139
+ visualState={mockVisualState}
140
+ bubbleAlignment={mockBubbleAlignment}
141
+ onPressEdit={mockOnPressEdit}
142
+ onPressDelete={mockOnPressDelete}
143
+ />
144
+ );
145
+
146
+ fireEvent.press(getByTestId('edit-button'));
147
+
148
+ expect(mockOnPressEdit).toHaveBeenCalledWith(mockId);
149
+ });
150
+
151
+ it('should call onPressDelete when the delete button is pressed', () => {
152
+ const {getByTestId} = render(
153
+ <SendTextBubble
154
+ id={mockId}
155
+ text={mockText}
156
+ visualState={mockVisualState}
157
+ bubbleAlignment={mockBubbleAlignment}
158
+ onPressEdit={mockOnPressEdit}
159
+ onPressDelete={mockOnPressDelete}
160
+ />
161
+ );
162
+
163
+ fireEvent.press(getByTestId('delete-button'));
164
+
165
+ expect(mockOnPressDelete).toHaveBeenCalledWith(mockId);
166
+ });
167
+ });
@@ -1,7 +1,7 @@
1
- import { VisualState } from '../../../types/visual-state.enum';
1
+ import {VisualState} from '../../../types/visual-state.enum';
2
2
  type SnackbarProps = {
3
- text: string;
4
- visualState: VisualState;
3
+ text: string;
4
+ visualState: VisualState;
5
5
  };
6
- declare const Snackbar: ({ text, visualState }: SnackbarProps) => JSX.Element;
7
- export { Snackbar as Snackbar };
6
+ declare const Snackbar: ({text, visualState}: SnackbarProps) => JSX.Element;
7
+ export {Snackbar as Snackbar};
@@ -1,7 +1,7 @@
1
- import { ReactNode } from 'react';
1
+ import {ReactNode} from 'react';
2
2
  type SwipeProps = {
3
- children: ReactNode;
4
- onIndexChange?: (index: number) => void;
3
+ children: ReactNode;
4
+ onIndexChange?: (index: number) => void;
5
5
  };
6
- declare const Swipe: ({ children, onIndexChange }: SwipeProps) => JSX.Element;
7
- export { Swipe as Swipe };
6
+ declare const Swipe: ({children, onIndexChange}: SwipeProps) => JSX.Element;
7
+ export {Swipe as Swipe};
@@ -1,7 +1,13 @@
1
1
  type TagProps = {
2
- value: string;
3
- label: string;
4
- onPress: (event: string) => void;
2
+ value: string;
3
+ label: string;
4
+ onPress: (value: string, isSelected: boolean) => void;
5
+ isSelected: boolean;
5
6
  };
6
- declare const Tag: ({ label, onPress, value }: TagProps) => JSX.Element;
7
- export { Tag as Tag };
7
+ declare const Tag: ({
8
+ label,
9
+ onPress,
10
+ value,
11
+ isSelected,
12
+ }: TagProps) => JSX.Element;
13
+ export {Tag as Tag};
@@ -1,8 +1,13 @@
1
1
  interface TimePickerProps {
2
- initialHours: string;
3
- initialMinutes: string;
4
- onChangeHours: (value: string) => void;
5
- onChangeMinutes: (value: string) => void;
2
+ initialHours: string;
3
+ initialMinutes: string;
4
+ onChangeHours: (value: string) => void;
5
+ onChangeMinutes: (value: string) => void;
6
6
  }
7
- export declare const TimePicker: ({ initialHours, initialMinutes, onChangeHours, onChangeMinutes, }: TimePickerProps) => JSX.Element;
7
+ export declare const TimePicker: ({
8
+ initialHours,
9
+ initialMinutes,
10
+ onChangeHours,
11
+ onChangeMinutes,
12
+ }: TimePickerProps) => JSX.Element;
8
13
  export {};
@@ -1,8 +1,12 @@
1
- import { VisualState } from '../../../types/visual-state.enum';
1
+ import {VisualState} from '../../../types/visual-state.enum';
2
2
  type TimeTrackerProps = {
3
- text: string;
4
- textColor?: string;
5
- visualState: VisualState;
3
+ text: string;
4
+ textColor?: string;
5
+ visualState: VisualState;
6
6
  };
7
- declare const TimeTracker: ({ text, visualState, textColor }: TimeTrackerProps) => JSX.Element;
8
- export { TimeTracker as TimeTracker };
7
+ declare const TimeTracker: ({
8
+ text,
9
+ visualState,
10
+ textColor,
11
+ }: TimeTrackerProps) => JSX.Element;
12
+ export {TimeTracker as TimeTracker};
@@ -1,6 +1,9 @@
1
1
  type TimeLineProps = {
2
- checkIn: string;
3
- checkOut?: string;
2
+ checkIn: string;
3
+ checkOut?: string;
4
4
  };
5
- export declare const TimeLine: ({ checkIn, checkOut }: TimeLineProps) => JSX.Element;
5
+ export declare const TimeLine: ({
6
+ checkIn,
7
+ checkOut,
8
+ }: TimeLineProps) => JSX.Element;
6
9
  export {};
@@ -1,6 +1,6 @@
1
- import { ToddleDateTime } from '../../../utilities/toddle-datetime/toddle-datetime.class';
1
+ import {ToddleDateTime} from '../../../utilities/toddle-datetime/toddle-datetime.class';
2
2
  type TimestampProps = {
3
- sent: ToddleDateTime;
3
+ sent: ToddleDateTime;
4
4
  };
5
- export declare const Timestamp: ({ sent }: TimestampProps) => JSX.Element;
5
+ export declare const Timestamp: ({sent}: TimestampProps) => JSX.Element;
6
6
  export {};
@@ -1,2 +1,7 @@
1
- import { WaveProps } from '../../atoms/static-wave/static-wave.component';
2
- export declare const WaveBackground: ({ customWavePath, customStyle, heightSvgContainer, positionTop, }: WaveProps) => JSX.Element;
1
+ import {WaveProps} from '../../atoms/static-wave/static-wave.component';
2
+ export declare const WaveBackground: ({
3
+ customWavePath,
4
+ customStyle,
5
+ heightSvgContainer,
6
+ positionTop,
7
+ }: WaveProps) => JSX.Element;
@@ -1,8 +1,13 @@
1
1
  type ButtonProps = {
2
- text: string;
3
- disabled?: boolean;
4
- onPress?: () => void;
5
- backgroundColor?: string;
2
+ text: string;
3
+ disabled?: boolean;
4
+ onPress?: () => void;
5
+ backgroundColor?: string;
6
6
  };
7
- declare const WideButton: ({ text, disabled, onPress, backgroundColor, }: ButtonProps) => JSX.Element;
8
- export { WideButton as WideButton };
7
+ declare const WideButton: ({
8
+ text,
9
+ disabled,
10
+ onPress,
11
+ backgroundColor,
12
+ }: ButtonProps) => JSX.Element;
13
+ export {WideButton as WideButton};
@@ -10,7 +10,6 @@ exports[`test child list item component arrow appears when selectable is false 1
10
10
  "borderTopLeftRadius": 48,
11
11
  "borderTopRightRadius": 24,
12
12
  "flexDirection": "row",
13
- "overflow": "hidden",
14
13
  "width": "100%",
15
14
  }
16
15
  }
@@ -278,7 +277,6 @@ exports[`test child list item component arrow appears when selectable is false 1
278
277
  "borderBottomRightRadius": 24,
279
278
  "borderTopRightRadius": 24,
280
279
  "justifyContent": "center",
281
- "overflow": "hidden",
282
280
  "paddingRight": 8,
283
281
  "width": 48,
284
282
  }
@@ -355,7 +353,6 @@ exports[`test child list item component background is blue and text is white whe
355
353
  "borderTopLeftRadius": 48,
356
354
  "borderTopRightRadius": 24,
357
355
  "flexDirection": "row",
358
- "overflow": "hidden",
359
356
  "width": "100%",
360
357
  }
361
358
  }
@@ -600,7 +597,6 @@ exports[`test child list item component make text that is too long end in ... 1`
600
597
  "borderTopLeftRadius": 48,
601
598
  "borderTopRightRadius": 24,
602
599
  "flexDirection": "row",
603
- "overflow": "hidden",
604
600
  "width": "100%",
605
601
  }
606
602
  }
@@ -1,20 +1,35 @@
1
1
  import * as React from 'react';
2
- import { ImageSourcePropType } from 'react-native';
3
- import { Initials } from '../../../models/initials.model';
4
- import { VisualState } from '../../../types/visual-state.enum';
2
+ import {ImageSourcePropType} from 'react-native';
3
+ import {Initials} from '../../../models/initials.model';
4
+ import {VisualState} from '../../../types/visual-state.enum';
5
5
  type ChildListItemProps = {
6
- id: string;
7
- name: string;
8
- department: string;
9
- selectable: boolean;
10
- isSelected: boolean;
11
- onPressArrow: (id: string) => void;
12
- onPressText: (id: string) => void;
13
- onLongPress: (id: string) => void;
14
- onSelect: (id: string) => void;
15
- sourceAvatar: ImageSourcePropType | Initials;
16
- textTimeTracker: string;
17
- visualStateTimeTracker: VisualState;
6
+ id: string;
7
+ name: string;
8
+ department: string;
9
+ selectable: boolean;
10
+ isSelected: boolean;
11
+ onPressArrow: (id: string) => void;
12
+ onPressText: (id: string) => void;
13
+ onLongPress: (id: string) => void;
14
+ onSelect: (id: string) => void;
15
+ sourceAvatar: ImageSourcePropType | Initials;
16
+ textTimeTracker: string;
17
+ visualStateTimeTracker: VisualState;
18
18
  };
19
- declare const ChildListItem: React.MemoExoticComponent<({ id, name, department, selectable, isSelected, onPressArrow, onPressText, onLongPress, onSelect, sourceAvatar, textTimeTracker, visualStateTimeTracker, }: ChildListItemProps) => JSX.Element>;
20
- export { ChildListItem as ChildListItem };
19
+ declare const ChildListItem: React.MemoExoticComponent<
20
+ ({
21
+ id,
22
+ name,
23
+ department,
24
+ selectable,
25
+ isSelected,
26
+ onPressArrow,
27
+ onPressText,
28
+ onLongPress,
29
+ onSelect,
30
+ sourceAvatar,
31
+ textTimeTracker,
32
+ visualStateTimeTracker,
33
+ }: ChildListItemProps) => JSX.Element
34
+ >;
35
+ export {ChildListItem as ChildListItem};