@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
|
@@ -9,11 +9,11 @@ export type NotificationProps = ViewProps & {
|
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
dismissible?: boolean;
|
|
11
11
|
onDismiss?: () => void;
|
|
12
|
-
|
|
12
|
+
onPress?: () => void;
|
|
13
13
|
ref?: React.RefObject<View>;
|
|
14
14
|
};
|
|
15
15
|
type PresetNotificationProps = Omit<NotificationProps, 'variant'>;
|
|
16
|
-
export declare const Notification: ({ variant, children, title, subtitle, noMargin,
|
|
16
|
+
export declare const Notification: ({ variant, children, title, subtitle, noMargin, onPress, dismissible, onDismiss, ref, ...rest }: NotificationProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
17
|
export declare const SuccessNotification: (props: PresetNotificationProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
export declare const InfoNotification: (props: PresetNotificationProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export declare const WarningNotification: (props: PresetNotificationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -22,26 +22,34 @@ const Strong_1 = require("../Strong");
|
|
|
22
22
|
const Notification_styles_1 = require("./Notification.styles");
|
|
23
23
|
const utils_1 = require("./utils");
|
|
24
24
|
const Notification = (_a) => {
|
|
25
|
-
var { variant = 'info', children, title, subtitle, noMargin,
|
|
25
|
+
var { variant = 'info', children, title, subtitle, noMargin, onPress, dismissible = true, onDismiss, ref } = _a, rest = __rest(_a, ["variant", "children", "title", "subtitle", "noMargin", "onPress", "dismissible", "onDismiss", "ref"]);
|
|
26
26
|
const [dismissed, setDismissed] = (0, react_1.useState)(false);
|
|
27
27
|
if (dismissed) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const isClickable = !!onPress;
|
|
31
|
+
if (isClickable || dismissible) {
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Notification_styles_1.NotificationShadow, { children: (0, jsx_runtime_1.jsx)(NotificationContent, Object.assign({ variant: variant, title: title, subtitle: subtitle, noMargin: noMargin, onPress: isClickable ? onPress : undefined, dismissible: dismissible, onDismiss: onDismiss, setDismissed: setDismissed, ref: ref }, rest, { children: children })) }));
|
|
32
33
|
}
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(NotificationContent, Object.assign({ variant: variant, title: title, subtitle: subtitle, noMargin: noMargin,
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(NotificationContent, Object.assign({ variant: variant, title: title, subtitle: subtitle, noMargin: noMargin, onPress: onPress, dismissible: dismissible, onDismiss: onDismiss, setDismissed: setDismissed, ref: ref }, rest, { children: children })));
|
|
34
35
|
};
|
|
35
36
|
exports.Notification = Notification;
|
|
36
37
|
const NotificationContent = (_a) => {
|
|
37
|
-
var { variant = 'info', children, title, subtitle, noMargin, dismissible, onDismiss, setDismissed, ref } = _a, rest = __rest(_a, ["variant", "children", "title", "subtitle", "noMargin", "dismissible", "onDismiss", "setDismissed", "ref"]);
|
|
38
|
+
var { variant = 'info', children, title, subtitle, noMargin, dismissible, onDismiss, setDismissed, onPress, ref } = _a, rest = __rest(_a, ["variant", "children", "title", "subtitle", "noMargin", "dismissible", "onDismiss", "setDismissed", "onPress", "ref"]);
|
|
38
39
|
const theme = (0, styled_native_1.useTheme)();
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const hasChildren = !!children;
|
|
41
|
+
const handleDismiss = () => {
|
|
42
|
+
if (onDismiss) {
|
|
43
|
+
onDismiss();
|
|
44
|
+
}
|
|
45
|
+
setDismissed(true);
|
|
46
|
+
};
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, Object.assign({ ref: ref }, rest, { children: [!!onPress && ((0, jsx_runtime_1.jsx)(Notification_styles_1.TappableNotification, { dismissible: dismissible, hasChildren: hasChildren, onPress: onPress })), (0, jsx_runtime_1.jsxs)(Notification_styles_1.NotificationBox, { noMargin: noMargin, testID: "nb-notification", children: [(0, jsx_runtime_1.jsx)(Notification_styles_1.VariantIconBackground, { variant: variant, children: (0, jsx_runtime_1.jsx)(Notification_styles_1.VariantIconContainer, { children: (0, jsx_runtime_1.jsx)(Notification_styles_1.StyledIcon, { variant: variant, size: theme.unit[800], name: (0, utils_1.mapVariantToIconName)(variant) }) }) }), (0, jsx_runtime_1.jsxs)(Notification_styles_1.ContentContainer, { children: [(0, jsx_runtime_1.jsxs)(Notification_styles_1.TitleContainer, { children: [title && ((0, jsx_runtime_1.jsx)(P_1.P, { size: "md", children: (0, jsx_runtime_1.jsx)(Strong_1.Strong, { children: title }) })), subtitle && (0, jsx_runtime_1.jsx)(P_1.P, { size: "sm", children: subtitle }), children && ((0, jsx_runtime_1.jsx)(Notification_styles_1.NotificationContentBox, { testID: "el-notification-box", children: children }))] }), dismissible ? ((0, jsx_runtime_1.jsx)(Notification_styles_1.DismissButton, { accessible: true, accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", hitSlop: {
|
|
48
|
+
top: theme.space[300],
|
|
49
|
+
right: theme.space[400],
|
|
50
|
+
bottom: theme.space[100],
|
|
51
|
+
left: theme.space[100],
|
|
52
|
+
}, onPress: handleDismiss, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { color: theme.button.surface.color.fgInverted, name: "cross", size: theme.space[400] }) })) : null] })] })] })));
|
|
45
53
|
};
|
|
46
54
|
const SuccessNotification = (props) => ((0, jsx_runtime_1.jsx)(exports.Notification, Object.assign({ variant: "success" }, props)));
|
|
47
55
|
exports.SuccessNotification = SuccessNotification;
|
|
@@ -49,5 +57,5 @@ const InfoNotification = (props) => ((0, jsx_runtime_1.jsx)(exports.Notification
|
|
|
49
57
|
exports.InfoNotification = InfoNotification;
|
|
50
58
|
const WarningNotification = (props) => ((0, jsx_runtime_1.jsx)(exports.Notification, Object.assign({ variant: "warning" }, props)));
|
|
51
59
|
exports.WarningNotification = WarningNotification;
|
|
52
|
-
const ErrorNotification = (props) => ((0, jsx_runtime_1.jsx)(exports.Notification, Object.assign({ variant: "error" }, props)));
|
|
60
|
+
const ErrorNotification = (props) => ((0, jsx_runtime_1.jsx)(exports.Notification, Object.assign({ variant: "error", dismissible: false }, props)));
|
|
53
61
|
exports.ErrorNotification = ErrorNotification;
|