@ovotech/element-native 2.2.0 → 3.0.0-canary-edaf96f-93

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 (302) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Accordion/Accordion.js +22 -25
  3. package/dist/components/Accordion/Group.js +10 -32
  4. package/dist/components/Accordion/Icon.js +19 -14
  5. package/dist/components/Accordion/hooks.d.ts +1 -1
  6. package/dist/components/Accordion/hooks.js +3 -26
  7. package/dist/components/Accordion/styles.d.ts +688 -46
  8. package/dist/components/Accordion/styles.js +56 -49
  9. package/dist/components/Badge/Badge.d.ts +54 -46
  10. package/dist/components/Badge/Badge.js +35 -20
  11. package/dist/components/CTAButton/CTAButton.d.ts +7 -12
  12. package/dist/components/CTAButton/CTAButton.js +23 -27
  13. package/dist/components/CTALink/CTALink.d.ts +4 -4
  14. package/dist/components/CTALink/CTALink.js +5 -27
  15. package/dist/components/Card/Card.d.ts +47 -45
  16. package/dist/components/Card/Card.js +5 -25
  17. package/dist/components/Checkbox/Checkbox.d.ts +3 -3
  18. package/dist/components/Checkbox/Checkbox.js +18 -57
  19. package/dist/components/Checkbox/CheckboxField.js +7 -37
  20. package/dist/components/DataTable/DataTable.d.ts +3 -12
  21. package/dist/components/DataTable/DataTable.js +11 -98
  22. package/dist/components/DataTable/TableRow.d.ts +2 -0
  23. package/dist/components/DataTable/TableRow.js +31 -0
  24. package/dist/components/DataTable/index.d.ts +2 -0
  25. package/dist/components/DataTable/index.js +16 -0
  26. package/dist/components/DataTable/styles.d.ts +2517 -0
  27. package/dist/components/DataTable/styles.js +77 -0
  28. package/dist/components/DataTable/types.d.ts +15 -0
  29. package/dist/components/DataTable/types.js +2 -0
  30. package/dist/components/DateField/DateField.d.ts +2 -2
  31. package/dist/components/DateField/DateField.js +9 -28
  32. package/dist/components/DescriptionList/DescriptionList.js +8 -32
  33. package/dist/components/DescriptionList/styled.d.ts +50 -44
  34. package/dist/components/DescriptionList/styled.js +9 -34
  35. package/dist/components/Disclosure/Disclosure.d.ts +3 -3
  36. package/dist/components/Disclosure/Disclosure.js +12 -18
  37. package/dist/components/Divider/Divider.js +4 -7
  38. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
  39. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -28
  40. package/dist/components/ErrorText/ErrorText.d.ts +45 -39
  41. package/dist/components/ErrorText/ErrorText.js +7 -4
  42. package/dist/components/Field/Field.d.ts +2 -2
  43. package/dist/components/Field/Field.js +18 -49
  44. package/dist/components/FormGroup/FormGroup.js +2 -3
  45. package/dist/components/Grid/Col.d.ts +45 -39
  46. package/dist/components/Grid/Col.js +4 -3
  47. package/dist/components/Grid/Row.d.ts +47 -41
  48. package/dist/components/Grid/Row.js +7 -10
  49. package/dist/components/Heading/Heading.js +21 -32
  50. package/dist/components/HintText/HintText.d.ts +45 -39
  51. package/dist/components/HintText/HintText.js +7 -4
  52. package/dist/components/Icon/Icon.d.ts +3 -4
  53. package/dist/components/Icon/Icon.js +5 -27
  54. package/dist/components/Input/CurrencyInput.d.ts +6 -6
  55. package/dist/components/Input/CurrencyInput.js +3 -25
  56. package/dist/components/Input/EmailInput.d.ts +6 -6
  57. package/dist/components/Input/EmailInput.js +3 -25
  58. package/dist/components/Input/Input.d.ts +8 -8
  59. package/dist/components/Input/Input.js +26 -32
  60. package/dist/components/Input/NumberInput.d.ts +6 -6
  61. package/dist/components/Input/NumberInput.js +3 -25
  62. package/dist/components/Input/PasswordInput.d.ts +6 -6
  63. package/dist/components/Input/PasswordInput.js +3 -25
  64. package/dist/components/Input/PasswordInput.styled.d.ts +45 -39
  65. package/dist/components/Input/PasswordInput.styled.js +2 -5
  66. package/dist/components/Input/PasswordVisibilityToggle.js +14 -29
  67. package/dist/components/Input/PhoneInput.d.ts +10 -0
  68. package/dist/components/Input/PhoneInput.js +19 -0
  69. package/dist/components/Input/TextInput.d.ts +6 -6
  70. package/dist/components/Input/TextInput.js +3 -25
  71. package/dist/components/Input/TextareaInput.d.ts +6 -6
  72. package/dist/components/Input/TextareaInput.js +13 -10
  73. package/dist/components/Input/index.d.ts +1 -1
  74. package/dist/components/Input/index.js +3 -3
  75. package/dist/components/LabelText/LabelText.d.ts +45 -39
  76. package/dist/components/LabelText/LabelText.js +5 -4
  77. package/dist/components/List/List.d.ts +149 -131
  78. package/dist/components/List/List.js +30 -44
  79. package/dist/components/Margin/Margin.d.ts +45 -39
  80. package/dist/components/Margin/Margin.js +3 -3
  81. package/dist/components/NavHeader/NavHeader.d.ts +1 -1
  82. package/dist/components/NavHeader/NavHeader.js +34 -35
  83. package/dist/components/Notification/Notification.d.ts +104 -100
  84. package/dist/components/Notification/Notification.js +32 -49
  85. package/dist/components/Radio/Radio.d.ts +3 -3
  86. package/dist/components/Radio/Radio.js +16 -61
  87. package/dist/components/Radio/RadioField.js +11 -41
  88. package/dist/components/SelectField/Select.d.ts +244 -0
  89. package/dist/components/SelectField/Select.js +102 -0
  90. package/dist/components/SelectField/SelectField.d.ts +7 -0
  91. package/dist/components/SelectField/SelectField.js +33 -0
  92. package/dist/components/SelectField/index.d.ts +1 -0
  93. package/dist/components/SelectField/index.js +5 -0
  94. package/dist/components/SkeletonLoading/Skeleton.d.ts +45 -39
  95. package/dist/components/SkeletonLoading/SkeletonAnimation.js +22 -33
  96. package/dist/components/SkeletonLoading/SkeletonCTA.js +4 -5
  97. package/dist/components/SkeletonLoading/SkeletonCircle.js +4 -6
  98. package/dist/components/SkeletonLoading/SkeletonHeading.js +4 -5
  99. package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
  100. package/dist/components/Stack/Stack.js +6 -28
  101. package/dist/components/Stretch/Stretch.js +2 -2
  102. package/dist/components/SubLabelText/SubLabelText.d.ts +45 -39
  103. package/dist/components/SubLabelText/SubLabelText.js +5 -4
  104. package/dist/components/SummaryList/SummaryList.js +8 -32
  105. package/dist/components/Tabs/Tab.d.ts +4 -4
  106. package/dist/components/Tabs/Tab.js +23 -20
  107. package/dist/components/Tabs/TabList.d.ts +11 -222
  108. package/dist/components/Tabs/TabList.js +22 -18
  109. package/dist/components/Tabs/TabPanel.js +33 -10
  110. package/dist/components/Tabs/Tabs.d.ts +8 -227
  111. package/dist/components/Tabs/Tabs.js +26 -23
  112. package/dist/components/Text/Text.d.ts +234 -204
  113. package/dist/components/Text/Text.js +17 -20
  114. package/dist/components/TextField/CurrencyField.d.ts +6 -6
  115. package/dist/components/TextField/CurrencyField.js +3 -26
  116. package/dist/components/TextField/EmailField.d.ts +6 -6
  117. package/dist/components/TextField/EmailField.js +3 -26
  118. package/dist/components/TextField/NumberField.d.ts +6 -6
  119. package/dist/components/TextField/NumberField.js +3 -26
  120. package/dist/components/TextField/PasswordField.d.ts +6 -6
  121. package/dist/components/TextField/PasswordField.js +3 -26
  122. package/dist/components/TextField/PhoneField.d.ts +10 -0
  123. package/dist/components/TextField/PhoneField.js +33 -0
  124. package/dist/components/TextField/TelField.d.ts +10 -6
  125. package/dist/components/TextField/TelField.js +9 -27
  126. package/dist/components/TextField/TextField.d.ts +6 -6
  127. package/dist/components/TextField/TextField.js +3 -26
  128. package/dist/components/TextField/TextareaField.d.ts +6 -6
  129. package/dist/components/TextField/TextareaField.js +3 -26
  130. package/dist/components/TextField/index.d.ts +1 -0
  131. package/dist/components/TextField/index.js +3 -1
  132. package/dist/components/TextLink/TextLink.d.ts +4 -4
  133. package/dist/components/TextLink/TextLink.js +5 -8
  134. package/dist/components/index.d.ts +1 -0
  135. package/dist/components/index.js +1 -0
  136. package/dist/esm/components/Accordion/Accordion.js +25 -28
  137. package/dist/esm/components/Accordion/Group.js +10 -9
  138. package/dist/esm/components/Accordion/Icon.js +20 -12
  139. package/dist/esm/components/Accordion/hooks.js +3 -3
  140. package/dist/esm/components/Accordion/styles.js +29 -48
  141. package/dist/esm/components/Badge/Badge.js +35 -17
  142. package/dist/esm/components/CTAButton/CTAButton.js +24 -28
  143. package/dist/esm/components/CTALink/CTALink.js +5 -4
  144. package/dist/esm/components/Card/Card.js +5 -25
  145. package/dist/esm/components/Checkbox/Checkbox.js +15 -34
  146. package/dist/esm/components/Checkbox/CheckboxField.js +7 -14
  147. package/dist/esm/components/DataTable/DataTable.js +10 -74
  148. package/dist/esm/components/DataTable/TableRow.js +27 -0
  149. package/dist/esm/components/DataTable/index.js +2 -0
  150. package/dist/esm/components/DataTable/styles.js +51 -0
  151. package/dist/esm/components/DataTable/types.js +1 -0
  152. package/dist/esm/components/DateField/DateField.js +9 -28
  153. package/dist/esm/components/DescriptionList/DescriptionList.js +8 -9
  154. package/dist/esm/components/DescriptionList/styled.js +9 -31
  155. package/dist/esm/components/Disclosure/Disclosure.js +13 -19
  156. package/dist/esm/components/Divider/Divider.js +4 -4
  157. package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -5
  158. package/dist/esm/components/ErrorText/ErrorText.js +7 -4
  159. package/dist/esm/components/Field/Field.js +18 -26
  160. package/dist/esm/components/FormGroup/FormGroup.js +2 -3
  161. package/dist/esm/components/Grid/Col.js +4 -3
  162. package/dist/esm/components/Grid/Row.js +7 -7
  163. package/dist/esm/components/Heading/Heading.js +21 -29
  164. package/dist/esm/components/HintText/HintText.js +7 -4
  165. package/dist/esm/components/Icon/Icon.js +5 -4
  166. package/dist/esm/components/Input/CurrencyInput.js +3 -2
  167. package/dist/esm/components/Input/EmailInput.js +3 -2
  168. package/dist/esm/components/Input/Input.js +27 -33
  169. package/dist/esm/components/Input/NumberInput.js +3 -2
  170. package/dist/esm/components/Input/PasswordInput.js +3 -2
  171. package/dist/esm/components/Input/PasswordInput.styled.js +2 -5
  172. package/dist/esm/components/Input/PasswordVisibilityToggle.js +15 -7
  173. package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +4 -3
  174. package/dist/esm/components/Input/TextInput.js +3 -2
  175. package/dist/esm/components/Input/TextareaInput.js +13 -10
  176. package/dist/esm/components/Input/index.js +1 -1
  177. package/dist/esm/components/LabelText/LabelText.js +5 -4
  178. package/dist/esm/components/List/List.js +31 -45
  179. package/dist/esm/components/Margin/Margin.js +3 -3
  180. package/dist/esm/components/NavHeader/NavHeader.js +34 -32
  181. package/dist/esm/components/Notification/Notification.js +33 -50
  182. package/dist/esm/components/Radio/Radio.js +16 -38
  183. package/dist/esm/components/Radio/RadioField.js +11 -18
  184. package/dist/esm/components/SelectField/Select.js +75 -0
  185. package/dist/esm/components/SelectField/SelectField.js +29 -0
  186. package/dist/esm/components/SelectField/index.js +1 -0
  187. package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +23 -11
  188. package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +4 -5
  189. package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +4 -6
  190. package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +4 -5
  191. package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
  192. package/dist/esm/components/Stack/Stack.js +6 -5
  193. package/dist/esm/components/Stretch/Stretch.js +2 -2
  194. package/dist/esm/components/SubLabelText/SubLabelText.js +5 -4
  195. package/dist/esm/components/SummaryList/SummaryList.js +8 -9
  196. package/dist/esm/components/Tabs/Tab.js +23 -17
  197. package/dist/esm/components/Tabs/TabList.js +21 -18
  198. package/dist/esm/components/Tabs/TabPanel.js +10 -7
  199. package/dist/esm/components/Tabs/Tabs.js +25 -23
  200. package/dist/esm/components/Text/Text.js +17 -20
  201. package/dist/esm/components/TextField/CurrencyField.js +3 -3
  202. package/dist/esm/components/TextField/EmailField.js +3 -3
  203. package/dist/esm/components/TextField/NumberField.js +3 -3
  204. package/dist/esm/components/TextField/PasswordField.js +3 -3
  205. package/dist/esm/components/TextField/PhoneField.js +30 -0
  206. package/dist/esm/components/TextField/TelField.js +9 -4
  207. package/dist/esm/components/TextField/TextField.js +3 -3
  208. package/dist/esm/components/TextField/TextareaField.js +3 -3
  209. package/dist/esm/components/TextField/index.js +1 -0
  210. package/dist/esm/components/TextLink/TextLink.js +5 -8
  211. package/dist/esm/components/index.js +1 -0
  212. package/dist/esm/hooks/use-breakpoint.js +4 -4
  213. package/dist/esm/providers/IconsProvider.js +3 -2
  214. package/dist/esm/providers/icons/ArrowDown.js +2 -3
  215. package/dist/esm/providers/icons/ArrowLeft.js +2 -3
  216. package/dist/esm/providers/icons/ArrowRight.js +2 -3
  217. package/dist/esm/providers/icons/ArrowUp.js +2 -3
  218. package/dist/esm/providers/icons/CaretDown.js +2 -3
  219. package/dist/esm/providers/icons/CaretLeft.js +2 -3
  220. package/dist/esm/providers/icons/CaretRight.js +2 -3
  221. package/dist/esm/providers/icons/CaretUp.js +2 -3
  222. package/dist/esm/providers/icons/Chart.js +2 -3
  223. package/dist/esm/providers/icons/Check.js +2 -3
  224. package/dist/esm/providers/icons/ChevronDown.js +2 -3
  225. package/dist/esm/providers/icons/ChevronLeft.js +2 -3
  226. package/dist/esm/providers/icons/ChevronLeftSmall.js +2 -3
  227. package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +2 -3
  228. package/dist/esm/providers/icons/ChevronRight.js +2 -3
  229. package/dist/esm/providers/icons/ChevronRightSmall.js +2 -3
  230. package/dist/esm/providers/icons/ChevronRightSmallLast.js +2 -3
  231. package/dist/esm/providers/icons/ChevronUp.js +2 -3
  232. package/dist/esm/providers/icons/Cross.js +2 -3
  233. package/dist/esm/providers/icons/Dollar.js +2 -3
  234. package/dist/esm/providers/icons/Download.js +2 -3
  235. package/dist/esm/providers/icons/Electricity.js +2 -3
  236. package/dist/esm/providers/icons/Euro.js +2 -3
  237. package/dist/esm/providers/icons/Gas.js +2 -4
  238. package/dist/esm/providers/icons/Help.js +2 -3
  239. package/dist/esm/providers/icons/Hide.js +2 -3
  240. package/dist/esm/providers/icons/Home.js +2 -3
  241. package/dist/esm/providers/icons/Info.js +2 -3
  242. package/dist/esm/providers/icons/Link.js +2 -4
  243. package/dist/esm/providers/icons/Logo.js +3 -4
  244. package/dist/esm/providers/icons/Minus.js +2 -3
  245. package/dist/esm/providers/icons/NewWindow.js +2 -3
  246. package/dist/esm/providers/icons/PaymentCard.js +2 -3
  247. package/dist/esm/providers/icons/Plus.js +2 -3
  248. package/dist/esm/providers/icons/Pound.js +2 -3
  249. package/dist/esm/providers/icons/Search.js +2 -3
  250. package/dist/esm/providers/icons/Show.js +2 -3
  251. package/dist/esm/providers/icons/User.js +2 -3
  252. package/dist/esm/theme/create-theme.js +0 -153
  253. package/dist/esm/utils/utils.js +7 -3
  254. package/dist/hooks/use-breakpoint.js +4 -4
  255. package/dist/providers/IconsProvider.js +3 -25
  256. package/dist/providers/icons/ArrowDown.js +2 -6
  257. package/dist/providers/icons/ArrowLeft.js +2 -6
  258. package/dist/providers/icons/ArrowRight.js +2 -6
  259. package/dist/providers/icons/ArrowUp.js +2 -6
  260. package/dist/providers/icons/CaretDown.js +2 -6
  261. package/dist/providers/icons/CaretLeft.js +2 -6
  262. package/dist/providers/icons/CaretRight.js +2 -6
  263. package/dist/providers/icons/CaretUp.js +2 -6
  264. package/dist/providers/icons/Chart.js +2 -6
  265. package/dist/providers/icons/Check.js +2 -6
  266. package/dist/providers/icons/ChevronDown.js +2 -6
  267. package/dist/providers/icons/ChevronLeft.js +2 -6
  268. package/dist/providers/icons/ChevronLeftSmall.js +2 -6
  269. package/dist/providers/icons/ChevronLeftSmallFirst.js +2 -6
  270. package/dist/providers/icons/ChevronRight.js +2 -6
  271. package/dist/providers/icons/ChevronRightSmall.js +2 -6
  272. package/dist/providers/icons/ChevronRightSmallLast.js +2 -6
  273. package/dist/providers/icons/ChevronUp.js +2 -6
  274. package/dist/providers/icons/Cross.js +2 -6
  275. package/dist/providers/icons/Dollar.js +2 -6
  276. package/dist/providers/icons/Download.js +2 -6
  277. package/dist/providers/icons/Electricity.js +2 -6
  278. package/dist/providers/icons/Euro.js +2 -6
  279. package/dist/providers/icons/Gas.js +2 -7
  280. package/dist/providers/icons/Help.js +2 -6
  281. package/dist/providers/icons/Hide.js +2 -6
  282. package/dist/providers/icons/Home.js +2 -6
  283. package/dist/providers/icons/Info.js +2 -6
  284. package/dist/providers/icons/Link.js +2 -7
  285. package/dist/providers/icons/Logo.js +2 -6
  286. package/dist/providers/icons/Minus.js +2 -6
  287. package/dist/providers/icons/NewWindow.js +2 -6
  288. package/dist/providers/icons/PaymentCard.js +2 -6
  289. package/dist/providers/icons/Plus.js +2 -6
  290. package/dist/providers/icons/Pound.js +2 -6
  291. package/dist/providers/icons/Search.js +2 -6
  292. package/dist/providers/icons/Show.js +2 -6
  293. package/dist/providers/icons/User.js +2 -6
  294. package/dist/styled.native.d.ts +270 -234
  295. package/dist/theme/create-theme.js +0 -153
  296. package/dist/theme/index.d.ts +45 -39
  297. package/dist/theme/theme.d.ts +0 -90
  298. package/dist/utils/utils.d.ts +5 -4
  299. package/dist/utils/utils.js +8 -26
  300. package/package.json +6 -5
  301. package/dist/components/Input/TelInput.d.ts +0 -10
  302. package/dist/components/Input/TelInput.js +0 -41
