@ovotech/element-native 4.4.9 → 5.0.0-canary-bcb1788-338

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 (277) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +1 -1
  2. package/dist/components/Accordion/Accordion.js +11 -9
  3. package/dist/components/Accordion/Icon.d.ts +2 -1
  4. package/dist/components/Accordion/Icon.js +9 -6
  5. package/dist/components/Accordion/styles.d.ts +1520 -1525
  6. package/dist/components/Accordion/styles.js +17 -11
  7. package/dist/components/Accordion/types.d.ts +2 -1
  8. package/dist/components/ActionCard/ActionCard.d.ts +2 -2
  9. package/dist/components/ActionCard/ActionCard.js +21 -21
  10. package/dist/components/ActionCard/CloseIconShape.js +2 -2
  11. package/dist/components/ActionCard/IndicatorIconShape.js +2 -2
  12. package/dist/components/ActionList/ActionList.d.ts +9 -3
  13. package/dist/components/ActionList/ActionList.js +7 -6
  14. package/dist/components/ActionList/styled.d.ts +5116 -3430
  15. package/dist/components/ActionList/styled.js +36 -19
  16. package/dist/components/Badge/Badge.d.ts +511 -508
  17. package/dist/components/Badge/Badge.js +24 -34
  18. package/dist/components/Badge/index.d.ts +1 -1
  19. package/dist/components/Card/Card.d.ts +9 -1
  20. package/dist/components/Card/Card.js +5 -6
  21. package/dist/components/Checkbox/Checkbox.js +13 -13
  22. package/dist/components/DataTable/styles.d.ts +6527 -6553
  23. package/dist/components/DataTable/styles.js +27 -27
  24. package/dist/components/DateField/DateField.d.ts +5 -4
  25. package/dist/components/DateField/DateField.js +20 -10
  26. package/dist/components/Disclosure/Disclosure.js +6 -6
  27. package/dist/components/Divider/Divider.js +3 -3
  28. package/dist/components/Em/Em.d.ts +493 -495
  29. package/dist/components/Em/Em.js +1 -1
  30. package/dist/components/ErrorText/ErrorText.d.ts +493 -495
  31. package/dist/components/ErrorText/ErrorText.js +6 -4
  32. package/dist/components/Field/Field.js +1 -1
  33. package/dist/components/Grid/Col.d.ts +493 -495
  34. package/dist/components/Grid/Col.js +10 -16
  35. package/dist/components/Grid/Row.d.ts +493 -495
  36. package/dist/components/Grid/Row.js +7 -6
  37. package/dist/components/HintText/HintText.d.ts +493 -495
  38. package/dist/components/HintText/HintText.js +6 -4
  39. package/dist/components/Icon/Icon.d.ts +1 -3
  40. package/dist/components/Icon/Icon.js +3 -5
  41. package/dist/components/Input/Input.d.ts +1 -1
  42. package/dist/components/Input/Input.js +16 -11
  43. package/dist/components/LabelText/LabelText.d.ts +493 -495
  44. package/dist/components/LabelText/LabelText.js +7 -4
  45. package/dist/components/LineThrough/LineThrough.d.ts +493 -495
  46. package/dist/components/List/styled.d.ts +2017 -2025
  47. package/dist/components/List/styled.js +11 -11
  48. package/dist/components/Margin/Margin.d.ts +493 -495
  49. package/dist/components/Margin/Margin.js +4 -2
  50. package/dist/components/NavHeader/NavHeader.d.ts +7 -1
  51. package/dist/components/NavHeader/NavHeader.js +2 -12
  52. package/dist/components/NavHeader/NavHeader.styles.d.ts +3489 -4636
  53. package/dist/components/NavHeader/NavHeader.styles.js +22 -32
  54. package/dist/components/Notification/Notification.d.ts +987 -991
  55. package/dist/components/Notification/Notification.js +18 -18
  56. package/dist/components/P/P.d.ts +7 -3
  57. package/dist/components/P/P.js +4 -2
  58. package/dist/components/PasswordInput/PasswordInput.styled.d.ts +493 -495
  59. package/dist/components/PasswordInput/PasswordInput.styled.js +2 -2
  60. package/dist/components/ProductCarousel/NavigationDots.js +4 -4
  61. package/dist/components/ProductCarousel/ProductCarousel.js +4 -4
  62. package/dist/components/Radio/Radio.js +11 -11
  63. package/dist/components/RadioCard/RadioCard.d.ts +0 -1
  64. package/dist/components/RadioCard/RadioCard.js +15 -15
  65. package/dist/components/SegmentedControls/SegmentedControls.js +5 -5
  66. package/dist/components/SegmentedControls/components/SegmentButton.js +4 -4
  67. package/dist/components/SelectField/Select.d.ts +493 -495
  68. package/dist/components/SelectField/Select.js +22 -24
  69. package/dist/components/SkeletonCircle/SkeletonCircle.d.ts +2 -2
  70. package/dist/components/SkeletonCircle/SkeletonCircle.js +6 -6
  71. package/dist/components/SkeletonHeading/SkeletonHeading.js +4 -4
  72. package/dist/components/SkeletonText/SkeletonText.js +4 -4
  73. package/dist/components/Spinner/Spinner.js +2 -2
  74. package/dist/components/Stack/Stack.js +4 -2
  75. package/dist/components/Strong/Strong.d.ts +493 -495
  76. package/dist/components/Strong/Strong.js +2 -2
  77. package/dist/components/SubLabelText/SubLabelText.d.ts +493 -495
  78. package/dist/components/SubLabelText/SubLabelText.js +4 -4
  79. package/dist/components/Tabs/Tab.js +8 -13
  80. package/dist/components/Tabs/TabList.d.ts +1 -2
  81. package/dist/components/Tabs/TabList.js +3 -6
  82. package/dist/components/Tabs/TabPanel.js +2 -2
  83. package/dist/components/Tabs/Tabs.d.ts +1 -2
  84. package/dist/components/Tabs/Tabs.js +4 -7
  85. package/dist/components/TextareaInput/TextareaInput.js +2 -2
  86. package/dist/components/Toast/Toast.js +16 -24
  87. package/dist/components/Toggle/Toggle.js +5 -9
  88. package/dist/components/Toggle/styles.d.ts +2023 -2031
  89. package/dist/components/Toggle/styles.js +10 -8
  90. package/dist/components/index.d.ts +6 -20
  91. package/dist/components/index.js +6 -20
  92. package/dist/esm/components/Accordion/Accordion.js +10 -8
  93. package/dist/esm/components/Accordion/Icon.js +9 -6
  94. package/dist/esm/components/Accordion/styles.js +17 -11
  95. package/dist/esm/components/ActionCard/ActionCard.js +22 -22
  96. package/dist/esm/components/ActionCard/CloseIconShape.js +2 -2
  97. package/dist/esm/components/ActionCard/IndicatorIconShape.js +2 -2
  98. package/dist/esm/components/ActionList/ActionList.js +9 -8
  99. package/dist/esm/components/ActionList/styled.js +35 -18
  100. package/dist/esm/components/Badge/Badge.js +25 -35
  101. package/dist/esm/components/Card/Card.js +5 -6
  102. package/dist/esm/components/Checkbox/Checkbox.js +13 -13
  103. package/dist/esm/components/DataTable/styles.js +27 -27
  104. package/dist/esm/components/DateField/DateField.js +20 -10
  105. package/dist/esm/components/Disclosure/Disclosure.js +6 -6
  106. package/dist/esm/components/Divider/Divider.js +3 -3
  107. package/dist/esm/components/Em/Em.js +1 -1
  108. package/dist/esm/components/ErrorText/ErrorText.js +6 -4
  109. package/dist/esm/components/Field/Field.js +1 -1
  110. package/dist/esm/components/Grid/Col.js +10 -16
  111. package/dist/esm/components/Grid/Row.js +7 -6
  112. package/dist/esm/components/HintText/HintText.js +6 -4
  113. package/dist/esm/components/Icon/Icon.js +3 -5
  114. package/dist/esm/components/Input/Input.js +16 -11
  115. package/dist/esm/components/LabelText/LabelText.js +7 -4
  116. package/dist/esm/components/List/styled.js +11 -11
  117. package/dist/esm/components/Margin/Margin.js +4 -2
  118. package/dist/esm/components/NavHeader/NavHeader.js +3 -13
  119. package/dist/esm/components/NavHeader/NavHeader.styles.js +21 -31
  120. package/dist/esm/components/Notification/Notification.js +18 -18
  121. package/dist/esm/components/P/P.js +4 -2
  122. package/dist/esm/components/PasswordInput/PasswordInput.styled.js +2 -2
  123. package/dist/esm/components/ProductCarousel/NavigationDots.js +4 -4
  124. package/dist/esm/components/ProductCarousel/ProductCarousel.js +4 -4
  125. package/dist/esm/components/Radio/Radio.js +11 -11
  126. package/dist/esm/components/RadioCard/RadioCard.js +15 -15
  127. package/dist/esm/components/SegmentedControls/SegmentedControls.js +5 -5
  128. package/dist/esm/components/SegmentedControls/components/SegmentButton.js +4 -4
  129. package/dist/esm/components/SelectField/Select.js +23 -25
  130. package/dist/esm/components/SkeletonCircle/SkeletonCircle.js +6 -6
  131. package/dist/esm/components/SkeletonHeading/SkeletonHeading.js +3 -3
  132. package/dist/esm/components/SkeletonText/SkeletonText.js +4 -4
  133. package/dist/esm/components/Spinner/Spinner.js +2 -2
  134. package/dist/esm/components/Stack/Stack.js +4 -2
  135. package/dist/esm/components/Strong/Strong.js +2 -2
  136. package/dist/esm/components/SubLabelText/SubLabelText.js +4 -4
  137. package/dist/esm/components/Tabs/Tab.js +8 -13
  138. package/dist/esm/components/Tabs/TabList.js +3 -6
  139. package/dist/esm/components/Tabs/TabPanel.js +2 -2
  140. package/dist/esm/components/Tabs/Tabs.js +4 -7
  141. package/dist/esm/components/TextareaInput/TextareaInput.js +2 -2
  142. package/dist/esm/components/Toast/Toast.js +16 -24
  143. package/dist/esm/components/Toggle/Toggle.js +5 -9
  144. package/dist/esm/components/Toggle/styles.js +10 -8
  145. package/dist/esm/components/index.js +6 -20
  146. package/dist/esm/hooks/use-breakpoint.js +1 -1
  147. package/dist/esm/providers/IconsProvider.js +1 -1
  148. package/dist/esm/providers/index.js +3 -1
  149. package/dist/hooks/use-breakpoint.js +1 -1
  150. package/dist/providers/IconsProvider.d.ts +1 -1
  151. package/dist/providers/index.d.ts +3 -1
  152. package/dist/providers/index.js +3 -1
  153. package/dist/styled.native.d.ts +3012 -3023
  154. package/package.json +3 -3
  155. package/dist/components/CTAButton/CTAButton.d.ts +0 -20
  156. package/dist/components/CTAButton/CTAButton.js +0 -119
  157. package/dist/components/CTAButton/index.d.ts +0 -1
  158. package/dist/components/CTAButton/index.js +0 -8
  159. package/dist/components/CTALink/CTALink.d.ts +0 -11
  160. package/dist/components/CTALink/CTALink.js +0 -23
  161. package/dist/components/CTALink/index.d.ts +0 -1
  162. package/dist/components/CTALink/index.js +0 -7
  163. package/dist/components/DescriptionList/DescriptionList.d.ts +0 -10
  164. package/dist/components/DescriptionList/DescriptionList.js +0 -44
  165. package/dist/components/DescriptionList/index.d.ts +0 -1
  166. package/dist/components/DescriptionList/index.js +0 -6
  167. package/dist/components/DescriptionList/styled.d.ts +0 -570
  168. package/dist/components/DescriptionList/styled.js +0 -86
  169. package/dist/components/Display0/Display0.d.ts +0 -5
  170. package/dist/components/Display0/Display0.js +0 -73
  171. package/dist/components/Display0/index.d.ts +0 -1
  172. package/dist/components/Display0/index.js +0 -5
  173. package/dist/components/Display1/Display1.d.ts +0 -5
  174. package/dist/components/Display1/Display1.js +0 -73
  175. package/dist/components/Display1/index.d.ts +0 -1
  176. package/dist/components/Display1/index.js +0 -5
  177. package/dist/components/Display2/Display2.d.ts +0 -5
  178. package/dist/components/Display2/Display2.js +0 -73
  179. package/dist/components/Display2/index.d.ts +0 -1
  180. package/dist/components/Display2/index.js +0 -5
  181. package/dist/components/Display3/Display3.d.ts +0 -5
  182. package/dist/components/Display3/Display3.js +0 -73
  183. package/dist/components/Display3/index.d.ts +0 -1
  184. package/dist/components/Display3/index.js +0 -5
  185. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +0 -18
  186. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +0 -52
  187. package/dist/components/ErrorSummaryNotification/index.d.ts +0 -1
  188. package/dist/components/ErrorSummaryNotification/index.js +0 -5
  189. package/dist/components/FilterSelect/FilterSelect.d.ts +0 -17
  190. package/dist/components/FilterSelect/FilterSelect.js +0 -88
  191. package/dist/components/FilterSelect/index.d.ts +0 -1
  192. package/dist/components/FilterSelect/index.js +0 -5
  193. package/dist/components/Heading1/Heading1.d.ts +0 -5
  194. package/dist/components/Heading1/Heading1.js +0 -73
  195. package/dist/components/Heading1/index.d.ts +0 -1
  196. package/dist/components/Heading1/index.js +0 -5
  197. package/dist/components/Heading2/Heading2.d.ts +0 -5
  198. package/dist/components/Heading2/Heading2.js +0 -73
  199. package/dist/components/Heading2/index.d.ts +0 -1
  200. package/dist/components/Heading2/index.js +0 -5
  201. package/dist/components/Heading3/Heading3.d.ts +0 -5
  202. package/dist/components/Heading3/Heading3.js +0 -73
  203. package/dist/components/Heading3/index.d.ts +0 -1
  204. package/dist/components/Heading3/index.js +0 -5
  205. package/dist/components/Heading4/Heading4.d.ts +0 -5
  206. package/dist/components/Heading4/Heading4.js +0 -73
  207. package/dist/components/Heading4/index.d.ts +0 -1
  208. package/dist/components/Heading4/index.js +0 -5
  209. package/dist/components/Label/Label.d.ts +0 -7
  210. package/dist/components/Label/Label.js +0 -51
  211. package/dist/components/Label/index.d.ts +0 -1
  212. package/dist/components/Label/index.js +0 -5
  213. package/dist/components/Lead/Lead.d.ts +0 -7
  214. package/dist/components/Lead/Lead.js +0 -53
  215. package/dist/components/Lead/index.d.ts +0 -1
  216. package/dist/components/Lead/index.js +0 -5
  217. package/dist/components/NavHeader/IconButton.d.ts +0 -15
  218. package/dist/components/NavHeader/IconButton.js +0 -21
  219. package/dist/components/SkeletonCTA/SkeletonCTA.d.ts +0 -6
  220. package/dist/components/SkeletonCTA/SkeletonCTA.js +0 -42
  221. package/dist/components/SkeletonCTA/index.d.ts +0 -1
  222. package/dist/components/SkeletonCTA/index.js +0 -5
  223. package/dist/components/Small/Small.d.ts +0 -576
  224. package/dist/components/Small/Small.js +0 -39
  225. package/dist/components/Small/index.d.ts +0 -1
  226. package/dist/components/Small/index.js +0 -5
  227. package/dist/components/TextGroup/TextGroup.d.ts +0 -3
  228. package/dist/components/TextGroup/TextGroup.js +0 -43
  229. package/dist/components/TextGroup/index.d.ts +0 -1
  230. package/dist/components/TextGroup/index.js +0 -5
  231. package/dist/components/TextLink/TextLink.d.ts +0 -8
  232. package/dist/components/TextLink/TextLink.js +0 -75
  233. package/dist/components/TextLink/index.d.ts +0 -1
  234. package/dist/components/TextLink/index.js +0 -5
  235. package/dist/esm/components/CTAButton/CTAButton.js +0 -90
  236. package/dist/esm/components/CTAButton/index.js +0 -1
  237. package/dist/esm/components/CTALink/CTALink.js +0 -18
  238. package/dist/esm/components/CTALink/index.js +0 -1
  239. package/dist/esm/components/DescriptionList/DescriptionList.js +0 -40
  240. package/dist/esm/components/DescriptionList/index.js +0 -1
  241. package/dist/esm/components/DescriptionList/styled.js +0 -58
  242. package/dist/esm/components/Display0/Display0.js +0 -46
  243. package/dist/esm/components/Display0/index.js +0 -1
  244. package/dist/esm/components/Display1/Display1.js +0 -46
  245. package/dist/esm/components/Display1/index.js +0 -1
  246. package/dist/esm/components/Display2/Display2.js +0 -46
  247. package/dist/esm/components/Display2/index.js +0 -1
  248. package/dist/esm/components/Display3/Display3.js +0 -46
  249. package/dist/esm/components/Display3/index.js +0 -1
  250. package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +0 -49
  251. package/dist/esm/components/ErrorSummaryNotification/index.js +0 -1
  252. package/dist/esm/components/FilterSelect/FilterSelect.js +0 -61
  253. package/dist/esm/components/FilterSelect/index.js +0 -1
  254. package/dist/esm/components/Heading1/Heading1.js +0 -46
  255. package/dist/esm/components/Heading1/index.js +0 -1
  256. package/dist/esm/components/Heading2/Heading2.js +0 -46
  257. package/dist/esm/components/Heading2/index.js +0 -1
  258. package/dist/esm/components/Heading3/Heading3.js +0 -46
  259. package/dist/esm/components/Heading3/index.js +0 -1
  260. package/dist/esm/components/Heading4/Heading4.js +0 -46
  261. package/dist/esm/components/Heading4/index.js +0 -1
  262. package/dist/esm/components/Label/Label.js +0 -25
  263. package/dist/esm/components/Label/index.js +0 -1
  264. package/dist/esm/components/Lead/Lead.js +0 -27
  265. package/dist/esm/components/Lead/index.js +0 -1
  266. package/dist/esm/components/NavHeader/IconButton.js +0 -17
  267. package/dist/esm/components/SkeletonCTA/SkeletonCTA.js +0 -35
  268. package/dist/esm/components/SkeletonCTA/index.js +0 -1
  269. package/dist/esm/components/Small/Small.js +0 -13
  270. package/dist/esm/components/Small/index.js +0 -1
  271. package/dist/esm/components/TextGroup/TextGroup.js +0 -39
  272. package/dist/esm/components/TextGroup/index.js +0 -1
  273. package/dist/esm/components/TextLink/TextLink.js +0 -49
  274. package/dist/esm/components/TextLink/index.js +0 -1
  275. package/dist/esm/providers/types.js +0 -1
  276. package/dist/providers/types.d.ts +0 -5
  277. package/dist/providers/types.js +0 -2
