@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.
Files changed (102) hide show
  1. package/dist/components/Accordion/styles.d.ts +3 -1734
  2. package/dist/components/ActionList/ActionListItems/DataListItem.js +3 -1
  3. package/dist/components/ActionList/ActionListItems/ToggleListItem.js +3 -4
  4. package/dist/components/ActionList/ActionListItems/styles.d.ts +22 -10404
  5. package/dist/components/ActionList/ActionListItems/styles.js +18 -16
  6. package/dist/components/ActionList/styled.d.ts +12 -6936
  7. package/dist/components/Badge/Badge.d.ts +1 -578
  8. package/dist/components/BottomActionBar/BottomActionBar.d.ts +12 -0
  9. package/dist/components/BottomActionBar/BottomActionBar.js +80 -0
  10. package/dist/components/BottomActionBar/OverlayProvider.d.ts +8 -0
  11. package/dist/components/BottomActionBar/OverlayProvider.js +38 -0
  12. package/dist/components/BottomActionBar/index.d.ts +2 -0
  13. package/dist/components/BottomActionBar/index.js +7 -0
  14. package/dist/components/Button/Button.styles.d.ts +5 -2312
  15. package/dist/components/Card/Card.styles.d.ts +3 -1734
  16. package/dist/components/Cards/AccountCard/AccountCard.styles.d.ts +8 -4624
  17. package/dist/components/Cards/BalanceCard/BalanceCard.styles.d.ts +15 -8670
  18. package/dist/components/Cards/DisruptiveCard/DisruptiveCard.styles.d.ts +1 -578
  19. package/dist/components/Cards/HeroImageCard/HeroImageCard.styles.d.ts +3 -1734
  20. package/dist/components/Cards/IconDataCard/IconDataCard.styles.d.ts +4 -2312
  21. package/dist/components/Cards/IconTextCard/IconTextCard.styles.d.ts +3 -1734
  22. package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.d.ts +5 -2890
  23. package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +1 -2
  24. package/dist/components/Cards/LinkTextCard/LinkTextCard.styles.d.ts +5 -2890
  25. package/dist/components/Cards/OfferCard/OfferCard.d.ts +22 -0
  26. package/dist/components/Cards/OfferCard/OfferCard.js +36 -0
  27. package/dist/components/Cards/OfferCard/OfferCard.styles.d.ts +34 -0
  28. package/dist/components/Cards/OfferCard/OfferCard.styles.js +61 -0
  29. package/dist/components/Cards/OfferCard/index.d.ts +1 -0
  30. package/dist/components/Cards/OfferCard/index.js +17 -0
  31. package/dist/components/Cards/ProgressBarCard/ProgressBarCard.styles.d.ts +9 -5202
  32. package/dist/components/Cards/QuickLinkCard/QuickLinkCard.styles.d.ts +5 -2890
  33. package/dist/components/Cards/ServicesImageCard/ServicesImageCard.styles.d.ts +5 -2890
  34. package/dist/components/Cards/shared.styles.d.ts +10 -5780
  35. package/dist/components/Checkbox/styled.d.ts +6 -3468
  36. package/dist/components/CurrencyInput/styled.d.ts +4 -2312
  37. package/dist/components/DataTable/styles.d.ts +13 -7514
  38. package/dist/components/Disclosure/Disclosure.d.ts +1 -578
  39. package/dist/components/Em/Em.d.ts +1 -578
  40. package/dist/components/EmptyState/styles.d.ts +2 -1156
  41. package/dist/components/ErrorText/ErrorText.d.ts +1 -578
  42. package/dist/components/Grid/Col.d.ts +1 -578
  43. package/dist/components/HintText/HintText.d.ts +1 -578
  44. package/dist/components/Input/styled.d.ts +3 -1734
  45. package/dist/components/LabelText/LabelText.d.ts +1 -578
  46. package/dist/components/LargeValueReference/styles.d.ts +3 -1734
  47. package/dist/components/LineThrough/LineThrough.d.ts +1 -578
  48. package/dist/components/List/styled.d.ts +4 -2312
  49. package/dist/components/Margin/Margin.d.ts +1 -578
  50. package/dist/components/NavHeader/NavHeader.styles.d.ts +11 -6358
  51. package/dist/components/Notification/Notification.d.ts +2 -2
  52. package/dist/components/Notification/Notification.js +20 -12
  53. package/dist/components/Notification/Notification.styles.d.ts +13 -5202
  54. package/dist/components/Notification/Notification.styles.js +21 -2
  55. package/dist/components/PasswordInput/PasswordInput.styled.d.ts +1 -578
  56. package/dist/components/Radio/Radio.d.ts +2 -2
  57. package/dist/components/Radio/Radio.js +5 -43
  58. package/dist/components/Radio/Radio.styles.d.ts +9 -0
  59. package/dist/components/Radio/Radio.styles.js +74 -0
  60. package/dist/components/RadioCard/RadioCard.styles.d.ts +5 -2890
  61. package/dist/components/Rail/Rail.d.ts +12 -0
  62. package/dist/components/Rail/Rail.js +58 -0
  63. package/dist/components/Rail/RailIndicator.d.ts +7 -0
  64. package/dist/components/Rail/RailIndicator.js +81 -0
  65. package/dist/components/Rail/index.d.ts +1 -0
  66. package/dist/components/Rail/index.js +5 -0
  67. package/dist/components/Rail/styles.d.ts +13 -0
  68. package/dist/components/Rail/styles.js +55 -0
  69. package/dist/components/Rail/useRailPaging.d.ts +13 -0
  70. package/dist/components/Rail/useRailPaging.js +95 -0
  71. package/dist/components/SelectField/styled.d.ts +8 -4624
  72. package/dist/components/Strong/Strong.d.ts +1 -578
  73. package/dist/components/SubLabelText/SubLabelText.d.ts +1 -578
  74. package/dist/components/Tabs/Tab.d.ts +1 -578
  75. package/dist/components/Toast/Toast.d.ts +10 -4
  76. package/dist/components/Toast/Toast.js +40 -27
  77. package/dist/components/Toggle/styles.d.ts +4 -2312
  78. package/dist/components/index.d.ts +2 -0
  79. package/dist/components/index.js +2 -0
  80. package/dist/esm/components/ActionList/ActionListItems/DataListItem.js +3 -1
  81. package/dist/esm/components/ActionList/ActionListItems/ToggleListItem.js +5 -6
  82. package/dist/esm/components/ActionList/ActionListItems/styles.js +17 -15
  83. package/dist/esm/components/BottomActionBar/BottomActionBar.js +40 -0
  84. package/dist/esm/components/BottomActionBar/OverlayProvider.js +30 -0
  85. package/dist/esm/components/BottomActionBar/index.js +2 -0
  86. package/dist/esm/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +1 -2
  87. package/dist/esm/components/Cards/OfferCard/OfferCard.js +32 -0
  88. package/dist/esm/components/Cards/OfferCard/OfferCard.styles.js +55 -0
  89. package/dist/esm/components/Cards/OfferCard/index.js +1 -0
  90. package/dist/esm/components/Notification/Notification.js +21 -13
  91. package/dist/esm/components/Notification/Notification.styles.js +20 -1
  92. package/dist/esm/components/Radio/Radio.js +4 -39
  93. package/dist/esm/components/Radio/Radio.styles.js +38 -0
  94. package/dist/esm/components/Rail/Rail.js +21 -0
  95. package/dist/esm/components/Rail/RailIndicator.js +44 -0
  96. package/dist/esm/components/Rail/index.js +1 -0
  97. package/dist/esm/components/Rail/styles.js +49 -0
  98. package/dist/esm/components/Rail/useRailPaging.js +92 -0
  99. package/dist/esm/components/Toast/Toast.js +40 -27
  100. package/dist/esm/components/index.js +2 -0
  101. package/dist/styled.native.d.ts +1 -3463
  102. 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
- isTappable?: boolean;
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, isTappable, dismissible, onDismiss, ref, ...rest }: NotificationProps) => import("react/jsx-runtime").JSX.Element | null;
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, isTappable = false, dismissible, onDismiss, ref } = _a, rest = __rest(_a, ["variant", "children", "title", "subtitle", "noMargin", "isTappable", "dismissible", "onDismiss", "ref"]);
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
- if (isTappable || dismissible) {
31
- 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, isTappable: isTappable, dismissible: dismissible, onDismiss: onDismiss, setDismissed: setDismissed, ref: ref }, rest, { children: children })) }));
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, isTappable: isTappable, dismissible: dismissible, onDismiss: onDismiss, setDismissed: setDismissed, ref: ref }, rest, { children: children })));
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
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, Object.assign({ ref: ref }, rest, { children: (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", onPress: () => {
40
- setDismissed(true);
41
- if (onDismiss) {
42
- onDismiss();
43
- }
44
- }, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { color: theme.button.surface.color.fgInverted, name: "cross", size: theme.space[400] }) })) : null] })] }) })));
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;