@ovotech/element-native 3.5.0 → 3.6.0-canary-0ed6e33-174

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 (58) hide show
  1. package/dist/components/ActionCard/ActionCard.js +13 -11
  2. package/dist/components/CTALink/CTALink.d.ts +1 -1
  3. package/dist/components/DescriptionList/styled.d.ts +214 -222
  4. package/dist/components/DescriptionList/styled.js +4 -2
  5. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +2 -1
  6. package/dist/components/Label/Label.d.ts +243 -0
  7. package/dist/components/Label/Label.js +38 -0
  8. package/dist/components/Label/index.d.ts +1 -0
  9. package/dist/components/Label/index.js +5 -0
  10. package/dist/components/Lead/Lead.d.ts +243 -0
  11. package/dist/components/Lead/Lead.js +38 -0
  12. package/dist/components/Lead/index.d.ts +1 -0
  13. package/dist/components/Lead/index.js +5 -0
  14. package/dist/components/List/List.d.ts +4 -245
  15. package/dist/components/List/List.js +17 -66
  16. package/dist/components/List/styled.d.ts +7 -473
  17. package/dist/components/List/styled.js +9 -26
  18. package/dist/components/SelectField/Select.js +5 -3
  19. package/dist/components/Spinner/Spinner.d.ts +8 -0
  20. package/dist/components/Spinner/Spinner.js +82 -0
  21. package/dist/components/Spinner/index.d.ts +1 -0
  22. package/dist/components/Spinner/index.js +5 -0
  23. package/dist/components/Toggle/Toggle.d.ts +10 -0
  24. package/dist/components/Toggle/Toggle.js +56 -0
  25. package/dist/components/Toggle/index.d.ts +1 -0
  26. package/dist/components/Toggle/index.js +5 -0
  27. package/dist/components/Toggle/styles.d.ts +939 -0
  28. package/dist/components/Toggle/styles.js +28 -0
  29. package/dist/components/index.d.ts +29 -25
  30. package/dist/components/index.js +29 -25
  31. package/dist/esm/components/ActionCard/ActionCard.js +13 -11
  32. package/dist/esm/components/DescriptionList/styled.js +4 -2
  33. package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +2 -1
  34. package/dist/esm/components/Label/Label.js +12 -0
  35. package/dist/esm/components/Label/index.js +1 -0
  36. package/dist/esm/components/Lead/Lead.js +12 -0
  37. package/dist/esm/components/Lead/index.js +1 -0
  38. package/dist/esm/components/List/List.js +19 -67
  39. package/dist/esm/components/List/styled.js +8 -25
  40. package/dist/esm/components/SelectField/Select.js +5 -3
  41. package/dist/esm/components/Spinner/Spinner.js +55 -0
  42. package/dist/esm/components/Spinner/index.js +1 -0
  43. package/dist/esm/components/Toggle/Toggle.js +53 -0
  44. package/dist/esm/components/Toggle/index.js +1 -0
  45. package/dist/esm/components/Toggle/styles.js +22 -0
  46. package/dist/esm/components/index.js +29 -25
  47. package/dist/esm/providers/IconsProvider.js +2 -1
  48. package/dist/esm/providers/icons/Logo.js +3 -3
  49. package/dist/esm/providers/icons/Torch.js +14 -0
  50. package/dist/esm/providers/icons/index.js +1 -0
  51. package/dist/providers/IconsProvider.js +1 -0
  52. package/dist/providers/icons/Logo.js +1 -1
  53. package/dist/providers/icons/Torch.d.ts +2 -0
  54. package/dist/providers/icons/Torch.js +41 -0
  55. package/dist/providers/icons/index.d.ts +1 -0
  56. package/dist/providers/icons/index.js +1 -0
  57. package/dist/providers/types.d.ts +1 -1
  58. package/package.json +2 -2
