@ovotech/element-native 2.1.0 → 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 (147) hide show
  1. package/dist/components/Accordion/Accordion.js +20 -19
  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/Badge/Badge.d.ts +237 -8
  6. package/dist/components/Badge/Badge.js +35 -16
  7. package/dist/components/CTAButton/CTAButton.d.ts +7 -12
  8. package/dist/components/CTAButton/CTAButton.js +18 -19
  9. package/dist/components/CTALink/CTALink.d.ts +3 -3
  10. package/dist/components/Card/Card.d.ts +228 -5
  11. package/dist/components/Card/Card.js +5 -25
  12. package/dist/components/Checkbox/Checkbox.js +14 -19
  13. package/dist/components/DataTable/DataTable.d.ts +3 -12
  14. package/dist/components/DataTable/DataTable.js +8 -71
  15. package/dist/components/DataTable/TableRow.d.ts +2 -0
  16. package/dist/components/DataTable/TableRow.js +33 -0
  17. package/dist/components/DataTable/index.d.ts +2 -0
  18. package/dist/components/DataTable/index.js +16 -0
  19. package/dist/components/DataTable/styles.d.ts +2517 -0
  20. package/dist/components/DataTable/styles.js +77 -0
  21. package/dist/components/DataTable/types.d.ts +15 -0
  22. package/dist/components/DataTable/types.js +2 -0
  23. package/dist/components/DateField/DateField.js +9 -9
  24. package/dist/components/DescriptionList/DescriptionList.d.ts +10 -0
  25. package/dist/components/DescriptionList/DescriptionList.js +66 -0
  26. package/dist/components/DescriptionList/index.d.ts +1 -0
  27. package/dist/components/DescriptionList/index.js +6 -0
  28. package/dist/components/DescriptionList/styled.d.ts +241 -0
  29. package/dist/components/DescriptionList/styled.js +88 -0
  30. package/dist/components/Disclosure/Disclosure.js +7 -10
  31. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
  32. package/dist/components/ErrorText/ErrorText.d.ts +228 -1
  33. package/dist/components/ErrorText/ErrorText.js +1 -1
  34. package/dist/components/Field/Field.js +3 -3
  35. package/dist/components/Grid/Col.d.ts +228 -1
  36. package/dist/components/Grid/Row.d.ts +228 -1
  37. package/dist/components/Heading/Heading.js +8 -24
  38. package/dist/components/HintText/HintText.d.ts +228 -1
  39. package/dist/components/HintText/HintText.js +1 -1
  40. package/dist/components/Icon/Icon.d.ts +2 -3
  41. package/dist/components/Icon/Icon.js +2 -2
  42. package/dist/components/Input/Input.d.ts +1 -1
  43. package/dist/components/Input/Input.js +13 -16
  44. package/dist/components/Input/PasswordInput.styled.d.ts +228 -1
  45. package/dist/components/Input/PasswordInput.styled.js +2 -5
  46. package/dist/components/Input/PasswordVisibilityToggle.js +2 -5
  47. package/dist/components/Input/{TelInput.d.ts → PhoneInput.d.ts} +2 -2
  48. package/dist/components/Input/{TelInput.js → PhoneInput.js} +3 -3
  49. package/dist/components/Input/TextareaInput.js +11 -9
  50. package/dist/components/Input/index.d.ts +1 -1
  51. package/dist/components/Input/index.js +3 -3
  52. package/dist/components/LabelText/LabelText.d.ts +228 -1
  53. package/dist/components/LabelText/LabelText.js +1 -1
  54. package/dist/components/List/List.d.ts +706 -3
  55. package/dist/components/List/List.js +18 -5
  56. package/dist/components/Margin/Margin.d.ts +228 -1
  57. package/dist/components/NavHeader/NavHeader.js +4 -4
  58. package/dist/components/Notification/Notification.d.ts +466 -20
  59. package/dist/components/Notification/Notification.js +32 -44
  60. package/dist/components/Radio/Radio.js +13 -29
  61. package/dist/components/SelectField/Select.d.ts +244 -0
  62. package/dist/components/SelectField/Select.js +101 -0
  63. package/dist/components/SelectField/SelectField.d.ts +7 -0
  64. package/dist/components/SelectField/SelectField.js +38 -0
  65. package/dist/components/SelectField/index.d.ts +1 -0
  66. package/dist/components/SelectField/index.js +5 -0
  67. package/dist/components/SkeletonLoading/Skeleton.d.ts +228 -1
  68. package/dist/components/SubLabelText/SubLabelText.d.ts +228 -1
  69. package/dist/components/SubLabelText/SubLabelText.js +1 -1
  70. package/dist/components/SummaryList/SummaryList.d.ts +4 -0
  71. package/dist/components/SummaryList/SummaryList.js +5 -0
  72. package/dist/components/Tabs/Tab.js +22 -19
  73. package/dist/components/Tabs/TabList.d.ts +11 -1
  74. package/dist/components/Tabs/TabList.js +19 -16
  75. package/dist/components/Tabs/TabPanel.js +32 -6
  76. package/dist/components/Tabs/Tabs.d.ts +8 -6
  77. package/dist/components/Tabs/Tabs.js +10 -6
  78. package/dist/components/Text/Text.d.ts +1140 -5
  79. package/dist/components/Text/Text.js +6 -10
  80. package/dist/components/TextField/PhoneField.d.ts +10 -0
  81. package/dist/components/TextField/PhoneField.js +56 -0
  82. package/dist/components/TextField/TelField.d.ts +4 -0
  83. package/dist/components/TextField/TelField.js +7 -2
  84. package/dist/components/TextField/index.d.ts +1 -0
  85. package/dist/components/TextField/index.js +3 -1
  86. package/dist/components/TextLink/TextLink.js +2 -2
  87. package/dist/components/index.d.ts +2 -0
  88. package/dist/components/index.js +2 -0
  89. package/dist/esm/components/Accordion/Accordion.js +23 -22
  90. package/dist/esm/components/Accordion/Icon.js +8 -8
  91. package/dist/esm/components/Accordion/styles.js +29 -48
  92. package/dist/esm/components/Badge/Badge.js +35 -16
  93. package/dist/esm/components/CTAButton/CTAButton.js +20 -21
  94. package/dist/esm/components/Card/Card.js +5 -25
  95. package/dist/esm/components/Checkbox/Checkbox.js +12 -20
  96. package/dist/esm/components/DataTable/DataTable.js +3 -66
  97. package/dist/esm/components/DataTable/TableRow.js +26 -0
  98. package/dist/esm/components/DataTable/index.js +2 -0
  99. package/dist/esm/components/DataTable/styles.js +51 -0
  100. package/dist/esm/components/DataTable/types.js +1 -0
  101. package/dist/esm/components/DateField/DateField.js +9 -9
  102. package/dist/esm/components/DescriptionList/DescriptionList.js +39 -0
  103. package/dist/esm/components/DescriptionList/index.js +1 -0
  104. package/dist/esm/components/DescriptionList/styled.js +57 -0
  105. package/dist/esm/components/Disclosure/Disclosure.js +9 -12
  106. package/dist/esm/components/ErrorText/ErrorText.js +1 -1
  107. package/dist/esm/components/Field/Field.js +3 -3
  108. package/dist/esm/components/Heading/Heading.js +8 -24
  109. package/dist/esm/components/HintText/HintText.js +1 -1
  110. package/dist/esm/components/Icon/Icon.js +2 -2
  111. package/dist/esm/components/Input/Input.js +15 -18
  112. package/dist/esm/components/Input/PasswordInput.styled.js +2 -5
  113. package/dist/esm/components/Input/PasswordVisibilityToggle.js +3 -6
  114. package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +2 -2
  115. package/dist/esm/components/Input/TextareaInput.js +11 -9
  116. package/dist/esm/components/Input/index.js +1 -1
  117. package/dist/esm/components/LabelText/LabelText.js +1 -1
  118. package/dist/esm/components/List/List.js +17 -5
  119. package/dist/esm/components/NavHeader/NavHeader.js +4 -4
  120. package/dist/esm/components/Notification/Notification.js +34 -46
  121. package/dist/esm/components/Radio/Radio.js +13 -29
  122. package/dist/esm/components/SelectField/Select.js +74 -0
  123. package/dist/esm/components/SelectField/SelectField.js +31 -0
  124. package/dist/esm/components/SelectField/index.js +1 -0
  125. package/dist/esm/components/SubLabelText/SubLabelText.js +1 -1
  126. package/dist/esm/components/SummaryList/SummaryList.js +5 -0
  127. package/dist/esm/components/Tabs/Tab.js +22 -16
  128. package/dist/esm/components/Tabs/TabList.js +18 -16
  129. package/dist/esm/components/Tabs/TabPanel.js +9 -6
  130. package/dist/esm/components/Tabs/Tabs.js +9 -6
  131. package/dist/esm/components/Text/Text.js +6 -10
  132. package/dist/esm/components/TextField/PhoneField.js +30 -0
  133. package/dist/esm/components/TextField/TelField.js +7 -2
  134. package/dist/esm/components/TextField/index.js +1 -0
  135. package/dist/esm/components/TextLink/TextLink.js +2 -2
  136. package/dist/esm/components/index.js +2 -0
  137. package/dist/esm/providers/icons/Logo.js +6 -3
  138. package/dist/esm/theme/create-theme.js +2 -176
  139. package/dist/esm/theme/index.js +13 -2
  140. package/dist/providers/icons/Logo.js +5 -2
  141. package/dist/styled.native.d.ts +1363 -1
  142. package/dist/theme/create-theme.d.ts +1 -1
  143. package/dist/theme/create-theme.js +2 -176
  144. package/dist/theme/index.d.ts +228 -2
  145. package/dist/theme/index.js +13 -2
  146. package/dist/theme/theme.d.ts +1 -110
  147. package/package.json +9 -6
