@ovotech/element-native 2.2.0-canary-668a0ee-91 → 2.2.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 (302) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Accordion/Accordion.js +24 -21
  3. package/dist/components/Accordion/Group.js +32 -10
  4. package/dist/components/Accordion/Icon.js +14 -19
  5. package/dist/components/Accordion/hooks.d.ts +1 -1
  6. package/dist/components/Accordion/hooks.js +26 -3
  7. package/dist/components/Accordion/styles.d.ts +46 -688
  8. package/dist/components/Accordion/styles.js +49 -56
  9. package/dist/components/Badge/Badge.d.ts +46 -54
  10. package/dist/components/Badge/Badge.js +20 -35
  11. package/dist/components/CTAButton/CTAButton.d.ts +12 -7
  12. package/dist/components/CTAButton/CTAButton.js +27 -23
  13. package/dist/components/CTALink/CTALink.d.ts +4 -4
  14. package/dist/components/CTALink/CTALink.js +27 -5
  15. package/dist/components/Card/Card.d.ts +45 -47
  16. package/dist/components/Card/Card.js +25 -5
  17. package/dist/components/Checkbox/Checkbox.d.ts +3 -3
  18. package/dist/components/Checkbox/Checkbox.js +57 -18
  19. package/dist/components/Checkbox/CheckboxField.js +37 -7
  20. package/dist/components/DataTable/DataTable.d.ts +12 -3
  21. package/dist/components/DataTable/DataTable.js +98 -11
  22. package/dist/components/DataTable/index.d.ts +0 -2
  23. package/dist/components/DataTable/index.js +0 -16
  24. package/dist/components/DateField/DateField.d.ts +2 -2
  25. package/dist/components/DateField/DateField.js +28 -9
  26. package/dist/components/DescriptionList/DescriptionList.js +32 -8
  27. package/dist/components/DescriptionList/styled.d.ts +44 -50
  28. package/dist/components/DescriptionList/styled.js +34 -9
  29. package/dist/components/Disclosure/Disclosure.d.ts +3 -3
  30. package/dist/components/Disclosure/Disclosure.js +18 -12
  31. package/dist/components/Divider/Divider.js +7 -4
  32. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
  33. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +28 -6
  34. package/dist/components/ErrorText/ErrorText.d.ts +39 -45
  35. package/dist/components/ErrorText/ErrorText.js +4 -7
  36. package/dist/components/Field/Field.d.ts +2 -2
  37. package/dist/components/Field/Field.js +49 -18
  38. package/dist/components/FormGroup/FormGroup.js +3 -2
  39. package/dist/components/Grid/Col.d.ts +39 -45
  40. package/dist/components/Grid/Col.js +3 -4
  41. package/dist/components/Grid/Row.d.ts +41 -47
  42. package/dist/components/Grid/Row.js +10 -7
  43. package/dist/components/Heading/Heading.js +32 -21
  44. package/dist/components/HintText/HintText.d.ts +39 -45
  45. package/dist/components/HintText/HintText.js +4 -7
  46. package/dist/components/Icon/Icon.d.ts +4 -3
  47. package/dist/components/Icon/Icon.js +27 -5
  48. package/dist/components/Input/CurrencyInput.d.ts +6 -6
  49. package/dist/components/Input/CurrencyInput.js +25 -3
  50. package/dist/components/Input/EmailInput.d.ts +6 -6
  51. package/dist/components/Input/EmailInput.js +25 -3
  52. package/dist/components/Input/Input.d.ts +8 -8
  53. package/dist/components/Input/Input.js +32 -26
  54. package/dist/components/Input/NumberInput.d.ts +6 -6
  55. package/dist/components/Input/NumberInput.js +25 -3
  56. package/dist/components/Input/PasswordInput.d.ts +6 -6
  57. package/dist/components/Input/PasswordInput.js +25 -3
  58. package/dist/components/Input/PasswordInput.styled.d.ts +39 -45
  59. package/dist/components/Input/PasswordInput.styled.js +5 -2
  60. package/dist/components/Input/PasswordVisibilityToggle.js +29 -14
  61. package/dist/components/Input/TelInput.d.ts +10 -0
  62. package/dist/components/Input/TelInput.js +41 -0
  63. package/dist/components/Input/TextInput.d.ts +6 -6
  64. package/dist/components/Input/TextInput.js +25 -3
  65. package/dist/components/Input/TextareaInput.d.ts +6 -6
  66. package/dist/components/Input/TextareaInput.js +10 -13
  67. package/dist/components/Input/index.d.ts +1 -1
  68. package/dist/components/Input/index.js +3 -3
  69. package/dist/components/LabelText/LabelText.d.ts +39 -45
  70. package/dist/components/LabelText/LabelText.js +4 -5
  71. package/dist/components/List/List.d.ts +131 -149
  72. package/dist/components/List/List.js +44 -30
  73. package/dist/components/Margin/Margin.d.ts +39 -45
  74. package/dist/components/Margin/Margin.js +3 -3
  75. package/dist/components/NavHeader/NavHeader.d.ts +1 -1
  76. package/dist/components/NavHeader/NavHeader.js +35 -34
  77. package/dist/components/Notification/Notification.d.ts +100 -104
  78. package/dist/components/Notification/Notification.js +49 -32
  79. package/dist/components/Radio/Radio.d.ts +3 -3
  80. package/dist/components/Radio/Radio.js +61 -16
  81. package/dist/components/Radio/RadioField.js +41 -11
  82. package/dist/components/SkeletonLoading/Skeleton.d.ts +39 -45
  83. package/dist/components/SkeletonLoading/SkeletonAnimation.js +33 -22
  84. package/dist/components/SkeletonLoading/SkeletonCTA.js +5 -4
  85. package/dist/components/SkeletonLoading/SkeletonCircle.js +6 -4
  86. package/dist/components/SkeletonLoading/SkeletonHeading.js +5 -4
  87. package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
  88. package/dist/components/Stack/Stack.js +28 -6
  89. package/dist/components/Stretch/Stretch.js +2 -2
  90. package/dist/components/SubLabelText/SubLabelText.d.ts +39 -45
  91. package/dist/components/SubLabelText/SubLabelText.js +4 -5
  92. package/dist/components/SummaryList/SummaryList.js +32 -8
  93. package/dist/components/Tabs/Tab.d.ts +4 -4
  94. package/dist/components/Tabs/Tab.js +20 -23
  95. package/dist/components/Tabs/TabList.d.ts +222 -11
  96. package/dist/components/Tabs/TabList.js +18 -22
  97. package/dist/components/Tabs/TabPanel.js +10 -33
  98. package/dist/components/Tabs/Tabs.d.ts +227 -8
  99. package/dist/components/Tabs/Tabs.js +23 -26
  100. package/dist/components/Text/Text.d.ts +204 -234
  101. package/dist/components/Text/Text.js +20 -17
  102. package/dist/components/TextField/CurrencyField.d.ts +6 -6
  103. package/dist/components/TextField/CurrencyField.js +26 -3
  104. package/dist/components/TextField/EmailField.d.ts +6 -6
  105. package/dist/components/TextField/EmailField.js +26 -3
  106. package/dist/components/TextField/NumberField.d.ts +6 -6
  107. package/dist/components/TextField/NumberField.js +26 -3
  108. package/dist/components/TextField/PasswordField.d.ts +6 -6
  109. package/dist/components/TextField/PasswordField.js +26 -3
  110. package/dist/components/TextField/TelField.d.ts +6 -10
  111. package/dist/components/TextField/TelField.js +27 -9
  112. package/dist/components/TextField/TextField.d.ts +6 -6
  113. package/dist/components/TextField/TextField.js +26 -3
  114. package/dist/components/TextField/TextareaField.d.ts +6 -6
  115. package/dist/components/TextField/TextareaField.js +26 -3
  116. package/dist/components/TextField/index.d.ts +0 -1
  117. package/dist/components/TextField/index.js +1 -3
  118. package/dist/components/TextLink/TextLink.d.ts +4 -4
  119. package/dist/components/TextLink/TextLink.js +8 -5
  120. package/dist/components/index.d.ts +0 -1
  121. package/dist/components/index.js +0 -1
  122. package/dist/esm/components/Accordion/Accordion.js +26 -23
  123. package/dist/esm/components/Accordion/Group.js +9 -10
  124. package/dist/esm/components/Accordion/Icon.js +12 -20
  125. package/dist/esm/components/Accordion/hooks.js +3 -3
  126. package/dist/esm/components/Accordion/styles.js +48 -29
  127. package/dist/esm/components/Badge/Badge.js +17 -35
  128. package/dist/esm/components/CTAButton/CTAButton.js +28 -24
  129. package/dist/esm/components/CTALink/CTALink.js +4 -5
  130. package/dist/esm/components/Card/Card.js +25 -5
  131. package/dist/esm/components/Checkbox/Checkbox.js +34 -15
  132. package/dist/esm/components/Checkbox/CheckboxField.js +14 -7
  133. package/dist/esm/components/DataTable/DataTable.js +74 -10
  134. package/dist/esm/components/DataTable/index.js +0 -2
  135. package/dist/esm/components/DateField/DateField.js +28 -9
  136. package/dist/esm/components/DescriptionList/DescriptionList.js +9 -8
  137. package/dist/esm/components/DescriptionList/styled.js +31 -9
  138. package/dist/esm/components/Disclosure/Disclosure.js +19 -13
  139. package/dist/esm/components/Divider/Divider.js +4 -4
  140. package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +5 -6
  141. package/dist/esm/components/ErrorText/ErrorText.js +4 -7
  142. package/dist/esm/components/Field/Field.js +26 -18
  143. package/dist/esm/components/FormGroup/FormGroup.js +3 -2
  144. package/dist/esm/components/Grid/Col.js +3 -4
  145. package/dist/esm/components/Grid/Row.js +7 -7
  146. package/dist/esm/components/Heading/Heading.js +29 -21
  147. package/dist/esm/components/HintText/HintText.js +4 -7
  148. package/dist/esm/components/Icon/Icon.js +4 -5
  149. package/dist/esm/components/Input/CurrencyInput.js +2 -3
  150. package/dist/esm/components/Input/EmailInput.js +2 -3
  151. package/dist/esm/components/Input/Input.js +33 -27
  152. package/dist/esm/components/Input/NumberInput.js +2 -3
  153. package/dist/esm/components/Input/PasswordInput.js +2 -3
  154. package/dist/esm/components/Input/PasswordInput.styled.js +5 -2
  155. package/dist/esm/components/Input/PasswordVisibilityToggle.js +7 -15
  156. package/dist/esm/components/Input/{PhoneInput.js → TelInput.js} +3 -4
  157. package/dist/esm/components/Input/TextInput.js +2 -3
  158. package/dist/esm/components/Input/TextareaInput.js +10 -13
  159. package/dist/esm/components/Input/index.js +1 -1
  160. package/dist/esm/components/LabelText/LabelText.js +4 -5
  161. package/dist/esm/components/List/List.js +45 -31
  162. package/dist/esm/components/Margin/Margin.js +3 -3
  163. package/dist/esm/components/NavHeader/NavHeader.js +32 -34
  164. package/dist/esm/components/Notification/Notification.js +50 -33
  165. package/dist/esm/components/Radio/Radio.js +38 -16
  166. package/dist/esm/components/Radio/RadioField.js +18 -11
  167. package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +11 -23
  168. package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +5 -4
  169. package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +6 -4
  170. package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +5 -4
  171. package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
  172. package/dist/esm/components/Stack/Stack.js +5 -6
  173. package/dist/esm/components/Stretch/Stretch.js +2 -2
  174. package/dist/esm/components/SubLabelText/SubLabelText.js +4 -5
  175. package/dist/esm/components/SummaryList/SummaryList.js +9 -8
  176. package/dist/esm/components/Tabs/Tab.js +17 -23
  177. package/dist/esm/components/Tabs/TabList.js +18 -21
  178. package/dist/esm/components/Tabs/TabPanel.js +7 -10
  179. package/dist/esm/components/Tabs/Tabs.js +23 -25
  180. package/dist/esm/components/Text/Text.js +20 -17
  181. package/dist/esm/components/TextField/CurrencyField.js +3 -3
  182. package/dist/esm/components/TextField/EmailField.js +3 -3
  183. package/dist/esm/components/TextField/NumberField.js +3 -3
  184. package/dist/esm/components/TextField/PasswordField.js +3 -3
  185. package/dist/esm/components/TextField/TelField.js +4 -9
  186. package/dist/esm/components/TextField/TextField.js +3 -3
  187. package/dist/esm/components/TextField/TextareaField.js +3 -3
  188. package/dist/esm/components/TextField/index.js +0 -1
  189. package/dist/esm/components/TextLink/TextLink.js +8 -5
  190. package/dist/esm/components/index.js +0 -1
  191. package/dist/esm/hooks/use-breakpoint.js +4 -4
  192. package/dist/esm/providers/IconsProvider.js +2 -3
  193. package/dist/esm/providers/icons/ArrowDown.js +3 -2
  194. package/dist/esm/providers/icons/ArrowLeft.js +3 -2
  195. package/dist/esm/providers/icons/ArrowRight.js +3 -2
  196. package/dist/esm/providers/icons/ArrowUp.js +3 -2
  197. package/dist/esm/providers/icons/CaretDown.js +3 -2
  198. package/dist/esm/providers/icons/CaretLeft.js +3 -2
  199. package/dist/esm/providers/icons/CaretRight.js +3 -2
  200. package/dist/esm/providers/icons/CaretUp.js +3 -2
  201. package/dist/esm/providers/icons/Chart.js +3 -2
  202. package/dist/esm/providers/icons/Check.js +3 -2
  203. package/dist/esm/providers/icons/ChevronDown.js +3 -2
  204. package/dist/esm/providers/icons/ChevronLeft.js +3 -2
  205. package/dist/esm/providers/icons/ChevronLeftSmall.js +3 -2
  206. package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +3 -2
  207. package/dist/esm/providers/icons/ChevronRight.js +3 -2
  208. package/dist/esm/providers/icons/ChevronRightSmall.js +3 -2
  209. package/dist/esm/providers/icons/ChevronRightSmallLast.js +3 -2
  210. package/dist/esm/providers/icons/ChevronUp.js +3 -2
  211. package/dist/esm/providers/icons/Cross.js +3 -2
  212. package/dist/esm/providers/icons/Dollar.js +3 -2
  213. package/dist/esm/providers/icons/Download.js +3 -2
  214. package/dist/esm/providers/icons/Electricity.js +3 -2
  215. package/dist/esm/providers/icons/Euro.js +3 -2
  216. package/dist/esm/providers/icons/Gas.js +4 -2
  217. package/dist/esm/providers/icons/Help.js +3 -2
  218. package/dist/esm/providers/icons/Hide.js +3 -2
  219. package/dist/esm/providers/icons/Home.js +3 -2
  220. package/dist/esm/providers/icons/Info.js +3 -2
  221. package/dist/esm/providers/icons/Link.js +4 -2
  222. package/dist/esm/providers/icons/Logo.js +4 -3
  223. package/dist/esm/providers/icons/Minus.js +3 -2
  224. package/dist/esm/providers/icons/NewWindow.js +3 -2
  225. package/dist/esm/providers/icons/PaymentCard.js +3 -2
  226. package/dist/esm/providers/icons/Plus.js +3 -2
  227. package/dist/esm/providers/icons/Pound.js +3 -2
  228. package/dist/esm/providers/icons/Search.js +3 -2
  229. package/dist/esm/providers/icons/Show.js +3 -2
  230. package/dist/esm/providers/icons/User.js +3 -2
  231. package/dist/esm/theme/create-theme.js +153 -0
  232. package/dist/esm/utils/utils.js +3 -7
  233. package/dist/hooks/use-breakpoint.js +4 -4
  234. package/dist/providers/IconsProvider.js +25 -3
  235. package/dist/providers/icons/ArrowDown.js +6 -2
  236. package/dist/providers/icons/ArrowLeft.js +6 -2
  237. package/dist/providers/icons/ArrowRight.js +6 -2
  238. package/dist/providers/icons/ArrowUp.js +6 -2
  239. package/dist/providers/icons/CaretDown.js +6 -2
  240. package/dist/providers/icons/CaretLeft.js +6 -2
  241. package/dist/providers/icons/CaretRight.js +6 -2
  242. package/dist/providers/icons/CaretUp.js +6 -2
  243. package/dist/providers/icons/Chart.js +6 -2
  244. package/dist/providers/icons/Check.js +6 -2
  245. package/dist/providers/icons/ChevronDown.js +6 -2
  246. package/dist/providers/icons/ChevronLeft.js +6 -2
  247. package/dist/providers/icons/ChevronLeftSmall.js +6 -2
  248. package/dist/providers/icons/ChevronLeftSmallFirst.js +6 -2
  249. package/dist/providers/icons/ChevronRight.js +6 -2
  250. package/dist/providers/icons/ChevronRightSmall.js +6 -2
  251. package/dist/providers/icons/ChevronRightSmallLast.js +6 -2
  252. package/dist/providers/icons/ChevronUp.js +6 -2
  253. package/dist/providers/icons/Cross.js +6 -2
  254. package/dist/providers/icons/Dollar.js +6 -2
  255. package/dist/providers/icons/Download.js +6 -2
  256. package/dist/providers/icons/Electricity.js +6 -2
  257. package/dist/providers/icons/Euro.js +6 -2
  258. package/dist/providers/icons/Gas.js +7 -2
  259. package/dist/providers/icons/Help.js +6 -2
  260. package/dist/providers/icons/Hide.js +6 -2
  261. package/dist/providers/icons/Home.js +6 -2
  262. package/dist/providers/icons/Info.js +6 -2
  263. package/dist/providers/icons/Link.js +7 -2
  264. package/dist/providers/icons/Logo.js +6 -2
  265. package/dist/providers/icons/Minus.js +6 -2
  266. package/dist/providers/icons/NewWindow.js +6 -2
  267. package/dist/providers/icons/PaymentCard.js +6 -2
  268. package/dist/providers/icons/Plus.js +6 -2
  269. package/dist/providers/icons/Pound.js +6 -2
  270. package/dist/providers/icons/Search.js +6 -2
  271. package/dist/providers/icons/Show.js +6 -2
  272. package/dist/providers/icons/User.js +6 -2
  273. package/dist/styled.native.d.ts +234 -270
  274. package/dist/theme/create-theme.js +153 -0
  275. package/dist/theme/index.d.ts +39 -45
  276. package/dist/theme/theme.d.ts +90 -0
  277. package/dist/utils/utils.d.ts +4 -5
  278. package/dist/utils/utils.js +26 -8
  279. package/package.json +5 -6
  280. package/dist/components/DataTable/TableRow.d.ts +0 -2
  281. package/dist/components/DataTable/TableRow.js +0 -31
  282. package/dist/components/DataTable/styles.d.ts +0 -2517
  283. package/dist/components/DataTable/styles.js +0 -77
  284. package/dist/components/DataTable/types.d.ts +0 -15
  285. package/dist/components/DataTable/types.js +0 -2
  286. package/dist/components/Input/PhoneInput.d.ts +0 -10
  287. package/dist/components/Input/PhoneInput.js +0 -19
  288. package/dist/components/SelectField/Select.d.ts +0 -244
  289. package/dist/components/SelectField/Select.js +0 -102
  290. package/dist/components/SelectField/SelectField.d.ts +0 -7
  291. package/dist/components/SelectField/SelectField.js +0 -33
  292. package/dist/components/SelectField/index.d.ts +0 -1
  293. package/dist/components/SelectField/index.js +0 -5
  294. package/dist/components/TextField/PhoneField.d.ts +0 -10
  295. package/dist/components/TextField/PhoneField.js +0 -33
  296. package/dist/esm/components/DataTable/TableRow.js +0 -27
  297. package/dist/esm/components/DataTable/styles.js +0 -51
  298. package/dist/esm/components/DataTable/types.js +0 -1
  299. package/dist/esm/components/SelectField/Select.js +0 -75
  300. package/dist/esm/components/SelectField/SelectField.js +0 -29
  301. package/dist/esm/components/SelectField/index.js +0 -1
  302. package/dist/esm/components/TextField/PhoneField.js +0 -30
