@ovotech/element-native 2.0.4 → 2.2.0-canary-1cac2ba-73

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 (183) hide show
  1. package/dist/components/Accordion/Accordion.js +23 -22
  2. package/dist/components/Accordion/Icon.js +7 -10
  3. package/dist/components/Accordion/styles.d.ts +688 -46
  4. package/dist/components/Accordion/styles.js +56 -49
  5. package/dist/components/Accordion/types.d.ts +1 -0
  6. package/dist/components/Badge/Badge.d.ts +238 -8
  7. package/dist/components/Badge/Badge.js +35 -14
  8. package/dist/components/CTAButton/CTAButton.d.ts +7 -12
  9. package/dist/components/CTAButton/CTAButton.js +18 -19
  10. package/dist/components/CTALink/CTALink.d.ts +3 -4
  11. package/dist/components/Card/Card.d.ts +228 -5
  12. package/dist/components/Card/Card.js +5 -25
  13. package/dist/components/Checkbox/Checkbox.js +19 -26
  14. package/dist/components/DataTable/DataTable.d.ts +3 -12
  15. package/dist/components/DataTable/DataTable.js +8 -71
  16. package/dist/components/DataTable/TableRow.d.ts +2 -0
  17. package/dist/components/DataTable/TableRow.js +33 -0
  18. package/dist/components/DataTable/index.d.ts +2 -0
  19. package/dist/components/DataTable/index.js +16 -0
  20. package/dist/components/DataTable/styles.d.ts +2517 -0
  21. package/dist/components/DataTable/styles.js +77 -0
  22. package/dist/components/DataTable/types.d.ts +15 -0
  23. package/dist/components/DataTable/types.js +2 -0
  24. package/dist/components/DateField/DateField.js +9 -9
  25. package/dist/components/DescriptionList/DescriptionList.d.ts +10 -0
  26. package/dist/components/DescriptionList/DescriptionList.js +66 -0
  27. package/dist/components/DescriptionList/index.d.ts +1 -0
  28. package/dist/components/DescriptionList/index.js +6 -0
  29. package/dist/components/DescriptionList/styled.d.ts +241 -0
  30. package/dist/components/DescriptionList/styled.js +88 -0
  31. package/dist/components/Disclosure/Disclosure.js +7 -10
  32. package/dist/components/Divider/Divider.d.ts +5 -0
  33. package/dist/components/Divider/Divider.js +45 -0
  34. package/dist/components/Divider/index.d.ts +1 -0
  35. package/dist/components/Divider/index.js +5 -0
  36. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
  37. package/dist/components/ErrorText/ErrorText.d.ts +228 -1
  38. package/dist/components/ErrorText/ErrorText.js +1 -1
  39. package/dist/components/Field/Field.js +3 -3
  40. package/dist/components/Grid/Col.d.ts +229 -2
  41. package/dist/components/Grid/Row.d.ts +228 -1
  42. package/dist/components/Heading/Heading.js +8 -24
  43. package/dist/components/HintText/HintText.d.ts +228 -1
  44. package/dist/components/HintText/HintText.js +1 -1
  45. package/dist/components/Icon/Icon.d.ts +2 -3
  46. package/dist/components/Icon/Icon.js +2 -2
  47. package/dist/components/Input/CurrencyInput.d.ts +2 -1
  48. package/dist/components/Input/EmailInput.d.ts +2 -1
  49. package/dist/components/Input/Input.d.ts +4 -2
  50. package/dist/components/Input/Input.js +16 -18
  51. package/dist/components/Input/NumberInput.d.ts +2 -1
  52. package/dist/components/Input/PasswordInput.d.ts +4 -1
  53. package/dist/components/Input/PasswordInput.js +4 -2
  54. package/dist/components/Input/PasswordInput.styled.d.ts +231 -0
  55. package/dist/components/Input/PasswordInput.styled.js +37 -0
  56. package/dist/components/Input/PasswordVisibilityToggle.d.ts +11 -0
  57. package/dist/components/Input/PasswordVisibilityToggle.js +51 -0
  58. package/dist/components/Input/{TelInput.d.ts → PhoneInput.d.ts} +3 -2
  59. package/dist/components/Input/{TelInput.js → PhoneInput.js} +3 -3
  60. package/dist/components/Input/TextInput.d.ts +2 -1
  61. package/dist/components/Input/TextareaInput.d.ts +2 -1
  62. package/dist/components/Input/TextareaInput.js +11 -9
  63. package/dist/components/Input/index.d.ts +1 -1
  64. package/dist/components/Input/index.js +3 -3
  65. package/dist/components/LabelText/LabelText.d.ts +228 -1
  66. package/dist/components/LabelText/LabelText.js +1 -1
  67. package/dist/components/List/List.d.ts +706 -3
  68. package/dist/components/List/List.js +18 -5
  69. package/dist/components/Margin/Margin.d.ts +228 -1
  70. package/dist/components/NavHeader/NavHeader.d.ts +1 -0
  71. package/dist/components/NavHeader/NavHeader.js +11 -13
  72. package/dist/components/Notification/Notification.d.ts +466 -20
  73. package/dist/components/Notification/Notification.js +32 -44
  74. package/dist/components/Radio/Radio.js +18 -36
  75. package/dist/components/SelectField/Select.d.ts +244 -0
  76. package/dist/components/SelectField/Select.js +101 -0
  77. package/dist/components/SelectField/SelectField.d.ts +7 -0
  78. package/dist/components/SelectField/SelectField.js +38 -0
  79. package/dist/components/SelectField/index.d.ts +1 -0
  80. package/dist/components/SelectField/index.js +5 -0
  81. package/dist/components/SkeletonLoading/Skeleton.d.ts +228 -1
  82. package/dist/components/SkeletonLoading/SkeletonAnimation.d.ts +6 -0
  83. package/dist/components/SkeletonLoading/SkeletonAnimation.js +57 -0
  84. package/dist/components/SkeletonLoading/SkeletonCTA.js +3 -1
  85. package/dist/components/SkeletonLoading/SkeletonCircle.js +4 -2
  86. package/dist/components/SkeletonLoading/SkeletonHeading.js +3 -1
  87. package/dist/components/SkeletonLoading/SkeletonText.js +2 -2
  88. package/dist/components/SubLabelText/SubLabelText.d.ts +228 -1
  89. package/dist/components/SubLabelText/SubLabelText.js +1 -1
  90. package/dist/components/SummaryList/SummaryList.d.ts +4 -0
  91. package/dist/components/SummaryList/SummaryList.js +5 -0
  92. package/dist/components/Tabs/Tab.js +22 -19
  93. package/dist/components/Tabs/TabList.d.ts +11 -1
  94. package/dist/components/Tabs/TabList.js +19 -16
  95. package/dist/components/Tabs/TabPanel.js +32 -6
  96. package/dist/components/Tabs/Tabs.d.ts +8 -6
  97. package/dist/components/Tabs/Tabs.js +10 -6
  98. package/dist/components/Text/Text.d.ts +1140 -5
  99. package/dist/components/Text/Text.js +6 -10
  100. package/dist/components/TextField/CurrencyField.d.ts +2 -1
  101. package/dist/components/TextField/EmailField.d.ts +2 -1
  102. package/dist/components/TextField/NumberField.d.ts +2 -1
  103. package/dist/components/TextField/PasswordField.d.ts +4 -1
  104. package/dist/components/TextField/PasswordField.js +2 -2
  105. package/dist/components/TextField/PhoneField.d.ts +10 -0
  106. package/dist/components/TextField/PhoneField.js +56 -0
  107. package/dist/components/TextField/TelField.d.ts +6 -1
  108. package/dist/components/TextField/TelField.js +7 -2
  109. package/dist/components/TextField/TextField.d.ts +2 -1
  110. package/dist/components/TextField/TextareaField.d.ts +2 -1
  111. package/dist/components/TextField/index.d.ts +1 -0
  112. package/dist/components/TextField/index.js +3 -1
  113. package/dist/components/TextLink/TextLink.js +2 -2
  114. package/dist/components/index.d.ts +3 -0
  115. package/dist/components/index.js +3 -0
  116. package/dist/esm/components/Accordion/Accordion.js +26 -25
  117. package/dist/esm/components/Accordion/Icon.js +8 -8
  118. package/dist/esm/components/Accordion/styles.js +29 -48
  119. package/dist/esm/components/Badge/Badge.js +35 -14
  120. package/dist/esm/components/CTAButton/CTAButton.js +20 -21
  121. package/dist/esm/components/Card/Card.js +5 -25
  122. package/dist/esm/components/Checkbox/Checkbox.js +17 -27
  123. package/dist/esm/components/DataTable/DataTable.js +3 -66
  124. package/dist/esm/components/DataTable/TableRow.js +26 -0
  125. package/dist/esm/components/DataTable/index.js +2 -0
  126. package/dist/esm/components/DataTable/styles.js +51 -0
  127. package/dist/esm/components/DataTable/types.js +1 -0
  128. package/dist/esm/components/DateField/DateField.js +9 -9
  129. package/dist/esm/components/DescriptionList/DescriptionList.js +39 -0
  130. package/dist/esm/components/DescriptionList/index.js +1 -0
  131. package/dist/esm/components/DescriptionList/styled.js +57 -0
  132. package/dist/esm/components/Disclosure/Disclosure.js +9 -12
  133. package/dist/esm/components/Divider/Divider.js +15 -0
  134. package/dist/esm/components/Divider/index.js +1 -0
  135. package/dist/esm/components/ErrorText/ErrorText.js +1 -1
  136. package/dist/esm/components/Field/Field.js +3 -3
  137. package/dist/esm/components/Heading/Heading.js +8 -24
  138. package/dist/esm/components/HintText/HintText.js +1 -1
  139. package/dist/esm/components/Icon/Icon.js +2 -2
  140. package/dist/esm/components/Input/Input.js +18 -20
  141. package/dist/esm/components/Input/PasswordInput.js +4 -2
  142. package/dist/esm/components/Input/PasswordInput.styled.js +11 -0
  143. package/dist/esm/components/Input/PasswordVisibilityToggle.js +23 -0
  144. package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +2 -2
  145. package/dist/esm/components/Input/TextareaInput.js +11 -9
  146. package/dist/esm/components/Input/index.js +1 -1
  147. package/dist/esm/components/LabelText/LabelText.js +1 -1
  148. package/dist/esm/components/List/List.js +17 -5
  149. package/dist/esm/components/NavHeader/NavHeader.js +12 -14
  150. package/dist/esm/components/Notification/Notification.js +34 -46
  151. package/dist/esm/components/Radio/Radio.js +18 -36
  152. package/dist/esm/components/SelectField/Select.js +74 -0
  153. package/dist/esm/components/SelectField/SelectField.js +31 -0
  154. package/dist/esm/components/SelectField/index.js +1 -0
  155. package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +30 -0
  156. package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +3 -1
  157. package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +4 -2
  158. package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +3 -1
  159. package/dist/esm/components/SkeletonLoading/SkeletonText.js +2 -2
  160. package/dist/esm/components/SubLabelText/SubLabelText.js +1 -1
  161. package/dist/esm/components/SummaryList/SummaryList.js +5 -0
  162. package/dist/esm/components/Tabs/Tab.js +22 -16
  163. package/dist/esm/components/Tabs/TabList.js +18 -16
  164. package/dist/esm/components/Tabs/TabPanel.js +9 -6
  165. package/dist/esm/components/Tabs/Tabs.js +9 -6
  166. package/dist/esm/components/Text/Text.js +6 -10
  167. package/dist/esm/components/TextField/PasswordField.js +2 -2
  168. package/dist/esm/components/TextField/PhoneField.js +30 -0
  169. package/dist/esm/components/TextField/TelField.js +7 -2
  170. package/dist/esm/components/TextField/index.js +1 -0
  171. package/dist/esm/components/TextLink/TextLink.js +2 -2
  172. package/dist/esm/components/index.js +3 -0
  173. package/dist/esm/providers/icons/Logo.js +6 -3
  174. package/dist/esm/theme/create-theme.js +2 -176
  175. package/dist/esm/theme/index.js +13 -2
  176. package/dist/providers/icons/Logo.js +5 -2
  177. package/dist/styled.native.d.ts +1363 -1
  178. package/dist/theme/create-theme.d.ts +1 -1
  179. package/dist/theme/create-theme.js +2 -176
  180. package/dist/theme/index.d.ts +228 -2
  181. package/dist/theme/index.js +13 -2
  182. package/dist/theme/theme.d.ts +1 -110
  183. package/package.json +12 -10