@@ -26,45 +26,35 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  };
27
27
  import { jsx as _jsx } from "react/jsx-runtime";
28
28
  import { numToPx } from '@ovotech/element-core';
29
- import styled, { css } from '../../styled.native';
29
+ import styled, { css, useTheme } from '../../styled.native';
30
30
  var StyledBadge = styled.View(function (_a) {
31
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, component = _b.component, _c = _a.variant, variant = _c === void 0 ? 'info' : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, customVariant = _a.customVariant;
32
- var surface;
33
- var message;
34
- if (variant in semantic) {
35
- surface = semantic[variant].surface;
36
- message = semantic[variant].message;
37
- }
38
- else {
39
- surface = component.badge.variants[variant].background;
40
- message = component.badge.variants[variant].foreground;
41
- }
42
- if ((customVariant === null || customVariant === void 0 ? void 0 : customVariant.foregroundColor) && (customVariant === null || customVariant === void 0 ? void 0 : customVariant.backgroundColor)) {
43
- surface = customVariant.backgroundColor;
44
- message = customVariant.foregroundColor;
45
- }
46
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 2px ", ";\n border-radius: 16px;\n border: ", " solid\n ", ";\n background-color: ", ";\n align-self: flex-start;\n "], ["\n padding: 2px ", ";\n border-radius: 16px;\n border: ", " solid\n ", ";\n background-color: ", ";\n align-self: flex-start;\n "])), numToPx(core.space[2]), numToPx(core.borderWidth.medium), core.color.brand.white, inverted ? message : surface);
31
+ var inverted = _a.inverted, theme = _a.theme, $surface = _a.$surface, $message = _a.$message;
32
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", " ", "\n ", " ", ";\n border-radius: 16px;\n border: ", " solid ", ";\n background-color: ", ";\n align-self: flex-start;\n "], ["\n padding: ", " ", "\n ", " ", ";\n border-radius: 16px;\n border: ", " solid ", ";\n background-color: ", ";\n align-self: flex-start;\n "])), numToPx(theme.space[50]), numToPx(theme.space[200]), numToPx(theme.space[100]), numToPx(theme.space[200]), numToPx(theme.border.width.md), theme.color.brand.onBrand, inverted ? $message : $surface);
47
33
  });