@@ -20,12 +20,12 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx } from "react/jsx-runtime";
23
+ import React from 'react';
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.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;
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;
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 (_jsx(StyledMargin, __assign({}, rest, { breakpoints: breakpoints, mTop: top, mBottom: bottom, mLeft: left, mRight: right })));
45
+ return (React.createElement(StyledMargin, __assign({}, rest, { breakpoints: breakpoints, mTop: top, mBottom: bottom, mLeft: left, mRight: right })));
46
46
  };
47
47
  export { Margin };
@@ -2,62 +2,60 @@ 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
- 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";
5
+ import React from 'react';
17
6
  import { TouchableOpacity, View } from 'react-native';
18
7
  import Animated, { FadeIn, FadeOut, Layout } from 'react-native-reanimated';
19
8
  import { Path, Svg } from 'react-native-svg';
20
9
  import styled, { css } from '../../styled.native';
21
10
  import { Heading3, Heading4 } from '../Heading';
22
11
  var BackIcon = function () {
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" }) })));
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" })));
24
14
  };
25
15
  var StyledText = styled.Text(function (_a) {
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);
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);
28
18
  });
29
19
  var LeftHeaderText = styled(StyledText)(function (_a) {
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]);
20
+ var space = _a.theme.space;
21
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n "], ["\n padding-left: ", ";\n "])), space[2]);
32
22
  });
