@hero-design/rn 7.23.0 → 7.25.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 (276) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/assets/fonts/hero-icons.ttf +0 -0
  3. package/es/index.js +1364 -9239
  4. package/lib/assets/fonts/hero-icons.ttf +0 -0
  5. package/lib/index.js +1368 -9238
  6. package/package.json +7 -4
  7. package/rollup.config.js +1 -0
  8. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +4 -4
  9. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  10. package/src/components/Attachment/StyledAttachment.tsx +44 -0
  11. package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +158 -0
  12. package/src/components/Attachment/__tests__/index.spec.tsx +59 -0
  13. package/src/components/Attachment/index.tsx +77 -0
  14. package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
  15. package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  16. package/src/components/Badge/Status.tsx +1 -1
  17. package/src/components/Badge/StyledBadge.tsx +8 -1
  18. package/src/components/Badge/__tests__/Badge.spec.tsx +9 -0
  19. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +44 -0
  20. package/src/components/Badge/index.tsx +1 -1
  21. package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  22. package/src/components/BottomSheet/Header.tsx +2 -1
  23. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +52 -52
  24. package/src/components/BottomSheet/index.tsx +4 -4
  25. package/src/components/Button/Button.tsx +0 -11
  26. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +4 -4
  27. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  28. package/src/components/Button/LoadingIndicator/index.tsx +1 -1
  29. package/src/components/Button/StyledButton.tsx +24 -63
  30. package/src/components/Button/UtilityButton/__tests__/index.spec.tsx +2 -2
  31. package/src/components/Button/__tests__/Button.spec.tsx +10 -5
  32. package/src/components/Button/__tests__/StyledButton.spec.tsx +0 -70
  33. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +301 -1206
  34. package/src/components/Calendar/CalendarRowItem.tsx +1 -4
  35. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +5 -5
  36. package/src/components/Calendar/index.tsx +4 -3
  37. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +1 -1
  38. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
  39. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  40. package/src/components/Checkbox/StyledCheckbox.tsx +7 -5
  41. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +4 -12
  42. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +95 -42
  43. package/src/components/Checkbox/index.tsx +4 -2
  44. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  45. package/src/components/ContentNavigator/index.tsx +14 -9
  46. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +2 -0
  47. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +29 -27
  48. package/src/components/Drawer/DragableDrawer/index.tsx +0 -2
  49. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  50. package/src/components/Empty/index.tsx +1 -2
  51. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  52. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +1 -1
  53. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  54. package/src/components/Icon/HeroIcon/fonts/hero-icons.ttf +0 -0
  55. package/src/components/Icon/HeroIcon/glyphMap.json +1 -0
  56. package/src/components/Icon/HeroIcon/index.tsx +3 -7
  57. package/src/components/Icon/IconList.ts +36 -6
  58. package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  59. package/src/components/Icon/index.tsx +1 -0
  60. package/src/components/List/BasicListItem.tsx +13 -8
  61. package/src/components/List/ListItem.tsx +8 -6
  62. package/src/components/List/StyledBasicListItem.tsx +2 -2
  63. package/src/components/List/StyledListItem.tsx +2 -2
  64. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +24 -36
  65. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +39 -59
  66. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +40 -44
  67. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +50 -50
  68. package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +6 -6
  69. package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +21 -21
  70. package/src/components/Progress/ProgressBar.tsx +1 -1
  71. package/src/components/Progress/ProgressCircle.tsx +1 -1
  72. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +10 -10
  73. package/src/components/Progress/types.ts +7 -1
  74. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +20 -32
  75. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +30 -48
  76. package/src/components/RefreshControl/__tests__/index.spec.tsx +1 -3
  77. package/src/components/RefreshControl/index.tsx +4 -2
  78. package/src/components/RichTextEditor/MentionList.tsx +12 -3
  79. package/src/components/RichTextEditor/RichTextEditor.tsx +4 -8
  80. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +6 -4
  81. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  82. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +13 -20
  83. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +154 -238
  84. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +435 -650
  85. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +11 -18
  86. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +144 -228
  87. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +414 -629
  88. package/src/components/Select/StyledOptionList.tsx +0 -1
  89. package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +1 -1
  90. package/src/components/Spinner/AnimatedSpinner.tsx +22 -7
  91. package/src/components/Spinner/StyledSpinner.tsx +15 -11
  92. package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +3 -1
  93. package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +42 -31
  94. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +12 -8
  95. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +543 -83
  96. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +12 -8
  97. package/src/components/Spinner/index.tsx +6 -1
  98. package/src/components/Swipeable/StyledSwipeable.tsx +11 -0
  99. package/src/components/Swipeable/SwipeableAction.tsx +45 -0
  100. package/src/components/Swipeable/__tests__/SwipeableAction.spec.tsx +37 -0
  101. package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +130 -0
  102. package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +33 -0
  103. package/src/components/Swipeable/__tests__/index.spec.tsx +34 -0
  104. package/src/components/Swipeable/index.tsx +160 -0
  105. package/src/components/Switch/SelectorSwitch/Option.tsx +1 -5
  106. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +3 -3
  107. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  108. package/src/components/Switch/SelectorSwitch/__tests__/index.spec.tsx +1 -0
  109. package/src/components/Switch/SelectorSwitch/index.tsx +4 -1
  110. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +1 -1
  111. package/src/components/Tabs/StyledTabs.tsx +1 -1
  112. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1 -1
  113. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  114. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +2 -2
  115. package/src/components/TextInput/StyledTextInput.tsx +7 -12
  116. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +12 -6
  117. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +31 -146
  118. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +40 -14
  119. package/src/components/TextInput/__tests__/index.spec.tsx +114 -124
  120. package/src/components/TextInput/index.tsx +8 -6
  121. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +2 -0
  122. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +29 -27
  123. package/src/components/Toast/Toast.tsx +0 -3
  124. package/src/components/Toast/ToastProvider.tsx +1 -0
  125. package/src/components/Toast/__tests__/index.spec.tsx +1 -1
  126. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
  127. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -6
  128. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +4 -4
  129. package/src/emotion.d.ts +1 -0
  130. package/src/index.ts +10 -0
  131. package/src/theme/ThemeSwitcher.tsx +7 -1
  132. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +96 -78
  133. package/src/theme/__tests__/ensureCompatibleWithV7.spec.tsx +13 -0
  134. package/src/theme/components/alert.ts +1 -1
  135. package/src/theme/components/attachment.ts +28 -0
  136. package/src/theme/components/avatar.ts +1 -1
  137. package/src/theme/components/badge.ts +2 -1
  138. package/src/theme/components/bottomNavigation.ts +1 -1
  139. package/src/theme/components/bottomSheet.ts +2 -2
  140. package/src/theme/components/button.ts +4 -20
  141. package/src/theme/components/calendar.ts +3 -3
  142. package/src/theme/components/card.ts +1 -1
  143. package/src/theme/components/checkbox.ts +2 -2
  144. package/src/theme/components/divider.ts +1 -1
  145. package/src/theme/components/drawer.ts +2 -2
  146. package/src/theme/components/empty.ts +3 -3
  147. package/src/theme/components/fab.ts +7 -7
  148. package/src/theme/components/icon.ts +4 -4
  149. package/src/theme/components/list.ts +0 -2
  150. package/src/theme/components/pinInput.ts +4 -4
  151. package/src/theme/components/progress.ts +6 -5
  152. package/src/theme/components/radio.ts +1 -1
  153. package/src/theme/components/richTextEditor.ts +2 -2
  154. package/src/theme/components/slider.ts +2 -2
  155. package/src/theme/components/spinner.ts +4 -1
  156. package/src/theme/components/swipeable.ts +13 -0
  157. package/src/theme/components/switch.ts +4 -4
  158. package/src/theme/components/tabs.ts +6 -5
  159. package/src/theme/components/tag.ts +2 -2
  160. package/src/theme/components/textInput.ts +23 -33
  161. package/src/theme/components/toast.ts +3 -3
  162. package/src/theme/components/toolbar.ts +3 -3
  163. package/src/theme/components/typography.ts +7 -7
  164. package/src/theme/getTheme.ts +7 -1
  165. package/src/theme/global/colors/eBens.ts +23 -0
  166. package/src/theme/global/colors/global.ts +15 -6
  167. package/src/theme/global/colors/jobs.ts +15 -10
  168. package/src/theme/global/colors/legacySystemPalette.ts +6 -6
  169. package/src/theme/global/colors/swag.ts +32 -53
  170. package/src/theme/global/colors/types.ts +35 -15
  171. package/src/theme/global/colors/wallet.ts +23 -0
  172. package/src/theme/global/colors/work.ts +15 -11
  173. package/src/theme/global/index.ts +4 -0
  174. package/src/theme/index.ts +4 -0
  175. package/src/types.ts +2 -0
  176. package/src/utils/functions.ts +2 -0
  177. package/src/utils/scale.ts +1 -1
  178. package/testUtils/setup.tsx +13 -0
  179. package/tsconfig.json +8 -2
  180. package/types/components/Accordion/StyledAccordion.d.ts +14 -14
  181. package/types/components/Alert/StyledAlert.d.ts +15 -15
  182. package/types/components/Attachment/StyledAttachment.d.ts +28 -0
  183. package/types/components/Attachment/index.d.ts +37 -0
  184. package/types/components/Avatar/StyledAvatar.d.ts +15 -15
  185. package/types/components/Avatar/index.d.ts +1 -1
  186. package/types/components/Badge/Status.d.ts +1 -1
  187. package/types/components/Badge/StyledBadge.d.ts +8 -8
  188. package/types/components/Badge/index.d.ts +1 -1
  189. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
  190. package/types/components/BottomSheet/Header.d.ts +1 -1
  191. package/types/components/BottomSheet/StyledBottomSheet.d.ts +22 -22
  192. package/types/components/Box/StyledBox.d.ts +4 -4
  193. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
  194. package/types/components/Button/StyledButton.d.ts +15 -18
  195. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
  196. package/types/components/Calendar/StyledCalendar.d.ts +25 -25
  197. package/types/components/Calendar/helpers.d.ts +2 -2
  198. package/types/components/Card/DataCard/StyledDataCard.d.ts +6 -6
  199. package/types/components/Card/StyledCard.d.ts +7 -7
  200. package/types/components/Checkbox/StyledCheckbox.d.ts +16 -10
  201. package/types/components/Collapse/StyledCollapse.d.ts +8 -8
  202. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
  203. package/types/components/ContentNavigator/index.d.ts +2 -1
  204. package/types/components/DatePicker/StyledDatePicker.d.ts +3 -3
  205. package/types/components/Divider/StyledDivider.d.ts +5 -5
  206. package/types/components/Drawer/StyledDrawer.d.ts +19 -19
  207. package/types/components/Empty/StyledEmpty.d.ts +9 -9
  208. package/types/components/Empty/index.d.ts +1 -2
  209. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +11 -11
  210. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +7 -7
  211. package/types/components/FAB/StyledFAB.d.ts +8 -8
  212. package/types/components/Icon/HeroIcon/index.d.ts +3 -3
  213. package/types/components/Icon/IconList.d.ts +1 -1
  214. package/types/components/Icon/index.d.ts +4 -1
  215. package/types/components/Icon/utils.d.ts +1 -1
  216. package/types/components/List/StyledBasicListItem.d.ts +16 -16
  217. package/types/components/List/StyledListItem.d.ts +25 -25
  218. package/types/components/PinInput/StyledPinInput.d.ts +30 -30
  219. package/types/components/Progress/ProgressBar.d.ts +1 -1
  220. package/types/components/Progress/ProgressCircle.d.ts +1 -1
  221. package/types/components/Progress/StyledProgressBar.d.ts +5 -5
  222. package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
  223. package/types/components/Progress/types.d.ts +1 -1
  224. package/types/components/Radio/StyledRadio.d.ts +9 -9
  225. package/types/components/RefreshControl/index.d.ts +1 -2
  226. package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
  227. package/types/components/RichTextEditor/MentionList.d.ts +1 -1
  228. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
  229. package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
  230. package/types/components/RichTextEditor/index.d.ts +2 -2
  231. package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
  232. package/types/components/Select/MultiSelect/Option.d.ts +1 -1
  233. package/types/components/Select/SingleSelect/Option.d.ts +1 -1
  234. package/types/components/Select/StyledSelect.d.ts +11 -11
  235. package/types/components/Select/helpers.d.ts +1 -1
  236. package/types/components/Spinner/AnimatedSpinner.d.ts +2 -1
  237. package/types/components/Spinner/StyledSpinner.d.ts +13 -12
  238. package/types/components/Spinner/index.d.ts +5 -1
  239. package/types/components/Swipeable/StyledSwipeable.d.ts +10 -0
  240. package/types/components/Swipeable/SwipeableAction.d.ts +27 -0
  241. package/types/components/Swipeable/index.d.ts +45 -0
  242. package/types/components/Switch/SelectorSwitch/Option.d.ts +3 -1
  243. package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +9 -9
  244. package/types/components/Switch/StyledSwitch.d.ts +5 -5
  245. package/types/components/Tabs/StyledScrollableTabs.d.ts +23 -23
  246. package/types/components/Tabs/StyledTabs.d.ts +22 -22
  247. package/types/components/Tag/StyledTag.d.ts +6 -6
  248. package/types/components/TextInput/StyledTextInput.d.ts +46 -45
  249. package/types/components/TextInput/index.d.ts +6 -6
  250. package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
  251. package/types/components/Toast/StyledToast.d.ts +17 -17
  252. package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
  253. package/types/components/Typography/Text/StyledText.d.ts +3 -3
  254. package/types/index.d.ts +4 -2
  255. package/types/testHelpers/renderWithTheme.d.ts +1 -1
  256. package/types/theme/ThemeSwitcher.d.ts +2 -2
  257. package/types/theme/components/attachment.d.ts +21 -0
  258. package/types/theme/components/badge.d.ts +1 -0
  259. package/types/theme/components/button.d.ts +0 -15
  260. package/types/theme/components/list.d.ts +0 -1
  261. package/types/theme/components/progress.d.ts +1 -0
  262. package/types/theme/components/spinner.d.ts +4 -1
  263. package/types/theme/components/swipeable.d.ts +9 -0
  264. package/types/theme/components/tabs.d.ts +1 -0
  265. package/types/theme/components/tag.d.ts +2 -2
  266. package/types/theme/components/textInput.d.ts +0 -10
  267. package/types/theme/getTheme.d.ts +4 -0
  268. package/types/theme/global/colors/eBens.d.ts +3 -0
  269. package/types/theme/global/colors/types.d.ts +23 -16
  270. package/types/theme/global/colors/wallet.d.ts +3 -0
  271. package/types/theme/global/index.d.ts +26 -12
  272. package/types/theme/index.d.ts +2 -2
  273. package/types/types.d.ts +2 -1
  274. package/types/utils/functions.d.ts +1 -0
  275. package/types/utils/hooks.d.ts +1 -1
  276. package/src/components/Icon/HeroIcon/selection.json +0 -7029