48
34
  var StyledBadgeText = styled.Text(function (_a) {
49
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, component = _b.component, _c = _a.variant, variant = _c === void 0 ? 'info' : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, customVariant = _a.customVariant;
50
- var surface;
51
- var message;
52
- if (variant in semantic) {
53
- surface = semantic[variant].surface;
54
- message = semantic[variant].message;
55
- }
56
- else {
57
- surface = component.badge.variants[variant].background;
58
- message = component.badge.variants[variant].foreground;
59
- }
60
- if ((customVariant === null || customVariant === void 0 ? void 0 : customVariant.foregroundColor) && (customVariant === null || customVariant === void 0 ? void 0 : customVariant.backgroundColor)) {
61
- surface = customVariant.backgroundColor;
62
- message = customVariant.foregroundColor;
63
- }
64
- return css(templateObject_2 || (templateObject_2 = __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.bodyBold.native, numToPx(core.lineHeight.body.small), inverted ? surface : message, numToPx(core.fontSize.body.small));
35
+ var inverted = _a.inverted, theme = _a.theme, $surface = _a.$surface, $message = _a.$message;
36
+ return css(templateObject_2 || (templateObject_2 = __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 "])), theme.native.font.family.bold, numToPx(theme.font.lineHeight.md.mediaQuery.sm), inverted ? $surface : $message, numToPx(theme.font.size.md.mediaQuery.sm));
65
37
  });
66
38
  export var Badge = function (_a) {
67
- var children = _a.children, variant = _a.variant, inverted = _a.inverted, rest = __rest(_a, ["children", "variant", "inverted"]);
68
- return (_jsx(StyledBadge, __assign({ variant: variant, inverted: inverted }, rest, { children: _jsx(StyledBadgeText, { variant: variant, inverted: inverted, children: children }) })));
39
+ var children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'neutral' : _b, _c = _a.inverted, inverted = _c === void 0 ? false : _c, customVariant = _a.customVariant, rest = __rest(_a, ["children", "variant", "inverted", "customVariant"]);
40
+ var theme = useTheme();
41
+ // check if variant is primitive, otherwise use alert colours
42
+ var isPrimitive = Object.keys(theme.color).includes(variant);
43
+ var message = isPrimitive
44
+ ? // @ts-ignore we're checking the variants above...
45
+ theme.color[variant]['70']
46
+ : // @ts-ignore we're checking the variants above...
47
+ theme.color.alert[variant];
48
+ var surface = isPrimitive
49
+ ? // @ts-ignore we're checking the variants above...
50
+ theme.color[variant]['20']
51
+ : // @ts-ignore we're checking the variants above...
52
+ theme.color.alert["".concat(variant, "Tint")];
53
+ if ((customVariant === null || customVariant === void 0 ? void 0 : customVariant.backgroundColor) !== undefined &&
54
+ (customVariant === null || customVariant === void 0 ? void 0 : customVariant.color) !== undefined) {
55
+ message = customVariant.color;
56
+ surface = customVariant.backgroundColor;
57
+ }
58
+ return (_jsx(StyledBadge, __assign({ inverted: inverted, "$surface": surface, "$message": message }, rest, { children: _jsx(StyledBadgeText, { inverted: inverted, "$surface": surface, "$message": message, children: children }) })));
69
59
  };
70
60
  var templateObject_1, templateObject_2;
@@ -25,13 +25,12 @@ import { numToPx } from '@ovotech/element-core';
25
25
  import { useBreakpoint } from '../../hooks';
26
26
  import styled from '../../styled.native';
27
27
  var CardWrapper = styled.View(function (_a) {
28
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, _c = _a.inline, inline = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, _e = _a.smallAndUp, smallAndUp = _e === void 0 ? false : _e;
29
- return "\n background: ".concat(inverted ? semantic.inverted.surface : semantic.surface.elevated, ";\n padding: ").concat(inline
30
- ? numToPx(core.space[smallAndUp ? 6 : 4])
31
- : numToPx(core.space[smallAndUp ? 9 : 6]), ";\n border-radius: ").concat(inline ? numToPx(core.radius.max) : 0, ";\n ");
28
+ var theme = _a.theme, displayStyle = _a.displayStyle, _b = _a.smallAndUp, smallAndUp = _b === void 0 ? false : _b;
29
+ var isSolid = displayStyle === 'solid';
30
+ return "\n position: relative;\n background: ".concat(isSolid ? theme.color.surface.bright : 'transparent', ";\n padding: ").concat(numToPx(theme.space[smallAndUp ? 900 : 600]), ";\n border-width: ").concat(numToPx(theme.border.width.md), ";\n border-style: solid;\n border-color: ").concat(isSolid ? 'transparent' : theme.color.surface.bright, ";\n border-radius: ").concat(numToPx(theme.border.radius['2xl']), ";\n ");
32
31
  });
33
32
  export var Card = function (_a) {
34
- var children = _a.children, inline = _a.inline, inverted = _a.inverted, rest = __rest(_a, ["children", "inline", "inverted"]);
33
+ var children = _a.children, _b = _a.displayStyle, displayStyle = _b === void 0 ? 'solid' : _b, rest = __rest(_a, ["children", "displayStyle"]);
35
34
  var smallAndUp = useBreakpoint().smallAndUp;
36
- return (_jsx(CardWrapper, __assign({ inline: inline, inverted: inverted, smallAndUp: smallAndUp }, rest, { children: children })));
35
+ return (_jsx(CardWrapper, __assign({ smallAndUp: smallAndUp, displayStyle: displayStyle }, rest, { children: children })));
37
36
  };
@@ -36,33 +36,33 @@ import { Icon } from '../Icon/Icon';
36
36
  import { LabelText } from '../LabelText';
37
37
  import { Stack } from '../Stack';
38
38
  var StyledCheckboxInputWrapper = styled.View(function (_a) {
39
- var core = _a.theme.core;
40
- var checkboxSize = core.space[6];
41
- var gap = core.space[2];
42
- return "\n width: ".concat(numToPx(checkboxSize + gap), ";\n height: ").concat(numToPx(core.space[11]), ";\n ");
39
+ var theme = _a.theme;
40
+ var checkboxSize = theme.space[600];
41
+ var gap = theme.space[200];
42
+ return "\n width: ".concat(numToPx(checkboxSize + gap), ";\n height: ").concat(numToPx(theme.space[1100]), ";\n ");
43
43
  });
44
44
  var StyledCheckboxInput = styled.View(function (_a) {
45
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
46
- return "\n width: ".concat(numToPx(core.space[6]), ";\n height: ").concat(numToPx(core.space[6]), ";\n border: ").concat(numToPx(core.borderWidth.small), " solid;\n margin-top: 10px;\n border-radius: ").concat(numToPx(core.radius.small), ";\n border-color: ").concat(invalid
47
- ? semantic.message.error
45
+ var theme = _a.theme, invalid = _a.invalid, checked = _a.checked;
46
+ return "\n width: ".concat(numToPx(theme.space[600]), ";\n height: ").concat(numToPx(theme.space[600]), ";\n border: ").concat(numToPx(theme.border.width.md), " solid;\n margin-top: 10px;\n border-radius: ").concat(numToPx(theme.border.radius.xs), ";\n border-color: ").concat(invalid
47
+ ? theme.input.color.borderError
48
48
  : checked
49
- ? core.color.blue.dark
50
- : semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
49
+ ? theme.input.color.selected
50
+ : theme.input.color.border, ";\n background: ").concat(checked ? theme.input.color.selectedTint : 'transparent', ";\n ");
51
51
  });
52
52
  var CheckboxCheck = function (props) {
53
53
  return _jsx(Icon, __assign({ name: "check", size: 16 }, props));
54
54
  };
55
55
  var StyledCheckboxInputCheck = styled(CheckboxCheck)(function (_a) {
56
- var core = _a.theme.core, checked = _a.checked;
57
- return "\n margin-top: 3px;\n margin-left: 3px;\n color: ".concat(core.color.blue.dark, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
56
+ var theme = _a.theme, checked = _a.checked;
57
+ return "\n margin-top: ".concat(numToPx(theme.space[50]), ";\n margin-left: ").concat(numToPx(theme.space[50]), ";\n color: ").concat(theme.color.alert.info, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
58
58
  });
59
59
  var Input = function (_a) {
60
60
  var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
61
61
  return (_jsx(StyledCheckboxInputWrapper, __assign({}, rest, { children: _jsx(StyledCheckboxInput, { invalid: invalid, checked: checked, testID: testID, children: _jsx(StyledCheckboxInputCheck, { checked: checked }) }) })));
62
62
  };
63
63
  var CheckLabelText = styled(LabelText)(function (_a) {
64
- var core = _a.theme.core;
65
- return "\n padding-top: ".concat(numToPx(core.space[3]), ";\n ");
64
+ var theme = _a.theme;
65
+ return "\n padding-top: ".concat(numToPx(theme.space[300]), ";\n ");
66
66
  });
67
67
  var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
68
68
  var Checkbox = forwardRef(function (_a, ref) {
@@ -5,57 +5,57 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
5
5
  import { numToPx } from '@ovotech/element-core';
6
6
  import styled, { css } from '../../styled.native';
7
7
  export var StyledTableContainer = styled.View(function (_a) {
8
- var _b = _a.theme, core = _b.core, semantic = _b.semantic;
9
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), numToPx(core.borderWidth.small), semantic.border.differentiated);
8
+ var theme = _a.theme;
9
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), numToPx(theme.border.width.sm), theme.color.surface.borderDim);
10
10
  });
11
11
  export var TableHeader = styled.View(function (_a) {
12
- var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
13
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[1]), numToPx(core.space[1]), cellWidth === 'auto' ? 1 : 0, cellWidth);
12
+ var theme = _a.theme, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
13
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "])), numToPx(theme.space[smallAndUp ? 300 : 200]), numToPx(theme.space[smallAndUp ? 300 : 200]), numToPx(theme.space[200]), numToPx(theme.space[200]), cellWidth === 'auto' ? 1 : 0, cellWidth);
14
14
  });
15
15
  export var TableHeaderText = styled.Text(function (_a) {
16
- var _b = _a.theme, semantic = _b.semantic, core = _b.core, smallAndUp = _a.smallAndUp;
17
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, numToPx(core.lineHeight.body[smallAndUp ? 'large' : 'small']), numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']), semantic.message.base);
16
+ var theme = _a.theme, smallAndUp = _a.smallAndUp;
17
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "])), theme.native.font.family.bold, numToPx(theme.font.lineHeight.md.mediaQuery[smallAndUp ? 'lg' : 'sm']), numToPx(theme.font.size.md.mediaQuery[smallAndUp ? 'lg' : 'sm']), theme.color.surface.onSurface);
18
18
  });
19
19
  export var TableCaptionText = styled.Text(function (_a) {
20
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
21
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, numToPx(core.fontSize.heading4[smallAndUp ? 'large' : 'small']), numToPx(core.lineHeight.heading4[smallAndUp ? 'large' : 'small']), semantic.message.branded);
20
+ var theme = _a.theme, smallAndUp = _a.smallAndUp;
21
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "])), theme.native.font.family.bold, numToPx(theme.font.size.xl.mediaQuery[smallAndUp ? 'lg' : 'sm']), numToPx(theme.font.lineHeight.xl.mediaQuery[smallAndUp ? 'lg' : 'sm']), theme.color.brand.brand);
22
22
  });
23
23
  export var CellText = styled.Text(function (_a) {
24
- var core = _a.theme.core, smallAndUp = _a.smallAndUp;
25
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, numToPx(core.lineHeight.body.large), numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']));
24
+ var theme = _a.theme, smallAndUp = _a.smallAndUp;
25
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "])), theme.native.font.family.book, numToPx(theme.font.lineHeight.md.mediaQuery.lg), numToPx(theme.font.size.md.mediaQuery[smallAndUp ? 'lg' : 'sm']));
26
26
  });
27
27
  export var TableCaption = styled.View(function (_a) {
28
- var core = _a.theme.core;
29
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), numToPx(core.space[4]), numToPx(core.space[2]));
28
+ var theme = _a.theme;
29
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), numToPx(theme.space[400]), numToPx(theme.space[200]));
30
30
  });
