@draftbit/core 46.10.3-877a3f.2 → 46.10.3-b95a8c.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.
Files changed (31) hide show
  1. package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
  2. package/lib/commonjs/components/Checkbox/context.js +1 -1
  3. package/lib/commonjs/constants.js +1 -1
  4. package/lib/commonjs/index.js +0 -7
  5. package/lib/commonjs/mappings/NativeBase/Layout.js +7 -13
  6. package/lib/module/components/DeprecatedFAB.js +3 -23
  7. package/lib/module/components/Elevation.js +2 -14
  8. package/lib/module/constants.js +1 -0
  9. package/lib/module/index.js +0 -1
  10. package/lib/module/mappings/NativeBase/Layout.js +8 -14
  11. package/lib/typescript/src/index.d.ts +0 -1
  12. package/lib/typescript/src/index.d.ts.map +1 -1
  13. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +15 -26
  14. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -1
  15. package/package.json +3 -3
  16. package/src/index.js +0 -1
  17. package/src/index.tsx +0 -1
  18. package/src/mappings/NativeBase/Layout.js +11 -13
  19. package/src/mappings/NativeBase/Layout.ts +11 -13
  20. package/lib/commonjs/components/Container.js +0 -93
  21. package/lib/commonjs/mappings/Container.js +0 -37
  22. package/lib/module/components/Container.js +0 -83
  23. package/lib/module/mappings/Container.js +0 -30
  24. package/lib/typescript/src/components/Container.d.ts +0 -21
  25. package/lib/typescript/src/components/Container.d.ts.map +0 -1
  26. package/lib/typescript/src/mappings/Container.d.ts +0 -55
  27. package/lib/typescript/src/mappings/Container.d.ts.map +0 -1
  28. package/src/components/Container.js +0 -43
  29. package/src/components/Container.tsx +0 -116
  30. package/src/mappings/Container.js +0 -30
  31. package/src/mappings/Container.ts +0 -41
@@ -14,7 +14,8 @@ 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
- var Direction;
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
+ let Direction;
18
19
  exports.Direction = Direction;
19
20
  (function (Direction) {
20
21
  Direction["Row"] = "row";
@@ -57,6 +58,7 @@ const CheckboxRow = _ref => {
57
58
  setInternalValue(status);
58
59
  }
59
60
  }, [status]);
61
+
60
62
  // This special logic is to handle weird APIs like Airtable that return
61
63
  // true or undefined for a boolean
62
64
  const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
@@ -80,14 +82,13 @@ const CheckboxRow = _ref => {
80
82
  textStyles,
81
83
  viewStyles
82
84
  } = (0, _utilities.extractStyles)(style);
83
- return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
85
+ return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
84
86
  onPress: handlePress,
85
87
  style: [viewStyles, styles.mainParent, {
86
88
  flexDirection: direction
87
89
  }],
88
- disabled: disabled,
89
- ...rest
90
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
90
+ disabled: disabled
91
+ }, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
91
92
  style: [styles.label, {
92
93
  alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
93
94
  }, labelContainerStyle]
@@ -124,22 +125,4 @@ const styles = _reactNative.StyleSheet.create({
124
125
  }
125
126
  });
126
127
  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;
145
128
  exports.default = _default;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.checkboxGroupContext = exports.Direction = void 0;
7
7
  exports.useCheckboxGroupContext = useCheckboxGroupContext;
8
8
  var _react = require("react");
9
- let Direction;
9
+ var Direction;
10
10
  exports.Direction = Direction;