@@ -24,9 +24,9 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  }
25
25
  return t;
26
26
  };
27
- import React, { forwardRef, useContext, } from 'react';
27
+ import React, { forwardRef } from 'react';
28
28
  import { TouchableOpacity, View, } from 'react-native';
29
- import styled, { ThemeContext } from '../../styled.native';
29
+ import styled from '../../styled.native';
30
30
  import { pxToNumber } from '../../utils';
31
31
  import { ErrorText } from '../ErrorText';
32
32
  import { FormGroup } from '../FormGroup';
@@ -41,27 +41,19 @@ var StyledCheckboxInputWrapper = styled.View(function (_a) {
41
41
  return "\n width: ".concat(checkboxSize + gap, "px;\n height: ").concat(checkbox.touchSize, ";\n ");
42
42
  });
43
43
  var StyledCheckboxInput = styled.View(function (_a) {
44
- var checkbox = _a.theme.checkbox, invalid = _a.invalid, checked = _a.checked;
45
- var touchSize = pxToNumber(checkbox.touchSize);
46
- var checkboxSize = pxToNumber(checkbox.size);
47
- var checkboxDistance = (touchSize - checkboxSize) / 2;
48
- return "\n width: ".concat(checkbox.size, ";\n height: ").concat(checkbox.size, ";\n border: ").concat(checkbox.borderWidth, " solid;\n margin-top: ").concat(checkboxDistance, "px;\n border-radius: ").concat(checkbox.borderRadius, ";\n border-color: ").concat(invalid
49
- ? checkbox.errorColor
44
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
45
+ return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n border: ").concat(core.borderWidth.small, " solid;\n margin-top: 10px;\n border-radius: ").concat(core.radius.small, ";\n border-color: ").concat(invalid
46
+ ? semantic.error.border
50
47
  : checked
51
- ? checkbox.checkColor
52
- : checkbox.borderColor, ";\n background: ").concat(checked ? checkbox.checkedBackground : checkbox.background, ";\n ");
48
+ ? core.color.blue.dark
49
+ : semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
53
50
  });