31
31
  export var TableRow = styled.View(function (_a) {
32
- var _b = _a.theme, semantic = _b.semantic, core = _b.core, stripe = _a.stripe;
32
+ var theme = _a.theme, stripe = _a.stripe;
33
33
  return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), stripe
34
- ? semantic.surface.cutout
35
- : semantic.surface.base, stripe ? '0px' : numToPx(core.borderWidth.small), stripe
34
+ ? theme.color.surface.dim
35
+ : theme.color.surface.surface, stripe ? '0px' : numToPx(theme.border.width.sm), stripe
36
36
  ? 'transparent'
37
- : "".concat(semantic.border.differentiated));
37
+ : "".concat(theme.color.surface.borderDim));
38
38
  });
39
39
  export var TableRowHeading = styled.View(function (_a) {
40
- var _b = _a.theme, semantic = _b.semantic, core = _b.core;
41
- return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), semantic.surface.base, numToPx(core.borderWidth.small), semantic.border.functional);
40
+ var theme = _a.theme;
41
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), theme.color.surface.surface, numToPx(theme.border.width.sm), theme.color.surface.border);
42
42
  });
43
43
  export var TableBody = styled.View(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex-direction: column;\n flex-wrap: nowrap;\n"], ["\n flex-direction: column;\n flex-wrap: nowrap;\n"])));
44
44
  export var TableCell = styled.View(function (_a) {
45
- var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
46
- return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[2]), numToPx(core.space[2]), cellWidth, cellWidth === 'auto' ? 1 : 0);
45
+ var theme = _a.theme, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
46
+ return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "])), numToPx(theme.space[smallAndUp ? 300 : 200]), numToPx(theme.space[smallAndUp ? 300 : 200]), numToPx(theme.space[200]), numToPx(theme.space[200]), cellWidth, cellWidth === 'auto' ? 1 : 0);
47
47
  });