@@ -58,11 +58,11 @@ export var Field = forwardRef(function (_a, ref) {
58
58
  React.createElement(LabelText, null,
59
59
  label,
60
60
  optional ? ' (optional)' : null),
61
- hint ? React.createElement(HintText, null, hint) : null)),
61
+ hint ? React.createElement(HintText, null, hint) : null,
62
+ error ? React.createElement(ErrorText, null, error) : null)),
62
63
  React.createElement(Stretch, { defaultWidth: "".concat(Math.ceil(characters * 0.8 * parseInt(field.fontSize[0])) + affixWidth, "px"), fullWidth: fullWidth }, Children.map(children, function (child) {
63
64
  return isValidElement(child)
64
65
  ? cloneElement(child, __assign({ invalid: hasError || undefined, ref: mergeRefs(inputRef, ref), accessibilityLabel: accessibilityLabel }, rest))
65
66
  : child;
66
- })),
67
- error ? React.createElement(ErrorText, null, error) : null)));
67
+ })))));
68
68
  });
@@ -28,12 +28,8 @@ import React from 'react';
28
28
  import { useBreakpoint } from '../../hooks';
29
29
  import styled, { css } from '../../styled.native';
30
30
  var StyledHeading1 = styled.Text(function (_a) {
31
- var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
32
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading1.fontWeight || heading.fontWeight, heading.color, heading.heading1.fontSize[smallAndUp ? 1 : 0], heading.heading1.lineHeight[smallAndUp ? 1 : 0], smallAndUp
33
- ? heading.heading1.marginTop[1]
34
- : heading.heading1.marginTop[0], smallAndUp
35
- ? heading.heading1.marginBottom[1]
36
- : heading.heading1.marginBottom[0]);
31
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
32
+ return 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.heading.native, core.fontSize.heading1[smallAndUp ? 'large' : 'small'], core.lineHeight.heading1[smallAndUp ? 'large' : 'small'], semantic.message.branded);
37
33
  });