11
11
  (function (Direction) {
12
12
  Direction["Horizontal"] = "horizontal";
@@ -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;AR_HEIGHT;
15
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
@@ -117,12 +117,6 @@ Object.defineProperty(exports, "CircleImage", {
117
117
  return _CircleImage.default;
118
118
  }
119
119
  });
120
- Object.defineProperty(exports, "Container", {
121
- enumerable: true,
122
- get: function () {
123
- return _Container.default;
124
- }
125
- });
126
120
  Object.defineProperty(exports, "DatePicker", {
127
121
  enumerable: true,
128
122
  get: function () {
@@ -410,7 +404,6 @@ var _CircleImage = _interopRequireDefault(require("./components/CircleImage"));
410
404
  var _AvatarEdit = _interopRequireDefault(require("./components/AvatarEdit"));
411
405
  var _Card = _interopRequireDefault(require("./components/Card"));
412
406
  var _Checkbox = require("./components/Checkbox");
413
- var _Container = _interopRequireDefault(require("./components/Container"));
414
407
  var _Divider = _interopRequireDefault(require("./components/Divider"));
415
408
  var _FAB = _interopRequireDefault(require("./components/FAB"));
416
409
  var _FieldSearchBarFull = _interopRequireDefault(require("./components/FieldSearchBarFull"));
@@ -45,9 +45,10 @@ const SEED_DATA = [{
45
45
  tag: "Container",
46
46
  description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
47
47
  props: {
48
- centerContent: (0, _types.createBoolProp)({
48
+ centerContent: (0, _types.createStaticBoolProp)({
49
49
  label: "Center content",
50
- description: "Center child elements based on their content width"
50
+ description: "Center child elements based on their content width",
51
+ defaultValue: true
51
52
  })
52
53
  },
53
54
  ...SHARED_SEED_DATA
@@ -71,24 +72,17 @@ const SEED_DATA = [{
71
72
  name: "Spacer",
72
73
  tag: "Spacer",
73
74
  description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
75
+ layout: {
76
+ flex: 1
77
+ },
74
78
  ...SHARED_SEED_DATA,
75
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
79
+ stylesPanelSections: [_types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.Background, _types.StylesPanelSections.Margins]
76
80
  }, {
77
81
  name: "Stack",
78
82
  tag: "Stack",
79
83
  description: "Stack aligns items vertically or horizontally based on the direction prop",
80
84
  ...SHARED_SEED_DATA,
81
85
  props: {
82
- direction: (0, _types.createTextEnumProp)({
83
- label: "Direction",
84
- description: "The direction of the Stack",
85
- options: ["row", "column"],
86
- defaultValue: "column"
87
- }),
88
- reversed: (0, _types.createBoolProp)({
89
- label: "Reversed",
90
- description: "Determines whether to reverse the direction of items"
91
- }),
92
86
  isDisabled: (0, _types.createBoolProp)({
93
87
  label: "Disabled",
94
88
  description: "If true, the Stack will be disabled"
@@ -1,3 +1,4 @@
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); }
1
2
  import * as React from "react";
2
3
  import { ActivityIndicator, View, StyleSheet, Pressable } from "react-native";
3
4
  import color from "color";
@@ -96,8 +97,7 @@ const FAB = _ref => {
96
97
  style: [{
97
98
  elevation
98
99
  }, style]
99
- }, /*#__PURE__*/React.createElement(Pressable, {
100
- ...rest,
100
+ }, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
101
101
  onPress: onPress,
102
102
  accessibilityState: {
103
103
  disabled
@@ -105,7 +105,7 @@ const FAB = _ref => {
105
105
  accessibilityRole: "button",
106
106
  disabled: disabled || loading,
107
107
  style: buttonStyles
108
- }, /*#__PURE__*/React.createElement(View, {
108
+ }), /*#__PURE__*/React.createElement(View, {
109
109
  style: styles.content
110
110
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
111
111
  style: iconStyle
@@ -144,24 +144,4 @@ const styles = StyleSheet.create({
144
144
  borderRadius: 0
145
145
  }
146
146
  });
147
- export default withTheme(FAB);le: "solid"
148
- },
149
- content: {
150
- flexDirection: "row",
151
- alignItems: "center",
152
- justifyContent: "center"
153
- },
154
- icon: {
155
- alignItems: "center",
156
- justifyContent: "center",
157
- width: Config.buttonIconSize
158
- },
159
- fixed: {
160
- left: 0,
161
- right: 0,
162
- bottom: 0,
163
- height: 64,
164
- borderRadius: 0
165
- }
166
- });
167
147
  export default withTheme(FAB);
@@ -1,3 +1,4 @@
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); }
1
2
  import * as React from "react";
2
3
  import { Animated, StyleSheet, View } from "react-native";
3
4
  import shadow from "../styles/shadow";
@@ -18,20 +19,7 @@ const Elevation = _ref => {
18
19
  colors
19
20
  } = theme;
20
21
  const borderRadius = radius;
21
- return /*#__PURE__*/React.createElement(Animated.View, {
22
- ...rest,
23
- style: [{
24
- borderRadius,
25
- backgroundColor: colors.surface
26
- }, elevation ? shadow(elevation) : null, style]
27
- }, /*#__PURE__*/React.createElement(View, {
28
- style: {
29
- overflow: "hidden",
30
- borderRadius
31
- }
32
- }, children));
33
- };
34
- export default withTheme(Elevation);React.createElement(Animated.View, _extends({}, rest, {
22
+ return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
35
23
  style: [{
36
24
  borderRadius,
37
25
  backgroundColor: colors.surface
@@ -6,4 +6,5 @@ const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo !== null && expo !== void 0 && expo.C
6
6
  export const APPROX_STATUSBAR_HEIGHT = Platform.select({
7
7
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
8
8
  ios: Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
9
+ });O : 0
9
10
  });
@@ -10,7 +10,6 @@ export { default as AvatarEdit } from "./components/AvatarEdit";
10
10
  export { default as Card } from "./components/Card";
11
11
  export { Checkbox, CheckboxGroup, CheckboxRow } from "./components/Checkbox";
12
12
  export { default as CircleImage } from "./components/CircleImage";
13
- export { default as Container } from "./components/Container";
14
13
  export { default as Divider } from "./components/Divider";
15
14
  export { default as FAB } from "./components/FAB";
16
15
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createTextEnumProp, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, StylesPanelSections } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, StylesPanelSections, createStaticBoolProp } from "@draftbit/types";
2
2
  const SHARED_SEED_DATA = {
3
3
  category: COMPONENT_TYPES.layout,
4
4
  packageName: "native-base",
@@ -39,9 +39,10 @@ export const SEED_DATA = [{
39
39
  tag: "Container",
40
40
  description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
41
41
  props: {
42
- centerContent: createBoolProp({
42
+ centerContent: createStaticBoolProp({
43
43
  label: "Center content",
44
- description: "Center child elements based on their content width"
44
+ description: "Center child elements based on their content width",
45
+ defaultValue: true
45
46
  })
46
47
  },
47
48
  ...SHARED_SEED_DATA
@@ -65,24 +66,17 @@ export const SEED_DATA = [{
65
66
  name: "Spacer",
66
67
  tag: "Spacer",
67
68
  description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
69
+ layout: {
70
+ flex: 1
71
+ },
68
72
  ...SHARED_SEED_DATA,
69
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
73
+ stylesPanelSections: [StylesPanelSections.LayoutSelectedItem, StylesPanelSections.Background, StylesPanelSections.Margins]
70
74
  }, {
71
75
  name: "Stack",
72
76
  tag: "Stack",
73
77
  description: "Stack aligns items vertically or horizontally based on the direction prop",
74
78
  ...SHARED_SEED_DATA,
75
79
  props: {
76
- direction: createTextEnumProp({
77
- label: "Direction",
78
- description: "The direction of the Stack",
79
- options: ["row", "column"],
80
- defaultValue: "column"
81
- }),
82
- reversed: createBoolProp({
83
- label: "Reversed",
84
- description: "Determines whether to reverse the direction of items"
85
- }),
86
80
  isDisabled: createBoolProp({
87
81
  label: "Disabled",
88
82
  description: "If true, the Stack will be disabled"
@@ -10,7 +10,6 @@ export { default as AvatarEdit } from "./components/AvatarEdit";
10
10
  export { default as Card } from "./components/Card";
11
11
  export { Checkbox, CheckboxGroup, CheckboxRow } from "./components/Checkbox";
12
12
  export { default as CircleImage } from "./components/CircleImage";
13
- export { default as Container } from "./components/Container";
14
13
  export { default as Divider } from "./components/Divider";
15
14
  export { default as FAB } from "./components/FAB";
16
15
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC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@@ export declare const SEED_DATA: ({
12
12
  step: number;
13
13
  };
14
14
  centerContent?: undefined;
15
- direction?: undefined;
16
- reversed?: undefined;
17
15
  isDisabled?: undefined;
18
16
  isInvalid?: undefined;
17
+ reversed?: undefined;
19
18
  };
20
19
  category: string;
21
20
  packageName: string;
@@ -49,10 +48,9 @@ export declare const SEED_DATA: ({
49
48
  group: string;
50
49
  };
51
50
  ratio?: undefined;
52
- direction?: undefined;
53
- reversed?: undefined;
54
51
  isDisabled?: undefined;
55
52
  isInvalid?: undefined;
53
+ reversed?: undefined;
56
54
  };
57
55
  } | {
58
56
  category: string;
@@ -63,30 +61,21 @@ export declare const SEED_DATA: ({
63
61
  description: string;
64
62
  layout: {
65
63
  flexDirection: string;
64
+ flex?: undefined;
65
+ };
66
+ } | {
67
+ stylesPanelSections: string[];
68
+ category: string;
69
+ packageName: string;
70
+ name: string;
71
+ tag: string;
72
+ description: string;
73
+ layout: {
74
+ flex: number;
75
+ flexDirection?: undefined;
66
76
  };
67
77
  } | {
68
78
  props: {
69
- direction: {
70
- group: string;
71
- label: string;
72
- description: string;
73
- editable: boolean;
74
- required: boolean;
75
- formType: string;
76
- propType: string;
77
- defaultValue: null;
78
- options: never[];
79
- };
80
- reversed: {
81
- label: string;
82
- description: string;
83
- formType: string;
84
- propType: string;
85
- defaultValue: boolean;
86
- editable: boolean;
87
- required: boolean;
88
- group: string;
89
- };
90
79
  isDisabled: {
91
80
  label: string;
92
81
  description: string;
@@ -109,6 +98,7 @@ export declare const SEED_DATA: ({
109
98
  };
110
99
  ratio?: undefined;
111
100
  centerContent?: undefined;
101
+ reversed?: undefined;
112
102
  };
113
103
  category: string;
114
104
  packageName: string;
@@ -130,7 +120,6 @@ export declare const SEED_DATA: ({
130
120
  };
131
121
  ratio?: undefined;
132
122
  centerContent?: undefined;
133
- direction?: undefined;
134
123
  isDisabled?: undefined;
135
124
  isInvalid?: undefined;
136
125
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/mappings/NativeBase/Layout.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoHrB,CAAC"}
1
+ {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/mappings/NativeBase/Layout.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkHrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.10.3-877a3f.2+877a3fa",
3
+ "version": "46.10.3-b95a8c.2+b95a8c9",
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.10.3-877a3f.2+877a3fa",
44
+ "@draftbit/types": "^46.10.3-b95a8c.2+b95a8c9",
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",
@@ -100,5 +100,5 @@
100
100
  ]
101
101
  ]
102
102
  },
103
- "gitHead": "877a3fa2568c2a8c87bcac685df23e35a69f883e"
103
+ "gitHead": "b95a8c9af2632eb49492cc095634fd4c6b5b19de"
104
104
  }
package/src/index.js CHANGED
@@ -10,7 +10,6 @@ export { default as AvatarEdit } from "./components/AvatarEdit";
10
10
  export { default as Card } from "./components/Card";
11
11
  export { Checkbox, CheckboxGroup, CheckboxRow } from "./components/Checkbox";
12
12
  export { default as CircleImage } from "./components/CircleImage";
13
- export { default as Container } from "./components/Container";
14
13
  export { default as Divider } from "./components/Divider";
15
14
  export { default as FAB } from "./components/FAB";
16
15
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
package/src/index.tsx CHANGED
@@ -11,7 +11,6 @@ export { default as AvatarEdit } from "./components/AvatarEdit";
11
11
  export { default as Card } from "./components/Card";
12
12
  export { Checkbox, CheckboxGroup, CheckboxRow } from "./components/Checkbox";
13
13
  export { default as CircleImage } from "./components/CircleImage";
14
- export { default as Container } from "./components/Container";
15
14
  export { default as Divider } from "./components/Divider";
16
15
  export { default as FAB } from "./components/FAB";
17
16
  export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createTextEnumProp, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, StylesPanelSections, createStaticBoolProp, } from "@draftbit/types";
2
2
  const SHARED_SEED_DATA = {
3
3
  category: COMPONENT_TYPES.layout,
4
4
  packageName: "native-base",
@@ -45,9 +45,10 @@ export const SEED_DATA = [
45
45
  tag: "Container",
46
46
  description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
47
47
  props: {
48
- centerContent: createBoolProp({
48
+ centerContent: createStaticBoolProp({
49
49
  label: "Center content",
50
50
  description: "Center child elements based on their content width",
51
+ defaultValue: true,
51
52
  }),
52
53
  },
53
54
  ...SHARED_SEED_DATA,
@@ -74,8 +75,15 @@ export const SEED_DATA = [
74
75
  name: "Spacer",
75
76
  tag: "Spacer",
76
77
  description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
78
+ layout: {
79
+ flex: 1,
80
+ },
77
81
  ...SHARED_SEED_DATA,
78
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
82
+ stylesPanelSections: [
83
+ StylesPanelSections.LayoutSelectedItem,
84
+ StylesPanelSections.Background,
85
+ StylesPanelSections.Margins,
86
+ ],
79
87
  },
80
88
  {
81
89
  name: "Stack",
@@ -83,16 +91,6 @@ export const SEED_DATA = [
83
91
  description: "Stack aligns items vertically or horizontally based on the direction prop",
84
92
  ...SHARED_SEED_DATA,
85
93
  props: {
86
- direction: createTextEnumProp({
87
- label: "Direction",
88
- description: "The direction of the Stack",
89
- options: ["row", "column"],
90
- defaultValue: "column",
91
- }),
92
- reversed: createBoolProp({
93
- label: "Reversed",
94
- description: "Determines whether to reverse the direction of items",
95
- }),
96
94
  isDisabled: createBoolProp({
97
95
  label: "Disabled",
98
96
  description: "If true, the Stack will be disabled",
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  COMPONENT_TYPES,
3
- createTextEnumProp,
4
3
  createBoolProp,
5
4
  CONTAINER_COMPONENT_STYLES_SECTIONS,
6
5
  createStaticNumberProp,
7
6
  StylesPanelSections,
7
+ createStaticBoolProp,
8
8
  } from "@draftbit/types";
9
9
 
10
10
  const SHARED_SEED_DATA = {
@@ -64,9 +64,10 @@ export const SEED_DATA = [
64
64
  description:
65
65
  "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
66
66
  props: {
67
- centerContent: createBoolProp({
67
+ centerContent: createStaticBoolProp({
68
68
  label: "Center content",
69
69
  description: "Center child elements based on their content width",
70
+ defaultValue: true,
70
71
  }),
71
72
  },
72
73
  ...SHARED_SEED_DATA,
@@ -94,8 +95,15 @@ export const SEED_DATA = [
94
95
  tag: "Spacer",
95
96
  description:
96
97
  "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
98
+ layout: {
99
+ flex: 1,
100
+ },
97
101
  ...SHARED_SEED_DATA,
98
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
102
+ stylesPanelSections: [
103
+ StylesPanelSections.LayoutSelectedItem,
104
+ StylesPanelSections.Background,
105
+ StylesPanelSections.Margins,
106
+ ],
99
107
  },
100
108
  {
101
109
  name: "Stack",
@@ -104,16 +112,6 @@ export const SEED_DATA = [
104
112
  "Stack aligns items vertically or horizontally based on the direction prop",
105
113
  ...SHARED_SEED_DATA,
106
114
  props: {
107
- direction: createTextEnumProp({
108
- label: "Direction",
109
- description: "The direction of the Stack",
110
- options: ["row", "column"],
111
- defaultValue: "column",
112
- }),
113
- reversed: createBoolProp({
114
- label: "Reversed",
115
- description: "Determines whether to reverse the direction of items",
116
- }),
117
115
  isDisabled: createBoolProp({
118
116
  label: "Disabled",
119
117
  description: "If true, the Stack will be disabled",
@@ -1,93 +0,0 @@
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 _theming = require("../theming");
10
- var _Elevation = _interopRequireDefault(require("./Elevation"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- 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); }
13
- 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; }
14
- 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); }
15
- const Container = _ref => {
16
- let {
17
- useThemeGutterPadding,
18
- borderColor,
19
- borderWidth,
20
- backgroundColor,
21
- backgroundImage,
22
- backgroundImageResizeMode,
23
- elevation,
24
- style,
25
- children,
26
- theme,
27
- // eslint-disable-line @typescript-eslint/no-unused-vars
28
- ...rest
29
- } = _ref;
30
- const {
31
- flex,
32
- flexGrow,
33
- flexWrap,
34
- flexBasis,
35
- flexShrink,
36
- flexDirection,
37
- alignContent,
38
- justifyContent,
39
- alignItems,
40
- padding,
41
- paddingTop,
42
- paddingBottom,
43
- paddingLeft,
44
- paddingRight,
45
- paddingVertical,
46
- paddingHorizontal,
47
- ...styleProp
48
- } = _reactNative.StyleSheet.flatten(style) || {};
49
- const containerStyle = {
50
- backgroundColor,
51
- borderColor,
52
- borderWidth,
53
- width: "100%",
54
- ...styleProp
55
- };
56
- const innerStyle = {
57
- flex,
58
- flexGrow,
59
- flexWrap,
60
- flexBasis,
61
- flexShrink,
62
- flexDirection,
63
- alignContent,
64
- justifyContent,
65
- alignItems,
66
- padding,
67
- paddingTop,
68
- paddingBottom,
69
- paddingLeft,
70
- paddingRight,
71
- paddingVertical,
72
- paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0
73
- };
74
- const Wrap = elevation ? _Elevation.default : _reactNative.View;
75
- if (elevation) containerStyle.elevation = elevation;
76
- return /*#__PURE__*/React.createElement(Wrap, _extends({
77
- style: [containerStyle, style]
78
- }, rest), backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
79
- source: typeof backgroundImage === "string" ? {
80
- uri: backgroundImage
81
- } : backgroundImage,
82
- resizeMode: backgroundImageResizeMode,
83
- style: {
84
- flex: 1
85
- }
86
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
87
- style: innerStyle
88
- }, children)) : /*#__PURE__*/React.createElement(_reactNative.View, {
89
- style: innerStyle
90
- }, children));
91
- };
92
- var _default = (0, _theming.withTheme)(Container);
93
- exports.default = _default;
@@ -1,37 +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: "Container",
10
- tag: "Container",
11
- description: "A container component with gutter padding",
12
- category: _types.COMPONENT_TYPES.deprecated,
13
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
14
- layout: {
15
- height: 250
16
- },
17
- props: {
18
- useThemeGutterPadding: {
19
- group: _types.GROUPS.basic,
20
- label: "Use gutter padding",
21
- description: "When true, uses the theme gutter spacing as the container's horizontal padding",
22
- formType: _types.FORM_TYPES.boolean,
23
- propType: _types.PROP_TYPES.BOOLEAN,
24
- defaultValue: false,
25
- editable: false,
26
- required: true
27
- },
28
- backgroundImage: (0, _types.createImageProp)({
29
- label: "Background Image",
30
- description: "Apply a custom background image",
31
- defaultValue: null
32
- }),
33
- backgroundImageResizeMode: (0, _types.createResizeModeProp)(),
34
- elevation: (0, _types.createElevationType)(0)
35
- }
36
- };
37
- exports.SEED_DATA = SEED_DATA;
@@ -1,83 +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 * as React from "react";
3
- import { View, ImageBackground, StyleSheet } from "react-native";
4
- import { withTheme } from "../theming";
5
- import Elevation from "./Elevation";
6
- const Container = _ref => {
7
- let {
8
- useThemeGutterPadding,
9
- borderColor,
10
- borderWidth,
11
- backgroundColor,
12
- backgroundImage,
13
- backgroundImageResizeMode,
14
- elevation,
15
- style,
16
- children,
17
- theme,
18
- // eslint-disable-line @typescript-eslint/no-unused-vars
19
- ...rest
20
- } = _ref;
21
- const {
22
- flex,
23
- flexGrow,
24
- flexWrap,
25
- flexBasis,
26
- flexShrink,
27
- flexDirection,
28
- alignContent,
29
- justifyContent,
30
- alignItems,
31
- padding,
32
- paddingTop,
33
- paddingBottom,
34
- paddingLeft,
35
- paddingRight,
36
- paddingVertical,
37
- paddingHorizontal,
38
- ...styleProp
39
- } = StyleSheet.flatten(style) || {};
40
- const containerStyle = {
41
- backgroundColor,
42
- borderColor,
43
- borderWidth,
44
- width: "100%",
45
- ...styleProp
46
- };
47
- const innerStyle = {
48
- flex,
49
- flexGrow,
50
- flexWrap,
51
- flexBasis,
52
- flexShrink,
53
- flexDirection,
54
- alignContent,
55
- justifyContent,
56
- alignItems,
57
- padding,
58
- paddingTop,
59
- paddingBottom,
60
- paddingLeft,
61
- paddingRight,
62
- paddingVertical,
63
- paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0
64
- };
65
- const Wrap = elevation ? Elevation : View;
66
- if (elevation) containerStyle.elevation = elevation;
67
- return /*#__PURE__*/React.createElement(Wrap, _extends({
68
- style: [containerStyle, style]
69
- }, rest), backgroundImage ? /*#__PURE__*/React.createElement(ImageBackground, {
70
- source: typeof backgroundImage === "string" ? {
71
- uri: backgroundImage
72
- } : backgroundImage,
73
- resizeMode: backgroundImageResizeMode,
74
- style: {
75
- flex: 1
76
- }
77
- }, /*#__PURE__*/React.createElement(View, {
78
- style: innerStyle
79
- }, children)) : /*#__PURE__*/React.createElement(View, {
80
- style: innerStyle
81
- }, children));
82
- };
83
- export default withTheme(Container);
@@ -1,30 +0,0 @@
1
- import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, createElevationType, createImageProp, createResizeModeProp, CONTAINER_COMPONENT_STYLES_SECTIONS } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Container",
4
- tag: "Container",
5
- description: "A container component with gutter padding",
6
- category: COMPONENT_TYPES.deprecated,
7
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
- layout: {
9
- height: 250
10
- },
11
- props: {
12
- useThemeGutterPadding: {
13
- group: GROUPS.basic,
14
- label: "Use gutter padding",
15
- description: "When true, uses the theme gutter spacing as the container's horizontal padding",
16
- formType: FORM_TYPES.boolean,
17
- propType: PROP_TYPES.BOOLEAN,
18
- defaultValue: false,
19
- editable: false,
20
- required: true
21
- },
22
- backgroundImage: createImageProp({
23
- label: "Background Image",
24
- description: "Apply a custom background image",
25
- defaultValue: null
26
- }),
27
- backgroundImageResizeMode: createResizeModeProp(),
28
- elevation: createElevationType(0)
29
- }
30
- };
@@ -1,21 +0,0 @@
1
- import * as React from "react";
2
- import { ImageSourcePropType, StyleProp, ViewStyle } from "react-native";
3
- import type { Theme } from "../styles/DefaultTheme";
4
- import { ResizeModeType } from "./ResizeMode";
5
- declare type Props = {
6
- theme: Theme;
7
- useThemeGutterPadding: boolean;
8
- borderColor: string;
9
- borderWidth: number;
10
- backgroundColor: string;
11
- backgroundImage?: string | ImageSourcePropType;
12
- backgroundImageResizeMode?: ResizeModeType;
13
- elevation?: number;
14
- style?: StyleProp<ViewStyle>;
15
- children?: React.ReactNode;
16
- };
17
- declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
18
- theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
19
- }> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
20
- export default _default;
21
- //# sourceMappingURL=Container.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/components/Container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,mBAAmB,EACnB,SAAS,EAET,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,aAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC/C,yBAAyB,CAAC,EAAE,cAAc,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;;;;AAyFF,wBAAoC"}
@@ -1,55 +0,0 @@
1
- export declare const SEED_DATA: {
2
- name: string;
3
- tag: string;
4
- description: string;
5
- category: string;
6
- stylesPanelSections: string[];
7
- layout: {
8
- height: number;
9
- };
10
- props: {
11
- useThemeGutterPadding: {
12
- group: string;
13
- label: string;
14
- description: string;
15
- formType: string;
16
- propType: string;
17
- defaultValue: boolean;
18
- editable: boolean;
19
- required: boolean;
20
- };
21
- backgroundImage: {
22
- label: string;
23
- description: string;
24
- group: string;
25
- formType: string;
26
- propType: string;
27
- defaultValue: string;
28
- editable: boolean;
29
- required: boolean;
30
- };
31
- backgroundImageResizeMode: {
32
- group: string;
33
- label: string;
34
- description: string;
35
- editable: boolean;
36
- required: boolean;
37
- defaultValue: string;
38
- formType: string;
39
- propType: string;
40
- options: string[];
41
- };
42
- elevation: {
43
- defaultValue: any;
44
- label: string;
45
- description: string;
46
- formType: string;
47
- propType: string;
48
- options: number[];
49
- editable: boolean;
50
- required: boolean;
51
- group: string;
52
- };
53
- };
54
- };
55
- //# sourceMappingURL=Container.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Container.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BrB,CAAC"}
@@ -1,43 +0,0 @@
1
- import * as React from "react";
2
- import { View, ImageBackground, StyleSheet, } from "react-native";
3
- import { withTheme } from "../theming";
4
- import Elevation from "./Elevation";
5
- const Container = ({ useThemeGutterPadding, borderColor, borderWidth, backgroundColor, backgroundImage, backgroundImageResizeMode, elevation, style, children, theme, // eslint-disable-line @typescript-eslint/no-unused-vars
6
- ...rest }) => {
7
- const { flex, flexGrow, flexWrap, flexBasis, flexShrink, flexDirection, alignContent, justifyContent, alignItems, padding, paddingTop, paddingBottom, paddingLeft, paddingRight, paddingVertical, paddingHorizontal, ...styleProp } = StyleSheet.flatten(style) || {};
8
- const containerStyle = {
9
- backgroundColor,
10
- borderColor,
11
- borderWidth,
12
- width: "100%",
13
- ...styleProp,
14
- };
15
- const innerStyle = {
16
- flex,
17
- flexGrow,
18
- flexWrap,
19
- flexBasis,
20
- flexShrink,
21
- flexDirection,
22
- alignContent,
23
- justifyContent,
24
- alignItems,
25
- padding,
26
- paddingTop,
27
- paddingBottom,
28
- paddingLeft,
29
- paddingRight,
30
- paddingVertical,
31
- paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0,
32
- };
33
- const Wrap = elevation ? Elevation : View;
34
- if (elevation)
35
- containerStyle.elevation = elevation;
36
- return (React.createElement(Wrap, { style: [containerStyle, style], ...rest }, backgroundImage ? (React.createElement(ImageBackground, { source: typeof backgroundImage === "string"
37
- ? { uri: backgroundImage }
38
- : backgroundImage, resizeMode: backgroundImageResizeMode, style: {
39
- flex: 1,
40
- } },
41
- React.createElement(View, { style: innerStyle }, children))) : (React.createElement(View, { style: innerStyle }, children))));
42
- };
43
- export default withTheme(Container);
@@ -1,116 +0,0 @@
1
- import * as React from "react";
2
- import {
3
- View,
4
- ImageBackground,
5
- ImageSourcePropType,
6
- StyleProp,
7
- StyleSheet,
8
- ViewStyle,
9
- } from "react-native";
10
- import { withTheme } from "../theming";
11
-
12
- import Elevation from "./Elevation";
13
- import type { Theme } from "../styles/DefaultTheme";
14
- import { ResizeModeType } from "./ResizeMode";
15
-
16
- type Props = {
17
- theme: Theme;
18
- useThemeGutterPadding: boolean;
19
- borderColor: string;
20
- borderWidth: number;
21
- backgroundColor: string;
22
- backgroundImage?: string | ImageSourcePropType;
23
- backgroundImageResizeMode?: ResizeModeType;
24
- elevation?: number;
25
- style?: StyleProp<ViewStyle>;
26
- children?: React.ReactNode;
27
- };
28
-
29
- const Container: React.FC<React.PropsWithChildren<Props>> = ({
30
- useThemeGutterPadding,
31
- borderColor,
32
- borderWidth,
33
- backgroundColor,
34
- backgroundImage,
35
- backgroundImageResizeMode,
36
- elevation,
37
- style,
38
- children,
39
- theme, // eslint-disable-line @typescript-eslint/no-unused-vars
40
- ...rest
41
- }) => {
42
- const {
43
- flex,
44
- flexGrow,
45
- flexWrap,
46
- flexBasis,
47
- flexShrink,
48
- flexDirection,
49
- alignContent,
50
- justifyContent,
51
- alignItems,
52
- padding,
53
- paddingTop,
54
- paddingBottom,
55
- paddingLeft,
56
- paddingRight,
57
- paddingVertical,
58
- paddingHorizontal,
59
- ...styleProp
60
- } = StyleSheet.flatten(style) || {};
61
-
62
- const containerStyle: StyleProp<ViewStyle> = {
63
- backgroundColor,
64
- borderColor,
65
- borderWidth,
66
- width: "100%",
67
- ...styleProp,
68
- };
69
-
70
- const innerStyle: StyleProp<ViewStyle> = {
71
- flex,
72
- flexGrow,
73
- flexWrap,
74
- flexBasis,
75
- flexShrink,
76
- flexDirection,
77
- alignContent,
78
- justifyContent,
79
- alignItems,
80
- padding,
81
- paddingTop,
82
- paddingBottom,
83
- paddingLeft,
84
- paddingRight,
85
- paddingVertical,
86
- paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0,
87
- };
88
-
89
- const Wrap = elevation ? Elevation : View;
90
-
91
- if (elevation) containerStyle.elevation = elevation;
92
-
93
- return (
94
- <Wrap style={[containerStyle, style]} {...rest}>
95
- {backgroundImage ? (
96
- <ImageBackground
97
- source={
98
- typeof backgroundImage === "string"
99
- ? { uri: backgroundImage }
100
- : backgroundImage
101
- }
102
- resizeMode={backgroundImageResizeMode}
103
- style={{
104
- flex: 1,
105
- }}
106
- >
107
- <View style={innerStyle}>{children}</View>
108
- </ImageBackground>
109
- ) : (
110
- <View style={innerStyle}>{children}</View>
111
- )}
112
- </Wrap>
113
- );
114
- };
115
-
116
- export default withTheme(Container);
@@ -1,30 +0,0 @@
1
- import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, createElevationType, createImageProp, createResizeModeProp, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
2
- export const SEED_DATA = {
3
- name: "Container",
4
- tag: "Container",
5
- description: "A container component with gutter padding",
6
- category: COMPONENT_TYPES.deprecated,
7
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
- layout: {
9
- height: 250,
10
- },
11
- props: {
12
- useThemeGutterPadding: {
13
- group: GROUPS.basic,
14
- label: "Use gutter padding",
15
- description: "When true, uses the theme gutter spacing as the container's horizontal padding",
16
- formType: FORM_TYPES.boolean,
17
- propType: PROP_TYPES.BOOLEAN,
18
- defaultValue: false,
19
- editable: false,
20
- required: true,
21
- },
22
- backgroundImage: createImageProp({
23
- label: "Background Image",
24
- description: "Apply a custom background image",
25
- defaultValue: null,
26
- }),
27
- backgroundImageResizeMode: createResizeModeProp(),
28
- elevation: createElevationType(0),
29
- },
30
- };
@@ -1,41 +0,0 @@
1
- import {
2
- GROUPS,
3
- COMPONENT_TYPES,
4
- FORM_TYPES,
5
- PROP_TYPES,
6
- createElevationType,
7
- createImageProp,
8
- createResizeModeProp,
9
- CONTAINER_COMPONENT_STYLES_SECTIONS,
10
- } from "@draftbit/types";
11
-
12
- export const SEED_DATA = {
13
- name: "Container",
14
- tag: "Container",
15
- description: "A container component with gutter padding",
16
- category: COMPONENT_TYPES.deprecated,
17
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
18
- layout: {
19
- height: 250,
20
- },
21
- props: {
22
- useThemeGutterPadding: {
23
- group: GROUPS.basic,
24
- label: "Use gutter padding",
25
- description:
26
- "When true, uses the theme gutter spacing as the container's horizontal padding",
27
- formType: FORM_TYPES.boolean,
28
- propType: PROP_TYPES.BOOLEAN,
29
- defaultValue: false,
30
- editable: false,
31
- required: true,
32
- },
33
- backgroundImage: createImageProp({
34
- label: "Background Image",
35
- description: "Apply a custom background image",
36
- defaultValue: null,
37
- }),
38
- backgroundImageResizeMode: createResizeModeProp(),
39
- elevation: createElevationType(0),
40
- },
41
- };