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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Accordion/Accordion.js +22 -25
  3. package/dist/components/Accordion/Group.js +10 -32
  4. package/dist/components/Accordion/Icon.js +19 -14
  5. package/dist/components/Accordion/hooks.d.ts +1 -1
  6. package/dist/components/Accordion/hooks.js +3 -26
  7. package/dist/components/Accordion/styles.d.ts +688 -46
  8. package/dist/components/Accordion/styles.js +56 -49
  9. package/dist/components/Badge/Badge.d.ts +54 -46
  10. package/dist/components/Badge/Badge.js +35 -20
  11. package/dist/components/CTAButton/CTAButton.d.ts +7 -12
  12. package/dist/components/CTAButton/CTAButton.js +23 -27
  13. package/dist/components/CTALink/CTALink.d.ts +4 -4
  14. package/dist/components/CTALink/CTALink.js +5 -27
  15. package/dist/components/Card/Card.d.ts +47 -45
  16. package/dist/components/Card/Card.js +5 -25
  17. package/dist/components/Checkbox/Checkbox.d.ts +3 -3
  18. package/dist/components/Checkbox/Checkbox.js +18 -57
  19. package/dist/components/Checkbox/CheckboxField.js +7 -37
  20. package/dist/components/DataTable/DataTable.d.ts +3 -12
  21. package/dist/components/DataTable/DataTable.js +11 -98
  22. package/dist/components/DataTable/TableRow.d.ts +2 -0
  23. package/dist/components/DataTable/TableRow.js +31 -0
  24. package/dist/components/DataTable/index.d.ts +2 -0
  25. package/dist/components/DataTable/index.js +16 -0
  26. package/dist/components/DataTable/styles.d.ts +2517 -0
  27. package/dist/components/DataTable/styles.js +77 -0
  28. package/dist/components/DataTable/types.d.ts +15 -0
  29. package/dist/components/DataTable/types.js +2 -0
  30. package/dist/components/DateField/DateField.d.ts +2 -2
  31. package/dist/components/DateField/DateField.js +9 -28
  32. package/dist/components/DescriptionList/DescriptionList.js +8 -32
  33. package/dist/components/DescriptionList/styled.d.ts +50 -44
  34. package/dist/components/DescriptionList/styled.js +9 -34
  35. package/dist/components/Disclosure/Disclosure.d.ts +3 -3
  36. package/dist/components/Disclosure/Disclosure.js +12 -18
  37. package/dist/components/Divider/Divider.js +4 -7
  38. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
  39. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -28
  40. package/dist/components/ErrorText/ErrorText.d.ts +45 -39
  41. package/dist/components/ErrorText/ErrorText.js +7 -4
  42. package/dist/components/Field/Field.d.ts +2 -2
  43. package/dist/components/Field/Field.js +18 -49
  44. package/dist/components/FormGroup/FormGroup.js +2 -3
  45. package/dist/components/Grid/Col.d.ts +45 -39
  46. package/dist/components/Grid/Col.js +4 -3
  47. package/dist/components/Grid/Row.d.ts +47 -41
  48. package/dist/components/Grid/Row.js +7 -10
  49. package/dist/components/Heading/Heading.js +21 -32
  50. package/dist/components/HintText/HintText.d.ts +45 -39
  51. package/dist/components/HintText/HintText.js +7 -4
  52. package/dist/components/Icon/Icon.d.ts +3 -4
  53. package/dist/components/Icon/Icon.js +5 -27
  54. package/dist/components/Input/CurrencyInput.d.ts +6 -6
  55. package/dist/components/Input/CurrencyInput.js +3 -25
  56. package/dist/components/Input/EmailInput.d.ts +6 -6
  57. package/dist/components/Input/EmailInput.js +3 -25
  58. package/dist/components/Input/Input.d.ts +8 -8
  59. package/dist/components/Input/Input.js +26 -32
  60. package/dist/components/Input/NumberInput.d.ts +6 -6
  61. package/dist/components/Input/NumberInput.js +3 -25
  62. package/dist/components/Input/PasswordInput.d.ts +6 -6
  63. package/dist/components/Input/PasswordInput.js +3 -25
  64. package/dist/components/Input/PasswordInput.styled.d.ts +45 -39
  65. package/dist/components/Input/PasswordInput.styled.js +2 -5
  66. package/dist/components/Input/PasswordVisibilityToggle.js +14 -29
  67. package/dist/components/Input/PhoneInput.d.ts +10 -0
  68. package/dist/components/Input/PhoneInput.js +19 -0
  69. package/dist/components/Input/TextInput.d.ts +6 -6
  70. package/dist/components/Input/TextInput.js +3 -25
  71. package/dist/components/Input/TextareaInput.d.ts +6 -6
  72. package/dist/components/Input/TextareaInput.js +13 -10
  73. package/dist/components/Input/index.d.ts +1 -1
  74. package/dist/components/Input/index.js +3 -3
  75. package/dist/components/LabelText/LabelText.d.ts +45 -39
  76. package/dist/components/LabelText/LabelText.js +5 -4
  77. package/dist/components/List/List.d.ts +149 -131
  78. package/dist/components/List/List.js +30 -44
  79. package/dist/components/Margin/Margin.d.ts +45 -39
  80. package/dist/components/Margin/Margin.js +3 -3
  81. package/dist/components/NavHeader/NavHeader.d.ts +1 -1
  82. package/dist/components/NavHeader/NavHeader.js +34 -35
  83. package/dist/components/Notification/Notification.d.ts +104 -100
  84. package/dist/components/Notification/Notification.js +32 -49
  85. package/dist/components/Radio/Radio.d.ts +3 -3
  86. package/dist/components/Radio/Radio.js +16 -61
  87. package/dist/components/Radio/RadioField.js +11 -41
  88. package/dist/components/SelectField/Select.d.ts +244 -0
  89. package/dist/components/SelectField/Select.js +102 -0
  90. package/dist/components/SelectField/SelectField.d.ts +7 -0
  91. package/dist/components/SelectField/SelectField.js +33 -0
  92. package/dist/components/SelectField/index.d.ts +1 -0
  93. package/dist/components/SelectField/index.js +5 -0
  94. package/dist/components/SkeletonLoading/Skeleton.d.ts +45 -39
  95. package/dist/components/SkeletonLoading/SkeletonAnimation.js +22 -33
  96. package/dist/components/SkeletonLoading/SkeletonCTA.js +4 -5
  97. package/dist/components/SkeletonLoading/SkeletonCircle.js +4 -6
  98. package/dist/components/SkeletonLoading/SkeletonHeading.js +4 -5
  99. package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
  100. package/dist/components/Stack/Stack.js +6 -28
  101. package/dist/components/Stretch/Stretch.js +2 -2
  102. package/dist/components/SubLabelText/SubLabelText.d.ts +45 -39
  103. package/dist/components/SubLabelText/SubLabelText.js +5 -4
  104. package/dist/components/SummaryList/SummaryList.js +8 -32
  105. package/dist/components/Tabs/Tab.d.ts +4 -4
  106. package/dist/components/Tabs/Tab.js +23 -20
  107. package/dist/components/Tabs/TabList.d.ts +11 -222
  108. package/dist/components/Tabs/TabList.js +22 -18
  109. package/dist/components/Tabs/TabPanel.js +33 -10
  110. package/dist/components/Tabs/Tabs.d.ts +8 -227
  111. package/dist/components/Tabs/Tabs.js +26 -23
  112. package/dist/components/Text/Text.d.ts +234 -204
  113. package/dist/components/Text/Text.js +17 -20
  114. package/dist/components/TextField/CurrencyField.d.ts +6 -6
  115. package/dist/components/TextField/CurrencyField.js +3 -26
  116. package/dist/components/TextField/EmailField.d.ts +6 -6
  117. package/dist/components/TextField/EmailField.js +3 -26
  118. package/dist/components/TextField/NumberField.d.ts +6 -6
  119. package/dist/components/TextField/NumberField.js +3 -26
  120. package/dist/components/TextField/PasswordField.d.ts +6 -6
  121. package/dist/components/TextField/PasswordField.js +3 -26
  122. package/dist/components/TextField/PhoneField.d.ts +10 -0
  123. package/dist/components/TextField/PhoneField.js +33 -0
  124. package/dist/components/TextField/TelField.d.ts +10 -6
  125. package/dist/components/TextField/TelField.js +9 -27
  126. package/dist/components/TextField/TextField.d.ts +6 -6
  127. package/dist/components/TextField/TextField.js +3 -26
  128. package/dist/components/TextField/TextareaField.d.ts +6 -6
  129. package/dist/components/TextField/TextareaField.js +3 -26
  130. package/dist/components/TextField/index.d.ts +1 -0
  131. package/dist/components/TextField/index.js +3 -1
  132. package/dist/components/TextLink/TextLink.d.ts +4 -4
  133. package/dist/components/TextLink/TextLink.js +5 -8
  134. package/dist/components/index.d.ts +1 -0
  135. package/dist/components/index.js +1 -0
  136. package/dist/esm/components/Accordion/Accordion.js +25 -28
  137. package/dist/esm/components/Accordion/Group.js +10 -9
  138. package/dist/esm/components/Accordion/Icon.js +20 -12
  139. package/dist/esm/components/Accordion/hooks.js +3 -3
  140. package/dist/esm/components/Accordion/styles.js +29 -48
  141. package/dist/esm/components/Badge/Badge.js +35 -17
  142. package/dist/esm/components/CTAButton/CTAButton.js +24 -28
  143. package/dist/esm/components/CTALink/CTALink.js +5 -4
  144. package/dist/esm/components/Card/Card.js +5 -25
  145. package/dist/esm/components/Checkbox/Checkbox.js +15 -34
  146. package/dist/esm/components/Checkbox/CheckboxField.js +7 -14
  147. package/dist/esm/components/DataTable/DataTable.js +10 -74
  148. package/dist/esm/components/DataTable/TableRow.js +27 -0
  149. package/dist/esm/components/DataTable/index.js +2 -0
  150. package/dist/esm/components/DataTable/styles.js +51 -0
  151. package/dist/esm/components/DataTable/types.js +1 -0
  152. package/dist/esm/components/DateField/DateField.js +9 -28
  153. package/dist/esm/components/DescriptionList/DescriptionList.js +8 -9
  154. package/dist/esm/components/DescriptionList/styled.js +9 -31
  155. package/dist/esm/components/Disclosure/Disclosure.js +13 -19
  156. package/dist/esm/components/Divider/Divider.js +4 -4
  157. package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -5
  158. package/dist/esm/components/ErrorText/ErrorText.js +7 -4
  159. package/dist/esm/components/Field/Field.js +18 -26
  160. package/dist/esm/components/FormGroup/FormGroup.js +2 -3
  161. package/dist/esm/components/Grid/Col.js +4 -3
  162. package/dist/esm/components/Grid/Row.js +7 -7
  163. package/dist/esm/components/Heading/Heading.js +21 -29
  164. package/dist/esm/components/HintText/HintText.js +7 -4
  165. package/dist/esm/components/Icon/Icon.js +5 -4
  166. package/dist/esm/components/Input/CurrencyInput.js +3 -2
  167. package/dist/esm/components/Input/EmailInput.js +3 -2
  168. package/dist/esm/components/Input/Input.js +27 -33
  169. package/dist/esm/components/Input/NumberInput.js +3 -2
  170. package/dist/esm/components/Input/PasswordInput.js +3 -2
  171. package/dist/esm/components/Input/PasswordInput.styled.js +2 -5
  172. package/dist/esm/components/Input/PasswordVisibilityToggle.js +15 -7
  173. package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +4 -3
  174. package/dist/esm/components/Input/TextInput.js +3 -2
  175. package/dist/esm/components/Input/TextareaInput.js +13 -10
  176. package/dist/esm/components/Input/index.js +1 -1
  177. package/dist/esm/components/LabelText/LabelText.js +5 -4
  178. package/dist/esm/components/List/List.js +31 -45
  179. package/dist/esm/components/Margin/Margin.js +3 -3
  180. package/dist/esm/components/NavHeader/NavHeader.js +34 -32
  181. package/dist/esm/components/Notification/Notification.js +33 -50
  182. package/dist/esm/components/Radio/Radio.js +16 -38
  183. package/dist/esm/components/Radio/RadioField.js +11 -18
  184. package/dist/esm/components/SelectField/Select.js +75 -0
  185. package/dist/esm/components/SelectField/SelectField.js +29 -0
  186. package/dist/esm/components/SelectField/index.js +1 -0
  187. package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +23 -11
  188. package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +4 -5
  189. package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +4 -6
  190. package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +4 -5
  191. package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
  192. package/dist/esm/components/Stack/Stack.js +6 -5
  193. package/dist/esm/components/Stretch/Stretch.js +2 -2
  194. package/dist/esm/components/SubLabelText/SubLabelText.js +5 -4
  195. package/dist/esm/components/SummaryList/SummaryList.js +8 -9
  196. package/dist/esm/components/Tabs/Tab.js +23 -17
  197. package/dist/esm/components/Tabs/TabList.js +21 -18
  198. package/dist/esm/components/Tabs/TabPanel.js +10 -7
  199. package/dist/esm/components/Tabs/Tabs.js +25 -23
  200. package/dist/esm/components/Text/Text.js +17 -20
  201. package/dist/esm/components/TextField/CurrencyField.js +3 -3
  202. package/dist/esm/components/TextField/EmailField.js +3 -3
  203. package/dist/esm/components/TextField/NumberField.js +3 -3
  204. package/dist/esm/components/TextField/PasswordField.js +3 -3
  205. package/dist/esm/components/TextField/PhoneField.js +30 -0
  206. package/dist/esm/components/TextField/TelField.js +9 -4
  207. package/dist/esm/components/TextField/TextField.js +3 -3
  208. package/dist/esm/components/TextField/TextareaField.js +3 -3
  209. package/dist/esm/components/TextField/index.js +1 -0
  210. package/dist/esm/components/TextLink/TextLink.js +5 -8
  211. package/dist/esm/components/index.js +1 -0
  212. package/dist/esm/hooks/use-breakpoint.js +4 -4
  213. package/dist/esm/providers/IconsProvider.js +3 -2
  214. package/dist/esm/providers/icons/ArrowDown.js +2 -3
  215. package/dist/esm/providers/icons/ArrowLeft.js +2 -3
  216. package/dist/esm/providers/icons/ArrowRight.js +2 -3
  217. package/dist/esm/providers/icons/ArrowUp.js +2 -3
  218. package/dist/esm/providers/icons/CaretDown.js +2 -3
  219. package/dist/esm/providers/icons/CaretLeft.js +2 -3
  220. package/dist/esm/providers/icons/CaretRight.js +2 -3
  221. package/dist/esm/providers/icons/CaretUp.js +2 -3
  222. package/dist/esm/providers/icons/Chart.js +2 -3
  223. package/dist/esm/providers/icons/Check.js +2 -3
  224. package/dist/esm/providers/icons/ChevronDown.js +2 -3
  225. package/dist/esm/providers/icons/ChevronLeft.js +2 -3
  226. package/dist/esm/providers/icons/ChevronLeftSmall.js +2 -3
  227. package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +2 -3
  228. package/dist/esm/providers/icons/ChevronRight.js +2 -3
  229. package/dist/esm/providers/icons/ChevronRightSmall.js +2 -3
  230. package/dist/esm/providers/icons/ChevronRightSmallLast.js +2 -3
  231. package/dist/esm/providers/icons/ChevronUp.js +2 -3
  232. package/dist/esm/providers/icons/Cross.js +2 -3
  233. package/dist/esm/providers/icons/Dollar.js +2 -3
  234. package/dist/esm/providers/icons/Download.js +2 -3
  235. package/dist/esm/providers/icons/Electricity.js +2 -3
  236. package/dist/esm/providers/icons/Euro.js +2 -3
  237. package/dist/esm/providers/icons/Gas.js +2 -4
  238. package/dist/esm/providers/icons/Help.js +2 -3
  239. package/dist/esm/providers/icons/Hide.js +2 -3
  240. package/dist/esm/providers/icons/Home.js +2 -3
  241. package/dist/esm/providers/icons/Info.js +2 -3
  242. package/dist/esm/providers/icons/Link.js +2 -4
  243. package/dist/esm/providers/icons/Logo.js +3 -4
  244. package/dist/esm/providers/icons/Minus.js +2 -3
  245. package/dist/esm/providers/icons/NewWindow.js +2 -3
  246. package/dist/esm/providers/icons/PaymentCard.js +2 -3
  247. package/dist/esm/providers/icons/Plus.js +2 -3
  248. package/dist/esm/providers/icons/Pound.js +2 -3
  249. package/dist/esm/providers/icons/Search.js +2 -3
  250. package/dist/esm/providers/icons/Show.js +2 -3
  251. package/dist/esm/providers/icons/User.js +2 -3
  252. package/dist/esm/theme/create-theme.js +0 -153
  253. package/dist/esm/utils/utils.js +7 -3
  254. package/dist/hooks/use-breakpoint.js +4 -4
  255. package/dist/providers/IconsProvider.js +3 -25
  256. package/dist/providers/icons/ArrowDown.js +2 -6
  257. package/dist/providers/icons/ArrowLeft.js +2 -6
  258. package/dist/providers/icons/ArrowRight.js +2 -6
  259. package/dist/providers/icons/ArrowUp.js +2 -6
  260. package/dist/providers/icons/CaretDown.js +2 -6
  261. package/dist/providers/icons/CaretLeft.js +2 -6
  262. package/dist/providers/icons/CaretRight.js +2 -6
  263. package/dist/providers/icons/CaretUp.js +2 -6
  264. package/dist/providers/icons/Chart.js +2 -6
  265. package/dist/providers/icons/Check.js +2 -6
  266. package/dist/providers/icons/ChevronDown.js +2 -6
  267. package/dist/providers/icons/ChevronLeft.js +2 -6
  268. package/dist/providers/icons/ChevronLeftSmall.js +2 -6
  269. package/dist/providers/icons/ChevronLeftSmallFirst.js +2 -6
  270. package/dist/providers/icons/ChevronRight.js +2 -6
  271. package/dist/providers/icons/ChevronRightSmall.js +2 -6
  272. package/dist/providers/icons/ChevronRightSmallLast.js +2 -6
  273. package/dist/providers/icons/ChevronUp.js +2 -6
  274. package/dist/providers/icons/Cross.js +2 -6
  275. package/dist/providers/icons/Dollar.js +2 -6
  276. package/dist/providers/icons/Download.js +2 -6
  277. package/dist/providers/icons/Electricity.js +2 -6
  278. package/dist/providers/icons/Euro.js +2 -6
  279. package/dist/providers/icons/Gas.js +2 -7
  280. package/dist/providers/icons/Help.js +2 -6
  281. package/dist/providers/icons/Hide.js +2 -6
  282. package/dist/providers/icons/Home.js +2 -6
  283. package/dist/providers/icons/Info.js +2 -6
  284. package/dist/providers/icons/Link.js +2 -7
  285. package/dist/providers/icons/Logo.js +2 -6
  286. package/dist/providers/icons/Minus.js +2 -6
  287. package/dist/providers/icons/NewWindow.js +2 -6
  288. package/dist/providers/icons/PaymentCard.js +2 -6
  289. package/dist/providers/icons/Plus.js +2 -6
  290. package/dist/providers/icons/Pound.js +2 -6
  291. package/dist/providers/icons/Search.js +2 -6
  292. package/dist/providers/icons/Show.js +2 -6
  293. package/dist/providers/icons/User.js +2 -6
  294. package/dist/styled.native.d.ts +270 -234
  295. package/dist/theme/create-theme.js +0 -153
  296. package/dist/theme/index.d.ts +45 -39
  297. package/dist/theme/theme.d.ts +0 -90
  298. package/dist/utils/utils.d.ts +5 -4
  299. package/dist/utils/utils.js +8 -26
  300. package/package.json +6 -5
  301. package/dist/components/Input/TelInput.d.ts +0 -10
  302. package/dist/components/Input/TelInput.js +0 -41
