@ovotech/element-native 5.5.0 → 5.6.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 +9 -0
- package/dist/components/ActionList/Action.d.ts +23 -0
- package/dist/components/ActionList/Action.js +29 -0
- package/dist/components/ActionList/ActionList.d.ts +11 -27
- package/dist/components/ActionList/ActionList.js +9 -25
- package/dist/components/ActionList/ActionListItems/DataListItem.d.ts +23 -0
- package/dist/components/ActionList/ActionListItems/DataListItem.js +21 -0
- package/dist/components/ActionList/ActionListItems/EditableListItem.d.ts +43 -0
- package/dist/components/ActionList/ActionListItems/EditableListItem.js +134 -0
- package/dist/components/ActionList/ActionListItems/NavigationListItem.d.ts +16 -0
- package/dist/components/ActionList/ActionListItems/NavigationListItem.js +30 -0
- package/dist/components/ActionList/ActionListItems/ProgressRing.d.ts +7 -0
- package/dist/components/ActionList/ActionListItems/ProgressRing.js +66 -0
- package/dist/components/ActionList/ActionListItems/ToggleListItem.d.ts +9 -0
- package/dist/components/ActionList/ActionListItems/ToggleListItem.js +13 -0
- package/dist/components/ActionList/ActionListItems/styles.d.ts +10433 -0
- package/dist/components/ActionList/ActionListItems/styles.js +171 -0
- package/dist/components/ActionList/components/ActionListHeading.d.ts +9 -0
- package/dist/components/ActionList/components/ActionListHeading.js +11 -0
- package/dist/components/ActionList/index.d.ts +6 -1
- package/dist/components/ActionList/index.js +11 -2
- package/dist/components/ActionList/styled.d.ts +1187 -7
- package/dist/components/ActionList/styled.js +24 -9
- package/dist/components/Badge/Badge.d.ts +3 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.styles.d.ts +12 -0
- package/dist/components/Card/Card.d.ts +7 -4
- package/dist/components/Card/Card.js +44 -22
- package/dist/components/Card/Card.styles.d.ts +11 -1
- package/dist/components/Card/Card.styles.js +7 -11
- package/dist/components/Cards/AccountCard/AccountCard.styles.d.ts +24 -0
- package/dist/components/Cards/BalanceCard/BalanceCard.styles.d.ts +46 -1
- package/dist/components/Cards/BalanceCard/BalanceCard.styles.js +2 -2
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.d.ts +13 -0
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.js +45 -0
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.styles.d.ts +580 -0
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.styles.js +11 -0
- package/dist/components/Cards/DisruptiveCard/index.d.ts +1 -0
- package/dist/components/Cards/DisruptiveCard/index.js +17 -0
- package/dist/components/Cards/HeroImageCard/HeroImageCard.d.ts +12 -0
- package/dist/components/Cards/HeroImageCard/HeroImageCard.js +65 -0
- package/dist/components/Cards/HeroImageCard/HeroImageCard.styles.d.ts +1741 -0
- package/dist/components/Cards/HeroImageCard/HeroImageCard.styles.js +27 -0
- package/dist/components/Cards/HeroImageCard/index.d.ts +1 -0
- package/dist/components/Cards/HeroImageCard/index.js +17 -0
- package/dist/components/Cards/IconDataCard/IconDataCard.styles.d.ts +12 -0
- package/dist/components/Cards/IconTextCard/IconTextCard.js +3 -16
- package/dist/components/Cards/IconTextCard/IconTextCard.styles.d.ts +10 -576
- package/dist/components/Cards/IconTextCard/IconTextCard.styles.js +1 -6
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.d.ts +14 -0
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.js +26 -0
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.d.ts +2903 -0
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +34 -0
- package/dist/components/Cards/IllustrationTextCard/index.d.ts +1 -0
- package/dist/components/Cards/IllustrationTextCard/index.js +17 -0
- package/dist/components/Cards/LinkTextCard/LinkTextCard.d.ts +2 -2
- package/dist/components/Cards/LinkTextCard/LinkTextCard.js +7 -6
- package/dist/components/Cards/LinkTextCard/LinkTextCard.styles.d.ts +20 -2
- package/dist/components/Cards/LinkTextCard/LinkTextCard.styles.js +9 -6
- package/dist/components/Cards/ProgressBarCard/ProgressBarCard.styles.d.ts +28 -1
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.d.ts +12 -0
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.js +27 -0
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.styles.d.ts +2897 -0
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.styles.js +31 -0
- package/dist/components/Cards/QuickLinkCard/index.d.ts +1 -0
- package/dist/components/Cards/QuickLinkCard/index.js +17 -0
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.d.ts +12 -0
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.js +24 -0
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.styles.d.ts +2902 -0
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.styles.js +38 -0
- package/dist/components/Cards/ServicesImageCard/index.d.ts +1 -0
- package/dist/components/Cards/ServicesImageCard/index.js +17 -0
- package/dist/components/Cards/components.d.ts +15 -0
- package/dist/components/Cards/components.js +24 -0
- package/dist/components/Cards/index.d.ts +5 -0
- package/dist/components/Cards/index.js +11 -1
- package/dist/components/Cards/shared.styles.d.ts +2835 -505
- package/dist/components/Cards/shared.styles.js +18 -2
- package/dist/components/Cards/utils.d.ts +1 -0
- package/dist/components/Cards/utils.js +13 -1
- package/dist/components/Checkbox/Checkbox.d.ts +2 -13
- package/dist/components/Checkbox/Checkbox.js +3 -49
- package/dist/components/Checkbox/styled.d.ts +3483 -0
- package/dist/components/Checkbox/styled.js +52 -0
- package/dist/components/Checkbox/types.d.ts +16 -0
- package/dist/components/Checkbox/types.js +2 -0
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +2 -1
- package/dist/components/CurrencyInput/CurrencyInput.js +11 -4
- package/dist/components/CurrencyInput/styled.d.ts +2318 -0
- package/dist/components/CurrencyInput/styled.js +39 -0
- package/dist/components/DataTable/styles.d.ts +39 -0
- package/dist/components/Disclosure/Disclosure.d.ts +3 -0
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +3 -1
- package/dist/components/Em/Em.d.ts +3 -0
- package/dist/components/EmailInput/EmailInput.d.ts +4 -1
- package/dist/components/EmailInput/EmailInput.js +18 -2
- package/dist/components/EmptyState/EmptyState.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.js +17 -0
- package/dist/components/EmptyState/EmptyState.test.d.ts +1 -0
- package/dist/components/EmptyState/EmptyState.test.js +92 -0
- package/dist/components/EmptyState/index.d.ts +1 -0
- package/dist/components/EmptyState/index.js +17 -0
- package/dist/components/EmptyState/styles.d.ts +1156 -0
- package/dist/components/EmptyState/styles.js +23 -0
- package/dist/components/EmptyState/types.d.ts +18 -0
- package/dist/components/EmptyState/types.js +2 -0
- package/dist/components/ErrorText/ErrorText.d.ts +3 -0
- package/dist/components/Field/Field.d.ts +3 -2
- package/dist/components/Field/Field.js +3 -2
- package/dist/components/Grid/Col.d.ts +3 -0
- package/dist/components/HintText/HintText.d.ts +3 -0
- package/dist/components/Input/Input.d.ts +2 -1
- package/dist/components/Input/Input.js +6 -97
- package/dist/components/Input/styled.d.ts +1747 -0
- package/dist/components/Input/styled.js +96 -0
- package/dist/components/LabelText/LabelText.d.ts +3 -0
- package/dist/components/LargeValueReference/LargeValueReference.d.ts +11 -0
- package/dist/components/LargeValueReference/LargeValueReference.js +49 -0
- package/dist/components/LargeValueReference/index.d.ts +1 -0
- package/dist/components/LargeValueReference/index.js +17 -0
- package/dist/components/LargeValueReference/styles.d.ts +1741 -0
- package/dist/components/LargeValueReference/styles.js +29 -0
- package/dist/components/LineThrough/LineThrough.d.ts +3 -0
- package/dist/components/List/styled.d.ts +12 -0
- package/dist/components/Margin/Margin.d.ts +3 -0
- package/dist/components/NavHeader/NavHeader.styles.d.ts +33 -0
- package/dist/components/Notification/Notification.styles.d.ts +27 -0
- package/dist/components/PasswordInput/PasswordInput.styled.d.ts +4 -3
- package/dist/components/PasswordInput/PasswordInput.styled.js +5 -3
- package/dist/components/PasswordInput/PasswordVisibilityToggle.js +2 -8
- package/dist/components/RadioCard/RadioCard.d.ts +2 -1
- package/dist/components/RadioCard/RadioCard.js +7 -57
- package/dist/components/RadioCard/RadioCard.styles.d.ts +2901 -0
- package/dist/components/RadioCard/RadioCard.styles.js +97 -0
- package/dist/components/SelectField/Select.d.ts +5 -579
- package/dist/components/SelectField/Select.js +7 -107
- package/dist/components/SelectField/SelectField.d.ts +2 -2
- package/dist/components/SelectField/SelectField.js +2 -2
- package/dist/components/SelectField/styled.d.ts +4642 -0
- package/dist/components/SelectField/styled.js +118 -0
- package/dist/components/SkeletonText/SkeletonText.js +4 -4
- package/dist/components/Strong/Strong.d.ts +3 -0
- package/dist/components/SubLabelText/SubLabelText.d.ts +3 -0
- package/dist/components/Tabs/Tab.d.ts +3 -0
- package/dist/components/TextareaInput/TextareaInput.js +12 -6
- package/dist/components/Toggle/Toggle.d.ts +3 -1
- package/dist/components/Toggle/Toggle.js +4 -6
- package/dist/components/Toggle/styles.d.ts +13 -0
- package/dist/components/Toggle/styles.js +3 -3
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/esm/components/ActionList/Action.js +26 -0
- package/dist/esm/components/ActionList/ActionList.js +12 -28
- package/dist/esm/components/ActionList/ActionListItems/DataListItem.js +17 -0
- package/dist/esm/components/ActionList/ActionListItems/EditableListItem.js +131 -0
- package/dist/esm/components/ActionList/ActionListItems/NavigationListItem.js +26 -0
- package/dist/esm/components/ActionList/ActionListItems/ProgressRing.js +29 -0
- package/dist/esm/components/ActionList/ActionListItems/ToggleListItem.js +9 -0
- package/dist/esm/components/ActionList/ActionListItems/styles.js +135 -0
- package/dist/esm/components/ActionList/components/ActionListHeading.js +7 -0
- package/dist/esm/components/ActionList/index.js +6 -1
- package/dist/esm/components/ActionList/styled.js +23 -8
- package/dist/esm/components/Button/Button.js +1 -1
- package/dist/esm/components/Card/Card.js +45 -23
- package/dist/esm/components/Card/Card.styles.js +8 -12
- package/dist/esm/components/Cards/BalanceCard/BalanceCard.styles.js +2 -2
- package/dist/esm/components/Cards/DisruptiveCard/DisruptiveCard.js +41 -0
- package/dist/esm/components/Cards/DisruptiveCard/DisruptiveCard.styles.js +5 -0
- package/dist/esm/components/Cards/DisruptiveCard/index.js +1 -0
- package/dist/esm/components/Cards/HeroImageCard/HeroImageCard.js +28 -0
- package/dist/esm/components/Cards/HeroImageCard/HeroImageCard.styles.js +21 -0
- package/dist/esm/components/Cards/HeroImageCard/index.js +1 -0
- package/dist/esm/components/Cards/IconTextCard/IconTextCard.js +5 -18
- package/dist/esm/components/Cards/IconTextCard/IconTextCard.styles.js +0 -5
- package/dist/esm/components/Cards/IllustrationTextCard/IllustrationTextCard.js +22 -0
- package/dist/esm/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +28 -0
- package/dist/esm/components/Cards/IllustrationTextCard/index.js +1 -0
- package/dist/esm/components/Cards/LinkTextCard/LinkTextCard.js +7 -6
- package/dist/esm/components/Cards/LinkTextCard/LinkTextCard.styles.js +9 -6
- package/dist/esm/components/Cards/QuickLinkCard/QuickLinkCard.js +23 -0
- package/dist/esm/components/Cards/QuickLinkCard/QuickLinkCard.styles.js +25 -0
- package/dist/esm/components/Cards/QuickLinkCard/index.js +1 -0
- package/dist/esm/components/Cards/ServicesImageCard/ServicesImageCard.js +20 -0
- package/dist/esm/components/Cards/ServicesImageCard/ServicesImageCard.styles.js +32 -0
- package/dist/esm/components/Cards/ServicesImageCard/index.js +1 -0
- package/dist/esm/components/Cards/components.js +19 -0
- package/dist/esm/components/Cards/index.js +5 -0
- package/dist/esm/components/Cards/shared.styles.js +17 -1
- package/dist/esm/components/Cards/utils.js +11 -0
- package/dist/esm/components/Checkbox/Checkbox.js +2 -45
- package/dist/esm/components/Checkbox/styled.js +46 -0
- package/dist/esm/components/Checkbox/types.js +1 -0
- package/dist/esm/components/CurrencyInput/CurrencyInput.js +12 -5
- package/dist/esm/components/CurrencyInput/styled.js +33 -0
- package/dist/esm/components/Divider/Divider.js +3 -1
- package/dist/esm/components/EmailInput/EmailInput.js +18 -2
- package/dist/esm/components/EmptyState/EmptyState.js +13 -0
- package/dist/esm/components/EmptyState/EmptyState.test.js +90 -0
- package/dist/esm/components/EmptyState/index.js +1 -0
- package/dist/esm/components/EmptyState/styles.js +17 -0
- package/dist/esm/components/EmptyState/types.js +1 -0
- package/dist/esm/components/Field/Field.js +3 -2
- package/dist/esm/components/Input/Input.js +6 -64
- package/dist/esm/components/Input/styled.js +60 -0
- package/dist/esm/components/LargeValueReference/LargeValueReference.js +45 -0
- package/dist/esm/components/LargeValueReference/index.js +1 -0
- package/dist/esm/components/LargeValueReference/styles.js +23 -0
- package/dist/esm/components/PasswordInput/PasswordInput.styled.js +5 -3
- package/dist/esm/components/PasswordInput/PasswordVisibilityToggle.js +2 -8
- package/dist/esm/components/RadioCard/RadioCard.js +5 -52
- package/dist/esm/components/RadioCard/RadioCard.styles.js +61 -0
- package/dist/esm/components/SelectField/Select.js +7 -74
- package/dist/esm/components/SelectField/SelectField.js +3 -3
- package/dist/esm/components/SelectField/styled.js +82 -0
- package/dist/esm/components/SkeletonText/SkeletonText.js +4 -4
- package/dist/esm/components/TextareaInput/TextareaInput.js +12 -6
- package/dist/esm/components/Toggle/Toggle.js +4 -6
- package/dist/esm/components/Toggle/styles.js +3 -3
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/hooks/use-font-scaling.js +32 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/test/utils.js +12 -0
- package/dist/esm/utils/utils.js +12 -1
- package/dist/hooks/use-font-scaling.d.ts +26 -0
- package/dist/hooks/use-font-scaling.js +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styled.native.d.ts +18 -0
- package/dist/test/utils.d.ts +4 -0
- package/dist/test/utils.js +28 -0
- package/dist/utils/utils.d.ts +11 -1
- package/dist/utils/utils.js +12 -0
- package/package.json +4 -4
- package/dist/components/ErrorWrapper/styles.d.ts +0 -0
- package/dist/components/ErrorWrapper/styles.js +0 -1
- package/dist/esm/components/ErrorWrapper/styles.js +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
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.StyledCurrencySymbol = exports.StyledCurrencySymbolWrapper = exports.StyledCurrencyInput = exports.CurrencyInputWrapper = void 0;
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const styled_native_1 = __importDefault(require("../../styled.native"));
|
|
9
|
+
const theme_1 = require("../../theme");
|
|
10
|
+
const NumberInput_1 = require("../NumberInput");
|
|
11
|
+
const P_1 = require("../P");
|
|
12
|
+
exports.CurrencyInputWrapper = (0, styled_native_1.default)(react_native_1.View) `
|
|
13
|
+
position: relative;
|
|
14
|
+
`;
|
|
15
|
+
exports.StyledCurrencyInput = (0, styled_native_1.default)(NumberInput_1.NumberInput)(({ theme, smallAndUp }) => `
|
|
16
|
+
padding-left: ${(0, theme_1.numToPx)(theme.space[800])};
|
|
17
|
+
padding-bottom: ${(0, theme_1.numToPx)(theme.space[100])};
|
|
18
|
+
font-family: ${theme.native.font.family.black};
|
|
19
|
+
font-size: ${(0, theme_1.numToPx)(theme.font.size['4xl'].mediaQuery[smallAndUp ? 'lg' : 'sm'])};
|
|
20
|
+
line-height: ${(0, theme_1.numToPx)(theme.font.size['4xl'].mediaQuery[smallAndUp ? 'lg' : 'sm'])};
|
|
21
|
+
letter-spacing: ${(0, theme_1.numToPx)(theme.font.letterSpacing['4xl'].mediaQuery[smallAndUp ? 'lg' : 'sm'])};
|
|
22
|
+
`);
|
|
23
|
+
exports.StyledCurrencySymbolWrapper = (0, styled_native_1.default)(react_native_1.View)(({ theme }) => {
|
|
24
|
+
return `
|
|
25
|
+
position: absolute;
|
|
26
|
+
width: ${(0, theme_1.numToPx)(theme.space[700])};
|
|
27
|
+
height: ${(0, theme_1.numToPx)(theme.space[700])};
|
|
28
|
+
top: 50%;
|
|
29
|
+
margin-top: -${(0, theme_1.numToPx)(theme.space[350])};
|
|
30
|
+
left: ${(0, theme_1.numToPx)(theme.space[400])};
|
|
31
|
+
`;
|
|
32
|
+
});
|
|
33
|
+
exports.StyledCurrencySymbol = (0, styled_native_1.default)(P_1.P)(({ theme, smallAndUp, }) => {
|
|
34
|
+
return `
|
|
35
|
+
font-family: ${theme.native.font.family.bold};
|
|
36
|
+
font-size: ${(0, theme_1.numToPx)(theme.font.size.xl.mediaQuery[smallAndUp ? 'lg' : 'sm'])};
|
|
37
|
+
line-height: ${(0, theme_1.numToPx)(theme.font.lineHeight.xl.mediaQuery[smallAndUp ? 'lg' : 'sm'])};
|
|
38
|
+
`;
|
|
39
|
+
});
|
|
@@ -38,6 +38,7 @@ export declare const StyledTableContainer: import("styled-components").StyledCom
|
|
|
38
38
|
"30": string;
|
|
39
39
|
"40": string;
|
|
40
40
|
"50": string;
|
|
41
|
+
"55": string;
|
|
41
42
|
"56": string;
|
|
42
43
|
"60": string;
|
|
43
44
|
"70": string;
|
|
@@ -80,6 +81,7 @@ export declare const StyledTableContainer: import("styled-components").StyledCom
|
|
|
80
81
|
onBrandVariant: string;
|
|
81
82
|
aiGradientFrom: string;
|
|
82
83
|
aiGradientTo: string;
|
|
84
|
+
accessible: string;
|
|
83
85
|
fixed: {
|
|
84
86
|
brand: string;
|
|
85
87
|
dark: string;
|
|
@@ -88,6 +90,7 @@ export declare const StyledTableContainer: import("styled-components").StyledCom
|
|
|
88
90
|
bright: string;
|
|
89
91
|
onBrand: string;
|
|
90
92
|
onBrandVariant: string;
|
|
93
|
+
accessible: string;
|
|
91
94
|
};
|
|
92
95
|
};
|
|
93
96
|
outline: {
|
|
@@ -613,6 +616,7 @@ export declare const TableHeader: import("styled-components").StyledComponent<ty
|
|
|
613
616
|
"30": string;
|
|
614
617
|
"40": string;
|
|
615
618
|
"50": string;
|
|
619
|
+
"55": string;
|
|
616
620
|
"56": string;
|
|
617
621
|
"60": string;
|
|
618
622
|
"70": string;
|
|
@@ -655,6 +659,7 @@ export declare const TableHeader: import("styled-components").StyledComponent<ty
|
|
|
655
659
|
onBrandVariant: string;
|
|
656
660
|
aiGradientFrom: string;
|
|
657
661
|
aiGradientTo: string;
|
|
662
|
+
accessible: string;
|
|
658
663
|
fixed: {
|
|
659
664
|
brand: string;
|
|
660
665
|
dark: string;
|
|
@@ -663,6 +668,7 @@ export declare const TableHeader: import("styled-components").StyledComponent<ty
|
|
|
663
668
|
bright: string;
|
|
664
669
|
onBrand: string;
|
|
665
670
|
onBrandVariant: string;
|
|
671
|
+
accessible: string;
|
|
666
672
|
};
|
|
667
673
|
};
|
|
668
674
|
outline: {
|
|
@@ -1190,6 +1196,7 @@ export declare const TableHeaderText: import("styled-components").StyledComponen
|
|
|
1190
1196
|
"30": string;
|
|
1191
1197
|
"40": string;
|
|
1192
1198
|
"50": string;
|
|
1199
|
+
"55": string;
|
|
1193
1200
|
"56": string;
|
|
1194
1201
|
"60": string;
|
|
1195
1202
|
"70": string;
|
|
@@ -1232,6 +1239,7 @@ export declare const TableHeaderText: import("styled-components").StyledComponen
|
|
|
1232
1239
|
onBrandVariant: string;
|
|
1233
1240
|
aiGradientFrom: string;
|
|
1234
1241
|
aiGradientTo: string;
|
|
1242
|
+
accessible: string;
|
|
1235
1243
|
fixed: {
|
|
1236
1244
|
brand: string;
|
|
1237
1245
|
dark: string;
|
|
@@ -1240,6 +1248,7 @@ export declare const TableHeaderText: import("styled-components").StyledComponen
|
|
|
1240
1248
|
bright: string;
|
|
1241
1249
|
onBrand: string;
|
|
1242
1250
|
onBrandVariant: string;
|
|
1251
|
+
accessible: string;
|
|
1243
1252
|
};
|
|
1244
1253
|
};
|
|
1245
1254
|
outline: {
|
|
@@ -1765,6 +1774,7 @@ export declare const TableCaptionText: import("styled-components").StyledCompone
|
|
|
1765
1774
|
"30": string;
|
|
1766
1775
|
"40": string;
|
|
1767
1776
|
"50": string;
|
|
1777
|
+
"55": string;
|
|
1768
1778
|
"56": string;
|
|
1769
1779
|
"60": string;
|
|
1770
1780
|
"70": string;
|
|
@@ -1807,6 +1817,7 @@ export declare const TableCaptionText: import("styled-components").StyledCompone
|
|
|
1807
1817
|
onBrandVariant: string;
|
|
1808
1818
|
aiGradientFrom: string;
|
|
1809
1819
|
aiGradientTo: string;
|
|
1820
|
+
accessible: string;
|
|
1810
1821
|
fixed: {
|
|
1811
1822
|
brand: string;
|
|
1812
1823
|
dark: string;
|
|
@@ -1815,6 +1826,7 @@ export declare const TableCaptionText: import("styled-components").StyledCompone
|
|
|
1815
1826
|
bright: string;
|
|
1816
1827
|
onBrand: string;
|
|
1817
1828
|
onBrandVariant: string;
|
|
1829
|
+
accessible: string;
|
|
1818
1830
|
};
|
|
1819
1831
|
};
|
|
1820
1832
|
outline: {
|
|
@@ -2340,6 +2352,7 @@ export declare const CellText: import("styled-components").StyledComponent<typeo
|
|
|
2340
2352
|
"30": string;
|
|
2341
2353
|
"40": string;
|
|
2342
2354
|
"50": string;
|
|
2355
|
+
"55": string;
|
|
2343
2356
|
"56": string;
|
|
2344
2357
|
"60": string;
|
|
2345
2358
|
"70": string;
|
|
@@ -2382,6 +2395,7 @@ export declare const CellText: import("styled-components").StyledComponent<typeo
|
|
|
2382
2395
|
onBrandVariant: string;
|
|
2383
2396
|
aiGradientFrom: string;
|
|
2384
2397
|
aiGradientTo: string;
|
|
2398
|
+
accessible: string;
|
|
2385
2399
|
fixed: {
|
|
2386
2400
|
brand: string;
|
|
2387
2401
|
dark: string;
|
|
@@ -2390,6 +2404,7 @@ export declare const CellText: import("styled-components").StyledComponent<typeo
|
|
|
2390
2404
|
bright: string;
|
|
2391
2405
|
onBrand: string;
|
|
2392
2406
|
onBrandVariant: string;
|
|
2407
|
+
accessible: string;
|
|
2393
2408
|
};
|
|
2394
2409
|
};
|
|
2395
2410
|
outline: {
|
|
@@ -2915,6 +2930,7 @@ export declare const TableCaption: import("styled-components").StyledComponent<t
|
|
|
2915
2930
|
"30": string;
|
|
2916
2931
|
"40": string;
|
|
2917
2932
|
"50": string;
|
|
2933
|
+
"55": string;
|
|
2918
2934
|
"56": string;
|
|
2919
2935
|
"60": string;
|
|
2920
2936
|
"70": string;
|
|
@@ -2957,6 +2973,7 @@ export declare const TableCaption: import("styled-components").StyledComponent<t
|
|
|
2957
2973
|
onBrandVariant: string;
|
|
2958
2974
|
aiGradientFrom: string;
|
|
2959
2975
|
aiGradientTo: string;
|
|
2976
|
+
accessible: string;
|
|
2960
2977
|
fixed: {
|
|
2961
2978
|
brand: string;
|
|
2962
2979
|
dark: string;
|
|
@@ -2965,6 +2982,7 @@ export declare const TableCaption: import("styled-components").StyledComponent<t
|
|
|
2965
2982
|
bright: string;
|
|
2966
2983
|
onBrand: string;
|
|
2967
2984
|
onBrandVariant: string;
|
|
2985
|
+
accessible: string;
|
|
2968
2986
|
};
|
|
2969
2987
|
};
|
|
2970
2988
|
outline: {
|
|
@@ -3490,6 +3508,7 @@ export declare const TableRow: import("styled-components").StyledComponent<typeo
|
|
|
3490
3508
|
"30": string;
|
|
3491
3509
|
"40": string;
|
|
3492
3510
|
"50": string;
|
|
3511
|
+
"55": string;
|
|
3493
3512
|
"56": string;
|
|
3494
3513
|
"60": string;
|
|
3495
3514
|
"70": string;
|
|
@@ -3532,6 +3551,7 @@ export declare const TableRow: import("styled-components").StyledComponent<typeo
|
|
|
3532
3551
|
onBrandVariant: string;
|
|
3533
3552
|
aiGradientFrom: string;
|
|
3534
3553
|
aiGradientTo: string;
|
|
3554
|
+
accessible: string;
|
|
3535
3555
|
fixed: {
|
|
3536
3556
|
brand: string;
|
|
3537
3557
|
dark: string;
|
|
@@ -3540,6 +3560,7 @@ export declare const TableRow: import("styled-components").StyledComponent<typeo
|
|
|
3540
3560
|
bright: string;
|
|
3541
3561
|
onBrand: string;
|
|
3542
3562
|
onBrandVariant: string;
|
|
3563
|
+
accessible: string;
|
|
3543
3564
|
};
|
|
3544
3565
|
};
|
|
3545
3566
|
outline: {
|
|
@@ -4067,6 +4088,7 @@ export declare const TableRowHeading: import("styled-components").StyledComponen
|
|
|
4067
4088
|
"30": string;
|
|
4068
4089
|
"40": string;
|
|
4069
4090
|
"50": string;
|
|
4091
|
+
"55": string;
|
|
4070
4092
|
"56": string;
|
|
4071
4093
|
"60": string;
|
|
4072
4094
|
"70": string;
|
|
@@ -4109,6 +4131,7 @@ export declare const TableRowHeading: import("styled-components").StyledComponen
|
|
|
4109
4131
|
onBrandVariant: string;
|
|
4110
4132
|
aiGradientFrom: string;
|
|
4111
4133
|
aiGradientTo: string;
|
|
4134
|
+
accessible: string;
|
|
4112
4135
|
fixed: {
|
|
4113
4136
|
brand: string;
|
|
4114
4137
|
dark: string;
|
|
@@ -4117,6 +4140,7 @@ export declare const TableRowHeading: import("styled-components").StyledComponen
|
|
|
4117
4140
|
bright: string;
|
|
4118
4141
|
onBrand: string;
|
|
4119
4142
|
onBrandVariant: string;
|
|
4143
|
+
accessible: string;
|
|
4120
4144
|
};
|
|
4121
4145
|
};
|
|
4122
4146
|
outline: {
|
|
@@ -4642,6 +4666,7 @@ export declare const TableBody: import("styled-components").StyledComponent<type
|
|
|
4642
4666
|
"30": string;
|
|
4643
4667
|
"40": string;
|
|
4644
4668
|
"50": string;
|
|
4669
|
+
"55": string;
|
|
4645
4670
|
"56": string;
|
|
4646
4671
|
"60": string;
|
|
4647
4672
|
"70": string;
|
|
@@ -4684,6 +4709,7 @@ export declare const TableBody: import("styled-components").StyledComponent<type
|
|
|
4684
4709
|
onBrandVariant: string;
|
|
4685
4710
|
aiGradientFrom: string;
|
|
4686
4711
|
aiGradientTo: string;
|
|
4712
|
+
accessible: string;
|
|
4687
4713
|
fixed: {
|
|
4688
4714
|
brand: string;
|
|
4689
4715
|
dark: string;
|
|
@@ -4692,6 +4718,7 @@ export declare const TableBody: import("styled-components").StyledComponent<type
|
|
|
4692
4718
|
bright: string;
|
|
4693
4719
|
onBrand: string;
|
|
4694
4720
|
onBrandVariant: string;
|
|
4721
|
+
accessible: string;
|
|
4695
4722
|
};
|
|
4696
4723
|
};
|
|
4697
4724
|
outline: {
|
|
@@ -5217,6 +5244,7 @@ export declare const TableCell: import("styled-components").StyledComponent<type
|
|
|
5217
5244
|
"30": string;
|
|
5218
5245
|
"40": string;
|
|
5219
5246
|
"50": string;
|
|
5247
|
+
"55": string;
|
|
5220
5248
|
"56": string;
|
|
5221
5249
|
"60": string;
|
|
5222
5250
|
"70": string;
|
|
@@ -5259,6 +5287,7 @@ export declare const TableCell: import("styled-components").StyledComponent<type
|
|
|
5259
5287
|
onBrandVariant: string;
|
|
5260
5288
|
aiGradientFrom: string;
|
|
5261
5289
|
aiGradientTo: string;
|
|
5290
|
+
accessible: string;
|
|
5262
5291
|
fixed: {
|
|
5263
5292
|
brand: string;
|
|
5264
5293
|
dark: string;
|
|
@@ -5267,6 +5296,7 @@ export declare const TableCell: import("styled-components").StyledComponent<type
|
|
|
5267
5296
|
bright: string;
|
|
5268
5297
|
onBrand: string;
|
|
5269
5298
|
onBrandVariant: string;
|
|
5299
|
+
accessible: string;
|
|
5270
5300
|
};
|
|
5271
5301
|
};
|
|
5272
5302
|
outline: {
|
|
@@ -5794,6 +5824,7 @@ export declare const RowHeading: import("styled-components").StyledComponent<typ
|
|
|
5794
5824
|
"30": string;
|
|
5795
5825
|
"40": string;
|
|
5796
5826
|
"50": string;
|
|
5827
|
+
"55": string;
|
|
5797
5828
|
"56": string;
|
|
5798
5829
|
"60": string;
|
|
5799
5830
|
"70": string;
|
|
@@ -5836,6 +5867,7 @@ export declare const RowHeading: import("styled-components").StyledComponent<typ
|
|
|
5836
5867
|
onBrandVariant: string;
|
|
5837
5868
|
aiGradientFrom: string;
|
|
5838
5869
|
aiGradientTo: string;
|
|
5870
|
+
accessible: string;
|
|
5839
5871
|
fixed: {
|
|
5840
5872
|
brand: string;
|
|
5841
5873
|
dark: string;
|
|
@@ -5844,6 +5876,7 @@ export declare const RowHeading: import("styled-components").StyledComponent<typ
|
|
|
5844
5876
|
bright: string;
|
|
5845
5877
|
onBrand: string;
|
|
5846
5878
|
onBrandVariant: string;
|
|
5879
|
+
accessible: string;
|
|
5847
5880
|
};
|
|
5848
5881
|
};
|
|
5849
5882
|
outline: {
|
|
@@ -6371,6 +6404,7 @@ export declare const StyledSeparatorRow: import("styled-components").StyledCompo
|
|
|
6371
6404
|
"30": string;
|
|
6372
6405
|
"40": string;
|
|
6373
6406
|
"50": string;
|
|
6407
|
+
"55": string;
|
|
6374
6408
|
"56": string;
|
|
6375
6409
|
"60": string;
|
|
6376
6410
|
"70": string;
|
|
@@ -6413,6 +6447,7 @@ export declare const StyledSeparatorRow: import("styled-components").StyledCompo
|
|
|
6413
6447
|
onBrandVariant: string;
|
|
6414
6448
|
aiGradientFrom: string;
|
|
6415
6449
|
aiGradientTo: string;
|
|
6450
|
+
accessible: string;
|
|
6416
6451
|
fixed: {
|
|
6417
6452
|
brand: string;
|
|
6418
6453
|
dark: string;
|
|
@@ -6421,6 +6456,7 @@ export declare const StyledSeparatorRow: import("styled-components").StyledCompo
|
|
|
6421
6456
|
bright: string;
|
|
6422
6457
|
onBrand: string;
|
|
6423
6458
|
onBrandVariant: string;
|
|
6459
|
+
accessible: string;
|
|
6424
6460
|
};
|
|
6425
6461
|
};
|
|
6426
6462
|
outline: {
|
|
@@ -6948,6 +6984,7 @@ export declare const SeparatorRowText: import("styled-components").StyledCompone
|
|
|
6948
6984
|
"30": string;
|
|
6949
6985
|
"40": string;
|
|
6950
6986
|
"50": string;
|
|
6987
|
+
"55": string;
|
|
6951
6988
|
"56": string;
|
|
6952
6989
|
"60": string;
|
|
6953
6990
|
"70": string;
|
|
@@ -6990,6 +7027,7 @@ export declare const SeparatorRowText: import("styled-components").StyledCompone
|
|
|
6990
7027
|
onBrandVariant: string;
|
|
6991
7028
|
aiGradientFrom: string;
|
|
6992
7029
|
aiGradientTo: string;
|
|
7030
|
+
accessible: string;
|
|
6993
7031
|
fixed: {
|
|
6994
7032
|
brand: string;
|
|
6995
7033
|
dark: string;
|
|
@@ -6998,6 +7036,7 @@ export declare const SeparatorRowText: import("styled-components").StyledCompone
|
|
|
6998
7036
|
bright: string;
|
|
6999
7037
|
onBrand: string;
|
|
7000
7038
|
onBrandVariant: string;
|
|
7039
|
+
accessible: string;
|
|
7001
7040
|
};
|
|
7002
7041
|
};
|
|
7003
7042
|
outline: {
|
|
@@ -39,6 +39,7 @@ declare const DisclosureButton: import("styled-components").StyledComponent<type
|
|
|
39
39
|
"30": string;
|
|
40
40
|
"40": string;
|
|
41
41
|
"50": string;
|
|
42
|
+
"55": string;
|
|
42
43
|
"56": string;
|
|
43
44
|
"60": string;
|
|
44
45
|
"70": string;
|
|
@@ -81,6 +82,7 @@ declare const DisclosureButton: import("styled-components").StyledComponent<type
|
|
|
81
82
|
onBrandVariant: string;
|
|
82
83
|
aiGradientFrom: string;
|
|
83
84
|
aiGradientTo: string;
|
|
85
|
+
accessible: string;
|
|
84
86
|
fixed: {
|
|
85
87
|
brand: string;
|
|
86
88
|
dark: string;
|
|
@@ -89,6 +91,7 @@ declare const DisclosureButton: import("styled-components").StyledComponent<type
|
|
|
89
91
|
bright: string;
|
|
90
92
|
onBrand: string;
|
|
91
93
|
onBrandVariant: string;
|
|
94
|
+
accessible: string;
|
|
92
95
|
};
|
|
93
96
|
};
|
|
94
97
|
outline: {
|
|
@@ -41,7 +41,9 @@ const StyledDivider = styled_native_1.default.View(({ theme, type = 'default', w
|
|
|
41
41
|
height: 1px;
|
|
42
42
|
background: ${type === 'default'
|
|
43
43
|
? theme.color.surface.border
|
|
44
|
-
:
|
|
44
|
+
: type === 'brand'
|
|
45
|
+
? theme.color.green[70]
|
|
46
|
+
: theme.color.surface.borderDim};
|
|
45
47
|
width: ${width};
|
|
46
48
|
`;
|
|
47
49
|
});
|
|
@@ -37,6 +37,7 @@ export declare const Em: import("styled-components").StyledComponent<typeof impo
|
|
|
37
37
|
"30": string;
|
|
38
38
|
"40": string;
|
|
39
39
|
"50": string;
|
|
40
|
+
"55": string;
|
|
40
41
|
"56": string;
|
|
41
42
|
"60": string;
|
|
42
43
|
"70": string;
|
|
@@ -79,6 +80,7 @@ export declare const Em: import("styled-components").StyledComponent<typeof impo
|
|
|
79
80
|
onBrandVariant: string;
|
|
80
81
|
aiGradientFrom: string;
|
|
81
82
|
aiGradientTo: string;
|
|
83
|
+
accessible: string;
|
|
82
84
|
fixed: {
|
|
83
85
|
brand: string;
|
|
84
86
|
dark: string;
|
|
@@ -87,6 +89,7 @@ export declare const Em: import("styled-components").StyledComponent<typeof impo
|
|
|
87
89
|
bright: string;
|
|
88
90
|
onBrand: string;
|
|
89
91
|
onBrandVariant: string;
|
|
92
|
+
accessible: string;
|
|
90
93
|
};
|
|
91
94
|
};
|
|
92
95
|
outline: {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { InputProps } from '../Input/Input';
|
|
2
|
-
|
|
2
|
+
type EmailInputProps = InputProps & {
|
|
3
|
+
onValidityChange?: (isValid: boolean) => void;
|
|
4
|
+
};
|
|
5
|
+
declare const EmailInput: ({ onChangeText, onSubmitEditing, value, invalid, onValidityChange, ...rest }: EmailInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
6
|
export { EmailInput };
|
|
@@ -13,9 +13,25 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.EmailInput = void 0;
|
|
15
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("react");
|
|
16
17
|
const Input_1 = require("../Input/Input");
|
|
18
|
+
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
17
19
|
const EmailInput = (_a) => {
|
|
18
|
-
var {
|
|
19
|
-
|
|
20
|
+
var { onChangeText, onSubmitEditing, value, invalid, onValidityChange } = _a, rest = __rest(_a, ["onChangeText", "onSubmitEditing", "value", "invalid", "onValidityChange"]);
|
|
21
|
+
const textValue = typeof value === 'string' ? value : '';
|
|
22
|
+
const isValid = (0, react_1.useMemo)(() => textValue.length > 0 && EMAIL_REGEX.test(textValue), [textValue]);
|
|
23
|
+
const [hasUserInput, setHasUserInput] = (0, react_1.useState)(false);
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
onValidityChange === null || onValidityChange === void 0 ? void 0 : onValidityChange(isValid);
|
|
26
|
+
}, [isValid, onValidityChange]);
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(Input_1.Input, Object.assign({ keyboardType: "email-address", autoCapitalize: "none", autoCorrect: false, value: value, invalid: invalid !== null && invalid !== void 0 ? invalid : (hasUserInput && !isValid), onChangeText: text => {
|
|
28
|
+
if (!hasUserInput)
|
|
29
|
+
setHasUserInput(true);
|
|
30
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
|
|
31
|
+
}, onSubmitEditing: e => {
|
|
32
|
+
if (!isValid)
|
|
33
|
+
return;
|
|
34
|
+
onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);
|
|
35
|
+
} }, rest)));
|
|
20
36
|
};
|
|
21
37
|
exports.EmailInput = EmailInput;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmptyState = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const providers_1 = require("../../providers");
|
|
6
|
+
const styled_native_1 = require("../../styled.native");
|
|
7
|
+
const Heading_1 = require("../Heading");
|
|
8
|
+
const Pictogram_1 = require("../Pictogram");
|
|
9
|
+
const RemoteImage_1 = require("../RemoteImage");
|
|
10
|
+
const styles_1 = require("./styles");
|
|
11
|
+
const EmptyState = ({ backgroundStyle = 'filled', children, illustration, heading, pictogramName, }) => {
|
|
12
|
+
const pictograms = (0, providers_1.usePictograms)();
|
|
13
|
+
const theme = (0, styled_native_1.useTheme)();
|
|
14
|
+
const isFilledBackground = backgroundStyle === 'filled';
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledCard, { testID: "empty-state-card", background: isFilledBackground ? theme.color.surface.bright : 'transparent', children: [(illustration === null || illustration === void 0 ? void 0 : illustration.uri) ? ((0, jsx_runtime_1.jsx)(RemoteImage_1.RemoteImage, Object.assign({ testID: "empty-state-illustration", resizeMode: "contain" }, illustration))) : null, pictogramName && pictograms[pictogramName] ? ((0, jsx_runtime_1.jsx)(Pictogram_1.Pictogram, { testID: "empty-state-pictogram", size: 64, name: pictogramName })) : null, (0, jsx_runtime_1.jsxs)(styles_1.TextContainer, { children: [(0, jsx_runtime_1.jsx)(Heading_1.Heading4, { style: { color: theme.color.surface.onSurface }, children: heading }), children] })] }));
|
|
16
|
+
};
|
|
17
|
+
exports.EmptyState = EmptyState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const utils_1 = require("../../test/utils");
|
|
6
|
+
const EmptyState_1 = require("./EmptyState");
|
|
7
|
+
jest.mock('../../providers', () => (Object.assign(Object.assign({}, jest.requireActual('../../providers')), { usePictograms: () => ({
|
|
8
|
+
'test-pictogram': 'test-pictogram-data',
|
|
9
|
+
}) })));
|
|
10
|
+
const mockIllustration = {
|
|
11
|
+
uri: 'https://example.com/image.png',
|
|
12
|
+
width: 100,
|
|
13
|
+
height: 100,
|
|
14
|
+
};
|
|
15
|
+
const setup = (props) => {
|
|
16
|
+
return (0, utils_1.render)((0, jsx_runtime_1.jsx)(EmptyState_1.EmptyState, Object.assign({}, props)));
|
|
17
|
+
};
|
|
18
|
+
describe('EmptyState', () => {
|
|
19
|
+
it('should render the heading and children', () => {
|
|
20
|
+
const { getByText } = setup({
|
|
21
|
+
heading: 'Default Heading',
|
|
22
|
+
children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { children: "Default Children" }),
|
|
23
|
+
pictogramName: 'test-pictogram',
|
|
24
|
+
});
|
|
25
|
+
expect(getByText('Default Heading')).toBeDefined();
|
|
26
|
+
expect(getByText('Default Children')).toBeDefined();
|
|
27
|
+
});
|
|
28
|
+
it('should have a filled background by default', () => {
|
|
29
|
+
const { getByTestId } = setup({
|
|
30
|
+
heading: 'Default Heading',
|
|
31
|
+
pictogramName: 'test-pictogram',
|
|
32
|
+
});
|
|
33
|
+
const card = getByTestId('empty-state-card');
|
|
34
|
+
expect(card.props.style.backgroundColor).not.toBe('transparent');
|
|
35
|
+
});
|
|
36
|
+
it("should have a transparent background when backgroundStyle is 'transparent'", () => {
|
|
37
|
+
const { getByTestId } = setup({
|
|
38
|
+
backgroundStyle: 'transparent',
|
|
39
|
+
heading: 'Default Heading',
|
|
40
|
+
pictogramName: 'test-pictogram',
|
|
41
|
+
});
|
|
42
|
+
const card = getByTestId('empty-state-card');
|
|
43
|
+
expect(card.props.style.backgroundColor).toBe('transparent');
|
|
44
|
+
});
|
|
45
|
+
it('should render an illustration if provided', () => {
|
|
46
|
+
const { getByTestId } = setup({
|
|
47
|
+
heading: 'Default Heading',
|
|
48
|
+
illustration: mockIllustration,
|
|
49
|
+
});
|
|
50
|
+
const image = getByTestId('empty-state-illustration');
|
|
51
|
+
expect(image).toBeDefined();
|
|
52
|
+
expect(image.props.source.uri).toBe(mockIllustration.uri);
|
|
53
|
+
});
|
|
54
|
+
it('should not render an illustration if uri is not provided', () => {
|
|
55
|
+
const { queryByTestId } = setup({
|
|
56
|
+
heading: 'Default Heading',
|
|
57
|
+
// @ts-expect-error - we are intentionally providing an illustration without a valid uri to test rendering logic
|
|
58
|
+
illustration: { height: 100, width: 100 },
|
|
59
|
+
});
|
|
60
|
+
expect(queryByTestId('empty-state-illustration')).toBeNull();
|
|
61
|
+
});
|
|
62
|
+
it('should render a pictogram if a valid pictogramName is provided', () => {
|
|
63
|
+
const { getByTestId } = setup({
|
|
64
|
+
heading: 'Default Heading',
|
|
65
|
+
pictogramName: 'test-pictogram',
|
|
66
|
+
});
|
|
67
|
+
expect(getByTestId('empty-state-pictogram')).toBeDefined();
|
|
68
|
+
});
|
|
69
|
+
it('should not render a pictogram if pictogramName is invalid', () => {
|
|
70
|
+
const { queryByTestId } = setup({
|
|
71
|
+
heading: 'Default Heading',
|
|
72
|
+
pictogramName: 'invalid-pictogram',
|
|
73
|
+
});
|
|
74
|
+
expect(queryByTestId('empty-state-pictogram')).toBeNull();
|
|
75
|
+
});
|
|
76
|
+
it('should render custom children', () => {
|
|
77
|
+
const { getByText } = (0, utils_1.render)((0, jsx_runtime_1.jsx)(EmptyState_1.EmptyState, { heading: "Custom Heading", pictogramName: "test-pictogram", children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { children: "My Custom Child" }) }));
|
|
78
|
+
expect(getByText('My Custom Child')).toBeDefined();
|
|
79
|
+
});
|
|
80
|
+
it('should only render illustration when both illustration and pictogramName are provided', () => {
|
|
81
|
+
// According to the EmptyStateProps, only one of them should be present.
|
|
82
|
+
// However, if a user passes both, the component's internal logic will prioritize illustration.
|
|
83
|
+
// @ts-expect-error - we are intentionally passing both props to test runtime behavior
|
|
84
|
+
const { getByTestId, queryByTestId } = setup({
|
|
85
|
+
heading: 'Default Heading',
|
|
86
|
+
illustration: mockIllustration,
|
|
87
|
+
pictogramName: 'test-pictogram',
|
|
88
|
+
});
|
|
89
|
+
expect(getByTestId('empty-state-illustration')).toBeDefined();
|
|
90
|
+
expect(queryByTestId('empty-state-pictogram')).toBeNull();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './EmptyState';
|
|
@@ -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("./EmptyState"), exports);
|