@draftbit/core 46.10.3-fb35c9.2 → 46.10.3-fbd333.2
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/BottomSheet/BottomSheetComponent.js +0 -41
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -5
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/DeprecatedCardWrapper.js +40 -0
- package/lib/commonjs/components/DeprecatedFAB.js +157 -0
- package/lib/commonjs/components/Portal/PortalConsumer.js +0 -7
- package/lib/commonjs/components/Portal/PortalHost.js +0 -1
- package/lib/commonjs/components/ProgressIndicator.js +55 -0
- package/lib/commonjs/components/ResizeMode.js +5 -0
- package/lib/commonjs/components/Text.js +0 -1
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/mappings/CardBlock.js +126 -0
- package/lib/commonjs/mappings/CardContainer.js +108 -0
- package/lib/commonjs/mappings/CardContainerRating.js +130 -0
- package/lib/commonjs/mappings/CardContainerShortImage.js +124 -0
- package/lib/commonjs/mappings/CardInline.js +59 -0
- package/lib/commonjs/mappings/ProgressIndicator.js +188 -0
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +0 -41
- package/lib/module/components/DeprecatedCardWrapper.js +32 -0
- package/lib/module/components/DeprecatedFAB.js +147 -0
- package/lib/module/components/Portal/PortalConsumer.js +0 -7
- package/lib/module/components/Portal/PortalHost.js +0 -1
- package/lib/module/components/Portal/PortalManager.js +7 -33
- package/lib/module/components/ProgressIndicator.js +45 -0
- package/lib/module/components/ResizeMode.js +1 -0
- package/lib/module/components/Text.js +0 -1
- package/lib/module/mappings/CardBlock.js +119 -0
- package/lib/module/mappings/CardContainer.js +101 -0
- package/lib/module/mappings/CardContainerRating.js +123 -0
- package/lib/module/mappings/CardContainerShortImage.js +117 -0
- package/lib/module/mappings/CardInline.js +52 -0
- package/lib/module/mappings/ProgressIndicator.js +181 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts +15 -0
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -0
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +56 -0
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -0
- package/lib/typescript/src/components/ProgressIndicator.d.ts +24 -0
- package/lib/typescript/src/components/ProgressIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/ResizeMode.d.ts +2 -0
- package/lib/typescript/src/components/ResizeMode.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardBlock.d.ts +289 -0
- package/lib/typescript/src/mappings/CardBlock.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainer.d.ts +102 -0
- package/lib/typescript/src/mappings/CardContainer.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainerRating.d.ts +108 -0
- package/lib/typescript/src/mappings/CardContainerRating.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts +139 -0
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts.map +1 -0
- package/lib/typescript/src/mappings/CardInline.d.ts +62 -0
- package/lib/typescript/src/mappings/CardInline.d.ts.map +1 -0
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts +181 -0
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts.map +1 -0
- package/package.json +15 -10
- package/src/components/DeprecatedCardWrapper.js +18 -0
- package/src/components/DeprecatedCardWrapper.tsx +46 -0
- package/src/components/DeprecatedFAB.js +114 -0
- package/src/components/DeprecatedFAB.tsx +231 -0
- package/src/components/ProgressIndicator.js +27 -0
- package/src/components/ProgressIndicator.tsx +71 -0
- package/src/components/ResizeMode.js +1 -0
- package/src/components/ResizeMode.ts +7 -0
- package/src/mappings/CardBlock.js +123 -0
- package/src/mappings/CardBlock.ts +136 -0
- package/src/mappings/CardContainer.js +104 -0
- package/src/mappings/CardContainer.ts +116 -0
- package/src/mappings/CardContainerRating.js +126 -0
- package/src/mappings/CardContainerRating.ts +137 -0
- package/src/mappings/CardContainerShortImage.js +120 -0
- package/src/mappings/CardContainerShortImage.ts +130 -0
- package/src/mappings/CardInline.js +52 -0
- package/src/mappings/CardInline.ts +61 -0
- package/src/mappings/ProgressIndicator.js +181 -0
- package/src/mappings/ProgressIndicator.ts +190 -0
|
@@ -77,22 +77,6 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
77
77
|
* Gesture Handler references
|
|
78
78
|
*/
|
|
79
79
|
|
|
80
|
-
/**
|
|
81
|
-
* ScrollView prop
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Pan gesture handler events for drawer handle and content
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Main Animated Value that drives the top position of the UI drawer at any point in time
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Animated value that keeps track of the position: 0 => closed, 1 => opened
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
80
|
/**
|
|
97
81
|
* Flag to indicate imperative snapping
|
|
98
82
|
*/
|
|
@@ -101,15 +85,6 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
101
85
|
* Manual snapping amount
|
|
102
86
|
*/
|
|
103
87
|
|
|
104
|
-
/**
|
|
105
|
-
* Keeps track of the current index
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Deceleration rate of the scroll component. This is used only on Android to
|
|
110
|
-
* compensate the unexpected glide it gets sometimes.
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
88
|
constructor(props) {
|
|
114
89
|
var _props$animationConfi, _this;
|
|
115
90
|
super(props);
|
|
@@ -118,15 +93,8 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
118
93
|
_defineProperty(this, "drawerHandleRef", /*#__PURE__*/_react.default.createRef());
|
|
119
94
|
_defineProperty(this, "drawerContentRef", /*#__PURE__*/_react.default.createRef());
|
|
120
95
|
_defineProperty(this, "scrollComponentRef", /*#__PURE__*/_react.default.createRef());
|
|
121
|
-
_defineProperty(this, "onScrollBeginDrag", void 0);
|
|
122
|
-
_defineProperty(this, "onHandleGestureEvent", void 0);
|
|
123
|
-
_defineProperty(this, "onDrawerGestureEvent", void 0);
|
|
124
|
-
_defineProperty(this, "translateY", void 0);
|
|
125
|
-
_defineProperty(this, "position", void 0);
|
|
126
96
|
_defineProperty(this, "isManuallySetValue", new _reactNativeReanimated.Value(0));
|
|
127
97
|
_defineProperty(this, "manualYOffset", new _reactNativeReanimated.Value(0));
|
|
128
|
-
_defineProperty(this, "nextSnapIndex", void 0);
|
|
129
|
-
_defineProperty(this, "decelerationRate", void 0);
|
|
130
98
|
_defineProperty(this, "prevSnapIndex", -1);
|
|
131
99
|
_defineProperty(this, "dragY", new _reactNativeReanimated.Value(0));
|
|
132
100
|
_defineProperty(this, "prevDragY", new _reactNativeReanimated.Value(0));
|
|
@@ -138,18 +106,9 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
138
106
|
_defineProperty(this, "animationFrameTime", new _reactNativeReanimated.Value(0));
|
|
139
107
|
_defineProperty(this, "velocityY", new _reactNativeReanimated.Value(0));
|
|
140
108
|
_defineProperty(this, "lastStartScrollY", new _reactNativeReanimated.Value(0));
|
|
141
|
-
_defineProperty(this, "prevTranslateYOffset", void 0);
|
|
142
|
-
_defineProperty(this, "translationY", void 0);
|
|
143
109
|
_defineProperty(this, "destSnapPoint", new _reactNativeReanimated.Value(0));
|
|
144
|
-
_defineProperty(this, "lastSnap", void 0);
|
|
145
110
|
_defineProperty(this, "dragWithHandle", new _reactNativeReanimated.Value(0));
|
|
146
111
|
_defineProperty(this, "scrollUpAndPullDown", new _reactNativeReanimated.Value(0));
|
|
147
|
-
_defineProperty(this, "didGestureFinish", void 0);
|
|
148
|
-
_defineProperty(this, "didScrollUpAndPullDown", void 0);
|
|
149
|
-
_defineProperty(this, "setTranslationY", void 0);
|
|
150
|
-
_defineProperty(this, "extraOffset", void 0);
|
|
151
|
-
_defineProperty(this, "calculateNextSnapPoint", void 0);
|
|
152
|
-
_defineProperty(this, "scrollComponent", void 0);
|
|
153
112
|
_defineProperty(this, "convertPercentageToDp", str => Number(str.split("%")[0]) * (windowHeight - this.props.topInset) / 100);
|
|
154
113
|
_defineProperty(this, "getNormalisedSnapPoints", () => {
|
|
155
114
|
return this.props.snapPoints.map(p => {
|
|
@@ -13,8 +13,7 @@ var _utilities = require("../../utilities");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
|
|
17
|
-
let Direction;
|
|
16
|
+
var Direction;
|
|
18
17
|
exports.Direction = Direction;
|
|
19
18
|
(function (Direction) {
|
|
20
19
|
Direction["Row"] = "row";
|
|
@@ -72,13 +71,14 @@ const CheckboxGroupRow = _ref => {
|
|
|
72
71
|
textStyles,
|
|
73
72
|
viewStyles
|
|
74
73
|
} = (0, _utilities.extractStyles)(style);
|
|
75
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
74
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
76
75
|
onPress: handlePress,
|
|
77
76
|
style: [styles.mainParent, {
|
|
78
77
|
flexDirection: direction
|
|
79
78
|
}, viewStyles],
|
|
80
|
-
disabled: disabled
|
|
81
|
-
|
|
79
|
+
disabled: disabled,
|
|
80
|
+
...rest
|
|
81
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
82
82
|
style: [styles.label, {
|
|
83
83
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
84
84
|
}, labelContainerStyle]
|
|
@@ -117,4 +117,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
var _default = CheckboxGroupRow;
|
|
120
|
+
exports.default = _default;center",
|
|
121
|
+
justifyContent: "space-around",
|
|
122
|
+
paddingStart: 20,
|
|
123
|
+
minHeight: 50,
|
|
124
|
+
paddingEnd: 20,
|
|
125
|
+
display: "flex",
|
|
126
|
+
..._reactNative.Platform.select({
|
|
127
|
+
web: {
|
|
128
|
+
cursor: "pointer",
|
|
129
|
+
userSelect: "none"
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
},
|
|
133
|
+
label: {
|
|
134
|
+
flex: 3
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
var _default = CheckboxGroupRow;
|
|
120
138
|
exports.default = _default;
|
|
@@ -14,8 +14,7 @@ var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
|
-
let Direction;
|
|
17
|
+
var Direction;
|
|
19
18
|
exports.Direction = Direction;
|
|
20
19
|
(function (Direction) {
|
|
21
20
|
Direction["Row"] = "row";
|
|
@@ -58,7 +57,6 @@ const CheckboxRow = _ref => {
|
|
|
58
57
|
setInternalValue(status);
|
|
59
58
|
}
|
|
60
59
|
}, [status]);
|
|
61
|
-
|
|
62
60
|
// This special logic is to handle weird APIs like Airtable that return
|
|
63
61
|
// true or undefined for a boolean
|
|
64
62
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -82,13 +80,14 @@ const CheckboxRow = _ref => {
|
|
|
82
80
|
textStyles,
|
|
83
81
|
viewStyles
|
|
84
82
|
} = (0, _utilities.extractStyles)(style);
|
|
85
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
83
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
86
84
|
onPress: handlePress,
|
|
87
85
|
style: [viewStyles, styles.mainParent, {
|
|
88
86
|
flexDirection: direction
|
|
89
87
|
}],
|
|
90
|
-
disabled: disabled
|
|
91
|
-
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
...rest
|
|
90
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
92
91
|
style: [styles.label, {
|
|
93
92
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
94
93
|
}, labelContainerStyle]
|
|
@@ -125,4 +124,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
125
124
|
}
|
|
126
125
|
});
|
|
127
126
|
var _default = CheckboxRow;
|
|
127
|
+
exports.default = _default;ems: "center",
|
|
128
|
+
justifyContent: "space-around",
|
|
129
|
+
paddingStart: 20,
|
|
130
|
+
minHeight: 50,
|
|
131
|
+
paddingEnd: 20,
|
|
132
|
+
display: "flex",
|
|
133
|
+
..._reactNative.Platform.select({
|
|
134
|
+
web: {
|
|
135
|
+
cursor: "pointer",
|
|
136
|
+
userSelect: "none"
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
},
|
|
140
|
+
label: {
|
|
141
|
+
flex: 3
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
var _default = CheckboxRow;
|
|
128
145
|
exports.default = _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 _theming = require("../theming");
|
|
9
|
+
var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
12
|
+
const getWidth = numColumns => {
|
|
13
|
+
switch (numColumns) {
|
|
14
|
+
case 1:
|
|
15
|
+
return "33%";
|
|
16
|
+
case 2:
|
|
17
|
+
return "50%";
|
|
18
|
+
default:
|
|
19
|
+
return "100%";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const Card = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
numColumns = 3,
|
|
25
|
+
children,
|
|
26
|
+
onPress,
|
|
27
|
+
style,
|
|
28
|
+
...rest
|
|
29
|
+
} = _ref;
|
|
30
|
+
const width = getWidth(numColumns);
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
|
|
32
|
+
disabled: !onPress,
|
|
33
|
+
onPress: onPress,
|
|
34
|
+
style: [style, {
|
|
35
|
+
width
|
|
36
|
+
}]
|
|
37
|
+
}, rest), children);
|
|
38
|
+
};
|
|
39
|
+
var _default = (0, _theming.withTheme)(Card);
|
|
40
|
+
exports.default = _default;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _color = _interopRequireDefault(require("color"));
|
|
10
|
+
var _Config = _interopRequireDefault(require("./Config"));
|
|
11
|
+
var _Text = _interopRequireDefault(require("./Text"));
|
|
12
|
+
var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
13
|
+
var _theming = require("../theming");
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
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 FAB = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
Icon,
|
|
21
|
+
icon,
|
|
22
|
+
disabled = false,
|
|
23
|
+
type = "solid",
|
|
24
|
+
loading = false,
|
|
25
|
+
color: colorOverride,
|
|
26
|
+
label,
|
|
27
|
+
onPress,
|
|
28
|
+
elevation = 0,
|
|
29
|
+
style,
|
|
30
|
+
theme: {
|
|
31
|
+
colors,
|
|
32
|
+
disabledOpacity,
|
|
33
|
+
roundness,
|
|
34
|
+
typography
|
|
35
|
+
},
|
|
36
|
+
...rest
|
|
37
|
+
} = _ref;
|
|
38
|
+
let backgroundColor, borderColor, textColor, borderWidth;
|
|
39
|
+
const buttonColor = colorOverride || colors.primary;
|
|
40
|
+
if (type === "standard" || type === "extended" || type === "fixed") {
|
|
41
|
+
backgroundColor = buttonColor;
|
|
42
|
+
if (disabled) {
|
|
43
|
+
textColor = (0, _color.default)(colors.surface).alpha(disabledOpacity).rgb().string();
|
|
44
|
+
} else {
|
|
45
|
+
textColor = colors.surface;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
backgroundColor = "transparent";
|
|
49
|
+
if (disabled) {
|
|
50
|
+
textColor = (0, _color.default)(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
51
|
+
} else {
|
|
52
|
+
textColor = buttonColor;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (type === "outline") {
|
|
56
|
+
if (disabled) {
|
|
57
|
+
borderColor = (0, _color.default)(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
58
|
+
} else {
|
|
59
|
+
borderColor = buttonColor;
|
|
60
|
+
}
|
|
61
|
+
borderWidth = _reactNative.StyleSheet.hairlineWidth;
|
|
62
|
+
} else {
|
|
63
|
+
borderColor = "transparent";
|
|
64
|
+
borderWidth = 0;
|
|
65
|
+
}
|
|
66
|
+
const buttonStyle = {
|
|
67
|
+
backgroundColor,
|
|
68
|
+
borderColor,
|
|
69
|
+
borderWidth,
|
|
70
|
+
borderRadius: roundness,
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
justifyContent: "center"
|
|
73
|
+
};
|
|
74
|
+
const buttonStyles = [styles.button, buttonStyle];
|
|
75
|
+
const contentStyle = [styles.content];
|
|
76
|
+
const textStyle = {
|
|
77
|
+
textAlign: "center",
|
|
78
|
+
color: textColor
|
|
79
|
+
};
|
|
80
|
+
const iconStyle = [styles.icon, {
|
|
81
|
+
width: _Config.default.buttonIconSize
|
|
82
|
+
}];
|
|
83
|
+
if (type === "standard" || type === "outline") {
|
|
84
|
+
buttonStyle.width = _Config.default.FABSize;
|
|
85
|
+
buttonStyle.height = _Config.default.FABSize;
|
|
86
|
+
buttonStyle.borderRadius = _Config.default.FABBorderRadius;
|
|
87
|
+
contentStyle.push({
|
|
88
|
+
width: _Config.default.FABSize,
|
|
89
|
+
height: _Config.default.FABSize
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (type === "extended" || type === "fixed") {
|
|
93
|
+
iconStyle.push({
|
|
94
|
+
marginLeft: 16,
|
|
95
|
+
marginRight: -8
|
|
96
|
+
});
|
|
97
|
+
textStyle.margin = 16;
|
|
98
|
+
}
|
|
99
|
+
if (type === "fixed") {
|
|
100
|
+
buttonStyles.push({
|
|
101
|
+
height: _Config.default.FABFixedHeight,
|
|
102
|
+
alignSelf: "stretch"
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return /*#__PURE__*/React.createElement(_Elevation.default, {
|
|
106
|
+
style: [{
|
|
107
|
+
elevation
|
|
108
|
+
}, style]
|
|
109
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
|
|
110
|
+
onPress: onPress,
|
|
111
|
+
accessibilityState: {
|
|
112
|
+
disabled
|
|
113
|
+
},
|
|
114
|
+
accessibilityRole: "button",
|
|
115
|
+
disabled: disabled || loading,
|
|
116
|
+
style: buttonStyles
|
|
117
|
+
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
118
|
+
style: styles.content
|
|
119
|
+
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
120
|
+
style: iconStyle
|
|
121
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
122
|
+
name: icon,
|
|
123
|
+
size: _Config.default.buttonIconSize,
|
|
124
|
+
color: textColor
|
|
125
|
+
})) : null, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
126
|
+
size: "small",
|
|
127
|
+
color: textColor,
|
|
128
|
+
style: iconStyle
|
|
129
|
+
}) : null, label ? /*#__PURE__*/React.createElement(_Text.default, {
|
|
130
|
+
numberOfLines: 1,
|
|
131
|
+
style: [textStyle, typography.button]
|
|
132
|
+
}, label) : null)));
|
|
133
|
+
};
|
|
134
|
+
const styles = _reactNative.StyleSheet.create({
|
|
135
|
+
button: {
|
|
136
|
+
borderStyle: "solid"
|
|
137
|
+
},
|
|
138
|
+
content: {
|
|
139
|
+
flexDirection: "row",
|
|
140
|
+
alignItems: "center",
|
|
141
|
+
justifyContent: "center"
|
|
142
|
+
},
|
|
143
|
+
icon: {
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
justifyContent: "center",
|
|
146
|
+
width: _Config.default.buttonIconSize
|
|
147
|
+
},
|
|
148
|
+
fixed: {
|
|
149
|
+
left: 0,
|
|
150
|
+
right: 0,
|
|
151
|
+
bottom: 0,
|
|
152
|
+
height: 64,
|
|
153
|
+
borderRadius: 0
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
var _default = (0, _theming.withTheme)(FAB);
|
|
157
|
+
exports.default = _default;
|
|
@@ -7,14 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
class PortalConsumer extends React.Component {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
_defineProperty(this, "key", void 0);
|
|
17
|
-
}
|
|
18
11
|
async componentDidMount() {
|
|
19
12
|
this.checkManager();
|
|
20
13
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _StepIndicator = _interopRequireDefault(require("./StepIndicator"));
|
|
9
|
+
var _theming = require("../theming");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
const ProgressIndicator = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
numberOfSteps,
|
|
16
|
+
currentStep,
|
|
17
|
+
currentStepStrokeWidth = 3,
|
|
18
|
+
stepStrokeCurrentColor = "primary",
|
|
19
|
+
stepIndicatorSize,
|
|
20
|
+
currentStepIndicatorSize,
|
|
21
|
+
stepIndicatorCurrentColor,
|
|
22
|
+
stepIndicatorLabelCurrentColor,
|
|
23
|
+
stepIndicatorLabelFontSize = 12,
|
|
24
|
+
stepNumberFinishedColor = "strongInverse",
|
|
25
|
+
stepNumberUnfinishedColor = "primary",
|
|
26
|
+
unfinishedColor = "light",
|
|
27
|
+
finishedColor = "primary",
|
|
28
|
+
theme
|
|
29
|
+
} = _ref;
|
|
30
|
+
const currentPosition = currentStep - 1;
|
|
31
|
+
return /*#__PURE__*/React.createElement(_StepIndicator.default, {
|
|
32
|
+
stepCount: numberOfSteps,
|
|
33
|
+
currentPosition: currentPosition,
|
|
34
|
+
customStyles: {
|
|
35
|
+
stepIndicatorSize,
|
|
36
|
+
currentStepIndicatorSize: currentStepIndicatorSize ? currentStepIndicatorSize : stepIndicatorSize,
|
|
37
|
+
stepStrokeFinishedColor: finishedColor,
|
|
38
|
+
stepStrokeUnFinishedColor: unfinishedColor,
|
|
39
|
+
separatorFinishedColor: finishedColor,
|
|
40
|
+
separatorUnFinishedColor: unfinishedColor,
|
|
41
|
+
stepIndicatorFinishedColor: finishedColor,
|
|
42
|
+
stepIndicatorUnFinishedColor: unfinishedColor,
|
|
43
|
+
currentStepStrokeWidth,
|
|
44
|
+
stepStrokeCurrentColor: stepStrokeCurrentColor || stepIndicatorCurrentColor,
|
|
45
|
+
stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
|
|
46
|
+
stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
|
|
47
|
+
stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
|
|
48
|
+
stepIndicatorLabelCurrentColor: stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
|
|
49
|
+
stepIndicatorLabelFontSize,
|
|
50
|
+
labelFontFamily: theme.typography.body1.fontFamily
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var _default = (0, _theming.withTheme)(ProgressIndicator);
|
|
55
|
+
exports.default = _default;
|
|
@@ -16,7 +16,6 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
16
16
|
class Text extends React.Component {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
|
-
_defineProperty(this, "_root", void 0);
|
|
20
19
|
_defineProperty(this, "state", {
|
|
21
20
|
nativeProps: {}
|
|
22
21
|
});
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
var _types = require("@draftbit/types");
|
|
8
|
+
const SEED_DATA_PROPS = {
|
|
9
|
+
image: {
|
|
10
|
+
group: _types.GROUPS.data,
|
|
11
|
+
label: "Image",
|
|
12
|
+
description: "Image",
|
|
13
|
+
formType: _types.FORM_TYPES.image,
|
|
14
|
+
propType: _types.PROP_TYPES.ASSET,
|
|
15
|
+
defaultValue: null,
|
|
16
|
+
editable: true,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
title: {
|
|
20
|
+
group: _types.GROUPS.data,
|
|
21
|
+
label: "Title",
|
|
22
|
+
description: "Text to display",
|
|
23
|
+
formType: _types.FORM_TYPES.string,
|
|
24
|
+
propType: _types.PROP_TYPES.STRING,
|
|
25
|
+
defaultValue: "Beautiful West Coast Villa",
|
|
26
|
+
editable: true,
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
leftDescription: {
|
|
30
|
+
group: _types.GROUPS.data,
|
|
31
|
+
label: "Left description",
|
|
32
|
+
description: "Text to display on the left",
|
|
33
|
+
formType: _types.FORM_TYPES.string,
|
|
34
|
+
propType: _types.PROP_TYPES.STRING,
|
|
35
|
+
defaultValue: "San Diego",
|
|
36
|
+
editable: true,
|
|
37
|
+
required: false
|
|
38
|
+
},
|
|
39
|
+
rightDescription: {
|
|
40
|
+
group: _types.GROUPS.data,
|
|
41
|
+
label: "Right description",
|
|
42
|
+
description: "Text to display on the right",
|
|
43
|
+
formType: _types.FORM_TYPES.string,
|
|
44
|
+
propType: _types.PROP_TYPES.STRING,
|
|
45
|
+
defaultValue: "$100",
|
|
46
|
+
editable: true,
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
aspectRatio: {
|
|
50
|
+
group: _types.GROUPS.basic,
|
|
51
|
+
label: "Aspect ratio",
|
|
52
|
+
description: "Aspect ratio of the image",
|
|
53
|
+
formType: _types.FORM_TYPES.aspectRatio,
|
|
54
|
+
propType: _types.PROP_TYPES.NUMBER,
|
|
55
|
+
defaultValue: 1.5,
|
|
56
|
+
editable: true,
|
|
57
|
+
required: false
|
|
58
|
+
},
|
|
59
|
+
titleCentered: {
|
|
60
|
+
group: _types.GROUPS.basic,
|
|
61
|
+
label: "Title centered",
|
|
62
|
+
description: "Whether to center the title",
|
|
63
|
+
formType: _types.FORM_TYPES.boolean,
|
|
64
|
+
propType: _types.PROP_TYPES.BOOLEAN,
|
|
65
|
+
defaultValue: false,
|
|
66
|
+
editable: true,
|
|
67
|
+
required: false
|
|
68
|
+
},
|
|
69
|
+
elevation: (0, _types.createElevationType)(2)
|
|
70
|
+
};
|
|
71
|
+
const SEED_DATA = [{
|
|
72
|
+
name: "Small Card",
|
|
73
|
+
tag: "CardBlock",
|
|
74
|
+
description: "An elevated card with a title and description, that takes up one third of its container.",
|
|
75
|
+
category: _types.COMPONENT_TYPES.card,
|
|
76
|
+
props: {
|
|
77
|
+
...SEED_DATA_PROPS,
|
|
78
|
+
numColumns: (0, _types.createNumColumnsType)({
|
|
79
|
+
defaultValue: 1
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
name: "Medium Block Card",
|
|
84
|
+
tag: "CardBlock",
|
|
85
|
+
description: "An elevated card with a title and description, that takes up one half of its container.",
|
|
86
|
+
category: _types.COMPONENT_TYPES.card,
|
|
87
|
+
props: {
|
|
88
|
+
...SEED_DATA_PROPS,
|
|
89
|
+
icon: {
|
|
90
|
+
group: _types.GROUPS.basic,
|
|
91
|
+
label: "Icon",
|
|
92
|
+
description: "Icon to display on the top right",
|
|
93
|
+
formType: _types.FORM_TYPES.icon,
|
|
94
|
+
propType: _types.PROP_TYPES.STRING,
|
|
95
|
+
defaultValue: null,
|
|
96
|
+
editable: true,
|
|
97
|
+
required: true
|
|
98
|
+
},
|
|
99
|
+
numColumns: (0, _types.createNumColumnsType)({
|
|
100
|
+
defaultValue: 2
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
name: "Large Block Card",
|
|
105
|
+
tag: "CardBlock",
|
|
106
|
+
description: "An elevated card with a title and description, that takes up the full width its container.",
|
|
107
|
+
category: _types.COMPONENT_TYPES.card,
|
|
108
|
+
stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
|
|
109
|
+
props: {
|
|
110
|
+
...SEED_DATA_PROPS,
|
|
111
|
+
icon: {
|
|
112
|
+
group: _types.GROUPS.basic,
|
|
113
|
+
label: "Icon",
|
|
114
|
+
description: "Icon to display on the top right",
|
|
115
|
+
formType: _types.FORM_TYPES.icon,
|
|
116
|
+
propType: _types.PROP_TYPES.STRING,
|
|
117
|
+
defaultValue: null,
|
|
118
|
+
editable: true,
|
|
119
|
+
required: true
|
|
120
|
+
},
|
|
121
|
+
numColumns: (0, _types.createNumColumnsType)({
|
|
122
|
+
defaultValue: 3
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
}];
|
|
126
|
+
exports.SEED_DATA = SEED_DATA;
|