38
34
  export var Heading1 = function (_a) {
39
35
  var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
@@ -41,12 +37,8 @@ export var Heading1 = function (_a) {
41
37
  return (React.createElement(StyledHeading1, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
42
38
  };
43
39
  var StyledHeading2 = styled.Text(function (_a) {
44
- var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
45
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading2.fontSize[smallAndUp ? 1 : 0], heading.heading2.lineHeight[smallAndUp ? 1 : 0], heading.heading2.fontWeight || heading.fontWeight, heading.color, smallAndUp
46
- ? heading.heading2.marginTop[1]
47
- : heading.heading2.marginTop[0], smallAndUp
48
- ? heading.heading2.marginBottom[1]
49
- : heading.heading2.marginBottom[0]);
40
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
41
+ return css(templateObject_2 || (templateObject_2 = __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.heading.native, core.fontSize.heading2[smallAndUp ? 'large' : 'small'], core.lineHeight.heading2[smallAndUp ? 'large' : 'small'], semantic.message.branded);
50
42
  });
51
43
  export var Heading2 = function (_a) {
52
44
  var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
@@ -54,12 +46,8 @@ export var Heading2 = function (_a) {
54
46
  return (React.createElement(StyledHeading2, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
55
47
  };
56
48
  var StyledHeading3 = styled.Text(function (_a) {
57
- var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
58
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading3.fontSize[smallAndUp ? 1 : 0], heading.heading3.lineHeight[smallAndUp ? 1 : 0], heading.heading3.fontWeight || heading.fontWeight, heading.color, smallAndUp
59
- ? heading.heading3.marginTop[1]
60
- : heading.heading3.marginTop[0], smallAndUp
61
- ? heading.heading3.marginBottom[1]
62
- : heading.heading3.marginBottom[0]);
49
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
50
+ return css(templateObject_3 || (templateObject_3 = __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.heading.native, core.fontSize.heading3[smallAndUp ? 'large' : 'small'], core.lineHeight.heading3[smallAndUp ? 'large' : 'small'], semantic.message.branded);
63
51
  });
64
52
  export var Heading3 = function (_a) {
65
53
  var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
@@ -67,12 +55,8 @@ export var Heading3 = function (_a) {
67
55
  return (React.createElement(StyledHeading3, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
68
56
  };
69
57
  var StyledHeading4 = styled.Text(function (_a) {
70
- var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
71
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading3.fontSize[smallAndUp ? 1 : 0], heading.heading3.lineHeight[smallAndUp ? 1 : 0], heading.heading4.fontWeight || heading.fontWeight, heading.color, smallAndUp
72
- ? heading.heading4.marginTop[1]
73
- : heading.heading4.marginTop[0], smallAndUp
74
- ? heading.heading4.marginBottom[1]
75
- : heading.heading4.marginBottom[0]);
58
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
59
+ return css(templateObject_4 || (templateObject_4 = __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.heading.native, core.fontSize.heading4[smallAndUp ? 'large' : 'small'], core.lineHeight.heading4[smallAndUp ? 'large' : 'small'], semantic.message.branded);
76
60
  });
77
61
  export var Heading4 = function (_a) {
78
62
  var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
@@ -8,7 +8,7 @@ import { styledComponentWithBreakpoints } from '../../utils';
8
8
  var StyledHintText = styled.Text(function (_a) {
9
9
  var field = _a.theme.field, smallAndUp = _a.smallAndUp;
10
10
  var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
11
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), field.fontFamily, field.hint.fontWeight, fontSize, calculateLineHeight(fontSize, field.lineHeight), field.hint.color);
11
+ return 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, calculateLineHeight(fontSize, field.lineHeight), field.hint.color);
12
12
  });
13
13
  var HintText = styledComponentWithBreakpoints(StyledHintText);
14
14
  export { HintText };
@@ -26,10 +26,10 @@ import { ThemeContext } from '../../styled.native';
26
26
  export var Icon = function (_a) {
27
27
  var name = _a.name, size = _a.size, color = _a.color, testID = _a.testID, rest = __rest(_a, ["name", "size", "color", "testID"]);
28
28
  var icons = useIcons();
29
- var colors = useContext(ThemeContext).colors;
29
+ var semantic = useContext(ThemeContext).semantic;
30
30
  // @ts-ignore to support additional icons.
31
31
  var Svg = name && icons[name];
32
32
  return Svg ? (React.createElement(Svg, __assign({ testID: testID ? testID : "element-icon".concat(name ? "-".concat(name) : ''),
33
33
  // @ts-ignore this is valid.
34
- color: color !== null && color !== void 0 ? color : colors.body, width: size, height: size }, rest))) : null;
34
+ color: color !== null && color !== void 0 ? color : semantic.message.base, width: size, height: size }, rest))) : null;
35
35
  };
@@ -24,25 +24,21 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  }
25
25
  return t;
26
26
  };
27
- import React, { useState, forwardRef, useContext } from 'react';
27
+ import React, { forwardRef, useState } from 'react';
28
28
  import { useBreakpoint } from '../../hooks';
29
- import styled, { css, ThemeContext } from '../../styled.native';
30
- import { pxToNumber } from '../../utils';
29
+ import styled, { css } from '../../styled.native';
31
30
  import { Icon } from '../Icon/Icon';
32
31
  var StyledIcon = styled(Icon)(function (_a) {
33
- var _b = _a.theme, input = _b.input, focusRing = _b.focusRing, side = _a.side, focused = _a.focused;
34
- var distance = (pxToNumber(input.height) - pxToNumber(input.icon.size)) / 2 +
35
- (focused ? pxToNumber(focusRing.distance) : 0);
36
- return 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") : '');
32
+ var core = _a.theme.core, side = _a.side, focused = _a.focused;
33
+ 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(core.space[2]) : '', side === 'right' ? "right: ".concat(core.space[2]) : '');
37
34
  });