@@ -24,70 +24,63 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  }
25
25
  return t;
26
26
  };
27
- import React, { Children, useContext, } from 'react';
27
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
+ import { Children } from 'react';
28
29
  import { View } from 'react-native';
29
30
  import { useBreakpoint } from '../../hooks';
30
- import styled, { css, ThemeContext } from '../../styled.native';
31
+ import styled, { css } from '../../styled.native';
31
32
  import { pxToNumber, styledComponentWithBreakpoints } from '../../utils';
32
33
  import { Stack } from '../Stack';
33
34
  var UlBullet = styled.View(function (_a) {
34
- var _b = _a.theme, colors = _b.colors, list = _b.list, _c = _a.visible, visible = _c === void 0 ? true : _c, smallAndUp = _a.smallAndUp;
35
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, _c = _a.visible, visible = _c === void 0 ? true : _c, smallAndUp = _a.smallAndUp;
35
36
  var lineHeight = smallAndUp
36
- ? list.listItem.lineHeight[1]
37
- : list.listItem.lineHeight[0];
38
- var topMargin = (pxToNumber(lineHeight) - pxToNumber(list.listItem.bulletWidth)) / 2;
39
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "], ["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "])), list.listItem.bulletGap, topMargin, list.listItem.bulletWidth, list.listItem.bulletWidth, visible ? colors.body : 'transparent');
37
+ ? core.lineHeight.body.large
38
+ : core.lineHeight.body.small;
39
+ var topMargin = (pxToNumber(lineHeight) - pxToNumber(core.space[2])) / 2;
40
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "], ["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "])), core.space[2], topMargin, core.space[2], core.space[2], visible ? semantic.message.base : 'transparent');
40
41
  });