@@ -0,0 +1,28 @@
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.StyledToggleDot = exports.StyledToggleInput = exports.StyledToggleInputWrapper = exports.StyledWrapper = void 0;
7
+ var react_native_1 = require("react-native");
8
+ var styled_native_1 = __importDefault(require("../../styled.native"));
9
+ exports.StyledWrapper = styled_native_1.default.TouchableOpacity(function (_a) {
10
+ var core = _a.theme.core, hasLabel = _a.hasLabel, labelPosition = _a.labelPosition;
11
+ return "\n width: ".concat(hasLabel ? '100%' : core.space[11], ";\n display: flex;\n flex-direction: row").concat(labelPosition === 'left' ? '' : '-reverse', ";\n justify-content: space-between;\n position: relative;\n ");
12
+ });
13
+ exports.StyledToggleInputWrapper = styled_native_1.default.View(function (_a) {
14
+ var core = _a.theme.core, labelPosition = _a.labelPosition;
15
+ return "\n width: ".concat(core.space[11], ";\n height: ").concat(core.space[6], ";\n ").concat(labelPosition
16
+ ? labelPosition === 'left'
17
+ ? 'margin-left: 10px;'
18
+ : 'margin-right: 10px;'
19
+ : null, "\n ");
20
+ });
21
+ exports.StyledToggleInput = styled_native_1.default.View(function (_a) {
22
+ var core = _a.theme.core, checked = _a.checked;
23
+ return "\n width: ".concat(core.space[11], ";\n height: ").concat(core.space[6], ";\n justify-content: center;\n border-radius: ").concat(core.radius.large, ";\n background: ").concat(checked ? core.color.brand.ovo : core.color.neutral.lighter, ";\n ");
24
+ });
25
+ exports.StyledToggleDot = (0, styled_native_1.default)(react_native_1.Animated.View)(function (_a) {
26
+ var core = _a.theme.core, checked = _a.checked;
27
+ return "\n position: absolute;\n width: ".concat(core.space[4], ";\n height: ").concat(core.space[4], ";\n border-radius: ").concat(core.space[4], ";\n background-color: ").concat(checked ? core.color.brand.white : core.color.neutral.dark, ";\n");
28
+ });
@@ -1,55 +1,59 @@
1
1
  export * from './Accordion';
2
- export * from './ActionList';
3
2
  export * from './ActionCard';
3
+ export * from './ActionList';
4
4
  export * from './Badge';
5
5
  export * from './Card';
6
6
  export * from './Checkbox';
7
7
  export * from './CTAButton';
8
8
  export * from './CTALink';
9
+ export * from './CurrencyField';
10
+ export * from './CurrencyInput';
11
+ export * from './DataTable';
9
12
  export * from './DateField';
10
13
  export * from './DescriptionList';
11
14
  export * from './Disclosure';
12
15
  export * from './Divider';
16
+ export * from './Em';
17
+ export * from './EmailField';
18
+ export * from './EmailInput';
13
19
  export * from './ErrorSummaryNotification';
14
20
  export * from './Field';
21
+ export * from './FilterSelect';
15
22
  export * from './Grid';
16
- export * from './NavHeader';
17
23
  export * from './Heading1';
18
24
  export * from './Heading2';
19
25
  export * from './Heading3';
20
26
  export * from './Heading4';
21
27
  export * from './Icon';
28
+ export * from './Label';
29
+ export * from './Lead';
30
+ export * from './LineThrough';
22
31
  export * from './List';
23
32
  export * from './Margin';
33
+ export * from './NavHeader';
24
34
  export * from './Notification';
25
- export * from './Radio';
26
- export * from './Stack';
27
- export * from './Tabs';
28
- export * from './TextGroup';
35
+ export * from './NumberField';
36
+ export * from './NumberInput';
29
37
  export * from './P';
30
- export * from './Strong';
31
- export * from './Small';
32
- export * from './Em';
33
- export * from './LineThrough';
34
- export * from './TextField';
35
- export * from './TextLink';
36
- export * from './DataTable';
37
- export * from './SelectField';
38
- export * from './CurrencyField';
39
38
  export * from './PasswordField';
40
- export * from './EmailField';
41
- export * from './TextareaField';
42
- export * from './NumberField';
39
+ export * from './PasswordInput';
43
40
  export * from './PhoneField';
44
41
  export * from './PhoneInput';
45
- export * from './TextInput';
46
- export * from './EmailInput';
47
- export * from './NumberInput';
48
- export * from './TextareaInput';
49
- export * from './PasswordInput';
50
- export * from './CurrencyInput';
42
+ export * from './Radio';
43
+ export * from './SelectField';
51
44
  export * from './SkeletonCircle';
52
45
  export * from './SkeletonCTA';
53
46
  export * from './SkeletonHeading';
54
47
  export * from './SkeletonText';
55
- export * from './FilterSelect';
48
+ export * from './Small';
49
+ export * from './Spinner';
50
+ export * from './Stack';
51
+ export * from './Strong';
52
+ export * from './Tabs';
53
+ export * from './TextareaField';
54
+ export * from './TextareaInput';
55
+ export * from './TextField';
56
+ export * from './TextGroup';
57
+ export * from './TextInput';
58
+ export * from './TextLink';
59
+ export * from './Toggle';
@@ -15,57 +15,61 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Accordion"), exports);
18
- __exportStar(require("./ActionList"), exports);
19
18
  __exportStar(require("./ActionCard"), exports);
19
+ __exportStar(require("./ActionList"), exports);
20
20
  __exportStar(require("./Badge"), exports);
21
21
  __exportStar(require("./Card"), exports);
22
22
  __exportStar(require("./Checkbox"), exports);
23
23
  __exportStar(require("./CTAButton"), exports);
24
24
  __exportStar(require("./CTALink"), exports);
25
+ __exportStar(require("./CurrencyField"), exports);
26
+ __exportStar(require("./CurrencyInput"), exports);
27
+ __exportStar(require("./DataTable"), exports);
25
28
  __exportStar(require("./DateField"), exports);