@@ -48,29 +48,26 @@ var __rest = (this && this.__rest) || function (s, e) {
48
48
  }
49
49
  return t;
50
50
  };
51
- var __importDefault = (this && this.__importDefault) || function (mod) {
52
- return (mod && mod.__esModule) ? mod : { "default": mod };
53
- };
54
51
  Object.defineProperty(exports, "__esModule", { value: true });
55
52
  exports.Row = void 0;
56
- var react_1 = __importDefault(require("react"));
53
+ var jsx_runtime_1 = require("react/jsx-runtime");
57
54
  var styled_native_1 = __importStar(require("../../styled.native"));
58
55
  var utils_1 = require("../../utils");
59
56
  var utils_2 = require("../../utils/utils");
60
57
  var StyledRow = styled_native_1.default.View(function (_a) {
61
- var grid = _a.theme.grid, isNested = _a.isNested, smallAndUp = _a.smallAndUp;
62
- var halfGutter = grid.gutter.map(function (g) { return (0, utils_2.pxToNumber)(g) / 2 + 'px'; });
58
+ var core = _a.theme.core, isNested = _a.isNested, smallAndUp = _a.smallAndUp;
59
+ var gutter = [core.space[4], core.space[8]];
60
+ var halfGutter = gutter.map(function (g) { return (0, utils_2.pxToNumber)(g) / 2 + 'px'; });
63
61
  var smallScreen = !smallAndUp;
64
- return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n margin: 0 auto;\n width: ", ";\n max-width: 100%;\n margin-bottom: -", ";\n\n ", "\n "], ["\n padding-left: ", ";\n padding-right: ", ";\n margin: 0 auto;\n width: ", ";\n max-width: 100%;\n margin-bottom: -", ";\n\n ", "\n "])), smallScreen ? halfGutter[0] : halfGutter[1], smallScreen ? halfGutter[0] : halfGutter[1], grid.maxWidth, smallScreen ? grid.gutter[0] : grid.gutter[1], isNested
65
- ? "\n margin-left: -".concat(smallScreen ? grid.gutter[0] : grid.gutter[1], ";\n margin-right: -").concat(smallScreen ? grid.gutter[0] : grid.gutter[1], ";\n width: auto;\n max-width: 200%; /* max width none not supported in RN */\n ")
62
+ return (0, styled_native_1.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 "])), smallScreen ? halfGutter[0] : halfGutter[1], smallScreen ? halfGutter[0] : halfGutter[1], core.breakpoint.large, smallScreen ? gutter[0] : gutter[1], isNested
63
+ ? "\n margin-left: -".concat(smallScreen ? gutter[0] : gutter[1], ";\n margin-right: -").concat(smallScreen ? gutter[0] : gutter[1], ";\n width: auto;\n max-width: 200%; /* max width none not supported in RN */\n ")
66
64
  : null);
67
65
  });