41
42
  var StyledBullet = styled.Text(function (_a) {
42
- var _b = _a.theme, text = _b.text, list = _b.list, space = _b.space, smallAndUp = _a.smallAndUp;
43
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
43
44
  var fontSize = smallAndUp
44
- ? list.listItem.fontSize[1]
45
- : list.listItem.fontSize[0];
45
+ ? core.fontSize.body.large
46
+ : core.fontSize.body.small;
46
47
  var lineHeight = smallAndUp
47
- ? list.listItem.lineHeight[1]
48
- : list.listItem.lineHeight[0];
49
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "])), text.fontFamily, lineHeight, text.color, fontSize, list.listItem.bulletGap, space[4]);
48
+ ? core.lineHeight.body.large
49
+ : core.lineHeight.body.small;
50
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "])), core.fontFamily.body.native, lineHeight, semantic.message.base, fontSize, core.space[2], core.space[4]);
50
51
  });
51
52
  var StyledUlItem = styled.View(function () { return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: flex-start;\n justify-content: center;\n "], ["\n flex-direction: row;\n align-items: flex-start;\n justify-content: center;\n "]))); });
52
53
  var Bullet = styledComponentWithBreakpoints(StyledBullet);
53
54
  var ListBulletItem = function (_a) {
54
55
  var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b;
55
- return (React.createElement(StyledUlItem, null,
56
- React.createElement(UlBullet, { visible: showBullets }),
57
- children));
56
+ return (_jsxs(StyledUlItem, { children: [_jsx(UlBullet, { visible: showBullets }), children] }));
58
57
  };
59
58
  var ListNumberedItem = function (_a) {
60
59
  var children = _a.children, prefix = _a.prefix;
61
- return (React.createElement(View, { style: { flexDirection: 'row' } },
62
- React.createElement(Bullet, null, prefix),
63
- children));
60
+ return (_jsxs(View, __assign({ style: { flexDirection: 'row' } }, { children: [_jsx(Bullet, { children: prefix }), children] })));
64
61
  };
65
62
  var StyledList = styled.View(function (_a) {
66
- var list = _a.theme.list, smallAndUp = _a.smallAndUp;
67
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), smallAndUp ? list.marginTop[1] : list.marginTop[0], smallAndUp ? list.marginBottom[1] : list.marginBottom[0]);
63
+ var core = _a.theme.core, smallAndUp = _a.smallAndUp;
64
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), smallAndUp ? core.space[3] : core.space[2], smallAndUp ? core.space[3] : core.space[2]);
68
65
  });