33
23
  var HeadlineView = styled(Animated.View)(function (_a) {
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]);
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]);
36
26
  });
37
27
  var RootView = styled.View(function (_a) {
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);
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);
40
30
  });
41
31
  var StyledView = styled(Animated.View)(function (_a) {
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);
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);
44
34
  });
45
35
  var StyledHeading4 = styled(Heading4)(function (_a) {
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);
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);
48
38
  });
49
39
  var StyledHeading3 = styled(Heading3)(function (_a) {
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);
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);
52
42
  });
53
43
  export var NavHeader = function (_a) {
54
44
  var options = _a.options, headline = _a.headline;
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] })));
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));
62
60
  };
63
61
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -24,52 +24,69 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  }
25
25
  return t;
26
26
  };
27
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
- import { forwardRef, useState } from 'react';
27
+ import React, { forwardRef, useContext, useState, } from 'react';
29
28
  import { View } from 'react-native';
30
- import styled, { css } from '../../styled.native';
29
+ import { useBreakpoint } from '../../hooks';
30
+ import styled, { css, ThemeContext } 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"); };
32
34
  var NotificationBox = styled.View(function (_a) {
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]);
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);
35
39
  });
36
40
  export var NotificationContentBox = styled.View(function (_a) {
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]);
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);
39
45
  });
