@draftbit/core 46.8.1-2ae5b7.2 → 46.8.1-2f0fda.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/DeckSwiper/DeckSwiper.js +4 -38
- package/lib/commonjs/components/Shadow.js +42 -0
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/mappings/Shadow.js +94 -0
- package/lib/commonjs/styles/overlay.js +3 -1
- package/lib/module/components/DeckSwiper/DeckSwiper.js +4 -38
- package/lib/module/components/Shadow.js +34 -0
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/Shadow.js +87 -0
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts +2 -8
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts.map +1 -1
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +3 -2
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts.map +1 -1
- package/lib/typescript/src/components/Shadow.d.ts +24 -0
- package/lib/typescript/src/components/Shadow.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Shadow.d.ts +173 -0
- package/lib/typescript/src/mappings/Shadow.d.ts.map +1 -0
- package/package.json +4 -3
- package/src/components/DeckSwiper/DeckSwiper.js +3 -33
- package/src/components/DeckSwiper/DeckSwiper.tsx +9 -51
- package/src/components/DeckSwiper/DeckSwiperCard.js +1 -1
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +6 -3
- package/src/components/Shadow.js +16 -0
- package/src/components/Shadow.tsx +58 -0
- package/src/index.js +1 -0
- package/src/index.tsx +2 -0
- package/src/mappings/Shadow.js +87 -0
- package/src/mappings/Shadow.ts +95 -0
|
@@ -17,47 +17,13 @@ const DeckSwiper = _ref => {
|
|
|
17
17
|
verticalEnabled = true,
|
|
18
18
|
horizontalEnabled = true,
|
|
19
19
|
visibleCardCount = 1,
|
|
20
|
-
data,
|
|
21
|
-
keyExtractor,
|
|
22
|
-
renderItem,
|
|
23
20
|
style,
|
|
24
21
|
children
|
|
25
22
|
} = _ref;
|
|
26
|
-
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
27
|
-
if (data && !renderItem || renderItem && !data) {
|
|
28
|
-
throw new Error("'renderItem' and 'data' need to both be provided to lazily render. Either remove them entirley or include both");
|
|
29
|
-
}
|
|
30
|
-
if (data && renderItem && children) {
|
|
31
|
-
console.warn("'children' of DeckSwiper ignored due to usage of 'data' and 'renderItem'");
|
|
32
|
-
}
|
|
33
23
|
const childrenArray = _react.default.useMemo(() => _react.default.Children.toArray(children), [children]);
|
|
34
24
|
|
|
35
25
|
// an array of indices based on children count
|
|
36
26
|
const cardsFillerData = _react.default.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
|
|
37
|
-
const cardsData = data || cardsFillerData;
|
|
38
|
-
const renderCard = (card, index) => {
|
|
39
|
-
if (renderItem) {
|
|
40
|
-
return renderItem({
|
|
41
|
-
item: card,
|
|
42
|
-
index
|
|
43
|
-
});
|
|
44
|
-
} else {
|
|
45
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, childrenArray[index]);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const renderFirstCard = () => {
|
|
49
|
-
if (cardsData.length) {
|
|
50
|
-
return renderCard(cardsData[0], 0);
|
|
51
|
-
}
|
|
52
|
-
return undefined;
|
|
53
|
-
};
|
|
54
|
-
const cardKeyExtractor = card => {
|
|
55
|
-
if (keyExtractor) {
|
|
56
|
-
return keyExtractor(card);
|
|
57
|
-
} else {
|
|
58
|
-
return card === null || card === void 0 ? void 0 : card.toString();
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
27
|
|
|
62
28
|
/**
|
|
63
29
|
* By default react-native-deck-swiper positions everything with absolute position.
|
|
@@ -71,10 +37,10 @@ const DeckSwiper = _ref => {
|
|
|
71
37
|
|
|
72
38
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
73
39
|
style: styles.containerHeightFiller
|
|
74
|
-
},
|
|
75
|
-
cards:
|
|
76
|
-
renderCard:
|
|
77
|
-
keyExtractor:
|
|
40
|
+
}, childrenArray.length && childrenArray[0]), /*#__PURE__*/_react.default.createElement(_reactNativeDeckSwiper.default, {
|
|
41
|
+
cards: cardsFillerData,
|
|
42
|
+
renderCard: (_, i) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, childrenArray[i]),
|
|
43
|
+
keyExtractor: card => card === null || card === void 0 ? void 0 : card.toString(),
|
|
78
44
|
containerStyle: _reactNative.StyleSheet.flatten([styles.cardsContainer, style]),
|
|
79
45
|
cardStyle: styles.card,
|
|
80
46
|
onSwiped: onIndexChanged,
|
|
@@ -0,0 +1,42 @@
|
|
|
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 _reactNativeShadow = require("react-native-shadow-2");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
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); }
|
|
11
|
+
const Shadow = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
offsetX = 0,
|
|
14
|
+
offsetY = 0,
|
|
15
|
+
showShadowSideStart = true,
|
|
16
|
+
showShadowSideEnd = true,
|
|
17
|
+
showShadowSideTop = true,
|
|
18
|
+
showShadowSideBottom = true,
|
|
19
|
+
showShadowCornerTopStart = true,
|
|
20
|
+
showShadowCornerTopEnd = true,
|
|
21
|
+
showShadowCornerBottomStart = true,
|
|
22
|
+
showShadowCornerBottomEnd = true,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeShadow.Shadow, _extends({
|
|
26
|
+
offset: [offsetX, offsetY],
|
|
27
|
+
sides: {
|
|
28
|
+
start: showShadowSideStart,
|
|
29
|
+
end: showShadowSideEnd,
|
|
30
|
+
top: showShadowSideTop,
|
|
31
|
+
bottom: showShadowSideBottom
|
|
32
|
+
},
|
|
33
|
+
corners: {
|
|
34
|
+
topStart: showShadowCornerTopStart,
|
|
35
|
+
topEnd: showShadowCornerTopEnd,
|
|
36
|
+
bottomStart: showShadowCornerBottomStart,
|
|
37
|
+
bottomEnd: showShadowCornerBottomEnd
|
|
38
|
+
}
|
|
39
|
+
}, rest));
|
|
40
|
+
};
|
|
41
|
+
var _default = Shadow;
|
|
42
|
+
exports.default = _default;
|
|
@@ -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;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -273,6 +273,12 @@ Object.defineProperty(exports, "ScreenContainer", {
|
|
|
273
273
|
return _ScreenContainer.default;
|
|
274
274
|
}
|
|
275
275
|
});
|
|
276
|
+
Object.defineProperty(exports, "Shadow", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function () {
|
|
279
|
+
return _Shadow.default;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
276
282
|
Object.defineProperty(exports, "Slider", {
|
|
277
283
|
enumerable: true,
|
|
278
284
|
get: function () {
|
|
@@ -413,6 +419,7 @@ var _ActionSheet = require("./components/ActionSheet");
|
|
|
413
419
|
var _Swiper = require("./components/Swiper");
|
|
414
420
|
var _Layout = require("./components/Layout");
|
|
415
421
|
var _index = require("./components/RadioButton/index");
|
|
422
|
+
var _Shadow = _interopRequireDefault(require("./components/Shadow"));
|
|
416
423
|
var _DeckSwiper = require("./components/DeckSwiper");
|
|
417
424
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
418
425
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
@@ -0,0 +1,94 @@
|
|
|
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 = {
|
|
9
|
+
name: "Shadow",
|
|
10
|
+
tag: "Shadow",
|
|
11
|
+
description: "A cross-platform, universal shadow.",
|
|
12
|
+
category: _types.COMPONENT_TYPES.view,
|
|
13
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
+
props: {
|
|
15
|
+
disabled: (0, _types.createDisabledProp)({
|
|
16
|
+
description: "Disables the shadow."
|
|
17
|
+
}),
|
|
18
|
+
startColor: (0, _types.createColorProp)({
|
|
19
|
+
label: "Start Color",
|
|
20
|
+
description: "The initial gradient color of the shadow.",
|
|
21
|
+
defaultValue: null
|
|
22
|
+
}),
|
|
23
|
+
endColor: (0, _types.createColorProp)({
|
|
24
|
+
label: "End Color",
|
|
25
|
+
description: "The final gradient color of the shadow.",
|
|
26
|
+
defaultValue: null
|
|
27
|
+
}),
|
|
28
|
+
distance: (0, _types.createStaticNumberProp)({
|
|
29
|
+
label: "Distance",
|
|
30
|
+
description: "The distance of the shadow."
|
|
31
|
+
}),
|
|
32
|
+
paintInside: (0, _types.createStaticBoolProp)({
|
|
33
|
+
label: "Paint Inside",
|
|
34
|
+
description: "Apply the shadow below/inside the content.",
|
|
35
|
+
defaultValue: null
|
|
36
|
+
}),
|
|
37
|
+
stretch: (0, _types.createStaticBoolProp)({
|
|
38
|
+
label: "Stretch",
|
|
39
|
+
description: "Force children to occupy all available horizontal space.",
|
|
40
|
+
defaultValue: null
|
|
41
|
+
}),
|
|
42
|
+
offsetX: (0, _types.createStaticNumberProp)({
|
|
43
|
+
label: "Offset X",
|
|
44
|
+
description: "Moves the shadow in the x direction",
|
|
45
|
+
defeaultValue: 0
|
|
46
|
+
}),
|
|
47
|
+
offsetY: (0, _types.createStaticNumberProp)({
|
|
48
|
+
label: "Offset Y",
|
|
49
|
+
description: "Moves the shadow in the y direction",
|
|
50
|
+
defeaultValue: 0
|
|
51
|
+
}),
|
|
52
|
+
showShadowSideStart: (0, _types.createStaticBoolProp)({
|
|
53
|
+
label: "Show Shadow Start",
|
|
54
|
+
description: "Whether to show shadow on the start side or not",
|
|
55
|
+
defaultValue: true
|
|
56
|
+
}),
|
|
57
|
+
showShadowSideEnd: (0, _types.createStaticBoolProp)({
|
|
58
|
+
label: "Show Shadow End",
|
|
59
|
+
description: "Whether to show shadow on the end side or not",
|
|
60
|
+
defaultValue: true
|
|
61
|
+
}),
|
|
62
|
+
showShadowSideTop: (0, _types.createStaticBoolProp)({
|
|
63
|
+
label: "Show Shadow Top",
|
|
64
|
+
description: "Whether to show shadow on the top side or not",
|
|
65
|
+
defaultValue: true
|
|
66
|
+
}),
|
|
67
|
+
showShadowSideBottom: (0, _types.createStaticBoolProp)({
|
|
68
|
+
label: "Show Shadow Bottom",
|
|
69
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
70
|
+
defaultValue: true
|
|
71
|
+
}),
|
|
72
|
+
showShadowCornerTopStart: (0, _types.createStaticBoolProp)({
|
|
73
|
+
label: "Show Shadow Top Start Corner",
|
|
74
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
75
|
+
defaultValue: true
|
|
76
|
+
}),
|
|
77
|
+
showShadowCornerTopEnd: (0, _types.createStaticBoolProp)({
|
|
78
|
+
label: "Show Shadow Top End Corner",
|
|
79
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
80
|
+
defaultValue: true
|
|
81
|
+
}),
|
|
82
|
+
showShadowCornerBottomStart: (0, _types.createStaticBoolProp)({
|
|
83
|
+
label: "Show Shadow Bottom Start Corner",
|
|
84
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
85
|
+
defaultValue: true
|
|
86
|
+
}),
|
|
87
|
+
showShadowCornerBottomEnd: (0, _types.createStaticBoolProp)({
|
|
88
|
+
label: "Show Shadow Bottom End Corner",
|
|
89
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
90
|
+
defaultValue: true
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -15,6 +15,7 @@ function overlay(elevation) {
|
|
|
15
15
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
|
|
16
16
|
if (isAnimatedValue(elevation)) {
|
|
17
17
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
18
|
+
|
|
18
19
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
19
20
|
return elevation.interpolate({
|
|
20
21
|
inputRange,
|
|
@@ -23,6 +24,7 @@ function overlay(elevation) {
|
|
|
23
24
|
})
|
|
24
25
|
});
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
27
29
|
return calculateColor(surfaceColor, elevation);
|
|
28
30
|
}
|
|
@@ -63,4 +65,4 @@ const elevationOverlayTransparency = {
|
|
|
63
65
|
22: 15.72,
|
|
64
66
|
23: 15.84,
|
|
65
67
|
24: 16
|
|
66
|
-
};
|
|
68
|
+
};
|
|
@@ -10,47 +10,13 @@ const DeckSwiper = _ref => {
|
|
|
10
10
|
verticalEnabled = true,
|
|
11
11
|
horizontalEnabled = true,
|
|
12
12
|
visibleCardCount = 1,
|
|
13
|
-
data,
|
|
14
|
-
keyExtractor,
|
|
15
|
-
renderItem,
|
|
16
13
|
style,
|
|
17
14
|
children
|
|
18
15
|
} = _ref;
|
|
19
|
-
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
20
|
-
if (data && !renderItem || renderItem && !data) {
|
|
21
|
-
throw new Error("'renderItem' and 'data' need to both be provided to lazily render. Either remove them entirley or include both");
|
|
22
|
-
}
|
|
23
|
-
if (data && renderItem && children) {
|
|
24
|
-
console.warn("'children' of DeckSwiper ignored due to usage of 'data' and 'renderItem'");
|
|
25
|
-
}
|
|
26
16
|
const childrenArray = React.useMemo(() => React.Children.toArray(children), [children]);
|
|
27
17
|
|
|
28
18
|
// an array of indices based on children count
|
|
29
19
|
const cardsFillerData = React.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
|
|
30
|
-
const cardsData = data || cardsFillerData;
|
|
31
|
-
const renderCard = (card, index) => {
|
|
32
|
-
if (renderItem) {
|
|
33
|
-
return renderItem({
|
|
34
|
-
item: card,
|
|
35
|
-
index
|
|
36
|
-
});
|
|
37
|
-
} else {
|
|
38
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, childrenArray[index]);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const renderFirstCard = () => {
|
|
42
|
-
if (cardsData.length) {
|
|
43
|
-
return renderCard(cardsData[0], 0);
|
|
44
|
-
}
|
|
45
|
-
return undefined;
|
|
46
|
-
};
|
|
47
|
-
const cardKeyExtractor = card => {
|
|
48
|
-
if (keyExtractor) {
|
|
49
|
-
return keyExtractor(card);
|
|
50
|
-
} else {
|
|
51
|
-
return card === null || card === void 0 ? void 0 : card.toString();
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
20
|
|
|
55
21
|
/**
|
|
56
22
|
* By default react-native-deck-swiper positions everything with absolute position.
|
|
@@ -64,10 +30,10 @@ const DeckSwiper = _ref => {
|
|
|
64
30
|
|
|
65
31
|
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
|
|
66
32
|
style: styles.containerHeightFiller
|
|
67
|
-
},
|
|
68
|
-
cards:
|
|
69
|
-
renderCard:
|
|
70
|
-
keyExtractor:
|
|
33
|
+
}, childrenArray.length && childrenArray[0]), /*#__PURE__*/React.createElement(DeckSwiperComponent, {
|
|
34
|
+
cards: cardsFillerData,
|
|
35
|
+
renderCard: (_, i) => /*#__PURE__*/React.createElement(React.Fragment, null, childrenArray[i]),
|
|
36
|
+
keyExtractor: card => card === null || card === void 0 ? void 0 : card.toString(),
|
|
71
37
|
containerStyle: StyleSheet.flatten([styles.cardsContainer, style]),
|
|
72
38
|
cardStyle: styles.card,
|
|
73
39
|
onSwiped: onIndexChanged,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
4
|
+
const Shadow = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
offsetX = 0,
|
|
7
|
+
offsetY = 0,
|
|
8
|
+
showShadowSideStart = true,
|
|
9
|
+
showShadowSideEnd = true,
|
|
10
|
+
showShadowSideTop = true,
|
|
11
|
+
showShadowSideBottom = true,
|
|
12
|
+
showShadowCornerTopStart = true,
|
|
13
|
+
showShadowCornerTopEnd = true,
|
|
14
|
+
showShadowCornerBottomStart = true,
|
|
15
|
+
showShadowCornerBottomEnd = true,
|
|
16
|
+
...rest
|
|
17
|
+
} = _ref;
|
|
18
|
+
return /*#__PURE__*/React.createElement(ShadowComponent, _extends({
|
|
19
|
+
offset: [offsetX, offsetY],
|
|
20
|
+
sides: {
|
|
21
|
+
start: showShadowSideStart,
|
|
22
|
+
end: showShadowSideEnd,
|
|
23
|
+
top: showShadowSideTop,
|
|
24
|
+
bottom: showShadowSideBottom
|
|
25
|
+
},
|
|
26
|
+
corners: {
|
|
27
|
+
topStart: showShadowCornerTopStart,
|
|
28
|
+
topEnd: showShadowCornerTopEnd,
|
|
29
|
+
bottomStart: showShadowCornerBottomStart,
|
|
30
|
+
bottomEnd: showShadowCornerBottomEnd
|
|
31
|
+
}
|
|
32
|
+
}, rest));
|
|
33
|
+
};
|
|
34
|
+
export default Shadow;
|
package/lib/module/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/Ac
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
34
|
+
export { default as Shadow } from "./components/Shadow";
|
|
34
35
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
36
|
|
|
36
37
|
/* Deprecated: Fix or Delete! */
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, CONTAINER_COMPONENT_STYLES_SECTIONS, createColorProp, createStaticNumberProp, createStaticBoolProp, createDisabledProp } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Shadow",
|
|
4
|
+
tag: "Shadow",
|
|
5
|
+
description: "A cross-platform, universal shadow.",
|
|
6
|
+
category: COMPONENT_TYPES.view,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
+
props: {
|
|
9
|
+
disabled: createDisabledProp({
|
|
10
|
+
description: "Disables the shadow."
|
|
11
|
+
}),
|
|
12
|
+
startColor: createColorProp({
|
|
13
|
+
label: "Start Color",
|
|
14
|
+
description: "The initial gradient color of the shadow.",
|
|
15
|
+
defaultValue: null
|
|
16
|
+
}),
|
|
17
|
+
endColor: createColorProp({
|
|
18
|
+
label: "End Color",
|
|
19
|
+
description: "The final gradient color of the shadow.",
|
|
20
|
+
defaultValue: null
|
|
21
|
+
}),
|
|
22
|
+
distance: createStaticNumberProp({
|
|
23
|
+
label: "Distance",
|
|
24
|
+
description: "The distance of the shadow."
|
|
25
|
+
}),
|
|
26
|
+
paintInside: createStaticBoolProp({
|
|
27
|
+
label: "Paint Inside",
|
|
28
|
+
description: "Apply the shadow below/inside the content.",
|
|
29
|
+
defaultValue: null
|
|
30
|
+
}),
|
|
31
|
+
stretch: createStaticBoolProp({
|
|
32
|
+
label: "Stretch",
|
|
33
|
+
description: "Force children to occupy all available horizontal space.",
|
|
34
|
+
defaultValue: null
|
|
35
|
+
}),
|
|
36
|
+
offsetX: createStaticNumberProp({
|
|
37
|
+
label: "Offset X",
|
|
38
|
+
description: "Moves the shadow in the x direction",
|
|
39
|
+
defeaultValue: 0
|
|
40
|
+
}),
|
|
41
|
+
offsetY: createStaticNumberProp({
|
|
42
|
+
label: "Offset Y",
|
|
43
|
+
description: "Moves the shadow in the y direction",
|
|
44
|
+
defeaultValue: 0
|
|
45
|
+
}),
|
|
46
|
+
showShadowSideStart: createStaticBoolProp({
|
|
47
|
+
label: "Show Shadow Start",
|
|
48
|
+
description: "Whether to show shadow on the start side or not",
|
|
49
|
+
defaultValue: true
|
|
50
|
+
}),
|
|
51
|
+
showShadowSideEnd: createStaticBoolProp({
|
|
52
|
+
label: "Show Shadow End",
|
|
53
|
+
description: "Whether to show shadow on the end side or not",
|
|
54
|
+
defaultValue: true
|
|
55
|
+
}),
|
|
56
|
+
showShadowSideTop: createStaticBoolProp({
|
|
57
|
+
label: "Show Shadow Top",
|
|
58
|
+
description: "Whether to show shadow on the top side or not",
|
|
59
|
+
defaultValue: true
|
|
60
|
+
}),
|
|
61
|
+
showShadowSideBottom: createStaticBoolProp({
|
|
62
|
+
label: "Show Shadow Bottom",
|
|
63
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
64
|
+
defaultValue: true
|
|
65
|
+
}),
|
|
66
|
+
showShadowCornerTopStart: createStaticBoolProp({
|
|
67
|
+
label: "Show Shadow Top Start Corner",
|
|
68
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
69
|
+
defaultValue: true
|
|
70
|
+
}),
|
|
71
|
+
showShadowCornerTopEnd: createStaticBoolProp({
|
|
72
|
+
label: "Show Shadow Top End Corner",
|
|
73
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
74
|
+
defaultValue: true
|
|
75
|
+
}),
|
|
76
|
+
showShadowCornerBottomStart: createStaticBoolProp({
|
|
77
|
+
label: "Show Shadow Bottom Start Corner",
|
|
78
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
79
|
+
defaultValue: true
|
|
80
|
+
}),
|
|
81
|
+
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
82
|
+
label: "Show Shadow Bottom End Corner",
|
|
83
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
84
|
+
defaultValue: true
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
export interface DeckSwiperProps
|
|
3
|
+
export interface DeckSwiperProps {
|
|
4
4
|
onIndexChanged?: (index: number) => void;
|
|
5
5
|
onEndReached?: () => void;
|
|
6
6
|
startCardIndex?: number;
|
|
@@ -8,14 +8,8 @@ export interface DeckSwiperProps<T> {
|
|
|
8
8
|
verticalEnabled?: boolean;
|
|
9
9
|
horizontalEnabled?: boolean;
|
|
10
10
|
visibleCardCount?: number;
|
|
11
|
-
data?: Array<T>;
|
|
12
|
-
keyExtractor?: (item: T) => string;
|
|
13
|
-
renderItem?: ({ item, index }: {
|
|
14
|
-
item: T;
|
|
15
|
-
index: number;
|
|
16
|
-
}) => JSX.Element;
|
|
17
11
|
style?: StyleProp<ViewStyle>;
|
|
18
12
|
}
|
|
19
|
-
declare const DeckSwiper: <
|
|
13
|
+
declare const DeckSwiper: React.FC<React.PropsWithChildren<DeckSwiperProps>>;
|
|
20
14
|
export default DeckSwiper;
|
|
21
15
|
//# sourceMappingURL=DeckSwiper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeckSwiper.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAGtE,MAAM,WAAW,eAAe
|
|
1
|
+
{"version":3,"file":"DeckSwiper.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAGtE,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAC,CA6DlE,CAAC;AAiBF,eAAe,UAAU,CAAC"}
|
|
@@ -3,10 +3,11 @@ import { StyleProp, ViewStyle } from "react-native";
|
|
|
3
3
|
import type { Theme } from "../../styles/DefaultTheme";
|
|
4
4
|
export interface DeckSwiperCardProps {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
+
children: React.ReactNode;
|
|
6
7
|
theme: Theme;
|
|
7
8
|
}
|
|
8
|
-
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<
|
|
9
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<DeckSwiperCardProps, "theme"> & {
|
|
9
10
|
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
10
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<
|
|
11
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<DeckSwiperCardProps> & React.FC<DeckSwiperCardProps>, {}>;
|
|
11
12
|
export default _default;
|
|
12
13
|
//# sourceMappingURL=DeckSwiperCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeckSwiperCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiperCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;
|
|
1
|
+
{"version":3,"file":"DeckSwiperCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiperCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AA+BD,wBAAyC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
interface ShadowProps {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
startColor?: string;
|
|
6
|
+
endColor?: string;
|
|
7
|
+
distance?: number;
|
|
8
|
+
paintInside?: boolean;
|
|
9
|
+
stretch?: boolean;
|
|
10
|
+
offsetX?: number;
|
|
11
|
+
offsetY?: number;
|
|
12
|
+
showShadowSideStart?: boolean;
|
|
13
|
+
showShadowSideEnd?: boolean;
|
|
14
|
+
showShadowSideTop?: boolean;
|
|
15
|
+
showShadowSideBottom?: boolean;
|
|
16
|
+
showShadowCornerTopStart?: boolean;
|
|
17
|
+
showShadowCornerTopEnd?: boolean;
|
|
18
|
+
showShadowCornerBottomStart?: boolean;
|
|
19
|
+
showShadowCornerBottomEnd?: boolean;
|
|
20
|
+
style?: StyleProp<ViewStyle>;
|
|
21
|
+
}
|
|
22
|
+
declare const Shadow: React.FC<React.PropsWithChildren<ShadowProps>>;
|
|
23
|
+
export default Shadow;
|
|
24
|
+
//# sourceMappingURL=Shadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../../../../src/components/Shadow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CA+B1D,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -31,6 +31,7 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
+
export { default as Shadow } from "./components/Shadow";
|
|
34
35
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
36
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
36
37
|
export { default as Picker } from "./components/Picker/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,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,GAAG,EACH,KAAK,EACL,MAAM,GACP,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
export declare const SEED_DATA: {
|
|
2
|
+
name: string;
|
|
3
|
+
tag: string;
|
|
4
|
+
description: string;
|
|
5
|
+
category: string;
|
|
6
|
+
stylesPanelSections: string[];
|
|
7
|
+
props: {
|
|
8
|
+
disabled: {
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
group: string;
|
|
12
|
+
editable: boolean;
|
|
13
|
+
required: boolean;
|
|
14
|
+
formType: string;
|
|
15
|
+
propType: string;
|
|
16
|
+
defaultValue: null;
|
|
17
|
+
};
|
|
18
|
+
startColor: {
|
|
19
|
+
group: string;
|
|
20
|
+
label: string;
|
|
21
|
+
description: string;
|
|
22
|
+
editable: boolean;
|
|
23
|
+
required: boolean;
|
|
24
|
+
defaultValue: null;
|
|
25
|
+
formType: string;
|
|
26
|
+
propType: string;
|
|
27
|
+
};
|
|
28
|
+
endColor: {
|
|
29
|
+
group: string;
|
|
30
|
+
label: string;
|
|
31
|
+
description: string;
|
|
32
|
+
editable: boolean;
|
|
33
|
+
required: boolean;
|
|
34
|
+
defaultValue: null;
|
|
35
|
+
formType: string;
|
|
36
|
+
propType: string;
|
|
37
|
+
};
|
|
38
|
+
distance: {
|
|
39
|
+
label: string;
|
|
40
|
+
description: string;
|
|
41
|
+
formType: string;
|
|
42
|
+
propType: string;
|
|
43
|
+
group: string;
|
|
44
|
+
defaultValue: null;
|
|
45
|
+
editable: boolean;
|
|
46
|
+
required: boolean;
|
|
47
|
+
step: number;
|
|
48
|
+
};
|
|
49
|
+
paintInside: {
|
|
50
|
+
label: string;
|
|
51
|
+
description: string;
|
|
52
|
+
formType: string;
|
|
53
|
+
propType: string;
|
|
54
|
+
defaultValue: boolean;
|
|
55
|
+
editable: boolean;
|
|
56
|
+
required: boolean;
|
|
57
|
+
group: string;
|
|
58
|
+
};
|
|
59
|
+
stretch: {
|
|
60
|
+
label: string;
|
|
61
|
+
description: string;
|
|
62
|
+
formType: string;
|
|
63
|
+
propType: string;
|
|
64
|
+
defaultValue: boolean;
|
|
65
|
+
editable: boolean;
|
|
66
|
+
required: boolean;
|
|
67
|
+
group: string;
|
|
68
|
+
};
|
|
69
|
+
offsetX: {
|
|
70
|
+
label: string;
|
|
71
|
+
description: string;
|
|
72
|
+
formType: string;
|
|
73
|
+
propType: string;
|
|
74
|
+
group: string;
|
|
75
|
+
defaultValue: null;
|
|
76
|
+
editable: boolean;
|
|
77
|
+
required: boolean;
|
|
78
|
+
step: number;
|
|
79
|
+
};
|
|
80
|
+
offsetY: {
|
|
81
|
+
label: string;
|
|
82
|
+
description: string;
|
|
83
|
+
formType: string;
|
|
84
|
+
propType: string;
|
|
85
|
+
group: string;
|
|
86
|
+
defaultValue: null;
|
|
87
|
+
editable: boolean;
|
|
88
|
+
required: boolean;
|
|
89
|
+
step: number;
|
|
90
|
+
};
|
|
91
|
+
showShadowSideStart: {
|
|
92
|
+
label: string;
|
|
93
|
+
description: string;
|
|
94
|
+
formType: string;
|
|
95
|
+
propType: string;
|
|
96
|
+
defaultValue: boolean;
|
|
97
|
+
editable: boolean;
|
|
98
|
+
required: boolean;
|
|
99
|
+
group: string;
|
|
100
|
+
};
|
|
101
|
+
showShadowSideEnd: {
|
|
102
|
+
label: string;
|
|
103
|
+
description: string;
|
|
104
|
+
formType: string;
|
|
105
|
+
propType: string;
|
|
106
|
+
defaultValue: boolean;
|
|
107
|
+
editable: boolean;
|
|
108
|
+
required: boolean;
|
|
109
|
+
group: string;
|
|
110
|
+
};
|
|
111
|
+
showShadowSideTop: {
|
|
112
|
+
label: string;
|
|
113
|
+
description: string;
|
|
114
|
+
formType: string;
|
|
115
|
+
propType: string;
|
|
116
|
+
defaultValue: boolean;
|
|
117
|
+
editable: boolean;
|
|
118
|
+
required: boolean;
|
|
119
|
+
group: string;
|
|
120
|
+
};
|
|
121
|
+
showShadowSideBottom: {
|
|
122
|
+
label: string;
|
|
123
|
+
description: string;
|
|
124
|
+
formType: string;
|
|
125
|
+
propType: string;
|
|
126
|
+
defaultValue: boolean;
|
|
127
|
+
editable: boolean;
|
|
128
|
+
required: boolean;
|
|
129
|
+
group: string;
|
|
130
|
+
};
|
|
131
|
+
showShadowCornerTopStart: {
|
|
132
|
+
label: string;
|
|
133
|
+
description: string;
|
|
134
|
+
formType: string;
|
|
135
|
+
propType: string;
|
|
136
|
+
defaultValue: boolean;
|
|
137
|
+
editable: boolean;
|
|
138
|
+
required: boolean;
|
|
139
|
+
group: string;
|
|
140
|
+
};
|
|
141
|
+
showShadowCornerTopEnd: {
|
|
142
|
+
label: string;
|
|
143
|
+
description: string;
|
|
144
|
+
formType: string;
|
|
145
|
+
propType: string;
|
|
146
|
+
defaultValue: boolean;
|
|
147
|
+
editable: boolean;
|
|
148
|
+
required: boolean;
|
|
149
|
+
group: string;
|
|
150
|
+
};
|
|
151
|
+
showShadowCornerBottomStart: {
|
|
152
|
+
label: string;
|
|
153
|
+
description: string;
|
|
154
|
+
formType: string;
|
|
155
|
+
propType: string;
|
|
156
|
+
defaultValue: boolean;
|
|
157
|
+
editable: boolean;
|
|
158
|
+
required: boolean;
|
|
159
|
+
group: string;
|
|
160
|
+
};
|
|
161
|
+
showShadowCornerBottomEnd: {
|
|
162
|
+
label: string;
|
|
163
|
+
description: string;
|
|
164
|
+
formType: string;
|
|
165
|
+
propType: string;
|
|
166
|
+
defaultValue: boolean;
|
|
167
|
+
editable: boolean;
|
|
168
|
+
required: boolean;
|
|
169
|
+
group: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=Shadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Shadow.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.8.1-
|
|
3
|
+
"version": "46.8.1-2f0fda.2+2f0fda3",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.8.1-
|
|
44
|
+
"@draftbit/types": "^46.8.1-2f0fda.2+2f0fda3",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"lodash.tonumber": "^4.0.3",
|
|
56
56
|
"react-native-deck-swiper": "^2.0.12",
|
|
57
57
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
58
|
+
"react-native-shadow-2": "^7.0.6",
|
|
58
59
|
"react-native-svg": "12.3.0",
|
|
59
60
|
"react-native-typography": "^1.4.1",
|
|
60
61
|
"react-native-web-swiper": "^2.2.3"
|
|
@@ -92,5 +93,5 @@
|
|
|
92
93
|
]
|
|
93
94
|
]
|
|
94
95
|
},
|
|
95
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "2f0fda313dd5d30edd1a6e874ebc4a20e2128b3c"
|
|
96
97
|
}
|
|
@@ -1,40 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
3
|
import DeckSwiperComponent from "react-native-deck-swiper";
|
|
4
|
-
const DeckSwiper = ({ onIndexChanged, onEndReached, startCardIndex = 0, infiniteSwiping = false, verticalEnabled = true, horizontalEnabled = true, visibleCardCount = 1,
|
|
5
|
-
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
6
|
-
if ((data && !renderItem) || (renderItem && !data)) {
|
|
7
|
-
throw new Error("'renderItem' and 'data' need to both be provided to lazily render. Either remove them entirley or include both");
|
|
8
|
-
}
|
|
9
|
-
if (data && renderItem && children) {
|
|
10
|
-
console.warn("'children' of DeckSwiper ignored due to usage of 'data' and 'renderItem'");
|
|
11
|
-
}
|
|
4
|
+
const DeckSwiper = ({ onIndexChanged, onEndReached, startCardIndex = 0, infiniteSwiping = false, verticalEnabled = true, horizontalEnabled = true, visibleCardCount = 1, style, children, }) => {
|
|
12
5
|
const childrenArray = React.useMemo(() => React.Children.toArray(children), [children]);
|
|
13
6
|
// an array of indices based on children count
|
|
14
7
|
const cardsFillerData = React.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
|
|
15
|
-
const cardsData = data || cardsFillerData;
|
|
16
|
-
const renderCard = (card, index) => {
|
|
17
|
-
if (renderItem) {
|
|
18
|
-
return renderItem({ item: card, index });
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
return React.createElement(React.Fragment, null, childrenArray[index]);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const renderFirstCard = () => {
|
|
25
|
-
if (cardsData.length) {
|
|
26
|
-
return renderCard(cardsData[0], 0);
|
|
27
|
-
}
|
|
28
|
-
return undefined;
|
|
29
|
-
};
|
|
30
|
-
const cardKeyExtractor = (card) => {
|
|
31
|
-
if (keyExtractor) {
|
|
32
|
-
return keyExtractor(card);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return card === null || card === void 0 ? void 0 : card.toString();
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
8
|
/**
|
|
39
9
|
* By default react-native-deck-swiper positions everything with absolute position.
|
|
40
10
|
* To overcome this, it is wrapped in a View to be able to add the component in any layout structure.
|
|
@@ -45,8 +15,8 @@ const DeckSwiper = ({ onIndexChanged, onEndReached, startCardIndex = 0, infinite
|
|
|
45
15
|
* This effectivley makes the default height of the container be the height of the first card.
|
|
46
16
|
*/
|
|
47
17
|
return (React.createElement(View, null,
|
|
48
|
-
React.createElement(View, { style: styles.containerHeightFiller },
|
|
49
|
-
React.createElement(DeckSwiperComponent, { cards:
|
|
18
|
+
React.createElement(View, { style: styles.containerHeightFiller }, childrenArray.length && childrenArray[0]),
|
|
19
|
+
React.createElement(DeckSwiperComponent, { cards: cardsFillerData, renderCard: (_, i) => React.createElement(React.Fragment, null, childrenArray[i]), keyExtractor: (card) => card === null || card === void 0 ? void 0 : card.toString(), containerStyle: StyleSheet.flatten([styles.cardsContainer, style]), cardStyle: styles.card, onSwiped: onIndexChanged, onSwipedAll: onEndReached, cardIndex: startCardIndex, infinite: infiniteSwiping, verticalSwipe: verticalEnabled, horizontalSwipe: horizontalEnabled, showSecondCard: visibleCardCount > 1, stackSize: visibleCardCount, backgroundColor: "transparent", cardVerticalMargin: 0, cardHorizontalMargin: 0 })));
|
|
50
20
|
};
|
|
51
21
|
const styles = StyleSheet.create({
|
|
52
22
|
cardsContainer: {
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { StyleProp, ViewStyle, StyleSheet, View } from "react-native";
|
|
3
3
|
import DeckSwiperComponent from "react-native-deck-swiper";
|
|
4
4
|
|
|
5
|
-
export interface DeckSwiperProps
|
|
5
|
+
export interface DeckSwiperProps {
|
|
6
6
|
onIndexChanged?: (index: number) => void;
|
|
7
7
|
onEndReached?: () => void;
|
|
8
8
|
startCardIndex?: number;
|
|
@@ -10,13 +10,10 @@ export interface DeckSwiperProps<T> {
|
|
|
10
10
|
verticalEnabled?: boolean;
|
|
11
11
|
horizontalEnabled?: boolean;
|
|
12
12
|
visibleCardCount?: number;
|
|
13
|
-
data?: Array<T>;
|
|
14
|
-
keyExtractor?: (item: T) => string;
|
|
15
|
-
renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;
|
|
16
13
|
style?: StyleProp<ViewStyle>;
|
|
17
14
|
}
|
|
18
15
|
|
|
19
|
-
const DeckSwiper
|
|
16
|
+
const DeckSwiper: React.FC<React.PropsWithChildren<DeckSwiperProps>> = ({
|
|
20
17
|
onIndexChanged,
|
|
21
18
|
onEndReached,
|
|
22
19
|
startCardIndex = 0,
|
|
@@ -24,25 +21,9 @@ const DeckSwiper = <T extends object>({
|
|
|
24
21
|
verticalEnabled = true,
|
|
25
22
|
horizontalEnabled = true,
|
|
26
23
|
visibleCardCount = 1,
|
|
27
|
-
data,
|
|
28
|
-
keyExtractor,
|
|
29
|
-
renderItem,
|
|
30
24
|
style,
|
|
31
25
|
children,
|
|
32
|
-
}
|
|
33
|
-
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
34
|
-
if ((data && !renderItem) || (renderItem && !data)) {
|
|
35
|
-
throw new Error(
|
|
36
|
-
"'renderItem' and 'data' need to both be provided to lazily render. Either remove them entirley or include both"
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (data && renderItem && children) {
|
|
41
|
-
console.warn(
|
|
42
|
-
"'children' of DeckSwiper ignored due to usage of 'data' and 'renderItem'"
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
26
|
+
}) => {
|
|
46
27
|
const childrenArray = React.useMemo(
|
|
47
28
|
() => React.Children.toArray(children),
|
|
48
29
|
[children]
|
|
@@ -54,31 +35,6 @@ const DeckSwiper = <T extends object>({
|
|
|
54
35
|
[childrenArray]
|
|
55
36
|
);
|
|
56
37
|
|
|
57
|
-
const cardsData = data || cardsFillerData;
|
|
58
|
-
|
|
59
|
-
const renderCard = (card: any, index: number): JSX.Element => {
|
|
60
|
-
if (renderItem) {
|
|
61
|
-
return renderItem({ item: card, index });
|
|
62
|
-
} else {
|
|
63
|
-
return <>{childrenArray[index]}</>;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const renderFirstCard = (): JSX.Element | undefined => {
|
|
68
|
-
if (cardsData.length) {
|
|
69
|
-
return renderCard(cardsData[0], 0);
|
|
70
|
-
}
|
|
71
|
-
return undefined;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const cardKeyExtractor = (card: any) => {
|
|
75
|
-
if (keyExtractor) {
|
|
76
|
-
return keyExtractor(card);
|
|
77
|
-
} else {
|
|
78
|
-
return card?.toString();
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
38
|
/**
|
|
83
39
|
* By default react-native-deck-swiper positions everything with absolute position.
|
|
84
40
|
* To overcome this, it is wrapped in a View to be able to add the component in any layout structure.
|
|
@@ -91,11 +47,13 @@ const DeckSwiper = <T extends object>({
|
|
|
91
47
|
|
|
92
48
|
return (
|
|
93
49
|
<View>
|
|
94
|
-
<View style={styles.containerHeightFiller}>
|
|
50
|
+
<View style={styles.containerHeightFiller}>
|
|
51
|
+
{childrenArray.length && childrenArray[0]}
|
|
52
|
+
</View>
|
|
95
53
|
<DeckSwiperComponent
|
|
96
|
-
cards={
|
|
97
|
-
renderCard={
|
|
98
|
-
keyExtractor={
|
|
54
|
+
cards={cardsFillerData}
|
|
55
|
+
renderCard={(_, i) => <>{childrenArray[i]}</>}
|
|
56
|
+
keyExtractor={(card) => card?.toString()}
|
|
99
57
|
containerStyle={
|
|
100
58
|
StyleSheet.flatten([styles.cardsContainer, style]) as
|
|
101
59
|
| object
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleSheet } from "react-native";
|
|
3
3
|
import { withTheme } from "../../theming";
|
|
4
|
-
const DeckSwiperCard = ({ style, children, theme }) => (React.createElement(View, { style: [
|
|
4
|
+
const DeckSwiperCard = ({ style, children, theme, }) => (React.createElement(View, { style: [
|
|
5
5
|
styles.card,
|
|
6
6
|
{
|
|
7
7
|
backgroundColor: theme.colors.background,
|
|
@@ -5,12 +5,15 @@ import { withTheme } from "../../theming";
|
|
|
5
5
|
|
|
6
6
|
export interface DeckSwiperCardProps {
|
|
7
7
|
style?: StyleProp<ViewStyle>;
|
|
8
|
+
children: React.ReactNode;
|
|
8
9
|
theme: Theme;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
const DeckSwiperCard: React.FC<
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const DeckSwiperCard: React.FC<DeckSwiperCardProps> = ({
|
|
13
|
+
style,
|
|
14
|
+
children,
|
|
15
|
+
theme,
|
|
16
|
+
}) => (
|
|
14
17
|
<View
|
|
15
18
|
style={[
|
|
16
19
|
styles.card,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
3
|
+
const Shadow = ({ offsetX = 0, offsetY = 0, showShadowSideStart = true, showShadowSideEnd = true, showShadowSideTop = true, showShadowSideBottom = true, showShadowCornerTopStart = true, showShadowCornerTopEnd = true, showShadowCornerBottomStart = true, showShadowCornerBottomEnd = true, ...rest }) => {
|
|
4
|
+
return (React.createElement(ShadowComponent, { offset: [offsetX, offsetY], sides: {
|
|
5
|
+
start: showShadowSideStart,
|
|
6
|
+
end: showShadowSideEnd,
|
|
7
|
+
top: showShadowSideTop,
|
|
8
|
+
bottom: showShadowSideBottom,
|
|
9
|
+
}, corners: {
|
|
10
|
+
topStart: showShadowCornerTopStart,
|
|
11
|
+
topEnd: showShadowCornerTopEnd,
|
|
12
|
+
bottomStart: showShadowCornerBottomStart,
|
|
13
|
+
bottomEnd: showShadowCornerBottomEnd,
|
|
14
|
+
}, ...rest }));
|
|
15
|
+
};
|
|
16
|
+
export default Shadow;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
4
|
+
|
|
5
|
+
interface ShadowProps {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
startColor?: string;
|
|
8
|
+
endColor?: string;
|
|
9
|
+
distance?: number;
|
|
10
|
+
paintInside?: boolean;
|
|
11
|
+
stretch?: boolean;
|
|
12
|
+
offsetX?: number;
|
|
13
|
+
offsetY?: number;
|
|
14
|
+
showShadowSideStart?: boolean;
|
|
15
|
+
showShadowSideEnd?: boolean;
|
|
16
|
+
showShadowSideTop?: boolean;
|
|
17
|
+
showShadowSideBottom?: boolean;
|
|
18
|
+
showShadowCornerTopStart?: boolean;
|
|
19
|
+
showShadowCornerTopEnd?: boolean;
|
|
20
|
+
showShadowCornerBottomStart?: boolean;
|
|
21
|
+
showShadowCornerBottomEnd?: boolean;
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Shadow: React.FC<React.PropsWithChildren<ShadowProps>> = ({
|
|
26
|
+
offsetX = 0,
|
|
27
|
+
offsetY = 0,
|
|
28
|
+
showShadowSideStart = true,
|
|
29
|
+
showShadowSideEnd = true,
|
|
30
|
+
showShadowSideTop = true,
|
|
31
|
+
showShadowSideBottom = true,
|
|
32
|
+
showShadowCornerTopStart = true,
|
|
33
|
+
showShadowCornerTopEnd = true,
|
|
34
|
+
showShadowCornerBottomStart = true,
|
|
35
|
+
showShadowCornerBottomEnd = true,
|
|
36
|
+
...rest
|
|
37
|
+
}) => {
|
|
38
|
+
return (
|
|
39
|
+
<ShadowComponent
|
|
40
|
+
offset={[offsetX, offsetY]}
|
|
41
|
+
sides={{
|
|
42
|
+
start: showShadowSideStart,
|
|
43
|
+
end: showShadowSideEnd,
|
|
44
|
+
top: showShadowSideTop,
|
|
45
|
+
bottom: showShadowSideBottom,
|
|
46
|
+
}}
|
|
47
|
+
corners={{
|
|
48
|
+
topStart: showShadowCornerTopStart,
|
|
49
|
+
topEnd: showShadowCornerTopEnd,
|
|
50
|
+
bottomStart: showShadowCornerBottomStart,
|
|
51
|
+
bottomEnd: showShadowCornerBottomEnd,
|
|
52
|
+
}}
|
|
53
|
+
{...rest}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default Shadow;
|
package/src/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
+
export { default as Shadow } from "./components/Shadow";
|
|
34
35
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
35
36
|
/* Deprecated: Fix or Delete! */
|
|
36
37
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
package/src/index.tsx
CHANGED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, CONTAINER_COMPONENT_STYLES_SECTIONS, createColorProp, createStaticNumberProp, createStaticBoolProp, createDisabledProp, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Shadow",
|
|
4
|
+
tag: "Shadow",
|
|
5
|
+
description: "A cross-platform, universal shadow.",
|
|
6
|
+
category: COMPONENT_TYPES.view,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
+
props: {
|
|
9
|
+
disabled: createDisabledProp({
|
|
10
|
+
description: "Disables the shadow.",
|
|
11
|
+
}),
|
|
12
|
+
startColor: createColorProp({
|
|
13
|
+
label: "Start Color",
|
|
14
|
+
description: "The initial gradient color of the shadow.",
|
|
15
|
+
defaultValue: null,
|
|
16
|
+
}),
|
|
17
|
+
endColor: createColorProp({
|
|
18
|
+
label: "End Color",
|
|
19
|
+
description: "The final gradient color of the shadow.",
|
|
20
|
+
defaultValue: null,
|
|
21
|
+
}),
|
|
22
|
+
distance: createStaticNumberProp({
|
|
23
|
+
label: "Distance",
|
|
24
|
+
description: "The distance of the shadow.",
|
|
25
|
+
}),
|
|
26
|
+
paintInside: createStaticBoolProp({
|
|
27
|
+
label: "Paint Inside",
|
|
28
|
+
description: "Apply the shadow below/inside the content.",
|
|
29
|
+
defaultValue: null,
|
|
30
|
+
}),
|
|
31
|
+
stretch: createStaticBoolProp({
|
|
32
|
+
label: "Stretch",
|
|
33
|
+
description: "Force children to occupy all available horizontal space.",
|
|
34
|
+
defaultValue: null,
|
|
35
|
+
}),
|
|
36
|
+
offsetX: createStaticNumberProp({
|
|
37
|
+
label: "Offset X",
|
|
38
|
+
description: "Moves the shadow in the x direction",
|
|
39
|
+
defeaultValue: 0,
|
|
40
|
+
}),
|
|
41
|
+
offsetY: createStaticNumberProp({
|
|
42
|
+
label: "Offset Y",
|
|
43
|
+
description: "Moves the shadow in the y direction",
|
|
44
|
+
defeaultValue: 0,
|
|
45
|
+
}),
|
|
46
|
+
showShadowSideStart: createStaticBoolProp({
|
|
47
|
+
label: "Show Shadow Start",
|
|
48
|
+
description: "Whether to show shadow on the start side or not",
|
|
49
|
+
defaultValue: true,
|
|
50
|
+
}),
|
|
51
|
+
showShadowSideEnd: createStaticBoolProp({
|
|
52
|
+
label: "Show Shadow End",
|
|
53
|
+
description: "Whether to show shadow on the end side or not",
|
|
54
|
+
defaultValue: true,
|
|
55
|
+
}),
|
|
56
|
+
showShadowSideTop: createStaticBoolProp({
|
|
57
|
+
label: "Show Shadow Top",
|
|
58
|
+
description: "Whether to show shadow on the top side or not",
|
|
59
|
+
defaultValue: true,
|
|
60
|
+
}),
|
|
61
|
+
showShadowSideBottom: createStaticBoolProp({
|
|
62
|
+
label: "Show Shadow Bottom",
|
|
63
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
64
|
+
defaultValue: true,
|
|
65
|
+
}),
|
|
66
|
+
showShadowCornerTopStart: createStaticBoolProp({
|
|
67
|
+
label: "Show Shadow Top Start Corner",
|
|
68
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
69
|
+
defaultValue: true,
|
|
70
|
+
}),
|
|
71
|
+
showShadowCornerTopEnd: createStaticBoolProp({
|
|
72
|
+
label: "Show Shadow Top End Corner",
|
|
73
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
74
|
+
defaultValue: true,
|
|
75
|
+
}),
|
|
76
|
+
showShadowCornerBottomStart: createStaticBoolProp({
|
|
77
|
+
label: "Show Shadow Bottom Start Corner",
|
|
78
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
79
|
+
defaultValue: true,
|
|
80
|
+
}),
|
|
81
|
+
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
82
|
+
label: "Show Shadow Bottom End Corner",
|
|
83
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
84
|
+
defaultValue: true,
|
|
85
|
+
}),
|
|
86
|
+
},
|
|
87
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
4
|
+
createColorProp,
|
|
5
|
+
createStaticNumberProp,
|
|
6
|
+
createStaticBoolProp,
|
|
7
|
+
createDisabledProp,
|
|
8
|
+
} from "@draftbit/types";
|
|
9
|
+
|
|
10
|
+
export const SEED_DATA = {
|
|
11
|
+
name: "Shadow",
|
|
12
|
+
tag: "Shadow",
|
|
13
|
+
description: "A cross-platform, universal shadow.",
|
|
14
|
+
category: COMPONENT_TYPES.view,
|
|
15
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
16
|
+
props: {
|
|
17
|
+
disabled: createDisabledProp({
|
|
18
|
+
description: "Disables the shadow.",
|
|
19
|
+
}),
|
|
20
|
+
startColor: createColorProp({
|
|
21
|
+
label: "Start Color",
|
|
22
|
+
description: "The initial gradient color of the shadow.",
|
|
23
|
+
defaultValue: null,
|
|
24
|
+
}),
|
|
25
|
+
endColor: createColorProp({
|
|
26
|
+
label: "End Color",
|
|
27
|
+
description: "The final gradient color of the shadow.",
|
|
28
|
+
defaultValue: null,
|
|
29
|
+
}),
|
|
30
|
+
distance: createStaticNumberProp({
|
|
31
|
+
label: "Distance",
|
|
32
|
+
description: "The distance of the shadow.",
|
|
33
|
+
}),
|
|
34
|
+
paintInside: createStaticBoolProp({
|
|
35
|
+
label: "Paint Inside",
|
|
36
|
+
description: "Apply the shadow below/inside the content.",
|
|
37
|
+
defaultValue: null,
|
|
38
|
+
}),
|
|
39
|
+
stretch: createStaticBoolProp({
|
|
40
|
+
label: "Stretch",
|
|
41
|
+
description: "Force children to occupy all available horizontal space.",
|
|
42
|
+
defaultValue: null,
|
|
43
|
+
}),
|
|
44
|
+
offsetX: createStaticNumberProp({
|
|
45
|
+
label: "Offset X",
|
|
46
|
+
description: "Moves the shadow in the x direction",
|
|
47
|
+
defeaultValue: 0,
|
|
48
|
+
}),
|
|
49
|
+
offsetY: createStaticNumberProp({
|
|
50
|
+
label: "Offset Y",
|
|
51
|
+
description: "Moves the shadow in the y direction",
|
|
52
|
+
defeaultValue: 0,
|
|
53
|
+
}),
|
|
54
|
+
showShadowSideStart: createStaticBoolProp({
|
|
55
|
+
label: "Show Shadow Start",
|
|
56
|
+
description: "Whether to show shadow on the start side or not",
|
|
57
|
+
defaultValue: true,
|
|
58
|
+
}),
|
|
59
|
+
showShadowSideEnd: createStaticBoolProp({
|
|
60
|
+
label: "Show Shadow End",
|
|
61
|
+
description: "Whether to show shadow on the end side or not",
|
|
62
|
+
defaultValue: true,
|
|
63
|
+
}),
|
|
64
|
+
showShadowSideTop: createStaticBoolProp({
|
|
65
|
+
label: "Show Shadow Top",
|
|
66
|
+
description: "Whether to show shadow on the top side or not",
|
|
67
|
+
defaultValue: true,
|
|
68
|
+
}),
|
|
69
|
+
showShadowSideBottom: createStaticBoolProp({
|
|
70
|
+
label: "Show Shadow Bottom",
|
|
71
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
72
|
+
defaultValue: true,
|
|
73
|
+
}),
|
|
74
|
+
showShadowCornerTopStart: createStaticBoolProp({
|
|
75
|
+
label: "Show Shadow Top Start Corner",
|
|
76
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
77
|
+
defaultValue: true,
|
|
78
|
+
}),
|
|
79
|
+
showShadowCornerTopEnd: createStaticBoolProp({
|
|
80
|
+
label: "Show Shadow Top End Corner",
|
|
81
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
82
|
+
defaultValue: true,
|
|
83
|
+
}),
|
|
84
|
+
showShadowCornerBottomStart: createStaticBoolProp({
|
|
85
|
+
label: "Show Shadow Bottom Start Corner",
|
|
86
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
87
|
+
defaultValue: true,
|
|
88
|
+
}),
|
|
89
|
+
showShadowCornerBottomEnd: createStaticBoolProp({
|
|
90
|
+
label: "Show Shadow Bottom End Corner",
|
|
91
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
92
|
+
defaultValue: true,
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
};
|