54
51
  var CheckboxCheck = function (props) {
55
- var checkbox = useContext(ThemeContext).checkbox;
56
- return (React.createElement(Icon, __assign({ name: "check", size: pxToNumber(checkbox.checkSize), color: checkbox.checkColor }, props)));
52
+ return React.createElement(Icon, __assign({ name: "check", size: 16 }, props));
57
53
  };
58
54
  var StyledCheckboxInputCheck = styled(CheckboxCheck)(function (_a) {
59
- var checkbox = _a.theme.checkbox, checked = _a.checked;
60
- var checkboxSize = pxToNumber(checkbox.size);
61
- var checkSize = pxToNumber(checkbox.checkSize);
62
- var borderWidth = pxToNumber(checkbox.borderWidth);
63
- var checkDistance = (checkboxSize - checkSize) / 2 - borderWidth;
64
- return "\n margin-top: ".concat(checkDistance, "px;\n margin-left: ").concat(checkDistance, "px;\n opacity: ").concat(checked ? 1 : 0, ";\n ");
55
+ var core = _a.theme.core, checked = _a.checked;
56
+ return "\n margin-top: 3px;\n margin-left: 3px;\n color: ".concat(core.color.blue.dark, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
65
57
  });
66
58
  var Input = function (_a) {
67
59
  var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
@@ -70,8 +62,8 @@ var Input = function (_a) {
70
62
  React.createElement(StyledCheckboxInputCheck, { checked: checked }))));