48
48
  export var RowHeading = styled.View(function (_a) {
49
- var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
50
- return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[2]), numToPx(core.space[2]), cellWidth, cellWidth === 'auto' ? 1 : 0);
49
+ var theme = _a.theme, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
50
+ return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "])), numToPx(theme.space[smallAndUp ? 300 : 200]), numToPx(theme.space[smallAndUp ? 300 : 200]), numToPx(theme.space[200]), numToPx(theme.space[200]), cellWidth, cellWidth === 'auto' ? 1 : 0);
51
51
  });
52
52
  export var StyledSeparatorRow = styled.View(function (_a) {
53
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, width = _a.width;
54
- var minWidth = width ? "".concat(width - core.space[2] * 2, "px") : '100%';
55
- return "\n min-width: ".concat(minWidth, ";\n flex: 1;\n flex-direction: row;\n background-color: ").concat(semantic.surface.elevated, ";\n padding: ").concat(numToPx(core.space[1]), " ").concat(numToPx(core.space[2]), ";\n ");
53
+ var theme = _a.theme, width = _a.width;
54
+ var minWidth = width ? "".concat(width - theme.space[200] * 2, "px") : '100%';
55
+ return "\n min-width: ".concat(minWidth, ";\n flex: 1;\n flex-direction: row;\n background-color: ").concat(theme.color.surface.bright, ";\n padding: ").concat(numToPx(theme.space[100]), " ").concat(numToPx(theme.space[200]), ";\n ");
56
56
  });
57
57
  export var SeparatorRowText = styled.Text(function (_a) {
58
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
59
- return "\n flex: 1;\n font-family: ".concat(core.fontFamily.body.native, ";\n font-size: ").concat(numToPx(core.fontSize.small[smallAndUp ? 'large' : 'small']), ";\n line-height: ").concat(numToPx(core.lineHeight.small[smallAndUp ? 'large' : 'small']), ";\n color: ").concat(semantic.message.secondary, ";\n");
58
+ var theme = _a.theme, smallAndUp = _a.smallAndUp;
59
+ return "\n flex: 1;\n font-family: ".concat(theme.native.font.family.book, ";\n font-size: ").concat(numToPx(theme.font.size.sm.mediaQuery[smallAndUp ? 'lg' : 'sm']), ";\n line-height: ").concat(numToPx(theme.font.lineHeight.sm.mediaQuery[smallAndUp ? 'lg' : 'sm']), ";\n color: ").concat(theme.color.surface.onSurfaceVariant, ";\n");
60
60
  });
61
61
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
@@ -27,29 +27,39 @@ import { NumberInput } from '../NumberInput';
27
27
  import { Stack } from '../Stack';
28
28
  import { SubLabelText } from '../SubLabelText';
29
29
  var InlineFields = styled.View(function (_a) {
30
- var stretch = _a.stretch, core = _a.theme.core;
31
- var margin = numToPx(core.space[1]);
32
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "], ["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "])), margin, margin, stretch ? '' : "width: 265px;");
30
+ var stretch = _a.stretch, theme = _a.theme;
31
+ var margin = numToPx(theme.space[100]);
32
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "], ["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "])), margin, margin, stretch ? '' : "width: 265px;");
33
33
  });
34
34
  var SubField = styled(Stack)(function (_a) {
35
- var core = _a.theme.core;
36
- var padding = numToPx(core.space[1]);
35
+ var theme = _a.theme;
36
+ var padding = numToPx(theme.space[100]);
37
37
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-right: ", ";\n padding-left: ", ";\n "], ["\n padding-right: ", ";\n padding-left: ", ";\n "])), padding, padding);
38
38
  });
39
39
  var DayField = styled(SubField)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
40
40
  var MonthField = styled(SubField)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
41
41
  var YearField = styled(SubField)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 50%;\n"], ["\n width: 50%;\n"])));
