@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentClass, ComponentType } from 'react';
|
|
2
2
|
import { AnimateProps } from 'react-native-reanimated';
|
|
3
3
|
import { AccordionProps } from './types';
|
|
4
|
-
export declare function withAnimated<T extends object>(WrappedComponent:
|
|
4
|
+
export declare function withAnimated<T extends object>(WrappedComponent: ComponentType<T>): ComponentClass<AnimateProps<T>>;
|
|
5
5
|
export declare const Accordion: ({ expanded, first, headingComponent, last, title, children, onToggle, }: AccordionProps) => JSX.Element;
|
|
@@ -50,15 +50,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
50
50
|
};
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
52
|
exports.Accordion = exports.withAnimated = void 0;
|
|
53
|
-
var
|
|
54
|
-
var
|
|
53
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
54
|
+
var react_1 = require("react");
|
|
55
55
|
var react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
56
|
-
var
|
|
56
|
+
var styled_native_1 = require("../../styled.native");
|
|
57
|
+
var utils_1 = require("../../utils");
|
|
57
58
|
var Heading_1 = require("../Heading");
|
|
58
59
|
var Icon_1 = require("./Icon");
|
|
59
60
|
var hooks_1 = require("./hooks");
|
|
60
61
|
var styles_1 = require("./styles");
|
|
61
|
-
var _a = theme_1.theme.colors, canvas = _a.canvas, canvasMuted = _a.canvasMuted, primary = _a.primary, greyDarker = _a.brand.grey.darker;
|
|
62
62
|
function withAnimated(WrappedComponent) {
|
|
63
63
|
var displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
64
64
|
// eslint-disable-next-line react/prefer-stateless-function
|
|
@@ -68,21 +68,22 @@ function withAnimated(WrappedComponent) {
|
|
|
68
68
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
69
69
|
}
|
|
70
70
|
WithAnimated.prototype.render = function () {
|
|
71
|
-
return
|
|
71
|
+
return (0, jsx_runtime_1.jsx)(WrappedComponent, __assign({}, this.props));
|
|
72
72
|
};
|
|
73
73
|
WithAnimated.displayName = "WithAnimated(".concat(displayName, ")");
|
|
74
74
|
return WithAnimated;
|
|
75
|
-
}(react_1.
|
|
75
|
+
}(react_1.Component));
|
|
76
76
|
return react_native_reanimated_1.default.createAnimatedComponent(WithAnimated);
|
|
77
77
|
}
|
|
78
78
|
exports.withAnimated = withAnimated;
|
|
79
79
|
var Accordion = function (_a) {
|
|
80
|
-
var _b = _a.expanded, expanded = _b === void 0 ? false : _b, first = _a.first, _c = _a.headingComponent, headingComponent = _c === void 0 ? Heading_1.
|
|
80
|
+
var _b = _a.expanded, expanded = _b === void 0 ? false : _b, first = _a.first, _c = _a.headingComponent, headingComponent = _c === void 0 ? Heading_1.Heading4 : _c, last = _a.last, title = _a.title, children = _a.children, onToggle = _a.onToggle;
|
|
81
|
+
var _d = (0, react_1.useContext)(styled_native_1.ThemeContext), core = _d.core, semantic = _d.semantic;
|
|
81
82
|
var AnimatedHeading = (0, react_1.useMemo)(function () { return withAnimated(headingComponent); }, [
|
|
82
83
|
headingComponent,
|
|
83
84
|
]);
|
|
84
|
-
var
|
|
85
|
-
var
|
|
85
|
+
var _e = (0, hooks_1.useLayout)(0), layout = _e[0], onLayout = _e[1];
|
|
86
|
+
var _f = (0, react_1.useState)(expanded), open = _f[0], setOpen = _f[1];
|
|
86
87
|
var handleHeightContent = (0, react_1.useMemo)(function () { return layout.height || 100; }, [
|
|
87
88
|
layout.height,
|
|
88
89
|
]);
|
|
@@ -117,23 +118,19 @@ var Accordion = function (_a) {
|
|
|
117
118
|
}
|
|
118
119
|
setOpen(function (o) { return !o; });
|
|
119
120
|
}, [handleHeightContent, open, size]);
|
|
120
|
-
var containerAnimatedStyle = (0, react_1.useMemo)(function () { return [
|
|
121
|
+
var containerAnimatedStyle = (0, react_1.useMemo)(function () { return [{ overflow: 'hidden' }, style]; }, [style]);
|
|
121
122
|
var headerStyle = (0, react_native_reanimated_1.useAnimatedStyle)(function () { return ({
|
|
122
|
-
color: (0, react_native_reanimated_1.interpolateColor)(progress.value, [0, 1], [
|
|
123
|
+
color: (0, react_native_reanimated_1.interpolateColor)(progress.value, [0, 1], [semantic.message.branded, semantic.message.base]),
|
|
123
124
|
}); });
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
react_1.default.createElement(AnimatedHeading, { style: [headerStyle, styles_1.styles.accordionHeaderText] }, title),
|
|
135
|
-
react_1.default.createElement(Icon_1.AccordionIcon, { animationTiming: progress })),
|
|
136
|
-
react_1.default.createElement(react_native_reanimated_1.default.View, { style: containerAnimatedStyle },
|
|
137
|
-
react_1.default.createElement(react_native_1.View, { onLayout: onLayout, style: styles_1.styles.container }, children))));
|
|
125
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledAccordion, __assign({ first: first, last: last }, { children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledAccordionHeader, __assign({ accessibilityState: { expanded: open }, onPress: toggleOpen, testID: "accordionTitle" }, { children: [(0, jsx_runtime_1.jsx)(AnimatedHeading, __assign({ style: [
|
|
126
|
+
headerStyle,
|
|
127
|
+
{
|
|
128
|
+
paddingTop: (0, utils_1.pxToNumber)(core.space[1]),
|
|
129
|
+
paddingRight: (0, utils_1.pxToNumber)(core.space[3]),
|
|
130
|
+
marginTop: 0,
|
|
131
|
+
marginBottom: 0,
|
|
132
|
+
flexShrink: 1,
|
|
133
|
+
},
|
|
134
|
+
] }, { children: title })), (0, jsx_runtime_1.jsx)(Icon_1.AccordionIcon, { animationTiming: progress })] })), (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, __assign({ style: containerAnimatedStyle }, { children: (0, jsx_runtime_1.jsx)(styles_1.StyledContainer, __assign({ onLayout: onLayout }, { children: children })) }))] })));
|
|
138
135
|
};
|
|
139
136
|
exports.Accordion = Accordion;
|
|
@@ -1,41 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.AccordionGroup = void 0;
|
|
27
|
-
var
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var react_1 = require("react");
|
|
28
6
|
var react_native_1 = require("react-native");
|
|
29
7
|
var AccordionGroup = function (_a) {
|
|
30
8
|
var children = _a.children;
|
|
31
9
|
var childCount = react_1.Children.count(children);
|
|
32
|
-
return (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { children: react_1.Children.map(children, function (child, i) {
|
|
11
|
+
return (0, react_1.isValidElement)(child)
|
|
12
|
+
? (0, react_1.cloneElement)(child, {
|
|
13
|
+
first: i === 0,
|
|
14
|
+
last: i === childCount - 1,
|
|
15
|
+
})
|
|
16
|
+
: child;
|
|
17
|
+
}) }));
|
|
40
18
|
};
|
|
41
19
|
exports.AccordionGroup = AccordionGroup;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -22,22 +33,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
33
|
__setModuleDefault(result, mod);
|
|
23
34
|
return result;
|
|
24
35
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
37
|
exports.AccordionIcon = void 0;
|
|
30
|
-
var
|
|
38
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
var react_1 = require("react");
|
|
31
40
|
var react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
32
41
|
var react_native_svg_1 = require("react-native-svg");
|
|
33
|
-
var
|
|
34
|
-
var _a = theme_1.theme.colors, canvas = _a.canvas, primary = _a.primary, primaryMuted = _a.primaryMuted;
|
|
42
|
+
var styled_native_1 = require("../../styled.native");
|
|
35
43
|
var OVO_LOGO_ANGLE = 105;
|
|
36
44
|
var AnimatedPath = react_native_reanimated_1.default.createAnimatedComponent(react_native_svg_1.Path);
|
|
37
45
|
function AccordionIcon(_a) {
|
|
38
46
|
var animationTiming = _a.animationTiming;
|
|
47
|
+
var _b = (0, react_1.useContext)(styled_native_1.ThemeContext), core = _b.core, semantic = _b.semantic;
|
|
39
48
|
var outerAnimatedStyles = (0, react_native_reanimated_1.useAnimatedStyle)(function () { return ({
|
|
40
|
-
backgroundColor: (0, react_native_reanimated_1.interpolateColor)(animationTiming.value, [0, 1], [
|
|
49
|
+
backgroundColor: (0, react_native_reanimated_1.interpolateColor)(animationTiming.value, [0, 1], [semantic.surface.cutout, semantic.message.branded]),
|
|
41
50
|
height: 36 - animationTiming.value * 4,
|
|
42
51
|
margin: 2 * animationTiming.value,
|
|
43
52
|
transform: [{ rotateZ: animationTiming.value * -OVO_LOGO_ANGLE + 'deg' }],
|
|
@@ -51,18 +60,14 @@ function AccordionIcon(_a) {
|
|
|
51
60
|
var minusAnimatedProps = (0, react_native_reanimated_1.useAnimatedProps)(function () { return ({
|
|
52
61
|
opacity: animationTiming.value,
|
|
53
62
|
}); });
|
|
54
|
-
return (
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, __assign({ style: [
|
|
55
64
|
{
|
|
56
|
-
backgroundColor:
|
|
65
|
+
backgroundColor: semantic.surface.cutout,
|
|
57
66
|
aspectRatio: 1,
|
|
58
67
|
alignItems: 'center',
|
|
59
68
|
justifyContent: 'center',
|
|
60
69
|
},
|
|
61
70
|
outerAnimatedStyles,
|
|
62
|
-
] },
|
|
63
|
-
react_1.default.createElement(react_native_reanimated_1.default.View, { style: innerAnimatedStyles },
|
|
64
|
-
react_1.default.createElement(react_native_svg_1.Svg, { width: "16", height: "16", viewBox: "0 0 16 16" },
|
|
65
|
-
react_1.default.createElement(AnimatedPath, { animatedProps: plusAnimatedProps, d: "M9 9H16V6.99H9V0H6.99V7H0V9.01H7V16.01H9.01V9.01L9 9Z", fill: primary }),
|
|
66
|
-
react_1.default.createElement(AnimatedPath, { animatedProps: minusAnimatedProps, d: "M16.3826 9.66663V7.66663H0.462646V9.66663H16.3826Z", fill: canvas })))));
|
|
71
|
+
] }, { children: (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, __assign({ style: innerAnimatedStyles }, { children: (0, jsx_runtime_1.jsxs)(react_native_svg_1.Svg, __assign({ width: "16", height: "16", viewBox: "0 0 16 16" }, { children: [(0, jsx_runtime_1.jsx)(AnimatedPath, { animatedProps: plusAnimatedProps, d: "M9 9H16V6.99H9V0H6.99V7H0V9.01H7V16.01H9.01V9.01L9 9Z", fill: semantic.message.secondary }), (0, jsx_runtime_1.jsx)(AnimatedPath, { animatedProps: minusAnimatedProps, d: "M16.3826 9.66663V7.66663H0.462646V9.66663H16.3826Z", fill: core.color.brand.white })] })) })) })));
|
|
67
72
|
}
|
|
68
73
|
exports.AccordionIcon = AccordionIcon;
|
|
@@ -1,33 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.useLayout = void 0;
|
|
27
|
-
var react_1 =
|
|
4
|
+
var react_1 = require("react");
|
|
28
5
|
var useLayout = function (defaultHeight) {
|
|
29
6
|
var _a = (0, react_1.useState)({ height: defaultHeight || 0, width: 0, measured: false }), layout = _a[0], setLayout = _a[1];
|
|
30
|
-
var onLayout = react_1.
|
|
7
|
+
var onLayout = (0, react_1.useCallback)(function (e) {
|
|
31
8
|
var _a = e.nativeEvent.layout, height = _a.height, width = _a.width;
|
|
32
9
|
if (height === layout.height && width === layout.width) {
|
|
33
10
|
return;
|
|
@@ -35,7 +12,7 @@ var useLayout = function (defaultHeight) {
|
|
|
35
12
|
setLayout({
|
|
36
13
|
height: height,
|
|
37
14
|
width: width,
|
|
38
|
-
measured: true
|
|
15
|
+
measured: true,
|
|
39
16
|
});
|
|
40
17
|
}, [layout.height, layout.width]);
|
|
41
18
|
return [layout, onLayout];
|