71
63
  };
72
64
  var CheckLabelText = styled(LabelText)(function (_a) {
73
- var checkbox = _a.theme.checkbox;
74
- return "\n padding-top: ".concat(checkbox.paddingTop, ";\n ");
65
+ var core = _a.theme.core;
66
+ return "\n padding-top: ".concat(core.space[3], ";\n ");
75
67
  });
76
68
  var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
77
69
  var Checkbox = forwardRef(function (_a, ref) {
@@ -1,7 +1,3 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
1
  var __assign = (this && this.__assign) || function () {
6
2
  __assign = Object.assign || function(t) {
7
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -27,8 +23,9 @@ var __rest = (this && this.__rest) || function (s, e) {
27
23
  import React, { forwardRef } from 'react';
28
24
  import { ScrollView } from 'react-native';
29
25
  import { useBreakpoint } from '../../hooks';
30
- import styled, { css } from '../../styled.native';
31
26
  import { getText } from '../../utils';
27
+ import { TableRow } from './TableRow';
28
+ import { StyledTableContainer, TableBody, TableCaption, TableCaptionText, TableHeader, TableHeaderText, TableRowHeading, } from './styles';
32
29
  export var DataTable = forwardRef(function (_a, ref) {
33
30
  var items = _a.items, columnHeadings = _a.columnHeadings, caption = _a.caption, rowHeadings = _a.rowHeadings, columnWidths = _a.columnWidths, _b = _a.striped, striped = _b === void 0 ? true : _b, rest = __rest(_a, ["items", "columnHeadings", "caption", "rowHeadings", "columnWidths", "striped"]);
34
31
  var breakpoints = useBreakpoint();
@@ -44,65 +41,5 @@ export var DataTable = forwardRef(function (_a, ref) {
44
41
  React.createElement(TableCaptionText, __assign({}, breakpoints, { accessibilityLabel: accessibilityLabel }), caption))) : null,
45
42
  columnHeadings ? (React.createElement(TableRowHeading, null, columnHeadings.map(function (columnHeading, index) { return (React.createElement(TableHeader, __assign({}, breakpoints, { key: index, cellWidth: columnWidths[index] }),
46
43
  React.createElement(TableHeaderText, __assign({}, breakpoints), columnHeading))); }))) : null,
47
- React.createElement(TableBody, null, items.map(function (rowData, p) { return (React.createElement(TableRow, { key: p, stripe: striped && p % 2 === 0 }, rowData.map(function (cellData, i) {
48
- return rowHeadings && i < 1 ? (React.createElement(RowHeading, __assign({}, breakpoints, { key: i, testID: "rowHeader", cellWidth: columnWidths[i] }),
49
- React.createElement(TableHeaderText, __assign({}, breakpoints), cellData))) : (React.createElement(TableCell, __assign({}, breakpoints, { key: i, testID: "cell", cellWidth: columnWidths[i] }),
50
- React.createElement(CellText, __assign({}, breakpoints), cellData)));
51
- }))); })))));
52
- });
53
- var StyledTableContainer = styled.View(function (_a) {
54
- var dataTable = _a.theme.dataTable;
55
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), dataTable.borderWidth, dataTable.borderColor);
56
- });
57
- var TableHeader = styled.View(function (_a) {
58
- var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
59
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n flex: ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0], cellWidth, cellWidth === 'auto' ? 1 : 0);
60
- });
61
- var TableHeaderText = styled.Text(function (_a) {
62
- var _b = _a.theme, tableHeader = _b.dataTable.tableHeader, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
63
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n\n line-height: ", ";\n font-size: ", ";\n "])), tableHeader.fontFamily, tableHeader.fontWeight, tableHeader.color, smallAndUp
64
- ? responsiveLineHeights.body[1]
65
- : responsiveLineHeights.body[0], smallAndUp
66
- ? responsiveFontSizes.body[1]
67
- : responsiveFontSizes.body[0]);
68
- });
69
- var TableCaptionText = styled.Text(function (_a) {
70
- var _b = _a.theme, tableCaption = _b.dataTable.tableCaption, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
71
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n line-height: ", ";\n font-size: ", ";\n "])), tableCaption.fontFamily, tableCaption.fontWeight, tableCaption.color, smallAndUp
72
- ? responsiveLineHeights.level4[1]
73
- : responsiveLineHeights.level4[0], smallAndUp
74
- ? responsiveFontSizes.level4[1]
75
- : responsiveFontSizes.level4[0]);
76
- });
77
- var CellText = styled.Text(function (_a) {
78
- var _b = _a.theme, text = _b.text, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
79
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-weight: ", ";\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-weight: ", ";\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "])), text.fontWeight, text.fontFamily, smallAndUp
80
- ? responsiveLineHeights.body[1]
81
- : responsiveLineHeights.body[0], smallAndUp
82
- ? responsiveFontSizes.body[1]
83
- : responsiveFontSizes.body[0]);
84
- });
85
- var TableCaption = styled.View(function (_a) {
86
- var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, smallAndUp = _a.smallAndUp;
87
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0]);
88
- });
89
- var TableRow = styled.View(function (_a) {
90
- var dataTable = _a.theme.dataTable, stripe = _a.stripe;
91
- return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), stripe
92
- ? dataTable.tableRow.stripeColor
93
- : dataTable.tableRow.backgroundColor, stripe ? 'none' : "".concat(dataTable.borderWidth), stripe ? 'none' : "".concat(dataTable.borderColor));
94
- });
95
- var TableRowHeading = styled.View(function (_a) {
96
- var dataTable = _a.theme.dataTable;
97
- return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), dataTable.tableHeader.backgroundColor, dataTable.tableHeader.borderWidth, dataTable.tableHeader.borderColor);
98
- });
99
- var TableBody = styled.View(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex-direction: column;\n flex-wrap: nowrap;\n"], ["\n flex-direction: column;\n flex-wrap: nowrap;\n"])));
100
- var TableCell = styled.View(function (_a) {
101
- var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
102
- return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0], cellWidth, cellWidth === 'auto' ? 1 : 0);
103
- });
104
- var RowHeading = styled.View(function (_a) {
105
- var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
106
- return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0], cellWidth, cellWidth === 'auto' ? 1 : 0);
44
+ React.createElement(TableBody, null, items.map(function (rowData, index) { return (React.createElement(TableRow, { key: index, data: rowData, index: index, rowHeadings: rowHeadings, columnWidths: columnWidths, striped: striped })); })))));
107
45
  });