38
35
  var Input = forwardRef(function (_a, ref) {
39
- var onFocus = _a.onFocus, onBlur = _a.onBlur, style = _a.style, iconLeft = _a.iconLeft, iconRight = _a.iconRight, rest = __rest(_a, ["onFocus", "onBlur", "style", "iconLeft", "iconRight"]);
36
+ 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"]);
40
37
  var _b = useState(false), focused = _b[0], setFocused = _b[1];
41
38
  var breakpoints = useBreakpoint();
42
- var input = useContext(ThemeContext).input;
43
39
  return (React.createElement(InputWrapper, { focused: focused },
44
- iconLeft ? (React.createElement(StyledIcon, { name: iconLeft, size: pxToNumber(input.icon.size), focused: focused, pointerEvents: "none", side: "left" })) : null,
45
- React.createElement(StyledInput, __assign({}, rest, breakpoints, { iconLeft: !!iconLeft, iconRight: !!iconRight, style: style,
40
+ iconLeft ? (React.createElement(StyledIcon, { name: iconLeft, size: 16, focused: focused, pointerEvents: "none", side: "left" })) : null,
41
+ React.createElement(StyledInput, __assign({}, rest, breakpoints, { iconLeft: !!iconLeft, iconRight: !!iconRight, hasRightSlot: !!rightSlot, style: style,
46
42
  // @ts-ignore
47
43
  ref: ref, onFocus: function (event) {
48
44
  setFocused(true);
@@ -55,22 +51,24 @@ var Input = forwardRef(function (_a, ref) {
55
51
  onBlur(event);
56
52
  }
57
53
  } })),
58
- iconRight ? (React.createElement(StyledIcon, { name: iconRight, size: pxToNumber(input.icon.size), focused: focused, pointerEvents: "none", side: "right" })) : null));
54
+ iconRight && !rightSlot ? (React.createElement(StyledIcon, { name: iconRight, size: 16, focused: focused, pointerEvents: "none", side: "right" })) : null,
55
+ rightSlot));
59
56
  });
60
57
  var InputWrapper = styled.View(function (_a) {
61
- var _b = _a.theme, input = _b.input, focusRing = _b.focusRing, focused = _a.focused;
62
- return 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
63
- ? "\n border-width: ".concat(focusRing.width, ";\n padding: ").concat(focusRing.distance, ";\n margin: -").concat(pxToNumber(focusRing.width) +
64
- pxToNumber(focusRing.distance), "px;")
58
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, focused = _a.focused;
59
+ 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 "])), core.radius.small, semantic.border.functional, focused
60
+ ? "\n border-width: ".concat(core.borderWidth.small, ";\n border-color: ").concat(semantic.focus.outline, ";\n padding: 2px;\n margin: -4px;")
65
61
  : null);
66
62
  });
67
63
  var StyledInput = styled.TextInput(function (_a) {
68
- var input = _a.theme.input, invalid = _a.invalid, smallAndUp = _a.smallAndUp, iconLeft = _a.iconLeft, iconRight = _a.iconRight;
69
- var fontSize = smallAndUp ? input.fontSize[1] : input.fontSize[0];
64
+ 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;
65
+ var fontSize = smallAndUp
66
+ ? core.fontSize.body.large
67
+ : core.fontSize.body.small;
70
68
  var errorStyles = invalid
71
- ? "\n border-width: ".concat(input.error.borderWidth, ";\n border-color: ").concat(input.error.color, ";\n ")
69
+ ? "\n border-color: ".concat(semantic.message.error, ";\n ")
72
70
  : '';
73
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\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 font-weight: ", ";\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.fontWeight, input.color, fontSize, input.height, input.borderWidth, input.borderColor, input.background, input.borderRadius, input.padding, iconLeft ? "padding-left: ".concat(input.height, ";") : '', iconRight ? "padding-right: ".concat(input.height, ";") : '', errorStyles);
71
+ 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: 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);
74
72
  });
