@ovotech/element-native 5.6.0 → 5.7.0
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/styles.d.ts +3 -1734
- package/dist/components/ActionList/ActionListItems/DataListItem.js +3 -1
- package/dist/components/ActionList/ActionListItems/ToggleListItem.js +3 -4
- package/dist/components/ActionList/ActionListItems/styles.d.ts +22 -10404
- package/dist/components/ActionList/ActionListItems/styles.js +18 -16
- package/dist/components/ActionList/styled.d.ts +12 -6936
- package/dist/components/Badge/Badge.d.ts +1 -578
- package/dist/components/BottomActionBar/BottomActionBar.d.ts +12 -0
- package/dist/components/BottomActionBar/BottomActionBar.js +80 -0
- package/dist/components/BottomActionBar/OverlayProvider.d.ts +8 -0
- package/dist/components/BottomActionBar/OverlayProvider.js +38 -0
- package/dist/components/BottomActionBar/index.d.ts +2 -0
- package/dist/components/BottomActionBar/index.js +7 -0
- package/dist/components/Button/Button.styles.d.ts +5 -2312
- package/dist/components/Card/Card.styles.d.ts +3 -1734
- package/dist/components/Cards/AccountCard/AccountCard.styles.d.ts +8 -4624
- package/dist/components/Cards/BalanceCard/BalanceCard.styles.d.ts +15 -8670
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.styles.d.ts +1 -578
- package/dist/components/Cards/HeroImageCard/HeroImageCard.styles.d.ts +3 -1734
- package/dist/components/Cards/IconDataCard/IconDataCard.styles.d.ts +4 -2312
- package/dist/components/Cards/IconTextCard/IconTextCard.styles.d.ts +3 -1734
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.d.ts +5 -2890
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +1 -2
- package/dist/components/Cards/LinkTextCard/LinkTextCard.styles.d.ts +5 -2890
- package/dist/components/Cards/OfferCard/OfferCard.d.ts +22 -0
- package/dist/components/Cards/OfferCard/OfferCard.js +36 -0
- package/dist/components/Cards/OfferCard/OfferCard.styles.d.ts +34 -0
- package/dist/components/Cards/OfferCard/OfferCard.styles.js +61 -0
- package/dist/components/Cards/OfferCard/index.d.ts +1 -0
- package/dist/components/Cards/OfferCard/index.js +17 -0
- package/dist/components/Cards/ProgressBarCard/ProgressBarCard.styles.d.ts +9 -5202
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.styles.d.ts +5 -2890
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.styles.d.ts +5 -2890
- package/dist/components/Cards/shared.styles.d.ts +10 -5780
- package/dist/components/Checkbox/styled.d.ts +6 -3468
- package/dist/components/CurrencyInput/styled.d.ts +4 -2312
- package/dist/components/DataTable/styles.d.ts +13 -7514
- package/dist/components/Disclosure/Disclosure.d.ts +1 -578
- package/dist/components/Em/Em.d.ts +1 -578
- package/dist/components/EmptyState/styles.d.ts +2 -1156
- package/dist/components/ErrorText/ErrorText.d.ts +1 -578
- package/dist/components/Grid/Col.d.ts +1 -578
- package/dist/components/HintText/HintText.d.ts +1 -578
- package/dist/components/Input/styled.d.ts +3 -1734
- package/dist/components/LabelText/LabelText.d.ts +1 -578
- package/dist/components/LargeValueReference/styles.d.ts +3 -1734
- package/dist/components/LineThrough/LineThrough.d.ts +1 -578
- package/dist/components/List/styled.d.ts +4 -2312
- package/dist/components/Margin/Margin.d.ts +1 -578
- package/dist/components/NavHeader/NavHeader.styles.d.ts +11 -6358
- package/dist/components/Notification/Notification.d.ts +2 -2
- package/dist/components/Notification/Notification.js +20 -12
- package/dist/components/Notification/Notification.styles.d.ts +13 -5202
- package/dist/components/Notification/Notification.styles.js +21 -2
- package/dist/components/PasswordInput/PasswordInput.styled.d.ts +1 -578
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Radio/Radio.js +5 -43
- package/dist/components/Radio/Radio.styles.d.ts +9 -0
- package/dist/components/Radio/Radio.styles.js +74 -0
- package/dist/components/RadioCard/RadioCard.styles.d.ts +5 -2890
- package/dist/components/Rail/Rail.d.ts +12 -0
- package/dist/components/Rail/Rail.js +58 -0
- package/dist/components/Rail/RailIndicator.d.ts +7 -0
- package/dist/components/Rail/RailIndicator.js +81 -0
- package/dist/components/Rail/index.d.ts +1 -0
- package/dist/components/Rail/index.js +5 -0
- package/dist/components/Rail/styles.d.ts +13 -0
- package/dist/components/Rail/styles.js +55 -0
- package/dist/components/Rail/useRailPaging.d.ts +13 -0
- package/dist/components/Rail/useRailPaging.js +95 -0
- package/dist/components/SelectField/styled.d.ts +8 -4624
- package/dist/components/Strong/Strong.d.ts +1 -578
- package/dist/components/SubLabelText/SubLabelText.d.ts +1 -578
- package/dist/components/Tabs/Tab.d.ts +1 -578
- package/dist/components/Toast/Toast.d.ts +10 -4
- package/dist/components/Toast/Toast.js +40 -27
- package/dist/components/Toggle/styles.d.ts +4 -2312
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/esm/components/ActionList/ActionListItems/DataListItem.js +3 -1
- package/dist/esm/components/ActionList/ActionListItems/ToggleListItem.js +5 -6
- package/dist/esm/components/ActionList/ActionListItems/styles.js +17 -15
- package/dist/esm/components/BottomActionBar/BottomActionBar.js +40 -0
- package/dist/esm/components/BottomActionBar/OverlayProvider.js +30 -0
- package/dist/esm/components/BottomActionBar/index.js +2 -0
- package/dist/esm/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +1 -2
- package/dist/esm/components/Cards/OfferCard/OfferCard.js +32 -0
- package/dist/esm/components/Cards/OfferCard/OfferCard.styles.js +55 -0
- package/dist/esm/components/Cards/OfferCard/index.js +1 -0
- package/dist/esm/components/Notification/Notification.js +21 -13
- package/dist/esm/components/Notification/Notification.styles.js +20 -1
- package/dist/esm/components/Radio/Radio.js +4 -39
- package/dist/esm/components/Radio/Radio.styles.js +38 -0
- package/dist/esm/components/Rail/Rail.js +21 -0
- package/dist/esm/components/Rail/RailIndicator.js +44 -0
- package/dist/esm/components/Rail/index.js +1 -0
- package/dist/esm/components/Rail/styles.js +49 -0
- package/dist/esm/components/Rail/useRailPaging.js +92 -0
- package/dist/esm/components/Toast/Toast.js +40 -27
- package/dist/esm/components/index.js +2 -0
- package/dist/styled.native.d.ts +1 -3463
- package/package.json +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageSourcePropType } from 'react-native';
|
|
3
|
+
import { IconNameExtended } from '../../../providers';
|
|
4
|
+
type Graphic = {
|
|
5
|
+
type: 'illustration';
|
|
6
|
+
source: ImageSourcePropType | string;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'image';
|
|
9
|
+
source: ImageSourcePropType | string;
|
|
10
|
+
};
|
|
11
|
+
type Props = {
|
|
12
|
+
badgeText?: string;
|
|
13
|
+
graphic?: Graphic;
|
|
14
|
+
eyebrowText?: string;
|
|
15
|
+
eyebrowIcon?: IconNameExtended;
|
|
16
|
+
heading: string;
|
|
17
|
+
subHeading?: string;
|
|
18
|
+
size?: 'default' | 'small';
|
|
19
|
+
onPress?: () => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const OfferCard: React.FC<Props>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OfferCard = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const styled_native_1 = require("../../../styled.native");
|
|
7
|
+
const Icon_1 = require("../../Icon");
|
|
8
|
+
const P_1 = require("../../P");
|
|
9
|
+
const components_1 = require("../components");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
const OfferCard_styles_1 = require("./OfferCard.styles");
|
|
12
|
+
const GraphicContent = ({ graphic }) => {
|
|
13
|
+
if (!graphic) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const resizeMode = graphic.type === 'image' ? 'cover' : 'contain';
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(OfferCard_styles_1.CardImage, { source: typeof graphic.source === 'string'
|
|
18
|
+
? { uri: graphic.source }
|
|
19
|
+
: graphic.source, resizeMode: resizeMode }));
|
|
20
|
+
};
|
|
21
|
+
const OfferCard = ({ badgeText, graphic, eyebrowText, eyebrowIcon, heading, subHeading, size = 'default', onPress, }) => {
|
|
22
|
+
const theme = (0, styled_native_1.useTheme)();
|
|
23
|
+
const hasBadge = !!badgeText;
|
|
24
|
+
const isSmall = (0, utils_1.checkIsSmall)(size);
|
|
25
|
+
const [cardHeight, setCardHeight] = (0, react_1.useState)(0);
|
|
26
|
+
const onLayout = (0, react_1.useCallback)((e) => {
|
|
27
|
+
const { height: layoutHeight } = e.nativeEvent.layout;
|
|
28
|
+
setCardHeight(layoutHeight);
|
|
29
|
+
}, []);
|
|
30
|
+
const CardContent = ((0, jsx_runtime_1.jsxs)(OfferCard_styles_1.CardWithOffer, { isSmall: isSmall, onPress: onPress, onLayout: onLayout, children: [(0, jsx_runtime_1.jsxs)(OfferCard_styles_1.TextContent, { isSmall: isSmall, hasBadge: hasBadge, children: [(eyebrowIcon || eyebrowText) && ((0, jsx_runtime_1.jsxs)(OfferCard_styles_1.EyebrowContainer, { children: [eyebrowIcon && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: eyebrowIcon, color: theme.color.brand.dim })), eyebrowText && (0, jsx_runtime_1.jsx)(OfferCard_styles_1.EyebrowText, { size: "sm", children: eyebrowText })] })), (0, jsx_runtime_1.jsx)(OfferCard_styles_1.HeadingText, { isSmall: isSmall, children: heading }), subHeading && ((0, jsx_runtime_1.jsx)(OfferCard_styles_1.SubHeadingContainer, { children: (0, jsx_runtime_1.jsx)(P_1.P, { size: "sm", children: subHeading }) }))] }), (graphic === null || graphic === void 0 ? void 0 : graphic.type) === 'illustration' && ((0, jsx_runtime_1.jsx)(OfferCard_styles_1.IllustrationContainer, { hasBadge: hasBadge, isSmall: isSmall, children: (0, jsx_runtime_1.jsx)(GraphicContent, { graphic: graphic }) })), (graphic === null || graphic === void 0 ? void 0 : graphic.type) === 'image' && ((0, jsx_runtime_1.jsx)(OfferCard_styles_1.ImageContainer, { isSmall: isSmall, cardHeight: cardHeight, children: (0, jsx_runtime_1.jsx)(GraphicContent, { graphic: graphic }) }))] }));
|
|
31
|
+
if (!hasBadge) {
|
|
32
|
+
return CardContent;
|
|
33
|
+
}
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(components_1.ContainerWithCardBadge, { badgeText: badgeText, children: CardContent }));
|
|
35
|
+
};
|
|
36
|
+
exports.OfferCard = OfferCard;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Image, View } from 'react-native';
|
|
2
|
+
export declare const CardWithOffer: import("styled-components").StyledComponent<({ children, displayStyle, background, onPress, onSelect, ...rest }: import("../../Card/Card").CardProps) => import("react/jsx-runtime").JSX.Element, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {
|
|
3
|
+
isSmall?: boolean;
|
|
4
|
+
} & {
|
|
5
|
+
isSmall?: boolean;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const TextContent: import("styled-components").StyledComponent<typeof View, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {
|
|
8
|
+
isSmall?: boolean;
|
|
9
|
+
hasBadge?: boolean;
|
|
10
|
+
}, never>;
|
|
11
|
+
export declare const EyebrowContainer: import("styled-components").StyledComponent<typeof View, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {}, never>;
|
|
12
|
+
export declare const EyebrowText: import("styled-components").StyledComponent<(props: import("react-native").TextProps & {
|
|
13
|
+
inverted?: boolean;
|
|
14
|
+
ref?: React.Ref<import("react-native").Text>;
|
|
15
|
+
size?: "xl" | "lg" | "sm" | "md";
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {}, never>;
|
|
17
|
+
export declare const HeadingText: import("styled-components").StyledComponent<(props: import("react").PropsWithChildren<import("react-native").TextProps & Omit<{
|
|
18
|
+
inverted?: boolean;
|
|
19
|
+
level: import("../../Heading/Heading").HeadingLevel;
|
|
20
|
+
variant?: "brand" | "surface";
|
|
21
|
+
}, "level">>) => import("react/jsx-runtime").JSX.Element, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {
|
|
22
|
+
isSmall?: boolean;
|
|
23
|
+
}, never>;
|
|
24
|
+
export declare const SubHeadingContainer: import("styled-components").StyledComponent<typeof View, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {}, never>;
|
|
25
|
+
export declare const IllustrationContainer: import("styled-components").StyledComponent<typeof View, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {
|
|
26
|
+
isSmall?: boolean;
|
|
27
|
+
hasBadge?: boolean;
|
|
28
|
+
}, never>;
|
|
29
|
+
export declare const ImageContainer: import("styled-components").StyledComponent<typeof View, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {
|
|
30
|
+
isSmall?: boolean;
|
|
31
|
+
hasBadge?: boolean;
|
|
32
|
+
cardHeight?: number;
|
|
33
|
+
}, never>;
|
|
34
|
+
export declare const CardImage: import("styled-components").StyledComponent<typeof Image, import("@ovotech/element-core/dist/tokens-build/theme-native.types").ThemeNative, {}, never>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CardImage = exports.ImageContainer = exports.IllustrationContainer = exports.SubHeadingContainer = exports.HeadingText = exports.EyebrowText = exports.EyebrowContainer = exports.TextContent = exports.CardWithOffer = void 0;
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const __1 = require("../..");
|
|
9
|
+
const styled_native_1 = __importDefault(require("../../../styled.native"));
|
|
10
|
+
const shared_styles_1 = require("../shared.styles");
|
|
11
|
+
exports.CardWithOffer = (0, styled_native_1.default)(shared_styles_1.CardWithMinHeight)(({ isSmall }) => ({
|
|
12
|
+
padding: 0,
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: isSmall ? 'column-reverse' : 'row',
|
|
15
|
+
borderWidth: 0,
|
|
16
|
+
justifyContent: 'space-between',
|
|
17
|
+
}));
|
|
18
|
+
exports.TextContent = (0, styled_native_1.default)(react_native_1.View)(({ isSmall, hasBadge, theme }) => ({
|
|
19
|
+
flex: isSmall ? undefined : 1,
|
|
20
|
+
paddingHorizontal: theme.space[400],
|
|
21
|
+
paddingTop: !isSmall && hasBadge ? theme.space[800] : theme.space[400],
|
|
22
|
+
paddingBottom: theme.space[400],
|
|
23
|
+
alignSelf: isSmall ? undefined : 'flex-end',
|
|
24
|
+
}));
|
|
25
|
+
exports.EyebrowContainer = (0, styled_native_1.default)(react_native_1.View)(({ theme }) => ({
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
gap: theme.space[50],
|
|
28
|
+
marginBottom: theme.space[100],
|
|
29
|
+
}));
|
|
30
|
+
exports.EyebrowText = (0, styled_native_1.default)(__1.P)(({ theme }) => ({
|
|
31
|
+
color: theme.color.brand.dim,
|
|
32
|
+
}));
|
|
33
|
+
exports.HeadingText = (0, styled_native_1.default)(__1.Heading4)(({ isSmall, theme }) => ({
|
|
34
|
+
color: theme.color.surface.onSurface,
|
|
35
|
+
fontSize: isSmall ? theme.font.size.md.mediaQuery.sm : undefined,
|
|
36
|
+
lineHeight: isSmall ? theme.font.lineHeight.md.mediaQuery.sm : undefined,
|
|
37
|
+
}));
|
|
38
|
+
exports.SubHeadingContainer = (0, styled_native_1.default)(react_native_1.View)(({ theme }) => ({
|
|
39
|
+
marginTop: theme.space[100],
|
|
40
|
+
}));
|
|
41
|
+
exports.IllustrationContainer = (0, styled_native_1.default)(react_native_1.View)(({ theme, isSmall, hasBadge }) => ({
|
|
42
|
+
width: isSmall ? theme.space[1600] : theme.space[3000],
|
|
43
|
+
height: isSmall ? theme.space[1600] : theme.space[3000],
|
|
44
|
+
alignSelf: isSmall ? undefined : 'center',
|
|
45
|
+
marginBottom: isSmall ? 0 : theme.space[400],
|
|
46
|
+
marginTop: hasBadge ? theme.space[800] : theme.space[400],
|
|
47
|
+
marginLeft: isSmall ? theme.space[400] : 0,
|
|
48
|
+
}));
|
|
49
|
+
exports.ImageContainer = (0, styled_native_1.default)(react_native_1.View)(({ theme, isSmall, cardHeight = 0 }) => ({
|
|
50
|
+
height: isSmall
|
|
51
|
+
? theme.space[2400]
|
|
52
|
+
: cardHeight > 0
|
|
53
|
+
? cardHeight
|
|
54
|
+
: shared_styles_1.SMALL_CARD_HEIGHT,
|
|
55
|
+
width: !isSmall ? theme.space[3500] : undefined,
|
|
56
|
+
flexShrink: 0,
|
|
57
|
+
}));
|
|
58
|
+
exports.CardImage = (0, styled_native_1.default)(react_native_1.Image)({
|
|
59
|
+
width: '100%',
|
|
60
|
+
height: '100%',
|
|
61
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './OfferCard';
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./OfferCard"), exports);
|