@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
|
@@ -57,18 +57,23 @@ var styled_native_1 = __importStar(require("../../styled.native"));
|
|
|
57
57
|
var theme_1 = require("../../theme");
|
|
58
58
|
var utils_1 = require("../../utils");
|
|
59
59
|
var Stack_1 = require("../Stack");
|
|
60
|
+
var UlBullet = styled_native_1.default.View(function (_a) {
|
|
61
|
+
var _b = _a.theme, colors = _b.colors, list = _b.list, _c = _a.visible, visible = _c === void 0 ? true : _c;
|
|
62
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: ", ";\n width: ", ";\n height: ", ";\n background-color: ", ";\n "], ["\n margin-right: ", ";\n width: ", ";\n height: ", ";\n background-color: ", ";\n "])), list.listItem.bulletGap, list.listItem.bulletWidth, list.listItem.bulletWidth, visible ? colors.body : 'transparent');
|
|
63
|
+
});
|
|
60
64
|
var StyledBullet = styled_native_1.default.Text(function (_a) {
|
|
61
|
-
var _b = _a.theme, text = _b.text, list = _b.list, smallAndUp = _a.smallAndUp;
|
|
65
|
+
var _b = _a.theme, text = _b.text, list = _b.list, space = _b.space, smallAndUp = _a.smallAndUp;
|
|
62
66
|
var fontSize = smallAndUp
|
|
63
67
|
? list.listItem.fontSize[1]
|
|
64
68
|
: list.listItem.fontSize[0];
|
|
65
|
-
return (0, styled_native_1.css)(
|
|
69
|
+
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-right: ", ";\n width: ", ";\n text-align: right;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "])), text.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, text.lineHeight), text.fontWeight, text.color, fontSize, list.listItem.bulletGap, space[4]);
|
|
66
70
|
});
|
|
71
|
+
var StyledUlItem = styled_native_1.default.View(function () { return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n justify-content: center;\n "], ["\n flex-direction: row;\n align-items: center;\n justify-content: center;\n "]))); });
|
|
67
72
|
var Bullet = (0, utils_1.styledComponentWithBreakpoints)(StyledBullet);
|
|
68
73
|
var ListBulletItem = function (_a) {
|
|
69
|
-
var children = _a.children;
|
|
70
|
-
return (react_1.default.createElement(
|
|
71
|
-
react_1.default.createElement(
|
|
74
|
+
var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b;
|
|
75
|
+
return (react_1.default.createElement(StyledUlItem, null,
|
|
76
|
+
react_1.default.createElement(UlBullet, { visible: showBullets }),
|
|
72
77
|
children));
|
|
73
78
|
};
|
|
74
79
|
var ListNumberedItem = function (_a) {
|
|
@@ -79,14 +84,14 @@ var ListNumberedItem = function (_a) {
|
|
|
79
84
|
};
|
|
80
85
|
var StyledList = styled_native_1.default.View(function (_a) {
|
|
81
86
|
var list = _a.theme.list, smallAndUp = _a.smallAndUp;
|
|
82
|
-
return (0, styled_native_1.css)(
|
|
87
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), smallAndUp ? list.marginTop[1] : list.marginTop[0], smallAndUp ? list.marginBottom[1] : list.marginBottom[0]);
|
|
83
88
|
});
|
|
84
89
|
var ListWrapper = (0, utils_1.styledComponentWithBreakpoints)(StyledList);
|
|
85
90
|
var Ul = function (_a) {
|
|
86
|
-
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
91
|
+
var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b, rest = __rest(_a, ["children", "showBullets"]);
|
|
87
92
|
var list = (0, react_1.useContext)(styled_native_1.ThemeContext).list;
|
|
88
93
|
return (react_1.default.createElement(ListWrapper, __assign({}, rest),
|
|
89
|
-
react_1.default.createElement(Stack_1.Stack, { spaceBetween: list.listItem.marginVertical }, react_1.Children.map(children, function (child) { return (react_1.default.createElement(ListBulletItem,
|
|
94
|
+
react_1.default.createElement(Stack_1.Stack, { spaceBetween: list.listItem.marginVertical }, react_1.Children.map(children, function (child) { return (react_1.default.createElement(ListBulletItem, { showBullets: showBullets }, child)); }))));
|
|
90
95
|
};
|
|
91
96
|
exports.Ul = Ul;
|
|
92
97
|
var Ol = function (_a) {
|
|
@@ -101,7 +106,7 @@ var StyledLi = styled_native_1.default.Text(function (_a) {
|
|
|
101
106
|
var fontSize = smallAndUp
|
|
102
107
|
? list.listItem.fontSize[1]
|
|
103
108
|
: list.listItem.fontSize[0];
|
|
104
|
-
return (0, styled_native_1.css)(
|
|
109
|
+
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, text.lineHeight), text.fontWeight, text.color, fontSize);
|
|
105
110
|
});
|
|
106
111
|
var Li = (0, utils_1.styledComponentWithBreakpoints)(StyledLi);
|
|
107
112
|
exports.Li = Li;
|
|
@@ -112,7 +117,7 @@ var StyledDtText = styled_native_1.default.Text(function (_a) {
|
|
|
112
117
|
var fontSize = smallAndUp
|
|
113
118
|
? list.listItem.fontSize[1]
|
|
114
119
|
: list.listItem.fontSize[0];
|
|
115
|
-
return (0, styled_native_1.css)(
|
|
120
|
+
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), list.descriptionTerm.fontFamily, list.descriptionTerm.fontWeight, (0, theme_1.calculateLineHeight)(fontSize, text.lineHeight), list.descriptionTerm.color, fontSize);
|
|
116
121
|
});
|
|
117
122
|
var DtText = (0, utils_1.styledComponentWithBreakpoints)(StyledDtText);
|
|
118
123
|
var StyledDtItem = styled_native_1.default.View(function (_a) {
|
|
@@ -123,7 +128,7 @@ var StyledDtItem = styled_native_1.default.View(function (_a) {
|
|
|
123
128
|
var marginBottom = smallAndUp
|
|
124
129
|
? list.descriptionTerm.marginBottom[1]
|
|
125
130
|
: list.descriptionTerm.marginBottom[0];
|
|
126
|
-
return (0, styled_native_1.css)(
|
|
131
|
+
return (0, styled_native_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "])), marginTop, marginBottom);
|
|
127
132
|
});
|
|
128
133
|
var DtItem = (0, utils_1.styledComponentWithBreakpoints)(StyledDtItem);
|
|
129
134
|
var Dt = function (_a) {
|
|
@@ -137,7 +142,7 @@ var StyledDdText = styled_native_1.default.Text(function (_a) {
|
|
|
137
142
|
var fontSize = smallAndUp
|
|
138
143
|
? list.listItem.fontSize[1]
|
|
139
144
|
: list.listItem.fontSize[0];
|
|
140
|
-
return (0, styled_native_1.css)(
|
|
145
|
+
return (0, styled_native_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, (0, theme_1.calculateLineHeight)(fontSize, text.lineHeight), text.fontWeight, text.color, fontSize);
|
|
141
146
|
});
|
|
142
147
|
var Dd = function (_a) {
|
|
143
148
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
@@ -146,4 +151,4 @@ var Dd = function (_a) {
|
|
|
146
151
|
react_1.default.createElement(StyledDdText, __assign({}, breakpoints), children)));
|
|
147
152
|
};
|
|
148
153
|
exports.Dd = Dd;
|
|
149
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
154
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { Breakpoints } from '../../hooks';
|
|
3
3
|
import { Theme } from '../../theme';
|
|
4
|
-
declare type SpaceKey = keyof Theme['space'];
|
|
4
|
+
declare type SpaceKey = keyof Theme['space'] | 0;
|
|
5
5
|
declare type MProps = {
|
|
6
6
|
mTop?: SpaceKey | SpaceKey[];
|
|
7
7
|
mBottom?: SpaceKey | SpaceKey[];
|
|
@@ -32,7 +32,9 @@ var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
|
32
32
|
var utils_1 = require("../../utils");
|
|
33
33
|
var StyledMargin = styled_native_1.default.View(function (_a) {
|
|
34
34
|
var space = _a.theme.space, mTop = _a.mTop, mBottom = _a.mBottom, mLeft = _a.mLeft, mRight = _a.mRight, horizontal = _a.horizontal, vertical = _a.vertical, all = _a.all, breakpoints = _a.breakpoints;
|
|
35
|
-
var formatter = function (spaceKey) {
|
|
35
|
+
var formatter = function (spaceKey) {
|
|
36
|
+
return spaceKey === 0 ? '0' : space[spaceKey];
|
|
37
|
+
};
|
|
36
38
|
return "\n ".concat(horizontal
|
|
37
39
|
? "\n ".concat((0, utils_1.responsiveStyle)('margin-left', horizontal, breakpoints, formatter), "\n ").concat((0, utils_1.responsiveStyle)('margin-right', horizontal, breakpoints, formatter), "\n ")
|
|
38
40
|
: '', "\n ").concat(vertical
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type NavHeaderProps = {
|
|
3
|
+
headline?: boolean;
|
|
4
|
+
options: NavHeaderOptions;
|
|
5
|
+
};
|
|
6
|
+
declare type NavHeaderOptions = {
|
|
7
|
+
title?: string;
|
|
8
|
+
statusBarHeight?: number;
|
|
9
|
+
header?(): React.ReactNode;
|
|
10
|
+
headerLeft?(): React.ReactNode;
|
|
11
|
+
canGoBack(): boolean;
|
|
12
|
+
goBack(): void;
|
|
13
|
+
};
|
|
14
|
+
export declare const NavHeader: ({ options, headline }: NavHeaderProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.NavHeader = void 0;
|
|
34
|
+
var react_1 = __importDefault(require("react"));
|
|
35
|
+
var react_native_1 = require("react-native");
|
|
36
|
+
var react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
37
|
+
var react_native_svg_1 = require("react-native-svg");
|
|
38
|
+
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
39
|
+
var Heading_1 = require("../Heading");
|
|
40
|
+
var BackIcon = function () {
|
|
41
|
+
return (react_1.default.createElement(react_native_svg_1.Svg, { width: "10", height: "16", viewBox: "0 0 10 16" },
|
|
42
|
+
react_1.default.createElement(react_native_svg_1.Path, { d: "M0.579956 8L8.57996 16L9.99996 14.58L3.41996 8L9.99996 1.42L8.57996 0L0.579956 8Z", fill: "white" })));
|
|
43
|
+
};
|
|
44
|
+
var StyledText = styled_native_1.default.Text(function (_a) {
|
|
45
|
+
var _b = _a.theme, colors = _b.colors, fonts = _b.fonts, fontWeights = _b.fontWeights, fontSizes = _b.fontSizes;
|
|
46
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-family: ", ";\n "], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-family: ", ";\n "])), colors.primaryContrast, fontSizes[1], fontWeights.normal, fonts.body);
|
|
47
|
+
});
|
|
48
|
+
var LeftHeaderText = (0, styled_native_1.default)(StyledText)(function (_a) {
|
|
49
|
+
var space = _a.theme.space;
|
|
50
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n "], ["\n padding-left: ", ";\n "])), space[2]);
|
|
51
|
+
});
|
|
52
|
+
var FeedbackText = (0, styled_native_1.default)(StyledText)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
|
|
53
|
+
var HeadlineView = (0, styled_native_1.default)(react_native_reanimated_1.default.View)(function (_a) {
|
|
54
|
+
var space = _a.theme.space;
|
|
55
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 0 ", " ", ";\n "], ["\n padding: 0 ", " ", ";\n "])), space[3], space[3]);
|
|
56
|
+
});
|
|
57
|
+
var RootView = styled_native_1.default.View(function (_a) {
|
|
58
|
+
var colors = _a.theme.colors;
|
|
59
|
+
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n "], ["\n background-color: ", ";\n overflow: hidden;\n "])), colors.primary);
|
|
60
|
+
});
|
|
61
|
+
var StyledView = (0, styled_native_1.default)(react_native_reanimated_1.default.View)(function (_a) {
|
|
62
|
+
var space = _a.theme.space, marginTop = _a.marginTop;
|
|
63
|
+
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "], ["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "])), space[3], space[2], marginTop !== null && marginTop !== void 0 ? marginTop : 0);
|
|
64
|
+
});
|
|
65
|
+
var StyledHeading4 = (0, styled_native_1.default)(Heading_1.Heading4)(function (_a) {
|
|
66
|
+
var _b = _a.theme, fonts = _b.fonts, fontWeights = _b.fontWeights, colors = _b.colors, textAlign = _a.textAlign;
|
|
67
|
+
return (0, styled_native_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "])), fonts.bold, fontWeights.bold, colors.primaryContrast, textAlign);
|
|
68
|
+
});
|
|
69
|
+
var StyledHeading3 = (0, styled_native_1.default)(Heading_1.Heading3)(function (_a) {
|
|
70
|
+
var colors = _a.theme.colors;
|
|
71
|
+
return (0, styled_native_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "], ["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "])), colors.primaryContrast);
|
|
72
|
+
});
|
|
73
|
+
var NavHeader = function (_a) {
|
|
74
|
+
var options = _a.options, headline = _a.headline;
|
|
75
|
+
return (react_1.default.createElement(RootView, { layout: react_native_reanimated_1.Layout.duration(150) },
|
|
76
|
+
react_1.default.createElement(StyledView, { marginTop: options === null || options === void 0 ? void 0 : options.statusBarHeight },
|
|
77
|
+
(options === null || options === void 0 ? void 0 : options.headerLeft) ? (options === null || options === void 0 ? void 0 : options.headerLeft()) : (options === null || options === void 0 ? void 0 : options.canGoBack()) ? (react_1.default.createElement(react_native_1.TouchableOpacity, { style: {
|
|
78
|
+
flexDirection: 'row',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
flex: 1,
|
|
81
|
+
flexGrow: 1,
|
|
82
|
+
flexShrink: 1,
|
|
83
|
+
}, onPress: options === null || options === void 0 ? void 0 : options.goBack },
|
|
84
|
+
react_1.default.createElement(BackIcon, null),
|
|
85
|
+
react_1.default.createElement(LeftHeaderText, null, "Back"))) : null,
|
|
86
|
+
react_1.default.createElement(react_native_reanimated_1.default.View, { entering: react_native_reanimated_1.FadeIn, exiting: react_native_reanimated_1.FadeOut, style: { flex: 1, flexGrow: 3, flexShrink: 1 } },
|
|
87
|
+
react_1.default.createElement(StyledHeading4, { textAlign: (options === null || options === void 0 ? void 0 : options.canGoBack()) ? 'center' : 'left', numberOfLines: 1 }, !headline ? options === null || options === void 0 ? void 0 : options.title : ' ')),
|
|
88
|
+
react_1.default.createElement(react_native_1.TouchableOpacity, { style: { flex: 1, flexGrow: 1, flexShrink: 1 } },
|
|
89
|
+
react_1.default.createElement(FeedbackText, null, "Feedback"))),
|
|
90
|
+
headline ? (react_1.default.createElement(HeadlineView, { entering: react_native_reanimated_1.FadeIn, exiting: react_native_reanimated_1.FadeOut }, (options === null || options === void 0 ? void 0 : options.title) ? (react_1.default.createElement(StyledHeading3, null, options.title)) : null)) : null));
|
|
91
|
+
};
|
|
92
|
+
exports.NavHeader = NavHeader;
|
|
93
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavHeader } from './NavHeader';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavHeader = void 0;
|
|
4
|
+
var NavHeader_1 = require("./NavHeader");
|
|
5
|
+
Object.defineProperty(exports, "NavHeader", { enumerable: true, get: function () { return NavHeader_1.NavHeader; } });
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import React, { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
import { Breakpoints } from '../../hooks';
|
|
3
4
|
export declare type NotificationVariantName = 'error' | 'success' | 'info' | 'warning';
|
|
4
5
|
export declare type NotificationVariant = {
|
|
5
6
|
background: string;
|
|
6
7
|
borderColor: string;
|
|
8
|
+
textColor: string;
|
|
7
9
|
};
|
|
8
10
|
declare type NotificationProps = Omit<ComponentProps<typeof Notification>, 'variant'>;
|
|
11
|
+
export declare const NotificationContentBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme, {
|
|
12
|
+
variant: NotificationVariantName | (string & {});
|
|
13
|
+
} & Breakpoints, never>;
|
|
14
|
+
export declare const NotificationTitleBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme, {
|
|
15
|
+
variant: NotificationVariantName | (string & {});
|
|
16
|
+
noMargin?: boolean | undefined;
|
|
17
|
+
dismissable: boolean;
|
|
18
|
+
} & Breakpoints, never>;
|
|
9
19
|
export declare const Notification: React.ForwardRefExoticComponent<{
|
|
10
20
|
variant?: (string & {}) | NotificationVariantName | undefined;
|
|
11
21
|
title?: ReactNode;
|
|
@@ -49,42 +49,75 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
49
49
|
return t;
|
|
50
50
|
};
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
exports.WarningNotification = exports.InfoNotification = exports.SuccessNotification = exports.ErrorNotification = exports.Notification = void 0;
|
|
52
|
+
exports.WarningNotification = exports.InfoNotification = exports.SuccessNotification = exports.ErrorNotification = exports.Notification = exports.NotificationTitleBox = exports.NotificationContentBox = void 0;
|
|
53
53
|
var react_1 = __importStar(require("react"));
|
|
54
54
|
var react_native_1 = require("react-native");
|
|
55
55
|
var hooks_1 = require("../../hooks");
|
|
56
56
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
57
|
-
var Heading_1 = require("../Heading");
|
|
58
57
|
var Icon_1 = require("../Icon");
|
|
58
|
+
var pxToNumber = function (value) { return parseInt(value.replace('px', '')); };
|
|
59
|
+
var numberToPx = function (value) { return "".concat(value, "px"); };
|
|
59
60
|
var NotificationBox = styled_native_1.default.View(function (_a) {
|
|
60
|
-
var _b = _a.theme, notification = _b.notification, space = _b.space,
|
|
61
|
+
var _b = _a.theme, notification = _b.notification, space = _b.space, variant = _a.variant, noMargin = _a.noMargin;
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
var currentVariant = notification.variants[variant];
|
|
64
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n "], ["\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n "])), notification.borderWidth, currentVariant.borderColor, notification.borderRadius, noMargin ? 0 : space[4]);
|
|
65
|
+
});
|
|
66
|
+
exports.NotificationContentBox = styled_native_1.default.View(function (_a) {
|
|
67
|
+
var _b = _a.theme, colors = _b.colors, _c = _b.notification, paddingX = _c.paddingX, paddingY = _c.paddingY, variants = _c.variants, smallAndUp = _a.smallAndUp, variant = _a.variant;
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
var currentVariant = variants[variant];
|
|
70
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "], ["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "])), paddingX[smallAndUp ? 1 : 0], paddingY[smallAndUp ? 1 : 0], currentVariant.textColor, colors.body, currentVariant.textColor);
|
|
71
|
+
});
|
|
72
|
+
exports.NotificationTitleBox = styled_native_1.default.View(function (_a) {
|
|
73
|
+
var notification = _a.theme.notification, variant = _a.variant, dismissable = _a.dismissable, smallAndUp = _a.smallAndUp;
|
|
61
74
|
// @ts-ignore to support additional palettes.
|
|
62
75
|
var currentVariant = notification.variants[variant];
|
|
63
|
-
return (0, styled_native_1.css)(
|
|
76
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.background, notification.paddingX[smallAndUp ? 1 : 0], notification.paddingX[smallAndUp ? 1 : 0], notification.paddingY[smallAndUp ? 1 : 0], dismissable
|
|
77
|
+
? numberToPx(pxToNumber(notification.dismiss.touchSize) -
|
|
78
|
+
pxToNumber(notification.dismiss.size))
|
|
79
|
+
: notification.paddingY[smallAndUp ? 1 : 0]);
|
|
80
|
+
});
|
|
81
|
+
var NotificationTitle = styled_native_1.default.Text(function (_a) {
|
|
82
|
+
var _b = _a.theme, fonts = _b.fonts, fontWeights = _b.fontWeights, responsiveFontSizes = _b.responsiveFontSizes, notification = _b.notification, variant = _a.variant;
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
var currentVariant = notification.variants[variant];
|
|
85
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n "])), currentVariant.textColor, fonts.bold, fontWeights.bold, responsiveFontSizes.body[0]);
|
|
64
86
|
});
|
|
65
|
-
var NotificationTitle = (0, styled_native_1.default)(Heading_1.Heading2)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: 0;\n"], ["\n margin-top: 0;\n"])));
|
|
66
87
|
var DismissButton = styled_native_1.default.TouchableOpacity(function (_a) {
|
|
67
88
|
var notification = _a.theme.notification;
|
|
68
|
-
return (0, styled_native_1.css)(
|
|
89
|
+
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "], ["\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "])), notification.dismiss.touchSize, notification.dismiss.touchSize);
|
|
69
90
|
});
|
|
70
91
|
exports.Notification = (0, react_1.forwardRef)(function (_a, ref) {
|
|
71
|
-
var
|
|
92
|
+
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, _c = _a.title, title = _c === void 0 ? 'Info' : _c, noMargin = _a.noMargin, dismissable = _a.dismissable, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissable", "onDismiss"]);
|
|
72
93
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
73
94
|
var theme = (0, react_1.useContext)(styled_native_1.ThemeContext);
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
var _d = (0, react_1.useState)(false), dismissed = _d[0], setDismissed = _d[1];
|
|
96
|
+
if (dismissed) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
var renderDismissButton = function () {
|
|
100
|
+
if (!dismissable)
|
|
101
|
+
return null;
|
|
102
|
+
return (react_1.default.createElement(DismissButton, { accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
|
|
77
103
|
setDismissed(true);
|
|
78
104
|
if (onDismiss) {
|
|
79
105
|
onDismiss();
|
|
80
106
|
}
|
|
81
107
|
} },
|
|
82
|
-
react_1.default.createElement(Icon_1.Icon, { name: theme.notification.dismiss.icon, size: theme.notification.dismiss.size
|
|
83
|
-
|
|
84
|
-
|
|
108
|
+
react_1.default.createElement(Icon_1.Icon, { name: theme.notification.dismiss.icon, size: theme.notification.dismiss.size,
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
color: theme.notification.variants[variant].textColor })));
|
|
111
|
+
};
|
|
112
|
+
return (react_1.default.createElement(react_native_1.View, __assign({ ref: ref }, rest),
|
|
113
|
+
react_1.default.createElement(NotificationBox, __assign({ variant: variant, noMargin: noMargin, testID: "nb-notification" }, breakpoints),
|
|
114
|
+
react_1.default.createElement(exports.NotificationTitleBox, __assign({ variant: variant, "data-testid": "nb-notification-box", dismissable: dismissable }, breakpoints),
|
|
115
|
+
react_1.default.createElement(NotificationTitle, { variant: variant }, title),
|
|
116
|
+
renderDismissButton()),
|
|
117
|
+
children ? (react_1.default.createElement(exports.NotificationContentBox, __assign({ variant: variant }, breakpoints), children)) : null)));
|
|
85
118
|
});
|
|
86
|
-
exports.ErrorNotification = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "error", title:
|
|
87
|
-
exports.SuccessNotification = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "success" }, props))); });
|
|
119
|
+
exports.ErrorNotification = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "error", title: "Oops, there\u2019s a problem\u2026" }, props))); });
|
|
120
|
+
exports.SuccessNotification = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(exports.Notification, __assign({ title: "Success", ref: ref, variant: "success" }, props))); });
|
|
88
121
|
exports.InfoNotification = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "info" }, props)); });
|
|
89
|
-
exports.WarningNotification = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "warning" }, props)); });
|
|
90
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
122
|
+
exports.WarningNotification = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(exports.Notification, __assign({ title: "Warning", ref: ref, variant: "warning" }, props))); });
|
|
123
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -58,7 +58,7 @@ var react_native_1 = require("react-native");
|
|
|
58
58
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
59
59
|
var utils_1 = require("../../utils");
|
|
60
60
|
var HintText_1 = require("../HintText");
|
|
61
|
-
var
|
|
61
|
+
var LabelText_1 = require("../LabelText");
|
|
62
62
|
var StyledRadioInputWrapper = styled_native_1.default.View(function (_a) {
|
|
63
63
|
var radio = _a.theme.radio;
|
|
64
64
|
var radioSize = (0, utils_1.pxToNumber)(radio.size);
|
|
@@ -66,11 +66,15 @@ var StyledRadioInputWrapper = styled_native_1.default.View(function (_a) {
|
|
|
66
66
|
return "\n width: ".concat(radioSize + gap, "px;\n height: ").concat(radio.touchSize, ";\n ");
|
|
67
67
|
});
|
|
68
68
|
var StyledRadioInput = styled_native_1.default.View(function (_a) {
|
|
69
|
-
var radio = _a.theme.radio, invalid = _a.invalid;
|
|
69
|
+
var radio = _a.theme.radio, invalid = _a.invalid, checked = _a.checked;
|
|
70
70
|
var touchSize = (0, utils_1.pxToNumber)(radio.touchSize);
|
|
71
71
|
var radioSize = (0, utils_1.pxToNumber)(radio.size);
|
|
72
72
|
var radioDistance = (touchSize - radioSize) / 2;
|
|
73
|
-
return "\n width: ".concat(radio.size, ";\n height: ").concat(radio.size, ";\n border: ").concat(radio.borderWidth, " solid;\n margin-top: ").concat(radioDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n border-color: ").concat(invalid
|
|
73
|
+
return "\n width: ".concat(radio.size, ";\n height: ").concat(radio.size, ";\n border: ").concat(radio.borderWidth, " solid;\n margin-top: ").concat(radioDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n border-color: ").concat(invalid
|
|
74
|
+
? radio.errorColor
|
|
75
|
+
: checked
|
|
76
|
+
? radio.dotColor
|
|
77
|
+
: radio.borderColor, ";\n background: ").concat(radio.background, ";\n background: ").concat(checked ? radio.checkedBackground : radio.background, ";\n ");
|
|
74
78
|
});
|
|
75
79
|
var StyledRadioInputDot = styled_native_1.default.View(function (_a) {
|
|
76
80
|
var radio = _a.theme.radio, checked = _a.checked;
|
|
@@ -83,10 +87,10 @@ var StyledRadioInputDot = styled_native_1.default.View(function (_a) {
|
|
|
83
87
|
var Input = function (_a) {
|
|
84
88
|
var checked = _a.checked, invalid = _a.invalid, rest = __rest(_a, ["checked", "invalid"]);
|
|
85
89
|
return (react_1.default.createElement(StyledRadioInputWrapper, __assign({}, rest),
|
|
86
|
-
react_1.default.createElement(StyledRadioInput, { invalid: invalid },
|
|
90
|
+
react_1.default.createElement(StyledRadioInput, { invalid: invalid, checked: checked },
|
|
87
91
|
react_1.default.createElement(StyledRadioInputDot, { checked: checked }))));
|
|
88
92
|
};
|
|
89
|
-
var
|
|
93
|
+
var RadioLabelText = (0, styled_native_1.default)(LabelText_1.LabelText)(function (_a) {
|
|
90
94
|
var space = _a.theme.space;
|
|
91
95
|
return "\n padding-top: ".concat(space[3], ";\n ");
|
|
92
96
|
});
|
|
@@ -103,7 +107,7 @@ var Radio = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
103
107
|
react_1.default.createElement(StyledWrapper, null,
|
|
104
108
|
react_1.default.createElement(Input, { checked: checked, invalid: invalid }),
|
|
105
109
|
react_1.default.createElement(react_native_1.View, { style: { flexShrink: 1 } },
|
|
106
|
-
react_1.default.createElement(
|
|
110
|
+
react_1.default.createElement(RadioLabelText, null, label),
|
|
107
111
|
hint ? react_1.default.createElement(HintText_1.HintText, null, hint) : null))));
|
|
108
112
|
});
|
|
109
113
|
exports.Radio = Radio;
|
|
@@ -58,8 +58,8 @@ var StyledText = styled_native_1.default.Text(function (_a) {
|
|
|
58
58
|
return "\n font-size: ".concat(tabs.tab.fontSize[smallAndUp ? 1 : 0], ";\n font-family: ").concat(tabs.tab.fontFamily, ";\n font-weight: ").concat(tabs.tab.fontWeight, ";\n background-color: ").concat(active ? tabs.tab.active.backgroundColor : tabs.tab.inactive.backgroundColor, ";\n line-height: ").concat("".concat(tabs.tab.lineHeight * (0, utils_1.pxToNumber)(tabs.tab.fontSize[0]), "px"), ";\n color: ").concat(active ? tabs.tab.active.foregroundColor : tabs.tab.inactive.foregroundColor, ";\n text-align: center;\n padding: ").concat("".concat(tabs.tab.paddingVertical[smallAndUp ? 1 : 0], " ").concat(tabs.tab.paddingHorizontal[smallAndUp ? 1 : 0]), ";\n");
|
|
59
59
|
});
|
|
60
60
|
var StyledTouchableOpacity = styled_native_1.default.TouchableOpacity(function (_a) {
|
|
61
|
-
var _b = _a.active, active = _b === void 0 ? false : _b, _c = _a.first, first = _c === void 0 ? false : _c, _d = _a.last, last = _d === void 0 ? false : _d, _e = _a.stretch, stretch = _e === void 0 ? false : _e, _f = _a.theme, card = _f.card, tabs = _f.tabs;
|
|
62
|
-
return "flex-grow: ".concat(stretch ? 1 : 0, ";\n border: ").concat(card.borderWidth, " solid ").concat(
|
|
61
|
+
var _b = _a.active, active = _b === void 0 ? false : _b, _c = _a.first, first = _c === void 0 ? false : _c, _d = _a.last, last = _d === void 0 ? false : _d, _e = _a.stretch, stretch = _e === void 0 ? false : _e, _f = _a.theme, card = _f.card, tabs = _f.tabs, inline = _a.inline;
|
|
62
|
+
return "flex-grow: ".concat(stretch ? 1 : 0, ";\n border: ").concat(card.borderWidth, " solid ").concat(tabs.tab.borderColor, ";\n border-bottom-color: ").concat(active ? tabs.tab.active.backgroundColor : card.borderColor, ";\n border-top-color: ").concat(inline ? card.borderColor : tabs.tab.borderColor, ";\n border-right-color: ").concat(last && inline ? card.borderColor : tabs.tab.borderColor, "};\n border-left-color: ").concat(first && inline ? card.borderColor : tabs.tab.borderColor, "};\n border-right-width: ").concat(card.borderWidth, ";\n border-left-width: ").concat(first ? card.borderWidth : 0, ";\n background-color: ").concat(active ? tabs.tab.active.borderColor : tabs.tab.inactive.backgroundColor, ";\n padding-bottom: ").concat(tabs.tab.borderBottomWidth, ";\n");
|
|
63
63
|
});
|
|
64
64
|
exports.Tab = (0, react_1.forwardRef)(function (
|
|
65
65
|
// eslint-disable-next-line
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TabList: import("styled-components").StyledComponent<({ children, setActiveTab, activeTab, tabRefs, fullWidth, ...rest }: any) => JSX.Element, import("../../theme/theme").Theme, {}, never>;
|
|
1
|
+
export declare const TabList: import("styled-components").StyledComponent<({ children, setActiveTab, activeTab, tabRefs, fullWidth, inline, ...rest }: any) => JSX.Element, import("../../theme/theme").Theme, {}, never>;
|
|
@@ -55,7 +55,7 @@ var react_native_1 = require("react-native");
|
|
|
55
55
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
56
56
|
var utils_1 = require("../../utils");
|
|
57
57
|
exports.TabList = (0, styled_native_1.default)(function (_a) {
|
|
58
|
-
var children = _a.children, setActiveTab = _a.setActiveTab, activeTab = _a.activeTab, tabRefs = _a.tabRefs, fullWidth = _a.fullWidth, rest = __rest(_a, ["children", "setActiveTab", "activeTab", "tabRefs", "fullWidth"]);
|
|
58
|
+
var children = _a.children, setActiveTab = _a.setActiveTab, activeTab = _a.activeTab, tabRefs = _a.tabRefs, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "setActiveTab", "activeTab", "tabRefs", "fullWidth", "inline"]);
|
|
59
59
|
return (react_1.default.createElement(react_native_1.View, __assign({ accessibilityRole: "tablist" }, rest), react_1.Children.map(children, function (child, i) {
|
|
60
60
|
return (0, react_1.cloneElement)(child, {
|
|
61
61
|
onPress: (0, utils_1.callAll)(function () { return setActiveTab && setActiveTab(i); }, child.props.onPress),
|
|
@@ -64,6 +64,7 @@ exports.TabList = (0, styled_native_1.default)(function (_a) {
|
|
|
64
64
|
ref: tabRefs[i],
|
|
65
65
|
first: i === 0,
|
|
66
66
|
last: react_1.Children.count(children) - 1 === i,
|
|
67
|
+
inline: inline,
|
|
67
68
|
});
|
|
68
69
|
})));
|
|
69
70
|
})(function (_a) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { FullWidthOptions } from '../../hooks';
|
|
3
|
-
export declare const Tabs: import("styled-components").StyledComponent<({ children, defaultSelected, onSelected, fullWidth, ...rest }: {
|
|
3
|
+
export declare const Tabs: import("styled-components").StyledComponent<({ children, defaultSelected, onSelected, fullWidth, inline, ...rest }: {
|
|
4
4
|
defaultSelected?: number | undefined;
|
|
5
5
|
inline?: boolean | undefined;
|
|
6
6
|
children: ReactNode;
|
|
@@ -57,7 +57,7 @@ var Card_1 = require("../Card");
|
|
|
57
57
|
var TabList_1 = require("./TabList");
|
|
58
58
|
var TabPanel_1 = require("./TabPanel");
|
|
59
59
|
exports.Tabs = (0, styled_native_1.default)(function (_a) {
|
|
60
|
-
var children = _a.children, _b = _a.defaultSelected, defaultSelected = _b === void 0 ? 0 : _b, onSelected = _a.onSelected, fullWidth = _a.fullWidth, rest = __rest(_a, ["children", "defaultSelected", "onSelected", "fullWidth"]);
|
|
60
|
+
var children = _a.children, _b = _a.defaultSelected, defaultSelected = _b === void 0 ? 0 : _b, onSelected = _a.onSelected, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "defaultSelected", "onSelected", "fullWidth", "inline"]);
|
|
61
61
|
var _c = (0, react_1.useState)(defaultSelected), activeTab = _c[0], setActiveTab = _c[1];
|
|
62
62
|
var tabList = (0, utils_1.filterChildrenByType)(children, TabList_1.TabList);
|
|
63
63
|
var tabPanels = (0, utils_1.filterChildrenByType)(children, TabPanel_1.TabPanel);
|
|
@@ -78,6 +78,7 @@ exports.Tabs = (0, styled_native_1.default)(function (_a) {
|
|
|
78
78
|
activeTab: activeTab,
|
|
79
79
|
tabRefs: tabRefs,
|
|
80
80
|
fullWidth: fullWidth,
|
|
81
|
+
inline: inline,
|
|
81
82
|
});
|
|
82
83
|
}),
|
|
83
84
|
tabPanels
|
|
@@ -87,7 +88,8 @@ exports.Tabs = (0, styled_native_1.default)(function (_a) {
|
|
|
87
88
|
hidden: activeTab !== index,
|
|
88
89
|
});
|
|
89
90
|
})));
|
|
90
|
-
})(function () {
|
|
91
|
-
|
|
91
|
+
})(function (_a) {
|
|
92
|
+
var _b = _a.theme, card = _b.card, tabs = _b.tabs, inline = _a.inline;
|
|
93
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border: ", " solid\n ", ";\n "], ["\n padding: 0;\n border: ", " solid\n ", ";\n "])), card.borderWidth, inline ? card.borderColor : tabs.tab.borderColor);
|
|
92
94
|
});
|
|
93
95
|
var templateObject_1;
|
|
@@ -53,12 +53,12 @@ exports.TextGroup = exports.LineThrough = exports.Em = exports.Strong = exports.
|
|
|
53
53
|
var react_1 = __importStar(require("react"));
|
|
54
54
|
var react_native_1 = require("react-native");
|
|
55
55
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
56
|
-
var theme_1 = require("../../theme");
|
|
57
56
|
var utils_1 = require("../../utils");
|
|
58
57
|
var StyledP = styled_native_1.default.Text(function (_a) {
|
|
59
58
|
var text = _a.theme.text, smallAndUp = _a.smallAndUp;
|
|
60
59
|
var fontSize = smallAndUp ? text.p.fontSize[1] : text.p.fontSize[0];
|
|
61
|
-
|
|
60
|
+
var lineHeight = smallAndUp ? text.p.lineHeight[1] : text.p.lineHeight[0];
|
|
61
|
+
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 margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), text.fontFamily, text.fontWeight, fontSize, lineHeight, text.color, smallAndUp ? text.p.marginTop[1] : text.p.marginTop[0], smallAndUp
|
|
62
62
|
? text.p.marginBottom[1]
|
|
63
63
|
: text.p.marginBottom[0]);
|
|
64
64
|
});
|
|
@@ -70,7 +70,7 @@ var StyledSmall = styled_native_1.default.Text(function (_a) {
|
|
|
70
70
|
exports.Small = (0, utils_1.styledComponentWithBreakpoints)(StyledSmall);
|
|
71
71
|
exports.Strong = styled_native_1.default.Text(function (_a) {
|
|
72
72
|
var text = _a.theme.text;
|
|
73
|
-
return "\n font-weight: ".concat(text.strong.fontWeight, ";\n ");
|
|
73
|
+
return "\n font-family: ".concat(text.strong.fontFamily, ";\n font-weight: ").concat(text.strong.fontWeight, ";\n ");
|
|
74
74
|
});
|
|
75
75
|
exports.Em = styled_native_1.default.Text(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-style: italic;\n"], ["\n font-style: italic;\n"])));
|
|
76
76
|
exports.LineThrough = styled_native_1.default.Text(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n text-decoration: line-through;\n"], ["\n text-decoration: line-through;\n"])));
|
|
@@ -4,8 +4,8 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const CurrencyField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?: (string & {}) | import("
|
|
8
|
-
iconRight?: (string & {}) | import("
|
|
7
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
9
9
|
} & {
|
|
10
10
|
currency?: "GBP" | "EUR" | "AUD" | "USD" | undefined;
|
|
11
11
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,6 +4,6 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const EmailField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?: (string & {}) | import("
|
|
8
|
-
iconRight?: (string & {}) | import("
|
|
7
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
9
9
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,6 +4,6 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const NumberField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?: (string & {}) | import("
|
|
8
|
-
iconRight?: (string & {}) | import("
|
|
7
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
9
9
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,6 +4,6 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const PasswordField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?: (string & {}) | import("
|
|
8
|
-
iconRight?: (string & {}) | import("
|
|
7
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
9
9
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,6 +4,6 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const TelField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?: (string & {}) | import("
|
|
8
|
-
iconRight?: (string & {}) | import("
|
|
7
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
9
9
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,6 +4,6 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const TextField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?: (string & {}) | import("
|
|
8
|
-
iconRight?: (string & {}) | import("
|
|
7
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
9
9
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,8 +4,8 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const TextareaField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?: (string & {}) | import("
|
|
8
|
-
iconRight?: (string & {}) | import("
|
|
7
|
+
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
9
9
|
} & {
|
|
10
10
|
rows?: number | undefined;
|
|
11
11
|
} & React.RefAttributes<NativeTextInput>>;
|