75
73
  export { Input };
76
74
  var templateObject_1, templateObject_2, templateObject_3;
@@ -22,8 +22,10 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import React, { forwardRef } from 'react';
24
24
  import { Input } from './Input';
25
+ import { PasswordVisibilityToggle, useTogglePasswordVisibility, } from './PasswordVisibilityToggle';
25
26
  var PasswordInput = forwardRef(function (_a, ref) {
26
- var _b = _a.secureTextEntry, secureTextEntry = _b === void 0 ? true : _b, props = __rest(_a, ["secureTextEntry"]);
27
- return (React.createElement(Input, __assign({}, props, { keyboardType: "default", autoCapitalize: "none", autoCorrect: false, secureTextEntry: secureTextEntry, ref: ref })));
27
+ var props = __rest(_a, []);
28
+ var _b = useTogglePasswordVisibility(), isPasswordVisible = _b.isPasswordVisible, handlePasswordVisibility = _b.handlePasswordVisibility;
29
+ return (React.createElement(Input, __assign({}, props, { rightSlot: props.hasVisibilityToggle ? (React.createElement(PasswordVisibilityToggle, { iconName: isPasswordVisible ? 'hide' : 'show', visibilityToggleLabel: isPasswordVisible ? 'Hide password' : 'Show password', handlePasswordVisibility: handlePasswordVisibility })) : null, keyboardType: "default", autoCapitalize: "none", autoCorrect: false, blurOnSubmit: false, secureTextEntry: !isPasswordVisible, ref: ref })));
28
30
  });
29
31
  export { PasswordInput };
@@ -0,0 +1,11 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { Pressable } from 'react-native';
6
+ import styled, { css } from '../../styled.native';
7
+ export var StyledPressable = styled(Pressable)(function (_a) {
8
+ var core = _a.theme.core, focused = _a.focused;
9
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", ";\n right: ", ";\n "], ["\n display: flex;\n align-items: center;\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", ";\n right: ", ";\n "])), core.space[4], focused ? '16px' : '14px', core.space[3]);
10
+ });
11
+ var templateObject_1;
@@ -0,0 +1,23 @@
1
+ import React, { useState } from 'react';
2
+ import { Icon } from '../Icon';
3
+ import { StyledPressable } from './PasswordInput.styled';
4
+ export var useTogglePasswordVisibility = function () {
5
+ var _a = useState(false), isPasswordVisible = _a[0], setIsPasswordVisible = _a[1];
6
+ var handlePasswordVisibility = function () {
7
+ setIsPasswordVisible(!isPasswordVisible);
8
+ };
9
+ return {
10
+ isPasswordVisible: isPasswordVisible,
11
+ handlePasswordVisibility: handlePasswordVisibility,
12
+ };
13
+ };
14
+ export var PasswordVisibilityToggle = function (_a) {
15
+ var iconName = _a.iconName, visibilityToggleLabel = _a.visibilityToggleLabel, handlePasswordVisibility = _a.handlePasswordVisibility;
16
+ var _b = useState(false), focused = _b[0], setFocused = _b[1];
17
+ return (React.createElement(StyledPressable, { testID: "password-input-visibility-toggle", focused: focused, accessibilityRole: "button", accessibilityLabel: visibilityToggleLabel, onPress: handlePasswordVisibility, hitSlop: 16, onFocus: function () {
18
+ setFocused(true);
19
+ }, onBlur: function () {
20
+ setFocused(false);
21
+ } },
22
+ React.createElement(Icon, { name: iconName, size: 16, pointerEvents: "none" })));
23
+ };
@@ -11,5 +11,5 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import React, { forwardRef } from 'react';
13
13
  import { Input } from './Input';
14
- var TelInput = forwardRef(function (props, ref) { return (React.createElement(Input, __assign({}, props, { keyboardType: "phone-pad", autoCapitalize: "none", autoCorrect: false, ref: ref }))); });
15
- export { TelInput };
14
+ var PhoneInput = forwardRef(function (props, ref) { return (React.createElement(Input, __assign({}, props, { keyboardType: "phone-pad", autoCapitalize: "none", autoCorrect: false, ref: ref }))); });
15
+ export { PhoneInput };
@@ -1,3 +1,7 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
1
5
  var __assign = (this && this.__assign) || function () {
2
6
  __assign = Object.assign || function(t) {
3
7
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -21,18 +25,16 @@ var __rest = (this && this.__rest) || function (s, e) {
21
25
  return t;
22
26
  };
23
27
  import React, { forwardRef } from 'react';
24
- import { useBreakpoint } from '../../hooks';
25
- import { useTheme } from '../../styled.native';
26
- import { calculateLineHeight } from '../../theme';
28
+ import styled, { css } from '../../styled.native';
27
29
  import { pxToNumber } from '../../utils';
28
30
  import { Input } from './Input';
31
+ var StyledInput = styled(Input)(function (_a) {
32
+ var core = _a.theme.core, rows = _a.rows;
33
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", " ", " ", " ", ";\n height: ", "px;\n "], ["\n padding: ", " ", " ", " ", ";\n height: ", "px;\n "])), core.space[3], core.space[2], core.space[2], core.space[2], pxToNumber(core.space[8]) * rows);
34
+ });
29
35
  var TextareaInput = forwardRef(function (_a, ref) {
30
36
  var _b = _a.rows, rows = _b === void 0 ? 3 : _b, rest = __rest(_a, ["rows"]);
31
- var input = useTheme().input;
32
- var smallAndUp = useBreakpoint().smallAndUp;
33
- var height = pxToNumber(input.padding) * 2 +
34
- pxToNumber(calculateLineHeight(smallAndUp ? input.fontSize[1] : input.fontSize[0], input.lineHeight)) *
35
- rows;
36
- return (React.createElement(Input, __assign({}, rest, { keyboardType: "default", multiline: true, textAlignVertical: "top", style: { height: height }, ref: ref })));
37
+ return (React.createElement(StyledInput, __assign({}, rest, { keyboardType: "default", multiline: true, textAlignVertical: "top", rows: rows, ref: ref })));
37
38
  });
38
39
  export { TextareaInput };
40
+ var templateObject_1;
@@ -1,7 +1,7 @@
1
1
  export { CurrencyInput } from './CurrencyInput';
2
2
  export { EmailInput } from './EmailInput';
3
3
  export { NumberInput } from './NumberInput';
4
- export { TelInput } from './TelInput';
4
+ export { PhoneInput } from './PhoneInput';
5
5
  export { TextInput } from './TextInput';
6
6
  export { PasswordInput } from './PasswordInput';
7
7
  export { TextareaInput } from './TextareaInput';
@@ -8,7 +8,7 @@ import { styledComponentWithBreakpoints } from '../../utils';
8
8
  var StyledLabelText = styled.Text(function (_a) {
9
9
  var field = _a.theme.field, smallAndUp = _a.smallAndUp;
10
10
  var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
11
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n "])), field.label.fontFamily, calculateLineHeight(fontSize, field.lineHeight), field.label.fontWeight, field.label.color, fontSize);
11
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), field.label.fontFamily, calculateLineHeight(fontSize, field.lineHeight), field.label.color, fontSize);
12
12
  });