108
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
@@ -0,0 +1,26 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React from 'react';
13
+ import { isElement as isReactElement } from 'react-is';
14
+ import { useBreakpoint } from '../../hooks';
15
+ import { CellText, RowHeading, TableCell, TableHeaderText, TableRow as StyledTableRow, } from './styles';
16
+ export var TableRow = function (_a) {
17
+ var data = _a.data, index = _a.index, striped = _a.striped, rowHeadings = _a.rowHeadings, columnWidths = _a.columnWidths;
18
+ var breakpoints = useBreakpoint();
19
+ var cells = data.map(function (cellData, i) {
20
+ if (rowHeadings && i === 0) {
21
+ return (React.createElement(RowHeading, __assign({}, breakpoints, { key: i, testID: "rowHeader", cellWidth: columnWidths[i] }), isReactElement(cellData) ? (cellData) : (React.createElement(TableHeaderText, __assign({}, breakpoints), cellData))));
22
+ }
23
+ return (React.createElement(TableCell, __assign({}, breakpoints, { key: i, testID: "cell", cellWidth: columnWidths[i] }), isReactElement(cellData) ? (cellData) : (React.createElement(CellText, __assign({}, breakpoints), cellData))));
24
+ });
25
+ return (React.createElement(StyledTableRow, { stripe: striped && index % 2 === 0 }, cells));
26
+ };
@@ -1 +1,3 @@
1
1
  export { DataTable } from './DataTable';