40
46
  export var NotificationTitleBox = styled.View(function (_a) {
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]);
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]);
44
54
  });
45
55
  var NotificationTitleText = styled.Text(function (_a) {
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);
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]);
49
60
  });
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);
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);
57
64
  });
58
65
  export var Notification = forwardRef(function (_a, ref) {
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"]);
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);
60
69
  var _c = useState(false), dismissed = _c[0], setDismissed = _c[1];
61
- if (dismissed || !children) {
70
+ if (dismissed || (!title && !children)) {
62
71
  return null;
63
72
  }
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] })) })));
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)));
70
87
  });
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;
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;
@@ -1,3 +1,7 @@
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
+ };
1
5
  var __assign = (this && this.__assign) || function () {
2
6
  __assign = Object.assign || function(t) {
3
7
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -20,42 +24,60 @@ var __rest = (this && this.__rest) || function (s, e) {
20
24
  }
21
25
  return t;
22
26
  };
23
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
27
+ import React, { forwardRef } from 'react';
25
28
  import { TouchableOpacity, View, } from 'react-native';
26
29
  import styled from '../../styled.native';
30
+ import { pxToNumber } from '../../utils';
27
31
  import { HintText } from '../HintText';
28
32
  import { LabelText } from '../LabelText';
29
33
  var StyledRadioInputWrapper = styled.View(function (_a) {
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 ");
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 ");
32
38
  });
33
39
  var StyledRadioInput = styled.View(function (_a) {
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
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
37
46
  : checked
38
- ? core.color.blue.dark
39
- : semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
47
+ ? radio.dotColor
48
+ : radio.borderColor, ";\n background: ").concat(radio.background, ";\n background: ").concat(checked ? radio.checkedBackground : radio.background, ";\n ");
40
49
  });