68
66
  var WidthRow = (0, utils_1.styledComponentWithBreakpoints)(StyledRow);
69
67
  var RowInner = styled_native_1.default.View(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex: 0 1 auto;\n flex-direction: row;\n flex-wrap: wrap;\n"], ["\n display: flex;\n flex: 0 1 auto;\n flex-direction: row;\n flex-wrap: wrap;\n"])));
70
68
  var Row = function (_a) {
71
69
  var children = _a.children, rest = __rest(_a, ["children"]);
72
- return (react_1.default.createElement(WidthRow, __assign({}, rest),
73
- react_1.default.createElement(RowInner, null, children)));
70
+ return ((0, jsx_runtime_1.jsx)(WidthRow, __assign({}, rest, { children: (0, jsx_runtime_1.jsx)(RowInner, { children: children }) })));
74
71
  };
75
72
  exports.Row = Row;
76
73
  var templateObject_1, templateObject_2;
@@ -48,68 +48,57 @@ var __rest = (this && this.__rest) || function (s, e) {
48
48
  }
49
49
  return t;
50
50
  };
51
- var __importDefault = (this && this.__importDefault) || function (mod) {
52
- return (mod && mod.__esModule) ? mod : { "default": mod };
53
- };
54
51
  Object.defineProperty(exports, "__esModule", { value: true });