13
13
  var LabelText = styledComponentWithBreakpoints(StyledLabelText);
14
14
  export { LabelText };
@@ -46,7 +46,7 @@ var StyledBullet = styled.Text(function (_a) {
46
46
  var lineHeight = smallAndUp
47
47
  ? list.listItem.lineHeight[1]
48
48
  : list.listItem.lineHeight[0];
49
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "])), text.fontFamily, lineHeight, text.fontWeight, text.color, fontSize, list.listItem.bulletGap, space[4]);
49
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "])), text.fontFamily, lineHeight, text.color, fontSize, list.listItem.bulletGap, space[4]);
50
50
  });
51
51
  var StyledUlItem = styled.View(function () { return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: flex-start;\n justify-content: center;\n "], ["\n flex-direction: row;\n align-items: flex-start;\n justify-content: center;\n "]))); });
52
52
  var Bullet = styledComponentWithBreakpoints(StyledBullet);
@@ -87,9 +87,13 @@ var StyledLi = styled.Text(function (_a) {
87
87
  var lineHeight = smallAndUp
88
88
  ? list.listItem.lineHeight[1]
89
89
  : list.listItem.lineHeight[0];
90
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, lineHeight, text.fontWeight, text.color, fontSize);
90
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, lineHeight, text.color, fontSize);
91
91
  });
92
92
  var Li = styledComponentWithBreakpoints(StyledLi);
93
+ /**
94
+ * @deprecated This component has been deprecated and will be removed in a future release.
95
+ * Please use the DescriptionList component instead.
96
+ * */
93
97
  var Dl = ListWrapper;
94
98
  var StyledDtText = styled.Text(function (_a) {
95
99
  var list = _a.theme.list, smallAndUp = _a.smallAndUp;
@@ -99,7 +103,7 @@ var StyledDtText = styled.Text(function (_a) {
99
103
  var lineHeight = smallAndUp
100
104
  ? list.listItem.lineHeight[1]
101
105
  : list.listItem.lineHeight[0];
102
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), list.descriptionTerm.fontFamily, list.descriptionTerm.fontWeight, lineHeight, list.descriptionTerm.color, fontSize);
106
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), list.descriptionTerm.fontFamily, lineHeight, list.descriptionTerm.color, fontSize);
103
107
  });
104
108
  var DtText = styledComponentWithBreakpoints(StyledDtText);
105
109
  var StyledDtItem = styled.View(function (_a) {
@@ -113,6 +117,10 @@ var StyledDtItem = styled.View(function (_a) {
113
117
  return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "])), marginTop, marginBottom);
114
118
  });
115
119
  var DtItem = styledComponentWithBreakpoints(StyledDtItem);
120
+ /**
121
+ * @deprecated This component has been deprecated and will be removed in a future release.
122
+ * Please use the DescriptionList component instead.
123
+ * */
116
124
  var Dt = function (_a) {
117
125
  var children = _a.children, rest = __rest(_a, ["children"]);
118
126
  return (React.createElement(DtItem, __assign({}, rest),
@@ -126,13 +134,17 @@ var StyledDdText = styled.Text(function (_a) {
126
134
  var lineHeight = smallAndUp
127
135
  ? list.listItem.lineHeight[1]
128
136
  : list.listItem.lineHeight[0];
129
- return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, lineHeight, text.fontWeight, text.color, fontSize);
137
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, lineHeight, text.color, fontSize);
130
138
  });
139
+ /**
140
+ * @deprecated This component has been deprecated and will be removed in a future release.
141
+ * Please use the DescriptionList component instead.
142
+ * */
131
143
  var Dd = function (_a) {
132
144
  var children = _a.children, rest = __rest(_a, ["children"]);
133
145
  var breakpoints = useBreakpoint();
134
146
  return (React.createElement(View, __assign({ style: { flexDirection: 'row' } }, rest),
135
147
  React.createElement(StyledDdText, __assign({}, breakpoints), children)));
136
148
  };
137
- export { Ul, Ol, Li, Dl, Dt, Dd };
149
+ export { Ul, Ol, Li, Dl, Dt, Dd, ListWrapper };
138
150
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -3,7 +3,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import React from 'react';
6
- import { TouchableOpacity } from 'react-native';
6
+ import { TouchableOpacity, View } from 'react-native';
7
7
  import Animated, { FadeIn, FadeOut, Layout } from 'react-native-reanimated';
8
8
  import { Path, Svg } from 'react-native-svg';
9
9
  import styled, { css } from '../../styled.native';
@@ -13,37 +13,36 @@ var BackIcon = function () {
13
13
  React.createElement(Path, { d: "M0.579956 8L8.57996 16L9.99996 14.58L3.41996 8L9.99996 1.42L8.57996 0L0.579956 8Z", fill: "white" })));
14
14
  };
15
15
  var StyledText = styled.Text(function (_a) {
16
- var _b = _a.theme, colors = _b.colors, fonts = _b.fonts, fontWeights = _b.fontWeights, fontSizes = _b.fontSizes;
17
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-family: ", ";\n "], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-family: ", ";\n "])), colors.primaryContrast, fontSizes[1], fontWeights.normal, fonts.body);
16
+ var _b = _a.theme, colors = _b.colors, fonts = _b.fonts, fontSizes = _b.fontSizes;
17
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "], ["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "])), colors.primaryContrast, fontSizes[1], fonts.body);
18
18
  });