42
42
  export var DateField = forwardRef(function (_a, ref) {
43
- var label = _a.label, hint = _a.hint, error = _a.error, _b = _a.optional, optional = _b === void 0 ? false : _b, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, onChange = _a.onChange, value = _a.value, testID = _a.testID, _d = _a.editable, editable = _d === void 0 ? false : _d;
43
+ var label = _a.label, hint = _a.hint, error = _a.error, _b = _a.optional, optional = _b === void 0 ? false : _b, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, onChange = _a.onChange, value = _a.value, testID = _a.testID, _d = _a.editable, editable = _d === void 0 ? true : _d, _e = _a.autoFocusNext, autoFocusNext = _e === void 0 ? true : _e;
44
44
  var hasError = !!error;
45
+ var dayRef = createRef();
46
+ var monthRef = createRef();
47
+ var yearRef = createRef();
48
+ var nextFieldRef = {
49
+ day: monthRef,
50
+ month: yearRef,
51
+ };
45
52
  var handleChange = function (key) { return function (datePartValue) {
46
53
  var _a;
47
54
  onChange &&
48
55
  onChange(__assign(__assign({}, value), (_a = {}, _a[key] = datePartValue, _a)));
56
+ if (key !== 'year' && autoFocusNext) {
57
+ var nextField = nextFieldRef[key].current;
58
+ if (nextField && datePartValue.length === 2) {
59
+ nextField.focus();
60
+ }
61
+ }
49
62
  }; };
50
- var dayRef = createRef();
51
- var monthRef = createRef();
52
- var yearRef = createRef();
53
63
  var accessibilityLabel = function (labelText) {
54
64
  return [labelText, getText(hint), getText(error)].filter(Boolean).join(', ');
55
65
  };
@@ -58,6 +68,6 @@ export var DateField = forwardRef(function (_a, ref) {
58
68
  internalRef.current.focus();
59
69
  }
60
70
  }; };
61
- return (_jsx(FormGroup, { error: hasError, children: _jsxs(Stack, { 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] }), _jsxs(InlineFields, { stretch: fullWidth, children: [_jsxs(DayField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(dayRef), accessible: false, children: _jsx(SubLabelText, { children: "Day" }) }), _jsx(NumberInput, { ref: mergeRefs(dayRef, ref), accessibilityLabel: accessibilityLabel('Day'), invalid: hasError, value: value.day, onChangeText: handleChange('day'), testID: testID, stretch: true, editable: editable })] }), _jsxs(MonthField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(monthRef), accessible: false, children: _jsx(SubLabelText, { children: "Month" }) }), _jsx(NumberInput, { ref: monthRef, accessibilityLabel: accessibilityLabel('Month'), invalid: hasError, value: value.month, onChangeText: handleChange('month'), testID: "".concat(testID, "-month"), stretch: true, editable: editable })] }), _jsxs(YearField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(yearRef), accessible: false, children: _jsx(SubLabelText, { children: "Year" }) }), _jsx(NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable })] })] })] }) }));
71
+ return (_jsx(FormGroup, { error: hasError, children: _jsxs(Stack, { 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] }), _jsxs(InlineFields, { stretch: fullWidth, children: [_jsxs(DayField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(dayRef), accessible: false, children: _jsx(SubLabelText, { children: "Day" }) }), _jsx(NumberInput, { ref: mergeRefs(dayRef, ref), accessibilityLabel: accessibilityLabel('Day'), invalid: hasError, value: value.day, onChangeText: handleChange('day'), testID: testID, stretch: true, editable: editable, maxLength: 2 })] }), _jsxs(MonthField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(monthRef), accessible: false, children: _jsx(SubLabelText, { children: "Month" }) }), _jsx(NumberInput, { ref: monthRef, accessibilityLabel: accessibilityLabel('Month'), invalid: hasError, value: value.month, onChangeText: handleChange('month'), testID: "".concat(testID, "-month"), stretch: true, editable: editable, maxLength: 2 })] }), _jsxs(YearField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(yearRef), accessible: false, children: _jsx(SubLabelText, { children: "Year" }) }), _jsx(NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable, maxLength: 4 })] })] })] }) }));
62
72
  });
63
73
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -32,16 +32,16 @@ import styled, { css } from '../../styled.native';
32
32
  import { Icon } from '../Icon';
33
33
  var DisclosureButton = styled.TouchableOpacity(function () { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n "], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n "]))); });
34
34
  var DisclosureButtonIcon = styled(Icon)(function (_a) {
35
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, expanded = _a.expanded, smallAndUp = _a.smallAndUp;
36
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)', numToPx(core.space[smallAndUp ? 2 : 1]), semantic.message.link);
35
+ var theme = _a.theme, expanded = _a.expanded, smallAndUp = _a.smallAndUp;
36
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)', numToPx(theme.space[smallAndUp ? 200 : 100]), theme.color.surface.link);
37
37
  });
38
38
  var DisclosureButtonText = styled.Text(function (_a) {
39
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
40
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']), numToPx(core.lineHeight.body[smallAndUp ? 'large' : 'small']), semantic.message.link, semantic.message.link);
39
+ var theme = _a.theme, smallAndUp = _a.smallAndUp;
40
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n padding-left: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n padding-left: ", ";\n "])), theme.native.font.family.book, numToPx(theme.font.size.md.mediaQuery[smallAndUp ? 'lg' : 'sm']), numToPx(theme.font.lineHeight.md.mediaQuery[smallAndUp ? 'lg' : 'sm']), theme.color.surface.link, theme.color.surface.link, numToPx(theme.space[200]));
41
41
  });
42
42
  var DisclosurePanel = styled.View(function (_a) {
43
- var core = _a.theme.core, smallAndUp = _a.smallAndUp;
44
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", ";\n "], ["\n margin-top: ", ";\n padding-left: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 2 : 1]));
43
+ var theme = _a.theme;
44
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", ";\n "], ["\n margin-top: ", ";\n padding-left: ", ";\n "])), numToPx(theme.space[300]), numToPx(theme.space[600]));
45
45
  });
46
46
  export var Disclosure = forwardRef(function (_a, ref) {
47
47
  var children = _a.children, title = _a.title, _b = _a.expanded, expanded = _b === void 0 ? false : _b, onToggle = _a.onToggle, rest = __rest(_a, ["children", "title", "expanded", "onToggle"]);
@@ -5,10 +5,10 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import styled, { css } from '../../styled.native';
7
7
  var StyledDivider = styled.View(function (_a) {
8
- var semantic = _a.theme.semantic, _b = _a.type, type = _b === void 0 ? 'default' : _b, _c = _a.width, width = _c === void 0 ? '100%' : _c;
8
+ var theme = _a.theme, _b = _a.type, type = _b === void 0 ? 'default' : _b, _c = _a.width, width = _c === void 0 ? '100%' : _c;
9
9
  return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1px;\n background: ", ";\n width: ", ";\n "], ["\n height: 1px;\n background: ", ";\n width: ", ";\n "])), type === 'default'
10
- ? semantic.border.graphic
11
- : semantic.border.differentiated, width);
10
+ ? theme.color.surface.border
11
+ : theme.color.surface.borderDim, width);
12
12
  });
13
13
  export var Divider = function (_a) {
14
14
  var type = _a.type, width = _a.width;
@@ -3,5 +3,5 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import styled from '../../styled.native';
6
- export var Em = styled.Text(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */\n font-family: 'System font';\n font-style: italic;\n"], ["\n /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */\n font-family: 'System font';\n font-style: italic;\n"])));
6
+ export var Em = styled.Text(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */\n font-family: System;\n font-style: italic;\n"], ["\n /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */\n font-family: System;\n font-style: italic;\n"])));
7
7
  var templateObject_1;
@@ -6,11 +6,13 @@ import { numToPx } from '@ovotech/element-core';
6
6
  import styled, { css } from '../../styled.native';
7
7
  import { styledComponentWithBreakpoints } from '../../utils';
8
8
  var StyledErrorText = styled.Text(function (_a) {
9
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
9
+ var theme = _a.theme, smallAndUp = _a.smallAndUp;
10
10
  var fontSize = smallAndUp
11
- ? core.fontSize.body.large
12
- : core.fontSize.body.small;
13
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), numToPx(core.space[1]), numToPx(core.space[1]), core.fontFamily.body.native, numToPx(fontSize), numToPx(smallAndUp ? core.lineHeight.body.large : core.lineHeight.body.small), semantic.message.error);
11
+ ? theme.font.size.md.mediaQuery.lg
12
+ : theme.font.size.md.mediaQuery.sm;
13
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), numToPx(theme.space[100]), numToPx(theme.space[100]), theme.native.font.family.bold, numToPx(fontSize), numToPx(smallAndUp
14
+ ? theme.font.lineHeight.md.mediaQuery.lg
15
+ : theme.font.lineHeight.md.mediaQuery.sm), theme.color.alert.error);
14
16
  });