41
50
  var StyledRadioInputDot = styled.View(function (_a) {
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 ");
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 ");
44
57
  });
45
58
  var Input = function (_a) {
46
59
  var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
47
- return (_jsx(StyledRadioInputWrapper, __assign({}, rest, { children: _jsx(StyledRadioInput, __assign({ invalid: invalid, checked: checked, testID: testID }, { children: _jsx(StyledRadioInputDot, { checked: checked }) })) })));
60
+ return (React.createElement(StyledRadioInputWrapper, __assign({}, rest),
61
+ React.createElement(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID },
62
+ React.createElement(StyledRadioInputDot, { checked: checked }))));
48
63
  };
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 ");
64
+ var RadioLabelText = styled(LabelText)(function (_a) {
65
+ var space = _a.theme.space;
66
+ return "\n padding-top: ".concat(space[3], ";\n ");
52
67
  });
68
+ var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
53
69
  var Radio = forwardRef(function (_a, ref) {
54
70
  var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
55
71
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
56
72
  value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
57
73
  _b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
58
74
  activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
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] }))] }) })));
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))));
60
81
  });
61
82
  export { Radio };
83
+ var templateObject_1;
@@ -20,8 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
24
- import { Children, cloneElement } from 'react';
23
+ import React, { Children, cloneElement, } from 'react';
25
24
  import { View } from 'react-native';