69
66
  var ListWrapper = styledComponentWithBreakpoints(StyledList);
70
67
  var Ul = function (_a) {
71
68
  var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b, rest = __rest(_a, ["children", "showBullets"]);
72
- var list = useContext(ThemeContext).list;
73
- return (React.createElement(ListWrapper, __assign({}, rest),
74
- React.createElement(Stack, { spaceBetween: list.listItem.marginVertical }, Children.map(children, function (child) { return (React.createElement(ListBulletItem, { showBullets: showBullets }, child)); }))));
69
+ return (_jsx(ListWrapper, __assign({}, rest, { children: _jsx(Stack, __assign({ spaceBetween: 2 }, { children: Children.map(children, function (child) { return (_jsx(ListBulletItem, __assign({ showBullets: showBullets }, { children: child }))); }) })) })));
75
70
  };
76
71
  var Ol = function (_a) {
77
72
  var children = _a.children, rest = __rest(_a, ["children"]);
78
- var list = useContext(ThemeContext).list;
79
- return (React.createElement(ListWrapper, __assign({}, rest),
80
- React.createElement(Stack, { spaceBetween: list.listItem.marginVertical }, Children.map(children, function (child, index) { return (React.createElement(ListNumberedItem, { prefix: index + 1 + '.' }, child)); }))));
73
+ return (_jsx(ListWrapper, __assign({}, rest, { children: _jsx(Stack, __assign({ spaceBetween: 2 }, { children: Children.map(children, function (child, index) { return (_jsx(ListNumberedItem, __assign({ prefix: index + 1 + '.' }, { children: child }))); }) })) })));
81
74
  };
82
75
  var StyledLi = styled.Text(function (_a) {
83
- var _b = _a.theme, text = _b.text, list = _b.list, smallAndUp = _a.smallAndUp;
76
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
84
77
  var fontSize = smallAndUp
85
- ? list.listItem.fontSize[1]
86
- : list.listItem.fontSize[0];
78
+ ? core.fontSize.body.large
79
+ : core.fontSize.body.small;
87
80
  var lineHeight = smallAndUp
88
- ? list.listItem.lineHeight[1]
89
- : list.listItem.lineHeight[0];
90
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, lineHeight, text.color, fontSize);
81
+ ? core.lineHeight.body.large
82
+ : core.lineHeight.body.large;
83
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), core.fontFamily.body.native, lineHeight, semantic.message.base, fontSize);
91
84
  });
92
85
  var Li = styledComponentWithBreakpoints(StyledLi);
93
86
  /**
@@ -107,14 +100,9 @@ var StyledDtText = styled.Text(function (_a) {
107
100
  });
108
101
  var DtText = styledComponentWithBreakpoints(StyledDtText);
109
102
  var StyledDtItem = styled.View(function (_a) {
110
- var list = _a.theme.list, smallAndUp = _a.smallAndUp;
111
- var marginTop = smallAndUp
112
- ? list.descriptionTerm.marginTop[1]
113
- : list.descriptionTerm.marginTop[0];
114
- var marginBottom = smallAndUp
115
- ? list.descriptionTerm.marginBottom[1]
116
- : list.descriptionTerm.marginBottom[0];
117
- return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "])), marginTop, marginBottom);
103
+ var core = _a.theme.core, smallAndUp = _a.smallAndUp;
104
+ var marginTop = smallAndUp ? core.space[4] : core.space[3];
105
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "])), marginTop, core.space[1]);
118
106
  });
119
107
  var DtItem = styledComponentWithBreakpoints(StyledDtItem);
120
108
  /**
@@ -123,8 +111,7 @@ var DtItem = styledComponentWithBreakpoints(StyledDtItem);
123
111
  * */
124
112
  var Dt = function (_a) {
125
113
  var children = _a.children, rest = __rest(_a, ["children"]);
126
- return (React.createElement(DtItem, __assign({}, rest),
127
- React.createElement(DtText, null, children)));
114
+ return (_jsx(DtItem, __assign({}, rest, { children: _jsx(DtText, { children: children }) })));
128
115
  };
