@ovotech/element-native 2.2.0 → 3.0.0-canary-edaf96f-93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +2 -2
- package/dist/components/Accordion/Accordion.js +22 -25
- package/dist/components/Accordion/Group.js +10 -32
- package/dist/components/Accordion/Icon.js +19 -14
- package/dist/components/Accordion/hooks.d.ts +1 -1
- package/dist/components/Accordion/hooks.js +3 -26
- package/dist/components/Accordion/styles.d.ts +688 -46
- package/dist/components/Accordion/styles.js +56 -49
- package/dist/components/Badge/Badge.d.ts +54 -46
- package/dist/components/Badge/Badge.js +35 -20
- package/dist/components/CTAButton/CTAButton.d.ts +7 -12
- package/dist/components/CTAButton/CTAButton.js +23 -27
- package/dist/components/CTALink/CTALink.d.ts +4 -4
- package/dist/components/CTALink/CTALink.js +5 -27
- package/dist/components/Card/Card.d.ts +47 -45
- package/dist/components/Card/Card.js +5 -25
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.js +18 -57
- package/dist/components/Checkbox/CheckboxField.js +7 -37
- package/dist/components/DataTable/DataTable.d.ts +3 -12
- package/dist/components/DataTable/DataTable.js +11 -98
- package/dist/components/DataTable/TableRow.d.ts +2 -0
- package/dist/components/DataTable/TableRow.js +31 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +16 -0
- package/dist/components/DataTable/styles.d.ts +2517 -0
- package/dist/components/DataTable/styles.js +77 -0
- package/dist/components/DataTable/types.d.ts +15 -0
- package/dist/components/DataTable/types.js +2 -0
- package/dist/components/DateField/DateField.d.ts +2 -2
- package/dist/components/DateField/DateField.js +9 -28
- package/dist/components/DescriptionList/DescriptionList.js +8 -32
- package/dist/components/DescriptionList/styled.d.ts +50 -44
- package/dist/components/DescriptionList/styled.js +9 -34
- package/dist/components/Disclosure/Disclosure.d.ts +3 -3
- package/dist/components/Disclosure/Disclosure.js +12 -18
- package/dist/components/Divider/Divider.js +4 -7
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -28
- package/dist/components/ErrorText/ErrorText.d.ts +45 -39
- package/dist/components/ErrorText/ErrorText.js +7 -4
- package/dist/components/Field/Field.d.ts +2 -2
- package/dist/components/Field/Field.js +18 -49
- package/dist/components/FormGroup/FormGroup.js +2 -3
- package/dist/components/Grid/Col.d.ts +45 -39
- package/dist/components/Grid/Col.js +4 -3
- package/dist/components/Grid/Row.d.ts +47 -41
- package/dist/components/Grid/Row.js +7 -10
- package/dist/components/Heading/Heading.js +21 -32
- package/dist/components/HintText/HintText.d.ts +45 -39
- package/dist/components/HintText/HintText.js +7 -4
- package/dist/components/Icon/Icon.d.ts +3 -4
- package/dist/components/Icon/Icon.js +5 -27
- package/dist/components/Input/CurrencyInput.d.ts +6 -6
- package/dist/components/Input/CurrencyInput.js +3 -25
- package/dist/components/Input/EmailInput.d.ts +6 -6
- package/dist/components/Input/EmailInput.js +3 -25
- package/dist/components/Input/Input.d.ts +8 -8
- package/dist/components/Input/Input.js +26 -32
- package/dist/components/Input/NumberInput.d.ts +6 -6
- package/dist/components/Input/NumberInput.js +3 -25
- package/dist/components/Input/PasswordInput.d.ts +6 -6
- package/dist/components/Input/PasswordInput.js +3 -25
- package/dist/components/Input/PasswordInput.styled.d.ts +45 -39
- package/dist/components/Input/PasswordInput.styled.js +2 -5
- package/dist/components/Input/PasswordVisibilityToggle.js +14 -29
- package/dist/components/Input/PhoneInput.d.ts +10 -0
- package/dist/components/Input/PhoneInput.js +19 -0
- package/dist/components/Input/TextInput.d.ts +6 -6
- package/dist/components/Input/TextInput.js +3 -25
- package/dist/components/Input/TextareaInput.d.ts +6 -6
- package/dist/components/Input/TextareaInput.js +13 -10
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/LabelText/LabelText.d.ts +45 -39
- package/dist/components/LabelText/LabelText.js +5 -4
- package/dist/components/List/List.d.ts +149 -131
- package/dist/components/List/List.js +30 -44
- package/dist/components/Margin/Margin.d.ts +45 -39
- package/dist/components/Margin/Margin.js +3 -3
- package/dist/components/NavHeader/NavHeader.d.ts +1 -1
- package/dist/components/NavHeader/NavHeader.js +34 -35
- package/dist/components/Notification/Notification.d.ts +104 -100
- package/dist/components/Notification/Notification.js +32 -49
- package/dist/components/Radio/Radio.d.ts +3 -3
- package/dist/components/Radio/Radio.js +16 -61
- package/dist/components/Radio/RadioField.js +11 -41
- package/dist/components/SelectField/Select.d.ts +244 -0
- package/dist/components/SelectField/Select.js +102 -0
- package/dist/components/SelectField/SelectField.d.ts +7 -0
- package/dist/components/SelectField/SelectField.js +33 -0
- package/dist/components/SelectField/index.d.ts +1 -0
- package/dist/components/SelectField/index.js +5 -0
- package/dist/components/SkeletonLoading/Skeleton.d.ts +45 -39
- package/dist/components/SkeletonLoading/SkeletonAnimation.js +22 -33
- package/dist/components/SkeletonLoading/SkeletonCTA.js +4 -5
- package/dist/components/SkeletonLoading/SkeletonCircle.js +4 -6
- package/dist/components/SkeletonLoading/SkeletonHeading.js +4 -5
- package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/components/Stack/Stack.js +6 -28
- package/dist/components/Stretch/Stretch.js +2 -2
- package/dist/components/SubLabelText/SubLabelText.d.ts +45 -39
- package/dist/components/SubLabelText/SubLabelText.js +5 -4
- package/dist/components/SummaryList/SummaryList.js +8 -32
- package/dist/components/Tabs/Tab.d.ts +4 -4
- package/dist/components/Tabs/Tab.js +23 -20
- package/dist/components/Tabs/TabList.d.ts +11 -222
- package/dist/components/Tabs/TabList.js +22 -18
- package/dist/components/Tabs/TabPanel.js +33 -10
- package/dist/components/Tabs/Tabs.d.ts +8 -227
- package/dist/components/Tabs/Tabs.js +26 -23
- package/dist/components/Text/Text.d.ts +234 -204
- package/dist/components/Text/Text.js +17 -20
- package/dist/components/TextField/CurrencyField.d.ts +6 -6
- package/dist/components/TextField/CurrencyField.js +3 -26
- package/dist/components/TextField/EmailField.d.ts +6 -6
- package/dist/components/TextField/EmailField.js +3 -26
- package/dist/components/TextField/NumberField.d.ts +6 -6
- package/dist/components/TextField/NumberField.js +3 -26
- package/dist/components/TextField/PasswordField.d.ts +6 -6
- package/dist/components/TextField/PasswordField.js +3 -26
- package/dist/components/TextField/PhoneField.d.ts +10 -0
- package/dist/components/TextField/PhoneField.js +33 -0
- package/dist/components/TextField/TelField.d.ts +10 -6
- package/dist/components/TextField/TelField.js +9 -27
- package/dist/components/TextField/TextField.d.ts +6 -6
- package/dist/components/TextField/TextField.js +3 -26
- package/dist/components/TextField/TextareaField.d.ts +6 -6
- package/dist/components/TextField/TextareaField.js +3 -26
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TextField/index.js +3 -1
- package/dist/components/TextLink/TextLink.d.ts +4 -4
- package/dist/components/TextLink/TextLink.js +5 -8
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/components/Accordion/Accordion.js +25 -28
- package/dist/esm/components/Accordion/Group.js +10 -9
- package/dist/esm/components/Accordion/Icon.js +20 -12
- package/dist/esm/components/Accordion/hooks.js +3 -3
- package/dist/esm/components/Accordion/styles.js +29 -48
- package/dist/esm/components/Badge/Badge.js +35 -17
- package/dist/esm/components/CTAButton/CTAButton.js +24 -28
- package/dist/esm/components/CTALink/CTALink.js +5 -4
- package/dist/esm/components/Card/Card.js +5 -25
- package/dist/esm/components/Checkbox/Checkbox.js +15 -34
- package/dist/esm/components/Checkbox/CheckboxField.js +7 -14
- package/dist/esm/components/DataTable/DataTable.js +10 -74
- package/dist/esm/components/DataTable/TableRow.js +27 -0
- package/dist/esm/components/DataTable/index.js +2 -0
- package/dist/esm/components/DataTable/styles.js +51 -0
- package/dist/esm/components/DataTable/types.js +1 -0
- package/dist/esm/components/DateField/DateField.js +9 -28
- package/dist/esm/components/DescriptionList/DescriptionList.js +8 -9
- package/dist/esm/components/DescriptionList/styled.js +9 -31
- package/dist/esm/components/Disclosure/Disclosure.js +13 -19
- package/dist/esm/components/Divider/Divider.js +4 -4
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -5
- package/dist/esm/components/ErrorText/ErrorText.js +7 -4
- package/dist/esm/components/Field/Field.js +18 -26
- package/dist/esm/components/FormGroup/FormGroup.js +2 -3
- package/dist/esm/components/Grid/Col.js +4 -3
- package/dist/esm/components/Grid/Row.js +7 -7
- package/dist/esm/components/Heading/Heading.js +21 -29
- package/dist/esm/components/HintText/HintText.js +7 -4
- package/dist/esm/components/Icon/Icon.js +5 -4
- package/dist/esm/components/Input/CurrencyInput.js +3 -2
- package/dist/esm/components/Input/EmailInput.js +3 -2
- package/dist/esm/components/Input/Input.js +27 -33
- package/dist/esm/components/Input/NumberInput.js +3 -2
- package/dist/esm/components/Input/PasswordInput.js +3 -2
- package/dist/esm/components/Input/PasswordInput.styled.js +2 -5
- package/dist/esm/components/Input/PasswordVisibilityToggle.js +15 -7
- package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +4 -3
- package/dist/esm/components/Input/TextInput.js +3 -2
- package/dist/esm/components/Input/TextareaInput.js +13 -10
- package/dist/esm/components/Input/index.js +1 -1
- package/dist/esm/components/LabelText/LabelText.js +5 -4
- package/dist/esm/components/List/List.js +31 -45
- package/dist/esm/components/Margin/Margin.js +3 -3
- package/dist/esm/components/NavHeader/NavHeader.js +34 -32
- package/dist/esm/components/Notification/Notification.js +33 -50
- package/dist/esm/components/Radio/Radio.js +16 -38
- package/dist/esm/components/Radio/RadioField.js +11 -18
- package/dist/esm/components/SelectField/Select.js +75 -0
- package/dist/esm/components/SelectField/SelectField.js +29 -0
- package/dist/esm/components/SelectField/index.js +1 -0
- package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +23 -11
- package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +4 -5
- package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +4 -6
- package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +4 -5
- package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/esm/components/Stack/Stack.js +6 -5
- package/dist/esm/components/Stretch/Stretch.js +2 -2
- package/dist/esm/components/SubLabelText/SubLabelText.js +5 -4
- package/dist/esm/components/SummaryList/SummaryList.js +8 -9
- package/dist/esm/components/Tabs/Tab.js +23 -17
- package/dist/esm/components/Tabs/TabList.js +21 -18
- package/dist/esm/components/Tabs/TabPanel.js +10 -7
- package/dist/esm/components/Tabs/Tabs.js +25 -23
- package/dist/esm/components/Text/Text.js +17 -20
- package/dist/esm/components/TextField/CurrencyField.js +3 -3
- package/dist/esm/components/TextField/EmailField.js +3 -3
- package/dist/esm/components/TextField/NumberField.js +3 -3
- package/dist/esm/components/TextField/PasswordField.js +3 -3
- package/dist/esm/components/TextField/PhoneField.js +30 -0
- package/dist/esm/components/TextField/TelField.js +9 -4
- package/dist/esm/components/TextField/TextField.js +3 -3
- package/dist/esm/components/TextField/TextareaField.js +3 -3
- package/dist/esm/components/TextField/index.js +1 -0
- package/dist/esm/components/TextLink/TextLink.js +5 -8
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/hooks/use-breakpoint.js +4 -4
- package/dist/esm/providers/IconsProvider.js +3 -2
- package/dist/esm/providers/icons/ArrowDown.js +2 -3
- package/dist/esm/providers/icons/ArrowLeft.js +2 -3
- package/dist/esm/providers/icons/ArrowRight.js +2 -3
- package/dist/esm/providers/icons/ArrowUp.js +2 -3
- package/dist/esm/providers/icons/CaretDown.js +2 -3
- package/dist/esm/providers/icons/CaretLeft.js +2 -3
- package/dist/esm/providers/icons/CaretRight.js +2 -3
- package/dist/esm/providers/icons/CaretUp.js +2 -3
- package/dist/esm/providers/icons/Chart.js +2 -3
- package/dist/esm/providers/icons/Check.js +2 -3
- package/dist/esm/providers/icons/ChevronDown.js +2 -3
- package/dist/esm/providers/icons/ChevronLeft.js +2 -3
- package/dist/esm/providers/icons/ChevronLeftSmall.js +2 -3
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +2 -3
- package/dist/esm/providers/icons/ChevronRight.js +2 -3
- package/dist/esm/providers/icons/ChevronRightSmall.js +2 -3
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +2 -3
- package/dist/esm/providers/icons/ChevronUp.js +2 -3
- package/dist/esm/providers/icons/Cross.js +2 -3
- package/dist/esm/providers/icons/Dollar.js +2 -3
- package/dist/esm/providers/icons/Download.js +2 -3
- package/dist/esm/providers/icons/Electricity.js +2 -3
- package/dist/esm/providers/icons/Euro.js +2 -3
- package/dist/esm/providers/icons/Gas.js +2 -4
- package/dist/esm/providers/icons/Help.js +2 -3
- package/dist/esm/providers/icons/Hide.js +2 -3
- package/dist/esm/providers/icons/Home.js +2 -3
- package/dist/esm/providers/icons/Info.js +2 -3
- package/dist/esm/providers/icons/Link.js +2 -4
- package/dist/esm/providers/icons/Logo.js +3 -4
- package/dist/esm/providers/icons/Minus.js +2 -3
- package/dist/esm/providers/icons/NewWindow.js +2 -3
- package/dist/esm/providers/icons/PaymentCard.js +2 -3
- package/dist/esm/providers/icons/Plus.js +2 -3
- package/dist/esm/providers/icons/Pound.js +2 -3
- package/dist/esm/providers/icons/Search.js +2 -3
- package/dist/esm/providers/icons/Show.js +2 -3
- package/dist/esm/providers/icons/User.js +2 -3
- package/dist/esm/theme/create-theme.js +0 -153
- package/dist/esm/utils/utils.js +7 -3
- package/dist/hooks/use-breakpoint.js +4 -4
- package/dist/providers/IconsProvider.js +3 -25
- package/dist/providers/icons/ArrowDown.js +2 -6
- package/dist/providers/icons/ArrowLeft.js +2 -6
- package/dist/providers/icons/ArrowRight.js +2 -6
- package/dist/providers/icons/ArrowUp.js +2 -6
- package/dist/providers/icons/CaretDown.js +2 -6
- package/dist/providers/icons/CaretLeft.js +2 -6
- package/dist/providers/icons/CaretRight.js +2 -6
- package/dist/providers/icons/CaretUp.js +2 -6
- package/dist/providers/icons/Chart.js +2 -6
- package/dist/providers/icons/Check.js +2 -6
- package/dist/providers/icons/ChevronDown.js +2 -6
- package/dist/providers/icons/ChevronLeft.js +2 -6
- package/dist/providers/icons/ChevronLeftSmall.js +2 -6
- package/dist/providers/icons/ChevronLeftSmallFirst.js +2 -6
- package/dist/providers/icons/ChevronRight.js +2 -6
- package/dist/providers/icons/ChevronRightSmall.js +2 -6
- package/dist/providers/icons/ChevronRightSmallLast.js +2 -6
- package/dist/providers/icons/ChevronUp.js +2 -6
- package/dist/providers/icons/Cross.js +2 -6
- package/dist/providers/icons/Dollar.js +2 -6
- package/dist/providers/icons/Download.js +2 -6
- package/dist/providers/icons/Electricity.js +2 -6
- package/dist/providers/icons/Euro.js +2 -6
- package/dist/providers/icons/Gas.js +2 -7
- package/dist/providers/icons/Help.js +2 -6
- package/dist/providers/icons/Hide.js +2 -6
- package/dist/providers/icons/Home.js +2 -6
- package/dist/providers/icons/Info.js +2 -6
- package/dist/providers/icons/Link.js +2 -7
- package/dist/providers/icons/Logo.js +2 -6
- package/dist/providers/icons/Minus.js +2 -6
- package/dist/providers/icons/NewWindow.js +2 -6
- package/dist/providers/icons/PaymentCard.js +2 -6
- package/dist/providers/icons/Plus.js +2 -6
- package/dist/providers/icons/Pound.js +2 -6
- package/dist/providers/icons/Search.js +2 -6
- package/dist/providers/icons/Show.js +2 -6
- package/dist/providers/icons/User.js +2 -6
- package/dist/styled.native.d.ts +270 -234
- package/dist/theme/create-theme.js +0 -153
- package/dist/theme/index.d.ts +45 -39
- package/dist/theme/theme.d.ts +0 -90
- package/dist/utils/utils.d.ts +5 -4
- package/dist/utils/utils.js +8 -26
- package/package.json +6 -5
- package/dist/components/Input/TelInput.d.ts +0 -10
- package/dist/components/Input/TelInput.js +0 -41
|
@@ -20,7 +20,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { Children, cloneElement } from 'react';
|
|
24
25
|
import { View } from 'react-native';
|
|
25
26
|
import { ErrorText } from '../ErrorText';
|
|
26
27
|
import { FormGroup } from '../FormGroup';
|
|
@@ -30,18 +31,10 @@ import { Stack } from '../Stack';
|
|
|
30
31
|
var CheckboxField = function (_a) {
|
|
31
32
|
var label = _a.label, hint = _a.hint, error = _a.error, children = _a.children, _b = _a.optional, optional = _b === void 0 ? false : _b, rest = __rest(_a, ["label", "hint", "error", "children", "optional"]);
|
|
32
33
|
var hasError = !!error;
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
optional ? ' (optional)' : null),
|
|
39
|
-
hint ? React.createElement(HintText, null, hint) : null,
|
|
40
|
-
error ? React.createElement(ErrorText, null, error) : null),
|
|
41
|
-
React.createElement(View, null, Children.map(children, function (child) {
|
|
42
|
-
return cloneElement(child, {
|
|
43
|
-
invalid: hasError ? true : child.props.invalid,
|
|
44
|
-
});
|
|
45
|
-
})))));
|
|
34
|
+
return (_jsx(FormGroup, __assign({}, rest, { error: hasError }, { children: _jsxs(Stack, __assign({ spaceBetween: 1 }, { children: [_jsxs(View, { children: [_jsxs(LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null, error ? _jsx(ErrorText, { children: error }) : null] }), _jsx(View, { children: Children.map(children, function (child) {
|
|
35
|
+
return cloneElement(child, {
|
|
36
|
+
invalid: hasError ? true : child.props.invalid,
|
|
37
|
+
});
|
|
38
|
+
}) })] })) })));
|
|
46
39
|
};
|
|
47
40
|
export { CheckboxField };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
var __assign = (this && this.__assign) || function () {
|
|
6
2
|
__assign = Object.assign || function(t) {
|
|
7
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -24,84 +20,24 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
20
|
}
|
|
25
21
|
return t;
|
|
26
22
|
};
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
23
|
+
import { createElement as _createElement } from "react";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
import { forwardRef } from 'react';
|
|
29
26
|
import { isElement as isReactElement } from 'react-is';
|
|
27
|
+
import { ScrollView } from 'react-native';
|
|
30
28
|
import { useBreakpoint } from '../../hooks';
|
|
31
|
-
import styled, { css } from '../../styled.native';
|
|
32
29
|
import { getText } from '../../utils';
|
|
30
|
+
import { TableRow } from './TableRow';
|
|
31
|
+
import { StyledTableContainer, TableBody, TableCaption, TableCaptionText, TableHeader, TableHeaderText, TableRowHeading, } from './styles';
|
|
33
32
|
export var DataTable = forwardRef(function (_a, ref) {
|
|
34
33
|
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"]);
|
|
35
34
|
var breakpoints = useBreakpoint();
|
|
36
35
|
var columnLabel = columnHeadings
|
|
37
36
|
? " ".concat(columnHeadings.length, " columns,")
|
|
38
37
|
: '';
|
|
39
|
-
var
|
|
40
|
-
|
|
38
|
+
var accessibilityLabelText = isReactElement(caption)
|
|
39
|
+
? getText(caption)
|
|
40
|
+
: caption;
|
|
41
41
|
var accessibilityLabel = "data table,".concat(columnLabel, " ").concat(items.length, " rows, ").concat(accessibilityLabelText);
|
|
42
|
-
return (
|
|
43
|
-
React.createElement(StyledTableContainer, __assign({}, rest, { ref: ref }),
|
|
44
|
-
caption ? (React.createElement(TableCaption, __assign({}, breakpoints),
|
|
45
|
-
React.createElement(TableCaptionText, __assign({}, breakpoints, { accessibilityLabel: accessibilityLabel }), caption))) : null,
|
|
46
|
-
columnHeadings ? (React.createElement(TableRowHeading, null, columnHeadings.map(function (columnHeading, index) { return (React.createElement(TableHeader, __assign({}, breakpoints, { key: index, cellWidth: columnWidths[index] }),
|
|
47
|
-
React.createElement(TableHeaderText, __assign({}, breakpoints), columnHeading))); }))) : null,
|
|
48
|
-
React.createElement(TableBody, null, items.map(function (rowData, p) { return (React.createElement(TableRow, { key: p, stripe: striped && p % 2 === 0 }, rowData.map(function (cellData, i) {
|
|
49
|
-
return rowHeadings && i < 1 ? (React.createElement(RowHeading, __assign({}, breakpoints, { key: i, testID: "rowHeader", cellWidth: columnWidths[i] }), isReactElement(cellData) ? (cellData) : (React.createElement(TableHeaderText, __assign({}, breakpoints), cellData)))) : (React.createElement(TableCell, __assign({}, breakpoints, { key: i, testID: "cell", cellWidth: columnWidths[i] }), isReactElement(cellData) ? (cellData) : (React.createElement(CellText, __assign({}, breakpoints), cellData))));
|
|
50
|
-
}))); })))));
|
|
51
|
-
});
|
|
52
|
-
var StyledTableContainer = styled.View(function (_a) {
|
|
53
|
-
var dataTable = _a.theme.dataTable;
|
|
54
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), dataTable.borderWidth, dataTable.borderColor);
|
|
55
|
-
});
|
|
56
|
-
var TableHeader = styled.View(function (_a) {
|
|
57
|
-
var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
58
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n flex: ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0], cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
59
|
-
});
|
|
60
|
-
var TableHeaderText = styled.Text(function (_a) {
|
|
61
|
-
var _b = _a.theme, tableHeader = _b.dataTable.tableHeader, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
|
|
62
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n\n line-height: ", ";\n font-size: ", ";\n "])), tableHeader.fontFamily, tableHeader.color, smallAndUp
|
|
63
|
-
? responsiveLineHeights.body[1]
|
|
64
|
-
: responsiveLineHeights.body[0], smallAndUp
|
|
65
|
-
? responsiveFontSizes.body[1]
|
|
66
|
-
: responsiveFontSizes.body[0]);
|
|
67
|
-
});
|
|
68
|
-
var TableCaptionText = styled.Text(function (_a) {
|
|
69
|
-
var _b = _a.theme, tableCaption = _b.dataTable.tableCaption, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
|
|
70
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n text-align: left;\n color: ", ";\n flex-wrap: wrap;\n line-height: ", ";\n font-size: ", ";\n "])), tableCaption.fontFamily, tableCaption.color, smallAndUp
|
|
71
|
-
? responsiveLineHeights.level4[1]
|
|
72
|
-
: responsiveLineHeights.level4[0], smallAndUp
|
|
73
|
-
? responsiveFontSizes.level4[1]
|
|
74
|
-
: responsiveFontSizes.level4[0]);
|
|
75
|
-
});
|
|
76
|
-
var CellText = styled.Text(function (_a) {
|
|
77
|
-
var _b = _a.theme, text = _b.text, responsiveFontSizes = _b.responsiveFontSizes, responsiveLineHeights = _b.responsiveLineHeights, smallAndUp = _a.smallAndUp;
|
|
78
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "])), text.fontFamily, smallAndUp
|
|
79
|
-
? responsiveLineHeights.body[1]
|
|
80
|
-
: responsiveLineHeights.body[0], smallAndUp
|
|
81
|
-
? responsiveFontSizes.body[1]
|
|
82
|
-
: responsiveFontSizes.body[0]);
|
|
83
|
-
});
|
|
84
|
-
var TableCaption = styled.View(function (_a) {
|
|
85
|
-
var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, smallAndUp = _a.smallAndUp;
|
|
86
|
-
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0]);
|
|
87
|
-
});
|
|
88
|
-
var TableRow = styled.View(function (_a) {
|
|
89
|
-
var dataTable = _a.theme.dataTable, stripe = _a.stripe;
|
|
90
|
-
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), stripe
|
|
91
|
-
? dataTable.tableRow.stripeColor
|
|
92
|
-
: dataTable.tableRow.backgroundColor, stripe ? '0px' : "".concat(dataTable.borderWidth), stripe ? 'transparent' : "".concat(dataTable.borderColor));
|
|
93
|
-
});
|
|
94
|
-
var TableRowHeading = styled.View(function (_a) {
|
|
95
|
-
var dataTable = _a.theme.dataTable;
|
|
96
|
-
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), dataTable.tableHeader.backgroundColor, dataTable.tableHeader.borderWidth, dataTable.tableHeader.borderColor);
|
|
97
|
-
});
|
|
98
|
-
var TableBody = styled.View(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex-direction: column;\n flex-wrap: nowrap;\n"], ["\n flex-direction: column;\n flex-wrap: nowrap;\n"])));
|
|
99
|
-
var TableCell = styled.View(function (_a) {
|
|
100
|
-
var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
101
|
-
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0], cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
102
|
-
});
|
|
103
|
-
var RowHeading = styled.View(function (_a) {
|
|
104
|
-
var _b = _a.theme.dataTable.responsivePadding, vertical = _b.vertical, horizontal = _b.horizontal, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
105
|
-
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "])), vertical[smallAndUp ? 1 : 0], horizontal[smallAndUp ? 1 : 0], cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
42
|
+
return (_jsx(ScrollView, __assign({ horizontal: true, alwaysBounceHorizontal: false, contentContainerStyle: { flexGrow: 1 } }, { children: _jsxs(StyledTableContainer, __assign({}, rest, { ref: ref }, { children: [caption ? (_jsx(TableCaption, __assign({}, breakpoints, { children: isReactElement(caption) ? (caption) : (_jsx(TableCaptionText, __assign({}, breakpoints, { accessibilityLabel: accessibilityLabel }, { children: caption }))) }))) : null, columnHeadings ? (_jsx(TableRowHeading, { children: columnHeadings.map(function (columnHeading, index) { return (_createElement(TableHeader, __assign({}, breakpoints, { key: index, cellWidth: columnWidths[index] }), isReactElement(columnHeading) ? (columnHeading) : (_jsx(TableHeaderText, __assign({}, breakpoints, { children: columnHeading }))))); }) })) : null, _jsx(TableBody, { children: items.map(function (rowData, index) { return (_jsx(TableRow, { data: rowData, index: index, rowHeadings: rowHeadings, columnWidths: columnWidths, striped: striped }, index)); }) })] })) })));
|
|
106
43
|
});
|
|
107
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { createElement as _createElement } from "react";
|
|
14
|
+
import { isElement as isReactElement } from 'react-is';
|
|
15
|
+
import { useBreakpoint } from '../../hooks';
|
|
16
|
+
import { CellText, RowHeading, TableCell, TableHeaderText, TableRow as StyledTableRow, } from './styles';
|
|
17
|
+
export var TableRow = function (_a) {
|
|
18
|
+
var data = _a.data, index = _a.index, striped = _a.striped, rowHeadings = _a.rowHeadings, columnWidths = _a.columnWidths;
|
|
19
|
+
var breakpoints = useBreakpoint();
|
|
20
|
+
var cells = data.map(function (cellData, i) {
|
|
21
|
+
if (rowHeadings && i === 0) {
|
|
22
|
+
return (_createElement(RowHeading, __assign({}, breakpoints, { key: i, testID: "rowHeader", cellWidth: columnWidths[i] }), isReactElement(cellData) ? (cellData) : (_jsx(TableHeaderText, __assign({}, breakpoints, { children: cellData })))));
|
|
23
|
+
}
|
|
24
|
+
return (_createElement(TableCell, __assign({}, breakpoints, { key: i, testID: "cell", cellWidth: columnWidths[i] }), isReactElement(cellData) ? (cellData) : (_jsx(CellText, __assign({}, breakpoints, { children: cellData })))));
|
|
25
|
+
});
|
|
26
|
+
return (_jsx(StyledTableRow, __assign({ stripe: striped && index % 2 === 0 }, { children: cells })));
|
|
27
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import styled, { css } from '../../styled.native';
|
|
6
|
+
export var StyledTableContainer = styled.View(function (_a) {
|
|
7
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
8
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), core.borderWidth.small, semantic.border.differentiated);
|
|
9
|
+
});
|
|
10
|
+
export var TableHeader = styled.View(function (_a) {
|
|
11
|
+
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
12
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "], ["\n padding: ", " ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[1], cellWidth === 'auto' ? 1 : 0, cellWidth);
|
|
13
|
+
});
|
|
14
|
+
export var TableHeaderText = styled.Text(function (_a) {
|
|
15
|
+
var _b = _a.theme, semantic = _b.semantic, core = _b.core, smallAndUp = _a.smallAndUp;
|
|
16
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body[smallAndUp ? 'large' : 'small'], core.fontSize.body[smallAndUp ? 'large' : 'small'], semantic.message.base);
|
|
17
|
+
});
|
|
18
|
+
export var TableCaptionText = styled.Text(function (_a) {
|
|
19
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
20
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, core.fontSize.heading4[smallAndUp ? 'large' : 'small'], core.lineHeight.heading4[smallAndUp ? 'large' : 'small'], semantic.message.branded);
|
|
21
|
+
});
|
|
22
|
+
export var CellText = styled.Text(function (_a) {
|
|
23
|
+
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
24
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n\n font-size: ", ";\n "])), core.fontFamily.body.native, core.lineHeight.body.large, core.fontSize.body[smallAndUp ? 'large' : 'small']);
|
|
25
|
+
});
|
|
26
|
+
export var TableCaption = styled.View(function (_a) {
|
|
27
|
+
var core = _a.theme.core;
|
|
28
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), core.space[4], core.space[1]);
|
|
29
|
+
});
|
|
30
|
+
export var TableRow = styled.View(function (_a) {
|
|
31
|
+
var _b = _a.theme, semantic = _b.semantic, core = _b.core, stripe = _a.stripe;
|
|
32
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), stripe
|
|
33
|
+
? semantic.surface.cutout
|
|
34
|
+
: semantic.surface.base, stripe ? '0px' : "".concat(core.borderWidth.small), stripe
|
|
35
|
+
? 'transparent'
|
|
36
|
+
: "".concat(semantic.border.differentiated));
|
|
37
|
+
});
|
|
38
|
+
export var TableRowHeading = styled.View(function (_a) {
|
|
39
|
+
var _b = _a.theme, semantic = _b.semantic, core = _b.core;
|
|
40
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), semantic.surface.base, core.borderWidth.small, semantic.border.functional);
|
|
41
|
+
});
|
|
42
|
+
export var TableBody = styled.View(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex-direction: column;\n flex-wrap: nowrap;\n"], ["\n flex-direction: column;\n flex-wrap: nowrap;\n"])));
|
|
43
|
+
export var TableCell = styled.View(function (_a) {
|
|
44
|
+
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
45
|
+
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[1], cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
46
|
+
});
|
|
47
|
+
export var RowHeading = styled.View(function (_a) {
|
|
48
|
+
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
49
|
+
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", " ", ";\n width: ", ";\n flex: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[1], cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
50
|
+
});
|
|
51
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,7 +13,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
};
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
|
-
import
|
|
16
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { forwardRef, createRef } from 'react';
|
|
17
18
|
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
18
19
|
import { useFullWidth } from '../../hooks';
|
|
19
20
|
import styled, { css } from '../../styled.native';
|
|
@@ -26,14 +27,14 @@ import { LabelText } from '../LabelText';
|
|
|
26
27
|
import { Stack } from '../Stack';
|
|
27
28
|
import { SubLabelText } from '../SubLabelText';
|
|
28
29
|
var InlineFields = styled.View(function (_a) {
|
|
29
|
-
var stretch = _a.stretch,
|
|
30
|
-
var margin =
|
|
31
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", "
|
|
30
|
+
var stretch = _a.stretch, core = _a.theme.core;
|
|
31
|
+
var margin = core.space[1];
|
|
32
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "], ["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "])), margin, margin, stretch ? '' : "width: 265px;");
|
|
32
33
|
});
|
|
33
34
|
var SubField = styled(Stack)(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
var padding =
|
|
36
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-right: ", "
|
|
35
|
+
var core = _a.theme.core;
|
|
36
|
+
var padding = core.space[1];
|
|
37
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-right: ", ";\n padding-left: ", ";\n "], ["\n padding-right: ", ";\n padding-left: ", ";\n "])), padding, padding);
|
|
37
38
|
});
|
|
38
39
|
var DayField = styled(SubField)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
|
|
39
40
|
var MonthField = styled(SubField)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
|
|
@@ -58,26 +59,6 @@ export var DateField = forwardRef(function (_a, ref) {
|
|
|
58
59
|
internalRef.current.focus();
|
|
59
60
|
}
|
|
60
61
|
}; };
|
|
61
|
-
return (
|
|
62
|
-
React.createElement(Stack, { spaceBetween: 1 },
|
|
63
|
-
React.createElement(View, null,
|
|
64
|
-
React.createElement(LabelText, null,
|
|
65
|
-
label,
|
|
66
|
-
optional ? ' (optional)' : null),
|
|
67
|
-
hint ? React.createElement(HintText, null, hint) : null),
|
|
68
|
-
React.createElement(InlineFields, { stretch: stretch },
|
|
69
|
-
React.createElement(DayField, { spaceBetween: 1 },
|
|
70
|
-
React.createElement(TouchableWithoutFeedback, { onPress: focusRef(dayRef), accessible: false },
|
|
71
|
-
React.createElement(SubLabelText, null, "Day")),
|
|
72
|
-
React.createElement(NumberInput, { ref: mergeRefs(dayRef, ref), accessibilityLabel: accessibilityLabel('Day'), invalid: hasError, value: value.day, onChangeText: handleChange('day'), testID: testID, stretch: true, editable: editable })),
|
|
73
|
-
React.createElement(MonthField, { spaceBetween: 1 },
|
|
74
|
-
React.createElement(TouchableWithoutFeedback, { onPress: focusRef(monthRef), accessible: false },
|
|
75
|
-
React.createElement(SubLabelText, null, "Month")),
|
|
76
|
-
React.createElement(NumberInput, { ref: monthRef, accessibilityLabel: accessibilityLabel('Month'), invalid: hasError, value: value.month, onChangeText: handleChange('month'), testID: "".concat(testID, "-month"), stretch: true, editable: editable })),
|
|
77
|
-
React.createElement(YearField, { spaceBetween: 1 },
|
|
78
|
-
React.createElement(TouchableWithoutFeedback, { onPress: focusRef(yearRef), accessible: false },
|
|
79
|
-
React.createElement(SubLabelText, null, "Year")),
|
|
80
|
-
React.createElement(NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable }))),
|
|
81
|
-
error ? React.createElement(ErrorText, null, error) : null)));
|
|
62
|
+
return (_jsx(FormGroup, __assign({ error: hasError }, { children: _jsxs(Stack, __assign({ spaceBetween: 1 }, { children: [_jsxs(View, { children: [_jsxs(LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null, error ? _jsx(ErrorText, { children: error }) : null] }), _jsxs(InlineFields, __assign({ stretch: stretch }, { children: [_jsxs(DayField, __assign({ spaceBetween: 1 }, { children: [_jsx(TouchableWithoutFeedback, __assign({ onPress: focusRef(dayRef), accessible: false }, { children: _jsx(SubLabelText, { children: "Day" }) })), _jsx(NumberInput, { ref: mergeRefs(dayRef, ref), accessibilityLabel: accessibilityLabel('Day'), invalid: hasError, value: value.day, onChangeText: handleChange('day'), testID: testID, stretch: true, editable: editable })] })), _jsxs(MonthField, __assign({ spaceBetween: 1 }, { children: [_jsx(TouchableWithoutFeedback, __assign({ onPress: focusRef(monthRef), accessible: false }, { children: _jsx(SubLabelText, { children: "Month" }) })), _jsx(NumberInput, { ref: monthRef, accessibilityLabel: accessibilityLabel('Month'), invalid: hasError, value: value.month, onChangeText: handleChange('month'), testID: "".concat(testID, "-month"), stretch: true, editable: editable })] })), _jsxs(YearField, __assign({ spaceBetween: 1 }, { children: [_jsx(TouchableWithoutFeedback, __assign({ onPress: focusRef(yearRef), accessible: false }, { children: _jsx(SubLabelText, { children: "Year" }) })), _jsx(NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable })] }))] }))] })) })));
|
|
82
63
|
});
|
|
83
64
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -20,20 +20,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { Children, cloneElement } from 'react';
|
|
24
25
|
import { Dd, Dl, Dt } from './styled';
|
|
25
26
|
var DescriptionList = function (_a) {
|
|
26
27
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
27
|
-
return (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
return (_jsx(Dl, __assign({}, rest, { children: Children.map(children, function (child, index) {
|
|
29
|
+
return cloneElement(child, {
|
|
30
|
+
index: index,
|
|
31
|
+
});
|
|
32
|
+
}) })));
|
|
32
33
|
};
|
|
33
34
|
var DescriptionItem = function (_a) {
|
|
34
35
|
var label = _a.label, children = _a.children, index = _a.index, rest = __rest(_a, ["label", "children", "index"]);
|
|
35
|
-
return (
|
|
36
|
-
React.createElement(Dt, { style: index === 0 ? { marginTop: 0 } : undefined }, label),
|
|
37
|
-
React.createElement(Dd, __assign({}, rest), children)));
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsx(Dt, __assign({ style: index === 0 ? { marginTop: 0 } : undefined }, { children: label })), _jsx(Dd, __assign({}, rest, { children: children }))] }));
|
|
38
37
|
};
|
|
39
38
|
export { DescriptionList, DescriptionItem };
|
|
@@ -24,54 +24,32 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
-
import
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
28
|
import { View } from 'react-native';
|
|
29
|
-
import { useBreakpoint } from '../../hooks';
|
|
30
29
|
import styled, { css } from '../../styled.native';
|
|
31
30
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
32
31
|
import { ListWrapper } from '../List/List';
|
|
33
32
|
export var Dl = ListWrapper;
|
|
34
33
|
var StyledDtText = styled.Text(function (_a) {
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
? list.listItem.fontSize[1]
|
|
38
|
-
: list.listItem.fontSize[0];
|
|
39
|
-
var lineHeight = smallAndUp
|
|
40
|
-
? list.listItem.lineHeight[1]
|
|
41
|
-
: list.listItem.lineHeight[0];
|
|
42
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), list.descriptionTerm.fontFamily, lineHeight, list.descriptionTerm.color, fontSize);
|
|
34
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
35
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body.small, core.fontSize.body.small, semantic.message.base);
|
|
43
36
|
});
|
|
44
37
|
var DtText = styledComponentWithBreakpoints(StyledDtText);
|
|
45
38
|
var StyledDtItem = styled.View(function (_a) {
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
? list.descriptionTerm.marginTop[1]
|
|
49
|
-
: list.descriptionTerm.marginTop[0];
|
|
50
|
-
var marginBottom = smallAndUp
|
|
51
|
-
? list.descriptionTerm.marginBottom[1]
|
|
52
|
-
: list.descriptionTerm.marginBottom[0];
|
|
53
|
-
return css(templateObject_2 || (templateObject_2 = __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);
|
|
39
|
+
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
40
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n flex-direction: row;\n "])), core.space[smallAndUp ? 4 : 3]);
|
|
54
41
|
});
|
|
55
42
|
var DtItem = styledComponentWithBreakpoints(StyledDtItem);
|
|
56
43
|
export var Dt = function (_a) {
|
|
57
44
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
58
|
-
return (
|
|
59
|
-
React.createElement(DtText, null, children)));
|
|
45
|
+
return (_jsx(DtItem, __assign({}, rest, { children: _jsx(DtText, { children: children }) })));
|
|
60
46
|
};
|
|
61
47
|
var StyledDdText = styled.Text(function (_a) {
|
|
62
|
-
var _b = _a.theme,
|
|
63
|
-
|
|
64
|
-
? list.listItem.fontSize[1]
|
|
65
|
-
: list.listItem.fontSize[0];
|
|
66
|
-
var lineHeight = smallAndUp
|
|
67
|
-
? list.listItem.lineHeight[1]
|
|
68
|
-
: list.listItem.lineHeight[0];
|
|
69
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, lineHeight, text.color, fontSize);
|
|
48
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
49
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), core.fontFamily.body.native, core.lineHeight.body.small, semantic.message.secondary, core.fontSize.body.small);
|
|
70
50
|
});
|
|
71
51
|
export var Dd = function (_a) {
|
|
72
52
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
73
|
-
|
|
74
|
-
return (React.createElement(View, __assign({ style: { flexDirection: 'row' } }, rest),
|
|
75
|
-
React.createElement(StyledDdText, __assign({}, breakpoints), children)));
|
|
53
|
+
return (_jsx(View, __assign({ style: { flexDirection: 'row' } }, rest, { children: _jsx(StyledDdText, { children: children }) })));
|
|
76
54
|
};
|
|
77
55
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -24,37 +24,31 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
-
import
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
|
+
import { forwardRef, useState } from 'react';
|
|
28
29
|
import { useBreakpoint } from '../../hooks';
|
|
29
|
-
import styled, { css
|
|
30
|
-
import { pxToNumber } from '../../utils';
|
|
30
|
+
import styled, { css } from '../../styled.native';
|
|
31
31
|
import { Icon } from '../Icon';
|
|
32
32
|
var DisclosureButton = styled.TouchableOpacity(function () { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n "], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n "]))); });
|
|
33
33
|
var DisclosureButtonIcon = styled(Icon)(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)',
|
|
34
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, expanded = _a.expanded, smallAndUp = _a.smallAndUp;
|
|
35
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)', core.space[smallAndUp ? 2 : 1], semantic.message.link);
|
|
36
36
|
});
|
|
37
37
|
var DisclosureButtonText = styled.Text(function (_a) {
|
|
38
|
-
var _b = _a.theme,
|
|
39
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "])),
|
|
38
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
39
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, core.fontSize.body[smallAndUp ? 'large' : 'small'], core.lineHeight.body[smallAndUp ? 'large' : 'small'], semantic.message.link, semantic.message.link);
|
|
40
40
|
});
|
|
41
41
|
var DisclosurePanel = styled.View(function (_a) {
|
|
42
|
-
var
|
|
43
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", "
|
|
44
|
-
pxToNumber(disclosure.iconGap[smallAndUp ? 1 : 0]));
|
|
42
|
+
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
43
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", ";\n "], ["\n margin-top: ", ";\n padding-left: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[smallAndUp ? 2 : 1]);
|
|
45
44
|
});
|
|
46
45
|
export var Disclosure = forwardRef(function (_a, ref) {
|
|
47
46
|
var children = _a.children, title = _a.title, _b = _a.expanded, expanded = _b === void 0 ? false : _b, onToggle = _a.onToggle, rest = __rest(_a, ["children", "title", "expanded", "onToggle"]);
|
|
48
47
|
var _c = useState(expanded), isExpanded = _c[0], setIsExpanded = _c[1];
|
|
49
48
|
var breakpoints = useBreakpoint();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
onToggle && onToggle(!isExpanded);
|
|
55
|
-
}, ref: ref, accessibilityState: { expanded: isExpanded } }, rest),
|
|
56
|
-
React.createElement(DisclosureButtonIcon, __assign({ name: "caret-down" }, breakpoints, { size: 14, expanded: isExpanded, color: textLink.color })),
|
|
57
|
-
React.createElement(DisclosureButtonText, __assign({}, breakpoints), title)),
|
|
58
|
-
isExpanded && (React.createElement(DisclosurePanel, __assign({}, breakpoints), children))));
|
|
49
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DisclosureButton, __assign({ onPress: function () {
|
|
50
|
+
setIsExpanded(!isExpanded);
|
|
51
|
+
onToggle && onToggle(!isExpanded);
|
|
52
|
+
}, ref: ref, accessibilityState: { expanded: isExpanded } }, rest, { children: [_jsx(DisclosureButtonIcon, __assign({ name: "caret-down" }, breakpoints, { size: 14, expanded: isExpanded })), _jsx(DisclosureButtonText, __assign({}, breakpoints, { children: title }))] })), isExpanded && (_jsx(DisclosurePanel, __assign({}, breakpoints, { children: children })))] }));
|
|
59
53
|
});
|
|
60
54
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -2,14 +2,14 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
-
import
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
import styled, { css } from '../../styled.native';
|
|
7
7
|
var StyledDivider = styled.View(function (_a) {
|
|
8
|
-
var
|
|
9
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1px;\n background: ", ";\n width: ", ";\n "], ["\n height: 1px;\n background: ", ";\n width: ", ";\n "])), type === 'default' ?
|
|
8
|
+
var semantic = _a.theme.semantic, _b = _a.type, type = _b === void 0 ? 'default' : _b, _c = _a.width, width = _c === void 0 ? '100%' : _c;
|
|
9
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1px;\n background: ", ";\n width: ", ";\n "], ["\n height: 1px;\n background: ", ";\n width: ", ";\n "])), type === 'default' ? semantic.border.graphic : semantic.border.differentiated, width);
|
|
10
10
|
});
|
|
11
11
|
export var Divider = function (_a) {
|
|
12
12
|
var type = _a.type, width = _a.width;
|
|
13
|
-
return
|
|
13
|
+
return _jsx(StyledDivider, { type: type, width: width });
|
|
14
14
|
};
|
|
15
15
|
var templateObject_1;
|
|
@@ -20,7 +20,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { createRef, useEffect } from 'react';
|
|
24
25
|
import { findNodeHandle, AccessibilityInfo, } from 'react-native';
|
|
25
26
|
import { Ul, Li } from '../List';
|
|
26
27
|
import { ErrorNotification } from '../Notification';
|
|
@@ -39,9 +40,9 @@ var ErrorSummaryNotification = function (_a) {
|
|
|
39
40
|
// This means that errors needs to have referential integrity otherwise the notification
|
|
40
41
|
// will be focused all the time.
|
|
41
42
|
}, [errors, scrollViewRef.current, ref.current]);
|
|
42
|
-
return (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
return (_jsx(ErrorNotification, __assign({ ref: ref }, rest, { children: errors.length === 0 ? null : (_jsx(Ul, { children: errors.map(function (_a) {
|
|
44
|
+
var message = _a.message, fieldId = _a.id;
|
|
45
|
+
return (_jsx(Li, { children: message }, fieldId));
|
|
46
|
+
}) })) })));
|
|
46
47
|
};
|
|
47
48
|
export { ErrorSummaryNotification };
|
|
@@ -3,12 +3,15 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled, { css } from '../../styled.native';
|
|
6
|
-
import { calculateLineHeight } from '../../theme';
|
|
7
6
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
8
7
|
var StyledErrorText = styled.Text(function (_a) {
|
|
9
|
-
var
|
|
10
|
-
var fontSize = smallAndUp
|
|
11
|
-
|
|
8
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
9
|
+
var fontSize = smallAndUp
|
|
10
|
+
? core.fontSize.body.large
|
|
11
|
+
: core.fontSize.body.small;
|
|
12
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, smallAndUp
|
|
13
|
+
? core.lineHeight.body.large
|
|
14
|
+
: core.lineHeight.body.small, fontSize, semantic.error.message);
|
|
12
15
|
});
|
|
13
16
|
var ErrorText = styledComponentWithBreakpoints(StyledErrorText);
|
|
14
17
|
export { ErrorText };
|
|
@@ -20,7 +20,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { Children, cloneElement, isValidElement, createRef, useContext, forwardRef, } from 'react';
|
|
24
25
|
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
25
26
|
import { ThemeContext } from '../../styled.native';
|
|
26
27
|
import { getText, mergeRefs } from '../../utils';
|
|
@@ -39,30 +40,21 @@ export var Field = forwardRef(function (_a, ref) {
|
|
|
39
40
|
var accessibilityLabel = [labelText, getText(hint), getText(error)]
|
|
40
41
|
.filter(Boolean)
|
|
41
42
|
.join(', ');
|
|
42
|
-
return (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
return (_jsx(FormGroup, __assign({ error: hasError || undefined, testID: "nb-field-form-group" }, { children: _jsxs(Stack, __assign({ spaceBetween: 1 }, { children: [_jsx(TouchableWithoutFeedback, __assign({ onPress: function () {
|
|
44
|
+
if (inputRef.current) {
|
|
45
|
+
// @ts-ignore. Toggle picker if this is a select menu.
|
|
46
|
+
if (inputRef.current.togglePicker) {
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
inputRef.current.togglePicker();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
inputRef.current.focus();
|
|
53
|
+
}
|
|
50
54
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
inputRef
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
} },
|
|
57
|
-
React.createElement(View, null,
|
|
58
|
-
React.createElement(LabelText, null,
|
|
59
|
-
label,
|
|
60
|
-
optional ? ' (optional)' : null),
|
|
61
|
-
hint ? React.createElement(HintText, null, hint) : null)),
|
|
62
|
-
React.createElement(Stretch, { defaultWidth: "".concat(Math.ceil(characters * 0.8 * parseInt(field.fontSize[0])) + affixWidth, "px"), fullWidth: fullWidth }, Children.map(children, function (child) {
|
|
63
|
-
return isValidElement(child)
|
|
64
|
-
? cloneElement(child, __assign({ invalid: hasError || undefined, ref: mergeRefs(inputRef, ref), accessibilityLabel: accessibilityLabel }, rest))
|
|
65
|
-
: child;
|
|
66
|
-
})),
|
|
67
|
-
error ? React.createElement(ErrorText, null, error) : null)));
|
|
55
|
+
} }, { children: _jsxs(View, { children: [_jsxs(LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null, error ? _jsx(ErrorText, { children: error }) : null] }) })), _jsx(Stretch, __assign({ defaultWidth: "".concat(Math.ceil(characters * 0.8 * parseInt(field.fontSize[0])) + affixWidth, "px"), fullWidth: fullWidth }, { children: Children.map(children, function (child) {
|
|
56
|
+
return isValidElement(child)
|
|
57
|
+
? cloneElement(child, __assign({ invalid: hasError || undefined, ref: mergeRefs(inputRef, ref), accessibilityLabel: accessibilityLabel }, rest))
|
|
58
|
+
: child;
|
|
59
|
+
}) }))] })) })));
|
|
68
60
|
});
|
|
@@ -24,14 +24,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
-
import
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
28
|
import { View } from 'react-native';
|
|
29
29
|
import styled from '../../styled.native';
|
|
30
30
|
var FormGroupWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
31
31
|
var FormGroup = function (_a) {
|
|
32
32
|
var children = _a.children, error = _a.error, rest = __rest(_a, ["children", "error"]);
|
|
33
|
-
return (
|
|
34
|
-
React.createElement(View, { style: { flex: 1 } }, children)));
|
|
33
|
+
return (_jsx(FormGroupWrapper, __assign({}, rest, { children: _jsx(View, __assign({ style: { flex: 1 } }, { children: children })) })));
|
|
35
34
|
};
|
|
36
35
|
export { FormGroup };
|
|
37
36
|
var templateObject_1;
|