@draftbit/core 46.6.8-80070f.2 → 46.6.9-ac42c5.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.
@@ -12,7 +12,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
 
13
13
  const isAnimatedValue = it => it instanceof _reactNative.Animated.Value;
14
14
  function overlay(elevation) {
15
- let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
15
+ var _DarkTheme$colors;
16
+ let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_DarkTheme$colors = _DarkTheme.default.colors) === null || _DarkTheme$colors === void 0 ? void 0 : _DarkTheme$colors.surface;
16
17
  if (isAnimatedValue(elevation)) {
17
18
  const inputRange = [0, 1, 2, 3, 8, 24];
18
19
 
@@ -1,5 +1,8 @@
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 { View } from "react-native";
4
+ // @ts-ignore
5
+
3
6
  export function Center(_ref) {
4
7
  let {
5
8
  width = 240,
@@ -9,16 +12,15 @@ export function Center(_ref) {
9
12
  style,
10
13
  ...rest
11
14
  } = _ref;
12
- return /*#__PURE__*/React.createElement(View, {
15
+ return /*#__PURE__*/React.createElement(View, _extends({
13
16
  style: [{
14
17
  justifyContent: "center",
15
18
  alignItems: "center",
16
19
  width,
17
20
  height,
18
21
  backgroundColor: bgColor
19
- }, style],
20
- ...rest
21
- }, children);
22
+ }, style]
23
+ }, rest), children);
22
24
  }
23
25
  export function Circle(_ref2) {
24
26
  let {
@@ -29,7 +31,7 @@ export function Circle(_ref2) {
29
31
  ...rest
30
32
  } = _ref2;
31
33
  const borderRadius = 1000;
32
- return /*#__PURE__*/React.createElement(Center, {
34
+ return /*#__PURE__*/React.createElement(Center, _extends({
33
35
  width: size,
34
36
  height: size,
35
37
  bgColor: bgColor,
@@ -37,9 +39,8 @@ export function Circle(_ref2) {
37
39
  backgroundColor: bgColor,
38
40
  borderRadius,
39
41
  overflow: "hidden"
40
- }],
41
- ...rest
42
- }, children);
42
+ }]
43
+ }, rest), children);
43
44
  }
44
45
  export function Square(_ref3) {
45
46
  let {
@@ -49,13 +50,12 @@ export function Square(_ref3) {
49
50
  style,
50
51
  ...rest
51
52
  } = _ref3;
52
- return /*#__PURE__*/React.createElement(Center, {
53
+ return /*#__PURE__*/React.createElement(Center, _extends({
53
54
  style: style,
54
55
  width: size,
55
56
  height: size,
56
- bgColor: bgColor,
57
- ...rest
58
- }, children);
57
+ bgColor: bgColor
58
+ }, rest), children);
59
59
  }
60
60
  export function Row(_ref4) {
61
61
  let {
@@ -65,14 +65,15 @@ export function Row(_ref4) {
65
65
  style,
66
66
  ...rest
67
67
  } = _ref4;
68
- return /*#__PURE__*/React.createElement(View, {
69
- style: [style, {
68
+ return /*#__PURE__*/React.createElement(View, _extends({
69
+ style: [style,
70
+ // style goes first b/c we can't override these
71
+ {
70
72
  alignItems,
71
73
  flexDirection: "row",
72
74
  justifyContent: justifyContent
73
- }],
74
- ...rest
75
- }, children);
75
+ }]
76
+ }, rest), children);
76
77
  }
77
78
  export function Spacer(_ref5) {
78
79
  let {
@@ -84,36 +85,14 @@ export function Spacer(_ref5) {
84
85
  style,
85
86
  ...rest
86
87
  } = _ref5;
87
- return /*#__PURE__*/React.createElement(View, {
88
+ return /*#__PURE__*/React.createElement(View, _extends({
88
89
  style: [style, {
89
90
  paddingRight: right,
90
91
  paddingTop: top,
91
92
  paddingLeft: left,
92
93
  paddingBottom: bottom
93
- }],
94
- ...rest
95
- }, children);
96
- }
97
- export function Stack(_ref6) {
98
- let {
99
- children,
100
- justifyContent = "flex-start",
101
- alignItems = "flex-start",
102
- style,
103
- ...rest
104
- } = _ref6;
105
- return (
106
- /*#__PURE__*/
107
- // style must go first since we don't want justifyContent, alignItems overridden
108
- React.createElement(View, {
109
- style: [style, {
110
- justifyContent,
111
- alignItems
112
- }],
113
- ...rest
114
- }, children)
115
- );
116
- }hildren);
94
+ }]
95
+ }, rest), children);
117
96
  }