129
116
  var StyledDdText = styled.Text(function (_a) {
130
117
  var _b = _a.theme, text = _b.text, list = _b.list, smallAndUp = _a.smallAndUp;
@@ -143,8 +130,7 @@ var StyledDdText = styled.Text(function (_a) {
143
130
  var Dd = function (_a) {
144
131
  var children = _a.children, rest = __rest(_a, ["children"]);
145
132
  var breakpoints = useBreakpoint();
146
- return (React.createElement(View, __assign({ style: { flexDirection: 'row' } }, rest),
147
- React.createElement(StyledDdText, __assign({}, breakpoints), children)));
133
+ return (_jsx(View, __assign({ style: { flexDirection: 'row' } }, rest, { children: _jsx(StyledDdText, __assign({}, breakpoints, { children: children })) })));
148
134
  };
149
135
  export { Ul, Ol, Li, Dl, Dt, Dd, ListWrapper };
150
136
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -20,12 +20,12 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import React from 'react';
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { useBreakpoint } from '../../hooks';
25
25
  import styled from '../../styled.native';
26
26
  import { responsiveStyle } from '../../utils';
27
27
  var StyledMargin = styled.View(function (_a) {
28
- var space = _a.theme.space, mTop = _a.mTop, mBottom = _a.mBottom, mLeft = _a.mLeft, mRight = _a.mRight, horizontal = _a.horizontal, vertical = _a.vertical, all = _a.all, breakpoints = _a.breakpoints;
28
+ var space = _a.theme.core.space, mTop = _a.mTop, mBottom = _a.mBottom, mLeft = _a.mLeft, mRight = _a.mRight, horizontal = _a.horizontal, vertical = _a.vertical, all = _a.all, breakpoints = _a.breakpoints;
29
29
  var formatter = function (spaceKey) {
30
30
  return spaceKey === 0 ? '0' : space[spaceKey];
31
31
  };
@@ -42,6 +42,6 @@ var StyledMargin = styled.View(function (_a) {
42
42
  var Margin = function (_a) {
43
43
  var top = _a.top, bottom = _a.bottom, left = _a.left, right = _a.right, rest = __rest(_a, ["top", "bottom", "left", "right"]);
44
44
  var breakpoints = useBreakpoint();
45
- return (React.createElement(StyledMargin, __assign({}, rest, { breakpoints: breakpoints, mTop: top, mBottom: bottom, mLeft: left, mRight: right })));
45
+ return (_jsx(StyledMargin, __assign({}, rest, { breakpoints: breakpoints, mTop: top, mBottom: bottom, mLeft: left, mRight: right })));
46
46
  };
47
47
  export { Margin };
@@ -2,60 +2,62 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
2
2
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
3
  return cooked;
4
4
  };
5
- import React from 'react';
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
17
  import { TouchableOpacity, View } from 'react-native';
7
18
  import Animated, { FadeIn, FadeOut, Layout } from 'react-native-reanimated';
8
19
  import { Path, Svg } from 'react-native-svg';
9
20
  import styled, { css } from '../../styled.native';
10
21
  import { Heading3, Heading4 } from '../Heading';
11
22
  var BackIcon = function () {
12
- return (React.createElement(Svg, { width: "10", height: "16", viewBox: "0 0 10 16" },
13
- React.createElement(Path, { d: "M0.579956 8L8.57996 16L9.99996 14.58L3.41996 8L9.99996 1.42L8.57996 0L0.579956 8Z", fill: "white" })));
23
+ return (_jsx(Svg, __assign({ width: "10", height: "16", viewBox: "0 0 10 16" }, { children: _jsx(Path, { d: "M0.579956 8L8.57996 16L9.99996 14.58L3.41996 8L9.99996 1.42L8.57996 0L0.579956 8Z", fill: "white" }) })));
14
24
  };
15
25
  var StyledText = styled.Text(function (_a) {
16
- var _b = _a.theme, colors = _b.colors, fonts = _b.fonts, fontSizes = _b.fontSizes;
17
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "], ["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "])), colors.primaryContrast, fontSizes[1], fonts.body);
26
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic;
27
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "], ["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "])), semantic.inverted.message.base, core.fontSize.small.small, core.fontFamily.body.native);
18
28
  });
19
29
  var LeftHeaderText = styled(StyledText)(function (_a) {
20
- var space = _a.theme.space;
21
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n "], ["\n padding-left: ", ";\n "])), space[2]);
30
+ var core = _a.theme.core;
31
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n "], ["\n padding-left: ", ";\n "])), core.space[2]);
22
32
  });
23
33
  var HeadlineView = styled(Animated.View)(function (_a) {
24
- var space = _a.theme.space;
25
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 0 ", " ", ";\n "], ["\n padding: 0 ", " ", ";\n "])), space[3], space[3]);
34
+ var core = _a.theme.core;
35
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 0 ", " ", ";\n "], ["\n padding: 0 ", " ", ";\n "])), core.space[3], core.space[3]);
26
36
  });
27
37
  var RootView = styled.View(function (_a) {
28
- var colors = _a.theme.colors;
29
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n "], ["\n background-color: ", ";\n overflow: hidden;\n "])), colors.primary);
38
+ var semantic = _a.theme.semantic;
39
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n "], ["\n background-color: ", ";\n overflow: hidden;\n "])), semantic.message.branded);
30
40
  });
31
41
  var StyledView = styled(Animated.View)(function (_a) {
32
- var space = _a.theme.space, marginTop = _a.marginTop;
33
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "], ["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "])), space[3], space[2], marginTop !== null && marginTop !== void 0 ? marginTop : 0);
42
+ var core = _a.theme.core, marginTop = _a.marginTop;
43
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "], ["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "])), core.space[3], core.space[2], marginTop !== null && marginTop !== void 0 ? marginTop : 0);
34
44
  });
35
45
  var StyledHeading4 = styled(Heading4)(function (_a) {
36
- var _b = _a.theme, fonts = _b.fonts, colors = _b.colors, textAlign = _a.textAlign;
37
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "], ["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "])), fonts.bold, colors.primaryContrast, textAlign);
46
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, textAlign = _a.textAlign;
47
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "], ["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "])), core.fontFamily.bodyBold.native, semantic.inverted.message.base, textAlign);
38
48
  });
39
49
  var StyledHeading3 = styled(Heading3)(function (_a) {
40
- var colors = _a.theme.colors;
41
- return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "], ["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "])), colors.primaryContrast);
50
+ var semantic = _a.theme.semantic;
51
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "], ["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "])), semantic.inverted.message.base);
42
52
  });
43
53
  export var NavHeader = function (_a) {
44
54
  var options = _a.options, headline = _a.headline;
45
- return (React.createElement(RootView, { layout: Layout === null || Layout === void 0 ? void 0 : Layout.duration(150) },
46
- React.createElement(StyledView, { marginTop: options === null || options === void 0 ? void 0 : options.statusBarHeight },
47
- (options === null || options === void 0 ? void 0 : options.headerLeft) ? (options === null || options === void 0 ? void 0 : options.headerLeft()) : (options === null || options === void 0 ? void 0 : options.canGoBack()) ? (React.createElement(TouchableOpacity, { style: {
48
- flexDirection: 'row',
49
- alignItems: 'center',
50
- flex: 1,
51
- flexGrow: 1,
52
- flexShrink: 1,
53
- }, onPress: options === null || options === void 0 ? void 0 : options.goBack },
54
- React.createElement(BackIcon, null),
55
- React.createElement(LeftHeaderText, null, "Back"))) : null,
56
- React.createElement(Animated.View, { entering: FadeIn, exiting: FadeOut, style: { flex: 1, flexGrow: 3, flexShrink: 1 } },
57
- React.createElement(StyledHeading4, { textAlign: (options === null || options === void 0 ? void 0 : options.canGoBack()) ? 'center' : 'left', numberOfLines: 1 }, !headline ? options === null || options === void 0 ? void 0 : options.title : ' ')),
58
- React.createElement(View, { style: { flex: 1, flexGrow: 1, flexShrink: 1 } }, options.headerRight ? options.headerRight() : null)),
59
- headline ? (React.createElement(HeadlineView, { entering: FadeIn, exiting: FadeOut }, (options === null || options === void 0 ? void 0 : options.title) ? (React.createElement(StyledHeading3, null, options.title)) : null)) : null));
55
+ return (_jsxs(RootView, __assign({ layout: Layout === null || Layout === void 0 ? void 0 : Layout.duration(150) }, { children: [_jsxs(StyledView, __assign({ marginTop: options === null || options === void 0 ? void 0 : options.statusBarHeight }, { children: [(options === null || options === void 0 ? void 0 : options.headerLeft) ? (options === null || options === void 0 ? void 0 : options.headerLeft()) : (options === null || options === void 0 ? void 0 : options.canGoBack()) ? (_jsxs(TouchableOpacity, __assign({ style: {
56
+ flexDirection: 'row',
57
+ alignItems: 'center',
58
+ flex: 1,
59
+ flexGrow: 1,
60
+ flexShrink: 1,
61
+ }, onPress: options === null || options === void 0 ? void 0 : options.goBack }, { children: [_jsx(BackIcon, {}), _jsx(LeftHeaderText, { children: "Back" })] }))) : null, _jsx(Animated.View, __assign({ entering: FadeIn, exiting: FadeOut, style: { flex: 1, flexGrow: 3, flexShrink: 1 } }, { children: _jsx(StyledHeading4, __assign({ textAlign: (options === null || options === void 0 ? void 0 : options.canGoBack()) ? 'center' : 'left', numberOfLines: 1 }, { children: !headline ? options === null || options === void 0 ? void 0 : options.title : ' ' })) })), _jsx(View, __assign({ style: { flex: 1, flexGrow: 1, flexShrink: 1 } }, { children: options.headerRight ? options.headerRight() : null }))] })), headline ? (_jsx(HeadlineView, __assign({ entering: FadeIn, exiting: FadeOut }, { children: (options === null || options === void 0 ? void 0 : options.title) ? (_jsx(StyledHeading3, { children: options.title })) : null }))) : null] })));
60
62
  };
61
63
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -24,69 +24,52 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  }
25
25
  return t;
26
26
  };
27
- import React, { forwardRef, useContext, useState, } from 'react';
27
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
+ import { forwardRef, useState } from 'react';
28
29
  import { View } from 'react-native';
29
- import { useBreakpoint } from '../../hooks';
30
- import styled, { css, ThemeContext } from '../../styled.native';
30
+ import styled, { css } from '../../styled.native';
31
31
  import { Icon } from '../Icon';
32
- var pxToNumber = function (value) { return parseInt(value.replace('px', '')); };
33
- var numberToPx = function (value) { return "".concat(value, "px"); };
34
32
  var NotificationBox = styled.View(function (_a) {
35
- var _b = _a.theme, colors = _b.colors, notification = _b.notification, space = _b.space, variant = _a.variant, noMargin = _a.noMargin;
36
- // @ts-ignore
37
- var currentVariant = notification.variants[variant];
38
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "])), notification.borderWidth, currentVariant.borderColor, notification.borderRadius, noMargin ? 0 : space[4], colors.canvas);
33
+ var core = _a.theme.core, noMargin = _a.noMargin;
34
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n "])), core.borderWidth.medium, core.color.brand.white, core.radius.small, noMargin ? 0 : core.space[4]);
39
35
  });
40
36
  export var NotificationContentBox = styled.View(function (_a) {
41
- var _b = _a.theme, colors = _b.colors, _c = _b.notification, paddingX = _c.paddingX, paddingY = _c.paddingY, variants = _c.variants, smallAndUp = _a.smallAndUp, variant = _a.variant;
42
- // @ts-ignore
43
- var currentVariant = variants[variant];
44
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "], ["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "])), paddingX[smallAndUp ? 1 : 0], paddingY[smallAndUp ? 1 : 0], currentVariant.textColor, colors.body, currentVariant.textColor);
37
+ var core = _a.theme.core;
38
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), core.color.brand.white, core.space[2], core.space[3], core.space[4], core.space[4]);
45
39
  });
46
40
  export var NotificationTitleBox = styled.View(function (_a) {
47
- var notification = _a.theme.notification, variant = _a.variant, dismissable = _a.dismissable, smallAndUp = _a.smallAndUp;
48
- // @ts-ignore to support additional palettes.
49
- var currentVariant = notification.variants[variant];
50
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.background, notification.paddingX[smallAndUp ? 1 : 0], notification.paddingX[smallAndUp ? 1 : 0], notification.paddingY[smallAndUp ? 1 : 0], dismissable
51
- ? numberToPx(pxToNumber(notification.dismiss.touchSize) -
52
- pxToNumber(notification.dismiss.size))
53
- : notification.paddingY[smallAndUp ? 1 : 0]);
41
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, variant = _a.variant, dismissible = _a.dismissible;
42
+ var currentVariant = semantic[variant];
43
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.surface, core.space[2], core.space[2], core.space[4], dismissible ? core.space[3] : core.space[4]);
54
44
  });
55
45
  var NotificationTitleText = styled.Text(function (_a) {
56
- var _b = _a.theme, fonts = _b.fonts, responsiveFontSizes = _b.responsiveFontSizes, notification = _b.notification, variant = _a.variant;
57
- // @ts-ignore
58
- var currentVariant = notification.variants[variant];
59
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n "])), currentVariant.textColor, fonts.bold, responsiveFontSizes.body[0]);
46
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, variant = _a.variant;
47
+ var currentVariant = semantic[variant];
48
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "])), core.fontSize.body.small, core.fontFamily.bodyBold.native, currentVariant.message);
60
49
  });
61
- var DismissButton = styled.TouchableOpacity(function (_a) {
62
- var notification = _a.theme.notification;
63
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "], ["\n position: absolute;\n top: 0;\n right: 0;\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "])), notification.dismiss.touchSize, notification.dismiss.touchSize);
50
+ var DismissButton = styled.TouchableOpacity(function () {
51
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 16px;\n height: 16px;\n margin-left: auto;\n "], ["\n width: 16px;\n height: 16px;\n margin-left: auto;\n "])));
52
+ });
53
+ var StyledIcon = styled(Icon)(function (_a) {
54
+ var semantic = _a.theme.semantic, variant = _a.variant;
55
+ var currentVariant = semantic[variant];
56
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), currentVariant.message);
64
57
  });
65
58
  export var Notification = forwardRef(function (_a, ref) {
66
- var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissable = _a.dismissable, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissable", "onDismiss"]);
67
- var breakpoints = useBreakpoint();
68
- var theme = useContext(ThemeContext);
59
+ var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissible = _a.dismissible, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissible", "onDismiss"]);
69
60
  var _c = useState(false), dismissed = _c[0], setDismissed = _c[1];
70
- if (dismissed || (!title && !children)) {
61
+ if (dismissed || !children) {
71
62
  return null;
72
63
  }
73
- return (React.createElement(View, __assign({ ref: ref }, rest),
74
- React.createElement(NotificationBox, __assign({ variant: variant, noMargin: noMargin, testID: "nb-notification" }, breakpoints),
75
- !!title ? (React.createElement(NotificationTitleBox, __assign({ variant: variant, dismissable: dismissable }, breakpoints),
76
- React.createElement(View, null, typeof title === 'string' ? (React.createElement(NotificationTitleText, { variant: variant }, title)) : (title)))) : null,
77
- dismissable ? (React.createElement(DismissButton, { accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
78
- setDismissed(true);
79
- if (onDismiss) {
80
- onDismiss();
81
- }
82
- } },
83
- React.createElement(Icon, { name: theme.notification.dismiss.icon, size: theme.notification.dismiss.size,
84
- // @ts-ignore
85
- color: theme.notification.variants[variant].textColor }))) : null,
86
- children ? (React.createElement(NotificationContentBox, __assign({ "data-testid": "el-notification-box", variant: variant }, breakpoints), children)) : null)));
64
+ return (_jsx(View, __assign({ ref: ref }, rest, { children: _jsxs(NotificationBox, __assign({ noMargin: noMargin, testID: "nb-notification" }, { children: [_jsxs(NotificationTitleBox, __assign({ variant: variant, dismissible: dismissible }, { children: [_jsx(NotificationTitleText, __assign({ variant: variant }, { children: title })), dismissible ? (_jsx(DismissButton, __assign({ accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
65
+ setDismissed(true);
66
+ if (onDismiss) {
67
+ onDismiss();
68
+ }
69
+ } }, { children: _jsx(StyledIcon, { variant: variant, name: "cross", size: "16" }) }))) : null] })), children ? (_jsx(NotificationContentBox, __assign({ "data-testid": "el-notification-box" }, { children: children }))) : null] })) })));
87
70
  });
