@utilitywarehouse/hearth-react-native 0.7.0 → 0.8.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 (109) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +12 -0
  4. package/build/components/Banner/Banner.d.ts +6 -0
  5. package/build/components/Banner/Banner.js +161 -0
  6. package/build/components/Banner/Banner.props.d.ts +82 -0
  7. package/build/components/Banner/Banner.props.js +1 -0
  8. package/build/components/Banner/index.d.ts +2 -0
  9. package/build/components/Banner/index.js +1 -0
  10. package/build/components/BottomSheet/BottomSheetBackdrop.js +1 -5
  11. package/build/components/BottomSheet/BottomSheetFlatList.js +1 -5
  12. package/build/components/BottomSheet/BottomSheetHandle.js +1 -5
  13. package/build/components/BottomSheet/useBottomSheetLogic.d.ts +1 -1
  14. package/build/components/Expandable/Expandable.d.ts +6 -0
  15. package/build/components/Expandable/Expandable.js +44 -0
  16. package/build/components/Expandable/Expandable.props.d.ts +38 -0
  17. package/build/components/Expandable/Expandable.props.js +1 -0
  18. package/build/components/Expandable/index.d.ts +2 -0
  19. package/build/components/Expandable/index.js +1 -0
  20. package/build/components/ExpandableCard/ExpandableCard.d.ts +6 -0
  21. package/build/components/ExpandableCard/ExpandableCard.js +23 -0
  22. package/build/components/ExpandableCard/ExpandableCard.props.d.ts +69 -0
  23. package/build/components/ExpandableCard/ExpandableCard.props.js +1 -0
  24. package/build/components/ExpandableCard/ExpandableCardContent.d.ts +6 -0
  25. package/build/components/ExpandableCard/ExpandableCardContent.js +14 -0
  26. package/build/components/ExpandableCard/ExpandableCardExpandedContent.d.ts +11 -0
  27. package/build/components/ExpandableCard/ExpandableCardExpandedContent.js +18 -0
  28. package/build/components/ExpandableCard/ExpandableCardGroup.d.ts +6 -0
  29. package/build/components/ExpandableCard/ExpandableCardGroup.js +17 -0
  30. package/build/components/ExpandableCard/ExpandableCardGroup.props.d.ts +25 -0
  31. package/build/components/ExpandableCard/ExpandableCardGroup.props.js +1 -0
  32. package/build/components/ExpandableCard/ExpandableCardHelperText.d.ts +6 -0
  33. package/build/components/ExpandableCard/ExpandableCardHelperText.js +13 -0
  34. package/build/components/ExpandableCard/ExpandableCardIcon.d.ts +9 -0
  35. package/build/components/ExpandableCard/ExpandableCardIcon.js +19 -0
  36. package/build/components/ExpandableCard/ExpandableCardLeadingContent.d.ts +6 -0
  37. package/build/components/ExpandableCard/ExpandableCardLeadingContent.js +5 -0
  38. package/build/components/ExpandableCard/ExpandableCardText.d.ts +6 -0
  39. package/build/components/ExpandableCard/ExpandableCardText.js +7 -0
  40. package/build/components/ExpandableCard/ExpandableCardTrailingContent.d.ts +6 -0
  41. package/build/components/ExpandableCard/ExpandableCardTrailingContent.js +5 -0
  42. package/build/components/ExpandableCard/ExpandableCardTrailingIcon.d.ts +9 -0
  43. package/build/components/ExpandableCard/ExpandableCardTrailingIcon.js +17 -0
  44. package/build/components/ExpandableCard/ExpandableCardTrigger.d.ts +17 -0
  45. package/build/components/ExpandableCard/ExpandableCardTrigger.js +7 -0
  46. package/build/components/ExpandableCard/ExpandableCardTrigger.props.d.ts +44 -0
  47. package/build/components/ExpandableCard/ExpandableCardTrigger.props.js +1 -0
  48. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.d.ts +11 -0
  49. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +91 -0
  50. package/build/components/ExpandableCard/index.d.ts +14 -0
  51. package/build/components/ExpandableCard/index.js +11 -0
  52. package/build/components/HighlightBanner/HighlightBanner.d.ts +6 -0
  53. package/build/components/HighlightBanner/HighlightBanner.js +86 -0
  54. package/build/components/HighlightBanner/HighlightBanner.props.d.ts +14 -0
  55. package/build/components/HighlightBanner/HighlightBanner.props.js +1 -0
  56. package/build/components/HighlightBanner/index.d.ts +2 -0
  57. package/build/components/HighlightBanner/index.js +1 -0
  58. package/build/components/Spinner/Spinner.js +0 -2
  59. package/build/components/Spinner/Spinner.web.d.ts +2 -1
  60. package/build/components/Spinner/Spinner.web.js +0 -2
  61. package/build/components/Switch/Switch.web.js +0 -1
  62. package/build/components/Tabs/TabsList.js +1 -6
  63. package/build/components/index.d.ts +4 -0
  64. package/build/components/index.js +4 -0
  65. package/docs/components/AllComponents.web.tsx +75 -4
  66. package/docs/components/VariantTitle.tsx +1 -1
  67. package/package.json +1 -1
  68. package/src/components/Banner/Banner.docs.mdx +402 -0
  69. package/src/components/Banner/Banner.props.ts +106 -0
  70. package/src/components/Banner/Banner.stories.tsx +494 -0
  71. package/src/components/Banner/Banner.tsx +264 -0
  72. package/src/components/Banner/index.ts +2 -0
  73. package/src/components/BottomSheet/BottomSheetBackdrop.tsx +0 -1
  74. package/src/components/BottomSheet/BottomSheetFlatList.tsx +0 -1
  75. package/src/components/BottomSheet/BottomSheetHandle.tsx +0 -1
  76. package/src/components/Card/Card.docs.mdx +10 -2
  77. package/src/components/Expandable/Expandable.docs.mdx +201 -0
  78. package/src/components/Expandable/Expandable.props.ts +46 -0
  79. package/src/components/Expandable/Expandable.stories.tsx +284 -0
  80. package/src/components/Expandable/Expandable.tsx +92 -0
  81. package/src/components/Expandable/index.ts +2 -0
  82. package/src/components/ExpandableCard/ExpandableCard.docs.mdx +312 -0
  83. package/src/components/ExpandableCard/ExpandableCard.props.ts +85 -0
  84. package/src/components/ExpandableCard/ExpandableCard.stories.tsx +326 -0
  85. package/src/components/ExpandableCard/ExpandableCard.tsx +76 -0
  86. package/src/components/ExpandableCard/ExpandableCardContent.tsx +21 -0
  87. package/src/components/ExpandableCard/ExpandableCardExpandedContent.tsx +42 -0
  88. package/src/components/ExpandableCard/ExpandableCardGroup.props.ts +31 -0
  89. package/src/components/ExpandableCard/ExpandableCardGroup.tsx +40 -0
  90. package/src/components/ExpandableCard/ExpandableCardHelperText.tsx +21 -0
  91. package/src/components/ExpandableCard/ExpandableCardIcon.tsx +32 -0
  92. package/src/components/ExpandableCard/ExpandableCardLeadingContent.tsx +9 -0
  93. package/src/components/ExpandableCard/ExpandableCardText.tsx +14 -0
  94. package/src/components/ExpandableCard/ExpandableCardTrailingContent.tsx +9 -0
  95. package/src/components/ExpandableCard/ExpandableCardTrailingIcon.tsx +30 -0
  96. package/src/components/ExpandableCard/ExpandableCardTrigger.props.ts +47 -0
  97. package/src/components/ExpandableCard/ExpandableCardTrigger.tsx +10 -0
  98. package/src/components/ExpandableCard/ExpandableCardTriggerRoot.tsx +154 -0
  99. package/src/components/ExpandableCard/index.ts +14 -0
  100. package/src/components/HighlightBanner/HighlightBanner.docs.mdx +277 -0
  101. package/src/components/HighlightBanner/HighlightBanner.props.ts +29 -0
  102. package/src/components/HighlightBanner/HighlightBanner.stories.tsx +259 -0
  103. package/src/components/HighlightBanner/HighlightBanner.tsx +122 -0
  104. package/src/components/HighlightBanner/index.ts +2 -0
  105. package/src/components/Spinner/Spinner.tsx +0 -2
  106. package/src/components/Spinner/Spinner.web.tsx +0 -2
  107. package/src/components/Switch/Switch.web.tsx +1 -5
  108. package/src/components/Tabs/TabsList.tsx +0 -2
  109. package/src/components/index.ts +4 -0
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ViewProps } from 'react-native';
3
+ export interface ExpandableCardGroupProps extends ViewProps {
4
+ /**
5
+ * Section heading
6
+ */
7
+ heading?: string;
8
+ /**
9
+ * Helper text displayed below the heading
10
+ */
11
+ helperText?: string;
12
+ /**
13
+ * Trailing content for the header (e.g., a link)
14
+ */
15
+ headerTrailingContent?: ReactNode;
16
+ /**
17
+ * The ExpandableCard children
18
+ */
19
+ children: ReactNode;
20
+ /**
21
+ * Test ID for testing
22
+ */
23
+ testID?: string;
24
+ }
25
+ export default ExpandableCardGroupProps;
@@ -0,0 +1,6 @@
1
+ import { TextProps } from 'react-native';
2
+ declare const ExpandableCardHelperText: {
3
+ ({ children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default ExpandableCardHelperText;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { StyleSheet } from 'react-native-unistyles';
3
+ import { BodyText } from '../BodyText';
4
+ const ExpandableCardHelperText = ({ children, ...props }) => {
5
+ return (_jsx(BodyText, { size: "md", ...props, style: [styles.text, props.style], children: children }));
6
+ };
7
+ ExpandableCardHelperText.displayName = 'ExpandableCardHelperText';
8
+ const styles = StyleSheet.create(theme => ({
9
+ text: {
10
+ color: theme.color.text.secondary,
11
+ },
12
+ }));
13
+ export default ExpandableCardHelperText;
@@ -0,0 +1,9 @@
1
+ import { ComponentType } from 'react';
2
+ import { IconProps } from '../Icon';
3
+ declare const ExpandableCardIcon: {
4
+ ({ children, ...props }: IconProps & {
5
+ as?: ComponentType;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export default ExpandableCardIcon;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Platform } from 'react-native';
3
+ import { StyleSheet } from 'react-native-unistyles';
4
+ import { Icon } from '../Icon';
5
+ const ExpandableCardIcon = ({ children, ...props }) => {
6
+ return (_jsx(Icon, { ...props, style: Platform.OS === 'web'
7
+ ? // @ts-expect-error - style prop type issue
8
+ { ...styles.icon, ...props.style }
9
+ : [styles.icon, props.style], children: children }));
10
+ };
11
+ ExpandableCardIcon.displayName = 'ExpandableCardIcon';
12
+ const styles = StyleSheet.create(theme => ({
13
+ icon: {
14
+ color: theme.color.icon.primary,
15
+ width: 24,
16
+ height: 24,
17
+ },
18
+ }));
19
+ export default ExpandableCardIcon;
@@ -0,0 +1,6 @@
1
+ import { type ViewProps } from 'react-native';
2
+ declare const ExpandableCardLeadingContent: {
3
+ ({ children, ...props }: ViewProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default ExpandableCardLeadingContent;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ const ExpandableCardLeadingContent = ({ children, ...props }) => (_jsx(View, { ...props, children: children }));
4
+ ExpandableCardLeadingContent.displayName = 'ExpandableCardLeadingContent';
5
+ export default ExpandableCardLeadingContent;
@@ -0,0 +1,6 @@
1
+ import { TextProps } from 'react-native';
2
+ declare const ExpandableCardText: {
3
+ ({ children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default ExpandableCardText;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { BodyText } from '../BodyText';
3
+ const ExpandableCardText = ({ children, ...props }) => {
4
+ return (_jsx(BodyText, { size: "lg", ...props, children: children }));
5
+ };
6
+ ExpandableCardText.displayName = 'ExpandableCardText';
7
+ export default ExpandableCardText;
@@ -0,0 +1,6 @@
1
+ import { type ViewProps } from 'react-native';
2
+ declare const ExpandableCardTrailingContent: {
3
+ ({ children, ...props }: ViewProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default ExpandableCardTrailingContent;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ const ExpandableCardTrailingContent = ({ children, ...props }) => (_jsx(View, { ...props, children: children }));
4
+ ExpandableCardTrailingContent.displayName = 'ExpandableCardTrailingContent';
5
+ export default ExpandableCardTrailingContent;
@@ -0,0 +1,9 @@
1
+ import { ComponentType } from 'react';
2
+ import { IconProps } from '../Icon';
3
+ declare const ExpandableCardTrailingIcon: {
4
+ ({ children, ...props }: IconProps & {
5
+ as?: ComponentType;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export default ExpandableCardTrailingIcon;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Platform } from 'react-native';
3
+ import { StyleSheet } from 'react-native-unistyles';
4
+ import { Icon } from '../Icon';
5
+ const ExpandableCardTrailingIcon = ({ children, ...props }) => {
6
+ return (_jsx(Icon, { ...props, style: Platform.OS === 'web'
7
+ ? // @ts-expect-error - style prop type issue
8
+ { ...styles.icon, ...props.style }
9
+ : [styles.icon, props.style], children: children }));
10
+ };
11
+ ExpandableCardTrailingIcon.displayName = 'ExpandableCardTrailingIcon';
12
+ const styles = StyleSheet.create(theme => ({
13
+ icon: {
14
+ color: theme.color.icon.primary,
15
+ },
16
+ }));
17
+ export default ExpandableCardTrailingIcon;
@@ -0,0 +1,17 @@
1
+ declare const ExpandableCardTrigger: import("react").ForwardRefExoticComponent<import("./ExpandableCardTrigger.props").ExpandableCardTriggerProps & {
2
+ states?: {
3
+ active?: boolean;
4
+ disabled?: boolean;
5
+ };
6
+ } & Omit<import("react-native").PressableProps, "children"> & {
7
+ tabIndex?: 0 | -1 | undefined;
8
+ } & {
9
+ children?: import("react").ReactNode | (({ hovered, pressed, focused, focusVisible, disabled, }: {
10
+ hovered?: boolean | undefined;
11
+ pressed?: boolean | undefined;
12
+ focused?: boolean | undefined;
13
+ focusVisible?: boolean | undefined;
14
+ disabled?: boolean | undefined;
15
+ }) => import("react").ReactNode);
16
+ } & import("react").RefAttributes<unknown>>;
17
+ export default ExpandableCardTrigger;
@@ -0,0 +1,7 @@
1
+ import { createPressable } from '@gluestack-ui/pressable';
2
+ import ExpandableCardTriggerRoot from './ExpandableCardTriggerRoot';
3
+ const ExpandableCardTrigger = createPressable({
4
+ Root: ExpandableCardTriggerRoot,
5
+ });
6
+ ExpandableCardTrigger.displayName = 'ExpandableCardTrigger';
7
+ export default ExpandableCardTrigger;
@@ -0,0 +1,44 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { PressableProps } from 'react-native';
3
+ import type BadgeProps from '../Badge/Badge.props';
4
+ export interface ExpandableCardTriggerProps extends Omit<PressableProps, 'children'> {
5
+ /**
6
+ * The main heading text
7
+ */
8
+ heading?: string;
9
+ /**
10
+ * Optional helper text displayed below the heading
11
+ */
12
+ helperText?: string;
13
+ /**
14
+ * Leading icon component
15
+ */
16
+ leadingIcon?: ComponentType;
17
+ /**
18
+ * Content to display on the left side (e.g., icon, avatar)
19
+ */
20
+ leadingContent?: React.ReactNode;
21
+ /**
22
+ * Optional badge to display
23
+ */
24
+ badge?: BadgeProps;
25
+ /**
26
+ * Position of the badge relative to the heading
27
+ * @default 'bottom'
28
+ */
29
+ badgePosition?: 'top' | 'bottom';
30
+ /**
31
+ * Optional numeric value to display
32
+ */
33
+ numericValue?: string | number;
34
+ /**
35
+ * Whether the expandable card is expanded
36
+ */
37
+ isExpanded: boolean;
38
+ /**
39
+ * Whether the trigger is disabled
40
+ */
41
+ disabled?: boolean;
42
+ children?: React.ReactNode;
43
+ }
44
+ export default ExpandableCardTriggerProps;
@@ -0,0 +1,11 @@
1
+ import type ExpandableCardTriggerProps from './ExpandableCardTrigger.props';
2
+ declare const ExpandableCardTriggerRoot: {
3
+ ({ heading, helperText, leadingIcon, leadingContent, badge, badgePosition, numericValue, isExpanded, disabled, states, children, ...props }: ExpandableCardTriggerProps & {
4
+ states?: {
5
+ active?: boolean;
6
+ disabled?: boolean;
7
+ };
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ displayName: string;
10
+ };
11
+ export default ExpandableCardTriggerRoot;
@@ -0,0 +1,91 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ChevronDownSmallIcon, ChevronUpSmallIcon, } from '@utilitywarehouse/hearth-react-native-icons';
3
+ import { Pressable } from 'react-native';
4
+ import { StyleSheet } from 'react-native-unistyles';
5
+ import { Badge } from '../Badge';
6
+ import { DetailText } from '../DetailText';
7
+ import ExpandableCardContent from './ExpandableCardContent';
8
+ import ExpandableCardHelperText from './ExpandableCardHelperText';
9
+ import ExpandableCardIcon from './ExpandableCardIcon';
10
+ import ExpandableCardLeadingContent from './ExpandableCardLeadingContent';
11
+ import ExpandableCardText from './ExpandableCardText';
12
+ import ExpandableCardTrailingContent from './ExpandableCardTrailingContent';
13
+ import ExpandableCardTrailingIcon from './ExpandableCardTrailingIcon';
14
+ const ExpandableCardTriggerRoot = ({ heading, helperText, leadingIcon, leadingContent, badge, badgePosition = 'bottom', numericValue, isExpanded, disabled, states, children, ...props }) => {
15
+ const { active } = states || { active: false };
16
+ const testID = props.testID || 'expandable-card-trigger';
17
+ styles.useVariants({
18
+ active,
19
+ disabled: !!disabled,
20
+ });
21
+ const renderLeadingContent = () => {
22
+ if (leadingIcon) {
23
+ return (_jsx(ExpandableCardLeadingContent, { children: _jsx(ExpandableCardIcon, { as: leadingIcon }) }));
24
+ }
25
+ if (leadingContent) {
26
+ return _jsx(ExpandableCardLeadingContent, { children: leadingContent });
27
+ }
28
+ return null;
29
+ };
30
+ const renderTopBadge = () => {
31
+ if (badgePosition === 'top' && badge) {
32
+ return _jsx(Badge, { ...badge });
33
+ }
34
+ return null;
35
+ };
36
+ const renderBottomBadge = () => {
37
+ if (badgePosition === 'bottom' && badge) {
38
+ return _jsx(Badge, { ...badge });
39
+ }
40
+ return null;
41
+ };
42
+ const renderDefaultContent = () => (_jsxs(_Fragment, { children: [renderLeadingContent(), _jsxs(ExpandableCardContent, { children: [renderTopBadge(), _jsx(ExpandableCardText, { children: heading }), helperText && _jsx(ExpandableCardHelperText, { children: helperText }), renderBottomBadge()] }), numericValue && (_jsx(DetailText, { size: "lg", style: styles.numericValue, children: numericValue })), _jsx(ExpandableCardTrailingContent, { style: styles.chevron, children: _jsx(ExpandableCardTrailingIcon, { as: isExpanded ? ChevronUpSmallIcon : ChevronDownSmallIcon }) })] }));
43
+ return (_jsx(Pressable, { ...props, testID: testID, style: [styles.container, props.style], disabled: disabled, accessibilityRole: "button", accessibilityState: { expanded: isExpanded, disabled }, accessibilityLabel: `${heading}${helperText ? `, ${helperText}` : ''}`, children: children || renderDefaultContent() }));
44
+ };
45
+ ExpandableCardTriggerRoot.displayName = 'ExpandableCardTriggerRoot';
46
+ const styles = StyleSheet.create(theme => ({
47
+ container: {
48
+ paddingVertical: theme.components.card.mobile.padding,
49
+ paddingHorizontal: theme.components.card.mobile.padding,
50
+ flexDirection: 'row',
51
+ width: '100%',
52
+ gap: theme.components.expandableCard.gapHorizontal,
53
+ variants: {
54
+ disabled: {
55
+ true: {
56
+ cursor: 'auto',
57
+ opacity: theme.opacity.disabled,
58
+ },
59
+ false: {
60
+ _web: {
61
+ _hover: {
62
+ backgroundColor: theme.color.interactive.neutral.surface.subtle.hover,
63
+ },
64
+ _active: {
65
+ backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
66
+ },
67
+ },
68
+ },
69
+ },
70
+ active: {
71
+ true: {},
72
+ },
73
+ },
74
+ compoundVariants: [
75
+ {
76
+ disabled: false,
77
+ active: true,
78
+ styles: {
79
+ backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
80
+ },
81
+ },
82
+ ],
83
+ },
84
+ chevron: {
85
+ justifyContent: 'center',
86
+ },
87
+ numericValue: {
88
+ alignSelf: 'center',
89
+ },
90
+ }));
91
+ export default ExpandableCardTriggerRoot;
@@ -0,0 +1,14 @@
1
+ export { default as ExpandableCard } from './ExpandableCard';
2
+ export type { default as ExpandableCardProps } from './ExpandableCard.props';
3
+ export { default as ExpandableCardContent } from './ExpandableCardContent';
4
+ export { default as ExpandableCardExpandedContent } from './ExpandableCardExpandedContent';
5
+ export { default as ExpandableCardGroup } from './ExpandableCardGroup';
6
+ export type { default as ExpandableCardGroupProps } from './ExpandableCardGroup.props';
7
+ export { default as ExpandableCardHelperText } from './ExpandableCardHelperText';
8
+ export { default as ExpandableCardIcon } from './ExpandableCardIcon';
9
+ export { default as ExpandableCardLeadingContent } from './ExpandableCardLeadingContent';
10
+ export { default as ExpandableCardText } from './ExpandableCardText';
11
+ export { default as ExpandableCardTrailingContent } from './ExpandableCardTrailingContent';
12
+ export { default as ExpandableCardTrailingIcon } from './ExpandableCardTrailingIcon';
13
+ export { default as ExpandableCardTrigger } from './ExpandableCardTrigger';
14
+ export type { default as ExpandableCardTriggerProps } from './ExpandableCardTrigger.props';
@@ -0,0 +1,11 @@
1
+ export { default as ExpandableCard } from './ExpandableCard';
2
+ export { default as ExpandableCardContent } from './ExpandableCardContent';
3
+ export { default as ExpandableCardExpandedContent } from './ExpandableCardExpandedContent';
4
+ export { default as ExpandableCardGroup } from './ExpandableCardGroup';
5
+ export { default as ExpandableCardHelperText } from './ExpandableCardHelperText';
6
+ export { default as ExpandableCardIcon } from './ExpandableCardIcon';
7
+ export { default as ExpandableCardLeadingContent } from './ExpandableCardLeadingContent';
8
+ export { default as ExpandableCardText } from './ExpandableCardText';
9
+ export { default as ExpandableCardTrailingContent } from './ExpandableCardTrailingContent';
10
+ export { default as ExpandableCardTrailingIcon } from './ExpandableCardTrailingIcon';
11
+ export { default as ExpandableCardTrigger } from './ExpandableCardTrigger';
@@ -0,0 +1,6 @@
1
+ import type HighlightBannerProps from './HighlightBanner.props';
2
+ declare const HighlightBanner: {
3
+ ({ heading, headingColor, image, imageContainerHeight, description, link, button, variant, style, ...props }: HighlightBannerProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default HighlightBanner;
@@ -0,0 +1,86 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Image, View } from 'react-native';
3
+ import { StyleSheet } from 'react-native-unistyles';
4
+ import { BodyText } from '../BodyText';
5
+ import { Card } from '../Card';
6
+ const HighlightBanner = ({ heading, headingColor, image, imageContainerHeight, description, link, button, variant = 'emphasis', style, ...props }) => {
7
+ styles.useVariants({ headingColor, variant });
8
+ return (_jsx(Card, { variant: variant, noPadding: true, style: style, ...props, children: _jsxs(View, { style: [styles.container], children: [_jsx(View, { style: [styles.header], children: _jsx(BodyText, { size: "md", textAlign: "center", weight: "semibold", children: heading }) }), _jsx(View, { style: styles.imageContainer(imageContainerHeight), children: _jsx(Image, { resizeMode: "cover", ...image, style: [styles.image, image?.style] }) }), _jsxs(View, { style: styles.footer, children: [_jsx(BodyText, { size: "md", textAlign: "center", children: description }), link && _jsx(View, { style: styles.linkContainer, children: link }), button && _jsx(View, { style: styles.buttonContainer, children: button })] })] }) }));
9
+ };
10
+ HighlightBanner.displayName = 'HighlightBanner';
11
+ const styles = StyleSheet.create(theme => ({
12
+ container: {
13
+ overflow: 'hidden',
14
+ flex: 1,
15
+ width: '100%',
16
+ },
17
+ header: {
18
+ padding: theme.components.banner.highlight.padding,
19
+ alignItems: 'center',
20
+ justifyContent: 'center',
21
+ variants: {
22
+ headingColor: {
23
+ highlight: {
24
+ backgroundColor: theme.color.surface.highlight.subtle,
25
+ },
26
+ pig: {
27
+ backgroundColor: theme.color.surface.pig.subtle,
28
+ },
29
+ energy: {
30
+ backgroundColor: theme.color.surface.energy.subtle,
31
+ },
32
+ broadband: {
33
+ backgroundColor: theme.color.surface.broadband.subtle,
34
+ },
35
+ mobile: {
36
+ backgroundColor: theme.color.surface.mobile.subtle,
37
+ },
38
+ insurance: {
39
+ backgroundColor: theme.color.surface.insurance.subtle,
40
+ },
41
+ cashback: {
42
+ backgroundColor: theme.color.surface.cashback.subtle,
43
+ },
44
+ },
45
+ variant: {
46
+ emphasis: {
47
+ borderColor: theme.color.border.strong,
48
+ borderBottomWidth: theme.borderWidth[2],
49
+ },
50
+ subtle: {
51
+ borderColor: theme.color.border.subtle,
52
+ },
53
+ },
54
+ },
55
+ },
56
+ imageContainer: (height = 200) => ({
57
+ width: '100%',
58
+ height,
59
+ }),
60
+ image: {
61
+ width: '100%',
62
+ height: '100%',
63
+ },
64
+ footer: {
65
+ padding: theme.components.banner.highlight.padding,
66
+ gap: theme.components.banner.highlight.content.gap,
67
+ variants: {
68
+ variant: {
69
+ emphasis: {
70
+ borderColor: theme.color.border.strong,
71
+ borderTopWidth: theme.borderWidth[2],
72
+ },
73
+ subtle: {
74
+ borderColor: theme.color.border.subtle,
75
+ },
76
+ },
77
+ },
78
+ },
79
+ linkContainer: {
80
+ alignItems: 'center',
81
+ },
82
+ buttonContainer: {
83
+ alignItems: 'stretch',
84
+ },
85
+ }));
86
+ export default HighlightBanner;
@@ -0,0 +1,14 @@
1
+ import { ReactElement } from 'react';
2
+ import { ImageProps } from 'react-native';
3
+ import CardProps from '../Card/Card.props';
4
+ interface HighlightBannerProps extends Omit<CardProps, 'noPadding' | 'variant' | 'space' | 'gap' | 'rowGap' | 'columnGap' | 'flexDirection' | 'flexWrap' | 'alignItems' | 'justifyContent'> {
5
+ heading?: string;
6
+ headingColor?: 'pig' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'highlight';
7
+ variant?: 'emphasis' | 'subtle';
8
+ image?: ImageProps;
9
+ imageContainerHeight?: number;
10
+ description?: string;
11
+ link?: ReactElement;
12
+ button?: ReactElement;
13
+ }
14
+ export default HighlightBannerProps;
@@ -0,0 +1,2 @@
1
+ export { default as HighlightBanner } from './HighlightBanner';
2
+ export type { default as HighlightBannerProps } from './HighlightBanner.props';
@@ -0,0 +1 @@
1
+ export { default as HighlightBanner } from './HighlightBanner';
@@ -7,9 +7,7 @@ import { Circle, G, Svg } from 'react-native-svg';
7
7
  import { StyleSheet } from 'react-native-unistyles';
8
8
  import { useTheme } from '../../hooks';
9
9
  import { getFlattenedColorValue } from '../../utils';
10
- // @ts-expect-error - Animated.View type issue
11
10
  const AnimatedSvg = Animated.createAnimatedComponent(Svg);
12
- // @ts-expect-error - Animated.View type issue
13
11
  const AnimatedCircle = Animated.createAnimatedComponent(Circle);
14
12
  const SpinnerRoot = ({ size = 'md', color, ...props }) => {
15
13
  const { components } = useTheme();
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type SpinnerProps from './Spinner.props';
2
- declare const Spinner: import("react").ComponentType<SpinnerProps>;
3
+ declare const Spinner: React.ComponentType<SpinnerProps>;
3
4
  export default Spinner;
@@ -8,9 +8,7 @@ import { Circle, G, Svg } from 'react-native-svg';
8
8
  import { StyleSheet } from 'react-native-unistyles';
9
9
  import { useTheme } from '../../hooks';
10
10
  import { getFlattenedColorValue } from '../../utils';
11
- // @ts-expect-error - Animated.View type issue
12
11
  const AnimatedSvg = Animated.createAnimatedComponent(Svg);
13
- // @ts-expect-error - Animated.View type issue
14
12
  const AnimatedCircle = Animated.createAnimatedComponent(Circle);
15
13
  const SpinnerRoot = ({ size = 'md', color, ...props }) => {
16
14
  const { components } = useTheme();
@@ -6,7 +6,6 @@ import Animated, { Easing, interpolateColor, useAnimatedStyle, useReducedMotion,
6
6
  import { StyleSheet } from 'react-native-unistyles';
7
7
  import { useTheme } from '../../hooks';
8
8
  import { Icon } from '../Icon';
9
- // @ts-expect-error - Animated.View type issue
10
9
  const AnimatedView = Animated.createAnimatedComponent(View);
11
10
  const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = 'medium', ...accessibilityProps }) => {
12
11
  const { components, color } = useTheme();
@@ -6,7 +6,6 @@ import Animated, { runOnJS, useAnimatedScrollHandler, useAnimatedStyle, useShare
6
6
  import { StyleSheet } from 'react-native-unistyles';
7
7
  import { UnstyledIconButton } from '../UnstyledIconButton';
8
8
  import { useTabsContext } from './Tabs.context';
9
- // @ts-expect-error - Animated.View type issue
10
9
  const Indicator = Animated.createAnimatedComponent(View);
11
10
  const SCROLL_STEP_RATIO = 0.6;
12
11
  const SCROLL_BUTTON_HITSLOP = { top: 10, bottom: 10, left: 10, right: 10 };
@@ -60,11 +59,7 @@ const TabsList = ({ children, style, ...rest }) => {
60
59
  }
61
60
  return;
62
61
  }, [updateScrollState]);
63
- return (_jsxs(View, { style: [styles.wrapper, style], ...rest, accessibilityRole: "tablist", children: [canScrollLeft && (_jsx(View, { style: [styles.iconButtonWrap, styles.scrollButtonLeft], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : {}), children: _jsx(UnstyledIconButton, { accessibilityLabel: undefined, icon: ChevronLeftSmallIcon, onPress: () => scrollBy(-1), style: styles.iconButton, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", hitSlop: SCROLL_BUTTON_HITSLOP, ...(Platform.OS === 'web' ? { 'aria-hidden': true, tabIndex: -1 } : {}) }) })), _jsx(Animated.ScrollView, { ref: scrollRef, horizontal: true, showsHorizontalScrollIndicator: false, onLayout: onLayoutContainer, onContentSizeChange: onContentSizeChange, onScroll: onScrollHandler, scrollEventThrottle: 16, bounces: false, contentContainerStyle: styles.scrollContent, children: _jsxs(View, { style: styles.container, children: [children, _jsx(Indicator
64
- // @ts-expect-error - Animated.View type issue
65
- , {
66
- // @ts-expect-error - Animated.View type issue
67
- accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: [styles.indicator, indicatorStyle] })] }) }), canScrollRight && (_jsx(View, { style: [styles.iconButtonWrap, styles.scrollButtonRight], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : {}), children: _jsx(UnstyledIconButton, { accessibilityLabel: undefined, icon: ChevronRightSmallIcon, onPress: () => scrollBy(1), style: styles.iconButton, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", hitSlop: SCROLL_BUTTON_HITSLOP, ...(Platform.OS === 'web' ? { 'aria-hidden': true, tabIndex: -1 } : {}) }) }))] }));
62
+ return (_jsxs(View, { style: [styles.wrapper, style], ...rest, accessibilityRole: "tablist", children: [canScrollLeft && (_jsx(View, { style: [styles.iconButtonWrap, styles.scrollButtonLeft], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : {}), children: _jsx(UnstyledIconButton, { accessibilityLabel: undefined, icon: ChevronLeftSmallIcon, onPress: () => scrollBy(-1), style: styles.iconButton, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", hitSlop: SCROLL_BUTTON_HITSLOP, ...(Platform.OS === 'web' ? { 'aria-hidden': true, tabIndex: -1 } : {}) }) })), _jsx(Animated.ScrollView, { ref: scrollRef, horizontal: true, showsHorizontalScrollIndicator: false, onLayout: onLayoutContainer, onContentSizeChange: onContentSizeChange, onScroll: onScrollHandler, scrollEventThrottle: 16, bounces: false, contentContainerStyle: styles.scrollContent, children: _jsxs(View, { style: styles.container, children: [children, _jsx(Indicator, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: [styles.indicator, indicatorStyle] })] }) }), canScrollRight && (_jsx(View, { style: [styles.iconButtonWrap, styles.scrollButtonRight], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", ...(Platform.OS === 'web' ? { 'aria-hidden': true } : {}), children: _jsx(UnstyledIconButton, { accessibilityLabel: undefined, icon: ChevronRightSmallIcon, onPress: () => scrollBy(1), style: styles.iconButton, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", hitSlop: SCROLL_BUTTON_HITSLOP, ...(Platform.OS === 'web' ? { 'aria-hidden': true, tabIndex: -1 } : {}) }) }))] }));
68
63
  };
69
64
  TabsList.displayName = 'TabsList';
70
65
  const styles = StyleSheet.create(theme => ({
@@ -1,6 +1,7 @@
1
1
  export * from './Accordion';
2
2
  export * from './Alert';
3
3
  export * from './Badge';
4
+ export * from './Banner';
4
5
  export * from './BodyText';
5
6
  export * from './BottomSheet';
6
7
  export * from './Box';
@@ -16,11 +17,14 @@ export * from './DatePickerInput';
16
17
  export * from './DescriptionList';
17
18
  export * from './DetailText';
18
19
  export * from './Divider';
20
+ export * from './Expandable';
21
+ export * from './ExpandableCard';
19
22
  export * from './Flex';
20
23
  export * from './FormField';
21
24
  export * from './Grid';
22
25
  export * from './Heading';
23
26
  export * from './Helper';
27
+ export * from './HighlightBanner';
24
28
  export * from './HTMLElements';
25
29
  export * from './Icon';
26
30
  export * from './IconButton';
@@ -2,6 +2,7 @@
2
2
  export * from './Accordion';
3
3
  export * from './Alert';
4
4
  export * from './Badge';
5
+ export * from './Banner';
5
6
  export * from './BodyText';
6
7
  export * from './BottomSheet';
7
8
  export * from './Box';
@@ -17,11 +18,14 @@ export * from './DatePickerInput';
17
18
  export * from './DescriptionList';
18
19
  export * from './DetailText';
19
20
  export * from './Divider';
21
+ export * from './Expandable';
22
+ export * from './ExpandableCard';
20
23
  export * from './Flex';
21
24
  export * from './FormField';
22
25
  export * from './Grid';
23
26
  export * from './Heading';
24
27
  export * from './Helper';
28
+ export * from './HighlightBanner';
25
29
  export * from './HTMLElements';
26
30
  export * from './Icon';
27
31
  export * from './IconButton';