15
17
  var ErrorText = styledComponentWithBreakpoints(StyledErrorText);
16
18
  export { ErrorText };
@@ -38,7 +38,7 @@ export var Field = forwardRef(function (_a, ref) {
38
38
  var accessibilityLabel = [labelText, getText(hint), getText(error)]
39
39
  .filter(Boolean)
40
40
  .join(', ');
41
- return (_jsx(FormGroup, { error: hasError || undefined, testID: "nb-field-form-group", children: _jsxs(Stack, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: function () {
41
+ return (_jsx(FormGroup, { error: hasError || undefined, testID: "nb-field-form-group", children: _jsxs(Stack, { spaceBetween: 2, children: [_jsx(TouchableWithoutFeedback, { onPress: function () {
42
42
  if (inputRef.current) {
43
43
  // @ts-ignore. Toggle picker if this is a select menu.
44
44
  if (inputRef.current.togglePicker) {
@@ -6,27 +6,21 @@ import { numToPx } from '@ovotech/element-core';
6
6
  import styled, { css } from '../../styled.native';
7
7
  import { styledComponentWithBreakpoints } from '../../utils';
8
8
  var StyledCol = styled.View(function (_a) {
9
- var core = _a.theme.core, _b = _a.span, span = _b === void 0 ? 12 : _b, small = _a.small, medium = _a.medium, large = _a.large, smallAndUp = _a.smallAndUp, mediumAndUp = _a.mediumAndUp, largeAndUp = _a.largeAndUp;
10
- var gutter = [core.space[4], core.space[8]];
11
- var halfGutter = gutter.map(function (g) { return g / 2; });
12
- var smallScreen = !smallAndUp;
13
- var percentage = (span / 12) * 100;
14
- var smallPercentage = small ? (small / 12) * 100 : percentage;
15
- var mediumPercentage = medium ? (medium / 12) * 100 : smallPercentage;
16
- var largePercentage = large ? (large / 12) * 100 : mediumPercentage;
17
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 0 0 auto;\n flex-basis: ", "%;\n max-width: ", "%;\n padding-left: ", ";\n padding-right: ", ";\n margin-bottom: ", ";\n width: 100%;\n "], ["\n flex: 0 0 auto;\n flex-basis: ", "%;\n max-width: ", "%;\n padding-left: ", ";\n padding-right: ", ";\n margin-bottom: ", ";\n width: 100%;\n "])), largeAndUp
9
+ var theme = _a.theme, _b = _a.span, span = _b === void 0 ? 12 : _b, small = _a.small, medium = _a.medium, large = _a.large, smallAndUp = _a.smallAndUp, mediumAndUp = _a.mediumAndUp, largeAndUp = _a.largeAndUp;
10
+ var COLS = 12;
11
+ var gutter = mediumAndUp ? theme.space[800] : theme.space[400];
12
+ var percentage = (span / COLS) * 100;
13
+ var smallPercentage = small ? (small / COLS) * 100 : percentage;
14
+ var mediumPercentage = medium ? (medium / COLS) * 100 : smallPercentage;
15
+ var largePercentage = large ? (large / COLS) * 100 : mediumPercentage;
16
+ var maxWidth = largeAndUp
18
17
  ? largePercentage
19
18
  : mediumAndUp
20
19
  ? mediumPercentage
21
20
  : smallAndUp
22
21
  ? smallPercentage
23
- : percentage, largeAndUp
24
- ? largePercentage
25
- : mediumAndUp
26
- ? mediumPercentage
27
- : smallAndUp
28
- ? smallPercentage
29
- : percentage, numToPx(smallScreen ? halfGutter[0] : halfGutter[1]), numToPx(smallScreen ? halfGutter[0] : halfGutter[1]), numToPx(smallScreen ? gutter[0] : gutter[1]));
22
+ : percentage;
23
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 0 0 auto;\n padding-left: ", ";\n padding-right: ", ";\n margin-bottom: ", ";\n max-width: ", "%;\n width: 100%;\n "], ["\n flex: 0 0 auto;\n padding-left: ", ";\n padding-right: ", ";\n margin-bottom: ", ";\n max-width: ", "%;\n width: 100%;\n "])), numToPx(gutter / 2), numToPx(gutter / 2), numToPx(gutter), maxWidth);
30
24
  });
31
25
  var Col = styledComponentWithBreakpoints(StyledCol);
32
26
  export { Col };
@@ -29,12 +29,13 @@ import { numToPx } from '@ovotech/element-core';
29
29
  import styled, { css } from '../../styled.native';
30
30
  import { styledComponentWithBreakpoints } from '../../utils';
31
31
  var StyledRow = styled.View(function (_a) {
32
- var core = _a.theme.core, isNested = _a.isNested, smallAndUp = _a.smallAndUp;
33
- var gutter = [core.space[4], core.space[8]];
34
- var halfGutter = gutter.map(function (g) { return g / 2; });
35
- var smallScreen = !smallAndUp;
36
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n margin: 0 auto;\n width: ", "px;\n max-width: 100%;\n margin-bottom: -", ";\n\n ", "\n "], ["\n padding-left: ", ";\n padding-right: ", ";\n margin: 0 auto;\n width: ", "px;\n max-width: 100%;\n margin-bottom: -", ";\n\n ", "\n "])), numToPx(smallScreen ? halfGutter[0] : halfGutter[1]), numToPx(smallScreen ? halfGutter[0] : halfGutter[1]), core.breakpoint.large, numToPx(smallScreen ? gutter[0] : gutter[1]), isNested
37
- ? "\n margin-left: -".concat(numToPx(smallScreen ? gutter[0] : gutter[1]), ";\n margin-right: -").concat(numToPx(smallScreen ? gutter[0] : gutter[1]), ";\n width: auto;\n max-width: 200%; /* max width none not supported in RN */\n ")
32
+ var theme = _a.theme, isNested = _a.isNested, smallAndUp = _a.smallAndUp, mediumAndUp = _a.mediumAndUp;
33
+ var gutter = mediumAndUp ? theme.space[800] : theme.space[400];
34
+ var margin = smallAndUp ? theme.space[800] : theme.space[400];
35
+ /* We need to make up for the half gutter that is added to the left and right of a column, between the small and medium breakpoints */
36
+ var additionalMargin = smallAndUp ? (margin - gutter) / 2 : 0;
37
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n\n ", "\n "], ["\n padding-left: ", ";\n padding-right: ", ";\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n\n ", "\n "])), numToPx(margin / 2 + additionalMargin), numToPx(margin / 2 + additionalMargin), theme.breakpoint.large + margin, isNested
38
+ ? "\n margin-left: -".concat(numToPx(margin / 2), ";\n margin-right: -").concat(numToPx(margin / 2), ";\n width: auto;\n max-width: 200%; /* max width none not supported in RN */\n ")
38
39
  : null);
39
40
  });
40
41
  var WidthRow = styledComponentWithBreakpoints(StyledRow);
@@ -6,11 +6,13 @@ import { numToPx } from '@ovotech/element-core';
6
6
  import styled, { css } from '../../styled.native';
7
7
  import { styledComponentWithBreakpoints } from '../../utils';
8
8
  var StyledHintText = styled.Text(function (_a) {
9
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
9
+ var theme = _a.theme, smallAndUp = _a.smallAndUp;
10
10
  var fontSize = smallAndUp
11
- ? core.fontSize.body.large
12
- : core.fontSize.body.small;
13
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), numToPx(core.space[1]), numToPx(core.space[1]), core.fontFamily.body.native, numToPx(fontSize), numToPx(smallAndUp ? core.lineHeight.body.large : core.lineHeight.body.small), semantic.border.functional);
11
+ ? theme.font.size.md.mediaQuery.lg
12
+ : theme.font.size.md.mediaQuery.sm;
13
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), numToPx(theme.space[100]), numToPx(theme.space[100]), theme.native.font.family.book, numToPx(fontSize), numToPx(smallAndUp
14
+ ? theme.font.lineHeight.md.mediaQuery.lg
15
+ : theme.font.lineHeight.md.mediaQuery.sm), theme.color.surface.onSurfaceVariant);
14
16
  });
15
17
  var HintText = styledComponentWithBreakpoints(StyledHintText);
16
18
  export { HintText };
@@ -25,12 +25,10 @@ import { useContext } from 'react';
25
25
  import { useIcons } from '../../providers';
26
26
  import { ThemeContext } from '../../styled.native';
27
27
  export var Icon = function (_a) {
28
- var name = _a.name, size = _a.size, color = _a.color, testID = _a.testID, rest = __rest(_a, ["name", "size", "color", "testID"]);
28
+ var name = _a.name, _b = _a.size, size = _b === void 0 ? '16' : _b, color = _a.color, testID = _a.testID, rest = __rest(_a, ["name", "size", "color", "testID"]);
29
29
  var icons = useIcons();
30
- var semantic = useContext(ThemeContext).semantic;
30
+ var theme = useContext(ThemeContext);
31
31
  // @ts-ignore to support additional icons.
32
32
  var Svg = name && icons[name];
33
- return Svg ? (_jsx(Svg, __assign({ testID: testID ? testID : "element-icon".concat(name ? "-".concat(name) : ''),
34
- // @ts-ignore this is valid.
35
- color: color !== null && color !== void 0 ? color : semantic.message.base, width: size, height: size }, rest))) : null;
33
+ return Svg ? (_jsx(Svg, __assign({ testID: testID ? testID : "element-icon".concat(name ? "-".concat(name) : ''), color: color !== null && color !== void 0 ? color : theme.color.surface.onSurface, width: size, height: size }, rest))) : null;
36
34
  };
@@ -31,8 +31,13 @@ import { useBreakpoint } from '../../hooks';
31
31
  import styled, { css } from '../../styled.native';
32
32
  import { Icon } from '../Icon/Icon';
33
33
  var StyledIcon = styled(Icon)(function (_a) {
34
- var core = _a.theme.core, side = _a.side, focused = _a.focused;
35
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n z-index: 1;\n top: ", ";\n ", ";\n ", ";\n "], ["\n position: absolute;\n z-index: 1;\n top: ", ";\n ", ";\n ", ";\n "])), focused ? '16px' : '14px', side === 'left' ? "left: ".concat(numToPx(core.space[2])) : '', side === 'right' ? "right: ".concat(numToPx(core.space[2])) : '');
34
+ var theme = _a.theme, side = _a.side, focused = _a.focused;
35
+ var focusCompensation = focused ? theme.space[50] : 0;
36
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n z-index: 1;\n top: ", ";\n ", ";\n ", ";\n "], ["\n position: absolute;\n z-index: 1;\n top: ", ";\n ", ";\n ", ";\n "])), numToPx(theme.space[350] + focusCompensation), side === 'left'
37
+ ? "left: ".concat(numToPx(theme.space[200] + focusCompensation))
38
+ : '', side === 'right'
39
+ ? "right: ".concat(numToPx(theme.space[200] + focusCompensation))
40
+ : '');
36
41
  });
37
42
  var Input = forwardRef(function (_a, ref) {
38
43
  var onFocus = _a.onFocus, onBlur = _a.onBlur, style = _a.style, iconLeft = _a.iconLeft, iconRight = _a.iconRight, rightSlot = _a.rightSlot, rest = __rest(_a, ["onFocus", "onBlur", "style", "iconLeft", "iconRight", "rightSlot"]);
@@ -53,21 +58,21 @@ var Input = forwardRef(function (_a, ref) {
53
58
  } })), iconRight && !rightSlot ? (_jsx(StyledIcon, { name: iconRight, size: 16, focused: focused, pointerEvents: "none", side: "right" })) : null, rightSlot] }));
54
59
  });
55
60
  var InputWrapper = styled.View(function (_a) {
56
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, focused = _a.focused;
57
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: stretch;\n border-radius: ", ";\n border-width: 0;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "], ["\n align-self: stretch;\n border-radius: ", ";\n border-width: 0;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "])), numToPx(core.radius.small), semantic.border.functional, focused
58
- ? "\n border-width: ".concat(numToPx(core.borderWidth.small), ";\n border-color: ").concat(semantic.focus.outline, ";\n padding: 2px;\n margin: -4px;")
61
+ var theme = _a.theme, focused = _a.focused;
62
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: stretch;\n border-radius: ", ";\n border-width: 0;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "], ["\n align-self: stretch;\n border-radius: ", ";\n border-width: 0;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "])), numToPx(theme.border.radius.md), theme.input.color.border, focused
63
+ ? "\n border-width: ".concat(numToPx(theme.border.width.md), ";\n border-color: ").concat(theme.color.outline.outer, ";\n padding: 2px;\n margin: -4px;")
59
64
  : null);
60
65
  });
61
66
  var StyledInput = styled.TextInput(function (_a) {
62
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, smallAndUp = _a.smallAndUp, iconLeft = _a.iconLeft, iconRight = _a.iconRight, hasRightSlot = _a.hasRightSlot;
67
+ var theme = _a.theme, invalid = _a.invalid, smallAndUp = _a.smallAndUp, iconLeft = _a.iconLeft, iconRight = _a.iconRight, hasRightSlot = _a.hasRightSlot;
63
68
  var fontSize = smallAndUp
64
- ? core.fontSize.body.large
65
- : core.fontSize.body.small;
69
+ ? theme.font.size.md.mediaQuery.lg
70
+ : theme.font.size.md.mediaQuery.sm;
66
71
  var errorStyles = invalid
67
- ? "\n border-color: ".concat(semantic.message.error, ";\n ")
72
+ ? "\n border-color: ".concat(theme.color.alert.error, ";\n ")
68
73
  : '';
69
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid\n ", ";\n border-radius: ", ";\n padding: 0 ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "], ["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid\n ", ";\n border-radius: ", ";\n padding: 0 ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "])), core.fontFamily.body.native, semantic.message.base, numToPx(fontSize), numToPx(core.space[11]), numToPx(core.borderWidth.small), semantic.border.functional, numToPx(core.radius.small), numToPx(core.space[2]), iconLeft ? "padding-left: ".concat(numToPx(core.space[8]), ";") : '', iconRight || hasRightSlot
70
- ? "padding-right: ".concat(numToPx(core.space[8]), ";")
74
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid ", ";\n border-radius: ", ";\n padding: ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "], ["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid ", ";\n border-radius: ", ";\n padding: ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "])), theme.native.font.family.book, theme.color.surface.onSurface, numToPx(fontSize), numToPx(theme.space[1100]), numToPx(theme.border.width.md), theme.input.color.border, numToPx(theme.border.radius.sm), numToPx(theme.space[200]), iconLeft ? "padding-left: ".concat(numToPx(theme.space[800]), ";") : '', iconRight || hasRightSlot
75
+ ? "padding-right: ".concat(numToPx(theme.space[800]), ";")
71
76
  : '', errorStyles);
72
77
  });
73
78
  export { Input };