26
25
  import { callAll } from '../../utils';
27
26
  import { ErrorText } from '../ErrorText';
@@ -32,14 +31,22 @@ import { Stack } from '../Stack';
32
31
  var RadioField = function (_a) {
33
32
  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"]);
34
33
  var hasError = !!error;
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
- }) }))] })) })));
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
+ })))));
44
51
  };
45
52
  export { RadioField };
@@ -1,16 +1,4 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { useEffect, useRef } from 'react';
1
+ import React, { useEffect, useRef } from 'react';
14
2
  import { View, Animated, Platform } from 'react-native';
15
3
  export var SkeletonAnimation = function (_a) {
16
4
  var children = _a.children, _b = _a.animation, animation = _b === void 0 ? 'pulse' : _b, testID = _a.testID;
@@ -29,14 +17,14 @@ export var SkeletonAnimation = function (_a) {
29
17
  animationRef.current.setValue(0);
30
18
  Animated.loop(animationLoop.current).start();
31
19
  }, []);
32
- return (_jsx(View, __assign({ accessibilityRole: "none", accessibilityLabel: "loading...", accessible: false, testID: testID }, { children: animation === 'pulse' ? (_jsx(Animated.View, __assign({ style: [
33
- {
34
- height: '100%',
35
- width: '100%',
36
- opacity: animationRef.current.interpolate({
37
- inputRange: [0.25, 1, 2],
38
- outputRange: [1, 0.25, 1],
39
- }),
40
- },
41
- ] }, { children: children }))) : (_jsx(View, { children: children })) })));
20
+ return (React.createElement(View, { accessibilityRole: "none", accessibilityLabel: "loading...", accessible: false, testID: testID }, animation === 'pulse' ? (React.createElement(Animated.View, { style: [
21
+ {
22
+ height: '100%',
23
+ width: '100%',
24
+ opacity: animationRef.current.interpolate({
25
+ inputRange: [0.25, 1, 2],
26
+ outputRange: [1, 0.25, 1],
27
+ }),
28
+ },
29
+ ] }, children)) : (React.createElement(View, null, children))));
42
30
  };
@@ -20,16 +20,17 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx } from "react/jsx-runtime";
23
+ import React from 'react';
24
24
  import styled from '../../styled.native';
25
25
  import { P } from '../Text';
26
26
  import { Skeleton } from './Skeleton';
27
27
  import { SkeletonAnimation } from './SkeletonAnimation';