@@ -1,37 +1,27 @@
1
- import { fireEvent, within } from "@testing-library/react-native";
2
- import React from "react";
3
- import { theme } from "../../..";
4
- import renderWithTheme from "../../../testHelpers/renderWithTheme";
5
- import Icon from "../../Icon";
6
- import TextInput, { getVariant } from "../index";
7
-
8
- describe("getVariant", () => {
1
+ import { fireEvent, within } from '@testing-library/react-native';
2
+ import React from 'react';
3
+ import { theme } from '../../..';
4
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
5
+ import Icon from '../../Icon';
6
+ import TextInput, { getVariant } from '../index';
7
+
8
+ describe('getVariant', () => {
9
9
  it.each`
10
- disabled | error | editable | loading | isFocused | isEmptyValue | expected
11
- ${false} | ${undefined} | ${true} | ${false} | ${false} | ${true} | ${"default"}
12
- ${false} | ${undefined} | ${true} | ${false} | ${false} | ${false} | ${"filled"}
13
- ${false} | ${undefined} | ${true} | ${false} | ${true} | ${true} | ${"focused"}
14
- ${false} | ${undefined} | ${false} | ${true} | ${true} | ${true} | ${"readonly"}
15
- ${false} | ${"This field is required"} | ${false} | ${false} | ${true} | ${true} | ${"error"}
16
- ${true} | ${"This field is required"} | ${false} | ${false} | ${true} | ${true} | ${"disabled"}
10
+ disabled | error | editable | loading | isEmptyValue | expected
11
+ ${false} | ${undefined} | ${true} | ${false} | ${true} | ${'default'}
12
+ ${false} | ${undefined} | ${true} | ${false} | ${false} | ${'filled'}
13
+ ${false} | ${undefined} | ${false} | ${true} | ${true} | ${'readonly'}
14
+ ${false} | ${'This field is required'} | ${false} | ${false} | ${true} | ${'error'}
15
+ ${true} | ${'This field is required'} | ${false} | ${false} | ${true} | ${'disabled'}
17
16
  `(
18
- "should return the correct variant when disabled $disabled, errorMessage $errorMessage, editable $false, isFocused $isFocused, isEmptyValue $isEmptyValue",
19
- ({
20
- disabled,
21
- error,
22
- editable,
23
- loading,
24
- isFocused,
25
- isEmptyValue,
26
- expected,
27
- }) => {
17
+ 'should return the correct variant when disabled $disabled, errorMessage $errorMessage, editable $false, isEmptyValue $isEmptyValue',
18
+ ({ disabled, error, editable, loading, isEmptyValue, expected }) => {
28
19
  expect(
29
20
  getVariant({
30
21
  disabled,
31
22
  error,
32
23
  editable,
33
24
  loading,
34
- isFocused,
35
25
  isEmptyValue,
36
26
  })
37
27
  ).toBe(expected);
@@ -39,9 +29,9 @@ describe("getVariant", () => {
39
29
  );
40
30
  });
41
31
 
42
- describe("TextInput", () => {
43
- describe("idle", () => {
44
- it("renders correctly", () => {
32
+ describe('TextInput', () => {
33
+ describe('idle', () => {
34
+ it('renders correctly', () => {
45
35
  const { getByTestId, toJSON } = renderWithTheme(
46
36
  <TextInput
47
37
  label="Amount (AUD)"
@@ -53,25 +43,25 @@ describe("TextInput", () => {
53
43
  );
54
44
 
55
45
  expect(toJSON()).toMatchSnapshot();
56
- expect(getByTestId("idle-text-input")).toBeTruthy();
46
+ expect(getByTestId('idle-text-input')).toBeTruthy();
57
47
  expect(
58
- within(getByTestId("idle-text-input")).queryAllByTestId("text-input")
48
+ within(getByTestId('idle-text-input')).queryAllByTestId('text-input')
59
49
  ).toHaveLength(1);
60
50
  expect(
61
- within(getByTestId("idle-text-input")).queryAllByText("Amount (AUD)")
51
+ within(getByTestId('idle-text-input')).queryAllByText('Amount (AUD)')
62
52
  ).toHaveLength(1);
63
53
  expect(
64
- within(getByTestId("idle-text-input")).queryAllByTestId("input-label")
54
+ within(getByTestId('idle-text-input')).queryAllByTestId('input-label')
65
55
  ).toHaveLength(1);
66
56
  expect(
67
- within(getByTestId("idle-text-input")).queryAllByTestId("input-prefix")
57
+ within(getByTestId('idle-text-input')).queryAllByTestId('input-prefix')
68
58
  ).toHaveLength(1);
69
59
  expect(
70
- within(getByTestId("idle-text-input")).queryAllByTestId("input-suffix")
60
+ within(getByTestId('idle-text-input')).queryAllByTestId('input-suffix')
71
61
  ).toHaveLength(1);
72
62
  });
73
63
 
74
- it("should not render input-label if label is empty", () => {
64
+ it('should not render input-label if label is empty', () => {
75
65
  const { getByTestId } = renderWithTheme(
76
66
  <TextInput
77
67
  prefix="dollar-sign"
@@ -80,13 +70,13 @@ describe("TextInput", () => {
80
70
  />
81
71
  );
82
72
 
83
- expect(getByTestId("idle-text-input")).toBeTruthy();
73
+ expect(getByTestId('idle-text-input')).toBeTruthy();
84
74
  expect(
85
- within(getByTestId("idle-text-input")).queryAllByTestId("input-label")
75
+ within(getByTestId('idle-text-input')).queryAllByTestId('input-label')
86
76
  ).toHaveLength(0);
87
77
  });
88
78
 
89
- it("onChangeText, onBlur, onFocus", () => {
79
+ it('onChangeText, onBlur, onFocus', () => {
90
80
  const onChangeText = jest.fn();
91
81
  const onBlur = jest.fn();
92
82
  const onFocus = jest.fn();
@@ -102,23 +92,23 @@ describe("TextInput", () => {
102
92
  />
103
93
  );
104
94
 
105
- const testInput = within(getByTestId("idle-text-input")).getByTestId(
106
- "text-input"
95
+ const testInput = within(getByTestId('idle-text-input')).getByTestId(
96
+ 'text-input'
107
97
  );
108
98
 
109
- fireEvent.changeText(testInput, "Thong Quach");
110
- expect(onChangeText).toHaveBeenCalledWith("Thong Quach");
99
+ fireEvent.changeText(testInput, 'Thong Quach');
100
+ expect(onChangeText).toHaveBeenCalledWith('Thong Quach');
111
101
 
112
- fireEvent(testInput, "blur");
102
+ fireEvent(testInput, 'blur');
113
103
  expect(onBlur).toHaveBeenCalledTimes(1);
114
104
 
115
- fireEvent(testInput, "focus");
105
+ fireEvent(testInput, 'focus');
116
106
  expect(onFocus).toHaveBeenCalledTimes(1);
117
107
  });
118
108
  });
119
109
 
120
- describe("idle with suffix and prefix are React Element", () => {
121
- it("renders correctly", () => {
110
+ describe('idle with suffix and prefix are React Element', () => {
111
+ it('renders correctly', () => {
122
112
  const { toJSON, queryAllByTestId, queryAllByText } = renderWithTheme(
123
113
  <TextInput
124
114
  label="Amount (AUD)"
@@ -129,16 +119,16 @@ describe("TextInput", () => {
129
119
  );
130
120
 
131
121
  expect(toJSON()).toMatchSnapshot();
132
- expect(queryAllByText("Amount (AUD)")).toHaveLength(1);
133
- expect(queryAllByText("*")).toHaveLength(1);
134
- expect(queryAllByTestId("input-label")).toHaveLength(1);
135
- expect(queryAllByTestId("prefix-element")).toHaveLength(1);
136
- expect(queryAllByTestId("suffix-element")).toHaveLength(1);
137
- expect(queryAllByTestId("text-input")).toHaveLength(1);
122
+ expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
123
+ expect(queryAllByText('*')).toHaveLength(1);
124
+ expect(queryAllByTestId('input-label')).toHaveLength(1);
125
+ expect(queryAllByTestId('prefix-element')).toHaveLength(1);
126
+ expect(queryAllByTestId('suffix-element')).toHaveLength(1);
127
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
138
128
  });
139
129
  });
140
- describe("required", () => {
141
- it("renders correctly", () => {
130
+ describe('required', () => {
131
+ it('renders correctly', () => {
142
132
  const { toJSON, queryAllByTestId, queryAllByText } = renderWithTheme(
143
133
  <TextInput
144
134
  label="Amount (AUD)"
@@ -149,17 +139,17 @@ describe("TextInput", () => {
149
139
  );
150
140
 
151
141
  expect(toJSON()).toMatchSnapshot();
152
- expect(queryAllByText("Amount (AUD)")).toHaveLength(1);
153
- expect(queryAllByText("*")).toHaveLength(1);
154
- expect(queryAllByTestId("input-label")).toHaveLength(1);
155
- expect(queryAllByTestId("input-prefix")).toHaveLength(1);
156
- expect(queryAllByTestId("input-suffix")).toHaveLength(1);
157
- expect(queryAllByTestId("text-input")).toHaveLength(1);
142
+ expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
143
+ expect(queryAllByText('*')).toHaveLength(1);
144
+ expect(queryAllByTestId('input-label')).toHaveLength(1);
145
+ expect(queryAllByTestId('input-prefix')).toHaveLength(1);
146
+ expect(queryAllByTestId('input-suffix')).toHaveLength(1);
147
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
158
148
  });
159
149
  });
160
150
 
161
- describe("filled", () => {
162
- it("renders correctly", () => {
151
+ describe('filled', () => {
152
+ it('renders correctly', () => {
163
153
  const {
164
154
  toJSON,
165
155
  queryAllByTestId,
@@ -175,17 +165,17 @@ describe("TextInput", () => {
175
165
  );
176
166
 
177
167
  expect(toJSON()).toMatchSnapshot();
178
- expect(queryAllByText("Amount (AUD)")).toHaveLength(1);
179
- expect(queryAllByDisplayValue("100")).toHaveLength(1);
180
- expect(queryAllByTestId("input-label")).toHaveLength(1);
181
- expect(queryAllByTestId("input-prefix")).toHaveLength(1);
182
- expect(queryAllByTestId("input-suffix")).toHaveLength(1);
183
- expect(queryAllByTestId("text-input")).toHaveLength(1);
168
+ expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
169
+ expect(queryAllByDisplayValue('100')).toHaveLength(1);
170
+ expect(queryAllByTestId('input-label')).toHaveLength(1);
171
+ expect(queryAllByTestId('input-prefix')).toHaveLength(1);
172
+ expect(queryAllByTestId('input-suffix')).toHaveLength(1);
173
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
184
174
  });
185
175
  });
186
176
 
187
- describe("readonly", () => {
188
- it("renders correctly", () => {
177
+ describe('readonly', () => {
178
+ it('renders correctly', () => {
189
179
  const onChangeText = jest.fn();
190
180
  const {
191
181
  toJSON,
@@ -206,31 +196,31 @@ describe("TextInput", () => {
206
196
  );
207
197
 
208
198
  expect(toJSON()).toMatchSnapshot();
209
- expect(queryAllByText("Amount (AUD)")).toHaveLength(1);
210
- expect(queryAllByDisplayValue("100")).toHaveLength(1);
211
- expect(queryAllByTestId("input-label")).toHaveLength(1);
212
- expect(queryAllByTestId("input-prefix")).toHaveLength(1);
213
- expect(queryAllByTestId("input-suffix")).toHaveLength(1);
214
- expect(queryAllByTestId("text-input")).toHaveLength(1);
215
-
216
- expect(getByTestId("text-input")).not.toHaveProp("editable", "false");
199
+ expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
200
+ expect(queryAllByDisplayValue('100')).toHaveLength(1);
201
+ expect(queryAllByTestId('input-label')).toHaveLength(1);
202
+ expect(queryAllByTestId('input-prefix')).toHaveLength(1);
203
+ expect(queryAllByTestId('input-suffix')).toHaveLength(1);
204
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
205
+
206
+ expect(getByTestId('text-input')).not.toHaveProp('editable', 'false');
217
207
  });
218
208
  });
219
209
 
220
- describe("loading", () => {
221
- it("renders correctly", () => {
210
+ describe('loading', () => {
211
+ it('renders correctly', () => {
222
212
  const { toJSON, queryAllByTestId, getByTestId } = renderWithTheme(
223
213
  <TextInput suffix="arrow-down" loading />
224
214
  );
225
215
 
226
216
  expect(toJSON()).toMatchSnapshot();
227
- expect(queryAllByTestId("text-input")).toHaveLength(1);
228
- expect(getByTestId("input-suffix")).toHaveProp("name", "loading");
217
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
218
+ expect(getByTestId('input-suffix')).toHaveProp('name', 'loading');
229
219
  });
230
220
  });
231
221
 
232
- describe("max length", () => {
233
- it("renders correctly", () => {
222
+ describe('max length', () => {
223
+ it('renders correctly', () => {
234
224
  const {
235
225
  toJSON,
236
226
  queryAllByTestId,
@@ -249,18 +239,18 @@ describe("TextInput", () => {
249
239
  );
250
240
 
251
241
  expect(toJSON()).toMatchSnapshot();
252
- expect(queryAllByText("Shout out")).toHaveLength(1);
253
- expect(queryAllByDisplayValue("shout out Tung Van")).toHaveLength(1);
254
- expect(queryAllByText("18/255")).toHaveLength(1);
255
- expect(queryAllByTestId("input-label")).toHaveLength(1);
256
- expect(queryAllByTestId("text-input")).toHaveLength(1);
242
+ expect(queryAllByText('Shout out')).toHaveLength(1);
243
+ expect(queryAllByDisplayValue('shout out Tung Van')).toHaveLength(1);
244
+ expect(queryAllByText('18/255')).toHaveLength(1);
245
+ expect(queryAllByTestId('input-label')).toHaveLength(1);
246
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
257
247
 
258
- expect(getByTestId("text-input")).not.toHaveProp("multiline", "true");
248
+ expect(getByTestId('text-input')).not.toHaveProp('multiline', 'true');
259
249
  });
260
250
  });
261
251
 
262
- describe("disabled", () => {
263
- it("renders correctly", () => {
252
+ describe('disabled', () => {
253
+ it('renders correctly', () => {
264
254
  const { toJSON, queryAllByTestId, queryAllByText, getByTestId } =
265
255
  renderWithTheme(
266
256
  <TextInput
@@ -273,17 +263,17 @@ describe("TextInput", () => {
273
263
  );
274
264
 
275
265
  expect(toJSON()).toMatchSnapshot();
276
- expect(queryAllByText("Amount (AUD)")).toHaveLength(1);
277
- expect(queryAllByTestId("input-label")).toHaveLength(1);
278
- expect(queryAllByTestId("text-input")).toHaveLength(1);
279
- expect(getByTestId("disabled-text-input")).toBeDisabled();
266
+ expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
267
+ expect(queryAllByTestId('input-label')).toHaveLength(1);
268
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
269
+ expect(getByTestId('disabled-text-input')).toBeDisabled();
280
270
 
281
- expect(getByTestId("text-input")).not.toHaveProp("multiline", "true");
271
+ expect(getByTestId('text-input')).not.toHaveProp('multiline', 'true');
282
272
  });
283
273
  });
284
274
 
285
- describe("error", () => {
286
- it("renders correctly", () => {
275
+ describe('error', () => {
276
+ it('renders correctly', () => {
287
277
  const { toJSON, queryAllByText } = renderWithTheme(
288
278
  <TextInput
289
279
  label="Amount (AUD)"
@@ -294,12 +284,12 @@ describe("TextInput", () => {
294
284
  );
295
285
 
296
286
  expect(toJSON()).toMatchSnapshot();
297
- expect(queryAllByText("Amount (AUD)")).toHaveLength(1);
298
- expect(queryAllByText("This field is required")).toHaveLength(1);
287
+ expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
288
+ expect(queryAllByText('This field is required')).toHaveLength(1);
299
289
  });
300
290
  });
301
- describe("helper text", () => {
302
- it("renders correctly", () => {
291
+ describe('helper text', () => {
292
+ it('renders correctly', () => {
303
293
  const { toJSON, queryAllByText } = renderWithTheme(
304
294
  <TextInput
305
295
  label="Amount (AUD)"
@@ -310,14 +300,14 @@ describe("TextInput", () => {
310
300
  );
311
301
 
312
302
  expect(toJSON()).toMatchSnapshot();
313
- expect(queryAllByText("Amount (AUD)")).toHaveLength(1);
314
- expect(queryAllByText("This is helper text")).toHaveLength(1);
303
+ expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
304
+ expect(queryAllByText('This is helper text')).toHaveLength(1);
315
305
  });
316
306
  });
317
307
 
318
- describe("placeholder", () => {
319
- describe("TextInput is idle", () => {
320
- it("renders correctly", () => {
308
+ describe('placeholder', () => {
309
+ describe('TextInput is idle', () => {
310
+ it('renders correctly', () => {
321
311
  const wrapper = renderWithTheme(
322
312
  <TextInput
323
313
  label="Amount (AUD)"
@@ -329,20 +319,20 @@ describe("TextInput", () => {
329
319
  );
330
320
 
331
321
  expect(wrapper.toJSON()).toMatchSnapshot();
332
- expect(wrapper.queryByPlaceholderText("Enter Amount")).toBeFalsy();
322
+ expect(wrapper.queryByPlaceholderText('Enter Amount')).toBeFalsy();
333
323
 
334
- fireEvent(wrapper.getByTestId("text-input"), "focus");
335
- expect(wrapper.queryByPlaceholderText("Enter Amount")).toBeTruthy();
324
+ fireEvent(wrapper.getByTestId('text-input'), 'focus');
325
+ expect(wrapper.queryByPlaceholderText('Enter Amount')).toBeTruthy();
336
326
 
337
- fireEvent(wrapper.getByTestId("text-input"), "blur");
338
- expect(wrapper.queryByPlaceholderText("Enter Amount")).toBeFalsy();
327
+ fireEvent(wrapper.getByTestId('text-input'), 'blur');
328
+ expect(wrapper.queryByPlaceholderText('Enter Amount')).toBeFalsy();
339
329
  });
340
330
  });
341
331
  });
342
332
 
343
- describe("defaultValue", () => {
344
- describe("TextInput is idle", () => {
345
- it("renders correctly", () => {
333
+ describe('defaultValue', () => {
334
+ describe('TextInput is idle', () => {
335
+ it('renders correctly', () => {
346
336
  const wrapper = renderWithTheme(
347
337
  <TextInput
348
338
  label="Amount (AUD)"
@@ -356,13 +346,13 @@ describe("TextInput", () => {
356
346
  );
357
347
 
358
348
  expect(wrapper.toJSON()).toMatchSnapshot();
359
- expect(wrapper.queryByDisplayValue("1000")).toBeTruthy();
360
- expect(wrapper.queryByText("4/255")).toBeTruthy();
349
+ expect(wrapper.queryByDisplayValue('1000')).toBeTruthy();
350
+ expect(wrapper.queryByText('4/255')).toBeTruthy();
361
351
  });
362
352
  });
363
353
 
364
- describe("default Value and Value", () => {
365
- it("renders correctly with 2000", () => {
354
+ describe('default Value and Value', () => {
355
+ it('renders correctly with 2000', () => {
366
356
  const wrapper = renderWithTheme(
367
357
  <TextInput
368
358
  label="Amount (AUD)"
@@ -377,9 +367,9 @@ describe("TextInput", () => {
377
367
  );
378
368
 
379
369
  expect(wrapper.toJSON()).toMatchSnapshot();
380
- expect(wrapper.queryByDisplayValue("2000")).toBeTruthy();
381
- expect(wrapper.queryByDisplayValue("1000")).toBeFalsy();
382
- expect(wrapper.queryByText("4/255")).toBeTruthy();
370
+ expect(wrapper.queryByDisplayValue('2000')).toBeTruthy();
371
+ expect(wrapper.queryByDisplayValue('1000')).toBeFalsy();
372
+ expect(wrapper.queryByText('4/255')).toBeTruthy();
383
373
  });
384
374
  });
385
375
  });
@@ -104,7 +104,6 @@ export const getVariant = ({
104
104
  error,
105
105
  editable,
106
106
  loading,
107
- isFocused,
108
107
  isEmptyValue,
109
108
  }: {
110
109
  disabled?: boolean;
@@ -123,9 +122,6 @@ export const getVariant = ({
123
122
  if (!editable || loading) {
124
123
  return 'readonly';
125
124
  }
126
- if (isFocused) {
127
- return 'focused';
128
- }
129
125
  if (!isEmptyValue) {
130
126
  return 'filled';
131
127
  }
@@ -195,6 +191,7 @@ const TextInput = ({
195
191
  accessibilityState: {
196
192
  disabled: variant === 'disabled' || variant === 'readonly',
197
193
  },
194
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
198
195
  // @ts-ignore
199
196
  accessibilityLabelledBy,
200
197
  ...nativeProps,
@@ -213,7 +210,8 @@ const TextInput = ({
213
210
  nativeProps.onChangeText?.(text);
214
211
  },
215
212
  defaultValue,
216
- placeholder: variant === 'focused' ? nativeProps.placeholder : undefined,
213
+ placeholder:
214
+ isFocused || label === undefined ? nativeProps.placeholder : undefined,
217
215
  };
218
216
 
219
217
  return (
@@ -225,7 +223,11 @@ const TextInput = ({
225
223
  testID={testID}
226
224
  >
227
225
  <StyledTextInputContainer>
228
- <StyledBorderBackDrop themeVariant={variant} style={borderStyle} />
226
+ <StyledBorderBackDrop
227
+ themeFocused={isFocused}
228
+ themeVariant={variant}
229
+ style={borderStyle}
230
+ />
229
231
  {(isFocused || (label && !isEmptyValue)) && (
230
232
  <StyledLabelContainer pointerEvents="none">
231
233
  {required && (
@@ -61,6 +61,7 @@ exports[`TimePickerAndroid renders correctly 1`] = `
61
61
  undefined,
62
62
  ]
63
63
  }
64
+ themeFocused={false}
64
65
  themeVariant="filled"
65
66
  />
66
67
  <View
@@ -138,6 +139,7 @@ exports[`TimePickerAndroid renders correctly 1`] = `
138
139
  "flexGrow": 2,
139
140
  "fontSize": 14,
140
141
  "marginHorizontal": 8,
142
+ "paddingVertical": 0,
141
143
  "textAlignVertical": "center",
142
144
  },
143
145
  Object {
@@ -61,6 +61,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
61
61
  undefined,
62
62
  ]
63
63
  }
64
+ themeFocused={false}
64
65
  themeVariant="filled"
65
66
  />
66
67
  <View
@@ -138,6 +139,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
138
139
  "flexGrow": 2,
139
140
  "fontSize": 14,
140
141
  "marginHorizontal": 8,
142
+ "paddingVertical": 0,
141
143
  "textAlignVertical": "center",
142
144
  },
143
145
  Object {
@@ -251,32 +253,6 @@ exports[`TimePickerIOS renders correctly 1`] = `
251
253
  ]
252
254
  }
253
255
  >
254
- <View
255
- accessible={true}
256
- collapsable={false}
257
- focusable={true}
258
- nativeID="animatedComponent"
259
- onBlur={[Function]}
260
- onClick={[Function]}
261
- onFocus={[Function]}
262
- onResponderGrant={[Function]}
263
- onResponderMove={[Function]}
264
- onResponderRelease={[Function]}
265
- onResponderTerminate={[Function]}
266
- onResponderTerminationRequest={[Function]}
267
- onStartShouldSetResponder={[Function]}
268
- style={
269
- Object {
270
- "backgroundColor": "#001f23",
271
- "bottom": 0,
272
- "left": 0,
273
- "opacity": 0.48,
274
- "position": "absolute",
275
- "right": 0,
276
- "top": 0,
277
- }
278
- }
279
- />
280
256
  <View
281
257
  onLayout={[Function]}
282
258
  style={
@@ -294,6 +270,32 @@ exports[`TimePickerIOS renders correctly 1`] = `
294
270
  ]
295
271
  }
296
272
  >
273
+ <View
274
+ accessible={true}
275
+ collapsable={false}
276
+ focusable={true}
277
+ nativeID="animatedComponent"
278
+ onBlur={[Function]}
279
+ onClick={[Function]}
280
+ onFocus={[Function]}
281
+ onResponderGrant={[Function]}
282
+ onResponderMove={[Function]}
283
+ onResponderRelease={[Function]}
284
+ onResponderTerminate={[Function]}
285
+ onResponderTerminationRequest={[Function]}
286
+ onStartShouldSetResponder={[Function]}
287
+ style={
288
+ Object {
289
+ "backgroundColor": "#001f23",
290
+ "bottom": 0,
291
+ "left": 0,
292
+ "opacity": 0.48,
293
+ "position": "absolute",
294
+ "right": 0,
295
+ "top": 0,
296
+ }
297
+ }
298
+ />
297
299
  <RCTSafeAreaView
298
300
  collapsable={false}
299
301
  emulateUnlessSupported={true}
@@ -502,7 +504,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
502
504
  style={
503
505
  Array [
504
506
  Object {
505
- "color": "#001f23",
507
+ "color": "#401960",
506
508
  "fontFamily": "BeVietnamPro-SemiBold",
507
509
  "fontSize": 16,
508
510
  "letterSpacing": 0.48,
@@ -66,9 +66,6 @@ const Toast = ({
66
66
 
67
67
  return () => clearTimeout(id);
68
68
  }
69
-
70
- // Consistent return
71
- return () => {};
72
69
  }, []);
73
70
 
74
71
  useEffect(() => {
@@ -20,6 +20,7 @@ const ToastProvider = ({
20
20
  position = 'top',
21
21
  }: ToastProviderProps) => {
22
22
  const toastRef = useRef<ToastControllerContextType>(null);
23
+ // @ts-expect-error: TODO: @tungv Fix this type error
23
24
  const [refState, setRefState] = useState<ToastControllerContextType>(null);
24
25
 
25
26
  useEffect(() => {
@@ -70,7 +70,7 @@ describe('Toast', () => {
70
70
  it(`"hide" method works correctly`, () => {
71
71
  const Component = () => {
72
72
  const toast = Toast.useToast();
73
- const [id, setId] = useState(null);
73
+ const [id, setId] = useState('');
74
74
 
75
75
  useEffect(() => {
76
76
  const toastId = toast.show({