@ovotech/element-native 1.0.0 → 2.0.0-beta.1
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.
- package/dist/components/Accordion/Accordion.d.ts +5 -22
- package/dist/components/Accordion/Accordion.js +99 -65
- package/dist/components/Accordion/Group.d.ts +3 -0
- package/dist/components/Accordion/Group.js +41 -0
- package/dist/components/Accordion/Icon.d.ts +4 -0
- package/dist/components/Accordion/Icon.js +68 -0
- package/dist/components/Accordion/hooks.d.ts +6 -0
- package/dist/components/Accordion/hooks.js +43 -0
- package/dist/components/Accordion/index.d.ts +4 -1
- package/dist/components/Accordion/index.js +5 -2
- package/dist/components/Accordion/styles.d.ts +46 -0
- package/dist/components/Accordion/styles.js +52 -0
- package/dist/components/Accordion/types.d.ts +20 -0
- package/dist/components/Accordion/types.js +2 -0
- package/dist/components/Badge/Badge.d.ts +0 -1
- package/dist/components/Badge/Badge.js +3 -5
- package/dist/components/CTAButton/CTAButton.d.ts +1 -1
- package/dist/components/CTAButton/CTAButton.js +1 -1
- package/dist/components/CTALink/CTALink.js +1 -21
- package/dist/components/Card/Card.js +6 -5
- package/dist/components/Checkbox/Checkbox.js +10 -6
- package/dist/components/DataTable/DataTable.js +40 -42
- package/dist/components/DateField/DateField.js +3 -3
- package/dist/components/Disclosure/Disclosure.js +4 -15
- package/dist/components/ErrorText/ErrorText.js +1 -1
- package/dist/components/Field/Field.js +3 -3
- package/dist/components/FormGroup/FormGroup.js +3 -31
- package/dist/components/Heading/Heading.js +4 -17
- package/dist/components/HintText/HintText.js +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Input/CurrencyInput.d.ts +2 -2
- package/dist/components/Input/EmailInput.d.ts +2 -2
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/NumberInput.d.ts +2 -2
- package/dist/components/Input/PasswordInput.d.ts +2 -2
- package/dist/components/Input/TelInput.d.ts +2 -2
- package/dist/components/Input/TextInput.d.ts +2 -2
- package/dist/components/Input/TextareaInput.d.ts +2 -2
- package/dist/components/LabelText/LabelText.js +1 -1
- package/dist/components/List/List.d.ts +3 -1
- package/dist/components/List/List.js +18 -13
- package/dist/components/Margin/Margin.d.ts +1 -1
- package/dist/components/Margin/Margin.js +3 -1
- package/dist/components/NavHeader/NavHeader.d.ts +15 -0
- package/dist/components/NavHeader/NavHeader.js +93 -0
- package/dist/components/NavHeader/index.d.ts +1 -0
- package/dist/components/NavHeader/index.js +5 -0
- package/dist/components/Notification/Notification.d.ts +10 -0
- package/dist/components/Notification/Notification.js +50 -17
- package/dist/components/Radio/Radio.js +10 -6
- package/dist/components/Tabs/Tab.js +2 -2
- package/dist/components/Tabs/TabList.d.ts +1 -1
- package/dist/components/Tabs/TabList.js +2 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +5 -3
- package/dist/components/Text/Text.js +3 -3
- package/dist/components/TextField/CurrencyField.d.ts +2 -2
- package/dist/components/TextField/EmailField.d.ts +2 -2
- package/dist/components/TextField/NumberField.d.ts +2 -2
- package/dist/components/TextField/PasswordField.d.ts +2 -2
- package/dist/components/TextField/TelField.d.ts +2 -2
- package/dist/components/TextField/TextField.d.ts +2 -2
- package/dist/components/TextField/TextareaField.d.ts +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/components/Accordion/Accordion.js +98 -65
- package/dist/esm/components/Accordion/Group.js +14 -0
- package/dist/esm/components/Accordion/Icon.js +38 -0
- package/dist/esm/components/Accordion/hooks.js +16 -0
- package/dist/esm/components/Accordion/index.js +3 -1
- package/dist/esm/components/Accordion/styles.js +49 -0
- package/dist/esm/components/Accordion/types.js +1 -0
- package/dist/esm/components/Badge/Badge.js +3 -5
- package/dist/esm/components/CTAButton/CTAButton.js +1 -1
- package/dist/esm/components/CTALink/CTALink.js +1 -21
- package/dist/esm/components/Card/Card.js +6 -5
- package/dist/esm/components/Checkbox/Checkbox.js +10 -6
- package/dist/esm/components/DataTable/DataTable.js +40 -42
- package/dist/esm/components/DateField/DateField.js +3 -3
- package/dist/esm/components/Disclosure/Disclosure.js +4 -15
- package/dist/esm/components/ErrorText/ErrorText.js +1 -1
- package/dist/esm/components/Field/Field.js +3 -3
- package/dist/esm/components/FormGroup/FormGroup.js +3 -8
- package/dist/esm/components/Heading/Heading.js +4 -17
- package/dist/esm/components/HintText/HintText.js +1 -1
- package/dist/esm/components/Icon/Icon.js +1 -1
- package/dist/esm/components/LabelText/LabelText.js +1 -1
- package/dist/esm/components/List/List.js +18 -13
- package/dist/esm/components/Margin/Margin.js +3 -1
- package/dist/esm/components/NavHeader/NavHeader.js +63 -0
- package/dist/esm/components/NavHeader/index.js +1 -0
- package/dist/esm/components/Notification/Notification.js +49 -16
- package/dist/esm/components/Radio/Radio.js +10 -6
- package/dist/esm/components/Tabs/Tab.js +2 -2
- package/dist/esm/components/Tabs/TabList.js +2 -1
- package/dist/esm/components/Tabs/Tabs.js +5 -3
- package/dist/esm/components/Text/Text.js +3 -3
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/providers/IconsProvider.js +28 -9
- package/dist/esm/providers/icons/ArrowDown.js +15 -0
- package/dist/esm/providers/icons/ArrowLeft.js +15 -0
- package/dist/esm/providers/icons/ArrowRight.js +15 -0
- package/dist/esm/providers/icons/ArrowUp.js +15 -0
- package/dist/esm/providers/icons/CaretDown.js +1 -1
- package/dist/esm/providers/icons/CaretLeft.js +15 -0
- package/dist/esm/providers/icons/CaretRight.js +1 -1
- package/dist/esm/providers/icons/CaretUp.js +15 -0
- package/dist/esm/providers/icons/Chart.js +15 -0
- package/dist/esm/providers/icons/Check.js +2 -2
- package/dist/esm/providers/icons/ChevronDown.js +2 -2
- package/dist/esm/providers/icons/ChevronLeft.js +1 -1
- package/dist/esm/providers/icons/ChevronLeftSmall.js +15 -0
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +15 -0
- package/dist/esm/providers/icons/ChevronRight.js +1 -1
- package/dist/esm/providers/icons/ChevronRightSmall.js +15 -0
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +15 -0
- package/dist/esm/providers/icons/ChevronUp.js +2 -2
- package/dist/esm/providers/icons/Cross.js +1 -1
- package/dist/esm/providers/icons/Dollar.js +2 -3
- package/dist/esm/providers/icons/Download.js +1 -1
- package/dist/esm/providers/icons/Electricity.js +1 -1
- package/dist/esm/providers/icons/Euro.js +2 -3
- package/dist/esm/providers/icons/Gas.js +2 -2
- package/dist/esm/providers/icons/Help.js +15 -0
- package/dist/esm/providers/icons/Hide.js +15 -0
- package/dist/esm/providers/icons/HidePassword.js +15 -0
- package/dist/esm/providers/icons/Home.js +15 -0
- package/dist/esm/providers/icons/Info.js +15 -0
- package/dist/esm/providers/icons/Link.js +2 -2
- package/dist/esm/providers/icons/Minus.js +1 -1
- package/dist/esm/providers/icons/NewWindow.js +1 -2
- package/dist/esm/providers/icons/Payment.js +15 -0
- package/dist/esm/providers/icons/PaymentCard.js +15 -0
- package/dist/esm/providers/icons/Plus.js +1 -1
- package/dist/esm/providers/icons/Pound.js +2 -3
- package/dist/esm/providers/icons/Search.js +15 -0
- package/dist/esm/providers/icons/Show.js +15 -0
- package/dist/esm/providers/icons/ShowPassword.js +15 -0
- package/dist/esm/providers/icons/Usage.js +15 -0
- package/dist/esm/providers/icons/User.js +15 -0
- package/dist/esm/providers/icons/index.js +21 -2
- package/dist/esm/theme/create-theme.js +139 -118
- package/dist/providers/IconsProvider.js +27 -8
- package/dist/providers/icons/ArrowDown.d.ts +2 -0
- package/dist/providers/icons/ArrowDown.js +22 -0
- package/dist/providers/icons/ArrowLeft.d.ts +2 -0
- package/dist/providers/icons/ArrowLeft.js +22 -0
- package/dist/providers/icons/ArrowRight.d.ts +2 -0
- package/dist/providers/icons/ArrowRight.js +22 -0
- package/dist/providers/icons/ArrowUp.d.ts +2 -0
- package/dist/providers/icons/ArrowUp.js +22 -0
- package/dist/providers/icons/CaretDown.js +1 -1
- package/dist/providers/icons/CaretLeft.d.ts +2 -0
- package/dist/providers/icons/CaretLeft.js +22 -0
- package/dist/providers/icons/CaretRight.js +1 -1
- package/dist/providers/icons/CaretUp.d.ts +2 -0
- package/dist/providers/icons/CaretUp.js +22 -0
- package/dist/providers/icons/Chart.d.ts +2 -0
- package/dist/providers/icons/Chart.js +22 -0
- package/dist/providers/icons/Check.js +2 -2
- package/dist/providers/icons/ChevronDown.js +2 -2
- package/dist/providers/icons/ChevronLeft.js +1 -1
- package/dist/providers/icons/ChevronLeftSmall.d.ts +2 -0
- package/dist/providers/icons/ChevronLeftSmall.js +22 -0
- package/dist/providers/icons/ChevronLeftSmallFirst.d.ts +2 -0
- package/dist/providers/icons/ChevronLeftSmallFirst.js +22 -0
- package/dist/providers/icons/ChevronRight.js +1 -1
- package/dist/providers/icons/ChevronRightSmall.d.ts +2 -0
- package/dist/providers/icons/ChevronRightSmall.js +22 -0
- package/dist/providers/icons/ChevronRightSmallLast.d.ts +2 -0
- package/dist/providers/icons/ChevronRightSmallLast.js +22 -0
- package/dist/providers/icons/ChevronUp.js +2 -2
- package/dist/providers/icons/Cross.js +1 -1
- package/dist/providers/icons/Dollar.d.ts +1 -2
- package/dist/providers/icons/Dollar.js +1 -1
- package/dist/providers/icons/Download.js +1 -1
- package/dist/providers/icons/Electricity.js +1 -1
- package/dist/providers/icons/Euro.d.ts +1 -2
- package/dist/providers/icons/Euro.js +1 -1
- package/dist/providers/icons/Gas.js +2 -2
- package/dist/providers/icons/Help.d.ts +2 -0
- package/dist/providers/icons/Help.js +22 -0
- package/dist/providers/icons/Hide.d.ts +2 -0
- package/dist/providers/icons/Hide.js +22 -0
- package/dist/providers/icons/HidePassword.d.ts +2 -0
- package/dist/providers/icons/HidePassword.js +22 -0
- package/dist/providers/icons/Home.d.ts +2 -0
- package/dist/providers/icons/Home.js +22 -0
- package/dist/providers/icons/Info.d.ts +2 -0
- package/dist/providers/icons/Info.js +22 -0
- package/dist/providers/icons/Link.js +2 -2
- package/dist/providers/icons/Minus.js +1 -1
- package/dist/providers/icons/NewWindow.js +1 -2
- package/dist/providers/icons/Payment.d.ts +2 -0
- package/dist/providers/icons/Payment.js +22 -0
- package/dist/providers/icons/PaymentCard.d.ts +2 -0
- package/dist/providers/icons/PaymentCard.js +22 -0
- package/dist/providers/icons/Plus.js +1 -1
- package/dist/providers/icons/Pound.d.ts +1 -2
- package/dist/providers/icons/Pound.js +1 -1
- package/dist/providers/icons/Search.d.ts +2 -0
- package/dist/providers/icons/Search.js +22 -0
- package/dist/providers/icons/Show.d.ts +2 -0
- package/dist/providers/icons/Show.js +22 -0
- package/dist/providers/icons/ShowPassword.d.ts +2 -0
- package/dist/providers/icons/ShowPassword.js +22 -0
- package/dist/providers/icons/Usage.d.ts +2 -0
- package/dist/providers/icons/Usage.js +22 -0
- package/dist/providers/icons/User.d.ts +2 -0
- package/dist/providers/icons/User.js +22 -0
- package/dist/providers/icons/index.d.ts +21 -2
- package/dist/providers/icons/index.js +21 -2
- package/dist/providers/types.d.ts +1 -1
- package/dist/theme/create-theme.d.ts +1 -1
- package/dist/theme/create-theme.js +139 -118
- package/dist/theme/theme.d.ts +33 -25
- package/package.json +18 -15
|
@@ -58,8 +58,8 @@ var ErrorText_1 = require("../ErrorText");
|
|
|
58
58
|
var FormGroup_1 = require("../FormGroup");
|
|
59
59
|
var HintText_1 = require("../HintText");
|
|
60
60
|
var Icon_1 = require("../Icon/Icon");
|
|
61
|
+
var LabelText_1 = require("../LabelText");
|
|
61
62
|
var Stack_1 = require("../Stack");
|
|
62
|
-
var SubLabelText_1 = require("../SubLabelText");
|
|
63
63
|
var StyledCheckboxInputWrapper = styled_native_1.default.View(function (_a) {
|
|
64
64
|
var checkbox = _a.theme.checkbox;
|
|
65
65
|
var checkboxSize = (0, utils_1.pxToNumber)(checkbox.size);
|
|
@@ -67,11 +67,15 @@ var StyledCheckboxInputWrapper = styled_native_1.default.View(function (_a) {
|
|
|
67
67
|
return "\n width: ".concat(checkboxSize + gap, "px;\n height: ").concat(checkbox.touchSize, ";\n ");
|
|
68
68
|
});
|
|
69
69
|
var StyledCheckboxInput = styled_native_1.default.View(function (_a) {
|
|
70
|
-
var checkbox = _a.theme.checkbox, invalid = _a.invalid;
|
|
70
|
+
var checkbox = _a.theme.checkbox, invalid = _a.invalid, checked = _a.checked;
|
|
71
71
|
var touchSize = (0, utils_1.pxToNumber)(checkbox.touchSize);
|
|
72
72
|
var checkboxSize = (0, utils_1.pxToNumber)(checkbox.size);
|
|
73
73
|
var checkboxDistance = (touchSize - checkboxSize) / 2;
|
|
74
|
-
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
|
|
74
|
+
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
|
|
75
|
+
? checkbox.errorColor
|
|
76
|
+
: checked
|
|
77
|
+
? checkbox.checkColor
|
|
78
|
+
: checkbox.borderColor, ";\n background: ").concat(checked ? checkbox.checkedBackground : checkbox.background, ";\n ");
|
|
75
79
|
});
|
|
76
80
|
var CheckboxCheck = function (props) {
|
|
77
81
|
var checkbox = (0, react_1.useContext)(styled_native_1.ThemeContext).checkbox;
|
|
@@ -88,10 +92,10 @@ var StyledCheckboxInputCheck = (0, styled_native_1.default)(CheckboxCheck)(funct
|
|
|
88
92
|
var Input = function (_a) {
|
|
89
93
|
var checked = _a.checked, invalid = _a.invalid, rest = __rest(_a, ["checked", "invalid"]);
|
|
90
94
|
return (react_1.default.createElement(StyledCheckboxInputWrapper, __assign({}, rest),
|
|
91
|
-
react_1.default.createElement(StyledCheckboxInput, { invalid: invalid },
|
|
95
|
+
react_1.default.createElement(StyledCheckboxInput, { invalid: invalid, checked: checked },
|
|
92
96
|
react_1.default.createElement(StyledCheckboxInputCheck, { checked: checked }))));
|
|
93
97
|
};
|
|
94
|
-
var
|
|
98
|
+
var CheckLabelText = (0, styled_native_1.default)(LabelText_1.LabelText)(function (_a) {
|
|
95
99
|
var checkbox = _a.theme.checkbox;
|
|
96
100
|
return "\n padding-top: ".concat(checkbox.paddingTop, ";\n ");
|
|
97
101
|
});
|
|
@@ -108,7 +112,7 @@ var Checkbox = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
108
112
|
react_1.default.createElement(StyledWrapper, null,
|
|
109
113
|
react_1.default.createElement(Input, { checked: checked, invalid: hasError || invalid }),
|
|
110
114
|
react_1.default.createElement(react_native_1.View, { style: { flexShrink: 1 } },
|
|
111
|
-
react_1.default.createElement(
|
|
115
|
+
react_1.default.createElement(CheckLabelText, null,
|
|
112
116
|
label,
|
|
113
117
|
optional ? ' (optional)' : null),
|
|
114
118
|
hint ? react_1.default.createElement(HintText_1.HintText, null, hint) : null))))));
|
|
@@ -57,68 +57,66 @@ var styled_native_1 = __importStar(require("../../styled.native"));
|
|
|
57
57
|
var utils_1 = require("../../utils");
|
|
58
58
|
exports.DataTable = (0, react_1.forwardRef)(function (_a, ref) {
|
|
59
59
|
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"]);
|
|
60
|
+
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
60
61
|
var columnLabel = columnHeadings
|
|
61
62
|
? " ".concat(columnHeadings.length, " columns,")
|
|
62
63
|
: '';
|
|
63
64
|
var captionLabel = caption ? caption : '';
|
|
64
65
|
var accessibilityLabelText = (0, utils_1.getText)(captionLabel);
|
|
65
66
|
var accessibilityLabel = "data table,".concat(columnLabel, " ").concat(items.length, " rows, ").concat(accessibilityLabelText);
|
|
66
|
-
return (react_1.default.createElement(react_native_1.ScrollView, { horizontal: true, alwaysBounceHorizontal: false },
|
|
67
|
+
return (react_1.default.createElement(react_native_1.ScrollView, { horizontal: true, alwaysBounceHorizontal: false, contentContainerStyle: { flexGrow: 1 } },
|
|
67
68
|
react_1.default.createElement(StyledTableContainer, __assign({}, rest, { ref: ref }),
|
|
68
|
-
caption ? (react_1.default.createElement(TableCaption,
|
|
69
|
-
react_1.default.createElement(TableCaptionText, { accessibilityLabel: accessibilityLabel }, caption))) : null,
|
|
70
|
-
columnHeadings ? (react_1.default.createElement(TableRowHeading, null, columnHeadings.map(function (columnHeading, index) { return (react_1.default.createElement(TableHeader, { key: index, cellWidth: columnWidths[index] },
|
|
71
|
-
react_1.default.createElement(TableHeaderText,
|
|
69
|
+
caption ? (react_1.default.createElement(TableCaption, __assign({}, breakpoints),
|
|
70
|
+
react_1.default.createElement(TableCaptionText, __assign({}, breakpoints, { accessibilityLabel: accessibilityLabel }), caption))) : null,
|
|
71
|
+
columnHeadings ? (react_1.default.createElement(TableRowHeading, null, columnHeadings.map(function (columnHeading, index) { return (react_1.default.createElement(TableHeader, __assign({}, breakpoints, { key: index, cellWidth: columnWidths[index] }),
|
|
72
|
+
react_1.default.createElement(TableHeaderText, __assign({}, breakpoints), columnHeading))); }))) : null,
|
|
72
73
|
react_1.default.createElement(TableBody, null, items.map(function (rowData, p) { return (react_1.default.createElement(TableRow, { key: p, stripe: striped && p % 2 === 0 }, rowData.map(function (cellData, i) {
|
|
73
|
-
return rowHeadings && i < 1 ? (react_1.default.createElement(RowHeading, { key: i, testID: "rowHeader", cellWidth: columnWidths[i] },
|
|
74
|
-
react_1.default.createElement(TableHeaderText,
|
|
75
|
-
react_1.default.createElement(CellText,
|
|
74
|
+
return rowHeadings && i < 1 ? (react_1.default.createElement(RowHeading, __assign({}, breakpoints, { key: i, testID: "rowHeader", cellWidth: columnWidths[i] }),
|
|
75
|
+
react_1.default.createElement(TableHeaderText, __assign({}, breakpoints), cellData))) : (react_1.default.createElement(TableCell, __assign({}, breakpoints, { key: i, testID: "cell", cellWidth: columnWidths[i] }),
|
|
76
|
+
react_1.default.createElement(CellText, __assign({}, breakpoints), cellData)));
|
|
76
77
|
}))); })))));
|
|
77
78
|
});
|
|
78
|
-
var StyledTableContainer = styled_native_1.default.View(
|
|
79
|
+
var StyledTableContainer = styled_native_1.default.View(function (_a) {
|
|
80
|
+
var dataTable = _a.theme.dataTable;
|
|
81
|
+
return (0, styled_native_1.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);
|
|
82
|
+
});
|
|
79
83
|
var TableHeader = styled_native_1.default.View(function (_a) {
|
|
80
|
-
var
|
|
81
|
-
return (0, styled_native_1.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 "])),
|
|
84
|
+
var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
85
|
+
return (0, styled_native_1.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);
|
|
82
86
|
});
|
|
83
|
-
var
|
|
84
|
-
var _b = _a.theme, tableHeader = _b.dataTable.tableHeader, responsiveFontSizes = _b.responsiveFontSizes, smallAndUp = _a.smallAndUp;
|
|
85
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-weight: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n\n font-size: ", ";\n "], ["\n font-weight: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n\n font-size: ", ";\n "])), tableHeader.fontWeight, tableHeader.color, smallAndUp
|
|
87
|
+
var TableHeaderText = styled_native_1.default.Text(function (_a) {
|
|
88
|
+
var _b = _a.theme, tableHeader = _b.dataTable.tableHeader, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
|
|
89
|
+
return (0, styled_native_1.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
|
|
90
|
+
? responsiveLineHeights.body[1]
|
|
91
|
+
: responsiveLineHeights.body[0], smallAndUp
|
|
86
92
|
? responsiveFontSizes.body[1]
|
|
87
93
|
: responsiveFontSizes.body[0]);
|
|
88
94
|
});
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
? responsiveFontSizes.body[1]
|
|
97
|
-
: responsiveFontSizes.body[0]);
|
|
95
|
+
var TableCaptionText = styled_native_1.default.Text(function (_a) {
|
|
96
|
+
var _b = _a.theme, tableCaption = _b.dataTable.tableCaption, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
|
|
97
|
+
return (0, styled_native_1.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
|
|
98
|
+
? responsiveLineHeights.level4[1]
|
|
99
|
+
: responsiveLineHeights.level4[0], smallAndUp
|
|
100
|
+
? responsiveFontSizes.level4[1]
|
|
101
|
+
: responsiveFontSizes.level4[0]);
|
|
98
102
|
});
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var _b = _a.theme, text = _b.text, responsiveFontSizes = _b.responsiveFontSizes, smallAndUp = _a.smallAndUp;
|
|
105
|
-
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-weight: ", ";\n font-family: ", ";\n font-size: ", ";\n "], ["\n font-weight: ", ";\n font-family: ", ";\n font-size: ", ";\n "])), text.fontWeight, text.fontFamily, smallAndUp
|
|
103
|
+
var CellText = styled_native_1.default.Text(function (_a) {
|
|
104
|
+
var _b = _a.theme, text = _b.text, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
|
|
105
|
+
return (0, styled_native_1.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
|
|
106
|
+
? responsiveLineHeights.body[1]
|
|
107
|
+
: responsiveLineHeights.body[0], smallAndUp
|
|
106
108
|
? responsiveFontSizes.body[1]
|
|
107
109
|
: responsiveFontSizes.body[0]);
|
|
108
110
|
});
|
|
109
|
-
var CellText = function (props) {
|
|
110
|
-
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
111
|
-
return react_1.default.createElement(StyledCellText, __assign({}, breakpoints, props));
|
|
112
|
-
};
|
|
113
111
|
var TableCaption = styled_native_1.default.View(function (_a) {
|
|
114
|
-
var
|
|
115
|
-
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])),
|
|
112
|
+
var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, smallAndUp = _a.smallAndUp;
|
|
113
|
+
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0]);
|
|
116
114
|
});
|
|
117
115
|
var TableRow = styled_native_1.default.View(function (_a) {
|
|
118
116
|
var dataTable = _a.theme.dataTable, stripe = _a.stripe;
|
|
119
|
-
return (0, styled_native_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), stripe
|
|
117
|
+
return (0, styled_native_1.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
|
|
120
118
|
? dataTable.tableRow.stripeColor
|
|
121
|
-
: dataTable.tableRow.backgroundColor);
|
|
119
|
+
: dataTable.tableRow.backgroundColor, stripe ? 'none' : "".concat(dataTable.borderWidth), stripe ? 'none' : "".concat(dataTable.borderColor));
|
|
122
120
|
});
|
|
123
121
|
var TableRowHeading = styled_native_1.default.View(function (_a) {
|
|
124
122
|
var dataTable = _a.theme.dataTable;
|
|
@@ -126,11 +124,11 @@ var TableRowHeading = styled_native_1.default.View(function (_a) {
|
|
|
126
124
|
});
|
|
127
125
|
var TableBody = styled_native_1.default.View(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex-direction: column;\n flex-wrap: nowrap;\n"], ["\n flex-direction: column;\n flex-wrap: nowrap;\n"])));
|
|
128
126
|
var TableCell = styled_native_1.default.View(function (_a) {
|
|
129
|
-
var
|
|
130
|
-
return (0, styled_native_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: ", " ", ";\n
|
|
127
|
+
var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
128
|
+
return (0, styled_native_1.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);
|
|
131
129
|
});
|
|
132
130
|
var RowHeading = styled_native_1.default.View(function (_a) {
|
|
133
|
-
var
|
|
134
|
-
return (0, styled_native_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: ", " ", ";\n
|
|
131
|
+
var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
132
|
+
return (0, styled_native_1.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);
|
|
135
133
|
});
|
|
136
134
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -90,8 +90,7 @@ exports.DateField = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
90
90
|
react_1.default.createElement(LabelText_1.LabelText, null,
|
|
91
91
|
label,
|
|
92
92
|
optional ? ' (optional)' : null),
|
|
93
|
-
hint ? react_1.default.createElement(HintText_1.HintText, null, hint) : null,
|
|
94
|
-
error ? react_1.default.createElement(ErrorText_1.ErrorText, null, error) : null),
|
|
93
|
+
hint ? react_1.default.createElement(HintText_1.HintText, null, hint) : null),
|
|
95
94
|
react_1.default.createElement(InlineFields, { stretch: stretch },
|
|
96
95
|
react_1.default.createElement(DayField, { spaceBetween: 1 },
|
|
97
96
|
react_1.default.createElement(react_native_1.TouchableWithoutFeedback, { onPress: focusRef(dayRef), accessible: false },
|
|
@@ -104,6 +103,7 @@ exports.DateField = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
104
103
|
react_1.default.createElement(YearField, { spaceBetween: 1 },
|
|
105
104
|
react_1.default.createElement(react_native_1.TouchableWithoutFeedback, { onPress: focusRef(yearRef), accessible: false },
|
|
106
105
|
react_1.default.createElement(SubLabelText_1.SubLabelText, null, "Year")),
|
|
107
|
-
react_1.default.createElement(Input_1.NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable })))
|
|
106
|
+
react_1.default.createElement(Input_1.NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable }))),
|
|
107
|
+
error ? react_1.default.createElement(ErrorText_1.ErrorText, null, error) : null)));
|
|
108
108
|
});
|
|
109
109
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -62,20 +62,11 @@ var DisclosureButtonIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_
|
|
|
62
62
|
});
|
|
63
63
|
var DisclosureButtonText = styled_native_1.default.Text(function (_a) {
|
|
64
64
|
var _b = _a.theme, text = _b.text, textLink = _b.textLink, smallAndUp = _a.smallAndUp;
|
|
65
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", "
|
|
66
|
-
(0, utils_1.pxToNumber)(text.p.fontSize[smallAndUp ? 1 : 0]), textLink.fontWeight, textLink.color, textLink.color);
|
|
67
|
-
});
|
|
68
|
-
var LineIndent = styled_native_1.default.View(function (_a) {
|
|
69
|
-
var _b = _a.theme, disclosure = _b.disclosure, responsiveFontSizes = _b.responsiveFontSizes, smallAndUp = _a.smallAndUp;
|
|
70
|
-
var lineOffset = function (fontSize) {
|
|
71
|
-
return "".concat((0, utils_1.pxToNumber)(fontSize) / 2 -
|
|
72
|
-
(0, utils_1.pxToNumber)(disclosure.lineIndent.width) / 2, "px");
|
|
73
|
-
};
|
|
74
|
-
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: ", ";\n border-radius: ", ";\n left: ", ";\n background-color: ", ";\n position: absolute;\n top: 0;\n bottom: 0;\n "], ["\n width: ", ";\n border-radius: ", ";\n left: ", ";\n background-color: ", ";\n position: absolute;\n top: 0;\n bottom: 0;\n "])), disclosure.lineIndent.width, disclosure.lineIndent.borderRadius, lineOffset(responsiveFontSizes.body[smallAndUp ? 1 : 0]), disclosure.lineIndent.backgroundColor);
|
|
65
|
+
return (0, styled_native_1.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);
|
|
75
66
|
});
|
|
76
67
|
var DisclosurePanel = styled_native_1.default.View(function (_a) {
|
|
77
68
|
var _b = _a.theme, disclosure = _b.disclosure, responsiveFontSizes = _b.responsiveFontSizes, smallAndUp = _a.smallAndUp;
|
|
78
|
-
return (0, styled_native_1.css)(
|
|
69
|
+
return (0, styled_native_1.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], (0, utils_1.pxToNumber)(responsiveFontSizes.body[smallAndUp ? 1 : 0]) +
|
|
79
70
|
(0, utils_1.pxToNumber)(disclosure.iconGap[smallAndUp ? 1 : 0]));
|
|
80
71
|
});
|
|
81
72
|
exports.Disclosure = (0, react_1.forwardRef)(function (_a, ref) {
|
|
@@ -90,8 +81,6 @@ exports.Disclosure = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
90
81
|
}, ref: ref, accessibilityState: { expanded: isExpanded } }, rest),
|
|
91
82
|
react_1.default.createElement(DisclosureButtonIcon, __assign({ name: "caret-down" }, breakpoints, { size: 14, expanded: isExpanded, color: textLink.color })),
|
|
92
83
|
react_1.default.createElement(DisclosureButtonText, __assign({}, breakpoints), title)),
|
|
93
|
-
isExpanded && (react_1.default.createElement(DisclosurePanel, __assign({}, breakpoints),
|
|
94
|
-
react_1.default.createElement(LineIndent, __assign({}, breakpoints)),
|
|
95
|
-
children))));
|
|
84
|
+
isExpanded && (react_1.default.createElement(DisclosurePanel, __assign({}, breakpoints), children))));
|
|
96
85
|
});
|
|
97
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4
|
|
86
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -34,7 +34,7 @@ var utils_1 = require("../../utils");
|
|
|
34
34
|
var StyledErrorText = styled_native_1.default.Text(function (_a) {
|
|
35
35
|
var field = _a.theme.field, smallAndUp = _a.smallAndUp;
|
|
36
36
|
var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
|
|
37
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n 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.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, field.lineHeight), fontSize, field.error.fontWeight, field.error.color);
|
|
37
|
+
return (0, styled_native_1.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, (0, theme_1.calculateLineHeight)(fontSize, field.lineHeight), fontSize, field.error.fontWeight, field.error.color);
|
|
38
38
|
});
|
|
39
39
|
var ErrorText = (0, utils_1.styledComponentWithBreakpoints)(StyledErrorText);
|
|
40
40
|
exports.ErrorText = ErrorText;
|
|
@@ -84,11 +84,11 @@ exports.Field = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
84
84
|
react_1.default.createElement(LabelText_1.LabelText, null,
|
|
85
85
|
label,
|
|
86
86
|
optional ? ' (optional)' : null),
|
|
87
|
-
hint ? react_1.default.createElement(HintText_1.HintText, null, hint) : null,
|
|
88
|
-
error ? react_1.default.createElement(ErrorText_1.ErrorText, null, error) : null)),
|
|
87
|
+
hint ? react_1.default.createElement(HintText_1.HintText, null, hint) : null)),
|
|
89
88
|
react_1.default.createElement(Stretch_1.Stretch, { defaultWidth: "".concat(Math.ceil(characters * 0.8 * parseInt(field.fontSize[0])) + affixWidth, "px"), fullWidth: fullWidth }, react_1.Children.map(children, function (child) {
|
|
90
89
|
return (0, react_1.isValidElement)(child)
|
|
91
90
|
? (0, react_1.cloneElement)(child, __assign({ invalid: hasError || undefined, ref: (0, utils_1.mergeRefs)(inputRef, ref), accessibilityLabel: accessibilityLabel }, rest))
|
|
92
91
|
: child;
|
|
93
|
-
}))
|
|
92
|
+
})),
|
|
93
|
+
error ? react_1.default.createElement(ErrorText_1.ErrorText, null, error) : null)));
|
|
94
94
|
});
|
|
@@ -14,29 +14,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
};
|
|
15
15
|
return __assign.apply(this, arguments);
|
|
16
16
|
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
17
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
41
18
|
var t = {};
|
|
42
19
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -55,17 +32,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
55
32
|
exports.FormGroup = void 0;
|
|
56
33
|
var react_1 = __importDefault(require("react"));
|
|
57
34
|
var react_native_1 = require("react-native");
|
|
58
|
-
var styled_native_1 =
|
|
59
|
-
var
|
|
60
|
-
var field = _a.theme.field;
|
|
61
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n height: 100%;\n background-color: ", ";\n border-radius: ", ";\n margin-right: ", ";\n "], ["\n width: ", ";\n height: 100%;\n background-color: ", ";\n border-radius: ", ";\n margin-right: ", ";\n "])), field.errorIndent.borderWidth, field.error.color, field.errorIndent.borderRadius, field.gap);
|
|
62
|
-
});
|
|
63
|
-
var FormGroupWrapper = styled_native_1.default.View(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
35
|
+
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
36
|
+
var FormGroupWrapper = styled_native_1.default.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
64
37
|
var FormGroup = function (_a) {
|
|
65
38
|
var children = _a.children, error = _a.error, rest = __rest(_a, ["children", "error"]);
|
|
66
39
|
return (react_1.default.createElement(FormGroupWrapper, __assign({}, rest),
|
|
67
|
-
error ? react_1.default.createElement(Line, null) : null,
|
|
68
40
|
react_1.default.createElement(react_native_1.View, { style: { flex: 1 } }, children)));
|
|
69
41
|
};
|
|
70
42
|
exports.FormGroup = FormGroup;
|
|
71
|
-
var templateObject_1
|
|
43
|
+
var templateObject_1;
|
|
@@ -56,13 +56,9 @@ exports.Heading4 = exports.Heading3 = exports.Heading2 = exports.Heading1 = void
|
|
|
56
56
|
var react_1 = __importDefault(require("react"));
|
|
57
57
|
var hooks_1 = require("../../hooks");
|
|
58
58
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
59
|
-
var theme_1 = require("../../theme");
|
|
60
59
|
var StyledHeading1 = styled_native_1.default.Text(function (_a) {
|
|
61
60
|
var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
|
|
62
|
-
|
|
63
|
-
? heading.heading1.fontSize[1]
|
|
64
|
-
: heading.heading1.fontSize[0];
|
|
65
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, heading.lineHeight), heading.heading1.fontWeight || heading.fontWeight, heading.color, fontSize, smallAndUp
|
|
61
|
+
return (0, styled_native_1.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
|
|
66
62
|
? heading.heading1.marginTop[1]
|
|
67
63
|
: heading.heading1.marginTop[0], smallAndUp
|
|
68
64
|
? heading.heading1.marginBottom[1]
|
|
@@ -76,10 +72,7 @@ var Heading1 = function (_a) {
|
|
|
76
72
|
exports.Heading1 = Heading1;
|
|
77
73
|
var StyledHeading2 = styled_native_1.default.Text(function (_a) {
|
|
78
74
|
var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
|
|
79
|
-
|
|
80
|
-
? heading.heading2.fontSize[1]
|
|
81
|
-
: heading.heading2.fontSize[0];
|
|
82
|
-
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, heading.lineHeight), heading.heading2.fontWeight || heading.fontWeight, heading.color, fontSize, smallAndUp
|
|
75
|
+
return (0, styled_native_1.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
|
|
83
76
|
? heading.heading2.marginTop[1]
|
|
84
77
|
: heading.heading2.marginTop[0], smallAndUp
|
|
85
78
|
? heading.heading2.marginBottom[1]
|
|
@@ -93,10 +86,7 @@ var Heading2 = function (_a) {
|
|
|
93
86
|
exports.Heading2 = Heading2;
|
|
94
87
|
var StyledHeading3 = styled_native_1.default.Text(function (_a) {
|
|
95
88
|
var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
|
|
96
|
-
|
|
97
|
-
? heading.heading3.fontSize[1]
|
|
98
|
-
: heading.heading3.fontSize[0];
|
|
99
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, heading.lineHeight), heading.heading3.fontWeight || heading.fontWeight, heading.color, fontSize, smallAndUp
|
|
89
|
+
return (0, styled_native_1.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
|
|
100
90
|
? heading.heading3.marginTop[1]
|
|
101
91
|
: heading.heading3.marginTop[0], smallAndUp
|
|
102
92
|
? heading.heading3.marginBottom[1]
|
|
@@ -110,10 +100,7 @@ var Heading3 = function (_a) {
|
|
|
110
100
|
exports.Heading3 = Heading3;
|
|
111
101
|
var StyledHeading4 = styled_native_1.default.Text(function (_a) {
|
|
112
102
|
var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
|
|
113
|
-
|
|
114
|
-
? heading.heading4.fontSize[1]
|
|
115
|
-
: heading.heading4.fontSize[0];
|
|
116
|
-
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, heading.lineHeight), heading.heading4.fontWeight || heading.fontWeight, heading.color, fontSize, smallAndUp
|
|
103
|
+
return (0, styled_native_1.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
|
|
117
104
|
? heading.heading4.marginTop[1]
|
|
118
105
|
: heading.heading4.marginTop[0], smallAndUp
|
|
119
106
|
? heading.heading4.marginBottom[1]
|
|
@@ -34,7 +34,7 @@ var utils_1 = require("../../utils");
|
|
|
34
34
|
var StyledHintText = styled_native_1.default.Text(function (_a) {
|
|
35
35
|
var field = _a.theme.field, smallAndUp = _a.smallAndUp;
|
|
36
36
|
var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
|
|
37
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n
|
|
37
|
+
return (0, styled_native_1.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, (0, theme_1.calculateLineHeight)(fontSize, field.lineHeight), field.hint.color);
|
|
38
38
|
});
|
|
39
39
|
var HintText = (0, utils_1.styledComponentWithBreakpoints)(StyledHintText);
|
|
40
40
|
exports.HintText = HintText;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SvgProps } from 'react-native-svg';
|
|
3
|
-
|
|
3
|
+
import { IconName } from '../../providers';
|
|
4
4
|
export declare type IconBase = React.FunctionComponent<SvgProps>;
|
|
5
5
|
declare type Props = SvgProps & {
|
|
6
6
|
name: IconName | (string & {});
|
|
@@ -55,7 +55,7 @@ var Icon = function (_a) {
|
|
|
55
55
|
var colors = (0, react_1.useContext)(styled_native_1.ThemeContext).colors;
|
|
56
56
|
// @ts-ignore to support additional icons.
|
|
57
57
|
var Svg = name && icons[name];
|
|
58
|
-
return Svg ? (react_1.default.createElement(Svg, __assign({ testID: testID ? testID : "
|
|
58
|
+
return Svg ? (react_1.default.createElement(Svg, __assign({ testID: testID ? testID : "element-icon".concat(name ? "-".concat(name) : ''),
|
|
59
59
|
// @ts-ignore this is valid.
|
|
60
60
|
color: color !== null && color !== void 0 ? color : colors.body, width: size, height: size }, rest))) : null;
|
|
61
61
|
};
|
|
@@ -7,8 +7,8 @@ export declare type CurrencyInputProps = InputProps & {
|
|
|
7
7
|
declare const CurrencyInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
8
8
|
invalid?: boolean | undefined;
|
|
9
9
|
stretch?: boolean | undefined;
|
|
10
|
-
iconLeft?: (string & {}) | import("
|
|
11
|
-
iconRight?: (string & {}) | import("
|
|
10
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
11
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
12
12
|
} & {
|
|
13
13
|
currency?: "GBP" | "EUR" | "AUD" | "USD" | undefined;
|
|
14
14
|
} & React.RefAttributes<TextInput>>;
|
|
@@ -3,7 +3,7 @@ import { TextInput } from 'react-native';
|
|
|
3
3
|
declare const EmailInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?: (string & {}) | import("
|
|
7
|
-
iconRight?: (string & {}) | import("
|
|
6
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
8
|
} & React.RefAttributes<TextInput>>;
|
|
9
9
|
export { EmailInput };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInputProps, TextInput } from 'react-native';
|
|
3
|
-
import { IconName } from '
|
|
3
|
+
import { IconName } from '../../providers/types';
|
|
4
4
|
export declare type InputProps = TextInputProps & {
|
|
5
5
|
invalid?: boolean;
|
|
6
6
|
stretch?: boolean;
|
|
@@ -3,7 +3,7 @@ import { TextInput as RNTextInput } from 'react-native';
|
|
|
3
3
|
declare const NumberInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?: (string & {}) | import("
|
|
7
|
-
iconRight?: (string & {}) | import("
|
|
6
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
8
|
} & React.RefAttributes<RNTextInput>>;
|
|
9
9
|
export { NumberInput };
|
|
@@ -3,7 +3,7 @@ import { TextInput as RNTextInput } from 'react-native';
|
|
|
3
3
|
declare const PasswordInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?: (string & {}) | import("
|
|
7
|
-
iconRight?: (string & {}) | import("
|
|
6
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
8
|
} & React.RefAttributes<RNTextInput>>;
|
|
9
9
|
export { PasswordInput };
|
|
@@ -3,7 +3,7 @@ import { TextInput } from 'react-native';
|
|
|
3
3
|
declare const TelInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?: (string & {}) | import("
|
|
7
|
-
iconRight?: (string & {}) | import("
|
|
6
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
8
|
} & React.RefAttributes<TextInput>>;
|
|
9
9
|
export { TelInput };
|
|
@@ -3,7 +3,7 @@ import { TextInput as RNTextInput } from 'react-native';
|
|
|
3
3
|
declare const TextInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?: (string & {}) | import("
|
|
7
|
-
iconRight?: (string & {}) | import("
|
|
6
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
8
|
} & React.RefAttributes<RNTextInput>>;
|
|
9
9
|
export { TextInput };
|
|
@@ -7,8 +7,8 @@ declare type TextareaInputProps = InputProps & {
|
|
|
7
7
|
declare const TextareaInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
8
8
|
invalid?: boolean | undefined;
|
|
9
9
|
stretch?: boolean | undefined;
|
|
10
|
-
iconLeft?: (string & {}) | import("
|
|
11
|
-
iconRight?: (string & {}) | import("
|
|
10
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
11
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
12
12
|
} & {
|
|
13
13
|
rows?: number | undefined;
|
|
14
14
|
} & React.RefAttributes<RNTextInput>>;
|
|
@@ -34,7 +34,7 @@ var utils_1 = require("../../utils");
|
|
|
34
34
|
var StyledLabelText = styled_native_1.default.Text(function (_a) {
|
|
35
35
|
var field = _a.theme.field, smallAndUp = _a.smallAndUp;
|
|
36
36
|
var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
|
|
37
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n 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.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, field.lineHeight), field.label.fontWeight, field.label.color, fontSize);
|
|
37
|
+
return (0, styled_native_1.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, (0, theme_1.calculateLineHeight)(fontSize, field.lineHeight), field.label.fontWeight, field.label.color, fontSize);
|
|
38
38
|
});
|
|
39
39
|
var LabelText = (0, utils_1.styledComponentWithBreakpoints)(StyledLabelText);
|
|
40
40
|
exports.LabelText = LabelText;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Text, View, ViewProps } from 'react-native';
|
|
3
|
-
declare const Ul: ({ children, ...rest }: PropsWithChildren<ViewProps
|
|
3
|
+
declare const Ul: ({ children, showBullets, ...rest }: React.PropsWithChildren<ViewProps & {
|
|
4
|
+
showBullets?: boolean | undefined;
|
|
5
|
+
}>) => JSX.Element;
|
|
4
6
|
declare const Ol: ({ children, ...rest }: PropsWithChildren<ViewProps>) => JSX.Element;
|
|
5
7
|
declare const Li: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
6
8
|
[x: string]: any;
|