28
28
  var StyledSkeletonCTA = styled(Skeleton)(function (_a) {
29
- var core = _a.theme.core, size = _a.size;
30
- return "\n background-color: ".concat(core.color.neutral.light, ";\n width: ").concat(size, ";\n height: ").concat(core.space[12], ";\n ");
29
+ var _b = _a.theme, colors = _b.colors, space = _b.space, size = _a.size;
30
+ return "\n background-color: ".concat(colors.borderMuted, ";\n width: ").concat(size, ";\n height: ").concat(space[12], ";\n ");
31
31
  });
32
32
  export var SkeletonCTA = function (_a) {
33
33
  var _b = _a.size, size = _b === void 0 ? '250px' : _b, rest = __rest(_a, ["size"]);
34
- return (_jsx(SkeletonAnimation, { children: _jsx(StyledSkeletonCTA, __assign({ as: P, size: size }, rest)) }));
34
+ return (React.createElement(SkeletonAnimation, null,
35
+ React.createElement(StyledSkeletonCTA, __assign({ as: P, size: size }, rest))));
35
36
  };
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx } from "react/jsx-runtime";
23
+ import React from 'react';
24
24
  import styled from '../../styled.native';
25
25
  import { pxToNumber } from '../../utils';
26
26
  import { Skeleton } from './Skeleton';
@@ -30,10 +30,12 @@ var StyledSkeletonCircleWrapper = styled(Skeleton)(function (_a) {
30
30
  return "width: ".concat(size, "; max-width: 100%;");
31
31
  });
32
32
  var StyledSkeletonCircle = styled(Skeleton)(function (_a) {
33
- var core = _a.theme.core, size = _a.size;
34
- return "\n background-color: ".concat(core.color.neutral.light, ";\n height: 0;\n padding-bottom: 100%;\n border-radius: ").concat(pxToNumber(size) / 2, "px;\n ");
33
+ var colors = _a.theme.colors, size = _a.size;
34
+ return "\n background-color: ".concat(colors.borderMuted, ";\n height: 0;\n padding-bottom: 100%;\n border-radius: ").concat(pxToNumber(size) / 2, "px;\n ");
35
35
  });
36
36
  export var SkeletonCircle = function (_a) {
37
37
  var _b = _a.size, size = _b === void 0 ? '120px' : _b, rest = __rest(_a, ["size"]);
38
- return (_jsx(SkeletonAnimation, { children: _jsx(StyledSkeletonCircleWrapper, __assign({ size: size }, rest, { children: _jsx(StyledSkeletonCircle, { size: size }) })) }));
38
+ return (React.createElement(SkeletonAnimation, null,
39
+ React.createElement(StyledSkeletonCircleWrapper, __assign({ size: size }, rest),
40
+ React.createElement(StyledSkeletonCircle, { size: size }))));
39
41
  };
@@ -20,16 +20,17 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx } from "react/jsx-runtime";
23
+ import React from 'react';
24
24
  import styled from '../../styled.native';
25
25
  import { Heading3 } from '../Heading';
26
26
  import { Skeleton } from './Skeleton';
27
27
  import { SkeletonAnimation } from './SkeletonAnimation';
28
28
  var StyledSkeletonHeading = styled(Skeleton)(function (_a) {
29
- var core = _a.theme.core, size = _a.size;
30
- return "\n background-color: ".concat(core.color.neutral.light, ";\n width: ").concat(size, ";\n ");
29
+ var colors = _a.theme.colors, size = _a.size;
30
+ return "\n background-color: ".concat(colors.borderMuted, ";\n width: ").concat(size, ";\n ");
31
31
  });
32
32
  export var SkeletonHeading = function (_a) {
33
33
  var _b = _a.size, size = _b === void 0 ? '70%' : _b, _c = _a.headingComponent, Heading = _c === void 0 ? Heading3 : _c, rest = __rest(_a, ["size", "headingComponent"]);
34
- return (_jsx(SkeletonAnimation, { children: _jsx(StyledSkeletonHeading, __assign({ "aria-hidden": "true", size: size, as: Heading }, rest, { children: "\u00A0" })) }));
34
+ return (React.createElement(SkeletonAnimation, null,
35
+ React.createElement(StyledSkeletonHeading, __assign({ "aria-hidden": "true", size: size, as: Heading }, rest), "\u00A0")));
35
36
  };
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx } from "react/jsx-runtime";
23
+ import React from 'react';
24
24
  import { useBreakpoint } from '../../hooks';
25
25
  import styled from '../../styled.native';
26
26
  import { responsiveStyle } from '../../utils';
@@ -28,15 +28,15 @@ import { P } from '../Text';
28
28
  import { Skeleton } from './Skeleton';
29
29
  import { SkeletonAnimation } from './SkeletonAnimation';
