@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,118 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.StyledCategory = exports.StyledP = exports.RadioDot = exports.Radio = exports.SelectOption = exports.DropdownContainer = exports.DropdownWrapper = exports.SelectInput = void 0;
|
|
37
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
38
|
+
const styled_native_1 = __importStar(require("../../styled.native"));
|
|
39
|
+
const theme_1 = require("../../theme");
|
|
40
|
+
const utils_1 = require("../../utils");
|
|
41
|
+
const P_1 = require("../P");
|
|
42
|
+
exports.SelectInput = styled_native_1.default.TouchableOpacity(({ theme, hasError, isSelected, size }) => {
|
|
43
|
+
const isSmall = size === 'small';
|
|
44
|
+
let borderColor = 'transparent';
|
|
45
|
+
/* prioritise error and selected states for border, even when focused */
|
|
46
|
+
if (hasError) {
|
|
47
|
+
borderColor = theme.color.alert.error;
|
|
48
|
+
}
|
|
49
|
+
else if (isSelected) {
|
|
50
|
+
borderColor = theme.color.surface.onSurface;
|
|
51
|
+
}
|
|
52
|
+
return (0, styled_native_1.css) `
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
align-items: center;
|
|
55
|
+
background-color: ${theme.color.surface.bright};
|
|
56
|
+
border-color: ${borderColor};
|
|
57
|
+
border-width: ${(0, theme_1.numToPx)(theme.border.width.md)};
|
|
58
|
+
border-radius: ${(0, theme_1.numToPx)(theme.border.radius.md)};
|
|
59
|
+
padding-top: ${(0, theme_1.numToPx)(theme.space[isSmall ? 200 : 400])};
|
|
60
|
+
padding-bottom: ${(0, theme_1.numToPx)(theme.space[isSmall ? 200 : 400])};
|
|
61
|
+
padding-left: ${(0, theme_1.numToPx)(theme.space[400])};
|
|
62
|
+
padding-right: ${(0, theme_1.numToPx)(theme.space[400])};
|
|
63
|
+
min-height: ${(0, theme_1.numToPx)(theme.space[isSmall ? 1100 : 1600])};
|
|
64
|
+
${(0, utils_1.getShadowCSS)({ theme })}
|
|
65
|
+
`;
|
|
66
|
+
});
|
|
67
|
+
exports.DropdownWrapper = styled_native_1.default.TouchableOpacity(({ theme }) => (0, styled_native_1.css) `
|
|
68
|
+
flex: 1;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
align-items: center;
|
|
71
|
+
|
|
72
|
+
/* 80 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 */
|
|
73
|
+
background-color: ${theme.color.brand.dark}80;
|
|
74
|
+
`);
|
|
75
|
+
exports.DropdownContainer = (0, styled_native_1.default)(react_native_safe_area_context_1.SafeAreaView)(({ theme }) => (0, styled_native_1.css) `
|
|
76
|
+
width: 95%;
|
|
77
|
+
max-height: 70%;
|
|
78
|
+
border-radius: ${(0, theme_1.numToPx)(theme.border.radius.md)};
|
|
79
|
+
background-color: ${theme.color.surface.bright};
|
|
80
|
+
`);
|
|
81
|
+
exports.SelectOption = styled_native_1.default.TouchableOpacity(({ theme, isLastOption }) => (0, styled_native_1.css) `
|
|
82
|
+
flex-direction: row;
|
|
83
|
+
align-items: center;
|
|
84
|
+
border-bottom-color: ${theme.color.input.borderDim};
|
|
85
|
+
border-bottom-width: ${isLastOption ? 0 : 1}px;
|
|
86
|
+
padding: 0 ${(0, theme_1.numToPx)(theme.space[400])};
|
|
87
|
+
`);
|
|
88
|
+
exports.Radio = styled_native_1.default.View(({ theme, isChecked }) => (0, styled_native_1.css) `
|
|
89
|
+
background-color: ${isChecked
|
|
90
|
+
? theme.input.color.selectedTint
|
|
91
|
+
: 'transparent'};
|
|
92
|
+
width: ${(0, theme_1.numToPx)(theme.space[600])};
|
|
93
|
+
height: ${(0, theme_1.numToPx)(theme.space[600])};
|
|
94
|
+
margin-left: auto;
|
|
95
|
+
border-radius: ${(0, theme_1.numToPx)(theme.space[600])};
|
|
96
|
+
border-width: ${(0, theme_1.numToPx)(theme.border.width.md)};
|
|
97
|
+
border-color: ${theme.input.color[isChecked ? 'selected' : 'border']};
|
|
98
|
+
`);
|
|
99
|
+
exports.RadioDot = styled_native_1.default.View(({ theme, isChecked }) => (0, styled_native_1.css) `
|
|
100
|
+
background-color: ${theme.input.color.selected};
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: ${(0, theme_1.numToPx)(theme.space[100])};
|
|
103
|
+
width: ${(0, theme_1.numToPx)(theme.space[300])};
|
|
104
|
+
height: ${(0, theme_1.numToPx)(theme.space[300])};
|
|
105
|
+
border-radius: ${(0, theme_1.numToPx)(theme.space[300])};
|
|
106
|
+
align-self: center;
|
|
107
|
+
opacity: ${isChecked ? 1 : 0};
|
|
108
|
+
`);
|
|
109
|
+
exports.StyledP = (0, styled_native_1.default)(P_1.P)(({ theme }) => (0, styled_native_1.css) `
|
|
110
|
+
margin-top: ${(0, theme_1.numToPx)(theme.space[300])};
|
|
111
|
+
margin-bottom: ${(0, theme_1.numToPx)(theme.space[300])};
|
|
112
|
+
`);
|
|
113
|
+
exports.StyledCategory = (0, styled_native_1.default)(P_1.P)(({ theme }) => (0, styled_native_1.css) `
|
|
114
|
+
font-size: ${(0, theme_1.numToPx)(theme.font.size.xs.mediaQuery.lg)};
|
|
115
|
+
color: ${theme.color.surface.onSurface};
|
|
116
|
+
background-color: ${theme.color.surface.surface};
|
|
117
|
+
padding: ${(0, theme_1.numToPx)(theme.space[100])} ${(0, theme_1.numToPx)(theme.space[400])};
|
|
118
|
+
`);
|
|
@@ -21,10 +21,10 @@ const hooks_1 = require("../../hooks");
|
|
|
21
21
|
const styled_native_1 = __importDefault(require("../../styled.native"));
|
|
22
22
|
const P_1 = require("../P");
|
|
23
23
|
const SkeletonAnimation_1 = require("../SkeletonAnimation");
|
|
24
|
-
const StyledSkeletonText = styled_native_1.default.View(({ theme, aboveSmallBreakpoint, short, size,
|
|
24
|
+
const StyledSkeletonText = styled_native_1.default.View(({ theme, aboveSmallBreakpoint, short, size, isLast }) => {
|
|
25
25
|
return `
|
|
26
26
|
background-color: ${theme.color.surface.dim};
|
|
27
|
-
margin-bottom: ${
|
|
27
|
+
margin-bottom: ${isLast ? 0 : (0, element_core_1.numToPx)(theme.space[200])};
|
|
28
28
|
border-radius: ${(0, element_core_1.numToPx)(theme.border.radius.sm)};
|
|
29
29
|
height: ${aboveSmallBreakpoint
|
|
30
30
|
? (0, element_core_1.numToPx)(theme.font.size.md.mediaQuery.lg)
|
|
@@ -37,9 +37,9 @@ const SkeletonText = (_a) => {
|
|
|
37
37
|
var { lines = 1, size } = _a, rest = __rest(_a, ["lines", "size"]);
|
|
38
38
|
const generatedLines = [];
|
|
39
39
|
const { smallAndUp } = (0, hooks_1.useBreakpoint)();
|
|
40
|
-
const hasMultipleLines = lines > 1;
|
|
41
40
|
for (let i = 1; i <= lines; i++) {
|
|
42
|
-
|
|
41
|
+
const isLast = i === lines;
|
|
42
|
+
generatedLines.push((0, jsx_runtime_1.jsx)(StyledSkeletonText, { short: lines > 1 && isLast, aboveSmallBreakpoint: smallAndUp, size: size, isLast: isLast }, `line-${i}`));
|
|
43
43
|
}
|
|
44
44
|
return (
|
|
45
45
|
// @ts-ignore styled components stuff
|
|
@@ -37,6 +37,7 @@ export declare const Strong: import("styled-components").StyledComponent<typeof
|
|
|
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 Strong: import("styled-components").StyledComponent<typeof
|
|
|
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 Strong: import("styled-components").StyledComponent<typeof
|
|
|
87
89
|
bright: string;
|
|
88
90
|
onBrand: string;
|
|
89
91
|
onBrandVariant: string;
|
|
92
|
+
accessible: string;
|
|
90
93
|
};
|
|
91
94
|
};
|
|
92
95
|
outline: {
|
|
@@ -42,6 +42,7 @@ declare const SubLabelText: (props: Omit<{
|
|
|
42
42
|
"30": string;
|
|
43
43
|
"40": string;
|
|
44
44
|
"50": string;
|
|
45
|
+
"55": string;
|
|
45
46
|
"56": string;
|
|
46
47
|
"60": string;
|
|
47
48
|
"70": string;
|
|
@@ -84,6 +85,7 @@ declare const SubLabelText: (props: Omit<{
|
|
|
84
85
|
onBrandVariant: string;
|
|
85
86
|
aiGradientFrom: string;
|
|
86
87
|
aiGradientTo: string;
|
|
88
|
+
accessible: string;
|
|
87
89
|
fixed: {
|
|
88
90
|
brand: string;
|
|
89
91
|
dark: string;
|
|
@@ -92,6 +94,7 @@ declare const SubLabelText: (props: Omit<{
|
|
|
92
94
|
bright: string;
|
|
93
95
|
onBrand: string;
|
|
94
96
|
onBrandVariant: string;
|
|
97
|
+
accessible: string;
|
|
95
98
|
};
|
|
96
99
|
};
|
|
97
100
|
outline: {
|
|
@@ -46,6 +46,7 @@ declare const TabTouchable: import("styled-components").StyledComponent<typeof i
|
|
|
46
46
|
"30": string;
|
|
47
47
|
"40": string;
|
|
48
48
|
"50": string;
|
|
49
|
+
"55": string;
|
|
49
50
|
"56": string;
|
|
50
51
|
"60": string;
|
|
51
52
|
"70": string;
|
|
@@ -88,6 +89,7 @@ declare const TabTouchable: import("styled-components").StyledComponent<typeof i
|
|
|
88
89
|
onBrandVariant: string;
|
|
89
90
|
aiGradientFrom: string;
|
|
90
91
|
aiGradientTo: string;
|
|
92
|
+
accessible: string;
|
|
91
93
|
fixed: {
|
|
92
94
|
brand: string;
|
|
93
95
|
dark: string;
|
|
@@ -96,6 +98,7 @@ declare const TabTouchable: import("styled-components").StyledComponent<typeof i
|
|
|
96
98
|
bright: string;
|
|
97
99
|
onBrand: string;
|
|
98
100
|
onBrandVariant: string;
|
|
101
|
+
accessible: string;
|
|
99
102
|
};
|
|
100
103
|
};
|
|
101
104
|
outline: {
|
|
@@ -47,15 +47,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
47
47
|
exports.TextareaInput = void 0;
|
|
48
48
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
49
|
const element_core_1 = require("@ovotech/element-core");
|
|
50
|
+
const hooks_1 = require("../../hooks");
|
|
50
51
|
const styled_native_1 = __importStar(require("../../styled.native"));
|
|
51
52
|
const Input_1 = require("../Input/Input");
|
|
52
|
-
const StyledInput = (0, styled_native_1.default)(Input_1.Input)(({ theme, rows }) =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
const StyledInput = (0, styled_native_1.default)(Input_1.Input)(({ theme, rows, smallAndUp, }) => {
|
|
54
|
+
const lineHeight = smallAndUp
|
|
55
|
+
? theme.font.lineHeight.md.mediaQuery.lg
|
|
56
|
+
: theme.font.lineHeight.md.mediaQuery.sm;
|
|
57
|
+
return (0, styled_native_1.css) `
|
|
58
|
+
min-height: ${theme.space[800] * rows}px;
|
|
59
|
+
line-height: ${rows > 1 ? (0, element_core_1.numToPx)(lineHeight) : 'normal'};
|
|
60
|
+
`;
|
|
61
|
+
});
|
|
57
62
|
const TextareaInput = (_a) => {
|
|
58
63
|
var { rows = 3, ref } = _a, rest = __rest(_a, ["rows", "ref"]);
|
|
59
|
-
|
|
64
|
+
const breakpoints = (0, hooks_1.useBreakpoint)();
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(StyledInput, Object.assign({}, rest, breakpoints, { keyboardType: "default", multiline: true, textAlignVertical: "top", rows: rows, ref: ref })));
|
|
60
66
|
};
|
|
61
67
|
exports.TextareaInput = TextareaInput;
|
|
@@ -8,6 +8,8 @@ type ToggleProps = Omit<TouchableOpacityProps, 'children'> & {
|
|
|
8
8
|
hint?: ReactNode;
|
|
9
9
|
labelPosition?: HorizontalPosition;
|
|
10
10
|
ref?: React.RefObject<View>;
|
|
11
|
+
testID?: string;
|
|
12
|
+
toggleBackgroundColor?: string;
|
|
11
13
|
};
|
|
12
|
-
export declare const Toggle: ({ activeOpacity, checked, label, hint, inline, labelPosition, testID, ref, ...rest }: ToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const Toggle: ({ activeOpacity, checked, label, hint, inline, labelPosition, testID, ref, toggleBackgroundColor, ...rest }: ToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -20,7 +20,7 @@ const HintText_1 = require("../HintText/HintText");
|
|
|
20
20
|
const LabelText_1 = require("../LabelText");
|
|
21
21
|
const styles_1 = require("./styles");
|
|
22
22
|
const Input = (_a) => {
|
|
23
|
-
var { checked, labelPosition, testID } = _a, rest = __rest(_a, ["checked", "labelPosition", "testID"]);
|
|
23
|
+
var { checked, labelPosition, testID, toggleBackgroundColor } = _a, rest = __rest(_a, ["checked", "labelPosition", "testID", "toggleBackgroundColor"]);
|
|
24
24
|
const theme = (0, styled_native_1.useTheme)();
|
|
25
25
|
const leftVal = (0, react_1.useRef)(new react_native_1.Animated.Value(checked ? theme.space[600] : theme.space[100])).current;
|
|
26
26
|
(0, react_1.useEffect)(() => {
|
|
@@ -30,13 +30,11 @@ const Input = (_a) => {
|
|
|
30
30
|
useNativeDriver: true,
|
|
31
31
|
}).start();
|
|
32
32
|
}, [checked]);
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledToggleInputWrapper, Object.assign({ labelPosition: labelPosition }, rest, { children: (0, jsx_runtime_1.jsx)(styles_1.StyledToggleInput, { checked: checked, testID: testID, children: (0, jsx_runtime_1.jsx)(styles_1.StyledToggleDot, { style: {
|
|
34
|
-
transform: [{ translateX: leftVal }],
|
|
35
|
-
}, checked: checked }) }) })));
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledToggleInputWrapper, Object.assign({ labelPosition: labelPosition }, rest, { children: (0, jsx_runtime_1.jsx)(styles_1.StyledToggleInput, { checked: checked, testID: testID, toggleBackgroundColor: toggleBackgroundColor, children: (0, jsx_runtime_1.jsx)(styles_1.StyledToggleDot, { style: { transform: [{ translateX: leftVal }] }, checked: checked }) }) })));
|
|
36
34
|
};
|
|
37
35
|
const Toggle = (_a) => {
|
|
38
|
-
var { activeOpacity = 0.8, checked = false, label, hint, inline, labelPosition = 'left', testID, ref } = _a, rest = __rest(_a, ["activeOpacity", "checked", "label", "hint", "inline", "labelPosition", "testID", "ref"]);
|
|
36
|
+
var { activeOpacity = 0.8, checked = false, label, hint, inline, labelPosition = 'left', testID, ref, toggleBackgroundColor } = _a, rest = __rest(_a, ["activeOpacity", "checked", "label", "hint", "inline", "labelPosition", "testID", "ref", "toggleBackgroundColor"]);
|
|
39
37
|
const hasLabel = label !== undefined;
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledWrapper, Object.assign({ ref: ref, accessible: true, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked }, hitSlop: 10, hasLabel: hasLabel, labelPosition: labelPosition, inline: inline }, rest, { children: [hasLabel ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexShrink: 1 }, children: [(0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] })) : null, (0, jsx_runtime_1.jsx)(Input, { checked: checked, testID: testID, labelPosition: hasLabel ? labelPosition : undefined })] })));
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledWrapper, Object.assign({ ref: ref, accessible: true, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked }, hitSlop: 10, hasLabel: hasLabel, labelPosition: labelPosition, inline: inline }, rest, { children: [hasLabel ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexShrink: 1 }, children: [(0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] })) : null, (0, jsx_runtime_1.jsx)(Input, { checked: checked, testID: testID, labelPosition: hasLabel ? labelPosition : undefined, toggleBackgroundColor: toggleBackgroundColor })] })));
|
|
41
39
|
};
|
|
42
40
|
exports.Toggle = Toggle;
|
|
@@ -39,6 +39,7 @@ export declare const StyledWrapper: import("styled-components").StyledComponent<
|
|
|
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 @@ export declare const StyledWrapper: import("styled-components").StyledComponent<
|
|
|
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 @@ export declare const StyledWrapper: import("styled-components").StyledComponent<
|
|
|
89
91
|
bright: string;
|
|
90
92
|
onBrand: string;
|
|
91
93
|
onBrandVariant: string;
|
|
94
|
+
accessible: string;
|
|
92
95
|
};
|
|
93
96
|
};
|
|
94
97
|
outline: {
|
|
@@ -618,6 +621,7 @@ export declare const StyledToggleInputWrapper: import("styled-components").Style
|
|
|
618
621
|
"30": string;
|
|
619
622
|
"40": string;
|
|
620
623
|
"50": string;
|
|
624
|
+
"55": string;
|
|
621
625
|
"56": string;
|
|
622
626
|
"60": string;
|
|
623
627
|
"70": string;
|
|
@@ -660,6 +664,7 @@ export declare const StyledToggleInputWrapper: import("styled-components").Style
|
|
|
660
664
|
onBrandVariant: string;
|
|
661
665
|
aiGradientFrom: string;
|
|
662
666
|
aiGradientTo: string;
|
|
667
|
+
accessible: string;
|
|
663
668
|
fixed: {
|
|
664
669
|
brand: string;
|
|
665
670
|
dark: string;
|
|
@@ -668,6 +673,7 @@ export declare const StyledToggleInputWrapper: import("styled-components").Style
|
|
|
668
673
|
bright: string;
|
|
669
674
|
onBrand: string;
|
|
670
675
|
onBrandVariant: string;
|
|
676
|
+
accessible: string;
|
|
671
677
|
};
|
|
672
678
|
};
|
|
673
679
|
outline: {
|
|
@@ -1195,6 +1201,7 @@ export declare const StyledToggleInput: import("styled-components").StyledCompon
|
|
|
1195
1201
|
"30": string;
|
|
1196
1202
|
"40": string;
|
|
1197
1203
|
"50": string;
|
|
1204
|
+
"55": string;
|
|
1198
1205
|
"56": string;
|
|
1199
1206
|
"60": string;
|
|
1200
1207
|
"70": string;
|
|
@@ -1237,6 +1244,7 @@ export declare const StyledToggleInput: import("styled-components").StyledCompon
|
|
|
1237
1244
|
onBrandVariant: string;
|
|
1238
1245
|
aiGradientFrom: string;
|
|
1239
1246
|
aiGradientTo: string;
|
|
1247
|
+
accessible: string;
|
|
1240
1248
|
fixed: {
|
|
1241
1249
|
brand: string;
|
|
1242
1250
|
dark: string;
|
|
@@ -1245,6 +1253,7 @@ export declare const StyledToggleInput: import("styled-components").StyledCompon
|
|
|
1245
1253
|
bright: string;
|
|
1246
1254
|
onBrand: string;
|
|
1247
1255
|
onBrandVariant: string;
|
|
1256
|
+
accessible: string;
|
|
1248
1257
|
};
|
|
1249
1258
|
};
|
|
1250
1259
|
outline: {
|
|
@@ -1732,6 +1741,7 @@ export declare const StyledToggleInput: import("styled-components").StyledCompon
|
|
|
1732
1741
|
};
|
|
1733
1742
|
}, {
|
|
1734
1743
|
checked?: boolean;
|
|
1744
|
+
toggleBackgroundColor?: string;
|
|
1735
1745
|
}, never>;
|
|
1736
1746
|
export declare const StyledToggleDot: import("styled-components").StyledComponent<Animated.AnimatedComponent<typeof import("react-native").View>, {
|
|
1737
1747
|
color: {
|
|
@@ -1772,6 +1782,7 @@ export declare const StyledToggleDot: import("styled-components").StyledComponen
|
|
|
1772
1782
|
"30": string;
|
|
1773
1783
|
"40": string;
|
|
1774
1784
|
"50": string;
|
|
1785
|
+
"55": string;
|
|
1775
1786
|
"56": string;
|
|
1776
1787
|
"60": string;
|
|
1777
1788
|
"70": string;
|
|
@@ -1814,6 +1825,7 @@ export declare const StyledToggleDot: import("styled-components").StyledComponen
|
|
|
1814
1825
|
onBrandVariant: string;
|
|
1815
1826
|
aiGradientFrom: string;
|
|
1816
1827
|
aiGradientTo: string;
|
|
1828
|
+
accessible: string;
|
|
1817
1829
|
fixed: {
|
|
1818
1830
|
brand: string;
|
|
1819
1831
|
dark: string;
|
|
@@ -1822,6 +1834,7 @@ export declare const StyledToggleDot: import("styled-components").StyledComponen
|
|
|
1822
1834
|
bright: string;
|
|
1823
1835
|
onBrand: string;
|
|
1824
1836
|
onBrandVariant: string;
|
|
1837
|
+
accessible: string;
|
|
1825
1838
|
};
|
|
1826
1839
|
};
|
|
1827
1840
|
outline: {
|
|
@@ -25,14 +25,14 @@ exports.StyledToggleInputWrapper = styled_native_1.default.View(({ theme, labelP
|
|
|
25
25
|
: ''}
|
|
26
26
|
`;
|
|
27
27
|
});
|
|
28
|
-
exports.StyledToggleInput = styled_native_1.default.View(({ theme, checked }) => {
|
|
28
|
+
exports.StyledToggleInput = styled_native_1.default.View(({ theme, checked, toggleBackgroundColor }) => {
|
|
29
29
|
return `
|
|
30
30
|
width: ${(0, element_core_1.numToPx)(theme.space[1100])};
|
|
31
31
|
height: ${(0, element_core_1.numToPx)(theme.space[600])};
|
|
32
32
|
justify-content: center;
|
|
33
33
|
border-radius: ${(0, element_core_1.numToPx)(theme.border.radius.lg)};
|
|
34
|
-
background: ${checked
|
|
35
|
-
? theme.color.outline.outer
|
|
34
|
+
background-color: ${checked
|
|
35
|
+
? toggleBackgroundColor || theme.color.outline.outer
|
|
36
36
|
: theme.color.surface.onSurfaceVariant};
|
|
37
37
|
`;
|
|
38
38
|
});
|
|
@@ -16,10 +16,13 @@ export * from './Divider';
|
|
|
16
16
|
export * from './Em';
|
|
17
17
|
export * from './EmailField';
|
|
18
18
|
export * from './EmailInput';
|
|
19
|
+
export * from './EmptyState';
|
|
20
|
+
export * from './ErrorWrapper';
|
|
19
21
|
export * from './Field';
|
|
20
22
|
export * from './Grid';
|
|
21
23
|
export * from './Heading';
|
|
22
24
|
export * from './Icon';
|
|
25
|
+
export * from './LargeValueReference';
|
|
23
26
|
export * from './LineThrough';
|
|
24
27
|
export * from './Link';
|
|
25
28
|
export * from './List';
|
package/dist/components/index.js
CHANGED
|
@@ -32,10 +32,13 @@ __exportStar(require("./Divider"), exports);
|
|
|
32
32
|
__exportStar(require("./Em"), exports);
|
|
33
33
|
__exportStar(require("./EmailField"), exports);
|
|
34
34
|
__exportStar(require("./EmailInput"), exports);
|
|
35
|
+
__exportStar(require("./EmptyState"), exports);
|
|
36
|
+
__exportStar(require("./ErrorWrapper"), exports);
|
|
35
37
|
__exportStar(require("./Field"), exports);
|
|
36
38
|
__exportStar(require("./Grid"), exports);
|
|
37
39
|
__exportStar(require("./Heading"), exports);
|
|
38
40
|
__exportStar(require("./Icon"), exports);
|
|
41
|
+
__exportStar(require("./LargeValueReference"), exports);
|
|
39
42
|
__exportStar(require("./LineThrough"), exports);
|
|
40
43
|
__exportStar(require("./Link"), exports);
|
|
41
44
|
__exportStar(require("./List"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { TouchableOpacity, View, } from 'react-native';
|
|
14
|
+
import { useBreakpoint } from '../../hooks';
|
|
15
|
+
import { Badge } from '../Badge';
|
|
16
|
+
import { StyledActionInner, StyledActionNodeWrapper, StyledActionText, StyledActionWrapper, StyledHintText, StyledLeftIcon, StyledRightIcon, StyledTextWrapper, } from './styled';
|
|
17
|
+
const ActionWrapper = (_a) => {
|
|
18
|
+
var { children, accessibilityRole, accessibilityLabel, accessibilityHint, activeOpacity = 0.75, fullWidth, hasBorder = false, inverted = false, inList, onPress, testID, standalone = false, ref } = _a, rest = __rest(_a, ["children", "accessibilityRole", "accessibilityLabel", "accessibilityHint", "activeOpacity", "fullWidth", "hasBorder", "inverted", "inList", "onPress", "testID", "standalone", "ref"]);
|
|
19
|
+
return (_jsx(StyledActionWrapper, Object.assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID, inList: inList }, rest, { children: _jsx(TouchableOpacity, { activeOpacity: activeOpacity, accessible: true, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, onPress: onPress, children: _jsx(StyledActionInner, { fullWidth: fullWidth, inList: inList, standalone: standalone, children: children }) }) })));
|
|
20
|
+
};
|
|
21
|
+
const Action = (_a) => {
|
|
22
|
+
var { accessibilityRole = 'link', accessibilityLabel, accessibilityHint, children, fullWidth = false, inverted = false, onPress, testID, iconLeft, iconRight, standalone = false, badgeVariant = 'info', badgeText, hint, ref } = _a, rest = __rest(_a, ["accessibilityRole", "accessibilityLabel", "accessibilityHint", "children", "fullWidth", "inverted", "onPress", "testID", "iconLeft", "iconRight", "standalone", "badgeVariant", "badgeText", "hint", "ref"]);
|
|
23
|
+
const { smallAndUp } = useBreakpoint();
|
|
24
|
+
return (_jsxs(ActionWrapper, Object.assign({ ref: ref, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, fullWidth: fullWidth, inverted: inverted, onPress: onPress, testID: testID, standalone: standalone, hint: hint, badgeText: badgeText }, rest, { children: [iconLeft ? (_jsx(StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, _jsxs(View, { children: [typeof children === 'string' ? (_jsxs(StyledTextWrapper, { children: [_jsx(StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, children: children }), badgeText ? (_jsx(Badge, { variant: badgeVariant, children: badgeText })) : null] })) : (_jsx(StyledActionNodeWrapper, { children: children })), hint ? (_jsx(StyledHintText, { inverted: inverted, children: hint })) : null] }), iconRight ? (_jsx(StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
|
|
25
|
+
};
|
|
26
|
+
export { Action };
|
|
@@ -10,35 +10,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { Children, cloneElement
|
|
14
|
-
import {
|
|
15
|
-
import { useBreakpoint } from '../../hooks';
|
|
13
|
+
import { Children, cloneElement } from 'react';
|
|
14
|
+
import { View } from 'react-native';
|
|
16
15
|
import { getValidChildren } from '../../utils';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
import { Divider } from '../Divider';
|
|
17
|
+
import { ActionListHeading } from './components/ActionListHeading';
|
|
18
|
+
import { StyledActionList } from './styled';
|
|
19
|
+
export const ActionList = (_a) => {
|
|
20
|
+
var { children, iconName, iconColor, heading, subheading } = _a, rest = __rest(_a, ["children", "iconName", "iconColor", "heading", "subheading"]);
|
|
21
21
|
const validChildren = getValidChildren(children);
|
|
22
22
|
const childCount = Children.count(validChildren);
|
|
23
|
-
return (_jsx(StyledActionList, Object.assign({}, rest, { children: Children.map(validChildren, (child, index) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
hasBorder: (childCount > 1 && index !== childCount - 1) || borderBottom,
|
|
29
|
-
inverted: (_a = child.props.inverted) !== null && _a !== void 0 ? _a : inverted, // prioritise child prop
|
|
30
|
-
inList: true,
|
|
31
|
-
iconRight: (_b = child.props.iconRight) !== null && _b !== void 0 ? _b : 'chevron-right-small',
|
|
32
|
-
});
|
|
33
|
-
}) })));
|
|
23
|
+
return (_jsxs(View, { children: [_jsx(ActionListHeading, { iconName: iconName, heading: heading, subheading: subheading, iconColor: iconColor }), _jsx(StyledActionList, Object.assign({}, rest, { children: Children.map(validChildren, (child, index) => (_jsxs(View, { children: [cloneElement(child, {
|
|
24
|
+
fullWidth: true,
|
|
25
|
+
index,
|
|
26
|
+
inList: true,
|
|
27
|
+
}), childCount > 1 && index !== childCount - 1 && _jsx(Divider, {})] }))) }))] }));
|
|
34
28
|
};
|
|
35
|
-
const ActionWrapper = (_a) => {
|
|
36
|
-
var { children, accessibilityRole, accessibilityLabel, accessibilityHint, activeOpacity = 0.75, fullWidth, hasBorder = false, inverted = false, inList, onPress, testID, standalone = false, ref } = _a, rest = __rest(_a, ["children", "accessibilityRole", "accessibilityLabel", "accessibilityHint", "activeOpacity", "fullWidth", "hasBorder", "inverted", "inList", "onPress", "testID", "standalone", "ref"]);
|
|
37
|
-
return (_jsx(StyledActionWrapper, Object.assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID, inList: inList }, rest, { children: _jsx(TouchableOpacity, { activeOpacity: activeOpacity, accessible: true, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, onPress: onPress, children: _jsx(StyledActionInner, { fullWidth: fullWidth, inList: inList, standalone: standalone, children: children }) }) })));
|
|
38
|
-
};
|
|
39
|
-
const Action = (_a) => {
|
|
40
|
-
var { accessibilityRole = 'link', accessibilityLabel, accessibilityHint, children, fullWidth = false, inverted = false, onPress, testID, iconLeft, iconRight, standalone = false, badgeVariant = 'info', badgeText, hint, ref } = _a, rest = __rest(_a, ["accessibilityRole", "accessibilityLabel", "accessibilityHint", "children", "fullWidth", "inverted", "onPress", "testID", "iconLeft", "iconRight", "standalone", "badgeVariant", "badgeText", "hint", "ref"]);
|
|
41
|
-
const { smallAndUp } = useBreakpoint();
|
|
42
|
-
return (_jsxs(ActionWrapper, Object.assign({ ref: ref, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, fullWidth: fullWidth, inverted: inverted, onPress: onPress, testID: testID, standalone: standalone, hint: hint, badgeText: badgeText }, rest, { children: [iconLeft ? (_jsx(StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, _jsxs(View, { children: [typeof children === 'string' ? (_jsxs(StyledTextWrapper, { children: [_jsx(StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, children: children }), badgeText ? (_jsx(Badge, { variant: badgeVariant, children: badgeText })) : null] })) : (_jsx(StyledActionNodeWrapper, { children: children })), hint ? (_jsx(StyledHintText, { inverted: inverted, children: hint })) : null] }), iconRight ? (_jsx(StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
|
|
43
|
-
};
|
|
44
|
-
export { Action, ActionList };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '../../../styled.native';
|
|
3
|
+
import { Icon } from '../../Icon';
|
|
4
|
+
import { LabelText } from '../../LabelText';
|
|
5
|
+
import { P } from '../../P';
|
|
6
|
+
import { ProgressRing } from './ProgressRing';
|
|
7
|
+
import { ActionListItemWrapper, DataValueText, DirectionAndValueTextContainer, DirectionLabelContainer, GraphicContainer, LeftTextContainer, OnSurfaceP, RightTextContainer, StatusText, StyledImage, ValueTextContainer, } from './styles';
|
|
8
|
+
export const DataListItem = ({ testID, graphic, progressRingPercentage, heading, subHeading, statusText, valueText, valueSubText, directionLabel, }) => {
|
|
9
|
+
const theme = useTheme();
|
|
10
|
+
const isError = statusText === 'Error';
|
|
11
|
+
const hasProgressRing = progressRingPercentage !== undefined;
|
|
12
|
+
const IconContent = (graphic === null || graphic === void 0 ? void 0 : graphic.type) === 'icon' ? (_jsx(GraphicContainer, { isIcon: true, hasProgress: hasProgressRing, children: _jsx(Icon, { name: graphic.icon, size: 24, color: graphic.iconColor ? graphic.iconColor : theme.color.brand.brand }) })) : null;
|
|
13
|
+
return (_jsxs(ActionListItemWrapper, { testID: testID, children: [(graphic === null || graphic === void 0 ? void 0 : graphic.type) === 'icon' &&
|
|
14
|
+
(hasProgressRing ? (_jsx(ProgressRing, { percentage: progressRingPercentage, children: IconContent })) : (IconContent)), (graphic === null || graphic === void 0 ? void 0 : graphic.type) === 'image' && (_jsx(GraphicContainer, { children: _jsx(StyledImage, { source: typeof graphic.image === 'string'
|
|
15
|
+
? { uri: graphic.image }
|
|
16
|
+
: graphic.image, resizeMode: "cover", accessibilityLabel: 'Data List Image' }) })), _jsxs(LeftTextContainer, { children: [heading && _jsx(LabelText, { children: heading }), subHeading && _jsx(P, { size: "sm", children: subHeading }), statusText && (_jsx(StatusText, { size: "sm", isError: isError, children: statusText }))] }), _jsxs(RightTextContainer, { children: [_jsxs(DirectionAndValueTextContainer, { children: [directionLabel && (_jsx(DirectionLabelContainer, { children: _jsx(OnSurfaceP, { size: "sm", children: directionLabel }) })), valueText && (_jsx(ValueTextContainer, { children: _jsx(DataValueText, { isError: isError, size: "lg", children: valueText }) }))] }), valueSubText && _jsx(OnSurfaceP, { size: "sm", children: valueSubText })] })] }));
|
|
17
|
+
};
|