26
29
  __exportStar(require("./DescriptionList"), exports);
27
30
  __exportStar(require("./Disclosure"), exports);
28
31
  __exportStar(require("./Divider"), exports);
32
+ __exportStar(require("./Em"), exports);
33
+ __exportStar(require("./EmailField"), exports);
34
+ __exportStar(require("./EmailInput"), exports);
29
35
  __exportStar(require("./ErrorSummaryNotification"), exports);
30
36
  __exportStar(require("./Field"), exports);
37
+ __exportStar(require("./FilterSelect"), exports);
31
38
  __exportStar(require("./Grid"), exports);
32
- __exportStar(require("./NavHeader"), exports);
33
39
  __exportStar(require("./Heading1"), exports);
34
40
  __exportStar(require("./Heading2"), exports);
35
41
  __exportStar(require("./Heading3"), exports);
36
42
  __exportStar(require("./Heading4"), exports);
37
43
  __exportStar(require("./Icon"), exports);
44
+ __exportStar(require("./Label"), exports);
45
+ __exportStar(require("./Lead"), exports);
46
+ __exportStar(require("./LineThrough"), exports);
38
47
  __exportStar(require("./List"), exports);
39
48
  __exportStar(require("./Margin"), exports);
49
+ __exportStar(require("./NavHeader"), exports);
40
50
  __exportStar(require("./Notification"), exports);
41
- __exportStar(require("./Radio"), exports);
42
- __exportStar(require("./Stack"), exports);
43
- __exportStar(require("./Tabs"), exports);
44
- __exportStar(require("./TextGroup"), exports);
51
+ __exportStar(require("./NumberField"), exports);
52
+ __exportStar(require("./NumberInput"), exports);
45
53
  __exportStar(require("./P"), exports);
46
- __exportStar(require("./Strong"), exports);
47
- __exportStar(require("./Small"), exports);
48
- __exportStar(require("./Em"), exports);
49
- __exportStar(require("./LineThrough"), exports);
50
- __exportStar(require("./TextField"), exports);
51
- __exportStar(require("./TextLink"), exports);
52
- __exportStar(require("./DataTable"), exports);
53
- __exportStar(require("./SelectField"), exports);
54
- __exportStar(require("./CurrencyField"), exports);
55
54
  __exportStar(require("./PasswordField"), exports);
56
- __exportStar(require("./EmailField"), exports);
57
- __exportStar(require("./TextareaField"), exports);
58
- __exportStar(require("./NumberField"), exports);
55
+ __exportStar(require("./PasswordInput"), exports);
59
56
  __exportStar(require("./PhoneField"), exports);
60
57
  __exportStar(require("./PhoneInput"), exports);
61
- __exportStar(require("./TextInput"), exports);
62
- __exportStar(require("./EmailInput"), exports);
63
- __exportStar(require("./NumberInput"), exports);
64
- __exportStar(require("./TextareaInput"), exports);
65
- __exportStar(require("./PasswordInput"), exports);
66
- __exportStar(require("./CurrencyInput"), exports);
58
+ __exportStar(require("./Radio"), exports);
59
+ __exportStar(require("./SelectField"), exports);
67
60
  __exportStar(require("./SkeletonCircle"), exports);
68
61
  __exportStar(require("./SkeletonCTA"), exports);
69
62
  __exportStar(require("./SkeletonHeading"), exports);
70
63
  __exportStar(require("./SkeletonText"), exports);
71
- __exportStar(require("./FilterSelect"), exports);
64
+ __exportStar(require("./Small"), exports);
65
+ __exportStar(require("./Spinner"), exports);
66
+ __exportStar(require("./Stack"), exports);
67
+ __exportStar(require("./Strong"), exports);
68
+ __exportStar(require("./Tabs"), exports);
69
+ __exportStar(require("./TextareaField"), exports);
70
+ __exportStar(require("./TextareaInput"), exports);
71
+ __exportStar(require("./TextField"), exports);
72
+ __exportStar(require("./TextGroup"), exports);
73
+ __exportStar(require("./TextInput"), exports);
74
+ __exportStar(require("./TextLink"), exports);
75
+ __exportStar(require("./Toggle"), exports);
@@ -20,7 +20,9 @@ import { CloseIconShape } from './CloseIconShape';
20
20
  import { IndicatorIconShape } from './IndicatorIconShape';