88
- export var ErrorNotification = forwardRef(function (props, ref) { return (React.createElement(Notification, __assign({ ref: ref, variant: "error", title: "Oops, there\u2019s a problem\u2026" }, props))); });
89
- export var SuccessNotification = forwardRef(function (props, ref) { return (React.createElement(Notification, __assign({ ref: ref, variant: "success" }, props))); });
90
- export var InfoNotification = forwardRef(function (props, ref) { return React.createElement(Notification, __assign({ ref: ref, variant: "info" }, props)); });
91
- export var WarningNotification = forwardRef(function (props, ref) { return React.createElement(Notification, __assign({ ref: ref, variant: "warning" }, props)); });
92
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
71
+ export var ErrorNotification = forwardRef(function (props, ref) { return _jsx(Notification, __assign({ ref: ref, variant: "error" }, props)); });
72
+ export var SuccessNotification = forwardRef(function (props, ref) { return (_jsx(Notification, __assign({ ref: ref, variant: "success" }, props))); });
73
+ export var InfoNotification = forwardRef(function (props, ref) { return _jsx(Notification, __assign({ ref: ref, variant: "info" }, props)); });
74
+ export var WarningNotification = forwardRef(function (props, ref) { return _jsx(Notification, __assign({ ref: ref, variant: "warning" }, props)); });
75
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -1,7 +1,3 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
1
  var __assign = (this && this.__assign) || function () {
6
2
  __assign = Object.assign || function(t) {
7
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -24,60 +20,42 @@ var __rest = (this && this.__rest) || function (s, e) {
24
20
  }
25
21
  return t;
26
22
  };
27
- import React, { forwardRef } from 'react';
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { forwardRef } from 'react';
28
25
  import { TouchableOpacity, View, } from 'react-native';
29
26
  import styled from '../../styled.native';
30
- import { pxToNumber } from '../../utils';
31
27
  import { HintText } from '../HintText';
32
28
  import { LabelText } from '../LabelText';
33
29
  var StyledRadioInputWrapper = styled.View(function (_a) {
34
- var radio = _a.theme.radio;
35
- var radioSize = pxToNumber(radio.size);
36
- var gap = pxToNumber(radio.gap);
37
- return "\n width: ".concat(radioSize + gap, "px;\n height: ").concat(radio.touchSize, ";\n ");
30
+ var core = _a.theme.core;
31
+ return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n margin-right: 10px;\n ");
38
32
  });
39
33
  var StyledRadioInput = styled.View(function (_a) {
40
- var radio = _a.theme.radio, invalid = _a.invalid, checked = _a.checked;
41
- var touchSize = pxToNumber(radio.touchSize);
42
- var radioSize = pxToNumber(radio.size);
43
- var radioDistance = (touchSize - radioSize) / 2;
44
- return "\n width: ".concat(radio.size, ";\n height: ").concat(radio.size, ";\n border: ").concat(radio.borderWidth, " solid;\n margin-top: ").concat(radioDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n border-color: ").concat(invalid
45
- ? radio.errorColor
34
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
35
+ return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n border: ").concat(core.borderWidth.small, " solid;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n border-color: ").concat(invalid
36
+ ? semantic.error.border
46
37
  : checked
47
- ? radio.dotColor
48
- : radio.borderColor, ";\n background: ").concat(radio.background, ";\n background: ").concat(checked ? radio.checkedBackground : radio.background, ";\n ");
38
+ ? core.color.blue.dark
39
+ : semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
49
40
  });
50
41
  var StyledRadioInputDot = styled.View(function (_a) {
51
- var radio = _a.theme.radio, checked = _a.checked;
52
- var radioSize = pxToNumber(radio.size);
53
- var dotSize = pxToNumber(radio.dotSize);
54
- var borderWidth = pxToNumber(radio.borderWidth);
55
- var dotDistance = (radioSize - dotSize) / 2 - borderWidth;
56
- return "\n width: ".concat(radio.dotSize, ";\n height: ").concat(radio.dotSize, ";\n margin: ").concat(dotDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n background: ").concat(radio.dotColor, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
42
+ var core = _a.theme.core, checked = _a.checked;
43
+ return "\n width: ".concat(core.space[3], ";\n height: ").concat(core.space[3], ";\n border-radius: 50%;\n background: ").concat(core.color.blue.dark, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
57
44
  });
58
45
  var Input = function (_a) {
59
46
  var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
60
- return (React.createElement(StyledRadioInputWrapper, __assign({}, rest),
61
- React.createElement(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID },
62
- React.createElement(StyledRadioInputDot, { checked: checked }))));
47
+ return (_jsx(StyledRadioInputWrapper, __assign({}, rest, { children: _jsx(StyledRadioInput, __assign({ invalid: invalid, checked: checked, testID: testID }, { children: _jsx(StyledRadioInputDot, { checked: checked }) })) })));
63
48
  };
64
- var RadioLabelText = styled(LabelText)(function (_a) {
65
- var space = _a.theme.space;
66
- return "\n padding-top: ".concat(space[3], ";\n ");
49
+ var StyledWrapper = styled.View(function (_a) {
50
+ var core = _a.theme.core;
51
+ return "\n padding-top: ".concat(core.space[3], ";\n flex-direction: row;\n ");
67
52
  });
68
- var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
69
53
  var Radio = forwardRef(function (_a, ref) {
70
54
  var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
71
55
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
72
56
  value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
73
57
  _b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
74
58
  activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
75
- return (React.createElement(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest),
76
- React.createElement(StyledWrapper, null,
77
- React.createElement(Input, { checked: checked, invalid: invalid, testID: testID }),
78
- React.createElement(View, { style: { flexShrink: 1 } },
79
- React.createElement(RadioLabelText, null, label),
80
- hint ? React.createElement(HintText, null, hint) : null))));
59
+ return (_jsx(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { children: [_jsx(Input, { checked: checked, invalid: invalid, testID: testID }), _jsxs(View, __assign({ style: { flexShrink: 1 } }, { children: [_jsx(LabelText, { children: label }), hint ? _jsx(HintText, { children: hint }) : null] }))] }) })));
81
60
  });
