@ovotech/element-native 5.5.0 → 5.7.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 (284) hide show
  1. package/dist/components/Accordion/styles.d.ts +3 -1725
  2. package/dist/components/ActionList/Action.d.ts +23 -0
  3. package/dist/components/ActionList/Action.js +29 -0
  4. package/dist/components/ActionList/ActionList.d.ts +11 -27
  5. package/dist/components/ActionList/ActionList.js +9 -25
  6. package/dist/components/ActionList/ActionListItems/DataListItem.d.ts +23 -0
  7. package/dist/components/ActionList/ActionListItems/DataListItem.js +23 -0
  8. package/dist/components/ActionList/ActionListItems/EditableListItem.d.ts +43 -0
  9. package/dist/components/ActionList/ActionListItems/EditableListItem.js +134 -0
  10. package/dist/components/ActionList/ActionListItems/NavigationListItem.d.ts +16 -0
  11. package/dist/components/ActionList/ActionListItems/NavigationListItem.js +30 -0
  12. package/dist/components/ActionList/ActionListItems/ProgressRing.d.ts +7 -0
  13. package/dist/components/ActionList/ActionListItems/ProgressRing.js +66 -0
  14. package/dist/components/ActionList/ActionListItems/ToggleListItem.d.ts +9 -0
  15. package/dist/components/ActionList/ActionListItems/ToggleListItem.js +12 -0
  16. package/dist/components/ActionList/ActionListItems/styles.d.ts +51 -0
  17. package/dist/components/ActionList/ActionListItems/styles.js +173 -0
  18. package/dist/components/ActionList/components/ActionListHeading.d.ts +9 -0
  19. package/dist/components/ActionList/components/ActionListHeading.js +11 -0
  20. package/dist/components/ActionList/index.d.ts +6 -1
  21. package/dist/components/ActionList/index.js +11 -2
  22. package/dist/components/ActionList/styled.d.ts +12 -5756
  23. package/dist/components/ActionList/styled.js +24 -9
  24. package/dist/components/Badge/Badge.d.ts +1 -575
  25. package/dist/components/BottomActionBar/BottomActionBar.d.ts +12 -0
  26. package/dist/components/BottomActionBar/BottomActionBar.js +80 -0
  27. package/dist/components/BottomActionBar/OverlayProvider.d.ts +8 -0
  28. package/dist/components/BottomActionBar/OverlayProvider.js +38 -0
  29. package/dist/components/BottomActionBar/index.d.ts +2 -0
  30. package/dist/components/BottomActionBar/index.js +7 -0
  31. package/dist/components/Button/Button.js +1 -1
  32. package/dist/components/Button/Button.styles.d.ts +5 -2300
  33. package/dist/components/Card/Card.d.ts +7 -4
  34. package/dist/components/Card/Card.js +44 -22
  35. package/dist/components/Card/Card.styles.d.ts +4 -1725
  36. package/dist/components/Card/Card.styles.js +7 -11
  37. package/dist/components/Cards/AccountCard/AccountCard.styles.d.ts +8 -4600
  38. package/dist/components/Cards/BalanceCard/BalanceCard.styles.d.ts +15 -8625
  39. package/dist/components/Cards/BalanceCard/BalanceCard.styles.js +2 -2
  40. package/dist/components/Cards/DisruptiveCard/DisruptiveCard.d.ts +13 -0
  41. package/dist/components/Cards/DisruptiveCard/DisruptiveCard.js +45 -0
  42. package/dist/components/Cards/DisruptiveCard/DisruptiveCard.styles.d.ts +3 -0
  43. package/dist/components/Cards/DisruptiveCard/DisruptiveCard.styles.js +11 -0
  44. package/dist/components/Cards/DisruptiveCard/index.d.ts +1 -0
  45. package/dist/components/Cards/DisruptiveCard/index.js +17 -0
  46. package/dist/components/Cards/HeroImageCard/HeroImageCard.d.ts +12 -0
  47. package/dist/components/Cards/HeroImageCard/HeroImageCard.js +65 -0
  48. package/dist/components/Cards/HeroImageCard/HeroImageCard.styles.d.ts +10 -0
  49. package/dist/components/Cards/HeroImageCard/HeroImageCard.styles.js +27 -0
  50. package/dist/components/Cards/HeroImageCard/index.d.ts +1 -0
  51. package/dist/components/Cards/HeroImageCard/index.js +17 -0
  52. package/dist/components/Cards/IconDataCard/IconDataCard.styles.d.ts +4 -2300
  53. package/dist/components/Cards/IconTextCard/IconTextCard.js +3 -16
  54. package/dist/components/Cards/IconTextCard/IconTextCard.styles.d.ts +3 -2300
  55. package/dist/components/Cards/IconTextCard/IconTextCard.styles.js +1 -6
  56. package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.d.ts +14 -0
  57. package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.js +26 -0
  58. package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.d.ts +18 -0
  59. package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +33 -0
  60. package/dist/components/Cards/IllustrationTextCard/index.d.ts +1 -0
  61. package/dist/components/Cards/IllustrationTextCard/index.js +17 -0
  62. package/dist/components/Cards/LinkTextCard/LinkTextCard.d.ts +2 -2
  63. package/dist/components/Cards/LinkTextCard/LinkTextCard.js +7 -6
  64. package/dist/components/Cards/LinkTextCard/LinkTextCard.styles.d.ts +8 -2875
  65. package/dist/components/Cards/LinkTextCard/LinkTextCard.styles.js +9 -6
  66. package/dist/components/Cards/OfferCard/OfferCard.d.ts +22 -0
  67. package/dist/components/Cards/OfferCard/OfferCard.js +36 -0
  68. package/dist/components/Cards/OfferCard/OfferCard.styles.d.ts +34 -0
  69. package/dist/components/Cards/OfferCard/OfferCard.styles.js +61 -0
  70. package/dist/components/Cards/OfferCard/index.d.ts +1 -0
  71. package/dist/components/Cards/OfferCard/index.js +17 -0
  72. package/dist/components/Cards/ProgressBarCard/ProgressBarCard.styles.d.ts +9 -5175
  73. package/dist/components/Cards/QuickLinkCard/QuickLinkCard.d.ts +12 -0
  74. package/dist/components/Cards/QuickLinkCard/QuickLinkCard.js +27 -0
  75. package/dist/components/Cards/QuickLinkCard/QuickLinkCard.styles.d.ts +12 -0
  76. package/dist/components/Cards/QuickLinkCard/QuickLinkCard.styles.js +31 -0
  77. package/dist/components/Cards/QuickLinkCard/index.d.ts +1 -0
  78. package/dist/components/Cards/QuickLinkCard/index.js +17 -0
  79. package/dist/components/Cards/ServicesImageCard/ServicesImageCard.d.ts +12 -0
  80. package/dist/components/Cards/ServicesImageCard/ServicesImageCard.js +24 -0
  81. package/dist/components/Cards/ServicesImageCard/ServicesImageCard.styles.d.ts +17 -0
  82. package/dist/components/Cards/ServicesImageCard/ServicesImageCard.styles.js +38 -0
  83. package/dist/components/Cards/ServicesImageCard/index.d.ts +1 -0
  84. package/dist/components/Cards/ServicesImageCard/index.js +17 -0
  85. package/dist/components/Cards/components.d.ts +15 -0
  86. package/dist/components/Cards/components.js +24 -0
  87. package/dist/components/Cards/index.d.ts +5 -0
  88. package/dist/components/Cards/index.js +11 -1
  89. package/dist/components/Cards/shared.styles.d.ts +11 -3451
  90. package/dist/components/Cards/shared.styles.js +18 -2
  91. package/dist/components/Cards/utils.d.ts +1 -0
  92. package/dist/components/Cards/utils.js +13 -1
  93. package/dist/components/Checkbox/Checkbox.d.ts +2 -13
  94. package/dist/components/Checkbox/Checkbox.js +3 -49
  95. package/dist/components/Checkbox/styled.d.ts +21 -0
  96. package/dist/components/Checkbox/styled.js +52 -0
  97. package/dist/components/Checkbox/types.d.ts +16 -0
  98. package/dist/components/Checkbox/types.js +2 -0
  99. package/dist/components/CurrencyInput/CurrencyInput.d.ts +2 -1
  100. package/dist/components/CurrencyInput/CurrencyInput.js +11 -4
  101. package/dist/components/CurrencyInput/styled.d.ts +10 -0
  102. package/dist/components/CurrencyInput/styled.js +39 -0
  103. package/dist/components/DataTable/styles.d.ts +13 -7475
  104. package/dist/components/Disclosure/Disclosure.d.ts +1 -575
  105. package/dist/components/Divider/Divider.d.ts +1 -1
  106. package/dist/components/Divider/Divider.js +3 -1
  107. package/dist/components/Em/Em.d.ts +1 -575
  108. package/dist/components/EmailInput/EmailInput.d.ts +4 -1
  109. package/dist/components/EmailInput/EmailInput.js +18 -2
  110. package/dist/components/EmptyState/EmptyState.d.ts +2 -0
  111. package/dist/components/EmptyState/EmptyState.js +17 -0
  112. package/dist/components/EmptyState/EmptyState.test.d.ts +1 -0
  113. package/dist/components/EmptyState/EmptyState.test.js +92 -0
  114. package/dist/components/EmptyState/index.d.ts +1 -0
  115. package/dist/components/EmptyState/index.js +17 -0
  116. package/dist/components/EmptyState/styles.d.ts +2 -0
  117. package/dist/components/EmptyState/styles.js +23 -0
  118. package/dist/components/EmptyState/types.d.ts +18 -0
  119. package/dist/components/EmptyState/types.js +2 -0
  120. package/dist/components/ErrorText/ErrorText.d.ts +1 -575
  121. package/dist/components/Field/Field.d.ts +3 -2
  122. package/dist/components/Field/Field.js +3 -2
  123. package/dist/components/Grid/Col.d.ts +1 -575
  124. package/dist/components/HintText/HintText.d.ts +1 -575
  125. package/dist/components/Input/Input.d.ts +2 -1
  126. package/dist/components/Input/Input.js +6 -97
  127. package/dist/components/Input/styled.d.ts +16 -0
  128. package/dist/components/Input/styled.js +96 -0
  129. package/dist/components/LabelText/LabelText.d.ts +1 -575
  130. package/dist/components/LargeValueReference/LargeValueReference.d.ts +11 -0
  131. package/dist/components/LargeValueReference/LargeValueReference.js +49 -0
  132. package/dist/components/LargeValueReference/index.d.ts +1 -0
  133. package/dist/components/LargeValueReference/index.js +17 -0
  134. package/dist/components/LargeValueReference/styles.d.ts +10 -0
  135. package/dist/components/LargeValueReference/styles.js +29 -0
  136. package/dist/components/LineThrough/LineThrough.d.ts +1 -575
  137. package/dist/components/List/styled.d.ts +4 -2300
  138. package/dist/components/Margin/Margin.d.ts +1 -575
  139. package/dist/components/NavHeader/NavHeader.styles.d.ts +11 -6325
  140. package/dist/components/Notification/Notification.d.ts +2 -2
  141. package/dist/components/Notification/Notification.js +20 -12
  142. package/dist/components/Notification/Notification.styles.d.ts +13 -5175
  143. package/dist/components/Notification/Notification.styles.js +21 -2
  144. package/dist/components/PasswordInput/PasswordInput.styled.d.ts +1 -577
  145. package/dist/components/PasswordInput/PasswordInput.styled.js +5 -3
  146. package/dist/components/PasswordInput/PasswordVisibilityToggle.js +2 -8
  147. package/dist/components/Radio/Radio.d.ts +2 -2
  148. package/dist/components/Radio/Radio.js +5 -43
  149. package/dist/components/Radio/Radio.styles.d.ts +9 -0
  150. package/dist/components/Radio/Radio.styles.js +74 -0
  151. package/dist/components/RadioCard/RadioCard.d.ts +2 -1
  152. package/dist/components/RadioCard/RadioCard.js +7 -57
  153. package/dist/components/RadioCard/RadioCard.styles.d.ts +16 -0
  154. package/dist/components/RadioCard/RadioCard.styles.js +97 -0
  155. package/dist/components/Rail/Rail.d.ts +12 -0
  156. package/dist/components/Rail/Rail.js +58 -0
  157. package/dist/components/Rail/RailIndicator.d.ts +7 -0
  158. package/dist/components/Rail/RailIndicator.js +81 -0
  159. package/dist/components/Rail/index.d.ts +1 -0
  160. package/dist/components/Rail/index.js +5 -0
  161. package/dist/components/Rail/styles.d.ts +13 -0
  162. package/dist/components/Rail/styles.js +55 -0
  163. package/dist/components/Rail/useRailPaging.d.ts +13 -0
  164. package/dist/components/Rail/useRailPaging.js +95 -0
  165. package/dist/components/SelectField/Select.d.ts +5 -579
  166. package/dist/components/SelectField/Select.js +7 -107
  167. package/dist/components/SelectField/SelectField.d.ts +2 -2
  168. package/dist/components/SelectField/SelectField.js +2 -2
  169. package/dist/components/SelectField/styled.d.ts +26 -0
  170. package/dist/components/SelectField/styled.js +118 -0
  171. package/dist/components/SkeletonText/SkeletonText.js +4 -4
  172. package/dist/components/Strong/Strong.d.ts +1 -575
  173. package/dist/components/SubLabelText/SubLabelText.d.ts +1 -575
  174. package/dist/components/Tabs/Tab.d.ts +1 -575
  175. package/dist/components/TextareaInput/TextareaInput.js +12 -6
  176. package/dist/components/Toast/Toast.d.ts +10 -4
  177. package/dist/components/Toast/Toast.js +40 -27
  178. package/dist/components/Toggle/Toggle.d.ts +3 -1
  179. package/dist/components/Toggle/Toggle.js +4 -6
  180. package/dist/components/Toggle/styles.d.ts +5 -2300
  181. package/dist/components/Toggle/styles.js +3 -3
  182. package/dist/components/index.d.ts +5 -0
  183. package/dist/components/index.js +5 -0
  184. package/dist/esm/components/ActionList/Action.js +26 -0
  185. package/dist/esm/components/ActionList/ActionList.js +12 -28
  186. package/dist/esm/components/ActionList/ActionListItems/DataListItem.js +19 -0
  187. package/dist/esm/components/ActionList/ActionListItems/EditableListItem.js +131 -0
  188. package/dist/esm/components/ActionList/ActionListItems/NavigationListItem.js +26 -0
  189. package/dist/esm/components/ActionList/ActionListItems/ProgressRing.js +29 -0
  190. package/dist/esm/components/ActionList/ActionListItems/ToggleListItem.js +8 -0
  191. package/dist/esm/components/ActionList/ActionListItems/styles.js +137 -0
  192. package/dist/esm/components/ActionList/components/ActionListHeading.js +7 -0
  193. package/dist/esm/components/ActionList/index.js +6 -1
  194. package/dist/esm/components/ActionList/styled.js +23 -8
  195. package/dist/esm/components/BottomActionBar/BottomActionBar.js +40 -0
  196. package/dist/esm/components/BottomActionBar/OverlayProvider.js +30 -0
  197. package/dist/esm/components/BottomActionBar/index.js +2 -0
  198. package/dist/esm/components/Button/Button.js +1 -1
  199. package/dist/esm/components/Card/Card.js +45 -23
  200. package/dist/esm/components/Card/Card.styles.js +8 -12
  201. package/dist/esm/components/Cards/BalanceCard/BalanceCard.styles.js +2 -2
  202. package/dist/esm/components/Cards/DisruptiveCard/DisruptiveCard.js +41 -0
  203. package/dist/esm/components/Cards/DisruptiveCard/DisruptiveCard.styles.js +5 -0
  204. package/dist/esm/components/Cards/DisruptiveCard/index.js +1 -0
  205. package/dist/esm/components/Cards/HeroImageCard/HeroImageCard.js +28 -0
  206. package/dist/esm/components/Cards/HeroImageCard/HeroImageCard.styles.js +21 -0
  207. package/dist/esm/components/Cards/HeroImageCard/index.js +1 -0
  208. package/dist/esm/components/Cards/IconTextCard/IconTextCard.js +5 -18
  209. package/dist/esm/components/Cards/IconTextCard/IconTextCard.styles.js +0 -5
  210. package/dist/esm/components/Cards/IllustrationTextCard/IllustrationTextCard.js +22 -0
  211. package/dist/esm/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +27 -0
  212. package/dist/esm/components/Cards/IllustrationTextCard/index.js +1 -0
  213. package/dist/esm/components/Cards/LinkTextCard/LinkTextCard.js +7 -6
  214. package/dist/esm/components/Cards/LinkTextCard/LinkTextCard.styles.js +9 -6
  215. package/dist/esm/components/Cards/OfferCard/OfferCard.js +32 -0
  216. package/dist/esm/components/Cards/OfferCard/OfferCard.styles.js +55 -0
  217. package/dist/esm/components/Cards/OfferCard/index.js +1 -0
  218. package/dist/esm/components/Cards/QuickLinkCard/QuickLinkCard.js +23 -0
  219. package/dist/esm/components/Cards/QuickLinkCard/QuickLinkCard.styles.js +25 -0
  220. package/dist/esm/components/Cards/QuickLinkCard/index.js +1 -0
  221. package/dist/esm/components/Cards/ServicesImageCard/ServicesImageCard.js +20 -0
  222. package/dist/esm/components/Cards/ServicesImageCard/ServicesImageCard.styles.js +32 -0
  223. package/dist/esm/components/Cards/ServicesImageCard/index.js +1 -0
  224. package/dist/esm/components/Cards/components.js +19 -0
  225. package/dist/esm/components/Cards/index.js +5 -0
  226. package/dist/esm/components/Cards/shared.styles.js +17 -1
  227. package/dist/esm/components/Cards/utils.js +11 -0
  228. package/dist/esm/components/Checkbox/Checkbox.js +2 -45
  229. package/dist/esm/components/Checkbox/styled.js +46 -0
  230. package/dist/esm/components/Checkbox/types.js +1 -0
  231. package/dist/esm/components/CurrencyInput/CurrencyInput.js +12 -5
  232. package/dist/esm/components/CurrencyInput/styled.js +33 -0
  233. package/dist/esm/components/Divider/Divider.js +3 -1
  234. package/dist/esm/components/EmailInput/EmailInput.js +18 -2
  235. package/dist/esm/components/EmptyState/EmptyState.js +13 -0
  236. package/dist/esm/components/EmptyState/EmptyState.test.js +90 -0
  237. package/dist/esm/components/EmptyState/index.js +1 -0
  238. package/dist/esm/components/EmptyState/styles.js +17 -0
  239. package/dist/esm/components/EmptyState/types.js +1 -0
  240. package/dist/esm/components/Field/Field.js +3 -2
  241. package/dist/esm/components/Input/Input.js +6 -64
  242. package/dist/esm/components/Input/styled.js +60 -0
  243. package/dist/esm/components/LargeValueReference/LargeValueReference.js +45 -0
  244. package/dist/esm/components/LargeValueReference/index.js +1 -0
  245. package/dist/esm/components/LargeValueReference/styles.js +23 -0
  246. package/dist/esm/components/Notification/Notification.js +21 -13
  247. package/dist/esm/components/Notification/Notification.styles.js +20 -1
  248. package/dist/esm/components/PasswordInput/PasswordInput.styled.js +5 -3
  249. package/dist/esm/components/PasswordInput/PasswordVisibilityToggle.js +2 -8
  250. package/dist/esm/components/Radio/Radio.js +4 -39
  251. package/dist/esm/components/Radio/Radio.styles.js +38 -0
  252. package/dist/esm/components/RadioCard/RadioCard.js +5 -52
  253. package/dist/esm/components/RadioCard/RadioCard.styles.js +61 -0
  254. package/dist/esm/components/Rail/Rail.js +21 -0
  255. package/dist/esm/components/Rail/RailIndicator.js +44 -0
  256. package/dist/esm/components/Rail/index.js +1 -0
  257. package/dist/esm/components/Rail/styles.js +49 -0
  258. package/dist/esm/components/Rail/useRailPaging.js +92 -0
  259. package/dist/esm/components/SelectField/Select.js +7 -74
  260. package/dist/esm/components/SelectField/SelectField.js +3 -3
  261. package/dist/esm/components/SelectField/styled.js +82 -0
  262. package/dist/esm/components/SkeletonText/SkeletonText.js +4 -4
  263. package/dist/esm/components/TextareaInput/TextareaInput.js +12 -6
  264. package/dist/esm/components/Toast/Toast.js +40 -27
  265. package/dist/esm/components/Toggle/Toggle.js +4 -6
  266. package/dist/esm/components/Toggle/styles.js +3 -3
  267. package/dist/esm/components/index.js +5 -0
  268. package/dist/esm/hooks/use-font-scaling.js +32 -0
  269. package/dist/esm/index.js +1 -0
  270. package/dist/esm/test/utils.js +12 -0
  271. package/dist/esm/utils/utils.js +12 -1
  272. package/dist/hooks/use-font-scaling.d.ts +26 -0
  273. package/dist/hooks/use-font-scaling.js +35 -0
  274. package/dist/index.d.ts +1 -0
  275. package/dist/index.js +1 -0
  276. package/dist/styled.native.d.ts +1 -3445
  277. package/dist/test/utils.d.ts +4 -0
  278. package/dist/test/utils.js +28 -0
  279. package/dist/utils/utils.d.ts +11 -1
  280. package/dist/utils/utils.js +12 -0
  281. package/package.json +5 -5
  282. package/dist/components/ErrorWrapper/styles.d.ts +0 -0
  283. package/dist/components/ErrorWrapper/styles.js +0 -1
  284. package/dist/esm/components/ErrorWrapper/styles.js +0 -1
