@draftbit/core 46.8.2-e0b610.2 → 46.8.2-fad2ca.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/Elevation.js +2 -14
- package/lib/commonjs/components/TabView/TabView.js +100 -0
- package/lib/commonjs/components/TabView/TabViewItem.js +25 -0
- package/lib/commonjs/components/TabView/index.js +20 -0
- package/lib/commonjs/index.js +13 -7
- package/lib/commonjs/mappings/TabView.js +73 -0
- package/lib/commonjs/mappings/TabViewItem.js +36 -0
- package/lib/module/components/AspectRatio.js +1 -18
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
- package/lib/module/components/TabView/TabView.js +90 -0
- package/lib/module/components/TabView/TabViewItem.js +20 -0
- package/lib/module/components/TabView/index.js +2 -0
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/TabView.js +66 -0
- package/lib/module/mappings/TabViewItem.js +29 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts +26 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts.map +1 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +11 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -0
- package/lib/typescript/src/components/TabView/index.d.ts +3 -0
- package/lib/typescript/src/components/TabView/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/{Shadow.d.ts → TabView.d.ts} +32 -82
- package/lib/typescript/src/mappings/TabView.d.ts.map +1 -0
- package/lib/typescript/src/mappings/TabViewItem.d.ts +25 -0
- package/lib/typescript/src/mappings/TabViewItem.d.ts.map +1 -0
- package/package.json +5 -4
- package/src/components/TabView/TabView.js +45 -0
- package/src/components/TabView/TabView.tsx +129 -0
- package/src/components/TabView/TabViewItem.js +11 -0
- package/src/components/TabView/TabViewItem.tsx +25 -0
- package/src/components/TabView/index.js +2 -0
- package/src/components/TabView/index.tsx +2 -0
- package/src/index.js +1 -1
- package/src/index.tsx +2 -2
- package/src/mappings/TabView.js +69 -0
- package/src/mappings/TabView.ts +79 -0
- package/src/mappings/TabViewItem.js +29 -0
- package/src/mappings/TabViewItem.ts +37 -0
- package/lib/commonjs/components/Shadow.js +0 -46
- package/lib/commonjs/mappings/Shadow.js +0 -94
- package/lib/module/components/Shadow.js +0 -38
- package/lib/module/mappings/Shadow.js +0 -87
- package/lib/typescript/src/components/Shadow.d.ts +0 -24
- package/lib/typescript/src/components/Shadow.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Shadow.d.ts.map +0 -1
- package/src/components/Shadow.js +0 -16
- package/src/components/Shadow.tsx +0 -62
- package/src/mappings/Shadow.js +0 -87
- package/src/mappings/Shadow.ts +0 -95
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createTextEnumProp,
|
|
4
|
+
createColorProp,
|
|
5
|
+
BLOCK_STYLES_SECTIONS,
|
|
6
|
+
StylesPanelSections,
|
|
7
|
+
Triggers,
|
|
8
|
+
createActionProp,
|
|
9
|
+
createStaticBoolProp,
|
|
10
|
+
} from "@draftbit/types";
|
|
11
|
+
|
|
12
|
+
export const SEED_DATA = {
|
|
13
|
+
name: "Tab View",
|
|
14
|
+
tag: "TabView",
|
|
15
|
+
description: "Tab view container",
|
|
16
|
+
category: COMPONENT_TYPES.swiper,
|
|
17
|
+
stylesPanelSections: [
|
|
18
|
+
...BLOCK_STYLES_SECTIONS,
|
|
19
|
+
StylesPanelSections.Background,
|
|
20
|
+
],
|
|
21
|
+
triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
|
|
22
|
+
props: {
|
|
23
|
+
onIndexChanged: createActionProp({
|
|
24
|
+
label: "On index changed",
|
|
25
|
+
description: "Action to execute when swipe to new index",
|
|
26
|
+
}),
|
|
27
|
+
onEndReached: createActionProp({
|
|
28
|
+
label: "On end reached",
|
|
29
|
+
description: "Action to execute when end of swiping reached",
|
|
30
|
+
}),
|
|
31
|
+
tabBarPosition: createTextEnumProp({
|
|
32
|
+
label: "Tab Bar Position",
|
|
33
|
+
description: "Position of tab bar",
|
|
34
|
+
options: ["top", "bottom"],
|
|
35
|
+
defaultValue: "top",
|
|
36
|
+
}),
|
|
37
|
+
keyboardDismissMode: createTextEnumProp({
|
|
38
|
+
label: "Keyboard Dismiss Mode",
|
|
39
|
+
description: "Keyboard Dismiss Mode",
|
|
40
|
+
options: ["auto", "on-drag", "none"],
|
|
41
|
+
defaultValue: "auto",
|
|
42
|
+
}),
|
|
43
|
+
swipeEnabled: createStaticBoolProp({
|
|
44
|
+
label: "Swipe Enabled",
|
|
45
|
+
description: "Whether swiping is enabled or not",
|
|
46
|
+
defaultValue: true,
|
|
47
|
+
}),
|
|
48
|
+
scrollEnabled: createStaticBoolProp({
|
|
49
|
+
label: "Scroll Enabled",
|
|
50
|
+
description: "Whether scrolling of tabs is enabled or not",
|
|
51
|
+
defaultValue: true,
|
|
52
|
+
}),
|
|
53
|
+
activeColor: createColorProp({
|
|
54
|
+
label: "Active Color",
|
|
55
|
+
description: "Color of icon and text of active tab",
|
|
56
|
+
defaultValue: "primary",
|
|
57
|
+
}),
|
|
58
|
+
inactiveColor: createColorProp({
|
|
59
|
+
label: "Inactive Color",
|
|
60
|
+
description: "Color of icon and text of inactive tab(s)",
|
|
61
|
+
defaultValue: null,
|
|
62
|
+
}),
|
|
63
|
+
pressColor: createColorProp({
|
|
64
|
+
label: "Press Color",
|
|
65
|
+
description: "Color of ripple when pressed (android only)",
|
|
66
|
+
defaultValue: "primary",
|
|
67
|
+
}),
|
|
68
|
+
indicatorColor: createColorProp({
|
|
69
|
+
label: "Indicator Color",
|
|
70
|
+
description: "Color of indicator",
|
|
71
|
+
defaultValue: "primary",
|
|
72
|
+
}),
|
|
73
|
+
tabsBackgroundColor: createColorProp({
|
|
74
|
+
label: "Tabs Background Color",
|
|
75
|
+
description: "Background color of tabs container",
|
|
76
|
+
defaultValue: "background",
|
|
77
|
+
}),
|
|
78
|
+
},
|
|
79
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createTextProp, createIconProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Tab View Item",
|
|
4
|
+
tag: "TabViewItem",
|
|
5
|
+
description: "Single Tab View item to be used in TabView. Each item represents a single tab and its content",
|
|
6
|
+
category: COMPONENT_TYPES.swiper,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
+
layout: {
|
|
9
|
+
flex: 1,
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
title: createTextProp({
|
|
13
|
+
label: "Title",
|
|
14
|
+
description: "Title of tab item",
|
|
15
|
+
defaultValue: null,
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
icon: createIconProp({
|
|
19
|
+
defaultValue: null,
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
accessibilityLabel: createTextProp({
|
|
23
|
+
label: "Accessibility Label",
|
|
24
|
+
description: "Accessibility Label",
|
|
25
|
+
defaultValue: null,
|
|
26
|
+
group: GROUPS.accessibility,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createTextProp,
|
|
4
|
+
createIconProp,
|
|
5
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
|
+
GROUPS,
|
|
7
|
+
} from "@draftbit/types";
|
|
8
|
+
|
|
9
|
+
export const SEED_DATA = {
|
|
10
|
+
name: "Tab View Item",
|
|
11
|
+
tag: "TabViewItem",
|
|
12
|
+
description:
|
|
13
|
+
"Single Tab View item to be used in TabView. Each item represents a single tab and its content",
|
|
14
|
+
category: COMPONENT_TYPES.swiper,
|
|
15
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
16
|
+
layout: {
|
|
17
|
+
flex: 1,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
title: createTextProp({
|
|
21
|
+
label: "Title",
|
|
22
|
+
description: "Title of tab item",
|
|
23
|
+
defaultValue: null,
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
icon: createIconProp({
|
|
27
|
+
defaultValue: null,
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
accessibilityLabel: createTextProp({
|
|
31
|
+
label: "Accessibility Label",
|
|
32
|
+
description: "Accessibility Label",
|
|
33
|
+
defaultValue: null,
|
|
34
|
+
group: GROUPS.accessibility,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -1,46 +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 _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
|
-
paintInside = false,
|
|
24
|
-
style,
|
|
25
|
-
...rest
|
|
26
|
-
} = _ref;
|
|
27
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeShadow.Shadow, _extends({
|
|
28
|
-
offset: [offsetX, offsetY],
|
|
29
|
-
sides: {
|
|
30
|
-
start: showShadowSideStart,
|
|
31
|
-
end: showShadowSideEnd,
|
|
32
|
-
top: showShadowSideTop,
|
|
33
|
-
bottom: showShadowSideBottom
|
|
34
|
-
},
|
|
35
|
-
corners: {
|
|
36
|
-
topStart: showShadowCornerTopStart,
|
|
37
|
-
topEnd: showShadowCornerTopEnd,
|
|
38
|
-
bottomStart: showShadowCornerBottomStart,
|
|
39
|
-
bottomEnd: showShadowCornerBottomEnd
|
|
40
|
-
},
|
|
41
|
-
containerStyle: style,
|
|
42
|
-
paintInside: paintInside
|
|
43
|
-
}, rest));
|
|
44
|
-
};
|
|
45
|
-
var _default = Shadow;
|
|
46
|
-
exports.default = _default;
|
|
@@ -1,94 +0,0 @@
|
|
|
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: false
|
|
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;
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
paintInside = false,
|
|
17
|
-
style,
|
|
18
|
-
...rest
|
|
19
|
-
} = _ref;
|
|
20
|
-
return /*#__PURE__*/React.createElement(ShadowComponent, _extends({
|
|
21
|
-
offset: [offsetX, offsetY],
|
|
22
|
-
sides: {
|
|
23
|
-
start: showShadowSideStart,
|
|
24
|
-
end: showShadowSideEnd,
|
|
25
|
-
top: showShadowSideTop,
|
|
26
|
-
bottom: showShadowSideBottom
|
|
27
|
-
},
|
|
28
|
-
corners: {
|
|
29
|
-
topStart: showShadowCornerTopStart,
|
|
30
|
-
topEnd: showShadowCornerTopEnd,
|
|
31
|
-
bottomStart: showShadowCornerBottomStart,
|
|
32
|
-
bottomEnd: showShadowCornerBottomEnd
|
|
33
|
-
},
|
|
34
|
-
containerStyle: style,
|
|
35
|
-
paintInside: paintInside
|
|
36
|
-
}, rest));
|
|
37
|
-
};
|
|
38
|
-
export default Shadow;
|
|
@@ -1,87 +0,0 @@
|
|
|
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: false
|
|
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,24 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,CAmC1D,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Shadow.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFrB,CAAC"}
|
package/src/components/Shadow.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
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, paintInside = false, style, ...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
|
-
}, containerStyle: style, paintInside: paintInside, ...rest }));
|
|
15
|
-
};
|
|
16
|
-
export default Shadow;
|
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
paintInside = false,
|
|
37
|
-
style,
|
|
38
|
-
...rest
|
|
39
|
-
}) => {
|
|
40
|
-
return (
|
|
41
|
-
<ShadowComponent
|
|
42
|
-
offset={[offsetX, offsetY]}
|
|
43
|
-
sides={{
|
|
44
|
-
start: showShadowSideStart,
|
|
45
|
-
end: showShadowSideEnd,
|
|
46
|
-
top: showShadowSideTop,
|
|
47
|
-
bottom: showShadowSideBottom,
|
|
48
|
-
}}
|
|
49
|
-
corners={{
|
|
50
|
-
topStart: showShadowCornerTopStart,
|
|
51
|
-
topEnd: showShadowCornerTopEnd,
|
|
52
|
-
bottomStart: showShadowCornerBottomStart,
|
|
53
|
-
bottomEnd: showShadowCornerBottomEnd,
|
|
54
|
-
}}
|
|
55
|
-
containerStyle={style}
|
|
56
|
-
paintInside={paintInside}
|
|
57
|
-
{...rest}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default Shadow;
|
package/src/mappings/Shadow.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
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: false,
|
|
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
|
-
};
|