55
52
  exports.Heading4 = exports.Heading3 = exports.Heading2 = exports.Heading1 = void 0;
56
- var react_1 = __importDefault(require("react"));
53
+ var jsx_runtime_1 = require("react/jsx-runtime");
57
54
  var hooks_1 = require("../../hooks");
58
55
  var styled_native_1 = __importStar(require("../../styled.native"));
56
+ var utils_1 = require("../../utils");
57
+ var calculateLetterSpacing = function (fontSize, letterSpacing) {
58
+ return (0, utils_1.numToPx)((0, utils_1.pxToNumber)(fontSize) * letterSpacing);
59
+ };
59
60
  var StyledHeading1 = styled_native_1.default.Text(function (_a) {
60
- var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
61
- return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.color, heading.heading1.fontSize[smallAndUp ? 1 : 0], heading.heading1.lineHeight[smallAndUp ? 1 : 0], smallAndUp
62
- ? heading.heading1.marginTop[1]
63
- : heading.heading1.marginTop[0], smallAndUp
64
- ? heading.heading1.marginBottom[1]
65
- : heading.heading1.marginBottom[0]);
61
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
62
+ var fontSize = core.fontSize.heading1[smallAndUp ? 'large' : 'small'];
63
+ return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n color: ", ";\n "])), core.fontFamily.heading.native, fontSize, core.lineHeight.heading1[smallAndUp ? 'large' : 'small'], calculateLetterSpacing(fontSize, core.letterSpacing.extraCompressed), semantic.message.branded);
66
64
  });