2
+ export * from './styles';
3
+ export * from './types';
@@ -0,0 +1,51 @@
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 styled, { css } from '../../styled.native';
6
+ export var StyledTableContainer = styled.View(function (_a) {
7
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic;
8
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), core.borderWidth.small, semantic.border.differentiated);
9
+ });
10
+ export var TableHeader = styled.View(function (_a) {
11
+ var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
12
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "], ["\n padding: ", " ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[1], cellWidth === 'auto' ? 1 : 0, cellWidth);
13
+ });
14
+ export var TableHeaderText = styled.Text(function (_a) {
15
+ var _b = _a.theme, semantic = _b.semantic, core = _b.core, smallAndUp = _a.smallAndUp;
16
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body[smallAndUp ? 'large' : 'small'], core.fontSize.body[smallAndUp ? 'large' : 'small'], semantic.message.base);
17
+ });
18
+ export var TableCaptionText = styled.Text(function (_a) {
19
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
20
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, core.fontSize.heading4[smallAndUp ? 'large' : 'small'], core.lineHeight.heading4[smallAndUp ? 'large' : 'small'], semantic.message.branded);
21
+ });
22
+ export var CellText = styled.Text(function (_a) {
23
+ var core = _a.theme.core, smallAndUp = _a.smallAndUp;
24
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n\n font-size: ", ";\n "])), core.fontFamily.body.native, core.lineHeight.body.large, core.fontSize.body[smallAndUp ? 'large' : 'small']);
25
+ });
26
+ export var TableCaption = styled.View(function (_a) {
27
+ var core = _a.theme.core;
28
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), core.space[4], core.space[1]);
29
+ });
30
+ export var TableRow = styled.View(function (_a) {
31
+ var _b = _a.theme, semantic = _b.semantic, core = _b.core, stripe = _a.stripe;
32
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), stripe
33
+ ? semantic.surface.cutout
34
+ : semantic.surface.base, stripe ? '0px' : "".concat(core.borderWidth.small), stripe
35
+ ? 'transparent'
36
+ : "".concat(semantic.border.differentiated));
37
+ });
38
+ export var TableRowHeading = styled.View(function (_a) {
39
+ var _b = _a.theme, semantic = _b.semantic, core = _b.core;
40
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), semantic.surface.base, core.borderWidth.small, semantic.border.functional);
41
+ });
42
+ export var TableBody = styled.View(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex-direction: column;\n flex-wrap: nowrap;\n"], ["\n flex-direction: column;\n flex-wrap: nowrap;\n"])));
43
+ export var TableCell = styled.View(function (_a) {
44
+ var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
45
+ return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[1], cellWidth, cellWidth === 'auto' ? 1 : 0);
46
+ });
47
+ export var RowHeading = styled.View(function (_a) {
48
+ var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
49
+ return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[1], cellWidth, cellWidth === 'auto' ? 1 : 0);
50
+ });
51
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
@@ -0,0 +1 @@
1
+ export {};
@@ -26,14 +26,14 @@ import { LabelText } from '../LabelText';
26
26
  import { Stack } from '../Stack';
27
27
  import { SubLabelText } from '../SubLabelText';
28
28
  var InlineFields = styled.View(function (_a) {
29
- var stretch = _a.stretch, field = _a.theme.field;
30
- var margin = parseFloat(field.gap) / 2;
31
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", "px;\n margin-right: -", "px;\n flex-direction: row;\n ", "\n "], ["\n margin-left: -", "px;\n margin-right: -", "px;\n flex-direction: row;\n ", "\n "])), margin, margin, stretch ? '' : "width: ".concat(field.dateWidth, ";"));
29
+ var stretch = _a.stretch, core = _a.theme.core;
30
+ var margin = core.space[1];
31
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "], ["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "])), margin, margin, stretch ? '' : "width: 265px;");
32
32
  });
33
33
  var SubField = styled(Stack)(function (_a) {
34
- var field = _a.theme.field;
35
- var padding = parseFloat(field.gap) / 2;
36
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-right: ", "px;\n padding-left: ", "px;\n "], ["\n padding-right: ", "px;\n padding-left: ", "px;\n "])), padding, padding);
34
+ var core = _a.theme.core;
35
+ var padding = core.space[1];
36
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-right: ", ";\n padding-left: ", ";\n "], ["\n padding-right: ", ";\n padding-left: ", ";\n "])), padding, padding);
37
37
  });