19
19
  var LeftHeaderText = styled(StyledText)(function (_a) {
20
20
  var space = _a.theme.space;
21
21
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n "], ["\n padding-left: ", ";\n "])), space[2]);
22
22
  });
23
- var FeedbackText = styled(StyledText)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
24
23
  var HeadlineView = styled(Animated.View)(function (_a) {
25
24
  var space = _a.theme.space;
26
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 0 ", " ", ";\n "], ["\n padding: 0 ", " ", ";\n "])), space[3], space[3]);
25
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 0 ", " ", ";\n "], ["\n padding: 0 ", " ", ";\n "])), space[3], space[3]);
27
26
  });
28
27
  var RootView = styled.View(function (_a) {
29
28
  var colors = _a.theme.colors;
30
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n "], ["\n background-color: ", ";\n overflow: hidden;\n "])), colors.primary);
29
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n "], ["\n background-color: ", ";\n overflow: hidden;\n "])), colors.primary);
31
30
  });
32
31
  var StyledView = styled(Animated.View)(function (_a) {
33
32
  var space = _a.theme.space, marginTop = _a.marginTop;
34
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "], ["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "])), space[3], space[2], marginTop !== null && marginTop !== void 0 ? marginTop : 0);
33
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "], ["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "])), space[3], space[2], marginTop !== null && marginTop !== void 0 ? marginTop : 0);
35
34
  });
36
35
  var StyledHeading4 = styled(Heading4)(function (_a) {
37
- var _b = _a.theme, fonts = _b.fonts, fontWeights = _b.fontWeights, colors = _b.colors, textAlign = _a.textAlign;
38
- return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "])), fonts.bold, fontWeights.bold, colors.primaryContrast, textAlign);
36
+ var _b = _a.theme, fonts = _b.fonts, colors = _b.colors, textAlign = _a.textAlign;
37
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "], ["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "])), fonts.bold, colors.primaryContrast, textAlign);
39
38
  });
40
39
  var StyledHeading3 = styled(Heading3)(function (_a) {
41
40
  var colors = _a.theme.colors;
42
- return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "], ["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "])), colors.primaryContrast);
41
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "], ["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "])), colors.primaryContrast);
43
42
  });
44
43
  export var NavHeader = function (_a) {
45
44
  var options = _a.options, headline = _a.headline;
46
- return (React.createElement(RootView, { layout: Layout.duration(150) },
45
+ return (React.createElement(RootView, { layout: Layout === null || Layout === void 0 ? void 0 : Layout.duration(150) },
47
46
  React.createElement(StyledView, { marginTop: options === null || options === void 0 ? void 0 : options.statusBarHeight },
48
47
  (options === null || options === void 0 ? void 0 : options.headerLeft) ? (options === null || options === void 0 ? void 0 : options.headerLeft()) : (options === null || options === void 0 ? void 0 : options.canGoBack()) ? (React.createElement(TouchableOpacity, { style: {
49
48
  flexDirection: 'row',
@@ -56,8 +55,7 @@ export var NavHeader = function (_a) {
56
55
  React.createElement(LeftHeaderText, null, "Back"))) : null,
57
56
  React.createElement(Animated.View, { entering: FadeIn, exiting: FadeOut, style: { flex: 1, flexGrow: 3, flexShrink: 1 } },
58
57
  React.createElement(StyledHeading4, { textAlign: (options === null || options === void 0 ? void 0 : options.canGoBack()) ? 'center' : 'left', numberOfLines: 1 }, !headline ? options === null || options === void 0 ? void 0 : options.title : ' ')),
59
- React.createElement(TouchableOpacity, { style: { flex: 1, flexGrow: 1, flexShrink: 1 } },
60
- React.createElement(FeedbackText, null, "Feedback"))),
58
+ React.createElement(View, { style: { flex: 1, flexGrow: 1, flexShrink: 1 } }, options.headerRight ? options.headerRight() : null)),
61
59
  headline ? (React.createElement(HeadlineView, { entering: FadeIn, exiting: FadeOut }, (options === null || options === void 0 ? void 0 : options.title) ? (React.createElement(StyledHeading3, null, options.title)) : null)) : null));
62
60
  };
63
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
61
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -24,69 +24,57 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  }
25
25
  return t;
26
26
  };
27
- import React, { forwardRef, useContext, useState, } from 'react';
27
+ import React, { forwardRef, useState } from 'react';
28
28
  import { View } from 'react-native';
29
- import { useBreakpoint } from '../../hooks';
30
- import styled, { css, ThemeContext } from '../../styled.native';
29
+ import styled, { css } from '../../styled.native';
31
30
  import { Icon } from '../Icon';
32
- var pxToNumber = function (value) { return parseInt(value.replace('px', '')); };
33
- var numberToPx = function (value) { return "".concat(value, "px"); };
34
31
  var NotificationBox = styled.View(function (_a) {
35
- var _b = _a.theme, colors = _b.colors, notification = _b.notification, space = _b.space, variant = _a.variant, noMargin = _a.noMargin;
36
- // @ts-ignore
37
- var currentVariant = notification.variants[variant];
38
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "])), notification.borderWidth, currentVariant.borderColor, notification.borderRadius, noMargin ? 0 : space[4], colors.canvas);
32
+ var core = _a.theme.core, noMargin = _a.noMargin;
33
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n "])), core.borderWidth.medium, core.color.brand.white, core.radius.small, noMargin ? 0 : core.space[4]);
39
34
  });
40
35
  export var NotificationContentBox = styled.View(function (_a) {
41
- var _b = _a.theme, colors = _b.colors, _c = _b.notification, paddingX = _c.paddingX, paddingY = _c.paddingY, variants = _c.variants, smallAndUp = _a.smallAndUp, variant = _a.variant;
42
- // @ts-ignore
43
- var currentVariant = variants[variant];
44
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "], ["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "])), paddingX[smallAndUp ? 1 : 0], paddingY[smallAndUp ? 1 : 0], currentVariant.textColor, colors.body, currentVariant.textColor);
36
+ var core = _a.theme.core;
37
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), core.color.brand.white, core.space[2], core.space[3], core.space[4], core.space[4]);
45
38
  });