118
97
  export function Stack(_ref6) {
119
98
  let {
@@ -4,7 +4,8 @@ import { Animated } from "react-native";
4
4
  import DarkTheme from "./DarkTheme";
5
5
  const isAnimatedValue = it => it instanceof Animated.Value;
6
6
  export default function overlay(elevation) {
7
- let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DarkTheme.colors.surface;
7
+ var _DarkTheme$colors;
8
+ let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_DarkTheme$colors = DarkTheme.colors) === null || _DarkTheme$colors === void 0 ? void 0 : _DarkTheme$colors.surface;
8
9
  if (isAnimatedValue(elevation)) {
9
10
  const inputRange = [0, 1, 2, 3, 8, 24];
10
11
 
@@ -1,3 +1,3 @@
1
1
  import { Animated } from "react-native";
2
- export default function overlay<T extends Animated.Value | number>(elevation: T, surfaceColor?: string): T extends number ? string : Animated.AnimatedInterpolation;
2
+ export default function overlay<T extends Animated.Value | number>(elevation: T, surfaceColor?: string): T extends number ? string : Animated.AnimatedInterpolation<number | string>;
3
3
  //# sourceMappingURL=overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/styles/overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,GAAG,MAAM,EAC/D,SAAS,EAAE,CAAC,EACZ,YAAY,GAAE,MAAiC,GAC9C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,qBAAqB,CAe5D"}
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/styles/overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,GAAG,MAAM,EAC/D,SAAS,EAAE,CAAC,EACZ,YAAY,GAAE,MAAkC,GAC/C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,qBAAqB,CAAC,MAAM,GAAG,MAAM,CAAC,CAe7E"}
@@ -3,10 +3,10 @@ export default function shadow(elevation?: number | Animated.Value): {
3
3
  shadowColor: string;
4
4
  shadowOffset: {
5
5
  width: Animated.Value;
6
- height: Animated.AnimatedInterpolation;
6
+ height: Animated.AnimatedInterpolation<string | number>;
7
7
  };
8
8
  shadowOpacity: Animated.Value;
9
- shadowRadius: Animated.AnimatedInterpolation;
9
+ shadowRadius: Animated.AnimatedInterpolation<string | number>;
10
10
  } | {
11
11
  shadowColor?: undefined;
12
12
  shadowOffset?: undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.6.8-80070f.2+80070f9",
3
+ "version": "46.6.9-ac42c5.2+ac42c57",
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.6.8-80070f.2+80070f9",
44
+ "@draftbit/types": "^46.6.9-ac42c5.2+ac42c57",
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",
@@ -91,5 +91,5 @@
91
91
  ]
92
92
  ]
93
93
  },
94
- "gitHead": "80070f9be3c7f65c45269eedba259186e054bdf3"
94
+ "gitHead": "ac42c57c5e41a92853c296f890b7f1b4b220af98"
95
95
  }
@@ -3,7 +3,9 @@ import color from "color";
3
3
  import { Animated } from "react-native";
4
4
  import DarkTheme from "./DarkTheme";
5
5
  const isAnimatedValue = (it) => it instanceof Animated.Value;
6
- export default function overlay(elevation, surfaceColor = DarkTheme.colors.surface) {
6
+ export default function overlay(elevation, surfaceColor) {
7
+ var _a;
8
+ if (surfaceColor === void 0) { surfaceColor = (_a = DarkTheme.colors) === null || _a === void 0 ? void 0 : _a.surface; }
7
9
  if (isAnimatedValue(elevation)) {
8
10
  const inputRange = [0, 1, 2, 3, 8, 24];
9
11
  // @ts-expect-error: TS doesn't seem to refine the type correctly
@@ -4,13 +4,13 @@ import { Animated } from "react-native";
4
4
  import DarkTheme from "./DarkTheme";
5
5
 
6
6
  const isAnimatedValue = (
7
- it: number | Animated.AnimatedInterpolation
7
+ it: number | string | Animated.AnimatedInterpolation<number | string>
8
8
  ): it is Animated.Value => it instanceof Animated.Value;
9
9
 
10
10
  export default function overlay<T extends Animated.Value | number>(
11
11
  elevation: T,
12
- surfaceColor: string = DarkTheme.colors.surface
13
- ): T extends number ? string : Animated.AnimatedInterpolation {
12
+ surfaceColor: string = DarkTheme.colors?.surface
13
+ ): T extends number ? string : Animated.AnimatedInterpolation<number | string> {
14
14
  if (isAnimatedValue(elevation)) {
15
15
  const inputRange = [0, 1, 2, 3, 8, 24];
16
16