38
38
  var DayField = styled(SubField)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
39
39
  var MonthField = styled(SubField)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
@@ -64,7 +64,8 @@ export var DateField = forwardRef(function (_a, ref) {
64
64
  React.createElement(LabelText, null,
65
65
  label,
66
66
  optional ? ' (optional)' : null),
67
- hint ? React.createElement(HintText, null, hint) : null),
67
+ hint ? React.createElement(HintText, null, hint) : null,
68
+ error ? React.createElement(ErrorText, null, error) : null),
68
69
  React.createElement(InlineFields, { stretch: stretch },
69
70
  React.createElement(DayField, { spaceBetween: 1 },
70
71
  React.createElement(TouchableWithoutFeedback, { onPress: focusRef(dayRef), accessible: false },
@@ -77,7 +78,6 @@ export var DateField = forwardRef(function (_a, ref) {
77
78
  React.createElement(YearField, { spaceBetween: 1 },
78
79
  React.createElement(TouchableWithoutFeedback, { onPress: focusRef(yearRef), accessible: false },
79
80
  React.createElement(SubLabelText, null, "Year")),
80
- React.createElement(NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable }))),
81
- error ? React.createElement(ErrorText, null, error) : null)));
81
+ React.createElement(NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable }))))));
82
82
  });
83
83
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -0,0 +1,39 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React, { Children, cloneElement, } from 'react';
24
+ import { Dd, Dl, Dt } from './styled';
25
+ var DescriptionList = function (_a) {
26
+ var children = _a.children, rest = __rest(_a, ["children"]);
27
+ return (React.createElement(Dl, __assign({}, rest), Children.map(children, function (child, index) {
28
+ return cloneElement(child, {
29
+ index: index,
30
+ });
31
+ })));
32
+ };
33
+ var DescriptionItem = function (_a) {
34
+ var label = _a.label, children = _a.children, index = _a.index, rest = __rest(_a, ["label", "children", "index"]);
35
+ return (React.createElement(React.Fragment, null,
36
+ React.createElement(Dt, { style: index === 0 ? { marginTop: 0 } : undefined }, label),
37
+ React.createElement(Dd, __assign({}, rest), children)));
38
+ };
39
+ export { DescriptionList, DescriptionItem };
@@ -0,0 +1 @@
1
+ export { DescriptionList, DescriptionItem } from './DescriptionList';
@@ -0,0 +1,57 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __rest = (this && this.__rest) || function (s, e) {
17
+ var t = {};
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
+ t[p] = s[p];
20
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
+ t[p[i]] = s[p[i]];
24
+ }
25
+ return t;
26
+ };
27
+ import React from 'react';
28
+ import { View } from 'react-native';
29
+ import styled, { css } from '../../styled.native';
30
+ import { styledComponentWithBreakpoints } from '../../utils';
31
+ import { ListWrapper } from '../List/List';
32
+ export var Dl = ListWrapper;
33
+ var StyledDtText = styled.Text(function (_a) {
34
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic;
35
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body.small, core.fontSize.body.small, semantic.message.base);
36
+ });
37
+ var DtText = styledComponentWithBreakpoints(StyledDtText);
38
+ var StyledDtItem = styled.View(function (_a) {
39
+ var core = _a.theme.core, smallAndUp = _a.smallAndUp;
40
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n flex-direction: row;\n "])), core.space[smallAndUp ? 4 : 3]);
41
+ });
42
+ var DtItem = styledComponentWithBreakpoints(StyledDtItem);
43
+ export var Dt = function (_a) {
44
+ var children = _a.children, rest = __rest(_a, ["children"]);
45
+ return (React.createElement(DtItem, __assign({}, rest),
46
+ React.createElement(DtText, null, children)));
47
+ };
48
+ var StyledDdText = styled.Text(function (_a) {
49
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic;
50
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), core.fontFamily.body.native, core.lineHeight.body.small, semantic.message.secondary, core.fontSize.body.small);
51
+ });
52
+ export var Dd = function (_a) {
53
+ var children = _a.children, rest = __rest(_a, ["children"]);
54
+ return (React.createElement(View, __assign({ style: { flexDirection: 'row' } }, rest),
55
+ React.createElement(StyledDdText, null, children)));
56
+ };
57
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -24,36 +24,33 @@ 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';
32
31
  var DisclosureButton = styled.TouchableOpacity(function () { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n "], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n "]))); });
