@ovotech/element-native 3.8.0 → 3.8.1-canary-a8563d8-232
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.js +4 -9
- package/dist/components/Accordion/styles.d.ts +1225 -484
- package/dist/components/Accordion/styles.js +4 -3
- package/dist/components/ActionCard/ActionCard.js +4 -3
- package/dist/components/ActionList/ActionList.d.ts +1 -1
- package/dist/components/ActionList/ActionList.js +2 -1
- package/dist/components/ActionList/styled.d.ts +2502 -1020
- package/dist/components/ActionList/styled.js +6 -5
- package/dist/components/Badge/Badge.d.ts +408 -161
- package/dist/components/Badge/Badge.js +3 -2
- package/dist/components/CTAButton/CTAButton.js +7 -6
- package/dist/components/Card/Card.d.ts +410 -161
- package/dist/components/Card/Card.js +5 -4
- package/dist/components/Checkbox/Checkbox.js +4 -3
- package/dist/components/DataTable/styles.d.ts +5472 -2261
- package/dist/components/DataTable/styles.js +14 -15
- package/dist/components/DateField/DateField.js +4 -3
- package/dist/components/DescriptionList/styled.d.ts +407 -160
- package/dist/components/DescriptionList/styled.js +5 -4
- package/dist/components/Disclosure/Disclosure.js +4 -3
- package/dist/components/Em/Em.d.ts +407 -160
- package/dist/components/ErrorText/ErrorText.d.ts +407 -160
- package/dist/components/ErrorText/ErrorText.js +2 -3
- package/dist/components/FilterSelect/FilterSelect.js +5 -4
- package/dist/components/Grid/Col.d.ts +407 -160
- package/dist/components/Grid/Col.js +3 -3
- package/dist/components/Grid/Row.d.ts +407 -160
- package/dist/components/Grid/Row.js +4 -4
- package/dist/components/Heading1/Heading1.d.ts +3 -1
- package/dist/components/Heading1/Heading1.js +6 -4
- package/dist/components/Heading2/Heading2.d.ts +3 -1
- package/dist/components/Heading2/Heading2.js +6 -4
- package/dist/components/Heading3/Heading3.d.ts +3 -1
- package/dist/components/Heading3/Heading3.js +6 -4
- package/dist/components/Heading4/Heading4.d.ts +3 -1
- package/dist/components/Heading4/Heading4.js +6 -4
- package/dist/components/HintText/HintText.d.ts +407 -160
- package/dist/components/HintText/HintText.js +2 -3
- package/dist/components/Input/Input.js +7 -4
- package/dist/components/Label/Label.d.ts +5 -241
- package/dist/components/Label/Label.js +17 -4
- package/dist/components/LabelText/LabelText.d.ts +407 -160
- package/dist/components/LabelText/LabelText.js +2 -1
- package/dist/components/Lead/Lead.d.ts +5 -241
- package/dist/components/Lead/Lead.js +19 -4
- package/dist/components/LineThrough/LineThrough.d.ts +407 -160
- package/dist/components/List/styled.d.ts +1636 -648
- package/dist/components/List/styled.js +4 -4
- package/dist/components/Margin/Margin.d.ts +408 -162
- package/dist/components/Margin/Margin.js +2 -3
- package/dist/components/NavHeader/NavHeader.d.ts +10 -2
- package/dist/components/NavHeader/NavHeader.js +25 -29
- package/dist/components/NavHeader/NavHeader.styles.d.ts +3845 -1387
- package/dist/components/NavHeader/NavHeader.styles.js +18 -17
- package/dist/components/Notification/Notification.d.ts +816 -322
- package/dist/components/Notification/Notification.js +18 -15
- package/dist/components/P/P.d.ts +2 -0
- package/dist/components/P/P.js +3 -2
- package/dist/components/PasswordInput/PasswordInput.styled.d.ts +407 -160
- package/dist/components/PasswordInput/PasswordInput.styled.js +2 -1
- package/dist/components/{HorizontalCarousel/HorizontalCarousel.d.ts → ProductCarousel/ProductCarousel.d.ts} +2 -2
- package/dist/components/ProductCarousel/ProductCarousel.js +128 -0
- package/dist/components/ProductCarousel/anchor-point.d.ts +10 -0
- package/dist/components/ProductCarousel/anchor-point.js +53 -0
- package/dist/components/ProductCarousel/index.d.ts +1 -0
- package/dist/components/ProductCarousel/index.js +5 -0
- package/dist/components/Radio/Radio.js +5 -4
- package/dist/components/RadioCard/RadioCard.d.ts +9 -0
- package/dist/components/RadioCard/RadioCard.js +72 -0
- package/dist/components/RadioCard/index.d.ts +1 -0
- package/dist/components/RadioCard/index.js +5 -0
- package/dist/components/SelectField/Select.d.ts +407 -160
- package/dist/components/SelectField/Select.js +8 -7
- package/dist/components/SkeletonCTA/SkeletonCTA.js +2 -1
- package/dist/components/SkeletonCircle/SkeletonCircle.js +2 -2
- package/dist/components/SkeletonText/SkeletonText.js +4 -1
- package/dist/components/Small/Small.d.ts +407 -160
- package/dist/components/Small/Small.js +2 -1
- package/dist/components/Stack/Stack.d.ts +1 -2
- package/dist/components/Stack/Stack.js +2 -1
- package/dist/components/Strong/Strong.d.ts +407 -160
- package/dist/components/SubLabelText/SubLabelText.d.ts +407 -160
- package/dist/components/SubLabelText/SubLabelText.js +2 -1
- package/dist/components/Tabs/Tab.js +8 -7
- package/dist/components/Tabs/TabList.js +2 -1
- package/dist/components/Tabs/TabPanel.js +2 -1
- package/dist/components/Tabs/Tabs.js +2 -1
- package/dist/components/TextareaInput/TextareaInput.js +2 -2
- package/dist/components/Toast/Toast.js +3 -2
- package/dist/components/Toggle/Toggle.js +2 -2
- package/dist/components/Toggle/styles.d.ts +1638 -650
- package/dist/components/Toggle/styles.js +5 -4
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/esm/components/Accordion/Accordion.js +4 -9
- package/dist/esm/components/Accordion/styles.js +4 -3
- package/dist/esm/components/ActionCard/ActionCard.js +4 -3
- package/dist/esm/components/ActionList/ActionList.js +2 -1
- package/dist/esm/components/ActionList/styled.js +6 -5
- package/dist/esm/components/Badge/Badge.js +3 -2
- package/dist/esm/components/CTAButton/CTAButton.js +7 -6
- package/dist/esm/components/Card/Card.js +5 -4
- package/dist/esm/components/Checkbox/Checkbox.js +4 -3
- package/dist/esm/components/DataTable/styles.js +14 -15
- package/dist/esm/components/DateField/DateField.js +4 -3
- package/dist/esm/components/DescriptionList/styled.js +5 -4
- package/dist/esm/components/Disclosure/Disclosure.js +4 -3
- package/dist/esm/components/ErrorText/ErrorText.js +2 -3
- package/dist/esm/components/FilterSelect/FilterSelect.js +5 -4
- package/dist/esm/components/Grid/Col.js +3 -3
- package/dist/esm/components/Grid/Row.js +4 -4
- package/dist/esm/components/Heading1/Heading1.js +5 -3
- package/dist/esm/components/Heading2/Heading2.js +5 -3
- package/dist/esm/components/Heading3/Heading3.js +5 -3
- package/dist/esm/components/Heading4/Heading4.js +5 -3
- package/dist/esm/components/HintText/HintText.js +2 -3
- package/dist/esm/components/Input/Input.js +7 -4
- package/dist/esm/components/Label/Label.js +17 -4
- package/dist/esm/components/LabelText/LabelText.js +2 -1
- package/dist/esm/components/Lead/Lead.js +19 -4
- package/dist/esm/components/List/styled.js +4 -4
- package/dist/esm/components/Margin/Margin.js +2 -3
- package/dist/esm/components/NavHeader/NavHeader.js +26 -30
- package/dist/esm/components/NavHeader/NavHeader.styles.js +17 -16
- package/dist/esm/components/Notification/Notification.js +18 -15
- package/dist/esm/components/P/P.js +3 -2
- package/dist/esm/components/PasswordInput/PasswordInput.styled.js +2 -1
- package/dist/esm/components/ProductCarousel/ProductCarousel.js +98 -0
- package/dist/esm/components/ProductCarousel/anchor-point.js +49 -0
- package/dist/esm/components/ProductCarousel/index.js +1 -0
- package/dist/esm/components/Radio/Radio.js +5 -4
- package/dist/esm/components/RadioCard/RadioCard.js +66 -0
- package/dist/esm/components/RadioCard/index.js +1 -0
- package/dist/esm/components/SelectField/Select.js +8 -7
- package/dist/esm/components/SkeletonCTA/SkeletonCTA.js +2 -1
- package/dist/esm/components/SkeletonCircle/SkeletonCircle.js +1 -1
- package/dist/esm/components/SkeletonText/SkeletonText.js +4 -1
- package/dist/esm/components/Small/Small.js +2 -1
- package/dist/esm/components/Stack/Stack.js +2 -1
- package/dist/esm/components/SubLabelText/SubLabelText.js +2 -1
- package/dist/esm/components/Tabs/Tab.js +9 -8
- package/dist/esm/components/Tabs/TabList.js +2 -1
- package/dist/esm/components/Tabs/TabPanel.js +2 -1
- package/dist/esm/components/Tabs/Tabs.js +2 -1
- package/dist/esm/components/TextareaInput/TextareaInput.js +2 -2
- package/dist/esm/components/Toast/Toast.js +3 -2
- package/dist/esm/components/Toggle/Toggle.js +2 -2
- package/dist/esm/components/Toggle/styles.js +5 -4
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/utils/utils.js +1 -7
- package/dist/styled.native.d.ts +2523 -1041
- package/dist/utils/utils.d.ts +1 -3
- package/dist/utils/utils.js +1 -9
- package/package.json +5 -4
- package/dist/components/HorizontalCarousel/HorizontalCarousel.js +0 -92
- package/dist/components/HorizontalCarousel/index.d.ts +0 -1
- package/dist/components/HorizontalCarousel/index.js +0 -17
- package/dist/esm/components/HorizontalCarousel/HorizontalCarousel.js +0 -62
- package/dist/esm/components/HorizontalCarousel/index.js +0 -1
- /package/dist/components/{HorizontalCarousel → ProductCarousel}/NavigationDots.d.ts +0 -0
- /package/dist/components/{HorizontalCarousel → ProductCarousel}/NavigationDots.js +0 -0
- /package/dist/esm/components/{HorizontalCarousel → ProductCarousel}/NavigationDots.js +0 -0
package/dist/utils/utils.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { ViewProps, View } from 'react-native';
|
|
|
3
3
|
import { BreakpointNames, Breakpoints } from '../hooks';
|
|
4
4
|
declare function mergeRefs<T>(ref1: undefined | Ref<T>, ref2: undefined | Ref<T>): (element: T) => void;
|
|
5
5
|
declare function getText(children: ReactNode): string;
|
|
6
|
-
declare function pxToNumber(px: string): number;
|
|
7
|
-
declare function numToPx(num: number): string;
|
|
8
6
|
declare function styledComponentWithBreakpoints<T = ViewProps, C = View>(Component: ComponentType<T>): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<Omit<T, BreakpointNames>> & import("react").RefAttributes<C>>;
|
|
9
7
|
declare function responsiveStyle(property: string, value: any, breakpoints: Breakpoints, formatter?: (v: any) => string): any;
|
|
10
8
|
declare function getErrorMessage(id: string, errors: Array<{
|
|
@@ -13,4 +11,4 @@ declare function getErrorMessage(id: string, errors: Array<{
|
|
|
13
11
|
}>): null | ReactNode;
|
|
14
12
|
declare function callAll(...fns: Array<Function | undefined>): (...args: any[]) => void;
|
|
15
13
|
declare function filterChildrenByType(children: ReactNode, type: ComponentType): ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
16
|
-
export { styledComponentWithBreakpoints, responsiveStyle,
|
|
14
|
+
export { styledComponentWithBreakpoints, responsiveStyle, mergeRefs, getText, getErrorMessage, callAll, filterChildrenByType, };
|
package/dist/utils/utils.js
CHANGED
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.filterChildrenByType = exports.callAll = exports.getErrorMessage = exports.getText = exports.mergeRefs = exports.
|
|
14
|
+
exports.filterChildrenByType = exports.callAll = exports.getErrorMessage = exports.getText = exports.mergeRefs = exports.responsiveStyle = exports.styledComponentWithBreakpoints = void 0;
|
|
15
15
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
var react_1 = require("react");
|
|
17
17
|
var hooks_1 = require("../hooks");
|
|
@@ -43,14 +43,6 @@ function getText(children) {
|
|
|
43
43
|
return String(children);
|
|
44
44
|
}
|
|
45
45
|
exports.getText = getText;
|
|
46
|
-
function pxToNumber(px) {
|
|
47
|
-
return parseFloat(px);
|
|
48
|
-
}
|
|
49
|
-
exports.pxToNumber = pxToNumber;
|
|
50
|
-
function numToPx(num) {
|
|
51
|
-
return "".concat(num, "px");
|
|
52
|
-
}
|
|
53
|
-
exports.numToPx = numToPx;
|
|
54
46
|
function styledComponentWithBreakpoints(Component) {
|
|
55
47
|
return (0, react_1.forwardRef)(function (props, ref) {
|
|
56
48
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovotech/element-native",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1-canary-a8563d8-232",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@backpackapp-io/react-native-toast": "^0.10.0",
|
|
17
|
-
"@ovotech/element-core": "
|
|
17
|
+
"@ovotech/element-core": "*-canary-a8563d8-232",
|
|
18
18
|
"deepmerge": "^4.2.2",
|
|
19
|
-
"lodash.groupby": "^4.6.0"
|
|
19
|
+
"lodash.groupby": "^4.6.0",
|
|
20
|
+
"react-native-reanimated-carousel": "^3.5.1"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@babel/core": "^7.11.5",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"react-native-reanimated": "^2.10.0",
|
|
46
47
|
"react-native-safe-area-context": "^4.7.4",
|
|
47
48
|
"react-native-svg": "9.2.4",
|
|
48
|
-
"react-router-dom": "^
|
|
49
|
+
"react-router-dom": "^6.0.0",
|
|
49
50
|
"react-test-renderer": "^18.2.0",
|
|
50
51
|
"styled-components": "^5.1.3",
|
|
51
52
|
"ts-jest": "^28.0.5",
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.HorizontalCarousel = void 0;
|
|
45
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
46
|
-
var react_1 = require("react");
|
|
47
|
-
var react_native_1 = require("react-native");
|
|
48
|
-
var react_native_reanimated_1 = require("react-native-reanimated");
|
|
49
|
-
var react_native_reanimated_carousel_1 = __importDefault(require("react-native-reanimated-carousel"));
|
|
50
|
-
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
51
|
-
var Icon_1 = require("../Icon");
|
|
52
|
-
var NavigationDots_1 = require("./NavigationDots");
|
|
53
|
-
function HorizontalCarousel(_a) {
|
|
54
|
-
var data = _a.data, children = _a.children, width = _a.width, height = _a.height, fullWidth = _a.fullWidth, _b = _a.showArrows, showArrows = _b === void 0 ? true : _b, _c = _a.showDots, showDots = _c === void 0 ? true : _c, _d = _a.loop, loop = _d === void 0 ? true : _d, arrowsDistanceFromTop = _a.arrowsDistanceFromTop;
|
|
55
|
-
var theme = (0, styled_native_1.useTheme)();
|
|
56
|
-
var carouselRef = (0, react_1.useRef)(null);
|
|
57
|
-
var progressValue = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
58
|
-
var windowWidth = (0, react_native_1.useWindowDimensions)().width;
|
|
59
|
-
var carouselWidth = fullWidth ? windowWidth : width || windowWidth;
|
|
60
|
-
return ((0, jsx_runtime_1.jsxs)(SCarouselContainer, { children: [(0, jsx_runtime_1.jsx)(react_native_reanimated_carousel_1.default, { ref: carouselRef, data: data, renderItem: function (_a) {
|
|
61
|
-
var item = _a.item;
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)(SItemContainer, __assign({ "$itemWidth": carouselWidth }, { children: children(item) })));
|
|
63
|
-
}, vertical: false, width: carouselWidth, height: height, onProgressChange: function (_, absoluteProgress) {
|
|
64
|
-
return (progressValue.value = absoluteProgress);
|
|
65
|
-
}, panGestureHandlerProps: {
|
|
66
|
-
activeOffsetX: [-20, 20],
|
|
67
|
-
}, loop: loop, testID: "carousel" }), showArrows && data.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SActionPressable, __assign({ onPress: function () { var _a; return (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.prev(); }, "$top": arrowsDistanceFromTop, hitSlop: {
|
|
68
|
-
top: 32,
|
|
69
|
-
bottom: 32,
|
|
70
|
-
left: 16,
|
|
71
|
-
right: 16,
|
|
72
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "arrow-left", size: 16, color: theme.core.color.brand.white }) })), (0, jsx_runtime_1.jsx)(SActionPressable, __assign({ "$next": true, onPress: function () { var _a; return (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.next(); }, "$top": arrowsDistanceFromTop, hitSlop: {
|
|
73
|
-
top: 32,
|
|
74
|
-
bottom: 32,
|
|
75
|
-
left: 16,
|
|
76
|
-
right: 16,
|
|
77
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "arrow-right", size: 16, color: theme.core.color.brand.white }) }))] })), showDots && data.length > 1 && ((0, jsx_runtime_1.jsx)(NavigationDots_1.NavigationDots, { data: data, animatedValue: progressValue }))] }));
|
|
78
|
-
}
|
|
79
|
-
exports.HorizontalCarousel = HorizontalCarousel;
|
|
80
|
-
var SCarouselContainer = styled_native_1.default.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n"], ["\n align-items: center;\n"])));
|
|
81
|
-
var SItemContainer = styled_native_1.default.View(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n width: ", "px;\n height: 100%;\n justify-content: center;\n align-items: center;\n"], ["\n position: relative;\n width: ", "px;\n height: 100%;\n justify-content: center;\n align-items: center;\n"])), function (_a) {
|
|
82
|
-
var $itemWidth = _a.$itemWidth;
|
|
83
|
-
return $itemWidth;
|
|
84
|
-
});
|
|
85
|
-
var SActionPressable = styled_native_1.default.Pressable(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: ", ";\n ", ";\n"], ["\n position: absolute;\n top: ", ";\n ", ";\n"])), function (_a) {
|
|
86
|
-
var $top = _a.$top;
|
|
87
|
-
return ($top ? "".concat($top, "px") : '50%');
|
|
88
|
-
}, function (_a) {
|
|
89
|
-
var theme = _a.theme, $next = _a.$next;
|
|
90
|
-
return $next ? "right: ".concat(theme.core.space[6]) : "left: ".concat(theme.core.space[6]);
|
|
91
|
-
});
|
|
92
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './HorizontalCarousel';
|
|
@@ -1,17 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./HorizontalCarousel"), exports);
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { useRef } from 'react';
|
|
18
|
-
import { useWindowDimensions } from 'react-native';
|
|
19
|
-
import { useSharedValue } from 'react-native-reanimated';
|
|
20
|
-
import Carousel from 'react-native-reanimated-carousel';
|
|
21
|
-
import styled, { useTheme } from '../../styled.native';
|
|
22
|
-
import { Icon } from '../Icon';
|
|
23
|
-
import { NavigationDots } from './NavigationDots';
|
|
24
|
-
export function HorizontalCarousel(_a) {
|
|
25
|
-
var data = _a.data, children = _a.children, width = _a.width, height = _a.height, fullWidth = _a.fullWidth, _b = _a.showArrows, showArrows = _b === void 0 ? true : _b, _c = _a.showDots, showDots = _c === void 0 ? true : _c, _d = _a.loop, loop = _d === void 0 ? true : _d, arrowsDistanceFromTop = _a.arrowsDistanceFromTop;
|
|
26
|
-
var theme = useTheme();
|
|
27
|
-
var carouselRef = useRef(null);
|
|
28
|
-
var progressValue = useSharedValue(0);
|
|
29
|
-
var windowWidth = useWindowDimensions().width;
|
|
30
|
-
var carouselWidth = fullWidth ? windowWidth : width || windowWidth;
|
|
31
|
-
return (_jsxs(SCarouselContainer, { children: [_jsx(Carousel, { ref: carouselRef, data: data, renderItem: function (_a) {
|
|
32
|
-
var item = _a.item;
|
|
33
|
-
return (_jsx(SItemContainer, __assign({ "$itemWidth": carouselWidth }, { children: children(item) })));
|
|
34
|
-
}, vertical: false, width: carouselWidth, height: height, onProgressChange: function (_, absoluteProgress) {
|
|
35
|
-
return (progressValue.value = absoluteProgress);
|
|
36
|
-
}, panGestureHandlerProps: {
|
|
37
|
-
activeOffsetX: [-20, 20],
|
|
38
|
-
}, loop: loop, testID: "carousel" }), showArrows && data.length > 1 && (_jsxs(_Fragment, { children: [_jsx(SActionPressable, __assign({ onPress: function () { var _a; return (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.prev(); }, "$top": arrowsDistanceFromTop, hitSlop: {
|
|
39
|
-
top: 32,
|
|
40
|
-
bottom: 32,
|
|
41
|
-
left: 16,
|
|
42
|
-
right: 16,
|
|
43
|
-
} }, { children: _jsx(Icon, { name: "arrow-left", size: 16, color: theme.core.color.brand.white }) })), _jsx(SActionPressable, __assign({ "$next": true, onPress: function () { var _a; return (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.next(); }, "$top": arrowsDistanceFromTop, hitSlop: {
|
|
44
|
-
top: 32,
|
|
45
|
-
bottom: 32,
|
|
46
|
-
left: 16,
|
|
47
|
-
right: 16,
|
|
48
|
-
} }, { children: _jsx(Icon, { name: "arrow-right", size: 16, color: theme.core.color.brand.white }) }))] })), showDots && data.length > 1 && (_jsx(NavigationDots, { data: data, animatedValue: progressValue }))] }));
|
|
49
|
-
}
|
|
50
|
-
var SCarouselContainer = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n"], ["\n align-items: center;\n"])));
|
|
51
|
-
var SItemContainer = styled.View(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n width: ", "px;\n height: 100%;\n justify-content: center;\n align-items: center;\n"], ["\n position: relative;\n width: ", "px;\n height: 100%;\n justify-content: center;\n align-items: center;\n"])), function (_a) {
|
|
52
|
-
var $itemWidth = _a.$itemWidth;
|
|
53
|
-
return $itemWidth;
|
|
54
|
-
});
|
|
55
|
-
var SActionPressable = styled.Pressable(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: ", ";\n ", ";\n"], ["\n position: absolute;\n top: ", ";\n ", ";\n"])), function (_a) {
|
|
56
|
-
var $top = _a.$top;
|
|
57
|
-
return ($top ? "".concat($top, "px") : '50%');
|
|
58
|
-
}, function (_a) {
|
|
59
|
-
var theme = _a.theme, $next = _a.$next;
|
|
60
|
-
return $next ? "right: ".concat(theme.core.space[6]) : "left: ".concat(theme.core.space[6]);
|
|
61
|
-
});
|
|
62
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './HorizontalCarousel';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|