@@ -25,14 +25,14 @@ exports.StyledToggleInputWrapper = styled_native_1.default.View(({ theme, labelP
25
25
  : ''}
26
26
  `;
27
27
  });
28
- exports.StyledToggleInput = styled_native_1.default.View(({ theme, checked }) => {
28
+ exports.StyledToggleInput = styled_native_1.default.View(({ theme, checked, toggleBackgroundColor }) => {
29
29
  return `
30
30
  width: ${(0, element_core_1.numToPx)(theme.space[1100])};
31
31
  height: ${(0, element_core_1.numToPx)(theme.space[600])};
32
32
  justify-content: center;
33
33
  border-radius: ${(0, element_core_1.numToPx)(theme.border.radius.lg)};
34
- background: ${checked
35
- ? theme.color.outline.outer
34
+ background-color: ${checked
35
+ ? toggleBackgroundColor || theme.color.outline.outer
36
36
  : theme.color.surface.onSurfaceVariant};
37
37
  `;
38
38
  });
@@ -2,6 +2,7 @@ export * from './Accordion';
2
2
  export * from './ActionCard';
3
3
  export * from './ActionList';
4
4
  export * from './Badge';
5
+ export * from './BottomActionBar';
5
6
  export * from './Button';
6
7
  export * from './Card';
7
8
  export * from './Cards';
@@ -16,10 +17,13 @@ export * from './Divider';
16
17
  export * from './Em';
17
18
  export * from './EmailField';
18
19
  export * from './EmailInput';
20
+ export * from './EmptyState';
21
+ export * from './ErrorWrapper';
19
22
  export * from './Field';
20
23
  export * from './Grid';
21
24
  export * from './Heading';
22
25
  export * from './Icon';
26
+ export * from './LargeValueReference';
23
27
  export * from './LineThrough';
24
28
  export * from './Link';
25
29
  export * from './List';
@@ -37,6 +41,7 @@ export * from './PhoneInput';
37
41
  export * from './Pictogram';
38
42
  export * from './Radio';
39
43
  export * from './RadioCard';
44
+ export * from './Rail';
40
45
  export * from './RemoteImage';
41
46
  export * from './ScreenView';
42
47
  export * from './SegmentedControls';
@@ -18,6 +18,7 @@ __exportStar(require("./Accordion"), exports);
18
18
  __exportStar(require("./ActionCard"), exports);
19
19
  __exportStar(require("./ActionList"), exports);
20
20
  __exportStar(require("./Badge"), exports);
21
+ __exportStar(require("./BottomActionBar"), exports);
21
22
  __exportStar(require("./Button"), exports);
22
23
  __exportStar(require("./Card"), exports);
23
24
  __exportStar(require("./Cards"), exports);
@@ -32,10 +33,13 @@ __exportStar(require("./Divider"), exports);
32
33
  __exportStar(require("./Em"), exports);
33
34
  __exportStar(require("./EmailField"), exports);
34
35
  __exportStar(require("./EmailInput"), exports);
36
+ __exportStar(require("./EmptyState"), exports);
37
+ __exportStar(require("./ErrorWrapper"), exports);
35
38
  __exportStar(require("./Field"), exports);
36
39
  __exportStar(require("./Grid"), exports);
37
40
  __exportStar(require("./Heading"), exports);
38
41
  __exportStar(require("./Icon"), exports);
42
+ __exportStar(require("./LargeValueReference"), exports);
39
43
  __exportStar(require("./LineThrough"), exports);
40
44
  __exportStar(require("./Link"), exports);
41
45
  __exportStar(require("./List"), exports);
@@ -53,6 +57,7 @@ __exportStar(require("./PhoneInput"), exports);
53
57
  __exportStar(require("./Pictogram"), exports);
54
58
  __exportStar(require("./Radio"), exports);
55
59
  __exportStar(require("./RadioCard"), exports);
60
+ __exportStar(require("./Rail"), exports);
56
61
  __exportStar(require("./RemoteImage"), exports);
57
62
  __exportStar(require("./ScreenView"), exports);
58
63
  __exportStar(require("./SegmentedControls"), exports);
@@ -0,0 +1,26 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { TouchableOpacity, View, } from 'react-native';
14
+ import { useBreakpoint } from '../../hooks';
15
+ import { Badge } from '../Badge';
16
+ import { StyledActionInner, StyledActionNodeWrapper, StyledActionText, StyledActionWrapper, StyledHintText, StyledLeftIcon, StyledRightIcon, StyledTextWrapper, } from './styled';
17
+ const ActionWrapper = (_a) => {
18
+ var { children, accessibilityRole, accessibilityLabel, accessibilityHint, activeOpacity = 0.75, fullWidth, hasBorder = false, inverted = false, inList, onPress, testID, standalone = false, ref } = _a, rest = __rest(_a, ["children", "accessibilityRole", "accessibilityLabel", "accessibilityHint", "activeOpacity", "fullWidth", "hasBorder", "inverted", "inList", "onPress", "testID", "standalone", "ref"]);
19
+ return (_jsx(StyledActionWrapper, Object.assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID, inList: inList }, rest, { children: _jsx(TouchableOpacity, { activeOpacity: activeOpacity, accessible: true, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, onPress: onPress, children: _jsx(StyledActionInner, { fullWidth: fullWidth, inList: inList, standalone: standalone, children: children }) }) })));
20
+ };
21
+ const Action = (_a) => {
22
+ var { accessibilityRole = 'link', accessibilityLabel, accessibilityHint, children, fullWidth = false, inverted = false, onPress, testID, iconLeft, iconRight, standalone = false, badgeVariant = 'info', badgeText, hint, ref } = _a, rest = __rest(_a, ["accessibilityRole", "accessibilityLabel", "accessibilityHint", "children", "fullWidth", "inverted", "onPress", "testID", "iconLeft", "iconRight", "standalone", "badgeVariant", "badgeText", "hint", "ref"]);
23
+ const { smallAndUp } = useBreakpoint();
24
+ return (_jsxs(ActionWrapper, Object.assign({ ref: ref, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, fullWidth: fullWidth, inverted: inverted, onPress: onPress, testID: testID, standalone: standalone, hint: hint, badgeText: badgeText }, rest, { children: [iconLeft ? (_jsx(StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, _jsxs(View, { children: [typeof children === 'string' ? (_jsxs(StyledTextWrapper, { children: [_jsx(StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, children: children }), badgeText ? (_jsx(Badge, { variant: badgeVariant, children: badgeText })) : null] })) : (_jsx(StyledActionNodeWrapper, { children: children })), hint ? (_jsx(StyledHintText, { inverted: inverted, children: hint })) : null] }), iconRight ? (_jsx(StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
25
+ };
26
+ export { Action };
@@ -10,35 +10,19 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { Children, cloneElement, } from 'react';
14
- import { TouchableOpacity, View, } from 'react-native';
15
- import { useBreakpoint } from '../../hooks';
13
+ import { Children, cloneElement } from 'react';
14
+ import { View } from 'react-native';
16
15
  import { getValidChildren } from '../../utils';
17
- import { Badge } from '../Badge';
18
- import { StyledActionInner, StyledActionList, StyledActionNodeWrapper, StyledActionText, StyledActionWrapper, StyledHintText, StyledLeftIcon, StyledRightIcon, StyledTextWrapper, } from './styled';
19
- const ActionList = (_a) => {
20
- var { children, inverted, borderBottom } = _a, rest = __rest(_a, ["children", "inverted", "borderBottom"]);
16
+ import { Divider } from '../Divider';
17
+ import { ActionListHeading } from './components/ActionListHeading';
18
+ import { StyledActionList } from './styled';
19
+ export const ActionList = (_a) => {
20
+ var { children, iconName, iconColor, heading, subheading } = _a, rest = __rest(_a, ["children", "iconName", "iconColor", "heading", "subheading"]);
21
21
  const validChildren = getValidChildren(children);
22
22
  const childCount = Children.count(validChildren);
23
- return (_jsx(StyledActionList, Object.assign({}, rest, { children: Children.map(validChildren, (child, index) => {
24
- var _a, _b;
25
- return cloneElement(child, {
26
- fullWidth: true,
27
- index,
28
- hasBorder: (childCount > 1 && index !== childCount - 1) || borderBottom,
29
- inverted: (_a = child.props.inverted) !== null && _a !== void 0 ? _a : inverted, // prioritise child prop
30
- inList: true,
31
- iconRight: (_b = child.props.iconRight) !== null && _b !== void 0 ? _b : 'chevron-right-small',
32
- });
33
- }) })));
23
+ return (_jsxs(View, { children: [_jsx(ActionListHeading, { iconName: iconName, heading: heading, subheading: subheading, iconColor: iconColor }), _jsx(StyledActionList, Object.assign({}, rest, { children: Children.map(validChildren, (child, index) => (_jsxs(View, { children: [cloneElement(child, {
24
+ fullWidth: true,
25
+ index,
26
+ inList: true,
27
+ }), childCount > 1 && index !== childCount - 1 && _jsx(Divider, {})] }))) }))] }));
34
28
  };
35
- const ActionWrapper = (_a) => {
36
- var { children, accessibilityRole, accessibilityLabel, accessibilityHint, activeOpacity = 0.75, fullWidth, hasBorder = false, inverted = false, inList, onPress, testID, standalone = false, ref } = _a, rest = __rest(_a, ["children", "accessibilityRole", "accessibilityLabel", "accessibilityHint", "activeOpacity", "fullWidth", "hasBorder", "inverted", "inList", "onPress", "testID", "standalone", "ref"]);
37
- return (_jsx(StyledActionWrapper, Object.assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID, inList: inList }, rest, { children: _jsx(TouchableOpacity, { activeOpacity: activeOpacity, accessible: true, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, onPress: onPress, children: _jsx(StyledActionInner, { fullWidth: fullWidth, inList: inList, standalone: standalone, children: children }) }) })));
38
- };
39
- const Action = (_a) => {
40
- var { accessibilityRole = 'link', accessibilityLabel, accessibilityHint, children, fullWidth = false, inverted = false, onPress, testID, iconLeft, iconRight, standalone = false, badgeVariant = 'info', badgeText, hint, ref } = _a, rest = __rest(_a, ["accessibilityRole", "accessibilityLabel", "accessibilityHint", "children", "fullWidth", "inverted", "onPress", "testID", "iconLeft", "iconRight", "standalone", "badgeVariant", "badgeText", "hint", "ref"]);
41
- const { smallAndUp } = useBreakpoint();
42
- return (_jsxs(ActionWrapper, Object.assign({ ref: ref, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, fullWidth: fullWidth, inverted: inverted, onPress: onPress, testID: testID, standalone: standalone, hint: hint, badgeText: badgeText }, rest, { children: [iconLeft ? (_jsx(StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, _jsxs(View, { children: [typeof children === 'string' ? (_jsxs(StyledTextWrapper, { children: [_jsx(StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, children: children }), badgeText ? (_jsx(Badge, { variant: badgeVariant, children: badgeText })) : null] })) : (_jsx(StyledActionNodeWrapper, { children: children })), hint ? (_jsx(StyledHintText, { inverted: inverted, children: hint })) : null] }), iconRight ? (_jsx(StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
43
- };
44
- export { Action, ActionList };
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useFontScaling } from '../../../hooks/use-font-scaling';
3
+ import { useTheme } from '../../../styled.native';
4
+ import { Icon } from '../../Icon';
5
+ import { LabelText } from '../../LabelText';
6
+ import { P } from '../../P';
7
+ import { ProgressRing } from './ProgressRing';
8
+ import { ActionListItemWrapper, DataValueText, DirectionAndValueTextContainer, DirectionLabelContainer, GraphicContainer, LeftTextContainer, OnSurfaceP, RightTextContainer, StatusText, StyledImage, ValueTextContainer, } from './styles';
9
+ export const DataListItem = ({ testID, graphic, progressRingPercentage, heading, subHeading, statusText, valueText, valueSubText, directionLabel, }) => {
10
+ const theme = useTheme();
11
+ const isError = statusText === 'Error';
12
+ const hasProgressRing = progressRingPercentage !== undefined;
13
+ const { isFontScalingLarge } = useFontScaling();
14
+ const IconContent = (graphic === null || graphic === void 0 ? void 0 : graphic.type) === 'icon' ? (_jsx(GraphicContainer, { isIcon: true, hasProgress: hasProgressRing, children: _jsx(Icon, { name: graphic.icon, size: 24, color: graphic.iconColor ? graphic.iconColor : theme.color.brand.brand }) })) : null;
15
+ return (_jsxs(ActionListItemWrapper, { testID: testID, children: [(graphic === null || graphic === void 0 ? void 0 : graphic.type) === 'icon' &&
16
+ (hasProgressRing ? (_jsx(ProgressRing, { percentage: progressRingPercentage, children: IconContent })) : (IconContent)), (graphic === null || graphic === void 0 ? void 0 : graphic.type) === 'image' && (_jsx(GraphicContainer, { children: _jsx(StyledImage, { source: typeof graphic.image === 'string'
17
+ ? { uri: graphic.image }
18
+ : graphic.image, resizeMode: "cover", accessibilityLabel: 'Data List Image' }) })), _jsxs(LeftTextContainer, { children: [heading && _jsx(LabelText, { children: heading }), subHeading && _jsx(P, { size: "sm", children: subHeading }), statusText && (_jsx(StatusText, { size: "sm", isError: isError, children: statusText }))] }), _jsxs(RightTextContainer, { children: [_jsxs(DirectionAndValueTextContainer, { children: [directionLabel && (_jsx(DirectionLabelContainer, { scaledUpFont: isFontScalingLarge, children: _jsx(OnSurfaceP, { size: "sm", children: directionLabel }) })), valueText && (_jsx(ValueTextContainer, { scaledUpFont: isFontScalingLarge, children: _jsx(DataValueText, { isError: isError, size: "lg", children: valueText }) }))] }), valueSubText && _jsx(OnSurfaceP, { size: "sm", children: valueSubText })] })] }));
19
+ };
@@ -0,0 +1,131 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useImperativeHandle, useMemo, useRef, useState, } from 'react';
3
+ import { CurrencyInput } from '../../CurrencyInput';
4
+ import { EmailInput } from '../../EmailInput';
5
+ import { Input } from '../../Input/Input';
6
+ import { TextLink } from '../../Link';
7
+ import { Margin } from '../../Margin';
8
+ import { NumberInput } from '../../NumberInput';
9
+ import { P } from '../../P';
10
+ import { SelectField } from '../../SelectField';
11
+ import { Strong } from '../../Strong';
12
+ import { TextareaInput } from '../../TextareaInput';
13
+ import { ActionListItemWrapper, EditableListContainer, EditButtonsContainer, InitialStateContainer, ValueText, } from './styles';
14
+ const getInitialValue = (input) => {
15
+ var _a, _b, _c;
16
+ switch (input.type) {
17
+ case 'number':
18
+ case 'currency':
19
+ return (_a = input.defaultValue) !== null && _a !== void 0 ? _a : null;
20
+ case 'select':
21
+ return (_b = input.defaultValue) !== null && _b !== void 0 ? _b : null;
22
+ case 'text':
23
+ case 'location':
24
+ case 'email':
25
+ case 'textarea':
26
+ return (_c = input.defaultValue) !== null && _c !== void 0 ? _c : '';
27
+ }
28
+ };
29
+ function acceptNumericInput(nextText, prevText) {
30
+ var _a;
31
+ if (nextText === '')
32
+ return '';
33
+ if (!/^[0-9.]*$/.test(nextText))
34
+ return prevText;
35
+ if (((_a = nextText.match(/\./g)) !== null && _a !== void 0 ? _a : []).length > 1)
36
+ return prevText;
37
+ return nextText;
38
+ }
39
+ function parseDraftNumericText(text) {
40
+ if (text === '' || text === '.' || text.endsWith('.'))
41
+ return null;
42
+ const n = Number(text);
43
+ return Number.isFinite(n) ? n : null;
44
+ }
45
+ export const EditableListItem = forwardRef(({ heading, input, onSave }, ref) => {
46
+ const inputRef = useRef(null);
47
+ const initialValue = useMemo(() => getInitialValue(input), [input]);
48
+ const [editState, setEditState] = useState('initial');
49
+ const [value, setValue] = useState(initialValue);
50
+ const [draft, setDraft] = useState(initialValue);
51
+ const [numericInputText, setNumericInputText] = useState('');
52
+ useImperativeHandle(ref, () => ({
53
+ getValue: () => value,
54
+ }));
55
+ const handleNumericChange = (nextText) => {
56
+ const accepted = acceptNumericInput(nextText, numericInputText);
57
+ if (accepted === numericInputText)
58
+ return;
59
+ setNumericInputText(accepted);
60
+ };
61
+ const startEditing = () => {
62
+ setDraft(value);
63
+ setEditState('editing');
64
+ if (input.type === 'number' || input.type === 'currency') {
65
+ const n = value;
66
+ setNumericInputText(n === null ? '' : String(n));
67
+ }
68
+ requestAnimationFrame(() => {
69
+ var _a, _b;
70
+ (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
71
+ });
72
+ };
73
+ const saveEditing = () => {
74
+ const nextValue = input.type === 'number' || input.type === 'currency'
75
+ ? parseDraftNumericText(numericInputText)
76
+ : draft;
77
+ setValue(nextValue);
78
+ setEditState('initial');
79
+ onSave === null || onSave === void 0 ? void 0 : onSave(nextValue);
80
+ };
81
+ const cancelEditing = () => {
82
+ setDraft(value);
83
+ if (input.type === 'number' || input.type === 'currency') {
84
+ const n = value;
85
+ setNumericInputText(n === null ? '' : String(n));
86
+ }
87
+ setEditState('initial');
88
+ };
89
+ const displayValue = useMemo(() => {
90
+ var _a, _b;
91
+ switch (input.type) {
92
+ case 'select':
93
+ return (_a = value === null || value === void 0 ? void 0 : value.label) !== null && _a !== void 0 ? _a : '-';
94
+ case 'number':
95
+ case 'currency':
96
+ return (_b = value === null || value === void 0 ? void 0 : value.toString()) !== null && _b !== void 0 ? _b : '-';
97
+ default: {
98
+ const v = value;
99
+ return v === '' ? '-' : v;
100
+ }
101
+ }
102
+ }, [input.type, value]);
103
+ const renderEditingInput = () => {
104
+ var _a;
105
+ if (editState !== 'editing')
106
+ return null;
107
+ switch (input.type) {
108
+ case 'text':
109
+ return (_jsx(Input, { ref: inputRef, value: draft, onChangeText: v => setDraft(v) }));
110
+ case 'location':
111
+ return (_jsx(Input, { ref: inputRef, value: draft, onChangeText: v => setDraft(v), iconLeft: "address" }));
112
+ case 'email':
113
+ return (_jsx(EmailInput, { ref: inputRef, value: draft, onChangeText: v => setDraft(v) }));
114
+ case 'textarea':
115
+ return (_jsx(TextareaInput, { ref: inputRef, value: draft, onChangeText: v => setDraft(v) }));
116
+ case 'number':
117
+ return (_jsx(NumberInput, { ref: inputRef, value: numericInputText, onChangeText: handleNumericChange }));
118
+ case 'currency':
119
+ return (_jsx(CurrencyInput, { ref: inputRef, value: numericInputText, onChangeText: handleNumericChange }));
120
+ case 'select': {
121
+ const selected = (_a = draft) !== null && _a !== void 0 ? _a : {
122
+ label: 'None',
123
+ value: 'default',
124
+ };
125
+ return (_jsx(SelectField, { ref: inputRef, label: "", options: input.options, onSelected: opt => setDraft(opt.value === 'default' ? null : opt), defaultSelected: selected }));
126
+ }
127
+ }
128
+ };
129
+ return (_jsx(ActionListItemWrapper, { children: _jsxs(EditableListContainer, { children: [heading && (_jsx(P, { children: _jsx(Strong, { children: heading }) })), editState === 'initial' ? (_jsxs(InitialStateContainer, { children: [_jsx(ValueText, { children: displayValue }), _jsx(TextLink, { onPress: startEditing, children: _jsx(P, { size: "md", children: displayValue === '-' ? 'Add' : 'Change' }) })] })) : (_jsxs(_Fragment, { children: [renderEditingInput(), _jsx(Margin, { top: 2 }), _jsxs(EditButtonsContainer, { children: [_jsx(TextLink, { onPress: saveEditing, children: _jsx(P, { children: "Save" }) }), _jsx(TextLink, { onPress: cancelEditing, children: _jsx(P, { children: "Cancel" }) })] })] }))] }) }));
130
+ });
131
+ EditableListItem.displayName = 'EditableListItem';
@@ -0,0 +1,26 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { TouchableOpacity, View, } from 'react-native';
14
+ import { useTheme } from '../../../styled.native';
15
+ import { Icon } from '../../Icon';
16
+ import { P } from '../../P';
17
+ import { ActionListItemWrapper, SubHeading, TextContainer } from './styles';
18
+ export const NavigationListItem = (_a) => {
19
+ var { testID, iconLeft, iconRight, heading, subHeading, onPress, accessibilityRole, accessibilityLabel, accessibilityHint, activeOpacity = 0.75, disabled } = _a, touchableProps = __rest(_a, ["testID", "iconLeft", "iconRight", "heading", "subHeading", "onPress", "accessibilityRole", "accessibilityLabel", "accessibilityHint", "activeOpacity", "disabled"]);
20
+ const theme = useTheme();
21
+ const isPressable = !!onPress && !disabled;
22
+ const Wrapper = isPressable ? TouchableOpacity : View;
23
+ return (_jsx(Wrapper, Object.assign({ testID: testID }, (isPressable && Object.assign({ activeOpacity,
24
+ onPress,
25
+ disabled, accessible: true, accessibilityRole: accessibilityRole !== null && accessibilityRole !== void 0 ? accessibilityRole : 'button', accessibilityLabel: accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : heading, accessibilityHint }, touchableProps)), { children: _jsxs(ActionListItemWrapper, { children: [iconLeft && (_jsx(Icon, { name: iconLeft, size: 24, color: theme.color.brand.brand })), (heading || subHeading) && (_jsxs(TextContainer, { children: [heading && _jsx(P, { children: heading }), subHeading && _jsx(SubHeading, { size: "sm", children: subHeading })] })), iconRight && _jsx(Icon, { name: iconRight, size: 20 })] }) })));
26
+ };
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import Svg, { Circle } from 'react-native-svg';
4
+ import styled, { css, useTheme } from '../../../styled.native';
5
+ import { PROGESS_RING_INNER } from './styles';
6
+ const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
7
+ const Outer = styled(View)(({ outerSize }) => css `
8
+ width: ${outerSize}px;
9
+ height: ${outerSize}px;
10
+ position: relative;
11
+ justify-content: center;
12
+ align-items: center;
13
+ `);
14
+ const RingSvg = styled(Svg) `
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ `;
19
+ export const ProgressRing = ({ percentage, children, }) => {
20
+ const theme = useTheme();
21
+ const innerSize = PROGESS_RING_INNER;
22
+ const strokeWidth = 2;
23
+ const outerSize = innerSize + 2 * strokeWidth;
24
+ const pct = clamp(percentage, 0, 100);
25
+ const radius = (outerSize - strokeWidth) / 2;
26
+ const circumference = 2 * Math.PI * radius;
27
+ const dashOffset = circumference * (1 - pct / 100);
28
+ return (_jsxs(Outer, { outerSize: outerSize, children: [_jsxs(RingSvg, { width: outerSize, height: outerSize, viewBox: `0 0 ${outerSize} ${outerSize}`, children: [_jsx(Circle, { cx: outerSize / 2, cy: outerSize / 2, r: radius, stroke: theme.color.surface.border, strokeWidth: strokeWidth, fill: "none" }), _jsx(Circle, { cx: outerSize / 2, cy: outerSize / 2, r: radius, stroke: theme.color.brand.brand, strokeWidth: strokeWidth, fill: "none", strokeDasharray: `${circumference} ${circumference}`, strokeDashoffset: dashOffset, transform: `rotate(-90 ${outerSize / 2} ${outerSize / 2})` })] }), children] }));
29
+ };
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Switch } from 'react-native';
3
+ import { HintText } from '../../HintText';
4
+ import { P } from '../../P';
5
+ import { ActionListItemWrapper, TextContainer } from './styles';
6
+ export const ToggleListItem = ({ testID, heading, hintText, checked, onToggle, }) => {
7
+ return (_jsxs(ActionListItemWrapper, { testID: testID ? `${testID}-toggle` : undefined, children: [_jsxs(TextContainer, { children: [_jsx(P, { children: heading }), hintText && _jsx(HintText, { children: hintText })] }), _jsx(Switch, { value: checked, onValueChange: onToggle, accessibilityRole: "switch", accessibilityLabel: heading, accessibilityState: { checked } })] }));
8
+ };
@@ -0,0 +1,137 @@
1
+ import { numToPx } from '@ovotech/element-core';
2
+ import { Image, ImageBackground, View } from 'react-native';
3
+ import styled, { css } from '../../../styled.native';
4
+ import { P } from '../../P';
5
+ export const ActionListItemWrapper = styled(View)(({ theme }) => {
6
+ return css `
7
+ flex-direction: row;
8
+ align-items: center;
9
+ justify-content: space-between;
10
+ gap: ${numToPx(theme.space[300])};
11
+ padding: ${numToPx(theme.space[400])} 0;
12
+ `;
13
+ });
14
+ export const TextContainer = styled(View)(() => {
15
+ return css `
16
+ flex: 1;
17
+ `;
18
+ });
19
+ // Editable List Item
20
+ export const EditableListContainer = styled(View)(({ theme }) => {
21
+ return css `
22
+ flex: 1;
23
+ gap: ${numToPx(theme.space[100])};
24
+ `;
25
+ });
26
+ export const InitialStateContainer = styled(View)(() => {
27
+ return css `
28
+ flex-direction: row;
29
+ justify-content: space-between;
30
+ align-items: center;
31
+ `;
32
+ });
33
+ export const ValueText = styled(P)(({ theme }) => {
34
+ return css `
35
+ color: ${theme.color.surface.onSurfaceVariant};
36
+ `;
37
+ });
38
+ export const EditButtonsContainer = styled(View)(({ theme }) => {
39
+ return css `
40
+ gap: ${numToPx(theme.space[300])};
41
+ flex-direction: row;
42
+ justify-content: flex-end;
43
+ `;
44
+ });
45
+ // Navigation List Item
46
+ export const NavigationListContainer = styled(View)(({ theme }) => {
47
+ return css `
48
+ flex-direction: row;
49
+ align-items: center;
50
+ justify-content: space-between;
51
+ gap: ${numToPx(theme.space[100])};
52
+ `;
53
+ });
54
+ export const SubHeading = styled(P)(({ theme }) => {
55
+ return css `
56
+ color: ${theme.color.alert.info};
57
+ `;
58
+ });
59
+ // Data List Item
60
+ export const LeftTextContainer = styled(View)(({ theme }) => {
61
+ return css `
62
+ flex: 1;
63
+ min-width: 0;
64
+ flex-shrink: 1;
65
+ gap: ${numToPx(theme.space[100])};
66
+ `;
67
+ });
68
+ export const RightTextContainer = styled(View)(({ theme }) => {
69
+ return css `
70
+ flex-shrink: 1;
71
+ gap: ${numToPx(theme.space[100])};
72
+ align-items: flex-end;
73
+ `;
74
+ });
75
+ export const StyledImage = styled(Image)(() => {
76
+ return css `
77
+ width: 100%;
78
+ height: 100%;
79
+ `;
80
+ });
81
+ export const StatusText = styled(P)(({ theme, isError, }) => {
82
+ return css `
83
+ color: ${isError ? theme.color.alert.error : theme.color.alert.info};
84
+ `;
85
+ });
86
+ export const ValueTextContainer = styled(View)(({ theme, scaledUpFont, }) => {
87
+ return css `
88
+ min-width: ${scaledUpFont ? 138 : numToPx(theme.space[2400])};
89
+ align-items: flex-end;
90
+ `;
91
+ });
92
+ export const DataValueText = styled(P)(({ theme, isError, }) => {
93
+ return css `
94
+ color: ${isError ? theme.color.alert.error : theme.color.surface.onSurface};
95
+ `;
96
+ });
97
+ export const DirectionLabelContainer = styled(View)(({ theme, scaledUpFont }) => {
98
+ return css `
99
+ min-width: ${scaledUpFont
100
+ ? numToPx(theme.space[900])
101
+ : numToPx(theme.space[600])};
102
+ align-items: flex-end;
103
+ `;
104
+ });
105
+ export const OnSurfaceP = styled(P)(({ theme }) => {
106
+ return css `
107
+ color: ${theme.color.surface.onSurfaceVariant};
108
+ `;
109
+ });
110
+ export const DirectionAndValueTextContainer = styled(View)(() => {
111
+ return css `
112
+ align-items: flex-end;
113
+ justify-content: space-between;
114
+ flex-direction: row;
115
+ `;
116
+ });
117
+ export const PROGESS_RING_INNER = 42;
118
+ export const GraphicContainer = styled(ImageBackground)(({ theme, isIcon, hasProgress }) => {
119
+ return css `
120
+ border-radius: ${numToPx(theme.border.radius['2xl'])};
121
+ background-color: ${hasProgress
122
+ ? theme.color.surface.bright
123
+ : theme.color.surface.surface};
124
+ border-width: 0;
125
+ padding: ${isIcon ? numToPx(theme.space[200]) : 0};
126
+ width: ${hasProgress
127
+ ? `${PROGESS_RING_INNER}px`
128
+ : numToPx(theme.space[1100])};
129
+ height: ${hasProgress
130
+ ? `${PROGESS_RING_INNER}px`
131
+ : numToPx(theme.space[1100])};
132
+ flex-shrink: 0;
133
+ overflow: hidden;
134
+ align-items: center;
135
+ justify-content: center;
136
+ `;
137
+ });
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import { Icon } from '../../Icon';
4
+ import { P } from '../../P';
5
+ import { Strong } from '../../Strong';
6
+ import { GraphicContainer, InfoRowWrapper } from '../styled';
7
+ export const ActionListHeading = ({ iconName, iconColor = 'surface.surface', heading, subheading, }) => (_jsxs(InfoRowWrapper, { children: [iconName && (_jsx(GraphicContainer, { children: _jsx(Icon, { name: iconName, size: 24, color: iconColor }) })), _jsxs(View, { children: [heading && (_jsx(P, { size: "xl", children: _jsx(Strong, { children: heading }) })), subheading && _jsx(P, { children: subheading })] })] }));
@@ -1 +1,6 @@
1
- export { Action, ActionList } from './ActionList';
1
+ export { Action } from './Action';
2
+ export { ActionList } from './ActionList';
3
+ export { DataListItem } from './ActionListItems/DataListItem';
4
+ export { EditableListItem } from './ActionListItems/EditableListItem';
5
+ export { NavigationListItem } from './ActionListItems/NavigationListItem';
6
+ export { ToggleListItem } from './ActionListItems/ToggleListItem';
@@ -1,23 +1,22 @@
1
1
  import { numToPx } from '@ovotech/element-core';
2
2
  import styled, { css } from '../../styled.native';
3
3
  import { styledComponentWithBreakpoints } from '../../utils';
4
+ import { Card } from '../Card';
4
5
  import { HintText } from '../HintText';
5
6
  import { Icon } from '../Icon';
6
- const StyledList = styled.View(({ theme, smallAndUp }) => css `
7
+ const StyledList = styled(Card)(({ theme, smallAndUp, inverted }) => css `
7
8
  flex-direction: column;
9
+ padding-top: ${numToPx(theme.space[0])};
10
+ padding-bottom: ${numToPx(theme.space[0])};
8
11
  margin-top: ${numToPx(smallAndUp ? theme.space[300] : theme.space[200])};
9
12
  margin-bottom: ${numToPx(smallAndUp ? theme.space[300] : theme.space[200])};
13
+ background-color: ${inverted && theme.color.neutral.black};
10
14
  `);
11
15
  export const StyledActionList = styledComponentWithBreakpoints(StyledList);
12
- export const StyledActionWrapper = styled.View(({ theme, hasBorder, inverted, inList, hint, badgeText }) => css `
16
+ export const StyledActionWrapper = styled.View(({ theme }) => css `
13
17
  width: 100%;
14
18
  align-self: flex-start;
15
- border-bottom-width: ${hasBorder ? numToPx(theme.border.width.sm) : 0};
16
- border-bottom-style: solid;
17
- border-bottom-color: ${inverted
18
- ? theme.color.surface.dim
19
- : theme.color.brand.fixed.onBrand};
20
- padding: ${inList && (hint || badgeText) ? numToPx(theme.space[200]) : 0} 0;
19
+ padding: ${numToPx(theme.space[400])} 0 ${numToPx(theme.space[400])} 0;
21
20
  `);
22
21
  export const StyledActionInner = styled.View(({ fullWidth, standalone }) => css `
23
22
  flex-direction: row;
@@ -72,3 +71,19 @@ export const StyledHintText = styled(HintText)(({ theme, inverted = false }) =>
72
71
  : theme.color.surface.onSurfaceVariant};
73
72
  `;
74
73
  });
74
+ // Action List Heading
75
+ export const GraphicContainer = styled.View(({ theme }) => css `
76
+ width: ${numToPx(theme.unit[1100])};
77
+ height: ${numToPx(theme.unit[1100])};
78
+ background-color: ${theme.color.surface.bright};
79
+ display: flex;
80
+ justify-content: center;
81
+ align-items: center;
82
+ border-radius: ${numToPx(theme.border.radius['2xl'])};
83
+ padding: ${numToPx(theme.space[200])};
84
+ `);
85
+ export const InfoRowWrapper = styled.View(({ theme }) => css `
86
+ flex-direction: row;
87
+ align-items: center;
88
+ gap: ${numToPx(theme.space[300])};
89
+ `);
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
+ import styled, { useTheme } from '../../styled.native';
5
+ import { Button } from '../Button';
6
+ import { Stack } from '../Stack';
7
+ import { useOverlayContext } from './OverlayProvider';
8
+ const BottomActionContainer = styled.View(({ theme, background }) => ({
9
+ width: '100%',
10
+ bottom: 0,
11
+ position: 'absolute',
12
+ borderTopWidth: theme.border.width.sm,
13
+ borderTopColor: theme.color.surface.border,
14
+ backgroundColor: background === 'surface'
15
+ ? theme.color.surface.surface
16
+ : background === 'bright'
17
+ ? theme.color.surface.bright
18
+ : 'transparent',
19
+ paddingTop: theme.space[300],
20
+ paddingHorizontal: theme.space[400],
21
+ }));
22
+ export const BottomActionBar = ({ surfaceAction, outlineAction, background = 'surface', }) => {
23
+ const theme = useTheme();
24
+ const overlay = useOverlayContext();
25
+ const insets = useSafeAreaInsets();
26
+ const paddingBottom = insets.bottom + theme.space[100];
27
+ React.useEffect(() => {
28
+ overlay.mount('BottomAction', _jsx(BottomActionContainer, { background: background, pointerEvents: "auto", style: { paddingBottom: paddingBottom }, children: _jsxs(Stack, { spaceBetween: 3, children: [surfaceAction && (_jsx(Button, { fullWidth: true, variant: "surface", onPress: surfaceAction.onPress, children: surfaceAction.label })), outlineAction && (_jsx(Button, { fullWidth: true, variant: "outline", onPress: outlineAction.onPress, children: outlineAction.label }))] }) }));
29
+ return () => overlay.unmount('BottomAction');
30
+ }, [
31
+ overlay,
32
+ background,
33
+ paddingBottom,
34
+ surfaceAction === null || surfaceAction === void 0 ? void 0 : surfaceAction.label,
35
+ surfaceAction === null || surfaceAction === void 0 ? void 0 : surfaceAction.onPress,
36
+ outlineAction === null || outlineAction === void 0 ? void 0 : outlineAction.label,
37
+ outlineAction === null || outlineAction === void 0 ? void 0 : outlineAction.onPress,
38
+ ]);
39
+ return null;
40
+ };