46
39
  export var NotificationTitleBox = styled.View(function (_a) {
47
- var notification = _a.theme.notification, variant = _a.variant, dismissable = _a.dismissable, smallAndUp = _a.smallAndUp;
48
- // @ts-ignore to support additional palettes.
49
- var currentVariant = notification.variants[variant];
50
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.background, notification.paddingX[smallAndUp ? 1 : 0], notification.paddingX[smallAndUp ? 1 : 0], notification.paddingY[smallAndUp ? 1 : 0], dismissable
51
- ? numberToPx(pxToNumber(notification.dismiss.touchSize) -
52
- pxToNumber(notification.dismiss.size))
53
- : notification.paddingY[smallAndUp ? 1 : 0]);
40
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, variant = _a.variant, dismissible = _a.dismissible;
41
+ var currentVariant = semantic[variant];
42
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.surface, core.space[2], core.space[2], core.space[4], dismissible ? core.space[3] : core.space[4]);
54
43
  });
55
44
  var NotificationTitleText = styled.Text(function (_a) {
56
- var _b = _a.theme, fonts = _b.fonts, fontWeights = _b.fontWeights, responsiveFontSizes = _b.responsiveFontSizes, notification = _b.notification, variant = _a.variant;
57
- // @ts-ignore
58
- var currentVariant = notification.variants[variant];
59
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n "])), currentVariant.textColor, fonts.bold, fontWeights.bold, responsiveFontSizes.body[0]);
45
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, variant = _a.variant;
46
+ var currentVariant = semantic[variant];
47
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "])), core.fontSize.body.small, core.fontFamily.bodyBold.native, currentVariant.message);
60
48
  });
61
- var DismissButton = styled.TouchableOpacity(function (_a) {
62
- var notification = _a.theme.notification;
63
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "], ["\n position: absolute;\n top: 0;\n right: 0;\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "])), notification.dismiss.touchSize, notification.dismiss.touchSize);
49
+ var DismissButton = styled.TouchableOpacity(function () {
50
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 16px;\n height: 16px;\n margin-left: auto;\n "], ["\n width: 16px;\n height: 16px;\n margin-left: auto;\n "])));
51
+ });
52
+ var StyledIcon = styled(Icon)(function (_a) {
53
+ var semantic = _a.theme.semantic, variant = _a.variant;
54
+ var currentVariant = semantic[variant];
55
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), currentVariant.message);
64
56
  });
65
57
  export var Notification = forwardRef(function (_a, ref) {
66
- var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissable = _a.dismissable, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissable", "onDismiss"]);
67
- var breakpoints = useBreakpoint();
68
- var theme = useContext(ThemeContext);
58
+ var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissible = _a.dismissible, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissible", "onDismiss"]);
69
59
  var _c = useState(false), dismissed = _c[0], setDismissed = _c[1];
70
- if (dismissed || (!title && !children)) {
60
+ if (dismissed || !children) {
71
61
  return null;
72
62
  }
73
63
  return (React.createElement(View, __assign({ ref: ref }, rest),
74
- React.createElement(NotificationBox, __assign({ variant: variant, noMargin: noMargin, testID: "nb-notification" }, breakpoints),
75
- !!title ? (React.createElement(NotificationTitleBox, __assign({ variant: variant, dismissable: dismissable }, breakpoints),
76
- React.createElement(View, null, typeof title === 'string' ? (React.createElement(NotificationTitleText, { variant: variant }, title)) : (title)))) : null,
77
- dismissable ? (React.createElement(DismissButton, { accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
78
- setDismissed(true);
79
- if (onDismiss) {
80
- onDismiss();
81
- }
82
- } },
83
- React.createElement(Icon, { name: theme.notification.dismiss.icon, size: theme.notification.dismiss.size,
84
- // @ts-ignore
85
- color: theme.notification.variants[variant].textColor }))) : null,
86
- children ? (React.createElement(NotificationContentBox, __assign({ "data-testid": "el-notification-box", variant: variant }, breakpoints), children)) : null)));
64
+ React.createElement(NotificationBox, { noMargin: noMargin, testID: "nb-notification" },
65
+ React.createElement(NotificationTitleBox, { variant: variant, dismissible: dismissible },
66
+ React.createElement(NotificationTitleText, { variant: variant }, title),
67
+ dismissible ? (React.createElement(DismissButton, { accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
68
+ setDismissed(true);
69
+ if (onDismiss) {
70
+ onDismiss();
71
+ }
72
+ } },
73
+ React.createElement(StyledIcon, { variant: variant, name: "cross", size: "16" }))) : null),
74
+ children ? (React.createElement(NotificationContentBox, { "data-testid": "el-notification-box" }, children)) : null)));
87
75
  });
88
- export var ErrorNotification = forwardRef(function (props, ref) { return (React.createElement(Notification, __assign({ ref: ref, variant: "error", title: "Oops, there\u2019s a problem\u2026" }, props))); });
76
+ export var ErrorNotification = forwardRef(function (props, ref) { return React.createElement(Notification, __assign({ ref: ref, variant: "error" }, props)); });
89
77
  export var SuccessNotification = forwardRef(function (props, ref) { return (React.createElement(Notification, __assign({ ref: ref, variant: "success" }, props))); });
90
78
  export var InfoNotification = forwardRef(function (props, ref) { return React.createElement(Notification, __assign({ ref: ref, variant: "info" }, props)); });
91
79
  export var WarningNotification = forwardRef(function (props, ref) { return React.createElement(Notification, __assign({ ref: ref, variant: "warning" }, props)); });
92
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
80
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;