82
61
  export { Radio };
83
- var templateObject_1;
@@ -20,7 +20,8 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import React, { Children, cloneElement, } from 'react';
23
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
24
+ import { Children, cloneElement } from 'react';
24
25
  import { View } from 'react-native';
25
26
  import { callAll } from '../../utils';
26
27
  import { ErrorText } from '../ErrorText';
@@ -31,22 +32,14 @@ import { Stack } from '../Stack';
31
32
  var RadioField = function (_a) {
32
33
  var label = _a.label, hint = _a.hint, error = _a.error, children = _a.children, _b = _a.optional, optional = _b === void 0 ? false : _b, value = _a.value, onValueChange = _a.onValueChange, rest = __rest(_a, ["label", "hint", "error", "children", "optional", "value", "onValueChange"]);
33
34
  var hasError = !!error;
34
- return (React.createElement(FormGroup, __assign({}, rest, { error: hasError }),
35
- React.createElement(Stack, { spaceBetween: 1 },
36
- React.createElement(View, null,
37
- React.createElement(LabelText, null,
38
- label,
39
- optional ? ' (optional)' : null),
40
- hint ? React.createElement(HintText, null, hint) : null,
41
- error ? React.createElement(ErrorText, null, error) : null),
42
- React.createElement(View, { accessibilityRole: "radiogroup" }, Children.map(children, function (child) {
43
- return cloneElement(child, {
44
- invalid: hasError ? true : child.props.invalid,
45
- checked: child.props.checked != null
46
- ? child.props.checked
47
- : value && (value === child.props.value ? true : false),
48
- onPress: callAll(onValueChange && (function () { return onValueChange(child.props.value); }), child.props.onPress),
49
- });
50
- })))));
35
+ return (_jsx(FormGroup, __assign({}, rest, { error: hasError }, { children: _jsxs(Stack, __assign({ spaceBetween: 1 }, { children: [_jsxs(View, { children: [_jsxs(LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null, error ? _jsx(ErrorText, { children: error }) : null] }), _jsx(View, __assign({ accessibilityRole: "radiogroup" }, { children: Children.map(children, function (child) {
36
+ return cloneElement(child, {
37
+ invalid: hasError ? true : child.props.invalid,
38
+ checked: child.props.checked != null
39
+ ? child.props.checked
40
+ : value && (value === child.props.value ? true : false),
41
+ onPress: callAll(onValueChange && (function () { return onValueChange(child.props.value); }), child.props.onPress),
42
+ });
43
+ }) }))] })) })));
51
44
  };
52
45
  export { RadioField };
@@ -0,0 +1,75 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
17
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
18
+ if (ar || !(i in from)) {
19
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
20
+ ar[i] = from[i];
21
+ }
22
+ }
23
+ return to.concat(ar || Array.prototype.slice.call(from));
24
+ };
25
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
+ import { useState } from 'react';
27
+ import { Modal, ScrollView, View } from 'react-native';
28
+ import styled, { css } from '../../styled.native';
29
+ import { Icon } from '../Icon';
30
+ import { P, Strong } from '../Text';
31
+ var SelectInput = styled.TouchableOpacity(function (_a) {
32
+ var _b = _a.theme, semantic = _b.semantic, core = _b.core, hasError = _a.hasError;
33
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-color: ", ";\n border-width: ", "\n border-radius: ", ";\n padding-vertical: ", "\n padding-left: ", "\n padding-right: 14px;\n height: 44px;\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-color: ", ";\n border-width: ", "\n border-radius: ", ";\n padding-vertical: ", "\n padding-left: ", "\n padding-right: 14px;\n height: 44px;\n "])), core.color.brand.white, hasError ? semantic.error.border : semantic.border.functional, core.borderWidth.small, core.radius.small, core.space[2], core.space[2]);
34
+ });
35
+ var DropdownWrapper = styled.View(function (_a) {
36
+ var core = _a.theme.core;
37
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n justify-content: center;\n align-items: center;\n // 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4\n background-color: ", "40;\n "], ["\n flex: 1;\n justify-content: center;\n align-items: center;\n // 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4\n background-color: ", "40;\n "])), core.color.neutral.darkest);
38
+ });
39
+ var DropdownContainer = styled.SafeAreaView(function (_a) {
40
+ var core = _a.theme.core;
41
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 95%;\n max-height: 70%;\n border-radius: ", ";\n background-color: ", ";\n "], ["\n width: 95%;\n max-height: 70%;\n border-radius: ", ";\n background-color: ", ";\n "])), core.radius.small, core.color.brand.white);
42
+ });
43
+ var SelectOption = styled.TouchableOpacity(function (_a) {
44
+ var _b = _a.theme, semantic = _b.semantic, core = _b.core, isLastOption = _a.isLastOption;
45
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n border-bottom-color: ", ";\n border-bottom-width: ", "px;\n padding-horizontal: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n border-bottom-color: ", ";\n border-bottom-width: ", "px;\n padding-horizontal: ", ";\n "])), semantic.border.differentiated, isLastOption ? 0 : 1, core.space[4]);
46
+ });
47
+ var Radio = styled.View(function (_a) {
48
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, isChecked = _a.isChecked;
49
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 24px;\n height: 24px;\n margin-left: auto;\n border-radius: 24px;\n border-width: ", ";\n border-color: ", ";\n "], ["\n width: 24px;\n height: 24px;\n margin-left: auto;\n border-radius: 24px;\n border-width: ", ";\n border-color: ", ";\n "])), core.borderWidth.small, isChecked
50
+ ? semantic.focus.outline
51
+ : semantic.border.functional);
52
+ });
53
+ var RadioDot = styled.View(function (_a) {
54
+ var semantic = _a.theme.semantic, isChecked = _a.isChecked;
55
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n position: absolute;\n top: 5px;\n width: 12px;\n height: 12px;\n border-radius: 12px;\n align-self: center;\n opacity: ", ";\n "], ["\n background-color: ", ";\n position: absolute;\n top: 5px;\n width: 12px;\n height: 12px;\n border-radius: 12px;\n align-self: center;\n opacity: ", ";\n "])), semantic.focus.outline, isChecked ? 1 : 0);
56
+ });
57
+ var StyledP = styled(P)(function (_a) {
58
+ var core = _a.theme.core;
59
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n "], ["\n margin-top: ", ";\n "])), core.space[3]);
60
+ });
61
+ export var Select = function (_a) {
62
+ var _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.defaultSelected, defaultSelected = _c === void 0 ? { label: '', value: 'default' } : _c, _d = _a.noOptionMessage, noOptionMessage = _d === void 0 ? 'No option selected' : _d, _e = _a.onSelected, onSelected = _e === void 0 ? function () { return null; } : _e, _f = _a.hasError, hasError = _f === void 0 ? false : _f, _g = _a.testID, testID = _g === void 0 ? 'select' : _g;
63
+ var _h = useState(false), isOpen = _h[0], setOpen = _h[1];
64
+ var _j = useState(defaultSelected), selected = _j[0], setSelected = _j[1];
65
+ var handleOptionPress = function (val) {
66
+ onSelected(val);
67
+ setOpen(false);
68
+ setSelected(val);
69
+ };
70
+ var extendedOptions = __spreadArray([
71
+ { label: "-- ".concat(noOptionMessage, " --"), value: 'default' }
72
+ ], options, true);
73
+ return (_jsxs(View, { children: [_jsxs(SelectInput, __assign({ testID: testID, hasError: hasError, onPress: function () { return setOpen(!isOpen); } }, { children: [_jsx(P, __assign({ style: { marginTop: 0, marginBottom: 0 } }, { children: selected.value === 'default' ? '' : selected.label })), _jsx(Icon, { name: "chevron-down", size: 16, style: { marginLeft: 'auto' } })] })), _jsx(Modal, __assign({ transparent: true, visible: isOpen, animationType: "fade", onRequestClose: function () { return setOpen(false); } }, { children: _jsx(DropdownWrapper, { children: _jsx(DropdownContainer, { children: _jsx(ScrollView, __assign({ nestedScrollEnabled: true }, { children: extendedOptions.map(function (option, i) { return (_jsxs(SelectOption, __assign({ accessibilityRole: "radio", isLastOption: i === extendedOptions.length - 1, onPress: function () { return handleOptionPress(option); } }, { children: [_jsx(StyledP, { children: _jsx(Strong, { children: option.label }) }), _jsx(Radio, __assign({ isChecked: selected.value === option.value }, { children: _jsx(RadioDot, { isChecked: selected.value === option.value }) }))] }), option.label)); }) })) }) }) }))] }));
74
+ };
75
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;