21
21
  var StyledCard = styled.Pressable(function (_a) {
22
22
  var _b = _a.theme, core = _b.core, semantic = _b.semantic, inline = _a.inline, inverted = _a.inverted, reducedBottomPadding = _a.reducedBottomPadding;
23
- return "\n border-radius: ".concat(inline ? core.space[6] : 0, ";\n background-color: ").concat(inverted ? semantic.inverted.surface : semantic.surface.elevated, ";\n padding-bottom: ").concat(reducedBottomPadding ? core.space[1] : core.space[4], ";\n padding: ").concat(core.space[4], ";\n overflow: hidden;\n border-width: 0;\n width: 100%;\n ");
23
+ var paddingVal = inline ? core.space[4] : core.space[6];
24
+ var reducedBottomPaddingVal = inline ? core.space[3] : core.space[5];
25
+ return "\n border-radius: ".concat(inline ? core.space[6] : 0, ";\n background-color: ").concat(inverted ? semantic.inverted.surface : semantic.surface.elevated, ";\n padding: ").concat(paddingVal, ";\n padding-bottom: ").concat(reducedBottomPadding ? reducedBottomPaddingVal : paddingVal, ";\n overflow: hidden;\n border-width: 0;\n width: 100%;\n ");
24
26
  });
25
27
  var StyledP = styled(P)(function (_a) {
26
28
  var semantic = _a.theme.semantic, inverted = _a.inverted;
@@ -35,21 +37,21 @@ export var ActionCard = function (_a) {
35
37
  }
36
38
  }, []);
37
39
  var Heading = inline ? Heading3 : Heading2;