67
65
  var Heading1 = function (_a) {
68
66
  var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
69
67
  var breakpoints = (0, hooks_1.useBreakpoint)();
70
- return (react_1.default.createElement(StyledHeading1, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
68
+ return ((0, jsx_runtime_1.jsx)(StyledHeading1, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
71
69
  };
72
70
  exports.Heading1 = Heading1;
73
71
  var StyledHeading2 = styled_native_1.default.Text(function (_a) {
74
- var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
75
- return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading2.fontSize[smallAndUp ? 1 : 0], heading.heading2.lineHeight[smallAndUp ? 1 : 0], heading.color, smallAndUp
76
- ? heading.heading2.marginTop[1]
77
- : heading.heading2.marginTop[0], smallAndUp
78
- ? heading.heading2.marginBottom[1]
79
- : heading.heading2.marginBottom[0]);
72
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
73
+ var fontSize = core.fontSize.heading2[smallAndUp ? 'large' : 'small'];
74
+ return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n color: ", ";\n "])), core.fontFamily.heading.native, fontSize, core.lineHeight.heading2[smallAndUp ? 'large' : 'small'], calculateLetterSpacing(fontSize, core.letterSpacing.extraCompressed), semantic.message.branded);
80
75
  });
81
76
  var Heading2 = function (_a) {
82
77
  var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
83
78
  var breakpoints = (0, hooks_1.useBreakpoint)();
84
- return (react_1.default.createElement(StyledHeading2, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
79
+ return ((0, jsx_runtime_1.jsx)(StyledHeading2, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
85
80
  };
86
81
  exports.Heading2 = Heading2;
87
82
  var StyledHeading3 = styled_native_1.default.Text(function (_a) {
88
- var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
89
- return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading3.fontSize[smallAndUp ? 1 : 0], heading.heading3.lineHeight[smallAndUp ? 1 : 0], heading.color, smallAndUp
90
- ? heading.heading3.marginTop[1]
91
- : heading.heading3.marginTop[0], smallAndUp
92
- ? heading.heading3.marginBottom[1]
93
- : heading.heading3.marginBottom[0]);
83
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
84
+ var fontSize = core.fontSize.heading3[smallAndUp ? 'large' : 'small'];
85
+ return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n color: ", ";\n "])), core.fontFamily.bodyBold.native, fontSize, core.lineHeight.heading3[smallAndUp ? 'large' : 'small'], calculateLetterSpacing(fontSize, core.letterSpacing.compressed), semantic.message.branded);
94
86
  });
95
87
  var Heading3 = function (_a) {
96
88
  var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
97
89
  var breakpoints = (0, hooks_1.useBreakpoint)();
98
- return (react_1.default.createElement(StyledHeading3, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
90
+ return ((0, jsx_runtime_1.jsx)(StyledHeading3, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
99
91
  };
100
92
  exports.Heading3 = Heading3;
101
93
  var StyledHeading4 = styled_native_1.default.Text(function (_a) {
102
- var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
103
- return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading3.fontSize[smallAndUp ? 1 : 0], heading.heading3.lineHeight[smallAndUp ? 1 : 0], heading.color, smallAndUp
104
- ? heading.heading4.marginTop[1]
105
- : heading.heading4.marginTop[0], smallAndUp
106
- ? heading.heading4.marginBottom[1]
107
- : heading.heading4.marginBottom[0]);
94
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
95
+ var fontSize = core.fontSize.heading4[smallAndUp ? 'large' : 'small'];
96
+ return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n color: ", ";\n "])), core.fontFamily.bodyBold.native, fontSize, core.lineHeight.heading4[smallAndUp ? 'large' : 'small'], calculateLetterSpacing(fontSize, core.letterSpacing.compressed), semantic.message.branded);
108
97
  });
109
98
  var Heading4 = function (_a) {
110
99
  var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
111
100
  var breakpoints = (0, hooks_1.useBreakpoint)();
112
- return (react_1.default.createElement(StyledHeading4, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
101
+ return ((0, jsx_runtime_1.jsx)(StyledHeading4, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
113
102
  };
114
103
  exports.Heading4 = Heading4;
115
104
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -11,10 +11,10 @@ declare const HintText: import("react").ForwardRefExoticComponent<Pick<Omit<{
11
11
  borderWidth: Record<"small" | "medium" | "large", string>;
12
12
  breakpoint: Record<"small" | "medium" | "large", string | number>;
13
13
  mediaQuery: Record<"small" | "medium" | "large", string>;
14
- space: Record<0 | 2 | 1 | 10 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15, string>;
14
+ space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15, string>;
15
15
  transition: Record<"medium" | "slow" | "fast", string>;
16
- opacity: Record<"transparent" | "translucent" | "solid", string | number>;
17
- color: Record<"sand" | "red" | "orange" | "yellow" | "lime" | "green" | "teal" | "blue" | "purple", {
16
+ opacity: Record<"solid" | "transparent" | "translucent", string | number>;
17
+ color: Record<"neutral" | "red" | "orange" | "yellow" | "green" | "blue", {
18
18
  lightest: string;
19
19
  lighter: string;
20
20
  light: string;
@@ -30,71 +30,53 @@ declare const HintText: import("react").ForwardRefExoticComponent<Pick<Omit<{
30
30
  web: string;
31
31
  }>;
32
32
  fontWeight: Record<"bold" | "book" | "black", string | number>;
33
- fontSize: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
33
+ fontSize: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
34
34
  small: string | number;
35
35
  large: string | number;
36
36
  }>;
37
- lineHeight: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
37
+ lineHeight: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
38
38
  small: string | number;
39
39
  large: string | number;
40
40
  }>;
41
+ letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
41
42
  };
42
43
  semantic: {
43
44
  surface: Record<"base" | "cutout" | "elevated", string>;
44
45
  message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
45
46
  border: Record<"graphic" | "differentiated" | "functional", string>;
46
- focus: Record<"outline" | "surface", string>;
47
- inverted: Record<"surface" | "border", string> & {
47
+ focus: Record<"surface" | "outline" | "hover", string>;
48
+ inverted: Record<"border" | "surface", string> & {
48
49
  message: Record<"base" | "link" | "secondary" | "branded", string>;
49
50
  };
50
51
  success: {
51
52
  border: string;
52
53
  surface: string;
53
- message: {
54
- base: string;
55
- secondary: string;
56
- };
54
+ surfaceEmphasis: string;
55
+ message: string;
56
+ messageOnEmphasis: string;
57
57
  };
58
58
  warning: {
59
59
  border: string;
60
60
  surface: string;
61
- message: {
62
- base: string;
63
- secondary: string;
64
- };
61
+ surfaceEmphasis: string;
62
+ message: string;
63
+ messageOnEmphasis: string;
65
64
  };
66
65
  error: {
67
66
  border: string;
68
67
  surface: string;
69
- message: {
70
- base: string;
71
- secondary: string;
72
- };
68
+ surfaceEmphasis: string;
69
+ message: string;
70
+ messageOnEmphasis: string;
73
71
  };
74
72
  info: {
75
73
  border: string;
76
74
  surface: string;
77
- message: {
78
- base: string;
79
- secondary: string;
80
- };
81
- };
82
- electricity: {
83
- border: string;
84
- surface: string;
85
- message: {
86
- base: string;
87
- secondary: string;
88
- };
89
- };
90
- gas: {
91
- border: string;
92
- surface: string;
93
- message: {
94
- base: string;
95
- secondary: string;
96
- };
75
+ surfaceEmphasis: string;
76
+ message: string;
77
+ messageOnEmphasis: string;
97
78
  };
79
+ data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
98
80
  };
99
81
  component: {
100
82
  heading1: {
@@ -225,6 +207,30 @@ declare const HintText: import("react").ForwardRefExoticComponent<Pick<Omit<{
225
207
  backgroundFocused: string;
226
208
  };
227
209
  };
210
+ badge: {
211
+ variants: {
212
+ red: {
213
+ foreground: string;
214
+ background: string;
215
+ };
216
+ orange: {
217
+ foreground: string;
218
+ background: string;
219
+ };
220
+ yellow: {
221
+ foreground: string;
222
+ background: string;
223
+ };
224
+ green: {
225
+ foreground: string;
226
+ background: string;
227
+ };
228
+ blue: {
229
+ foreground: string;
230
+ background: string;
231
+ };
232
+ };
233
+ };
228
234
  };
229
235
  }) | undefined;
230
236
  } & {
@@ -29,12 +29,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.HintText = void 0;
31
31
  var styled_native_1 = __importStar(require("../../styled.native"));
32
- var theme_1 = require("../../theme");
33
32
  var utils_1 = require("../../utils");
34
33
  var StyledHintText = styled_native_1.default.Text(function (_a) {
35
- var field = _a.theme.field, smallAndUp = _a.smallAndUp;
36
- var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
37
- return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), field.fontFamily, fontSize, (0, theme_1.calculateLineHeight)(fontSize, field.lineHeight), field.hint.color);
34
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
35
+ var fontSize = smallAndUp
36
+ ? core.fontSize.body.large
37
+ : core.fontSize.body.small;
38
+ return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, fontSize, smallAndUp
39
+ ? core.lineHeight.body.large
40
+ : core.lineHeight.body.small, semantic.border.functional);
38
41
  });
39
42
  var HintText = (0, utils_1.styledComponentWithBreakpoints)(StyledHintText);
40
43
  exports.HintText = HintText;
@@ -1,11 +1,10 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { SvgProps } from 'react-native-svg';
3
3
  import { IconName } from '../../providers';
4
4
  export declare type IconBase = React.FunctionComponent<SvgProps>;
5
- declare type Props = SvgProps & {
5
+ export declare type IconProps = SvgProps & {
6
6
  name: IconName | (string & {});
7
7
  color?: string;
8
8
  size: string | number;
9
9
  };
10
- export declare const Icon: ({ name, size, color, testID, ...rest }: Props) => JSX.Element | null;
11
- export {};
10
+ export declare const Icon: ({ name, size, color, testID, ...rest }: IconProps) => JSX.Element | null;
@@ -10,29 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
13
  var __rest = (this && this.__rest) || function (s, e) {
37
14
  var t = {};
38
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -46,17 +23,18 @@ var __rest = (this && this.__rest) || function (s, e) {
46
23
  };
47
24
  Object.defineProperty(exports, "__esModule", { value: true });
48
25
  exports.Icon = void 0;
49
- var react_1 = __importStar(require("react"));
26
+ var jsx_runtime_1 = require("react/jsx-runtime");
27
+ var react_1 = require("react");
50
28
  var providers_1 = require("../../providers");
51
29
  var styled_native_1 = require("../../styled.native");
52
30
  var Icon = function (_a) {
53
31
  var name = _a.name, size = _a.size, color = _a.color, testID = _a.testID, rest = __rest(_a, ["name", "size", "color", "testID"]);
54
32
  var icons = (0, providers_1.useIcons)();
55
- var colors = (0, react_1.useContext)(styled_native_1.ThemeContext).colors;
33
+ var semantic = (0, react_1.useContext)(styled_native_1.ThemeContext).semantic;
56
34
  // @ts-ignore to support additional icons.
57
35
  var Svg = name && icons[name];
58
- return Svg ? (react_1.default.createElement(Svg, __assign({ testID: testID ? testID : "element-icon".concat(name ? "-".concat(name) : ''),
36
+ return Svg ? ((0, jsx_runtime_1.jsx)(Svg, __assign({ testID: testID ? testID : "element-icon".concat(name ? "-".concat(name) : ''),
59
37
  // @ts-ignore this is valid.
60
- color: color !== null && color !== void 0 ? color : colors.body, width: size, height: size }, rest))) : null;
38
+ color: color !== null && color !== void 0 ? color : semantic.message.base, width: size, height: size }, rest))) : null;
61
39
  };
62
40
  exports.Icon = Icon;
@@ -1,16 +1,16 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { TextInput } from 'react-native';
3
3
  import { InputProps } from './Input';
4
4
  export declare type CurrencyInputProps = InputProps & {
5
5
  currency?: 'GBP' | 'EUR' | 'AUD' | 'USD';
6
6
  };
7
- declare const CurrencyInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
7
+ declare const CurrencyInput: import("react").ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
8
8
  invalid?: boolean | undefined;
9
9
  stretch?: boolean | undefined;
10
- iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
11
- iconRight?: (string & {}) | import("../../providers").IconName | undefined;
12
- rightSlot?: React.ReactNode;
10
+ iconLeft?: import("../../providers").IconName | undefined;
11
+ iconRight?: import("../../providers").IconName | undefined;
12
+ rightSlot?: import("react").ReactNode;
13
13
  } & {
14
14
  currency?: "GBP" | "EUR" | "AUD" | "USD" | undefined;
15
- } & React.RefAttributes<TextInput>>;
15
+ } & import("react").RefAttributes<TextInput>>;
16
16
  export { CurrencyInput };
@@ -10,29 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
13
  var __rest = (this && this.__rest) || function (s, e) {
37
14
  var t = {};
38
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -46,7 +23,8 @@ var __rest = (this && this.__rest) || function (s, e) {
46
23
  };
47
24
  Object.defineProperty(exports, "__esModule", { value: true });
48
25
  exports.CurrencyInput = void 0;
49
- var react_1 = __importStar(require("react"));
26
+ var jsx_runtime_1 = require("react/jsx-runtime");
27
+ var react_1 = require("react");
50
28
  var utils_1 = require("../../utils");
51
29
  var NumberInput_1 = require("./NumberInput");
52
30
  var CurrencyInput = (0, react_1.forwardRef)(function (_a, ref) {
@@ -54,6 +32,6 @@ var CurrencyInput = (0, react_1.forwardRef)(function (_a, ref) {
54
32
  var inputRef = (0, react_1.createRef)();
55
33
  var updatedAccessibilityLabel = "".concat(accessibilityLabel, " ").concat(currency === 'GBP' ? 'pounds' : currency === 'EUR' ? 'euro' : 'dollar').trim();
56
34
  var iconName = currency === 'GBP' ? 'pound' : currency === 'EUR' ? 'euro' : 'dollar';
57
- return (react_1.default.createElement(NumberInput_1.NumberInput, __assign({}, rest, { invalid: invalid, accessibilityLabel: updatedAccessibilityLabel, ref: (0, utils_1.mergeRefs)(ref, inputRef), iconLeft: iconName })));
35
+ return ((0, jsx_runtime_1.jsx)(NumberInput_1.NumberInput, __assign({}, rest, { invalid: invalid, accessibilityLabel: updatedAccessibilityLabel, ref: (0, utils_1.mergeRefs)(ref, inputRef), iconLeft: iconName })));
58
36
  });
59
37
  exports.CurrencyInput = CurrencyInput;
@@ -1,10 +1,10 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { TextInput } from 'react-native';
3
- declare const EmailInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
3
+ declare const EmailInput: import("react").ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
4
4
  invalid?: boolean | undefined;
5
5
  stretch?: boolean | undefined;
6
- iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
7
- iconRight?: (string & {}) | import("../../providers").IconName | undefined;
8
- rightSlot?: React.ReactNode;
9
- } & React.RefAttributes<TextInput>>;
6
+ iconLeft?: import("../../providers").IconName | undefined;
7
+ iconRight?: import("../../providers").IconName | undefined;
8
+ rightSlot?: import("react").ReactNode;
9
+ } & import("react").RefAttributes<TextInput>>;
10
10
  export { EmailInput };
@@ -10,32 +10,10 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
13
  Object.defineProperty(exports, "__esModule", { value: true });
37
14
  exports.EmailInput = void 0;
38
- var react_1 = __importStar(require("react"));
15
+ var jsx_runtime_1 = require("react/jsx-runtime");
16
+ var react_1 = require("react");
39
17
  var Input_1 = require("./Input");
40
- var EmailInput = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(Input_1.Input, __assign({}, props, { keyboardType: "email-address", autoCapitalize: "none", autoCorrect: false, ref: ref }))); });
18
+ var EmailInput = (0, react_1.forwardRef)(function (props, ref) { return ((0, jsx_runtime_1.jsx)(Input_1.Input, __assign({}, props, { keyboardType: "email-address", autoCapitalize: "none", autoCorrect: false, ref: ref }))); });
41
19
  exports.EmailInput = EmailInput;
@@ -1,18 +1,18 @@
1
- import React, { ReactNode } from 'react';
2
- import { TextInputProps, TextInput } from 'react-native';
1
+ import { ReactNode } from 'react';
2
+ import { TextInput, TextInputProps } from 'react-native';
3
3
  import { IconName } from '../../providers/types';
4
4
  export declare type InputProps = TextInputProps & {
5
5
  invalid?: boolean;
6
6
  stretch?: boolean;
7
- iconLeft?: IconName | (string & {});
8
- iconRight?: IconName | (string & {});
7
+ iconLeft?: IconName | (string & object);
8
+ iconRight?: IconName | (string & object);
9
9
  rightSlot?: ReactNode;
10
10
  };
11
- declare const Input: React.ForwardRefExoticComponent<TextInputProps & {
11
+ declare const Input: import("react").ForwardRefExoticComponent<TextInputProps & {
12
12
  invalid?: boolean | undefined;
13
13
  stretch?: boolean | undefined;
14
- iconLeft?: (string & {}) | IconName | undefined;
15
- iconRight?: (string & {}) | IconName | undefined;
14
+ iconLeft?: IconName | undefined;
15
+ iconRight?: IconName | undefined;
16
16
  rightSlot?: ReactNode;
17
- } & React.RefAttributes<TextInput>>;
17
+ } & import("react").RefAttributes<TextInput>>;
18
18
  export { Input };
@@ -50,54 +50,48 @@ var __rest = (this && this.__rest) || function (s, e) {
50
50
  };
51
51
  Object.defineProperty(exports, "__esModule", { value: true });
52
52
  exports.Input = void 0;
53
- var react_1 = __importStar(require("react"));
53
+ var jsx_runtime_1 = require("react/jsx-runtime");
54
+ var react_1 = require("react");
54
55
  var hooks_1 = require("../../hooks");
55
56
  var styled_native_1 = __importStar(require("../../styled.native"));
56
- var utils_1 = require("../../utils");
57
57
  var Icon_1 = require("../Icon/Icon");
58
58
  var StyledIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_a) {
59
- var _b = _a.theme, input = _b.input, focusRing = _b.focusRing, side = _a.side, focused = _a.focused;
60
- var distance = ((0, utils_1.pxToNumber)(input.height) - (0, utils_1.pxToNumber)(input.icon.size)) / 2 +
61
- (focused ? (0, utils_1.pxToNumber)(focusRing.distance) : 0);
62
- return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", "px;\n ", ";\n ", ";\n "], ["\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", "px;\n ", ";\n ", ";\n "])), input.icon.size, distance, side === 'left' ? "left: ".concat(distance, "px") : '', side === 'right' ? "right: ".concat(distance, "px") : '');
59
+ var core = _a.theme.core, side = _a.side, focused = _a.focused;
60
+ return (0, styled_native_1.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(core.space[2]) : '', side === 'right' ? "right: ".concat(core.space[2]) : '');
63
61
  });
64
62
  var Input = (0, react_1.forwardRef)(function (_a, ref) {
65
63
  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"]);
66
64
  var _b = (0, react_1.useState)(false), focused = _b[0], setFocused = _b[1];
67
65
  var breakpoints = (0, hooks_1.useBreakpoint)();
68
- var input = (0, react_1.useContext)(styled_native_1.ThemeContext).input;
69
- return (react_1.default.createElement(InputWrapper, { focused: focused },
70
- iconLeft ? (react_1.default.createElement(StyledIcon, { name: iconLeft, size: (0, utils_1.pxToNumber)(input.icon.size), focused: focused, pointerEvents: "none", side: "left" })) : null,
71
- react_1.default.createElement(StyledInput, __assign({}, rest, breakpoints, { iconLeft: !!iconLeft, iconRight: !!iconRight, hasRightSlot: !!rightSlot, style: style,
72
- // @ts-ignore
73
- ref: ref, onFocus: function (event) {
74
- setFocused(true);
75
- if (onFocus) {
76
- onFocus(event);
77
- }
78
- }, onBlur: function (event) {
79
- setFocused(false);
80
- if (onBlur) {
81
- onBlur(event);
82
- }
83
- } })),
84
- iconRight && !rightSlot ? (react_1.default.createElement(StyledIcon, { name: iconRight, size: (0, utils_1.pxToNumber)(input.icon.size), focused: focused, pointerEvents: "none", side: "right" })) : null,
85
- rightSlot));
66
+ return ((0, jsx_runtime_1.jsxs)(InputWrapper, __assign({ focused: focused }, { children: [iconLeft ? ((0, jsx_runtime_1.jsx)(StyledIcon, { name: iconLeft, size: 16, focused: focused, pointerEvents: "none", side: "left" })) : null, (0, jsx_runtime_1.jsx)(StyledInput, __assign({}, rest, breakpoints, { iconLeft: !!iconLeft, iconRight: !!iconRight, hasRightSlot: !!rightSlot, style: style,
67
+ // @ts-ignore
68
+ ref: ref, onFocus: function (event) {
69
+ setFocused(true);
70
+ if (onFocus) {
71
+ onFocus(event);
72
+ }
73
+ }, onBlur: function (event) {
74
+ setFocused(false);
75
+ if (onBlur) {
76
+ onBlur(event);
77
+ }
78
+ } })), iconRight && !rightSlot ? ((0, jsx_runtime_1.jsx)(StyledIcon, { name: iconRight, size: 16, focused: focused, pointerEvents: "none", side: "right" })) : null, rightSlot] })));
86
79
  });
87
80
  exports.Input = Input;
88
81
  var InputWrapper = styled_native_1.default.View(function (_a) {
89
- var _b = _a.theme, input = _b.input, focusRing = _b.focusRing, focused = _a.focused;
90
- return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: stretch;\n background-color: ", ";\n border-radius: ", ";\n border-width: 0px;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "], ["\n align-self: stretch;\n background-color: ", ";\n border-radius: ", ";\n border-width: 0px;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "])), input.background, input.borderRadius, focusRing.color, focused
91
- ? "\n border-width: ".concat(focusRing.width, ";\n padding: ").concat(focusRing.distance, ";\n margin: -").concat((0, utils_1.pxToNumber)(focusRing.width) +
92
- (0, utils_1.pxToNumber)(focusRing.distance), "px;")
82
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, focused = _a.focused;
83
+ return (0, styled_native_1.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 "])), core.radius.small, semantic.border.functional, focused
84
+ ? "\n border-width: ".concat(core.borderWidth.small, ";\n border-color: ").concat(semantic.focus.outline, ";\n padding: 2px;\n margin: -4px;")
93
85
  : null);
94
86
  });
95
87
  var StyledInput = styled_native_1.default.TextInput(function (_a) {
96
- var input = _a.theme.input, invalid = _a.invalid, smallAndUp = _a.smallAndUp, iconLeft = _a.iconLeft, iconRight = _a.iconRight, hasRightSlot = _a.hasRightSlot;
97
- var fontSize = smallAndUp ? input.fontSize[1] : input.fontSize[0];
88
+ 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;
89
+ var fontSize = smallAndUp
90
+ ? core.fontSize.body.large
91
+ : core.fontSize.body.small;
98
92
  var errorStyles = invalid
99
- ? "\n border-width: ".concat(input.error.borderWidth, ";\n border-color: ").concat(input.error.color, ";\n ")
93
+ ? "\n border-color: ".concat(semantic.message.error, ";\n ")
100
94
  : '';
101
- return (0, styled_native_1.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 background: ", ";\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 background: ", ";\n border-radius: ", ";\n padding: ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "])), input.fontFamily, input.color, fontSize, input.height, input.borderWidth, input.borderColor, input.background, input.borderRadius, input.padding, iconLeft ? "padding-left: ".concat(input.height, ";") : '', iconRight || hasRightSlot ? "padding-right: ".concat(input.height, ";") : '', errorStyles);
95
+ return (0, styled_native_1.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: 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 border-radius: ", ";\n padding: 0 ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "])), core.fontFamily.body.native, semantic.message.base, fontSize, core.space[11], core.borderWidth.small, semantic.border.functional, core.radius.small, core.space[2], iconLeft ? "padding-left: ".concat(core.space[8], ";") : '', iconRight || hasRightSlot ? "padding-right: ".concat(core.space[8], ";") : '', errorStyles);
102
96
  });
103
97
  var templateObject_1, templateObject_2, templateObject_3;