30
30
  var StyledSkeletonText = styled(Skeleton)(function (_a) {
31
- var core = _a.theme.core, short = _a.short, breakpoints = _a.breakpoints;
32
- return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(core.space[2], ";\n ").concat(responsiveStyle('height', core.fontSize.body, breakpoints), "\n\n ").concat(short ? 'width: 50%' : '', ";\n ");
31
+ var _b = _a.theme, colors = _b.colors, space = _b.space, responsiveFontSizes = _b.responsiveFontSizes, short = _a.short, breakpoints = _a.breakpoints;
32
+ return "\n background-color: ".concat(colors.borderMuted, ";\n margin-bottom: ").concat(space[2], ";\n ").concat(responsiveStyle('height', responsiveFontSizes.body, breakpoints), "\n\n ").concat(short ? 'width: 50%' : '', ";\n ");
33
33
  });
34
34
  export var SkeletonText = function (_a) {
35
35
  var _b = _a.lines, lines = _b === void 0 ? 1 : _b, rest = __rest(_a, ["lines"]);
36
36
  var breakpoints = useBreakpoint();
37
37
  var generatedLines = [];
38
38
  for (var i = 1; i <= lines; i++) {
39
- generatedLines.push(_jsx(StyledSkeletonText, { short: i === lines, breakpoints: breakpoints }, "line-".concat(i)));
39
+ generatedLines.push(React.createElement(StyledSkeletonText, { key: "line-".concat(i), short: i === lines, breakpoints: breakpoints }));
40
40
  }
41
- return (_jsx(P, __assign({ as: SkeletonAnimation }, rest, { children: generatedLines })));
41
+ return (React.createElement(P, __assign({ as: SkeletonAnimation }, rest), generatedLines));
42
42
  };
@@ -20,8 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { Children } from 'react';
23
+ import React, { Children } from 'react';
25
24
  import { View } from 'react-native';
26
25
  import styled from '../../styled.native';
27
26
  import { responsiveStyle, styledComponentWithBreakpoints } from '../../utils';
@@ -33,12 +32,12 @@ var Stack = function (_a) {
33
32
  filteredChildren.push(child);
34
33
  }
35
34
  });
36
- return (_jsx(View, __assign({}, rest, { children: Children.map(filteredChildren, function (child, index) {
37
- return index === 0 ? (child) : (_jsx(StackItem, __assign({ spaceBetween: spaceBetween }, { children: child })));
38
- }) })));
35
+ return (React.createElement(View, __assign({}, rest), Children.map(filteredChildren, function (child, index) {
36
+ return index === 0 ? (child) : (React.createElement(StackItem, { spaceBetween: spaceBetween }, child));
37
+ })));
39
38
  };
40
39
  var StyledStackItem = styled.View(function (_a) {
41
- var space = _a.theme.core.space, spaceBetween = _a.spaceBetween, smallAndUp = _a.smallAndUp, mediumAndUp = _a.mediumAndUp, largeAndUp = _a.largeAndUp;
40
+ var space = _a.theme.space, spaceBetween = _a.spaceBetween, smallAndUp = _a.smallAndUp, mediumAndUp = _a.mediumAndUp, largeAndUp = _a.largeAndUp;
42
41
  var formatter = function (spaceKey) { return space[spaceKey]; };
43
42
  var breakpoints = { smallAndUp: smallAndUp, mediumAndUp: mediumAndUp, largeAndUp: largeAndUp };
44
43
  return responsiveStyle('margin-top', spaceBetween, breakpoints, formatter);
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx } from "react/jsx-runtime";
12
+ import React from 'react';
13
13
  import { useBreakpoint } from '../../hooks';
14
14
  import styled from '../../styled.native';
15
15
  var StyledStretch = styled.View(function (_a) {
@@ -20,5 +20,5 @@ var StyledStretch = styled.View(function (_a) {
20
20
  });
21
21
  export var Stretch = function (props) {
22
22
  var smallAndUp = useBreakpoint().smallAndUp;
23
- return _jsx(StyledStretch, __assign({ smallAndUp: smallAndUp }, props));
23
+ return React.createElement(StyledStretch, __assign({ smallAndUp: smallAndUp }, props));
24
24
  };
@@ -3,13 +3,12 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import styled, { css } from '../../styled.native';
6
+ import { calculateLineHeight } from '../../theme';
6
7
  import { styledComponentWithBreakpoints } from '../../utils';
7
8
  var StyledSubLabelText = styled.Text(function (_a) {
8
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
9
- var fontSize = smallAndUp
10
- ? core.fontSize.body.large
11
- : core.fontSize.body.small;
12
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, core.lineHeight.body.small, semantic.message.secondary, fontSize);
9
+ var field = _a.theme.field, smallAndUp = _a.smallAndUp;
10
+ var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
11
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), field.fontFamily, calculateLineHeight(fontSize, field.lineHeight), field.subLabel.color, fontSize);
13
12
  });
14
13
  var SubLabelText = styledComponentWithBreakpoints(StyledSubLabelText);
15
14
  export { SubLabelText };