40
+ var cardPadding = parseInt(core.space[inline ? 4 : 6]);
41
+ var negativeMarginAdjustment = -cardPadding;
38
42
  return (_jsx(StyledCard, __assign({ onPress: onPressIndicator, inline: inline, inverted: inverted, reducedBottomPadding: Boolean(buttonTitle && !ctaVariant), testID: "".concat(testID, "-card") }, { children: _jsxs(View, __assign({ style: { flexDirection: 'row' } }, { children: [_jsx(View, __assign({ style: { flex: 1 } }, { children: _jsxs(Stack, __assign({ spaceBetween: 2 }, { children: [_jsx(Heading, __assign({ style: {
39
43
  color: inverted
40
44
  ? semantic.inverted.message.link
41
45
  : semantic.message.branded,
42
- paddingRight: image || !onPressCloseButton ? 0 : parseInt(core.space[6]),
46
+ paddingRight: image || !onPressCloseButton ? 0 : cardPadding,
43
47
  }, testID: "".concat(testID, "-heading") }, { children: title })), _jsxs(View, { children: [typeof body === 'string' ? (_jsx(View, __assign({ style: {
44
- paddingRight: !image && !title && onPressCloseButton
45
- ? parseInt(core.space[6])
46
- : 0,
48
+ paddingRight: !image && !title && onPressCloseButton ? cardPadding : 0,
47
49
  } }, { children: _jsx(StyledP, __assign({ inverted: inverted }, { children: body })) }))) : (body), buttonTitle && onPressActionButton && !onPressIndicator ? (!ctaVariant ? (_jsx(Margin, __assign({ top: 2 }, { children: _jsx(Action, __assign({ inverted: inverted, inline: true, onPress: onPressActionButton, testID: "".concat(testID, "-button") }, { children: buttonTitle })) }))) : (_jsx(Margin, __assign({ top: 4 }, { children: _jsx(CTAButton, __assign({ onPress: onPressActionButton, testID: "".concat(testID, "-button"), variant: ctaVariant }, { children: buttonTitle })) })))) : null] })] })) })), image ? (_jsx(MaskedView, __assign({ style: {
48
50
  flex: 1,
49
51
  flexDirection: 'row',
50
52
  height: '100%',
51
- marginTop: -16,
52
- marginRight: -16,
53
+ marginTop: negativeMarginAdjustment,
54
+ marginRight: negativeMarginAdjustment,
53
55
  }, maskElement: _jsx(View, { style: {
54
56
  width: '100%',
55
57
  height: 165,
@@ -67,16 +69,16 @@ export var ActionCard = function (_a) {
67
69
  right: 0,
68
70
  }, accessible: true, accessibilityRole: "image", accessibilityLabel: accessibilityLabel }) }))) : null, onPressIndicator ? (_jsxs(Pressable, __assign({ style: {
69
71
  position: 'absolute',
70
- right: -16,
71
- bottom: -16,
72
+ right: negativeMarginAdjustment,
73
+ bottom: negativeMarginAdjustment,
72
74
  }, onPress: onPressIndicator, testID: "".concat(testID, "-indicator-button") }, { children: [_jsx(IndicatorIconShape, {}), _jsx(Icon, { size: 14, style: {
73
75
  position: 'absolute',
74
76
  right: inline ? 8 : 6,
75
77
  bottom: 16,
76
78
  }, color: semantic.surface.elevated, name: "chevron-right", accessibilityLabel: "chevron-right" })] }))) : null, onPressCloseButton && !onPressIndicator ? (_jsxs(Pressable, __assign({ style: {
77
79
  position: 'absolute',
78
- right: -16,
79
- top: -16,
80
+ right: negativeMarginAdjustment,
81
+ top: negativeMarginAdjustment,
80
82
  }, onPress: onPressCloseButton, testID: "".concat(testID, "-close-button") }, { children: [_jsx(CloseIconShape, {}), _jsx(Icon, { size: 14, style: {
81
83
  position: 'absolute',
82
84
  top: inline ? 14 : 12,
@@ -28,8 +28,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
28
28
  import { View } from 'react-native';
29
29
  import styled, { css } from '../../styled.native';
30
30
  import { styledComponentWithBreakpoints } from '../../utils';
31
- import { ListWrapper } from '../List/List';
32
- export var Dl = ListWrapper;
31
+ export var Dl = styled.View(function (_a) {
32
+ var core = _a.theme.core, smallAndUp = _a.smallAndUp;
33
+ return "\n flex-direction: column;\n flex: 1;\n margin-vertical: ".concat(smallAndUp ? core.space[3] : core.space[2], ";\n");
34
+ });
33
35
  var StyledDtText = styled.Text(function (_a) {
34
36
  var _b = _a.theme, core = _b.core, semantic = _b.semantic;
35
37
  return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body.small, core.fontSize.body.small, semantic.message.base);
@@ -25,6 +25,7 @@ import { createRef, useEffect } from 'react';
25
25
  import { findNodeHandle, AccessibilityInfo, } from 'react-native';
26
26
  import { Ul, Li } from '../List';
27
27
  import { ErrorNotification } from '../Notification';
28
+ import { P } from '../P';
28
29
  var ErrorSummaryNotification = function (_a) {
29
30
  var errors = _a.errors, scrollViewRef = _a.scrollViewRef, _b = _a.scrollPos, scrollPos = _b === void 0 ? { x: 0, y: 0 } : _b, rest = __rest(_a, ["errors", "scrollViewRef", "scrollPos"]);
30
31
  var ref = createRef();
@@ -42,7 +43,7 @@ var ErrorSummaryNotification = function (_a) {
42
43
  }, [errors, scrollViewRef.current, ref.current]);
43
44
  return (_jsx(ErrorNotification, __assign({ ref: ref }, rest, { children: errors.length === 0 ? null : (_jsx(Ul, { children: errors.map(function (_a) {
44
45
  var message = _a.message, fieldId = _a.id;
45
- return (_jsx(Li, { children: message }, fieldId));
46
+ return (_jsx(Li, { children: _jsx(P, { children: message }) }, fieldId));
46
47
  }) })) })));
47
48
  };
48
49
  export { ErrorSummaryNotification };
@@ -0,0 +1,12 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import styled, { css } from '../../styled.native';
6
+ import { styledComponentWithBreakpoints } from '../../utils';
7
+ var StyledLabel = styled.Text(function (_a) {
8
+ var core = _a.theme.core, smallAndUp = _a.smallAndUp;
9
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n "])), core.fontFamily.body.native, core.fontSize.label[smallAndUp ? 'large' : 'small'], core.lineHeight.label[smallAndUp ? 'large' : 'small']);
10
+ });
11
+ export var Label = styledComponentWithBreakpoints(StyledLabel);
12
+ var templateObject_1;
@@ -0,0 +1 @@
1
+ export { Label } from './Label';
@@ -0,0 +1,12 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import styled, { css } from '../../styled.native';
6
+ import { styledComponentWithBreakpoints } from '../../utils';
7
+ var StyledLead = styled.Text(function (_a) {
8
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
9
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, core.fontSize.lead[smallAndUp ? 'large' : 'small'], core.lineHeight.lead[smallAndUp ? 'large' : 'small'], semantic.message.branded);
10
+ });
11
+ export var Lead = styledComponentWithBreakpoints(StyledLead);
12
+ var templateObject_1;
@@ -0,0 +1 @@
1
+ export { Lead } from './Lead';
@@ -9,80 +9,32 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
13
  import { Children } from 'react';
25
- import { styledComponentWithBreakpoints } from '../../utils';
26
- import { P } from '../P';
14
+ import { View } from 'react-native';
15
+ import { Margin } from '../Margin';
27
16
  import { Stack } from '../Stack';
28
- import { StyledBullet, StyledLi, StyledList, StyledOlItem, StyledUlItem, UlBullet, } from './styled';
29
- var Bullet = styledComponentWithBreakpoints(StyledBullet);
30
- var ListWrapper = styledComponentWithBreakpoints(StyledList);
31
- var ListBulletItem = function (_a) {
32
- var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b, level = _a.level;
33
- return (_jsxs(StyledUlItem, __assign({ level: level }, { children: [_jsx(UlBullet, { visible: showBullets }), children] })));
34
- };
35
- var ListNumberedItem = function (_a) {
36
- var children = _a.children, prefix = _a.prefix, level = _a.level;
37
- return (_jsxs(StyledOlItem, __assign({ level: level }, { children: [_jsx(Bullet, { children: prefix }), children] })));
17
+ import { FlexRow, LiContent, SquareBullet, TextBullet } from './styled';
18
+ var ListItem = function (_a) {
19
+ var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b, prefix = _a.prefix;
20
+ return (_jsxs(FlexRow, { children: [prefix ? (_jsx(TextBullet, { children: prefix })) : (_jsx(SquareBullet, { visible: showBullets })), _jsx(LiContent, { children: children })] }));
38
21
  };
39
22
  var renderList = function (_a) {
40
- var arrayChildren = _a.arrayChildren, _b = _a.level, level = _b === void 0 ? 0 : _b, showBullets = _a.showBullets, listType = _a.listType;
41
- return Children.map(arrayChildren, function (child, index) {
42
- var _a;
43
- var lvl = level;
44
- var PADDING = 3;
45
- lvl = lvl + PADDING;
46
- // @ts-ignore doesn't recognise child props.
47
- var nestedChildren = ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.children) || {};
48
- var nestedLists = [];
49
- var childrenToRender = Array.from(nestedChildren).filter(function (ch) {
50
- var _a, _b;
51
- if (typeof ch == 'object' &&
52
- // @ts-ignore Missing types for React Children
53
- (((_a = ch === null || ch === void 0 ? void 0 : ch.type) === null || _a === void 0 ? void 0 : _a.name) === 'Ul' || ((_b = ch === null || ch === void 0 ? void 0 : ch.type) === null || _b === void 0 ? void 0 : _b.name) === 'Ol')) {
54
- nestedLists.push(ch);
55
- return false;
56
- }
57
- else {
58
- return true;
59
- }
60
- });
61
- return (_jsxs(_Fragment, { children: [childrenToRender.length > 0 && listType === 'ul' ? (_jsx(ListBulletItem, __assign({ showBullets: showBullets, level: level }, { children: _jsx(P, { children: childrenToRender }) }))) : null, childrenToRender.length > 0 && listType === 'ol' ? (_jsx(ListNumberedItem, __assign({ level: level, prefix: "".concat(index + 1, ".") }, { children: _jsx(P, { children: childrenToRender }) }))) : null, nestedLists.length > 0
62
- ? nestedLists.map(function (obj) {
63
- var _a, _b, _c, _d;
64
- return renderList({
65
- //@ts-ignore
66
- arrayChildren: (_b = (_a = obj === null || obj === void 0 ? void 0 : obj.props) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : obj,
67
- level: lvl,
68
- showBullets: showBullets,
69
- //@ts-ignore
70
- listType: (_d = (_c = obj.type) === null || _c === void 0 ? void 0 : _c.name) === null || _d === void 0 ? void 0 : _d.toLowerCase(),
71
- });
72
- })
73
- : null] }));
23
+ var children = _a.children, listType = _a.listType, showBullets = _a.showBullets;
24
+ return Children.map(children, function (child, index) {
25
+ return (_jsx(ListItem, __assign({ prefix: listType === 'ol' ? "".concat(index + 1, ".") : undefined, showBullets: showBullets }, { children: child })));
74
26
  });
75
27
  };
76
28
  var Li = function (_a) {
77
- var children = _a.children, rest = __rest(_a, ["children"]);
78
- return _jsx(StyledLi, __assign({}, rest, { children: children }));
29
+ var children = _a.children;
30
+ return _jsx(View, __assign({ style: { flexDirection: 'column' } }, { children: children }));
79
31
  };
80
- var Ul = function (_a) {
81
- var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b, rest = __rest(_a, ["children", "showBullets"]);
82
- return (_jsx(ListWrapper, __assign({}, rest, { children: _jsx(Stack, __assign({ spaceBetween: 2 }, { children: renderList({ arrayChildren: children, listType: 'ul', showBullets: showBullets }) })) })));
32
+ var Ul = function (props) {
33
+ var children = props.children, showBullets = props.showBullets;
34
+ return (_jsx(Margin, __assign({ top: 2 }, { children: _jsx(Stack, __assign({ spaceBetween: 2 }, { children: renderList({ children: children, listType: 'ul', showBullets: showBullets }) })) })));
83
35
  };
84
- var Ol = function (_a) {
85
- var children = _a.children, rest = __rest(_a, ["children"]);
86
- return (_jsx(ListWrapper, __assign({}, rest, { children: _jsx(Stack, __assign({ spaceBetween: 2 }, { children: renderList({ arrayChildren: children, listType: 'ol' }) })) })));
36
+ var Ol = function (props) {
37
+ var children = props.children;
38
+ return (_jsx(Margin, __assign({ top: 2 }, { children: _jsx(Stack, __assign({ spaceBetween: 2 }, { children: renderList({ children: children, listType: 'ol' }) })) })));
87
39
  };
88
- export { Ul, Ol, Li, ListWrapper };
40
+ export { Li, Ol, Ul };
@@ -4,15 +4,15 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
4
4
  };
5
5
  import styled, { css } from '../../styled.native';
6
6
  import { pxToNumber } from '../../utils';
7
- export var UlBullet = styled.View(function (_a) {
8
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, _c = _a.visible, visible = _c === void 0 ? true : _c, smallAndUp = _a.smallAndUp;
7
+ export var SquareBullet = styled.View(function (_a) {
8
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, visible = _a.visible, smallAndUp = _a.smallAndUp;
9
9
  var lineHeight = smallAndUp
10
10
  ? core.lineHeight.body.large
11
11
  : core.lineHeight.body.small;
12
12
  var topMargin = (pxToNumber(lineHeight) - pxToNumber(core.space[2])) / 2;
13
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "], ["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "])), core.space[2], topMargin, core.space[2], core.space[2], visible ? semantic.message.base : 'transparent');
13
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-self: flex-start;\n width: ", ";\n height: ", ";\n margin-right: ", ";\n margin-top: ", "px;\n background-color: ", ";\n "], ["\n align-self: flex-start;\n width: ", ";\n height: ", ";\n margin-right: ", ";\n margin-top: ", "px;\n background-color: ", ";\n "])), core.space[2], core.space[2], core.space[2], topMargin, visible ? semantic.message.base : 'transparent');
14
14
  });
15
- export var StyledBullet = styled.Text(function (_a) {
15
+ export var TextBullet = styled.Text(function (_a) {
16
16
  var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
17
17
  var fontSize = smallAndUp
18
18
  ? core.fontSize.body.large
@@ -20,25 +20,8 @@ export var StyledBullet = styled.Text(function (_a) {
20
20
  var lineHeight = smallAndUp
21
21
  ? core.lineHeight.body.large
22
22
  : core.lineHeight.body.small;
23
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n text-align: left;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n text-align: left;\n "])), core.fontFamily.body.native, lineHeight, semantic.message.base, fontSize, core.space[1]);
23
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-right: ", ";\n min-width: ", ";\n min-height: ", ";\n font-size: ", ";\n line-height: ", ";\n text-align: left;\n color: ", ";\n "], ["\n margin-right: ", ";\n min-width: ", ";\n min-height: ", ";\n font-size: ", ";\n line-height: ", ";\n text-align: left;\n color: ", ";\n "])), core.space[1], core.space[3], core.space[3], fontSize, lineHeight, semantic.message.base);
24
24
  });
25
- export var StyledUlItem = styled.View(function (_a) {
26
- var core = _a.theme.core, level = _a.level;
27
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: flex-start;\n justify-content: flex-start;\n padding-left: ", ";\n "], ["\n flex-direction: row;\n align-items: flex-start;\n justify-content: flex-start;\n padding-left: ", ";\n "])), core.space[level]);
28
- });
29
- export var StyledOlItem = StyledUlItem;
30
- export var StyledList = styled.View(function (_a) {
31
- var core = _a.theme.core, smallAndUp = _a.smallAndUp;
32
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: column;\n flex: 1;\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n flex-direction: column;\n flex: 1;\n margin-top: ", ";\n margin-bottom: ", ";\n "])), smallAndUp ? core.space[3] : core.space[2], smallAndUp ? core.space[3] : core.space[2]);
33
- });
34
- export var StyledLi = styled.Text(function (_a) {
35
- var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
36
- var fontSize = smallAndUp
37
- ? core.fontSize.body.large
38
- : core.fontSize.body.small;
39
- var lineHeight = smallAndUp
40
- ? core.lineHeight.body.large
41
- : core.lineHeight.body.large;
42
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), core.fontFamily.body.native, lineHeight, semantic.message.base, fontSize);
43
- });
44
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
25
+ export var FlexRow = styled.View(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
26
+ export var LiContent = styled.View(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: column;\n flex: 1;\n"], ["\n flex-direction: column;\n flex: 1;\n"])));
27
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -23,11 +23,13 @@ import { P } from '../P';
23
23
  import { Strong } from '../Strong';
24
24
  var SelectInput = styled.TouchableOpacity(function (_a) {
25
25
  var _b = _a.theme, semantic = _b.semantic, core = _b.core, hasError = _a.hasError;
26
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-color: ", ";\n border-width: ", "\n border-radius: ", ";\n padding-vertical: ", "\n padding-left: ", "\n padding-right: 14px;\n height: 44px;\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-color: ", ";\n border-width: ", "\n border-radius: ", ";\n padding-vertical: ", "\n padding-left: ", "\n padding-right: 14px;\n height: 44px;\n "])), core.color.brand.white, hasError ? semantic.error.border : semantic.border.functional, core.borderWidth.small, core.radius.small, core.space[2], core.space[2]);
26
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n padding: ", ";\n padding-right: 14px;\n height: 44px;\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n padding: ", ";\n padding-right: 14px;\n height: 44px;\n "])), core.color.brand.white, hasError
27
+ ? semantic.error.border
28
+ : semantic.border.functional, core.borderWidth.small, core.radius.small, core.space[2]);
27
29
  });
28
30
  var DropdownWrapper = styled.View(function (_a) {
29
31
  var core = _a.theme.core;
30
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n justify-content: center;\n align-items: center;\n // 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4\n background-color: ", "40;\n "], ["\n flex: 1;\n justify-content: center;\n align-items: center;\n // 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4\n background-color: ", "40;\n "])), core.color.neutral.darkest);
32
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n justify-content: center;\n align-items: center;\n /* 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 */\n background-color: ", "40;\n "], ["\n flex: 1;\n justify-content: center;\n align-items: center;\n /* 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 */\n background-color: ", "40;\n "])), core.color.neutral.darkest);
31
33
  });
32
34
  var DropdownContainer = styled.SafeAreaView(function (_a) {
33
35
  var core = _a.theme.core;
@@ -53,7 +55,7 @@ var StyledP = styled(P)(function (_a) {
53
55
  });
54
56
  var StyledCategory = styled(P)(function (_a) {
55
57
  var _b = _a.theme, core = _b.core, semantic = _b.semantic;
56
- return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-size: ", ";\n color: ", "\n background-color: ", ";\n padding-horizontal: ", ";\n padding-vertical: ", ";\n "], ["\n font-size: ", ";\n color: ", "\n background-color: ", ";\n padding-horizontal: ", ";\n padding-vertical: ", ";\n "])), core.fontSize.label.large, semantic.message.secondary, semantic.surface.cutout, core.space[4], core.space[1]);
58
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n padding-horizontal: ", ";\n padding-vertical: ", ";\n "], ["\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n padding-horizontal: ", ";\n padding-vertical: ", ";\n "])), core.fontSize.label.large, semantic.message.secondary, semantic.surface.cutout, core.space[4], core.space[1]);
57
59
  });
58
60
  export var Select = function (_a) {
59
61
  var _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.defaultSelected, defaultSelected = _c === void 0 ? { label: '', value: 'default' } : _c, _d = _a.noOptionMessage, noOptionMessage = _d === void 0 ? 'No option selected' : _d, _e = _a.onSelected, onSelected = _e === void 0 ? function () { return null; } : _e, _f = _a.hasError, hasError = _f === void 0 ? false : _f, _g = _a.testID, testID = _g === void 0 ? 'select' : _g;
@@ -0,0 +1,55 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { useContext, useEffect } from 'react';
14
+ import Animated, { cancelAnimation, Easing, useAnimatedStyle, useSharedValue, withRepeat, withTiming, } from 'react-native-reanimated';
15
+ import Svg, { Rect } from 'react-native-svg';
16
+ import { ThemeContext } from '../../styled.native';
17
+ var semanticSizes = {
18
+ large: 65,
19
+ small: 32,
20
+ };
21
+ // based on values in the Figma `y` point is 3.5 times smaller side length, `viewBox` is 1.25 times larger side length
22
+ var calculateSvgProps = function (size) {
23
+ return {
24
+ viewBox: size * 1.25,
25
+ y: size / 3.5,
26
+ };
27
+ };
28
+ export var Spinner = function (_a) {
29
+ var _b = _a.inverted, inverted = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'small' : _c, _d = _a.accessibilityLabel, accessibilityLabel = _d === void 0 ? 'Loading' : _d;
30
+ var core = useContext(ThemeContext).core;
31
+ var rotation = useSharedValue(0);
32
+ var animatedStyles = useAnimatedStyle(function () {
33
+ return {
34
+ transform: [
35
+ // needed for correct 3d animation
36
+ { perspective: 1000 },
37
+ {
38
+ rotateY: "".concat(rotation.value, "deg"),
39
+ },
40
+ ],
41
+ };
42
+ }, [rotation.value]);
43
+ useEffect(function () {
44
+ // rotate svg from right to left on 360deg during 2 seconds and repeat that 200 times
45
+ rotation.value = withRepeat(withTiming(-360, {
46
+ duration: 2000,
47
+ easing: Easing.linear,
48
+ }), 200);
49
+ // cancel animation if component is unmounted
50
+ return function () { return cancelAnimation(rotation); };
51
+ }, []);
52
+ var rectangleSize = size in semanticSizes ? semanticSizes[size] : size;
53
+ var _e = calculateSvgProps(rectangleSize), viewBox = _e.viewBox, y = _e.y;
54
+ return (_jsx(Animated.View, __assign({ style: [{ width: viewBox }, animatedStyles], accessible: true, accessibilityLabel: accessibilityLabel }, { children: _jsx(Svg, __assign({ width: "".concat(viewBox), height: "".concat(viewBox), viewBox: "0 0 ".concat(viewBox, " ").concat(viewBox) }, { children: _jsx(Rect, { y: "".concat(y), width: "".concat(rectangleSize), height: "".concat(rectangleSize), transform: "rotate(-15 0 ".concat(y, ")"), fill: core.color.brand[inverted ? 'white' : 'ovo'] }) })) })));
55
+ };
@@ -0,0 +1 @@
1
+ export { Spinner } from './Spinner';