33
32
  var DisclosureButtonIcon = styled(Icon)(function (_a) {
34
- var disclosure = _a.theme.disclosure, expanded = _a.expanded, smallAndUp = _a.smallAndUp;
35
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)', disclosure.iconGap[smallAndUp ? 1 : 0]);
33
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, expanded = _a.expanded, smallAndUp = _a.smallAndUp;
34
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)', core.space[smallAndUp ? 2 : 1], semantic.message.link);
36
35
  });
37
36
  var DisclosureButtonText = styled.Text(function (_a) {
38
- var _b = _a.theme, text = _b.text, textLink = _b.textLink, smallAndUp = _a.smallAndUp;
39
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "])), text.fontFamily, text.p.fontSize[smallAndUp ? 1 : 0], text.p.lineHeight[smallAndUp ? 1 : 0], textLink.fontWeight, textLink.color, textLink.color);
37
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
38
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, core.fontSize.body[smallAndUp ? 'large' : 'small'], core.lineHeight.body[smallAndUp ? 'large' : 'small'], semantic.message.link, semantic.message.link);
40
39
  });
41
40
  var DisclosurePanel = styled.View(function (_a) {
42
- var _b = _a.theme, disclosure = _b.disclosure, responsiveFontSizes = _b.responsiveFontSizes, smallAndUp = _a.smallAndUp;
43
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", "px;\n "], ["\n margin-top: ", ";\n padding-left: ", "px;\n "])), disclosure.panelGap[smallAndUp ? 1 : 0], pxToNumber(responsiveFontSizes.body[smallAndUp ? 1 : 0]) +
44
- pxToNumber(disclosure.iconGap[smallAndUp ? 1 : 0]));
41
+ var core = _a.theme.core, smallAndUp = _a.smallAndUp;
42
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", ";\n "], ["\n margin-top: ", ";\n padding-left: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[smallAndUp ? 2 : 1]);
45
43
  });
46
44
  export var Disclosure = forwardRef(function (_a, ref) {
47
45
  var children = _a.children, title = _a.title, _b = _a.expanded, expanded = _b === void 0 ? false : _b, onToggle = _a.onToggle, rest = __rest(_a, ["children", "title", "expanded", "onToggle"]);
48
46
  var _c = useState(expanded), isExpanded = _c[0], setIsExpanded = _c[1];
49
47
  var breakpoints = useBreakpoint();
50
- var textLink = useContext(ThemeContext).textLink;
51
48
  return (React.createElement(React.Fragment, null,
52
49
  React.createElement(DisclosureButton, __assign({ onPress: function () {
53
50
  setIsExpanded(!isExpanded);
54
51
  onToggle && onToggle(!isExpanded);
55
52
  }, ref: ref, accessibilityState: { expanded: isExpanded } }, rest),
56
- React.createElement(DisclosureButtonIcon, __assign({ name: "caret-down" }, breakpoints, { size: 14, expanded: isExpanded, color: textLink.color })),
53
+ React.createElement(DisclosureButtonIcon, __assign({ name: "caret-down" }, breakpoints, { size: 14, expanded: isExpanded })),
57
54
  React.createElement(DisclosureButtonText, __assign({}, breakpoints), title)),
58
55
  isExpanded && (React.createElement(DisclosurePanel, __assign({}, breakpoints), children))));
59
56
  });
@@ -8,7 +8,7 @@ import { styledComponentWithBreakpoints } from '../../utils';
8
8
  var StyledErrorText = 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-size: ", ";\n font-weight: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n "])), field.error.fontFamily, calculateLineHeight(fontSize, field.lineHeight), fontSize, field.error.fontWeight, field.error.color);
11
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "])), field.error.fontFamily, calculateLineHeight(fontSize, field.lineHeight), fontSize, field.error.color);
12
12
  });
13
13
  var ErrorText = styledComponentWithBreakpoints(StyledErrorText);
14
14
  export { ErrorText };
@@ -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
  };