@draftbit/core 46.7.3 → 46.7.5
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/lib/commonjs/components/Accordion/AccordionItem.js +4 -23
- package/lib/commonjs/components/AnimatedCircularProgress.js +1 -12
- package/lib/commonjs/components/AvatarEdit.js +4 -15
- package/lib/commonjs/components/Button.js +12 -35
- package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/components/DeprecatedButton.js +3 -20
- package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/IconButton.js +4 -2
- package/lib/commonjs/components/Image.js +2 -17
- package/lib/commonjs/components/NumberInput.js +1 -1
- package/lib/commonjs/components/Picker/Picker.js +4 -9
- package/lib/commonjs/components/Portal/PortalHost.js +15 -44
- package/lib/commonjs/components/Portal/PortalManager.js +8 -34
- package/lib/commonjs/components/Pressable.js +2 -2
- package/lib/commonjs/components/ProgressBar.js +7 -37
- package/lib/commonjs/components/Slider.js +4 -21
- package/lib/commonjs/components/Surface.js +2 -14
- package/lib/commonjs/components/TextField.js +28 -76
- package/lib/commonjs/components/Touchable.js +4 -17
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +2 -1
- package/lib/commonjs/index.js +0 -56
- package/lib/commonjs/mappings/Button.js +2 -2
- package/lib/commonjs/mappings/FlashList.js +28 -0
- package/lib/commonjs/mappings/FlatList.js +14 -0
- package/lib/commonjs/mappings/IconButton.js +4 -6
- package/lib/commonjs/mappings/MapView.js +3 -1
- package/lib/commonjs/mappings/ScrollView.js +7 -1
- package/lib/commonjs/mappings/Touchable.js +9 -2
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/commonjs/utilities.js +2 -1
- package/lib/module/components/Button.js +12 -35
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
- package/lib/module/components/Checkbox/context.js +1 -1
- package/lib/module/components/CircleImage.js +1 -16
- package/lib/module/components/DeprecatedCardWrapper.js +1 -18
- package/lib/module/components/Divider.js +1 -18
- package/lib/module/components/Elevation.js +2 -14
- package/lib/module/components/FieldSearchBarFull.js +2 -1
- package/lib/module/components/FormRow.js +2 -17
- package/lib/module/components/IconButton.js +4 -2
- package/lib/module/components/Image.js +2 -18
- package/lib/module/components/Layout.js +21 -42
- package/lib/module/components/NumberInput.js +4 -13
- package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
- package/lib/module/components/Portal/PortalConsumer.js +7 -22
- package/lib/module/components/Pressable.js +2 -2
- package/lib/module/components/RadioButton/RadioButton.js +1 -13
- package/lib/module/components/RadioButton/RadioButtonGroup.js +2 -16
- package/lib/module/components/RadioButton/RadioButtonRow.js +5 -24
- package/lib/module/components/Slider.js +4 -21
- package/lib/module/components/StepIndicator.js +18 -58
- package/lib/module/components/TextField.js +28 -78
- package/lib/module/components/ToggleButton.js +2 -16
- package/lib/module/components/Touchable.js +4 -17
- package/lib/module/constants.js +2 -1
- package/lib/module/index.js +0 -8
- package/lib/module/mappings/Button.js +2 -2
- package/lib/module/mappings/FieldSearchBarFull.js +1 -4
- package/lib/module/mappings/FlashList.js +29 -1
- package/lib/module/mappings/FlatList.js +15 -1
- package/lib/module/mappings/IconButton.js +5 -7
- package/lib/module/mappings/MapView.js +3 -1
- package/lib/module/mappings/ScrollView.js +8 -2
- package/lib/module/mappings/Touchable.js +10 -3
- package/lib/module/styles/overlay.js +3 -1
- package/lib/module/utilities.js +2 -1
- package/lib/typescript/src/components/IconButton.d.ts +2 -0
- package/lib/typescript/src/components/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +60 -0
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +30 -0
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/IconButton.d.ts +20 -10
- package/lib/typescript/src/mappings/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +2 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ScrollView.d.ts +21 -0
- package/lib/typescript/src/mappings/ScrollView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +20 -0
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Button.js +1 -1
- package/src/components/Button.tsx +2 -2
- package/src/components/IconButton.js +2 -2
- package/src/components/IconButton.tsx +6 -2
- package/src/components/NumberInput.js +1 -1
- package/src/components/NumberInput.tsx +1 -1
- package/src/components/Pressable.js +1 -1
- package/src/components/Pressable.tsx +2 -2
- package/src/components/Touchable.js +1 -1
- package/src/components/Touchable.tsx +2 -2
- package/src/index.js +0 -8
- package/src/index.tsx +0 -8
- package/src/mappings/Button.js +2 -2
- package/src/mappings/Button.ts +2 -2
- package/src/mappings/FlashList.js +29 -1
- package/src/mappings/FlashList.ts +33 -0
- package/src/mappings/FlatList.js +15 -1
- package/src/mappings/FlatList.ts +17 -0
- package/src/mappings/IconButton.js +5 -7
- package/src/mappings/IconButton.ts +5 -7
- package/src/mappings/MapView.js +2 -0
- package/src/mappings/MapView.ts +2 -0
- package/src/mappings/ScrollView.js +8 -2
- package/src/mappings/ScrollView.ts +10 -1
- package/src/mappings/Touchable.js +10 -3
- package/src/mappings/Touchable.ts +12 -2
- package/lib/commonjs/components/CardBlock.js +0 -115
- package/lib/commonjs/components/CardContainer.js +0 -138
- package/lib/commonjs/components/CardContainerRating.js +0 -133
- package/lib/commonjs/components/CardContainerShortImage.js +0 -84
- package/lib/commonjs/components/CardInline.js +0 -91
- package/lib/commonjs/components/Carousel.js +0 -130
- package/lib/commonjs/components/Header.js +0 -82
- package/lib/commonjs/components/HeaderLarge.js +0 -38
- package/lib/commonjs/components/HeaderMedium.js +0 -38
- package/lib/commonjs/components/HeaderOverline.js +0 -39
- package/lib/module/components/CardBlock.js +0 -108
- package/lib/module/components/CardContainer.js +0 -121
- package/lib/module/components/CardContainerRating.js +0 -135
- package/lib/module/components/CardContainerShortImage.js +0 -90
- package/lib/module/components/CardInline.js +0 -82
- package/lib/module/components/Carousel.js +0 -120
- package/lib/module/components/Header.js +0 -72
- package/lib/module/components/HeaderLarge.js +0 -28
- package/lib/module/components/HeaderMedium.js +0 -28
- package/lib/module/components/HeaderOverline.js +0 -29
- package/lib/typescript/src/components/CardBlock.d.ts +0 -21
- package/lib/typescript/src/components/CardBlock.d.ts.map +0 -1
- package/lib/typescript/src/components/CardContainer.d.ts +0 -23
- package/lib/typescript/src/components/CardContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/CardContainerRating.d.ts +0 -24
- package/lib/typescript/src/components/CardContainerRating.d.ts.map +0 -1
- package/lib/typescript/src/components/CardContainerShortImage.d.ts +0 -19
- package/lib/typescript/src/components/CardContainerShortImage.d.ts.map +0 -1
- package/lib/typescript/src/components/CardInline.d.ts +0 -20
- package/lib/typescript/src/components/CardInline.d.ts.map +0 -1
- package/lib/typescript/src/components/Carousel.d.ts +0 -15
- package/lib/typescript/src/components/Carousel.d.ts.map +0 -1
- package/lib/typescript/src/components/Header.d.ts +0 -20
- package/lib/typescript/src/components/Header.d.ts.map +0 -1
- package/lib/typescript/src/components/HeaderLarge.d.ts +0 -17
- package/lib/typescript/src/components/HeaderLarge.d.ts.map +0 -1
- package/lib/typescript/src/components/HeaderMedium.d.ts +0 -17
- package/lib/typescript/src/components/HeaderMedium.d.ts.map +0 -1
- package/lib/typescript/src/components/HeaderOverline.d.ts +0 -17
- package/lib/typescript/src/components/HeaderOverline.d.ts.map +0 -1
- package/src/components/CardBlock.js +0 -54
- package/src/components/CardBlock.tsx +0 -127
- package/src/components/CardContainer.js +0 -69
- package/src/components/CardContainer.tsx +0 -165
- package/src/components/CardContainerRating.js +0 -79
- package/src/components/CardContainerRating.tsx +0 -175
- package/src/components/CardContainerShortImage.js +0 -33
- package/src/components/CardContainerShortImage.tsx +0 -101
- package/src/components/CardInline.js +0 -36
- package/src/components/CardInline.tsx +0 -93
- package/src/components/Carousel.js +0 -68
- package/src/components/Carousel.tsx +0 -134
- package/src/components/Header.js +0 -44
- package/src/components/Header.tsx +0 -105
- package/src/components/HeaderLarge.js +0 -7
- package/src/components/HeaderLarge.tsx +0 -40
- package/src/components/HeaderMedium.js +0 -7
- package/src/components/HeaderMedium.tsx +0 -41
- package/src/components/HeaderOverline.js +0 -7
- package/src/components/HeaderOverline.tsx +0 -42
|
@@ -2,6 +2,9 @@ import {
|
|
|
2
2
|
COMPONENT_TYPES,
|
|
3
3
|
createStaticBoolProp,
|
|
4
4
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
5
|
+
Triggers,
|
|
6
|
+
createActionProp,
|
|
7
|
+
createColorProp,
|
|
5
8
|
} from "@draftbit/types";
|
|
6
9
|
|
|
7
10
|
export const SEED_DATA = {
|
|
@@ -11,7 +14,9 @@ export const SEED_DATA = {
|
|
|
11
14
|
category: COMPONENT_TYPES.view,
|
|
12
15
|
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
13
16
|
layout: {},
|
|
17
|
+
triggers: [Triggers.OnRefresh],
|
|
14
18
|
props: {
|
|
19
|
+
onRefresh: createActionProp(),
|
|
15
20
|
horizontal: createStaticBoolProp({
|
|
16
21
|
label: "Horizontal",
|
|
17
22
|
description: "Render your list horizontally",
|
|
@@ -21,7 +26,7 @@ export const SEED_DATA = {
|
|
|
21
26
|
label: "Show Horizontal Scroll Indicator",
|
|
22
27
|
description:
|
|
23
28
|
"When true, shows a horizontal scroll indicator. The default value is true.",
|
|
24
|
-
defaultValue:
|
|
29
|
+
defaultValue: true,
|
|
25
30
|
}),
|
|
26
31
|
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
27
32
|
label: "Show Vertical Scroll Indicator",
|
|
@@ -35,5 +40,9 @@ export const SEED_DATA = {
|
|
|
35
40
|
"When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
36
41
|
defaultValue: true,
|
|
37
42
|
}),
|
|
43
|
+
refreshColor: createColorProp({
|
|
44
|
+
label: "Refreshing Color",
|
|
45
|
+
description: "Color of the refresh indicator",
|
|
46
|
+
}),
|
|
38
47
|
},
|
|
39
48
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, createDisabledProp, GROUPS, createStaticBoolProp, } from "@draftbit/types";
|
|
2
2
|
const SEED_DATA_PROPS = {
|
|
3
3
|
stylesPanelSections: [
|
|
4
4
|
StylesPanelSections.Size,
|
|
@@ -10,10 +10,11 @@ const SEED_DATA_PROPS = {
|
|
|
10
10
|
props: {
|
|
11
11
|
onPress: createActionProp(),
|
|
12
12
|
onLongPress: createActionProp(),
|
|
13
|
+
disabled: createDisabledProp(),
|
|
13
14
|
activeOpacity: createStaticNumberProp({
|
|
14
15
|
label: "Active Opacity",
|
|
15
16
|
description: "The opacity when the button is pressed.",
|
|
16
|
-
defaultValue:
|
|
17
|
+
defaultValue: null,
|
|
17
18
|
min: 0,
|
|
18
19
|
max: 1,
|
|
19
20
|
step: 0.01,
|
|
@@ -23,7 +24,7 @@ const SEED_DATA_PROPS = {
|
|
|
23
24
|
disabledOpacity: createStaticNumberProp({
|
|
24
25
|
label: "Disabled Opacity",
|
|
25
26
|
description: "The opacity when the button is disabled.",
|
|
26
|
-
defaultValue:
|
|
27
|
+
defaultValue: null,
|
|
27
28
|
min: 0,
|
|
28
29
|
max: 1,
|
|
29
30
|
step: 0.01,
|
|
@@ -40,6 +41,12 @@ const SEED_DATA_PROPS = {
|
|
|
40
41
|
description: "Sets additional distance outside of element in which a press can be detected.",
|
|
41
42
|
required: false,
|
|
42
43
|
}),
|
|
44
|
+
android_disableSound: createStaticBoolProp({
|
|
45
|
+
label: "Disable Sound",
|
|
46
|
+
description: "Disable the Android sound effect.",
|
|
47
|
+
defaultValue: null,
|
|
48
|
+
group: GROUPS.android,
|
|
49
|
+
}),
|
|
43
50
|
},
|
|
44
51
|
};
|
|
45
52
|
export const SEED_DATA = [
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
Triggers,
|
|
5
5
|
createStaticNumberProp,
|
|
6
6
|
StylesPanelSections,
|
|
7
|
+
createDisabledProp,
|
|
8
|
+
GROUPS,
|
|
9
|
+
createStaticBoolProp,
|
|
7
10
|
} from "@draftbit/types";
|
|
8
11
|
|
|
9
12
|
const SEED_DATA_PROPS = {
|
|
@@ -17,10 +20,11 @@ const SEED_DATA_PROPS = {
|
|
|
17
20
|
props: {
|
|
18
21
|
onPress: createActionProp(),
|
|
19
22
|
onLongPress: createActionProp(),
|
|
23
|
+
disabled: createDisabledProp(),
|
|
20
24
|
activeOpacity: createStaticNumberProp({
|
|
21
25
|
label: "Active Opacity",
|
|
22
26
|
description: "The opacity when the button is pressed.",
|
|
23
|
-
defaultValue:
|
|
27
|
+
defaultValue: null,
|
|
24
28
|
min: 0,
|
|
25
29
|
max: 1,
|
|
26
30
|
step: 0.01,
|
|
@@ -30,7 +34,7 @@ const SEED_DATA_PROPS = {
|
|
|
30
34
|
disabledOpacity: createStaticNumberProp({
|
|
31
35
|
label: "Disabled Opacity",
|
|
32
36
|
description: "The opacity when the button is disabled.",
|
|
33
|
-
defaultValue:
|
|
37
|
+
defaultValue: null,
|
|
34
38
|
min: 0,
|
|
35
39
|
max: 1,
|
|
36
40
|
step: 0.01,
|
|
@@ -49,6 +53,12 @@ const SEED_DATA_PROPS = {
|
|
|
49
53
|
"Sets additional distance outside of element in which a press can be detected.",
|
|
50
54
|
required: false,
|
|
51
55
|
}),
|
|
56
|
+
android_disableSound: createStaticBoolProp({
|
|
57
|
+
label: "Disable Sound",
|
|
58
|
+
description: "Disable the Android sound effect.",
|
|
59
|
+
defaultValue: null,
|
|
60
|
+
group: GROUPS.android,
|
|
61
|
+
}),
|
|
52
62
|
},
|
|
53
63
|
};
|
|
54
64
|
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _Image = _interopRequireDefault(require("./Image"));
|
|
10
|
-
var _DeprecatedCardWrapper = _interopRequireDefault(require("./DeprecatedCardWrapper"));
|
|
11
|
-
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
12
|
-
var _theming = require("../theming");
|
|
13
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const CardBlock = _ref => {
|
|
16
|
-
let {
|
|
17
|
-
image = _Config.default.cardImageUrl,
|
|
18
|
-
title,
|
|
19
|
-
leftDescription,
|
|
20
|
-
rightDescription,
|
|
21
|
-
titleCentered,
|
|
22
|
-
aspectRatio = 1.5,
|
|
23
|
-
elevation = 2,
|
|
24
|
-
numColumns = 3,
|
|
25
|
-
theme: {
|
|
26
|
-
colors,
|
|
27
|
-
roundness,
|
|
28
|
-
typography
|
|
29
|
-
},
|
|
30
|
-
style,
|
|
31
|
-
onPress,
|
|
32
|
-
...rest
|
|
33
|
-
} = _ref;
|
|
34
|
-
let titleJustification;
|
|
35
|
-
let titleStyle;
|
|
36
|
-
if (titleCentered && !leftDescription && !rightDescription) {
|
|
37
|
-
titleJustification = "center";
|
|
38
|
-
} else {
|
|
39
|
-
titleJustification = "space-between";
|
|
40
|
-
}
|
|
41
|
-
if (numColumns === 1) {
|
|
42
|
-
titleStyle = typography.button;
|
|
43
|
-
} else if (numColumns === 2) {
|
|
44
|
-
titleStyle = typography.headline6;
|
|
45
|
-
} else {
|
|
46
|
-
titleStyle = typography.headline5;
|
|
47
|
-
}
|
|
48
|
-
const rightDescriptionStyles = [typography.subtitle2, {
|
|
49
|
-
color: colors.light
|
|
50
|
-
}];
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
|
|
52
|
-
style: style,
|
|
53
|
-
onPress: onPress,
|
|
54
|
-
numColumns: numColumns,
|
|
55
|
-
...rest
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
57
|
-
style: {
|
|
58
|
-
backgroundColor: colors.background
|
|
59
|
-
}
|
|
60
|
-
}, /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
61
|
-
style: {
|
|
62
|
-
elevation,
|
|
63
|
-
borderRadius: roundness
|
|
64
|
-
}
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement(_Image.default, {
|
|
66
|
-
style: {
|
|
67
|
-
borderRadius: roundness,
|
|
68
|
-
aspectRatio
|
|
69
|
-
},
|
|
70
|
-
source: typeof image === "string" ? {
|
|
71
|
-
uri: image
|
|
72
|
-
} : image,
|
|
73
|
-
resizeMode: "cover"
|
|
74
|
-
})), title ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
75
|
-
style: {
|
|
76
|
-
flexDirection: "row",
|
|
77
|
-
alignItems: "center",
|
|
78
|
-
justifyContent: titleJustification,
|
|
79
|
-
marginTop: numColumns === 3 ? 16 : 12
|
|
80
|
-
}
|
|
81
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
82
|
-
numberOfLines: 1,
|
|
83
|
-
style: [titleStyle, {
|
|
84
|
-
color: colors.strong
|
|
85
|
-
}]
|
|
86
|
-
}, title), !leftDescription && rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
87
|
-
style: rightDescriptionStyles
|
|
88
|
-
}, rightDescription) : null) : null, leftDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
89
|
-
style: {
|
|
90
|
-
flexDirection: "row",
|
|
91
|
-
justifyContent: "space-between",
|
|
92
|
-
alignItems: "center",
|
|
93
|
-
marginTop: numColumns === 3 ? 4 : 4 / 2
|
|
94
|
-
}
|
|
95
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
96
|
-
numberOfLines: 1,
|
|
97
|
-
style: [typography.body2, {
|
|
98
|
-
color: colors.medium
|
|
99
|
-
}]
|
|
100
|
-
}, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
101
|
-
numberOfLines: 1,
|
|
102
|
-
style: rightDescriptionStyles
|
|
103
|
-
}, rightDescription) : null) : null));
|
|
104
|
-
};
|
|
105
|
-
var _default = (0, _theming.withTheme)(CardBlock);
|
|
106
|
-
exports.default = _default;yle: [typography.body2, {
|
|
107
|
-
color: colors.medium
|
|
108
|
-
}]
|
|
109
|
-
}, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
110
|
-
numberOfLines: 1,
|
|
111
|
-
style: rightDescriptionStyles
|
|
112
|
-
}, rightDescription) : null) : null));
|
|
113
|
-
};
|
|
114
|
-
var _default = (0, _theming.withTheme)(CardBlock);
|
|
115
|
-
exports.default = _default;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _color = _interopRequireDefault(require("color"));
|
|
10
|
-
var _Image = _interopRequireDefault(require("./Image"));
|
|
11
|
-
var _DeprecatedCardWrapper = _interopRequireDefault(require("./DeprecatedCardWrapper"));
|
|
12
|
-
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
13
|
-
var _theming = require("../theming");
|
|
14
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
const ICON_CONTAINER_SIZE = _Config.default.cardIconSize * 2;
|
|
17
|
-
const ICON_CONTAINER_PADDING = _Config.default.cardIconSize / 2 - 1;
|
|
18
|
-
const CardContainer = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
Icon,
|
|
21
|
-
icon,
|
|
22
|
-
image = _Config.default.cardImageUrl,
|
|
23
|
-
title,
|
|
24
|
-
leftDescription,
|
|
25
|
-
rightDescription,
|
|
26
|
-
textCentered,
|
|
27
|
-
aspectRatio = 1.5,
|
|
28
|
-
elevation = 2,
|
|
29
|
-
numColumns = 3,
|
|
30
|
-
theme: {
|
|
31
|
-
colors,
|
|
32
|
-
roundness,
|
|
33
|
-
typography
|
|
34
|
-
},
|
|
35
|
-
style,
|
|
36
|
-
onPress,
|
|
37
|
-
...rest
|
|
38
|
-
} = _ref;
|
|
39
|
-
let textJustification;
|
|
40
|
-
let titleStyle;
|
|
41
|
-
if (textCentered && !rightDescription) {
|
|
42
|
-
textJustification = "center";
|
|
43
|
-
} else {
|
|
44
|
-
textJustification = "space-between";
|
|
45
|
-
}
|
|
46
|
-
switch (numColumns) {
|
|
47
|
-
case 2:
|
|
48
|
-
titleStyle = typography.headline6;
|
|
49
|
-
break;
|
|
50
|
-
case 3:
|
|
51
|
-
titleStyle = typography.headline5;
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
|
|
55
|
-
style: style,
|
|
56
|
-
onPress: onPress,
|
|
57
|
-
numColumns: numColumns,
|
|
58
|
-
...rest
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
60
|
-
style: {
|
|
61
|
-
elevation,
|
|
62
|
-
borderRadius: roundness
|
|
63
|
-
}
|
|
64
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
65
|
-
style: {
|
|
66
|
-
borderRadius: roundness,
|
|
67
|
-
overflow: "hidden",
|
|
68
|
-
backgroundColor: colors.surface
|
|
69
|
-
}
|
|
70
|
-
}, /*#__PURE__*/_react.default.createElement(_Image.default, {
|
|
71
|
-
style: {
|
|
72
|
-
aspectRatio
|
|
73
|
-
},
|
|
74
|
-
source: typeof image === "string" ? {
|
|
75
|
-
uri: image
|
|
76
|
-
} : image,
|
|
77
|
-
resizeMode: "cover"
|
|
78
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
79
|
-
style: {
|
|
80
|
-
padding: numColumns === 1 ? 8 : 16
|
|
81
|
-
}
|
|
82
|
-
}, title ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
83
|
-
style: {
|
|
84
|
-
flexDirection: "row",
|
|
85
|
-
alignItems: "center",
|
|
86
|
-
justifyContent: textJustification
|
|
87
|
-
}
|
|
88
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
89
|
-
numberOfLines: 1,
|
|
90
|
-
style: [titleStyle, {
|
|
91
|
-
color: colors.strong
|
|
92
|
-
}]
|
|
93
|
-
}, title)) : null, leftDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
94
|
-
style: {
|
|
95
|
-
flexDirection: "row",
|
|
96
|
-
justifyContent: textJustification,
|
|
97
|
-
alignItems: "center",
|
|
98
|
-
marginTop: numColumns === 3 ? 4 : 4 / 2
|
|
99
|
-
}
|
|
100
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
101
|
-
numberOfLines: 1,
|
|
102
|
-
style: [typography.body2, {
|
|
103
|
-
color: colors.medium
|
|
104
|
-
}]
|
|
105
|
-
}, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
106
|
-
numberOfLines: 1,
|
|
107
|
-
style: [typography.subtitle2, {
|
|
108
|
-
color: colors.light
|
|
109
|
-
}]
|
|
110
|
-
}, rightDescription) : null) : null), icon ? /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
111
|
-
style: {
|
|
112
|
-
elevation: _Config.default.cardIconElevation,
|
|
113
|
-
position: "absolute",
|
|
114
|
-
top: 12,
|
|
115
|
-
right: 12,
|
|
116
|
-
width: ICON_CONTAINER_SIZE,
|
|
117
|
-
height: ICON_CONTAINER_SIZE,
|
|
118
|
-
padding: ICON_CONTAINER_PADDING,
|
|
119
|
-
borderRadius: ICON_CONTAINER_SIZE,
|
|
120
|
-
backgroundColor: (0, _color.default)(colors.strong).alpha(_Config.default.cardIconBackgroundOpacity).rgb().string()
|
|
121
|
-
}
|
|
122
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
123
|
-
name: icon,
|
|
124
|
-
size: _Config.default.cardIconSize,
|
|
125
|
-
color: colors.surface
|
|
126
|
-
})) : null)));
|
|
127
|
-
};
|
|
128
|
-
var _default = (0, _theming.withTheme)(CardContainer);
|
|
129
|
-
exports.default = _default;0, _color.default)(colors.strong).alpha(_Config.default.cardIconBackgroundOpacity).rgb().string()
|
|
130
|
-
}
|
|
131
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
132
|
-
name: icon,
|
|
133
|
-
size: _Config.default.cardIconSize,
|
|
134
|
-
color: colors.surface
|
|
135
|
-
})) : null)));
|
|
136
|
-
};
|
|
137
|
-
var _default = (0, _theming.withTheme)(CardContainer);
|
|
138
|
-
exports.default = _default;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _color = _interopRequireDefault(require("color"));
|
|
10
|
-
var _Image = _interopRequireDefault(require("./Image"));
|
|
11
|
-
var _DeprecatedCardWrapper = _interopRequireDefault(require("./DeprecatedCardWrapper"));
|
|
12
|
-
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
13
|
-
var _StarRating = _interopRequireDefault(require("./StarRating"));
|
|
14
|
-
var _theming = require("../theming");
|
|
15
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
|
-
const ICON_CONTAINER_SIZE = _Config.default.cardIconSize * 2;
|
|
19
|
-
const ICON_CONTAINER_PADDING = _Config.default.cardIconSize / 2 - 1;
|
|
20
|
-
const CardContainerRating = _ref => {
|
|
21
|
-
let {
|
|
22
|
-
Icon,
|
|
23
|
-
icon,
|
|
24
|
-
image = _Config.default.cardImageUrl,
|
|
25
|
-
title,
|
|
26
|
-
leftDescription,
|
|
27
|
-
rightDescription,
|
|
28
|
-
rating,
|
|
29
|
-
aspectRatio = 1.5,
|
|
30
|
-
elevation = 2,
|
|
31
|
-
numColumns = 3,
|
|
32
|
-
theme: {
|
|
33
|
-
colors,
|
|
34
|
-
roundness,
|
|
35
|
-
typography
|
|
36
|
-
},
|
|
37
|
-
style,
|
|
38
|
-
onPress,
|
|
39
|
-
...rest
|
|
40
|
-
} = _ref;
|
|
41
|
-
let titleStyle, rightDescriptionStyle;
|
|
42
|
-
switch (numColumns) {
|
|
43
|
-
case 2:
|
|
44
|
-
titleStyle = typography.headline6;
|
|
45
|
-
rightDescriptionStyle = typography.body2;
|
|
46
|
-
break;
|
|
47
|
-
case 3:
|
|
48
|
-
titleStyle = typography.headline5;
|
|
49
|
-
rightDescriptionStyle = typography.caption;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
|
|
53
|
-
style: style,
|
|
54
|
-
onPress: onPress,
|
|
55
|
-
numColumns: numColumns
|
|
56
|
-
}, rest), /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
57
|
-
style: {
|
|
58
|
-
elevation,
|
|
59
|
-
borderRadius: roundness
|
|
60
|
-
}
|
|
61
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
62
|
-
style: {
|
|
63
|
-
borderRadius: roundness,
|
|
64
|
-
overflow: "hidden",
|
|
65
|
-
backgroundColor: colors.background
|
|
66
|
-
//background color is needed for bug on android 9 - https://github.com/facebook/react-native/issues/25093
|
|
67
|
-
}
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement(_Image.default, {
|
|
69
|
-
style: {
|
|
70
|
-
aspectRatio
|
|
71
|
-
},
|
|
72
|
-
source: typeof image === "string" ? {
|
|
73
|
-
uri: image
|
|
74
|
-
} : image,
|
|
75
|
-
resizeMode: "cover"
|
|
76
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
77
|
-
style: {
|
|
78
|
-
padding: numColumns === 1 ? 8 : 16
|
|
79
|
-
}
|
|
80
|
-
}, title ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
81
|
-
style: {
|
|
82
|
-
flexDirection: "row",
|
|
83
|
-
alignItems: "center",
|
|
84
|
-
justifyContent: "space-between"
|
|
85
|
-
}
|
|
86
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
87
|
-
numberOfLines: 1,
|
|
88
|
-
style: [titleStyle, {
|
|
89
|
-
color: colors.strong
|
|
90
|
-
}]
|
|
91
|
-
}, title)) : null, leftDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
92
|
-
numberOfLines: 1,
|
|
93
|
-
style: [typography.body2, {
|
|
94
|
-
color: colors.medium,
|
|
95
|
-
marginTop: numColumns === 3 ? 4 : 4 / 2
|
|
96
|
-
}]
|
|
97
|
-
}, leftDescription) : null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
98
|
-
style: {
|
|
99
|
-
flexDirection: "row",
|
|
100
|
-
justifyContent: "space-between",
|
|
101
|
-
alignItems: "center",
|
|
102
|
-
marginTop: numColumns === 3 ? 16 : 12
|
|
103
|
-
}
|
|
104
|
-
}, /*#__PURE__*/_react.default.createElement(_StarRating.default, {
|
|
105
|
-
Icon: Icon,
|
|
106
|
-
starSize: numColumns === 1 ? 10 : 16,
|
|
107
|
-
rating: rating
|
|
108
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
109
|
-
style: [rightDescriptionStyle, {
|
|
110
|
-
color: colors.medium,
|
|
111
|
-
marginLeft: 8
|
|
112
|
-
}],
|
|
113
|
-
numberOfLines: 1
|
|
114
|
-
}, rightDescription))), icon ? /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
115
|
-
style: {
|
|
116
|
-
elevation: _Config.default.cardIconElevation,
|
|
117
|
-
position: "absolute",
|
|
118
|
-
top: 12,
|
|
119
|
-
right: 12,
|
|
120
|
-
width: ICON_CONTAINER_SIZE,
|
|
121
|
-
height: ICON_CONTAINER_SIZE,
|
|
122
|
-
padding: ICON_CONTAINER_PADDING,
|
|
123
|
-
borderRadius: ICON_CONTAINER_SIZE,
|
|
124
|
-
backgroundColor: (0, _color.default)(colors.strong).alpha(_Config.default.cardIconBackgroundOpacity).rgb().string()
|
|
125
|
-
}
|
|
126
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
127
|
-
name: icon,
|
|
128
|
-
size: _Config.default.cardIconSize,
|
|
129
|
-
color: colors.surface
|
|
130
|
-
})) : null)));
|
|
131
|
-
};
|
|
132
|
-
var _default = (0, _theming.withTheme)(CardContainerRating);
|
|
133
|
-
exports.default = _default;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _Image = _interopRequireDefault(require("./Image"));
|
|
10
|
-
var _DeprecatedCardWrapper = _interopRequireDefault(require("./DeprecatedCardWrapper"));
|
|
11
|
-
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
12
|
-
var _theming = require("../theming");
|
|
13
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
-
const CardContainerShortImage = _ref => {
|
|
17
|
-
let {
|
|
18
|
-
image = _Config.default.squareImageUrl,
|
|
19
|
-
title,
|
|
20
|
-
subtitle,
|
|
21
|
-
mode = "left",
|
|
22
|
-
aspectRatio = 1,
|
|
23
|
-
elevation = 2,
|
|
24
|
-
theme: {
|
|
25
|
-
colors,
|
|
26
|
-
roundness,
|
|
27
|
-
typography
|
|
28
|
-
},
|
|
29
|
-
style,
|
|
30
|
-
onPress,
|
|
31
|
-
...rest
|
|
32
|
-
} = _ref;
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
|
|
34
|
-
style: style,
|
|
35
|
-
onPress: onPress
|
|
36
|
-
}, rest), /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
37
|
-
style: {
|
|
38
|
-
elevation,
|
|
39
|
-
borderRadius: roundness
|
|
40
|
-
}
|
|
41
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
42
|
-
style: {
|
|
43
|
-
overflow: "hidden",
|
|
44
|
-
flexDirection: "row",
|
|
45
|
-
justifyContent: mode === "right" ? "space-between" : "flex-start",
|
|
46
|
-
borderRadius: roundness
|
|
47
|
-
}
|
|
48
|
-
}, mode === "left" && /*#__PURE__*/_react.default.createElement(_Image.default, {
|
|
49
|
-
style: {
|
|
50
|
-
aspectRatio
|
|
51
|
-
},
|
|
52
|
-
source: typeof image === "string" ? {
|
|
53
|
-
uri: image
|
|
54
|
-
} : image,
|
|
55
|
-
resizeMode: "cover"
|
|
56
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
57
|
-
style: {
|
|
58
|
-
padding: 16,
|
|
59
|
-
backgroundColor: colors.surface,
|
|
60
|
-
flex: 1
|
|
61
|
-
}
|
|
62
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
63
|
-
numberOfLines: 1,
|
|
64
|
-
style: [typography.headline5, {
|
|
65
|
-
color: colors.strong
|
|
66
|
-
}]
|
|
67
|
-
}, title), subtitle ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
68
|
-
numberOfLines: 1,
|
|
69
|
-
style: [typography.body2, {
|
|
70
|
-
color: colors.medium,
|
|
71
|
-
marginTop: 4
|
|
72
|
-
}]
|
|
73
|
-
}, subtitle) : null), mode === "right" && /*#__PURE__*/_react.default.createElement(_Image.default, {
|
|
74
|
-
style: {
|
|
75
|
-
aspectRatio
|
|
76
|
-
},
|
|
77
|
-
source: typeof image === "string" ? {
|
|
78
|
-
uri: image
|
|
79
|
-
} : image,
|
|
80
|
-
resizeMode: "cover"
|
|
81
|
-
}))));
|
|
82
|
-
};
|
|
83
|
-
var _default = (0, _theming.withTheme)(CardContainerShortImage);
|
|
84
|
-
exports.default = _default;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _Typography = require("./Typography");
|
|
10
|
-
var _Image = _interopRequireDefault(require("./Image"));
|
|
11
|
-
var _Surface = _interopRequireDefault(require("./Surface"));
|
|
12
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
13
|
-
var _theming = require("../theming");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
// @ts-nocheck
|
|
16
|
-
|
|
17
|
-
const CardInline = _ref => {
|
|
18
|
-
let {
|
|
19
|
-
image = _Config.default.cardImageUrl,
|
|
20
|
-
title,
|
|
21
|
-
subtitle,
|
|
22
|
-
aspectRatio = 1.5,
|
|
23
|
-
elevation = 2,
|
|
24
|
-
style,
|
|
25
|
-
titleStyle,
|
|
26
|
-
subtitleStyle,
|
|
27
|
-
onPress
|
|
28
|
-
} = _ref;
|
|
29
|
-
const {
|
|
30
|
-
alignItems,
|
|
31
|
-
justifyContent,
|
|
32
|
-
width,
|
|
33
|
-
height
|
|
34
|
-
} = _reactNative.StyleSheet.flatten(style || {});
|
|
35
|
-
const imageStyles = width && height ? {
|
|
36
|
-
width,
|
|
37
|
-
height
|
|
38
|
-
} : {
|
|
39
|
-
aspectRatio
|
|
40
|
-
};
|
|
41
|
-
return /*#__PURE__*/_react.default.createElement(_Surface.default, {
|
|
42
|
-
style: [{
|
|
43
|
-
elevation
|
|
44
|
-
}, style]
|
|
45
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
46
|
-
disabled: !onPress,
|
|
47
|
-
onPress: onPress,
|
|
48
|
-
style: _ref2 => {
|
|
49
|
-
let {
|
|
50
|
-
pressed
|
|
51
|
-
} = _ref2;
|
|
52
|
-
return [{
|
|
53
|
-
opacity: pressed ? 0.8 : 1
|
|
54
|
-
}];
|
|
55
|
-
}
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(_Image.default, {
|
|
57
|
-
style: imageStyles,
|
|
58
|
-
source: typeof image === "string" ? {
|
|
59
|
-
uri: image
|
|
60
|
-
} : image,
|
|
61
|
-
resizeMode: "cover"
|
|
62
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
63
|
-
style: [styles.overlay, {
|
|
64
|
-
justifyContent,
|
|
65
|
-
alignItems
|
|
66
|
-
}]
|
|
67
|
-
}, title ? /*#__PURE__*/_react.default.createElement(_Typography.Title, {
|
|
68
|
-
style: [{
|
|
69
|
-
color: "white"
|
|
70
|
-
}, titleStyle],
|
|
71
|
-
text: title
|
|
72
|
-
}) : null, subtitle ? /*#__PURE__*/_react.default.createElement(_Typography.Subtitle, {
|
|
73
|
-
style: [{
|
|
74
|
-
color: "rgba(255, 255, 255, 0.7)"
|
|
75
|
-
}, subtitleStyle],
|
|
76
|
-
text: subtitle
|
|
77
|
-
}) : null)));
|
|
78
|
-
};
|
|
79
|
-
const styles = _reactNative.StyleSheet.create({
|
|
80
|
-
overlay: {
|
|
81
|
-
position: "absolute",
|
|
82
|
-
top: 0,
|
|
83
|
-
bottom: 0,
|
|
84
|
-
left: 0,
|
|
85
|
-
right: 0,
|
|
86
|
-
padding: 16,
|
|
87
|
-
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
var _default = (0, _theming.withTheme)(CardInline);
|
|
91
|
-
exports.default = _default;
|